From: Vadim Zeitlin Date: Sun, 11 Jun 2006 21:08:53 +0000 (+0000) Subject: don't send wxHelpEvent generated for WM_HELP to all window parents, wxHelpEvent is... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a9c11b71e345859fc8d44e0565c49e90ed3be668?ds=inline don't send wxHelpEvent generated for WM_HELP to all window parents, wxHelpEvent is already propagated upwards implicitely anyhow so in fact we should prevent the default behaviour for it from taking place git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 3fa0e54e5c..c345b326e4 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3000,50 +3000,48 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l #if defined(WM_HELP) case WM_HELP: { - // HELPINFO doesn't seem to be supported on WinCE. + // by default, WM_HELP is propagated by DefWindowProc() upwards + // to the window parent but as we do it ourselves already + // (wxHelpEvent is derived from wxCommandEvent), we don't want + // to get the other events if we process this message at all + processed = true; + + // WM_HELP doesn't use lParam under CE #ifndef __WXWINCE__ HELPINFO* info = (HELPINFO*) lParam; - // Don't yet process menu help events, just windows - if (info->iContextType == HELPINFO_WINDOW) + if ( info->iContextType == HELPINFO_WINDOW ) { -#endif - wxWindowMSW* subjectOfHelp = this; - bool eventProcessed = false; - while (subjectOfHelp && !eventProcessed) - { - wxHelpEvent helpEvent(wxEVT_HELP, - subjectOfHelp->GetId(), +#endif // !__WXWINCE__ + wxHelpEvent helpEvent + ( + wxEVT_HELP, + GetId(), #ifdef __WXWINCE__ - wxPoint(0,0) + wxGetMousePosition(), // what else? #else - wxPoint(info->MousePos.x, info->MousePos.y) + wxPoint(info->MousePos.x, info->MousePos.y) #endif - ); - - helpEvent.SetEventObject(this); - eventProcessed = - GetEventHandler()->ProcessEvent(helpEvent); - - // Go up the window hierarchy until the event is - // handled (or not) - subjectOfHelp = subjectOfHelp->GetParent(); - } + ); - processed = eventProcessed; + helpEvent.SetEventObject(this); + GetEventHandler()->ProcessEvent(helpEvent); #ifndef __WXWINCE__ } - else if (info->iContextType == HELPINFO_MENUITEM) + else if ( info->iContextType == HELPINFO_MENUITEM ) { wxHelpEvent helpEvent(wxEVT_HELP, info->iCtrlId); helpEvent.SetEventObject(this); - processed = GetEventHandler()->ProcessEvent(helpEvent); + GetEventHandler()->ProcessEvent(helpEvent); } - //else: processed is already false -#endif + else // unknown help event? + { + processed = false; + } +#endif // !__WXWINCE__ } break; -#endif +#endif // WM_HELP #if !defined(__WXWINCE__) case WM_CONTEXTMENU: