[Contents] [Index] [Next] [Previous]

XmForm


NAME

XmForm - The Form widget class

SYNOPSIS

#include <Xm/Form.h>

DESCRIPTION

Form is a container widget with no input semantics of its own. Constraints are placed on children of the Form to define attachments for each of the child's four sides. These attachments can be to the Form, to another child widget or gadget, to a relative position within the Form, or to the initial position of the child. The attachments determine the layout behavior of the Form when resizing occurs.

The default value for XmNinitialFocus is the value of XmNdefaultButton.

Following are some important considerations in using a Form:

All these considerations are true of top and bottom attachments as well, with top acting like left, bottom acting like right, y acting like x, and height acting like width.

Classes

Form inherits behavior and resources from Core, Composite, Constraint, XmManager, and XmBulletinBoard classes.

The class pointer is xmFormWidgetClass.

The class name is XmForm.

New Resources

The following table defines a set of widget resources used by the programmer to specify data. The programmer can also set the resource values for the inherited classes to set attributes for this widget. To reference a resource by name or by class in a .Xdefaults file, remove the XmN or XmC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the Xm prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). The codes in the access column indicate if the given resource can be set at creation time (C), set by using XtSetValues (S), retrieved by using XtGetValues (G), or is not applicable (N/A).

XmForm Resource Set
Name Class Type Default Access
XmNfractionBase XmCMaxValue int 100 CSG
XmNhorizontalSpacing XmCSpacing Dimension 0 CSG
XmNrubberPositioning XmCRubberPositioning Boolean False CSG
XmNverticalSpacing XmCSpacing Dimension 0 CSG
XmNfractionBase
Specifies the denominator used in calculating the relative position of a child widget using XmATTACH_POSITION constraints. The value must not be 0.

If the value of a child's XmNleftAttachment (or XmNrightAttachment) is XmATTACH_POSITION, the position of the left (or right) side of the child is relative to the left side of the Form and is a fraction of the width of the Form. This fraction is the value of the child's XmNleftPosition (or XmNrightPosition) resource divided by the value of the Form's XmNfractionBase.

If the value of a child's XmNtopAttachment (or XmNbottomAttachment) is XmATTACH_POSITION, the position of the top (or bottom) side of the child is relative to the top side of the Form and is a fraction of the height of the Form. This fraction is the value of the child's XmNtopPosition (or XmNbottomPosition) resource divided by the value of the Form's XmNfractionBase.

XmNhorizontalSpacing
Specifies the offset for right and left attachments. This resource is only used if no offset resource is specified (when attaching to a widget), or if no margin resource is specified (when attaching to the Form).
XmNrubberPositioning
Indicates the default near (left) and top attachments for a child of the Form. (Note: Whether this resource actually applies to the left or right side of the child and its attachment may depend on the value of the XmNstringDirection resource.)

The default left attachment is applied whenever initialization or XtSetValues leaves the child without either a left or right attachment. The default top attachment is applied whenever initialization or XtSetValues leaves the child without either a top or bottom attachment.

If this Boolean resource is set to False, XmNleftAttachment and XmNtopAttachment default to XmATTACH_FORM, XmNleftOffset defaults to the current x value of the left side of the child, and XmNtopOffset defaults to the current y value of the child. The effect is to position the child according to its absolute distance from the left or top side of the Form.

If this resource is set to True, XmNleftAttachment and XmNtopAttachment default to XmATTACH_POSITION, XmNleftPosition defaults to a value proportional to the current x value of the left side of the child divided by the width of the Form, and XmNtopPosition defaults to a value proportional to the current y value of the child divided by the height of the Form. The effect is to position the child relative to the left or top side of the Form and in proportion to the width or height of the Form.

XmNverticalSpacing
Specifies the offset for top and bottom attachments. This resource is only used if no offset resource is specified (when attaching to a widget), or if no margin resource is specified (when attaching to the Form).

XmForm Constraint Resource Set
Name Class Type Default Access
XmNbottomAttachment XmCAttachment unsigned char XmATTACH_NONE CSG
XmNbottomOffset XmCOffset int 0 CSG
XmNbottomPosition XmCAttachment int 0 CSG
XmNbottomWidget XmCWidget Widget NULL CSG
XmNleftAttachment XmCAttachment unsigned char XmATTACH_NONE CSG
XmNleftOffset XmCOffset int 0 CSG
XmNleftPosition XmCAttachment int 0 CSG
XmNleftWidget XmCWidget Widget NULL CSG
XmNresizable XmCBoolean Boolean True CSG
XmNrightAttachment XmCAttachment unsigned char XmATTACH_NONE CSG
XmNrightOffset XmCOffset int 0 CSG
XmNrightPosition XmCAttachment int 0 CSG
XmNrightWidget XmCWidget Widget NULL CSG
XmNtopAttachment XmCAttachment unsigned char XmATTACH_NONE CSG
XmNtopOffset XmCOffset int 0 CSG
XmNtopPosition XmCAttachment int 0 CSG
XmNtopWidget XmCWidget Widget NULL CSG
XmNbottomAttachment
Specifies attachment of the bottom side of the child. It can have the following values:
XmNbottomOffset
Specifies the constant offset between the bottom side of the child and the object to which it is attached. The relationship established remains, regardless of any resizing operations that occur. When this resource is explicitly set, the value of XmNverticalSpacing is ignored.
XmNbottomPosition
This resource is used to determine the position of the bottom side of the child when the child's XmNbottomAttachment is set to XmATTACH_POSITION. In this case the position of the bottom side of the child is relative to the top side of the Form and is a fraction of the height of the Form. This fraction is the value of the child's XmNbottomPosition resource divided by the value of the Form's XmNfractionBase. For example, if the child's XmNbottomPosition is 50, the Form's XmNfractionBase is 100, and the Form's height is 200, the position of the bottom side of the child is 100.
XmNbottomWidget
Specifies the widget or gadget to which the bottom side of the child is attached. This resource is used if XmNbottomAttachment is set to either XmATTACH_WIDGET or XmATTACH_OPPOSITE_WIDGET.

A string-to-widget resource converter is automatically installed for use with this resource. With this converter, the widget that is to be the value of the resource must exist at the time the widget that has the resource is created.

XmNleftAttachment
Specifies attachment of the near (left) side of the child. (Note: Whether this resource actually applies to the left or right side of the child and its attachment may depend on the value of the XmNstringDirection resource.) It can have the following values:
XmNleftOffset
Specifies the constant offset between the near (left) side of the child and the object to which it is attached. (Note: Whether this resource actually applies to the left or right side of the child and its attachment may depend on the value of the XmNstringDirection resource.) The relationship established remains, regardless of any resizing operations that occur. When this resource is explicitly set, the value of XmNhorizontalSpacing is ignored.
XmNleftPosition
This resource is used to determine the position of the near (left) side of the child when the child's XmNleftAttachment is set to XmATTACH_POSITION. (Note: Whether this resource actually applies to the left or right side of the child and its attachment may depend on the value of the XmNstringDirection resource.)

In this case the position of the left side of the child is relative to the left side of the Form and is a fraction of the width of the Form. This fraction is the value of the child's XmNleftPosition resource divided by the value of the Form's XmNfractionBase. For example, if the child's XmNleftPosition is 50, the Form's XmNfractionBase is 100, and the Form's width is 200, the position of the left side of the child is 100.

XmNleftWidget
Specifies the widget or gadget to which the near (left) side of the child is attached. (Note: Whether this resource actually applies to the left or right side of the child and its attachment may depend on the value of the XmNstringDirection resource.) This resource is used if XmNleftAttachment is set to either XmATTACH_WIDGET or XmATTACH_OPPOSITE_WIDGET.

A string-to-widget resource converter is automatically installed for use with this resource. With this converter, the widget that is to be the value of the resource must exist at the time the widget that has the resource is created.

XmNresizable
This Boolean resource specifies whether or not a child's request for a new size is (conditionally) granted by the Form. If this resource is set to True the request is granted if possible. If this resource is set to False the request is always refused.

If a child has both left and right attachments, its width is completely controlled by the Form, regardless of the value of the child's XmNresizable resource. If a child has a left or right attachment but not both, the child's XmNwidth is used in setting its width if the value of the child's XmNresizable resource is True. These conditions are also true for top and bottom attachments, with height acting like width.

XmNrightAttachment
Specifies attachment of the far (right) side of the child. (Note: Whether this resource actually applies to the left or right side of the child and its attachment may depend on the value of the XmNstringDirection resource.) It can have the following values:
XmNrightOffset
Specifies the constant offset between the far (right) side of the child and the object to which it is attached. (Note: Whether this resource actually applies to the left or right side of the child and its attachment may depend on the value of the XmNstringDirection resource.) The relationship established remains, regardless of any resizing operations that occur. When this resource is explicitly set, the value of XmNhorizontalSpacing is ignored.
XmNrightPosition
This resource is used to determine the position of the far (right) side of the child when the child's XmNrightAttachment is set to XmATTACH_POSITION. (Note: Whether this resource actually applies to the left or right side of the child and its attachment may depend on the value of the XmNstringDirection resource.)

In this case the position of the right side of the child is relative to the left side of the Form and is a fraction of the width of the Form. This fraction is the value of the child's XmNrightPosition resource divided by the value of the Form's XmNfractionBase. For example, if the child's XmNrightPosition is 50, the Form's XmNfractionBase is 100, and the Form's width is 200, the position of the right side of the child is 100.

XmNrightWidget
Specifies the widget or gadget to which the far (right) side of the child is attached. (Note: Whether this resource actually applies to the left or right side of the child and its attachment may depend on the value of the XmNstringDirection resource.) This resource is used if XmNrightAttachment is set to either XmATTACH_WIDGET or XmATTACH_OPPOSITE_WIDGET.

A string-to-widget resource converter is automatically installed for use with this resource. With this converter, the widget that is to be the value of the resource must exist at the time the widget that has the resource is created.

XmNtopAttachment
Specifies attachment of the top side of the child. It can have following values:
XmNtopOffset
Specifies the constant offset between the top side of the child and the object to which it is attached. The relationship established remains, regardless of any resizing operations that occur. When this resource is explicitly set, the value of XmNverticalSpacing is ignored.
XmNtopPosition
This resource is used to determine the position of the top side of the child when the child's XmNtopAttachment is set to XmATTACH_POSITION. In this case the position of the top side of the child is relative to the top side of the Form and is a fraction of the height of the Form. This fraction is the value of the child's XmNtopPosition resource divided by the value of the Form's XmNfractionBase. For example, if the child's XmNtopPosition is 50, the Form's XmNfractionBase is 100, and the Form's height is 200, the position of the top side of the child is 100.
XmNtopWidget
Specifies the widget or gadget to which the top side of the child is attached. This resource is used if XmNtopAttachment is set to either XmATTACH_WIDGET or XmATTACH_OPPOSITE_WIDGET.

A string-to-widget resource converter is automatically installed for use with this resource. With this converter, the widget that is to be the value of the resource must exist at the time the widget that has the resource is created.

Inherited Resources

Form inherits behavior and resources from the following superclasses. For a complete description of each resource, refer to the man page for that superclass.

XmBulletinBoard Resource Set
Name Class Type Default Access
XmNallowOverlap XmCAllowOverlap Boolean True CSG
XmNautoUnmanage XmCAutoUnmanage Boolean True CG
XmNbuttonFontList XmCButtonFontList XmFontList dynamic CSG
XmNcancelButton XmCWidget Widget NULL SG
XmNdefaultButton XmCWidget Widget NULL SG
XmNdefaultPosition XmCDefaultPosition Boolean True CSG
XmNdialogStyle XmCDialogStyle unsigned char dynamic CSG
XmNdialogTitle XmCDialogTitle XmString NULL CSG
XmNfocusCallback XmCCallback XtCallbackList NULL C
XmNlabelFontList XmCLabelFontList XmFontList dynamic CSG
XmNmapCallback XmCCallback XtCallbackList NULL C
XmNmarginHeight XmCMarginHeight Dimension 0 CSG
XmNmarginWidth XmCMarginWidth Dimension 0 CSG
XmNnoResize XmCNoResize Boolean False CSG
XmNresizePolicy XmCResizePolicy unsigned char XmRESIZE_ANY CSG
XmNshadowType XmCShadowType unsigned char XmSHADOW_OUT CSG
XmNtextFontList XmCTextFontList XmFontList dynamic CSG
XmNtextTranslations XmCTranslations XtTranslations NULL C
XmNunmapCallback XmCCallback XtCallbackList NULL C

XmManager Resource Set
Name Class Type Default Access
XmNbottomShadowColor XmCBottomShadowColor Pixel dynamic CSG
XmNbottomShadowPixmap XmCBottomShadowPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNforeground XmCForeground Pixel dynamic CSG
XmNhelpCallback XmCCallback XtCallbackList NULL C
XmNhighlightColor XmCHighlightColor Pixel dynamic CSG
XmNhighlightPixmap XmCHighlightPixmap Pixmap dynamic CSG
XmNinitialFocus XmCInitialFocus Widget dynamic CSG
XmNnavigationType XmCNavigationType XmNavigationType XmTAB_GROUP CSG
XmNshadowThickness XmCShadowThickness Dimension dynamic CSG
XmNstringDirection XmCStringDirection XmStringDirection dynamic CG
XmNtopShadowColor XmCTopShadowColor Pixel dynamic CSG
XmNtopShadowPixmap XmCTopShadowPixmap Pixmap dynamic CSG
XmNtraversalOn XmCTraversalOn Boolean True CSG
XmNunitType XmCUnitType unsigned char dynamic CSG
XmNuserData XmCUserData XtPointer NULL CSG

Composite Resource Set
Name Class Type Default Access
XmNchildren XmCReadOnly WidgetList NULL G
XmNinsertPosition XmCInsertPosition XtOrderProc NULL CSG
XmNnumChildren XmCReadOnly Cardinal 0 G

Core Resource Set
Name Class Type Default Access
XmNaccelerators XmCAccelerators XtAccelerators dynamic N/A
XmNancestorSensitive XmCSensitive Boolean dynamic G
XmNbackground XmCBackground Pixel dynamic CSG
XmNbackgroundPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNborderColor XmCBorderColor Pixel XtDefaultForeground CSG
XmNborderPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
XmNborderWidth XmCBorderWidth Dimension 0 CSG
XmNcolormap XmCColormap Colormap dynamic CG
XmNdepth XmCDepth int dynamic CG
XmNdestroyCallback XmCCallback XtCallbackList NULL C
XmNheight XmCHeight Dimension dynamic CSG
XmNinitialResourcesPersistent XmCInitialResourcesPersistent Boolean True C
XmNmappedWhenManaged XmCMappedWhenManaged Boolean True CSG
XmNsensitive XmCSensitive Boolean True CSG
XmNtranslations XmCTranslations XtTranslations dynamic CSG
XmNwidth XmCWidth Dimension dynamic CSG
XmNx XmCPosition Position 0 CSG
XmNy XmCPosition Position 0 CSG

Translations

XmForm inherits translations from XmBulletinBoard.

RELATED INFORMATION

Composite(3X), Constraint(3X), Core(3X), XmBulletinBoard(3X), XmCreateForm, XmCreateFormDialog(3X), and XmManager(3X).