In addition, there are new resources that are specific to XmNspinboxType of
(To download from Netscape, use the right mouse button to ``Save Link As...''.
You can also get
spinbox1.5.tar.gz
Class Name: XmpSpinbox
Class Hierarchy: core -> composite -> constraint -> XmManager -> XmpGeometry -> XmpSpinbox
Class Pointer: xmpSpinboxWidgetClass
Instantiation: widget = XtCreateWidget ( name, xmpSpinboxWidgetClass, ... )
Functions/Macros: XmpCreateSpinbox(), XmpSpinboxGetValue(), XmpSpinboxSetValue(), XmpSpinboxGetReal(), XmpSpinboxSetReal()
Name
Class
Type
Default
Access
XmNarrowOrientation
XmCArrowOrientation
char
XmVERTICAL
CSG
XmNcolumns
XmCColumns
short
8
CSG
XmNspinboxCycle
XmCSpinboxCycle
Boolean
False
CSG
XmNspinboxStyle
XmCSpinboxStyle
char
XmSPINBOX_STACKED_RIGHT
CSG
XmNspinboxType
XmCSpinboxType
char
XmSPINBOX_NUMBER
CSG
XmNincrement
XmCIncrement
long
1
CSG
XmNincrementLarge
XmCIncrementLarge
long
dynamic
CSG
XmNmaximum
XmCMaximum
long
dynamic
CSG
XmNminimum
XmCMinimum
long
dynamic
CSG
XmNupdateText
XmCupdateText
Boolean
False
CSG
XmNuseClosestValue
XmCuseClosestValue
Boolean
False
CSG
XmNvalue XmCValue long 0 CSG
XmVERTICAL XmHORIZONTAL
XmNspinboxType | XmNincrementLarge |
XmSPINBOX_CLOCK_HM | 60 |
XmSPINBOX_CLOCK_HMS | 60 |
XmSPINBOX_DOLLARS | 100 |
XmSPINBOX_NUMBER (XmNdecimalPoints>0) | 10 ^ XmNdecimalPoints |
XmSPINBOX_NUMBER (XmNdecimalPoints==0) | (XmNmaximum-XmNminimum)/10 |
XmSPINBOX_STRINGS | (XmNmaximum-XmNminimum)/10 |
XmSPINBOX_USER_DEFINED | N/A |
XmNspinboxType | Minimum | Maximum |
XmSPINBOX_CLOCK_HM | 0 | (60*24)-1 |
XmSPINBOX_CLOCK_HMS | 0 | (60*60*24)-1 |
XmSPINBOX_DOLLARS | LONG_MIN+1 | LONG_MAX-1 |
XmSPINBOX_NUMBER | LONG_MIN+1 | LONG_MAX-1 |
XmSPINBOX_STRINGS | 0 | XmNitemCount-1 |
XmSPINBOX_USER_DEFINED | N/A | N/A |
Every time XmNspinboxType is set, if XmNmaximum and XmNminimum are not explicitly set too, they are automatically set to the appropriate default. As a result, changing XmNspinboxType during runtime can cause the current value to suddenly be less than XmNminimum or greater than XmNmaximum. Because of this, it's a good idea to check the current value when changing the XmNspinboxType on the fly.
XmSPINBOX_CLOCK_HM /* Clock with Hours, Minutes */ XmSPINBOX_CLOCK_HMS /* Clock with Hours, Minutes, and Seconds */ XmSPINBOX_DOLLARS XmSPINBOX_NUMBER XmSPINBOX_STRINGS XmSPINBOX_USER_DEFINEDSince
XmSPINBOX_USER_DEFINED
allows the user more control over the
spinbox, the XmNmaximum, XmNminimum, XmNincrementLarge, XmNgetValueProc, and XmNshowValueProc
should be set explicitly when setting XmNspinboxType to XmSPINBOX_USER_DEFINED
.
XmNspinboxStyle | Layout |
XmSPINBOX_STACKED | stack { up, tf, down} |
XmSPINBOX_STACKED_LEFT | stack { up, down }, tf |
XmSPINBOX_STACKED_RIGHT | tf, stack { up, down } |
XmSPINBOX_LEFT | down, up, tf |
XmSPINBOX_RIGHT | tf, down, up |
XmSPINBOX_SEPARATE | down, tf, up |
When a spinbox is created with a specified name,
the textfield child is named tf
,
the up arrowbutton is named up_ab
,
and the down arrowbutton is named down_ab
.
The superclass of XmpSpinbox, XmpGeometry, is a free widget written by Alastair Gourlay. Mr. Gourlay has written an article in the X Resource issue #10 (ISBN 1-56592-067-8) about the XmpGeometry widget. The X Resource Archive at ftp.uu.net contains the original source code for the XmpGeometry widget ; however, since it is included with this widget it is not necessary unless you want to learn more about the XmpGeometry widget.
Callback | Reason Constant |
XmNvalueChangedCallback | XmCR_VALUE_CHANGED |
Each callback function is passed the following structure:
typedef struct { int reason; const char *str; size_t str_len; int value; } XmpSpinboxCallbackStruct;
Spinbox defines the following action routines:
Action | Event | Description |
DecrementLarge() |
Decrements the Spinbox by XmNincrementLarge. | |
DecrementSmall() |
Decrements the Spinbox by XmNincrement. | |
IncrementLarge() |
Increments the Spinbox by XmNincrementLarge. | |
IncrementSmall() |
Increments the Spinbox by XmNincrement. |