2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: SpinBox.h /main/4 1995/10/26 09:34:23 rswiston $ */
25 * (c) Copyright 1993, 1994 Hewlett-Packard Company
26 * (c) Copyright 1993, 1994 International Business Machines Corp.
27 * (c) Copyright 1993, 1994 Novell, Inc.
28 * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
30 /***********************************************************
31 Copyright 1993 Interleaf, Inc.
33 Permission to use, copy, modify, and distribute this software
34 and its documentation for any purpose without fee is granted,
35 provided that the above copyright notice appear in all copies
36 and that both copyright notice and this permission notice appear
37 in supporting documentation, and that the name of Interleaf not
38 be used in advertising or publicly pertaining to distribution of
39 the software without specific written prior permission.
41 Interleaf makes no representation about the suitability of this
42 software for any purpose. It is provided "AS IS" without any
43 express or implied warranty.
44 ******************************************************************/
50 #if defined(DT_USE_XM_SSPINBOX)
51 #include <Xm/SSpinB.h>
65 #ifndef DtNarrowLayout
66 # if defined(DT_USE_XM_SSPINBOX)
67 # define DtNarrowLayout XmNarrowLayout
69 # define DtNarrowLayout "arrowLayout"
72 #ifndef DtNarrowSensitivity
73 # if defined(DT_USE_XM_SSPINBOX)
74 # define DtNarrowSensitivity XmNarrowSensitivity
76 # define DtNarrowSensitivity "arrowSensitivity"
80 # if defined(DT_USE_XM_SSPINBOX)
81 # define DtNarrowSize XmNarrowSize
83 # define DtNarrowSize "arrowSize"
86 #ifndef DtNspinBoxChildType
87 # if defined(DT_USE_XM_SSPINBOX)
88 # define DtNspinBoxChildType XmNspinBoxChildType
90 # define DtNspinBoxChildType "spinBoxChildType"
94 # if defined(DT_USE_XM_SSPINBOX)
95 # define DtNposition XmNposition
97 # define DtNposition "position"
101 # if defined(DT_USE_XM_SSPINBOX)
102 # define DtNtextField XmNtextField
104 # define DtNtextField "textField"
108 # if defined(DT_USE_XM_SSPINBOX)
109 # define DtNwrap "wrap"
111 # define DtNwrap "wrap"
114 #ifndef DtNincrementValue
115 # if defined(DT_USE_XM_SSPINBOX)
116 # define DtNincrementValue XmNincrementValue
118 # define DtNincrementValue "incrementValue"
121 #ifndef DtNmaximumValue
122 # if defined(DT_USE_XM_SSPINBOX)
123 # define DtNmaximumValue XmNmaximumValue
125 # define DtNmaximumValue "maximumValue"
128 #ifndef DtNminimumValue
129 # if defined(DT_USE_XM_SSPINBOX)
130 # define DtNminimumValue XmNminimumValue
132 # define DtNminimumValue "minimumValue"
136 # if defined(DT_USE_XM_SSPINBOX)
137 # define DtNnumValues XmNnumValues
139 # define DtNnumValues "numValues"
143 # if defined(DT_USE_XM_SSPINBOX)
144 # define DtNvalues XmNvalues
146 # define DtNvalues "values"
150 #ifndef DtNactivateCallback
151 #define DtNactivateCallback XmNactivateCallback
154 #define DtNalignment XmNalignment
157 #define DtNcolumns XmNcolumns
159 #ifndef DtNdecimalPoints
160 #define DtNdecimalPoints XmNdecimalPoints
163 #define DtNeditable XmNeditable
165 #ifndef DtNfocusCallback
166 #define DtNfocusCallback XmNfocusCallback
168 #ifndef DtNinitialDelay
169 #define DtNinitialDelay XmNinitialDelay
171 #ifndef DtNlosingFocusCallback
172 #define DtNlosingFocusCallback XmNlosingFocusCallback
174 #ifndef DtNmarginHeight
175 #define DtNmarginHeight XmNmarginHeight
177 #ifndef DtNmarginWidth
178 #define DtNmarginWidth XmNmarginWidth
181 #define DtNmaxLength XmNmaxLength
183 #ifndef DtNmodifyVerifyCallback
184 #define DtNmodifyVerifyCallback XmNmodifyVerifyCallback
186 #ifndef DtNrecomputeSize
187 #define DtNrecomputeSize XmNrecomputeSize
189 #ifndef DtNrepeatDelay
190 #define DtNrepeatDelay XmNrepeatDelay
192 #ifndef DtNvalueChangedCallback
193 #define DtNvalueChangedCallback XmNvalueChangedCallback
196 #ifndef DtCArrowLayout
197 # if defined(DT_USE_XM_SSPINBOX)
198 # define DtCArrowLayout XmCArrowLayout
200 # define DtCArrowLayout "ArrowLayout"
203 #ifndef DtCArrowSensitivity
204 # if defined(DT_USE_XM_SSPINBOX)
205 # define DtCArrowSensitivity XmCArrowSensitivity
207 # define DtCArrowSensitivity "ArrowSensitivity"
211 # if defined(DT_USE_XM_SSPINBOX)
212 # define DtCArrowSize XmCArrowSize
214 # define DtCArrowSize "ArrowSize"
217 #ifndef DtCSpinBoxChildType
218 # if defined(DT_USE_XM_SSPINBOX)
219 # define DtCSpinBoxChildType XmCSpinBoxChildType
221 # define DtCSpinBoxChildType "SpinBoxChildType"
225 # if defined(DT_USE_XM_SSPINBOX)
226 # define DtCPosition XmCPosition
228 # define DtCPosition "Position"
232 # if defined(DT_USE_XM_SSPINBOX)
233 # define DtCTextField XmCTextField
235 # define DtCTextField "TextField"
239 # define DtCWrap "Wrap"
241 #ifndef DtCIncrementValue
242 # if defined(DT_USE_XM_SSPINBOX)
243 # define DtCIncrementValue XmCIncrementValue
245 # define DtCIncrementValue "incrementValue"
248 #ifndef DtCMaximumValue
249 # if defined(DT_USE_XM_SSPINBOX)
250 # define DtCMaximumValue XmCMaximumValue
252 # define DtCMaximumValue "maximumValue"
255 #ifndef DtCMinimumValue
256 # if defined(DT_USE_XM_SSPINBOX)
257 # define DtCMinimumValue XmCMinimumValue
259 # define DtCMinimumValue "minimumValue"
263 # if defined(DT_USE_XM_SSPINBOX)
264 # define DtCNumValues XmCNumValues
266 # define DtCNumValues "numValues"
270 # if defined(DT_USE_XM_SSPINBOX)
271 # define DtCValues XmCValues
273 # define DtCValues "values"
278 #define DtCAlignment XmCAlignment
281 #define DtCCallback XmCCallback
284 #define DtCColumns XmCColumns
286 #ifndef DtCDecimalPoints
287 #define DtCDecimalPoints XmCDecimalPoints
290 #define DtCEditable XmCEditable
292 #ifndef DtCInitialDelay
293 #define DtCInitialDelay XmCInitialDelay
296 #define DtCItems XmCItems
298 #ifndef DtCMarginHeight
299 #define DtCMarginHeight XmCMarginHeight
301 #ifndef DtCMarginWidth
302 #define DtCMarginWidth XmCMarginWidth
305 #define DtCMaxLength XmCMaxLength
308 #define DtCPosition XmCPosition
310 #ifndef DtCRecomputeSize
311 #define DtCRecomputeSize XmCRecomputeSize
313 #ifndef DtCRepeatDelay
314 #define DtCRepeatDelay XmCRepeatDelay
317 /* Representation types */
319 #ifndef DtRIncrementValue
320 # if defined(DT_USE_XM_SSPINBOX)
321 # define DtRIncrementValue XmRint
323 # define DtRIncrementValue "IncrementValue"
326 #ifndef DtRMaximumValue
327 # if defined(DT_USE_XM_SSPINBOX)
328 # define DtRMaximumValue XmRint
330 # define DtRMaximumValue "MaximumValue"
333 #ifndef DtRMinimumValue
334 # if defined(DT_USE_XM_SSPINBOX)
335 # define DtRMinimumValue XmRint
337 # define DtRMinimumValue "MinimumValue"
341 # if defined(DT_USE_XM_SSPINBOX)
342 # define DtRNumValues XmRint
344 # define DtRNumValues "NumValues"
348 # if defined(DT_USE_XM_SSPINBOX)
349 # define DtRValues XmRXmStringTable
351 # define DtRValues "Values"
354 #ifndef DtRArrowSensitivity
355 # if defined(DT_USE_XM_SSPINBOX)
356 # define DtRArrowSensitivity XmRArrowSensitivity
358 # define DtRArrowSensitivity "ArrowSensitivity"
361 #ifndef DtRArrowLayout
362 # if defined(DT_USE_XM_SSPINBOX)
363 # define DtRArrowLayout XmRArrowLayout
365 # define DtRArrowLayout "ArrowLayout"
368 #ifndef DtRSpinBoxChildType
369 # if defined(DT_USE_XM_SSPINBOX)
370 # define DtRSpinBoxChildType XmRSpinBoxChildType
372 # define DtRSpinBoxChildType "SpinBoxChildType"
376 /* DtNarrowLayout values */
378 #ifndef DtARROWS_FLAT_BEGINNING
379 # if defined(DT_USE_XM_SSPINBOX)
380 # define DtARROWS_FLAT_BEGINNING XmARROWS_FLAT_BEGINNING
382 # define DtARROWS_FLAT_BEGINNING 4
385 #ifndef DtARROWS_FLAT_END
386 # if defined(DT_USE_XM_SSPINBOX)
387 # define DtARROWS_FLAT_END XmARROWS_FLAT_END
389 # define DtARROWS_FLAT_END 3
392 #ifndef DtARROWS_SPLIT
393 # if defined(DT_USE_XM_SSPINBOX)
394 # define DtARROWS_SPLIT XmARROWS_SPLIT
396 # define DtARROWS_SPLIT 2
399 #ifndef DtARROWS_BEGINNING
400 # if defined(DT_USE_XM_SSPINBOX)
401 # define DtARROWS_BEGINNING XmARROWS_BEGINNING
403 # define DtARROWS_BEGINNING 1
407 # if defined(DT_USE_XM_SSPINBOX)
408 # define DtARROWS_END XmARROWS_END
410 # define DtARROWS_END 0
414 /* DtNarrowSensitivity values */
416 #ifndef DtARROWS_SENSITIVE
417 # if defined(DT_USE_XM_SSPINBOX)
418 # define DtARROWS_SENSITIVE XmARROWS_SENSITIVE
420 # define DtARROWS_SENSITIVE 3
423 #ifndef DtARROWS_DECREMENT_SENSITIVE
424 # if defined(DT_USE_XM_SSPINBOX)
425 # define DtARROWS_DECREMENT_SENSITIVE XmARROWS_DECREMENT_SENSITIVE
427 # define DtARROWS_DECREMENT_SENSITIVE 2
430 #ifndef DtARROWS_INCREMENT_SENSITIVE
431 # if defined(DT_USE_XM_SSPINBOX)
432 # define DtARROWS_INCREMENT_SENSITIVE XmARROWS_INCREMENT_SENSITIVE
434 # define DtARROWS_INCREMENT_SENSITIVE 1
437 #ifndef DtARROWS_INSENSITIVE
438 # if defined(DT_USE_XM_SSPINBOX)
439 # define DtARROWS_INSENSITIVE XmARROWS_INSENSITIVE
441 # define DtARROWS_INSENSITIVE 0
445 /* DtNspinBoxChildType values */
448 # if defined(DT_USE_XM_SSPINBOX)
449 # define DtNUMERIC XmNUMERIC
456 # define DtSTRING XmSTRING
459 /* DtNalignment values */
461 #ifndef DtALIGNMENT_BEGINNING
462 #define DtALIGNMENT_BEGINNING XmALIGNMENT_BEGINNING
464 #ifndef DtALIGNMENT_CENTER
465 #define DtALIGNMENT_CENTER XmALIGNMENT_CENTER
467 #ifndef DtALIGNMENT_END
468 #define DtALIGNMENT_END XmALIGNMENT_END
471 /* Callback reasons */
474 # define DtCR_OK XmCR_OK
476 #ifndef DtCR_SPIN_NEXT
477 # if defined(DT_USE_XM_SSPINBOX)
478 # define DtCR_SPIN_NEXT XmCR_SPIN_NEXT
480 # define DtCR_SPIN_NEXT 62
483 #ifndef DtCR_SPIN_PRIOR
484 # if defined(DT_USE_XM_SSPINBOX)
485 # define DtCR_SPIN_PRIOR XmCR_SPIN_PRIOR
487 # define DtCR_SPIN_PRIOR 63
495 #if defined(DT_USE_XM_SSPINBOX)
496 # define DtSpinBoxCallbackStruct XmSpinBoxCallbackStruct
505 Boolean crossed_boundary;
506 } DtSpinBoxCallbackStruct;
509 /* Widget class and instance */
510 #if defined(DT_USE_XM_SSPINBOX)
511 # define _DtSpinBoxClassRec _XmSimpleSpinBoxClassRec
512 # define _DtSpinBoxRec _XmSimpleSpinBoxRec
513 # define DtSpinBoxWidgetClass XmSimpleSpinBoxWidgetClass
514 # define DtSpinBoxWidget XmSimpleSpinBoxWidget
516 typedef struct _DtSpinBoxClassRec *DtSpinBoxWidgetClass;
517 typedef struct _DtSpinBoxRec *DtSpinBoxWidget;
524 /* Widget class record */
525 #if defined(DT_USE_XM_SSPINBOX)
526 # define dtSpinBoxWidgetClass xmSimpleSpinBoxWidgetClass
528 externalref WidgetClass dtSpinBoxWidgetClass;
536 #if defined(DT_USE_XM_SSPINBOX)
537 # define DtCreateSpinBox XmCreateSimpleSpinBox
538 # define DtSpinBoxAddItem XmSimpleSpinBoxAddItem
539 # define DtSpinBoxDeletePos XmSimpleSpinBoxDeletePos
540 # define DtSpinBoxSetItem XmSimpleSpinBoxSetItem
542 extern Widget DtCreateSpinBox(
548 extern void DtSpinBoxAddItem(
553 extern void DtSpinBoxDeletePos(
557 extern void DtSpinBoxSetItem(
566 #endif /* _Dt_SpinBox_h */