In wxPopupFocusHandler, watch for EVT_CHAR, not EVT_KEY_DOWN.
We should close the popup only if neither of these events was processed; previously, EVT_CHAR would never reach the popup in open state, as it would be closed automatically. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63859 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -86,7 +86,7 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void OnKillFocus(wxFocusEvent& event);
|
void OnKillFocus(wxFocusEvent& event);
|
||||||
void OnKeyDown(wxKeyEvent& event);
|
void OnChar(wxKeyEvent& event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxPopupTransientWindow *m_popup;
|
wxPopupTransientWindow *m_popup;
|
||||||
@@ -105,7 +105,7 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxPopupFocusHandler, wxEvtHandler)
|
BEGIN_EVENT_TABLE(wxPopupFocusHandler, wxEvtHandler)
|
||||||
EVT_KILL_FOCUS(wxPopupFocusHandler::OnKillFocus)
|
EVT_KILL_FOCUS(wxPopupFocusHandler::OnKillFocus)
|
||||||
EVT_KEY_DOWN(wxPopupFocusHandler::OnKeyDown)
|
EVT_CHAR(wxPopupFocusHandler::OnChar)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxPopupTransientWindow, wxPopupWindow)
|
BEGIN_EVENT_TABLE(wxPopupTransientWindow, wxPopupWindow)
|
||||||
@@ -600,7 +600,7 @@ void wxPopupFocusHandler::OnKillFocus(wxFocusEvent& event)
|
|||||||
m_popup->DismissAndNotify();
|
m_popup->DismissAndNotify();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPopupFocusHandler::OnKeyDown(wxKeyEvent& event)
|
void wxPopupFocusHandler::OnChar(wxKeyEvent& event)
|
||||||
{
|
{
|
||||||
// we can be associated with the popup itself in which case we should avoid
|
// we can be associated with the popup itself in which case we should avoid
|
||||||
// infinite recursion
|
// infinite recursion
|
||||||
|
Reference in New Issue
Block a user