From 44070fd37901a9fac597314730b55de6b9461382 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 May 2010 14:55:41 +0000 Subject: [PATCH] Use ProcessEventLocally() instead of ProcessEventHere() in docview code. Use wxEvtHandler::ProcessEventLocally() instead of ProcessEventHere() when forwarding events in the docview code. This ensures that any event handlers chained with the objects involved (document manager, document, view) will be used. Incidentally the old code didn't work at all as ProcessEventHere() didn't even call TryBefore() where the (further) forwarding was implemented. Closes #10640. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/docview.h | 2 +- src/common/docmdi.cpp | 2 +- src/common/docview.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/wx/docview.h b/include/wx/docview.h index 6f678c9b29..f8b7ea2cb7 100644 --- a/include/wx/docview.h +++ b/include/wx/docview.h @@ -580,7 +580,7 @@ protected: // a chance to process the message before the frame event handlers are used bool TryProcessEvent(wxEvent& event) { - return m_childView && m_childView->ProcessEventHere(event); + return m_childView && m_childView->ProcessEventLocally(event); } // called from EVT_CLOSE handler in the frame: check if we can close and do diff --git a/src/common/docmdi.cpp b/src/common/docmdi.cpp index c8911d606a..0767a62104 100644 --- a/src/common/docmdi.cpp +++ b/src/common/docmdi.cpp @@ -70,7 +70,7 @@ void wxDocMDIParentFrame::OnMRUFile(wxCommandEvent& event) bool wxDocMDIParentFrame::TryBefore(wxEvent& event) { - if ( m_docManager && m_docManager->ProcessEventHere(event) ) + if ( m_docManager && m_docManager->ProcessEventLocally(event) ) return true; return wxMDIParentFrame::TryBefore(event); diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 64315afb60..335265e02c 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -689,7 +689,7 @@ void wxView::SetDocChildFrame(wxDocChildFrameAnyBase *docChildFrame) bool wxView::TryBefore(wxEvent& event) { wxDocument * const doc = GetDocument(); - return doc && doc->ProcessEventHere(event); + return doc && doc->ProcessEventLocally(event); } void wxView::OnActivateView(bool WXUNUSED(activate), @@ -1252,7 +1252,7 @@ wxView *wxDocManager::GetActiveView() const bool wxDocManager::TryBefore(wxEvent& event) { wxView * const view = GetActiveView(); - return view && view->ProcessEventHere(event); + return view && view->ProcessEventLocally(event); } namespace @@ -1970,7 +1970,7 @@ void wxDocParentFrame::OnMRUFile(wxCommandEvent& event) // Extend event processing to search the view's event table bool wxDocParentFrame::TryBefore(wxEvent& event) { - if ( m_docManager && m_docManager->ProcessEventHere(event) ) + if ( m_docManager && m_docManager->ProcessEventLocally(event) ) return true; return wxFrame::TryBefore(event); -- 2.45.2