next up previous contents index
Next: 4. Applying the Changes Up: 2. Layout Management Functions Previous: 2. Computing the Desired   Contents   Index

3. Computing the Layout

This next function is responsible for actually laying out each row. It is in this function that things like the fit_mode and fill_mode in the Layout structure are evaluated.


_XmGeoArrangeList(XmKidGeometry boxes, XmGeoRowLayout layout,
                  Position x, Position y,
                  Dimension width, Dimension margin);

The pseudo code for this function is as follows:


    °figure out the width of our children°
    °figure out the "fill" space wanted°
    °figure out the amount of adjusting necessary°
    °figure out the starting height of this row°

    if (°things aren't going to fit, and layout fit_mode is° XmGEO_WRAP) {
    else if (°things aren't going to fit°) {
        if (°fit_mode is° Xm_GEO_AVERAGING)
    else if (°the wanted width is wider than necessary°) {
        if (°fill_mode is° XmGEO_CENTER)

Finally, after the rows have been laid out, the y offsets or the widget heights in each row may need adjusting, based on the actual height of the widget, and the value of stretch_height. _XmGeoArrangeBoxes() takes care of that with the following two functions. The first stretches the rows to fit; the second inserts filler space.


_XmGeoStretchVertical(XmGeoMatrix geoSpec, Dimension height, Dimension maxh);
_XmGeoFillVertical(XmGeoMatrix geoSpec, Dimension height, Dimension maxh);

I'll stop at this level. If you want to know more, you'll need to delve into the code in GeoUtils.c. What I've given should be enough for you to find your way around.

Danny Backx