From cea0b70615e442ca9162def14d92a2777857cd86 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 5 Oct 2002 23:29:40 +0000 Subject: [PATCH] generate TEXT_ENTER event when Enter is pressed in a combobox git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/combobox.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 283eab16ac..129eece661 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -201,6 +201,17 @@ bool wxComboBox::MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam) switch ( msg ) { case WM_CHAR: + // for compatibility with wxTextCtrl, generate a special message + // when Enter is pressed + if ( wParam == VK_RETURN ) + { + wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); + InitCommandEvent(event); + event.SetString(GetValue()); + event.SetInt(GetSelection()); + ProcessCommand(event); + } + return HandleChar(wParam, lParam, TRUE /* isASCII */); case WM_KEYDOWN: