|
Version: 3.2.1
|
Below are a number of functions/macros used with wxWidgets event-handling system.
Related class group: Events
|
| #define | wxDEFINE_EVENT(name, cls) |
| | Define a new event type associated with the specified event class. More...
|
| |
| #define | wxDECLARE_EVENT(name, cls) |
| | Declares a custom event type. More...
|
| |
| #define | wxDECLARE_EXPORTED_EVENT(expdecl, name, cls) |
| | Variant of wxDECLARE_EVENT() used for event types defined inside a shared library. More...
|
| |
| #define | wxEVENT_HANDLER_CAST(functype, func) |
| | Helper macro for definition of custom event table macros. More...
|
| |
| #define | wx__DECLARE_EVT1(evt, id, fn) |
| | This macro is used to define event table macros for handling custom events. More...
|
| |
| #define | wx__DECLARE_EVT2(evt, id1, id2, fn) |
| | Generalized version of the wx__DECLARE_EVT1() macro taking a range of IDs instead of a single one. More...
|
| |
| #define | wx__DECLARE_EVT0(evt, fn) |
| | Simplified version of the wx__DECLARE_EVT1() macro, to be used when the event type must be handled regardless of the ID associated with the specific event instances. More...
|
| |
| #define | wxDECLARE_EVENT_TABLE() |
| | Use this macro inside a class declaration to declare a static event table for that class. More...
|
| |
| #define | wxBEGIN_EVENT_TABLE(theClass, baseClass) |
| | Use this macro in a source file to start listing static event handlers for a specific class. More...
|
| |
| #define | wxEND_EVENT_TABLE() |
| | Use this macro in a source file to end listing static event handlers for a specific class. More...
|
| |
◆ wx__DECLARE_EVT0
| #define wx__DECLARE_EVT0 |
( |
|
evt, |
|
|
|
fn |
|
) |
| |
Simplified version of the wx__DECLARE_EVT1() macro, to be used when the event type must be handled regardless of the ID associated with the specific event instances.
◆ wx__DECLARE_EVT1
| #define wx__DECLARE_EVT1 |
( |
|
evt, |
|
|
|
id, |
|
|
|
fn |
|
) |
| |
This macro is used to define event table macros for handling custom events.
Example of use:
class MyEvent :
public wxEvent { ... };
#define MyEventHandler(func) wxEVENT_HANDLER_CAST(MyEventFunction, func)
#define EVT_MY(id, func) \
wx__DECLARE_EVT1(MY_EVENT_TYPE, id, MyEventHandler(func))
...
wxBEGIN_EVENT_TABLE(MyFrame,
wxFrame)
- Parameters
-
| evt | The event type to handle. |
| id | The identifier of events to handle. |
| fn | The event handler method. |
◆ wx__DECLARE_EVT2
| #define wx__DECLARE_EVT2 |
( |
|
evt, |
|
|
|
id1, |
|
|
|
id2, |
|
|
|
fn |
|
) |
| |
Generalized version of the wx__DECLARE_EVT1() macro taking a range of IDs instead of a single one.
Argument id1 is the first identifier of the range, id2 is the second identifier of the range.
◆ wxBEGIN_EVENT_TABLE
| #define wxBEGIN_EVENT_TABLE |
( |
|
theClass, |
|
|
|
baseClass |
|
) |
| |
◆ wxDECLARE_EVENT
| #define wxDECLARE_EVENT |
( |
|
name, |
|
|
|
cls |
|
) |
| |
Declares a custom event type.
This macro declares a variable called name which must be defined elsewhere using wxDEFINE_EVENT().
The class cls must be the wxEvent-derived class associated with the events of this type and its full declaration must be visible from the point of use of this macro.
For example:
class MyCustomEvent :
public wxEvent { ... };
◆ wxDECLARE_EVENT_TABLE
| #define wxDECLARE_EVENT_TABLE |
( |
| ) |
|
◆ wxDECLARE_EXPORTED_EVENT
| #define wxDECLARE_EXPORTED_EVENT |
( |
|
expdecl, |
|
|
|
name, |
|
|
|
cls |
|
) |
| |
Variant of wxDECLARE_EVENT() used for event types defined inside a shared library.
This is mostly used by wxWidgets internally, e.g.
◆ wxDEFINE_EVENT
| #define wxDEFINE_EVENT |
( |
|
name, |
|
|
|
cls |
|
) |
| |
Define a new event type associated with the specified event class.
This macro defines a new unique event type name associated with the event class cls.
For example:
class MyCustomEvent :
public wxEvent { ... };
- See also
- wxDECLARE_EVENT(), Custom Event Summary
◆ wxEND_EVENT_TABLE
| #define wxEND_EVENT_TABLE |
( |
| ) |
|
◆ wxEVENT_HANDLER_CAST
| #define wxEVENT_HANDLER_CAST |
( |
|
functype, |
|
|
|
func |
|
) |
| |
Helper macro for definition of custom event table macros.
This macro casts the given event handler to the given function type using static_cast to ensure that the actual handler is indeed compatible with it, before (unsafely) casting it to a generic function pointer used by the event tables.
See wx__DECLARE_EVT1 for an example of use.
- See also
- Defining Your Own Event Class
◆ wxEventType
A value uniquely identifying the type of the event.
The values of this type should only be created using wxNewEventType().
See the macro wxDEFINE_EVENT_TYPE() for more information.
- See also
- Events and Event Handling
◆ wxNewEventType()
Generates a new unique event type.
Usually this function is only used by wxDEFINE_EVENT() and not called directly.
◆ wxPostEvent()
◆ wxQueueEvent()
Queue an event for processing on the given object.
This is a wrapper around wxEvtHandler::QueueEvent(), see its documentation for more details.
Include file:
#include <wx/event.h>
- Parameters
-
| dest | The object to queue the event on, can't be NULL. |
| event | The heap-allocated and non-NULL event to queue, the function takes ownership of it. |
◆ wxEVT_ACTIVATE
◆ wxEVT_ACTIVATE_APP
◆ wxEVT_ANY
◆ wxEVT_AUX1_DCLICK
◆ wxEVT_AUX1_DOWN
◆ wxEVT_AUX1_UP
◆ wxEVT_AUX2_DCLICK
◆ wxEVT_AUX2_DOWN
◆ wxEVT_AUX2_UP
◆ wxEVT_BUTTON
◆ wxEVT_CHAR
◆ wxEVT_CHAR_HOOK
◆ wxEVT_CHECKBOX
◆ wxEVT_CHECKLISTBOX
◆ wxEVT_CHILD_FOCUS
◆ wxEVT_CHOICE
◆ wxEVT_CLOSE_WINDOW
◆ wxEVT_COMBOBOX
◆ wxEVT_COMBOBOX_CLOSEUP
◆ wxEVT_COMBOBOX_DROPDOWN
◆ wxEVT_COMMAND_ENTER
◆ wxEVT_COMMAND_KILL_FOCUS
◆ wxEVT_COMMAND_LEFT_CLICK
◆ wxEVT_COMMAND_LEFT_DCLICK
◆ wxEVT_COMMAND_RIGHT_CLICK
◆ wxEVT_COMMAND_RIGHT_DCLICK
◆ wxEVT_COMMAND_SET_FOCUS
◆ wxEVT_CONTEXT_MENU
◆ wxEVT_CREATE
◆ wxEVT_DESTROY
◆ wxEVT_DETAILED_HELP
◆ wxEVT_DISPLAY_CHANGED
◆ wxEVT_DPI_CHANGED
◆ wxEVT_DROP_FILES
◆ wxEVT_END_SESSION
◆ wxEVT_ENTER_WINDOW
◆ wxEVT_ERASE_BACKGROUND
◆ wxEVT_FULLSCREEN
◆ wxEVT_GESTURE_PAN
◆ wxEVT_GESTURE_ROTATE
◆ wxEVT_GESTURE_ZOOM
◆ wxEVT_HELP
◆ wxEVT_HIBERNATE
◆ wxEVT_HOTKEY
◆ wxEVT_ICONIZE
◆ wxEVT_IDLE
◆ wxEVT_INIT_DIALOG
◆ wxEVT_JOY_BUTTON_DOWN
◆ wxEVT_JOY_BUTTON_UP
◆ wxEVT_JOY_MOVE
◆ wxEVT_JOY_ZMOVE
◆ wxEVT_KEY_DOWN
◆ wxEVT_KEY_UP
◆ wxEVT_KILL_FOCUS
◆ wxEVT_LEAVE_WINDOW
◆ wxEVT_LEFT_DCLICK
◆ wxEVT_LEFT_DOWN
◆ wxEVT_LEFT_UP
◆ wxEVT_LISTBOX
◆ wxEVT_LISTBOX_DCLICK
◆ wxEVT_LONG_PRESS
◆ wxEVT_MAGNIFY
◆ wxEVT_MAXIMIZE
◆ wxEVT_MENU
◆ wxEVT_MENU_CLOSE
◆ wxEVT_MENU_HIGHLIGHT
◆ wxEVT_MENU_OPEN
◆ wxEVT_MIDDLE_DCLICK
◆ wxEVT_MIDDLE_DOWN
◆ wxEVT_MIDDLE_UP
◆ wxEVT_MOTION
◆ wxEVT_MOUSE_CAPTURE_CHANGED
◆ wxEVT_MOUSE_CAPTURE_LOST
◆ wxEVT_MOUSEWHEEL
◆ wxEVT_MOVE
◆ wxEVT_MOVE_END
◆ wxEVT_MOVE_START
◆ wxEVT_MOVING
◆ wxEVT_NAVIGATION_KEY
◆ wxEVT_NC_PAINT
◆ wxEVT_NULL
A special event type usually used to indicate that some wxEvent has yet no type assigned.
◆ wxEVT_PAINT
◆ wxEVT_PALETTE_CHANGED
◆ wxEVT_PRESS_AND_TAP
◆ wxEVT_QUERY_END_SESSION
◆ wxEVT_QUERY_NEW_PALETTE
◆ wxEVT_RADIOBOX
◆ wxEVT_RADIOBUTTON
◆ wxEVT_RIGHT_DCLICK
◆ wxEVT_RIGHT_DOWN
◆ wxEVT_RIGHT_UP
◆ wxEVT_SCROLL_BOTTOM
◆ wxEVT_SCROLL_CHANGED
◆ wxEVT_SCROLL_LINEDOWN
◆ wxEVT_SCROLL_LINEUP
◆ wxEVT_SCROLL_PAGEDOWN
◆ wxEVT_SCROLL_PAGEUP
◆ wxEVT_SCROLL_THUMBRELEASE
◆ wxEVT_SCROLL_THUMBTRACK
◆ wxEVT_SCROLL_TOP
◆ wxEVT_SCROLLBAR
◆ wxEVT_SCROLLWIN_BOTTOM
◆ wxEVT_SCROLLWIN_LINEDOWN
◆ wxEVT_SCROLLWIN_LINEUP
◆ wxEVT_SCROLLWIN_PAGEDOWN
◆ wxEVT_SCROLLWIN_PAGEUP
◆ wxEVT_SCROLLWIN_THUMBRELEASE
◆ wxEVT_SCROLLWIN_THUMBTRACK
◆ wxEVT_SCROLLWIN_TOP
◆ wxEVT_SET_CURSOR
◆ wxEVT_SET_FOCUS
◆ wxEVT_SHOW
◆ wxEVT_SIZE
◆ wxEVT_SIZING
◆ wxEVT_SLIDER
◆ wxEVT_SPIN
◆ wxEVT_SPIN_DOWN
◆ wxEVT_SPIN_UP
◆ wxEVT_SYS_COLOUR_CHANGED
◆ wxEVT_TEXT_COPY
◆ wxEVT_TEXT_CUT
◆ wxEVT_TEXT_PASTE
◆ wxEVT_THREAD
◆ wxEVT_TOOL
◆ wxEVT_TOOL_DROPDOWN
◆ wxEVT_TOOL_ENTER
◆ wxEVT_TOOL_RCLICKED
◆ wxEVT_TWO_FINGER_TAP
◆ wxEVT_UPDATE_UI
◆ wxEVT_VLBOX
◆ wxEVT_WINDOW_MODAL_DIALOG_CLOSED
A class that can handle events from the windowing system.
Definition: event.h:382
An event is a structure holding information about an event passed to a callback or member function.
Definition: event.h:93
@ wxID_ANY
Any id: means that we don't care about the id, whether when installing an event handler or when creat...
Definition: defs.h:597
#define wxDECLARE_EVENT(name, cls)
Declares a custom event type.
Definition: event.h:4989
A frame is a window whose size and position can (usually) be changed by the user.
Definition: frame.h:164
wxEventType wxEVT_BUTTON
Definition: event.h:5133
#define wxDECLARE_EXPORTED_EVENT(expdecl, name, cls)
Variant of wxDECLARE_EVENT() used for event types defined inside a shared library.
Definition: event.h:5000
#define wxDEFINE_EVENT(name, cls)
Define a new event type associated with the specified event class.
Definition: event.h:4969
#define wxEND_EVENT_TABLE()
Use this macro in a source file to end listing static event handlers for a specific class.
Definition: event.h:5097
This event class contains information about command events, which originate from a variety of simple ...
Definition: event.h:2032