Managing UI Geometry: 2.1 Arranging Your Generic Objects: General Geometry Rules

Up: GEOS SDK TechDocs | Up | Prev: 2 Arranging Your Generic Objects | Next: 2.2 Orienting Children

You may feel at first that the use of generic UI components limits your control over the UI of your application. Actually, just the opposite is true: Your application becomes immediately available at all supported video resolutions in all available specific UIs. Additionally, you can concentrate on more important issues of your application; the generic UI objects take care of a tremendous amount of the work in positioning and displaying the user interface.

To determine your generic UI tree, you must remember that UI geometry is determined by three things: First and foremost, the overall structure of the UI is governed by the structure and organization of the generic object tree. For example, if GenTriggers A, B, and C are designated as children of a dialog box, they will likely be ordered in the same order they're listed in the dialog's GI_comp field.

Second, an object's attributes can determine its implementation. For example, the GIGI_visibility field of a GenInteraction can determine whether the interaction is implemented as a dialog box, a menu, or a grouping object. The attributes of a generic object determine the basic functionality of the object; that is, even though a menu might be implemented differently in different specific UIs, the functionality of a menu will be implemented in the object. The manner of display of an object is based on its functionality. In this way, the attributes of a generic object take precedence over hints.

Third, an object's behavior can be fine-tuned through the use of hints. Hints may or may not be implemented for each object that has them, and they control less strictly how the object works.

Generic Tree Structure

As stated above, the structure of your application's generic object tree determines how the generic UI objects will be organized. A simple example of a generic tree including a menu, a dialog box, and a GenView can be found in the Hello World chapter.

How Hints Work

Nearly all geometry of generic UI objects is determined by hints. You can position, size, and limit generic objects with different hints. All these hints are defined in GenClass ; inheritance allows all generic objects to have them, though not all hints are applicable to all generic objects.

Hints are described in detail in the GenClass chapter, but the basics are reviewed here for convenience. Hints are implemented as variable data entries; each hint is a different variable-data type. Hints therefore take up instance data space in an object only when the object has that hint.

As stated earlier, not all hints are appropriate for all objects. For example, HINT_CUSTOM_CHILD_SPACING is probably not useful when applied to a GenTrigger object because a GenTrigger can have no children. Hints, by definition, are also not guaranteed to be supported by all specific UI libraries. For example, a specific UI might require all elements of a dialog box to be oriented horizontally; in this case, HINT_ORIENT_CHILDREN_VERTICALLY might be useful but might not be heeded by the specific UI.

Because geometry management of generic objects can be confusing at times, this chapter follows a series of examples accompanied with diagrams. For the most part, you should be able to "plug and play" the examples in the following sections.


Up: GEOS SDK TechDocs | Up | Prev: 2 Arranging Your Generic Objects | Next: 2.2 Orienting Children