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