]> git.saurik.com Git - wxWidgets.git/commitdiff
In wxComboPopupEvtHandler::OnMouseEvent(), when need to relay event to drop-down...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Tue, 1 Jun 2010 15:01:59 +0000 (15:01 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Tue, 1 Jun 2010 15:01:59 +0000 (15:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64457 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/combo.h
src/common/combocmn.cpp

index b991ad7aa95dd0173812796229962aab6d95881b..cfb202be2bb8b874a2ef6a795b870e944d32c372 100644 (file)
@@ -142,6 +142,7 @@ struct wxComboCtrlFeatures
 class WXDLLIMPEXP_CORE wxComboCtrlBase : public wxControl
 {
     friend class wxComboPopup;
+    friend class wxComboPopupEvtHandler;
 public:
     // ctors and such
     wxComboCtrlBase() : wxControl() { Init(); }
index 10e0da7dcdf0b0d017266aeaa975dd4f275741b5..a050bd6cf231cf34ca7692665ad6d944cf8c6777 100644 (file)
@@ -760,6 +760,12 @@ void wxComboPopupEvtHandler::OnMouseEvent( wxMouseEvent& event )
                 // block this one)
                 m_blockEventsToPopup = false;
                 event.Skip(false);
+
+                // Also, this button press was (probably) used to display
+                // the popup, so relay it back to the drop-down button
+                // (which supposedly originated it). This is necessary to
+                // refresh it properly.
+                relayToButton = true;
             }
         }
         else if ( m_blockEventsToPopup )
@@ -789,12 +795,14 @@ void wxComboPopupEvtHandler::OnMouseEvent( wxMouseEvent& event )
 
     if ( relayToButton )
     {
-        wxWindow* eventSink = m_combo;
         wxWindow* btn = m_combo->GetButton();
         if ( btn )
-            eventSink = btn;
-
-        eventSink->GetEventHandler()->ProcessEvent(event);
+            btn->GetEventHandler()->ProcessEvent(event);
+        else
+            // Bypass the event handling mechanism. Using it would be
+            // confusing for the platform-specific wxComboCtrl
+            // implementations.
+            m_combo->HandleButtonMouseEvent(event, 0);
     }
 }