Managing UI Geometry: 2.6 Arranging Your Generic Objects: Using Monikers

Up: GEOS SDK TechDocs | Up | Prev: 2.5 Outlining the Composite | Next: 2.7 Using Custom Child Spacing

Nearly all generic objects will have visual monikers (usually text labels) that get drawn somewhere in or near the object. The moniker helps the user distinguish between different objects; for example, each trigger should have a text (or graphical) moniker giving some indication of what happens when the trigger is pressed.

Placing Monikers in Relation to Children

HINT_PLACE_MONIKER_ABOVE, HINT_PLACE_MONIKER_BELOW, HINT_PLACE_MONIKER_TO_LEFT, HINT_PLACE_MONIKER_TO_RIGHT, HINT_DO_NOT_USE_MONIKER, HINT_CENTER_MONIKER, HINT_PLACE_MONIKER_ALONG_LARGER_DIMENSION, HINT_ALIGN_LEFT_MONIKER_EDGE_WITH_CHILD

Monikers are extremely useful and dynamic--see the GenClass chapter, for full information on creating, manipulating, and using visual monikers. Monikers may be created or changed at run-time (often causing geometry updates), and all generic objects may be given monikers.

If you place a composite object's moniker to one side of its children, the geometry manager will ensure extra space in the composite gets allotted for the moniker. You can hint that the moniker should be placed above, to the right of, to the left of, or below the children. You can also hint that the moniker should not be used.

Most specific UIs will put the moniker to the left of the object's children by default. You can also center the moniker on the composite's children with HINT_CENTER_MONIKER .

You can also have the UI place the moniker along the object's larger dimension--to the left if the screen is wider than it is tall, or above if the screen is taller than it is wide. To do this, set the hint HINT_PLACE_MONIKER_ALONG_LARGER_DIMENSION .

If a moniker is placed above a group of children, HINT_ALIGN_LEFT_MONIKER_EDGE_WITH_CHILD ensures that left moniker edge coincides with the left edge of the first child below that moniker. This is usually the default behavior anyway, but different specific UIs may have different default behavior.

Justifying or Centering on Monikers

HINT_CENTER_CHILDREN_ON_MONIKERS, HINT_LEFT_JUSTIFY_MONIKERS

When you have several composites within a single composite, you can center the composites based on the position and size of the monikers. Using the hint HINT_CENTER_CHILDREN_ON_MONIKERS has the effect shown in the figure above: It aligns the child composites so their monikers are right-justified at the center. Adding HINT_LEFT_JUSTIFY_MONIKERS has a similar effect, except the monikers are left-justified.

Note that the two hints HINT_CENTER_CHILDREN_ON_MONIKERS and HINT_LEFT_JUSTIFY_MONIKERS are valid only for composites with one or more child composites, all of which have monikers placed to their left.

Removing Moniker Borders

HINT_NO_BORDERS_ON_MONIKERS

This hint removes borders that may appear by default around an object's moniker. For example, GenTriggers under most specific UIs have a rectangular border drawn around their moniker's borders. This hint removes these borders. It may be useful in cases where a custom border should be implemented, but in general should not be used to override the specific UI, as this may confuse the user.


Up: GEOS SDK TechDocs | Up | Prev: 2.5 Outlining the Composite | Next: 2.7 Using Custom Child Spacing