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: ComboBox.h /main/4 1995/10/26 09:29:51 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 ******************************************************************/
46 #ifndef _Dt_ComboBox_h
47 #define _Dt_ComboBox_h
50 * This widget is deprecated in favor of XmComboBox. The two are very
51 * similar, but do have minor differences. Applications doing new
52 * development are encouraged to use XmComboBox directly. Existing
53 * applications may wish to recompile with DT_USE_XM_COMBOBOX.
57 #ifdef DT_USE_XM_COMBOBOX
58 #include <Xm/ComboBox.h>
73 #ifndef DT_USE_XM_COMBOBOX
75 /***********************************************************************
78 * Because of future development of the ComboBox, not all of the
79 * following resources should be used. The only ones which are
80 * supported are the ones found in the Common Desktop Environment:
81 * Programmer's Guide. The supported resources include:
82 * DtNmarginHeight, DtNmarginWidth, DtNselectedItem,
83 * DtNselectedPosition, DtNselectionCallback, and DtNcomboBoxType.
85 * The use of the unsupported resources found in this header
86 * file may cause dangerous and unexpected behavior.
88 **********************************************************************/
90 /* WARNING: DtNactivateCallback is an unsupported resource in CDE 1.0 */
91 #ifndef DtNactivateCallback
92 #define DtNactivateCallback XmNactivateCallback
94 /* WARNING: DtNalignment is an unsupported resource in CDE 1.0 */
96 #define DtNalignment XmNalignment
98 /* WARNING: DtNarrowSize is an unsupported resource in CDE 1.0 */
100 #define DtNarrowSize "arrowSize"
102 /* WARNING: DtNarrowSpacing is an unsupported resource in CDE 1.0 */
103 #ifndef DtNarrowSpacing
104 #define DtNarrowSpacing "arrowSpacing"
106 /* WARNING: DtNarrowType is an unsupported resource in CDE 1.0 */
108 #define DtNarrowType "arrowType"
110 /* WARNING: DtNcolumns is an unsupported resource in CDE 1.0 */
112 #define DtNcolumns XmNcolumns
114 #ifndef DtNcomboBoxType
115 #define DtNcomboBoxType "comboBoxType"
117 /* WARNING: DtNfocusCallback is an unsupported resource in CDE 1.0 */
118 #ifndef DtNfocusCallback
119 #define DtNfocusCallback XmNfocusCallback
121 /* WARNING: DtNhorizontalSpacing is an unsupported resource in CDE 1.0 */
122 #ifndef DtNhorizontalSpacing
123 #define DtNhorizontalSpacing XmNhorizontalSpacing
125 /* WARNING: DtNitemCount is an unsupported resource in CDE 1.0 */
127 #define DtNitemCount XmNitemCount
129 /* WARNING: DtNitems is an unsupported resource in CDE 1.0 */
131 #define DtNitems XmNitems
133 /* WARNING: DtNlabelString is an unsupported resource in CDE 1.0 */
134 #ifndef DtNlabelString
135 #define DtNlabelString XmNlabelString
137 /* WARNING: DtNlist is an unsupported resource in CDE 1.0 */
139 #define DtNlist "list"
141 /* WARNING: DtNlistFontList is an unsupported resource in CDE 1.0 */
142 #ifndef DtNlistFontList
143 #define DtNlistFontList "listFontList"
145 /* WARNING: DtNlistMarginHeight is an unsupported resource in CDE 1.0 */
146 #ifndef DtNlistMarginHeight
147 #define DtNlistMarginHeight XmNlistMarginHeight
149 /* WARNING: DtNlistMarginWidth is an unsupported resource in CDE 1.0 */
150 #ifndef DtNlistMarginWidth
151 #define DtNlistMarginWidth XmNlistMarginWidth
153 /* WARNING: DtNlistSpacing is an unsupported resource in CDE 1.0 */
154 #ifndef DtNlistSpacing
155 #define DtNlistSpacing XmNlistSpacing
157 /* WARNING: DtNlosingFocusCallback is an unsupported resource in CDE 1.0 */
158 #ifndef DtNlosingFocusCallback
159 #define DtNlosingFocusCallback XmNlosingFocusCallback
161 #ifndef DtNmarginHeight
162 #define DtNmarginHeight XmNmarginHeight
164 #ifndef DtNmarginWidth
165 #define DtNmarginWidth XmNmarginWidth
167 /* WARNING: DtNmaxLength is an unsupported resource in CDE 1.0 */
169 #define DtNmaxLength XmNmaxLength
171 /* WARNING: DtNmenuPostCallback is an unsupported resource in CDE 1.0 */
172 #ifndef DtNmenuPostCallback
173 #define DtNmenuPostCallback "menuPostCallback"
175 /* WARNING: DtNorientation is an unsupported resource in CDE 1.0 */
176 #ifndef DtNorientation
177 #define DtNorientation XmNorientation
179 /* WARNING: DtNpoppedUp is an unsupported resource in CDE 1.0 */
181 #define DtNpoppedUp "poppedUp"
183 /* WARNING: DtNrecomputeSize is an unsupported resource in CDE 1.0 */
184 #ifndef DtNrecomputeSize
185 #define DtNrecomputeSize XmNrecomputeSize
187 #ifndef DtNselectedItem
188 #define DtNselectedItem "selectedItem"
190 #ifndef DtNselectedPosition
191 #define DtNselectedPosition "selectedPosition"
193 #ifndef DtNselectionCallback
194 #define DtNselectionCallback "selectionCallback"
196 /* WARNING: DtNtextField is an unsupported resource in CDE 1.0 */
198 #define DtNtextField "textField"
200 /* WARNING: DtNtopItemPosition is an unsupported resource in CDE 1.0 */
201 #ifndef DtNtopItemPosition
202 #define DtNtopItemPosition XmNtopItemPosition
204 /* WARNING: DtNupdateLabel is an unsupported resource in CDE 1.0 */
205 #ifndef DtNupdateLabel
206 #define DtNupdateLabel "updateLabel"
208 /* WARNING: DtNverticalSpacing is an unsupported resource in CDE 1.0 */
209 #ifndef DtNverticalSpacing
210 #define DtNverticalSpacing XmNverticalSpacing
212 /* WARNING: DtNvisibleItemCount is an unsupported resource in CDE 1.0 */
213 #ifndef DtNvisibleItemCount
214 #define DtNvisibleItemCount XmNvisibleItemCount
218 #define DtCAlignment XmCAlignment
221 #define DtCArrowSize "ArrowSize"
223 #ifndef DtCArrowSpacing
224 #define DtCArrowSpacing "ArrowSpacing"
227 #define DtCArrowType "ArrowType"
230 #define DtCCallback XmCCallback
233 #define DtCColumns XmCColumns
235 #ifndef DtCComboBoxType
236 #define DtCComboBoxType "ComboBoxType"
238 #ifndef DtCHorizontalSpacing
239 #define DtCHorizontalSpacing "HorizontalSpacing"
242 #define DtCItemCount XmCItemCount
245 #define DtCItems XmCItems
248 #define DtCList "List"
250 #ifndef DtCListFontList
251 #define DtCListFontList "ListFontList"
253 #ifndef DtCListMarginHeight
254 #define DtCListMarginHeight XmCListMarginHeight
256 #ifndef DtCListMarginWidth
257 #define DtCListMarginWidth XmCListMarginWidth
259 #ifndef DtCListSpacing
260 #define DtCListSpacing XmCListSpacing
262 #ifndef DtCMarginHeight
263 #define DtCMarginHeight XmCMarginHeight
265 #ifndef DtCMarginWidth
266 #define DtCMarginWidth XmCMarginWidth
269 #define DtCMaxLength XmCMaxLength
271 #ifndef DtCOrientation
272 #define DtCOrientation XmCOrientation
275 #define DtCPoppedUp "PoppedUp"
277 #ifndef DtCRecomputeSize
278 #define DtCRecomputeSize XmCRecomputeSize
280 #ifndef DtCSelectedItem
281 #define DtCSelectedItem "SelectedItem"
283 #ifndef DtCSelectedPosition
284 #define DtCSelectedPosition "SelectedPosition"
287 #define DtCTextField "TextField"
289 #ifndef DtCTopItemPosition
290 #define DtCTopItemPosition XmCTopItemPosition
292 #ifndef DtCUpdateLabel
293 #define DtCUpdateLabel "UpdateLabel"
295 #ifndef DtCVerticalSpacing
296 #define DtCVerticalSpacing "VerticalSpacing"
298 #ifndef DtCVisibleItemCount
299 #define DtCVisibleItemCount XmCVisibleItemCount
302 #define DtCXmString XmCXmString
305 #else /* DT_USE_XM_COMBOBOX */
308 #define DtNarrowSize XmNarrowSize
310 #ifndef DtNarrowSpacing
311 #define DtNarrowSpacing XmNarrowSpacing
314 #define DtNcolumns XmNcolumns
316 #ifndef DtNcomboBoxType
317 #define DtNcomboBoxType XmNcomboBoxType
320 #define DtNitemCount XmNitemCount
323 #define DtNitems XmNitems
325 #ifndef DtNlabelString
326 #define DtNlabelString XmNlabelString
329 #define DtNlist XmNlist
331 #ifndef DtNmarginHeight
332 #define DtNmarginHeight XmNmarginHeight
334 #ifndef DtNmarginWidth
335 #define DtNmarginWidth XmNmarginWidth
337 #ifndef DtNselectedItem
338 #define DtNselectedItem XmNselectedItem
340 #ifndef DtNselectedPosition
341 #define DtNselectedPosition XmNselectedPosition
343 #ifndef DtNselectionCallback
344 #define DtNselectionCallback XmNselectionCallback
347 #define DtNtextField XmNtextField
349 #ifndef DtNvisibleItemCount
350 #define DtNvisibleItemCount XmNvisibleItemCount
354 #define DtCArrowSize XmCArrowSize
356 #ifndef DtCArrowSpacing
357 #define DtCArrowSpacing XmCArrowSpacing
360 #define DtCCallback XmCCallback
363 #define DtCColumns XmCColumns
365 #ifndef DtCComboBoxType
366 #define DtCComboBoxType XmCComboBoxType
369 #define DtCItemCount XmCItemCount
372 #define DtCItems XmCItems
375 #define DtCList XmCList
377 #ifndef DtCMarginHeight
378 #define DtCMarginHeight XmCMarginHeight
380 #ifndef DtCMarginWidth
381 #define DtCMarginWidth XmCMarginWidth
383 #ifndef DtCSelectedItem
384 #define DtCSelectedItem XmCSelectedItem
386 #ifndef DtCSelectedPosition
387 #define DtCSelectedPosition XmCSelectedPosition
390 #define DtCTextField XmCTextField
392 #ifndef DtCVisibleItemCount
393 #define DtCVisibleItemCount XmCVisibleItemCount
396 #define DtCXmString XmCXmString
399 #endif /* DT_USE_XM_COMBOBOX */
401 /* Representation types */
403 #ifndef DT_USE_XM_COMBOBOX
406 #define DtRArrowType "ArrowType"
408 #ifndef DtRComboBoxType
409 #define DtRComboBoxType "ComboBoxType"
412 #else /* DT_USE_XM_COMBOBOX */
414 #ifndef DtRComboBoxType
415 #define DtRComboBoxType XmRComboBoxType
418 #endif /* DT_USE_XM_COMBOBOX */
420 /* DtNorientation values */
422 #ifndef DT_USE_XM_COMBOBOX
431 #endif /* not DT_USE_XM_COMBOBOX */
433 /* DtNarrowType values */
435 #ifndef DT_USE_XM_COMBOBOX
444 #endif /* not DT_USE_XM_COMBOBOX */
446 /* DtNcomboBoxType values */
448 #ifndef DT_USE_XM_COMBOBOX
450 #ifndef DtDROP_DOWN_LIST
451 #define DtDROP_DOWN_LIST 2
453 #ifndef DtDROP_DOWN_COMBO_BOX
454 #define DtDROP_DOWN_COMBO_BOX 1
457 #else /* DT_USE_XM_COMBOBOX */
459 #ifndef DtDROP_DOWN_LIST
460 #define DtDROP_DOWN_LIST XmDROP_DOWN_LIST
462 #ifndef DtDROP_DOWN_COMBO_BOX
463 #define DtDROP_DOWN_COMBO_BOX XmDROP_DOWN_COMBO_BOX
466 #endif /* DT_USE_XM_COMBOBOX */
468 /* DtNalignment values */
470 #ifndef DT_USE_XM_COMBOBOX
472 #ifndef DtALIGNMENT_BEGINNING
473 #define DtALIGNMENT_BEGINNING XmALIGNMENT_BEGINNING
475 #ifndef DtALIGNMENT_CENTER
476 #define DtALIGNMENT_CENTER XmALIGNMENT_CENTER
478 #ifndef DtALIGNMENT_END
479 #define DtALIGNMENT_END XmALIGNMENT_END
482 #endif /* not DT_USE_XM_COMBOBOX */
484 /* Callback reasons */
486 #ifndef DT_USE_XM_COMBOBOX
489 #define DtCR_SELECT 57 /* Large #, so no collisions with XM */
491 #ifndef DtCR_MENU_POST
492 #define DtCR_MENU_POST 129 /* Large #, so no collisions with XM */
495 #endif /* not DT_USE_XM_COMBOBOX */
502 #ifndef DT_USE_XM_COMBOBOX
507 XmString item_or_text;
509 } DtComboBoxCallbackStruct;
512 /* Widget class and instance */
514 typedef struct _DtComboBoxClassRec *DtComboBoxWidgetClass;
515 typedef struct _DtComboBoxRec *DtComboBoxWidget;
517 #else /* DT_USE_XM_COMBOBOX */
519 #define DtComboBoxCallbackStruct XmComboBoxCallbackStruct
520 #define DtComboBoxWidgetClass XmComboBoxWidgetClass
521 #define DtComboBoxWidget XmComboBoxWidget
523 #endif /* DT_USE_XM_COMBOBOX */
530 #ifndef DT_USE_XM_COMBOBOX
532 /* Widget class record */
534 externalref WidgetClass dtComboBoxWidgetClass;
536 #else /* DT_USE_XM_COMBOBOX */
538 #define dtComboBoxWidgetClass xmComboBoxWidgetClass;
540 #endif /* DT_USE_XM_COMBOBOX */
547 #ifndef DT_USE_XM_COMBOBOX
549 extern Widget DtCreateComboBox(
555 extern void DtComboBoxAddItem(
561 extern void DtComboBoxDeletePos(
565 extern void DtComboBoxSetItem(
569 extern void DtComboBoxSelectItem(
573 #else /* DT_USE_XM_COMBOBOX */
575 #define DtCreateComboBox XmCreateComboBox
576 #define DtComboBoxAddItem XmComboBoxAddItem
577 #define DtComboBoxDeletePos XmComboBoxDeletePos
578 #define DtComboBoxSetItem XmComboBoxSetItem
579 #define DtComboBoxSelectItem XmComboBoxSelectItem
581 #endif /* DT_USE_XM_COMBOBOX */
587 #endif /* _Dt_ComboBox_h */