1 /* $XConsortium: ComboBox.h /main/4 1995/10/26 09:29:51 rswiston $ */
3 * (c) Copyright 1993, 1994 Hewlett-Packard Company
4 * (c) Copyright 1993, 1994 International Business Machines Corp.
5 * (c) Copyright 1993, 1994 Novell, Inc.
6 * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
8 /***********************************************************
9 Copyright 1993 Interleaf, Inc.
11 Permission to use, copy, modify, and distribute this software
12 and its documentation for any purpose without fee is granted,
13 provided that the above copyright notice appear in all copies
14 and that both copyright notice and this permission notice appear
15 in supporting documentation, and that the name of Interleaf not
16 be used in advertising or publicly pertaining to distribution of
17 the software without specific written prior permission.
19 Interleaf makes no representation about the suitability of this
20 software for any purpose. It is provided "AS IS" without any
21 express or implied warranty.
22 ******************************************************************/
24 #ifndef _Dt_ComboBox_h
25 #define _Dt_ComboBox_h
28 * This widget is deprecated in favor of XmComboBox. The two are very
29 * similar, but do have minor differences. Applications doing new
30 * development are encouraged to use XmComboBox directly. Existing
31 * applications may wish to recompile with DT_USE_XM_COMBOBOX.
35 #ifdef DT_USE_XM_COMBOBOX
36 #include <Xm/ComboBox.h>
51 #ifndef DT_USE_XM_COMBOBOX
53 /***********************************************************************
56 * Because of future development of the ComboBox, not all of the
57 * following resources should be used. The only ones which are
58 * supported are the ones found in the Common Desktop Environment:
59 * Programmer's Guide. The supported resources include:
60 * DtNmarginHeight, DtNmarginWidth, DtNselectedItem,
61 * DtNselectedPosition, DtNselectionCallback, and DtNcomboBoxType.
63 * The use of the unsupported resources found in this header
64 * file may cause dangerous and unexpected behavior.
66 **********************************************************************/
68 /* WARNING: DtNactivateCallback is an unsupported resource in CDE 1.0 */
69 #ifndef DtNactivateCallback
70 #define DtNactivateCallback XmNactivateCallback
72 /* WARNING: DtNalignment is an unsupported resource in CDE 1.0 */
74 #define DtNalignment XmNalignment
76 /* WARNING: DtNarrowSize is an unsupported resource in CDE 1.0 */
78 #define DtNarrowSize "arrowSize"
80 /* WARNING: DtNarrowSpacing is an unsupported resource in CDE 1.0 */
81 #ifndef DtNarrowSpacing
82 #define DtNarrowSpacing "arrowSpacing"
84 /* WARNING: DtNarrowType is an unsupported resource in CDE 1.0 */
86 #define DtNarrowType "arrowType"
88 /* WARNING: DtNcolumns is an unsupported resource in CDE 1.0 */
90 #define DtNcolumns XmNcolumns
92 #ifndef DtNcomboBoxType
93 #define DtNcomboBoxType "comboBoxType"
95 /* WARNING: DtNfocusCallback is an unsupported resource in CDE 1.0 */
96 #ifndef DtNfocusCallback
97 #define DtNfocusCallback XmNfocusCallback
99 /* WARNING: DtNhorizontalSpacing is an unsupported resource in CDE 1.0 */
100 #ifndef DtNhorizontalSpacing
101 #define DtNhorizontalSpacing XmNhorizontalSpacing
103 /* WARNING: DtNitemCount is an unsupported resource in CDE 1.0 */
105 #define DtNitemCount XmNitemCount
107 /* WARNING: DtNitems is an unsupported resource in CDE 1.0 */
109 #define DtNitems XmNitems
111 /* WARNING: DtNlabelString is an unsupported resource in CDE 1.0 */
112 #ifndef DtNlabelString
113 #define DtNlabelString XmNlabelString
115 /* WARNING: DtNlist is an unsupported resource in CDE 1.0 */
117 #define DtNlist "list"
119 /* WARNING: DtNlistFontList is an unsupported resource in CDE 1.0 */
120 #ifndef DtNlistFontList
121 #define DtNlistFontList "listFontList"
123 /* WARNING: DtNlistMarginHeight is an unsupported resource in CDE 1.0 */
124 #ifndef DtNlistMarginHeight
125 #define DtNlistMarginHeight XmNlistMarginHeight
127 /* WARNING: DtNlistMarginWidth is an unsupported resource in CDE 1.0 */
128 #ifndef DtNlistMarginWidth
129 #define DtNlistMarginWidth XmNlistMarginWidth
131 /* WARNING: DtNlistSpacing is an unsupported resource in CDE 1.0 */
132 #ifndef DtNlistSpacing
133 #define DtNlistSpacing XmNlistSpacing
135 /* WARNING: DtNlosingFocusCallback is an unsupported resource in CDE 1.0 */
136 #ifndef DtNlosingFocusCallback
137 #define DtNlosingFocusCallback XmNlosingFocusCallback
139 #ifndef DtNmarginHeight
140 #define DtNmarginHeight XmNmarginHeight
142 #ifndef DtNmarginWidth
143 #define DtNmarginWidth XmNmarginWidth
145 /* WARNING: DtNmaxLength is an unsupported resource in CDE 1.0 */
147 #define DtNmaxLength XmNmaxLength
149 /* WARNING: DtNmenuPostCallback is an unsupported resource in CDE 1.0 */
150 #ifndef DtNmenuPostCallback
151 #define DtNmenuPostCallback "menuPostCallback"
153 /* WARNING: DtNorientation is an unsupported resource in CDE 1.0 */
154 #ifndef DtNorientation
155 #define DtNorientation XmNorientation
157 /* WARNING: DtNpoppedUp is an unsupported resource in CDE 1.0 */
159 #define DtNpoppedUp "poppedUp"
161 /* WARNING: DtNrecomputeSize is an unsupported resource in CDE 1.0 */
162 #ifndef DtNrecomputeSize
163 #define DtNrecomputeSize XmNrecomputeSize
165 #ifndef DtNselectedItem
166 #define DtNselectedItem "selectedItem"
168 #ifndef DtNselectedPosition
169 #define DtNselectedPosition "selectedPosition"
171 #ifndef DtNselectionCallback
172 #define DtNselectionCallback "selectionCallback"
174 /* WARNING: DtNtextField is an unsupported resource in CDE 1.0 */
176 #define DtNtextField "textField"
178 /* WARNING: DtNtopItemPosition is an unsupported resource in CDE 1.0 */
179 #ifndef DtNtopItemPosition
180 #define DtNtopItemPosition XmNtopItemPosition
182 /* WARNING: DtNupdateLabel is an unsupported resource in CDE 1.0 */
183 #ifndef DtNupdateLabel
184 #define DtNupdateLabel "updateLabel"
186 /* WARNING: DtNverticalSpacing is an unsupported resource in CDE 1.0 */
187 #ifndef DtNverticalSpacing
188 #define DtNverticalSpacing XmNverticalSpacing
190 /* WARNING: DtNvisibleItemCount is an unsupported resource in CDE 1.0 */
191 #ifndef DtNvisibleItemCount
192 #define DtNvisibleItemCount XmNvisibleItemCount
196 #define DtCAlignment XmCAlignment
199 #define DtCArrowSize "ArrowSize"
201 #ifndef DtCArrowSpacing
202 #define DtCArrowSpacing "ArrowSpacing"
205 #define DtCArrowType "ArrowType"
208 #define DtCCallback XmCCallback
211 #define DtCColumns XmCColumns
213 #ifndef DtCComboBoxType
214 #define DtCComboBoxType "ComboBoxType"
216 #ifndef DtCHorizontalSpacing
217 #define DtCHorizontalSpacing "HorizontalSpacing"
220 #define DtCItemCount XmCItemCount
223 #define DtCItems XmCItems
226 #define DtCList "List"
228 #ifndef DtCListFontList
229 #define DtCListFontList "ListFontList"
231 #ifndef DtCListMarginHeight
232 #define DtCListMarginHeight XmCListMarginHeight
234 #ifndef DtCListMarginWidth
235 #define DtCListMarginWidth XmCListMarginWidth
237 #ifndef DtCListSpacing
238 #define DtCListSpacing XmCListSpacing
240 #ifndef DtCMarginHeight
241 #define DtCMarginHeight XmCMarginHeight
243 #ifndef DtCMarginWidth
244 #define DtCMarginWidth XmCMarginWidth
247 #define DtCMaxLength XmCMaxLength
249 #ifndef DtCOrientation
250 #define DtCOrientation XmCOrientation
253 #define DtCPoppedUp "PoppedUp"
255 #ifndef DtCRecomputeSize
256 #define DtCRecomputeSize XmCRecomputeSize
258 #ifndef DtCSelectedItem
259 #define DtCSelectedItem "SelectedItem"
261 #ifndef DtCSelectedPosition
262 #define DtCSelectedPosition "SelectedPosition"
265 #define DtCTextField "TextField"
267 #ifndef DtCTopItemPosition
268 #define DtCTopItemPosition XmCTopItemPosition
270 #ifndef DtCUpdateLabel
271 #define DtCUpdateLabel "UpdateLabel"
273 #ifndef DtCVerticalSpacing
274 #define DtCVerticalSpacing "VerticalSpacing"
276 #ifndef DtCVisibleItemCount
277 #define DtCVisibleItemCount XmCVisibleItemCount
280 #define DtCXmString XmCXmString
283 #else /* DT_USE_XM_COMBOBOX */
286 #define DtNarrowSize XmNarrowSize
288 #ifndef DtNarrowSpacing
289 #define DtNarrowSpacing XmNarrowSpacing
292 #define DtNcolumns XmNcolumns
294 #ifndef DtNcomboBoxType
295 #define DtNcomboBoxType XmNcomboBoxType
298 #define DtNitemCount XmNitemCount
301 #define DtNitems XmNitems
303 #ifndef DtNlabelString
304 #define DtNlabelString XmNlabelString
307 #define DtNlist XmNlist
309 #ifndef DtNmarginHeight
310 #define DtNmarginHeight XmNmarginHeight
312 #ifndef DtNmarginWidth
313 #define DtNmarginWidth XmNmarginWidth
315 #ifndef DtNselectedItem
316 #define DtNselectedItem XmNselectedItem
318 #ifndef DtNselectedPosition
319 #define DtNselectedPosition XmNselectedPosition
321 #ifndef DtNselectionCallback
322 #define DtNselectionCallback XmNselectionCallback
325 #define DtNtextField XmNtextField
327 #ifndef DtNvisibleItemCount
328 #define DtNvisibleItemCount XmNvisibleItemCount
332 #define DtCArrowSize XmCArrowSize
334 #ifndef DtCArrowSpacing
335 #define DtCArrowSpacing XmCArrowSpacing
338 #define DtCCallback XmCCallback
341 #define DtCColumns XmCColumns
343 #ifndef DtCComboBoxType
344 #define DtCComboBoxType XmCComboBoxType
347 #define DtCItemCount XmCItemCount
350 #define DtCItems XmCItems
353 #define DtCList XmCList
355 #ifndef DtCMarginHeight
356 #define DtCMarginHeight XmCMarginHeight
358 #ifndef DtCMarginWidth
359 #define DtCMarginWidth XmCMarginWidth
361 #ifndef DtCSelectedItem
362 #define DtCSelectedItem XmCSelectedItem
364 #ifndef DtCSelectedPosition
365 #define DtCSelectedPosition XmCSelectedPosition
368 #define DtCTextField XmCTextField
370 #ifndef DtCVisibleItemCount
371 #define DtCVisibleItemCount XmCVisibleItemCount
374 #define DtCXmString XmCXmString
377 #endif /* DT_USE_XM_COMBOBOX */
379 /* Representation types */
381 #ifndef DT_USE_XM_COMBOBOX
384 #define DtRArrowType "ArrowType"
386 #ifndef DtRComboBoxType
387 #define DtRComboBoxType "ComboBoxType"
390 #else /* DT_USE_XM_COMBOBOX */
392 #ifndef DtRComboBoxType
393 #define DtRComboBoxType XmRComboBoxType
396 #endif /* DT_USE_XM_COMBOBOX */
398 /* DtNorientation values */
400 #ifndef DT_USE_XM_COMBOBOX
409 #endif /* not DT_USE_XM_COMBOBOX */
411 /* DtNarrowType values */
413 #ifndef DT_USE_XM_COMBOBOX
422 #endif /* not DT_USE_XM_COMBOBOX */
424 /* DtNcomboBoxType values */
426 #ifndef DT_USE_XM_COMBOBOX
428 #ifndef DtDROP_DOWN_LIST
429 #define DtDROP_DOWN_LIST 2
431 #ifndef DtDROP_DOWN_COMBO_BOX
432 #define DtDROP_DOWN_COMBO_BOX 1
435 #else /* DT_USE_XM_COMBOBOX */
437 #ifndef DtDROP_DOWN_LIST
438 #define DtDROP_DOWN_LIST XmDROP_DOWN_LIST
440 #ifndef DtDROP_DOWN_COMBO_BOX
441 #define DtDROP_DOWN_COMBO_BOX XmDROP_DOWN_COMBO_BOX
444 #endif /* DT_USE_XM_COMBOBOX */
446 /* DtNalignment values */
448 #ifndef DT_USE_XM_COMBOBOX
450 #ifndef DtALIGNMENT_BEGINNING
451 #define DtALIGNMENT_BEGINNING XmALIGNMENT_BEGINNING
453 #ifndef DtALIGNMENT_CENTER
454 #define DtALIGNMENT_CENTER XmALIGNMENT_CENTER
456 #ifndef DtALIGNMENT_END
457 #define DtALIGNMENT_END XmALIGNMENT_END
460 #endif /* not DT_USE_XM_COMBOBOX */
462 /* Callback reasons */
464 #ifndef DT_USE_XM_COMBOBOX
467 #define DtCR_SELECT 57 /* Large #, so no collisions with XM */
469 #ifndef DtCR_MENU_POST
470 #define DtCR_MENU_POST 129 /* Large #, so no collisions with XM */
473 #endif /* not DT_USE_XM_COMBOBOX */
480 #ifndef DT_USE_XM_COMBOBOX
485 XmString item_or_text;
487 } DtComboBoxCallbackStruct;
490 /* Widget class and instance */
492 typedef struct _DtComboBoxClassRec *DtComboBoxWidgetClass;
493 typedef struct _DtComboBoxRec *DtComboBoxWidget;
495 #else /* DT_USE_XM_COMBOBOX */
497 #define DtComboBoxCallbackStruct XmComboBoxCallbackStruct
498 #define DtComboBoxWidgetClass XmComboBoxWidgetClass
499 #define DtComboBoxWidget XmComboBoxWidget
501 #endif /* DT_USE_XM_COMBOBOX */
508 #ifndef DT_USE_XM_COMBOBOX
510 /* Widget class record */
512 externalref WidgetClass dtComboBoxWidgetClass;
514 #else /* DT_USE_XM_COMBOBOX */
516 #define dtComboBoxWidgetClass xmComboBoxWidgetClass;
518 #endif /* DT_USE_XM_COMBOBOX */
525 #ifndef DT_USE_XM_COMBOBOX
527 extern Widget DtCreateComboBox(
533 extern void DtComboBoxAddItem(
539 extern void DtComboBoxDeletePos(
543 extern void DtComboBoxSetItem(
547 extern void DtComboBoxSelectItem(
551 #else /* DT_USE_XM_COMBOBOX */
553 #define DtCreateComboBox XmCreateComboBox
554 #define DtComboBoxAddItem XmComboBoxAddItem
555 #define DtComboBoxDeletePos XmComboBoxDeletePos
556 #define DtComboBoxSetItem XmComboBoxSetItem
557 #define DtComboBoxSelectItem XmComboBoxSelectItem
559 #endif /* DT_USE_XM_COMBOBOX */
565 #endif /* _Dt_ComboBox_h */