GUI Builders (was: More On Multiple Inheritance)

Matthew Tuck matty@box.net.au
Sat, 13 Mar 1999 18:54:07 +1030


Hans-Dieter Dreier wrote:

<from a separate message>

>>> Example: The user decides that an edit field is no longer sufficient
>>> in some place and he want to replace that with a combo box (edit
>>> field + drop down list box), which is quite a different class. Here 
>>> it would be nice if he simply could change the object's class and
>>> all matching attributes (font, screen position, message handlers...)
>>> would migrate.  All attributes that have no equivalent in the new
>>> class would turn to comments (so the code is not lost in case it will
>>> be needed later on).

OK, in the light of what you said just below, this makes more sense.  A
lot depends on whether these properties are represented underneath by
methods (and I think they should be).  If so, the methods that will stay
are those that are in the most specific common subtype.

> Explanation: The term "template" is used here not in the C++ sense. It
> basically is a constructor call with some parameters already attached
> (editable in an outline). It resides as a member variable declaration
> inside some object and will be called as soon as that object is
> created. For example, a window may contain controls. Each control
> creation is done by declaring a control as a member variable of the
> window. The  editor supplies the outline for entering the
> constructor's parameters. Which parameters to use is determined by
> looking at the instance items' declarations of the control. If they
> are tagged as "properties", they are included. Some properties may be
> inherited from the parent (not the base class, but the window, in this
> case).  An example of property inheritance might be a font
> specification, or the background color. This allows to easily change
> them by just changing the property value of the parent. Look at
> Centura (or maybe at Delphi, but I'm not sure whether they support
> property inheritance).

OK, you're referring to a GUI editor, whereas I'm referring to GUI
classes.  So you have the window/panel/component hierachy inheritance
(which you could use for pop-up help too).  So do these editors allow
you to define a control that inherits the properties of another control?
 
> There are other (similar) ways to achive the same result. Instead of
> tagging the instance variables, one could specify the constructor to
> use along with the declaration. This would allow for multiple versions
> of templates and would also have the advantage of not introducing yet
> another keyword.

I'm not sure I understand what you mean.  Could you elaborate?

-- 
     Matthew Tuck - Software Developer & All-Round Nice Guy
             mailto:matty@box.net.au (ICQ #8125618)
       Check out the Ultra programming language project!
              http://www.box.net.au/~matty/ultra/