From dc2b49b3d19b9b759fd9c8d7b118c00933f369a8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Tue, 14 Sep 2010 18:35:50 +0000 Subject: [PATCH] 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 --- src/common/combocmn.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) 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; + } } } -- 2.47.2