]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/event.cpp
More richtext fixes for Phoenix
[wxWidgets.git] / src / common / event.cpp
index c35ba60eb87f81a36f49d8e96823552bcf3e6e27..c7d1d33bde6753459de6f61194dfbf8c0db89dc0 100644 (file)
@@ -370,6 +370,7 @@ wxEvent::wxEvent(int theId, wxEventType commandType)
     m_isCommandEvent = false;
     m_propagationLevel = wxEVENT_PROPAGATE_NONE;
     m_wasProcessed = false;
+    m_willBeProcessedAgain = false;
 }
 
 wxEvent::wxEvent(const wxEvent& src)
@@ -384,6 +385,7 @@ wxEvent::wxEvent(const wxEvent& src)
     , m_skipped(src.m_skipped)
     , m_isCommandEvent(src.m_isCommandEvent)
     , m_wasProcessed(false)
+    , m_willBeProcessedAgain(false)
 {
 }
 
@@ -403,6 +405,10 @@ wxEvent& wxEvent::operator=(const wxEvent& src)
 
     // don't change m_wasProcessed
 
+    // While the original again could be passed to another handler, this one
+    // isn't going to be processed anywhere else by default.
+    m_willBeProcessedAgain = false;
+
     return *this;
 }
 
@@ -1428,6 +1434,12 @@ bool wxEvtHandler::TryAfter(wxEvent& event)
     if ( GetNextHandler() )
         return GetNextHandler()->TryAfter(event);
 
+    // If this event is going to be processed in another handler next, don't
+    // pass it to wxTheApp now, it will be done from TryAfter() of this other
+    // handler.
+    if ( event.WillBeProcessedAgain() )
+        return false;
+
 #if WXWIN_COMPATIBILITY_2_8
     // as above, call the old virtual function for compatibility
     return TryParent(event);