]> git.saurik.com Git - wxWidgets.git/commitdiff
In wxPopupFocusHandler, watch for EVT_CHAR, not EVT_KEY_DOWN.
authorVáclav Slavík <vslavik@fastmail.fm>
Mon, 5 Apr 2010 17:18:41 +0000 (17:18 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Mon, 5 Apr 2010 17:18:41 +0000 (17:18 +0000)
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

src/common/popupcmn.cpp

index 65a487e2ded71d1df5d38d781c0ee6f95b6f8781..44eb9c7000ec01d1a08bd18c6d92a17f23f41e45 100644 (file)
@@ -86,7 +86,7 @@ public:
 
 protected:
     void OnKillFocus(wxFocusEvent& event);
-    void OnKeyDown(wxKeyEvent& event);
+    void OnChar(wxKeyEvent& event);
 
 private:
     wxPopupTransientWindow *m_popup;
@@ -105,7 +105,7 @@ END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(wxPopupFocusHandler, wxEvtHandler)
     EVT_KILL_FOCUS(wxPopupFocusHandler::OnKillFocus)
-    EVT_KEY_DOWN(wxPopupFocusHandler::OnKeyDown)
+    EVT_CHAR(wxPopupFocusHandler::OnChar)
 END_EVENT_TABLE()
 
 BEGIN_EVENT_TABLE(wxPopupTransientWindow, wxPopupWindow)
@@ -600,7 +600,7 @@ void wxPopupFocusHandler::OnKillFocus(wxFocusEvent& event)
     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
     // infinite recursion