Contents

What is fGUI ?

fGUI basics
The factory
Event model
Legal Issues
Things to do
History

Tree of classes
About

The classes

fApplication
fClassInfo
fColor
fGroup
fObject
fPoint

The flexible GUI: fGroup

Derived from: public fObject

Declared in: fGUI/fGroup.h

Library: fGUI.so


Overview

fGroup 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 Classes

As 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 Functions

In order to do a correct layout any group has to override some methods from fObject:
  • Either
    • recalculateSizeLimits
  • Or all three of
    • calculateMinimumSize
    • calculatePreferredSize
    • calculateMaximumSize
  • setSize
The former are used to calculate the minimum, preferred and maximum of all the objects in the group, respectively. These methods have to take the weights and size limits of the contained classes into account and have to apply the spacing (see below).

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 Destructor


fGroup()

	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) = 0
These 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) = 0
Sets 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) = 0
When 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.