]> git.saurik.com Git - wxWidgets.git/commitdiff
allow to change the event propagation level (modified patch 743086)
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 18 Jul 2003 00:48:49 +0000 (00:48 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 18 Jul 2003 00:48:49 +0000 (00:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22069 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/wincmn.cpp

index c7c5001fd195d3a138b1bc5798602b19c11d0286..2043e41e43d00e86aa88d3ba75ab8513520757b4 100644 (file)
@@ -2163,10 +2163,9 @@ bool wxWindowBase::TryValidator(wxEvent& event)
 
 bool wxWindowBase::TryParent(wxEvent& event)
 {
-    // Carry on up the parent-child hierarchy, but only if event is a command
-    // event: it wouldn't make sense for a parent to receive a child's size
-    // event, for example
-    if ( event.IsCommandEvent() )
+    // carry on up the parent-child hierarchy if the propgation count hasn't
+    // reached zero yet
+    if ( event.ShouldPropagate() )
     {
         // honour the requests to stop propagation at this window: this is
         // used by the dialogs, for example, to prevent processing the events
@@ -2176,7 +2175,11 @@ bool wxWindowBase::TryParent(wxEvent& event)
         {
             wxWindow *parent = GetParent();
             if ( parent && !parent->IsBeingDeleted() )
+            {
+                wxPropagateOnce propagateOnce(event);
+
                 return parent->GetEventHandler()->ProcessEvent(event);
+            }
         }
     }