]> git.saurik.com Git - wxWidgets.git/commitdiff
we don't need to manually propagate wxHelpEvents upwards, they're already wxCommandEv...
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 12 Jun 2006 23:59:42 +0000 (23:59 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 12 Jun 2006 23:59:42 +0000 (23:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39688 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/cshelp.cpp

index efe31c27f457a7c58fbdb3870272db0497319739..2a166280478bf2fda69f758d3c1ce53147d4d758 100644 (file)
@@ -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);
 }
 
 // ----------------------------------------------------------------------------