ContentsWhat is fGUI ?
fGUI basics The classesfApplicationfClassInfo fColor fGroup fObject fPoint |
The flexible GUI: fGroupDerived from: public fObject Declared in: fGUI/fGroup.h Library: fGUI.so
OverviewfGroup defines the interface for all clases that manage other objects. (There are a few exceptions from this rule, namely fTabItem and fScrollBar, see the documention of those for more details.)
Derived ClassesAs fGroup only defines the interface for groups derived classes have to implement all methods that are declared here. For most purposes it is much more convenient to inherit from fBaseGroup which defines all these methods and has an implementation for draw() that will fit most groups.
Hook FunctionsIn order to do a correct layout any group has to override some methods from fObject:
setSize finally does the actual layout. These methods are the most complex in fGUI, before you try to write your own have a look at that in fHorizontalGroup::setSize() to get an idea of how it has to be done correctly.
Constructor and DestructorfGroup()
fGroup( void)As fGroup is virtual the constructor cannot be called directly, only from derived classes.
~fGroup()
virtual ~fGroup( void)Should be implemented by derived classes to delete all children.
Member Functions
addObject(), insertObject(), insertObjectAfter(), insertObjectBefore(), removeObject()
virtual void addObject( fObject *NewObject) = 0 virtual void insertObject( fObject *NewObject, int32 Position = 0) = 0 virtual void insertObjectAfter( fObject *NewObject, fObject *OtherObject) = 0 virtual void insertObjectBefore( fObject *NewObject, fObject *OtherObject) = 0 virtual void removeObject( fObject *OldObject) = 0These mthods add and remove objects from the group. addObject() adds NewObject at the end of the list of objects, while insertObject() inserts it at the top of the list by default or at the Position's position. insertObjectAfter() inserts NewObject after OtherObject, insertObjectBefore() inserts NewObject before OtherObject. Finally removeObject() removes OldObject from the group. removeObject() does not delete the object. Once added to the group the objects become the groups responsibility, that means that the group is responsible for deleting the objects when the group is deleted.
setFrame()
virtual void setFrame( class fFrame *Frame) = 0Sets the frame the class should draw around itself. See the fFrame class and fBaseGroup::setFrame() and fBaseGroup::draw() for more details.
setSpacing()
virtual void setSpacing( float NewSpacing) = 0When groups arrange objects they will add space between the managed objects, otherwise the objects will be to close together. To counter this the group can add space between the objects, NewSpacing pixels between each object. See for an example fHorizontalGroup::setSize() of how this is done.
The flexible GUI, in HTML for the BeOS Release 3. Copyright © 1997-1998 Stegemann & Co. All rights reserved. Last modified May 19, 1998. |