diff --git a/include/wx/popupwin.h b/include/wx/popupwin.h index 0bef727d28..63c4d65eea 100644 --- a/include/wx/popupwin.h +++ b/include/wx/popupwin.h @@ -151,9 +151,13 @@ protected: // notify the combo here virtual void OnDismiss(); + // forward the key presses to the combobox + void OnKeyDown(wxKeyEvent& event); + // the parent combobox wxComboControl *m_combo; + DECLARE_EVENT_TABLE() DECLARE_DYNAMIC_CLASS(wxPopupComboWindow) }; diff --git a/src/common/popupcmn.cpp b/src/common/popupcmn.cpp index b1e1eeade7..29fdf03fc8 100644 --- a/src/common/popupcmn.cpp +++ b/src/common/popupcmn.cpp @@ -304,6 +304,10 @@ bool wxPopupTransientWindow::ProcessLeftDown(wxMouseEvent& WXUNUSED(event)) // wxPopupComboWindow // ---------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(wxPopupComboWindow, wxPopupTransientWindow) + EVT_KEY_DOWN(wxPopupComboWindow::OnKeyDown) +END_EVENT_TABLE() + wxPopupComboWindow::wxPopupComboWindow(wxComboControl *parent) : wxPopupTransientWindow(parent) { @@ -341,6 +345,11 @@ void wxPopupComboWindow::OnDismiss() m_combo->OnDismiss(); } +void wxPopupComboWindow::OnKeyDown(wxKeyEvent& event) +{ + m_combo->ProcessEvent(event); +} + #endif // wxUSE_COMBOBOX && defined(__WXUNIVERSAL__) // ----------------------------------------------------------------------------