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
This commit is contained in:
@@ -580,7 +580,7 @@ protected:
|
|||||||
// a chance to process the message before the frame event handlers are used
|
// a chance to process the message before the frame event handlers are used
|
||||||
bool TryProcessEvent(wxEvent& event)
|
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
|
// called from EVT_CLOSE handler in the frame: check if we can close and do
|
||||||
|
@@ -70,7 +70,7 @@ void wxDocMDIParentFrame::OnMRUFile(wxCommandEvent& event)
|
|||||||
|
|
||||||
bool wxDocMDIParentFrame::TryBefore(wxEvent& event)
|
bool wxDocMDIParentFrame::TryBefore(wxEvent& event)
|
||||||
{
|
{
|
||||||
if ( m_docManager && m_docManager->ProcessEventHere(event) )
|
if ( m_docManager && m_docManager->ProcessEventLocally(event) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return wxMDIParentFrame::TryBefore(event);
|
return wxMDIParentFrame::TryBefore(event);
|
||||||
|
@@ -689,7 +689,7 @@ void wxView::SetDocChildFrame(wxDocChildFrameAnyBase *docChildFrame)
|
|||||||
bool wxView::TryBefore(wxEvent& event)
|
bool wxView::TryBefore(wxEvent& event)
|
||||||
{
|
{
|
||||||
wxDocument * const doc = GetDocument();
|
wxDocument * const doc = GetDocument();
|
||||||
return doc && doc->ProcessEventHere(event);
|
return doc && doc->ProcessEventLocally(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxView::OnActivateView(bool WXUNUSED(activate),
|
void wxView::OnActivateView(bool WXUNUSED(activate),
|
||||||
@@ -1252,7 +1252,7 @@ wxView *wxDocManager::GetActiveView() const
|
|||||||
bool wxDocManager::TryBefore(wxEvent& event)
|
bool wxDocManager::TryBefore(wxEvent& event)
|
||||||
{
|
{
|
||||||
wxView * const view = GetActiveView();
|
wxView * const view = GetActiveView();
|
||||||
return view && view->ProcessEventHere(event);
|
return view && view->ProcessEventLocally(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
@@ -1970,7 +1970,7 @@ void wxDocParentFrame::OnMRUFile(wxCommandEvent& event)
|
|||||||
// Extend event processing to search the view's event table
|
// Extend event processing to search the view's event table
|
||||||
bool wxDocParentFrame::TryBefore(wxEvent& event)
|
bool wxDocParentFrame::TryBefore(wxEvent& event)
|
||||||
{
|
{
|
||||||
if ( m_docManager && m_docManager->ProcessEventHere(event) )
|
if ( m_docManager && m_docManager->ProcessEventLocally(event) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return wxFrame::TryBefore(event);
|
return wxFrame::TryBefore(event);
|
||||||
|
Reference in New Issue
Block a user