From 298ca00cdc879c3b040192f1b8b3132fa1d89078 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 19 Feb 2005 21:59:21 +0000 Subject: [PATCH] added wxNavigationEvent::FromTab flag git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/event.h | 12 ++++++++++-- src/msw/window.cpp | 5 ++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/wx/event.h b/include/wx/event.h index 884459101c..7d82d855a3 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; diff --git a/src/msw/window.cpp b/src/msw/window.cpp index d86c3599f1..0cf5f9959c 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1828,7 +1828,8 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) } bool bForward = true, - bWindowChange = false; + bWindowChange = false, + bFromTab = false; // should we process this message specially? bool bProcess = true; @@ -1842,6 +1843,7 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) // Ctrl-Tab cycles thru notebook pages bWindowChange = bCtrlDown; bForward = !bShiftDown; + bFromTab = true; } break; @@ -1966,6 +1968,7 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) wxNavigationKeyEvent event; event.SetDirection(bForward); event.SetWindowChange(bWindowChange); + event.SetFromTab(bFromTab); event.SetEventObject(this); if ( GetEventHandler()->ProcessEvent(event) ) -- 2.45.2