]> git.saurik.com Git - wxWidgets.git/blob - include/wx/event.h
Whole lotta stuff for wxPlotWindow,
[wxWidgets.git] / include / wx / event.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: event.h
3 // Purpose: Event classes
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c)
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_EVENTH__
13 #define _WX_EVENTH__
14
15 #ifdef __GNUG__
16 #pragma interface "event.h"
17 #endif
18
19 #include "wx/defs.h"
20 #include "wx/object.h"
21
22 #if wxUSE_GUI
23 #include "wx/gdicmn.h"
24 #endif
25
26 #include "wx/thread.h"
27
28 // ----------------------------------------------------------------------------
29 // forward declarations
30 // ----------------------------------------------------------------------------
31
32 class WXDLLEXPORT wxList;
33
34 #if wxUSE_GUI
35 class WXDLLEXPORT wxClientData;
36 class WXDLLEXPORT wxDC;
37 class WXDLLEXPORT wxMenu;
38 class WXDLLEXPORT wxWindow;
39 #endif // wxUSE_GUI
40
41 // ----------------------------------------------------------------------------
42 // Event types
43 // ----------------------------------------------------------------------------
44
45 typedef int wxEventType;
46
47 #if defined(__VISAGECPP__) && __IBMCPP__ >= 400
48 // must define these static for VA or else you get multiply defined symbols everywhere
49 extern const wxEventType wxEVT_NULL;
50 extern const wxEventType wxEVT_FIRST;
51
52 extern const wxEventType wxEVT_COMMAND_BUTTON_CLICKED;
53 extern const wxEventType wxEVT_COMMAND_CHECKBOX_CLICKED;
54 extern const wxEventType wxEVT_COMMAND_CHOICE_SELECTED;
55 extern const wxEventType wxEVT_COMMAND_LISTBOX_SELECTED;
56 extern const wxEventType wxEVT_COMMAND_LISTBOX_DOUBLECLICKED;
57 extern const wxEventType wxEVT_COMMAND_CHECKLISTBOX_TOGGLED;
58 extern const wxEventType wxEVT_COMMAND_TEXT_UPDATED;
59 extern const wxEventType wxEVT_COMMAND_TEXT_ENTER;
60 extern const wxEventType wxEVT_COMMAND_MENU_SELECTED;
61 extern const wxEventType wxEVT_COMMAND_TOOL_CLICKED;
62 extern const wxEventType wxEVT_COMMAND_SLIDER_UPDATED;
63 extern const wxEventType wxEVT_COMMAND_RADIOBOX_SELECTED;
64 extern const wxEventType wxEVT_COMMAND_RADIOBUTTON_SELECTED;
65 extern const wxEventType wxEVT_COMMAND_SCROLLBAR_UPDATED;
66 extern const wxEventType wxEVT_COMMAND_VLBOX_SELECTED;
67 extern const wxEventType wxEVT_COMMAND_COMBOBOX_SELECTED;
68 extern const wxEventType wxEVT_COMMAND_TOOL_RCLICKED;
69 extern const wxEventType wxEVT_COMMAND_TOOL_ENTER;
70 extern const wxEventType wxEVT_COMMAND_SPINCTRL_UPDATED;
71
72 /* Sockets and timers send events, too */
73 extern const wxEventType wxEVT_SOCKET;
74 extern const wxEventType wxEVT_TIMER;
75
76 /* Mouse event types */
77 extern const wxEventType wxEVT_LEFT_DOWN;
78 extern const wxEventType wxEVT_LEFT_UP;
79 extern const wxEventType wxEVT_MIDDLE_DOWN;
80 extern const wxEventType wxEVT_MIDDLE_UP;
81 extern const wxEventType wxEVT_RIGHT_DOWN;
82 extern const wxEventType wxEVT_RIGHT_UP;
83 extern const wxEventType wxEVT_MOTION;
84 extern const wxEventType wxEVT_ENTER_WINDOW;
85 extern const wxEventType wxEVT_LEAVE_WINDOW;
86 extern const wxEventType wxEVT_LEFT_DCLICK;
87 extern const wxEventType wxEVT_MIDDLE_DCLICK;
88 extern const wxEventType wxEVT_RIGHT_DCLICK;
89 extern const wxEventType wxEVT_SET_FOCUS;
90 extern const wxEventType wxEVT_KILL_FOCUS;
91
92 /* Non-client mouse events */
93 extern const wxEventType wxEVT_NC_LEFT_DOWN;
94 extern const wxEventType wxEVT_NC_LEFT_UP;
95 extern const wxEventType wxEVT_NC_MIDDLE_DOWN;
96 extern const wxEventType wxEVT_NC_MIDDLE_UP;
97 extern const wxEventType wxEVT_NC_RIGHT_DOWN;
98 extern const wxEventType wxEVT_NC_RIGHT_UP;
99 extern const wxEventType wxEVT_NC_MOTION;
100 extern const wxEventType wxEVT_NC_ENTER_WINDOW;
101 extern const wxEventType wxEVT_NC_LEAVE_WINDOW;
102 extern const wxEventType wxEVT_NC_LEFT_DCLICK;
103 extern const wxEventType wxEVT_NC_MIDDLE_DCLICK;
104 extern const wxEventType wxEVT_NC_RIGHT_DCLICK;
105
106 /* Character input event type */
107 extern const wxEventType wxEVT_CHAR;
108 extern const wxEventType wxEVT_CHAR_HOOK;
109 extern const wxEventType wxEVT_NAVIGATION_KEY;
110 extern const wxEventType wxEVT_KEY_DOWN;
111 extern const wxEventType wxEVT_KEY_UP;
112
113 /*
114 * wxScrollbar and wxSlider event identifiers
115 */
116 extern const wxEventType wxEVT_SCROLL_TOP;
117 extern const wxEventType wxEVT_SCROLL_BOTTOM;
118 extern const wxEventType wxEVT_SCROLL_LINEUP;
119 extern const wxEventType wxEVT_SCROLL_LINEDOWN;
120 extern const wxEventType wxEVT_SCROLL_PAGEUP;
121 extern const wxEventType wxEVT_SCROLL_PAGEDOWN;
122 extern const wxEventType wxEVT_SCROLL_THUMBTRACK;
123
124 /*
125 * Scroll events from wxWindow
126 */
127 extern const wxEventType wxEVT_SCROLLWIN_TOP;
128 extern const wxEventType wxEVT_SCROLLWIN_BOTTOM;
129 extern const wxEventType wxEVT_SCROLLWIN_LINEUP;
130 extern const wxEventType wxEVT_SCROLLWIN_LINEDOWN;
131 extern const wxEventType wxEVT_SCROLLWIN_PAGEUP;
132 extern const wxEventType wxEVT_SCROLLWIN_PAGEDOWN;
133 extern const wxEventType wxEVT_SCROLLWIN_THUMBTRACK;
134
135 /*
136 * System events
137 */
138 extern const wxEventType wxEVT_SIZE;
139 extern const wxEventType wxEVT_MOVE;
140 extern const wxEventType wxEVT_CLOSE_WINDOW;
141 extern const wxEventType wxEVT_END_SESSION;
142 extern const wxEventType wxEVT_QUERY_END_SESSION;
143 extern const wxEventType wxEVT_ACTIVATE_APP;
144 extern const wxEventType wxEVT_POWER;
145 extern const wxEventType wxEVT_ACTIVATE;
146 extern const wxEventType wxEVT_CREATE;
147 extern const wxEventType wxEVT_DESTROY;
148 extern const wxEventType wxEVT_SHOW;
149 extern const wxEventType wxEVT_ICONIZE;
150 extern const wxEventType wxEVT_MAXIMIZE;
151 extern const wxEventType wxEVT_MOUSE_CAPTURE_CHANGED;
152 extern const wxEventType wxEVT_PAINT;
153 extern const wxEventType wxEVT_ERASE_BACKGROUND;
154 extern const wxEventType wxEVT_NC_PAINT;
155 extern const wxEventType wxEVT_PAINT_ICON;
156 extern const wxEventType wxEVT_MENU_CHAR;
157 extern const wxEventType wxEVT_MENU_INIT;
158 extern const wxEventType wxEVT_MENU_HIGHLIGHT;
159 extern const wxEventType wxEVT_POPUP_MENU_INIT;
160 extern const wxEventType wxEVT_CONTEXT_MENU;
161 extern const wxEventType wxEVT_SYS_COLOUR_CHANGED;
162 extern const wxEventType wxEVT_SETTING_CHANGED;
163 extern const wxEventType wxEVT_QUERY_NEW_PALETTE;
164 extern const wxEventType wxEVT_PALETTE_CHANGED;
165 extern const wxEventType wxEVT_JOY_BUTTON_DOWN;
166 extern const wxEventType wxEVT_JOY_BUTTON_UP;
167 extern const wxEventType wxEVT_JOY_MOVE;
168 extern const wxEventType wxEVT_JOY_ZMOVE;
169 extern const wxEventType wxEVT_DROP_FILES;
170 extern const wxEventType wxEVT_DRAW_ITEM;
171 extern const wxEventType wxEVT_MEASURE_ITEM;
172 extern const wxEventType wxEVT_COMPARE_ITEM;
173 extern const wxEventType wxEVT_INIT_DIALOG;
174 extern const wxEventType wxEVT_IDLE;
175 extern const wxEventType wxEVT_UPDATE_UI;
176
177 /* System misc. */
178 extern const wxEventType wxEVT_END_PROCESS;
179
180 /* Dial up events */
181 extern const wxEventType wxEVT_DIALUP_CONNECTED;
182 extern const wxEventType wxEVT_DIALUP_DISCONNECTED;
183
184 /* Generic command events */
185 /* Note: a click is a higher-level event than button down/up */
186 extern const wxEventType wxEVT_COMMAND_LEFT_CLICK;
187 extern const wxEventType wxEVT_COMMAND_LEFT_DCLICK;
188 extern const wxEventType wxEVT_COMMAND_RIGHT_CLICK;
189 extern const wxEventType wxEVT_COMMAND_RIGHT_DCLICK;
190 extern const wxEventType wxEVT_COMMAND_SET_FOCUS;
191 extern const wxEventType wxEVT_COMMAND_KILL_FOCUS;
192 extern const wxEventType wxEVT_COMMAND_ENTER;
193
194 /* Tree control event types */
195 extern const wxEventType wxEVT_COMMAND_TREE_BEGIN_DRAG;
196 extern const wxEventType wxEVT_COMMAND_TREE_BEGIN_RDRAG;
197 extern const wxEventType wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT;
198 extern const wxEventType wxEVT_COMMAND_TREE_END_LABEL_EDIT;
199 extern const wxEventType wxEVT_COMMAND_TREE_DELETE_ITEM;
200 extern const wxEventType wxEVT_COMMAND_TREE_GET_INFO;
201 extern const wxEventType wxEVT_COMMAND_TREE_SET_INFO;
202 extern const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDED;
203 extern const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDING;
204 extern const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSED;
205 extern const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSING;
206 extern const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGED;
207 extern const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGING;
208 extern const wxEventType wxEVT_COMMAND_TREE_KEY_DOWN;
209 extern const wxEventType wxEVT_COMMAND_TREE_ITEM_ACTIVATED;
210 extern const wxEventType wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK;
211 extern const wxEventType wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK;
212
213 /* List control event types */
214 extern const wxEventType wxEVT_COMMAND_LIST_BEGIN_DRAG;
215 extern const wxEventType wxEVT_COMMAND_LIST_BEGIN_RDRAG;
216 extern const wxEventType wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT;
217 extern const wxEventType wxEVT_COMMAND_LIST_END_LABEL_EDIT;
218 extern const wxEventType wxEVT_COMMAND_LIST_DELETE_ITEM;
219 extern const wxEventType wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS;
220 extern const wxEventType wxEVT_COMMAND_LIST_GET_INFO;
221 extern const wxEventType wxEVT_COMMAND_LIST_SET_INFO;
222 extern const wxEventType wxEVT_COMMAND_LIST_ITEM_SELECTED;
223 extern const wxEventType wxEVT_COMMAND_LIST_ITEM_DESELECTED;
224 extern const wxEventType wxEVT_COMMAND_LIST_KEY_DOWN;
225 extern const wxEventType wxEVT_COMMAND_LIST_INSERT_ITEM;
226 extern const wxEventType wxEVT_COMMAND_LIST_COL_CLICK;
227 extern const wxEventType wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK;
228 extern const wxEventType wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK;
229 extern const wxEventType wxEVT_COMMAND_LIST_ITEM_ACTIVATED;
230
231 /* Tab and notebook control event types */
232 extern const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGED;
233 extern const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGING;
234 extern const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED;
235 extern const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING;
236
237 /* Splitter events */
238 extern const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED;
239 extern const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING;
240 extern const wxEventType wxEVT_COMMAND_SPLITTER_DOUBLECLICKED;
241 extern const wxEventType wxEVT_COMMAND_SPLITTER_UNSPLIT;
242
243 /* Wizard events */
244 extern const wxEventType wxEVT_WIZARD_PAGE_CHANGED;
245 extern const wxEventType wxEVT_WIZARD_PAGE_CHANGING;
246 extern const wxEventType wxEVT_WIZARD_CANCEL;
247
248 /* Calendar events */
249 extern const wxEventType wxEVT_CALENDAR_SEL_CHANGED;
250 extern const wxEventType wxEVT_CALENDAR_DAY_CHANGED;
251 extern const wxEventType wxEVT_CALENDAR_MONTH_CHANGED;
252 extern const wxEventType wxEVT_CALENDAR_YEAR_CHANGED;
253 extern const wxEventType wxEVT_CALENDAR_DOUBLECLICKED;
254 extern const wxEventType wxEVT_CALENDAR_WEEKDAY_CLICKED;
255
256 /* Plot events */
257 extern const wxEventType wxEVT_PLOT_SEL_CHANGING;
258 extern const wxEventType wxEVT_PLOT_SEL_CHANGED;
259 extern const wxEventType wxEVT_PLOT_CLICKED;
260 extern const wxEventType wxEVT_PLOT_DOUBLECLICKED;
261 extern const wxEventType wxEVT_PLOT_ZOOM_IN;
262 extern const wxEventType wxEVT_PLOT_ZOOM_OUT;
263 extern const wxEventType wxEVT_PLOT_VALUE_SEL_CREATING;
264 extern const wxEventType wxEVT_PLOT_VALUE_SEL_CREATED;
265 extern const wxEventType wxEVT_PLOT_VALUE_SEL_CHANGING;
266 extern const wxEventType wxEVT_PLOT_VALUE_SEL_CHANGED;
267 extern const wxEventType wxEVT_PLOT_AREA_SEL_CREATING;
268 extern const wxEventType wxEVT_PLOT_AREA_SEL_CREATED;
269 extern const wxEventType wxEVT_PLOT_AREA_SEL_CHANGING;
270 extern const wxEventType wxEVT_PLOT_AREA_SEL_CHANGED;
271 extern const wxEventType wxEVT_PLOT_BEGIN_X_LABEL_EDIT;
272 extern const wxEventType wxEVT_PLOT_END_X_LABEL_EDIT;
273 extern const wxEventType wxEVT_PLOT_BEGIN_Y_LABEL_EDIT;
274 extern const wxEventType wxEVT_PLOT_END_Y_LABEL_EDIT;
275 extern const wxEventType wxEVT_PLOT_BEGIN_TITLE_EDIT;
276 extern const wxEventType wxEVT_PLOT_END_TITLE_EDIT;
277
278 extern const wxEventType wxEVT_USER_FIRST;
279
280 #else // everybody else
281
282 const wxEventType wxEVT_NULL = 0;
283 const wxEventType wxEVT_FIRST = 10000;
284
285 const wxEventType wxEVT_COMMAND_BUTTON_CLICKED = wxEVT_FIRST + 1;
286 const wxEventType wxEVT_COMMAND_CHECKBOX_CLICKED = wxEVT_FIRST + 2;
287 const wxEventType wxEVT_COMMAND_CHOICE_SELECTED = wxEVT_FIRST + 3;
288 const wxEventType wxEVT_COMMAND_LISTBOX_SELECTED = wxEVT_FIRST + 4;
289 const wxEventType wxEVT_COMMAND_LISTBOX_DOUBLECLICKED = wxEVT_FIRST + 5;
290 const wxEventType wxEVT_COMMAND_CHECKLISTBOX_TOGGLED = wxEVT_FIRST + 6;
291 const wxEventType wxEVT_COMMAND_TEXT_UPDATED = wxEVT_FIRST + 7;
292 const wxEventType wxEVT_COMMAND_TEXT_ENTER = wxEVT_FIRST + 8;
293 const wxEventType wxEVT_COMMAND_MENU_SELECTED = wxEVT_FIRST + 9;
294 const wxEventType wxEVT_COMMAND_TOOL_CLICKED = wxEVT_COMMAND_MENU_SELECTED;
295 const wxEventType wxEVT_COMMAND_SLIDER_UPDATED = wxEVT_FIRST + 10;
296 const wxEventType wxEVT_COMMAND_RADIOBOX_SELECTED = wxEVT_FIRST + 11;
297 const wxEventType wxEVT_COMMAND_RADIOBUTTON_SELECTED = wxEVT_FIRST + 12;
298 //const wxEventType wxEVT_COMMAND_SCROLLBAR_UPDATED is now obsolete since we use wxEVT_SCROLL... events
299 const wxEventType wxEVT_COMMAND_SCROLLBAR_UPDATED = wxEVT_FIRST + 13;
300 const wxEventType wxEVT_COMMAND_VLBOX_SELECTED = wxEVT_FIRST + 14;
301 const wxEventType wxEVT_COMMAND_COMBOBOX_SELECTED = wxEVT_FIRST + 15;
302 const wxEventType wxEVT_COMMAND_TOOL_RCLICKED = wxEVT_FIRST + 16;
303 const wxEventType wxEVT_COMMAND_TOOL_ENTER = wxEVT_FIRST + 17;
304 const wxEventType wxEVT_COMMAND_SPINCTRL_UPDATED = wxEVT_FIRST + 18;
305
306 /* Sockets send events, too */
307 const wxEventType wxEVT_SOCKET = wxEVT_FIRST + 50;
308
309 /* And timers do as well */
310 const wxEventType wxEVT_TIMER = wxEVT_FIRST + 80;
311
312 /* Mouse event types */
313 const wxEventType wxEVT_LEFT_DOWN = wxEVT_FIRST + 100;
314 const wxEventType wxEVT_LEFT_UP = wxEVT_FIRST + 101;
315 const wxEventType wxEVT_MIDDLE_DOWN = wxEVT_FIRST + 102;
316 const wxEventType wxEVT_MIDDLE_UP = wxEVT_FIRST + 103;
317 const wxEventType wxEVT_RIGHT_DOWN = wxEVT_FIRST + 104;
318 const wxEventType wxEVT_RIGHT_UP = wxEVT_FIRST + 105;
319 const wxEventType wxEVT_MOTION = wxEVT_FIRST + 106;
320 const wxEventType wxEVT_ENTER_WINDOW = wxEVT_FIRST + 107;
321 const wxEventType wxEVT_LEAVE_WINDOW = wxEVT_FIRST + 108;
322 const wxEventType wxEVT_LEFT_DCLICK = wxEVT_FIRST + 109;
323 const wxEventType wxEVT_MIDDLE_DCLICK = wxEVT_FIRST + 110;
324 const wxEventType wxEVT_RIGHT_DCLICK = wxEVT_FIRST + 111;
325 const wxEventType wxEVT_SET_FOCUS = wxEVT_FIRST + 112;
326 const wxEventType wxEVT_KILL_FOCUS = wxEVT_FIRST + 113;
327
328 /* Non-client mouse events */
329 const wxEventType wxEVT_NC_LEFT_DOWN = wxEVT_FIRST + 200;
330 const wxEventType wxEVT_NC_LEFT_UP = wxEVT_FIRST + 201;
331 const wxEventType wxEVT_NC_MIDDLE_DOWN = wxEVT_FIRST + 202;
332 const wxEventType wxEVT_NC_MIDDLE_UP = wxEVT_FIRST + 203;
333 const wxEventType wxEVT_NC_RIGHT_DOWN = wxEVT_FIRST + 204;
334 const wxEventType wxEVT_NC_RIGHT_UP = wxEVT_FIRST + 205;
335 const wxEventType wxEVT_NC_MOTION = wxEVT_FIRST + 206;
336 const wxEventType wxEVT_NC_ENTER_WINDOW = wxEVT_FIRST + 207;
337 const wxEventType wxEVT_NC_LEAVE_WINDOW = wxEVT_FIRST + 208;
338 const wxEventType wxEVT_NC_LEFT_DCLICK = wxEVT_FIRST + 209;
339 const wxEventType wxEVT_NC_MIDDLE_DCLICK = wxEVT_FIRST + 210;
340 const wxEventType wxEVT_NC_RIGHT_DCLICK = wxEVT_FIRST + 211;
341
342 /* Character input event type */
343 const wxEventType wxEVT_CHAR = wxEVT_FIRST + 212;
344 const wxEventType wxEVT_CHAR_HOOK = wxEVT_FIRST + 213;
345 const wxEventType wxEVT_NAVIGATION_KEY = wxEVT_FIRST + 214;
346 const wxEventType wxEVT_KEY_DOWN = wxEVT_FIRST + 215;
347 const wxEventType wxEVT_KEY_UP = wxEVT_FIRST + 216;
348
349 /*
350 * wxScrollbar and wxSlider event identifiers
351 */
352 const wxEventType wxEVT_SCROLL_TOP = wxEVT_FIRST + 300;
353 const wxEventType wxEVT_SCROLL_BOTTOM = wxEVT_FIRST + 301;
354 const wxEventType wxEVT_SCROLL_LINEUP = wxEVT_FIRST + 302;
355 const wxEventType wxEVT_SCROLL_LINEDOWN = wxEVT_FIRST + 303;
356 const wxEventType wxEVT_SCROLL_PAGEUP = wxEVT_FIRST + 304;
357 const wxEventType wxEVT_SCROLL_PAGEDOWN = wxEVT_FIRST + 305;
358 const wxEventType wxEVT_SCROLL_THUMBTRACK = wxEVT_FIRST + 306;
359
360 /*
361 * Scroll events from wxWindow
362 */
363 const wxEventType wxEVT_SCROLLWIN_TOP = wxEVT_FIRST + 320;
364 const wxEventType wxEVT_SCROLLWIN_BOTTOM = wxEVT_FIRST + 321;
365 const wxEventType wxEVT_SCROLLWIN_LINEUP = wxEVT_FIRST + 322;
366 const wxEventType wxEVT_SCROLLWIN_LINEDOWN = wxEVT_FIRST + 323;
367 const wxEventType wxEVT_SCROLLWIN_PAGEUP = wxEVT_FIRST + 324;
368 const wxEventType wxEVT_SCROLLWIN_PAGEDOWN = wxEVT_FIRST + 325;
369 const wxEventType wxEVT_SCROLLWIN_THUMBTRACK = wxEVT_FIRST + 326;
370
371 /*
372 * System events
373 */
374 const wxEventType wxEVT_SIZE = wxEVT_FIRST + 400;
375 const wxEventType wxEVT_MOVE = wxEVT_FIRST + 401;
376 const wxEventType wxEVT_CLOSE_WINDOW = wxEVT_FIRST + 402;
377 const wxEventType wxEVT_END_SESSION = wxEVT_FIRST + 403;
378 const wxEventType wxEVT_QUERY_END_SESSION = wxEVT_FIRST + 404;
379 const wxEventType wxEVT_ACTIVATE_APP = wxEVT_FIRST + 405;
380 const wxEventType wxEVT_POWER = wxEVT_FIRST + 406;
381 const wxEventType wxEVT_ACTIVATE = wxEVT_FIRST + 409;
382 const wxEventType wxEVT_CREATE = wxEVT_FIRST + 410;
383 const wxEventType wxEVT_DESTROY = wxEVT_FIRST + 411;
384 const wxEventType wxEVT_SHOW = wxEVT_FIRST + 412;
385 const wxEventType wxEVT_ICONIZE = wxEVT_FIRST + 413;
386 const wxEventType wxEVT_MAXIMIZE = wxEVT_FIRST + 414;
387 const wxEventType wxEVT_MOUSE_CAPTURE_CHANGED = wxEVT_FIRST + 415;
388 const wxEventType wxEVT_PAINT = wxEVT_FIRST + 416;
389 const wxEventType wxEVT_ERASE_BACKGROUND = wxEVT_FIRST + 417;
390 const wxEventType wxEVT_NC_PAINT = wxEVT_FIRST + 418;
391 const wxEventType wxEVT_PAINT_ICON = wxEVT_FIRST + 419;
392 const wxEventType wxEVT_MENU_CHAR = wxEVT_FIRST + 420;
393 const wxEventType wxEVT_MENU_INIT = wxEVT_FIRST + 421;
394 const wxEventType wxEVT_MENU_HIGHLIGHT = wxEVT_FIRST + 422;
395 const wxEventType wxEVT_POPUP_MENU_INIT = wxEVT_FIRST + 423;
396 const wxEventType wxEVT_CONTEXT_MENU = wxEVT_FIRST + 424;
397 const wxEventType wxEVT_SYS_COLOUR_CHANGED = wxEVT_FIRST + 425;
398 const wxEventType wxEVT_SETTING_CHANGED = wxEVT_FIRST + 426;
399 const wxEventType wxEVT_QUERY_NEW_PALETTE = wxEVT_FIRST + 427;
400 const wxEventType wxEVT_PALETTE_CHANGED = wxEVT_FIRST + 428;
401 const wxEventType wxEVT_JOY_BUTTON_DOWN = wxEVT_FIRST + 429;
402 const wxEventType wxEVT_JOY_BUTTON_UP = wxEVT_FIRST + 430;
403 const wxEventType wxEVT_JOY_MOVE = wxEVT_FIRST + 431;
404 const wxEventType wxEVT_JOY_ZMOVE = wxEVT_FIRST + 432;
405 const wxEventType wxEVT_DROP_FILES = wxEVT_FIRST + 433;
406 const wxEventType wxEVT_DRAW_ITEM = wxEVT_FIRST + 434;
407 const wxEventType wxEVT_MEASURE_ITEM = wxEVT_FIRST + 435;
408 const wxEventType wxEVT_COMPARE_ITEM = wxEVT_FIRST + 436;
409 const wxEventType wxEVT_INIT_DIALOG = wxEVT_FIRST + 437;
410 const wxEventType wxEVT_IDLE = wxEVT_FIRST + 438;
411 const wxEventType wxEVT_UPDATE_UI = wxEVT_FIRST + 439;
412
413 /* System misc. */
414 const wxEventType wxEVT_END_PROCESS = wxEVT_FIRST + 440;
415
416 /* Dial up events */
417 const wxEventType wxEVT_DIALUP_CONNECTED = wxEVT_FIRST + 450;
418 const wxEventType wxEVT_DIALUP_DISCONNECTED = wxEVT_FIRST + 451;
419
420 /* Generic command events */
421 /* Note: a click is a higher-level event than button down/up */
422 const wxEventType wxEVT_COMMAND_LEFT_CLICK = wxEVT_FIRST + 500;
423 const wxEventType wxEVT_COMMAND_LEFT_DCLICK = wxEVT_FIRST + 501;
424 const wxEventType wxEVT_COMMAND_RIGHT_CLICK = wxEVT_FIRST + 502;
425 const wxEventType wxEVT_COMMAND_RIGHT_DCLICK = wxEVT_FIRST + 503;
426 const wxEventType wxEVT_COMMAND_SET_FOCUS = wxEVT_FIRST + 504;
427 const wxEventType wxEVT_COMMAND_KILL_FOCUS = wxEVT_FIRST + 505;
428 const wxEventType wxEVT_COMMAND_ENTER = wxEVT_FIRST + 506;
429
430 /* Tree control event types */
431 const wxEventType wxEVT_COMMAND_TREE_BEGIN_DRAG = wxEVT_FIRST + 600;
432 const wxEventType wxEVT_COMMAND_TREE_BEGIN_RDRAG = wxEVT_FIRST + 601;
433 const wxEventType wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT = wxEVT_FIRST + 602;
434 const wxEventType wxEVT_COMMAND_TREE_END_LABEL_EDIT = wxEVT_FIRST + 603;
435 const wxEventType wxEVT_COMMAND_TREE_DELETE_ITEM = wxEVT_FIRST + 604;
436 const wxEventType wxEVT_COMMAND_TREE_GET_INFO = wxEVT_FIRST + 605;
437 const wxEventType wxEVT_COMMAND_TREE_SET_INFO = wxEVT_FIRST + 606;
438 const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDED = wxEVT_FIRST + 607;
439 const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDING = wxEVT_FIRST + 608;
440 const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSED = wxEVT_FIRST + 609;
441 const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSING = wxEVT_FIRST + 610;
442 const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGED = wxEVT_FIRST + 611;
443 const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGING = wxEVT_FIRST + 612;
444 const wxEventType wxEVT_COMMAND_TREE_KEY_DOWN = wxEVT_FIRST + 613;
445 const wxEventType wxEVT_COMMAND_TREE_ITEM_ACTIVATED = wxEVT_FIRST + 614;
446 const wxEventType wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK = wxEVT_FIRST + 615;
447 const wxEventType wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK = wxEVT_FIRST + 616;
448
449 /* List control event types */
450 const wxEventType wxEVT_COMMAND_LIST_BEGIN_DRAG = wxEVT_FIRST + 700;
451 const wxEventType wxEVT_COMMAND_LIST_BEGIN_RDRAG = wxEVT_FIRST + 701;
452 const wxEventType wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT = wxEVT_FIRST + 702;
453 const wxEventType wxEVT_COMMAND_LIST_END_LABEL_EDIT = wxEVT_FIRST + 703;
454 const wxEventType wxEVT_COMMAND_LIST_DELETE_ITEM = wxEVT_FIRST + 704;
455 const wxEventType wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS = wxEVT_FIRST + 705;
456 const wxEventType wxEVT_COMMAND_LIST_GET_INFO = wxEVT_FIRST + 706;
457 const wxEventType wxEVT_COMMAND_LIST_SET_INFO = wxEVT_FIRST + 707;
458 const wxEventType wxEVT_COMMAND_LIST_ITEM_SELECTED = wxEVT_FIRST + 708;
459 const wxEventType wxEVT_COMMAND_LIST_ITEM_DESELECTED = wxEVT_FIRST + 709;
460 const wxEventType wxEVT_COMMAND_LIST_KEY_DOWN = wxEVT_FIRST + 710;
461 const wxEventType wxEVT_COMMAND_LIST_INSERT_ITEM = wxEVT_FIRST + 711;
462 const wxEventType wxEVT_COMMAND_LIST_COL_CLICK = wxEVT_FIRST + 712;
463 const wxEventType wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK = wxEVT_FIRST + 713;
464 const wxEventType wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK = wxEVT_FIRST + 714;
465 const wxEventType wxEVT_COMMAND_LIST_ITEM_ACTIVATED = wxEVT_FIRST + 715;
466
467 /* Tab and notebook control event types */
468 const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGED = wxEVT_FIRST + 800;
469 const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGING = wxEVT_FIRST + 801;
470
471 #if defined(__BORLANDC__) && defined(__WIN16__)
472 /* For 16-bit BC++, these 2 are identical (truncated) */
473 const wxEventType wxEVT_COMMAND_NB_PAGE_CHANGED = wxEVT_FIRST + 802;
474 const wxEventType wxEVT_COMMAND_NB_PAGE_CHANGING = wxEVT_FIRST + 803;
475 #else
476 const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED = wxEVT_FIRST + 802;
477 const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING = wxEVT_FIRST + 803;
478 #endif
479
480 /* Splitter events */
481 const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED = wxEVT_FIRST + 850;
482 const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING = wxEVT_FIRST + 851;
483 const wxEventType wxEVT_COMMAND_SPLITTER_DOUBLECLICKED = wxEVT_FIRST + 852;
484 const wxEventType wxEVT_COMMAND_SPLITTER_UNSPLIT = wxEVT_FIRST + 853;
485
486 /* Wizard events */
487 const wxEventType wxEVT_WIZARD_PAGE_CHANGED = wxEVT_FIRST + 900;
488 const wxEventType wxEVT_WIZARD_PAGE_CHANGING = wxEVT_FIRST + 901;
489 const wxEventType wxEVT_WIZARD_CANCEL = wxEVT_FIRST + 902;
490
491 /* Calendar events */
492 const wxEventType wxEVT_CALENDAR_SEL_CHANGED = wxEVT_FIRST + 950;
493 const wxEventType wxEVT_CALENDAR_DAY_CHANGED = wxEVT_FIRST + 951;
494 const wxEventType wxEVT_CALENDAR_MONTH_CHANGED = wxEVT_FIRST + 952;
495 const wxEventType wxEVT_CALENDAR_YEAR_CHANGED = wxEVT_FIRST + 953;
496 const wxEventType wxEVT_CALENDAR_DOUBLECLICKED = wxEVT_FIRST + 954;
497 const wxEventType wxEVT_CALENDAR_WEEKDAY_CLICKED = wxEVT_FIRST + 955;
498
499 /* Plot events */
500 const wxEventType wxEVT_PLOT_SEL_CHANGING = wxEVT_FIRST + 1000;
501 const wxEventType wxEVT_PLOT_SEL_CHANGED = wxEVT_FIRST + 1001;
502 const wxEventType wxEVT_PLOT_CLICKED = wxEVT_FIRST + 1002;
503 const wxEventType wxEVT_PLOT_DOUBLECLICKED = wxEVT_FIRST + 1003;
504 const wxEventType wxEVT_PLOT_ZOOM_IN = wxEVT_FIRST + 1004;
505 const wxEventType wxEVT_PLOT_ZOOM_OUT = wxEVT_FIRST + 1005;
506 const wxEventType wxEVT_PLOT_VALUE_SEL_CREATING = wxEVT_FIRST + 1010;
507 const wxEventType wxEVT_PLOT_VALUE_SEL_CREATED = wxEVT_FIRST + 1011;
508 const wxEventType wxEVT_PLOT_VALUE_SEL_CHANGING = wxEVT_FIRST + 1012;
509 const wxEventType wxEVT_PLOT_VALUE_SEL_CHANGED = wxEVT_FIRST + 1013;
510 const wxEventType wxEVT_PLOT_AREA_SEL_CREATING = wxEVT_FIRST + 1014;
511 const wxEventType wxEVT_PLOT_AREA_SEL_CREATED = wxEVT_FIRST + 1015;
512 const wxEventType wxEVT_PLOT_AREA_SEL_CHANGING = wxEVT_FIRST + 1016;
513 const wxEventType wxEVT_PLOT_AREA_SEL_CHANGED = wxEVT_FIRST + 1017;
514 const wxEventType wxEVT_PLOT_BEGIN_X_LABEL_EDIT = wxEVT_FIRST + 1020;
515 const wxEventType wxEVT_PLOT_END_X_LABEL_EDIT = wxEVT_FIRST + 1021;
516 const wxEventType wxEVT_PLOT_BEGIN_Y_LABEL_EDIT = wxEVT_FIRST + 1022;
517 const wxEventType wxEVT_PLOT_END_Y_LABEL_EDIT = wxEVT_FIRST + 1023;
518 const wxEventType wxEVT_PLOT_BEGIN_TITLE_EDIT = wxEVT_FIRST + 1024;
519 const wxEventType wxEVT_PLOT_END_TITLE_EDIT = wxEVT_FIRST + 1025;
520
521 const wxEventType wxEVT_USER_FIRST = wxEVT_FIRST + 2000;
522
523 #endif // for VisualAge C++ V4.0
524
525 /* Compatibility */
526
527 #if WXWIN_COMPATIBILITY
528
529 #define wxEVENT_TYPE_BUTTON_COMMAND wxEVT_COMMAND_BUTTON_CLICKED
530 #define wxEVENT_TYPE_CHECKBOX_COMMAND wxEVT_COMMAND_CHECKBOX_CLICKED
531 #define wxEVENT_TYPE_CHOICE_COMMAND wxEVT_COMMAND_CHOICE_SELECTED
532 #define wxEVENT_TYPE_LISTBOX_COMMAND wxEVT_COMMAND_LISTBOX_SELECTED
533 #define wxEVENT_TYPE_LISTBOX_DCLICK_COMMAND wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
534 #define wxEVENT_TYPE_TEXT_COMMAND wxEVT_COMMAND_TEXT_UPDATED
535 #define wxEVENT_TYPE_MULTITEXT_COMMAND wxEVT_COMMAND_TEXT_UPDATED
536 #define wxEVENT_TYPE_MENU_COMMAND wxEVT_COMMAND_MENU_SELECTED
537 #define wxEVENT_TYPE_SLIDER_COMMAND wxEVT_COMMAND_SLIDER_UPDATED
538 #define wxEVENT_TYPE_RADIOBOX_COMMAND wxEVT_COMMAND_RADIOBOX_SELECTED
539 #define wxEVENT_TYPE_RADIOBUTTON_COMMAND wxEVT_COMMAND_RADIOBUTTON_SELECTED
540 #define wxEVENT_TYPE_TEXT_ENTER_COMMAND wxEVT_COMMAND_TEXT_ENTER
541 #define wxEVENT_TYPE_SET_FOCUS wxEVT_SET_FOCUS
542 #define wxEVENT_TYPE_KILL_FOCUS wxEVT_KILL_FOCUS
543 #define wxEVENT_TYPE_SCROLLBAR_COMMAND wxEVT_COMMAND_SCROLLBAR_UPDATED
544 #define wxEVENT_TYPE_VIRT_LISTBOX_COMMAND wxEVT_COMMAND_VLBOX_SELECTED
545 #define wxEVENT_TYPE_COMBOBOX_COMMAND wxEVT_COMMAND_COMBOBOX_SELECTED
546
547 #define wxEVENT_TYPE_LEFT_DOWN wxEVT_LEFT_DOWN
548 #define wxEVENT_TYPE_LEFT_UP wxEVT_LEFT_UP
549 #define wxEVENT_TYPE_MIDDLE_DOWN wxEVT_MIDDLE_DOWN
550 #define wxEVENT_TYPE_MIDDLE_UP wxEVT_MIDDLE_UP
551 #define wxEVENT_TYPE_RIGHT_DOWN wxEVT_RIGHT_DOWN
552 #define wxEVENT_TYPE_RIGHT_UP wxEVT_RIGHT_UP
553 #define wxEVENT_TYPE_MOTION wxEVT_MOTION
554 #define wxEVENT_TYPE_ENTER_WINDOW wxEVT_ENTER_WINDOW
555 #define wxEVENT_TYPE_LEAVE_WINDOW wxEVT_LEAVE_WINDOW
556 #define wxEVENT_TYPE_LEFT_DCLICK wxEVT_LEFT_DCLICK
557 #define wxEVENT_TYPE_MIDDLE_DCLICK wxEVT_MIDDLE_DCLICK
558 #define wxEVENT_TYPE_RIGHT_DCLICK wxEVT_RIGHT_DCLICK
559 #define wxEVENT_TYPE_CHAR wxEVT_CHAR
560 #define wxEVENT_TYPE_SCROLL_TOP wxEVT_SCROLL_TOP
561 #define wxEVENT_TYPE_SCROLL_BOTTOM wxEVT_SCROLL_BOTTOM
562 #define wxEVENT_TYPE_SCROLL_LINEUP wxEVT_SCROLL_LINEUP
563 #define wxEVENT_TYPE_SCROLL_LINEDOWN wxEVT_SCROLL_LINEDOWN
564 #define wxEVENT_TYPE_SCROLL_PAGEUP wxEVT_SCROLL_PAGEUP
565 #define wxEVENT_TYPE_SCROLL_PAGEDOWN wxEVT_SCROLL_PAGEDOWN
566 #define wxEVENT_TYPE_SCROLL_THUMBTRACK wxEVT_SCROLL_THUMBTRACK
567
568 #endif // WXWIN_COMPATIBILITY
569
570 /*
571 * wxWindows events, covering all interesting things that might happen
572 * (button clicking, resizing, setting text in widgets, etc.).
573 *
574 * For each completely new event type, derive a new event class.
575 * An event CLASS represents a C++ class defining a range of similar event TYPES;
576 * examples are canvas events, panel item command events.
577 * An event TYPE is a unique identifier for a particular system event,
578 * such as a button press or a listbox deselection.
579 *
580 */
581
582 class WXDLLEXPORT wxEvent : public wxObject
583 {
584 DECLARE_ABSTRACT_CLASS(wxEvent)
585
586 public:
587 wxEvent(int id = 0);
588 ~wxEvent() {}
589
590 void SetEventType(wxEventType typ) { m_eventType = typ; }
591 wxEventType GetEventType() const { return m_eventType; }
592 wxObject *GetEventObject() const { return m_eventObject; }
593 void SetEventObject(wxObject *obj) { m_eventObject = obj; }
594 long GetTimestamp() const { return m_timeStamp; }
595 void SetTimestamp(long ts = 0) { m_timeStamp = ts; }
596 int GetId() const { return m_id; }
597 void SetId(int Id) { m_id = Id; }
598
599 // Can instruct event processor that we wish to ignore this event
600 // (treat as if the event table entry had not been found): this must be done
601 // to allow the event processing by the base classes (calling event.Skip()
602 // is the analog of calling the base class verstion of a virtual function)
603 void Skip(bool skip = TRUE) { m_skipped = skip; }
604 bool GetSkipped() const { return m_skipped; };
605
606 // implementation only: this test is explicitlty anti OO and this functions
607 // exists only for optimization purposes
608 bool IsCommandEvent() const { return m_isCommandEvent; }
609
610 void CopyObject(wxObject& object_dest) const;
611
612 public:
613 wxObject* m_eventObject;
614 wxEventType m_eventType;
615 long m_timeStamp;
616 int m_id;
617 wxObject* m_callbackUserData;
618 bool m_skipped;
619
620 // optimization: instead of using costly IsKindOf() we keep a flag telling
621 // whether we're a command event (by far the most common case)
622 bool m_isCommandEvent;
623 };
624
625 #if wxUSE_GUI
626
627 // Item or menu event class
628 /*
629 wxEVT_COMMAND_BUTTON_CLICKED
630 wxEVT_COMMAND_CHECKBOX_CLICKED
631 wxEVT_COMMAND_CHOICE_SELECTED
632 wxEVT_COMMAND_LISTBOX_SELECTED
633 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
634 wxEVT_COMMAND_TEXT_UPDATED
635 wxEVT_COMMAND_TEXT_ENTER
636 wxEVT_COMMAND_MENU_SELECTED
637 wxEVT_COMMAND_SLIDER_UPDATED
638 wxEVT_COMMAND_RADIOBOX_SELECTED
639 wxEVT_COMMAND_RADIOBUTTON_SELECTED
640 wxEVT_COMMAND_SCROLLBAR_UPDATED
641 wxEVT_COMMAND_VLBOX_SELECTED
642 wxEVT_COMMAND_COMBOBOX_SELECTED
643 */
644
645 class WXDLLEXPORT wxCommandEvent : public wxEvent
646 {
647 DECLARE_DYNAMIC_CLASS(wxCommandEvent)
648
649 public:
650 wxCommandEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
651 ~wxCommandEvent() {}
652
653 /*
654 * Accessors dependent on context
655 *
656 */
657
658 // Set/Get client data from controls
659 void SetClientData(void* clientData) { m_clientData = clientData; }
660 void *GetClientData() const { return m_clientData; }
661
662 // Set/Get client object from controls
663 void SetClientObject(wxClientData* clientObject) { m_clientObject = clientObject; }
664 void *GetClientObject() const { return m_clientObject; }
665
666 // Get listbox selection if single-choice
667 int GetSelection() const { return m_commandInt; }
668
669 // Set/Get listbox/choice selection string
670 void SetString(const wxString& s) { m_commandString = s; }
671 wxString GetString() const { return m_commandString; }
672
673 // Get checkbox value
674 bool Checked() const { return (m_commandInt != 0); }
675
676 // TRUE if the listbox event was a selection.
677 bool IsSelection() const { return (m_extraLong != 0); }
678
679 void SetExtraLong(long extraLong) { m_extraLong = extraLong; }
680 long GetExtraLong() const { return m_extraLong ; }
681
682 void SetInt(int i) { m_commandInt = i; }
683 long GetInt() const { return m_commandInt ; }
684
685 void CopyObject(wxObject& obj) const;
686
687 public:
688 wxString m_commandString; // String event argument
689 int m_commandInt;
690 long m_extraLong; // Additional information (e.g. select/deselect)
691 void* m_clientData; // Arbitrary client data
692 wxClientData* m_clientObject; // Arbitrary client object
693 };
694
695 // this class adds a possibility to react (from the user) code to a control
696 // notification: allow or veto the operation being reported.
697 class WXDLLEXPORT wxNotifyEvent : public wxCommandEvent
698 {
699 public:
700 wxNotifyEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
701 : wxCommandEvent(commandType, id) { m_bAllow = TRUE; }
702
703 // veto the operation (by default it's allowed)
704 void Veto() { m_bAllow = FALSE; }
705
706 // for implementation code only: is the operation allowed?
707 bool IsAllowed() const { return m_bAllow; }
708
709 // probably useless: CopyObject() is used for deferred event
710 // handling but wxNotifyEvent must be processed immediately
711 void CopyObject(wxObject& obj) const;
712
713 private:
714 bool m_bAllow;
715
716 DECLARE_DYNAMIC_CLASS(wxNotifyEvent)
717 };
718
719 // Scroll event class, derived form wxCommandEvent. wxScrollEvents are
720 // sent by wxSlider and wxScrollbar.
721 /*
722 wxEVT_SCROLL_TOP
723 wxEVT_SCROLL_BOTTOM
724 wxEVT_SCROLL_LINEUP
725 wxEVT_SCROLL_LINEDOWN
726 wxEVT_SCROLL_PAGEUP
727 wxEVT_SCROLL_PAGEDOWN
728 wxEVT_SCROLL_THUMBTRACK
729 */
730
731 class WXDLLEXPORT wxScrollEvent : public wxCommandEvent
732 {
733 DECLARE_DYNAMIC_CLASS(wxScrollEvent)
734
735 public:
736 wxScrollEvent(wxEventType commandType = wxEVT_NULL,
737 int id = 0, int pos = 0, int orient = 0);
738 ~wxScrollEvent() {}
739
740 /*
741 * Accessors
742 *
743 */
744
745 int GetOrientation() const { return (int) m_extraLong ; }
746 int GetPosition() const { return m_commandInt ; }
747 bool IsScrolling() const { return m_isScrolling; }
748 void SetOrientation(int orient) { m_extraLong = (long) orient; }
749 void SetPosition(int pos) { m_commandInt = pos; }
750 void SetScrolling(bool isScrolling) { m_isScrolling = isScrolling; }
751
752 void CopyObject(wxObject& obj) const;
753 public:
754 bool m_isScrolling;
755 };
756
757 // ScrollWin event class, derived fom wxEvent. wxScrollWinEvents
758 // are sent by wxWindow.
759 /*
760 wxEVT_SCROLLWIN_TOP
761 wxEVT_SCROLLWIN_BOTTOM
762 wxEVT_SCROLLWIN_LINEUP
763 wxEVT_SCROLLWIN_LINEDOWN
764 wxEVT_SCROLLWIN_PAGEUP
765 wxEVT_SCROLLWIN_PAGEDOWN
766 wxEVT_SCROLLWIN_THUMBTRACK
767 */
768
769 class WXDLLEXPORT wxScrollWinEvent : public wxEvent
770 {
771 DECLARE_DYNAMIC_CLASS(wxScrollWinEvent)
772
773 public:
774 wxScrollWinEvent(wxEventType commandType = wxEVT_NULL,
775 int pos = 0, int orient = 0);
776 ~wxScrollWinEvent() {}
777
778 /*
779 * Accessors
780 */
781
782 int GetOrientation() const { return (int) m_extraLong ; }
783 int GetPosition() const { return m_commandInt ; }
784 bool IsScrolling() const { return m_isScrolling; }
785 void SetOrientation(int orient) { m_extraLong = (long) orient; }
786 void SetPosition(int pos) { m_commandInt = pos; }
787 void SetScrolling(bool isScrolling) { m_isScrolling = isScrolling; }
788
789 void CopyObject(wxObject& object_dest) const;
790 public:
791 int m_commandInt; // Additional information
792 long m_extraLong;
793 bool m_isScrolling;
794 };
795
796 // Mouse event class
797
798 /*
799 wxEVT_LEFT_DOWN
800 wxEVT_LEFT_UP
801 wxEVT_MIDDLE_DOWN
802 wxEVT_MIDDLE_UP
803 wxEVT_RIGHT_DOWN
804 wxEVT_RIGHT_UP
805 wxEVT_MOTION
806 wxEVT_ENTER_WINDOW
807 wxEVT_LEAVE_WINDOW
808 wxEVT_LEFT_DCLICK
809 wxEVT_MIDDLE_DCLICK
810 wxEVT_RIGHT_DCLICK
811 wxEVT_NC_LEFT_DOWN
812 wxEVT_NC_LEFT_UP,
813 wxEVT_NC_MIDDLE_DOWN,
814 wxEVT_NC_MIDDLE_UP,
815 wxEVT_NC_RIGHT_DOWN,
816 wxEVT_NC_RIGHT_UP,
817 wxEVT_NC_MOTION,
818 wxEVT_NC_ENTER_WINDOW,
819 wxEVT_NC_LEAVE_WINDOW,
820 wxEVT_NC_LEFT_DCLICK,
821 wxEVT_NC_MIDDLE_DCLICK,
822 wxEVT_NC_RIGHT_DCLICK,
823 */
824
825 class WXDLLEXPORT wxMouseEvent : public wxEvent
826 {
827 DECLARE_DYNAMIC_CLASS(wxMouseEvent)
828
829 public:
830 wxMouseEvent(wxEventType mouseType = wxEVT_NULL);
831
832 // Was it a button event? (*doesn't* mean: is any button *down*?)
833 bool IsButton() const { return Button(-1); }
834
835 // Was it a down event from button 1, 2 or 3 or any?
836 bool ButtonDown(int but = -1) const;
837
838 // Was it a dclick event from button 1, 2 or 3 or any?
839 bool ButtonDClick(int but = -1) const;
840
841 // Was it a up event from button 1, 2 or 3 or any?
842 bool ButtonUp(int but = -1) const;
843
844 // Was the given button 1,2,3 or any changing state?
845 bool Button(int but) const;
846
847 // Was the given button 1,2,3 or any in Down state?
848 bool ButtonIsDown(int but) const;
849
850 // Find state of shift/control keys
851 bool ControlDown() const { return m_controlDown; }
852 bool MetaDown() const { return m_metaDown; }
853 bool AltDown() const { return m_altDown; }
854 bool ShiftDown() const { return m_shiftDown; }
855
856 // Find which event was just generated
857 bool LeftDown() const { return (m_eventType == wxEVT_LEFT_DOWN); }
858 bool MiddleDown() const { return (m_eventType == wxEVT_MIDDLE_DOWN); }
859 bool RightDown() const { return (m_eventType == wxEVT_RIGHT_DOWN); }
860
861 bool LeftUp() const { return (m_eventType == wxEVT_LEFT_UP); }
862 bool MiddleUp() const { return (m_eventType == wxEVT_MIDDLE_UP); }
863 bool RightUp() const { return (m_eventType == wxEVT_RIGHT_UP); }
864
865 bool LeftDClick() const { return (m_eventType == wxEVT_LEFT_DCLICK); }
866 bool MiddleDClick() const { return (m_eventType == wxEVT_MIDDLE_DCLICK); }
867 bool RightDClick() const { return (m_eventType == wxEVT_RIGHT_DCLICK); }
868
869 // Find the current state of the mouse buttons (regardless
870 // of current event type)
871 bool LeftIsDown() const { return m_leftDown; }
872 bool MiddleIsDown() const { return m_middleDown; }
873 bool RightIsDown() const { return m_rightDown; }
874
875 // True if a button is down and the mouse is moving
876 bool Dragging() const
877 {
878 return ((m_eventType == wxEVT_MOTION) &&
879 (LeftIsDown() || MiddleIsDown() || RightIsDown()));
880 }
881
882 // True if the mouse is moving, and no button is down
883 bool Moving() const { return (m_eventType == wxEVT_MOTION); }
884
885 // True if the mouse is just entering the window
886 bool Entering() const { return (m_eventType == wxEVT_ENTER_WINDOW); }
887
888 // True if the mouse is just leaving the window
889 bool Leaving() const { return (m_eventType == wxEVT_LEAVE_WINDOW); }
890
891 // Find the position of the event
892 void GetPosition(wxCoord *xpos, wxCoord *ypos) const
893 {
894 if (xpos)
895 *xpos = m_x;
896 if (ypos)
897 *ypos = m_y;
898 }
899
900 #ifndef __WIN16__
901 void GetPosition(long *xpos, long *ypos) const
902 {
903 if (xpos)
904 *xpos = (long)m_x;
905 if (ypos)
906 *ypos = (long)m_y;
907 }
908 #endif
909
910 // Find the position of the event
911 wxPoint GetPosition() const { return wxPoint(m_x, m_y); }
912
913 // Find the logical position of the event given the DC
914 wxPoint GetLogicalPosition(const wxDC& dc) const ;
915
916 // Compatibility
917 #if WXWIN_COMPATIBILITY
918 void Position(long *xpos, long *ypos) const
919 {
920 if (xpos)
921 *xpos = (long)m_x;
922 if (ypos)
923 *ypos = (long)m_y;
924 }
925
926 void Position(float *xpos, float *ypos) const
927 {
928 *xpos = (float) m_x; *ypos = (float) m_y;
929 }
930 #endif // WXWIN_COMPATIBILITY
931
932 // Get X position
933 long GetX() const { return m_x; }
934
935 // Get Y position
936 long GetY() const { return m_y; }
937
938 void CopyObject(wxObject& obj) const;
939
940 public:
941 wxCoord m_x, m_y;
942
943 bool m_leftDown;
944 bool m_middleDown;
945 bool m_rightDown;
946
947 bool m_controlDown;
948 bool m_shiftDown;
949 bool m_altDown;
950 bool m_metaDown;
951 };
952
953 // Keyboard input event class
954
955 /*
956 wxEVT_CHAR
957 wxEVT_CHAR_HOOK
958 wxEVT_KEY_DOWN
959 wxEVT_KEY_UP
960 */
961
962 class WXDLLEXPORT wxKeyEvent : public wxEvent
963 {
964 DECLARE_DYNAMIC_CLASS(wxKeyEvent)
965
966 public:
967 wxKeyEvent(wxEventType keyType = wxEVT_NULL);
968
969 // Find state of shift/control keys
970 bool ControlDown() const { return m_controlDown; }
971 bool MetaDown() const { return m_metaDown; }
972 bool AltDown() const { return m_altDown; }
973 bool ShiftDown() const { return m_shiftDown; }
974 long KeyCode() const { return m_keyCode; }
975
976 // Find the position of the event
977 void GetPosition(wxCoord *xpos, wxCoord *ypos) const
978 {
979 if (xpos) *xpos = m_x;
980 if (ypos) *ypos = m_y;
981 }
982
983 #ifndef __WIN16__
984 void GetPosition(long *xpos, long *ypos) const
985 {
986 if (xpos) *xpos = (long)m_x;
987 if (ypos) *ypos = (long)m_y;
988 }
989 #endif
990
991 wxPoint GetPosition() const
992 { return wxPoint(m_x, m_y); }
993
994 // Get X position
995 wxCoord GetX() const { return m_x; }
996
997 // Get Y position
998 wxCoord GetY() const { return m_y; }
999
1000 void CopyObject(wxObject& obj) const;
1001
1002 public:
1003 wxCoord m_x, m_y;
1004
1005 long m_keyCode;
1006
1007 bool m_controlDown;
1008 bool m_shiftDown;
1009 bool m_altDown;
1010 bool m_metaDown;
1011 bool m_scanCode;
1012 };
1013
1014 // Size event class
1015 /*
1016 wxEVT_SIZE
1017 */
1018
1019 class WXDLLEXPORT wxSizeEvent : public wxEvent
1020 {
1021 DECLARE_DYNAMIC_CLASS(wxSizeEvent)
1022
1023 public:
1024 wxSize m_size;
1025
1026 wxSizeEvent() { m_eventType = wxEVT_SIZE; }
1027 wxSizeEvent(const wxSize& sz, int id = 0)
1028 : m_size(sz)
1029 { m_eventType = wxEVT_SIZE; m_id = id; }
1030
1031 wxSize GetSize() const { return m_size; }
1032
1033 void CopyObject(wxObject& obj) const;
1034 };
1035
1036 // Move event class
1037
1038 /*
1039 wxEVT_MOVE
1040 */
1041
1042 class WXDLLEXPORT wxMoveEvent : public wxEvent
1043 {
1044 DECLARE_DYNAMIC_CLASS(wxMoveEvent)
1045
1046 public:
1047 wxPoint m_pos;
1048
1049 wxMoveEvent() { m_eventType = wxEVT_MOVE; }
1050 wxMoveEvent(const wxPoint& pos, int id = 0)
1051 : m_pos(pos)
1052 { m_eventType = wxEVT_MOVE; m_id = id; }
1053
1054 wxPoint GetPosition() const { return m_pos; }
1055
1056 void CopyObject(wxObject& obj) const;
1057 };
1058
1059 // Paint event class
1060 /*
1061 wxEVT_PAINT
1062 wxEVT_NC_PAINT
1063 wxEVT_PAINT_ICON
1064 */
1065
1066 #if defined(__WXDEBUG__) && defined(__WXMSW__)
1067 // see comments in src/msw/dcclient.cpp where g_isPainting is defined
1068 extern int g_isPainting;
1069 #endif // debug
1070
1071 class WXDLLEXPORT wxPaintEvent : public wxEvent
1072 {
1073 DECLARE_DYNAMIC_CLASS(wxPaintEvent)
1074
1075 public:
1076 wxPaintEvent(int Id = 0)
1077 {
1078 m_eventType = wxEVT_PAINT;
1079 m_id = Id;
1080
1081 #if defined(__WXDEBUG__) && defined(__WXMSW__)
1082 // set the internal flag for the duration of processing of WM_PAINT
1083 g_isPainting++;
1084 #endif // debug
1085 }
1086
1087 #if defined(__WXDEBUG__) && defined(__WXMSW__)
1088 ~wxPaintEvent()
1089 {
1090 g_isPainting--;
1091 }
1092 #endif // debug
1093 };
1094
1095 // Erase background event class
1096 /*
1097 wxEVT_ERASE_BACKGROUND
1098 */
1099
1100 class WXDLLEXPORT wxEraseEvent : public wxEvent
1101 {
1102 DECLARE_DYNAMIC_CLASS(wxEraseEvent)
1103
1104 public:
1105 wxDC *m_dc;
1106
1107 wxEraseEvent(int Id = 0, wxDC *dc = (wxDC *) NULL)
1108 { m_eventType = wxEVT_ERASE_BACKGROUND; m_id = Id; m_dc = dc; }
1109 wxDC *GetDC() const { return m_dc; }
1110
1111 void CopyObject(wxObject& obj) const;
1112 };
1113
1114 // Focus event class
1115 /*
1116 wxEVT_SET_FOCUS
1117 wxEVT_KILL_FOCUS
1118 */
1119
1120 class WXDLLEXPORT wxFocusEvent : public wxEvent
1121 {
1122 DECLARE_DYNAMIC_CLASS(wxFocusEvent)
1123
1124 public:
1125 wxFocusEvent(wxEventType type = wxEVT_NULL, int Id = 0)
1126 { m_eventType = type; m_id = Id; }
1127 };
1128
1129 // Activate event class
1130 /*
1131 wxEVT_ACTIVATE
1132 wxEVT_ACTIVATE_APP
1133 */
1134
1135 class WXDLLEXPORT wxActivateEvent : public wxEvent
1136 {
1137 DECLARE_DYNAMIC_CLASS(wxActivateEvent)
1138
1139 public:
1140 wxActivateEvent(wxEventType type = wxEVT_NULL, bool active = TRUE, int Id = 0)
1141 { m_eventType = type; m_active = active; m_id = Id; }
1142 bool GetActive() const { return m_active; }
1143
1144 void CopyObject(wxObject& obj) const;
1145
1146 private:
1147 bool m_active;
1148 };
1149
1150 // InitDialog event class
1151 /*
1152 wxEVT_INIT_DIALOG
1153 */
1154
1155 class WXDLLEXPORT wxInitDialogEvent : public wxEvent
1156 {
1157 DECLARE_DYNAMIC_CLASS(wxInitDialogEvent)
1158
1159 public:
1160 wxInitDialogEvent(int Id = 0)
1161 { m_eventType = wxEVT_INIT_DIALOG; m_id = Id; }
1162 };
1163
1164 // Miscellaneous menu event class
1165 /*
1166 wxEVT_MENU_CHAR,
1167 wxEVT_MENU_INIT,
1168 wxEVT_MENU_HIGHLIGHT,
1169 wxEVT_POPUP_MENU_INIT,
1170 wxEVT_CONTEXT_MENU,
1171 */
1172
1173 class WXDLLEXPORT wxMenuEvent : public wxEvent
1174 {
1175 DECLARE_DYNAMIC_CLASS(wxMenuEvent)
1176
1177 public:
1178 wxMenuEvent(wxEventType type = wxEVT_NULL, int id = 0)
1179 { m_eventType = type; m_menuId = id; }
1180
1181 int GetMenuId() const { return m_menuId; }
1182
1183 void CopyObject(wxObject& obj) const;
1184 private:
1185 int m_menuId;
1186 };
1187
1188 // Window close or session close event class
1189 /*
1190 wxEVT_CLOSE_WINDOW,
1191 wxEVT_END_SESSION,
1192 wxEVT_QUERY_END_SESSION
1193 */
1194
1195 class WXDLLEXPORT wxCloseEvent : public wxEvent
1196 {
1197 DECLARE_DYNAMIC_CLASS(wxCloseEvent)
1198
1199 public:
1200 wxCloseEvent(wxEventType type = wxEVT_NULL, int id = 0)
1201 {
1202 m_eventType = type;
1203 m_loggingOff = TRUE;
1204 m_veto = FALSE; // should be FALSE by default
1205 m_id = id;
1206 #if WXWIN_COMPATIBILITY
1207 m_force = FALSE;
1208 #endif // WXWIN_COMPATIBILITY
1209 m_canVeto = TRUE;
1210 }
1211
1212 void SetLoggingOff(bool logOff) { m_loggingOff = logOff; }
1213 bool GetLoggingOff() const { return m_loggingOff; }
1214
1215 void Veto(bool veto = TRUE)
1216 {
1217 // GetVeto() will return FALSE anyhow...
1218 wxCHECK_RET( m_canVeto,
1219 wxT("call to Veto() ignored (can't veto this event)") );
1220
1221 m_veto = veto;
1222 }
1223 void SetCanVeto(bool canVeto) { m_canVeto = canVeto; }
1224 // No more asserts here please, the one you put here was wrong.
1225 bool CanVeto() const { return m_canVeto; }
1226 bool GetVeto() const { return m_canVeto && m_veto; }
1227
1228 #if WXWIN_COMPATIBILITY
1229 // This is probably obsolete now, since we use CanVeto instead, in
1230 // both OnCloseWindow and OnQueryEndSession.
1231 // m_force == ! m_canVeto i.e., can't veto means we must force it to close.
1232 void SetForce(bool force) { m_force = force; }
1233 bool GetForce() const { return m_force; }
1234 #endif
1235
1236 void CopyObject(wxObject& obj) const;
1237
1238 protected:
1239 bool m_loggingOff;
1240 bool m_veto, m_canVeto;
1241
1242 #if WXWIN_COMPATIBILITY
1243 bool m_force;
1244 #endif
1245 };
1246
1247 /*
1248 wxEVT_SHOW
1249 */
1250
1251 class WXDLLEXPORT wxShowEvent : public wxEvent
1252 {
1253 DECLARE_DYNAMIC_CLASS(wxShowEvent)
1254
1255 public:
1256
1257 wxShowEvent(int id = 0, bool show = FALSE)
1258 { m_eventType = wxEVT_SHOW; m_id = id; m_show = show; }
1259
1260 void SetShow(bool show) { m_show = show; }
1261 bool GetShow() const { return m_show; }
1262
1263 void CopyObject(wxObject& obj) const;
1264
1265 protected:
1266 bool m_show;
1267 };
1268
1269 /*
1270 wxEVT_ICONIZE
1271 */
1272
1273 class WXDLLEXPORT wxIconizeEvent : public wxEvent
1274 {
1275 DECLARE_DYNAMIC_CLASS(wxIconizeEvent)
1276
1277 public:
1278 wxIconizeEvent(int id = 0)
1279 { m_eventType = wxEVT_ICONIZE; m_id = id; }
1280 };
1281
1282 /*
1283 wxEVT_MAXIMIZE
1284 */
1285
1286 class WXDLLEXPORT wxMaximizeEvent : public wxEvent
1287 {
1288 DECLARE_DYNAMIC_CLASS(wxMaximizeEvent)
1289
1290 public:
1291 wxMaximizeEvent(int id = 0)
1292 { m_eventType = wxEVT_MAXIMIZE; m_id = id; }
1293 };
1294
1295 // Joystick event class
1296 /*
1297 wxEVT_JOY_BUTTON_DOWN,
1298 wxEVT_JOY_BUTTON_UP,
1299 wxEVT_JOY_MOVE,
1300 wxEVT_JOY_ZMOVE
1301 */
1302
1303 // Which joystick? Same as Windows ids so no conversion necessary.
1304 #define wxJOYSTICK1 0
1305 #define wxJOYSTICK2 1
1306
1307 // Which button is down?
1308 #define wxJOY_BUTTON1 1
1309 #define wxJOY_BUTTON2 2
1310 #define wxJOY_BUTTON3 4
1311 #define wxJOY_BUTTON4 8
1312 #define wxJOY_BUTTON_ANY -1
1313
1314 class WXDLLEXPORT wxJoystickEvent : public wxEvent
1315 {
1316 DECLARE_DYNAMIC_CLASS(wxJoystickEvent)
1317
1318 public:
1319 wxPoint m_pos;
1320 int m_zPosition;
1321 int m_buttonChange; // Which button changed?
1322 int m_buttonState; // Which buttons are down?
1323 int m_joyStick; // Which joystick?
1324
1325 wxJoystickEvent(wxEventType type = wxEVT_NULL,
1326 int state = 0,
1327 int joystick = wxJOYSTICK1,
1328 int change = 0)
1329 {
1330 m_eventType = type;
1331 m_buttonState = state;
1332 m_pos = wxPoint(0,0);
1333 m_zPosition = 0;
1334 m_joyStick = joystick;
1335 m_buttonChange = change;
1336 }
1337
1338 wxPoint GetPosition() const { return m_pos; }
1339 int GetZPosition() const { return m_zPosition; }
1340 int GetButtonState() const { return m_buttonState; }
1341 int GetButtonChange() const { return m_buttonChange; }
1342 int GetJoystick() const { return m_joyStick; }
1343
1344 void SetJoystick(int stick) { m_joyStick = stick; }
1345 void SetButtonState(int state) { m_buttonState = state; }
1346 void SetButtonChange(int change) { m_buttonChange = change; }
1347 void SetPosition(const wxPoint& pos) { m_pos = pos; }
1348 void SetZPosition(int zPos) { m_zPosition = zPos; }
1349
1350 // Was it a button event? (*doesn't* mean: is any button *down*?)
1351 bool IsButton() const { return ((GetEventType() == wxEVT_JOY_BUTTON_DOWN) ||
1352 (GetEventType() == wxEVT_JOY_BUTTON_UP)); }
1353
1354 // Was it a move event?
1355 bool IsMove() const { return (GetEventType() == wxEVT_JOY_MOVE) ; }
1356
1357 // Was it a zmove event?
1358 bool IsZMove() const { return (GetEventType() == wxEVT_JOY_ZMOVE) ; }
1359
1360 // Was it a down event from button 1, 2, 3, 4 or any?
1361 bool ButtonDown(int but = wxJOY_BUTTON_ANY) const
1362 { return ((GetEventType() == wxEVT_JOY_BUTTON_DOWN) &&
1363 ((but == wxJOY_BUTTON_ANY) || (but == m_buttonChange))); }
1364
1365 // Was it a up event from button 1, 2, 3 or any?
1366 bool ButtonUp(int but = wxJOY_BUTTON_ANY) const
1367 { return ((GetEventType() == wxEVT_JOY_BUTTON_UP) &&
1368 ((but == wxJOY_BUTTON_ANY) || (but == m_buttonChange))); }
1369
1370 // Was the given button 1,2,3,4 or any in Down state?
1371 bool ButtonIsDown(int but = wxJOY_BUTTON_ANY) const
1372 { return (((but == wxJOY_BUTTON_ANY) && (m_buttonState != 0)) ||
1373 ((m_buttonState & but) == but)); }
1374
1375 void CopyObject(wxObject& obj) const;
1376 };
1377
1378 // Drop files event class
1379 /*
1380 wxEVT_DROP_FILES
1381 */
1382
1383 class WXDLLEXPORT wxDropFilesEvent : public wxEvent
1384 {
1385 DECLARE_DYNAMIC_CLASS(wxDropFilesEvent)
1386
1387 public:
1388 int m_noFiles;
1389 wxPoint m_pos;
1390 wxString* m_files; // Memory (de)allocated by code calling ProcessEvent
1391
1392 wxDropFilesEvent(wxEventType type = wxEVT_NULL,
1393 int noFiles = 0,
1394 wxString *files = (wxString *) NULL)
1395 { m_eventType = type; m_noFiles = noFiles; m_files = files; }
1396
1397 wxPoint GetPosition() const { return m_pos; }
1398 int GetNumberOfFiles() const { return m_noFiles; }
1399 wxString *GetFiles() const { return m_files; }
1400
1401 void CopyObject(wxObject& obj) const;
1402 };
1403
1404 // Update UI event
1405 /*
1406 wxEVT_UPDATE_UI
1407 */
1408
1409 class WXDLLEXPORT wxUpdateUIEvent : public wxCommandEvent
1410 {
1411 DECLARE_DYNAMIC_CLASS(wxUpdateUIEvent)
1412
1413 public:
1414 wxUpdateUIEvent(wxWindowID commandId = 0)
1415 {
1416 m_eventType = wxEVT_UPDATE_UI;
1417 m_id = commandId;
1418 m_checked = FALSE;
1419 m_setChecked = FALSE;
1420 m_enabled = FALSE;
1421 m_setEnabled = FALSE;
1422 m_setText = FALSE;
1423 m_text = "";
1424 }
1425
1426 bool GetChecked() const { return m_checked; }
1427 bool GetEnabled() const { return m_enabled; }
1428 wxString GetText() const { return m_text; }
1429 bool GetSetText() const { return m_setText; }
1430 bool GetSetChecked() const { return m_setChecked; }
1431 bool GetSetEnabled() const { return m_setEnabled; }
1432
1433 void Check(bool check) { m_checked = check; m_setChecked = TRUE; }
1434 void Enable(bool enable) { m_enabled = enable; m_setEnabled = TRUE; }
1435 void SetText(const wxString& text) { m_text = text; m_setText = TRUE; }
1436
1437 void CopyObject(wxObject& obj) const;
1438
1439 protected:
1440 bool m_checked;
1441 bool m_enabled;
1442 bool m_setEnabled;
1443 bool m_setText;
1444 bool m_setChecked;
1445 wxString m_text;
1446 };
1447
1448 /*
1449 wxEVT_SYS_COLOUR_CHANGED
1450 */
1451
1452 // TODO: shouldn't all events record the window ID?
1453 class WXDLLEXPORT wxSysColourChangedEvent : public wxEvent
1454 {
1455 DECLARE_DYNAMIC_CLASS(wxSysColourChangedEvent)
1456
1457 public:
1458 wxSysColourChangedEvent()
1459 { m_eventType = wxEVT_SYS_COLOUR_CHANGED; }
1460 };
1461
1462 /*
1463 wxEVT_PALETTE_CHANGED
1464 */
1465
1466 class WXDLLEXPORT wxPaletteChangedEvent : public wxEvent
1467 {
1468 DECLARE_DYNAMIC_CLASS(wxPaletteChangedEvent)
1469
1470 public:
1471 wxPaletteChangedEvent(wxWindowID id = 0) : wxEvent(id)
1472 {
1473 m_eventType = wxEVT_PALETTE_CHANGED;
1474 m_changedWindow = (wxWindow *) NULL;
1475 }
1476
1477 void SetChangedWindow(wxWindow* win) { m_changedWindow = win; }
1478 wxWindow* GetChangedWindow() const { return m_changedWindow; }
1479
1480 void CopyObject(wxObject& obj) const;
1481
1482 protected:
1483 wxWindow* m_changedWindow;
1484 };
1485
1486 /*
1487 wxEVT_QUERY_NEW_PALETTE
1488 Indicates the window is getting keyboard focus and should re-do its palette.
1489 */
1490
1491 class WXDLLEXPORT wxQueryNewPaletteEvent : public wxEvent
1492 {
1493 DECLARE_DYNAMIC_CLASS(wxQueryNewPaletteEvent)
1494
1495 public:
1496 wxQueryNewPaletteEvent(wxWindowID id = 0): wxEvent(id)
1497 { m_eventType = wxEVT_QUERY_NEW_PALETTE; m_paletteRealized = FALSE; }
1498
1499 // App sets this if it changes the palette.
1500 void SetPaletteRealized(bool realized) { m_paletteRealized = realized; }
1501 bool GetPaletteRealized() const { return m_paletteRealized; }
1502
1503 void CopyObject(wxObject& obj) const;
1504
1505 protected:
1506 bool m_paletteRealized;
1507 };
1508
1509 /*
1510 Event generated by dialog navigation keys
1511 wxEVT_NAVIGATION_KEY
1512 */
1513 // NB: don't derive from command event to avoid being propagated to the parent
1514 class WXDLLEXPORT wxNavigationKeyEvent : public wxEvent
1515 {
1516 public:
1517 wxNavigationKeyEvent()
1518 {
1519 SetEventType(wxEVT_NAVIGATION_KEY);
1520
1521 m_flags = IsForward | Propagate; // defaults are for TAB
1522 m_focus = (wxWindow *)NULL;
1523 }
1524
1525 // direction: forward (true) or backward (false)
1526 bool GetDirection() const
1527 { return (m_flags & IsForward) != 0; }
1528 void SetDirection(bool bForward)
1529 { if ( bForward ) m_flags |= IsForward; else m_flags &= ~IsForward; }
1530
1531 // it may be a window change event (MDI, notebook pages...) or a control
1532 // change event
1533 bool IsWindowChange() const
1534 { return (m_flags & WinChange) != 0; }
1535 void SetWindowChange(bool bIs)
1536 { if ( bIs ) m_flags |= WinChange; else m_flags &= ~WinChange; }
1537
1538 // some navigation events are meant to be propagated upwards (Windows
1539 // convention is to do this for TAB events) while others should always
1540 // cycle inside the panel/radiobox/whatever we're current inside
1541 bool ShouldPropagate() const
1542 { return (m_flags & Propagate) != 0; }
1543 void SetPropagate(bool bDoIt)
1544 { if ( bDoIt ) m_flags |= Propagate; else m_flags &= ~Propagate; }
1545
1546 // the child which has the focus currently (may be NULL - use
1547 // wxWindow::FindFocus then)
1548 wxWindow* GetCurrentFocus() const { return m_focus; }
1549 void SetCurrentFocus(wxWindow *win) { m_focus = win; }
1550
1551 private:
1552 enum
1553 {
1554 IsForward = 0x0001,
1555 WinChange = 0x0002,
1556 Propagate = 0x0004
1557 };
1558
1559 long m_flags;
1560 wxWindow *m_focus;
1561
1562 DECLARE_DYNAMIC_CLASS(wxNavigationKeyEvent)
1563 };
1564
1565 // Window creation/destruction events: the first is sent as soon as window is
1566 // created (i.e. the underlying GUI object exists), but when the C++ object is
1567 // fully initialized (so virtual functions may be called). The second,
1568 // wxEVT_DESTROY, is sent right before the window is destroyed - again, it's
1569 // still safe to call virtual functions at this moment
1570 /*
1571 wxEVT_CREATE
1572 wxEVT_DESTROY
1573 */
1574
1575 class WXDLLEXPORT wxWindowCreateEvent : public wxEvent
1576 {
1577 DECLARE_DYNAMIC_CLASS(wxWindowCreateEvent)
1578
1579 public:
1580 wxWindowCreateEvent(wxWindow *win = NULL);
1581
1582 wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); }
1583 };
1584
1585 class WXDLLEXPORT wxWindowDestroyEvent : public wxEvent
1586 {
1587 DECLARE_DYNAMIC_CLASS(wxWindowDestroyEvent)
1588
1589 public:
1590 wxWindowDestroyEvent(wxWindow *win = NULL);
1591
1592 wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); }
1593 };
1594
1595 #endif // wxUSE_GUI
1596
1597 // Idle event
1598 /*
1599 wxEVT_IDLE
1600 */
1601
1602 class WXDLLEXPORT wxIdleEvent : public wxEvent
1603 {
1604 DECLARE_DYNAMIC_CLASS(wxIdleEvent)
1605
1606 public:
1607 wxIdleEvent()
1608 { m_eventType = wxEVT_IDLE; m_requestMore = FALSE; }
1609
1610 void RequestMore(bool needMore = TRUE) { m_requestMore = needMore; }
1611 bool MoreRequested() const { return m_requestMore; }
1612
1613 void CopyObject(wxObject& obj) const;
1614
1615 protected:
1616 bool m_requestMore;
1617 };
1618
1619 /* TODO
1620 wxEVT_POWER,
1621 wxEVT_MOUSE_CAPTURE_CHANGED,
1622 wxEVT_SETTING_CHANGED, // WM_WININICHANGE (NT) / WM_SETTINGCHANGE (Win95)
1623 // wxEVT_FONT_CHANGED, // WM_FONTCHANGE: roll into wxEVT_SETTING_CHANGED, but remember to propagate
1624 // wxEVT_FONT_CHANGED to all other windows (maybe).
1625 wxEVT_DRAW_ITEM, // Leave these three as virtual functions in wxControl?? Platform-specific.
1626 wxEVT_MEASURE_ITEM,
1627 wxEVT_COMPARE_ITEM
1628 */
1629
1630 // ============================================================================
1631 // event handler and related classes
1632 // ============================================================================
1633
1634 typedef void (wxObject::*wxObjectEventFunction)(wxEvent&);
1635
1636 struct WXDLLEXPORT wxEventTableEntry
1637 {
1638 // For some reason, this can't be wxEventType, or VC++ complains.
1639 int m_eventType; // main event type
1640 int m_id; // control/menu/toolbar id
1641 int m_lastId; // used for ranges of ids
1642 wxObjectEventFunction m_fn; // function to call: not wxEventFunction,
1643 // because of dependency problems
1644
1645 wxObject* m_callbackUserData;
1646 };
1647
1648 struct WXDLLEXPORT wxEventTable
1649 {
1650 const wxEventTable *baseTable; // Points to base event table (next in chain)
1651 const wxEventTableEntry *entries; // Points to bottom of entry array
1652 };
1653
1654 class WXDLLEXPORT wxEvtHandler : public wxObject
1655 {
1656 DECLARE_DYNAMIC_CLASS(wxEvtHandler)
1657
1658 public:
1659 wxEvtHandler();
1660 ~wxEvtHandler();
1661
1662 wxEvtHandler *GetNextHandler() const { return m_nextHandler; }
1663 wxEvtHandler *GetPreviousHandler() const { return m_previousHandler; }
1664 void SetNextHandler(wxEvtHandler *handler) { m_nextHandler = handler; }
1665 void SetPreviousHandler(wxEvtHandler *handler) { m_previousHandler = handler; }
1666
1667 void SetEvtHandlerEnabled(bool enabled) { m_enabled = enabled; }
1668 bool GetEvtHandlerEnabled() const { return m_enabled; }
1669
1670 // process an event right now
1671 virtual bool ProcessEvent(wxEvent& event);
1672
1673 // add an event to be processed later
1674 void AddPendingEvent(wxEvent& event);
1675
1676 // process all pending events
1677 void ProcessPendingEvents();
1678
1679 // add a
1680 #if wxUSE_THREADS
1681 bool ProcessThreadEvent(wxEvent& event);
1682 #endif
1683
1684 // Dynamic association of a member function handler with the event handler,
1685 // id and event type
1686 void Connect( int id, int lastId, wxEventType eventType,
1687 wxObjectEventFunction func,
1688 wxObject *userData = (wxObject *) NULL );
1689
1690 // Convenience function: take just one id
1691 void Connect( int id, wxEventType eventType,
1692 wxObjectEventFunction func,
1693 wxObject *userData = (wxObject *) NULL )
1694 { Connect(id, -1, eventType, func, userData); }
1695
1696 bool Disconnect( int id, int lastId = -1, wxEventType eventType = wxEVT_NULL,
1697 wxObjectEventFunction func = NULL,
1698 wxObject *userData = (wxObject *) NULL );
1699
1700 // Convenience function: take just one id
1701 bool Disconnect( int id, wxEventType eventType = wxEVT_NULL,
1702 wxObjectEventFunction func = NULL,
1703 wxObject *userData = (wxObject *) NULL )
1704 { return Disconnect(id, -1, eventType, func, userData); }
1705
1706 // implementation from now on
1707 virtual bool SearchEventTable(wxEventTable& table, wxEvent& event);
1708 bool SearchDynamicEventTable( wxEvent& event );
1709
1710 #if wxUSE_THREADS
1711 void ClearEventLocker()
1712 {
1713 # if !defined(__VISAGECPP__)
1714 delete m_eventsLocker;
1715 m_eventsLocker = NULL;
1716 #endif
1717 };
1718 #endif
1719
1720 // old stuff
1721
1722 #if WXWIN_COMPATIBILITY_2
1723 virtual void OnCommand(wxWindow& WXUNUSED(win),
1724 wxCommandEvent& WXUNUSED(event))
1725 {
1726 wxFAIL_MSG(wxT("shouldn't be called any more"));
1727 }
1728
1729 // Called if child control has no callback function
1730 virtual long Default()
1731 { return GetNextHandler() ? GetNextHandler()->Default() : 0; };
1732 #endif // WXWIN_COMPATIBILITY_2
1733
1734 #if WXWIN_COMPATIBILITY
1735 virtual bool OnClose();
1736 #endif
1737
1738 private:
1739 static const wxEventTableEntry sm_eventTableEntries[];
1740
1741 protected:
1742 static const wxEventTable sm_eventTable;
1743
1744 virtual const wxEventTable *GetEventTable() const;
1745
1746 protected:
1747 wxEvtHandler* m_nextHandler;
1748 wxEvtHandler* m_previousHandler;
1749 wxList* m_dynamicEvents;
1750 wxList* m_pendingEvents;
1751 #if wxUSE_THREADS
1752 #if defined (__VISAGECPP__)
1753 wxCriticalSection m_eventsLocker;
1754 # else
1755 wxCriticalSection* m_eventsLocker;
1756 # endif
1757 #endif
1758
1759 // optimization: instead of using costly IsKindOf() to decide whether we're
1760 // a window (which is true in 99% of cases), use this flag
1761 bool m_isWindow;
1762
1763 // Is event handler enabled?
1764 bool m_enabled;
1765 };
1766
1767 typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&);
1768 #if wxUSE_GUI
1769 typedef void (wxEvtHandler::*wxCommandEventFunction)(wxCommandEvent&);
1770 typedef void (wxEvtHandler::*wxScrollEventFunction)(wxScrollEvent&);
1771 typedef void (wxEvtHandler::*wxScrollWinEventFunction)(wxScrollWinEvent&);
1772 typedef void (wxEvtHandler::*wxSizeEventFunction)(wxSizeEvent&);
1773 typedef void (wxEvtHandler::*wxMoveEventFunction)(wxMoveEvent&);
1774 typedef void (wxEvtHandler::*wxPaintEventFunction)(wxPaintEvent&);
1775 typedef void (wxEvtHandler::*wxEraseEventFunction)(wxEraseEvent&);
1776 typedef void (wxEvtHandler::*wxMouseEventFunction)(wxMouseEvent&);
1777 typedef void (wxEvtHandler::*wxCharEventFunction)(wxKeyEvent&);
1778 typedef void (wxEvtHandler::*wxFocusEventFunction)(wxFocusEvent&);
1779 typedef void (wxEvtHandler::*wxActivateEventFunction)(wxActivateEvent&);
1780 typedef void (wxEvtHandler::*wxMenuEventFunction)(wxMenuEvent&);
1781 typedef void (wxEvtHandler::*wxJoystickEventFunction)(wxJoystickEvent&);
1782 typedef void (wxEvtHandler::*wxDropFilesEventFunction)(wxDropFilesEvent&);
1783 typedef void (wxEvtHandler::*wxInitDialogEventFunction)(wxInitDialogEvent&);
1784 typedef void (wxEvtHandler::*wxSysColourChangedFunction)(wxSysColourChangedEvent&);
1785 typedef void (wxEvtHandler::*wxUpdateUIEventFunction)(wxUpdateUIEvent&);
1786 typedef void (wxEvtHandler::*wxIdleEventFunction)(wxIdleEvent&);
1787 typedef void (wxEvtHandler::*wxCloseEventFunction)(wxCloseEvent&);
1788 typedef void (wxEvtHandler::*wxShowEventFunction)(wxShowEvent&);
1789 typedef void (wxEvtHandler::*wxIconizeEventFunction)(wxShowEvent&);
1790 typedef void (wxEvtHandler::*wxMaximizeEventFunction)(wxShowEvent&);
1791 typedef void (wxEvtHandler::*wxNavigationKeyEventFunction)(wxNavigationKeyEvent&);
1792 typedef void (wxEvtHandler::*wxPaletteChangedEventFunction)(wxPaletteChangedEvent&);
1793 typedef void (wxEvtHandler::*wxQueryNewPaletteEventFunction)(wxQueryNewPaletteEvent&);
1794 #endif // wxUSE_GUI
1795
1796 // N.B. In GNU-WIN32, you *have* to take the address of a member function
1797 // (use &) or the compiler crashes...
1798
1799 #define DECLARE_EVENT_TABLE() \
1800 private:\
1801 static const wxEventTableEntry sm_eventTableEntries[];\
1802 protected:\
1803 static const wxEventTable sm_eventTable;\
1804 virtual const wxEventTable* GetEventTable() const;
1805
1806 #define BEGIN_EVENT_TABLE(theClass, baseClass) \
1807 const wxEventTable *theClass::GetEventTable() const { return &theClass::sm_eventTable; }\
1808 const wxEventTable theClass::sm_eventTable =\
1809 { &baseClass::sm_eventTable, &theClass::sm_eventTableEntries[0] };\
1810 const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
1811
1812 #define END_EVENT_TABLE() \
1813 { 0, 0, 0, 0, 0 } };
1814
1815 /*
1816 * Event table macros
1817 */
1818
1819 // Generic events
1820 #define EVT_CUSTOM(event, id, func) { event, id, -1, (wxObjectEventFunction) (wxEventFunction) & func, (wxObject *) NULL },
1821 #define EVT_CUSTOM_RANGE(event, id1, id2, func) { event, id1, id2, (wxObjectEventFunction) (wxEventFunction) & func, (wxObject *) NULL },
1822
1823 // Miscellaneous
1824 #define EVT_SIZE(func) { wxEVT_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxSizeEventFunction) & func, (wxObject *) NULL },
1825 #define EVT_MOVE(func) { wxEVT_MOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMoveEventFunction) & func, (wxObject *) NULL },
1826 #define EVT_CLOSE(func) { wxEVT_CLOSE_WINDOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL },
1827 #define EVT_END_SESSION(func) { wxEVT_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL },
1828 #define EVT_QUERY_END_SESSION(func) { wxEVT_QUERY_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL },
1829 #define EVT_PAINT(func) { wxEVT_PAINT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxPaintEventFunction) & func, (wxObject *) NULL },
1830 #define EVT_ERASE_BACKGROUND(func) { wxEVT_ERASE_BACKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxEraseEventFunction) & func, (wxObject *) NULL },
1831 #define EVT_CHAR(func) { wxEVT_CHAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, (wxObject *) NULL },
1832 #define EVT_KEY_DOWN(func) { wxEVT_KEY_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, (wxObject *) NULL },
1833 #define EVT_KEY_UP(func) { wxEVT_KEY_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, (wxObject *) NULL },
1834 #define EVT_CHAR_HOOK(func) { wxEVT_CHAR_HOOK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, NULL },
1835 #define EVT_MENU_HIGHLIGHT(id, func) { wxEVT_MENU_HIGHLIGHT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMenuEventFunction) & func, (wxObject *) NULL },
1836 #define EVT_MENU_HIGHLIGHT_ALL(func) { wxEVT_MENU_HIGHLIGHT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMenuEventFunction) & func, (wxObject *) NULL },
1837 #define EVT_SET_FOCUS(func) { wxEVT_SET_FOCUS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxFocusEventFunction) & func, (wxObject *) NULL },
1838 #define EVT_KILL_FOCUS(func) { wxEVT_KILL_FOCUS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxFocusEventFunction) & func, (wxObject *) NULL },
1839 #define EVT_ACTIVATE(func) { wxEVT_ACTIVATE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxActivateEventFunction) & func, (wxObject *) NULL },
1840 #define EVT_ACTIVATE_APP(func) { wxEVT_ACTIVATE_APP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxActivateEventFunction) & func, (wxObject *) NULL },
1841 #define EVT_END_SESSION(func) { wxEVT_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL },
1842 #define EVT_QUERY_END_SESSION(func) { wxEVT_QUERY_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL },
1843 #define EVT_DROP_FILES(func) { wxEVT_DROP_FILES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxDropFilesEventFunction) & func, (wxObject *) NULL },
1844 #define EVT_INIT_DIALOG(func) { wxEVT_INIT_DIALOG, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxInitDialogEventFunction) & func, (wxObject *) NULL },
1845 #define EVT_SYS_COLOUR_CHANGED(func) { wxEVT_SYS_COLOUR_CHANGED, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxSysColourChangedFunction) & func, (wxObject *) NULL },
1846 #define EVT_SHOW(func) { wxEVT_SHOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxShowEventFunction) & func, (wxObject *) NULL },
1847 #define EVT_MAXIMIZE(func) { wxEVT_MAXIMIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMaximizeEventFunction) & func, (wxObject *) NULL },
1848 #define EVT_ICONIZE(func) { wxEVT_ICONIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIconizeEventFunction) & func, (wxObject *) NULL },
1849 #define EVT_NAVIGATION_KEY(func) { wxEVT_NAVIGATION_KEY, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNavigationKeyEventFunction) & func, (wxObject *) NULL },
1850 #define EVT_PALETTE_CHANGED(func) { wxEVT_PALETTE_CHANGED, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxPaletteChangedEventFunction) & func, (wxObject *) NULL },
1851 #define EVT_QUERY_NEW_PALETTE(func) { wxEVT_QUERY_NEW_PALETTE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxQueryNewPaletteEventFunction) & func, (wxObject *) NULL },
1852 #define EVT_WINDOW_CREATE(func) { wxEVT_CREATE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxQueryNewPaletteEventFunction) & func, (wxObject *) NULL },
1853 #define EVT_WINDOW_DESTROY(func) { wxEVT_DESTROY, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxQueryNewPaletteEventFunction) & func, (wxObject *) NULL },
1854
1855 // Mouse events
1856 #define EVT_LEFT_DOWN(func) { wxEVT_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1857 #define EVT_LEFT_UP(func) { wxEVT_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1858 #define EVT_MIDDLE_DOWN(func) { wxEVT_MIDDLE_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1859 #define EVT_MIDDLE_UP(func) { wxEVT_MIDDLE_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1860 #define EVT_RIGHT_DOWN(func) { wxEVT_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1861 #define EVT_RIGHT_UP(func) { wxEVT_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1862 #define EVT_MOTION(func) { wxEVT_MOTION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1863 #define EVT_LEFT_DCLICK(func) { wxEVT_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1864 #define EVT_MIDDLE_DCLICK(func) { wxEVT_MIDDLE_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1865 #define EVT_RIGHT_DCLICK(func) { wxEVT_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1866 #define EVT_LEAVE_WINDOW(func) { wxEVT_LEAVE_WINDOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1867 #define EVT_ENTER_WINDOW(func) { wxEVT_ENTER_WINDOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1868
1869 // All mouse events
1870 #define EVT_MOUSE_EVENTS(func) \
1871 { wxEVT_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1872 { wxEVT_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1873 { wxEVT_MIDDLE_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1874 { wxEVT_MIDDLE_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1875 { wxEVT_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1876 { wxEVT_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1877 { wxEVT_MOTION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1878 { wxEVT_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1879 { wxEVT_MIDDLE_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1880 { wxEVT_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1881 { wxEVT_ENTER_WINDOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1882 { wxEVT_LEAVE_WINDOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1883
1884 // EVT_COMMAND
1885 #define EVT_COMMAND(id, event, fn) { event, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1886 #define EVT_COMMAND_RANGE(id1, id2, event, fn) { event, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1887
1888 // Scrolling from wxWindow (sent to wxScrolledWindow)
1889 #define EVT_SCROLLWIN(func) \
1890 { wxEVT_SCROLLWIN_TOP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1891 { wxEVT_SCROLLWIN_BOTTOM, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1892 { wxEVT_SCROLLWIN_LINEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1893 { wxEVT_SCROLLWIN_LINEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1894 { wxEVT_SCROLLWIN_PAGEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1895 { wxEVT_SCROLLWIN_PAGEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1896 { wxEVT_SCROLLWIN_THUMBTRACK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1897
1898 #define EVT_SCROLLWIN_TOP(func) { wxEVT_SCROLLWIN_TOP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1899 #define EVT_SCROLLWIN_BOTTOM(func) { wxEVT_SCROLLWIN_BOTTOM, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1900 #define EVT_SCROLLWIN_LINEUP(func) { wxEVT_SCROLLWIN_LINEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1901 #define EVT_SCROLLWIN_LINEDOWN(func) { wxEVT_SCROLLWIN_LINEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1902 #define EVT_SCROLLWIN_PAGEUP(func) { wxEVT_SCROLLWIN_PAGEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1903 #define EVT_SCROLLWIN_PAGEDOWN(func) { wxEVT_SCROLLWIN_PAGEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1904 #define EVT_SCROLLWIN_THUMBTRACK(func) { wxEVT_SCROLLWIN_THUMBTRACK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1905
1906 // Scrolling from wxSlider and wxScrollBar
1907 #define EVT_SCROLL(func) \
1908 { wxEVT_SCROLL_TOP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1909 { wxEVT_SCROLL_BOTTOM, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1910 { wxEVT_SCROLL_LINEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1911 { wxEVT_SCROLL_LINEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1912 { wxEVT_SCROLL_PAGEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1913 { wxEVT_SCROLL_PAGEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1914 { wxEVT_SCROLL_THUMBTRACK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1915
1916 #define EVT_SCROLL_TOP(func) { wxEVT_SCROLL_TOP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1917 #define EVT_SCROLL_BOTTOM(func) { wxEVT_SCROLL_BOTTOM, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1918 #define EVT_SCROLL_LINEUP(func) { wxEVT_SCROLL_LINEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1919 #define EVT_SCROLL_LINEDOWN(func) { wxEVT_SCROLL_LINEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1920 #define EVT_SCROLL_PAGEUP(func) { wxEVT_SCROLL_PAGEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1921 #define EVT_SCROLL_PAGEDOWN(func) { wxEVT_SCROLL_PAGEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1922 #define EVT_SCROLL_THUMBTRACK(func) { wxEVT_SCROLL_THUMBTRACK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1923
1924 // Scrolling from wxSlider and wxScrollBar, with an id
1925 #define EVT_COMMAND_SCROLL(id, func) \
1926 { wxEVT_SCROLL_TOP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1927 { wxEVT_SCROLL_BOTTOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1928 { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1929 { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1930 { wxEVT_SCROLL_PAGEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1931 { wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1932 { wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1933
1934 #define EVT_COMMAND_SCROLL_TOP(id, func) { wxEVT_SCROLL_TOP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1935 #define EVT_COMMAND_SCROLL_BOTTOM(id, func) { wxEVT_SCROLL_BOTTOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1936 #define EVT_COMMAND_SCROLL_LINEUP(id, func) { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1937 #define EVT_COMMAND_SCROLL_LINEDOWN(id, func) { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1938 #define EVT_COMMAND_SCROLL_PAGEUP(id, func) { wxEVT_SCROLL_PAGEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1939 #define EVT_COMMAND_SCROLL_PAGEDOWN(id, func) { wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1940 #define EVT_COMMAND_SCROLL_THUMBTRACK(id, func) { wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1941
1942 // Convenience macros for commonly-used commands
1943 #define EVT_BUTTON(id, fn) { wxEVT_COMMAND_BUTTON_CLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1944 #define EVT_CHECKBOX(id, fn) { wxEVT_COMMAND_CHECKBOX_CLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1945 #define EVT_CHOICE(id, fn) { wxEVT_COMMAND_CHOICE_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1946 #define EVT_LISTBOX(id, fn) { wxEVT_COMMAND_LISTBOX_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1947 #define EVT_LISTBOX_DCLICK(id, fn) { wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1948 #define EVT_TEXT(id, fn) { wxEVT_COMMAND_TEXT_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1949 #define EVT_TEXT_ENTER(id, fn) { wxEVT_COMMAND_TEXT_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1950 #define EVT_MENU(id, fn) { wxEVT_COMMAND_MENU_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1951 #define EVT_MENU_RANGE(id1, id2, fn) { wxEVT_COMMAND_MENU_SELECTED, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1952 #define EVT_SLIDER(id, fn) { wxEVT_COMMAND_SLIDER_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1953 #define EVT_RADIOBOX(id, fn) { wxEVT_COMMAND_RADIOBOX_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1954 #define EVT_RADIOBUTTON(id, fn) { wxEVT_COMMAND_RADIOBUTTON_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1955 // EVT_SCROLLBAR is now obsolete since we use EVT_COMMAND_SCROLL... events
1956 #define EVT_SCROLLBAR(id, fn) { wxEVT_COMMAND_SCROLLBAR_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1957 #define EVT_VLBOX(id, fn) { wxEVT_COMMAND_VLBOX_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1958 #define EVT_COMBOBOX(id, fn) { wxEVT_COMMAND_COMBOBOX_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1959 #define EVT_TOOL(id, fn) { wxEVT_COMMAND_TOOL_CLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1960 #define EVT_TOOL_RANGE(id1, id2, fn) { wxEVT_COMMAND_TOOL_CLICKED, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1961 #define EVT_TOOL_RCLICKED(id, fn) { wxEVT_COMMAND_TOOL_RCLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1962 #define EVT_TOOL_RCLICKED_RANGE(id1, id2, fn) { wxEVT_COMMAND_TOOL_RCLICKED, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1963 #define EVT_TOOL_ENTER(id, fn) { wxEVT_COMMAND_TOOL_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1964 #define EVT_CHECKLISTBOX(id, fn) { wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1965
1966 // Generic command events
1967 #define EVT_COMMAND_LEFT_CLICK(id, fn) { wxEVT_COMMAND_LEFT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1968 #define EVT_COMMAND_LEFT_DCLICK(id, fn) { wxEVT_COMMAND_LEFT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1969 #define EVT_COMMAND_RIGHT_CLICK(id, fn) { wxEVT_COMMAND_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1970 #define EVT_COMMAND_RIGHT_DCLICK(id, fn) { wxEVT_COMMAND_RIGHT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1971 #define EVT_COMMAND_SET_FOCUS(id, fn) { wxEVT_COMMAND_SET_FOCUS, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1972 #define EVT_COMMAND_KILL_FOCUS(id, fn) { wxEVT_COMMAND_KILL_FOCUS, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1973 #define EVT_COMMAND_ENTER(id, fn) { wxEVT_COMMAND_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1974
1975 // Joystick events
1976 #define EVT_JOY_DOWN(func) \
1977 { wxEVT_JOY_BUTTON_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },
1978 #define EVT_JOY_UP(func) \
1979 { wxEVT_JOY_BUTTON_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },
1980 #define EVT_JOY_MOVE(func) \
1981 { wxEVT_JOY_MOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },
1982 #define EVT_JOY_ZMOVE(func) \
1983 { wxEVT_JOY_ZMOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },
1984
1985 // All joystick events
1986 #define EVT_JOYSTICK_EVENTS(func) \
1987 { wxEVT_JOY_BUTTON_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
1988 { wxEVT_JOY_BUTTON_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
1989 { wxEVT_JOY_MOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
1990 { wxEVT_JOY_ZMOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
1991
1992 // Idle event
1993 #define EVT_IDLE(func) \
1994 { wxEVT_IDLE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) & func, (wxObject *) NULL },\
1995
1996 // Update UI event
1997 #define EVT_UPDATE_UI(id, func) \
1998 { wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, (wxObject *) NULL },\
1999
2000 // ----------------------------------------------------------------------------
2001 // Global data
2002 // ----------------------------------------------------------------------------
2003
2004 // for pending event processing - notice that there is intentionally no
2005 // WXDLLEXPORT here
2006 extern wxList *wxPendingEvents;
2007 #if wxUSE_THREADS
2008 extern wxCriticalSection *wxPendingEventsLocker;
2009 #endif
2010
2011 // ----------------------------------------------------------------------------
2012 // Helper functions
2013 // ----------------------------------------------------------------------------
2014
2015 #if wxUSE_GUI
2016
2017 // Find a window with the focus, that is also a descendant of the given window.
2018 // This is used to determine the window to initially send commands to.
2019 wxWindow* wxFindFocusDescendant(wxWindow* ancestor);
2020
2021 #endif // wxUSE_GUI
2022
2023 #endif
2024 // _WX_EVENTH__