FLAT WIDGET LAYOUT(3W) — OLIT
DESCRIPTION
All of the flat containers have the same layout characteristics. The superclass of all flat widgets is a generic row/column manager. Though each column has its own width and each row has its own height, all columns can have the same width and all rows can have the same height, if desired.
Note:
As a programming note, the efficiency in both processing steps and data requirements increases as the grid becomes more regular in shape. For example, a grid specifying that all rows must have the same height and all columns must have the same width is the most efficient configuration.
The flat row/column manager lays out each managed sub-object in row-major order or in column-major order depending on the attributes of the container, starting with with the NorthWest corner of the container.
Note:
Row-major order implies every column in the current row is filled before filling any columns in the next row. Column-major order implies every row in the current column is filled before filling any rows in the next column.
Sub-objects of flat containers are placed within the grid. If the sub-object’s width (or height) is less than the column’s width (or row’s height), the sub-object is positioned in accordance to the XtNitemGravity resource. The following table lists the layout resources of all flat containers:
Note:
See the resource tables for each flat container for a more accurate accounting of the default/allowable values for each layout resource.
Table 1 Flat Exclusives Widget Resource Set Common Flat Container Layout Resources
Name Type Default Access
XtNgravity int CenterGravity SGI
XtNhPad Dimension 0 SGI
XtNhSpace Dimension 0 SGI XtNitemGravity int NorthWestGravity SGI
XtNmeasure int 1 SGI
XtNvPad Dimension 0 SGI
XtNvSpace Dimension 0 SGI
XtNgravity
Range of Values:
EastGravity/"east"
WestGravity/"west"
CenterGravity/"center"
NorthGravity/"north"
NorthEastGravity/"northEast"
NorthWestGravity/"northWest"
SouthGravity/"south"
SouthEastGravity/"southEast"
SouthWestGravity/"southWest"
The gravity resource specifies the position of all sub-objects (i.e., as a group) whenever a tight-fitting bounding box that surrounds the sub-objects has a width, or height, less than the container’s width or height, respectively. Essentially, this resource specifies how the sub-objects, as a group, float within its container.
XtNhPad
XtNvPad
Range of Values:
0 ≤ XtNhPad
0 ≤ XtNvPad
These resources specify the minimum spacing to leave round the edges of the container, left and right, and top and bottom, respectively.
XtNhSpace
XtNvSpace
Range of Values:
0 ≤ XtNhSpace
0 ≤ XtNvSpace
These resource specify the amount of space to leave between sub-objects horizontally and vertically, respectively. If the sub-objects are of different sizes in a row or column, the spacing applies to the widest or tallest dimension all sub-objects in the row or column.
XtNitemGravity
Range of Values:
EastGravity/"east"
WestGravity/"west"
CenterGravity/"center"
NorthGravity/"north"
NorthEastGravity/"northEast"
NorthWestGravity/"northWest"
SouthGravity/"south"
SouthEastGravity/"southEast"
SouthWestGravity/"southWest"
This resource specifies how an item fits into its row or column whenever the item’s width or height is less than the column’s width or the row’s height. The values of XtNsameWidth and XtNsameHeight govern the column’s width and the row’s height.
XtNitemMaxHeight
XtNitemMaxWidth
Range of Values:
OL_IGNORE != XtNitemMaxHeight
OL_IGNORE != XtNitemMaxWidth
These resources specify the maximum allowable width and height (respectively) of all sub-objects. If the either of these resources have a value of OL_IGNORE, the maximum size constraint is ignored.
XtNitemMinHeight
XtNitemMinWidth
Range of Values:
OL_IGNORE != XtNitemMinHeight
OL_IGNORE != XtNitemMinWidth
These resources specify the minimum allowable width and height (respectively) of all sub-objects. If the either resource has a value of OL_IGNORE, it is ignored.
XtNlayoutHeight
XtNlayoutWidth
Range of Values:
OL_MINIMIZE/"minimize"
OL_MAXIMIZE/"maximize"
OL_IGNORE/"ignore"
These resources specify the resize policy of flat containers whenever a sub-object is added, removed or altered. These resources have no affect when an external force applies a size change to the container, e.g., if the application resizes a container. The explanation of the values are:
OL_MINIMIZE
The container will modify its width (or height) to be just large enough to tightly wrap around its sub-objects regardless of its current width (or height). Thus the container will grow and shrink depending on the size needs of its sub-objects.
OL_MAXIMIZE
The container will increase its width (or height) to be just large enough to tightly wrap around its sub-objects regardless of its current width (or height), but will not give up extra space. Thus the container will grow but never shrink depending on the size needs of its sub-objects.
OL_IGNORE
The container will honor its own width and height, i.e., it will not grow or shrink in response to the addition, deletion or altering of its sub-objects.
XtNlayoutType
Range of Values:
OL_FIXEDCOLS/"fixedcols"
OL_FIXEDROWS/"fixedrows"
This resource controls the number of rows and columns used to layout the sub-objects.
OL_FIXEDCOLS
The layout should have a maximum number of columns equal to the value specified by the XtNmeasure resource, and there will be enough rows to hold all sub-objects. Sub-objects are placed in row-major order, i.e., the columns of the current row are filled before filling any columns in the next row.
OL_FIXEDROWS
The layout should have a maximum number of rows equal to the value specified by the XtNmeasure resource, and there will be enough columns to hold all sub-objects. Sub-objects are placed in column-major order, i.e., the rows of the current column are filled before filling any rows in the next column.
XtNmeasure
Range of Values:
0 < XtNmeasure
This resource gives the number of rows or columns that were requested from the XtNlayoutType resource.
XtNsameHeight
Range of Values:
OL_ALL/"all"
OL_ROWS/"rows"
OL_NONE/"none"
This resource defines which sub-objects are forced to be the same height within the container:
OL_ALLAll sub-objects are to be the same height.
OL_ROWSAll sub-objects appearing in the same row should be the same height.
OL_NONEThe sub-objects are placed in fixed-height rows but the height of each item is left alone. The height of each row is the height of the tallest sub-object.
XtNsameWidth
Range of Values:
OL_ALL/"all"
OL_COLUMNS/"columns"
OL_NONE/"none"
This resource defines that sub-objects are forced to be the same width within the container:
OL_ALLAll sub-objects are to be the same width.
OL_COLUMNSAll sub-objects appearing in the same column should be the same width.
OL_NONEThe sub-objects are placed in fixed-width columns but the width of each item is left alone. The width of each column is the width of the widest sub-object.
Sun Release 4.1 — Last change: 1/8/90