]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/_event.i
Typo fix.
[wxWidgets.git] / wxPython / src / _event.i
CommitLineData
d14a1e28
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: _event.i
3// Purpose: SWIG interface for common event classes and event binders
4//
5// Author: Robin Dunn
6//
7// Created: 24-May-1998
8// RCS-ID: $Id$
9// Copyright: (c) 2003 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
13// Not a %module
14
15
16//---------------------------------------------------------------------------
17// Include some extra python code here
18%pythoncode "_event_ex.py"
19
20//---------------------------------------------------------------------------
21%newgroup;
22
23// the predefined constants for the number of times we propagate event
24// upwards window child-parent chain
25enum Propagation_state
26{
27 // don't propagate it at all
28 wxEVENT_PROPAGATE_NONE = 0,
29
30 // propagate it until it is processed
31 wxEVENT_PROPAGATE_MAX = INT_MAX
32};
33
34
35//---------------------------------------------------------------------------
36// Event types
37
38wxEventType wxNewEventType();
39
40
41%constant wxEventType wxEVT_NULL;
42%constant wxEventType wxEVT_FIRST;
43%constant wxEventType wxEVT_USER_FIRST;
44
45%constant wxEventType wxEVT_COMMAND_BUTTON_CLICKED;
46%constant wxEventType wxEVT_COMMAND_CHECKBOX_CLICKED;
47%constant wxEventType wxEVT_COMMAND_CHOICE_SELECTED;
48%constant wxEventType wxEVT_COMMAND_LISTBOX_SELECTED;
49%constant wxEventType wxEVT_COMMAND_LISTBOX_DOUBLECLICKED;
50%constant wxEventType wxEVT_COMMAND_CHECKLISTBOX_TOGGLED;
51
52%constant wxEventType wxEVT_COMMAND_MENU_SELECTED;
53%constant wxEventType wxEVT_COMMAND_TOOL_CLICKED;
54%constant wxEventType wxEVT_COMMAND_SLIDER_UPDATED;
55%constant wxEventType wxEVT_COMMAND_RADIOBOX_SELECTED;
56%constant wxEventType wxEVT_COMMAND_RADIOBUTTON_SELECTED;
57
58%constant wxEventType wxEVT_COMMAND_SCROLLBAR_UPDATED;
59%constant wxEventType wxEVT_COMMAND_VLBOX_SELECTED;
60%constant wxEventType wxEVT_COMMAND_COMBOBOX_SELECTED;
61%constant wxEventType wxEVT_COMMAND_TOOL_RCLICKED;
62%constant wxEventType wxEVT_COMMAND_TOOL_ENTER;
63
64// Mouse event types
65%constant wxEventType wxEVT_LEFT_DOWN;
66%constant wxEventType wxEVT_LEFT_UP;
67%constant wxEventType wxEVT_MIDDLE_DOWN;
68%constant wxEventType wxEVT_MIDDLE_UP;
69%constant wxEventType wxEVT_RIGHT_DOWN;
70%constant wxEventType wxEVT_RIGHT_UP;
71%constant wxEventType wxEVT_MOTION;
72%constant wxEventType wxEVT_ENTER_WINDOW;
73%constant wxEventType wxEVT_LEAVE_WINDOW;
74%constant wxEventType wxEVT_LEFT_DCLICK;
75%constant wxEventType wxEVT_MIDDLE_DCLICK;
76%constant wxEventType wxEVT_RIGHT_DCLICK;
77%constant wxEventType wxEVT_SET_FOCUS;
78%constant wxEventType wxEVT_KILL_FOCUS;
79%constant wxEventType wxEVT_CHILD_FOCUS;
80%constant wxEventType wxEVT_MOUSEWHEEL;
81
82// Non-client mouse events
83%constant wxEventType wxEVT_NC_LEFT_DOWN;
84%constant wxEventType wxEVT_NC_LEFT_UP;
85%constant wxEventType wxEVT_NC_MIDDLE_DOWN;
86%constant wxEventType wxEVT_NC_MIDDLE_UP;
87%constant wxEventType wxEVT_NC_RIGHT_DOWN;
88%constant wxEventType wxEVT_NC_RIGHT_UP;
89%constant wxEventType wxEVT_NC_MOTION;
90%constant wxEventType wxEVT_NC_ENTER_WINDOW;
91%constant wxEventType wxEVT_NC_LEAVE_WINDOW;
92%constant wxEventType wxEVT_NC_LEFT_DCLICK;
93%constant wxEventType wxEVT_NC_MIDDLE_DCLICK;
94%constant wxEventType wxEVT_NC_RIGHT_DCLICK;
95
96// Character input event type
97%constant wxEventType wxEVT_CHAR;
98%constant wxEventType wxEVT_CHAR_HOOK;
99%constant wxEventType wxEVT_NAVIGATION_KEY;
100%constant wxEventType wxEVT_KEY_DOWN;
101%constant wxEventType wxEVT_KEY_UP;
02b800ce
RD
102
103%{
104#if ! wxUSE_HOTKEY
105#define wxEVT_HOTKEY -9999
106#endif
107%}
108
d14a1e28 109%constant wxEventType wxEVT_HOTKEY;
02b800ce
RD
110
111
d14a1e28
RD
112// Set cursor event
113%constant wxEventType wxEVT_SET_CURSOR;
114
115// wxScrollBar and wxSlider event identifiers
116%constant wxEventType wxEVT_SCROLL_TOP;
117%constant wxEventType wxEVT_SCROLL_BOTTOM;
118%constant wxEventType wxEVT_SCROLL_LINEUP;
119%constant wxEventType wxEVT_SCROLL_LINEDOWN;
120%constant wxEventType wxEVT_SCROLL_PAGEUP;
121%constant wxEventType wxEVT_SCROLL_PAGEDOWN;
122%constant wxEventType wxEVT_SCROLL_THUMBTRACK;
123%constant wxEventType wxEVT_SCROLL_THUMBRELEASE;
7b77d988
RD
124%constant wxEventType wxEVT_SCROLL_CHANGED;
125%pythoncode { wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED }
126
d14a1e28
RD
127
128// Scroll events from wxWindow
129%constant wxEventType wxEVT_SCROLLWIN_TOP;
130%constant wxEventType wxEVT_SCROLLWIN_BOTTOM;
131%constant wxEventType wxEVT_SCROLLWIN_LINEUP;
132%constant wxEventType wxEVT_SCROLLWIN_LINEDOWN;
133%constant wxEventType wxEVT_SCROLLWIN_PAGEUP;
134%constant wxEventType wxEVT_SCROLLWIN_PAGEDOWN;
135%constant wxEventType wxEVT_SCROLLWIN_THUMBTRACK;
136%constant wxEventType wxEVT_SCROLLWIN_THUMBRELEASE;
137
138// System events
139%constant wxEventType wxEVT_SIZE;
140%constant wxEventType wxEVT_MOVE;
141%constant wxEventType wxEVT_CLOSE_WINDOW;
142%constant wxEventType wxEVT_END_SESSION;
143%constant wxEventType wxEVT_QUERY_END_SESSION;
144%constant wxEventType wxEVT_ACTIVATE_APP;
d14a1e28
RD
145%constant wxEventType wxEVT_ACTIVATE;
146%constant wxEventType wxEVT_CREATE;
147%constant wxEventType wxEVT_DESTROY;
148%constant wxEventType wxEVT_SHOW;
149%constant wxEventType wxEVT_ICONIZE;
150%constant wxEventType wxEVT_MAXIMIZE;
151%constant wxEventType wxEVT_MOUSE_CAPTURE_CHANGED;
e249d3c0 152%constant wxEventType wxEVT_MOUSE_CAPTURE_LOST;
d14a1e28
RD
153%constant wxEventType wxEVT_PAINT;
154%constant wxEventType wxEVT_ERASE_BACKGROUND;
155%constant wxEventType wxEVT_NC_PAINT;
156%constant wxEventType wxEVT_PAINT_ICON;
157%constant wxEventType wxEVT_MENU_OPEN;
158%constant wxEventType wxEVT_MENU_CLOSE;
159%constant wxEventType wxEVT_MENU_HIGHLIGHT;
160
161%constant wxEventType wxEVT_CONTEXT_MENU;
162%constant wxEventType wxEVT_SYS_COLOUR_CHANGED;
163%constant wxEventType wxEVT_DISPLAY_CHANGED;
164%constant wxEventType wxEVT_SETTING_CHANGED;
165%constant wxEventType wxEVT_QUERY_NEW_PALETTE;
166%constant wxEventType wxEVT_PALETTE_CHANGED;
167%constant wxEventType wxEVT_DROP_FILES;
168%constant wxEventType wxEVT_DRAW_ITEM;
169%constant wxEventType wxEVT_MEASURE_ITEM;
170%constant wxEventType wxEVT_COMPARE_ITEM;
171%constant wxEventType wxEVT_INIT_DIALOG;
172%constant wxEventType wxEVT_IDLE;
173%constant wxEventType wxEVT_UPDATE_UI;
174%constant wxEventType wxEVT_SIZING;
175%constant wxEventType wxEVT_MOVING;
2d672d17
RD
176%constant wxEventType wxEVT_HIBERNATE;
177
05c43d46
RD
178%constant wxEventType wxEVT_COMMAND_TEXT_COPY;
179%constant wxEventType wxEVT_COMMAND_TEXT_CUT;
180%constant wxEventType wxEVT_COMMAND_TEXT_PASTE;
181
d14a1e28
RD
182
183// Generic command events
184// Note: a click is a higher-level event than button down/up
185%constant wxEventType wxEVT_COMMAND_LEFT_CLICK;
186%constant wxEventType wxEVT_COMMAND_LEFT_DCLICK;
187%constant wxEventType wxEVT_COMMAND_RIGHT_CLICK;
188%constant wxEventType wxEVT_COMMAND_RIGHT_DCLICK;
189%constant wxEventType wxEVT_COMMAND_SET_FOCUS;
190%constant wxEventType wxEVT_COMMAND_KILL_FOCUS;
191%constant wxEventType wxEVT_COMMAND_ENTER;
192
193
194
195%pythoncode {
196%#
197%# Create some event binders
198EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
199EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
200EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
201EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
202EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
203EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
204EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
205EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
206EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
207EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
208EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
209EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
210EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
d0e2ede0 211EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
d14a1e28
RD
212EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
213EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
214EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
215EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
216EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
217EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
218EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
219EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
220EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
221EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
d0e2ede0 222EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
d14a1e28
RD
223EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
224EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
225EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
226EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
227EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
228EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
229EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
230EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
231EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
232EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
233EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
234EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
235EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
236EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
237EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
238EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
e249d3c0 239EVT_MOUSE_CAPTURE_LOST = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_LOST )
d14a1e28
RD
240
241EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
242EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
243EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
244EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
245EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
246EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
247EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
248EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
249EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
250EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
251EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
252EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
253EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
254
255EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
256 wxEVT_LEFT_UP,
257 wxEVT_MIDDLE_DOWN,
258 wxEVT_MIDDLE_UP,
259 wxEVT_RIGHT_DOWN,
260 wxEVT_RIGHT_UP,
261 wxEVT_MOTION,
262 wxEVT_LEFT_DCLICK,
263 wxEVT_MIDDLE_DCLICK,
264 wxEVT_RIGHT_DCLICK,
265 wxEVT_ENTER_WINDOW,
266 wxEVT_LEAVE_WINDOW,
267 wxEVT_MOUSEWHEEL
268 ])
269
270
271%# Scrolling from wxWindow (sent to wxScrolledWindow)
d0e2ede0 272EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
d14a1e28
RD
273 wxEVT_SCROLLWIN_BOTTOM,
274 wxEVT_SCROLLWIN_LINEUP,
275 wxEVT_SCROLLWIN_LINEDOWN,
d0e2ede0 276 wxEVT_SCROLLWIN_PAGEUP,
d14a1e28
RD
277 wxEVT_SCROLLWIN_PAGEDOWN,
278 wxEVT_SCROLLWIN_THUMBTRACK,
279 wxEVT_SCROLLWIN_THUMBRELEASE,
280 ])
281
282EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
283EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
284EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
285EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
286EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
287EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
288EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
289EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
290
d5a7caf6 291%# Scrolling from wx.Slider and wx.ScrollBar
d0e2ede0
RD
292EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
293 wxEVT_SCROLL_BOTTOM,
294 wxEVT_SCROLL_LINEUP,
295 wxEVT_SCROLL_LINEDOWN,
296 wxEVT_SCROLL_PAGEUP,
297 wxEVT_SCROLL_PAGEDOWN,
298 wxEVT_SCROLL_THUMBTRACK,
299 wxEVT_SCROLL_THUMBRELEASE,
7b77d988 300 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
301 ])
302
303EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
304EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
305EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
306EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
307EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
308EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
309EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
310EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
7b77d988
RD
311EVT_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED )
312EVT_SCROLL_ENDSCROLL = EVT_SCROLL_CHANGED
d0e2ede0 313
d5a7caf6 314%# Scrolling from wx.Slider and wx.ScrollBar, with an id
d0e2ede0
RD
315EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
316 wxEVT_SCROLL_BOTTOM,
317 wxEVT_SCROLL_LINEUP,
318 wxEVT_SCROLL_LINEDOWN,
319 wxEVT_SCROLL_PAGEUP,
320 wxEVT_SCROLL_PAGEDOWN,
321 wxEVT_SCROLL_THUMBTRACK,
d14a1e28 322 wxEVT_SCROLL_THUMBRELEASE,
7b77d988 323 wxEVT_SCROLL_CHANGED,
d14a1e28
RD
324 ], 1)
325
326EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
327EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
328EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
329EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
330EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
331EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
332EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
333EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
7b77d988
RD
334EVT_COMMAND_SCROLL_CHANGED = wx.PyEventBinder( wxEVT_SCROLL_CHANGED, 1)
335EVT_COMMAND_SCROLL_ENDSCROLL = EVT_COMMAND_SCROLL_CHANGED
d14a1e28 336
d14a1e28
RD
337EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
338EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
339EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
340EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
341EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
342EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
343EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
344EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
345EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
346EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
347
348EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
349EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
350EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
351EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
352EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
353EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
354EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
355EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
356EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
357
358
359EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
360EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
361EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
362EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
363EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
364EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
365EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
366
367EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
368
369EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
370EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
371
372EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
373
05c43d46
RD
374EVT_TEXT_CUT = wx.PyEventBinder( wxEVT_COMMAND_TEXT_CUT )
375EVT_TEXT_COPY = wx.PyEventBinder( wxEVT_COMMAND_TEXT_COPY )
376EVT_TEXT_PASTE = wx.PyEventBinder( wxEVT_COMMAND_TEXT_PASTE )
d14a1e28
RD
377
378}
379
380//---------------------------------------------------------------------------
381%newgroup;
382
d5a7caf6
RD
383DocStr(wxEvent,
384"An event is a structure holding information about an event passed to a
385callback or member function. wx.Event is an abstract base class for
386other event classes", "");
387
d14a1e28
RD
388class wxEvent : public wxObject {
389public:
390 // wxEvent(int winid = 0, wxEventType commandType = wxEVT_NULL); // *** This class is now an ABC
391 ~wxEvent();
392
d5a7caf6
RD
393 DocDeclStr(
394 void , SetEventType(wxEventType typ),
395 "Sets the specific type of the event.", "");
d0e2ede0 396
d5a7caf6
RD
397 DocDeclStr(
398 wxEventType , GetEventType() const,
399 "Returns the identifier of the given event type, such as
400``wxEVT_COMMAND_BUTTON_CLICKED``.", "");
d0e2ede0 401
d5a7caf6
RD
402 DocDeclStr(
403 wxObject *, GetEventObject() const,
404 "Returns the object (usually a window) associated with the event, if
405any.", "");
d0e2ede0 406
d5a7caf6
RD
407 DocDeclStr(
408 void , SetEventObject(wxObject *obj),
409 "Sets the originating object, or in other words, obj is normally the
410object that is sending the event.", "");
d0e2ede0 411
d14a1e28
RD
412 long GetTimestamp() const;
413 void SetTimestamp(long ts = 0);
d0e2ede0 414
d5a7caf6
RD
415 DocDeclStr(
416 int , GetId() const,
417 "Returns the identifier associated with this event, such as a button
418command id.", "");
d0e2ede0 419
d5a7caf6
RD
420 DocDeclStr(
421 void , SetId(int Id),
422 "Set's the ID for the event. This is usually the ID of the window that
423is sending the event, but it can also be a command id from a menu
424item, etc.", "");
d0e2ede0 425
d14a1e28
RD
426
427
d5a7caf6
RD
428 DocDeclStr(
429 bool , IsCommandEvent() const,
430 "Returns true if the event is or is derived from `wx.CommandEvent` else
431it returns false. Note: Exists only for optimization purposes.", "");
d0e2ede0 432
d14a1e28 433
31066066
RD
434 DocDeclStr(
435 void , Skip(bool skip = true),
0c86b22b
RD
436 "This method can be used inside an event handler to control whether
437further event handlers bound to this event will be called after the
438current one returns. Without Skip() (or equivalently if Skip(False) is
439used), the event will not be processed any more. If Skip(True) is
440called, the event processing system continues searching for a further
441handler function for this event, even though it has been processed
442already in the current handler.", "");
d0e2ede0 443
d5a7caf6
RD
444 DocDeclStr(
445 bool , GetSkipped() const,
446 "Returns true if the event handler should be skipped, false otherwise.
447:see: `Skip`", "");
d0e2ede0 448
d14a1e28 449
d5a7caf6
RD
450 DocDeclStr(
451 bool , ShouldPropagate() const,
452 "Test if this event should be propagated to the parent window or not,
453i.e. if the propagation level is currently greater than 0.", "");
d0e2ede0 454
d14a1e28
RD
455
456 // Stop an event from propagating to its parent window, returns the old
457 // propagation level value
d5a7caf6
RD
458 DocDeclStr(
459 int , StopPropagation(),
460 "Stop the event from propagating to its parent window. Returns the old
461propagation level value which may be later passed to
462`ResumePropagation` to allow propagating the event again.", "");
d0e2ede0 463
d14a1e28 464
d5a7caf6
RD
465 DocDeclStr(
466 void , ResumePropagation(int propagationLevel),
467 "Resume the event propagation by restoring the propagation level. (For
468example, you can use the value returned by an earlier call to
469`StopPropagation`.)
470", "");
d0e2ede0 471
d14a1e28
RD
472
473 // this function is used to create a copy of the event polymorphically and
474 // all derived classes must implement it because otherwise wxPostEvent()
475 // for them wouldn't work (it needs to do a copy of the event)
476 virtual wxEvent *Clone() /* =0*/;
42e2bbb9
RD
477
478 %property(EventObject, GetEventObject, SetEventObject, doc="See `GetEventObject` and `SetEventObject`");
479 %property(EventType, GetEventType, SetEventType, doc="See `GetEventType` and `SetEventType`");
480 %property(Id, GetId, SetId, doc="See `GetId` and `SetId`");
481 %property(Skipped, GetSkipped, doc="See `GetSkipped`");
482 %property(Timestamp, GetTimestamp, SetTimestamp, doc="See `GetTimestamp` and `SetTimestamp`");
483
d14a1e28
RD
484};
485
486
487//---------------------------------------------------------------------------
488%newgroup;
489
d5a7caf6
RD
490DocStr(wxPropagationDisabler,
491"Helper class to temporarily change an event not to propagate. Simply
492create an instance of this class and then whe it is destroyed the
493propogation of the event will be restored.", "");
d14a1e28
RD
494class wxPropagationDisabler
495{
496public:
497 wxPropagationDisabler(wxEvent& event);
498 ~wxPropagationDisabler();
499};
500
501
d5a7caf6
RD
502DocStr( wxPropagateOnce,
503"A helper class that will temporarily lower propagation level of an
504event. Simply create an instance of this class and then whe it is
505destroyed the propogation of the event will be restored.", "");
d14a1e28
RD
506class wxPropagateOnce
507{
508public:
509 wxPropagateOnce(wxEvent& event);
510 ~wxPropagateOnce();
511};
512
513//---------------------------------------------------------------------------
514%newgroup;
515
d5a7caf6
RD
516DocStr(wxCommandEvent,
517"This event class contains information about command events, which
518originate from a variety of simple controls, as well as menus and
519toolbars.", "");
520
d14a1e28
RD
521class wxCommandEvent : public wxEvent
522{
523public:
524 wxCommandEvent(wxEventType commandType = wxEVT_NULL, int winid = 0);
525
526
527// // Set/Get client data from controls
528// void SetClientData(void* clientData) { m_clientData = clientData; }
529// void *GetClientData() const { return m_clientData; }
530
531// // Set/Get client object from controls
532// void SetClientObject(wxClientData* clientObject) { m_clientObject = clientObject; }
533// void *GetClientObject() const { return m_clientObject; }
534
d0e2ede0 535
d5a7caf6
RD
536 DocDeclStr(
537 int , GetSelection() const,
538 "Returns item index for a listbox or choice selection event (not valid
539for a deselection).", "");
d0e2ede0 540
d14a1e28 541
d14a1e28 542 void SetString(const wxString& s);
d5a7caf6
RD
543 DocDeclStr(
544 wxString , GetString() const,
545 "Returns item string for a listbox or choice selection event (not valid
546for a deselection).", "");
d0e2ede0 547
d14a1e28 548
d5a7caf6
RD
549 DocDeclStr(
550 bool , IsChecked() const,
551 "This method can be used with checkbox and menu events: for the
552checkboxes, the method returns true for a selection event and false
553for a deselection one. For the menu events, this method indicates if
554the menu item just has become checked or unchecked (and thus only
555makes sense for checkable menu items).", "");
d0e2ede0 556
61c5a8ac 557 %pythoncode { Checked = IsChecked }
d0e2ede0 558
d5a7caf6
RD
559 DocDeclStr(
560 bool , IsSelection() const,
561 "For a listbox or similar event, returns true if it is a selection,
562false if it is a deselection.", "");
d0e2ede0 563
d14a1e28
RD
564
565 void SetExtraLong(long extraLong);
d5a7caf6
RD
566 DocDeclStr(
567 long , GetExtraLong() const,
e47ce385
RD
568 "Returns extra information dependant on the event objects type. If the
569event comes from a listbox selection, it is a boolean determining
570whether the event was a selection (true) or a deselection (false). A
571listbox deselection only occurs for multiple-selection boxes, and in
572this case the index and string values are indeterminate and the
573listbox must be examined by the application.", "");
d0e2ede0 574
d14a1e28
RD
575
576 void SetInt(int i);
d5a7caf6 577 DocDeclStr(
229acc79 578 int , GetInt() const,
e47ce385
RD
579 "Returns the integer identifier corresponding to a listbox, choice or
580radiobox selection (only if the event was a selection, not a
581deselection), or a boolean value representing the value of a checkbox.", "");
d0e2ede0 582
d14a1e28 583
821053dd
RD
584 %extend {
585 DocStr(GetClientData,
586 "Returns the client data object for a listbox or choice selection event, (if any.)", "");
587 PyObject* GetClientData() {
588 wxPyClientData* data = (wxPyClientData*)self->GetClientObject();
589 if (data) {
590 Py_INCREF(data->m_obj);
591 return data->m_obj;
592 } else {
593 Py_INCREF(Py_None);
594 return Py_None;
595 }
596 }
597
598 DocStr(SetClientData,
599 "Associate the given client data with the item at position n.", "");
600 void SetClientData(PyObject* clientData) {
601 wxPyClientData* data = new wxPyClientData(clientData);
602 self->SetClientObject(data);
603 }
604 }
605 %pythoncode {
606 GetClientObject = GetClientData
607 SetClientObject = SetClientData
608 }
d0e2ede0 609
d14a1e28
RD
610 virtual wxEvent *Clone() const;
611
0eae5d09
RD
612 %property(ClientData, GetClientData, SetClientData, doc="See `GetClientData` and `SetClientData`");
613 %property(ClientObject, GetClientObject, SetClientObject, doc="See `GetClientObject` and `SetClientObject`");
614 %property(ExtraLong, GetExtraLong, SetExtraLong, doc="See `GetExtraLong` and `SetExtraLong`");
615 %property(Int, GetInt, SetInt, doc="See `GetInt` and `SetInt`");
616 %property(Selection, GetSelection, doc="See `GetSelection`");
617 %property(String, GetString, SetString, doc="See `GetString` and `SetString`");
d14a1e28
RD
618};
619
620//---------------------------------------------------------------------------
621%newgroup;
622
d5a7caf6
RD
623DocStr(wxNotifyEvent,
624"An instance of this class (or one of its derived classes) is sent from
625a control when the control's state is being changed and the control
626allows that change to be prevented from happening. The event handler
627can call `Veto` or `Allow` to tell the control what to do.", "");
628
d14a1e28
RD
629class wxNotifyEvent : public wxCommandEvent
630{
631public:
632 wxNotifyEvent(wxEventType commandType = wxEVT_NULL, int winid = 0);
633
d5a7caf6
RD
634 DocDeclStr(
635 void , Veto(),
636 "Prevents the change announced by this event from happening.
d14a1e28 637
d5a7caf6
RD
638It is in general a good idea to notify the user about the reasons for
639vetoing the change because otherwise the applications behaviour (which
640just refuses to do what the user wants) might be quite surprising.", "");
d0e2ede0 641
d5a7caf6
RD
642
643 DocDeclStr(
644 void , Allow(),
645 "This is the opposite of `Veto`: it explicitly allows the event to be
646processed. For most events it is not necessary to call this method as
647the events are allowed anyhow but some are forbidden by default (this
648will be mentioned in the corresponding event description).", "");
d0e2ede0 649
d14a1e28 650
d5a7caf6
RD
651 DocDeclStr(
652 bool , IsAllowed(),
653 "Returns true if the change is allowed (`Veto` hasn't been called) or
654false otherwise (if it was).", "");
d0e2ede0 655
d14a1e28
RD
656};
657
658
659//---------------------------------------------------------------------------
660%newgroup;
661
d5a7caf6
RD
662DocStr(wxScrollEvent,
663"A scroll event holds information about events sent from stand-alone
664scrollbars and sliders. Note that scrolled windows do not send
665instnaces of this event class, but send the `wx.ScrollWinEvent`
666instead.", "
667
668Events
669-------
670 ======================= ==========================================
671 EVT_SCROLL Used to bind all scroll events
672 EVT_SCROLL_TOP scroll-to-top events (minimum position)
673 EVT_SCROLL_BOTTOM scroll-to-bottom events (maximum position)
674 EVT_SCROLL_LINEUP line up events
675 EVT_SCROLL_LINEDOWN line down events
676 EVT_SCROLL_PAGEUP page up events
677 EVT_SCROLL_PAGEDOWN page down events
678 EVT_SCROLL_THUMBTRACK thumbtrack events (frequent events sent
679 as the user drags the 'thumb')
6a223074
RD
680 EVT_SCROLL_THUMBRELEASE thumb release events
681 EVT_SCROLL_CHANGED End of scrolling
d5a7caf6
RD
682 ======================= ==========================================
683
684Note
685------
686 The EVT_SCROLL_THUMBRELEASE event is only emitted when actually
687 dragging the thumb using the mouse and releasing it (This
688 EVT_SCROLL_THUMBRELEASE event is also followed by an
6a223074 689 EVT_SCROLL_CHANGED event).
d5a7caf6 690
6a223074 691 The EVT_SCROLL_CHANGED event also occurs when using the keyboard
d5a7caf6
RD
692 to change the thumb position, and when clicking next to the thumb
693 (In all these cases the EVT_SCROLL_THUMBRELEASE event does not
694 happen).
695
6a223074 696 In short, the EVT_SCROLL_CHANGED event is triggered when
d5a7caf6
RD
697 scrolling/ moving has finished. The only exception (unfortunately)
698 is that changing the thumb position using the mousewheel does give
6a223074 699 a EVT_SCROLL_THUMBRELEASE event but NOT an EVT_SCROLL_CHANGED
d5a7caf6
RD
700 event.
701");
702
d14a1e28
RD
703class wxScrollEvent : public wxCommandEvent
704{
705public:
d5a7caf6
RD
706 DocCtorStr(
707 wxScrollEvent(wxEventType commandType = wxEVT_NULL,
708 int winid = 0, int pos = 0, int orient = 0),
709 "", "");
d14a1e28 710
d5a7caf6
RD
711 DocDeclStr(
712 int , GetOrientation() const,
713 "Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
714the scrollbar.", "");
d0e2ede0 715
d5a7caf6
RD
716 DocDeclStr(
717 int , GetPosition() const,
718 "Returns the position of the scrollbar.", "");
d0e2ede0 719
d14a1e28
RD
720 void SetOrientation(int orient);
721 void SetPosition(int pos);
7012bb9f
RD
722
723 %property(Orientation, GetOrientation, SetOrientation, doc="See `GetOrientation` and `SetOrientation`");
724 %property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`");
d14a1e28
RD
725};
726
727
728//---------------------------------------------------------------------------
729%newgroup;
730
d5a7caf6
RD
731DocStr(wxScrollWinEvent,
732"A wx.ScrollWinEvent holds information about scrolling and is sent from
733scrolling windows.", "
734
735Events
736-------
737 ========================== ==========================================
738 EVT_SCROLLWIN Used to bind all scrolled window scroll events
739 EVT_SCROLLWIN_TOP scroll-to-top events (minimum position)
740 EVT_SCROLLWIN_BOTTOM scroll-to-bottom events (maximum position)
741 EVT_SCROLLWIN_LINEUP line up events
742 EVT_SCROLLWIN_LINEDOWN line down events
743 EVT_SCROLLWIN_PAGEUP page up events
744 EVT_SCROLLWIN_PAGEDOWN page down events
745 EVT_SCROLLWIN_THUMBTRACK thumbtrack events (frequent events sent
746 as the user drags the 'thumb')
6a223074
RD
747 EVT_SCROLLWIN_THUMBRELEASE thumb release events
748 EVT_SCROLLWIN_CHANGED End of scrolling
d5a7caf6
RD
749 ========================== ==========================================
750
e47ce385 751:see: `wx.ScrollEvent`
d5a7caf6
RD
752");
753
d14a1e28
RD
754class wxScrollWinEvent : public wxEvent
755{
756public:
757 wxScrollWinEvent(wxEventType commandType = wxEVT_NULL,
758 int pos = 0, int orient = 0);
759
d5a7caf6
RD
760 DocDeclStr(
761 int , GetOrientation() const,
762 "Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
763the scrollbar.", "");
d0e2ede0 764
d5a7caf6
RD
765 DocDeclStr(
766 int , GetPosition() const,
767 "Returns the position of the scrollbar for the thumb track and release
768events. Note that this field can't be used for the other events, you
769need to query the window itself for the current position in that case.", "");
d0e2ede0 770
d14a1e28
RD
771 void SetOrientation(int orient);
772 void SetPosition(int pos);
7012bb9f
RD
773
774 %property(Orientation, GetOrientation, SetOrientation, doc="See `GetOrientation` and `SetOrientation`");
775 %property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`");
d14a1e28
RD
776};
777
778//---------------------------------------------------------------------------
779%newgroup;
780
d5a7caf6
RD
781
782DocStr(wxMouseEvent,
783"This event class contains information about the events generated by
784the mouse: they include mouse buttons press and release events and
785mouse move events.
786
787All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
788the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
789``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
790a middle button so a portable application should avoid relying on the
791events from it.
792
793Note the difference between methods like `LeftDown` and `LeftIsDown`:
794the former returns true when the event corresponds to the left mouse
795button click while the latter returns true if the left mouse button is
796currently being pressed. For example, when the user is dragging the
797mouse you can use `LeftIsDown` to test whether the left mouse button
798is (still) depressed. Also, by convention, if `LeftDown` returns true,
799`LeftIsDown` will also return true in wxWidgets whatever the
800underlying GUI behaviour is (which is platform-dependent). The same
801applies, of course, to other mouse buttons as well.", "
802
803Events
804-------
805 ================== ==============================================
806 EVT_LEFT_DOWN Left mouse button down event. The handler
807 of this event should normally call
808 event.Skip() to allow the default processing
809 to take place as otherwise the window under
810 mouse wouldn't get the focus.
811 EVT_LEFT_UP Left mouse button up event
812 EVT_LEFT_DCLICK Left mouse button double click event
813 EVT_MIDDLE_DOWN Middle mouse button down event
814 EVT_MIDDLE_UP Middle mouse button up event
815 EVT_MIDDLE_DCLICK Middle mouse button double click event
816 EVT_RIGHT_DOWN Right mouse button down event
817 EVT_RIGHT_UP Right mouse button up event
818 EVT_RIGHT_DCLICK Right mouse button double click event
819 EVT_MOTION Event sent when the mouse is moving
820 EVT_ENTER_WINDOW Event sent when the mouse enters the
821 boundaries of a window.
822 EVT_LEAVE_WINDOW Sent when the mouse leaves the window's bounds
823 EVT_MOUSEWHEEL Mouse scroll wheel event
824 EVT_MOUSE_EVENTS Binds all mouse events at once.
825 ================== ==============================================
826
827");
828
829
d14a1e28
RD
830// the symbolic names for the mouse buttons
831enum
832{
833 wxMOUSE_BTN_ANY = -1,
834 wxMOUSE_BTN_NONE = -1,
835 wxMOUSE_BTN_LEFT = 0,
836 wxMOUSE_BTN_MIDDLE = 1,
837 wxMOUSE_BTN_RIGHT = 2
838};
839
840
841// Mouse event class
842class wxMouseEvent : public wxEvent
843{
844public:
d5a7caf6
RD
845 DocCtorStr(
846 wxMouseEvent(wxEventType mouseType = wxEVT_NULL),
847"Constructs a wx.MouseEvent. Valid event types are:
848
849 * wxEVT_ENTER_WINDOW
850 * wxEVT_LEAVE_WINDOW
851 * wxEVT_LEFT_DOWN
852 * wxEVT_LEFT_UP
853 * wxEVT_LEFT_DCLICK
854 * wxEVT_MIDDLE_DOWN
855 * wxEVT_MIDDLE_UP
856 * wxEVT_MIDDLE_DCLICK
857 * wxEVT_RIGHT_DOWN
858 * wxEVT_RIGHT_UP
859 * wxEVT_RIGHT_DCLICK
860 * wxEVT_MOTION
861 * wxEVT_MOUSEWHEEL ", "");
d14a1e28 862
d14a1e28 863
d5a7caf6
RD
864 DocDeclStr(
865 bool , IsButton() const,
866 "Returns true if the event was a mouse button event (not necessarily a
867button down event - that may be tested using `ButtonDown`).", "");
d0e2ede0 868
d14a1e28 869
d5a7caf6
RD
870 DocDeclStr(
871 bool , ButtonDown(int but = wxMOUSE_BTN_ANY) const,
e47ce385
RD
872 "If the argument is omitted, this returns true if the event was any
873mouse button down event. Otherwise the argument specifies which
874button-down event shold be checked for (see `Button` for the possible
875values).", "");
d0e2ede0 876
d5a7caf6
RD
877
878 DocDeclStr(
879 bool , ButtonDClick(int but = wxMOUSE_BTN_ANY) const,
880 "If the argument is omitted, this returns true if the event was any
881mouse double click event. Otherwise the argument specifies which
882double click event to check for (see `Button` for the possible
883values).", "");
d0e2ede0 884
d14a1e28 885
d5a7caf6
RD
886 DocDeclStr(
887 bool , ButtonUp(int but = wxMOUSE_BTN_ANY) const,
888 "If the argument is omitted, this returns true if the event was any
e47ce385
RD
889mouse button up event. Otherwise the argument specifies which button
890up event to check for (see `Button` for the possible values).", "");
d0e2ede0 891
d14a1e28 892
d5a7caf6
RD
893 DocDeclStr(
894 bool , Button(int button) const,
895 "Returns true if the identified mouse button is changing state. Valid
896values of button are:
897
898 ==================== =====================================
899 wx.MOUSE_BTN_LEFT check if left button was pressed
900 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
901 wx.MOUSE_BTN_RIGHT check if right button was pressed
902 wx.MOUSE_BTN_ANY check if any button was pressed
903 ==================== =====================================
904", "");
d0e2ede0 905
d14a1e28
RD
906
907 // Was the given button in Down state?
908 bool ButtonIsDown(int but) const;
909
d5a7caf6
RD
910 DocDeclStr(
911 int , GetButton() const,
912 "Returns the mouse button which generated this event or
913wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
914leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
915the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
916and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
917right buttons respectively.", "");
d0e2ede0 918
d14a1e28 919
d5a7caf6
RD
920 DocDeclStr(
921 bool , ControlDown() const,
922 "Returns true if the control key was down at the time of the event.", "");
d0e2ede0 923
d5a7caf6
RD
924 DocDeclStr(
925 bool , MetaDown() const,
926 "Returns true if the Meta key was down at the time of the event.", "");
d0e2ede0
RD
927
928
d5a7caf6
RD
929 DocDeclStr(
930 bool , AltDown() const,
931 "Returns true if the Alt key was down at the time of the event.", "");
d0e2ede0 932
d5a7caf6
RD
933 DocDeclStr(
934 bool , ShiftDown() const,
935 "Returns true if the Shift key was down at the time of the event.", "");
d0e2ede0 936
d14a1e28 937
ba3e5ef2
RD
938 DocDeclStr(
939 bool , CmdDown() const,
940 "\"Cmd\" is a pseudo key which is the same as Control for PC and Unix
941platforms but the special \"Apple\" (a.k.a as \"Command\") key on
e47ce385 942Macs. It often makes sense to use it instead of, say, `ControlDown`
ba3e5ef2 943because Cmd key is used for the same thing under Mac as Ctrl
d5a7caf6 944elsewhere. The Ctrl key still exists, it's just not used for this
ba3e5ef2
RD
945purpose. So for non-Mac platforms this is the same as `ControlDown`
946and Macs this is the same as `MetaDown`.", "");
d0e2ede0 947
d14a1e28 948
d5a7caf6
RD
949 DocDeclStr(
950 bool , LeftDown() const,
951 "Returns true if the left mouse button state changed to down.", "");
d0e2ede0 952
d5a7caf6
RD
953 DocDeclStr(
954 bool , MiddleDown() const,
955 "Returns true if the middle mouse button state changed to down.", "");
d0e2ede0 956
d5a7caf6
RD
957 DocDeclStr(
958 bool , RightDown() const,
959 "Returns true if the right mouse button state changed to down.", "");
d5a7caf6 960
d0e2ede0
RD
961
962
d5a7caf6
RD
963 DocDeclStr(
964 bool , LeftUp() const,
965 "Returns true if the left mouse button state changed to up.", "");
d0e2ede0 966
d5a7caf6
RD
967 DocDeclStr(
968 bool , MiddleUp() const,
969 "Returns true if the middle mouse button state changed to up.", "");
d0e2ede0 970
d5a7caf6
RD
971 DocDeclStr(
972 bool , RightUp() const,
973 "Returns true if the right mouse button state changed to up.", "");
d5a7caf6
RD
974
975
d0e2ede0
RD
976
977
d5a7caf6
RD
978 DocDeclStr(
979 bool , LeftDClick() const,
980 "Returns true if the event was a left button double click.", "");
d0e2ede0 981
d5a7caf6
RD
982 DocDeclStr(
983 bool , MiddleDClick() const,
984 "Returns true if the event was a middle button double click.", "");
d0e2ede0 985
d5a7caf6
RD
986 DocDeclStr(
987 bool , RightDClick() const,
988 "Returns true if the event was a right button double click.", "");
d5a7caf6 989
d0e2ede0
RD
990
991
d5a7caf6
RD
992 DocDeclStr(
993 bool , LeftIsDown(),
994 "Returns true if the left mouse button is currently down, independent
995of the current event type.
d14a1e28 996
d5a7caf6
RD
997Please notice that it is not the same as LeftDown which returns true
998if the left mouse button was just pressed. Rather, it describes the
999state of the mouse button before the event happened.
d14a1e28 1000
d5a7caf6
RD
1001This event is usually used in the mouse event handlers which process
1002\"move mouse\" messages to determine whether the user is (still)
1003dragging the mouse.", "");
d0e2ede0 1004
d5a7caf6
RD
1005 DocDeclStr(
1006 bool , MiddleIsDown(),
1007 "Returns true if the middle mouse button is currently down, independent
1008of the current event type.", "");
d0e2ede0 1009
d5a7caf6
RD
1010 DocDeclStr(
1011 bool , RightIsDown(),
1012 "Returns true if the right mouse button is currently down, independent
1013of the current event type.", "");
d14a1e28 1014
d0e2ede0
RD
1015
1016
d5a7caf6
RD
1017 DocDeclStr(
1018 bool , Dragging() const,
1019 "Returns true if this was a dragging event (motion while a button is
1020depressed).", "");
d0e2ede0 1021
d14a1e28 1022
d5a7caf6
RD
1023 DocDeclStr(
1024 bool , Moving() const,
1025 "Returns true if this was a motion event and no mouse buttons were
1026pressed. If any mouse button is held pressed, then this method returns
1027false and Dragging returns true.", "");
d0e2ede0 1028
d14a1e28 1029
d5a7caf6
RD
1030 DocDeclStr(
1031 bool , Entering() const,
1032 "Returns true if the mouse was entering the window.", "");
d0e2ede0 1033
d14a1e28 1034
d5a7caf6
RD
1035 DocDeclStr(
1036 bool , Leaving() const,
1037 "Returns true if the mouse was leaving the window.", "");
d0e2ede0 1038
d14a1e28 1039
dd9f7fea
RD
1040
1041 DocStr(GetPosition, // sets the docstring for both
d5a7caf6
RD
1042 "Returns the pixel position of the mouse in window coordinates when the
1043event happened.", "");
d14a1e28 1044 wxPoint GetPosition();
d14a1e28 1045
dd9f7fea
RD
1046 DocDeclAName(
1047 void, GetPosition(long *OUTPUT, long *OUTPUT),
1048 "GetPositionTuple() -> (x,y)",
1049 GetPositionTuple);
d0e2ede0 1050
d5a7caf6
RD
1051 DocDeclStr(
1052 wxPoint , GetLogicalPosition(const wxDC& dc) const,
1053 "Returns the logical mouse position in pixels (i.e. translated
1054according to the translation set for the DC, which usually indicates
1055that the window has been scrolled).", "");
d0e2ede0 1056
d14a1e28 1057
d5a7caf6
RD
1058 DocDeclStr(
1059 wxCoord , GetX() const,
1060 "Returns X coordinate of the physical mouse event position.", "");
d0e2ede0 1061
d5a7caf6
RD
1062 DocDeclStr(
1063 wxCoord , GetY() const,
1064 "Returns Y coordinate of the physical mouse event position.", "");
d0e2ede0 1065
d14a1e28 1066
d5a7caf6
RD
1067 DocDeclStr(
1068 int , GetWheelRotation() const,
1069 "Get wheel rotation, positive or negative indicates direction of
1070rotation. Current devices all send an event when rotation is equal to
1071+/-WheelDelta, but this allows for finer resolution devices to be
1072created in the future. Because of this you shouldn't assume that one
1073event is equal to 1 line or whatever, but you should be able to either
1074do partial line scrolling or wait until +/-WheelDelta rotation values
1075have been accumulated before scrolling.", "");
d0e2ede0 1076
d14a1e28 1077
d5a7caf6
RD
1078 DocDeclStr(
1079 int , GetWheelDelta() const,
1080 "Get wheel delta, normally 120. This is the threshold for action to be
1081taken, and one such action (for example, scrolling one increment)
1082should occur for each delta.", "");
d0e2ede0 1083
d5a7caf6
RD
1084
1085 DocDeclStr(
1086 int , GetLinesPerAction() const,
1087 "Returns the configured number of lines (or whatever) to be scrolled
1088per wheel action. Defaults to three.", "");
d0e2ede0 1089
d5a7caf6
RD
1090
1091 DocDeclStr(
1092 bool , IsPageScroll() const,
1093 "Returns true if the system has been setup to do page scrolling with
1094the mouse wheel instead of line scrolling.", "");
d0e2ede0 1095
d14a1e28
RD
1096
1097public:
1098 wxCoord m_x, m_y;
1099
1100 bool m_leftDown;
1101 bool m_middleDown;
1102 bool m_rightDown;
1103
1104 bool m_controlDown;
1105 bool m_shiftDown;
1106 bool m_altDown;
1107 bool m_metaDown;
1108
1109 int m_wheelRotation;
1110 int m_wheelDelta;
1111 int m_linesPerAction;
203bfdca
RD
1112
1113 %property(Button, GetButton, doc="See `GetButton`");
1114 %property(LinesPerAction, GetLinesPerAction, doc="See `GetLinesPerAction`");
1115 %property(LogicalPosition, GetLogicalPosition, doc="See `GetLogicalPosition`");
1116 %property(Position, GetPosition, doc="See `GetPosition`");
1117 %property(WheelDelta, GetWheelDelta, doc="See `GetWheelDelta`");
1118 %property(WheelRotation, GetWheelRotation, doc="See `GetWheelRotation`");
1119 %property(X, GetX, doc="See `GetX`");
1120 %property(Y, GetY, doc="See `GetY`");
d14a1e28
RD
1121};
1122
1123//---------------------------------------------------------------------------
1124%newgroup;
1125
1126// Cursor set event
e47ce385
RD
1127
1128DocStr(wxSetCursorEvent,
1129"A SetCursorEvent is generated when the mouse cursor is about to be set
1130as a result of mouse motion. This event gives the application the
1131chance to perform specific mouse cursor processing based on the
1132current position of the mouse within the window. Use the `SetCursor`
1133method to specify the cursor you want to be displayed.", "");
1134
d14a1e28
RD
1135class wxSetCursorEvent : public wxEvent
1136{
1137public:
e47ce385
RD
1138 DocCtorStr(
1139 wxSetCursorEvent(wxCoord x = 0, wxCoord y = 0),
1140 "Construct a new `wx.SetCursorEvent`.", "");
d14a1e28 1141
e47ce385
RD
1142 DocDeclStr(
1143 wxCoord , GetX() const,
1144 "Returns the X coordinate of the mouse in client coordinates.", "");
d0e2ede0 1145
e47ce385
RD
1146 DocDeclStr(
1147 wxCoord , GetY() const,
1148 "Returns the Y coordinate of the mouse in client coordinates.", "");
d0e2ede0 1149
d14a1e28 1150
e47ce385
RD
1151 DocDeclStr(
1152 void , SetCursor(const wxCursor& cursor),
1153 "Sets the cursor associated with this event.", "");
d0e2ede0 1154
e47ce385
RD
1155 DocDeclStr(
1156 const wxCursor& , GetCursor() const,
1157 "Returns a reference to the cursor specified by this event.", "");
d0e2ede0 1158
e47ce385
RD
1159 DocDeclStr(
1160 bool , HasCursor() const,
1161 "Returns true if the cursor specified by this event is a valid cursor.", "");
d0e2ede0 1162
7012bb9f
RD
1163 %property(Cursor, GetCursor, SetCursor, doc="See `GetCursor` and `SetCursor`");
1164 %property(X, GetX, doc="See `GetX`");
1165 %property(Y, GetY, doc="See `GetY`");
d14a1e28
RD
1166};
1167
1168//---------------------------------------------------------------------------
1169%newgroup;
1170
1171// Keyboard input event class
1172
e47ce385
RD
1173DocStr(wxKeyEvent,
1174"This event class contains information about keypress and character
1175events. These events are only sent to the widget that currently has
1176the keyboard focus.
1177
1178Notice that there are three different kinds of keyboard events in
1179wxWidgets: key down and up events and char events. The difference
1180between the first two is clear - the first corresponds to a key press
1181and the second to a key release - otherwise they are identical. Just
1182note that if the key is maintained in a pressed state you will
1183typically get a lot of (automatically generated) down events but only
1184one up so it is wrong to assume that there is one up event
1185corresponding to each down one.
1186
1187Both key events provide untranslated key codes while the char event
1188carries the translated one. The untranslated code for alphanumeric
1189keys is always an upper case value. For the other keys it is one of
1190WXK_XXX values from the keycodes table. The translated key is, in
1191general, the character the user expects to appear as the result of the
1192key combination when typing the text into a text entry zone, for
1193example.
1194
1195A few examples to clarify this (all assume that CAPS LOCK is unpressed
1196and the standard US keyboard): when the 'A' key is pressed, the key
1197down event key code is equal to ASCII A == 65. But the char event key
1198code is ASCII a == 97. On the other hand, if you press both SHIFT and
1199'A' keys simultaneously , the key code in key down event will still be
1200just 'A' while the char event key code parameter will now be 'A' as
1201well.
1202
1203Although in this simple case it is clear that the correct key code
1204could be found in the key down event handler by checking the value
1205returned by `ShiftDown`, in general you should use EVT_CHAR for this
1206as for non alphanumeric keys or non-US keyboard layouts the
1207translation is keyboard-layout dependent and can only be done properly
1208by the system itself.
1209
1210Another kind of translation is done when the control key is pressed:
1211for example, for CTRL-A key press the key down event still carries the
1212same key code 'A' as usual but the char event will have key code of 1,
1213the ASCII value of this key combination.
1214
1215You may discover how the other keys on your system behave
1216interactively by running the KeyEvents sample in the wxPython demo and
1217pressing some keys while the blue box at the top has the keyboard
1218focus.
1219
1220**Note**: If a key down event is caught and the event handler does not
1221call event.Skip() then the coresponding char event will not
1222happen. This is by design and enables the programs that handle both
1223types of events to be a bit simpler.
1224
1225**Note for Windows programmers**: The key and char events in wxWidgets
1226are similar to but slightly different from Windows WM_KEYDOWN and
1227WM_CHAR events. In particular, Alt-x combination will generate a char
1228event in wxWidgets (unless it is used as an accelerator).
1229
1230**Tip**: be sure to call event.Skip() for events that you don't
1231process in key event function, otherwise menu shortcuts may cease to
1232work under Windows.
1233", "
1234
1235Events
1236------
1237 ================== ==============================================
1238 wx.EVT_KEY_DOWN Sent when a keyboard key has been pressed
1239 wx.EVT_KEY_UP Sent when a keyboard key has been released
1240 wx.EVT_CHAR Sent for translated character events.
1241 ================== ==============================================
1242
1243
1244Keycode Table
1245-------------
d0e2ede0
RD
1246 =========== ============== ======== ==================== =================
1247 WXK_BACK WXK_EXECUTE WXK_F1 WXK_NUMPAD_SPACE WXK_WINDOWS_LEFT
1248 WXK_TAB WXK_SNAPSHOT WXK_F2 WXK_NUMPAD_TAB WXK_WINDOWS_RIGHT
1249 WXK_RETURN WXK_INSERT WXK_F3 WXK_NUMPAD_ENTER WXK_WINDOWS_MENU
1250 WXK_ESCAPE WXK_HELP WXK_F4 WXK_NUMPAD_F1 WXK_SPECIAL1
1251 WXK_SPACE WXK_NUMPAD0 WXK_F5 WXK_NUMPAD_F2 WXK_SPECIAL2
1252 WXK_DELETE WXK_NUMPAD1 WXK_F6 WXK_NUMPAD_F3 WXK_SPECIAL3
1253 WXK_LBUTTON WXK_NUMPAD2 WXK_F7 WXK_NUMPAD_F4 WXK_SPECIAL4
1254 WXK_RBUTTON WXK_NUMPAD3 WXK_F8 WXK_NUMPAD_HOME WXK_SPECIAL5
1255 WXK_CANCEL WXK_NUMPAD4 WXK_F9 WXK_NUMPAD_LEFT WXK_SPECIAL6
1256 WXK_MBUTTON WXK_NUMPAD5 WXK_F10 WXK_NUMPAD_UP WXK_SPECIAL7
1257 WXK_CLEAR WXK_NUMPAD6 WXK_F11 WXK_NUMPAD_RIGHT WXK_SPECIAL8
1258 WXK_SHIFT WXK_NUMPAD7 WXK_F12 WXK_NUMPAD_DOWN WXK_SPECIAL9
1259 WXK_ALT WXK_NUMPAD8 WXK_F13 WXK_NUMPAD_PRIOR WXK_SPECIAL10
1260 WXK_CONTROL WXK_NUMPAD9 WXK_F14 WXK_NUMPAD_PAGEUP WXK_SPECIAL11
1261 WXK_MENU WXK_MULTIPLY WXK_F15 WXK_NUMPAD_NEXT WXK_SPECIAL12
1262 WXK_PAUSE WXK_ADD WXK_F16 WXK_NUMPAD_PAGEDOWN WXK_SPECIAL13
1263 WXK_CAPITAL WXK_SEPARATOR WXK_F17 WXK_NUMPAD_END WXK_SPECIAL14
1264 WXK_PRIOR WXK_SUBTRACT WXK_F18 WXK_NUMPAD_BEGIN WXK_SPECIAL15
1265 WXK_NEXT WXK_DECIMAL WXK_F19 WXK_NUMPAD_INSERT WXK_SPECIAL16
1266 WXK_END WXK_DIVIDE WXK_F20 WXK_NUMPAD_DELETE WXK_SPECIAL17
1267 WXK_HOME WXK_NUMLOCK WXK_F21 WXK_NUMPAD_EQUAL WXK_SPECIAL18
1268 WXK_LEFT WXK_SCROLL WXK_F22 WXK_NUMPAD_MULTIPLY WXK_SPECIAL19
1269 WXK_UP WXK_PAGEUP WXK_F23 WXK_NUMPAD_ADD WXK_SPECIAL20
1270 WXK_RIGHT WXK_PAGEDOWN WXK_F24 WXK_NUMPAD_SEPARATOR
1271 WXK_DOWN WXK_NUMPAD_SUBTRACT
1272 WXK_SELECT WXK_NUMPAD_DECIMAL
1273 WXK_PRINT WXK_NUMPAD_DIVIDE
1274 =========== ============== ======== ==================== =================
e47ce385
RD
1275");
1276
d14a1e28
RD
1277class wxKeyEvent : public wxEvent
1278{
1279public:
e47ce385
RD
1280 DocCtorStr(
1281 wxKeyEvent(wxEventType eventType = wxEVT_NULL),
1282 "Construct a new `wx.KeyEvent`. Valid event types are:
1283 * ", "");
1284
d14a1e28 1285
488867ab
RD
1286 DocDeclStr(
1287 int, GetModifiers() const,
1288 "Returns a bitmask of the current modifier settings. Can be used to
1289check if the key event has exactly the given modifiers without having
1290to explicitly check that the other modifiers are not down. For
1291example::
1292
1293 if event.GetModifers() == wx.MOD_CONTROL:
1294 DoSomething()
1295", "");
1296
e47ce385
RD
1297 DocDeclStr(
1298 bool , ControlDown() const,
1299 "Returns ``True`` if the Control key was down at the time of the event.", "");
d0e2ede0 1300
e47ce385
RD
1301 DocDeclStr(
1302 bool , MetaDown() const,
1303 "Returns ``True`` if the Meta key was down at the time of the event.", "");
d0e2ede0 1304
e47ce385
RD
1305 DocDeclStr(
1306 bool , AltDown() const,
1307 "Returns ``True`` if the Alt key was down at the time of the event.", "");
d0e2ede0 1308
e47ce385
RD
1309 DocDeclStr(
1310 bool , ShiftDown() const,
1311 "Returns ``True`` if the Shift key was down at the time of the event.", "");
d0e2ede0
RD
1312
1313
ba3e5ef2
RD
1314 DocDeclStr(
1315 bool , CmdDown() const,
1316 "\"Cmd\" is a pseudo key which is the same as Control for PC and Unix
1317platforms but the special \"Apple\" (a.k.a as \"Command\") key on
e47ce385 1318Macs. It makes often sense to use it instead of, say, `ControlDown`
ba3e5ef2
RD
1319because Cmd key is used for the same thing under Mac as Ctrl
1320elsewhere. The Ctrl still exists, it's just not used for this
1321purpose. So for non-Mac platforms this is the same as `ControlDown`
1322and Macs this is the same as `MetaDown`.", "");
d0e2ede0
RD
1323
1324
d14a1e28 1325
e47ce385
RD
1326 DocDeclStr(
1327 bool , HasModifiers() const,
1328 "Returns true if either CTRL or ALT keys was down at the time of the
1329key event. Note that this function does not take into account neither
1330SHIFT nor META key states (the reason for ignoring the latter is that
1331it is common for NUMLOCK key to be configured as META under X but the
1332key presses even while NUMLOCK is on should be still processed
1333normally).", "");
d0e2ede0 1334
d14a1e28 1335
e47ce385
RD
1336 DocDeclStr(
1337 int , GetKeyCode() const,
1338 "Returns the virtual key code. ASCII events return normal ASCII values,
1339while non-ASCII events return values such as WXK_LEFT for the left
1340cursor key. See `wx.KeyEvent` for a full list of the virtual key
1341codes.
1342
1343Note that in Unicode build, the returned value is meaningful only if
1344the user entered a character that can be represented in current
1345locale's default charset. You can obtain the corresponding Unicode
1346character using `GetUnicodeKey`.", "");
76b8fa1d
RD
1347
1348// %pythoncode { KeyCode = GetKeyCode } this will be hidden by the property
d14a1e28 1349
d0e2ede0 1350
d14a1e28 1351 %extend {
e47ce385
RD
1352 DocStr(
1353 GetUnicodeKey,
1354 "Returns the Unicode character corresponding to this key event. This
d0e2ede0 1355function is only meaningfule in a Unicode build of wxPython.", "");
ba87052f 1356 int GetUnicodeKey() {
3b7224dc 1357 %#if wxUSE_UNICODE
ba87052f 1358 return self->GetUnicodeKey();
3b7224dc 1359 %#else
d14a1e28 1360 return 0;
3b7224dc 1361 %#endif
d14a1e28
RD
1362 }
1363 }
ba87052f 1364 %pythoncode { GetUniChar = GetUnicodeKey }
d0e2ede0 1365
26798518
RD
1366 %extend {
1367 DocStr(
1368 SetUnicodeKey,
1369 "Set the Unicode value of the key event, but only if this is a Unicode
1370build of wxPython.", "");
1371 void SetUnicodeKey(int uniChar) {
1372 %#if wxUSE_UNICODE
1373 self->m_uniChar = uniChar;
1374 %#endif
1375 }
1376 }
d0e2ede0 1377
e47ce385
RD
1378 DocDeclStr(
1379 wxUint32 , GetRawKeyCode() const,
1380 "Returns the raw key code for this event. This is a platform-dependent
1381scan code which should only be used in advanced
1382applications. Currently the raw key codes are not supported by all
1383ports.", "");
d0e2ede0 1384
d14a1e28 1385
e47ce385
RD
1386 DocDeclStr(
1387 wxUint32 , GetRawKeyFlags() const,
1388 "Returns the low level key flags for this event. The flags are
1389platform-dependent and should only be used in advanced applications.
1390Currently the raw key flags are not supported by all ports.", "");
d14a1e28 1391
d0e2ede0
RD
1392
1393
dd9f7fea 1394 DocStr(GetPosition, // sets the docstring for both
e47ce385 1395 "Find the position of the event, if applicable.", "");
d14a1e28 1396 wxPoint GetPosition();
dd9f7fea
RD
1397
1398 DocDeclAName(
1399 void, GetPosition(long *OUTPUT, long *OUTPUT),
1400 "GetPositionTuple() -> (x,y)",
1401 GetPositionTuple);
d14a1e28 1402
d0e2ede0 1403
e47ce385
RD
1404 DocDeclStr(
1405 wxCoord , GetX() const,
1406 "Returns the X position (in client coordinates) of the event, if
1407applicable.", "");
d0e2ede0 1408
d14a1e28 1409
e47ce385
RD
1410 DocDeclStr(
1411 wxCoord , GetY() const,
1412 "Returns the Y position (in client coordinates) of the event, if
1413applicable.", "");
d0e2ede0 1414
d14a1e28
RD
1415
1416public:
1417 wxCoord m_x, m_y;
1418
1419 long m_keyCode;
1420
1421 bool m_controlDown;
1422 bool m_shiftDown;
1423 bool m_altDown;
1424 bool m_metaDown;
1425 bool m_scanCode;
1426
d14a1e28
RD
1427 wxUint32 m_rawCode;
1428 wxUint32 m_rawFlags;
76b8fa1d
RD
1429
1430 %property(KeyCode, GetKeyCode, doc="See `GetKeyCode`");
1431 %property(Modifiers, GetModifiers, doc="See `GetModifiers`");
1432 %property(Position, GetPosition, doc="See `GetPosition`");
1433 %property(RawKeyCode, GetRawKeyCode, doc="See `GetRawKeyCode`");
1434 %property(RawKeyFlags, GetRawKeyFlags, doc="See `GetRawKeyFlags`");
1435 %property(UnicodeKey, GetUnicodeKey, SetUnicodeKey, doc="See `GetUnicodeKey` and `SetUnicodeKey`");
1436 %property(X, GetX, doc="See `GetX`");
1437 %property(Y, GetY, doc="See `GetY`");
d14a1e28
RD
1438};
1439
1440//---------------------------------------------------------------------------
1441%newgroup;
1442
1443// Size event class
e47ce385
RD
1444
1445DocStr(wxSizeEvent,
1446"A size event holds information about size change events. The EVT_SIZE
1447handler function will be called when the window it is bound to has
1448been resized.
1449
1450Note that the size passed is of the whole window: call
1451`wx.Window.GetClientSize` for the area which may be used by the
1452application.
1453
1454When a window is resized, usually only a small part of the window is
1455damaged and and that area is all that is in the update region for the
1456next paint event. However, if your drawing depends on the size of the
1457window, you may need to clear the DC explicitly and repaint the whole
1458window. In which case, you may need to call `wx.Window.Refresh` to
1459invalidate the entire window.
1460", "");
1461
d14a1e28
RD
1462class wxSizeEvent : public wxEvent
1463{
1464public:
e47ce385
RD
1465 DocCtorStr(
1466 wxSizeEvent(const wxSize& sz=wxDefaultSize, int winid = 0),
1467 "Construct a new ``wx.SizeEvent``.", "");
d14a1e28 1468
e47ce385
RD
1469 DocDeclStr(
1470 wxSize , GetSize() const,
1471 "Returns the entire size of the window generating the size change
1472event.", "");
d0e2ede0 1473
d14a1e28
RD
1474 wxRect GetRect() const;
1475 void SetRect(wxRect rect);
d0e2ede0 1476
d14a1e28
RD
1477 %extend {
1478 void SetSize(wxSize size) {
1479 self->m_size = size;
1480 }
1481 }
1482
d14a1e28 1483 wxSize m_size;
e47ce385 1484 wxRect m_rect;
7012bb9f
RD
1485
1486 %property(Rect, GetRect, SetRect, doc="See `GetRect` and `SetRect`");
1487 %property(Size, GetSize, SetSize, doc="See `GetSize` and `SetSize`");
d14a1e28
RD
1488};
1489
1490
1491//---------------------------------------------------------------------------
1492%newgroup;
1493
e47ce385
RD
1494DocStr(wxMoveEvent,
1495"This event object is sent for EVT_MOVE event bindings when a window is
1496moved to a new position.", "");
1497
d14a1e28
RD
1498class wxMoveEvent : public wxEvent
1499{
1500public:
e47ce385
RD
1501 DocCtorStr(
1502 wxMoveEvent(const wxPoint& pos=wxDefaultPosition, int winid = 0),
1503 "Constructor.", "");
d14a1e28 1504
e47ce385
RD
1505 DocDeclStr(
1506 wxPoint , GetPosition() const,
1507 "Returns the position of the window generating the move change event.", "");
d0e2ede0 1508
d14a1e28 1509 wxRect GetRect() const;
aeee37c3
RD
1510 void SetRect(const wxRect& rect);
1511 void SetPosition(const wxPoint& pos);
d14a1e28 1512
aeee37c3
RD
1513 %pythoncode {
1514 m_pos = property(GetPosition, SetPosition)
1515 m_rect = property(GetRect, SetRect)
1516 }
203bfdca
RD
1517
1518 %property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`");
1519 %property(Rect, GetRect, SetRect, doc="See `GetRect` and `SetRect`");
1520
d14a1e28
RD
1521};
1522
1523//---------------------------------------------------------------------------
1524%newgroup;
1525
e47ce385
RD
1526DocStr(wxPaintEvent,
1527"A paint event is sent when a window's contents needs to be repainted.
1528Note that in an EVT_PAINT handler the application must *always* create
1529a `wx.PaintDC` object, even if you do not use it. Otherwise MS
1530Windows assumes that the window has not been painted yet and will send
1531the event again, causing endless refreshes.
1532
1533You can optimize painting by retrieving the rectangles that have been
1534damaged using `wx.Window.GetUpdateRegion` and/or `wx.RegionIterator`,
1535and only repainting these rectangles. The rectangles are in terms of
1536the client area, and are unscrolled, so you will need to do some
1537calculations using the current view position to obtain logical,
1538scrolled units.
1539", "");
1540
d14a1e28
RD
1541class wxPaintEvent : public wxEvent
1542{
1543public:
e47ce385
RD
1544 DocCtorStr(
1545 wxPaintEvent(int Id = 0),
1546 "", "");
d14a1e28
RD
1547};
1548
1549
1550class wxNcPaintEvent : public wxEvent
1551{
1552public:
1553 wxNcPaintEvent(int winid = 0);
1554};
1555
1556//---------------------------------------------------------------------------
1557%newgroup;
1558
e47ce385
RD
1559DocStr(wxEraseEvent,
1560"An erase event is sent whenever the background of a window needs to be
1561repainted. To intercept this event use the EVT_ERASE_BACKGROUND event
1562binder. On some platforms, such as GTK+, this event is simulated
1563(simply generated just before the paint event) and may cause flicker.
1564
1565To paint a custom background use the `GetDC` method and use the returned
1566device context if it is not ``None``, otherwise create a temporary
1567`wx.ClientDC` and draw on that.
1568", "");
1569
d14a1e28
RD
1570class wxEraseEvent : public wxEvent
1571{
1572public:
e47ce385
RD
1573 DocCtorStr(
1574 wxEraseEvent(int Id = 0, wxDC *dc = NULL),
1575 "Constructor", "");
d14a1e28 1576
e47ce385
RD
1577 DocDeclStr(
1578 wxDC *, GetDC() const,
1579 "Returns the device context the event handler should draw upon. If
1580``None`` is returned then create a temporary `wx.ClientDC` and use
1581that instead.", "");
42e2bbb9
RD
1582
1583 %property(DC, GetDC, doc="See `GetDC`");
d14a1e28
RD
1584};
1585
1586
1587//---------------------------------------------------------------------------
1588%newgroup;
1589
e47ce385
RD
1590DocStr(wxFocusEvent,
1591"A focus event is sent when a window's focus changes. The window losing
1592focus receives an EVT_KILL_FOCUS event while the window gaining it
1593gets an EVT_SET_FOCUS event.
1594
1595Notice that the set focus event happens both when the user gives focus
1596to the window (whether using the mouse or keyboard) and when it is
1597done from the program itself using `wx.Window.SetFocus`.
1598", "");
1599
d14a1e28
RD
1600class wxFocusEvent : public wxEvent
1601{
1602public:
e47ce385
RD
1603 DocCtorStr(
1604 wxFocusEvent(wxEventType type = wxEVT_NULL, int winid = 0),
1605 "Constructor", "");
d14a1e28 1606
e47ce385
RD
1607 DocDeclStr(
1608 wxWindow *, GetWindow() const,
1609 "Returns the other window associated with this event, that is the
1610window which had the focus before for the EVT_SET_FOCUS event and the
1611window which is going to receive focus for the wxEVT_KILL_FOCUS event.
1612
1613Warning: the window returned may be None!", "");
d0e2ede0 1614
d14a1e28 1615 void SetWindow(wxWindow *win);
42e2bbb9
RD
1616
1617 %property(Window, GetWindow, SetWindow, doc="See `GetWindow` and `SetWindow`");
d14a1e28
RD
1618};
1619
1620//---------------------------------------------------------------------------
1621%newgroup;
1622
e47ce385 1623DocStr(wxChildFocusEvent,
e393c3fb
RD
1624"A child focus event is sent to a (parent-)window when one of its child
1625windows gains focus, so that the window could restore the focus back
1626to its corresponding child if it loses it now and regains later.
1627
1628Notice that child window is the direct child of the window receiving
1629the event, and so may not be the actual widget recieving focus if it
1630is further down the containment heirarchy. Use `wx.Window.FindFocus`
1631to get the widget that is actually receiving focus.", "");
e47ce385
RD
1632
1633
d14a1e28
RD
1634class wxChildFocusEvent : public wxCommandEvent
1635{
1636public:
e47ce385
RD
1637 DocCtorStr(
1638 wxChildFocusEvent(wxWindow *win = NULL),
1639 "Constructor", "");
d14a1e28 1640
e47ce385
RD
1641 DocDeclStr(
1642 wxWindow *, GetWindow() const,
e393c3fb
RD
1643 "The window, or (grand)parent of the window which has just received the
1644focus.", "");
d0e2ede0 1645
0eae5d09 1646 %property(Window, GetWindow, doc="See `GetWindow`");
d14a1e28
RD
1647};
1648
1649//---------------------------------------------------------------------------
1650%newgroup;
1651
e47ce385
RD
1652DocStr(wxActivateEvent,
1653"An activate event is sent when a top-level window or the entire
1654application is being activated or deactivated.
1655
1656A top-level window (a dialog or frame) receives an activate event when
1657is being activated or deactivated. This is indicated visually by the
1658title bar changing colour, and a subwindow gaining the keyboard focus.
1659An application is activated or deactivated when one of its frames
1660becomes activated, or a frame becomes inactivate resulting in all
1661application frames being inactive.
1662
1663Please note that usually you should call event.Skip() in your handlers
1664for these events so the default handlers will still be called, as not
1665doing so can result in strange effects.
1666", "
1667
1668Events
1669-------
1670 ======================= ==========================================
1671 wx.EVT_ACTIVATE Sent to a frame when it has been activated
1672 or deactivated.
1673 wx.EVT_ACTIVATE_APP Sent to the app object when its activation
1674 state changes.
1675 ======================= ==========================================
1676");
1677
1678
d14a1e28
RD
1679class wxActivateEvent : public wxEvent
1680{
1681public:
e47ce385
RD
1682 DocCtorStr(
1683 wxActivateEvent(wxEventType type = wxEVT_NULL, bool active = true, int Id = 0),
1684 "Constructor", "");
d0e2ede0 1685
e47ce385
RD
1686 DocDeclStr(
1687 bool , GetActive() const,
1688 "Returns true if the application or window is being activated, false
1689otherwise.", "");
d0e2ede0 1690
0eae5d09 1691 %property(Active, GetActive, doc="See `GetActive`");
d14a1e28
RD
1692};
1693
1694
1695//---------------------------------------------------------------------------
1696%newgroup;
1697
e47ce385
RD
1698DocStr(wxInitDialogEvent,
1699"A wx.InitDialogEvent is sent as a dialog is being initialised, or for
1700any window when `wx.Window.InitDialog` is called. Handlers for this
1701event can transfer data to the window, or anything else that should be
1702done before the user begins editing the form. The default handler
1703calls `wx.Window.TransferDataToWindow`.", "
1704
1705Events
1706-------
1707 ======================= ==========================================
1708 wx.EVT_INIT_DIALOG Binder for init dialog events.
1709 ======================= ==========================================
1710");
1711
d14a1e28
RD
1712class wxInitDialogEvent : public wxEvent
1713{
1714public:
e47ce385
RD
1715 DocCtorStr(
1716 wxInitDialogEvent(int Id = 0),
1717 "Constructor", "");
d14a1e28
RD
1718};
1719
1720
1721//---------------------------------------------------------------------------
1722%newgroup;
1723
e47ce385
RD
1724DocStr(wxMenuEvent,
1725"This class is used for a variety of menu-related events. Note that
1726these do not include menu command events, which are handled by sending
1727`wx.CommandEvent` objects.
1728
1729The default handler for wx.EVT_MENU_HIGHLIGHT displays menu item help
1730text in the first field of the status bar.", "
1731
1732Events
1733-------
1734 ========================= ==========================================
1735 wx.EVT_MENU_OPEN A menu is about to be opened. On Windows,
1736 this is only sent once for each navigation
1737 of the menubar (up until all menus have closed).
1738 wx.EVT_MENU_CLOSE A menu has been just closed.
1739 wx.EVT_MENU_HIGHLIGHT Sent when the menu item with the specified id
1740 has been highlighted: used by default to show
1741 help prompts in the `wx.Frame`'s status bar.
1742 wx.EVT_MENU_HIGHLIGHT_ALL Can be used to catch the menu highlight
1743 event for all menu items.
1744 ========================= ==========================================
1745");
1746
d14a1e28
RD
1747class wxMenuEvent : public wxEvent
1748{
1749public:
e47ce385
RD
1750 DocCtorStr(
1751 wxMenuEvent(wxEventType type = wxEVT_NULL, int winid = 0, wxMenu* menu = NULL),
1752 "Constructor", "");
d0e2ede0 1753
e47ce385
RD
1754 DocDeclStr(
1755 int , GetMenuId() const,
1756 "Returns the menu identifier associated with the event. This method
1757should be only used with the HIGHLIGHT events.", "");
d0e2ede0 1758
d14a1e28 1759
e47ce385
RD
1760 DocDeclStr(
1761 bool , IsPopup() const,
1762 "Returns ``True`` if the menu which is being opened or closed is a
1763popup menu, ``False`` if it is a normal one. This method should only
1764be used with the OPEN and CLOSE events.", "");
d0e2ede0 1765
d14a1e28 1766
e47ce385
RD
1767 DocDeclStr(
1768 wxMenu* , GetMenu() const,
1769 "Returns the menu which is being opened or closed. This method should
1770only be used with the OPEN and CLOSE events.", "");
d0e2ede0 1771
203bfdca
RD
1772 %property(Menu, GetMenu, doc="See `GetMenu`");
1773 %property(MenuId, GetMenuId, doc="See `GetMenuId`");
d14a1e28
RD
1774};
1775
1776//---------------------------------------------------------------------------
1777%newgroup;
1778
e47ce385
RD
1779DocStr(wxCloseEvent,
1780"This event class contains information about window and session close
1781events.
1782
1783The handler function for EVT_CLOSE is called when the user has tried
1784to close a a frame or dialog box using the window manager controls or
1785the system menu. It can also be invoked by the application itself
1786programmatically, for example by calling the `wx.Window.Close`
1787function.
1788
1789You should check whether the application is forcing the deletion of
1790the window using `CanVeto`. If it returns ``False``, you must destroy
1791the window using `wx.Window.Destroy`. If the return value is ``True``,
1792it is up to you whether you respond by destroying the window or not.
1793For example you may wish to display a message dialog prompting to save
1794files or to cancel the close.
1795
1796If you don't destroy the window, you should call `Veto` to let the
1797calling code know that you did not destroy the window. This allows the
1798`wx.Window.Close` function to return ``True`` or ``False`` depending
1799on whether the close instruction was honored or not.", "
1800
1801Events
1802-------
1803 ========================= ==========================================
1804 wx.EVT_CLOSE This event is sent to a top-level window
1805 when it has been requested to close either
1806 from the user or programatically.
1807 wx.EVT_QUERY_END_SESSION This event is sent to the `wx.App` when the
1808 system is about to be logged off, giving the
1809 app a chance to veto the shutdown.
1810 wx.EVT_END_SESSION This event is sent to the `wx.App` when the
1811 system is being logged off.
1812 ========================= ==========================================
1813");
1814
d14a1e28
RD
1815class wxCloseEvent : public wxEvent
1816{
1817public:
e47ce385
RD
1818 DocCtorStr(
1819 wxCloseEvent(wxEventType type = wxEVT_NULL, int winid = 0),
1820 "Constructor.", "");
d0e2ede0 1821
e47ce385
RD
1822 DocDeclStr(
1823 void , SetLoggingOff(bool logOff),
1824 "Sets the 'logging off' flag.", "");
d0e2ede0 1825
e47ce385
RD
1826 DocDeclStr(
1827 bool , GetLoggingOff() const,
6c75a4cf
RD
1828 "Returns ``True`` if the user is logging off or ``False`` if the
1829system is shutting down. This method can only be called for end
1830session and query end session events, it doesn't make sense for close
1831window event.", "");
d0e2ede0 1832
d14a1e28 1833
e47ce385
RD
1834 DocDeclStr(
1835 void , Veto(bool veto = true),
1836 "Call this from your event handler to veto a system shutdown or to
1837signal to the calling application that a window close did not happen.
1838
1839You can only veto a shutdown or close if `CanVeto` returns true.", "");
d0e2ede0 1840
d14a1e28 1841 bool GetVeto() const;
d0e2ede0 1842
e47ce385
RD
1843 DocDeclStr(
1844 void , SetCanVeto(bool canVeto),
1845 "Sets the 'can veto' flag.", "");
d0e2ede0 1846
e47ce385
RD
1847 DocDeclStr(
1848 bool , CanVeto() const,
1849 "Returns true if you can veto a system shutdown or a window close
1850event. Vetoing a window close event is not possible if the calling
1851code wishes to force the application to exit, and so this function
1852must be called to check this.", "");
d0e2ede0 1853
0eae5d09 1854 %property(LoggingOff, GetLoggingOff, SetLoggingOff, doc="See `GetLoggingOff` and `SetLoggingOff`");
d14a1e28
RD
1855};
1856
1857
1858//---------------------------------------------------------------------------
1859%newgroup;
1860
e47ce385
RD
1861DocStr(wxShowEvent,
1862"An EVT_SHOW event is sent when a window is shown or hidden.", "");
1863
d14a1e28
RD
1864class wxShowEvent : public wxEvent
1865{
1866public:
a72f4631 1867 wxShowEvent(int winid = 0, bool show = false);
d0e2ede0 1868
d14a1e28
RD
1869 void SetShow(bool show);
1870 bool GetShow() const;
1871
7012bb9f 1872 %property(Show, GetShow, SetShow, doc="See `GetShow` and `SetShow`");
d14a1e28
RD
1873};
1874
1875
1876//---------------------------------------------------------------------------
1877%newgroup;
1878
e47ce385
RD
1879DocStr(wxIconizeEvent,
1880"An EVT_ICONIZE event is sent when a frame is iconized (minimized) or
1881restored.", "");
1882
d14a1e28
RD
1883class wxIconizeEvent: public wxEvent
1884{
1885public:
a72f4631 1886 wxIconizeEvent(int id = 0, bool iconized = true);
d0e2ede0 1887
e47ce385
RD
1888 DocDeclStr(
1889 bool , Iconized(),
1890 "Returns ``True`` if the frame has been iconized, ``False`` if it has
1891been restored.", "");
d0e2ede0 1892
d14a1e28
RD
1893};
1894
1895
1896//---------------------------------------------------------------------------
1897%newgroup;
1898
e47ce385
RD
1899DocStr(wxMaximizeEvent,
1900"An EVT_MAXIMIZE event is sent when a frame is maximized or restored.", "");
1901
d14a1e28
RD
1902class wxMaximizeEvent: public wxEvent
1903{
1904public:
1905 wxMaximizeEvent(int id = 0);
1906};
1907
1908//---------------------------------------------------------------------------
1909%newgroup;
1910
e47ce385
RD
1911DocStr(wxDropFilesEvent,
1912"This class is used for drop files events, that is, when files have
1913been dropped onto the window. This functionality is only available
1914under Windows. The window must have previously been enabled for
1915dropping by calling `wx.Window.DragAcceptFiles`.
1916
1917Important note: this is a separate implementation to the more general
1918drag and drop implementation using `wx.FileDropTarget`, and etc. This
1919implementation uses the older, Windows message-based approach of
1920dropping files.
1921
1922Use wx.EVT_DROP_FILES to bind an event handler to receive file drop
1923events.
1924", "");
1925
d14a1e28
RD
1926class wxDropFilesEvent: public wxEvent
1927{
1928public:
e47ce385
RD
1929
1930 // TODO: wrap the ctor!
1931
d0e2ede0 1932
e47ce385
RD
1933 DocDeclStr(
1934 wxPoint , GetPosition(),
1935 "Returns the position at which the files were dropped.", "");
d0e2ede0 1936
e47ce385
RD
1937 DocDeclStr(
1938 int , GetNumberOfFiles(),
1939 "Returns the number of files dropped.", "");
d0e2ede0 1940
d14a1e28
RD
1941
1942 %extend {
e47ce385
RD
1943 DocStr(
1944 GetFiles,
1945 "Returns a list of the filenames that were dropped.", "");
d0e2ede0 1946
d14a1e28
RD
1947 PyObject* GetFiles() {
1948 int count = self->GetNumberOfFiles();
1949 wxString* files = self->GetFiles();
e47ce385 1950 wxPyBlock_t blocked = wxPyBeginBlockThreads();
d14a1e28
RD
1951 PyObject* list = PyList_New(count);
1952
1953 if (!list) {
1954 PyErr_SetString(PyExc_MemoryError, "Can't allocate list of files!");
e47ce385 1955 wxPyEndBlockThreads(blocked);
d14a1e28
RD
1956 return NULL;
1957 }
1958
1959 for (int i=0; i<count; i++) {
1fc9204a 1960 PyList_SetItem(list, i, wx2PyString(files[i]));
d14a1e28 1961 }
e47ce385 1962 wxPyEndBlockThreads(blocked);
d14a1e28
RD
1963 return list;
1964 }
1965 }
0eae5d09
RD
1966
1967 %property(Files, GetFiles, doc="See `GetFiles`");
1968 %property(NumberOfFiles, GetNumberOfFiles, doc="See `GetNumberOfFiles`");
1969 %property(Position, GetPosition, doc="See `GetPosition`");
d14a1e28
RD
1970};
1971
1972
1973
1974//---------------------------------------------------------------------------
1975%newgroup;
1976
1977
d14a1e28
RD
1978enum wxUpdateUIMode
1979{
d14a1e28 1980 wxUPDATE_UI_PROCESS_ALL,
d14a1e28
RD
1981 wxUPDATE_UI_PROCESS_SPECIFIED
1982};
1983
64e8a1f0 1984
e47ce385
RD
1985DocStr(wxUpdateUIEvent,
1986"This class is used for EVT_UPDATE_UI pseudo-events which are sent by
1987wxWidgets to give an application the chance to update various user
1988interface elements.
1989
1990Without update UI events, an application has to work hard to
1991check/uncheck, enable/disable, and set the text for elements such as
1992menu items and toolbar buttons. The code for doing this has to be
1993mixed up with the code that is invoked when an action is invoked for a
1994menu item or button.
1995
1996With update UI events, you define an event handler to look at the
1997state of the application and change UI elements accordingly. wxWidgets
1998will call your handler functions in idle time, so you don't have to
1999worry where to call this code. In addition to being a clearer and more
2000declarative method, it also means you don't have to worry whether
2001you're updating a toolbar or menubar identifier. The same handler can
2002update a menu item and toolbar button, if the ID values are the same.
2003
2004Instead of directly manipulating the menu or button, you call
2005functions in the event object, such as `Check`. wxWidgets will
2006determine whether such a call has been made, and which UI element to
2007update.
2008
2009These events will work for popup menus as well as menubars. Just
2010before a menu is popped up, `wx.Menu.UpdateUI` is called to process
2011any UI events for the window that owns the menu.
2012
2013If you find that the overhead of UI update processing is affecting
2014your application, you can do one or both of the following:
2015
2016 1. Call `wx.UpdateUIEvent.SetMode` with a value of
2017 wx.UPDATE_UI_PROCESS_SPECIFIED, and set the extra style
2018 wx.WS_EX_PROCESS_UPDATE_EVENTS for every window that should
2019 receive update events. No other windows will receive update
2020 events.
2021
2022 2. Call `wx.UpdateUIEvent.SetUpdateInterval` with a millisecond
2023 value to set the delay between updates. You may need to call
2024 `wx.Window.UpdateWindowUI` at critical points, for example when
2025 a dialog is about to be shown, in case the user sees a slight
2026 delay before windows are updated.
2027
2028Note that although events are sent in idle time, defining a EVT_IDLE
2029handler for a window does not affect this because the events are sent
2030from an internal idle handler.
2031
2032wxWidgets tries to optimize update events on some platforms. On
2033Windows and GTK+, events for menubar items are only sent when the menu
2034is about to be shown, and not in idle time.
2035", "");
64e8a1f0 2036
d14a1e28
RD
2037class wxUpdateUIEvent : public wxCommandEvent
2038{
2039public:
e47ce385
RD
2040 DocCtorStr(
2041 wxUpdateUIEvent(wxWindowID commandId = 0),
2042 "Constructor", "");
d0e2ede0 2043
e47ce385
RD
2044 DocDeclStr(
2045 bool , GetChecked() const,
2046 "Returns ``True`` if the UI element should be checked.", "");
d0e2ede0 2047
e47ce385
RD
2048 DocDeclStr(
2049 bool , GetEnabled() const,
2050 "Returns ``True`` if the UI element should be enabled.", "");
3edb17de
RD
2051
2052 DocDeclStr(
2053 bool , GetShown() const,
2054 "Returns ``True`` if the UI element should be shown.", "");
d0e2ede0 2055
e47ce385
RD
2056 DocDeclStr(
2057 wxString , GetText() const,
2058 "Returns the text that should be set for the UI element.", "");
d0e2ede0 2059
e47ce385
RD
2060 DocDeclStr(
2061 bool , GetSetText() const,
2062 "Returns ``True`` if the application has called `SetText`. For
2063wxWidgets internal use only.", "");
d0e2ede0 2064
e47ce385
RD
2065 DocDeclStr(
2066 bool , GetSetChecked() const,
2067 "Returns ``True`` if the application has called `Check`. For wxWidgets
2068internal use only.", "");
d0e2ede0 2069
e47ce385
RD
2070 DocDeclStr(
2071 bool , GetSetEnabled() const,
2072 "Returns ``True`` if the application has called `Enable`. For wxWidgets
2073internal use only.", "");
d0e2ede0 2074
3edb17de
RD
2075 DocDeclStr(
2076 bool , GetSetShown() const,
2077 "Returns ``True`` if the application has called `Show`. For wxWidgets
2078internal use only.", "");
d0e2ede0 2079
d14a1e28 2080
e47ce385
RD
2081 DocDeclStr(
2082 void , Check(bool check),
2083 "Check or uncheck the UI element.", "");
d0e2ede0 2084
e47ce385
RD
2085 DocDeclStr(
2086 void , Enable(bool enable),
2087 "Enable or disable the UI element.", "");
3edb17de
RD
2088
2089 DocDeclStr(
2090 void , Show(bool show),
2091 "Show or hide the UI element.", "");
d0e2ede0
RD
2092
2093
e47ce385
RD
2094 DocDeclStr(
2095 void , SetText(const wxString& text),
2096 "Sets the text for this UI element.", "");
e47ce385 2097
d0e2ede0
RD
2098
2099
e47ce385
RD
2100 DocDeclStr(
2101 static void , SetUpdateInterval(long updateInterval),
2102 "Sets the interval between updates in milliseconds. Set to -1 to
2103disable updates, or to 0 to update as frequently as possible. The
2104default is 0.
d14a1e28 2105
e47ce385
RD
2106Use this to reduce the overhead of UI update events if your
2107application has a lot of windows. If you set the value to -1 or
2108greater than 0, you may also need to call `wx.Window.UpdateWindowUI`
2109at appropriate points in your application, such as when a dialog is
2110about to be shown.", "");
d0e2ede0 2111
d14a1e28 2112
e47ce385
RD
2113 DocDeclStr(
2114 static long , GetUpdateInterval(),
2115 "Returns the current interval between updates in milliseconds. -1
2116disables updates, 0 updates as frequently as possible.", "");
d0e2ede0 2117
d14a1e28 2118
e47ce385
RD
2119 DocDeclStr(
2120 static bool , CanUpdate(wxWindow *win),
2121 "Returns ``True`` if it is appropriate to update (send UI update events
2122to) this window.
2123
2124This function looks at the mode used (see `wx.UpdateUIEvent.SetMode`),
2125the wx.WS_EX_PROCESS_UPDATE_EVENTS flag in window, the time update
2126events were last sent in idle time, and the update interval, to
2127determine whether events should be sent to this window now. By default
2128this will always return true because the update mode is initially
2129wx.UPDATE_UI_PROCESS_ALL and the interval is set to 0; so update
2130events will be sent as often as possible. You can reduce the frequency
2131that events are sent by changing the mode and/or setting an update
2132interval.
2133", "");
d0e2ede0 2134
d14a1e28 2135
e47ce385
RD
2136 DocDeclStr(
2137 static void , ResetUpdateTime(),
2138 "Used internally to reset the last-updated time to the current time. It
2139is assumed that update events are normally sent in idle time, so this
2140is called at the end of idle processing.", "");
d0e2ede0 2141
d14a1e28 2142
e47ce385
RD
2143 DocDeclStr(
2144 static void , SetMode(wxUpdateUIMode mode),
2145 "Specify how wxWidgets will send update events: to all windows, or only
2146to those which specify that they will process the events.
2147
2148The mode may be one of the following values:
2149
2150 ============================= ==========================================
2151 wxUPDATE_UI_PROCESS_ALL Send UI update events to all windows. This
2152 is the default setting.
2153 wxUPDATE_UI_PROCESS_SPECIFIED Send UI update events only to windows that
2154 have the wx.WS_EX_PROCESS_UI_UPDATES extra
2155 style set.
2156 ============================= ==========================================
2157", "");
d0e2ede0 2158
d14a1e28 2159
e47ce385
RD
2160 DocDeclStr(
2161 static wxUpdateUIMode , GetMode(),
2162 "Returns a value specifying how wxWidgets will send update events: to
2163all windows, or only to those which specify that they will process the
2164events.", "");
d0e2ede0 2165
dba7934c
RD
2166 %property(Checked, GetChecked, Check, doc="See `GetChecked`");
2167 %property(Enabled, GetEnabled, Enable, doc="See `GetEnabled`");
2168 %property(Shown, GetShown, Show, doc="See `GetShown`");
2169 %property(Text, GetText, SetText, doc="See `GetText` and `SetText`");
d14a1e28
RD
2170};
2171
d14a1e28
RD
2172//---------------------------------------------------------------------------
2173%newgroup;
2174
e47ce385
RD
2175DocStr(wxSysColourChangedEvent,
2176"This class is used for EVT_SYS_COLOUR_CHANGED, which are generated
2177when the user changes the colour settings using the control
2178panel. This is only applicable under Windows.
2179
2180The default event handler for this event propagates the event to child
2181windows, since Windows only sends the events to top-level windows. If
2182intercepting this event for a top-level window, remember to call
2183`Skip` so the the base class handler will still be executed, or to
2184pass the event on to the window's children explicitly.
2185", "");
2186
d14a1e28
RD
2187class wxSysColourChangedEvent: public wxEvent {
2188public:
e47ce385
RD
2189 DocCtorStr(
2190 wxSysColourChangedEvent(),
2191 "Constructor", "");
d14a1e28
RD
2192};
2193
2194//---------------------------------------------------------------------------
2195%newgroup;
2196
2197
e47ce385
RD
2198DocStr(wxMouseCaptureChangedEvent,
2199"An mouse capture changed event (EVT_MOUSE_CAPTURE_CHANGED) is sent to
2200a window that loses its mouse capture. This is called even if
2201`wx.Window.ReleaseMouse` was called by the application code. Handling
2202this event allows an application to cater for unexpected capture
2203releases which might otherwise confuse mouse handling code.
2204
2205This event is implemented under Windows only.", "");
2206
d14a1e28
RD
2207class wxMouseCaptureChangedEvent : public wxEvent
2208{
2209public:
e47ce385
RD
2210 DocCtorStr(
2211 wxMouseCaptureChangedEvent(wxWindowID winid = 0, wxWindow* gainedCapture = NULL),
2212 "Constructor", "");
d14a1e28 2213
e47ce385
RD
2214 DocDeclStr(
2215 wxWindow* , GetCapturedWindow() const,
2216 "Returns the window that gained the capture, or ``None`` if it was a
2217non-wxWidgets window.", "");
d0e2ede0 2218
203bfdca 2219 %property(CapturedWindow, GetCapturedWindow, doc="See `GetCapturedWindow`");
d14a1e28
RD
2220};
2221
2222//---------------------------------------------------------------------------
2223%newgroup;
2224
e249d3c0
RD
2225DocStr(wxMouseCaptureLostEvent,
2226"A mouse capture lost event is sent to a window that obtained mouse
2227capture, which was subsequently loss due to \"external\" event, for
2228example when a dialog box is shown or if another application captures
2229the mouse.
2230
2231If this happens, this event is sent to all windows that are on the
2232capture stack (i.e. a window that called `wx.Window.CaptureMouse`, but
2233didn't call `wx.Window.ReleaseMouse` yet). The event is *not* sent
2234if the capture changes because of a call to CaptureMouse or
2235ReleaseMouse.
2236
2237This event is currently emitted under Windows only.
2238", "");
2239
2240class wxMouseCaptureLostEvent : public wxEvent
2241{
2242public:
2243 wxMouseCaptureLostEvent(wxWindowID winid = 0);
2244};
2245
2246//---------------------------------------------------------------------------
2247%newgroup;
2248
e47ce385
RD
2249DocStr(wxDisplayChangedEvent,
2250"An EVT_DISPLAY_CHANGED event is sent to all windows when the display
2251resolution has changed.
2252
2253This event is implemented under Windows only.", "");
2254
d14a1e28
RD
2255class wxDisplayChangedEvent : public wxEvent
2256{
2257public:
e47ce385
RD
2258 DocCtorStr(
2259 wxDisplayChangedEvent(),
2260 "", "");
d14a1e28
RD
2261};
2262
2263//---------------------------------------------------------------------------
2264%newgroup;
2265
e47ce385
RD
2266DocStr(wxPaletteChangedEvent,
2267"An EVT_PALETTE_CHANGED event is sent when the system palette has
2268changed, thereby giving each window a chance to redo their own to
2269match.
2270
2271This event is implemented under Windows only.", "");
2272
d14a1e28
RD
2273class wxPaletteChangedEvent : public wxEvent
2274{
2275public:
2276 wxPaletteChangedEvent(wxWindowID id = 0);
2277
2278 void SetChangedWindow(wxWindow* win);
2279 wxWindow* GetChangedWindow();
2280
7012bb9f 2281 %property(ChangedWindow, GetChangedWindow, SetChangedWindow, doc="See `GetChangedWindow` and `SetChangedWindow`");
d14a1e28
RD
2282};
2283
2284//---------------------------------------------------------------------------
2285%newgroup;
2286
e47ce385
RD
2287DocStr(wxQueryNewPaletteEvent,
2288 "An EVT_QUERY_NEW_PALETE event indicates the window is getting keyboard
2289focus and should re-do its palette.
2290
2291This event is implemented under Windows only.", "");
d14a1e28 2292
d14a1e28
RD
2293class wxQueryNewPaletteEvent : public wxEvent
2294{
2295public:
e47ce385
RD
2296 DocCtorStr(
2297 wxQueryNewPaletteEvent(wxWindowID winid = 0),
2298 "Constructor.", "");
d14a1e28 2299
e47ce385
RD
2300 DocDeclStr(
2301 void , SetPaletteRealized(bool realized),
2302 "App should set this if it changes the palette.", "");
d0e2ede0 2303
d14a1e28 2304 bool GetPaletteRealized() const;
7012bb9f
RD
2305
2306 %property(PaletteRealized, GetPaletteRealized, SetPaletteRealized, doc="See `GetPaletteRealized` and `SetPaletteRealized`");
d14a1e28
RD
2307};
2308
2309//---------------------------------------------------------------------------
2310%newgroup;
2311
2312
e47ce385
RD
2313
2314DocStr(wxNavigationKeyEvent,
2315"EVT_NAVIGATION_KEY events are used to control moving the focus between
2316widgets, otherwise known as tab-traversal. You woudl normally not
2317catch navigation events in applications as there are already
2318appropriate handlers in `wx.Dialog` and `wx.Panel`, but you may find
2319it useful to send navigation events in certain situations to change
2320the focus in certain ways, although it's probably easier to just call
2321`wx.Window.Navigate`.", "");
d14a1e28
RD
2322
2323class wxNavigationKeyEvent : public wxEvent
2324{
2325public:
e47ce385
RD
2326 DocCtorStr(
2327 wxNavigationKeyEvent(),
2328 "", "");
d0e2ede0 2329
e47ce385
RD
2330 DocDeclStr(
2331 bool , GetDirection() const,
2332 "Returns ``True`` if the direction is forward, ``False`` otherwise.", "");
d0e2ede0 2333
e47ce385
RD
2334 DocDeclStr(
2335 void , SetDirection(bool forward),
2336 "Specify the direction that the navigation should take. Usually the
2337difference between using Tab and Shift-Tab.", "");
d0e2ede0 2338
d14a1e28 2339
e47ce385
RD
2340 DocDeclStr(
2341 bool , IsWindowChange() const,
2342 "Returns ``True`` if window change is allowed.", "");
d0e2ede0 2343
e47ce385
RD
2344 DocDeclStr(
2345 void , SetWindowChange(bool ischange),
2346 "Specify if the navigation should be able to change parent windows.
2347For example, changing notebook pages, etc. This is usually implemented
2348by using Control-Tab.", "");
d0e2ede0 2349
d14a1e28 2350
e47ce385
RD
2351 DocDeclStr(
2352 bool , IsFromTab() const,
2353 "Returns ``True`` if the navigation event is originated from the Tab
2354key.", "");
d0e2ede0 2355
e47ce385
RD
2356 DocDeclStr(
2357 void , SetFromTab(bool bIs),
2358 "Set to true under MSW if the event was generated using the tab key.
2359This is required for proper navogation over radio buttons.", "");
d0e2ede0 2360
b7189025 2361
e47ce385
RD
2362 DocDeclStr(
2363 void , SetFlags(long flags),
2364 "Set the navigation flags to a combination of the following:
2365
2366 * wx.NavigationKeyEvent.IsBackward
2367 * wx.NavigationKeyEvent.IsForward
2368 * wx.NavigationKeyEvent.WinChange
2369 * wx.NavigationKeyEvent.FromTab
2370", "");
d0e2ede0
RD
2371
2372
e47ce385
RD
2373 DocDeclStr(
2374 wxWindow* , GetCurrentFocus() const,
2375 "Returns the child window which currenty has the focus. May be
2376``None``.", "");
d0e2ede0 2377
e47ce385
RD
2378 DocDeclStr(
2379 void , SetCurrentFocus(wxWindow *win),
2380 "Set the window that has the focus.", "");
d0e2ede0 2381
3b74f194
RD
2382
2383 enum {
5a319c5c 2384 IsBackward,
3b74f194 2385 IsForward,
b7189025
RD
2386 WinChange,
2387 FromTab
3b74f194 2388 };
203bfdca
RD
2389
2390 %property(CurrentFocus, GetCurrentFocus, SetCurrentFocus, doc="See `GetCurrentFocus` and `SetCurrentFocus`");
2391 %property(Direction, GetDirection, SetDirection, doc="See `GetDirection` and `SetDirection`");
2392
d14a1e28
RD
2393};
2394
d14a1e28
RD
2395//---------------------------------------------------------------------------
2396%newgroup;
2397
e47ce385
RD
2398
2399DocStr(wxWindowCreateEvent,
2400 "The EVT_WINDOW_CREATE event is sent as soon as the window object (the
2401underlying GUI object) exists.", "");
d14a1e28
RD
2402
2403class wxWindowCreateEvent : public wxCommandEvent
2404{
2405public:
2406 wxWindowCreateEvent(wxWindow *win = NULL);
d0e2ede0 2407
e47ce385
RD
2408 DocDeclStr(
2409 wxWindow *, GetWindow() const,
2410 "Returns the window that this event refers to.", "");
d0e2ede0 2411
dba7934c 2412 %property(Window, GetWindow, doc="See `GetWindow`");
d14a1e28
RD
2413};
2414
e47ce385
RD
2415
2416DocStr(wxWindowDestroyEvent,
02b800ce
RD
2417 "The EVT_WINDOW_DESTROY event is sent from the `wx.Window` destructor
2418when the GUI window is destroyed.
2419
2420When a class derived from `wx.Window` is destroyed its destructor will
2421have already run by the time this event is sent. Therefore this event
2422will not usually be received at all by the window itself. Since it is
2423received after the destructor has run, an object should not try to
2424handle its own wx.WindowDestroyEvent, but it can be used to get
2425notification of the destruction of another window.", "");
d14a1e28
RD
2426class wxWindowDestroyEvent : public wxCommandEvent
2427{
2428public:
2429 wxWindowDestroyEvent(wxWindow *win = NULL);
d0e2ede0 2430
e47ce385
RD
2431 DocDeclStr(
2432 wxWindow *, GetWindow() const,
d0e2ede0 2433 "Returns the window that this event refers to.", "");
dba7934c
RD
2434
2435 %property(Window, GetWindow, doc="See `GetWindow`");
d14a1e28
RD
2436};
2437
2438
2439//---------------------------------------------------------------------------
2440%newgroup;
2441
e47ce385
RD
2442
2443DocStr(wxContextMenuEvent,
2444"This class is used for context menu events (EVT_CONTECT_MENU,) sent to
2445give the application a chance to show a context (popup) menu.", "");
d14a1e28
RD
2446
2447class wxContextMenuEvent : public wxCommandEvent
2448{
2449public:
e47ce385
RD
2450 DocCtorStr(
2451 wxContextMenuEvent(wxEventType type = wxEVT_NULL,
2452 wxWindowID winid = 0,
2453 const wxPoint& pt = wxDefaultPosition),
2454 "Constructor.", "");
d14a1e28
RD
2455
2456 // Position of event (in screen coordinates)
e47ce385
RD
2457 DocDeclStr(
2458 const wxPoint& , GetPosition() const,
2459 "Returns the position (in screen coordinants) at which the menu should
2460be shown.", "");
2461
d0e2ede0 2462
e47ce385
RD
2463 DocDeclStr(
2464 void , SetPosition(const wxPoint& pos),
2465 "Sets the position at which the menu should be shown.", "");
d0e2ede0 2466
0eae5d09 2467 %property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`");
d14a1e28
RD
2468};
2469
2470//---------------------------------------------------------------------------
2471%newgroup;
2472
d14a1e28
RD
2473enum wxIdleMode
2474{
d14a1e28 2475 wxIDLE_PROCESS_ALL,
d14a1e28
RD
2476 wxIDLE_PROCESS_SPECIFIED
2477};
2478
64e8a1f0 2479
e47ce385
RD
2480DocStr(wxIdleEvent,
2481"This class is used for EVT_IDLE events, which are generated and sent
2482when the application *becomes* idle. In other words, the when the
2483event queue becomes empty then idle events are sent to all windows (by
2484default) and as long as none of them call `RequestMore` then there are
2485no more idle events until after the system event queue has some normal
2486events and then becomes empty again.
2487
2488By default, idle events are sent to all windows. If this is causing a
2489significant overhead in your application, you can call
2490`wx.IdleEvent.SetMode` with the value wx.IDLE_PROCESS_SPECIFIED, and
2491set the wx.WS_EX_PROCESS_IDLE extra window style for every window
2492which should receive idle events. Then idle events will only be sent
2493to those windows and not to any others.", "");
2494
d14a1e28
RD
2495class wxIdleEvent : public wxEvent
2496{
2497public:
e47ce385
RD
2498 DocCtorStr(
2499 wxIdleEvent(),
2500 "Constructor", "");
d0e2ede0
RD
2501
2502
e47ce385
RD
2503 DocDeclStr(
2504 void , RequestMore(bool needMore = true),
2505 "Tells wxWidgets that more processing is required. This function can be
2506called by an EVT_IDLE handler for a window to indicate that the
2507application should forward the EVT_IDLE event once more to the
2508application windows. If no window calls this function during its
2509EVT_IDLE handler, then the application will remain in a passive event
2510loop until a new event is posted to the application by the windowing
2511system.", "");
d0e2ede0 2512
e47ce385
RD
2513 DocDeclStr(
2514 bool , MoreRequested() const,
2515 "Returns ``True`` if the OnIdle function processing this event
2516requested more processing time.", "");
d0e2ede0 2517
e47ce385
RD
2518
2519 DocDeclStr(
2520 static void , SetMode(wxIdleMode mode),
2521 "Static method for specifying how wxWidgets will send idle events: to
2522all windows, or only to those which specify that they will process the
2523events.
2524
2525The mode can be one of the following values:
2526
2527 ========================= ========================================
2528 wx.IDLE_PROCESS_ALL Send idle events to all windows
2529 wx.IDLE_PROCESS_SPECIFIED Send idle events only to windows that have
2530 the wx.WS_EX_PROCESS_IDLE extra style
2531 flag set.
2532 ========================= ========================================
2533", "");
d0e2ede0 2534
d14a1e28 2535
e47ce385
RD
2536 DocDeclStr(
2537 static wxIdleMode , GetMode(),
2538 "Static method returning a value specifying how wxWidgets will send
2539idle events: to all windows, or only to those which specify that they
2540will process the events.", "");
d0e2ede0 2541
d14a1e28 2542
e47ce385
RD
2543 DocDeclStr(
2544 static bool , CanSend(wxWindow* win),
2545 "Returns ``True`` if it is appropriate to send idle events to this
2546window.
d14a1e28 2547
e47ce385
RD
2548This function looks at the mode used (see `wx.IdleEvent.SetMode`), and
2549the wx.WS_EX_PROCESS_IDLE style in window to determine whether idle
2550events should be sent to this window now. By default this will always
2551return ``True`` because the update mode is initially
2552wx.IDLE_PROCESS_ALL. You can change the mode to only send idle events
2553to windows with the wx.WS_EX_PROCESS_IDLE extra window style set.", "");
d0e2ede0 2554
d14a1e28
RD
2555};
2556
05c43d46
RD
2557//---------------------------------------------------------------------------
2558%newgroup;
2559
2560
2561DocStr(wxClipboardTextEvent,
2562"A Clipboard Text event is sent when a window intercepts a text
2563copy/cut/paste message, i.e. the user has cut/copied/pasted data
2564from/into a text control via ctrl-C/X/V, ctrl/shift-del/insert, a
2565popup menu command, etc. NOTE : under windows these events are *NOT*
2566generated automatically for a Rich Edit text control.", "");
2567
2568class wxClipboardTextEvent : public wxCommandEvent
2569{
2570public:
2571 wxClipboardTextEvent(wxEventType type = wxEVT_NULL,
2572 wxWindowID winid = 0);
2573};
2574
2575
d14a1e28
RD
2576//---------------------------------------------------------------------------
2577%newgroup;
2578
2579// These classes can be derived from in Python and passed through the event
2580// system without loosing anything. They do this by keeping a reference to
2581// themselves and some special case handling in wxPyCallback::EventThunker.
2582
e47ce385
RD
2583DocStr(wxPyEvent,
2584"wx.PyEvent can be used as a base class for implementing custom event
2585types in Python. You should derived from this class instead of
2586`wx.Event` because this class is Python-aware and is able to transport
2587its Python bits safely through the wxWidgets event system and have
2588them still be there when the event handler is invoked.
2589
2590:see: `wx.PyCommandEvent`
2591", "");
2592
d14a1e28
RD
2593class wxPyEvent : public wxEvent {
2594public:
e47ce385
RD
2595 %pythonAppend wxPyEvent "self._SetSelf(self)"
2596 DocCtorStr(
2597 wxPyEvent(int winid=0, wxEventType eventType = wxEVT_NULL ),
2598 "", "");
d0e2ede0 2599
d14a1e28
RD
2600 ~wxPyEvent();
2601
2602
e47ce385
RD
2603 %Rename(_SetSelf, void , SetSelf(PyObject* self));
2604 %Rename(_GetSelf, PyObject* , GetSelf());
d14a1e28
RD
2605};
2606
2607
e47ce385
RD
2608
2609DocStr(wxPyCommandEvent,
2610"wx.PyCommandEvent can be used as a base class for implementing custom
2611event types in Python, where the event shoudl travel up to parent
2612windows looking for a handler. You should derived from this class
2613instead of `wx.CommandEvent` because this class is Python-aware and is
2614able to transport its Python bits safely through the wxWidgets event
2615system and have them still be there when the event handler is invoked.
2616
2617:see: `wx.PyEvent`
2618", "");
2619
d14a1e28
RD
2620class wxPyCommandEvent : public wxCommandEvent {
2621public:
e47ce385
RD
2622 %pythonAppend wxPyCommandEvent "self._SetSelf(self)"
2623
2624 DocCtorStr(
2625 wxPyCommandEvent(wxEventType eventType = wxEVT_NULL, int id=0),
2626 "", "");
d0e2ede0 2627
d14a1e28
RD
2628 ~wxPyCommandEvent();
2629
e47ce385
RD
2630 %Rename(_SetSelf, void , SetSelf(PyObject* self));
2631 %Rename(_GetSelf, PyObject* , GetSelf());
d14a1e28
RD
2632};
2633
2634
2635
2636//---------------------------------------------------------------------------
2637
2638
e47ce385
RD
2639DocStr(wxDateEvent,
2640"This event class holds information about a date change event and is
2641used together with `wx.DatePickerCtrl`. It also serves as a base class
2642for `wx.calendar.CalendarEvent`. Bind these event types with
2643EVT_DATE_CHANGED.", "");
2644
b3b61cda
RD
2645class wxDateEvent : public wxCommandEvent
2646{
2647public:
e47ce385
RD
2648 DocCtorStr(
2649 wxDateEvent(wxWindow *win, const wxDateTime& dt, wxEventType type),
2650 "", "");
b3b61cda 2651
e47ce385
RD
2652 DocDeclStr(
2653 const wxDateTime& , GetDate() const,
2654 "Returns the date.", "");
d0e2ede0 2655
e47ce385
RD
2656 DocDeclStr(
2657 void , SetDate(const wxDateTime &date),
2658 "Sets the date carried by the event, normally only used by the library
2659internally.", "");
d0e2ede0 2660
0eae5d09 2661 %property(Date, GetDate, SetDate, doc="See `GetDate` and `SetDate`");
b3b61cda
RD
2662
2663};
2664
d14a1e28 2665
b3b61cda
RD
2666%constant wxEventType wxEVT_DATE_CHANGED;
2667
2668%pythoncode {
2669 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
2670}
2671
2672
2673//---------------------------------------------------------------------------
d0e2ede0 2674//---------------------------------------------------------------------------