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: SpinBoxP.h /main/4 1996/03/26 19:54:14 drk $ */
25 * SpinBoxP.h, Interleaf, 16aug93 2:37pm Version 1.1.
28 /***********************************************************
29 Copyright 1993 Interleaf, Inc.
31 Permission to use, copy, modify, and distribute this software
32 and its documentation for any purpose without fee is granted,
33 provided that the above copyright notice appear in all copies
34 and that both copyright notice and this permission notice appear
35 in supporting documentation, and that the name of Interleaf not
36 be used in advertising or publicly pertaining to distribution of
37 the software without specific written prior permission.
39 Interleaf makes no representation about the suitability of this
40 software for any purpose. It is provided "AS IS" without any
41 express or implied warranty.
42 ******************************************************************/
45 * (C) Copyright 1991,1992, 1993
47 * 9 Hillside Avenue, Waltham, MA 02154
51 * Private header file for DtSpinBoxWidget.
57 #include <Xm/TextFP.h>
58 #include <Xm/ArrowB.h>
59 #include <Xm/ManagerP.h>
67 * External definitions of syn_resources for our list widget.
69 #define SYN_RESOURCE_AA (Widget w, int resource_offset, XtArgVal *value)
70 extern void _DtSpinBoxGetArrowSize SYN_RESOURCE_AA;
72 #define ARROW_MULT .45
74 #define MAX_FLOAT_DECIMALS 6
75 #define NUMERIC_LENGTH 128
77 #define LABEL_PADDING 2
78 #define LABEL_SHADOW 2
79 #define TEXT_FIELD_SHADOW 1
80 #define TEXT_CONTEXT_MARGIN 4
82 /****************************************************************
86 ****************************************************************/
88 #define SB_ARROW_SENSITIVE DTWIDGET_GETMESSAGE( \
89 MS_SpinBox, SPIN_ARROW_SENSITIVE, _DtMsgSpinBox_0000)
91 #define SB_ALIGNMENT DTWIDGET_GETMESSAGE( \
92 MS_SpinBox, SPIN_ALIGNMENT, _DtMsgSpinBox_0001)
94 #define SB_INIT_DELAY DTWIDGET_GETMESSAGE( \
95 MS_SpinBox, SPIN_INIT_DELAY, _DtMsgSpinBox_0002)
97 #define SB_MARGIN_HEIGHT DTWIDGET_GETMESSAGE( \
98 MS_SpinBox, SPIN_MARGIN_HEIGHT, _DtMsgSpinBox_0003)
100 #define SB_MARGIN_WIDTH DTWIDGET_GETMESSAGE( \
101 MS_SpinBox, SPIN_MARGIN_WIDTH, _DtMsgSpinBox_0004)
103 #define SB_ARROW_LAYOUT DTWIDGET_GETMESSAGE( \
104 MS_SpinBox, SPIN_ARROW_LAYOUT, _DtMsgSpinBox_0005)
106 #define SB_REPEAT_DELAY DTWIDGET_GETMESSAGE( \
107 MS_SpinBox, SPIN_REPEAT_DELAY, _DtMsgSpinBox_0006)
109 #define SB_ITEM_COUNT DTWIDGET_GETMESSAGE( \
110 MS_SpinBox, SPIN_ITEM_COUNT, _DtMsgSpinBox_0007)
112 #define SB_POSITION_STRING DTWIDGET_GETMESSAGE( \
113 MS_SpinBox, SPIN_POSITION_STRING, _DtMsgSpinBox_0008)
115 #define SB_POSITION_NUMERIC DTWIDGET_GETMESSAGE( \
116 MS_SpinBox, SPIN_POSITION_NUMERIC, _DtMsgSpinBox_0009)
118 #define SB_DECIMAL_POINTS DTWIDGET_GETMESSAGE( \
119 MS_SpinBox, SPIN_DECIMAL_POINTS, _DtMsgSpinBox_0010)
121 #define SB_MIN_MAX DTWIDGET_GETMESSAGE( \
122 MS_SpinBox, SPIN_MIN_MAX, _DtMsgSpinBox_0011)
124 #define SB_TEXT DTWIDGET_GETMESSAGE( \
125 MS_SpinBox, SPIN_TEXT, _DtMsgSpinBox_0012)
127 #define SB_SET_ITEM DTWIDGET_GETMESSAGE( \
128 MS_SpinBox, SPIN_SET_ITEM, _DtMsgSpinBox_0013)
130 #define SB_LABEL DTWIDGET_GETMESSAGE( \
131 MS_SpinBox, SPIN_LABEL, _DtMsgSpinBox_0014)
137 } DtSpinBoxClassPart;
139 typedef struct _DtSpinBoxClassRec {
140 CoreClassPart core_class;
141 CompositeClassPart composite_class;
142 ConstraintClassPart constraint_class;
143 XmManagerClassPart manager_class;
144 DtSpinBoxClassPart spin_box_class;
147 extern DtSpinBoxClassRec dtSpinBoxClassRec;
153 typedef struct _DtSpinBoxPart {
158 unsigned char which_arrow;
163 float increment, current;
164 char float_format[10];
166 Dimension old_height;
167 Dimension label_max_length;
168 Dimension label_max_height;
170 /* Resource-related data */
171 unsigned char arrow_sensitivity;
172 short decimal_points;
173 int numeric_increment;
178 unsigned char child_type;
180 XtCallbackList activate_callback;
181 unsigned char alignment;
182 unsigned char arrow_layout;
183 Dimension arrow_size;
186 XtCallbackList focus_callback;
187 unsigned int initial_delay;
188 XtCallbackList losing_focus_callback;
189 Dimension margin_height;
190 Dimension margin_width;
192 XtCallbackList modify_verify_callback;
193 Boolean recompute_size;
194 unsigned int repeat_delay;
196 XtCallbackList value_changed_callback;
202 /* String list related resources */
204 /* Numeric related resources */
206 /* TextField resources */
210 /* Full instance record declaration */
211 typedef struct _DtSpinBoxRec {
213 CompositePart composite;
214 ConstraintPart constraint;
215 XmManagerPart manager;
216 DtSpinBoxPart spin_box;
220 } /* Close scope of 'extern "C"' declaration which encloses file. */
223 #endif /* _SpinBoxP_h */