XmSimpleSpinBox(3) | Library Functions Manual | XmSimpleSpinBox(3) |
XmSimpleSpinBox — a simple SpinBox widget class
#include <Xm/SSpinB.h>
The XmSimpleSpinBox widget is a user interface control to increment and decrement an arbitrary TextField. For example, it can be used to cycle through the months of the year or days of the month.
Widget subclassing is not supported for the XmSimpleSpinBox widget class.
The XmSimpleSpinBox widget inherits behavior and resources from the Core, Composite and XmManager classes.
The class pointer is XmSimpleSpinBoxWidgetClass.
The class name is XmSimpleSpinBoxWidget.
The following table defines a set of widget resources used by the application to specify data. The application can also set the resource values for the inherited classes to set attributes for this widget. To reference a resource by name or by class in a .Xdefaults file, the application must 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, the application must remove the Xm prefix and use the remaining letters (in either lower case or upper case, but including 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).
XmSimpleSpinBox Resource | ||||
Set | ||||
Name | Class | Type | Default | Access |
XmNarrowLayout | XmCArrowLayout | unsigned char | XmARROWS_END | CSG |
XmNarrowSensitivity | XmCArrowSensitivity | unsigned char | XmARROWS-_SENSITIVE | CSG |
XmNcolumns | XmCColumn | short | 20 | CSG |
XmNdecimalPoints | XmCDecimalPoints | short | 0 | CSG |
XmNeditable | XmCEditable | Boolean | True | CSG |
XmNincrementValue | XmCIncrementValue | int | 1 | CSG |
XmNinitialDelay | XmCInitialDelay | unsigned int | 250 | CSG |
XmNmaximumValue | XmCMaximumValue | int | 10 | CSG |
XmNminimumValue | XmCMinimumValue | int | 0 | CSG |
XmNmodifyVerifyCallback | XmCCallback | XtCallbackList | NULL | C |
XmNnumValues | XmCNumValues | int | 0 | CSG |
XmNposition | XmCPosition | int | 0 | CSG |
XmNrepeatDelay | XmCRepeatDelay | unsigned int | 200 | CSG |
XmNspinBoxChildType | XmCSpinBoxChildType | unsigned char | XmSTRING | CG |
XmNtextField | XmCTextField | Widget | dynamic | G |
XmNvalueChangedCallback | XmCCallback | XtCallbackList | NULL | C |
XmNvalues | XmCValues | XmStringTable | NULL | CSG |
The XmSimpleSpinBox widget inherits behavior and resources from the following named superclasses. For a complete description of each resource, see the man page for that superclass.
XmManager Resource | ||||
Set | ||||
Name | Class | Type | Default | Access |
XmNbottomShadowColor | XmCBottomShadowColor | Pixel | dynamic | CSG |
XmNbottomShadowPixmap | XmCBottomShadowPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
XmNforeground | XmCForeground | Pixel | dynamic | CSG |
XmNhelpCallback | XmCCallback | XtCallbackList | NULL | C |
XmNhighlightColor | XmCHighlightColor | Pixel | dynamic | CSG |
XmNhighlightPixmap | XmCHighlightPixmap | Pixmap | dynamic | CSG |
XmNinitialFocus | XmCInitialFocus | Widget | NULL | CSG |
XmNnavigationType | XmCNavigationType | XmNavigationType | dynamic | CSG |
XmNshadowThickness | XmCShadowThickness | Dimension | dynamic | CSG |
XmNstringDirection | XmCStringDirection | XmStringDirection | dynamic | CG |
XmNtopShadowColor | XmCTopShadowColor | Pixel | dynamic | CSG |
XmNtopShadowPixmap | XmCTopShadowPixmap | Pixmap | dynamic | CSG |
XmNtraversalOn | XmCTraversalOn | Boolean | dynamic | CSG |
XmNunitType | XmCUnitType | unsigned char | dynamic | CSG |
XmNuserData | XmCUserData | XtPointer | NULL | CSG |
Composite Resource | ||||
Set | ||||
Name | Class | Type | Default | Access |
XmNchildren | XmCReadOnly | WidgetList | NULL | G |
XmNinsertPosition | XmCInsertPosition | XtOrderProc | default procedure | CSG |
XmNnumChildren | XmCReadOnly | Cardinal | 0 | G |
Core Resource Set | ||||
Name | Class | Type | Default | Access |
XmNaccelerators | XmCAccelerators | XtAccelerators | dynamic | CSG |
XmNancestorSensitive | XmCSensitive | Boolean | dynamic | G |
XmNbackground | XmCBackground | Pixel | dynamic | CSG |
XmNbackgroundPixmap | XmCPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
XmNborderColor | XmCBorderColor | Pixel | XtDefaultForeground | CSG |
XmNborderPixmap | XmCPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
XmNborderWidth | XmCBorderWidth | Dimension | 0 | CSG |
XmNcolormap | XmCColormap | Colormap | dynamic | CG |
XmNdepth | XmCDepth | int | dynamic | CG |
XmNdestroyCallback | XmCCallback | XtCallbackList | NULL | C |
XmNheight | XmCHeight | Dimension | dynamic | CSG |
XmNinitialResourcesPersistent | XmCInitialResourcesPersistent | Boolean | True | C |
XmNmappedWhenManaged | XmCMappedWhenManaged | Boolean | True | CSG |
XmNscreen | XmCScreen | Screen * | dynamic | CG |
XmNsensitive | XmCSensitive | Boolean | True | CSG |
XmNtranslations | XmCTranslations | XtTranslations | dynamic | CSG |
XmNwidth | XmCWidth | Dimension | dynamic | CSG |
XmNx | XmCPosition | Position | 0 | CSG |
XmNy | XmCPosition | Position | 0 | CSG |
A pointer to the following structure is passed to each XmSimpleSpinBox callback:
typedef struct {
int reason;
XEvent *event;
Widget widget;
Boolean doit;
int position;
XmString value;
Boolean crossed_boundary; } XmSimpleSpinBoxCallbackStruct;
The reason argument indicates why the callback was invoked. There are three possible reasons for this callback to be issued. The reason is XmCR_OK when this is the first call to the callback at the beginning of a spin or if it is a single activation of the spin arrows. If the XmSimpleSpinBox is in the process of being continuously spun, then the reason will be XmCR_SPIN_NEXT or XmCR_SPIN_PRIOR, depending on the arrow that is spinning.
The event argument points to the XEvent that triggered the callback. It can be NULL when the XmSimpleSpinBox is continuously spinning.
The widget argument is the widget identifier for the simple spin box widget that has been affected by this callback.
The doit argument is set only when the call_data comes from the XmNmodifyVerifyCallback. It indicates that the action that caused the callback to be called should be performed. The action is not performed if doit is set to False.
The position argument is the new value of the XmNposition resource as a result of the spin.
The value argument is the new XmString value displayed in the Text widget as a result of the spin. The application must copy this string if it is used beyond the scope of the call_data structure.
The crossed_boundary argument is True when the spinbox cycles. This is the case when a XmNspinBoxChildType of XmSTRING wraps from the first item to the last or the last item to the first. In the case of the XmNspinBoxChildType of XmNUMERIC, the boundary is crossed when the XmSimpleSpinBox cycles from the maximum value to the minimum or vice versa.
The toolkit will display a warning if the application tries to set the value of the XmNtextField resource, which is read-only (marked G in the resource table).
XmSpinBox(3), XmCreateSimpleSpinBox(3), XmCreateSpinBox(3), XmSimpleSpinBoxAddItem(3), XmSimpleSpinBoxDeletePos(3), XmSimpleSpinBoxSetItem(3), Composite(3), Core(3), XmManager(3), XmText(3), XmTextField(3), XtGetValues(3), XtSetValues(3), XmVaCreateSimpleSpinBox(3), and XmVaCreateManagedSimpleSpinBox(3).