X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5cd2a6aecca03d270ed658192eac197672bdcf24..248eaddf7a14cefa161d514763e8fefb8d6f2f79:/include/wx/event.h diff --git a/include/wx/event.h b/include/wx/event.h index 7e2d8dae3c..7d82d855a3 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -49,6 +49,8 @@ class WXDLLIMPEXP_BASE wxList; class WXDLLIMPEXP_CORE wxWindowBase; #endif // wxUSE_GUI +class WXDLLIMPEXP_BASE wxEvtHandler; + // ---------------------------------------------------------------------------- // Event types // ---------------------------------------------------------------------------- @@ -1857,7 +1859,7 @@ class WXDLLIMPEXP_CORE wxNavigationKeyEvent : public wxEvent public: wxNavigationKeyEvent() : wxEvent(0, wxEVT_NAVIGATION_KEY), - m_flags(IsForward), // defaults are for TAB + m_flags(IsForward | FromTab), // defaults are for TAB m_focus((wxWindow *)NULL) { m_propagationLevel = wxEVENT_PROPAGATE_NONE; @@ -1882,6 +1884,13 @@ public: void SetWindowChange(bool bIs) { if ( bIs ) m_flags |= WinChange; else m_flags &= ~WinChange; } + // Set to true under MSW if the event was generated using the tab key. + // This is required for proper navogation over radio buttons + bool IsFromTab() const + { return (m_flags & FromTab) != 0; } + void SetFromTab(bool bIs) + { if ( bIs ) m_flags |= FromTab; else m_flags &= ~FromTab; } + // the child which has the focus currently (may be NULL - use // wxWindow::FindFocus then) wxWindow* GetCurrentFocus() const { return m_focus; } @@ -1896,7 +1905,8 @@ public: { IsBackward = 0x0000, IsForward = 0x0001, - WinChange = 0x0002 + WinChange = 0x0002, + FromTab = 0x0004 }; long m_flags; @@ -2095,7 +2105,7 @@ private: // event handler and related classes // ============================================================================ -typedef void (wxObject::*wxObjectEventFunction)(wxEvent&); +typedef void (wxEvtHandler::*wxObjectEventFunction)(wxEvent&); // we can't have ctors nor base struct in backwards compatibility mode or // otherwise we won't be able to initialize the objects with an agregate, so @@ -2333,19 +2343,13 @@ public: wxObject *userData = (wxObject *) NULL, wxEvtHandler *eventSink = (wxEvtHandler *) NULL); - bool Disconnect(int winid, + bool Disconnect(int winid = wxID_ANY, wxEventType eventType = wxEVT_NULL, wxObjectEventFunction func = NULL, wxObject *userData = (wxObject *) NULL, wxEvtHandler *eventSink = (wxEvtHandler *) NULL) { return Disconnect(winid, wxID_ANY, eventType, func, userData, eventSink); } - bool Disconnect(wxEventType eventType = wxEVT_NULL, - wxObjectEventFunction func = NULL, - wxObject *userData = (wxObject *) NULL, - wxEvtHandler *eventSink = (wxEvtHandler *) NULL ) - { return Disconnect(wxID_ANY, wxID_ANY, eventType, func, userData, eventSink); } - wxList* GetDynamicEventTable() const { return m_dynamicEvents ; } @@ -2636,9 +2640,9 @@ typedef void (wxEvtHandler::*wxMouseCaptureChangedEventFunction)(wxMouseCaptureC wx__DECLARE_EVT2(event, id1, id2, wxEventHandler(func)) // EVT_COMMAND -#define EVT_COMMAND(winid, event, fn) \ +#define EVT_COMMAND(winid, event, func) \ wx__DECLARE_EVT1(event, winid, wxCommandEventHandler(func)) -#define EVT_COMMAND_RANGE(id1, id2, event, fn) \ +#define EVT_COMMAND_RANGE(id1, id2, event, func) \ wx__DECLARE_EVT2(event, id1, id2, wxCommandEventHandler(func)) #define EVT_NOTIFY(event, winid, func) \