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