Application Header file | <Xraw/Form.h> |
---|---|
Class Header file | <Xraw/FormP.h> |
Class | formWidgetClass |
Class Name | Form |
Superclass | Container --> Constraint --> Composit --> Core |
The Form widget can contain an arbitrary number of children or subwidgets. The Form provides geometry management for its children, which allows individual control of the position of each child. Any combination of children can be added to a Form. The initial positions of the children may be computed relative to the positions of previously created children. When the Form is resized, it computes new positions and sizes for its children. This computation is based upon information provided when a child is added to the Form.
The default width of the Form is the minimum width needed to enclose the children after computing their initial layout, with a margin of defaultDistance at the right and bottom edges. If a width and height is assigned to the Form that is too small for the layout, the children will be clipped by the right and bottom edges of the Form.
Name | Class | Type | Notes | Default Value |
---|---|---|---|---|
accelerators | Accelerators | AcceleratorTable | NULL | |
ancestorSensitive | AncestorSensitive | Boolean | D | True |
background | Background | Pixel | XtDefaultBackground | |
backgroundPixmap | Pixmap | Pixmap | XtUnspecifiedPixmap | |
borderColor | BorderColor | Pixel | XtDefaultForeground | |
borderPixmap | Pixmap | Pixmap | XtUnspecifiedPixmap | |
borderWidth | BorderWidth | Dimension | 1 | |
children | ReadOnly | WidgetList | R | NULL |
colormap | Colormap | Colormap | Parent's Colormap | |
defaultDistance | Thickness | int | 4 | |
depth | Depth | int | C | Parent's Depth |
destroyCallback | Callback | XtCallbackList | NULL | |
height | Height | Dimension | A | Enough space to contain all children |
mappedWhenManaged | MappedWhenManaged | Boolean | True | |
numChildren | ReadOnly | Cardinal | R | 0 |
screen | Screen | Screen | R | Parent's Screen |
sensitive | Sensitive | Boolean | True | |
translations | Translations | TranslationTable | NULL | |
width | Width | Dimension | A | Enough space to contain all children |
x | Position | Position | 0 | |
y | Position | Position | 0 |
Name | Class | Type | Notes | Default Value |
---|---|---|---|---|
bottom | Edge | XawEdgeType | XawRubber | |
fromHoriz | Widget | Widget | NULL (left edge of Form) | |
fromVert | Widget | Widget | NULL (top edge of Form) | |
horizDistance | Thickness | int | defaultDistance resource | |
left | Edge | XawEdgeType | XawRubber | |
resizable | Boolean | Boolean | FALSE | |
right | Edge | XawEdgeType | XawRubber | |
top | Edge | XawEdgeType | XawRubber | |
vertDistance | Thickness | int | defaultDistance resource |
bottom left right top |
What to do with this edge of the child when the parent is resized. This resource may be any edgeType. See Layout Semantics for details. |
---|---|
fromHoriz fromVert |
Which widget this child should be placed underneath (or to the right of). If a value of NULL is specified then this widget will be positioned relative to the edge of the parent. |
horizDistance vertDistance |
The amount of space, in pixels, between this child and its left or upper neighbor. |
resizable | If this resource is False then the parent widget will ignore all geometry request made by this child. The parent may still resize this child itself, however. |
The first layout method uses the fromVert and fromHoriz resources to place the children of the Form. A single pass is made through the Form widget's children in the order that they were created. Each child is then placed in the Form widget below or to the right of the widget specified by the fromVert and fromHoriz resources. The distance the new child is placed from its left or upper neighbor is determined by the horizDistance and vertDistance resources. This implies some things about how the order of creation affects the possible placement of the children. The Form widget registers a string to widget converter which does not postpone conversion and does not cache conversion results.
The second layout method is used when the Form is resized. It does not matter what causes this resize, and it is possible for a resize to happen before the widget becomes visible (due to constraints imposed by the parent of the Form). This layout method uses the bottom, top, left, and right resources. These resources are used to determine what will happen to each edge of the child when the Form is resized. If a value of XawChain<something> is specified, the the edge of the child will remain a fixed distance from the chain edge of the Form. For example if XawChainLeft is specified for the right resource of a child then the right edge of that child will remain a fixed distance from the left edge of the Form widget. If a value of XawRubber is specified, that edge will grow by the same percentage that the Form grew. For instance if the Form grows by 50% the left edge of the child (if specified as XawRubber will be 50% farther from the left edge of the Form). One must be very careful when specifying these resources, for when they are specified incorrectly children may overlap or completely occlude other children when the Form widget is resized.
Edge Type | Resource Name | Description |
---|---|---|
XawChainBottom | ChainBottom | Edge remains a fixed distance from bottom of Form |
XawChainLeft | ChainLeft | Edge remains a fixed distance from left of Form |
XawChainRight | ChainRight | Edge remains a fixed distance from right of Form |
XawChainTop | ChainTop | Edge remains a fixed distance from top of Form |
XawRubber | Rubber | Edges will move a proportional distance |
XawFormDoLayout
.
void XawFormDoLayout(w, do_layout)
Widget w;
Boolean do_layout;
w | Specifies the Form widget. |
do_layout |
Specifies whether the layout of the Form widget is enabled (True )
or disabled (False ).
|
When making several changes to the children of a Form widget after the Form has been realized, it is a good idea to disable relayout until after all changes have been made.