1XmSimpleSpinBox(library call) XmSimpleSpinBox(library call)
2
3
4
6 XmSimpleSpinBox — a simple SpinBox widget class
7
9 #include <Xm/SSpinB.h>
10
12 The XmSimpleSpinBox widget is a user interface control to increment and
13 decrement an arbitrary TextField. For example, it can be used to cycle
14 through the months of the year or days of the month.
15
16 Widget subclassing is not supported for the XmSimpleSpinBox widget
17 class.
18
19 Classes
20 The XmSimpleSpinBox widget inherits behavior and resources from the
21 Core, Composite and XmManager classes.
22
23 The class pointer is XmSimpleSpinBoxWidgetClass.
24
25 The class name is XmSimpleSpinBoxWidget.
26
27 New Resources
28 The following table defines a set of widget resources used by the
29 application to specify data. The application can also set the resource
30 values for the inherited classes to set attributes for this widget. To
31 reference a resource by name or by class in a .Xdefaults file, the
32 application must remove the XmN or XmC prefix and use the remaining
33 letters. To specify one of the defined values for a resource in a .Xde‐
34 faults file, the application must remove the Xm prefix and use the
35 remaining letters (in either lower case or upper case, but including
36 any underscores between words). The codes in the access column indicate
37 if the given resource can be set at creation time (C), set by using
38 XtSetValues (S), retrieved by using XtGetValues (G), or is not applica‐
39 ble (N/A).
40
41 XmSimpleSpinBox Resource
42 Set
43 Name Class Type Default Access
44 XmNarrowLayout XmCArrowLayout unsigned char XmARROWS_END CSG
45 XmNarrowSensitivity XmCArrowSensitivity unsigned char XmARROWS-_SENSITIVE CSG
46 XmNcolumns XmCColumn short 20 CSG
47 XmNdecimalPoints XmCDecimalPoints short 0 CSG
48 XmNeditable XmCEditable Boolean True CSG
49 XmNincrementValue XmCIncrementValue int 1 CSG
50 XmNinitialDelay XmCInitialDelay unsigned int 250 CSG
51 XmNmaximumValue XmCMaximumValue int 10 CSG
52 XmNminimumValue XmCMinimumValue int 0 CSG
53 XmNmodifyVerifyCallback XmCCallback XtCallbackList NULL C
54 XmNnumValues XmCNumValues int 0 CSG
55 XmNposition XmCPosition int 0 CSG
56 XmNrepeatDelay XmCRepeatDelay unsigned int 200 CSG
57 XmNspinBoxChildType XmCSpinBoxChildType unsigned char XmSTRING CG
58 XmNtextField XmCTextField Widget dynamic G
59 XmNvalueChangedCallback XmCCallback XtCallbackList NULL C
60 XmNvalues XmCValues XmStringTable NULL CSG
61
62 XmNarrowLayout
63 Specifies the style and position of the SpinBox arrows. The
64 following values are supported:
65
66 XmARROWS_FLAT_BEGINNING
67 The arrows are placed side by side to the right of
68 the TextField.
69
70 XmARROWS_FLAT_END
71 The arrows are placed side by side to the left of
72 the TextField.
73
74 XmARROWS_SPLIT
75 The down arrow is on the left and the up arrow is
76 on the right of the TextField.
77
78 XmARROWS_BEGINNING
79 The arrows are stacked and placed on the left of
80 the TextField.
81
82 XmARROWS_END
83 The arrows are stacked and placed on the right of
84 the TextField.
85
86 XmNarrowSensitivity
87 Specifies the sensitivity of the arrows in the XmSimpleSpin‐
88 Box. The following values are supported:
89
90 XmARROWS_SENSITIVE
91 Both arrows are active to user selection.
92
93 XmARROWS_DECREMENT_SENSITIVE
94 The down arrow is active and the up arrow is inac‐
95 tive to user selection.
96
97 XmARROWS_INCREMENT_SENSITIVE
98 The up arrow is active and the down arrow is inac‐
99 tive to user selection.
100
101 XmARROWS_INSENSITIVE
102 Both arrows are inactive to user selection.
103
104 XmNcolumns
105 Specifies the number of columns of the text field.
106
107 XmNdecimalPoints
108 Specifies the position of the radix character within the
109 numeric value when XmNspinBoxChildType is XmNUMERIC. This
110 resource is used to allow for floating point values in the
111 XmSimpleSpinBox widget.
112
113 XmNeditable
114 Specifies whether the text field can take input.
115
116 When XmNeditable is used on a widget it sets the dropsite to
117 XmDROP_SITE_ACTIVE.
118
119 XmNincrementValue
120 Specifies the amount to increment or decrement the XmNposi‐
121 tion when the XmNspinBoxChildType is XmNUMERIC. When the Up
122 action is activated, the XmNincrementValue is added to the
123 XmNposition value; when the Down action is activated, the
124 XmNincrementValue is subtracted from the XmNposition value.
125 When XmNspinBoxChildType is XmSTRING, this resource is
126 ignored.
127
128 XmNinitialDelay
129 Specifies the amount of time in milliseconds before the Arrow
130 buttons will begin to spin continuously.
131
132 XmNnumValues
133 Specifies the number of items in the XmNvalues list when the
134 XmNspinBoxChildType resource is XmSTRING. The value of this
135 resource must be a positive integer. The XmNnumValues is
136 maintained by the XmSimpleSpinBox widget when items are added
137 or deleted from the XmNvalues list. When XmNspinBoxChildType
138 is not XmSTRING, this resource is ignored.
139
140 XmNvalues Supplies the list of strings to cycle through when the XmN‐
141 spinButtonChildType resource is XmSTRING. When XmNspinBox‐
142 ChildType is not XmSTRING, this resource is ignored.
143
144 XmNmaximumValue
145 Specifies the upper bound on the XmSimpleSpinBox's range when
146 XmNspinBoxChildType is XmNUMERIC.
147
148 XmNminimumValue
149 Specifies the lower bound on the XmSimpleSpinBox's range when
150 XmNspinBoxChildType is XmNUMERIC.
151
152 XmNmodifyVerifyCallback
153 Specifies the callback to be invoked just before the XmSim‐
154 pleSpinBox position changes. The application can use this
155 callback to implement new application-related logic (includ‐
156 ing setting new position spinning to, or canceling the
157 impending action). For example, this callback can be used to
158 stop the spinning just before wrapping at the upper and lower
159 position boundaries. If the application sets the doit member
160 of the XmSimpleSpinBoxCallbackStruct to False, nothing hap‐
161 pens. Otherwise, the position changes. Reasons sent by the
162 callback are XmCR_SPIN_NEXT, or XmCR_SPIN_PRIOR.
163
164 XmNposition
165 The XmNposition resource has a different value based on the
166 XmNspinBoxChildType resource. When XmNspinBoxChildType is
167 XmSTRING, the XmNposition is the index into the XmNvalues
168 list for the current item. When the XmNspinBoxChildType
169 resource is XmNUMERIC, the XmNposition is the integer value
170 of the XmSimpleSpinBox that falls within the range of XmNmax‐
171 imumValue and XmNminimumValue.
172
173 XmNrepeatDelay
174 Specifies the number of milliseconds between repeated calls
175 to the XmNvalueChangedCallback while the user is spinning the
176 XmSimpleSpinBox.
177
178 XmNspinBoxChildType
179 Specifies the style of the XmSimpleSpinBox. The following
180 values are supported:
181
182 XmSTRING The child is a string value that is specified
183 through the XmNvalues resource and incremented and
184 decremented by changing the XmNposition resource.
185
186 XmNUMERIC The child is a numeric value that is specified
187 through the XmNposition resource and incremented
188 according to the XmNincrementValue resource.
189
190 XmtextField
191 Specifies the textfield widget.
192
193 XmNvalueChangedCallback
194 Specifies the callback to be invoked whenever the value of
195 the XmNposition resource is changed through the use of the
196 spinner arrows. The XmNvalueChangedCallback passes the XmSim‐
197 pleSpinBoxCallbackStruct call_data structure.
198
199 Inherited Resources
200 The XmSimpleSpinBox widget inherits behavior and resources from the
201 following named superclasses. For a complete description of each
202 resource, see the man page for that superclass.
203
204
205 XmManager Resource
206 Set
207 Name Class Type Default Access
208 XmNbottomShadowColor XmCBottomShadowColor Pixel dynamic CSG
209 XmNbottomShadowPixmap XmCBottomShadowPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
210 XmNforeground XmCForeground Pixel dynamic CSG
211 XmNhelpCallback XmCCallback XtCallbackList NULL C
212 XmNhighlightColor XmCHighlightColor Pixel dynamic CSG
213 XmNhighlightPixmap XmCHighlightPixmap Pixmap dynamic CSG
214 XmNinitialFocus XmCInitialFocus Widget NULL CSG
215 XmNnavigationType XmCNavigationType XmNavigationType dynamic CSG
216 XmNshadowThickness XmCShadowThickness Dimension dynamic CSG
217 XmNstringDirection XmCStringDirection XmStringDirection dynamic CG
218 XmNtopShadowColor XmCTopShadowColor Pixel dynamic CSG
219 XmNtopShadowPixmap XmCTopShadowPixmap Pixmap dynamic CSG
220 XmNtraversalOn XmCTraversalOn Boolean dynamic CSG
221 XmNunitType XmCUnitType unsigned char dynamic CSG
222 XmNuserData XmCUserData XtPointer NULL CSG
223
224 Composite Resource
225 Set
226 Name Class Type Default Access
227 XmNchildren XmCReadOnly WidgetList NULL G
228 XmNinsertPosition XmCInsertPosition XtOrderProc default procedure CSG
229 XmNnumChildren XmCReadOnly Cardinal 0 G
230
231 Core Resource Set
232 Name Class Type Default Access
233 XmNaccelerators XmCAccelerators XtAccelerators dynamic CSG
234 XmNancestorSensitive XmCSensitive Boolean dynamic G
235 XmNbackground XmCBackground Pixel dynamic CSG
236 XmNbackgroundPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
237 XmNborderColor XmCBorderColor Pixel XtDefaultForeground CSG
238 XmNborderPixmap XmCPixmap Pixmap XmUNSPECIFIED_PIXMAP CSG
239 XmNborderWidth XmCBorderWidth Dimension 0 CSG
240 XmNcolormap XmCColormap Colormap dynamic CG
241 XmNdepth XmCDepth int dynamic CG
242 XmNdestroyCallback XmCCallback XtCallbackList NULL C
243 XmNheight XmCHeight Dimension dynamic CSG
244 XmNinitialResourcesPersistent XmCInitialResourcesPersistent Boolean True C
245 XmNmappedWhenManaged XmCMappedWhenManaged Boolean True CSG
246 XmNscreen XmCScreen Screen * dynamic CG
247 XmNsensitive XmCSensitive Boolean True CSG
248 XmNtranslations XmCTranslations XtTranslations dynamic CSG
249 XmNwidth XmCWidth Dimension dynamic CSG
250 XmNx XmCPosition Position 0 CSG
251 XmNy XmCPosition Position 0 CSG
252
253 Callback Information
254 A pointer to the following structure is passed to each XmSimpleSpinBox
255 callback:
256
257 typedef struct {
258 int reason;
259 XEvent *event;
260 Widget widget;
261 Boolean doit;
262 int position;
263 XmString value;
264 Boolean crossed_boundary;
265 } XmSimpleSpinBoxCallbackStruct;
266
267 The reason argument indicates why the callback was invoked. There are
268 three possible reasons for this callback to be issued. The reason is
269 XmCR_OK when this is the first call to the callback at the beginning of
270 a spin or if it is a single activation of the spin arrows. If the
271 XmSimpleSpinBox is in the process of being continuously spun, then the
272 reason will be XmCR_SPIN_NEXT or XmCR_SPIN_PRIOR, depending on the
273 arrow that is spinning.
274
275 The event argument points to the XEvent that triggered the callback. It
276 can be NULL when the XmSimpleSpinBox is continuously spinning.
277
278 The widget argument is the widget identifier for the simple spin box
279 widget that has been affected by this callback.
280
281 The doit argument is set only when the call_data comes from the XmNmod‐
282 ifyVerifyCallback. It indicates that the action that caused the call‐
283 back to be called should be performed. The action is not performed if
284 doit is set to False.
285
286 The position argument is the new value of the XmNposition resource as a
287 result of the spin.
288
289 The value argument is the new XmString value displayed in the Text wid‐
290 get as a result of the spin. The application must copy this string if
291 it is used beyond the scope of the call_data structure.
292
293 The crossed_boundary argument is True when the spinbox cycles. This is
294 the case when a XmNspinBoxChildType of XmSTRING wraps from the first
295 item to the last or the last item to the first. In the case of the XmN‐
296 spinBoxChildType of XmNUMERIC, the boundary is crossed when the XmSim‐
297 pleSpinBox cycles from the maximum value to the minimum or vice versa.
298
300 The toolkit will display a warning if the application tries to set the
301 value of the XmNtextField resource, which is read-only (marked G in the
302 resource table).
303
305 XmSpinBox(3), XmCreateSimpleSpinBox(3), XmCreateSpinBox(3), XmSimple‐
306 SpinBoxAddItem(3), XmSimpleSpinBoxDeletePos(3), XmSimpleSpin‐
307 BoxSetItem(3), Composite(3), Core(3), XmManager(3), XmText(3),
308 XmTextField(3), XtGetValues(3), XtSetValues(3), XmVaCreateSimpleSpin‐
309 Box(3), and XmVaCreateManagedSimpleSpinBox(3).
310
311
312
313 XmSimpleSpinBox(library call)