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:
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.
Suggestions to ferrar@uiuc.edu.