From 068b764a5a7cc2929b1fd8ea5643f43b5cbc8762 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 5 Apr 2005 23:33:04 +0000 Subject: [PATCH] move code ignoring VK_SPACE and VK_RETURN WM_CHAR messages to MSWDefWindowProc() from MSWWindowProc(): this allows to catch wxCharEvents for them while still not letting the control have them git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33366 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/treectrl.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 93bdeea6e7..5e49a101c1 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -2517,18 +2517,6 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara } } #endif // !wxUSE_CHECKBOXES_IN_MULTI_SEL_TREE - else if ( nMsg == WM_CHAR ) - { - // don't let the control process Space and Return keys because it - // doesn't do anything useful with them anyhow but always beeps - // annoyingly when it receives them and there is no way to turn it off - // simply if you just process TREEITEM_ACTIVATED event to which Space - // and Enter presses are mapped in your code - if ( wParam == VK_SPACE || wParam == VK_RETURN ) - { - processed = true; - } - } else if ( nMsg == WM_COMMAND ) { // if we receive a EN_KILLFOCUS command from the in-place edit control @@ -2564,6 +2552,17 @@ wxTreeCtrl::MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) if ( nMsg == WM_RBUTTONDOWN ) return 0; + if ( nMsg == WM_CHAR ) + { + // also don't let the control process Space and Return keys because it + // doesn't do anything useful with them anyhow but always beeps + // annoyingly when it receives them and there is no way to turn it off + // simply if you just process TREEITEM_ACTIVATED event to which Space + // and Enter presses are mapped in your code + if ( wParam == VK_SPACE || wParam == VK_RETURN ) + return 0; + } + return wxControl::MSWDefWindowProc(nMsg, wParam, lParam); }