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 static 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 and timers send events, too */
73 extern const wxEventType wxEVT_SOCKET
;
74 extern const wxEventType wxEVT_TIMER
;
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
;
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
;
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
;
114 * wxScrollbar and wxSlider event identifiers
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
;
125 * Scroll events from wxWindow
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
;
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
;
178 extern const wxEventType wxEVT_END_PROCESS
;
181 extern const wxEventType wxEVT_DIALUP_CONNECTED
;
182 extern const wxEventType wxEVT_DIALUP_DISCONNECTED
;
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
;
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
;
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
;
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
;
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 /* And timers do as well */
288 const wxEventType wxEVT_TIMER
= wxEVT_FIRST
+ 80;
290 /* Mouse event types */
291 const wxEventType wxEVT_LEFT_DOWN
= wxEVT_FIRST
+ 100;
292 const wxEventType wxEVT_LEFT_UP
= wxEVT_FIRST
+ 101;
293 const wxEventType wxEVT_MIDDLE_DOWN
= wxEVT_FIRST
+ 102;
294 const wxEventType wxEVT_MIDDLE_UP
= wxEVT_FIRST
+ 103;
295 const wxEventType wxEVT_RIGHT_DOWN
= wxEVT_FIRST
+ 104;
296 const wxEventType wxEVT_RIGHT_UP
= wxEVT_FIRST
+ 105;
297 const wxEventType wxEVT_MOTION
= wxEVT_FIRST
+ 106;
298 const wxEventType wxEVT_ENTER_WINDOW
= wxEVT_FIRST
+ 107;
299 const wxEventType wxEVT_LEAVE_WINDOW
= wxEVT_FIRST
+ 108;
300 const wxEventType wxEVT_LEFT_DCLICK
= wxEVT_FIRST
+ 109;
301 const wxEventType wxEVT_MIDDLE_DCLICK
= wxEVT_FIRST
+ 110;
302 const wxEventType wxEVT_RIGHT_DCLICK
= wxEVT_FIRST
+ 111;
303 const wxEventType wxEVT_SET_FOCUS
= wxEVT_FIRST
+ 112;
304 const wxEventType wxEVT_KILL_FOCUS
= wxEVT_FIRST
+ 113;
306 /* Non-client mouse events */
307 const wxEventType wxEVT_NC_LEFT_DOWN
= wxEVT_FIRST
+ 200;
308 const wxEventType wxEVT_NC_LEFT_UP
= wxEVT_FIRST
+ 201;
309 const wxEventType wxEVT_NC_MIDDLE_DOWN
= wxEVT_FIRST
+ 202;
310 const wxEventType wxEVT_NC_MIDDLE_UP
= wxEVT_FIRST
+ 203;
311 const wxEventType wxEVT_NC_RIGHT_DOWN
= wxEVT_FIRST
+ 204;
312 const wxEventType wxEVT_NC_RIGHT_UP
= wxEVT_FIRST
+ 205;
313 const wxEventType wxEVT_NC_MOTION
= wxEVT_FIRST
+ 206;
314 const wxEventType wxEVT_NC_ENTER_WINDOW
= wxEVT_FIRST
+ 207;
315 const wxEventType wxEVT_NC_LEAVE_WINDOW
= wxEVT_FIRST
+ 208;
316 const wxEventType wxEVT_NC_LEFT_DCLICK
= wxEVT_FIRST
+ 209;
317 const wxEventType wxEVT_NC_MIDDLE_DCLICK
= wxEVT_FIRST
+ 210;
318 const wxEventType wxEVT_NC_RIGHT_DCLICK
= wxEVT_FIRST
+ 211;
320 /* Character input event type */
321 const wxEventType wxEVT_CHAR
= wxEVT_FIRST
+ 212;
322 const wxEventType wxEVT_CHAR_HOOK
= wxEVT_FIRST
+ 213;
323 const wxEventType wxEVT_NAVIGATION_KEY
= wxEVT_FIRST
+ 214;
324 const wxEventType wxEVT_KEY_DOWN
= wxEVT_FIRST
+ 215;
325 const wxEventType wxEVT_KEY_UP
= wxEVT_FIRST
+ 216;
328 * wxScrollbar and wxSlider event identifiers
330 const wxEventType wxEVT_SCROLL_TOP
= wxEVT_FIRST
+ 300;
331 const wxEventType wxEVT_SCROLL_BOTTOM
= wxEVT_FIRST
+ 301;
332 const wxEventType wxEVT_SCROLL_LINEUP
= wxEVT_FIRST
+ 302;
333 const wxEventType wxEVT_SCROLL_LINEDOWN
= wxEVT_FIRST
+ 303;
334 const wxEventType wxEVT_SCROLL_PAGEUP
= wxEVT_FIRST
+ 304;
335 const wxEventType wxEVT_SCROLL_PAGEDOWN
= wxEVT_FIRST
+ 305;
336 const wxEventType wxEVT_SCROLL_THUMBTRACK
= wxEVT_FIRST
+ 306;
339 * Scroll events from wxWindow
341 const wxEventType wxEVT_SCROLLWIN_TOP
= wxEVT_FIRST
+ 320;
342 const wxEventType wxEVT_SCROLLWIN_BOTTOM
= wxEVT_FIRST
+ 321;
343 const wxEventType wxEVT_SCROLLWIN_LINEUP
= wxEVT_FIRST
+ 322;
344 const wxEventType wxEVT_SCROLLWIN_LINEDOWN
= wxEVT_FIRST
+ 323;
345 const wxEventType wxEVT_SCROLLWIN_PAGEUP
= wxEVT_FIRST
+ 324;
346 const wxEventType wxEVT_SCROLLWIN_PAGEDOWN
= wxEVT_FIRST
+ 325;
347 const wxEventType wxEVT_SCROLLWIN_THUMBTRACK
= wxEVT_FIRST
+ 326;
352 const wxEventType wxEVT_SIZE
= wxEVT_FIRST
+ 400;
353 const wxEventType wxEVT_MOVE
= wxEVT_FIRST
+ 401;
354 const wxEventType wxEVT_CLOSE_WINDOW
= wxEVT_FIRST
+ 402;
355 const wxEventType wxEVT_END_SESSION
= wxEVT_FIRST
+ 403;
356 const wxEventType wxEVT_QUERY_END_SESSION
= wxEVT_FIRST
+ 404;
357 const wxEventType wxEVT_ACTIVATE_APP
= wxEVT_FIRST
+ 405;
358 const wxEventType wxEVT_POWER
= wxEVT_FIRST
+ 406;
359 const wxEventType wxEVT_ACTIVATE
= wxEVT_FIRST
+ 409;
360 const wxEventType wxEVT_CREATE
= wxEVT_FIRST
+ 410;
361 const wxEventType wxEVT_DESTROY
= wxEVT_FIRST
+ 411;
362 const wxEventType wxEVT_SHOW
= wxEVT_FIRST
+ 412;
363 const wxEventType wxEVT_ICONIZE
= wxEVT_FIRST
+ 413;
364 const wxEventType wxEVT_MAXIMIZE
= wxEVT_FIRST
+ 414;
365 const wxEventType wxEVT_MOUSE_CAPTURE_CHANGED
= wxEVT_FIRST
+ 415;
366 const wxEventType wxEVT_PAINT
= wxEVT_FIRST
+ 416;
367 const wxEventType wxEVT_ERASE_BACKGROUND
= wxEVT_FIRST
+ 417;
368 const wxEventType wxEVT_NC_PAINT
= wxEVT_FIRST
+ 418;
369 const wxEventType wxEVT_PAINT_ICON
= wxEVT_FIRST
+ 419;
370 const wxEventType wxEVT_MENU_CHAR
= wxEVT_FIRST
+ 420;
371 const wxEventType wxEVT_MENU_INIT
= wxEVT_FIRST
+ 421;
372 const wxEventType wxEVT_MENU_HIGHLIGHT
= wxEVT_FIRST
+ 422;
373 const wxEventType wxEVT_POPUP_MENU_INIT
= wxEVT_FIRST
+ 423;
374 const wxEventType wxEVT_CONTEXT_MENU
= wxEVT_FIRST
+ 424;
375 const wxEventType wxEVT_SYS_COLOUR_CHANGED
= wxEVT_FIRST
+ 425;
376 const wxEventType wxEVT_SETTING_CHANGED
= wxEVT_FIRST
+ 426;
377 const wxEventType wxEVT_QUERY_NEW_PALETTE
= wxEVT_FIRST
+ 427;
378 const wxEventType wxEVT_PALETTE_CHANGED
= wxEVT_FIRST
+ 428;
379 const wxEventType wxEVT_JOY_BUTTON_DOWN
= wxEVT_FIRST
+ 429;
380 const wxEventType wxEVT_JOY_BUTTON_UP
= wxEVT_FIRST
+ 430;
381 const wxEventType wxEVT_JOY_MOVE
= wxEVT_FIRST
+ 431;
382 const wxEventType wxEVT_JOY_ZMOVE
= wxEVT_FIRST
+ 432;
383 const wxEventType wxEVT_DROP_FILES
= wxEVT_FIRST
+ 433;
384 const wxEventType wxEVT_DRAW_ITEM
= wxEVT_FIRST
+ 434;
385 const wxEventType wxEVT_MEASURE_ITEM
= wxEVT_FIRST
+ 435;
386 const wxEventType wxEVT_COMPARE_ITEM
= wxEVT_FIRST
+ 436;
387 const wxEventType wxEVT_INIT_DIALOG
= wxEVT_FIRST
+ 437;
388 const wxEventType wxEVT_IDLE
= wxEVT_FIRST
+ 438;
389 const wxEventType wxEVT_UPDATE_UI
= wxEVT_FIRST
+ 439;
392 const wxEventType wxEVT_END_PROCESS
= wxEVT_FIRST
+ 440;
395 const wxEventType wxEVT_DIALUP_CONNECTED
= wxEVT_FIRST
+ 450;
396 const wxEventType wxEVT_DIALUP_DISCONNECTED
= wxEVT_FIRST
+ 451;
398 /* Generic command events */
399 /* Note: a click is a higher-level event than button down/up */
400 const wxEventType wxEVT_COMMAND_LEFT_CLICK
= wxEVT_FIRST
+ 500;
401 const wxEventType wxEVT_COMMAND_LEFT_DCLICK
= wxEVT_FIRST
+ 501;
402 const wxEventType wxEVT_COMMAND_RIGHT_CLICK
= wxEVT_FIRST
+ 502;
403 const wxEventType wxEVT_COMMAND_RIGHT_DCLICK
= wxEVT_FIRST
+ 503;
404 const wxEventType wxEVT_COMMAND_SET_FOCUS
= wxEVT_FIRST
+ 504;
405 const wxEventType wxEVT_COMMAND_KILL_FOCUS
= wxEVT_FIRST
+ 505;
406 const wxEventType wxEVT_COMMAND_ENTER
= wxEVT_FIRST
+ 506;
408 /* Tree control event types */
409 const wxEventType wxEVT_COMMAND_TREE_BEGIN_DRAG
= wxEVT_FIRST
+ 600;
410 const wxEventType wxEVT_COMMAND_TREE_BEGIN_RDRAG
= wxEVT_FIRST
+ 601;
411 const wxEventType wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT
= wxEVT_FIRST
+ 602;
412 const wxEventType wxEVT_COMMAND_TREE_END_LABEL_EDIT
= wxEVT_FIRST
+ 603;
413 const wxEventType wxEVT_COMMAND_TREE_DELETE_ITEM
= wxEVT_FIRST
+ 604;
414 const wxEventType wxEVT_COMMAND_TREE_GET_INFO
= wxEVT_FIRST
+ 605;
415 const wxEventType wxEVT_COMMAND_TREE_SET_INFO
= wxEVT_FIRST
+ 606;
416 const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDED
= wxEVT_FIRST
+ 607;
417 const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDING
= wxEVT_FIRST
+ 608;
418 const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSED
= wxEVT_FIRST
+ 609;
419 const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSING
= wxEVT_FIRST
+ 610;
420 const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGED
= wxEVT_FIRST
+ 611;
421 const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGING
= wxEVT_FIRST
+ 612;
422 const wxEventType wxEVT_COMMAND_TREE_KEY_DOWN
= wxEVT_FIRST
+ 613;
423 const wxEventType wxEVT_COMMAND_TREE_ITEM_ACTIVATED
= wxEVT_FIRST
+ 614;
424 const wxEventType wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK
= wxEVT_FIRST
+ 615;
425 const wxEventType wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK
= wxEVT_FIRST
+ 616;
427 /* List control event types */
428 const wxEventType wxEVT_COMMAND_LIST_BEGIN_DRAG
= wxEVT_FIRST
+ 700;
429 const wxEventType wxEVT_COMMAND_LIST_BEGIN_RDRAG
= wxEVT_FIRST
+ 701;
430 const wxEventType wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT
= wxEVT_FIRST
+ 702;
431 const wxEventType wxEVT_COMMAND_LIST_END_LABEL_EDIT
= wxEVT_FIRST
+ 703;
432 const wxEventType wxEVT_COMMAND_LIST_DELETE_ITEM
= wxEVT_FIRST
+ 704;
433 const wxEventType wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS
= wxEVT_FIRST
+ 705;
434 const wxEventType wxEVT_COMMAND_LIST_GET_INFO
= wxEVT_FIRST
+ 706;
435 const wxEventType wxEVT_COMMAND_LIST_SET_INFO
= wxEVT_FIRST
+ 707;
436 const wxEventType wxEVT_COMMAND_LIST_ITEM_SELECTED
= wxEVT_FIRST
+ 708;
437 const wxEventType wxEVT_COMMAND_LIST_ITEM_DESELECTED
= wxEVT_FIRST
+ 709;
438 const wxEventType wxEVT_COMMAND_LIST_KEY_DOWN
= wxEVT_FIRST
+ 710;
439 const wxEventType wxEVT_COMMAND_LIST_INSERT_ITEM
= wxEVT_FIRST
+ 711;
440 const wxEventType wxEVT_COMMAND_LIST_COL_CLICK
= wxEVT_FIRST
+ 712;
441 const wxEventType wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK
= wxEVT_FIRST
+ 713;
442 const wxEventType wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK
= wxEVT_FIRST
+ 714;
443 const wxEventType wxEVT_COMMAND_LIST_ITEM_ACTIVATED
= wxEVT_FIRST
+ 715;
445 /* Tab and notebook control event types */
446 const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGED
= wxEVT_FIRST
+ 800;
447 const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGING
= wxEVT_FIRST
+ 801;
449 #if defined(__BORLANDC__) && defined(__WIN16__)
450 /* For 16-bit BC++, these 2 are identical (truncated) */
451 const wxEventType wxEVT_COMMAND_NB_PAGE_CHANGED
= wxEVT_FIRST
+ 802;
452 const wxEventType wxEVT_COMMAND_NB_PAGE_CHANGING
= wxEVT_FIRST
+ 803;
454 const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
= wxEVT_FIRST
+ 802;
455 const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
= wxEVT_FIRST
+ 803;
458 /* Splitter events */
459 const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED
= wxEVT_FIRST
+ 850;
460 const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING
= wxEVT_FIRST
+ 851;
461 const wxEventType wxEVT_COMMAND_SPLITTER_DOUBLECLICKED
= wxEVT_FIRST
+ 852;
462 const wxEventType wxEVT_COMMAND_SPLITTER_UNSPLIT
= wxEVT_FIRST
+ 853;
465 const wxEventType wxEVT_WIZARD_PAGE_CHANGED
= wxEVT_FIRST
+ 900;
466 const wxEventType wxEVT_WIZARD_PAGE_CHANGING
= wxEVT_FIRST
+ 901;
467 const wxEventType wxEVT_WIZARD_CANCEL
= wxEVT_FIRST
+ 902;
469 /* Calendar events */
470 const wxEventType wxEVT_CALENDAR_SEL_CHANGED
= wxEVT_FIRST
+ 950;
471 const wxEventType wxEVT_CALENDAR_DAY_CHANGED
= wxEVT_FIRST
+ 951;
472 const wxEventType wxEVT_CALENDAR_MONTH_CHANGED
= wxEVT_FIRST
+ 952;
473 const wxEventType wxEVT_CALENDAR_YEAR_CHANGED
= wxEVT_FIRST
+ 953;
474 const wxEventType wxEVT_CALENDAR_DOUBLECLICKED
= wxEVT_FIRST
+ 954;
475 const wxEventType wxEVT_CALENDAR_WEEKDAY_CLICKED
= wxEVT_FIRST
+ 955;
477 const wxEventType wxEVT_USER_FIRST
= wxEVT_FIRST
+ 2000;
479 #endif // for VisualAge C++ V4.0
483 #if WXWIN_COMPATIBILITY
485 #define wxEVENT_TYPE_BUTTON_COMMAND wxEVT_COMMAND_BUTTON_CLICKED
486 #define wxEVENT_TYPE_CHECKBOX_COMMAND wxEVT_COMMAND_CHECKBOX_CLICKED
487 #define wxEVENT_TYPE_CHOICE_COMMAND wxEVT_COMMAND_CHOICE_SELECTED
488 #define wxEVENT_TYPE_LISTBOX_COMMAND wxEVT_COMMAND_LISTBOX_SELECTED
489 #define wxEVENT_TYPE_LISTBOX_DCLICK_COMMAND wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
490 #define wxEVENT_TYPE_TEXT_COMMAND wxEVT_COMMAND_TEXT_UPDATED
491 #define wxEVENT_TYPE_MULTITEXT_COMMAND wxEVT_COMMAND_TEXT_UPDATED
492 #define wxEVENT_TYPE_MENU_COMMAND wxEVT_COMMAND_MENU_SELECTED
493 #define wxEVENT_TYPE_SLIDER_COMMAND wxEVT_COMMAND_SLIDER_UPDATED
494 #define wxEVENT_TYPE_RADIOBOX_COMMAND wxEVT_COMMAND_RADIOBOX_SELECTED
495 #define wxEVENT_TYPE_RADIOBUTTON_COMMAND wxEVT_COMMAND_RADIOBUTTON_SELECTED
496 #define wxEVENT_TYPE_TEXT_ENTER_COMMAND wxEVT_COMMAND_TEXT_ENTER
497 #define wxEVENT_TYPE_SET_FOCUS wxEVT_SET_FOCUS
498 #define wxEVENT_TYPE_KILL_FOCUS wxEVT_KILL_FOCUS
499 #define wxEVENT_TYPE_SCROLLBAR_COMMAND wxEVT_COMMAND_SCROLLBAR_UPDATED
500 #define wxEVENT_TYPE_VIRT_LISTBOX_COMMAND wxEVT_COMMAND_VLBOX_SELECTED
501 #define wxEVENT_TYPE_COMBOBOX_COMMAND wxEVT_COMMAND_COMBOBOX_SELECTED
503 #define wxEVENT_TYPE_LEFT_DOWN wxEVT_LEFT_DOWN
504 #define wxEVENT_TYPE_LEFT_UP wxEVT_LEFT_UP
505 #define wxEVENT_TYPE_MIDDLE_DOWN wxEVT_MIDDLE_DOWN
506 #define wxEVENT_TYPE_MIDDLE_UP wxEVT_MIDDLE_UP
507 #define wxEVENT_TYPE_RIGHT_DOWN wxEVT_RIGHT_DOWN
508 #define wxEVENT_TYPE_RIGHT_UP wxEVT_RIGHT_UP
509 #define wxEVENT_TYPE_MOTION wxEVT_MOTION
510 #define wxEVENT_TYPE_ENTER_WINDOW wxEVT_ENTER_WINDOW
511 #define wxEVENT_TYPE_LEAVE_WINDOW wxEVT_LEAVE_WINDOW
512 #define wxEVENT_TYPE_LEFT_DCLICK wxEVT_LEFT_DCLICK
513 #define wxEVENT_TYPE_MIDDLE_DCLICK wxEVT_MIDDLE_DCLICK
514 #define wxEVENT_TYPE_RIGHT_DCLICK wxEVT_RIGHT_DCLICK
515 #define wxEVENT_TYPE_CHAR wxEVT_CHAR
516 #define wxEVENT_TYPE_SCROLL_TOP wxEVT_SCROLL_TOP
517 #define wxEVENT_TYPE_SCROLL_BOTTOM wxEVT_SCROLL_BOTTOM
518 #define wxEVENT_TYPE_SCROLL_LINEUP wxEVT_SCROLL_LINEUP
519 #define wxEVENT_TYPE_SCROLL_LINEDOWN wxEVT_SCROLL_LINEDOWN
520 #define wxEVENT_TYPE_SCROLL_PAGEUP wxEVT_SCROLL_PAGEUP
521 #define wxEVENT_TYPE_SCROLL_PAGEDOWN wxEVT_SCROLL_PAGEDOWN
522 #define wxEVENT_TYPE_SCROLL_THUMBTRACK wxEVT_SCROLL_THUMBTRACK
524 #endif // WXWIN_COMPATIBILITY
527 * wxWindows events, covering all interesting things that might happen
528 * (button clicking, resizing, setting text in widgets, etc.).
530 * For each completely new event type, derive a new event class.
531 * An event CLASS represents a C++ class defining a range of similar event TYPES;
532 * examples are canvas events, panel item command events.
533 * An event TYPE is a unique identifier for a particular system event,
534 * such as a button press or a listbox deselection.
538 class WXDLLEXPORT wxEvent
: public wxObject
540 DECLARE_ABSTRACT_CLASS(wxEvent
)
546 void SetEventType(wxEventType typ
) { m_eventType
= typ
; }
547 wxEventType
GetEventType() const { return m_eventType
; }
548 wxObject
*GetEventObject() const { return m_eventObject
; }
549 void SetEventObject(wxObject
*obj
) { m_eventObject
= obj
; }
550 long GetTimestamp() const { return m_timeStamp
; }
551 void SetTimestamp(long ts
= 0) { m_timeStamp
= ts
; }
552 int GetId() const { return m_id
; }
553 void SetId(int Id
) { m_id
= Id
; }
555 // Can instruct event processor that we wish to ignore this event
556 // (treat as if the event table entry had not been found): this must be done
557 // to allow the event processing by the base classes (calling event.Skip()
558 // is the analog of calling the base class verstion of a virtual function)
559 void Skip(bool skip
= TRUE
) { m_skipped
= skip
; }
560 bool GetSkipped() const { return m_skipped
; };
562 // implementation only: this test is explicitlty anti OO and this functions
563 // exists only for optimization purposes
564 bool IsCommandEvent() const { return m_isCommandEvent
; }
566 void CopyObject(wxObject
& object_dest
) const;
569 wxObject
* m_eventObject
;
570 wxEventType m_eventType
;
573 wxObject
* m_callbackUserData
;
576 // optimization: instead of using costly IsKindOf() we keep a flag telling
577 // whether we're a command event (by far the most common case)
578 bool m_isCommandEvent
;
583 // Item or menu event class
585 wxEVT_COMMAND_BUTTON_CLICKED
586 wxEVT_COMMAND_CHECKBOX_CLICKED
587 wxEVT_COMMAND_CHOICE_SELECTED
588 wxEVT_COMMAND_LISTBOX_SELECTED
589 wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
590 wxEVT_COMMAND_TEXT_UPDATED
591 wxEVT_COMMAND_TEXT_ENTER
592 wxEVT_COMMAND_MENU_SELECTED
593 wxEVT_COMMAND_SLIDER_UPDATED
594 wxEVT_COMMAND_RADIOBOX_SELECTED
595 wxEVT_COMMAND_RADIOBUTTON_SELECTED
596 wxEVT_COMMAND_SCROLLBAR_UPDATED
597 wxEVT_COMMAND_VLBOX_SELECTED
598 wxEVT_COMMAND_COMBOBOX_SELECTED
601 class WXDLLEXPORT wxCommandEvent
: public wxEvent
603 DECLARE_DYNAMIC_CLASS(wxCommandEvent
)
606 wxCommandEvent(wxEventType commandType
= wxEVT_NULL
, int id
= 0);
610 * Accessors dependent on context
614 // Set/Get client data from controls
615 void SetClientData(void* clientData
) { m_clientData
= clientData
; }
616 void *GetClientData() const { return m_clientData
; }
618 // Set/Get client object from controls
619 void SetClientObject(wxClientData
* clientObject
) { m_clientObject
= clientObject
; }
620 void *GetClientObject() const { return m_clientObject
; }
622 // Get listbox selection if single-choice
623 int GetSelection() const { return m_commandInt
; }
625 // Set/Get listbox/choice selection string
626 void SetString(const wxString
& s
) { m_commandString
= s
; }
627 wxString
GetString() const { return m_commandString
; }
629 // Get checkbox value
630 bool Checked() const { return (m_commandInt
!= 0); }
632 // TRUE if the listbox event was a selection.
633 bool IsSelection() const { return (m_extraLong
!= 0); }
635 void SetExtraLong(long extraLong
) { m_extraLong
= extraLong
; }
636 long GetExtraLong() const { return m_extraLong
; }
638 void SetInt(int i
) { m_commandInt
= i
; }
639 long GetInt() const { return m_commandInt
; }
641 void CopyObject(wxObject
& obj
) const;
644 wxString m_commandString
; // String event argument
646 long m_extraLong
; // Additional information (e.g. select/deselect)
647 void* m_clientData
; // Arbitrary client data
648 wxClientData
* m_clientObject
; // Arbitrary client object
651 // this class adds a possibility to react (from the user) code to a control
652 // notification: allow or veto the operation being reported.
653 class WXDLLEXPORT wxNotifyEvent
: public wxCommandEvent
656 wxNotifyEvent(wxEventType commandType
= wxEVT_NULL
, int id
= 0)
657 : wxCommandEvent(commandType
, id
) { m_bAllow
= TRUE
; }
659 // veto the operation (by default it's allowed)
660 void Veto() { m_bAllow
= FALSE
; }
662 // for implementation code only: is the operation allowed?
663 bool IsAllowed() const { return m_bAllow
; }
665 // probably useless: CopyObject() is used for deferred event
666 // handling but wxNotifyEvent must be processed immediately
667 void CopyObject(wxObject
& obj
) const;
672 DECLARE_DYNAMIC_CLASS(wxNotifyEvent
)
675 // Scroll event class, derived form wxCommandEvent. wxScrollEvents are
676 // sent by wxSlider and wxScrollbar.
681 wxEVT_SCROLL_LINEDOWN
683 wxEVT_SCROLL_PAGEDOWN
684 wxEVT_SCROLL_THUMBTRACK
687 class WXDLLEXPORT wxScrollEvent
: public wxCommandEvent
689 DECLARE_DYNAMIC_CLASS(wxScrollEvent
)
692 wxScrollEvent(wxEventType commandType
= wxEVT_NULL
,
693 int id
= 0, int pos
= 0, int orient
= 0);
701 int GetOrientation() const { return (int) m_extraLong
; }
702 int GetPosition() const { return m_commandInt
; }
703 bool IsScrolling() const { return m_isScrolling
; }
704 void SetOrientation(int orient
) { m_extraLong
= (long) orient
; }
705 void SetPosition(int pos
) { m_commandInt
= pos
; }
706 void SetScrolling(bool isScrolling
) { m_isScrolling
= isScrolling
; }
708 void CopyObject(wxObject
& obj
) const;
713 // ScrollWin event class, derived fom wxEvent. wxScrollWinEvents
714 // are sent by wxWindow.
717 wxEVT_SCROLLWIN_BOTTOM
718 wxEVT_SCROLLWIN_LINEUP
719 wxEVT_SCROLLWIN_LINEDOWN
720 wxEVT_SCROLLWIN_PAGEUP
721 wxEVT_SCROLLWIN_PAGEDOWN
722 wxEVT_SCROLLWIN_THUMBTRACK
725 class WXDLLEXPORT wxScrollWinEvent
: public wxEvent
727 DECLARE_DYNAMIC_CLASS(wxScrollWinEvent
)
730 wxScrollWinEvent(wxEventType commandType
= wxEVT_NULL
,
731 int pos
= 0, int orient
= 0);
732 ~wxScrollWinEvent() {}
738 int GetOrientation() const { return (int) m_extraLong
; }
739 int GetPosition() const { return m_commandInt
; }
740 bool IsScrolling() const { return m_isScrolling
; }
741 void SetOrientation(int orient
) { m_extraLong
= (long) orient
; }
742 void SetPosition(int pos
) { m_commandInt
= pos
; }
743 void SetScrolling(bool isScrolling
) { m_isScrolling
= isScrolling
; }
745 void CopyObject(wxObject
& object_dest
) const;
747 int m_commandInt
; // Additional information
769 wxEVT_NC_MIDDLE_DOWN,
774 wxEVT_NC_ENTER_WINDOW,
775 wxEVT_NC_LEAVE_WINDOW,
776 wxEVT_NC_LEFT_DCLICK,
777 wxEVT_NC_MIDDLE_DCLICK,
778 wxEVT_NC_RIGHT_DCLICK,
781 class WXDLLEXPORT wxMouseEvent
: public wxEvent
783 DECLARE_DYNAMIC_CLASS(wxMouseEvent
)
786 wxMouseEvent(wxEventType mouseType
= wxEVT_NULL
);
788 // Was it a button event? (*doesn't* mean: is any button *down*?)
789 bool IsButton() const { return Button(-1); }
791 // Was it a down event from button 1, 2 or 3 or any?
792 bool ButtonDown(int but
= -1) const;
794 // Was it a dclick event from button 1, 2 or 3 or any?
795 bool ButtonDClick(int but
= -1) const;
797 // Was it a up event from button 1, 2 or 3 or any?
798 bool ButtonUp(int but
= -1) const;
800 // Was the given button 1,2,3 or any changing state?
801 bool Button(int but
) const;
803 // Was the given button 1,2,3 or any in Down state?
804 bool ButtonIsDown(int but
) const;
806 // Find state of shift/control keys
807 bool ControlDown() const { return m_controlDown
; }
808 bool MetaDown() const { return m_metaDown
; }
809 bool AltDown() const { return m_altDown
; }
810 bool ShiftDown() const { return m_shiftDown
; }
812 // Find which event was just generated
813 bool LeftDown() const { return (m_eventType
== wxEVT_LEFT_DOWN
); }
814 bool MiddleDown() const { return (m_eventType
== wxEVT_MIDDLE_DOWN
); }
815 bool RightDown() const { return (m_eventType
== wxEVT_RIGHT_DOWN
); }
817 bool LeftUp() const { return (m_eventType
== wxEVT_LEFT_UP
); }
818 bool MiddleUp() const { return (m_eventType
== wxEVT_MIDDLE_UP
); }
819 bool RightUp() const { return (m_eventType
== wxEVT_RIGHT_UP
); }
821 bool LeftDClick() const { return (m_eventType
== wxEVT_LEFT_DCLICK
); }
822 bool MiddleDClick() const { return (m_eventType
== wxEVT_MIDDLE_DCLICK
); }
823 bool RightDClick() const { return (m_eventType
== wxEVT_RIGHT_DCLICK
); }
825 // Find the current state of the mouse buttons (regardless
826 // of current event type)
827 bool LeftIsDown() const { return m_leftDown
; }
828 bool MiddleIsDown() const { return m_middleDown
; }
829 bool RightIsDown() const { return m_rightDown
; }
831 // True if a button is down and the mouse is moving
832 bool Dragging() const
834 return ((m_eventType
== wxEVT_MOTION
) &&
835 (LeftIsDown() || MiddleIsDown() || RightIsDown()));
838 // True if the mouse is moving, and no button is down
839 bool Moving() const { return (m_eventType
== wxEVT_MOTION
); }
841 // True if the mouse is just entering the window
842 bool Entering() const { return (m_eventType
== wxEVT_ENTER_WINDOW
); }
844 // True if the mouse is just leaving the window
845 bool Leaving() const { return (m_eventType
== wxEVT_LEAVE_WINDOW
); }
847 // Find the position of the event
848 void GetPosition(wxCoord
*xpos
, wxCoord
*ypos
) const
857 void GetPosition(long *xpos
, long *ypos
) const
866 // Find the position of the event
867 wxPoint
GetPosition() const { return wxPoint(m_x
, m_y
); }
869 // Find the logical position of the event given the DC
870 wxPoint
GetLogicalPosition(const wxDC
& dc
) const ;
873 #if WXWIN_COMPATIBILITY
874 void Position(long *xpos
, long *ypos
) const
882 void Position(float *xpos
, float *ypos
) const
884 *xpos
= (float) m_x
; *ypos
= (float) m_y
;
886 #endif // WXWIN_COMPATIBILITY
889 long GetX() const { return m_x
; }
892 long GetY() const { return m_y
; }
894 void CopyObject(wxObject
& obj
) const;
909 // Keyboard input event class
918 class WXDLLEXPORT wxKeyEvent
: public wxEvent
920 DECLARE_DYNAMIC_CLASS(wxKeyEvent
)
923 wxKeyEvent(wxEventType keyType
= wxEVT_NULL
);
925 // Find state of shift/control keys
926 bool ControlDown() const { return m_controlDown
; }
927 bool MetaDown() const { return m_metaDown
; }
928 bool AltDown() const { return m_altDown
; }
929 bool ShiftDown() const { return m_shiftDown
; }
930 long KeyCode() const { return m_keyCode
; }
932 // Find the position of the event
933 void GetPosition(wxCoord
*xpos
, wxCoord
*ypos
) const
935 if (xpos
) *xpos
= m_x
;
936 if (ypos
) *ypos
= m_y
;
940 void GetPosition(long *xpos
, long *ypos
) const
942 if (xpos
) *xpos
= (long)m_x
;
943 if (ypos
) *ypos
= (long)m_y
;
947 wxPoint
GetPosition() const
948 { return wxPoint(m_x
, m_y
); }
951 wxCoord
GetX() const { return m_x
; }
954 wxCoord
GetY() const { return m_y
; }
956 void CopyObject(wxObject
& obj
) const;
975 class WXDLLEXPORT wxSizeEvent
: public wxEvent
977 DECLARE_DYNAMIC_CLASS(wxSizeEvent
)
982 wxSizeEvent() { m_eventType
= wxEVT_SIZE
; }
983 wxSizeEvent(const wxSize
& sz
, int id
= 0)
985 { m_eventType
= wxEVT_SIZE
; m_id
= id
; }
987 wxSize
GetSize() const { return m_size
; }
989 void CopyObject(wxObject
& obj
) const;
998 class WXDLLEXPORT wxMoveEvent
: public wxEvent
1000 DECLARE_DYNAMIC_CLASS(wxMoveEvent
)
1005 wxMoveEvent() { m_eventType
= wxEVT_MOVE
; }
1006 wxMoveEvent(const wxPoint
& pos
, int id
= 0)
1008 { m_eventType
= wxEVT_MOVE
; m_id
= id
; }
1010 wxPoint
GetPosition() const { return m_pos
; }
1012 void CopyObject(wxObject
& obj
) const;
1015 // Paint event class
1022 #if defined(__WXDEBUG__) && defined(__WXMSW__)
1023 // see comments in src/msw/dcclient.cpp where g_isPainting is defined
1024 extern int g_isPainting
;
1027 class WXDLLEXPORT wxPaintEvent
: public wxEvent
1029 DECLARE_DYNAMIC_CLASS(wxPaintEvent
)
1032 wxPaintEvent(int Id
= 0)
1034 m_eventType
= wxEVT_PAINT
;
1037 #if defined(__WXDEBUG__) && defined(__WXMSW__)
1038 // set the internal flag for the duration of processing of WM_PAINT
1043 #if defined(__WXDEBUG__) && defined(__WXMSW__)
1051 // Erase background event class
1053 wxEVT_ERASE_BACKGROUND
1056 class WXDLLEXPORT wxEraseEvent
: public wxEvent
1058 DECLARE_DYNAMIC_CLASS(wxEraseEvent
)
1063 wxEraseEvent(int Id
= 0, wxDC
*dc
= (wxDC
*) NULL
)
1064 { m_eventType
= wxEVT_ERASE_BACKGROUND
; m_id
= Id
; m_dc
= dc
; }
1065 wxDC
*GetDC() const { return m_dc
; }
1067 void CopyObject(wxObject
& obj
) const;
1070 // Focus event class
1076 class WXDLLEXPORT wxFocusEvent
: public wxEvent
1078 DECLARE_DYNAMIC_CLASS(wxFocusEvent
)
1081 wxFocusEvent(wxEventType type
= wxEVT_NULL
, int Id
= 0)
1082 { m_eventType
= type
; m_id
= Id
; }
1085 // Activate event class
1091 class WXDLLEXPORT wxActivateEvent
: public wxEvent
1093 DECLARE_DYNAMIC_CLASS(wxActivateEvent
)
1096 wxActivateEvent(wxEventType type
= wxEVT_NULL
, bool active
= TRUE
, int Id
= 0)
1097 { m_eventType
= type
; m_active
= active
; m_id
= Id
; }
1098 bool GetActive() const { return m_active
; }
1100 void CopyObject(wxObject
& obj
) const;
1106 // InitDialog event class
1111 class WXDLLEXPORT wxInitDialogEvent
: public wxEvent
1113 DECLARE_DYNAMIC_CLASS(wxInitDialogEvent
)
1116 wxInitDialogEvent(int Id
= 0)
1117 { m_eventType
= wxEVT_INIT_DIALOG
; m_id
= Id
; }
1120 // Miscellaneous menu event class
1124 wxEVT_MENU_HIGHLIGHT,
1125 wxEVT_POPUP_MENU_INIT,
1129 class WXDLLEXPORT wxMenuEvent
: public wxEvent
1131 DECLARE_DYNAMIC_CLASS(wxMenuEvent
)
1134 wxMenuEvent(wxEventType type
= wxEVT_NULL
, int id
= 0)
1135 { m_eventType
= type
; m_menuId
= id
; }
1137 int GetMenuId() const { return m_menuId
; }
1139 void CopyObject(wxObject
& obj
) const;
1144 // Window close or session close event class
1148 wxEVT_QUERY_END_SESSION
1151 class WXDLLEXPORT wxCloseEvent
: public wxEvent
1153 DECLARE_DYNAMIC_CLASS(wxCloseEvent
)
1156 wxCloseEvent(wxEventType type
= wxEVT_NULL
, int id
= 0)
1159 m_loggingOff
= TRUE
;
1160 m_veto
= FALSE
; // should be FALSE by default
1162 #if WXWIN_COMPATIBILITY
1164 #endif // WXWIN_COMPATIBILITY
1168 void SetLoggingOff(bool logOff
) { m_loggingOff
= logOff
; }
1169 bool GetLoggingOff() const { return m_loggingOff
; }
1171 void Veto(bool veto
= TRUE
)
1173 // GetVeto() will return FALSE anyhow...
1174 wxCHECK_RET( m_canVeto
,
1175 wxT("call to Veto() ignored (can't veto this event)") );
1179 void SetCanVeto(bool canVeto
) { m_canVeto
= canVeto
; }
1180 // No more asserts here please, the one you put here was wrong.
1181 bool CanVeto() const { return m_canVeto
; }
1182 bool GetVeto() const { return m_canVeto
&& m_veto
; }
1184 #if WXWIN_COMPATIBILITY
1185 // This is probably obsolete now, since we use CanVeto instead, in
1186 // both OnCloseWindow and OnQueryEndSession.
1187 // m_force == ! m_canVeto i.e., can't veto means we must force it to close.
1188 void SetForce(bool force
) { m_force
= force
; }
1189 bool GetForce() const { return m_force
; }
1192 void CopyObject(wxObject
& obj
) const;
1196 bool m_veto
, m_canVeto
;
1198 #if WXWIN_COMPATIBILITY
1207 class WXDLLEXPORT wxShowEvent
: public wxEvent
1209 DECLARE_DYNAMIC_CLASS(wxShowEvent
)
1213 wxShowEvent(int id
= 0, bool show
= FALSE
)
1214 { m_eventType
= wxEVT_SHOW
; m_id
= id
; m_show
= show
; }
1216 void SetShow(bool show
) { m_show
= show
; }
1217 bool GetShow() const { return m_show
; }
1219 void CopyObject(wxObject
& obj
) const;
1229 class WXDLLEXPORT wxIconizeEvent
: public wxEvent
1231 DECLARE_DYNAMIC_CLASS(wxIconizeEvent
)
1234 wxIconizeEvent(int id
= 0)
1235 { m_eventType
= wxEVT_ICONIZE
; m_id
= id
; }
1242 class WXDLLEXPORT wxMaximizeEvent
: public wxEvent
1244 DECLARE_DYNAMIC_CLASS(wxMaximizeEvent
)
1247 wxMaximizeEvent(int id
= 0)
1248 { m_eventType
= wxEVT_MAXIMIZE
; m_id
= id
; }
1251 // Joystick event class
1253 wxEVT_JOY_BUTTON_DOWN,
1254 wxEVT_JOY_BUTTON_UP,
1259 // Which joystick? Same as Windows ids so no conversion necessary.
1260 #define wxJOYSTICK1 0
1261 #define wxJOYSTICK2 1
1263 // Which button is down?
1264 #define wxJOY_BUTTON1 1
1265 #define wxJOY_BUTTON2 2
1266 #define wxJOY_BUTTON3 4
1267 #define wxJOY_BUTTON4 8
1268 #define wxJOY_BUTTON_ANY -1
1270 class WXDLLEXPORT wxJoystickEvent
: public wxEvent
1272 DECLARE_DYNAMIC_CLASS(wxJoystickEvent
)
1277 int m_buttonChange
; // Which button changed?
1278 int m_buttonState
; // Which buttons are down?
1279 int m_joyStick
; // Which joystick?
1281 wxJoystickEvent(wxEventType type
= wxEVT_NULL
,
1283 int joystick
= wxJOYSTICK1
,
1287 m_buttonState
= state
;
1288 m_pos
= wxPoint(0,0);
1290 m_joyStick
= joystick
;
1291 m_buttonChange
= change
;
1294 wxPoint
GetPosition() const { return m_pos
; }
1295 int GetZPosition() const { return m_zPosition
; }
1296 int GetButtonState() const { return m_buttonState
; }
1297 int GetButtonChange() const { return m_buttonChange
; }
1298 int GetJoystick() const { return m_joyStick
; }
1300 void SetJoystick(int stick
) { m_joyStick
= stick
; }
1301 void SetButtonState(int state
) { m_buttonState
= state
; }
1302 void SetButtonChange(int change
) { m_buttonChange
= change
; }
1303 void SetPosition(const wxPoint
& pos
) { m_pos
= pos
; }
1304 void SetZPosition(int zPos
) { m_zPosition
= zPos
; }
1306 // Was it a button event? (*doesn't* mean: is any button *down*?)
1307 bool IsButton() const { return ((GetEventType() == wxEVT_JOY_BUTTON_DOWN
) ||
1308 (GetEventType() == wxEVT_JOY_BUTTON_UP
)); }
1310 // Was it a move event?
1311 bool IsMove() const { return (GetEventType() == wxEVT_JOY_MOVE
) ; }
1313 // Was it a zmove event?
1314 bool IsZMove() const { return (GetEventType() == wxEVT_JOY_ZMOVE
) ; }
1316 // Was it a down event from button 1, 2, 3, 4 or any?
1317 bool ButtonDown(int but
= wxJOY_BUTTON_ANY
) const
1318 { return ((GetEventType() == wxEVT_JOY_BUTTON_DOWN
) &&
1319 ((but
== wxJOY_BUTTON_ANY
) || (but
== m_buttonChange
))); }
1321 // Was it a up event from button 1, 2, 3 or any?
1322 bool ButtonUp(int but
= wxJOY_BUTTON_ANY
) const
1323 { return ((GetEventType() == wxEVT_JOY_BUTTON_UP
) &&
1324 ((but
== wxJOY_BUTTON_ANY
) || (but
== m_buttonChange
))); }
1326 // Was the given button 1,2,3,4 or any in Down state?
1327 bool ButtonIsDown(int but
= wxJOY_BUTTON_ANY
) const
1328 { return (((but
== wxJOY_BUTTON_ANY
) && (m_buttonState
!= 0)) ||
1329 ((m_buttonState
& but
) == but
)); }
1331 void CopyObject(wxObject
& obj
) const;
1334 // Drop files event class
1339 class WXDLLEXPORT wxDropFilesEvent
: public wxEvent
1341 DECLARE_DYNAMIC_CLASS(wxDropFilesEvent
)
1346 wxString
* m_files
; // Memory (de)allocated by code calling ProcessEvent
1348 wxDropFilesEvent(wxEventType type
= wxEVT_NULL
,
1350 wxString
*files
= (wxString
*) NULL
)
1351 { m_eventType
= type
; m_noFiles
= noFiles
; m_files
= files
; }
1353 wxPoint
GetPosition() const { return m_pos
; }
1354 int GetNumberOfFiles() const { return m_noFiles
; }
1355 wxString
*GetFiles() const { return m_files
; }
1357 void CopyObject(wxObject
& obj
) const;
1365 class WXDLLEXPORT wxUpdateUIEvent
: public wxCommandEvent
1367 DECLARE_DYNAMIC_CLASS(wxUpdateUIEvent
)
1370 wxUpdateUIEvent(wxWindowID commandId
= 0)
1372 m_eventType
= wxEVT_UPDATE_UI
;
1375 m_setChecked
= FALSE
;
1377 m_setEnabled
= FALSE
;
1382 bool GetChecked() const { return m_checked
; }
1383 bool GetEnabled() const { return m_enabled
; }
1384 wxString
GetText() const { return m_text
; }
1385 bool GetSetText() const { return m_setText
; }
1386 bool GetSetChecked() const { return m_setChecked
; }
1387 bool GetSetEnabled() const { return m_setEnabled
; }
1389 void Check(bool check
) { m_checked
= check
; m_setChecked
= TRUE
; }
1390 void Enable(bool enable
) { m_enabled
= enable
; m_setEnabled
= TRUE
; }
1391 void SetText(const wxString
& text
) { m_text
= text
; m_setText
= TRUE
; }
1393 void CopyObject(wxObject
& obj
) const;
1405 wxEVT_SYS_COLOUR_CHANGED
1408 // TODO: shouldn't all events record the window ID?
1409 class WXDLLEXPORT wxSysColourChangedEvent
: public wxEvent
1411 DECLARE_DYNAMIC_CLASS(wxSysColourChangedEvent
)
1414 wxSysColourChangedEvent()
1415 { m_eventType
= wxEVT_SYS_COLOUR_CHANGED
; }
1419 wxEVT_PALETTE_CHANGED
1422 class WXDLLEXPORT wxPaletteChangedEvent
: public wxEvent
1424 DECLARE_DYNAMIC_CLASS(wxPaletteChangedEvent
)
1427 wxPaletteChangedEvent(wxWindowID id
= 0) : wxEvent(id
)
1429 m_eventType
= wxEVT_PALETTE_CHANGED
;
1430 m_changedWindow
= (wxWindow
*) NULL
;
1433 void SetChangedWindow(wxWindow
* win
) { m_changedWindow
= win
; }
1434 wxWindow
* GetChangedWindow() const { return m_changedWindow
; }
1436 void CopyObject(wxObject
& obj
) const;
1439 wxWindow
* m_changedWindow
;
1443 wxEVT_QUERY_NEW_PALETTE
1444 Indicates the window is getting keyboard focus and should re-do its palette.
1447 class WXDLLEXPORT wxQueryNewPaletteEvent
: public wxEvent
1449 DECLARE_DYNAMIC_CLASS(wxQueryNewPaletteEvent
)
1452 wxQueryNewPaletteEvent(wxWindowID id
= 0): wxEvent(id
)
1453 { m_eventType
= wxEVT_QUERY_NEW_PALETTE
; m_paletteRealized
= FALSE
; }
1455 // App sets this if it changes the palette.
1456 void SetPaletteRealized(bool realized
) { m_paletteRealized
= realized
; }
1457 bool GetPaletteRealized() const { return m_paletteRealized
; }
1459 void CopyObject(wxObject
& obj
) const;
1462 bool m_paletteRealized
;
1466 Event generated by dialog navigation keys
1467 wxEVT_NAVIGATION_KEY
1469 // NB: don't derive from command event to avoid being propagated to the parent
1470 class WXDLLEXPORT wxNavigationKeyEvent
: public wxEvent
1473 wxNavigationKeyEvent()
1475 SetEventType(wxEVT_NAVIGATION_KEY
);
1477 m_flags
= IsForward
| Propagate
; // defaults are for TAB
1478 m_focus
= (wxWindow
*)NULL
;
1481 // direction: forward (true) or backward (false)
1482 bool GetDirection() const
1483 { return (m_flags
& IsForward
) != 0; }
1484 void SetDirection(bool bForward
)
1485 { if ( bForward
) m_flags
|= IsForward
; else m_flags
&= ~IsForward
; }
1487 // it may be a window change event (MDI, notebook pages...) or a control
1489 bool IsWindowChange() const
1490 { return (m_flags
& WinChange
) != 0; }
1491 void SetWindowChange(bool bIs
)
1492 { if ( bIs
) m_flags
|= WinChange
; else m_flags
&= ~WinChange
; }
1494 // some navigation events are meant to be propagated upwards (Windows
1495 // convention is to do this for TAB events) while others should always
1496 // cycle inside the panel/radiobox/whatever we're current inside
1497 bool ShouldPropagate() const
1498 { return (m_flags
& Propagate
) != 0; }
1499 void SetPropagate(bool bDoIt
)
1500 { if ( bDoIt
) m_flags
|= Propagate
; else m_flags
&= ~Propagate
; }
1502 // the child which has the focus currently (may be NULL - use
1503 // wxWindow::FindFocus then)
1504 wxWindow
* GetCurrentFocus() const { return m_focus
; }
1505 void SetCurrentFocus(wxWindow
*win
) { m_focus
= win
; }
1518 DECLARE_DYNAMIC_CLASS(wxNavigationKeyEvent
)
1521 // Window creation/destruction events: the first is sent as soon as window is
1522 // created (i.e. the underlying GUI object exists), but when the C++ object is
1523 // fully initialized (so virtual functions may be called). The second,
1524 // wxEVT_DESTROY, is sent right before the window is destroyed - again, it's
1525 // still safe to call virtual functions at this moment
1531 class WXDLLEXPORT wxWindowCreateEvent
: public wxEvent
1533 DECLARE_DYNAMIC_CLASS(wxWindowCreateEvent
)
1536 wxWindowCreateEvent(wxWindow
*win
= NULL
);
1538 wxWindow
*GetWindow() const { return (wxWindow
*)GetEventObject(); }
1541 class WXDLLEXPORT wxWindowDestroyEvent
: public wxEvent
1543 DECLARE_DYNAMIC_CLASS(wxWindowDestroyEvent
)
1546 wxWindowDestroyEvent(wxWindow
*win
= NULL
);
1548 wxWindow
*GetWindow() const { return (wxWindow
*)GetEventObject(); }
1558 class WXDLLEXPORT wxIdleEvent
: public wxEvent
1560 DECLARE_DYNAMIC_CLASS(wxIdleEvent
)
1564 { m_eventType
= wxEVT_IDLE
; m_requestMore
= FALSE
; }
1566 void RequestMore(bool needMore
= TRUE
) { m_requestMore
= needMore
; }
1567 bool MoreRequested() const { return m_requestMore
; }
1569 void CopyObject(wxObject
& obj
) const;
1577 wxEVT_MOUSE_CAPTURE_CHANGED,
1578 wxEVT_SETTING_CHANGED, // WM_WININICHANGE (NT) / WM_SETTINGCHANGE (Win95)
1579 // wxEVT_FONT_CHANGED, // WM_FONTCHANGE: roll into wxEVT_SETTING_CHANGED, but remember to propagate
1580 // wxEVT_FONT_CHANGED to all other windows (maybe).
1581 wxEVT_DRAW_ITEM, // Leave these three as virtual functions in wxControl?? Platform-specific.
1586 // ============================================================================
1587 // event handler and related classes
1588 // ============================================================================
1590 typedef void (wxObject::*wxObjectEventFunction
)(wxEvent
&);
1592 struct WXDLLEXPORT wxEventTableEntry
1594 // For some reason, this can't be wxEventType, or VC++ complains.
1595 int m_eventType
; // main event type
1596 int m_id
; // control/menu/toolbar id
1597 int m_lastId
; // used for ranges of ids
1598 wxObjectEventFunction m_fn
; // function to call: not wxEventFunction,
1599 // because of dependency problems
1601 wxObject
* m_callbackUserData
;
1604 struct WXDLLEXPORT wxEventTable
1606 const wxEventTable
*baseTable
; // Points to base event table (next in chain)
1607 const wxEventTableEntry
*entries
; // Points to bottom of entry array
1610 class WXDLLEXPORT wxEvtHandler
: public wxObject
1612 DECLARE_DYNAMIC_CLASS(wxEvtHandler
)
1618 wxEvtHandler
*GetNextHandler() const { return m_nextHandler
; }
1619 wxEvtHandler
*GetPreviousHandler() const { return m_previousHandler
; }
1620 void SetNextHandler(wxEvtHandler
*handler
) { m_nextHandler
= handler
; }
1621 void SetPreviousHandler(wxEvtHandler
*handler
) { m_previousHandler
= handler
; }
1623 void SetEvtHandlerEnabled(bool enabled
) { m_enabled
= enabled
; }
1624 bool GetEvtHandlerEnabled() const { return m_enabled
; }
1626 // process an event right now
1627 virtual bool ProcessEvent(wxEvent
& event
);
1629 // add an event to be processed later
1630 void AddPendingEvent(wxEvent
& event
);
1632 // process all pending events
1633 void ProcessPendingEvents();
1637 bool ProcessThreadEvent(wxEvent
& event
);
1640 // Dynamic association of a member function handler with the event handler,
1641 // id and event type
1642 void Connect( int id
, int lastId
, wxEventType eventType
,
1643 wxObjectEventFunction func
,
1644 wxObject
*userData
= (wxObject
*) NULL
);
1646 // Convenience function: take just one id
1647 void Connect( int id
, wxEventType eventType
,
1648 wxObjectEventFunction func
,
1649 wxObject
*userData
= (wxObject
*) NULL
)
1650 { Connect(id
, -1, eventType
, func
, userData
); }
1652 bool Disconnect( int id
, int lastId
= -1, wxEventType eventType
= wxEVT_NULL
,
1653 wxObjectEventFunction func
= NULL
,
1654 wxObject
*userData
= (wxObject
*) NULL
);
1656 // Convenience function: take just one id
1657 bool Disconnect( int id
, wxEventType eventType
= wxEVT_NULL
,
1658 wxObjectEventFunction func
= NULL
,
1659 wxObject
*userData
= (wxObject
*) NULL
)
1660 { return Disconnect(id
, -1, eventType
, func
, userData
); }
1662 // implementation from now on
1663 virtual bool SearchEventTable(wxEventTable
& table
, wxEvent
& event
);
1664 bool SearchDynamicEventTable( wxEvent
& event
);
1667 void ClearEventLocker()
1669 # if !defined(__VISAGECPP__)
1670 delete m_eventsLocker
;
1671 m_eventsLocker
= NULL
;
1678 #if WXWIN_COMPATIBILITY_2
1679 virtual void OnCommand(wxWindow
& WXUNUSED(win
),
1680 wxCommandEvent
& WXUNUSED(event
))
1682 wxFAIL_MSG(wxT("shouldn't be called any more"));
1685 // Called if child control has no callback function
1686 virtual long Default()
1687 { return GetNextHandler() ? GetNextHandler()->Default() : 0; };
1688 #endif // WXWIN_COMPATIBILITY_2
1690 #if WXWIN_COMPATIBILITY
1691 virtual bool OnClose();
1695 static const wxEventTableEntry sm_eventTableEntries
[];
1698 static const wxEventTable sm_eventTable
;
1700 virtual const wxEventTable
*GetEventTable() const;
1703 wxEvtHandler
* m_nextHandler
;
1704 wxEvtHandler
* m_previousHandler
;
1705 wxList
* m_dynamicEvents
;
1706 wxList
* m_pendingEvents
;
1708 #if defined (__VISAGECPP__)
1709 wxCriticalSection m_eventsLocker
;
1711 wxCriticalSection
* m_eventsLocker
;
1715 // optimization: instead of using costly IsKindOf() to decide whether we're
1716 // a window (which is true in 99% of cases), use this flag
1719 // Is event handler enabled?
1723 typedef void (wxEvtHandler::*wxEventFunction
)(wxEvent
&);
1725 typedef void (wxEvtHandler::*wxCommandEventFunction
)(wxCommandEvent
&);
1726 typedef void (wxEvtHandler::*wxScrollEventFunction
)(wxScrollEvent
&);
1727 typedef void (wxEvtHandler::*wxScrollWinEventFunction
)(wxScrollWinEvent
&);
1728 typedef void (wxEvtHandler::*wxSizeEventFunction
)(wxSizeEvent
&);
1729 typedef void (wxEvtHandler::*wxMoveEventFunction
)(wxMoveEvent
&);
1730 typedef void (wxEvtHandler::*wxPaintEventFunction
)(wxPaintEvent
&);
1731 typedef void (wxEvtHandler::*wxEraseEventFunction
)(wxEraseEvent
&);
1732 typedef void (wxEvtHandler::*wxMouseEventFunction
)(wxMouseEvent
&);
1733 typedef void (wxEvtHandler::*wxCharEventFunction
)(wxKeyEvent
&);
1734 typedef void (wxEvtHandler::*wxFocusEventFunction
)(wxFocusEvent
&);
1735 typedef void (wxEvtHandler::*wxActivateEventFunction
)(wxActivateEvent
&);
1736 typedef void (wxEvtHandler::*wxMenuEventFunction
)(wxMenuEvent
&);
1737 typedef void (wxEvtHandler::*wxJoystickEventFunction
)(wxJoystickEvent
&);
1738 typedef void (wxEvtHandler::*wxDropFilesEventFunction
)(wxDropFilesEvent
&);
1739 typedef void (wxEvtHandler::*wxInitDialogEventFunction
)(wxInitDialogEvent
&);
1740 typedef void (wxEvtHandler::*wxSysColourChangedFunction
)(wxSysColourChangedEvent
&);
1741 typedef void (wxEvtHandler::*wxUpdateUIEventFunction
)(wxUpdateUIEvent
&);
1742 typedef void (wxEvtHandler::*wxIdleEventFunction
)(wxIdleEvent
&);
1743 typedef void (wxEvtHandler::*wxCloseEventFunction
)(wxCloseEvent
&);
1744 typedef void (wxEvtHandler::*wxShowEventFunction
)(wxShowEvent
&);
1745 typedef void (wxEvtHandler::*wxIconizeEventFunction
)(wxShowEvent
&);
1746 typedef void (wxEvtHandler::*wxMaximizeEventFunction
)(wxShowEvent
&);
1747 typedef void (wxEvtHandler::*wxNavigationKeyEventFunction
)(wxNavigationKeyEvent
&);
1748 typedef void (wxEvtHandler::*wxPaletteChangedEventFunction
)(wxPaletteChangedEvent
&);
1749 typedef void (wxEvtHandler::*wxQueryNewPaletteEventFunction
)(wxQueryNewPaletteEvent
&);
1752 // N.B. In GNU-WIN32, you *have* to take the address of a member function
1753 // (use &) or the compiler crashes...
1755 #define DECLARE_EVENT_TABLE() \
1757 static const wxEventTableEntry sm_eventTableEntries[];\
1759 static const wxEventTable sm_eventTable;\
1760 virtual const wxEventTable* GetEventTable() const;
1762 #define BEGIN_EVENT_TABLE(theClass, baseClass) \
1763 const wxEventTable *theClass::GetEventTable() const { return &theClass::sm_eventTable; }\
1764 const wxEventTable theClass::sm_eventTable =\
1765 { &baseClass::sm_eventTable, &theClass::sm_eventTableEntries[0] };\
1766 const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
1768 #define END_EVENT_TABLE() \
1769 { 0, 0, 0, 0, 0 } };
1772 * Event table macros
1776 #define EVT_CUSTOM(event, id, func) { event, id, -1, (wxObjectEventFunction) (wxEventFunction) & func, (wxObject *) NULL },
1777 #define EVT_CUSTOM_RANGE(event, id1, id2, func) { event, id1, id2, (wxObjectEventFunction) (wxEventFunction) & func, (wxObject *) NULL },
1780 #define EVT_SIZE(func) { wxEVT_SIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxSizeEventFunction) & func, (wxObject *) NULL },
1781 #define EVT_MOVE(func) { wxEVT_MOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMoveEventFunction) & func, (wxObject *) NULL },
1782 #define EVT_CLOSE(func) { wxEVT_CLOSE_WINDOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL },
1783 #define EVT_END_SESSION(func) { wxEVT_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL },
1784 #define EVT_QUERY_END_SESSION(func) { wxEVT_QUERY_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL },
1785 #define EVT_PAINT(func) { wxEVT_PAINT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxPaintEventFunction) & func, (wxObject *) NULL },
1786 #define EVT_ERASE_BACKGROUND(func) { wxEVT_ERASE_BACKGROUND, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxEraseEventFunction) & func, (wxObject *) NULL },
1787 #define EVT_CHAR(func) { wxEVT_CHAR, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, (wxObject *) NULL },
1788 #define EVT_KEY_DOWN(func) { wxEVT_KEY_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, (wxObject *) NULL },
1789 #define EVT_KEY_UP(func) { wxEVT_KEY_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, (wxObject *) NULL },
1790 #define EVT_CHAR_HOOK(func) { wxEVT_CHAR_HOOK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCharEventFunction) & func, NULL },
1791 #define EVT_MENU_HIGHLIGHT(id, func) { wxEVT_MENU_HIGHLIGHT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxMenuEventFunction) & func, (wxObject *) NULL },
1792 #define EVT_MENU_HIGHLIGHT_ALL(func) { wxEVT_MENU_HIGHLIGHT, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMenuEventFunction) & func, (wxObject *) NULL },
1793 #define EVT_SET_FOCUS(func) { wxEVT_SET_FOCUS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxFocusEventFunction) & func, (wxObject *) NULL },
1794 #define EVT_KILL_FOCUS(func) { wxEVT_KILL_FOCUS, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxFocusEventFunction) & func, (wxObject *) NULL },
1795 #define EVT_ACTIVATE(func) { wxEVT_ACTIVATE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxActivateEventFunction) & func, (wxObject *) NULL },
1796 #define EVT_ACTIVATE_APP(func) { wxEVT_ACTIVATE_APP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxActivateEventFunction) & func, (wxObject *) NULL },
1797 #define EVT_END_SESSION(func) { wxEVT_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL },
1798 #define EVT_QUERY_END_SESSION(func) { wxEVT_QUERY_END_SESSION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCloseEventFunction) & func, (wxObject *) NULL },
1799 #define EVT_DROP_FILES(func) { wxEVT_DROP_FILES, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxDropFilesEventFunction) & func, (wxObject *) NULL },
1800 #define EVT_INIT_DIALOG(func) { wxEVT_INIT_DIALOG, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxInitDialogEventFunction) & func, (wxObject *) NULL },
1801 #define EVT_SYS_COLOUR_CHANGED(func) { wxEVT_SYS_COLOUR_CHANGED, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxSysColourChangedFunction) & func, (wxObject *) NULL },
1802 #define EVT_SHOW(func) { wxEVT_SHOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxShowEventFunction) & func, (wxObject *) NULL },
1803 #define EVT_MAXIMIZE(func) { wxEVT_MAXIMIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMaximizeEventFunction) & func, (wxObject *) NULL },
1804 #define EVT_ICONIZE(func) { wxEVT_ICONIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIconizeEventFunction) & func, (wxObject *) NULL },
1805 #define EVT_NAVIGATION_KEY(func) { wxEVT_NAVIGATION_KEY, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNavigationKeyEventFunction) & func, (wxObject *) NULL },
1806 #define EVT_PALETTE_CHANGED(func) { wxEVT_PALETTE_CHANGED, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxPaletteChangedEventFunction) & func, (wxObject *) NULL },
1807 #define EVT_QUERY_NEW_PALETTE(func) { wxEVT_QUERY_NEW_PALETTE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxQueryNewPaletteEventFunction) & func, (wxObject *) NULL },
1808 #define EVT_WINDOW_CREATE(func) { wxEVT_CREATE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxQueryNewPaletteEventFunction) & func, (wxObject *) NULL },
1809 #define EVT_WINDOW_DESTROY(func) { wxEVT_DESTROY, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxQueryNewPaletteEventFunction) & func, (wxObject *) NULL },
1812 #define EVT_LEFT_DOWN(func) { wxEVT_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1813 #define EVT_LEFT_UP(func) { wxEVT_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1814 #define EVT_MIDDLE_DOWN(func) { wxEVT_MIDDLE_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1815 #define EVT_MIDDLE_UP(func) { wxEVT_MIDDLE_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1816 #define EVT_RIGHT_DOWN(func) { wxEVT_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1817 #define EVT_RIGHT_UP(func) { wxEVT_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1818 #define EVT_MOTION(func) { wxEVT_MOTION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1819 #define EVT_LEFT_DCLICK(func) { wxEVT_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1820 #define EVT_MIDDLE_DCLICK(func) { wxEVT_MIDDLE_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1821 #define EVT_RIGHT_DCLICK(func) { wxEVT_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1822 #define EVT_LEAVE_WINDOW(func) { wxEVT_LEAVE_WINDOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1823 #define EVT_ENTER_WINDOW(func) { wxEVT_ENTER_WINDOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1826 #define EVT_MOUSE_EVENTS(func) \
1827 { wxEVT_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1828 { wxEVT_LEFT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1829 { wxEVT_MIDDLE_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1830 { wxEVT_MIDDLE_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1831 { wxEVT_RIGHT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1832 { wxEVT_RIGHT_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1833 { wxEVT_MOTION, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1834 { wxEVT_LEFT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1835 { wxEVT_MIDDLE_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1836 { wxEVT_RIGHT_DCLICK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1837 { wxEVT_ENTER_WINDOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },\
1838 { wxEVT_LEAVE_WINDOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, (wxObject *) NULL },
1841 #define EVT_COMMAND(id, event, fn) { event, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1842 #define EVT_COMMAND_RANGE(id1, id2, event, fn) { event, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1844 // Scrolling from wxWindow (sent to wxScrolledWindow)
1845 #define EVT_SCROLLWIN(func) \
1846 { wxEVT_SCROLLWIN_TOP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1847 { wxEVT_SCROLLWIN_BOTTOM, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1848 { wxEVT_SCROLLWIN_LINEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1849 { wxEVT_SCROLLWIN_LINEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1850 { wxEVT_SCROLLWIN_PAGEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1851 { wxEVT_SCROLLWIN_PAGEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },\
1852 { wxEVT_SCROLLWIN_THUMBTRACK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1854 #define EVT_SCROLLWIN_TOP(func) { wxEVT_SCROLLWIN_TOP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1855 #define EVT_SCROLLWIN_BOTTOM(func) { wxEVT_SCROLLWIN_BOTTOM, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1856 #define EVT_SCROLLWIN_LINEUP(func) { wxEVT_SCROLLWIN_LINEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1857 #define EVT_SCROLLWIN_LINEDOWN(func) { wxEVT_SCROLLWIN_LINEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1858 #define EVT_SCROLLWIN_PAGEUP(func) { wxEVT_SCROLLWIN_PAGEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1859 #define EVT_SCROLLWIN_PAGEDOWN(func) { wxEVT_SCROLLWIN_PAGEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1860 #define EVT_SCROLLWIN_THUMBTRACK(func) { wxEVT_SCROLLWIN_THUMBTRACK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollWinEventFunction) & func, (wxObject *) NULL },
1862 // Scrolling from wxSlider and wxScrollBar
1863 #define EVT_SCROLL(func) \
1864 { wxEVT_SCROLL_TOP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1865 { wxEVT_SCROLL_BOTTOM, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1866 { wxEVT_SCROLL_LINEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1867 { wxEVT_SCROLL_LINEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1868 { wxEVT_SCROLL_PAGEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1869 { wxEVT_SCROLL_PAGEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1870 { wxEVT_SCROLL_THUMBTRACK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1872 #define EVT_SCROLL_TOP(func) { wxEVT_SCROLL_TOP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1873 #define EVT_SCROLL_BOTTOM(func) { wxEVT_SCROLL_BOTTOM, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1874 #define EVT_SCROLL_LINEUP(func) { wxEVT_SCROLL_LINEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1875 #define EVT_SCROLL_LINEDOWN(func) { wxEVT_SCROLL_LINEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1876 #define EVT_SCROLL_PAGEUP(func) { wxEVT_SCROLL_PAGEUP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1877 #define EVT_SCROLL_PAGEDOWN(func) { wxEVT_SCROLL_PAGEDOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1878 #define EVT_SCROLL_THUMBTRACK(func) { wxEVT_SCROLL_THUMBTRACK, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1880 // Scrolling from wxSlider and wxScrollBar, with an id
1881 #define EVT_COMMAND_SCROLL(id, func) \
1882 { wxEVT_SCROLL_TOP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1883 { wxEVT_SCROLL_BOTTOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1884 { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1885 { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1886 { wxEVT_SCROLL_PAGEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1887 { wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },\
1888 { wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1890 #define EVT_COMMAND_SCROLL_TOP(id, func) { wxEVT_SCROLL_TOP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1891 #define EVT_COMMAND_SCROLL_BOTTOM(id, func) { wxEVT_SCROLL_BOTTOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1892 #define EVT_COMMAND_SCROLL_LINEUP(id, func) { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1893 #define EVT_COMMAND_SCROLL_LINEDOWN(id, func) { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1894 #define EVT_COMMAND_SCROLL_PAGEUP(id, func) { wxEVT_SCROLL_PAGEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1895 #define EVT_COMMAND_SCROLL_PAGEDOWN(id, func) { wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1896 #define EVT_COMMAND_SCROLL_THUMBTRACK(id, func) { wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxScrollEventFunction) & func, (wxObject *) NULL },
1898 // Convenience macros for commonly-used commands
1899 #define EVT_BUTTON(id, fn) { wxEVT_COMMAND_BUTTON_CLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1900 #define EVT_CHECKBOX(id, fn) { wxEVT_COMMAND_CHECKBOX_CLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1901 #define EVT_CHOICE(id, fn) { wxEVT_COMMAND_CHOICE_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1902 #define EVT_LISTBOX(id, fn) { wxEVT_COMMAND_LISTBOX_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1903 #define EVT_LISTBOX_DCLICK(id, fn) { wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1904 #define EVT_TEXT(id, fn) { wxEVT_COMMAND_TEXT_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1905 #define EVT_TEXT_ENTER(id, fn) { wxEVT_COMMAND_TEXT_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1906 #define EVT_MENU(id, fn) { wxEVT_COMMAND_MENU_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1907 #define EVT_MENU_RANGE(id1, id2, fn) { wxEVT_COMMAND_MENU_SELECTED, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1908 #define EVT_SLIDER(id, fn) { wxEVT_COMMAND_SLIDER_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1909 #define EVT_RADIOBOX(id, fn) { wxEVT_COMMAND_RADIOBOX_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1910 #define EVT_RADIOBUTTON(id, fn) { wxEVT_COMMAND_RADIOBUTTON_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1911 // EVT_SCROLLBAR is now obsolete since we use EVT_COMMAND_SCROLL... events
1912 #define EVT_SCROLLBAR(id, fn) { wxEVT_COMMAND_SCROLLBAR_UPDATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1913 #define EVT_VLBOX(id, fn) { wxEVT_COMMAND_VLBOX_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1914 #define EVT_COMBOBOX(id, fn) { wxEVT_COMMAND_COMBOBOX_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1915 #define EVT_TOOL(id, fn) { wxEVT_COMMAND_TOOL_CLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1916 #define EVT_TOOL_RANGE(id1, id2, fn) { wxEVT_COMMAND_TOOL_CLICKED, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1917 #define EVT_TOOL_RCLICKED(id, fn) { wxEVT_COMMAND_TOOL_RCLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1918 #define EVT_TOOL_RCLICKED_RANGE(id1, id2, fn) { wxEVT_COMMAND_TOOL_RCLICKED, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1919 #define EVT_TOOL_ENTER(id, fn) { wxEVT_COMMAND_TOOL_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1920 #define EVT_CHECKLISTBOX(id, fn) { wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1922 // Generic command events
1923 #define EVT_COMMAND_LEFT_CLICK(id, fn) { wxEVT_COMMAND_LEFT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1924 #define EVT_COMMAND_LEFT_DCLICK(id, fn) { wxEVT_COMMAND_LEFT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1925 #define EVT_COMMAND_RIGHT_CLICK(id, fn) { wxEVT_COMMAND_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1926 #define EVT_COMMAND_RIGHT_DCLICK(id, fn) { wxEVT_COMMAND_RIGHT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1927 #define EVT_COMMAND_SET_FOCUS(id, fn) { wxEVT_COMMAND_SET_FOCUS, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1928 #define EVT_COMMAND_KILL_FOCUS(id, fn) { wxEVT_COMMAND_KILL_FOCUS, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1929 #define EVT_COMMAND_ENTER(id, fn) { wxEVT_COMMAND_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, (wxObject *) NULL },
1932 #define EVT_JOY_DOWN(func) \
1933 { wxEVT_JOY_BUTTON_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },
1934 #define EVT_JOY_UP(func) \
1935 { wxEVT_JOY_BUTTON_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },
1936 #define EVT_JOY_MOVE(func) \
1937 { wxEVT_JOY_MOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },
1938 #define EVT_JOY_ZMOVE(func) \
1939 { wxEVT_JOY_ZMOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },
1941 // All joystick events
1942 #define EVT_JOYSTICK_EVENTS(func) \
1943 { wxEVT_JOY_BUTTON_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
1944 { wxEVT_JOY_BUTTON_UP, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
1945 { wxEVT_JOY_MOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
1946 { wxEVT_JOY_ZMOVE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxJoystickEventFunction) & func, (wxObject *) NULL },\
1949 #define EVT_IDLE(func) \
1950 { wxEVT_IDLE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) & func, (wxObject *) NULL },\
1953 #define EVT_UPDATE_UI(id, func) \
1954 { wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, (wxObject *) NULL },\
1956 // ----------------------------------------------------------------------------
1958 // ----------------------------------------------------------------------------
1960 // for pending event processing - notice that there is intentionally no
1962 extern wxList
*wxPendingEvents
;
1964 extern wxCriticalSection
*wxPendingEventsLocker
;
1967 // ----------------------------------------------------------------------------
1969 // ----------------------------------------------------------------------------
1973 // Find a window with the focus, that is also a descendant of the given window.
1974 // This is used to determine the window to initially send commands to.
1975 wxWindow
* wxFindFocusDescendant(wxWindow
* ancestor
);