SYNOPSIS
#include <Xm/Form.h>XmForm
XmCreateForm
DESCRIPTION
XmForm is a widget which allows you to specify complicated geometries. The widget is capable of aligning children widgets with reference to each other. Widgets can be linked to each other's positions, hooked to a fixed place, or hooked to the form's edges. Positioning can be relative as well as absolute.The algorithm used to lay out the children is an iterative one. In development versions of LessTif, the amount of iterations that the widget supports before it wants to have reached a steady state is 200. OSF/Motif® uses a much higher number than this; if the low number in LessTif gives you trouble (it generates a warning message mentioning "bailout") then either the number is too low or you've discovered a bug.
X RESOURCES
Name | Class | Type | Default | Access |
XmNmarginWidth | XmCMarginWidth | HorizontalDimension | 0 | CSG |
XmNmarginHeight | XmCMarginHeight | VerticalDimension | 0 | CSG |
XmNhorizontalSpacing | XmCSpacing | HorizontalDimension | 0 | CSG |
XmNverticalSpacing | XmCSpacing | VerticalDimension | 0 | CSG |
XmNfractionBase | XmCMaxValue | Int | 100 | CSG |
XmNrubberPositioning | XmCRubberPositioning | Boolean | False | CSG |
XmNfractionBase is the resource that allows you to specify the reference value relative to which values for the constraint resource XmNposition are to be used. The default, 100, allows you to specify e.g. 50 to mean that some widget edge should be positioned at 50% of the form's width (or height).
XmNrubberPositioning is a boolean which determines the default layout if some of the constraint resources aren't set for children of XmForm. In the default case (False), children widgets for which the left or top sides haven't been specified, default their attachment to XmATTACH_FORM. This means the children will be in the upper left side of the form. In the other case, the children widgets's left or top attachments will default to XmATTACH_SELF.
XmNmarginWidth
XmNmarginHeight
XmNhorizontalSpacing
XmNverticalSpacing
CONSTRAINT RESOURCES
The constraint resources for XmForm allow us to specify the layout of children of the form. These resources should not be set on the form, they should be set on the children. They don't work unless the parent of a widget is an XmForm, they also don't work if the widget is a grandchild of XmForm.
The latter is a mistake often made in the case of scrolled widgets. Functions such as XmCreateScrolledText create two (or more) widgets, and return a grandchild of Form if they are called with the form as parent. In such case, constraint resources should be set on the parent of the widget returned by XmCreateScrolledText (or similar).
Name | Class | Type | Default | Access |
XmNtopAttachment | XmCAttachment | unsigned char | dynamic | CSG |
XmNbottomAttachment | XmCAttachment | unsigned char | dynamic | CSG |
XmNleftAttachment | XmCAttachment | unsigned char | dynamic | CSG |
XmNrightAttachment | XmCAttachment | unsigned char | dynamic | CSG |
XmNtopWidget | XmCWidget | Widget | NULL | CSG |
XmNbottomWidget | XmCWidget | Widget | NULL | CSG |
XmNleftWidget | XmCWidget | Widget | NULL | CSG |
XmNrightWidget | XmCWidget | Widget | NULL | CSG |
XmNtopPosition | XmCPosition | int | 0 | CSG |
XmNbottomPosition | XmCPosition | int | 0 | CSG |
XmNleftPosition | XmCPosition | int | 0 | CSG |
XmNrightPosition | XmCPosition | int | 0 | CSG |
XmNtopOffset | XmCOffset | int | 0 | CSG |
XmNbottomOffset | XmCOffset | int | 0 | CSG |
XmNleftOffset | XmCOffset | int | 0 | CSG |
XmNrightOffset | XmCOffset | int | 0 | CSG |
XmNresizable | XmCBoolean | Boolean | True | CSG |
XmNresizable specifies whether this widget can resize itself, if the geometry request doesn't conflict with attachments. An example of this is a XmLabel widget which modifies its XmNlabelString, which causes it to try to resize itself. If XmNresizable is set to False in such a case, expensive geometry calculations can be avoided.
XmNtopAttachment is the method of attachment for the child's top side XmNtopWidget is the ID of the widget or gadget that serves as attachment point for the top of this child. For this to work, XmNtopAttachment must be set to XmATTACH_WIDGET or to XmATTACH_OPPOSITE_WIDGET.
XmNtopPosition used in conjunction with XmNfractionBase allows you to calculate the position of the top of a child widget relative to the top of the Form. This resource only works if XmNtopAttachment has been set to XmATTACH_POSITION. A position can be a negative number, which allows you to position a child widget in a place which is either partially or completely invisible. Values larger than the value of XmNfractionBase, or close to it, have similar effect.
XmNtopOffset is the distance between the child's top edge and the object it is attached to. This may be the form (XmATTACH_FORM) or another widget (XmATTACH_WIDGET or XmATTACH_OPPOSITE_WIDGET). In the latter case (XmATTACH_OPPOSITE_WIDGET), the offset is relative to the other widget's top. In the other cases, the offset is relative to the form's top or to the other widget's bottom edge.
As with XmNtopPosition, values can be specified which are either negative or large, to position the child widget at a place where it is either partially or completely invisible.