/////////////////////////////////////////////////////////////////////////////
// Name: event.h
-// Purpose: documentation for wxKeyEvent class
+// Purpose: interface of wxKeyEvent
// Author: wxWidgets team
// RCS-ID: $Id$
// Licence: wxWindows license
1, the ASCII value of this key combination.
You may discover how the other keys on your system behave interactively by
- running the text wxWidgets sample and pressing some keys
+ running the text() wxWidgets sample and pressing some keys
in any of the text controls shown in it.
@b Note: If a key down (@c EVT_KEY_DOWN) event is caught and
Notice that GetModifiers() is easier to use
correctly than this function so you should consider using it in new code.
*/
- bool AltDown();
+ bool AltDown() const;
/**
CMD is a pseudo key which is the same as Control for PC and Unix
this is the same as ControlDown() and under
Mac this is the same as MetaDown().
*/
- bool CmdDown();
+ bool CmdDown() const;
/**
Returns @true if the control key was down at the time of the key event.
Notice that GetModifiers() is easier to use
correctly than this function so you should consider using it in new code.
*/
- bool ControlDown();
+ bool ControlDown() const;
/**
Returns the virtual key code. ASCII events return normal ASCII values,
while non-ASCII events return values such as @b WXK_LEFT for the
- left cursor key. See Keycodes for a full list of
+ left cursor key. See Keycodes() for a full list of
the virtual key codes.
Note that in Unicode build, the returned value is meaningful only if the
user entered a character that can be represented in current locale's default
charset. You can obtain the corresponding Unicode character using
GetUnicodeKey().
*/
- int GetKeyCode();
+ int GetKeyCode() const;
/**
Return the bitmask of modifier keys which were pressed when this event
Notice that this function is easier to use correctly than, for example,
ControlDown() because when using the latter you
also have to remember to test that none of the other modifiers is pressed:
-
+
and forgetting to do it can result in serious program bugs (e.g. program not
working with European keyboard layout where ALTGR key which is seen by
the program as combination of CTRL and ALT is used). On the
other hand, you can simply write
-
+
with this function.
*/
- int GetModifiers();
+ int GetModifiers() const;
//@{
/**
Obtains the position (in client coordinates) at which the key was pressed.
*/
- wxPoint GetPosition();
- void GetPosition(long* x, long* y);
+ wxPoint GetPosition() const;
+ const void GetPosition(long* x, long* y) const;
//@}
/**
@b NB: Currently the raw key codes are not supported by all ports, use
@c #ifdef wxHAS_RAW_KEY_CODES to determine if this feature is available.
*/
- wxUint32 GetRawKeyCode();
+ wxUint32 GetRawKeyCode() const;
/**
Returns the low level key flags for this event. The flags are
@b NB: Currently the raw key flags are not supported by all ports, use
@c #ifdef wxHAS_RAW_KEY_CODES to determine if this feature is available.
*/
- wxUint32 GetRawKeyFlags();
+ wxUint32 GetRawKeyFlags() const;
/**
Returns the Unicode character corresponding to this key event.
This function is only available in Unicode build, i.e. when
@c wxUSE_UNICODE is 1.
*/
- wxChar GetUnicodeKey();
+ wxChar GetUnicodeKey() const;
/**
Returns the X position (in client coordinates) of the event.
*/
- long GetX();
+ long GetX() const;
/**
Returns the Y (in client coordinates) position of the event.
*/
- long GetY();
+ long GetY() const;
/**
Returns @true if either CTRL or ALT keys was down
META under X but the key presses even while NUMLOCK is on should
be still processed normally).
*/
- bool HasModifiers();
+ bool HasModifiers() const;
/**
Returns @true if the Meta key was down at the time of the key event.
Notice that GetModifiers() is easier to use
correctly than this function so you should consider using it in new code.
*/
- bool MetaDown();
+ bool MetaDown() const;
/**
Returns @true if the shift key was down at the time of the key event.
Notice that GetModifiers() is easier to use
correctly than this function so you should consider using it in new code.
*/
- bool ShiftDown();
+ bool ShiftDown() const;
/**
bool m_altDown
long m_keyCode
@b Deprecated: Please use GetKeyCode()
instead!
- Virtual keycode. See Keycodes for a list of identifiers.
+ Virtual keycode. See Keycodes() for a list of identifiers.
*/
};
+
/**
@class wxJoystickEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- wxJoystick
+ @see wxJoystick
*/
class wxJoystickEvent : public wxEvent
{
/**
Returns @true if the event was a down event from the specified button (or any
button).
-
+
@param button
Can be wxJOY_BUTTONn where n is 1, 2, 3 or 4; or wxJOY_BUTTON_ANY to
indicate any button down event.
*/
- bool ButtonDown(int button = wxJOY_BUTTON_ANY);
+ bool ButtonDown(int button = wxJOY_BUTTON_ANY) const;
/**
Returns @true if the specified button (or any button) was in a down state.
-
+
@param button
Can be wxJOY_BUTTONn where n is 1, 2, 3 or 4; or wxJOY_BUTTON_ANY to
indicate any button down event.
*/
- bool ButtonIsDown(int button = wxJOY_BUTTON_ANY);
+ bool ButtonIsDown(int button = wxJOY_BUTTON_ANY) const;
/**
Returns @true if the event was an up event from the specified button (or any
button).
-
+
@param button
Can be wxJOY_BUTTONn where n is 1, 2, 3 or 4; or wxJOY_BUTTON_ANY to
indicate any button down event.
*/
- bool ButtonUp(int button = wxJOY_BUTTON_ANY);
+ bool ButtonUp(int button = wxJOY_BUTTON_ANY) const;
/**
Returns the identifier of the button changing state. This is a wxJOY_BUTTONn
identifier, where
n is one of 1, 2, 3, 4.
*/
- int GetButtonChange();
+ int GetButtonChange() const;
/**
Returns the down state of the buttons. This is a bitlist of wxJOY_BUTTONn
identifiers, where
n is one of 1, 2, 3, 4.
*/
- int GetButtonState();
+ int GetButtonState() const;
/**
Returns the identifier of the joystick generating the event - one of
wxJOYSTICK1 and wxJOYSTICK2.
*/
- int GetJoystick();
+ int GetJoystick() const;
/**
Returns the x, y position of the joystick event.
*/
- wxPoint GetPosition();
+ wxPoint GetPosition() const;
/**
Returns the z position of the joystick event.
*/
- int GetZPosition();
+ int GetZPosition() const;
/**
Returns @true if this was a button up or down event (@e not 'is any button
down?').
*/
- bool IsButton();
+ bool IsButton() const;
/**
Returns @true if this was an x, y move event.
*/
- bool IsMove();
+ bool IsMove() const;
/**
Returns @true if this was a z move event.
*/
- bool IsZMove();
+ bool IsZMove() const;
};
+
/**
@class wxScrollWinEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- wxScrollEvent, @ref overview_eventhandlingoverview
+ @see wxScrollEvent, @ref overview_eventhandlingoverview
*/
class wxScrollWinEvent : public wxEvent
{
Returns wxHORIZONTAL or wxVERTICAL, depending on the orientation of the
scrollbar.
*/
- int GetOrientation();
+ int GetOrientation() const;
/**
Returns the position of the scrollbar for the thumb track and release events.
Note that this field can't be used for the other events, you need to query
the window itself for the current position in that case.
*/
- int GetPosition();
+ int GetPosition() const;
};
+
/**
@class wxSysColourChangedEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- @ref overview_eventhandlingoverview
+ @see @ref overview_eventhandlingoverview
*/
class wxSysColourChangedEvent : public wxEvent
{
};
+
/**
@class wxWindowCreateEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- @ref overview_eventhandlingoverview, wxWindowDestroyEvent
+ @see @ref overview_eventhandlingoverview, wxWindowDestroyEvent
*/
class wxWindowCreateEvent : public wxCommandEvent
{
};
+
/**
@class wxPaintEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- @ref overview_eventhandlingoverview
+ @see @ref overview_eventhandlingoverview
*/
class wxPaintEvent : public wxEvent
{
};
+
/**
@class wxMaximizeEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- @ref overview_eventhandlingoverview, wxTopLevelWindow::Maximize,
+ @see @ref overview_eventhandlingoverview, wxTopLevelWindow::Maximize,
wxTopLevelWindow::IsMaximized
*/
class wxMaximizeEvent : public wxEvent
};
+
/**
@class wxUpdateUIEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- @ref overview_eventhandlingoverview
+ @see @ref overview_eventhandlingoverview
*/
class wxUpdateUIEvent : public wxCommandEvent
{
the interval is set to 0; so update events will be sent as
often as possible. You can reduce the frequency that events
are sent by changing the mode and/or setting an update interval.
-
+
@see ResetUpdateTime(), SetUpdateInterval(),
SetMode()
*/
/**
Returns @true if the UI element should be checked.
*/
- bool GetChecked();
+ bool GetChecked() const;
/**
Returns @true if the UI element should be enabled.
*/
- bool GetEnabled();
+ bool GetEnabled() const;
/**
Static function returning a value specifying how wxWidgets
Returns @true if the application has called Check(). For wxWidgets internal use
only.
*/
- bool GetSetChecked();
+ bool GetSetChecked() const;
/**
Returns @true if the application has called Enable(). For wxWidgets internal use
only.
*/
- bool GetSetEnabled();
+ bool GetSetEnabled() const;
/**
Returns @true if the application has called Show(). For wxWidgets internal use
only.
*/
- bool GetSetShown();
+ bool GetSetShown() const;
/**
Returns @true if the application has called SetText(). For wxWidgets internal
use only.
*/
- bool GetSetText();
+ bool GetSetText() const;
/**
Returns @true if the UI element should be shown.
*/
- bool GetShown();
+ bool GetShown() const;
/**
Returns the text that should be set for the UI element.
*/
- wxString GetText();
+ wxString GetText() const;
/**
Returns the current interval between updates in milliseconds.
current time. It is assumed that update events are
normally sent in idle time, so this is called at the end of
idle processing.
-
+
@see CanUpdate(), SetUpdateInterval(),
SetMode()
*/
};
+
/**
@class wxClipboardTextEvent
@wxheader{event.h}
wxEVT_COMMAND_TEXT_CUT and wxEVT_COMMAND_TEXT_PASTE.
If any of these events is processed (without being skipped) by an event
- handler, the corresponding operation doesn't take place which allows to prevent
- the text from being copied from or pasted to a control. It is also possible to
- examine the clipboard contents in the PASTE event handler and transform it in
- some way before inserting in a control -- for example, changing its case or
- removing invalid characters.
+ handler, the corresponding operation doesn't take place which allows to
+ prevent the text from being copied from or pasted to a control. It is also
+ possible to examine the clipboard contents in the PASTE event handler and
+ transform it in some way before inserting in a control -- for example,
+ changing its case or removing invalid characters.
Finally notice that a CUT event is always preceded by the COPY event which
- makes it possible to only process the latter if it doesn't matter if the text
- was copied or cut.
+ makes it possible to only process the latter if it doesn't matter if the
+ text was copied or cut.
+
+ @beginEventTable
+ @event{EVT_TEXT_COPY(id, func)}:
+ Some or all of the controls content was copied to the clipboard.
+ @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)}:
+ Clipboard content was pasted into the control.
+ @endEventTable
+
+ @note
+ These events are currently only generated by wxTextCtrl under GTK+. They
+ are generated by all controls under Windows.
@library{wxcore}
@category{events}
- @seealso
- wxClipboard
+ @see wxClipboard
*/
class wxClipboardTextEvent : public wxCommandEvent
{
public:
/**
-
+ Constructor.
*/
- wxClipboardTextEvent(wxEventType commandType = wxEVT_NULL,
- int id = 0);
+ wxClipboardTextEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
};
+
/**
@class wxMouseEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- wxKeyEvent::CmdDown
+ @see wxKeyEvent::CmdDown
*/
class wxMouseEvent : public wxEvent
{
public:
/**
Constructor. Valid event types are:
-
+
@b wxEVT_ENTER_WINDOW
@b wxEVT_LEAVE_WINDOW
@b wxEVT_LEFT_DOWN
/**
Returns @true if the event was a first extra button double click.
*/
- bool Aux1DClick();
+ bool Aux1DClick() const;
/**
Returns @true if the first extra button mouse button changed to down.
*/
- bool Aux1Down();
+ bool Aux1Down() const;
/**
Returns @true if the first extra button mouse button is currently down,
independent
of the current event type.
*/
- bool Aux1IsDown();
+ bool Aux1IsDown() const;
/**
Returns @true if the first extra button mouse button changed to up.
*/
- bool Aux1Up();
+ bool Aux1Up() const;
/**
Returns @true if the event was a second extra button double click.
*/
- bool Aux2DClick();
+ bool Aux2DClick() const;
/**
Returns @true if the second extra button mouse button changed to down.
*/
- bool Aux2Down();
+ bool Aux2Down() const;
/**
Returns @true if the second extra button mouse button is currently down,
independent
of the current event type.
*/
- bool Aux2IsDown();
+ bool Aux2IsDown() const;
/**
Returns @true if the second extra button mouse button changed to up.
*/
- bool Aux2Up();
+ bool Aux2Up() const;
/**
Returns @true if the identified mouse button is changing state. Valid
values of @a button are:
-
+
@c wxMOUSE_BTN_LEFT
-
+
check if left button was pressed
-
+
@c wxMOUSE_BTN_MIDDLE
-
+
check if middle button was pressed
-
+
@c wxMOUSE_BTN_RIGHT
-
+
check if right button was pressed
-
+
@c wxMOUSE_BTN_AUX1
-
+
check if the first extra button was pressed
-
+
@c wxMOUSE_BTN_AUX2
-
+
check if the second extra button was pressed
-
+
@c wxMOUSE_BTN_ANY
-
+
check if any button was pressed
*/
bool Button(int button);
/**
Same as MetaDown() under Mac, same as
ControlDown() elsewhere.
-
+
@see wxKeyEvent::CmdDown
*/
- bool CmdDown();
+ bool CmdDown() const;
/**
Returns @true if the control key was down at the time of the event.
/**
Returns @true if this was a dragging event (motion while a button is depressed).
-
+
@see Moving()
*/
bool Dragging();
double click events, @c wxMOUSE_BTN_MIDDLE and @c wxMOUSE_BTN_RIGHT
for the same events for the middle and the right buttons respectively.
*/
- int GetButton();
+ int GetButton() const;
/**
Returns the number of mouse clicks for this event: 1 for a simple click, 2
Currently this function is implemented only in wxMac and returns -1 for the
other platforms (you can still distinguish simple clicks from double-clicks as
they generate different kinds of events however).
- This function is new since wxWidgets version 2.9.0
+
+ @wxsince{2.9.0}
*/
- int GetClickCount();
+ int GetClickCount() const;
/**
Returns the configured number of lines (or whatever) to be scrolled per
wheel action. Defaults to three.
*/
- int GetLinesPerAction();
+ int GetLinesPerAction() const;
/**
Returns the logical mouse position in pixels (i.e. translated according to the
translation set for the DC, which usually indicates that the window has been
scrolled).
*/
- wxPoint GetLogicalPosition(const wxDC& dc);
+ wxPoint GetLogicalPosition(const wxDC& dc) const;
//@{
/**
keyboard combination (e.g. under Windows when the "menu'' key is pressed), the
returned position is @c wxDefaultPosition.
*/
- wxPoint GetPosition();
- void GetPosition(wxCoord* x, wxCoord* y);
- void GetPosition(long* x, long* y);
+ wxPoint GetPosition() const;
+ const void GetPosition(wxCoord* x, wxCoord* y) const;
+ const void GetPosition(long* x, long* y) const;
//@}
/**
taken, and one such action (for example, scrolling one increment)
should occur for each delta.
*/
- int GetWheelDelta();
+ int GetWheelDelta() const;
/**
Get wheel rotation, positive or negative indicates direction of
should be able to either do partial line scrolling or wait until several
events accumulate before scrolling.
*/
- int GetWheelRotation();
+ int GetWheelRotation() const;
/**
Returns X coordinate of the physical mouse event position.
*/
- long GetX();
+ long GetX() const;
/**
Returns Y coordinate of the physical mouse event position.
down event -
that may be tested using @e ButtonDown).
*/
- bool IsButton();
+ bool IsButton() const;
/**
Returns @true if the system has been setup to do page scrolling with
the mouse wheel instead of line scrolling.
*/
- bool IsPageScroll();
+ bool IsPageScroll() const;
/**
Returns @true if the mouse was leaving the window.
See also Entering().
*/
- bool Leaving();
+ bool Leaving() const;
/**
Returns @true if the event was a left double click.
*/
- bool LeftDClick();
+ bool LeftDClick() const;
/**
Returns @true if the left mouse button changed to down.
*/
- bool LeftDown();
+ bool LeftDown() const;
/**
Returns @true if the left mouse button is currently down, independent
This event is usually used in the mouse event handlers which process "move
mouse" messages to determine whether the user is (still) dragging the mouse.
*/
- bool LeftIsDown();
+ bool LeftIsDown() const;
/**
Returns @true if the left mouse button changed to up.
*/
- bool LeftUp();
+ bool LeftUp() const;
/**
Returns @true if the Meta key was down at the time of the event.
*/
- bool MetaDown();
+ bool MetaDown() const;
/**
Returns @true if the event was a middle double click.
*/
- bool MiddleDClick();
+ bool MiddleDClick() const;
/**
Returns @true if the middle mouse button changed to down.
*/
- bool MiddleDown();
+ bool MiddleDown() const;
/**
Returns @true if the middle mouse button is currently down, independent
of the current event type.
*/
- bool MiddleIsDown();
+ bool MiddleIsDown() const;
/**
Returns @true if the middle mouse button changed to up.
*/
- bool MiddleUp();
+ bool MiddleUp() const;
/**
Returns @true if this was a motion event and no mouse buttons were pressed.
If any mouse button is held pressed, then this method returns @false and
Dragging() returns @true.
*/
- bool Moving();
+ bool Moving() const;
/**
Returns @true if the event was a right double click.
*/
- bool RightDClick();
+ bool RightDClick() const;
/**
Returns @true if the right mouse button changed to down.
*/
- bool RightDown();
+ bool RightDown() const;
/**
Returns @true if the right mouse button is currently down, independent
of the current event type.
*/
- bool RightIsDown();
+ bool RightIsDown() const;
/**
Returns @true if the right mouse button changed to up.
*/
- bool RightUp();
+ bool RightUp() const;
/**
Returns @true if the shift key was down at the time of the event.
*/
- bool ShiftDown();
+ bool ShiftDown() const;
/**
bool m_altDown
};
+
/**
@class wxDropFilesEvent
@wxheader{event.h}
wxWindow::DragAcceptFiles.
Important note: this is a separate implementation to the more general
- drag and drop implementation documented here. It uses the
+ drag and drop implementation documented here(). It uses the
older, Windows message-based approach of dropping files.
@library{wxcore}
@category{events}
- @seealso
- @ref overview_eventhandlingoverview
+ @see @ref overview_eventhandlingoverview
*/
class wxDropFilesEvent : public wxEvent
{
/**
Returns an array of filenames.
*/
- wxString* GetFiles();
+ wxString* GetFiles() const;
/**
Returns the number of files dropped.
*/
- int GetNumberOfFiles();
+ int GetNumberOfFiles() const;
/**
Returns the position at which the files were dropped.
Returns an array of filenames.
*/
- wxPoint GetPosition();
+ wxPoint GetPosition() const;
/**
wxString* m_files
};
+
/**
@class wxCommandEvent
@wxheader{event.h}
/**
Deprecated, use IsChecked() instead.
*/
- bool Checked();
+ bool Checked() const;
/**
Returns client data pointer for a listbox or choice selection event
Notice that this method can not be used with
wxCheckListBox currently.
*/
- bool IsChecked();
+ bool IsChecked() const;
/**
For a listbox or similar event, returns @true if it is a selection, @false if it
};
+
/**
@class wxActivateEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- @ref overview_eventhandlingoverview, wxApp::IsActive
+ @see @ref overview_eventhandlingoverview, wxApp::IsActive
*/
class wxActivateEvent : public wxEvent
{
/**
Returns @true if the application or window is being activated, @false otherwise.
*/
- bool GetActive();
+ bool GetActive() const;
};
+
/**
@class wxContextMenuEvent
@wxheader{event.h}
means that the event originated
from a keyboard context button event, and you should compute a suitable
position yourself,
- for example by calling wxGetMousePosition.
+ for example by calling wxGetMousePosition().
When a keyboard context menu button is pressed on Windows, a right-click event
with default position is sent first,
@library{wxcore}
@category{events}
- @seealso
- @ref overview_wxcommandevent "Command events", @ref
+ @see @ref overview_wxcommandevent "Command events", @ref
overview_eventhandlingoverview
*/
class wxContextMenuEvent : public wxCommandEvent
If the event originated from a keyboard event, the value returned from this
function will be wxDefaultPosition.
*/
- wxPoint GetPosition();
+ wxPoint GetPosition() const;
/**
Sets the position at which the menu should be shown.
};
+
/**
@class wxEraseEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- @ref overview_eventhandlingoverview
+ @see @ref overview_eventhandlingoverview
*/
class wxEraseEvent : public wxEvent
{
/**
Returns the device context associated with the erase event to draw on.
*/
- wxDC* GetDC();
+ wxDC* GetDC() const;
};
+
/**
@class wxFocusEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- @ref overview_eventhandlingoverview
+ @see @ref overview_eventhandlingoverview
*/
class wxFocusEvent : public wxEvent
{
};
+
/**
@class wxChildFocusEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- @ref overview_eventhandlingoverview
+ @see @ref overview_eventhandlingoverview
*/
class wxChildFocusEvent : public wxCommandEvent
{
public:
/**
Constructor.
-
+
@param win
The direct child which is (or which contains the window which is) receiving
the focus.
};
+
/**
@class wxMouseCaptureLostEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- wxMouseCaptureChangedEvent, @ref overview_eventhandlingoverview,
+ @see wxMouseCaptureChangedEvent, @ref overview_eventhandlingoverview,
wxWindow::CaptureMouse, wxWindow::ReleaseMouse, wxWindow::GetCapture
*/
class wxMouseCaptureLostEvent : public wxEvent
};
+
/**
@class wxNotifyEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- wxNotebookEvent
+ @see wxNotebookEvent
*/
class wxNotifyEvent : public wxCommandEvent
{
Returns @true if the change is allowed (Veto()
hasn't been called) or @false otherwise (if it was).
*/
- bool IsAllowed();
+ bool IsAllowed() const;
/**
Prevents the change announced by this event from happening.
};
+
/**
@class wxHelpEvent
@wxheader{event.h}
@library{wxcore}
@category{FIXME}
- @seealso
- wxContextHelp, wxDialog, @ref overview_eventhandlingoverview
+ @see wxContextHelp, wxDialog, @ref overview_eventhandlingoverview
*/
class wxHelpEvent : public wxCommandEvent
{
/**
Returns the origin of the help event which is one of the following values:
-
+
@b Origin_Unknown
-
+
Unrecognized event source.
-
+
@b Origin_Keyboard
-
+
Event generated by @c F1 key press.
-
+
@b Origin_HelpButton
-
+
Event generated by
wxContextHelp or using the "?" title bur button under
MS Windows.
-
+
The application may handle events generated using the keyboard or mouse
- differently, e.g. by using wxGetMousePosition
+ differently, e.g. by using wxGetMousePosition()
for the mouse events.
-
+
@see SetOrigin()
*/
- wxHelpEvent::Origin GetOrigin();
+ wxHelpEvent::Origin GetOrigin() const;
/**
Returns the left-click position of the mouse, in screen coordinates. This allows
the application to position the help appropriately.
*/
- const wxPoint GetPosition();
+ const wxPoint GetPosition() const;
/**
Set the help event origin, only used internally by wxWidgets normally.
-
+
@see GetOrigin()
*/
void SetOrigin(wxHelpEvent::Origin origin);
};
+
/**
@class wxScrollEvent
@wxheader{event.h}
A scroll event holds information about events sent from stand-alone
- scrollbars and sliders. Note that
+ scrollbars() and sliders(). Note that
starting from wxWidgets 2.1, scrolled windows send the
wxScrollWinEvent which does not derive from
wxCommandEvent, but from wxEvent directly - don't confuse these two kinds of
@library{wxcore}
@category{events}
- @seealso
- wxScrollBar, wxSlider, wxSpinButton, , wxScrollWinEvent, @ref
+ @see wxScrollBar, wxSlider, wxSpinButton, , wxScrollWinEvent, @ref
overview_eventhandlingoverview
*/
class wxScrollEvent : public wxCommandEvent
Returns wxHORIZONTAL or wxVERTICAL, depending on the orientation of the
scrollbar.
*/
- int GetOrientation();
+ int GetOrientation() const;
/**
Returns the position of the scrollbar.
*/
- int GetPosition();
+ int GetPosition() const;
};
+
/**
@class wxIdleEvent
@wxheader{event.h}
happens and only then is the next idle event sent again. If you need to ensure
a continuous stream of idle events, you can either use
wxIdleEvent::RequestMore method in your handler or call
- wxWakeUpIdle periodically (for example from timer
+ wxWakeUpIdle() periodically (for example from timer
event), but note that both of these approaches (and especially the first one)
increase the system load and so should be avoided if possible.
@library{wxbase}
@category{events}
- @seealso
- @ref overview_eventhandlingoverview, wxUpdateUIEvent, wxWindow::OnInternalIdle
+ @see @ref overview_eventhandlingoverview, wxUpdateUIEvent,
+ wxWindow::OnInternalIdle
*/
class wxIdleEvent : public wxEvent
{
the update mode is initially wxIDLE_PROCESS_ALL. You can change the mode
to only send idle events to windows with the wxWS_EX_PROCESS_IDLE extra window
style set.
-
+
@see SetMode()
*/
static bool CanSend(wxWindow* window);
/**
Returns @true if the OnIdle function processing this event requested more
processing time.
-
+
@see RequestMore()
*/
- bool MoreRequested();
+ bool MoreRequested() const;
/**
Tells wxWidgets that more processing is required. This function can be called
during OnIdle, then the application will remain in a passive event loop (not
calling OnIdle) until a
new event is posted to the application by the windowing system.
-
+
@see MoreRequested()
*/
void RequestMore(bool needMore = true);
};
+
/**
@class wxInitDialogEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- @ref overview_eventhandlingoverview
+ @see @ref overview_eventhandlingoverview
*/
class wxInitDialogEvent : public wxEvent
{
};
+
/**
@class wxWindowDestroyEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- @ref overview_eventhandlingoverview, wxWindowCreateEvent
+ @see @ref overview_eventhandlingoverview, wxWindowCreateEvent
*/
class wxWindowDestroyEvent : public wxCommandEvent
{
};
+
/**
@class wxNavigationKeyEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- wxWindow::Navigate, wxWindow::NavigateIn
+ @see wxWindow::Navigate, wxWindow::NavigateIn
*/
class wxNavigationKeyEvent
{
/**
Returns the child that has the focus, or @NULL.
*/
- wxWindow* GetCurrentFocus();
+ wxWindow* GetCurrentFocus() const;
/**
Returns @true if the navigation was in the forward direction.
*/
- bool GetDirection();
+ bool GetDirection() const;
/**
Returns @true if the navigation event was from a tab key. This is required
for proper navigation over radio buttons.
*/
- bool IsFromTab();
+ bool IsFromTab() const;
/**
Returns @true if the navigation event represents a window change (for
example, from Ctrl-Page Down
in a notebook).
*/
- bool IsWindowChange();
+ bool IsWindowChange() const;
/**
Sets the current focus window member.
};
+
/**
@class wxMouseCaptureChangedEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- wxMouseCaptureLostEvent, @ref overview_eventhandlingoverview,
+ @see wxMouseCaptureLostEvent, @ref overview_eventhandlingoverview,
wxWindow::CaptureMouse, wxWindow::ReleaseMouse, wxWindow::GetCapture
*/
class wxMouseCaptureChangedEvent : public wxEvent
Returns the window that gained the capture, or @NULL if it was a non-wxWidgets
window.
*/
- wxWindow* GetCapturedWindow();
+ wxWindow* GetCapturedWindow() const;
};
+
/**
@class wxCloseEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- wxWindow::Close, @ref overview_windowdeletionoverview "Window deletion overview"
+ @see wxWindow::Close, @ref overview_windowdeletionoverview "Window deletion
+ overview"
*/
class wxCloseEvent : public wxEvent
{
shutting down. This method can only be called for end session and query end
session events, it doesn't make sense for close window event.
*/
- bool GetLoggingOff();
+ bool GetLoggingOff() const;
/**
Sets the 'can veto' flag.
/**
Sets the 'force' flag.
*/
- void SetForce(bool force);
+ void SetForce(bool force) const;
/**
Sets the 'logging off' flag.
*/
- void SetLoggingOff(bool loggingOff);
+ void SetLoggingOff(bool loggingOff) const;
/**
Call this from your event handler to veto a system shutdown or to signal
};
+
/**
@class wxMenuEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- @ref overview_wxcommandevent "Command events", @ref
+ @see @ref overview_wxcommandevent "Command events", @ref
overview_eventhandlingoverview
*/
class wxMenuEvent : public wxEvent
used with the @c OPEN and @c CLOSE events and even for them the
returned pointer may be @NULL in some ports.
*/
- wxMenu* GetMenu();
+ wxMenu* GetMenu() const;
/**
Returns the menu identifier associated with the event. This method should be
only used with the @c HIGHLIGHT events.
*/
- int GetMenuId();
+ int GetMenuId() const;
/**
Returns @true if the menu which is being opened or closed is a popup menu,
@false if it is a normal one.
This method should only be used with the @c OPEN and @c CLOSE events.
*/
- bool IsPopup();
+ bool IsPopup() const;
};
+
/**
@class wxEventBlocker
@wxheader{event.h}
@library{wxcore}
@category{FIXME}
- @seealso
- @ref overview_eventhandlingoverview, wxEvtHandler
+ @see @ref overview_eventhandlingoverview, wxEvtHandler
*/
class wxEventBlocker : public wxEvtHandler
{
};
+
/**
@class wxEvtHandler
@wxheader{event.h}
@library{wxbase}
@category{FIXME}
- @seealso
- @ref overview_eventhandlingoverview
+ @see @ref overview_eventhandlingoverview
*/
class wxEvtHandler : public wxObject
{
/**
This function posts an event to be processed later.
-
+
@param event
Event to add to process queue.
-
+
@remarks 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
type. This
is an alternative to the use of static event tables. See the 'event' or the old
'dynamic' sample for usage.
-
+
@param id
The identifier (or first of the identifier range) to be
associated with the event handler function. For the version not taking this
added
using the Connect() method. There is no way
to disconnect functions connected using the (static) event tables.
-
+
@param id
The identifier (or first of the identifier range) associated with the event
handler function.
/**
Gets user-supplied client data.
-
+
@remarks Normally, any extra data the programmer wishes to associate with
the object should be made available by deriving a new
class with new data members.
-
+
@see SetClientData()
*/
void* GetClientData();
/**
Get a pointer to the user-supplied client data object.
-
+
@see SetClientObject(), wxClientData
*/
- wxClientData* GetClientObject();
+ wxClientData* GetClientObject() const;
/**
Returns @true if the event handler is enabled, @false otherwise.
-
+
@see SetEvtHandlerEnabled()
*/
bool GetEvtHandlerEnabled();
/**
Gets the pointer to the next handler in the chain.
-
+
@see SetNextHandler(), GetPreviousHandler(),
SetPreviousHandler(), wxWindow::PushEventHandler,
wxWindow::PopEventHandler
/**
Gets the pointer to the previous handler in the chain.
-
+
@see SetPreviousHandler(), GetNextHandler(),
SetNextHandler(), wxWindow::PushEventHandler,
wxWindow::PopEventHandler
/**
Processes an event, searching event tables and calling zero or more suitable
event handler function(s).
-
+
@param event
Event to process.
-
+
@returns @true if a suitable event handler function was found and
executed, and the function did not call wxEvent::Skip.
-
+
@remarks Normally, your application would not call this function: it is
called in the wxWidgets implementation to dispatch
incoming user interface events to the framework (and
application).
-
+
@see SearchEventTable()
*/
virtual bool ProcessEvent(wxEvent& event);
and handles any exceptions that occur in the process. If an exception is
thrown in event handler, wxApp::OnExceptionInMainLoop
is called.
-
+
@param event
Event to process.
-
+
@returns @true if the event was processed, @false if no handler was found
or an exception was thrown.
-
+
@see wxWindow::HandleWindowEvent
*/
bool SafelyProcessEvent(wxEvent& event);
Searches the event table, executing an event handler function if an appropriate
one
is found.
-
+
@param table
Event table to be searched.
@param event
Event to be matched against an event table entry.
-
+
@returns @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
to find an entry that will match the event.
-
+
@see ProcessEvent()
*/
virtual bool SearchEventTable(wxEventTable& table,
/**
Sets user-supplied client data.
-
+
@param data
Data to be associated with the event handler.
-
+
@remarks Normally, any extra data the programmer wishes to associate with
the object should be made available by deriving a new
class with new data members. You must not call this
method and SetClientObject on the same class - only one
of them.
-
+
@see GetClientData()
*/
void SetClientData(void* data);
/**
Set the client data object. Any previous object will be deleted.
-
+
@see GetClientObject(), wxClientData
*/
void SetClientObject(wxClientData* data);
/**
Enables or disables the event handler.
-
+
@param enabled
@true if the event handler is to be enabled, @false if it is to be disabled.
-
+
@remarks You can use this function to avoid having to remove the event
handler from the chain, for example when implementing a
dialog editor and changing from edit to test mode.
-
+
@see GetEvtHandlerEnabled()
*/
void SetEvtHandlerEnabled(bool enabled);
/**
Sets the pointer to the next handler.
-
+
@param handler
Event handler to be set as the next handler.
-
+
@see GetNextHandler(), SetPreviousHandler(),
GetPreviousHandler(), wxWindow::PushEventHandler,
wxWindow::PopEventHandler
/**
Sets the pointer to the previous handler.
-
+
@param handler
Event handler to be set as the previous handler.
*/
};
+
/**
@class wxIconizeEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- @ref overview_eventhandlingoverview, wxTopLevelWindow::Iconize,
+ @see @ref overview_eventhandlingoverview, wxTopLevelWindow::Iconize,
wxTopLevelWindow::IsIconized
*/
class wxIconizeEvent : public wxEvent
Returns @true if the frame has been iconized, @false if it has been
restored.
*/
- bool Iconized();
+ bool Iconized() const;
};
+
/**
@class wxMoveEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- wxPoint, @ref overview_eventhandlingoverview
+ @see wxPoint, @ref overview_eventhandlingoverview
*/
class wxMoveEvent : public wxEvent
{
/**
Returns the position of the window generating the move change event.
*/
- wxPoint GetPosition();
+ wxPoint GetPosition() const;
};
+
/**
@class wxEvent
@wxheader{event.h}
@library{wxbase}
@category{events}
- @seealso
- wxCommandEvent, wxMouseEvent
+ @see wxCommandEvent, wxMouseEvent
*/
class wxEvent : public wxObject
{
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. All wxWidgets
+ 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 (or some event
derived from them) are ever posted.
implementing the Clone function is to implement a copy constructor for
a new event (call it MyEvent) and then define the Clone function like this:
*/
- virtual wxEvent* Clone();
+ virtual wxEvent* Clone() const;
/**
Returns the object (usually a window) associated with the
/**
Returns the identifier associated with this event, such as a button command id.
*/
- int GetId();
+ int GetId() const;
/**
Returns @true if the event handler should be skipped, @false otherwise.
*/
- bool GetSkipped();
+ bool GetSkipped() const;
/**
Gets the timestamp for the event. The timestamp is the time in milliseconds
wxCommandEvent else it returns @false.
Note: Exists only for optimization purposes.
*/
- bool IsCommandEvent();
+ bool IsCommandEvent() const;
/**
Sets the propagation level to the given value (for example returned from an
Test if this event should be propagated or not, i.e. if the propagation level
is currently greater than 0.
*/
- bool ShouldPropagate();
+ bool ShouldPropagate() const;
/**
This method can be used inside an event handler to control whether further
};
+
/**
@class wxSizeEvent
@wxheader{event.h}
@library{wxcore}
@category{events}
- @seealso
- wxSize, @ref overview_eventhandlingoverview
+ @see wxSize, @ref overview_eventhandlingoverview
*/
class wxSizeEvent : public wxEvent
{
/**
Returns the entire size of the window generating the size change event.
*/
- wxSize GetSize();
+ wxSize GetSize() const;
};
+
/**
@class wxSetCursorEvent
@wxheader{event.h}
@library{wxcore}
@category{FIXME}
- @seealso
- ::wxSetCursor, wxWindow::wxSetCursor
+ @see ::wxSetCursor, wxWindow::wxSetCursor
*/
class wxSetCursorEvent : public wxEvent
{
/**
Returns a reference to the cursor specified by this event.
*/
- wxCursor GetCursor();
+ wxCursor GetCursor() const;
/**
Returns the X coordinate of the mouse in client coordinates.
*/
- wxCoord GetX();
+ wxCoord GetX() const;
/**
Returns the Y coordinate of the mouse in client coordinates.
*/
- wxCoord GetY();
+ wxCoord GetY() const;
/**
Returns @true if the cursor specified by this event is a valid cursor.
-
+
@remarks You cannot specify wxNullCursor with this event, as it is not
considered a valid cursor.
*/
- bool HasCursor();
+ bool HasCursor() const;
/**
Sets the cursor associated with this event.
*/
void SetCursor(const wxCursor& cursor);
};
+
+
+
+/**
+ In a GUI application, this function posts @a event to the specified @e dest
+ object using wxEvtHandler::AddPendingEvent.
+
+ Otherwise, it dispatches @a event immediately using wxEvtHandler::ProcessEvent.
+ See the respective documentation for details (and caveats).
+*/
+void wxPostEvent(wxEvtHandler* dest, wxEvent& event);