]> git.saurik.com Git - wxWidgets.git/commitdiff
use wxEvent::ShouldPropagate() instead of its own propgation control mechanism in...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 30 Sep 2003 12:49:56 +0000 (12:49 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 30 Sep 2003 12:49:56 +0000 (12:49 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24010 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/event.h
src/common/containr.cpp

index 884475de28025cea56e6d6174ebd2c2e5bb738d0..3befe6f6137648b7de8f7df755bd2a2ad7e014dc 100644 (file)
@@ -1731,9 +1731,11 @@ class WXDLLIMPEXP_CORE wxNavigationKeyEvent : public wxEvent
 public:
     wxNavigationKeyEvent()
         : wxEvent(0, wxEVT_NAVIGATION_KEY),
-          m_flags(IsForward | Propagate),    // defaults are for TAB
+          m_flags(IsForward),    // defaults are for TAB
           m_focus((wxWindow *)NULL)
-        { }
+        {
+            m_propagationLevel = wxEVENT_PROPAGATE_NONE;
+        }
 
     wxNavigationKeyEvent(const wxNavigationKeyEvent& event)
         : wxEvent(event),
@@ -1754,14 +1756,6 @@ public:
     void SetWindowChange(bool bIs)
         { if ( bIs ) m_flags |= WinChange; else m_flags &= ~WinChange; }
 
-    // some navigation events are meant to be propagated upwards (Windows
-    // convention is to do this for TAB events) while others should always
-    // cycle inside the panel/radiobox/whatever we're current inside
-    bool ShouldPropagate() const
-        { return (m_flags & Propagate) != 0; }
-    void SetPropagate(bool bDoIt)
-        { if ( bDoIt ) m_flags |= Propagate; else m_flags &= ~Propagate; }
-
     // the child which has the focus currently (may be NULL - use
     // wxWindow::FindFocus then)
     wxWindow* GetCurrentFocus() const { return m_focus; }
@@ -1773,8 +1767,7 @@ private:
     enum
     {
         IsForward = 0x0001,
-        WinChange = 0x0002,
-        Propagate = 0x0004
+        WinChange = 0x0002
     };
 
     long m_flags;
index dfb7a123d86a1272de12365436e8c4cdc2d0a4d9..368cee065daaa97b9e30e7b3d0d67dc2c2b8baac 100644 (file)
@@ -293,6 +293,9 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
             // and instead give it to the first/last child depending from which
             // direction we're coming
             event.SetEventObject(m_winParent);
+            // disable propagation for this call as otherwise the event might
+            // bounce back to us.
+            wxPropagationDisabler disableProp(event);
             if ( !child->GetEventHandler()->ProcessEvent(event) )
             {
                 // set it first in case SetFocusFromKbd() results in focus