Table of Contents
XfwfGroup
The Group widget is a subclass of RowCol, which means that
it arranges its children in rows and columns. (See the Row
Col widget for the resources that influence the layout.) The
Group widget adds two things to the capabilities already
present in RowCol, namely a label in the upper left hand
corner and the ability to make a number of Toggle buttons
act as radio buttons.
The label is a short, one line piece of text, that is dis
played over the border in the top left corner. The border is
interupted at that point. Since this works best with
`ledged' or `chiseled' border types, the default border is
XfwfChiseled.
The special support for radio buttons works as follows: when
a child is added the Group widget checks if it is of class
XfwfToggle or a subclass thereof. If so, the Group widget
installs a callback in it. When the toggle button is then
activated, the Group widget determines which other buttons
need to be turned off. All toggle buttons are given an
implicit number. The first one to be added is number 0.
There are three selection styles, settable through the
selectionStyle resource:
1) `single' (XfwfSingleSelection) means that at most one of
the toggle buttons may be on, but it is possible that they
are all off. When one of the buttons is turned on, all oth
ers are turned off automatically. The resource selection
holds the number of the button that is on, or -1 if they are
all off.
2) `one' (XfwfOneSelection) means that at all times exactly
one button is turned on. It is not possible to turn buttons
off, except by toggling another one to on. The resource
selection holds the number of the button that is currently
on.
3) `multi' or `multiple' (XfwfMultipleSelection) means that
any number of buttons may be on. No buttons are turned off
automatically. The resource selection has one bit set for
each button that is on. Thus, if buttons 1, 4 and 5 are on,
the value of selection is (1<<1 + 1<<4 + 1<<5 =) 0x62. Note
that this limits the number of buttons that is recorded in
selection to the first 32. It is still possible to have more
buttons, but the application will then have to use callbacks
or other means to keep track of the toggle buttons.
4) `none' (XfwfNoSelection) turns off any special handling
of toggle buttons. The value of the selection resource is
undefined.
Applications may of course install callbacks on the toggle
buttons, but a simpler way is to attach to the activateCall
back of the Group widget itself, or use no callback at all
and simply inspect the selection resource when needed.
It is recommended that application visually differentiate
between selection styles. One way would be to use different
graphics in the toggle buttons, e.g., the Motif convention
that radiobuttons have an empty or colored diamond, and nonexclusive
toggles a square. Suitable icons are already
defined by the Common widget.
Public variables
_______________________________________________________________________________
- |
- XfwfGroup
| Name | Class | Type | Default
| XtNlabel | XtCLabel | String | NULL
| XtNfont | XtCFont | FontStruct | XtDefaultFont
| XtNforeground | XtCForeground | Pixel | XtDefaultForeground
| XtNselectionStyle| XtCSelectionStyle| SelectionType | XfwfSingleSelection
| XtNselection | XtCSelection | long | 0
| XtNactivate | XtCActivate | Callback | NULL
| | | |
|__________________|___________________|________________|______________________
XtNlabel
The label must be a single line. It is displayed super
imposed on the frame, in the upper lefthand corner.
Currently, it must be simple string in a single font.
XtNfont
The font for the label is set with font.
XtNforeground
The foreground color is the color used to draw the
text.
XtNselectionStyle
The selectionStyle resource determines how the Group
widget treats the child widgets that are of class
XfwfToggle or a subclass thereof. The possible values
are XfwfNoSelection, XfwfSingleSelection (default),
XfwfOneSelection and XfwfMultipleSelection. The meaning
is as explained above. There is a converter from
strings, that recognizes the strings `no', `none',
`single', `one', `multi', and `multiple', in upper or
lower case.
XtNselection
The resource selection holds the state of the toggle
buttons (if any). If selectionType = XfwfSingleSelec
tion or XfwfOneSelection, it holds the number of the
buttons that is currently on, or -1 if they are all
off. If selectionType = XfwfMultipleSelection, it is a
bitmap with one bit set for each button that is on.
(See the introduction above for more information.)
The value can also be set (e.g., through XtSetValues);
the result is that the corresponding toggle buttons
will be turned on or off.
XtNactivate
The callback activate can be used by applications that
want to be informed of any change to the state of the
toggle buttons as soon as it happens. Other applica
tions can simply use XtGetValues to get the value of
the selection resource. The callback will be called
with the value of selection as call_data argument.
XtNframeType
The default border type is different from that of its
superclass RowCol. It is set to XfwfChiseled because
that is the conventional border type around radio but
tons, and because it looks better when there is a label
superimposed on it.
XtNinnerOffset
The default value for innerOffset is set to 3 pixels,
which makes it a little bit more likely that the
descenders of the label will stay visible.
- _____________________________________________________________
-
- |
- XfwfRowCol
- | Name
- | Class | Type | Default
| XtNstoreByRow | XtCStoreByRow | Boolean | True
- | XtNrows
- | XtCRows | Int | 0
| XtNcolumns | XtCColumns | Int | 0
| XtNalignment | XtCAlignment | Alignment | XfwfTopLeft
| XtNshrinkToFit| XtCShrinkToFit| Boolean | False
| | | |
|_______________|________________|____________|______________
- _____________________________________________________
-
- |
- XfwfBoard
- | Name
- | Class | Type | Default
- | XtNabs_x
- | XtCAbs_x | Position | 0
- | XtNrel_x
- | XtCRel_x | Float | "0.0"
- | XtNabs_y
- | XtCAbs_y | Position | 0
- | XtNrel_y
- | XtCRel_y | Float | "0.0"
| XtNabs_width | XtCAbs_width | Position | 0
| XtNrel_width | XtCRel_width | Float | "1.0"
| XtNabs_height| XtCAbs_height| Position | 0
| XtNrel_height| XtCRel_height| Float | "1.0"
- | XtNhunit
- | XtCHunit | Float | "1.0"
- | XtNvunit
- | XtCVunit | Float | "1.0"
| XtNlocation | XtCLocation | String | NULL
| | | |
|______________|_______________|___________|_________
________________________________________________________________________________________
- |
- XfwfFrame
| Name | Class | Type | Default
| XtNcursor | XtCCursor | Cursor | None
| XtNframeType | XtCFrameType | FrameType | XfwfRaised
| XtNframeWidth | XtCFrameWidth | Dimension | 0
| XtNouterOffset | XtCOuterOffset | Dimension | 0
| XtNinnerOffset | XtCInnerOffset | Dimension | 0
| XtNshadowScheme | XtCShadowScheme | ShadowScheme | XfwfAuto
| XtNtopShadowColor | XtCTopShadowColor | Pixel | compute_topcolor
| XtNbottomShadowColor | XtCBottomShadowColor | Pixel | compute_bottomcolor
| XtNtopShadowStipple | XtCTopShadowStipple | Bitmap | NULL
| XtNbottomShadowStipple| XtCBottomShadowStipple| Bitmap | NULL
| | | |
|_______________________|________________________|_______________|______________________
___________________________________________________________________________________
- |
- XfwfCommon
| Name | Class | Type | Default
| XtNtraversalOn | XtCTraversalOn | Boolean | True
| XtNhighlightThickness| XtCHighlightThickness| Dimension | 2
| XtNhighlightColor | XtCHighlightColor | Pixel | XtDefaultForeground
| XtNhighlightPixmap | XtCHighlightPixmap | Pixmap | None
| XtNnextTop | XtCNextTop | Callback | NULL
| XtNuserData | XtCUserData | Pointer | NULL
| | | |
|______________________|_______________________|____________|______________________
- _____________________________________________________________
-
- |
- Composite
- | Name
- | Class | Type | Default
| XtNchildren | XtCChildren | WidgetList | NULL
| insertPosition| XtCInsertPosition| XTOrderProc | NULL
| numChildren | XtCNumChildren | Cardinal | 0
| | | |
|_______________|___________________|______________|_________
______________________________________________________________________
- |
- Core
- | Name | Class | Type | Default
-
- | XtNx
- | XtCX | Position | 0
- | XtNy
- | XtCY | Position | 0
- | XtNwidth
- | XtCWidth | Dimension | 0
- | XtNheight
- | XtCHeight | Dimension | 0
- | borderWidth
- | XtCBorderWidth | Dimension | 0
- | XtNcolormap
- | XtCColormap | Colormap | NULL
- | XtNdepth
- | XtCDepth | Int | 0
| destroyCallback | XtCDestroyCallback | XTCallbackList | NULL
| XtNsensitive | XtCSensitive | Boolean | True
- | XtNtm
- | XtCTm | XTTMRec | NULL
| ancestorSensitive| XtCAncestorSensitive| Boolean | False
| accelerators | XtCAccelerators | XTTranslations | NULL
- | borderColor
- | XtCBorderColor | Pixel | 0
| borderPixmap | XtCBorderPixmap | Pixmap | NULL
- | background
- | XtCBackground | Pixel | 0
| backgroundPixmap | XtCBackgroundPixmap | Pixmap | NULL
| mappedWhenManaged| XtCMappedWhenManaged| Boolean | True
- | XtNscreen
- | XtCScreen | Screen * | NULL
| | | |
|__________________|______________________|_________________|_________
Exports
The SelectionType type is exported to the public header
file.
type
SelectionType = enum {
XfwfNoSelection, XfwfSingleSelection,
XfwfOneSelection, XfwfMultipleSelection }
Table of Contents