From: Václav Slavík Date: Tue, 14 Sep 2010 18:35:50 +0000 (+0000) Subject: Click on wxOwnerDrawnComboBox's animating popup should close it. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/dc2b49b3d19b9b759fd9c8d7b118c00933f369a8 Click on wxOwnerDrawnComboBox's animating popup should close it. 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 --- diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp index 6c4c8df147..122405a1cd 100644 --- a/src/common/combocmn.cpp +++ b/src/common/combocmn.cpp @@ -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; + } } }