The Form Widget
Author: Roland Krause 2002, roland_krause@freenet.de
Description: Documentation to XawPlus

### _________________________________________________________XawPlus

### The Form Widget

Application Header file Class Header file Class Class Name Superclass | <X11/XawPlus/Form.h> <X11/XawPlus/FormP.h> formWidgetClass Form Constraint

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.

### Differences between Xaw and XawPlus

The default background color is grey75.

### Resources

When creating a Form widget instance, the following resources are retrieved from the argument list of XtSetValues() or XtVaSetValues() or from the resource database:

Name | Class | Type | Default Value
OBJECT: |  |  |
destroyCallback | Callback | Pointer | NULL
RECTANGLE: |  |  |
borderWidth height sensitive width x y | BorderWidth Height Sensitive Width Position Position | Dimension Dimension Boolean Dimension Position Position | 1 Space for all children True Space for all children 0 0
CORE: |  |  |
border background mappedWhenManaged | BorderColor Background MappedWhenManaged | Pixel Pixel Boolean | XtDefaultForeground grey75 True
FORM: |  |  |
defaultDistance | Thickness | int | 4

defaultDistance | The default internal spacing for the children. This is the default value for constrained resources horizDistance and vertDistance.

### Constraint Resources

Each child of the Form widget may request special layout resources be applied to it. These constraint resources allow the Form widget's children to specify individual layout requirements.

Name | Class | RepType | Default Value
bottom fromHoriz fromVert horizDistance left resizable right top vertDistance | Edge Widget Widget Thickness Edge Boolean Edge Edge Thickness | XtEdgeType Widget Widget int XtEdgeType Boolean XtEdgeType XtEdgeType int | XtRubber (left edge of form) (top of form) defaultDistance XtRubber False XtRubber XtRubber defaultDistance

### Layout Semantics

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

### Example

If you wish to force the Form to never resize one or more of its children, then set left and right to XawChainLeft and top and bottom to XawChainTop. This will cause the child to remain a fixed distance from the top and left edges of the Form, and never to resize.

### Convenience Routines

To force or defer a re-layout of the Form, use 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.

### XawPlus_________________________________________________________