Manual Page Result
0
Command: XmForm | Section: 3 | Source: Digital UNIX | File: XmForm.3X.gz
XmForm(3X) XmForm(3X)
NAME
XmForm - The Form widget class
SYNOPSIS
#include <Xm/Form.h>
DESCRIPTION
Form is a container widget with no input semantics of its own. Con-
straints 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 deter-
mine 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: Every
child must have an attachment on either the left or the right. If ini-
tialization or XtSetValues leaves a widget without such an attachment,
the result depends upon the value of XmNrubberPositioning.
If XmNrubberPositioning is False, the child is given an XmNleft-
Attachment of XmATTACH_FORM and an XmNleftOffset equal to its
current x value.
If XmNrubberPositioning is True, the child is given an XmNleft-
Attachment of XmATTACH_POSITION and an XmNleftPosition propor-
tional to the current x value divided by the width of the Form.
In either case, if the child has not been previously given an x
value, its x value is taken to be 0, which places the child at
the left side of the Form. If you want to create a child with-
out any attachments, and then later (e.g., after creating and
managing it, but before realizing it) give it a right attachment
via XtSetValues, you must set its XmNleftAttachment to XmAT-
TACH_NONE at the same time. The XmNresizable resource controls
only whether a geometry request by the child will be granted.
It has no effect on whether the child's size can be changed be-
cause of changes in geometry of the Form or of other children.
Every child has a preferred width, based on geometry requests it
makes (whether they are granted or not). If a child has attach-
ments on both the left and the right sides, its size is com-
pletely controlled by the Form. It can be shrunk below its pre-
ferred width or enlarged above it, if necessary, due to other
constraints. In addition, the child's geometry requests to
change its own width may be refused. If a child has attachments
on only its left or right side, it will always be at its pre-
ferred width (if resizable, otherwise at is current width). This
may cause it to be clipped by the Form or by other children. If
a child's left (or right) attachment is set to XmATTACH_SELF,
its corresponding left (or right) offset is forced to 0. The at-
tachment is then changed to XmATTACH_POSITION, with a position
that corresponds to x value of the child's left (or right) edge.
To fix the position of a side at a specific x value use XmAT-
TACH_FORM or XmATTACH_OPPOSITE_FORM with the x value as the left
(or right) offset. Unmapping a child has no effect on the Form
except that the child is not mapped. Unmanaging a child unmaps
it. If no other child is attached to it, or if all children at-
tached to it and all children recursively attached to them are
also all unmanaged, all of those children are treated as if they
did not exist in determining the size of the Form. When using
XtSetValues to change the XmNx resource of a child, you must si-
multaneously set its left attachment to either XmATTACH_SELF or
XmATTACH_NONE. Otherwise, the request is not granted. If XmNre-
sizable is False, the request is granted only if the child's
size can remain the same. A left (or right) attachment of XmAT-
TACH_WIDGET, where XmNleftWidget (or XmNrightWidget) is NULL,
acts like an attachment of XmATTACH_FORM. If an attachment is
made to a widget that is not a child of the Form, but an ances-
tor of the widget is a child of the Form, the attachment is made
to the ancestor.
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 pro-
grammer to specify data. The programmer can also set the resource val-
ues 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
Class: XmCMaxValue Default: 100 Type: int Access: CSG Class: XmCSpac-
ing Default: 0 Type: Dimension Access: CSG Class: XmCRubberPositioning
Default: False Type: Boolean Access: CSG Class: XmCSpacing Default: 0
Type: Dimension Access: CSG
Specifies the denominator used in calculating the relative posi-
tion of a child widget using XmATTACH_POSITION constraints. The
value must not be 0.
If the value of a child's XmNleftAttachment (or XmNrightAttach-
ment) 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) re-
source divided by the value of the Form's XmNfractionBase.
If the value of a child's XmNtopAttachment (or XmNbottomAttach-
ment) 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. 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). Indicates the default near (left) and top attach-
ments 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 ini-
tialization 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 de-
faults 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 dis-
tance from the left or top side of the Form.
If this resource is set to True, XmNleftAttachment and XmNtopAt-
tachment 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 XmNtopPosi-
tion 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. 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
Class: XmCAttachment Default: XmATTACH_NONE Type: unsigned char Ac-
cess: CSG Class: XmCOffset Default: 0 Type: int Access: CSG Class: Xm-
CAttachment Default: 0 Type: int Access: CSG Class: XmCWidget Default:
NULL Type: Widget Access: CSG Class: XmCAttachment Default: XmAT-
TACH_NONE Type: unsigned char Access: CSG Class: XmCOffset Default: 0
Type: int Access: CSG Class: XmCAttachment Default: 0 Type: int Ac-
cess: CSG Class: XmCWidget Default: NULL Type: Widget Access: CSG
Class: XmCBoolean Default: True Type: Boolean Access: CSG Class: Xm-
CAttachment Default: XmATTACH_NONE Type: unsigned char Access: CSG
Class: XmCOffset Default: 0 Type: int Access: CSG Class: XmCAttachment
Default: 0 Type: int Access: CSG Class: XmCWidget Default: NULL Type:
Widget Access: CSG Class: XmCAttachment Default: XmATTACH_NONE Type:
unsigned char Access: CSG Class: XmCOffset Default: 0 Type: int Ac-
cess: CSG Class: XmCAttachment Default: 0 Type: int Access: CSG Class:
XmCWidget Default: NULL Type: Widget Access: CSG
Specifies attachment of the bottom side of the child. It can
have the following values: XmATTACH_NONE--Do not attach the bot-
tom side of the child. XmATTACH_FORM--Attach the bottom side of
the child to the bottom side of the Form. XmATTACH_OPPO-
SITE_FORM--Attach the bottom side of the child to the top side
of the Form. XmNbottomOffset can be used to determine the visi-
bility of the child. XmATTACH_WIDGET--Attach the bottom side of
the child to the top side of the widget or gadget specified in
the XmNbottomWidget resource. If XmNbottomWidget is NULL, XmAT-
TACH_WIDGET is replaced by XmATTACH_FORM, and the child is at-
tached to the bottom side of the Form. XmATTACH_OPPOSITE_WID-
GET--Attach the bottom side of the child to the bottom side of
the widget or gadget specified in the XmNbottomWidget resource.
XmATTACH_POSITION--Attach the bottom side of the child to a po-
sition that is relative to the top side of the Form and in pro-
portion to the height of the Form. This position is determined
by the XmNbottomPosition and XmNfractionBase resources. XmAT-
TACH_SELF--Attach the bottom side of the child to a position
that is proportional to the current y value of the bottom of the
child divided by the height of the Form. This position is deter-
mined by the XmNbottomPosition and XmNfractionBase resources.
XmNbottomPosition is set to a value proportional to the current
y value of the bottom of the child divided by the height of the
Form. Specifies the constant offset between the bottom side of
the child and the object to which it is attached. The relation-
ship established remains, regardless of any resizing operations
that occur. When this resource is explicitly set, the value of
XmNverticalSpacing is ignored. This resource is used to deter-
mine 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 XmNbottomPosi-
tion resource divided by the value of the Form's XmNfraction-
Base. 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. Specifies the
widget or gadget to which the bottom side of the child is at-
tached. 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. 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: XmATTACH_NONE--Do not attach
the left side of the child. If XmNrightAttachment is also XmAT-
TACH_NONE, this value is ignored and the child is given a de-
fault left attachment. XmATTACH_FORM--Attach the left side of
the child to the left side of the Form. XmATTACH_OPPO-
SITE_FORM--Attach the left side of the child to the right side
of the Form. XmNleftOffset can be used to determine the visibil-
ity of the child. XmATTACH_WIDGET--Attach the left side of the
child to the right side of the widget or gadget specified in the
XmNleftWidget resource. If XmNleftWidget is NULL, XmATTACH_WID-
GET is replaced by XmATTACH_FORM, and the child is attached to
the left side of the Form. XmATTACH_OPPOSITE_WIDGET--Attach the
left side of the child to the left side of the widget or gadget
specified in the XmNleftWidget resource. XmATTACH_POSITION--At-
tach the left side of the child to a position that is relative
to the left side of the Form and in proportion to the width of
the Form. This position is determined by the XmNleftPosition and
XmNfractionBase resources. XmATTACH_SELF--Attach the left side
of the child to a position that is proportional to the current x
value of the left side of the child divided by the width of the
Form. This position is determined by the XmNleftPosition and Xm-
NfractionBase resources. XmNleftPosition is set to a value pro-
portional to the current x value of the left side of the child
divided by the width of the Form. 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. 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 rela-
tive 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 XmNleft-
Position resource divided by the value of the Form's XmNfrac-
tionBase. 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. 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. 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 re-
source is True. These conditions are also true for top and bot-
tom attachments, with height acting like width. Specifies at-
tachment 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: XmATTACH_NONE--Do not attach
the right side of the child. XmATTACH_FORM--Attach the right
side of the child to the right side of the Form. XmATTACH_OPPO-
SITE_FORM--Attach the right side of the child to the left side
of the Form. XmNrightOffset can be used to determine the visi-
bility of the child. XmATTACH_WIDGET--Attach the right side of
the child to the left side of the widget or gadget specified in
the XmNrightWidget resource. If XmNrightWidget is NULL, XmAT-
TACH_WIDGET is replaced by XmATTACH_FORM, and the child is at-
tached to the right side of the Form. XmATTACH_OPPOSITE_WID-
GET--Attach the right side of the child to the right side of the
widget or gadget specified in the XmNrightWidget resource.
XmATTACH_POSITION--Attach the right side of the child to a posi-
tion that is relative to the left side of the Form and in pro-
portion to the width of the Form. This position is determined by
the XmNrightPosition and XmNfractionBase resources. XmAT-
TACH_SELF--Attach the right side of the child to a position that
is proportional to the current x value of the right side of the
child divided by the width of the Form. This position is deter-
mined by the XmNrightPosition and XmNfractionBase resources. Xm-
NrightPosition is set to a value proportional to the current x
value of the right side of the child divided by the width of the
Form. 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. 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 rel-
ative 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 Xm-
NrightPosition resource divided by the value of the Form's XmN-
fractionBase. 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. Speci-
fies 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. Specifies attachment
of the top side of the child. It can have following values:
XmATTACH_NONE--Do not attach the top side of the child. If XmN-
bottomAttachment is also XmATTACH_NONE, this value is ignored
and the child is given a default top attachment. XmAT-
TACH_FORM--Attach the top side of the child to the top side of
the Form. XmATTACH_OPPOSITE_FORM--Attach the top side of the
child to the bottom side of the Form. XmNtopOffset can be used
to determine the visibility of the child. XmATTACH_WIDGET--At-
tach the top side of the child to the bottom side of the widget
or gadget specified in the XmNtopWidget resource. If XmNtopWid-
get is NULL, XmATTACH_WIDGET is replaced by XmATTACH_FORM, and
the child is attached to the top side of the Form. XmATTACH_OP-
POSITE_WIDGET--Attach the top side of the child to the top side
of the widget or gadget specified in the XmNtopWidget resource.
XmATTACH_POSITION--Attach the top side of the child to a posi-
tion that is relative to the top side of the Form and in propor-
tion to the height of the Form. This position is determined by
the XmNtopPosition and XmNfractionBase resources. XmAT-
TACH_SELF--Attach the top side of the child to a position that
is proportional to the current y value of the child divided by
the height of the Form. This position is determined by the XmN-
topPosition and XmNfractionBase resources. XmNtopPosition is set
to a value proportional to the current y value of the child di-
vided by the height of the Form. 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 ex-
plicitly set, the value of XmNverticalSpacing is ignored. This
resource is used to determine the position of the top side of
the child when the child's XmNtopAttachment is set to XmAT-
TACH_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 XmNtopPosi-
tion 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.
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
Class: XmCAllowOverlap Default: True Type: Boolean Access: CSG Class:
XmCAutoUnmanage Default: True Type: Boolean Access: CG Class: XmCBut-
tonFontList Default: dynamic Type: XmFontList Access: CSG Class: Xm-
CWidget Default: NULL Type: Widget Access: SG Class: XmCWidget De-
fault: NULL Type: Widget Access: SG Class: XmCDefaultPosition Default:
True Type: Boolean Access: CSG Class: XmCDialogStyle Default: dynamic
Type: unsigned char Access: CSG Class: XmCDialogTitle Default: NULL
Type: XmString Access: CSG Class: XmCCallback Default: NULL Type:
XtCallbackList Access: C Class: XmCLabelFontList Default: dynamic Type:
XmFontList Access: CSG Class: XmCCallback Default: NULL Type: XtCall-
backList Access: C Class: XmCMarginHeight Default: 0 Type: Dimension
Access: CSG Class: XmCMarginWidth Default: 0 Type: Dimension Access:
CSG Class: XmCNoResize Default: False Type: Boolean Access: CSG Class:
XmCResizePolicy Default: XmRESIZE_ANY Type: unsigned char Access: CSG
Class: XmCShadowType Default: XmSHADOW_OUT Type: unsigned char Access:
CSG Class: XmCTextFontList Default: dynamic Type: XmFontList Access:
CSG Class: XmCTranslations Default: NULL Type: XtTranslations Access:
C Class: XmCCallback Default: NULL Type: XtCallbackList Access: C
XmManager Resource Set
Class: XmCBottomShadowColor Default: dynamic Type: Pixel Access: CSG
Class: XmCBottomShadowPixmap Default: XmUNSPECIFIED_PIXMAP Type:
Pixmap Access: CSG Class: XmCForeground Default: dynamic Type: Pixel
Access: CSG Class: XmCCallback Default: NULL Type: XtCallbackList Ac-
cess: C Class: XmCHighlightColor Default: dynamic Type: Pixel Access:
CSG Class: XmCHighlightPixmap Default: dynamic Type: Pixmap Access:
CSG Class: XmCInitialFocus Default: dynamic Type: Widget Access: CSG
Class: XmCNavigationType Default: XmTAB_GROUP Type: XmNavigationType
Access: CSG Class: XmCShadowThickness Default: dynamic Type: Dimension
Access: CSG Class: XmCStringDirection Default: dynamic Type: Xm-
StringDirection Access: CG Class: XmCTopShadowColor Default: dynamic
Type: Pixel Access: CSG Class: XmCTopShadowPixmap Default: dynamic
Type: Pixmap Access: CSG Class: XmCTraversalOn Default: True Type:
Boolean Access: CSG Class: XmCUnitType Default: dynamic Type: unsigned
char Access: CSG Class: XmCUserData Default: NULL Type: XtPointer Ac-
cess: CSG
Composite Resource Set
Class: XmCReadOnly Default: NULL Type: WidgetList Access: G Class: Xm-
CInsertPosition Default: NULL Type: XtOrderProc Access: CSG Class: Xm-
CReadOnly Default: 0 Type: Cardinal Access: G
Core Resource Set
Class: XmCAccelerators Default: dynamic Type: XtAccelerators Access:
N/A Class: XmCSensitive Default: dynamic Type: Boolean Access: G
Class: XmCBackground Default: dynamic Type: Pixel Access: CSG Class:
XmCPixmap Default: XmUNSPECIFIED_PIXMAP Type: Pixmap Access: CSG
Class: XmCBorderColor Default: XtDefaultForeground Type: Pixel Access:
CSG Class: XmCPixmap Default: XmUNSPECIFIED_PIXMAP Type: Pixmap Ac-
cess: CSG Class: XmCBorderWidth Default: 0 Type: Dimension Access: CSG
Class: XmCColormap Default: dynamic Type: Colormap Access: CG Class:
XmCDepth Default: dynamic Type: int Access: CG Class: XmCCallback De-
fault: NULL Type: XtCallbackList Access: C Class: XmCHeight Default:
dynamic Type: Dimension Access: CSG Class: XmCInitialResourcesPersis-
tent Default: True Type: Boolean Access: C Class: XmCMappedWhenManaged
Default: True Type: Boolean Access: CSG Class: XmCScreen Default: dy-
namic Type: Screen * Access: CG Class: XmCSensitive Default: True
Type: Boolean Access: CSG Class: XmCTranslations Default: dynamic
Type: XtTranslations Access: CSG Class: XmCWidth Default: dynamic
Type: Dimension Access: CSG Class: XmCPosition Default: 0 Type: Posi-
tion Access: CSG Class: XmCPosition Default: 0 Type: Position Access:
CSG
Translations
XmForm inherits translations from XmBulletinBoard.
SEE ALSO
Composite(3X), Constraint(3X), Core(3X), XmBulletinBoard(3X), XmCreate-
Form(3X), XmCreateFormDialog(3X), XmManager(3X)
XmForm(3X)