Workbench User Guide : Creating and Using Basic Fields : Composite Fields : Stack Fields
 
Share this page          
Stack Fields
A stack field appears as a set of fields that remain aligned if you rearrange or reorder them. The stack can include any combination of fields.
A stack field is useful for laying out fields so that they stay aligned when you port the form to another environment. For more information about using stack fields to create portable forms, see the Programming Guide.
Fields in a stack field are arranged either vertically or horizontally in a one-dimensional array, depending on the setting of the Orientation property in the Property Inspector.
The ChildTopMargin, ChildBottomMargin, ChildLeftMargin, and ChildRightMargin properties let you specify margins for each child field of a stack field. The ChildGravity property determines the position of child fields in the stack field cells. You can use the Property Inspector to set these properties; you can also use the Gravity property of a stack field's children to control the placement of the children in the stack field cells.
Create a Stack Field
You can create a stack field to align a group of existing fields or you can create a new stack field
To create a stack field by grouping existing fields
1. Open your frame in the Frame Editor (see Open an Existing Frame).
2. Select the fields to be included in the stack field.
Note:  For information about selecting fields, see How You Can Select Fields.
3. Click Group, Stack Field.
Workbench moves the selected fields into a vertical or horizontal stack. To change this orientation, set the Orientation property in the Property Inspector.
4. Set the properties and style for the stack field.
Note:  For complete descriptions of each field property, see Stack Field Properties and Common Field Properties.
To create a new stack field
1. Open your frame in the Frame Editor (see Open an Existing Frame).
2. Click Insert, Field, Stack Field.
3. Click to place the field on the form.
Workbench places the field on the form with some placeholder child fields to prevent the collapse of the stack field.
4. Add your own fields to the stack field and then delete the placeholder fields.
5. Set the properties and style for the stack field.
Note:  For complete descriptions of each field property, see Stack Field Properties and Common Field Properties.
Stack Field Properties
All the properties for stack fields are described under Common Field Properties, with the exception of the following properties or values that are specific to the stack field type:
ChildBottomMargin
Specifies the bottom margin (in 1000ths of an inch) around each child field within the composite field and between the child field and the bottom boundary of the composite field
ChildGravity
Specifies the default position of each child field relative to its cell in the composite field. Valid alignment options are:
FA_DEFAULT (system default value)
FA_NONE
FA_TOPCENTER
FA_TOPLEFT
FA_TOPRIGHT
FA_CENTERLEFT
FA_CENTER
FA_CENTERRIGHT
FA_BOTTOMCENTER
FA_BOTTOMLEFT
FA_BOTTOMRIGHT
For more information about the Gravity and ChildGravity properties, see the Gravity section under Common Field Properties.
In general, this property should be set to FA_NONE. To align the child fields, use one of the alignment commands on the Layout menu.
ChildLeftMargin
Specifies the left margin (in 1000ths of an inch) around each child field within the composite field and between the child field and the left boundary of the composite field
ChildRightMargin
Specifies the right margin (in 1000ths of an inch) around each child field within the composite field and between the child field and the right boundary of the composite field
ChildTopMargin
Specifies the top margin (in 1000ths of an inch) around each child field within the composite field and between the child field and the top boundary of the composite field