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
This commit is contained in:
Václav Slavík
2010-09-14 18:35:50 +00:00
parent 6f7e96d843
commit dc2b49b3d1

View 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;
}
}
}