]> git.saurik.com Git - wxWidgets.git/commitdiff
Click on wxOwnerDrawnComboBox's animating popup should close it.
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 14 Sep 2010 18:35:50 +0000 (18:35 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 14 Sep 2010 18:35:50 +0000 (18:35 +0000)
Previously, it behaved differently from native combo box: clicking the
popup while its opening animation was running had no effect. This was
different from the native control, which would close the popup in this
case (just like when it's fully opened).

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

src/common/combocmn.cpp

index 6c4c8df14717ffe983a31c26fbf8aed089505d24..122405a1cdeff8cb4ef2f172eda54fdbf9fb58cb 100644 (file)
@@ -2092,17 +2092,24 @@ void wxComboCtrlBase::OnButtonClick()
 {
     // Derived classes can override this method for totally custom
     // popup action
-    if ( !IsPopupWindowState(Visible) )
+    switch ( GetPopupWindowState() )
     {
-        wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_DROPDOWN, GetId());
-        event.SetEventObject(this);
-        HandleWindowEvent(event);
+        case Hidden:
+        {
+            wxCommandEvent event(wxEVT_COMMAND_COMBOBOX_DROPDOWN, GetId());
+            event.SetEventObject(this);
+            HandleWindowEvent(event);
 
-        ShowPopup();
-    }
-    else
-    {
-        HidePopup(true);
+            ShowPopup();
+            break;
+        }
+
+        case Animating:
+        case Visible:
+        {
+            HidePopup(true);
+            break;
+        }
     }
 }