Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

ControlArea(3W)

NAME

ControlArea − control area widget

SYNOPSIS

#include <Xol/OpenLook.h>
#include <Xol/ControlAre.h>
 . . .

ANCESTRY

Core-Composite-Constraint-Manager-ControlArea

DESCRIPTION

The ControlArea is a composite widget that organizes its child controls in rows and columns. 

Components

The ControlArea widget has zero or more child widgets and an optional border. 

Layout Control

The application can choose one of four simple layout schemes:

Fixed number of columns in the control pane,

fixed number of rows,

fixed overall width of the control area,

and fixed overall height. 

The application can also specify the inter-control spacing and the size of the margin around the children. 

Equal Height Rows

The children in each row align at the top of the row.  The distance between the top of one row and the next is the height of the tallest control in the row plus the application specified inter-row spacing. 

Coloration

of the ControlArea widget. 

  Figure 1 Control Area Coloration

RESOURCES

  Table 1 ControlArea Resource Set

Name                      Type           Default              Access
XtNalignCaptions        Boolean          FALSE                 SGI
XtNancestorSensitive-   Boolean          TRUE                  GO
XtNbackground-          Pixel            XtDefaultBackground   SGI
XtNbackgroundPixmap-    Pixmap           (none)                SGI
XtNborderColor-         Pixel            XtDefaultForeground   SGI
XtNborderPixmap-        Pixmap           (none)                SGI
XtNborderWidth-         Dimension        0                     SGI
XtNcenter               Boolean          FALSE                 SGI
XtNconsumeEvent-        XtCallbackList   NULL                  SG
XtNdepth-               int              (parent’s)            GI
XtNdestroyCallback-     XtCallbackList   NULL                  SI
XtNhPad                 Dimension        4                     SGI
XtNhSpace               Dimension        4                     SGI
XtNheight-              Dimension        (calculated)          SGI
XtNlayoutType           OlDefine         OL_FIXEDROWS          SGI
XtNmappedWhenManaged-   Boolean          TRUE                  SGI
XtNmeasure              int              1                     SGI
XtNsameSize             OlDefine         OL_COLUMNS            SGI
XtNsensitive-           Boolean          TRUE                  GIO
XtNtraversalManager     Boolean          FALSE                 SGI
XtNuserData-            XtPointer        NULL                  SGI
XtNvPad                 Dimension        4                     SGI
XtNvSpace               Dimension        4                     SGI
XtNwidth-               Dimension        (calculated)          SGI
XtNx-                   Position         0                     SGI
XtNy-                   Position         0                     SGI

Access:   S = XtSetValues   G = XtGetValues
            I = init time   O = other access
† see resources(3W)

XtNalignCaptions

 class:XtCAlignCaptionstype:Booleandefault:FALSEFALSE’u’access:SGISGI’u’

Action: controls how the ControlArea widget aligns caption widgets. 

Values: TRUE, FALSE

If set to TRUE the ControlArea will align all Caption widgets in each column so that their captions are right justified.  This may affect the width calculation for a column. 

The effective width for the Caption widgets in a column becomes the sum of the width of the widest caption, plus the largest caption/child widget separation and child widget width.  This alignment is only for groups of Caption widgets with all their captions on the left or the right. 

Mixed orientation, or captions above or below, cannot be aligned well. 

  Figure 2 Aligning Captions

If the XtNalignCaptions resource is set to FALSE the ControlArea will align all Caption widgets the same as other widgets—by their overall width.  This resource takes precedence over the XtNcenter resource, but only for Caption widgets. 

XtNcenter

 class:XtCCentertype:Booleandefault:FALSEFALSE’u’access:SGISGI’u’

Action: controls how the ControlArea orients each widget within a column. 

Values: TRUE – center each widget with each column.  FALSE – left justify each widget within each column, unless the XtNalignCaptions resource is TRUE. 

See Also: XtNalignCaptions. 

XtNhPad

 class:XtCHPadtype:Dimensiondefault:44’u’access:SGISGI’u’

XtNvPad

 class:XtCVPadtype:Dimensiondefault:44’u’access:SGISGI’u’

Action: sets the amount of padding, in pixels, to leave around the edges of the control area. 

Values: 0 ≤ XtNhPad , 0 ≤ XtNvPad

The caption of this resource is

  Figure 3 Padding Around Controls

XtNhSpace

 class:XtCHSpacetype:Dimensiondefault:44’u’access:SGISGI’u’

XtNvSpace

 class:XtCVSpacetype:Dimensiondefault:44’u’access:SGISGI’u’

Action: set the amount of space, in pixels, to leave between controls. 

Values: 0 ≤ XtNhSpace , 0 ≤ XtNvSpace

If the controls are of different sizes in a row or column, the spacing applies to the widest or tallest dimension of all the controls. 

  Figure 4 Spacing Between Controls

XtNlayoutType

 class:XtCLayoutTypetype:OlDefinedefault:OL_FIXEDROWSOL_FIXEDROWS’u’access:SGISGI’u’

Action: controls the layout of the child widgets by the ControlArea. 

Values: OL_FIXEDROWS/fixedrows if the layout should have a fixed number of rows and enough columns to hold all the controls; OL_FIXEDCOLS/fixedcols if the layout should have a fixed number of columns and enough rows to hold all the controls; OL_FIXEDWIDTH/fixedwidth if the layout should be of a fixed width but tall enough to hold all the controls; OL_FIXEDHEIGHT/fixedheight if the layout should be of a fixed height but wide enough to hold all the controls. 

The XtNmeasure resource gives the number of rows or columns or the fixed height or width. 

The choices are to specify the number of rows or columns, or to specify the overall height or width of the layout area.  Only one of these dimensions can be specified directly; the other is determined by the number of controls added. 

For instance, if the application specifies that the control area should have four columns, the number of rows will be the number of controls divided by four. 

XtNmeasure

 class:XtCMeasuretype:intdefault:11’u’access:SGISGI’u’

Action: gives the number of rows or columns in the layout of the child widgets, or the fixed width or height of the control area. 

Values: 0 < XtNmeasure

Default: If XtNlayoutType is OL_FIXEDROWS or OL_FIXEDCOLS then 1.  If XtNlayoutType is OL_FIXEDWIDTH or OL_FIXEDHEIGHT then the width or height of widest or tallest widget, depending on XtNlayoutType.

When XtNlayoutType is OL_FIXEDWIDTH or OL_FIXEDHEIGHT the measure includes the padding on both edges and the inter-control spacing,

  Figure 5 XtNmeasure

XtNsameSize

 class:XtCSameSizetype:OlDefinedefault:OL_COLUMNSOL_COLUMNS’u’access:SGISGI’u’

Action: determines which controls, if any, within the ControlArea widget are forced to be the same width

Values: OL_NONE The controls are placed in fixed-width columns, but the size of each control is left alone.  The width of each column is the width of the widest control in the column.  OL_COLUMNS Controls in each column are made the same width as the widest of them.  The width of each column is thus the width of the widest control in the column.  OL_ALL All controls are made the same width, the width of the widest control in the ControlArea widget. 
 
 

Version 3.0.1  —  Last change: June 92

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026