ET++ Graphical Layout Management

ET++ performs automatic graphical layout through two mechanisms. First, for specifiying the layout of a single object in, it uses a VObjAlign type to specify multiple layout parameters (left/right flush, object should expand with container, etc.). For this layout method, the final layout is done using VObject::Align().

For more complex multi-element layouts like dialog boxes and grids, ET++ uses its CompositeVObject hierarchy. A CompositeVObject is a VObject which contains other VObjects. Box is a subclass of CompositeVObject, and implements two-dimensional grid-based layout. There are several subclasses of Box which simplify the implementation of complex Box structures:

ET++'s system of layout is reminiscent of Donald Knuth's box/fill layout approach, used in the TeX document creation system.

As an example which uses both Box layout and VObjAlign layout (in fact, they are inseparable, since the Box constructor requires you to specify the VObjAlign layout of its sub-objects), consider the case of a VObject which contains a single other VObject, centered. This might be done by creating the following VObject:

  new Box(cIdNone, Point(1,0), gPoint2, (VObjAlign)( eVObjHCenter | eVObjVCenter ), myVObj)
This creates a 1x1 grid containing a centered VObject called myVObj. Now suppose the Box is moved (perhaps it's inside a Scroller, and the user scrolls). ET++ will call Box::SetOrigin() to change the position of the Box. This calls VObject::Align() on each element in the Box, just one in this case. VObject::Align() moves the single element to the position specified by the Box's VObjAlign value, which centers the object in the moved box.


For inheritance information, see a partial inheritance hierarchy for ET++.

Back to the top ET++ page

Suggestions to ferrar@uiuc.edu.