From 1ed403dc4cd40229eec00e5ff2a4771fbb356892 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 12 Jun 2006 23:59:42 +0000 Subject: [PATCH] we don't need to manually propagate wxHelpEvents upwards, they're already wxCommandEvents and so propagate by default git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39688 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/cshelp.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/common/cshelp.cpp b/src/common/cshelp.cpp index efe31c27f4..2a16628047 100644 --- a/src/common/cshelp.cpp +++ b/src/common/cshelp.cpp @@ -223,22 +223,13 @@ bool wxContextHelpEvtHandler::ProcessEvent(wxEvent& event) // Dispatch the help event to the relevant window bool wxContextHelp::DispatchEvent(wxWindow* win, const wxPoint& pt) { - wxWindow* subjectOfHelp = win; - bool eventProcessed = false; - while (subjectOfHelp && !eventProcessed) - { - wxHelpEvent helpEvent(wxEVT_HELP, subjectOfHelp->GetId(), pt, - wxHelpEvent::Origin_HelpButton); - helpEvent.SetEventObject(subjectOfHelp); + wxCHECK_MSG( win, false, _T("win parameter can't be NULL") ); - eventProcessed = win->GetEventHandler()->ProcessEvent(helpEvent); + wxHelpEvent helpEvent(wxEVT_HELP, win->GetId(), pt, + wxHelpEvent::Origin_HelpButton); + helpEvent.SetEventObject(win); - // Go up the window hierarchy until the event is handled (or not). - // I.e. keep submitting ancestor windows until one is recognised - // by the app code that processes the ids and displays help. - subjectOfHelp = subjectOfHelp->GetParent(); - } - return eventProcessed; + return win->GetEventHandler()->ProcessEvent(helpEvent); } // ---------------------------------------------------------------------------- -- 2.45.2