1 /* $XConsortium: SpinBoxP.h /main/4 1996/03/26 19:54:14 drk $ */
3 * SpinBoxP.h, Interleaf, 16aug93 2:37pm Version 1.1.
6 /***********************************************************
7 Copyright 1993 Interleaf, Inc.
9 Permission to use, copy, modify, and distribute this software
10 and its documentation for any purpose without fee is granted,
11 provided that the above copyright notice appear in all copies
12 and that both copyright notice and this permission notice appear
13 in supporting documentation, and that the name of Interleaf not
14 be used in advertising or publicly pertaining to distribution of
15 the software without specific written prior permission.
17 Interleaf makes no representation about the suitability of this
18 software for any purpose. It is provided "AS IS" without any
19 express or implied warranty.
20 ******************************************************************/
23 * (C) Copyright 1991,1992, 1993
25 * 9 Hillside Avenue, Waltham, MA 02154
29 * Private header file for DtSpinBoxWidget.
35 #include <Xm/TextFP.h>
36 #include <Xm/ArrowB.h>
37 #include <Xm/ManagerP.h>
45 * External definitions of syn_resources for our list widget.
47 #define SYN_RESOURCE_AA (Widget w, int resource_offset, XtArgVal *value)
48 extern void _DtSpinBoxGetArrowSize SYN_RESOURCE_AA;
50 #define ARROW_MULT .45
52 #define MAX_FLOAT_DECIMALS 6
53 #define NUMERIC_LENGTH 128
55 #define LABEL_PADDING 2
56 #define LABEL_SHADOW 2
57 #define TEXT_FIELD_SHADOW 1
58 #define TEXT_CONTEXT_MARGIN 4
60 /****************************************************************
64 ****************************************************************/
66 #define SB_ARROW_SENSITIVE DTWIDGET_GETMESSAGE( \
67 MS_SpinBox, SPIN_ARROW_SENSITIVE, _DtMsgSpinBox_0000)
69 #define SB_ALIGNMENT DTWIDGET_GETMESSAGE( \
70 MS_SpinBox, SPIN_ALIGNMENT, _DtMsgSpinBox_0001)
72 #define SB_INIT_DELAY DTWIDGET_GETMESSAGE( \
73 MS_SpinBox, SPIN_INIT_DELAY, _DtMsgSpinBox_0002)
75 #define SB_MARGIN_HEIGHT DTWIDGET_GETMESSAGE( \
76 MS_SpinBox, SPIN_MARGIN_HEIGHT, _DtMsgSpinBox_0003)
78 #define SB_MARGIN_WIDTH DTWIDGET_GETMESSAGE( \
79 MS_SpinBox, SPIN_MARGIN_WIDTH, _DtMsgSpinBox_0004)
81 #define SB_ARROW_LAYOUT DTWIDGET_GETMESSAGE( \
82 MS_SpinBox, SPIN_ARROW_LAYOUT, _DtMsgSpinBox_0005)
84 #define SB_REPEAT_DELAY DTWIDGET_GETMESSAGE( \
85 MS_SpinBox, SPIN_REPEAT_DELAY, _DtMsgSpinBox_0006)
87 #define SB_ITEM_COUNT DTWIDGET_GETMESSAGE( \
88 MS_SpinBox, SPIN_ITEM_COUNT, _DtMsgSpinBox_0007)
90 #define SB_POSITION_STRING DTWIDGET_GETMESSAGE( \
91 MS_SpinBox, SPIN_POSITION_STRING, _DtMsgSpinBox_0008)
93 #define SB_POSITION_NUMERIC DTWIDGET_GETMESSAGE( \
94 MS_SpinBox, SPIN_POSITION_NUMERIC, _DtMsgSpinBox_0009)
96 #define SB_DECIMAL_POINTS DTWIDGET_GETMESSAGE( \
97 MS_SpinBox, SPIN_DECIMAL_POINTS, _DtMsgSpinBox_0010)
99 #define SB_MIN_MAX DTWIDGET_GETMESSAGE( \
100 MS_SpinBox, SPIN_MIN_MAX, _DtMsgSpinBox_0011)
102 #define SB_TEXT DTWIDGET_GETMESSAGE( \
103 MS_SpinBox, SPIN_TEXT, _DtMsgSpinBox_0012)
105 #define SB_SET_ITEM DTWIDGET_GETMESSAGE( \
106 MS_SpinBox, SPIN_SET_ITEM, _DtMsgSpinBox_0013)
108 #define SB_LABEL DTWIDGET_GETMESSAGE( \
109 MS_SpinBox, SPIN_LABEL, _DtMsgSpinBox_0014)
115 } DtSpinBoxClassPart;
117 typedef struct _DtSpinBoxClassRec {
118 CoreClassPart core_class;
119 CompositeClassPart composite_class;
120 ConstraintClassPart constraint_class;
121 XmManagerClassPart manager_class;
122 DtSpinBoxClassPart spin_box_class;
125 extern DtSpinBoxClassRec dtSpinBoxClassRec;
131 typedef struct _DtSpinBoxPart {
136 unsigned char which_arrow;
141 float increment, current;
142 char float_format[10];
144 Dimension old_height;
145 Dimension label_max_length;
146 Dimension label_max_height;
148 /* Resource-related data */
149 unsigned char arrow_sensitivity;
150 short decimal_points;
151 int numeric_increment;
156 unsigned char child_type;
158 XtCallbackList activate_callback;
159 unsigned char alignment;
160 unsigned char arrow_layout;
161 Dimension arrow_size;
164 XtCallbackList focus_callback;
165 unsigned int initial_delay;
166 XtCallbackList losing_focus_callback;
167 Dimension margin_height;
168 Dimension margin_width;
170 XtCallbackList modify_verify_callback;
171 Boolean recompute_size;
172 unsigned int repeat_delay;
174 XtCallbackList value_changed_callback;
180 /* String list related resources */
182 /* Numeric related resources */
184 /* TextField resources */
188 /* Full instance record declaration */
189 typedef struct _DtSpinBoxRec {
191 CompositePart composite;
192 ConstraintPart constraint;
193 XmManagerPart manager;
194 DtSpinBoxPart spin_box;
198 } /* Close scope of 'extern "C"' declaration which encloses file. */
201 #endif /* _SpinBoxP_h */