]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * ComboBox.h - Das schon lange schmerzlich vermisste Combo-Box- | |
3 | * Widget -- nun endlich auf fuer Motif! | |
4 | * | |
5 | * Letzte Modifikation: 04.10.1995 Revisionsstand: 1.32a | |
6 | * | |
7 | * (c) 1993, 1994 Harald Albrecht | |
8 | * Institut fuer Geometrie und Praktische Mathematik | |
9 | * RWTH Aachen, Germany | |
10 | * albrecht@igpm.rwth-aachen.de | |
11 | * | |
12 | * This program is free software; you can redistribute it and/or modify | |
13 | * it under the terms of the GNU General Public License as published by | |
14 | * the Free Software Foundation; either version 2 of the License, or | |
15 | * (at your option) any later version. | |
16 | * | |
17 | * This program is distributed in the hope that it will be useful, | |
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 | * GNU General Public License for more details. | |
21 | * | |
22 | * You should have received a copy of the GNU General Public License | |
23 | * along with this program (see the file COPYING for more details); | |
24 | * if not, write to the Free Software Foundation, Inc., 675 Mass Ave, | |
25 | * Cambridge, MA 02139, USA. | |
26 | * | |
27 | */ | |
28 | #ifndef __ComboBoxWidget_h | |
29 | #define __ComboBoxWidget_h | |
30 | ||
31 | #include <Xm/Xm.h> | |
32 | ||
33 | #if defined(__cplusplus) || defined(c_plusplus) | |
34 | extern "C" { | |
35 | #endif | |
36 | ||
37 | #define XmNselectionCallback "selectionCallback" | |
38 | #define XmCSelectionCallback "SelectionCallback" | |
39 | #define XmNunselectionCallback "unselectionCallback" | |
40 | #define XmCUnselectionCallback "UnselectionCallback" | |
41 | #define XmNdropDownCallback "dropDownCallback" | |
42 | #define XmCDropDownCallback "DropDownCallback" | |
43 | ||
44 | #define XmNdropDownCursor "dropDownCursor" | |
45 | #define XmCDropDownCursor "DropDownCursor" | |
46 | ||
47 | /* ICH GLAUB' ES JA EINFACH NICHT! DIESE @#$!%^ BEI DER OSF HABEN | |
48 | * DOCH TATSAECHLICH VERGESSEN, DASS DIE EINTRAEGE IN DER LISTBOX | |
49 | * VIELLEICHT AUCH SORTIERT SEIN SOLLEN -- MUSS MAN DENN ALLES | |
50 | * SELBST MACHEN?! | |
51 | */ | |
52 | #define XmNsorted "sorted" | |
53 | #define XmCSorted "Sorted" | |
54 | #define XmNsortingCallback "sortingCallback" | |
55 | #define XmCSortingCallback "SortingCallback" | |
56 | ||
57 | #define XmNstaticList "staticList" | |
58 | #define XmCStaticList "StaticList" | |
59 | ||
60 | #define XmNsquareArrow "squareArrow" | |
61 | #define XmCSquareArrow "SquareArrow" | |
62 | #define XmNarrowSpacingOn "arrowSpacingOn" | |
63 | #define XmCArrowSpacingOn "ArrowSpacingOn" | |
64 | ||
65 | /* | |
66 | * Wie verhaeltsich die Liste, wenn der Focus verloren geht, sobald | |
67 | * der Mauszeiger aus dem Dialog herausbewegt wird? | |
68 | */ | |
69 | #define XmNpersistentDropDown "persistentDropDown" | |
70 | #define XmCPersistentDropDown "PersistentDropDown" | |
71 | #define XmNtwmHandlingOn "twmHandlingOn" | |
72 | #define XmCTwmHandlingOn "TwmHandlingOn" | |
73 | /* | |
74 | * alles fuer das Label... | |
75 | */ | |
76 | #define XmNshowLabel "showLabel" | |
77 | #define XmCShowLabel "ShowLabel" | |
78 | #define XmNdropDownOffset "dropDownOffset" | |
79 | #define XmCDropDownOffset "DropDownOffset" | |
80 | ||
81 | #define XmNlabelMarginBottom "labelMarginBottom" | |
82 | #define XmCLabelMarginBottom "LabelMarginBottom" | |
83 | #define XmNlabelMarginHeight "labelMarginHeight" | |
84 | #define XmCLabelMarginHeight "LabelMarginHeight" | |
85 | #define XmNlabelMarginLeft "labelMarginLeft" | |
86 | #define XmCLabelMarginLeft "LabelMarginLeft" | |
87 | #define XmNlabelMarginRight "labelMarginRight" | |
88 | #define XmCLabelMarginRight "LabelMarginRight" | |
89 | #define XmNlabelMarginTop "labelMarginTop" | |
90 | #define XmCLabelMarginTop "LabelMarginTop" | |
91 | #define XmNlabelMarginWidth "labelMarginWidth" | |
92 | #define XmCLabelMarginWidth "LabelMarginWidth" | |
93 | ||
94 | /* Callback reasons: (part. predefined) | |
95 | * | |
96 | * XmCR_SINGLE_SELECT user selected item in the list | |
97 | */ | |
98 | ||
99 | typedef struct { | |
100 | int reason; /* Grund */ | |
101 | XEvent *event; /* Ausloesender Event */ | |
102 | XmString value; /* Ausgewaehlter Eintrag */ | |
103 | int index; /* Index dieses Eintrages */ | |
104 | } XmComboBoxSelectionCallbackStruct,XmComboBoxDefaultActionCallbackStruct; | |
105 | ||
106 | typedef struct { | |
107 | int reason; | |
108 | XEvent *event; | |
109 | Boolean doit; | |
110 | Position currInsert, newInsert; | |
111 | Position startPos, endPos; | |
112 | XmTextBlock text; | |
113 | } XmComboBoxTextVerifyCallbackStruct, *XmComboBoxTextVerifyPtr; | |
114 | ||
115 | /* Callback reasons: new | |
116 | * | |
117 | * XmCR_SHOW_LIST list is dropping down | |
118 | * XmCR_HIDE_LIST list is getting hidden | |
119 | * | |
120 | * XmCR_UNSELECT unselecting item from list or osfDelete | |
121 | */ | |
122 | #define XmCR_SHOW_LIST 4200 /* ten times "42", that should */ | |
123 | #define XmCR_HIDE_LIST 4201 /* explain everything of live... */ | |
124 | #define XmCR_UNSELECT 4202 | |
125 | typedef struct { | |
126 | int reason; /* Grund */ | |
127 | XEvent *event; /* Ausloesender Event */ | |
128 | } XmComboBoxDropDownCallbackStruct, XmComboBoxUnselectionCallbackStruct; | |
129 | ||
130 | #define XmCR_SORTING 4203 | |
131 | #define XmOP_INIT 1 | |
132 | #define XmOP_DONE 2 | |
133 | #define XmOP_COMPARE 3 | |
134 | typedef struct { | |
135 | int reason; | |
136 | XEvent *event; /* IMMER NULL!! */ | |
137 | int operation; | |
138 | void *item_internal; | |
139 | XmString item; | |
140 | int result; | |
141 | } XmComboBoxSortingCallbackStruct, *XmComboBoxSortingPtr; | |
142 | ||
143 | /* Alle Funktionen, um auf die Liste der Combo-Box zuzugreifen. | |
144 | * Bitte immer diese Funktionen dazu benutzen und nicht direkt | |
145 | * auf das entsprechende Widget in der Combo-Box zugreifen! | |
146 | * Aus diesem Grunde sind auch nicht alle Funktionen einer Listbox | |
147 | * verfuegbar, da sich einige Funktionen mit der Verwaltung der | |
148 | * Combo-Box beissen wuerden. | |
149 | */ | |
150 | extern void XmComboBoxAddItem(Widget w, XmString item, int pos); | |
151 | extern void XmComboBoxAddItems(Widget w, XmString *items, int item_count, int pos); | |
152 | extern void XmComboBoxAddItemUnselected(Widget w, XmString item, int pos); | |
153 | extern void XmComboBoxDeleteItem(Widget w, XmString item); | |
154 | extern void XmComboBoxDeleteItems(Widget w, XmString *items, int item_count); | |
155 | extern void XmComboBoxDeletePos(Widget w, int pos); | |
156 | extern void XmComboBoxDeleteItemsPos(Widget w, int item_count, int pos); | |
157 | extern void XmComboBoxDeleteAllItems(Widget w); | |
158 | extern void XmComboBoxReplaceItems(Widget w, XmString *old_items, int item_count, XmString *new_items); | |
159 | extern void XmComboBoxReplaceItemsPos(Widget w, XmString *new_items, int item_count, int position); | |
160 | extern Boolean XmComboBoxItemExists(Widget w, XmString item); | |
161 | extern int XmComboBoxItemPos(Widget w, XmString item); | |
162 | extern Boolean XmComboBoxGetMatchPos(Widget w, XmString item, int **pos_list, int *pos_count); | |
163 | extern void XmComboBoxSelectPos(Widget w, int pos, Boolean notify); | |
164 | extern void XmComboBoxSelectItem(Widget w, XmString item, Boolean notify); | |
165 | /* Etwas anders als bei der Listbox, da es sowieso nur einen ausge- | |
166 | * waehlten Eintrag in der Listbox geben kann! | |
167 | * Liefert Index des ausgewaehlten Eintrages oder 0. | |
168 | */ | |
169 | extern int XmComboBoxGetSelectedPos(Widget w); | |
170 | extern void XmComboBoxClearItemSelection(Widget w); | |
171 | /* | |
172 | * Nun alle Funktionen, die auf das Eingabefeld zugreifen... | |
173 | * Auch hier gilt wieder, es gibt 'was auf die Finger, wenn jemand | |
174 | * versucht, direkt auf das Eingabefeld direkt zuzugreifen! | |
175 | */ | |
176 | extern void XmComboBoxClearSelection(Widget w, Time time); | |
177 | extern Boolean XmComboBoxCopy(Widget w, Time time); | |
178 | extern Boolean XmComboBoxCut(Widget w, Time time); | |
179 | extern XmTextPosition XmComboBoxGetInsertionPosition(Widget w); | |
180 | extern XmTextPosition XmComboBoxGetLastPosition(Widget w); | |
181 | extern int XmComboBoxGetMaxLength(Widget w); | |
182 | extern char * XmComboBoxGetSelection(Widget w); | |
183 | extern Boolean XmComboBoxGetSelectionPosition(Widget w, XmTextPosition *left, | |
184 | XmTextPosition *right); | |
185 | extern char * XmComboBoxGetString(Widget w); | |
186 | extern void XmComboBoxInsert(Widget w, XmTextPosition position, char *value); | |
187 | extern Boolean XmComboBoxPaste(Widget w); | |
188 | extern Boolean XmComboBoxRemove(Widget w); | |
189 | extern void XmComboBoxReplace(Widget w, XmTextPosition from_pos, | |
190 | XmTextPosition to_pos, char *value); | |
191 | extern void XmComboBoxSetAddMode(Widget w, Boolean state); | |
192 | extern void XmComboBoxSetHighlight(Widget w, XmTextPosition left, | |
193 | XmTextPosition right, XmHighlightMode mode); | |
194 | extern void XmComboBoxSetInsertionPosition(Widget w, XmTextPosition position); | |
195 | extern void XmComboBoxSetMaxLength(Widget w, int max_length); | |
196 | extern void XmComboBoxSetSelection(Widget w, XmTextPosition first, | |
197 | XmTextPosition last, Time time); | |
198 | extern void XmComboBoxSetString(Widget w, char *value); | |
199 | extern void XmComboBoxShowPosition(Widget w, XmTextPosition position); | |
200 | ||
201 | extern WidgetClass xmComboBoxWidgetClass; /* Die Klasse hoechstselbst */ | |
202 | ||
203 | #ifndef XmIsComboBox | |
204 | #define XmIsComboBox(w) XtIsSubclass(w, xmComboBoxWidgetClass) | |
205 | #endif /* XmIsComboBox */ | |
206 | ||
207 | typedef struct _XmComboBoxClassRec *XmComboBoxWidgetClass; | |
208 | typedef struct _XmComboBoxRec *XmComboBoxWidget; | |
209 | ||
210 | extern Widget XmCreateComboBox(Widget parent, String name, ArgList arglist, | |
211 | Cardinal argcount); | |
212 | ||
213 | /* PLEASE do not use this functions if you really not need to do so !!! */ | |
214 | extern Widget XmComboBoxGetEditWidget(Widget w); | |
215 | extern Widget XmComboBoxGetListWidget(Widget w); | |
216 | extern Widget XmComboBoxGetLabelWidget(Widget w); | |
217 | ||
218 | #if defined(__cplusplus) || defined(c_plusplus) | |
219 | } | |
220 | #endif | |
221 | ||
222 | #endif /* __ComboBoxWidget_h */ | |
223 | /* Ende von ComboBox.h */ |