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
This commit is contained in:
Vadim Zeitlin
2011-07-22 12:49:24 +00:00
parent 2e1cee233e
commit 9f6e407c7d

View File

@@ -119,11 +119,21 @@ LRESULT APIENTRY _EXPORT wxBuddyTextWndProc(HWND hwnd,
// is clicked with the "?" cursor
case WM_HELP:
#endif
spin->MSWWindowProc(message, wParam, lParam);
{
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;
// The control may have been deleted at this point, so check.
if ( !::IsWindow(hwnd) )
return 0;
}
break;
case WM_GETDLGCODE: