override TryValidator() in wxMDIParentFrame to implement forwarding of menu/toolbar events to the active child at wx level instead of forwarding the WM_COMMAND itself: this is better as it prevents the same event from being passed twice to wxApp fall back if a handler exists in the child frame but skips the event and also because the code is portable now and can be moved down to the base class; also call the base class TryValidator() from wxDocMDI classes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59162 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -70,7 +70,10 @@ void wxDocMDIParentFrame::OnMRUFile(wxCommandEvent& event)
|
||||
|
||||
bool wxDocMDIParentFrame::TryValidator(wxEvent& event)
|
||||
{
|
||||
return m_docManager && m_docManager->ProcessEventHere(event);
|
||||
if ( m_docManager && m_docManager->ProcessEventHere(event) )
|
||||
return true;
|
||||
|
||||
return wxMDIParentFrame::TryValidator(event);
|
||||
}
|
||||
|
||||
void wxDocMDIParentFrame::OnCloseWindow(wxCloseEvent& event)
|
||||
@@ -135,7 +138,10 @@ wxDocMDIChildFrame::~wxDocMDIChildFrame(void)
|
||||
|
||||
bool wxDocMDIChildFrame::TryValidator(wxEvent& event)
|
||||
{
|
||||
return m_childView && m_childView->ProcessEventHere(event);
|
||||
if ( m_childView && m_childView->ProcessEventHere(event) )
|
||||
return true;
|
||||
|
||||
return wxMDIChildFrame::TryValidator(event);
|
||||
}
|
||||
|
||||
void wxDocMDIChildFrame::OnActivate(wxActivateEvent& event)
|
||||
|
||||
Reference in New Issue
Block a user