Could a wrapper do the trick?
Rene
Am 22.05.2011 04:29, schrieb Douglas G. Danforth:
Folks,
In the past I have used the Ctls modules by Juan Antonio Ortega, Helmut Zinn and Robert D Campbell.
I have even created a new control on my own (a Dial).
What I want to do now is simply modify a command button that is made available by Controls
(the standard BB module). All I want to do is to change it into a ToggleButton similar to what
I remember under Oberon System-3 where when you press the button it stays down until you
press it again (System-3 also had a little red square appear in the corner of the button when
it was down).
So, rather than start from scratch I would like to use the functionality of a command button but
change its behavior. How do I do that in the most general way?
I really do not want to copy all of the code for the command button which has links to many other
modules but rather *extend* or modify command button. Unfortunately a
Controls.PushButton is not exported and is not extensible.
So, I have attempted to do "mixin" by creating a new ToggleButton as an extension of
Controls.Control with two fields: button: Controls.Control and down: BOOLEAN;
However, when I deposit that control its Restore method (my added method) complains
when I attempt to restore the mixed in button
PROCEDURE (tb: ToggleButton) Restore (f: Frame; l, t, r, b: INTEGER);
BEGIN
tb.button.Restore(f, l, t, r, b)
END Restore;
It complains by saying the frame is not of the type StdCFrame (iirc) (the WITH statement
internally fails).
So I have a feeling I am looking at this all from the wrong point of view. I really don't want
to have to recreate the picture of a button with its sculpted edges all over again nor do I
want to have to do it when those edges change when the button is pushed.
So does anyone have a suggestion of how to do this?
-Doug Danforth
---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
Received on Sun May 22 2011 - 08:40:31 UTC