FIX: call DismissAndNotify to manual close popup

Change-Id: I395708a98dda390f81d52151c9c52ba367de5a3d
This commit is contained in:
chunmao.guo 2022-08-04 16:25:14 +08:00 committed by Lane.Wei
parent b03a93d7fc
commit 8300c386e0
2 changed files with 4 additions and 11 deletions

View file

@ -3,7 +3,7 @@
#include <wx/dcgraph.h>
BEGIN_EVENT_TABLE(DropDown, wxPanel)
BEGIN_EVENT_TABLE(DropDown, wxPopupTransientWindow)
EVT_LEFT_DOWN(DropDown::mouseDown)
EVT_LEFT_UP(DropDown::mouseReleased)
@ -46,14 +46,6 @@ DropDown::DropDown(wxWindow * parent,
// BBS set default font
SetFont(Label::Body_14);
#ifdef __WXOSX__
Bind(wxEVT_ACTIVATE, [this](auto & e) {
if (!e.GetActive()) {
Hide();
OnDismiss();
}
});
#endif
}
void DropDown::Invalidate(bool clear)
@ -373,6 +365,7 @@ void DropDown::mouseReleased(wxMouseEvent& event)
pressedDown = false;
if (hover_item >= 0) // not moved
sendDropDownEvent();
DismissAndNotify();
}
}