Nonexclusives(3W)
NAME
Nonexclusives − nonexclusive choice widget
SYNOPSIS
#include <Xol/OpenLook.h>
#include <Xol/Nonexclusi.h>
. . .
ANCESTRY
Core-Composite-Constraint-Manager-Nonexclusives
DESCRIPTION
The Nonexclusives provides layout management and selection control for a set of rectangular buttons or check boxes. It provides a simple way to build a several-of-many button selection object.
Layout and Labels
The Nonexclusives widget lays out the rectangular buttons or check boxes in a grid in the order they are added as child widgets by the application. The number of rows or columns in this grid can be controlled by the application. If the grid has more than one row, the Nonexclusives widget forces the rectangular buttons or check boxes in each column to be the same size as the widest in the column.
Note: If the grid is a single row, each button will be only as wide as necessary to display the label.
The rectangular buttons or check boxes are separated by a distance that is 50% of the prevailing point size for the containing window.
Figure 1 Example of Nonexclusives Buttons "Nonexclusives buttons"
Use in Menu
The Nonexclusives widget can be added as a single child to a menu pane to implement a several-of-many menu choice. Only RectButton widgets can be used in a Nonexclusives widget in a menu.
Restrictions on Children
Child widgets of a Nonexclusives widget must all be from either: rectButtonWidgetClass, or checkBoxWidgetClass.
In addition, all the child widgets must be of the same class.
Coloration
There is no explicit foreground or background in the Nonexclusives composite widget; each rectangular button has its own foreground and background. The space between the rectangular buttons or check boxes is the same color or pixmap as the parent of the Nonexclusives widget.
Keyboard Traversal
The Nonexclusives widget manages the traversal between a set of RectButtons. When the user traverses to a Nonexclusives widget, the first RectButton in the set will receive input focus. The MOVEUP, MOVEDOWN, MOVERIGHT, and MOVELEFT keys move the input focus between the RectButtons. To traverse out of the Nonexclusives widget, the following keys can be used:
—NEXT_FIELD moves to the next traversable widget in the window
—PREV_FIELD moves to the previous traversable widget in the window
—NEXTWINDOW moves to the next window in the application.
—PREVWINDOW moves to the previous window in the application.
—NEXTAPP moves to the first window in the next application.
—PREVAPP moves to the first window in the previous application.
These controls have two states: "set" and "not set". Pressing the SELECTKEY on a nonexclusive control will toggle the current state. If the control is in a menu, then the MENUKEY will also toggle the current state. If the control is "set", then toggling the control will call the XtNunselect callback list. If the control is "not set", then toggling the control will call the XtNselect callback list.
RESOURCES
Table 1 Nonexclusive Button Resource Set
Name Type Default Access
XtNancestorSensitive- Boolean TRUE GO
XtNconsumeEvent- XtCallbackList NULL SG
XtNdepth- int (parent’s) GI
XtNdestroyCallback- XtCallbackList NULL SI
XtNheight- Dimension (calculated) SGI
XtNlayoutType- OlDefine OL_FIXEDROWS SGI
XtNmappedWhenManaged- Boolean TRUE SGI
XtNmeasure- int 1 SGI
XtNreferenceName- String NULL GI
XtNreferenceWidget- Widget NULL GI
XtNsensitive- Boolean TRUE GIO
XtNtraversalOn- Boolean TRUE SGI
XtNuserData- XtPointer NULL 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)
XtNlayoutType
class:XtCLayoutTypetype:OlDefinedefault:OL_FIXEDROWSOL_FIXEDROWS’u’access:SGISGI’u’
Action: controls the type of layout of the child widgets by the Nonexclusives composite.
Values: OL_FIXEDROWS/fixedrows – if the layout should have a fixed number of rows; OL_FIXEDCOLS/fixedcols – if the layout should have a fixed number of columns.
The choices are to specify the number of rows or the number of columns. Only one of these dimensions can be specified directly; the other is determined by the number of child widgets added, and will always be enough to show all the child widgets.
XtNmeasure
class:XtCMeasuretype:intdefault:11’u’access:SGISGI’u’
Action: gives the number of rows or columns in the layout of the child widgets.
Values: 0 < XtNmeasure
If there are not enough child widgets to fill a row or column, the remaining space is left blank. If there is only one row (column), and it is not filled with child widgets, the remaining “space” is of zero width (height).
SEE ALSO
Version 3.0.1 — Last change: June 92