From 443fb14a30532dd49abc3de2e9786176df0e8d30 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 14 Sep 2008 19:56:14 +0000 Subject: [PATCH] only request Enter key for the spin control if it has wxTE_PROCESS_ENTER style [partial backport of r55617 from trunk] git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@55622 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/spinctrl.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 46b0103c1c..371355a336 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -176,8 +176,20 @@ LRESULT APIENTRY _EXPORT wxBuddyTextWndProc(HWND hwnd, break; case WM_GETDLGCODE: - // we want to get WXK_RETURN in order to generate the event for it - return DLGC_WANTALLKEYS; + if ( spin->HasFlag(wxTE_PROCESS_ENTER) ) + { + long dlgCode = ::CallWindowProc + ( + CASTWNDPROC spin->GetBuddyWndProc(), + hwnd, + message, + wParam, + lParam + ); + dlgCode |= DLGC_WANTMESSAGE; + return dlgCode; + } + break; } return ::CallWindowProc(CASTWNDPROC spin->GetBuddyWndProc(),