Managing UI Geometry: 2.8 Arranging Your Generic Objects: Allowing Children to Wrap

Up: GEOS SDK TechDocs | Up | Prev: 2.7 Using Custom Child Spacing | Next: 2.9 Object Placement
HINT_ALLOW_CHILDREN_TO_WRAP, HINT_WRAP_AFTER_CHILD_COUNT, HINT_DONT_ALLOW_CHILDREN_TO_WRAP, HINT_WRAP_AFTER_CHILD_COUNT_IF_VERTICAL_SCREEN

When a composite grows to fit its children and also must remain small enough to fit within its generic parent, it may wrap the children. This typically happens as a result of the user resizing a window smaller so the children of the composite no longer fit the window's width. Wrapping can occur in both the horizontal and the vertical, depending on the orientation of the composite object.

To allow a composite to wrap its children when necessary, apply the hint HINT_ALLOW_CHILDREN_TO_WRAP to the composite. If you want the children not to wrap, apply HINT_DONT_ALLOW_CHILDREN_TO_WRAP . An example of wrapping children appears below.

When HINT_WRAP_AFTER_CHILD_COUNT is applied and children are allowed to wrap, the composite will cause its children to wrap after a certain number are displayed. This hint takes a single integer as a parameter. For example, if you wanted three children on every line in the composite no matter how many children there were total, you would specify the composite as follows:

@object GenInteractionClass @MyComp = {
    GI_comp = @child1, @child2, @child3, @child4;
    HINT_ALLOW_CHILDREN_TO_WRAP;
    HINT_WRAP_AFTER_CHILD_COUNT = 3;
}

The configuration shown above is demonstrated in the figure below.

A variation, HINT_WRAP_AFTER_CHILD_COUNT_IF_VERTICAL_SCREEN , allows you to allow child wrapping based on whether or not the screen is "vertical." If the screen is taller than it is wide, this hint will have an effect like HINT_WRAP_AFTER_CHILD_COUNT ; if not, the hint will have no effect.


Up: GEOS SDK TechDocs | Up | Prev: 2.7 Using Custom Child Spacing | Next: 2.9 Object Placement