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