1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Event classes
4 // Author: Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "event.h"
20 #include "wx/object.h"
23 #include "wx/gdicmn.h"
26 #include "wx/thread.h"
28 // ----------------------------------------------------------------------------
29 // forward declarations
30 // ----------------------------------------------------------------------------
32 class WXDLLEXPORT wxList
;
35 class WXDLLEXPORT wxClientData
;
36 class WXDLLEXPORT wxDC
;
37 class WXDLLEXPORT wxMenu
;
38 class WXDLLEXPORT wxWindow
;
41 // ----------------------------------------------------------------------------
43 // ----------------------------------------------------------------------------
45 typedef int wxEventType
;
47 #if defined(__VISAGECPP__) && __IBMCPP__ >= 400
48 // must define these in the .cpp for VA or else you get multiply defined symbols everywhere
49 extern const wxEventType wxEVT_NULL
;
50 extern const wxEventType wxEVT_FIRST
;
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
;
72 /* Sockets send events, too */
73 extern const wxEventType wxEVT_SOCKET
;
75 /* Mouse event types */
76 extern const wxEventType wxEVT_LEFT_DOWN
;
77 extern const wxEventType wxEVT_LEFT_UP
;
78 extern const wxEventType wxEVT_MIDDLE_DOWN
;
79 extern const wxEventType wxEVT_MIDDLE_UP
;
80 extern const wxEventType wxEVT_RIGHT_DOWN
;
81 extern const wxEventType wxEVT_RIGHT_UP
;
82 extern const wxEventType wxEVT_MOTION
;
83 extern const wxEventType wxEVT_ENTER_WINDOW
;
84 extern const wxEventType wxEVT_LEAVE_WINDOW
;
85 extern const wxEventType wxEVT_LEFT_DCLICK
;
86 extern const wxEventType wxEVT_MIDDLE_DCLICK
;
87 extern const wxEventType wxEVT_RIGHT_DCLICK
;
88 extern const wxEventType wxEVT_SET_FOCUS
;
89 extern const wxEventType wxEVT_KILL_FOCUS
;
91 /* Non-client mouse events */
92 extern const wxEventType wxEVT_NC_LEFT_DOWN
;
93 extern const wxEventType wxEVT_NC_LEFT_UP
;
94 extern const wxEventType wxEVT_NC_MIDDLE_DOWN
;
95 extern const wxEventType wxEVT_NC_MIDDLE_UP
;
96 extern const wxEventType wxEVT_NC_RIGHT_DOWN
;
97 extern const wxEventType wxEVT_NC_RIGHT_UP
;
98 extern const wxEventType wxEVT_NC_MOTION
;
99 extern const wxEventType wxEVT_NC_ENTER_WINDOW
;
100 extern const wxEventType wxEVT_NC_LEAVE_WINDOW
;
101 extern const wxEventType wxEVT_NC_LEFT_DCLICK
;
102 extern const wxEventType wxEVT_NC_MIDDLE_DCLICK
;
103 extern const wxEventType wxEVT_NC_RIGHT_DCLICK
;
105 /* Character input event type */
106 extern const wxEventType wxEVT_CHAR
;
107 extern const wxEventType wxEVT_CHAR_HOOK
;
108 extern const wxEventType wxEVT_NAVIGATION_KEY
;
109 extern const wxEventType wxEVT_KEY_DOWN
;
110 extern const wxEventType wxEVT_KEY_UP
;
113 * wxScrollbar and wxSlider event identifiers
115 extern const wxEventType wxEVT_SCROLL_TOP
;
116 extern const wxEventType wxEVT_SCROLL_BOTTOM
;
117 extern const wxEventType wxEVT_SCROLL_LINEUP
;
118 extern const wxEventType wxEVT_SCROLL_LINEDOWN
;
119 extern const wxEventType wxEVT_SCROLL_PAGEUP
;
120 extern const wxEventType wxEVT_SCROLL_PAGEDOWN
;
121 extern const wxEventType wxEVT_SCROLL_THUMBTRACK
;
124 * Scroll events from wxWindow
126 extern const wxEventType wxEVT_SCROLLWIN_TOP
;
127 extern const wxEventType wxEVT_SCROLLWIN_BOTTOM
;
128 extern const wxEventType wxEVT_SCROLLWIN_LINEUP
;
129 extern const wxEventType wxEVT_SCROLLWIN_LINEDOWN
;
130 extern const wxEventType wxEVT_SCROLLWIN_PAGEUP
;
131 extern const wxEventType wxEVT_SCROLLWIN_PAGEDOWN
;
132 extern const wxEventType wxEVT_SCROLLWIN_THUMBTRACK
;
137 extern const wxEventType wxEVT_SIZE
;
138 extern const wxEventType wxEVT_MOVE
;
139 extern const wxEventType wxEVT_CLOSE_WINDOW
;
140 extern const wxEventType wxEVT_END_SESSION
;
141 extern const wxEventType wxEVT_QUERY_END_SESSION
;
142 extern const wxEventType wxEVT_ACTIVATE_APP
;
143 extern const wxEventType wxEVT_POWER
;
144 extern const wxEventType wxEVT_ACTIVATE
;
145 extern const wxEventType wxEVT_CREATE
;
146 extern const wxEventType wxEVT_DESTROY
;
147 extern const wxEventType wxEVT_SHOW
;
148 extern const wxEventType wxEVT_ICONIZE
;
149 extern const wxEventType wxEVT_MAXIMIZE
;
150 extern const wxEventType wxEVT_MOUSE_CAPTURE_CHANGED
;
151 extern const wxEventType wxEVT_PAINT
;
152 extern const wxEventType wxEVT_ERASE_BACKGROUND
;
153 extern const wxEventType wxEVT_NC_PAINT
;
154 extern const wxEventType wxEVT_PAINT_ICON
;
155 extern const wxEventType wxEVT_MENU_CHAR
;
156 extern const wxEventType wxEVT_MENU_INIT
;
157 extern const wxEventType wxEVT_MENU_HIGHLIGHT
;
158 extern const wxEventType wxEVT_POPUP_MENU_INIT
;
159 extern const wxEventType wxEVT_CONTEXT_MENU
;
160 extern const wxEventType wxEVT_SYS_COLOUR_CHANGED
;
161 extern const wxEventType wxEVT_SETTING_CHANGED
;
162 extern const wxEventType wxEVT_QUERY_NEW_PALETTE
;
163 extern const wxEventType wxEVT_PALETTE_CHANGED
;
164 extern const wxEventType wxEVT_JOY_BUTTON_DOWN
;
165 extern const wxEventType wxEVT_JOY_BUTTON_UP
;
166 extern const wxEventType wxEVT_JOY_MOVE
;
167 extern const wxEventType wxEVT_JOY_ZMOVE
;
168 extern const wxEventType wxEVT_DROP_FILES
;
169 extern const wxEventType wxEVT_DRAW_ITEM
;
170 extern const wxEventType wxEVT_MEASURE_ITEM
;
171 extern const wxEventType wxEVT_COMPARE_ITEM
;
172 extern const wxEventType wxEVT_INIT_DIALOG
;
173 extern const wxEventType wxEVT_IDLE
;
174 extern const wxEventType wxEVT_UPDATE_UI
;
177 extern const wxEventType wxEVT_END_PROCESS
;
180 extern const wxEventType wxEVT_DIALUP_CONNECTED
;
181 extern const wxEventType wxEVT_DIALUP_DISCONNECTED
;
183 /* Generic command events */
184 /* Note: a click is a higher-level event than button down/up */
185 extern const wxEventType wxEVT_COMMAND_LEFT_CLICK
;
186 extern const wxEventType wxEVT_COMMAND_LEFT_DCLICK
;
187 extern const wxEventType wxEVT_COMMAND_RIGHT_CLICK
;
188 extern const wxEventType wxEVT_COMMAND_RIGHT_DCLICK
;
189 extern const wxEventType wxEVT_COMMAND_SET_FOCUS
;
190 extern const wxEventType wxEVT_COMMAND_KILL_FOCUS
;
191 extern const wxEventType wxEVT_COMMAND_ENTER
;
193 /* Tree control event types */
194 extern const wxEventType wxEVT_COMMAND_TREE_BEGIN_DRAG
;
195 extern const wxEventType wxEVT_COMMAND_TREE_BEGIN_RDRAG
;
196 extern const wxEventType wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT
;
197 extern const wxEventType wxEVT_COMMAND_TREE_END_LABEL_EDIT
;
198 extern const wxEventType wxEVT_COMMAND_TREE_DELETE_ITEM
;
199 extern const wxEventType wxEVT_COMMAND_TREE_GET_INFO
;
200 extern const wxEventType wxEVT_COMMAND_TREE_SET_INFO
;
201 extern const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDED
;
202 extern const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDING
;
203 extern const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSED
;
204 extern const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSING
;
205 extern const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGED
;
206 extern const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGING
;
207 extern const wxEventType wxEVT_COMMAND_TREE_KEY_DOWN
;
208 extern const wxEventType wxEVT_COMMAND_TREE_ITEM_ACTIVATED
;
209 extern const wxEventType wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK
;
210 extern const wxEventType wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK
;
212 /* List control event types */
213 extern const wxEventType wxEVT_COMMAND_LIST_BEGIN_DRAG
;
214 extern const wxEventType wxEVT_COMMAND_LIST_BEGIN_RDRAG
;
215 extern const wxEventType wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT
;
216 extern const wxEventType wxEVT_COMMAND_LIST_END_LABEL_EDIT
;
217 extern const wxEventType wxEVT_COMMAND_LIST_DELETE_ITEM
;
218 extern const wxEventType wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS
;
219 extern const wxEventType wxEVT_COMMAND_LIST_GET_INFO
;
220 extern const wxEventType wxEVT_COMMAND_LIST_SET_INFO
;
221 extern const wxEventType wxEVT_COMMAND_LIST_ITEM_SELECTED
;
222 extern const wxEventType wxEVT_COMMAND_LIST_ITEM_DESELECTED
;
223 extern const wxEventType wxEVT_COMMAND_LIST_KEY_DOWN
;
224 extern const wxEventType wxEVT_COMMAND_LIST_INSERT_ITEM
;
225 extern const wxEventType wxEVT_COMMAND_LIST_COL_CLICK
;
226 extern const wxEventType wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK
;
227 extern const wxEventType wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK
;
228 extern const wxEventType wxEVT_COMMAND_LIST_ITEM_ACTIVATED
;
230 /* Tab and notebook control event types */
231 extern const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGED
;
232 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
;
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
;
244 extern const wxEventType wxEVT_WIZARD_PAGE_CHANGED
;
245 extern const wxEventType wxEVT_WIZARD_PAGE_CHANGING
;
246 extern const wxEventType wxEVT_WIZARD_CANCEL
;
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
;
256 extern const wxEventType wxEVT_USER_FIRST
;
258 #else // everybody else
260 const wxEventType wxEVT_NULL
= 0;
261 const wxEventType wxEVT_FIRST
= 10000;
263 const wxEventType wxEVT_COMMAND_BUTTON_CLICKED
= wxEVT_FIRST
+ 1;
264 const wxEventType wxEVT_COMMAND_CHECKBOX_CLICKED
= wxEVT_FIRST
+ 2;
265 const wxEventType wxEVT_COMMAND_CHOICE_SELECTED
= wxEVT_FIRST
+ 3;
266 const wxEventType wxEVT_COMMAND_LISTBOX_SELECTED
= wxEVT_FIRST
+ 4;
267 const wxEventType wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
= wxEVT_FIRST
+ 5;
268 const wxEventType wxEVT_COMMAND_CHECKLISTBOX_TOGGLED
= wxEVT_FIRST
+ 6;
269 const wxEventType wxEVT_COMMAND_TEXT_UPDATED
= wxEVT_FIRST
+ 7;
270 const wxEventType wxEVT_COMMAND_TEXT_ENTER
= wxEVT_FIRST
+ 8;
271 const wxEventType wxEVT_COMMAND_MENU_SELECTED
= wxEVT_FIRST
+ 9;
272 const wxEventType wxEVT_COMMAND_TOOL_CLICKED
= wxEVT_COMMAND_MENU_SELECTED
;
273 const wxEventType wxEVT_COMMAND_SLIDER_UPDATED
= wxEVT_FIRST
+ 10;
274 const wxEventType wxEVT_COMMAND_RADIOBOX_SELECTED
= wxEVT_FIRST
+ 11;
275 const wxEventType wxEVT_COMMAND_RADIOBUTTON_SELECTED
= wxEVT_FIRST
+ 12;
276 //const wxEventType wxEVT_COMMAND_SCROLLBAR_UPDATED is now obsolete since we use wxEVT_SCROLL... events
277 const wxEventType wxEVT_COMMAND_SCROLLBAR_UPDATED
= wxEVT_FIRST
+ 13;
278 const wxEventType wxEVT_COMMAND_VLBOX_SELECTED
= wxEVT_FIRST
+ 14;
279 const wxEventType wxEVT_COMMAND_COMBOBOX_SELECTED
= wxEVT_FIRST
+ 15;
280 const wxEventType wxEVT_COMMAND_TOOL_RCLICKED
= wxEVT_FIRST
+ 16;
281 const wxEventType wxEVT_COMMAND_TOOL_ENTER
= wxEVT_FIRST
+ 17;
282 const wxEventType wxEVT_COMMAND_SPINCTRL_UPDATED
= wxEVT_FIRST
+ 18;
284 /* Sockets send events, too */
285 const wxEventType wxEVT_SOCKET
= wxEVT_FIRST
+ 50;
287 /* Mouse event types */
288 const wxEventType wxEVT_LEFT_DOWN
= wxEVT_FIRST
+ 100;
289 const wxEventType wxEVT_LEFT_UP
= wxEVT_FIRST
+ 101;
290 const wxEventType wxEVT_MIDDLE_DOWN
= wxEVT_FIRST
+ 102;
291 const wxEventType wxEVT_MIDDLE_UP
= wxEVT_FIRST
+ 103;
292 const wxEventType wxEVT_RIGHT_DOWN
= wxEVT_FIRST
+ 104;
293 const wxEventType wxEVT_RIGHT_UP
= wxEVT_FIRST
+ 105;
294 const wxEventType wxEVT_MOTION
= wxEVT_FIRST
+ 106;
295 const wxEventType wxEVT_ENTER_WINDOW
= wxEVT_FIRST
+ 107;
296 const wxEventType wxEVT_LEAVE_WINDOW
= wxEVT_FIRST
+ 108;
297 const wxEventType wxEVT_LEFT_DCLICK
= wxEVT_FIRST
+ 109;
298 const wxEventType wxEVT_MIDDLE_DCLICK
= wxEVT_FIRST
+ 110;
299 const wxEventType wxEVT_RIGHT_DCLICK
= wxEVT_FIRST
+ 111;
300 const wxEventType wxEVT_SET_FOCUS
= wxEVT_FIRST
+ 112;
301 const wxEventType wxEVT_KILL_FOCUS
= wxEVT_FIRST
+ 113;
303 /* Non-client mouse events */
304 const wxEventType wxEVT_NC_LEFT_DOWN
= wxEVT_FIRST
+ 200;
305 const wxEventType wxEVT_NC_LEFT_UP
= wxEVT_FIRST
+ 201;
306 const wxEventType wxEVT_NC_MIDDLE_DOWN
= wxEVT_FIRST
+ 202;
307 const wxEventType wxEVT_NC_MIDDLE_UP
= wxEVT_FIRST
+ 203;
308 const wxEventType wxEVT_NC_RIGHT_DOWN
= wxEVT_FIRST
+ 204;
309 const wxEventType wxEVT_NC_RIGHT_UP
= wxEVT_FIRST
+ 205;
310 const wxEventType wxEVT_NC_MOTION
= wxEVT_FIRST
+ 206;
311 const wxEventType wxEVT_NC_ENTER_WINDOW
= wxEVT_FIRST
+ 207;
312 const wxEventType wxEVT_NC_LEAVE_WINDOW
= wxEVT_FIRST
+ 208;
313 const wxEventType wxEVT_NC_LEFT_DCLICK
= wxEVT_FIRST
+ 209;
314 const wxEventType wxEVT_NC_MIDDLE_DCLICK
= wxEVT_FIRST
+ 210;
315 const wxEventType wxEVT_NC_RIGHT_DCLICK
= wxEVT_FIRST
+ 211;
317 /* Character input event type */
318 const wxEventType wxEVT_CHAR
= wxEVT_FIRST
+ 212;
319 const wxEventType wxEVT_CHAR_HOOK
= wxEVT_FIRST
+ 213;
320 const wxEventType wxEVT_NAVIGATION_KEY
= wxEVT_FIRST
+ 214;
321 const wxEventType wxEVT_KEY_DOWN
= wxEVT_FIRST
+ 215;
322 const wxEventType wxEVT_KEY_UP
= wxEVT_FIRST
+ 216;
325 * wxScrollbar and wxSlider event identifiers
327 const wxEventType wxEVT_SCROLL_TOP
= wxEVT_FIRST
+ 300;
328 const wxEventType wxEVT_SCROLL_BOTTOM
= wxEVT_FIRST
+ 301;
329 const wxEventType wxEVT_SCROLL_LINEUP
= wxEVT_FIRST
+ 302;
330 const wxEventType wxEVT_SCROLL_LINEDOWN
= wxEVT_FIRST
+ 303;
331 const wxEventType wxEVT_SCROLL_PAGEUP
= wxEVT_FIRST
+ 304;
332 const wxEventType wxEVT_SCROLL_PAGEDOWN
= wxEVT_FIRST
+ 305;
333 const wxEventType wxEVT_SCROLL_THUMBTRACK
= wxEVT_FIRST
+ 306;
336 * Scroll events from wxWindow
338 const wxEventType wxEVT_SCROLLWIN_TOP
= wxEVT_FIRST
+ 320;
339 const wxEventType wxEVT_SCROLLWIN_BOTTOM
= wxEVT_FIRST
+ 321;
340 const wxEventType wxEVT_SCROLLWIN_LINEUP
= wxEVT_FIRST
+ 322;
341 const wxEventType wxEVT_SCROLLWIN_LINEDOWN
= wxEVT_FIRST
+ 323;
342 const wxEventType wxEVT_SCROLLWIN_PAGEUP
= wxEVT_FIRST
+ 324;
343 const wxEventType wxEVT_SCROLLWIN_PAGEDOWN
= wxEVT_FIRST
+ 325;
344 const wxEventType wxEVT_SCROLLWIN_THUMBTRACK
= wxEVT_FIRST
+ 326;
349 const wxEventType wxEVT_SIZE
= wxEVT_FIRST
+ 400;
350 const wxEventType wxEVT_MOVE
= wxEVT_FIRST
+ 401;
351 const wxEventType wxEVT_CLOSE_WINDOW
= wxEVT_FIRST
+ 402;
352 const wxEventType wxEVT_END_SESSION
= wxEVT_FIRST
+ 403;
353 const wxEventType wxEVT_QUERY_END_SESSION
= wxEVT_FIRST
+ 404;
354 const wxEventType wxEVT_ACTIVATE_APP
= wxEVT_FIRST
+ 405;
355 const wxEventType wxEVT_POWER
= wxEVT_FIRST
+ 406;
356 const wxEventType wxEVT_ACTIVATE
= wxEVT_FIRST
+ 409;
357 const wxEventType wxEVT_CREATE
= wxEVT_FIRST
+ 410;
358 const wxEventType wxEVT_DESTROY
= wxEVT_FIRST
+ 411;
359 const wxEventType wxEVT_SHOW
= wxEVT_FIRST
+ 412;
360 const wxEventType wxEVT_ICONIZE
= wxEVT_FIRST
+ 413;
361 const wxEventType wxEVT_MAXIMIZE
= wxEVT_FIRST
+ 414;
362 const wxEventType wxEVT_MOUSE_CAPTURE_CHANGED
= wxEVT_FIRST
+ 415;
363 const wxEventType wxEVT_PAINT
= wxEVT_FIRST
+ 416;
364 const wxEventType wxEVT_ERASE_BACKGROUND
= wxEVT_FIRST
+ 417;
365 const wxEventType wxEVT_NC_PAINT
= wxEVT_FIRST
+ 418;
366 const wxEventType wxEVT_PAINT_ICON
= wxEVT_FIRST
+ 419;
367 const wxEventType wxEVT_MENU_CHAR
= wxEVT_FIRST
+ 420;
368 const wxEventType wxEVT_MENU_INIT
= wxEVT_FIRST
+ 421;
369 const wxEventType wxEVT_MENU_HIGHLIGHT
= wxEVT_FIRST
+ 422;
370 const wxEventType wxEVT_POPUP_MENU_INIT
= wxEVT_FIRST
+ 423;
371 const wxEventType wxEVT_CONTEXT_MENU
= wxEVT_FIRST
+ 424;
372 const wxEventType wxEVT_SYS_COLOUR_CHANGED
= wxEVT_FIRST
+ 425;
373 const wxEventType wxEVT_SETTING_CHANGED
= wxEVT_FIRST
+ 426;
374 const wxEventType wxEVT_QUERY_NEW_PALETTE
= wxEVT_FIRST
+ 427;
375 const wxEventType wxEVT_PALETTE_CHANGED
= wxEVT_FIRST
+ 428;
376 const wxEventType wxEVT_JOY_BUTTON_DOWN
= wxEVT_FIRST
+ 429;
377 const wxEventType wxEVT_JOY_BUTTON_UP
= wxEVT_FIRST
+ 430;
378 const wxEventType wxEVT_JOY_MOVE
= wxEVT_FIRST
+ 431;
379 const wxEventType wxEVT_JOY_ZMOVE
= wxEVT_FIRST
+ 432;
380 const wxEventType wxEVT_DROP_FILES
= wxEVT_FIRST
+ 433;
381 const wxEventType wxEVT_DRAW_ITEM
= wxEVT_FIRST
+ 434;
382 const wxEventType wxEVT_MEASURE_ITEM
= wxEVT_FIRST
+ 435;
383 const wxEventType wxEVT_COMPARE_ITEM
= wxEVT_FIRST
+ 436;
384 const wxEventType wxEVT_INIT_DIALOG
= wxEVT_FIRST
+ 437;
385 const wxEventType wxEVT_IDLE
= wxEVT_FIRST
+ 438;
386 const wxEventType wxEVT_UPDATE_UI
= wxEVT_FIRST
+ 439;
389 const wxEventType wxEVT_END_PROCESS
= wxEVT_FIRST
+ 440;
392 const wxEventType wxEVT_DIALUP_CONNECTED
= wxEVT_FIRST
+ 450;
393 const wxEventType wxEVT_DIALUP_DISCONNECTED
= wxEVT_FIRST
+ 451;
395 /* Generic command events */
396 /* Note: a click is a higher-level event than button down/up */
397 const wxEventType wxEVT_COMMAND_LEFT_CLICK
= wxEVT_FIRST
+ 500;
398 const wxEventType wxEVT_COMMAND_LEFT_DCLICK
= wxEVT_FIRST
+ 501;
399 const wxEventType wxEVT_COMMAND_RIGHT_CLICK
= wxEVT_FIRST
+ 502;
400 const wxEventType wxEVT_COMMAND_RIGHT_DCLICK
= wxEVT_FIRST
+ 503;
401 const wxEventType wxEVT_COMMAND_SET_FOCUS
= wxEVT_FIRST
+ 504;
402 const wxEventType wxEVT_COMMAND_KILL_FOCUS
= wxEVT_FIRST
+ 505;
403 const wxEventType wxEVT_COMMAND_ENTER
= wxEVT_FIRST
+ 506;
405 /* Tree control event types */
406 const wxEventType wxEVT_COMMAND_TREE_BEGIN_DRAG
= wxEVT_FIRST
+ 600;
407 const wxEventType wxEVT_COMMAND_TREE_BEGIN_RDRAG
= wxEVT_FIRST
+ 601;
408 const wxEventType wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT
= wxEVT_FIRST
+ 602;
409 const wxEventType wxEVT_COMMAND_TREE_END_LABEL_EDIT
= wxEVT_FIRST
+ 603;
410 const wxEventType wxEVT_COMMAND_TREE_DELETE_ITEM
= wxEVT_FIRST
+ 604;
411 const wxEventType wxEVT_COMMAND_TREE_GET_INFO
= wxEVT_FIRST
+ 605;
412 const wxEventType wxEVT_COMMAND_TREE_SET_INFO
= wxEVT_FIRST
+ 606;
413 const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDED
= wxEVT_FIRST
+ 607;
414 const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDING
= wxEVT_FIRST
+ 608;
415 const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSED
= wxEVT_FIRST
+ 609;
416 const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSING
= wxEVT_FIRST
+ 610;
417 const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGED
= wxEVT_FIRST
+ 611;
418 const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGING
= wxEVT_FIRST
+ 612;
419 const wxEventType wxEVT_COMMAND_TREE_KEY_DOWN
= wxEVT_FIRST
+ 613;
420 const wxEventType wxEVT_COMMAND_TREE_ITEM_ACTIVATED
= wxEVT_FIRST
+ 614;
421 const wxEventType wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK
= wxEVT_FIRST
+ 615;
422 const wxEventType wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK
= wxEVT_FIRST
+ 616;
424 /* List control event types */
425 const wxEventType wxEVT_COMMAND_LIST_BEGIN_DRAG
= wxEVT_FIRST
+ 700;
426 const wxEventType wxEVT_COMMAND_LIST_BEGIN_RDRAG
= wxEVT_FIRST
+ 701;
427 const wxEventType wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT
= wxEVT_FIRST
+ 702;
428 const wxEventType wxEVT_COMMAND_LIST_END_LABEL_EDIT
= wxEVT_FIRST
+ 703;
429 const wxEventType wxEVT_COMMAND_LIST_DELETE_ITEM
= wxEVT_FIRST
+ 704;
430 const wxEventType wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS
= wxEVT_FIRST
+ 705;
431 const wxEventType wxEVT_COMMAND_LIST_GET_INFO
= wxEVT_FIRST
+ 706;
432 const wxEventType wxEVT_COMMAND_LIST_SET_INFO
= wxEVT_FIRST
+ 707;
433 const wxEventType wxEVT_COMMAND_LIST_ITEM_SELECTED
= wxEVT_FIRST
+ 708;
434 const wxEventType wxEVT_COMMAND_LIST_ITEM_DESELECTED
= wxEVT_FIRST
+ 709;
435 const wxEventType wxEVT_COMMAND_LIST_KEY_DOWN
= wxEVT_FIRST
+ 710;
436 const wxEventType wxEVT_COMMAND_LIST_INSERT_ITEM
= wxEVT_FIRST
+ 711;
437 const wxEventType wxEVT_COMMAND_LIST_COL_CLICK
= wxEVT_FIRST
+ 712;
438 const wxEventType wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK
= wxEVT_FIRST
+ 713;
439 const wxEventType wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK
= wxEVT_FIRST
+ 714;
440 const wxEventType wxEVT_COMMAND_LIST_ITEM_ACTIVATED
= wxEVT_FIRST
+ 715;
442 /* Tab and notebook control event types */
443 const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGED
= wxEVT_FIRST
+ 800;
444 const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGING
= wxEVT_FIRST
+ 801;
446 #if defined(__BORLANDC__) && defined(__WIN16__)
447 /* For 16-bit BC++, these 2 are identical (truncated) */
448 const wxEventType wxEVT_COMMAND_NB_PAGE_CHANGED
= wxEVT_FIRST
+ 802;
449 const wxEventType wxEVT_COMMAND_NB_PAGE_CHANGING
= wxEVT_FIRST
+ 803;
451 const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
= wxEVT_FIRST
+ 802;
452 const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
= wxEVT_FIRST
+ 803;
455 /* Splitter events */
456 const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED
= wxEVT_FIRST
+ 850;
457 const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING
= wxEVT_FIRST
+ 851;
458 const wxEventType wxEVT_COMMAND_SPLITTER_DOUBLECLICKED
= wxEVT_FIRST
+ 852;
459 const wxEventType wxEVT_COMMAND_SPLITTER_UNSPLIT
= wxEVT_FIRST
+ 853;
462 const wxEventType wxEVT_WIZARD_PAGE_CHANGED
= wxEVT_FIRST
+ 900;
463 const wxEventType wxEVT_WIZARD_PAGE_CHANGING
= wxEVT_FIRST
+ 901;
464 const wxEventType wxEVT_WIZARD_CANCEL
= wxEVT_FIRST
+ 902;
466 /* Calendar events */
467 const wxEventType wxEVT_CALENDAR_SEL_CHANGED
= wxEVT_FIRST
+ 950;
468 const wxEventType wxEVT_CALENDAR_DAY_CHANGED
= wxEVT_FIRST
+ 951;
469 const wxEventType wxEVT_CALENDAR_MONTH_CHANGED
= wxEVT_FIRST
+ 952;
470 const wxEventType wxEVT_CALENDAR_YEAR_CHANGED
= wxEVT_FIRST
+ 953;
471 const wxEventType wxEVT_CALENDAR_DOUBLECLICKED
= wxEVT_FIRST
+ 954;
472 const wxEventType wxEVT_CALENDAR_WEEKDAY_CLICKED
= wxEVT_FIRST
+ 955;
474 const wxEventType wxEVT_USER_FIRST
= wxEVT_FIRST
+ 2000;
476 #endif // for VisualAge C++ V4.0
480 #if WXWIN_COMPATIBILITY
482 #define wxEVENT_TYPE_BUTTON_COMMAND wxEVT_COMMAND_BUTTON_CLICKED
483 #define wxEVENT_TYPE_CHECKBOX_COMMAND wxEVT_COMMAND_CHECKBOX_CLICKED
484 #define wxEVENT_TYPE_CHOICE_COMMAND wxEVT_COMMAND_CHOICE_SELECTED
485 #define wxEVENT_TYPE_LISTBOX_COMMAND wxEVT_COMMAND_LISTBOX_SELECTED
486 #define wxEVENT_TYPE_LISTBOX_DCLICK_COMMAND wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
487 #define wxEVENT_TYPE_TEXT_COMMAND wxEVT_COMMAND_TEXT_UPDATED
488 #define wxEVENT_TYPE_MULTITEXT_COMMAND wxEVT_COMMAND_TEXT_UPDATED
489 #define wxEVENT_TYPE_MENU_COMMAND wxEVT_COMMAND_MENU_SELECTED
490 #define wxEVENT_TYPE_SLIDER_COMMAND wxEVT_COMMAND_SLIDER_UPDATED
491 #define wxEVENT_TYPE_RADIOBOX_COMMAND wxEVT_COMMAND_RADIOBOX_SELECTED
492 #define wxEVENT_TYPE_RADIOBUTTON_COMMAND wxEVT_COMMAND_RADIOBUTTON_SELECTED
493 #define wxEVENT_TYPE_TEXT_ENTER_COMMAND wxEVT_COMMAND_TEXT_ENTER
494 #define wxEVENT_TYPE_SET_FOCUS wxEVT_SET_FOCUS
495 #define wxEVENT_TYPE_KILL_FOCUS wxEVT_KILL_FOCUS
496 #define wxEVENT_TYPE_SCROLLBAR_COMMAND wxEVT_COMMAND_SCROLLBAR_UPDATED
497 #define wxEVENT_TYPE_VIRT_LISTBOX_COMMAND wxEVT_COMMAND_VLBOX_SELECTED
498 #define wxEVENT_TYPE_COMBOBOX_COMMAND wxEVT_COMMAND_COMBOBOX_SELECTED
500 #define wxEVENT_TYPE_LEFT_DOWN wxEVT_LEFT_DOWN
501 #define wxEVENT_TYPE_LEFT_UP wxEVT_LEFT_UP
502 #define wxEVENT_TYPE_MIDDLE_DOWN wxEVT_MIDDLE_DOWN
503 #define wxEVENT_TYPE_MIDDLE_UP wxEVT_MIDDLE_UP
504 #define wxEVENT_TYPE_RIGHT_DOWN wxEVT_RIGHT_DOWN
505 #define wxEVENT_TYPE_RIGHT_UP wxEVT_RIGHT_UP
506 #define wxEVENT_TYPE_MOTION wxEVT_MOTION
507 #define wxEVENT_TYPE_ENTER_WINDOW wxEVT_ENTER_WINDOW
508 #define wxEVENT_TYPE_LEAVE_WINDOW wxEVT_LEAVE_WINDOW
509 #define wxEVENT_TYPE_LEFT_DCLICK wxEVT_LEFT_DCLICK
510 #define wxEVENT_TYPE_MIDDLE_DCLICK wxEVT_MIDDLE_DCLICK
511 #define wxEVENT_TYPE_RIGHT_DCLICK wxEVT_RIGHT_DCLICK
512 #define wxEVENT_TYPE_CHAR wxEVT_CHAR
513 #define wxEVENT_TYPE_SCROLL_TOP wxEVT_SCROLL_TOP
514 #define wxEVENT_TYPE_SCROLL_BOTTOM wxEVT_SCROLL_BOTTOM
515 #define wxEVENT_TYPE_SCROLL_LINEUP wxEVT_SCROLL_LINEUP
516 #define wxEVENT_TYPE_SCROLL_LINEDOWN wxEVT_SCROLL_LINEDOWN
517 #define wxEVENT_TYPE_SCROLL_PAGEUP wxEVT_SCROLL_PAGEUP
518 #define wxEVENT_TYPE_SCROLL_PAGEDOWN wxEVT_SCROLL_PAGEDOWN
519 #define wxEVENT_TYPE_SCROLL_THUMBTRACK wxEVT_SCROLL_THUMBTRACK
521 #endif // WXWIN_COMPATIBILITY
524 * wxWindows events, covering all interesting things that might happen
525 * (button clicking, resizing, setting text in widgets, etc.).
527 * For each completely new event type, derive a new event class.
528 * An event CLASS represents a C++ class defining a range of similar event TYPES;
529 * examples are canvas events, panel item command events.
530 * An event TYPE is a unique identifier for a particular system event,
531 * such as a button press or a listbox deselection.
535 class WXDLLEXPORT wxEvent
: public wxObject
537 DECLARE_ABSTRACT_CLASS(wxEvent
)
543 void SetEventType(wxEventType typ
) { m_eventType
= typ
; }
544 wxEventType
GetEventType() const { return m_eventType
; }
545 wxObject
*GetEventObject() const { return m_eventObject
; }
546 void SetEventObject(wxObject
*obj
) { m_eventObject
= obj
; }
547 long GetTimestamp() const { return m_timeStamp
; }
548 void SetTimestamp(long ts
= 0) { m_timeStamp
= ts
; }
549 int GetId() const { return m_id
; }
550 void SetId(int Id
) { m_id
= Id
; }
552 // Can instruct event processor that we wish to ignore this event
553 // (treat as if the event table entry had not been found): this must be done
554 // to allow the event processing by the base classes (calling event.Skip()
555 // is the analog of calling the base class verstion of a virtual function)
556 void Skip(bool skip
= TRUE
) { m_skipped
= skip
; }
557 bool GetSkipped() const { return m_skipped
; };
559 // implementation only: this test is explicitlty anti OO and this functions
560 // exists only for optimization purposes
561 bool IsCommandEvent() const { return m_isCommandEvent
; }
563 void CopyObject(wxObject
& object_dest
) const;
566 wxObject
* m_eventObject
;
567 wxEventType m_eventType
;
570 wxObject
* m_callbackUserData
;
573 // optimization: instead of using costly IsKindOf() we keep a flag telling
574 // whether we're a command event (by far the most common case)
575 bool m_isCommandEvent
;
580 // Item or menu event class
582 wxEVT_COMMAND_BUTTON_CLICKED
583 wxEVT_COMMAND_CHECKBOX_CLICKED
584 wxEVT_COMMAND_CHOICE_SELECTED
585 wxEVT_COMMAND_LISTBOX_SELECTED
586 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
587 wxEVT_COMMAND_TEXT_UPDATED
588 wxEVT_COMMAND_TEXT_ENTER
589 wxEVT_COMMAND_MENU_SELECTED
590 wxEVT_COMMAND_SLIDER_UPDATED
591 wxEVT_COMMAND_RADIOBOX_SELECTED
592 wxEVT_COMMAND_RADIOBUTTON_SELECTED
593 wxEVT_COMMAND_SCROLLBAR_UPDATED
594 wxEVT_COMMAND_VLBOX_SELECTED
595 wxEVT_COMMAND_COMBOBOX_SELECTED
598 class WXDLLEXPORT wxCommandEvent
: public wxEvent
600 DECLARE_DYNAMIC_CLASS(wxCommandEvent
)
603 wxCommandEvent(wxEventType commandType
= wxEVT_NULL
, int id
= 0);
607 * Accessors dependent on context
611 // Set/Get client data from controls
612 void SetClientData(void* clientData
) { m_clientData
= clientData
; }
613 void *GetClientData() const { return m_clientData
; }
615 // Set/Get client object from controls
616 void SetClientObject(wxClientData
* clientObject
) { m_clientObject
= clientObject
; }
617 void *GetClientObject() const { return m_clientObject
; }
619 // Get listbox selection if single-choice
620 int GetSelection() const { return m_commandInt
; }
622 // Set/Get listbox/choice selection string
623 void SetString(const wxString
& s
) { m_commandString
= s
; }
624 wxString
GetString() const { return m_commandString
; }
626 // Get checkbox value
627 bool Checked() const { return (m_commandInt
!= 0); }
629 // TRUE if the listbox event was a selection.
630 bool IsSelection() const { return (m_extraLong
!= 0); }
632 void SetExtraLong(long extraLong
) { m_extraLong
= extraLong
; }
633 long GetExtraLong() const { return m_extraLong
; }
635 void SetInt(int i
) { m_commandInt
= i
; }
636 long GetInt() const { return m_commandInt
; }
638 void CopyObject(wxObject
& obj
) const;
641 wxString m_commandString
; // String event argument
643 long m_extraLong
; // Additional information (e.g. select/deselect)
644 void* m_clientData
; // Arbitrary client data
645 wxClientData
* m_clientObject
; // Arbitrary client object
648 // this class adds a possibility to react (from the user) code to a control
649 // notification: allow or veto the operation being reported.
650 class WXDLLEXPORT wxNotifyEvent
: public wxCommandEvent
653 wxNotifyEvent(wxEventType commandType
= wxEVT_NULL
, int id
= 0)
654 : wxCommandEvent(commandType
, id
) { m_bAllow
= TRUE
; }
656 // veto the operation (by default it's allowed)
657 void Veto() { m_bAllow
= FALSE
; }
659 // for implementation code only: is the operation allowed?
660 bool IsAllowed() const { return m_bAllow
; }
662 // probably useless: CopyObject() is used for deferred event
663 // handling but wxNotifyEvent must be processed immediately
664 void CopyObject(wxObject
& obj
) const;
669 DECLARE_DYNAMIC_CLASS(wxNotifyEvent
)
672 // Scroll event class, derived form wxCommandEvent. wxScrollEvents are
673 // sent by wxSlider and wxScrollbar.
678 wxEVT_SCROLL_LINEDOWN
680 wxEVT_SCROLL_PAGEDOWN
681 wxEVT_SCROLL_THUMBTRACK
684 class WXDLLEXPORT wxScrollEvent
: public wxCommandEvent
686 DECLARE_DYNAMIC_CLASS(wxScrollEvent
)
689 wxScrollEvent(wxEventType commandType
= wxEVT_NULL
,
690 int id
= 0, int pos
= 0, int orient
= 0);
698 int GetOrientation() const { return (int) m_extraLong
; }
699 int GetPosition() const { return m_commandInt
; }
700 bool IsScrolling() const { return m_isScrolling
; }
701 void SetOrientation(int orient
) { m_extraLong
= (long) orient
; }
702 void SetPosition(int pos
) { m_commandInt
= pos
; }
703 void SetScrolling(bool isScrolling
) { m_isScrolling
= isScrolling
; }
705 void CopyObject(wxObject
& obj
) const;
710 // ScrollWin event class, derived fom wxEvent. wxScrollWinEvents
711 // are sent by wxWindow.
714 wxEVT_SCROLLWIN_BOTTOM
715 wxEVT_SCROLLWIN_LINEUP
716 wxEVT_SCROLLWIN_LINEDOWN
717 wxEVT_SCROLLWIN_PAGEUP
718 wxEVT_SCROLLWIN_PAGEDOWN
719 wxEVT_SCROLLWIN_THUMBTRACK
722 class WXDLLEXPORT wxScrollWinEvent
: public wxEvent
724 DECLARE_DYNAMIC_CLASS(wxScrollWinEvent
)
727 wxScrollWinEvent(wxEventType commandType
= wxEVT_NULL
,
728 int pos
= 0, int orient
= 0);
729 ~wxScrollWinEvent() {}
735 int GetOrientation() const { return (int) m_extraLong
; }
736 int GetPosition() const { return m_commandInt
; }
737 bool IsScrolling() const { return m_isScrolling
; }
738 void SetOrientation(int orient
) { m_extraLong
= (long) orient
; }
739 void SetPosition(int pos
) { m_commandInt
= pos
; }
740 void SetScrolling(bool isScrolling
) { m_isScrolling
= isScrolling
; }
742 void CopyObject(wxObject
& object_dest
) const;
744 int m_commandInt
; // Additional information
766 wxEVT_NC_MIDDLE_DOWN,
771 wxEVT_NC_ENTER_WINDOW,
772 wxEVT_NC_LEAVE_WINDOW,
773 wxEVT_NC_LEFT_DCLICK,
774 wxEVT_NC_MIDDLE_DCLICK,
775 wxEVT_NC_RIGHT_DCLICK,
778 class WXDLLEXPORT wxMouseEvent
: public wxEvent
780 DECLARE_DYNAMIC_CLASS(wxMouseEvent
)
783 wxMouseEvent(wxEventType mouseType
= wxEVT_NULL
);
785 // Was it a button event? (*doesn't* mean: is any button *down*?)
786 bool IsButton() const { return Button(-1); }
788 // Was it a down event from button 1, 2 or 3 or any?
789 bool ButtonDown(int but
= -1) const;
791 // Was it a dclick event from button 1, 2 or 3 or any?
792 bool ButtonDClick(int but
= -1) const;
794 // Was it a up event from button 1, 2 or 3 or any?
795 bool ButtonUp(int but
= -1) const;
797 // Was the given button 1,2,3 or any changing state?
798 bool Button(int but
) const;
800 // Was the given button 1,2,3 or any in Down state?
801 bool ButtonIsDown(int but
) const;
803 // Find state of shift/control keys
804 bool ControlDown() const { return m_controlDown
; }
805 bool MetaDown() const { return m_metaDown
; }
806 bool AltDown() const { return m_altDown
; }
807 bool ShiftDown() const { return m_shiftDown
; }
809 // Find which event was just generated
810 bool LeftDown() const { return (m_eventType
== wxEVT_LEFT_DOWN
); }
811 bool MiddleDown() const { return (m_eventType
== wxEVT_MIDDLE_DOWN
); }
812 bool RightDown() const { return (m_eventType
== wxEVT_RIGHT_DOWN
); }
814 bool LeftUp() const { return (m_eventType
== wxEVT_LEFT_UP
); }
815 bool MiddleUp() const { return (m_eventType
== wxEVT_MIDDLE_UP
); }
816 bool RightUp() const { return (m_eventType
== wxEVT_RIGHT_UP
); }
818 bool LeftDClick() const { return (m_eventType
== wxEVT_LEFT_DCLICK
); }
819 bool MiddleDClick() const { return (m_eventType
== wxEVT_MIDDLE_DCLICK
); }
820 bool RightDClick() const { return (m_eventType
== wxEVT_RIGHT_DCLICK
); }
822 // Find the current state of the mouse buttons (regardless
823 // of current event type)
824 bool LeftIsDown() const { return m_leftDown
; }
825 bool MiddleIsDown() const { return m_middleDown
; }
826 bool RightIsDown() const { return m_rightDown
; }
828 // True if a button is down and the mouse is moving
829 bool Dragging() const
831 return ((m_eventType
== wxEVT_MOTION
) &&
832 (LeftIsDown() || MiddleIsDown() || RightIsDown()));
835 // True if the mouse is moving, and no button is down
836 bool Moving() const { return (m_eventType
== wxEVT_MOTION
); }
838 // True if the mouse is just entering the window
839 bool Entering() const { return (m_eventType
== wxEVT_ENTER_WINDOW
); }
841 // True if the mouse is just leaving the window
842 bool Leaving() const { return (m_eventType
== wxEVT_LEAVE_WINDOW
); }
844 // Find the position of the event
845 void GetPosition(wxCoord
*xpos
, wxCoord
*ypos
) const
854 void GetPosition(long *xpos
, long *ypos
) const
863 // Find the position of the event
864 wxPoint
GetPosition() const { return wxPoint(m_x
, m_y
); }
866 // Find the logical position of the event given the DC
867 wxPoint
GetLogicalPosition(const wxDC
& dc
) const ;
870 #if WXWIN_COMPATIBILITY
871 void Position(long *xpos
, long *ypos
) const
879 void Position(float *xpos
, float *ypos
) const
881 *xpos
= (float) m_x
; *ypos
= (float) m_y
;
883 #endif // WXWIN_COMPATIBILITY
886 long GetX() const { return m_x
; }
889 long GetY() const { return m_y
; }
891 void CopyObject(wxObject
& obj
) const;
906 // Keyboard input event class
915 class WXDLLEXPORT wxKeyEvent
: public wxEvent
917 DECLARE_DYNAMIC_CLASS(wxKeyEvent
)
920 wxKeyEvent(wxEventType keyType
= wxEVT_NULL
);
922 // Find state of shift/control keys
923 bool ControlDown() const { return m_controlDown
; }
924 bool MetaDown() const { return m_metaDown
; }
925 bool AltDown() const { return m_altDown
; }
926 bool ShiftDown() const { return m_shiftDown
; }
927 long KeyCode() const { return m_keyCode
; }
929 // Find the position of the event
930 void GetPosition(wxCoord
*xpos
, wxCoord
*ypos
) const
932 if (xpos
) *xpos
= m_x
;
933 if (ypos
) *ypos
= m_y
;
937 void GetPosition(long *xpos
, long *ypos
) const
939 if (xpos
) *xpos
= (long)m_x
;
940 if (ypos
) *ypos
= (long)m_y
;
944 wxPoint
GetPosition() const
945 { return wxPoint(m_x
, m_y
); }
948 wxCoord
GetX() const { return m_x
; }
951 wxCoord
GetY() const { return m_y
; }
953 void CopyObject(wxObject
& obj
) const;
972 class WXDLLEXPORT wxSizeEvent
: public wxEvent
974 DECLARE_DYNAMIC_CLASS(wxSizeEvent
)
979 wxSizeEvent() { m_eventType
= wxEVT_SIZE
; }
980 wxSizeEvent(const wxSize
& sz
, int id
= 0)
982 { m_eventType
= wxEVT_SIZE
; m_id
= id
; }
984 wxSize
GetSize() const { return m_size
; }
986 void CopyObject(wxObject
& obj
) const;
995 class WXDLLEXPORT wxMoveEvent
: public wxEvent
997 DECLARE_DYNAMIC_CLASS(wxMoveEvent
)
1002 wxMoveEvent() { m_eventType
= wxEVT_MOVE
; }
1003 wxMoveEvent(const wxPoint
& pos
, int id
= 0)
1005 { m_eventType
= wxEVT_MOVE
; m_id
= id
; }
1007 wxPoint
GetPosition() const { return m_pos
; }
1009 void CopyObject(wxObject
& obj
) const;
1012 // Paint event class
1019 #if defined(__WXDEBUG__) && defined(__WXMSW__)
1020 // see comments in src/msw/dcclient.cpp where g_isPainting is defined
1021 extern int g_isPainting
;
1024 class WXDLLEXPORT wxPaintEvent
: public wxEvent
1026 DECLARE_DYNAMIC_CLASS(wxPaintEvent
)
1029 wxPaintEvent(int Id
= 0)
1031 m_eventType
= wxEVT_PAINT
;
1034 #if defined(__WXDEBUG__) && defined(__WXMSW__)
1035 // set the internal flag for the duration of processing of WM_PAINT
1040 #if defined(__WXDEBUG__) && defined(__WXMSW__)
1048 // Erase background event class
1050 wxEVT_ERASE_BACKGROUND
1053 class WXDLLEXPORT wxEraseEvent
: public wxEvent
1055 DECLARE_DYNAMIC_CLASS(wxEraseEvent
)
1060 wxEraseEvent(int Id
= 0, wxDC
*dc
= (wxDC
*) NULL
)
1061 { m_eventType
= wxEVT_ERASE_BACKGROUND
; m_id
= Id
; m_dc
= dc
; }
1062 wxDC
*GetDC() const { return m_dc
; }
1064 void CopyObject(wxObject
& obj
) const;
1067 // Focus event class
1073 class WXDLLEXPORT wxFocusEvent
: public wxEvent
1075 DECLARE_DYNAMIC_CLASS(wxFocusEvent
)
1078 wxFocusEvent(wxEventType type
= wxEVT_NULL
, int Id
= 0)
1079 { m_eventType
= type
; m_id
= Id
; }
1082 // Activate event class
1088 class WXDLLEXPORT wxActivateEvent
: public wxEvent
1090 DECLARE_DYNAMIC_CLASS(wxActivateEvent
)
1093 wxActivateEvent(wxEventType type
= wxEVT_NULL
, bool active
= TRUE
, int Id
= 0)
1094 { m_eventType
= type
; m_active
= active
; m_id
= Id
; }
1095 bool GetActive() const { return m_active
; }
1097 void CopyObject(wxObject
& obj
) const;
1103 // InitDialog event class
1108 class WXDLLEXPORT wxInitDialogEvent
: public wxEvent
1110 DECLARE_DYNAMIC_CLASS(wxInitDialogEvent
)
1113 wxInitDialogEvent(int Id
= 0)
1114 { m_eventType
= wxEVT_INIT_DIALOG
; m_id
= Id
; }
1117 // Miscellaneous menu event class
1121 wxEVT_MENU_HIGHLIGHT,
1122 wxEVT_POPUP_MENU_INIT,
1126 class WXDLLEXPORT wxMenuEvent
: public wxEvent
1128 DECLARE_DYNAMIC_CLASS(wxMenuEvent
)
1131 wxMenuEvent(wxEventType type
= wxEVT_NULL
, int id
= 0)
1132 { m_eventType
= type
; m_menuId
= id
; }
1134 int GetMenuId() const { return m_menuId
; }
1136 void CopyObject(wxObject
& obj
) const;
1141 // Window close or session close event class
1145 wxEVT_QUERY_END_SESSION
1148 class WXDLLEXPORT wxCloseEvent
: public wxEvent
1150 DECLARE_DYNAMIC_CLASS(wxCloseEvent
)
1153 wxCloseEvent(wxEventType type
= wxEVT_NULL
, int id
= 0)
1156 m_loggingOff
= TRUE
;
1157 m_veto
= FALSE
; // should be FALSE by default
1159 #if WXWIN_COMPATIBILITY
1161 #endif // WXWIN_COMPATIBILITY
1165 void SetLoggingOff(bool logOff
) { m_loggingOff
= logOff
; }
1166 bool GetLoggingOff() const { return m_loggingOff
; }
1168 void Veto(bool veto
= TRUE
)
1170 // GetVeto() will return FALSE anyhow...
1171 wxCHECK_RET( m_canVeto
,
1172 wxT("call to Veto() ignored (can't veto this event)") );
1176 void SetCanVeto(bool canVeto
) { m_canVeto
= canVeto
; }
1177 // No more asserts here please, the one you put here was wrong.
1178 bool CanVeto() const { return m_canVeto
; }
1179 bool GetVeto() const { return m_canVeto
&& m_veto
; }
1181 #if WXWIN_COMPATIBILITY
1182 // This is probably obsolete now, since we use CanVeto instead, in
1183 // both OnCloseWindow and OnQueryEndSession.
1184 // m_force == ! m_canVeto i.e., can't veto means we must force it to close.
1185 void SetForce(bool force
) { m_force
= force
; }
1186 bool GetForce() const { return m_force
; }
1189 void CopyObject(wxObject
& obj
) const;
1193 bool m_veto
, m_canVeto
;
1195 #if WXWIN_COMPATIBILITY
1204 class WXDLLEXPORT wxShowEvent
: public wxEvent
1206 DECLARE_DYNAMIC_CLASS(wxShowEvent
)
1210 wxShowEvent(int id
= 0, bool show
= FALSE
)
1211 { m_eventType
= wxEVT_SHOW
; m_id
= id
; m_show
= show
; }
1213 void SetShow(bool show
) { m_show
= show
; }
1214 bool GetShow() const { return m_show
; }
1216 void CopyObject(wxObject
& obj
) const;
1226 class WXDLLEXPORT wxIconizeEvent
: public wxEvent
1228 DECLARE_DYNAMIC_CLASS(wxIconizeEvent
)
1231 wxIconizeEvent(int id
= 0)
1232 { m_eventType
= wxEVT_ICONIZE
; m_id
= id
; }
1239 class WXDLLEXPORT wxMaximizeEvent
: public wxEvent
1241 DECLARE_DYNAMIC_CLASS(wxMaximizeEvent
)
1244 wxMaximizeEvent(int id
= 0)
1245 { m_eventType
= wxEVT_MAXIMIZE
; m_id
= id
; }
1248 // Joystick event class
1250 wxEVT_JOY_BUTTON_DOWN,
1251 wxEVT_JOY_BUTTON_UP,
1256 // Which joystick? Same as Windows ids so no conversion necessary.
1257 #define wxJOYSTICK1 0
1258 #define wxJOYSTICK2 1
1260 // Which button is down?
1261 #define wxJOY_BUTTON1 1
1262 #define wxJOY_BUTTON2 2
1263 #define wxJOY_BUTTON3 4
1264 #define wxJOY_BUTTON4 8
1265 #define wxJOY_BUTTON_ANY -1
1267 class WXDLLEXPORT wxJoystickEvent
: public wxEvent
1269 DECLARE_DYNAMIC_CLASS(wxJoystickEvent
)
1274 int m_buttonChange
; // Which button changed?
1275 int m_buttonState
; // Which buttons are down?
1276 int m_joyStick
; // Which joystick?
1278 wxJoystickEvent(wxEventType type
= wxEVT_NULL
,
1280 int joystick
= wxJOYSTICK1
,
1284 m_buttonState
= state
;
1285 m_pos
= wxPoint(0,0);
1287 m_joyStick
= joystick
;
1288 m_buttonChange
= change
;
1291 wxPoint
GetPosition() const { return m_pos
; }
1292 int GetZPosition() const { return m_zPosition
; }
1293 int GetButtonState() const { return m_buttonState
; }
1294 int GetButtonChange() const { return m_buttonChange
; }
1295 int GetJoystick() const { return m_joyStick
; }
1297 void SetJoystick(int stick
) { m_joyStick
= stick
; }
1298 void SetButtonState(int state
) { m_buttonState
= state
; }
1299 void SetButtonChange(int change
) { m_buttonChange
= change
; }
1300 void SetPosition(const wxPoint
& pos
) { m_pos
= pos
; }
1301 void SetZPosition(int zPos
) { m_zPosition
= zPos
; }
1303 // Was it a button event? (*doesn't* mean: is any button *down*?)
1304 bool IsButton() const { return ((GetEventType() == wxEVT_JOY_BUTTON_DOWN
) ||
1305 (GetEventType() == wxEVT_JOY_BUTTON_UP
)); }
1307 // Was it a move event?
1308 bool IsMove() const { return (GetEventType() == wxEVT_JOY_MOVE
) ; }
1310 // Was it a zmove event?
1311 bool IsZMove() const { return (GetEventType() == wxEVT_JOY_ZMOVE
) ; }
1313 // Was it a down event from button 1, 2, 3, 4 or any?
1314 bool ButtonDown(int but
= wxJOY_BUTTON_ANY
) const
1315 { return ((GetEventType() == wxEVT_JOY_BUTTON_DOWN
) &&
1316 ((but
== wxJOY_BUTTON_ANY
) || (but
== m_buttonChange
))); }
1318 // Was it a up event from button 1, 2, 3 or any?
1319 bool ButtonUp(int but
= wxJOY_BUTTON_ANY
) const
1320 { return ((GetEventType() == wxEVT_JOY_BUTTON_UP
) &&
1321 ((but
== wxJOY_BUTTON_ANY
) || (but
== m_buttonChange
))); }
1323 // Was the given button 1,2,3,4 or any in Down state?
1324 bool ButtonIsDown(int but
= wxJOY_BUTTON_ANY
) const
1325 { return (((but
== wxJOY_BUTTON_ANY
) && (m_buttonState
!= 0)) ||
1326 ((m_buttonState
& but
) == but
)); }
1328 void CopyObject(wxObject
& obj
) const;
1331 // Drop files event class
1336 class WXDLLEXPORT wxDropFilesEvent
: public wxEvent
1338 DECLARE_DYNAMIC_CLASS(wxDropFilesEvent
)
1343 wxString
* m_files
; // Memory (de)allocated by code calling ProcessEvent
1345 wxDropFilesEvent(wxEventType type
= wxEVT_NULL
,
1347 wxString
*files
= (wxString
*) NULL
)
1348 { m_eventType
= type
; m_noFiles
= noFiles
; m_files
= files
; }
1350 wxPoint
GetPosition() const { return m_pos
; }
1351 int GetNumberOfFiles() const { return m_noFiles
; }
1352 wxString
*GetFiles() const { return m_files
; }
1354 void CopyObject(wxObject
& obj
) const;
1362 class WXDLLEXPORT wxUpdateUIEvent
: public wxCommandEvent
1364 DECLARE_DYNAMIC_CLASS(wxUpdateUIEvent
)
1367 wxUpdateUIEvent(wxWindowID commandId
= 0)
1369 m_eventType
= wxEVT_UPDATE_UI
;
1372 m_setChecked
= FALSE
;
1374 m_setEnabled
= FALSE
;
1379 bool GetChecked() const { return m_checked
; }
1380 bool GetEnabled() const { return m_enabled
; }
1381 wxString
GetText() const { return m_text
; }
1382 bool GetSetText() const { return m_setText
; }
1383 bool GetSetChecked() const { return m_setChecked
; }
1384 bool GetSetEnabled() const { return m_setEnabled
; }
1386 void Check(bool check
) { m_checked
= check
; m_setChecked
= TRUE
; }
1387 void Enable(bool enable
) { m_enabled
= enable
; m_setEnabled
= TRUE
; }
1388 void SetText(const wxString
& text
) { m_text
= text
; m_setText
= TRUE
; }
1390 void CopyObject(wxObject
& obj
) const;
1402 wxEVT_SYS_COLOUR_CHANGED
1405 // TODO: shouldn't all events record the window ID?
1406 class WXDLLEXPORT wxSysColourChangedEvent
: public wxEvent
1408 DECLARE_DYNAMIC_CLASS(wxSysColourChangedEvent
)
1411 wxSysColourChangedEvent()
1412 { m_eventType
= wxEVT_SYS_COLOUR_CHANGED
; }
1416 wxEVT_PALETTE_CHANGED
1419 class WXDLLEXPORT wxPaletteChangedEvent
: public wxEvent
1421 DECLARE_DYNAMIC_CLASS(wxPaletteChangedEvent
)
1424 wxPaletteChangedEvent(wxWindowID id
= 0) : wxEvent(id
)
1426 m_eventType
= wxEVT_PALETTE_CHANGED
;
1427 m_changedWindow
= (wxWindow
*) NULL
;
1430 void SetChangedWindow(wxWindow
* win
) { m_changedWindow
= win
; }
1431 wxWindow
* GetChangedWindow() const { return m_changedWindow
; }
1433 void CopyObject(wxObject
& obj
) const;
1436 wxWindow
* m_changedWindow
;
1440 wxEVT_QUERY_NEW_PALETTE
1441 Indicates the window is getting keyboard focus and should re-do its palette.
1444 class WXDLLEXPORT wxQueryNewPaletteEvent
: public wxEvent
1446 DECLARE_DYNAMIC_CLASS(wxQueryNewPaletteEvent
)
1449 wxQueryNewPaletteEvent(wxWindowID id
= 0): wxEvent(id
)
1450 { m_eventType
= wxEVT_QUERY_NEW_PALETTE
; m_paletteRealized
= FALSE
; }
1452 // App sets this if it changes the palette.
1453 void SetPaletteRealized(bool realized
) { m_paletteRealized
= realized
; }
1454 bool GetPaletteRealized() const { return m_paletteRealized
; }
1456 void CopyObject(wxObject
& obj
) const;
1459 bool m_paletteRealized
;
1463 Event generated by dialog navigation keys
1464 wxEVT_NAVIGATION_KEY
1466 // NB: don't derive from command event to avoid being propagated to the parent
1467 class WXDLLEXPORT wxNavigationKeyEvent
: public wxEvent
1470 wxNavigationKeyEvent()
1472 SetEventType(wxEVT_NAVIGATION_KEY
);
1474 m_flags
= IsForward
| Propagate
; // defaults are for TAB
1475 m_focus
= (wxWindow
*)NULL
;
1478 // direction: forward (true) or backward (false)
1479 bool GetDirection() const
1480 { return (m_flags
& IsForward
) != 0; }
1481 void SetDirection(bool bForward
)
1482 { if ( bForward
) m_flags
|= IsForward
; else m_flags
&= ~IsForward
; }
1484 // it may be a window change event (MDI, notebook pages...) or a control
1486 bool IsWindowChange() const
1487 { return (m_flags
& WinChange
) != 0; }
1488 void SetWindowChange(bool bIs
)
1489 { if ( bIs
) m_flags
|= WinChange
; else m_flags
&= ~WinChange
; }
1491 // some navigation events are meant to be propagated upwards (Windows
1492 // convention is to do this for TAB events) while others should always
1493 // cycle inside the panel/radiobox/whatever we're current inside
1494 bool ShouldPropagate() const
1495 { return (m_flags
& Propagate
) != 0; }
1496 void SetPropagate(bool bDoIt
)
1497 { if ( bDoIt
) m_flags
|= Propagate
; else m_flags
&= ~Propagate
; }
1499 // the child which has the focus currently (may be NULL - use
1500 // wxWindow::FindFocus then)
1501 wxWindow
* GetCurrentFocus() const { return m_focus
; }
1502 void SetCurrentFocus(wxWindow
*win
) { m_focus
= win
; }
1515 DECLARE_DYNAMIC_CLASS(wxNavigationKeyEvent
)
1518 // Window creation/destruction events: the first is sent as soon as window is
1519 // created (i.e. the underlying GUI object exists), but when the C++ object is
1520 // fully initialized (so virtual functions may be called). The second,
1521 // wxEVT_DESTROY, is sent right before the window is destroyed - again, it's
1522 // still safe to call virtual functions at this moment
1528 class WXDLLEXPORT wxWindowCreateEvent
: public wxEvent
1530 DECLARE_DYNAMIC_CLASS(wxWindowCreateEvent
)
1533 wxWindowCreateEvent(wxWindow
*win
= NULL
);
1535 wxWindow
*GetWindow() const { return (wxWindow
*)GetEventObject(); }
1538 class WXDLLEXPORT wxWindowDestroyEvent
: public wxEvent
1540 DECLARE_DYNAMIC_CLASS(wxWindowDestroyEvent
)
1543 wxWindowDestroyEvent(wxWindow
*win
= NULL
);
1545 wxWindow
*GetWindow() const { return (wxWindow
*)GetEventObject(); }
1555 class WXDLLEXPORT wxIdleEvent
: public wxEvent
1557 DECLARE_DYNAMIC_CLASS(wxIdleEvent
)
1561 { m_eventType
= wxEVT_IDLE
; m_requestMore
= FALSE
; }
1563 void RequestMore(bool needMore
= TRUE
) { m_requestMore
= needMore
; }
1564 bool MoreRequested() const { return m_requestMore
; }
1566 void CopyObject(wxObject
& obj
) const;
1574 wxEVT_MOUSE_CAPTURE_CHANGED,
1575 wxEVT_SETTING_CHANGED, // WM_WININICHANGE (NT) / WM_SETTINGCHANGE (Win95)
1576 // wxEVT_FONT_CHANGED, // WM_FONTCHANGE: roll into wxEVT_SETTING_CHANGED, but remember to propagate
1577 // wxEVT_FONT_CHANGED to all other windows (maybe).
1578 wxEVT_DRAW_ITEM, // Leave these three as virtual functions in wxControl?? Platform-specific.
1583 // ============================================================================
1584 // event handler and related classes
1585 // ============================================================================
1587 typedef void (wxObject::*wxObjectEventFunction
)(wxEvent
&);
1589 struct WXDLLEXPORT wxEventTableEntry
1591 // For some reason, this can't be wxEventType, or VC++ complains.
1592 int m_eventType
; // main event type
1593 int m_id
; // control/menu/toolbar id
1594 int m_lastId
; // used for ranges of ids
1595 wxObjectEventFunction m_fn
; // function to call: not wxEventFunction,
1596 // because of dependency problems
1598 wxObject
* m_callbackUserData
;
1601 struct WXDLLEXPORT wxEventTable
1603 const wxEventTable
*baseTable
; // Points to base event table (next in chain)
1604 const wxEventTableEntry
*entries
; // Points to bottom of entry array
1607 class WXDLLEXPORT wxEvtHandler
: public wxObject
1609 DECLARE_DYNAMIC_CLASS(wxEvtHandler
)
1615 wxEvtHandler
*GetNextHandler() const { return m_nextHandler
; }
1616 wxEvtHandler
*GetPreviousHandler() const { return m_previousHandler
; }
1617 void SetNextHandler(wxEvtHandler
*handler
) { m_nextHandler
= handler
; }
1618 void SetPreviousHandler(wxEvtHandler
*handler
) { m_previousHandler
= handler
; }
1620 void SetEvtHandlerEnabled(bool enabled
) { m_enabled
= enabled
; }
1621 bool GetEvtHandlerEnabled() const { return m_enabled
; }
1623 // process an event right now
1624 virtual bool ProcessEvent(wxEvent
& event
);
1626 // add an event to be processed later
1627 void AddPendingEvent(wxEvent
& event
);
1629 // process all pending events
1630 void ProcessPendingEvents();
1634 bool ProcessThreadEvent(wxEvent
& event
);
1637 // Dynamic association of a member function handler with the event handler,
1638 // id and event type
1639 void Connect( int id
, int lastId
, wxEventType eventType
,
1640 wxObjectEventFunction func
,
1641 wxObject
*userData
= (wxObject
*) NULL
);
1643 // Convenience function: take just one id
1644 void Connect( int id
, wxEventType eventType
,
1645 wxObjectEventFunction func
,
1646 wxObject
*userData
= (wxObject
*) NULL
)
1647 { Connect(id
, -1, eventType
, func
, userData
); }
1649 bool Disconnect( int id
, int lastId
= -1, wxEventType eventType
= wxEVT_NULL
,
1650 wxObjectEventFunction func
= NULL
,
1651 wxObject
*userData
= (wxObject
*) NULL
);
1653 // Convenience function: take just one id
1654 bool Disconnect( int id
, wxEventType eventType
= wxEVT_NULL
,
1655 wxObjectEventFunction func
= NULL
,
1656 wxObject
*userData
= (wxObject
*) NULL
)
1657 { return Disconnect(id
, -1, eventType
, func
, userData
); }
1659 // implementation from now on
1660 virtual bool SearchEventTable(wxEventTable
& table
, wxEvent
& event
);
1661 bool SearchDynamicEventTable( wxEvent
& event
);
1664 void ClearEventLocker()
1666 # if !defined(__VISAGECPP__)
1667 delete m_eventsLocker
;
1668 m_eventsLocker
= NULL
;
1675 #if WXWIN_COMPATIBILITY_2
1676 virtual void OnCommand(wxWindow
& WXUNUSED(win
),
1677 wxCommandEvent
& WXUNUSED(event
))
1679 wxFAIL_MSG(wxT("shouldn't be called any more"));
1682 // Called if child control has no callback function
1683 virtual long Default()
1684 { return GetNextHandler() ? GetNextHandler()->Default() : 0; };
1685 #endif // WXWIN_COMPATIBILITY_2
1687 #if WXWIN_COMPATIBILITY
1688 virtual bool OnClose();
1692 static const wxEventTableEntry sm_eventTableEntries
[];
1695 static const wxEventTable sm_eventTable
;
1697 virtual const wxEventTable
*GetEventTable() const;
1700 wxEvtHandler
* m_nextHandler
;
1701 wxEvtHandler
* m_previousHandler
;
1702 wxList
* m_dynamicEvents
;
1703 wxList
* m_pendingEvents
;
1705 #if defined (__VISAGECPP__)
1706 wxCriticalSection m_eventsLocker
;
1708 wxCriticalSection
* m_eventsLocker
;
1712 // optimization: instead of using costly IsKindOf() to decide whether we're
1713 // a window (which is true in 99% of cases), use this flag
1716 // Is event handler enabled?
1720 typedef void (wxEvtHandler::*wxEventFunction
)(wxEvent
&);
1722 typedef void (wxEvtHandler::*wxCommandEventFunction
)(wxCommandEvent
&);
1723 typedef void (wxEvtHandler::*wxScrollEventFunction
)(wxScrollEvent
&);
1724 typedef void (wxEvtHandler::*wxScrollWinEventFunction
)(wxScrollWinEvent
&);
1725 typedef void (wxEvtHandler::*wxSizeEventFunction
)(wxSizeEvent
&);
1726 typedef void (wxEvtHandler::*wxMoveEventFunction
)(wxMoveEvent
&);
1727 typedef void (wxEvtHandler::*wxPaintEventFunction
)(wxPaintEvent
&);
1728 typedef void (wxEvtHandler::*wxEraseEventFunction
)(wxEraseEvent
&);
1729 typedef void (wxEvtHandler::*wxMouseEventFunction
)(wxMouseEvent
&);
1730 typedef void (wxEvtHandler::*wxCharEventFunction
)(wxKeyEvent
&);
1731 typedef void (wxEvtHandler::*wxFocusEventFunction
)(wxFocusEvent
&);
1732 typedef void (wxEvtHandler::*wxActivateEventFunction
)(wxActivateEvent
&);
1733 typedef void (wxEvtHandler::*wxMenuEventFunction
)(wxMenuEvent
&);
1734 typedef void (wxEvtHandler::*wxJoystickEventFunction
)(wxJoystickEvent
&);
1735 typedef void (wxEvtHandler::*wxDropFilesEventFunction
)(wxDropFilesEvent
&);
1736 typedef void (wxEvtHandler::*wxInitDialogEventFunction
)(wxInitDialogEvent
&);
1737 typedef void (wxEvtHandler::*wxSysColourChangedFunction
)(wxSysColourChangedEvent
&);
1738 typedef void (wxEvtHandler::*wxUpdateUIEventFunction
)(wxUpdateUIEvent
&);
1739 typedef void (wxEvtHandler::*wxIdleEventFunction
)(wxIdleEvent
&);
1740 typedef void (wxEvtHandler::*wxCloseEventFunction
)(wxCloseEvent
&);
1741 typedef void (wxEvtHandler::*wxShowEventFunction
)(wxShowEvent
&);
1742 typedef void (wxEvtHandler::*wxIconizeEventFunction
)(wxShowEvent
&);
1743 typedef void (wxEvtHandler::*wxMaximizeEventFunction
)(wxShowEvent
&);
1744 typedef void (wxEvtHandler::*wxNavigationKeyEventFunction
)(wxNavigationKeyEvent
&);
1745 typedef void (wxEvtHandler::*wxPaletteChangedEventFunction
)(wxPaletteChangedEvent
&);
1746 typedef void (wxEvtHandler::*wxQueryNewPaletteEventFunction
)(wxQueryNewPaletteEvent
&);
1749 // N.B. In GNU-WIN32, you *have* to take the address of a member function
1750 // (use &) or the compiler crashes...
1752 #define DECLARE_EVENT_TABLE() \
1754 static const wxEventTableEntry sm_eventTableEntries[];\
1756 static const wxEventTable sm_eventTable;\
1757 virtual const wxEventTable* GetEventTable() const;
1759 #define BEGIN_EVENT_TABLE(theClass, baseClass) \
1760 const wxEventTable *theClass::GetEventTable() const { return &theClass::sm_eventTable; }\
1761 const wxEventTable theClass::sm_eventTable =\
1762 { &baseClass::sm_eventTable, &theClass::sm_eventTableEntries[0] };\
1763 const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
1765 #define END_EVENT_TABLE() \
1766 { 0, 0, 0, 0, 0 } };
1769 * Event table macros
1773 #define EVT_CUSTOM(event, id, func) { event, id, -1, (wxObjectEventFunction) (wxEventFunction) & func, (wxObject *) NULL },
1774 #define EVT_CUSTOM_RANGE(event, id1, id2, func) { event, id1, id2, (wxObjectEventFunction) (wxEventFunction) & func, (wxObject *) NULL },
1777 #define EVT_SIZE(func) { wxEVT_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxSizeEventFunction) & func, (wxObject *) NULL },
1778 #define EVT_MOVE(func) { wxEVT_MOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMoveEventFunction) & func, (wxObject *) NULL },
1779 #define EVT_CLOSE(func) { wxEVT_CLOSE_WINDOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL },
1780 #define EVT_END_SESSION(func) { wxEVT_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL },
1781 #define EVT_QUERY_END_SESSION(func) { wxEVT_QUERY_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL },
1782 #define EVT_PAINT(func) { wxEVT_PAINT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxPaintEventFunction) & func, (wxObject *) NULL },
1783 #define EVT_ERASE_BACKGROUND(func) { wxEVT_ERASE_BACKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxEraseEventFunction) & func, (wxObject *) NULL },
1784 #define EVT_CHAR(func) { wxEVT_CHAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, (wxObject *) NULL },
1785 #define EVT_KEY_DOWN(func) { wxEVT_KEY_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, (wxObject *) NULL },
1786 #define EVT_KEY_UP(func) { wxEVT_KEY_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, (wxObject *) NULL },
1787 #define EVT_CHAR_HOOK(func) { wxEVT_CHAR_HOOK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, NULL },
1788 #define EVT_MENU_HIGHLIGHT(id, func) { wxEVT_MENU_HIGHLIGHT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMenuEventFunction) & func, (wxObject *) NULL },
1789 #define EVT_MENU_HIGHLIGHT_ALL(func) { wxEVT_MENU_HIGHLIGHT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMenuEventFunction) & func, (wxObject *) NULL },
1790 #define EVT_SET_FOCUS(func) { wxEVT_SET_FOCUS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxFocusEventFunction) & func, (wxObject *) NULL },
1791 #define EVT_KILL_FOCUS(func) { wxEVT_KILL_FOCUS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxFocusEventFunction) & func, (wxObject *) NULL },
1792 #define EVT_ACTIVATE(func) { wxEVT_ACTIVATE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxActivateEventFunction) & func, (wxObject *) NULL },
1793 #define EVT_ACTIVATE_APP(func) { wxEVT_ACTIVATE_APP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxActivateEventFunction) & func, (wxObject *) NULL },
1794 #define EVT_END_SESSION(func) { wxEVT_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL },
1795 #define EVT_QUERY_END_SESSION(func) { wxEVT_QUERY_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL },
1796 #define EVT_DROP_FILES(func) { wxEVT_DROP_FILES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxDropFilesEventFunction) & func, (wxObject *) NULL },
1797 #define EVT_INIT_DIALOG(func) { wxEVT_INIT_DIALOG, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxInitDialogEventFunction) & func, (wxObject *) NULL },
1798 #define EVT_SYS_COLOUR_CHANGED(func) { wxEVT_SYS_COLOUR_CHANGED, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxSysColourChangedFunction) & func, (wxObject *) NULL },
1799 #define EVT_SHOW(func) { wxEVT_SHOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxShowEventFunction) & func, (wxObject *) NULL },
1800 #define EVT_MAXIMIZE(func) { wxEVT_MAXIMIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMaximizeEventFunction) & func, (wxObject *) NULL },
1801 #define EVT_ICONIZE(func) { wxEVT_ICONIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIconizeEventFunction) & func, (wxObject *) NULL },
1802 #define EVT_NAVIGATION_KEY(func) { wxEVT_NAVIGATION_KEY, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNavigationKeyEventFunction) & func, (wxObject *) NULL },
1803 #define EVT_PALETTE_CHANGED(func) { wxEVT_PALETTE_CHANGED, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxPaletteChangedEventFunction) & func, (wxObject *) NULL },
1804 #define EVT_QUERY_NEW_PALETTE(func) { wxEVT_QUERY_NEW_PALETTE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxQueryNewPaletteEventFunction) & func, (wxObject *) NULL },
1805 #define EVT_WINDOW_CREATE(func) { wxEVT_CREATE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxQueryNewPaletteEventFunction) & func, (wxObject *) NULL },
1806 #define EVT_WINDOW_DESTROY(func) { wxEVT_DESTROY, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxQueryNewPaletteEventFunction) & func, (wxObject *) NULL },
1809 #define EVT_LEFT_DOWN(func) { wxEVT_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1810 #define EVT_LEFT_UP(func) { wxEVT_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1811 #define EVT_MIDDLE_DOWN(func) { wxEVT_MIDDLE_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1812 #define EVT_MIDDLE_UP(func) { wxEVT_MIDDLE_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1813 #define EVT_RIGHT_DOWN(func) { wxEVT_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1814 #define EVT_RIGHT_UP(func) { wxEVT_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1815 #define EVT_MOTION(func) { wxEVT_MOTION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1816 #define EVT_LEFT_DCLICK(func) { wxEVT_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1817 #define EVT_MIDDLE_DCLICK(func) { wxEVT_MIDDLE_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1818 #define EVT_RIGHT_DCLICK(func) { wxEVT_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1819 #define EVT_LEAVE_WINDOW(func) { wxEVT_LEAVE_WINDOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1820 #define EVT_ENTER_WINDOW(func) { wxEVT_ENTER_WINDOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1823 #define EVT_MOUSE_EVENTS(func) \
1824 { wxEVT_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1825 { wxEVT_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1826 { wxEVT_MIDDLE_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1827 { wxEVT_MIDDLE_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1828 { wxEVT_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1829 { wxEVT_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1830 { wxEVT_MOTION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1831 { wxEVT_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1832 { wxEVT_MIDDLE_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1833 { wxEVT_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1834 { wxEVT_ENTER_WINDOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1835 { wxEVT_LEAVE_WINDOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1838 #define EVT_COMMAND(id, event, fn) { event, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1839 #define EVT_COMMAND_RANGE(id1, id2, event, fn) { event, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1841 // Scrolling from wxWindow (sent to wxScrolledWindow)
1842 #define EVT_SCROLLWIN(func) \
1843 { wxEVT_SCROLLWIN_TOP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1844 { wxEVT_SCROLLWIN_BOTTOM, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1845 { wxEVT_SCROLLWIN_LINEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1846 { wxEVT_SCROLLWIN_LINEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1847 { wxEVT_SCROLLWIN_PAGEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1848 { wxEVT_SCROLLWIN_PAGEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1849 { wxEVT_SCROLLWIN_THUMBTRACK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1851 #define EVT_SCROLLWIN_TOP(func) { wxEVT_SCROLLWIN_TOP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1852 #define EVT_SCROLLWIN_BOTTOM(func) { wxEVT_SCROLLWIN_BOTTOM, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1853 #define EVT_SCROLLWIN_LINEUP(func) { wxEVT_SCROLLWIN_LINEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1854 #define EVT_SCROLLWIN_LINEDOWN(func) { wxEVT_SCROLLWIN_LINEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1855 #define EVT_SCROLLWIN_PAGEUP(func) { wxEVT_SCROLLWIN_PAGEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1856 #define EVT_SCROLLWIN_PAGEDOWN(func) { wxEVT_SCROLLWIN_PAGEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1857 #define EVT_SCROLLWIN_THUMBTRACK(func) { wxEVT_SCROLLWIN_THUMBTRACK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1859 // Scrolling from wxSlider and wxScrollBar
1860 #define EVT_SCROLL(func) \
1861 { wxEVT_SCROLL_TOP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1862 { wxEVT_SCROLL_BOTTOM, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1863 { wxEVT_SCROLL_LINEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1864 { wxEVT_SCROLL_LINEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1865 { wxEVT_SCROLL_PAGEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1866 { wxEVT_SCROLL_PAGEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1867 { wxEVT_SCROLL_THUMBTRACK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1869 #define EVT_SCROLL_TOP(func) { wxEVT_SCROLL_TOP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1870 #define EVT_SCROLL_BOTTOM(func) { wxEVT_SCROLL_BOTTOM, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1871 #define EVT_SCROLL_LINEUP(func) { wxEVT_SCROLL_LINEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1872 #define EVT_SCROLL_LINEDOWN(func) { wxEVT_SCROLL_LINEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1873 #define EVT_SCROLL_PAGEUP(func) { wxEVT_SCROLL_PAGEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1874 #define EVT_SCROLL_PAGEDOWN(func) { wxEVT_SCROLL_PAGEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1875 #define EVT_SCROLL_THUMBTRACK(func) { wxEVT_SCROLL_THUMBTRACK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1877 // Scrolling from wxSlider and wxScrollBar, with an id
1878 #define EVT_COMMAND_SCROLL(id, func) \
1879 { wxEVT_SCROLL_TOP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1880 { wxEVT_SCROLL_BOTTOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1881 { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1882 { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1883 { wxEVT_SCROLL_PAGEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1884 { wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1885 { wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1887 #define EVT_COMMAND_SCROLL_TOP(id, func) { wxEVT_SCROLL_TOP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1888 #define EVT_COMMAND_SCROLL_BOTTOM(id, func) { wxEVT_SCROLL_BOTTOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1889 #define EVT_COMMAND_SCROLL_LINEUP(id, func) { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1890 #define EVT_COMMAND_SCROLL_LINEDOWN(id, func) { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1891 #define EVT_COMMAND_SCROLL_PAGEUP(id, func) { wxEVT_SCROLL_PAGEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1892 #define EVT_COMMAND_SCROLL_PAGEDOWN(id, func) { wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1893 #define EVT_COMMAND_SCROLL_THUMBTRACK(id, func) { wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1895 // Convenience macros for commonly-used commands
1896 #define EVT_BUTTON(id, fn) { wxEVT_COMMAND_BUTTON_CLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1897 #define EVT_CHECKBOX(id, fn) { wxEVT_COMMAND_CHECKBOX_CLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1898 #define EVT_CHOICE(id, fn) { wxEVT_COMMAND_CHOICE_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1899 #define EVT_LISTBOX(id, fn) { wxEVT_COMMAND_LISTBOX_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1900 #define EVT_LISTBOX_DCLICK(id, fn) { wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1901 #define EVT_TEXT(id, fn) { wxEVT_COMMAND_TEXT_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1902 #define EVT_TEXT_ENTER(id, fn) { wxEVT_COMMAND_TEXT_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1903 #define EVT_MENU(id, fn) { wxEVT_COMMAND_MENU_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1904 #define EVT_MENU_RANGE(id1, id2, fn) { wxEVT_COMMAND_MENU_SELECTED, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1905 #define EVT_SLIDER(id, fn) { wxEVT_COMMAND_SLIDER_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1906 #define EVT_RADIOBOX(id, fn) { wxEVT_COMMAND_RADIOBOX_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1907 #define EVT_RADIOBUTTON(id, fn) { wxEVT_COMMAND_RADIOBUTTON_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1908 // EVT_SCROLLBAR is now obsolete since we use EVT_COMMAND_SCROLL... events
1909 #define EVT_SCROLLBAR(id, fn) { wxEVT_COMMAND_SCROLLBAR_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1910 #define EVT_VLBOX(id, fn) { wxEVT_COMMAND_VLBOX_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1911 #define EVT_COMBOBOX(id, fn) { wxEVT_COMMAND_COMBOBOX_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1912 #define EVT_TOOL(id, fn) { wxEVT_COMMAND_TOOL_CLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1913 #define EVT_TOOL_RANGE(id1, id2, fn) { wxEVT_COMMAND_TOOL_CLICKED, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1914 #define EVT_TOOL_RCLICKED(id, fn) { wxEVT_COMMAND_TOOL_RCLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1915 #define EVT_TOOL_RCLICKED_RANGE(id1, id2, fn) { wxEVT_COMMAND_TOOL_RCLICKED, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1916 #define EVT_TOOL_ENTER(id, fn) { wxEVT_COMMAND_TOOL_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1917 #define EVT_CHECKLISTBOX(id, fn) { wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1919 // Generic command events
1920 #define EVT_COMMAND_LEFT_CLICK(id, fn) { wxEVT_COMMAND_LEFT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1921 #define EVT_COMMAND_LEFT_DCLICK(id, fn) { wxEVT_COMMAND_LEFT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1922 #define EVT_COMMAND_RIGHT_CLICK(id, fn) { wxEVT_COMMAND_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1923 #define EVT_COMMAND_RIGHT_DCLICK(id, fn) { wxEVT_COMMAND_RIGHT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1924 #define EVT_COMMAND_SET_FOCUS(id, fn) { wxEVT_COMMAND_SET_FOCUS, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1925 #define EVT_COMMAND_KILL_FOCUS(id, fn) { wxEVT_COMMAND_KILL_FOCUS, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1926 #define EVT_COMMAND_ENTER(id, fn) { wxEVT_COMMAND_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1929 #define EVT_JOY_DOWN(func) \
1930 { wxEVT_JOY_BUTTON_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },
1931 #define EVT_JOY_UP(func) \
1932 { wxEVT_JOY_BUTTON_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },
1933 #define EVT_JOY_MOVE(func) \
1934 { wxEVT_JOY_MOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },
1935 #define EVT_JOY_ZMOVE(func) \
1936 { wxEVT_JOY_ZMOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },
1938 // All joystick events
1939 #define EVT_JOYSTICK_EVENTS(func) \
1940 { wxEVT_JOY_BUTTON_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
1941 { wxEVT_JOY_BUTTON_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
1942 { wxEVT_JOY_MOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
1943 { wxEVT_JOY_ZMOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
1946 #define EVT_IDLE(func) \
1947 { wxEVT_IDLE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) & func, (wxObject *) NULL },\
1950 #define EVT_UPDATE_UI(id, func) \
1951 { wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, (wxObject *) NULL },\
1953 // ----------------------------------------------------------------------------
1955 // ----------------------------------------------------------------------------
1957 // for pending event processing - notice that there is intentionally no
1959 extern wxList
*wxPendingEvents
;
1961 extern wxCriticalSection
*wxPendingEventsLocker
;
1964 // ----------------------------------------------------------------------------
1966 // ----------------------------------------------------------------------------
1970 // Find a window with the focus, that is also a descendant of the given window.
1971 // This is used to determine the window to initially send commands to.
1972 wxWindow
* wxFindFocusDescendant(wxWindow
* ancestor
);