/**
Returns a copy of the event.
- Any event that is posted to the wxWidgets event system for later action (via
- wxEvtHandler::AddPendingEvent or wxPostEvent()) must implement this method.
+ Any event that is posted to the wxWidgets event system for later action
+ (via wxEvtHandler::AddPendingEvent or wxPostEvent()) must implement
+ this method.
All wxWidgets events fully implement this method, but any derived events
implemented by the user should also implement this method just in case they
virtual ~wxEvtHandler();
/**
- This function posts an event to be processed later.
+ Queue event for a later processing.
+
+ This method is similar to ProcessEvent() but while the latter is
+ synchronous, i.e. the event is processed immediately, before the
+ function returns, this one is asynchronous and returns immediately
+ while the event will be processed at some later time (usually during
+ the next event loop iteration).
+
+ Another important difference is that this method takes ownership of the
+ @a event parameter, i.e. it will delete it itself. This implies that
+ the event should be allocated on the heap and that the pointer can't be
+ used any more after the function returns (as it can be deleted at any
+ moment).
+
+ QueueEvent() can be used for inter-thread communication from the worker
+ threads to the main thread, it is safe in the sense that it uses
+ locking internally and avoids the problem mentioned in AddPendingEvent()
+ documentation by ensuring that the @a event object is not used by the
+ calling thread any more. Care should still be taken to avoid that some
+ fields of this object are used by it, notably any wxString members of
+ the event object must not be shallow copies of another wxString object
+ as this would result in them still using the same string buffer behind
+ the scenes. For example
+ @code
+ void FunctionInAWorkerThread(const wxString& str)
+ {
+ wxCommandEvent* evt = new wxCommandEvent;
+
+ // NOT evt->SetString(str) as this would be a shallow copy
+ evt->SetString(str.c_str()); // make a deep copy
+
+ wxTheApp->QueueEvent( evt );
+ }
+ @endcode
- The difference between sending an event (using the ProcessEvent
- method) and posting it is that in the first case the event is
- processed before the function returns, while in the second case,
- the function returns immediately and the event will be processed
- sometime later (usually during the next event loop iteration).
+ Finally notice that this method automatically wakes up the event loop
+ if it is currently idle by calling ::wxWakeUpIdle() so there is no need
+ to do it manually when using it.
- A copy of event is made by the function, so the original can be deleted as
- soon as function returns (it is common that the original is created on the
- stack). This requires that the wxEvent::Clone method be implemented by event
- so that it can be duplicated and stored until it gets processed.
+ @since 2.9.0
+
+ @param event
+ A heap-allocated event to be queued, QueueEvent() takes ownership
+ of it. This parameter shouldn't be @c NULL.
+ */
+ virtual void QueueEvent(wxEvent *event);
+
+ /**
+ Post an event to be processed later.
- This is also the method to call for inter-thread communication - it will post
- events safely between different threads which means that this method is
- thread-safe by using critical sections where needed. In a multi-threaded program,
- you often need to inform the main GUI thread about the status of other working
- threads and such notification should be done using this method.
+ This function is similar to QueueEvent() but can't be used to post
+ events from worker threads for the event objects with wxString fields
+ (i.e. in practice most of them) because of an unsafe use of the same
+ wxString object which happens because the wxString field in the
+ original @a event object and its copy made internally by this function
+ share the same string buffer internally. Use QueueEvent() to avoid
+ this.
- This method automatically wakes up idle handling if the underlying window
- system is currently idle and thus would not send any idle events.
- (Waking up idle handling is done calling ::wxWakeUpIdle.)
+ A copy of event is made by the function, so the original can be deleted
+ as soon as function returns (it is common that the original is created
+ on the stack). This requires that the wxEvent::Clone() method be
+ implemented by event so that it can be duplicated and stored until it
+ gets processed.
@param event
- Event to add to process queue.
+ Event to add to the pending events queue.
*/
virtual void AddPendingEvent(const wxEvent& event);
@param event
Event to process.
- @returns @true if a suitable event handler function was found and
+ @return @true if a suitable event handler function was found and
executed, and the function did not call wxEvent::Skip.
@see SearchEventTable()
@param event
Event to process.
- @returns @true if the event was processed, @false if no handler was found
+ @return @true if the event was processed, @false if no handler was found
or an exception was thrown.
@see wxWindow::HandleWindowEvent
@param event
Event to be matched against an event table entry.
- @returns @true if a suitable event handler function was found and
+ @return @true if a suitable event handler function was found and
executed, and the function did not call wxEvent::Skip.
@remarks This function looks through the object's event table and tries
@beginEventTable{wxKeyEvent}
- @event{EVT_KEY_DOWN(func)}:
+ @event{EVT_KEY_DOWN(func)}
Process a wxEVT_KEY_DOWN event (any key has been pressed).
- @event{EVT_KEY_UP(func)}:
+ @event{EVT_KEY_UP(func)}
Process a wxEVT_KEY_UP event (any key has been released).
- @event{EVT_CHAR(func)}:
+ @event{EVT_CHAR(func)}
Process a wxEVT_CHAR event.
@endEventTable
events received by windows.
@beginEventTable{wxJoystickEvent}
- @style{EVT_JOY_BUTTON_DOWN(func)}:
+ @style{EVT_JOY_BUTTON_DOWN(func)}
Process a wxEVT_JOY_BUTTON_DOWN event.
- @style{EVT_JOY_BUTTON_UP(func)}:
+ @style{EVT_JOY_BUTTON_UP(func)}
Process a wxEVT_JOY_BUTTON_UP event.
- @style{EVT_JOY_MOVE(func)}:
+ @style{EVT_JOY_MOVE(func)}
Process a wxEVT_JOY_MOVE event.
- @style{EVT_JOY_ZMOVE(func)}:
+ @style{EVT_JOY_ZMOVE(func)}
Process a wxEVT_JOY_ZMOVE event.
- @style{EVT_JOYSTICK_EVENTS(func)}:
+ @style{EVT_JOYSTICK_EVENTS(func)}
Processes all joystick events.
@endEventTable
@beginEventTable{wxScrollWinEvent}
You can use the EVT_SCROLLWIN* macros for intercepting scroll window events
from the receiving window.
- @event{EVT_SCROLLWIN(func)}:
+ @event{EVT_SCROLLWIN(func)}
Process all scroll events.
- @event{EVT_SCROLLWIN_TOP(func)}:
+ @event{EVT_SCROLLWIN_TOP(func)}
Process wxEVT_SCROLLWIN_TOP scroll-to-top events.
- @event{EVT_SCROLLWIN_BOTTOM(func)}:
+ @event{EVT_SCROLLWIN_BOTTOM(func)}
Process wxEVT_SCROLLWIN_BOTTOM scroll-to-bottom events.
- @event{EVT_SCROLLWIN_LINEUP(func)}:
+ @event{EVT_SCROLLWIN_LINEUP(func)}
Process wxEVT_SCROLLWIN_LINEUP line up events.
- @event{EVT_SCROLLWIN_LINEDOWN(func)}:
+ @event{EVT_SCROLLWIN_LINEDOWN(func)}
Process wxEVT_SCROLLWIN_LINEDOWN line down events.
- @event{EVT_SCROLLWIN_PAGEUP(func)}:
+ @event{EVT_SCROLLWIN_PAGEUP(func)}
Process wxEVT_SCROLLWIN_PAGEUP page up events.
- @event{EVT_SCROLLWIN_PAGEDOWN(func)}:
+ @event{EVT_SCROLLWIN_PAGEDOWN(func)}
Process wxEVT_SCROLLWIN_PAGEDOWN page down events.
- @event{EVT_SCROLLWIN_THUMBTRACK(func)}:
+ @event{EVT_SCROLLWIN_THUMBTRACK(func)}
Process wxEVT_SCROLLWIN_THUMBTRACK thumbtrack events
(frequent events sent as the user drags the thumbtrack).
- @event{EVT_SCROLLWIN_THUMBRELEASE(func)}:
+ @event{EVT_SCROLLWIN_THUMBRELEASE(func)}
Process wxEVT_SCROLLWIN_THUMBRELEASE thumb release events.
@endEventTable
class handler, or to pass the event on to the window's children explicitly.
@beginEventTable{wxSysColourChangedEvent}
- @event{EVT_SYS_COLOUR_CHANGED(func)}:
+ @event{EVT_SYS_COLOUR_CHANGED(func)}
Process a wxEVT_SYS_COLOUR_CHANGED event.
@endEventTable
the window hierarchy.
@beginEventTable{wxWindowCreateEvent}
- @event{EVT_WINDOW_CREATE(func)}:
+ @event{EVT_WINDOW_CREATE(func)}
Process a wxEVT_CREATE event.
@endEventTable
@beginEventTable{wxPaintEvent}
- @event{EVT_PAINT(func)}:
+ @event{EVT_PAINT(func)}
Process a wxEVT_PAINT event.
@endEventTable
maximized, only a normal wxSizeEvent is generated in this case.
@beginEventTable{wxMaximizeEvent}
- @event{EVT_MAXIMIZE(func)}:
+ @event{EVT_MAXIMIZE(func)}
Process a wxEVT_MAXIMIZE event.
@endEventTable
@beginEventTable{wxUpdateUIEvent}
- @event{EVT_UPDATE_UI(id, func)}:
+ @event{EVT_UPDATE_UI(id, func)}
Process a wxEVT_UPDATE_UI event for the command with the given id.
- @event{EVT_UPDATE_UI_RANGE(id1, id2, func)}:
+ @event{EVT_UPDATE_UI_RANGE(id1, id2, func)}
Process a wxEVT_UPDATE_UI event for any command with id included in the given range.
@endEventTable
They are generated by all controls under Windows.
@beginEventTable{wxClipboardTextEvent}
- @event{EVT_TEXT_COPY(id, func)}:
+ @event{EVT_TEXT_COPY(id, func)}
Some or all of the controls content was copied to the clipboard.
- @event{EVT_TEXT_CUT(id, func)}:
+ @event{EVT_TEXT_CUT(id, func)}
Some or all of the controls content was cut (i.e. copied and
deleted).
- @event{EVT_TEXT_PASTE(id, func)}:
+ @event{EVT_TEXT_PASTE(id, func)}
Clipboard content was pasted into the control.
@endEventTable
@beginEventTable{wxMouseEvent}
- @event{EVT_LEFT_DOWN(func)}:
+ @event{EVT_LEFT_DOWN(func)}
Process a wxEVT_LEFT_DOWN event. The handler of this event should normally
call event.Skip() to allow the default processing to take place as otherwise
the window under mouse wouldn't get the focus.
- @event{EVT_LEFT_UP(func)}:
+ @event{EVT_LEFT_UP(func)}
Process a wxEVT_LEFT_UP event.
- @event{EVT_LEFT_DCLICK(func)}:
+ @event{EVT_LEFT_DCLICK(func)}
Process a wxEVT_LEFT_DCLICK event.
- @event{EVT_MIDDLE_DOWN(func)}:
+ @event{EVT_MIDDLE_DOWN(func)}
Process a wxEVT_MIDDLE_DOWN event.
- @event{EVT_MIDDLE_UP(func)}:
+ @event{EVT_MIDDLE_UP(func)}
Process a wxEVT_MIDDLE_UP event.
- @event{EVT_MIDDLE_DCLICK(func)}:
+ @event{EVT_MIDDLE_DCLICK(func)}
Process a wxEVT_MIDDLE_DCLICK event.
- @event{EVT_RIGHT_DOWN(func)}:
+ @event{EVT_RIGHT_DOWN(func)}
Process a wxEVT_RIGHT_DOWN event.
- @event{EVT_RIGHT_UP(func)}:
+ @event{EVT_RIGHT_UP(func)}
Process a wxEVT_RIGHT_UP event.
- @event{EVT_RIGHT_DCLICK(func)}:
+ @event{EVT_RIGHT_DCLICK(func)}
Process a wxEVT_RIGHT_DCLICK event.
- @event{EVT_MOUSE_AUX1_DOWN(func)}:
+ @event{EVT_MOUSE_AUX1_DOWN(func)}
Process a wxEVT_MOUSE_AUX1_DOWN event.
- @event{EVT_MOUSE_AUX1_UP(func)}:
+ @event{EVT_MOUSE_AUX1_UP(func)}
Process a wxEVT_MOUSE_AUX1_UP event.
- @event{EVT_MOUSE_AUX1_DCLICK(func)}:
+ @event{EVT_MOUSE_AUX1_DCLICK(func)}
Process a wxEVT_MOUSE_AUX1_DCLICK event.
- @event{EVT_MOUSE_AUX2_DOWN(func)}:
+ @event{EVT_MOUSE_AUX2_DOWN(func)}
Process a wxEVT_MOUSE_AUX2_DOWN event.
- @event{EVT_MOUSE_AUX2_UP(func)}:
+ @event{EVT_MOUSE_AUX2_UP(func)}
Process a wxEVT_MOUSE_AUX2_UP event.
- @event{EVT_MOUSE_AUX2_DCLICK(func)}:
+ @event{EVT_MOUSE_AUX2_DCLICK(func)}
Process a wxEVT_MOUSE_AUX2_DCLICK event.
- @event{EVT_MOTION(func)}:
+ @event{EVT_MOTION(func)}
Process a wxEVT_MOTION event.
- @event{EVT_ENTER_WINDOW(func)}:
+ @event{EVT_ENTER_WINDOW(func)}
Process a wxEVT_ENTER_WINDOW event.
- @event{EVT_LEAVE_WINDOW(func)}:
+ @event{EVT_LEAVE_WINDOW(func)}
Process a wxEVT_LEAVE_WINDOW event.
- @event{EVT_MOUSEWHEEL(func)}:
+ @event{EVT_MOUSEWHEEL(func)}
Process a wxEVT_MOUSEWHEEL event.
- @event{EVT_MOUSE_EVENTS(func)}:
+ @event{EVT_MOUSE_EVENTS(func)}
Process all mouse events.
@endEventTable
other platforms (you can still distinguish simple clicks from double-clicks as
they generate different kinds of events however).
- @wxsince{2.9.0}
+ @since 2.9.0
*/
int GetClickCount() const;
message-based approach of dropping files.
@beginEventTable{wxDropFilesEvent}
- @event{EVT_DROP_FILES(func)}:
+ @event{EVT_DROP_FILES(func)}
Process a wxEVT_DROP_FILES event.
@endEventTable
More complex controls, such as wxTreeCtrl, have separate command event classes.
@beginEventTable{wxCommandEvent}
- @event{EVT_COMMAND(id, event, func)}:
+ @event{EVT_COMMAND(id, event, func)}
Process a command, supplying the window identifier, command event identifier,
and member function.
- @event{EVT_COMMAND_RANGE(id1, id2, event, func)}:
+ @event{EVT_COMMAND_RANGE(id1, id2, event, func)}
Process a command for a range of window identifiers, supplying the minimum and
maximum window identifiers, command event identifier, and member function.
- @event{EVT_BUTTON(id, func)}:
+ @event{EVT_BUTTON(id, func)}
Process a wxEVT_COMMAND_BUTTON_CLICKED command, which is generated by a wxButton control.
- @event{EVT_CHECKBOX(id, func)}:
+ @event{EVT_CHECKBOX(id, func)}
Process a wxEVT_COMMAND_CHECKBOX_CLICKED command, which is generated by a wxCheckBox control.
- @event{EVT_CHOICE(id, func)}:
+ @event{EVT_CHOICE(id, func)}
Process a wxEVT_COMMAND_CHOICE_SELECTED command, which is generated by a wxChoice control.
- @event{EVT_COMBOBOX(id, func)}:
+ @event{EVT_COMBOBOX(id, func)}
Process a wxEVT_COMMAND_COMBOBOX_SELECTED command, which is generated by a wxComboBox control.
- @event{EVT_LISTBOX(id, func)}:
+ @event{EVT_LISTBOX(id, func)}
Process a wxEVT_COMMAND_LISTBOX_SELECTED command, which is generated by a wxListBox control.
- @event{EVT_LISTBOX_DCLICK(id, func)}:
+ @event{EVT_LISTBOX_DCLICK(id, func)}
Process a wxEVT_COMMAND_LISTBOX_DOUBLECLICKED command, which is generated by a wxListBox control.
- @event{EVT_MENU(id, func)}:
+ @event{EVT_MENU(id, func)}
Process a wxEVT_COMMAND_MENU_SELECTED command, which is generated by a menu item.
- @event{EVT_MENU_RANGE(id1, id2, func)}:
+ @event{EVT_MENU_RANGE(id1, id2, func)}
Process a wxEVT_COMMAND_MENU_RANGE command, which is generated by a range of menu items.
- @event{EVT_CONTEXT_MENU(func)}:
+ @event{EVT_CONTEXT_MENU(func)}
Process the event generated when the user has requested a popup menu to appear by
pressing a special keyboard key (under Windows) or by right clicking the mouse.
- @event{EVT_RADIOBOX(id, func)}:
+ @event{EVT_RADIOBOX(id, func)}
Process a wxEVT_COMMAND_RADIOBOX_SELECTED command, which is generated by a wxRadioBox control.
- @event{EVT_RADIOBUTTON(id, func)}:
+ @event{EVT_RADIOBUTTON(id, func)}
Process a wxEVT_COMMAND_RADIOBUTTON_SELECTED command, which is generated by a wxRadioButton control.
- @event{EVT_SCROLLBAR(id, func)}:
+ @event{EVT_SCROLLBAR(id, func)}
Process a wxEVT_COMMAND_SCROLLBAR_UPDATED command, which is generated by a wxScrollBar
control. This is provided for compatibility only; more specific scrollbar event macros
should be used instead (see wxScrollEvent).
- @event{EVT_SLIDER(id, func)}:
+ @event{EVT_SLIDER(id, func)}
Process a wxEVT_COMMAND_SLIDER_UPDATED command, which is generated by a wxSlider control.
- @event{EVT_TEXT(id, func)}:
+ @event{EVT_TEXT(id, func)}
Process a wxEVT_COMMAND_TEXT_UPDATED command, which is generated by a wxTextCtrl control.
- @event{EVT_TEXT_ENTER(id, func)}:
+ @event{EVT_TEXT_ENTER(id, func)}
Process a wxEVT_COMMAND_TEXT_ENTER command, which is generated by a wxTextCtrl control.
Note that you must use wxTE_PROCESS_ENTER flag when creating the control if you want it
to generate such events.
- @event{EVT_TEXT_MAXLEN(id, func)}:
+ @event{EVT_TEXT_MAXLEN(id, func)}
Process a wxEVT_COMMAND_TEXT_MAXLEN command, which is generated by a wxTextCtrl control
when the user tries to enter more characters into it than the limit previously set
with SetMaxLength().
- @event{EVT_TOGGLEBUTTON(id, func)}:
+ @event{EVT_TOGGLEBUTTON(id, func)}
Process a wxEVT_COMMAND_TOGGLEBUTTON_CLICKED event.
- @event{EVT_TOOL(id, func)}:
+ @event{EVT_TOOL(id, func)}
Process a wxEVT_COMMAND_TOOL_CLICKED event (a synonym for wxEVT_COMMAND_MENU_SELECTED).
Pass the id of the tool.
- @event{EVT_TOOL_RANGE(id1, id2, func)}:
+ @event{EVT_TOOL_RANGE(id1, id2, func)}
Process a wxEVT_COMMAND_TOOL_CLICKED event for a range of identifiers. Pass the ids of the tools.
- @event{EVT_TOOL_RCLICKED(id, func)}:
+ @event{EVT_TOOL_RCLICKED(id, func)}
Process a wxEVT_COMMAND_TOOL_RCLICKED event. Pass the id of the tool.
- @event{EVT_TOOL_RCLICKED_RANGE(id1, id2, func)}:
+ @event{EVT_TOOL_RCLICKED_RANGE(id1, id2, func)}
Process a wxEVT_COMMAND_TOOL_RCLICKED event for a range of ids. Pass the ids of the tools.
- @event{EVT_TOOL_ENTER(id, func)}:
+ @event{EVT_TOOL_ENTER(id, func)}
Process a wxEVT_COMMAND_TOOL_ENTER event. Pass the id of the toolbar itself.
The value of wxCommandEvent::GetSelection() is the tool id, or -1 if the mouse cursor
has moved off a tool.
- @event{EVT_COMMAND_LEFT_CLICK(id, func)}:
+ @event{EVT_COMMAND_LEFT_CLICK(id, func)}
Process a wxEVT_COMMAND_LEFT_CLICK command, which is generated by a control (Windows 95 and NT only).
- @event{EVT_COMMAND_LEFT_DCLICK(id, func)}:
+ @event{EVT_COMMAND_LEFT_DCLICK(id, func)}
Process a wxEVT_COMMAND_LEFT_DCLICK command, which is generated by a control (Windows 95 and NT only).
- @event{EVT_COMMAND_RIGHT_CLICK(id, func)}:
+ @event{EVT_COMMAND_RIGHT_CLICK(id, func)}
Process a wxEVT_COMMAND_RIGHT_CLICK command, which is generated by a control (Windows 95 and NT only).
- @event{EVT_COMMAND_SET_FOCUS(id, func)}:
+ @event{EVT_COMMAND_SET_FOCUS(id, func)}
Process a wxEVT_COMMAND_SET_FOCUS command, which is generated by a control (Windows 95 and NT only).
- @event{EVT_COMMAND_KILL_FOCUS(id, func)}:
+ @event{EVT_COMMAND_KILL_FOCUS(id, func)}
Process a wxEVT_COMMAND_KILL_FOCUS command, which is generated by a control (Windows 95 and NT only).
- @event{EVT_COMMAND_ENTER(id, func)}:
+ @event{EVT_COMMAND_ENTER(id, func)}
Process a wxEVT_COMMAND_ENTER command, which is generated by a control.
@endEventTable
int GetSelection() const;
/**
- Returns item string for a listbox or choice selection event (not valid for
- a deselection).
+ Returns item string for a listbox or choice selection event. If one
+ or several items have been deselected, returns the index of the first
+ deselected item. If some items have been selected and others deselected
+ at the same time, it will return the index of the first selected item.
*/
wxString GetString() const;
bool IsChecked() const;
/**
- For a listbox or similar event, returns @true if it is a selection, @false if it
- is a deselection.
+ For a listbox or similar event, returns @true if it is a selection, @false
+ if it is a deselection. If some items have been selected and others deselected
+ at the same time, it will return @true.
*/
bool IsSelection() const;
or deactivated.
@beginEventTable{wxActivateEvent}
- @event{EVT_ACTIVATE(func)}:
+ @event{EVT_ACTIVATE(func)}
Process a wxEVT_ACTIVATE event.
- @event{EVT_ACTIVATE_APP(func)}:
+ @event{EVT_ACTIVATE_APP(func)}
Process a wxEVT_ACTIVATE_APP event.
- @event{EVT_HIBERNATE(func)}:
+ @event{EVT_HIBERNATE(func)}
Process a hibernate event, supplying the member function. This event applies
to wxApp only, and only on Windows SmartPhone and PocketPC.
It is generated when the system is low on memory; the application should free
for mouse right-down events.
@beginEventTable{wxContextMenuEvent}
- @event{EVT_CONTEXT_MENU(func)}:
+ @event{EVT_CONTEXT_MENU(func)}
A right click (or other context menu command depending on platform) has been detected.
@endEventTable
a wxPaintDC in the event handler.
@beginEventTable{wxEraseEvent}
- @event{EVT_ERASE_BACKGROUND(func)}:
+ @event{EVT_ERASE_BACKGROUND(func)}
Process a wxEVT_ERASE_BACKGROUND event.
@endEventTable
program itself using wxWindow::SetFocus.
@beginEventTable{wxFocusEvent}
- @event{EVT_SET_FOCUS(func)}:
+ @event{EVT_SET_FOCUS(func)}
Process a wxEVT_SET_FOCUS event.
- @event{EVT_KILL_FOCUS(func)}:
+ @event{EVT_KILL_FOCUS(func)}
Process a wxEVT_KILL_FOCUS event.
@endEventTable
Use wxWindow::FindFocus() to retreive the window which is actually getting focus.
@beginEventTable{wxChildFocusEvent}
- @event{EVT_CHILD_FOCUS(func)}:
+ @event{EVT_CHILD_FOCUS(func)}
Process a wxEVT_CHILD_FOCUS event.
@endEventTable
This event is currently emitted under Windows only.
@beginEventTable{wxMouseCaptureLostEvent}
- @event{EVT_MOUSE_CAPTURE_LOST(func)}:
+ @event{EVT_MOUSE_CAPTURE_LOST(func)}
Process a wxEVT_MOUSE_CAPTURE_LOST event.
@endEventTable
found.
@beginEventTable{wxHelpEvent}
- @event{EVT_HELP(id, func)}:
+ @event{EVT_HELP(id, func)}
Process a wxEVT_HELP event.
- @event{EVT_HELP_RANGE(id1, id2, func)}:
+ @event{EVT_HELP_RANGE(id1, id2, func)}
Process a wxEVT_HELP event for a range of ids.
@endEventTable
scroll events from controls, or EVT_SCROLL... macros without window IDs for
intercepting scroll events from the receiving window -- except for this, the
macros behave exactly the same.
- @event{EVT_SCROLL(func)}:
+ @event{EVT_SCROLL(func)}
Process all scroll events.
- @event{EVT_SCROLL_TOP(func)}:
+ @event{EVT_SCROLL_TOP(func)}
Process wxEVT_SCROLL_TOP scroll-to-top events (minimum position).
- @event{EVT_SCROLL_BOTTOM(func)}:
+ @event{EVT_SCROLL_BOTTOM(func)}
Process wxEVT_SCROLL_BOTTOM scroll-to-bottom events (maximum position).
- @event{EVT_SCROLL_LINEUP(func)}:
+ @event{EVT_SCROLL_LINEUP(func)}
Process wxEVT_SCROLL_LINEUP line up events.
- @event{EVT_SCROLL_LINEDOWN(func)}:
+ @event{EVT_SCROLL_LINEDOWN(func)}
Process wxEVT_SCROLL_LINEDOWN line down events.
- @event{EVT_SCROLL_PAGEUP(func)}:
+ @event{EVT_SCROLL_PAGEUP(func)}
Process wxEVT_SCROLL_PAGEUP page up events.
- @event{EVT_SCROLL_PAGEDOWN(func)}:
+ @event{EVT_SCROLL_PAGEDOWN(func)}
Process wxEVT_SCROLL_PAGEDOWN page down events.
- @event{EVT_SCROLL_THUMBTRACK(func)}:
+ @event{EVT_SCROLL_THUMBTRACK(func)}
Process wxEVT_SCROLL_THUMBTRACK thumbtrack events (frequent events sent as the
user drags the thumbtrack).
- @event{EVT_SCROLL_THUMBRELEASE(func)}:
+ @event{EVT_SCROLL_THUMBRELEASE(func)}
Process wxEVT_SCROLL_THUMBRELEASE thumb release events.
- @event{EVT_SCROLL_CHANGED(func)}:
+ @event{EVT_SCROLL_CHANGED(func)}
Process wxEVT_SCROLL_CHANGED end of scrolling events (MSW only).
- @event{EVT_COMMAND_SCROLL(id, func)}:
+ @event{EVT_COMMAND_SCROLL(id, func)}
Process all scroll events.
- @event{EVT_COMMAND_SCROLL_TOP(id, func)}:
+ @event{EVT_COMMAND_SCROLL_TOP(id, func)}
Process wxEVT_SCROLL_TOP scroll-to-top events (minimum position).
- @event{EVT_COMMAND_SCROLL_BOTTOM(id, func)}:
+ @event{EVT_COMMAND_SCROLL_BOTTOM(id, func)}
Process wxEVT_SCROLL_BOTTOM scroll-to-bottom events (maximum position).
- @event{EVT_COMMAND_SCROLL_LINEUP(id, func)}:
+ @event{EVT_COMMAND_SCROLL_LINEUP(id, func)}
Process wxEVT_SCROLL_LINEUP line up events.
- @event{EVT_COMMAND_SCROLL_LINEDOWN(id, func)}:
+ @event{EVT_COMMAND_SCROLL_LINEDOWN(id, func)}
Process wxEVT_SCROLL_LINEDOWN line down events.
- @event{EVT_COMMAND_SCROLL_PAGEUP(id, func)}:
+ @event{EVT_COMMAND_SCROLL_PAGEUP(id, func)}
Process wxEVT_SCROLL_PAGEUP page up events.
- @event{EVT_COMMAND_SCROLL_PAGEDOWN(id, func)}:
+ @event{EVT_COMMAND_SCROLL_PAGEDOWN(id, func)}
Process wxEVT_SCROLL_PAGEDOWN page down events.
- @event{EVT_COMMAND_SCROLL_THUMBTRACK(id, func)}:
+ @event{EVT_COMMAND_SCROLL_THUMBTRACK(id, func)}
Process wxEVT_SCROLL_THUMBTRACK thumbtrack events (frequent events sent
as the user drags the thumbtrack).
- @event{EVT_COMMAND_SCROLL_THUMBRELEASE(func)}:
+ @event{EVT_COMMAND_SCROLL_THUMBRELEASE(func)}
Process wxEVT_SCROLL_THUMBRELEASE thumb release events.
- @event{EVT_COMMAND_SCROLL_CHANGED(func)}:
+ @event{EVT_COMMAND_SCROLL_CHANGED(func)}
Process wxEVT_SCROLL_CHANGED end of scrolling events (MSW only).
@endEventTable
idle events.
@beginEventTable{wxIdleEvent}
- @event{EVT_IDLE(func)}:
+ @event{EVT_IDLE(func)}
Process a wxEVT_IDLE event.
@endEventTable
The default handler calls wxWindow::TransferDataToWindow.
@beginEventTable{wxInitDialogEvent}
- @event{EVT_INIT_DIALOG(func)}:
+ @event{EVT_INIT_DIALOG(func)}
Process a wxEVT_INIT_DIALOG event.
@endEventTable
WX_DECLARE_CONTROL_CONTAINER.
@beginEventTable{wxNavigationKeyEvent}
- @event{EVT_NAVIGATION_KEY(func)}:
+ @event{EVT_NAVIGATION_KEY(func)}
Process a navigation key event.
@endEventTable
@onlyfor{wxmsw}
@beginEventTable{wxMouseCaptureChangedEvent}
- @event{EVT_MOUSE_CAPTURE_CHANGED(func)}:
+ @event{EVT_MOUSE_CAPTURE_CHANGED(func)}
Process a wxEVT_MOUSE_CAPTURE_CHANGED event.
@endEventTable
This allows the wxWindow::Close function to return @true or @false depending
on whether the close instruction was honoured or not.
+ The EVT_END_SESSION event is slightly different as it is sent by the system
+ when the user session is ending (e.g. because of log out or shutdown) and
+ so all windows are being forcefully closed. At least under MSW, after the
+ handler for this event is executed the program is simply killed by the
+ system. Because of this, the default handler for this event provided by
+ wxWidgets calls all the usual cleanup code (including wxApp::OnExit()) so
+ that it could still be executed and exit()s the process itself, without
+ waiting for being killed. If this behaviour is for some reason undesirable,
+ make sure that you define a handler for this event in your wxApp-derived
+ class and do not call @c event.Skip() in it (but be aware that the system
+ will still kill your application).
+
@beginEventTable{wxCloseEvent}
- @event{EVT_CLOSE(func)}:
+ @event{EVT_CLOSE(func)}
Process a close event, supplying the member function.
This event applies to wxFrame and wxDialog classes.
- @event{EVT_QUERY_END_SESSION(func)}:
+ @event{EVT_QUERY_END_SESSION(func)}
Process a query end session event, supplying the member function.
- This event applies to wxApp only.
- @event{EVT_END_SESSION(func)}:
+ This event can be handled in wxApp-derived class only.
+ @event{EVT_END_SESSION(func)}
Process an end session event, supplying the member function.
- This event applies to wxApp only.
+ This event can be handled in wxApp-derived class only.
@endEventTable
@library{wxcore}
text in the first field of the status bar.
@beginEventTable{wxMenuEvent}
- @event{EVT_MENU_OPEN(func)}:
+ @event{EVT_MENU_OPEN(func)}
A menu is about to be opened. On Windows, this is only sent once for each
navigation of the menubar (up until all menus have closed).
- @event{EVT_MENU_CLOSE(func)}:
+ @event{EVT_MENU_CLOSE(func)}
A menu has been just closed.
- @event{EVT_MENU_HIGHLIGHT(id, func)}:
+ @event{EVT_MENU_HIGHLIGHT(id, func)}
The menu item with the specified id has been highlighted: used to show
help prompts in the status bar by wxFrame
- @event{EVT_MENU_HIGHLIGHT_ALL(func)}:
+ @event{EVT_MENU_HIGHLIGHT_ALL(func)}
A menu item has been highlighted, i.e. the currently selected menu item has changed.
@endEventTable
@onlyfor{wxmsw,wxgtk}
@beginEventTable{wxIconizeEvent}
- @event{EVT_ICONIZE(func)}:
+ @event{EVT_ICONIZE(func)}
Process a wxEVT_ICONIZE event.
@endEventTable
A move event holds information about move change events.
@beginEventTable{wxMoveEvent}
- @event{EVT_MOVE(func)}:
+ @event{EVT_MOVE(func)}
Process a wxEVT_MOVE event, which is generated when a window is moved.
- @event{EVT_MOVE_START(func)}:
+ @event{EVT_MOVE_START(func)}
Process a wxEVT_MOVE_START event, which is generated when the user starts
to move or size a window. wxMSW only.
- @event{EVT_MOVE_END(func)}:
+ @event{EVT_MOVE_END(func)}
Process a wxEVT_MOVE_END event, which is generated when the user stops
moving or sizing a window. wxMSW only.
@endEventTable
In which case, you may need to call wxWindow::Refresh to invalidate the entire window.
@beginEventTable{wxSizeEvent}
- @event{EVT_SIZE(func)}:
+ @event{EVT_SIZE(func)}
Process a wxEVT_SIZE event.
@endEventTable
Use wxSetCursorEvent::SetCursor to specify the cursor you want to be displayed.
@beginEventTable{wxSetCursorEvent}
- @event{EVT_SET_CURSOR(func)}:
+ @event{EVT_SET_CURSOR(func)}
Process a wxEVT_SET_CURSOR event.
@endEventTable
Otherwise, it dispatches @a event immediately using
wxEvtHandler::ProcessEvent(). See the respective documentation for details
- (and caveats).
+ (and caveats). Because of limitation of wxEvtHandler::AddPendingEvent()
+ this function is not thread-safe for event objects having wxString fields,
+ use wxQueueEvent() instead.
@header{wx/event.h}
*/
-void wxPostEvent(wxEvtHandler* dest, wxEvent& event);
+void wxPostEvent(wxEvtHandler* dest, const wxEvent& event);
+
+/**
+ Queue an event for processing on the given object.
+
+ This is a wrapper around wxEvtHandler::QueueEvent(), see its documentation
+ for more details.
+
+ @header{wx/event.h}
+
+ @param dest
+ The object to queue the event on, can't be @c NULL.
+ @param event
+ The heap-allocated and non-@c NULL event to queue, the function takes
+ ownership of it.
+ */
+void wxQueueEvent(wxEvtHandler* dest, wxEvent *event);
//@}