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

fGUI basics


Layout

The basic element of a fGUI user interface is the fObject class. All visual elements of the system are derived from that class. The elements are arranged using classes derived from fGroup, an instance of which is for example the fVerticalGroup class which arranges objects in a row. To arrange the objects these key elements are used:
  • minimum size
  • preferred size
  • maximum size
  • horizontal weight
  • vertical weight
Together these attributes allow the layout engine of the groups to assign each object a size within its size limits and depending on its weight it gets bigger or smaller than the other objects in the group.

In addition to the five basic attributes two more are needed for a correct layout:

  • horizontal alignment
  • vertical alignment
When a group is told by its parent to resize itself (passed down from the fView class which makes the connection from thew Be system to fGUI) it recalculates the new size and position of the objects according to these attributes and sets
  • current size
  • position
in every child it manages.

Enhanced Layout

A tiny bit of information is missing in the above description: Every object has a small border around it (by default 1.0 pixels) that belongs to the object but in which the object should not draw ! This border is necessary for cosmetic purposes only, otherwise the objects would be too close together.

You only need to remember that when you write your own classes derived from fObject, which normally isn't not necessary.

Drawing

The root of drawing is the fView class, it passes the Draw() calls it receives to the corresponding draw() method.Contrary to the Be philosophy not every object has its own drawing environment, each object is responsible for setting the parameters of the target BView according to its own needs.

Another possibility to draw is when an object has to react to an user input outside the regular call to draw(). This is used very often, for example in the fTextInput and the scrollbar classes.


The flexible GUI, in HTML for the BeOS Release 3.

Copyright © 1997-1998 Stegemann & Co. All rights reserved.

Last modified May 19, 1998.