Widgetry GroupBox as Subclass of ComponentPane?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Widgetry GroupBox as Subclass of ComponentPane?

Runar Jordahl
Wouldn't it be nice if GroupBox was a subclass of ComponentPane? Then
the group box would hold on to the other panes that are inside of it.
As it is now, the group box will not have any information about which
panes are inside it. The group box is simply a visual decoration on
its parent pane.

Just like the application user can visually group widgets by looking
at the group box, developers should be able to access the contents of
the group box. We should be able to move the group box *and* its
contents in the GUI editor and  pragmatically fetch all widgets inside
it. One example of when this is handy is when enabling and disabling a
group of related widgets.

Both Visual Studio (Containers) and Eclipse (SWT Composites) seems to
follow the idea of letting group box hold on to other widgets. Other
components like layout panels and splitters follow the same pattern
too. VA Smalltalk also follows this paradigm. Wrapper does not let
group boxes hold subcomponents, but I think there is available another
group box widget with this functionality.

It might be that it is better to keep the system like it is today.
What one can do is to embed all group boxes in a ComponentPane. Then
the parent of the group box (the component pane) will hold all widgets
in the group box (plus the group box itself). However, I doubt that
this approach will be widely used. Directly supporting this
functionality seems like a better approach to me.

Runar Jordahl