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