]> git.saurik.com Git - wxWidgets.git/commitdiff
Pass events around with ProcessEvent(), not AddPendingEvent().
authorVáclav Slavík <vslavik@fastmail.fm>
Mon, 5 Apr 2010 17:18:55 +0000 (17:18 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Mon, 5 Apr 2010 17:18:55 +0000 (17:18 +0000)
The latter adds the event for later processing. As a result, the event
appears to be processed to the caller, even if the handled it was passed
to called Skip() on it. ProcessEvent() doesn't suffer from this problem,
it may modify the event as expected.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63862 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/combocmn.cpp

index ea91647c2c22fc04da9cd9aa225c11b584b6bd1d..05eeb0eb310b8e3b75a05ea1bacefead68e78aeb 100644 (file)
@@ -483,7 +483,7 @@ void wxComboPopupWindowEvtHandler::OnKeyEvent( wxKeyEvent& event )
     wxWindowList children = m_combo->GetPopupWindow()->GetChildren();
     wxWindowList::iterator node = children.begin();
     wxWindow* child = (wxWindow*)*node;
-    child->GetEventHandler()->AddPendingEvent(event);
+    child->GetEventHandler()->ProcessEvent(event);
 }
 
 #if USES_GENERICTLW
@@ -1760,7 +1760,7 @@ void wxComboCtrlBase::HandleNormalMouseEvent( wxMouseEvent& event )
         if ( IsPopupShown() )
         {
             // relay (some) mouse events to the popup
-            m_popup->GetEventHandler()->AddPendingEvent(event);
+            m_popup->GetEventHandler()->ProcessEvent(event);
         }
         else if ( event.GetWheelAxis() == 0 &&
                   event.GetWheelRotation() != 0 &&
@@ -1773,7 +1773,7 @@ void wxComboCtrlBase::HandleNormalMouseEvent( wxMouseEvent& event )
             kevent.m_keyCode = event.GetWheelRotation() > 0
                                ? WXK_UP
                                : WXK_DOWN;
-            GetEventHandler()->AddPendingEvent(kevent);
+            GetEventHandler()->ProcessEvent(kevent);
         }
         else
         {
@@ -1791,7 +1791,7 @@ void wxComboCtrlBase::OnKeyEvent(wxKeyEvent& event)
     if ( IsPopupShown() )
     {
         // pass it to the popped up control
-        GetPopupControl()->GetControl()->GetEventHandler()->AddPendingEvent(event);
+        GetPopupControl()->GetControl()->GetEventHandler()->ProcessEvent(event);
     }
     else // no popup
     {