From 7fdefd57550305e7e818bd45044331ccdbf18631 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 8 Jul 1998 22:16:19 +0000 Subject: [PATCH] wxNavigationKeyEvent class and corresponding macro added git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@196 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/event.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/wx/event.h b/include/wx/event.h index 55e0d2d0df..cd40b09c4c 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -82,6 +82,7 @@ enum wxEventType { /* Character input event type */ wxEVT_CHAR, + wxEVT_NAVIGATION_KEY, /* * Scrollbar event identifiers @@ -906,6 +907,33 @@ class WXDLLEXPORT wxSysColourChangedEvent: public wxEvent { m_eventType = wxEVT_SYS_COLOUR_CHANGED; } }; +/* + Event generated by dialog navigation keys + wxEVT_NAVIGATION_KEY + */ +// must derive from command event to be propagated to the parent +class WXDLLEXPORT wxNavigationKeyEvent : public wxCommandEvent +{ + DECLARE_DYNAMIC_CLASS(wxNavigationKeyEvent) + +public: + wxNavigationKeyEvent() : wxCommandEvent(wxEVT_NAVIGATION_KEY) { } + + // direction: forward (true) or backward (false) + bool GetDirection() const { return m_commandInt == 1; } + void SetDirection(bool bForward) { m_commandInt = bForward; } + + // it may be a window change event (MDI, notebook pages...) or a control + // change event + bool IsWindowChange() const { return m_extraLong == 1; } + void SetWindowChange(bool bIs) { m_extraLong = bIs; } + + // the child which has the focus currently (may be NULL - use + // wxWindow::FindFocus then) + wxWindow* GetCurrentFocus() const { return (wxWindow *)m_clientData; } + void SetCurrentFocus(wxWindow *win) { m_clientData = (char *)win; } +}; + /* TODO wxEVT_POWER, wxEVT_CREATE, @@ -1067,6 +1095,7 @@ const wxEventTableEntry theClass::sm_eventTableEntries[] = { \ #define EVT_SHOW(func) { wxEVT_SHOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxShowEventFunction) & func, NULL }, #define EVT_MAXIMIZE(func) { wxEVT_MAXIMIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMaximizeEventFunction) & func, NULL }, #define EVT_ICONIZE(func) { wxEVT_ICONIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIconizeEventFunction) & func, NULL }, +#define EVT_NAVIGATION_KEY(func) { wxEVT_NAVIGATION_KEY, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & func, NULL }, // Mouse events #define EVT_LEFT_DOWN(func) { wxEVT_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, NULL },