Manual pages › OPEN LOOK widgets (3W)
olForm(3W)
Form
From the original Amiga UNIX 2.1 manual. Some things it mentions may not be in this release.
WIDGET CLASS NAME · SYNOPSIS · DESCRIPTION · RESOURCES · CONSTRAINT RESOURCES
WIDGET CLASS NAME
Form
SYNOPSIS
#include <Intrinsic.h> #include <StringDefs.h> #include <OpenLook.h> #include <Form.h> widget = XtCreateWidget(name, formWidgetClass, ...);
DESCRIPTION
The Form widget is a constraint-based manager that provides a layout language used to establish spatial relationships between its children. It then manipulates these relationships when the Form is resized, new children are added to the Form, or its children are moved, resized, unmanaged, remanaged, rearranged, or destroyed.
Spanning Constraints A widget can be created with a set of constraints in such a manner that it spans the width or height of a form. Constraints that cause a widget to span both the width and height of a form can also be specified. Row Constraints Sets of widgets can be set up as a row so that resizing a form may increase or decrease the spacing between the widgets. The form may also make the widgets smaller if desired. Column Constraints Sets of widgets can be displayed in a single column or in multiple columns. The form may increase or decrease the spacing between widgets or resize the widg- ets. Automatic Form Resizing The form calculates new sizes or positions for its children whenever they change size or position. The new form size thus generated is passed as a geometry request to the parent of the form. Once resized, the form, using its children's constraints, tries to rear- range its children as intelligently as possible.
Managing, Unmanaging and Destroying Children When a widget within a form is unmanaged or destroyed, it is removed from the constraint processing and the constraints are reprocessed to reposition and/or resize the form and its contents. Any widgets that referenced it are rereferenced to the widget that it had been referencing. For the unmanaged case, if the widget is remanaged, the widgets that were previously referencing it are rereferenced to it, thereby reestablishing the original layout.
Amiga Unix Last change: 1
Works with All Children The Form composite widget works with all the widgets defined in this document, except those that are sub-classed from the Shell widget class.
Keyboard Traversal Users can traverse among Text and Text-Field widgets within any ancestor ControlArea, Bulletin-Board, or Form widget using the NEXTFIELD and PREVFIELD keys:
- NEXTFIELD moves the caret to the next traversable Text or TextField widget in the managing ancestor widget. When the caret is in the last traversable field, NEXTFIELD moves the caret to the first traversable field.
- PREVFIELD moves the caret to the previous traversable
field in the managing ancestor widget. When the caret
is in the first traversable field, PREVFIELD moves the
caret to the last traversable field. The default key
mappings for NEXTFIELD and PREVFIELD are TAB and
SHIFT-TAB, respectively. A user may change these
defaults through the appropriate Workspace Properties
window.
Form Coloration Figure 1 illustrates the resources that
affect the coloration of the Form widget.
Figure 1. Form Coloration
Amiga Unix Last change: 2
RESOURCES
______________________________________________________________________________________
_______________________________Form_Resource_Set\*(cO_________________________________
Name Class Type Default Access
______________________________________________________________________________________
Amiga Unix Last change: 3
() MISC. REFERENCE MANUAL PAGES ()
______________________________________________________________________________________
_XtNancestorSensitive___XtCSenstitive__________Boolean__________TRUE___________G*_____
| XtNbackground XtCBackground Pixel White SGI- |
|_____________________|______________________|________________|______________|________|
|_XtNbackgroundPixmap_|__XtCPixmap___________|__Pixmap________|__(none)______|__SGI-__|
| XtNborderColor | XtCBorderColor | Pixel | Black | SGI- |
|_____________________|______________________|________________|______________|________|
|_XtNborderPixmap_____|__XtCPixmap___________|__Pixmap________|__(none)______|__SGI-__|
| XtNborderWidth | XtCBorderWidth | Dimension | 0 | SGI |
|_____________________|______________________|________________|______________|________|
|_XtNdepth____________|__XtCDepth____________|__int___________|__(parent's)__|__GI____|
| XtNdestroyCallback | XtCCallback | XtCallbackList| NULL | SI |
|_____________________|______________________|________________|______________|________|
|_XtNheight___________|__XtCHeight___________|__Dimension_____|__(calculated)|__SGI___|
| XtNmappedWhenManaged| XtCMappedWhenManaged| Boolean | TRUE | SGI |
|_____________________|______________________|________________|______________|________|
|_XtNsensitive________|__XtCSensitive________|__Boolean_______|__TRUE________|__GI*___|
| XtNtraversalManager | XtCTraversalManager | Boolean | FALSE | SGI |
|_____________________|______________________|________________|______________|________|
|_XtNuserData_________|__XtCUserData_________|__XtPointer_____|__NULL________|__SGI___|
| XtNwidth | XtCWidth | Dimension | (calculated)| SGI |
|_____________________|______________________|________________|______________|________|
|_XtNx________________|__XtCPosition_________|__Position______|__0___________|__SGI___|
| XtNy | XtCPosition | Position | 0 | SGI |
|_____________________|______________________|________________|______________|________|
CONSTRAINT RESOURCES
Each child widget attached to the Form composite widget is
constrained by the following resources: (In essence, these
resources become resources for each child widget and can be
set and read just like any other resources defined for the
child.)___________________________________________________________
Form Constraint Resource Set\*(cO
__________________________________________________________________
_Name_______________Class______________Type______Default___Access_
Amiga Unix Last change: 1
() MISC. REFERENCE MANUAL PAGES ()
__________________________________________________________________
_XtNxAddWidth_______XtCXAddWidth_______Boolean___FALSE_____SGI____
XtNxAttachOffset XtCXAttachOffset int 0 SGI
__________________________________________________________________
_XtNxAttachRight____XtCXAttachRight____Boolean___FALSE_____SGI____
XtNxOffset XtCXOffset int 0 SGI
__________________________________________________________________
_XtNxRefName________XtCXRefName________String____NULL______SGI____
XtNxRefWidget XtCXRefWidget Widget (form) SGI
__________________________________________________________________
_XtNxResizable______XtCXResizable______Boolean___FALSE_____SGI____
XtNxVaryOffset XtCXVaryOffset Boolean FALSE SGI
__________________________________________________________________
_XtNyAddHeight______XtCYAddHeight______Boolean___FALSE_____SGI____
XtNyAttachBottom XtCYAttachBottom Boolean FALSE SGI
__________________________________________________________________
_XtNyAttachOffset___XtCYAttachOffset___int_______0_________SGI____
XtNyOffset XtCYOffset int 0 SGI
__________________________________________________________________
_XtNyRefName________XtCYRefName________String____NULL______SGI____
XtNyRefWidget XtCYRefWidget Widget (form) SGI
__________________________________________________________________
_XtNyResizable______XtCYResizable______Boolean___FALSE_____SGI____
XtNyVaryOffset XtCYVaryOffset Boolean FALSE SGI
__________________________________________________________________
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | |
| | | |
Amiga Unix Last change: 1
() MISC. REFERENCE MANUAL PAGES ()
XtNxAddWidth
XtNyAddHeight
Range of Values:
TRUE
FALSE
These resources indicate whether to add the width or height of the corresponding reference widget to a widget's location when determining the widget's position.
XtNxAttachOffset
XtNyAttachOffset
Range of Values:
0 < XtNxAttachOffset
0 < XtNyAttachOffset
When a widget is attached to the right or bottom edge of the form, the separation between the widget and the form defaults to zero pixels. These resources allow that separation to be set to some other value. Also, for widgets that are not attached to the right or bottom edge of the form, these resources specify the minimum spacing between the widget and the form.
XtNxAttachRight
XtNyAttachBottom
Range of Values:
TRUE
FALSE
Widgets are normally referenced from ``form left'' to ``form right'' or from ``form top'' to ``form bottom.'' These resources allow this reference to occur on the opposite edges of the form. When used with the XtNxVaryOffset and XtNyVaryOffset resources, they allow a widget to float along the right or bottom edge of the form. This is done by setting both the XtNxAttachRight (XtNyAttachBottom) and XtNxVaryOffset (XtNyVaryOffset) resources to TRUE. A widget can also span the width (height) of the form by setting the XtNxAttachRight (XtNyAttachBottom) resource to TRUE and the XtNxVaryOffset (XtNyVaryOffset) resource to FALSE.
XtNxOffset
XtNyOffset
Range of Values:
0 < XtNxOffset
0 < XtNyOffset
Amiga Unix Last change: 2
() MISC. REFERENCE MANUAL PAGES ()
The location of a widget is determined by the widget it references. As the default, a widget's position on the form exactly matches its reference widget's location. There are two additional data used to determine the location. These resources define integer values representing the number of pixels to add to the reference widget's location when calculating the widget's location.
Amiga Unix Last change: 3
() MISC. REFERENCE MANUAL PAGES ()
XtNxRefName
XtNyRefName
Range of Values:
(the name of a widget already created as a child of the form)
When a widget is added as a child of the form, its position is determined by the widget it references. These resources allow the name of the reference widget to be given. The form converts this name to a widget to use for the referencing. Any widget that is a direct child of the form or the form widget itself can be used as a reference widget. If one of these resources is set and the corresponding resource, XtNxRefWidget or XtNyRefWidget, is also set, they must agree: the name given in XtNxRefName or XtNyRefName must match the name of the identified widget.
XtNxRefWidget
XtNyRefWidget
Range of Values:
(the ID of a widget already created as a child)
Instead of naming the reference widget, an application can give the reference widget's ID using these resources. If both a widget ID and a widget name is given for a reference in the same dimension (x or y), they must refer to the same widget. If not, a warning is made and the widget referred to by name is used.
XtNxResizable
XtNyResizable
Range of Values:
TRUE
FALSE
These resources specify whether the form can resize (expand or shrink) a widget. When a form's size becomes smaller, the form will resize its children only after resizing all the inter-widget spacing of widgets with their XtNxVaryOffset (XtNyVaryOffset) resource set to TRUE. The form keeps track of a widget's initial size or its size generated through calls to XtSetValues(), so that when the form then becomes larger, the widget will grow to its original size and no larger.
XtNtraversalManager
This resource controls whether this widget manages traversal for its descendants.
Amiga Unix Last change: 4
() MISC. REFERENCE MANUAL PAGES ()
XtNxVaryOffset
XtNyVaryOffset
Range of Values:
TRUE
FALSE
When a form is resized, it processes the constraints contained within its children. These resources allow the spacing between a widget and the widget it references to vary (either increase or decrease) when a form's size changes. For widgets that directly reference the form widget, these resources are ignored. The spacing between a widget and its reference widget can decrease to zero pixels if the XtNxAddWidth (XtNyAddHeight) resource is FALSE or to one pixel if XtNxAddWidth (XtNyAddHeight) is TRUE.
Amiga Unix Last change: 5