1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface for common event classes and event binders
7 // Created: 24-May-1998
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
17 // Include some extra python code here
18 %pythoncode "_event_ex.py"
20 //---------------------------------------------------------------------------
23 // the predefined constants for the number of times we propagate event
24 // upwards window child-parent chain
25 enum Propagation_state
27 // don't propagate it at all
28 wxEVENT_PROPAGATE_NONE = 0,
30 // propagate it until it is processed
31 wxEVENT_PROPAGATE_MAX = INT_MAX
35 //---------------------------------------------------------------------------
38 wxEventType wxNewEventType();
41 %constant wxEventType wxEVT_NULL;
42 %constant wxEventType wxEVT_FIRST;
43 %constant wxEventType wxEVT_USER_FIRST;
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;
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;
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;
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;
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;
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 %constant wxEventType wxEVT_HOTKEY;
105 %constant wxEventType wxEVT_SET_CURSOR;
107 // wxScrollBar and wxSlider event identifiers
108 %constant wxEventType wxEVT_SCROLL_TOP;
109 %constant wxEventType wxEVT_SCROLL_BOTTOM;
110 %constant wxEventType wxEVT_SCROLL_LINEUP;
111 %constant wxEventType wxEVT_SCROLL_LINEDOWN;
112 %constant wxEventType wxEVT_SCROLL_PAGEUP;
113 %constant wxEventType wxEVT_SCROLL_PAGEDOWN;
114 %constant wxEventType wxEVT_SCROLL_THUMBTRACK;
115 %constant wxEventType wxEVT_SCROLL_THUMBRELEASE;
116 %constant wxEventType wxEVT_SCROLL_ENDSCROLL;
118 // Scroll events from wxWindow
119 %constant wxEventType wxEVT_SCROLLWIN_TOP;
120 %constant wxEventType wxEVT_SCROLLWIN_BOTTOM;
121 %constant wxEventType wxEVT_SCROLLWIN_LINEUP;
122 %constant wxEventType wxEVT_SCROLLWIN_LINEDOWN;
123 %constant wxEventType wxEVT_SCROLLWIN_PAGEUP;
124 %constant wxEventType wxEVT_SCROLLWIN_PAGEDOWN;
125 %constant wxEventType wxEVT_SCROLLWIN_THUMBTRACK;
126 %constant wxEventType wxEVT_SCROLLWIN_THUMBRELEASE;
129 %constant wxEventType wxEVT_SIZE;
130 %constant wxEventType wxEVT_MOVE;
131 %constant wxEventType wxEVT_CLOSE_WINDOW;
132 %constant wxEventType wxEVT_END_SESSION;
133 %constant wxEventType wxEVT_QUERY_END_SESSION;
134 %constant wxEventType wxEVT_ACTIVATE_APP;
135 %constant wxEventType wxEVT_POWER;
136 %constant wxEventType wxEVT_ACTIVATE;
137 %constant wxEventType wxEVT_CREATE;
138 %constant wxEventType wxEVT_DESTROY;
139 %constant wxEventType wxEVT_SHOW;
140 %constant wxEventType wxEVT_ICONIZE;
141 %constant wxEventType wxEVT_MAXIMIZE;
142 %constant wxEventType wxEVT_MOUSE_CAPTURE_CHANGED;
143 %constant wxEventType wxEVT_PAINT;
144 %constant wxEventType wxEVT_ERASE_BACKGROUND;
145 %constant wxEventType wxEVT_NC_PAINT;
146 %constant wxEventType wxEVT_PAINT_ICON;
147 %constant wxEventType wxEVT_MENU_OPEN;
148 %constant wxEventType wxEVT_MENU_CLOSE;
149 %constant wxEventType wxEVT_MENU_HIGHLIGHT;
151 %constant wxEventType wxEVT_CONTEXT_MENU;
152 %constant wxEventType wxEVT_SYS_COLOUR_CHANGED;
153 %constant wxEventType wxEVT_DISPLAY_CHANGED;
154 %constant wxEventType wxEVT_SETTING_CHANGED;
155 %constant wxEventType wxEVT_QUERY_NEW_PALETTE;
156 %constant wxEventType wxEVT_PALETTE_CHANGED;
157 %constant wxEventType wxEVT_DROP_FILES;
158 %constant wxEventType wxEVT_DRAW_ITEM;
159 %constant wxEventType wxEVT_MEASURE_ITEM;
160 %constant wxEventType wxEVT_COMPARE_ITEM;
161 %constant wxEventType wxEVT_INIT_DIALOG;
162 %constant wxEventType wxEVT_IDLE;
163 %constant wxEventType wxEVT_UPDATE_UI;
164 %constant wxEventType wxEVT_SIZING;
165 %constant wxEventType wxEVT_MOVING;
166 %constant wxEventType wxEVT_HIBERNATE;
169 // Generic command events
170 // Note: a click is a higher-level event than button down/up
171 %constant wxEventType wxEVT_COMMAND_LEFT_CLICK;
172 %constant wxEventType wxEVT_COMMAND_LEFT_DCLICK;
173 %constant wxEventType wxEVT_COMMAND_RIGHT_CLICK;
174 %constant wxEventType wxEVT_COMMAND_RIGHT_DCLICK;
175 %constant wxEventType wxEVT_COMMAND_SET_FOCUS;
176 %constant wxEventType wxEVT_COMMAND_KILL_FOCUS;
177 %constant wxEventType wxEVT_COMMAND_ENTER;
183 %# Create some event binders
184 EVT_SIZE = wx.PyEventBinder( wxEVT_SIZE )
185 EVT_SIZING = wx.PyEventBinder( wxEVT_SIZING )
186 EVT_MOVE = wx.PyEventBinder( wxEVT_MOVE )
187 EVT_MOVING = wx.PyEventBinder( wxEVT_MOVING )
188 EVT_CLOSE = wx.PyEventBinder( wxEVT_CLOSE_WINDOW )
189 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
190 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
191 EVT_PAINT = wx.PyEventBinder( wxEVT_PAINT )
192 EVT_NC_PAINT = wx.PyEventBinder( wxEVT_NC_PAINT )
193 EVT_ERASE_BACKGROUND = wx.PyEventBinder( wxEVT_ERASE_BACKGROUND )
194 EVT_CHAR = wx.PyEventBinder( wxEVT_CHAR )
195 EVT_KEY_DOWN = wx.PyEventBinder( wxEVT_KEY_DOWN )
196 EVT_KEY_UP = wx.PyEventBinder( wxEVT_KEY_UP )
197 EVT_HOTKEY = wx.PyEventBinder( wxEVT_HOTKEY, 1)
198 EVT_CHAR_HOOK = wx.PyEventBinder( wxEVT_CHAR_HOOK )
199 EVT_MENU_OPEN = wx.PyEventBinder( wxEVT_MENU_OPEN )
200 EVT_MENU_CLOSE = wx.PyEventBinder( wxEVT_MENU_CLOSE )
201 EVT_MENU_HIGHLIGHT = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT, 1)
202 EVT_MENU_HIGHLIGHT_ALL = wx.PyEventBinder( wxEVT_MENU_HIGHLIGHT )
203 EVT_SET_FOCUS = wx.PyEventBinder( wxEVT_SET_FOCUS )
204 EVT_KILL_FOCUS = wx.PyEventBinder( wxEVT_KILL_FOCUS )
205 EVT_CHILD_FOCUS = wx.PyEventBinder( wxEVT_CHILD_FOCUS )
206 EVT_ACTIVATE = wx.PyEventBinder( wxEVT_ACTIVATE )
207 EVT_ACTIVATE_APP = wx.PyEventBinder( wxEVT_ACTIVATE_APP )
208 EVT_HIBERNATE = wx.PyEventBinder( wxEVT_HIBERNATE )
209 EVT_END_SESSION = wx.PyEventBinder( wxEVT_END_SESSION )
210 EVT_QUERY_END_SESSION = wx.PyEventBinder( wxEVT_QUERY_END_SESSION )
211 EVT_DROP_FILES = wx.PyEventBinder( wxEVT_DROP_FILES )
212 EVT_INIT_DIALOG = wx.PyEventBinder( wxEVT_INIT_DIALOG )
213 EVT_SYS_COLOUR_CHANGED = wx.PyEventBinder( wxEVT_SYS_COLOUR_CHANGED )
214 EVT_DISPLAY_CHANGED = wx.PyEventBinder( wxEVT_DISPLAY_CHANGED )
215 EVT_SHOW = wx.PyEventBinder( wxEVT_SHOW )
216 EVT_MAXIMIZE = wx.PyEventBinder( wxEVT_MAXIMIZE )
217 EVT_ICONIZE = wx.PyEventBinder( wxEVT_ICONIZE )
218 EVT_NAVIGATION_KEY = wx.PyEventBinder( wxEVT_NAVIGATION_KEY )
219 EVT_PALETTE_CHANGED = wx.PyEventBinder( wxEVT_PALETTE_CHANGED )
220 EVT_QUERY_NEW_PALETTE = wx.PyEventBinder( wxEVT_QUERY_NEW_PALETTE )
221 EVT_WINDOW_CREATE = wx.PyEventBinder( wxEVT_CREATE )
222 EVT_WINDOW_DESTROY = wx.PyEventBinder( wxEVT_DESTROY )
223 EVT_SET_CURSOR = wx.PyEventBinder( wxEVT_SET_CURSOR )
224 EVT_MOUSE_CAPTURE_CHANGED = wx.PyEventBinder( wxEVT_MOUSE_CAPTURE_CHANGED )
226 EVT_LEFT_DOWN = wx.PyEventBinder( wxEVT_LEFT_DOWN )
227 EVT_LEFT_UP = wx.PyEventBinder( wxEVT_LEFT_UP )
228 EVT_MIDDLE_DOWN = wx.PyEventBinder( wxEVT_MIDDLE_DOWN )
229 EVT_MIDDLE_UP = wx.PyEventBinder( wxEVT_MIDDLE_UP )
230 EVT_RIGHT_DOWN = wx.PyEventBinder( wxEVT_RIGHT_DOWN )
231 EVT_RIGHT_UP = wx.PyEventBinder( wxEVT_RIGHT_UP )
232 EVT_MOTION = wx.PyEventBinder( wxEVT_MOTION )
233 EVT_LEFT_DCLICK = wx.PyEventBinder( wxEVT_LEFT_DCLICK )
234 EVT_MIDDLE_DCLICK = wx.PyEventBinder( wxEVT_MIDDLE_DCLICK )
235 EVT_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_RIGHT_DCLICK )
236 EVT_LEAVE_WINDOW = wx.PyEventBinder( wxEVT_LEAVE_WINDOW )
237 EVT_ENTER_WINDOW = wx.PyEventBinder( wxEVT_ENTER_WINDOW )
238 EVT_MOUSEWHEEL = wx.PyEventBinder( wxEVT_MOUSEWHEEL )
240 EVT_MOUSE_EVENTS = wx.PyEventBinder([ wxEVT_LEFT_DOWN,
256 %# Scrolling from wxWindow (sent to wxScrolledWindow)
257 EVT_SCROLLWIN = wx.PyEventBinder([ wxEVT_SCROLLWIN_TOP,
258 wxEVT_SCROLLWIN_BOTTOM,
259 wxEVT_SCROLLWIN_LINEUP,
260 wxEVT_SCROLLWIN_LINEDOWN,
261 wxEVT_SCROLLWIN_PAGEUP,
262 wxEVT_SCROLLWIN_PAGEDOWN,
263 wxEVT_SCROLLWIN_THUMBTRACK,
264 wxEVT_SCROLLWIN_THUMBRELEASE,
267 EVT_SCROLLWIN_TOP = wx.PyEventBinder( wxEVT_SCROLLWIN_TOP )
268 EVT_SCROLLWIN_BOTTOM = wx.PyEventBinder( wxEVT_SCROLLWIN_BOTTOM )
269 EVT_SCROLLWIN_LINEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEUP )
270 EVT_SCROLLWIN_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_LINEDOWN )
271 EVT_SCROLLWIN_PAGEUP = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEUP )
272 EVT_SCROLLWIN_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLLWIN_PAGEDOWN )
273 EVT_SCROLLWIN_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBTRACK )
274 EVT_SCROLLWIN_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLLWIN_THUMBRELEASE )
276 %# Scrolling from wx.Slider and wx.ScrollBar
277 EVT_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
280 wxEVT_SCROLL_LINEDOWN,
282 wxEVT_SCROLL_PAGEDOWN,
283 wxEVT_SCROLL_THUMBTRACK,
284 wxEVT_SCROLL_THUMBRELEASE,
285 wxEVT_SCROLL_ENDSCROLL,
288 EVT_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP )
289 EVT_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM )
290 EVT_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP )
291 EVT_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN )
292 EVT_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP )
293 EVT_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN )
294 EVT_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK )
295 EVT_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE )
296 EVT_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL )
298 %# Scrolling from wx.Slider and wx.ScrollBar, with an id
299 EVT_COMMAND_SCROLL = wx.PyEventBinder([ wxEVT_SCROLL_TOP,
302 wxEVT_SCROLL_LINEDOWN,
304 wxEVT_SCROLL_PAGEDOWN,
305 wxEVT_SCROLL_THUMBTRACK,
306 wxEVT_SCROLL_THUMBRELEASE,
307 wxEVT_SCROLL_ENDSCROLL,
310 EVT_COMMAND_SCROLL_TOP = wx.PyEventBinder( wxEVT_SCROLL_TOP, 1)
311 EVT_COMMAND_SCROLL_BOTTOM = wx.PyEventBinder( wxEVT_SCROLL_BOTTOM, 1)
312 EVT_COMMAND_SCROLL_LINEUP = wx.PyEventBinder( wxEVT_SCROLL_LINEUP, 1)
313 EVT_COMMAND_SCROLL_LINEDOWN = wx.PyEventBinder( wxEVT_SCROLL_LINEDOWN, 1)
314 EVT_COMMAND_SCROLL_PAGEUP = wx.PyEventBinder( wxEVT_SCROLL_PAGEUP, 1)
315 EVT_COMMAND_SCROLL_PAGEDOWN = wx.PyEventBinder( wxEVT_SCROLL_PAGEDOWN, 1)
316 EVT_COMMAND_SCROLL_THUMBTRACK = wx.PyEventBinder( wxEVT_SCROLL_THUMBTRACK, 1)
317 EVT_COMMAND_SCROLL_THUMBRELEASE = wx.PyEventBinder( wxEVT_SCROLL_THUMBRELEASE, 1)
318 EVT_COMMAND_SCROLL_ENDSCROLL = wx.PyEventBinder( wxEVT_SCROLL_ENDSCROLL, 1)
320 EVT_BUTTON = wx.PyEventBinder( wxEVT_COMMAND_BUTTON_CLICKED, 1)
321 EVT_CHECKBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKBOX_CLICKED, 1)
322 EVT_CHOICE = wx.PyEventBinder( wxEVT_COMMAND_CHOICE_SELECTED, 1)
323 EVT_LISTBOX = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_SELECTED, 1)
324 EVT_LISTBOX_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, 1)
325 EVT_MENU = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 1)
326 EVT_MENU_RANGE = wx.PyEventBinder( wxEVT_COMMAND_MENU_SELECTED, 2)
327 EVT_SLIDER = wx.PyEventBinder( wxEVT_COMMAND_SLIDER_UPDATED, 1)
328 EVT_RADIOBOX = wx.PyEventBinder( wxEVT_COMMAND_RADIOBOX_SELECTED, 1)
329 EVT_RADIOBUTTON = wx.PyEventBinder( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 1)
331 EVT_SCROLLBAR = wx.PyEventBinder( wxEVT_COMMAND_SCROLLBAR_UPDATED, 1)
332 EVT_VLBOX = wx.PyEventBinder( wxEVT_COMMAND_VLBOX_SELECTED, 1)
333 EVT_COMBOBOX = wx.PyEventBinder( wxEVT_COMMAND_COMBOBOX_SELECTED, 1)
334 EVT_TOOL = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 1)
335 EVT_TOOL_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_CLICKED, 2)
336 EVT_TOOL_RCLICKED = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 1)
337 EVT_TOOL_RCLICKED_RANGE = wx.PyEventBinder( wxEVT_COMMAND_TOOL_RCLICKED, 2)
338 EVT_TOOL_ENTER = wx.PyEventBinder( wxEVT_COMMAND_TOOL_ENTER, 1)
339 EVT_CHECKLISTBOX = wx.PyEventBinder( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, 1)
342 EVT_COMMAND_LEFT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_CLICK, 1)
343 EVT_COMMAND_LEFT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_LEFT_DCLICK, 1)
344 EVT_COMMAND_RIGHT_CLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_CLICK, 1)
345 EVT_COMMAND_RIGHT_DCLICK = wx.PyEventBinder( wxEVT_COMMAND_RIGHT_DCLICK, 1)
346 EVT_COMMAND_SET_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_SET_FOCUS, 1)
347 EVT_COMMAND_KILL_FOCUS = wx.PyEventBinder( wxEVT_COMMAND_KILL_FOCUS, 1)
348 EVT_COMMAND_ENTER = wx.PyEventBinder( wxEVT_COMMAND_ENTER, 1)
350 EVT_IDLE = wx.PyEventBinder( wxEVT_IDLE )
352 EVT_UPDATE_UI = wx.PyEventBinder( wxEVT_UPDATE_UI, 1)
353 EVT_UPDATE_UI_RANGE = wx.PyEventBinder( wxEVT_UPDATE_UI, 2)
355 EVT_CONTEXT_MENU = wx.PyEventBinder( wxEVT_CONTEXT_MENU )
360 //---------------------------------------------------------------------------
364 "An event is a structure holding information about an event passed to a
365 callback or member function. wx.Event is an abstract base class for
366 other event classes", "");
368 class wxEvent : public wxObject {
370 // wxEvent(int winid = 0, wxEventType commandType = wxEVT_NULL); // *** This class is now an ABC
374 void , SetEventType(wxEventType typ),
375 "Sets the specific type of the event.", "");
378 wxEventType , GetEventType() const,
379 "Returns the identifier of the given event type, such as
380 ``wxEVT_COMMAND_BUTTON_CLICKED``.", "");
383 wxObject *, GetEventObject() const,
384 "Returns the object (usually a window) associated with the event, if
388 void , SetEventObject(wxObject *obj),
389 "Sets the originating object, or in other words, obj is normally the
390 object that is sending the event.", "");
392 long GetTimestamp() const;
393 void SetTimestamp(long ts = 0);
397 "Returns the identifier associated with this event, such as a button
401 void , SetId(int Id),
402 "Set's the ID for the event. This is usually the ID of the window that
403 is sending the event, but it can also be a command id from a menu
409 bool , IsCommandEvent() const,
410 "Returns true if the event is or is derived from `wx.CommandEvent` else
411 it returns false. Note: Exists only for optimization purposes.", "");
415 void , Skip(bool skip = true),
416 "Called by an event handler, it controls whether additional event
417 handlers bound to this event will be called after the current event
418 handler returns. Skip(false) (the default setting) will prevent
419 additional event handlers from being called and control will be
420 returned to the sender of the event immediately after the current
421 handler has finished. Skip(True) will cause the event processing
422 system to continue searching for a handler function for this event.
426 bool , GetSkipped() const,
427 "Returns true if the event handler should be skipped, false otherwise.
432 bool , ShouldPropagate() const,
433 "Test if this event should be propagated to the parent window or not,
434 i.e. if the propagation level is currently greater than 0.", "");
437 // Stop an event from propagating to its parent window, returns the old
438 // propagation level value
440 int , StopPropagation(),
441 "Stop the event from propagating to its parent window. Returns the old
442 propagation level value which may be later passed to
443 `ResumePropagation` to allow propagating the event again.", "");
447 void , ResumePropagation(int propagationLevel),
448 "Resume the event propagation by restoring the propagation level. (For
449 example, you can use the value returned by an earlier call to
454 // this function is used to create a copy of the event polymorphically and
455 // all derived classes must implement it because otherwise wxPostEvent()
456 // for them wouldn't work (it needs to do a copy of the event)
457 virtual wxEvent *Clone() /* =0*/;
461 //---------------------------------------------------------------------------
464 DocStr(wxPropagationDisabler,
465 "Helper class to temporarily change an event not to propagate. Simply
466 create an instance of this class and then whe it is destroyed the
467 propogation of the event will be restored.", "");
468 class wxPropagationDisabler
471 wxPropagationDisabler(wxEvent& event);
472 ~wxPropagationDisabler();
476 DocStr( wxPropagateOnce,
477 "A helper class that will temporarily lower propagation level of an
478 event. Simply create an instance of this class and then whe it is
479 destroyed the propogation of the event will be restored.", "");
480 class wxPropagateOnce
483 wxPropagateOnce(wxEvent& event);
487 //---------------------------------------------------------------------------
490 DocStr(wxCommandEvent,
491 "This event class contains information about command events, which
492 originate from a variety of simple controls, as well as menus and
495 class wxCommandEvent : public wxEvent
498 wxCommandEvent(wxEventType commandType = wxEVT_NULL, int winid = 0);
501 // // Set/Get client data from controls
502 // void SetClientData(void* clientData) { m_clientData = clientData; }
503 // void *GetClientData() const { return m_clientData; }
505 // // Set/Get client object from controls
506 // void SetClientObject(wxClientData* clientObject) { m_clientObject = clientObject; }
507 // void *GetClientObject() const { return m_clientObject; }
511 int , GetSelection() const,
512 "Returns item index for a listbox or choice selection event (not valid
513 for a deselection).", "");
516 void SetString(const wxString& s);
518 wxString , GetString() const,
519 "Returns item string for a listbox or choice selection event (not valid
520 for a deselection).", "");
524 bool , IsChecked() const,
525 "This method can be used with checkbox and menu events: for the
526 checkboxes, the method returns true for a selection event and false
527 for a deselection one. For the menu events, this method indicates if
528 the menu item just has become checked or unchecked (and thus only
529 makes sense for checkable menu items).", "");
531 %pythoncode { Checked = IsChecked }
534 bool , IsSelection() const,
535 "For a listbox or similar event, returns true if it is a selection,
536 false if it is a deselection.", "");
539 void SetExtraLong(long extraLong);
541 long , GetExtraLong() const,
542 "Returns extra information dependant on the event objects type. If the event
543 comes from a listbox selection, it is a boolean determining whether the event
544 was a selection (true) or a deselection (false). A listbox deselection only
545 occurs for multiple-selection boxes, and in this case the index and string
546 values are indeterminate and the listbox must be examined by the application.", "");
551 long , GetInt() const,
552 "Returns the integer identifier corresponding to a listbox, choice or radiobox
553 selection (only if the event was a selection, not a deselection), or a boolean
554 value representing the value of a checkbox.", "");
557 virtual wxEvent *Clone() const;
561 //---------------------------------------------------------------------------
564 DocStr(wxNotifyEvent,
565 "An instance of this class (or one of its derived classes) is sent from
566 a control when the control's state is being changed and the control
567 allows that change to be prevented from happening. The event handler
568 can call `Veto` or `Allow` to tell the control what to do.", "");
570 class wxNotifyEvent : public wxCommandEvent
573 wxNotifyEvent(wxEventType commandType = wxEVT_NULL, int winid = 0);
577 "Prevents the change announced by this event from happening.
579 It is in general a good idea to notify the user about the reasons for
580 vetoing the change because otherwise the applications behaviour (which
581 just refuses to do what the user wants) might be quite surprising.", "");
586 "This is the opposite of `Veto`: it explicitly allows the event to be
587 processed. For most events it is not necessary to call this method as
588 the events are allowed anyhow but some are forbidden by default (this
589 will be mentioned in the corresponding event description).", "");
594 "Returns true if the change is allowed (`Veto` hasn't been called) or
595 false otherwise (if it was).", "");
600 //---------------------------------------------------------------------------
603 DocStr(wxScrollEvent,
604 "A scroll event holds information about events sent from stand-alone
605 scrollbars and sliders. Note that scrolled windows do not send
606 instnaces of this event class, but send the `wx.ScrollWinEvent`
611 ======================= ==========================================
612 EVT_SCROLL Used to bind all scroll events
613 EVT_SCROLL_TOP scroll-to-top events (minimum position)
614 EVT_SCROLL_BOTTOM scroll-to-bottom events (maximum position)
615 EVT_SCROLL_LINEUP line up events
616 EVT_SCROLL_LINEDOWN line down events
617 EVT_SCROLL_PAGEUP page up events
618 EVT_SCROLL_PAGEDOWN page down events
619 EVT_SCROLL_THUMBTRACK thumbtrack events (frequent events sent
620 as the user drags the 'thumb')
621 EVT_SCROLL_THUMBRELEASE thumb release events.
622 EVT_SCROLL_ENDSCROLL End of scrolling
623 ======================= ==========================================
627 The EVT_SCROLL_THUMBRELEASE event is only emitted when actually
628 dragging the thumb using the mouse and releasing it (This
629 EVT_SCROLL_THUMBRELEASE event is also followed by an
630 EVT_SCROLL_ENDSCROLL event).
632 The EVT_SCROLL_ENDSCROLL event also occurs when using the keyboard
633 to change the thumb position, and when clicking next to the thumb
634 (In all these cases the EVT_SCROLL_THUMBRELEASE event does not
637 In short, the EVT_SCROLL_ENDSCROLL event is triggered when
638 scrolling/ moving has finished. The only exception (unfortunately)
639 is that changing the thumb position using the mousewheel does give
640 a EVT_SCROLL_THUMBRELEASE event but NOT an EVT_SCROLL_ENDSCROLL
644 class wxScrollEvent : public wxCommandEvent
648 wxScrollEvent(wxEventType commandType = wxEVT_NULL,
649 int winid = 0, int pos = 0, int orient = 0),
653 int , GetOrientation() const,
654 "Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
655 the scrollbar.", "");
658 int , GetPosition() const,
659 "Returns the position of the scrollbar.", "");
661 void SetOrientation(int orient);
662 void SetPosition(int pos);
666 //---------------------------------------------------------------------------
669 DocStr(wxScrollWinEvent,
670 "A wx.ScrollWinEvent holds information about scrolling and is sent from
671 scrolling windows.", "
675 ========================== ==========================================
676 EVT_SCROLLWIN Used to bind all scrolled window scroll events
677 EVT_SCROLLWIN_TOP scroll-to-top events (minimum position)
678 EVT_SCROLLWIN_BOTTOM scroll-to-bottom events (maximum position)
679 EVT_SCROLLWIN_LINEUP line up events
680 EVT_SCROLLWIN_LINEDOWN line down events
681 EVT_SCROLLWIN_PAGEUP page up events
682 EVT_SCROLLWIN_PAGEDOWN page down events
683 EVT_SCROLLWIN_THUMBTRACK thumbtrack events (frequent events sent
684 as the user drags the 'thumb')
685 EVT_SCROLLWIN_THUMBRELEASE thumb release events.
686 EVT_SCROLLWIN_ENDSCROLL End of scrolling
687 ========================== ==========================================
691 class wxScrollWinEvent : public wxEvent
694 wxScrollWinEvent(wxEventType commandType = wxEVT_NULL,
695 int pos = 0, int orient = 0);
698 int , GetOrientation() const,
699 "Returns wx.HORIZONTAL or wx.VERTICAL, depending on the orientation of
700 the scrollbar.", "");
703 int , GetPosition() const,
704 "Returns the position of the scrollbar for the thumb track and release
705 events. Note that this field can't be used for the other events, you
706 need to query the window itself for the current position in that case.", "");
708 void SetOrientation(int orient);
709 void SetPosition(int pos);
712 //---------------------------------------------------------------------------
717 "This event class contains information about the events generated by
718 the mouse: they include mouse buttons press and release events and
721 All mouse events involving the buttons use ``wx.MOUSE_BTN_LEFT`` for
722 the left mouse button, ``wx.MOUSE_BTN_MIDDLE`` for the middle one and
723 ``wx.MOUSE_BTN_RIGHT`` for the right one. Note that not all mice have
724 a middle button so a portable application should avoid relying on the
727 Note the difference between methods like `LeftDown` and `LeftIsDown`:
728 the former returns true when the event corresponds to the left mouse
729 button click while the latter returns true if the left mouse button is
730 currently being pressed. For example, when the user is dragging the
731 mouse you can use `LeftIsDown` to test whether the left mouse button
732 is (still) depressed. Also, by convention, if `LeftDown` returns true,
733 `LeftIsDown` will also return true in wxWidgets whatever the
734 underlying GUI behaviour is (which is platform-dependent). The same
735 applies, of course, to other mouse buttons as well.", "
739 ================== ==============================================
740 EVT_LEFT_DOWN Left mouse button down event. The handler
741 of this event should normally call
742 event.Skip() to allow the default processing
743 to take place as otherwise the window under
744 mouse wouldn't get the focus.
745 EVT_LEFT_UP Left mouse button up event
746 EVT_LEFT_DCLICK Left mouse button double click event
747 EVT_MIDDLE_DOWN Middle mouse button down event
748 EVT_MIDDLE_UP Middle mouse button up event
749 EVT_MIDDLE_DCLICK Middle mouse button double click event
750 EVT_RIGHT_DOWN Right mouse button down event
751 EVT_RIGHT_UP Right mouse button up event
752 EVT_RIGHT_DCLICK Right mouse button double click event
753 EVT_MOTION Event sent when the mouse is moving
754 EVT_ENTER_WINDOW Event sent when the mouse enters the
755 boundaries of a window.
756 EVT_LEAVE_WINDOW Sent when the mouse leaves the window's bounds
757 EVT_MOUSEWHEEL Mouse scroll wheel event
758 EVT_MOUSE_EVENTS Binds all mouse events at once.
759 ================== ==============================================
764 // the symbolic names for the mouse buttons
767 wxMOUSE_BTN_ANY = -1,
768 wxMOUSE_BTN_NONE = -1,
769 wxMOUSE_BTN_LEFT = 0,
770 wxMOUSE_BTN_MIDDLE = 1,
771 wxMOUSE_BTN_RIGHT = 2
776 class wxMouseEvent : public wxEvent
780 wxMouseEvent(wxEventType mouseType = wxEVT_NULL),
781 "Constructs a wx.MouseEvent. Valid event types are:
790 * wxEVT_MIDDLE_DCLICK
795 * wxEVT_MOUSEWHEEL ", "");
799 bool , IsButton() const,
800 "Returns true if the event was a mouse button event (not necessarily a
801 button down event - that may be tested using `ButtonDown`).", "");
805 bool , ButtonDown(int but = wxMOUSE_BTN_ANY) const,
806 "If the argument is omitted, this returns true if the event was any mouse
807 button down event. Otherwise the argument specifies which button-down
808 event shold be checked for (see `Button` for the possible values).", "");
812 bool , ButtonDClick(int but = wxMOUSE_BTN_ANY) const,
813 "If the argument is omitted, this returns true if the event was any
814 mouse double click event. Otherwise the argument specifies which
815 double click event to check for (see `Button` for the possible
820 bool , ButtonUp(int but = wxMOUSE_BTN_ANY) const,
821 "If the argument is omitted, this returns true if the event was any
822 mouse button up event. Otherwise the argument specifies which
823 button up event to check for (see `Button` for the possible values).", "");
827 bool , Button(int button) const,
828 "Returns true if the identified mouse button is changing state. Valid
829 values of button are:
831 ==================== =====================================
832 wx.MOUSE_BTN_LEFT check if left button was pressed
833 wx.MOUSE_BTN_MIDDLE check if middle button was pressed
834 wx.MOUSE_BTN_RIGHT check if right button was pressed
835 wx.MOUSE_BTN_ANY check if any button was pressed
836 ==================== =====================================
840 // Was the given button in Down state?
841 bool ButtonIsDown(int but) const;
844 int , GetButton() const,
845 "Returns the mouse button which generated this event or
846 wx.MOUSE_BTN_NONE if no button is involved (for mouse move, enter or
847 leave event, for example). Otherwise wx.MOUSE_BTN_LEFT is returned for
848 the left button down, up and double click events, wx.MOUSE_BTN_MIDDLE
849 and wx.MOUSE_BTN_RIGHT for the same events for the middle and the
850 right buttons respectively.", "");
854 bool , ControlDown() const,
855 "Returns true if the control key was down at the time of the event.", "");
858 bool , MetaDown() const,
859 "Returns true if the Meta key was down at the time of the event.", "");
863 bool , AltDown() const,
864 "Returns true if the Alt key was down at the time of the event.", "");
867 bool , ShiftDown() const,
868 "Returns true if the Shift key was down at the time of the event.", "");
872 bool , CmdDown() const,
873 "\"Cmd\" is a pseudo key which is the same as Control for PC and Unix
874 platforms but the special \"Apple\" (a.k.a as \"Command\") key on
875 Macs: it often makes sense to use it instead of, say, `ControlDown`
876 because Cmd key is used for the same thing under Mac as Ctrl
877 elsewhere. The Ctrl key still exists, it's just not used for this
878 purpose. So for non-Mac platforms this is the same as `ControlDown`
879 and Macs this is the same as `MetaDown`.", "");
883 bool , LeftDown() const,
884 "Returns true if the left mouse button state changed to down.", "");
887 bool , MiddleDown() const,
888 "Returns true if the middle mouse button state changed to down.", "");
891 bool , RightDown() const,
892 "Returns true if the right mouse button state changed to down.", "");
897 bool , LeftUp() const,
898 "Returns true if the left mouse button state changed to up.", "");
901 bool , MiddleUp() const,
902 "Returns true if the middle mouse button state changed to up.", "");
905 bool , RightUp() const,
906 "Returns true if the right mouse button state changed to up.", "");
912 bool , LeftDClick() const,
913 "Returns true if the event was a left button double click.", "");
916 bool , MiddleDClick() const,
917 "Returns true if the event was a middle button double click.", "");
920 bool , RightDClick() const,
921 "Returns true if the event was a right button double click.", "");
927 "Returns true if the left mouse button is currently down, independent
928 of the current event type.
930 Please notice that it is not the same as LeftDown which returns true
931 if the left mouse button was just pressed. Rather, it describes the
932 state of the mouse button before the event happened.
934 This event is usually used in the mouse event handlers which process
935 \"move mouse\" messages to determine whether the user is (still)
936 dragging the mouse.", "");
939 bool , MiddleIsDown(),
940 "Returns true if the middle mouse button is currently down, independent
941 of the current event type.", "");
944 bool , RightIsDown(),
945 "Returns true if the right mouse button is currently down, independent
946 of the current event type.", "");
951 bool , Dragging() const,
952 "Returns true if this was a dragging event (motion while a button is
957 bool , Moving() const,
958 "Returns true if this was a motion event and no mouse buttons were
959 pressed. If any mouse button is held pressed, then this method returns
960 false and Dragging returns true.", "");
964 bool , Entering() const,
965 "Returns true if the mouse was entering the window.", "");
969 bool , Leaving() const,
970 "Returns true if the mouse was leaving the window.", "");
974 DocStr(GetPosition, // sets the docstring for both
975 "Returns the pixel position of the mouse in window coordinates when the
976 event happened.", "");
977 wxPoint GetPosition();
980 void, GetPosition(long *OUTPUT, long *OUTPUT),
981 "GetPositionTuple() -> (x,y)",
985 wxPoint , GetLogicalPosition(const wxDC& dc) const,
986 "Returns the logical mouse position in pixels (i.e. translated
987 according to the translation set for the DC, which usually indicates
988 that the window has been scrolled).", "");
992 wxCoord , GetX() const,
993 "Returns X coordinate of the physical mouse event position.", "");
996 wxCoord , GetY() const,
997 "Returns Y coordinate of the physical mouse event position.", "");
1001 int , GetWheelRotation() const,
1002 "Get wheel rotation, positive or negative indicates direction of
1003 rotation. Current devices all send an event when rotation is equal to
1004 +/-WheelDelta, but this allows for finer resolution devices to be
1005 created in the future. Because of this you shouldn't assume that one
1006 event is equal to 1 line or whatever, but you should be able to either
1007 do partial line scrolling or wait until +/-WheelDelta rotation values
1008 have been accumulated before scrolling.", "");
1012 int , GetWheelDelta() const,
1013 "Get wheel delta, normally 120. This is the threshold for action to be
1014 taken, and one such action (for example, scrolling one increment)
1015 should occur for each delta.", "");
1019 int , GetLinesPerAction() const,
1020 "Returns the configured number of lines (or whatever) to be scrolled
1021 per wheel action. Defaults to three.", "");
1025 bool , IsPageScroll() const,
1026 "Returns true if the system has been setup to do page scrolling with
1027 the mouse wheel instead of line scrolling.", "");
1042 int m_wheelRotation;
1044 int m_linesPerAction;
1047 //---------------------------------------------------------------------------
1051 class wxSetCursorEvent : public wxEvent
1054 wxSetCursorEvent(wxCoord x = 0, wxCoord y = 0);
1056 wxCoord GetX() const;
1057 wxCoord GetY() const;
1059 void SetCursor(const wxCursor& cursor);
1060 const wxCursor& GetCursor() const;
1061 bool HasCursor() const;
1064 //---------------------------------------------------------------------------
1067 // Keyboard input event class
1069 class wxKeyEvent : public wxEvent
1072 wxKeyEvent(wxEventType keyType = wxEVT_NULL);
1074 // Find state of shift/control keys
1075 bool ControlDown() const;
1076 bool MetaDown() const;
1077 bool AltDown() const;
1078 bool ShiftDown() const;
1081 bool , CmdDown() const,
1082 "\"Cmd\" is a pseudo key which is the same as Control for PC and Unix
1083 platforms but the special \"Apple\" (a.k.a as \"Command\") key on
1084 Macs: it makes often sense to use it instead of, say, `ControlDown`
1085 because Cmd key is used for the same thing under Mac as Ctrl
1086 elsewhere. The Ctrl still exists, it's just not used for this
1087 purpose. So for non-Mac platforms this is the same as `ControlDown`
1088 and Macs this is the same as `MetaDown`.", "");
1092 // exclude MetaDown() from HasModifiers() because NumLock under X is often
1093 // configured as mod2 modifier, yet the key events even when it is pressed
1094 // should be processed normally, not like Ctrl- or Alt-key
1095 bool HasModifiers() const;
1097 // get the key code: an ASCII7 char or an element of wxKeyCode enum
1098 int GetKeyCode() const;
1099 %pythoncode { KeyCode = GetKeyCode }
1102 int GetUnicodeKey() {
1104 return self->GetUnicodeKey();
1110 %pythoncode { GetUniChar = GetUnicodeKey }
1113 // get the raw key code (platform-dependent)
1114 wxUint32 GetRawKeyCode() const;
1116 // get the raw key flags (platform-dependent)
1117 wxUint32 GetRawKeyFlags() const;
1120 DocStr(GetPosition, // sets the docstring for both
1121 "Find the position of the event.", "");
1122 wxPoint GetPosition();
1125 void, GetPosition(long *OUTPUT, long *OUTPUT),
1126 "GetPositionTuple() -> (x,y)",
1130 wxCoord GetX() const;
1133 wxCoord GetY() const;
1146 // these fields contain the platform-specific information about
1147 // key that was pressed
1149 wxUint32 m_rawFlags;
1152 //---------------------------------------------------------------------------
1156 class wxSizeEvent : public wxEvent
1159 wxSizeEvent(const wxSize& sz=wxDefaultSize, int winid = 0);
1161 wxSize GetSize() const;
1162 wxRect GetRect() const;
1163 void SetRect(wxRect rect);
1165 void SetSize(wxSize size) {
1166 self->m_size = size;
1172 wxRect m_rect; // Used for wxEVT_SIZING
1176 //---------------------------------------------------------------------------
1180 class wxMoveEvent : public wxEvent
1183 wxMoveEvent(const wxPoint& pos=wxDefaultPosition, int winid = 0);
1185 wxPoint GetPosition() const;
1186 wxRect GetRect() const;
1187 void SetRect(const wxRect& rect);
1188 void SetPosition(const wxPoint& pos);
1191 m_pos = property(GetPosition, SetPosition)
1192 m_rect = property(GetRect, SetRect)
1196 //---------------------------------------------------------------------------
1199 // Paint event class
1200 class wxPaintEvent : public wxEvent
1203 wxPaintEvent(int Id = 0);
1207 class wxNcPaintEvent : public wxEvent
1210 wxNcPaintEvent(int winid = 0);
1213 //---------------------------------------------------------------------------
1216 class wxEraseEvent : public wxEvent
1219 wxEraseEvent(int Id = 0, wxDC *dc = (wxDC *) NULL);
1221 wxDC *GetDC() const;
1225 //---------------------------------------------------------------------------
1228 class wxFocusEvent : public wxEvent
1231 wxFocusEvent(wxEventType type = wxEVT_NULL, int winid = 0);
1233 // The window associated with this event is the window which had focus
1234 // before for SET event and the window which will have focus for the KILL
1235 // one. NB: it may be NULL in both cases!
1236 wxWindow *GetWindow() const;
1237 void SetWindow(wxWindow *win);
1240 //---------------------------------------------------------------------------
1243 // wxChildFocusEvent notifies the parent that a child has got the focus: unlike
1244 // wxFocusEvent it is propagated upwards the window chain
1245 class wxChildFocusEvent : public wxCommandEvent
1248 wxChildFocusEvent(wxWindow *win = NULL);
1250 wxWindow *GetWindow() const;
1253 //---------------------------------------------------------------------------
1256 class wxActivateEvent : public wxEvent
1259 wxActivateEvent(wxEventType type = wxEVT_NULL, bool active = true, int Id = 0);
1260 bool GetActive() const;
1264 //---------------------------------------------------------------------------
1267 class wxInitDialogEvent : public wxEvent
1270 wxInitDialogEvent(int Id = 0);
1274 //---------------------------------------------------------------------------
1277 class wxMenuEvent : public wxEvent
1280 wxMenuEvent(wxEventType type = wxEVT_NULL, int winid = 0, wxMenu* menu = NULL);
1282 // only for wxEVT_MENU_HIGHLIGHT
1283 int GetMenuId() const;
1285 // only for wxEVT_MENU_OPEN/CLOSE
1286 bool IsPopup() const;
1288 // only for wxEVT_MENU_OPEN/CLOSE
1289 wxMenu* GetMenu() const;
1292 //---------------------------------------------------------------------------
1295 // Window close or session close event class
1296 class wxCloseEvent : public wxEvent
1299 wxCloseEvent(wxEventType type = wxEVT_NULL, int winid = 0);
1301 void SetLoggingOff(bool logOff);
1302 bool GetLoggingOff() const;
1304 void Veto(bool veto = true);
1305 void SetCanVeto(bool canVeto);
1307 bool CanVeto() const;
1308 bool GetVeto() const;
1312 //---------------------------------------------------------------------------
1315 class wxShowEvent : public wxEvent
1318 wxShowEvent(int winid = 0, bool show = false);
1320 void SetShow(bool show);
1321 bool GetShow() const;
1326 //---------------------------------------------------------------------------
1329 class wxIconizeEvent: public wxEvent
1332 wxIconizeEvent(int id = 0, bool iconized = true);
1337 //---------------------------------------------------------------------------
1340 class wxMaximizeEvent: public wxEvent
1343 wxMaximizeEvent(int id = 0);
1346 //---------------------------------------------------------------------------
1349 class wxDropFilesEvent: public wxEvent
1352 wxPoint GetPosition();
1353 int GetNumberOfFiles();
1356 PyObject* GetFiles() {
1357 int count = self->GetNumberOfFiles();
1358 wxString* files = self->GetFiles();
1359 PyObject* list = PyList_New(count);
1362 PyErr_SetString(PyExc_MemoryError, "Can't allocate list of files!");
1366 for (int i=0; i<count; i++) {
1367 PyList_SetItem(list, i, wx2PyString(files[i]));
1376 //---------------------------------------------------------------------------
1380 // Whether to always send update events to windows, or
1381 // to only send update events to those with the
1382 // wxWS_EX_PROCESS_UI_UPDATES style.
1386 // Send UI update events to all windows
1387 wxUPDATE_UI_PROCESS_ALL,
1389 // Send UI update events to windows that have
1390 // the wxWS_EX_PROCESS_UI_UPDATES flag specified
1391 wxUPDATE_UI_PROCESS_SPECIFIED
1396 class wxUpdateUIEvent : public wxCommandEvent
1399 wxUpdateUIEvent(wxWindowID commandId = 0);
1401 bool GetChecked() const;
1402 bool GetEnabled() const;
1403 wxString GetText() const;
1404 bool GetSetText() const;
1405 bool GetSetChecked() const;
1406 bool GetSetEnabled() const;
1408 void Check(bool check);
1409 void Enable(bool enable);
1410 void SetText(const wxString& text);
1412 // Sets the interval between updates in milliseconds.
1413 // Set to -1 to disable updates, or to 0 to update as frequently as possible.
1414 static void SetUpdateInterval(long updateInterval);
1416 // Returns the current interval between updates in milliseconds
1417 static long GetUpdateInterval();
1419 // Can we update this window?
1420 static bool CanUpdate(wxWindow *win);
1422 // Reset the update time to provide a delay until the next
1423 // time we should update
1424 static void ResetUpdateTime();
1426 // Specify how wxWindows will send update events: to
1427 // all windows, or only to those which specify that they
1428 // will process the events.
1429 static void SetMode(wxUpdateUIMode mode);
1431 // Returns the UI update mode
1432 static wxUpdateUIMode GetMode();
1435 //---------------------------------------------------------------------------
1438 class wxSysColourChangedEvent: public wxEvent {
1440 wxSysColourChangedEvent();
1443 //---------------------------------------------------------------------------
1447 // wxEVT_MOUSE_CAPTURE_CHANGED
1448 // The window losing the capture receives this message
1449 // (even if it released the capture itself).
1450 class wxMouseCaptureChangedEvent : public wxEvent
1453 wxMouseCaptureChangedEvent(wxWindowID winid = 0, wxWindow* gainedCapture = NULL);
1455 wxWindow* GetCapturedWindow() const;
1458 //---------------------------------------------------------------------------
1461 class wxDisplayChangedEvent : public wxEvent
1464 wxDisplayChangedEvent();
1467 //---------------------------------------------------------------------------
1470 class wxPaletteChangedEvent : public wxEvent
1473 wxPaletteChangedEvent(wxWindowID id = 0);
1475 void SetChangedWindow(wxWindow* win);
1476 wxWindow* GetChangedWindow();
1480 //---------------------------------------------------------------------------
1484 // wxEVT_QUERY_NEW_PALETTE
1485 // Indicates the window is getting keyboard focus and should re-do its palette.
1486 class wxQueryNewPaletteEvent : public wxEvent
1489 wxQueryNewPaletteEvent(wxWindowID winid = 0);
1491 // App sets this if it changes the palette.
1492 void SetPaletteRealized(bool realized);
1493 bool GetPaletteRealized() const;
1496 //---------------------------------------------------------------------------
1500 // Event generated by dialog navigation keys
1501 // wxEVT_NAVIGATION_KEY
1503 class wxNavigationKeyEvent : public wxEvent
1506 wxNavigationKeyEvent();
1508 // direction: forward (True) or backward (False)
1509 bool GetDirection() const;
1510 void SetDirection(bool forward);
1512 // it may be a window change event (MDI, notebook pages...) or a control
1514 bool IsWindowChange() const;
1515 void SetWindowChange(bool ischange);
1517 // Set to true under MSW if the event was generated using the tab key.
1518 // This is required for proper navogation over radio buttons
1519 bool IsFromTab() const;
1520 void SetFromTab(bool bIs);
1522 void SetFlags(long flags);
1524 // the child which has the focus currently (may be NULL - use
1525 // wxWindow::FindFocus then)
1526 wxWindow* GetCurrentFocus() const;
1527 void SetCurrentFocus(wxWindow *win);
1538 //---------------------------------------------------------------------------
1541 // Window creation/destruction events: the first is sent as soon as window is
1542 // created (i.e. the underlying GUI object exists), but when the C++ object is
1543 // fully initialized (so virtual functions may be called). The second,
1544 // wxEVT_DESTROY, is sent right before the window is destroyed - again, it's
1545 // still safe to call virtual functions at this moment
1547 class wxWindowCreateEvent : public wxCommandEvent
1550 wxWindowCreateEvent(wxWindow *win = NULL);
1551 wxWindow *GetWindow() const;
1554 class wxWindowDestroyEvent : public wxCommandEvent
1557 wxWindowDestroyEvent(wxWindow *win = NULL);
1558 wxWindow *GetWindow() const;
1562 //---------------------------------------------------------------------------
1565 // A Context event is sent when the user right clicks on a window or
1566 // presses Shift-F10
1567 // NOTE : Under windows this is a repackaged WM_CONTETXMENU message
1568 // Under other systems it may have to be generated from a right click event
1573 class wxContextMenuEvent : public wxCommandEvent
1576 wxContextMenuEvent(wxEventType type = wxEVT_NULL,
1577 wxWindowID winid = 0,
1578 const wxPoint& pt = wxDefaultPosition);
1580 // Position of event (in screen coordinates)
1581 const wxPoint& GetPosition() const;
1582 void SetPosition(const wxPoint& pos);
1585 //---------------------------------------------------------------------------
1588 // Whether to always send idle events to windows, or
1589 // to only send update events to those with the
1590 // wxWS_EX_PROCESS_IDLE style.
1594 // Send idle events to all windows
1597 // Send idle events to windows that have
1598 // the wxWS_EX_PROCESS_IDLE flag specified
1599 wxIDLE_PROCESS_SPECIFIED
1603 class wxIdleEvent : public wxEvent
1608 void RequestMore(bool needMore = true);
1609 bool MoreRequested() const;
1611 // Specify how wxWindows will send idle events: to
1612 // all windows, or only to those which specify that they
1613 // will process the events.
1614 static void SetMode(wxIdleMode mode);
1616 // Returns the idle event mode
1617 static wxIdleMode GetMode();
1619 // Can we send an idle event?
1620 static bool CanSend(wxWindow* win);
1623 //---------------------------------------------------------------------------
1626 // These classes can be derived from in Python and passed through the event
1627 // system without loosing anything. They do this by keeping a reference to
1628 // themselves and some special case handling in wxPyCallback::EventThunker.
1630 class wxPyEvent : public wxEvent {
1632 %pythonAppend wxPyEvent "self.SetSelf(self)"
1633 wxPyEvent(int winid=0, wxEventType commandType = wxEVT_NULL );
1637 void SetSelf(PyObject* self);
1638 PyObject* GetSelf();
1642 class wxPyCommandEvent : public wxCommandEvent {
1644 %pythonAppend wxPyCommandEvent "self.SetSelf(self)"
1645 wxPyCommandEvent(wxEventType commandType = wxEVT_NULL, int id=0);
1646 ~wxPyCommandEvent();
1648 void SetSelf(PyObject* self);
1649 PyObject* GetSelf();
1654 //---------------------------------------------------------------------------
1657 class wxDateEvent : public wxCommandEvent
1660 wxDateEvent(wxWindow *win, const wxDateTime& dt, wxEventType type);
1662 const wxDateTime& GetDate() const;
1663 void SetDate(const wxDateTime &date);
1668 %constant wxEventType wxEVT_DATE_CHANGED;
1671 EVT_DATE_CHANGED = wx.PyEventBinder( wxEVT_DATE_CHANGED, 1 )
1675 //---------------------------------------------------------------------------