X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/432968bf3d888547cc88478199cdd9da37109be8..330be5349367f48b25c9f19dbeadd0f30593c830:/include/wx/event.h diff --git a/include/wx/event.h b/include/wx/event.h index 332f501a4d..0165b960e3 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -1859,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; @@ -1884,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; } @@ -1898,7 +1905,8 @@ public: { IsBackward = 0x0000, IsForward = 0x0001, - WinChange = 0x0002 + WinChange = 0x0002, + FromTab = 0x0004 }; long m_flags; @@ -2097,7 +2105,10 @@ private: // event handler and related classes // ============================================================================ -typedef void (wxEvtHandler::*wxObjectEventFunction)(wxEvent&); +// for backwards compatibility and to prevent eVC 4 for ARM from crashing with +// internal compiler error when compiling wx, we define wxObjectEventFunction +// as a wxObject method even though it can only be a wxEvtHandler one +typedef void (wxObject::*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 @@ -2409,8 +2420,14 @@ protected: #if wxUSE_THREADS #if defined (__VISAGECPP__) + const wxCriticalSection& Lock() const { return m_eventsLocker; } + wxCriticalSection& Lock() { return m_eventsLocker; } + wxCriticalSection m_eventsLocker; # else + const wxCriticalSection& Lock() const { return *m_eventsLocker; } + wxCriticalSection& Lock() { return *m_eventsLocker; } + wxCriticalSection* m_eventsLocker; # endif #endif @@ -2632,9 +2649,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) \