From 9f6e407c7d555078b6fd2ef62534acfbf9781545 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 22 Jul 2011 12:49:24 +0000 Subject: [PATCH] Don't pass spin text control messages processed at wx level to Windows. Windows messages handled at wx level shouldn't be processed again at Windows level but we always passed the events forwarded by spin control "buddy" text window to its default window proc as we had no way to determine whether they were really handled or not. Now we do have a way to do, by using the newly added MSWHandleMessage(), so only pass the messages to default window proc if they hadn't been handled already. This notably suppresses the annoying beep which happened if Enter key was pressed in a wxSpinCtrl with wxTE_PROCESS_ENTER style (as used by the corresponding wxDataViewCtrl renderer, for example). It probably corrects some other bugs/discrepancies with the other ports in event handling in wxSpinCtrl too. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68328 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/spinctrl.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 19e302e6d4..6cc84eac58 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -119,11 +119,21 @@ LRESULT APIENTRY _EXPORT wxBuddyTextWndProc(HWND hwnd, // is clicked with the "?" cursor case WM_HELP: #endif - spin->MSWWindowProc(message, wParam, lParam); - - // The control may have been deleted at this point, so check. - if ( !::IsWindow(hwnd) ) - return 0; + { + WXLRESULT result; + if ( spin->MSWHandleMessage(&result, message, wParam, lParam) ) + { + // Do not let the message be processed by the window proc + // of the text control if it had been already handled at wx + // level, this is consistent with what happens for normal, + // non-composite controls. + return 0; + } + + // The control may have been deleted at this point, so check. + if ( !::IsWindow(hwnd) ) + return 0; + } break; case WM_GETDLGCODE: -- 2.45.2