+inline bool wxMDIParentFrameBase::TryBefore(wxEvent& event)
+{
+ // Menu (and toolbar) events should be sent to the active child frame
+ // first, if any.
+ if ( event.GetEventType() == wxEVT_MENU ||
+ event.GetEventType() == wxEVT_UPDATE_UI )
+ {
+ wxMDIChildFrame * const child = GetActiveChild();
+ if ( child )
+ {
+ // However avoid sending the event back to the child if it's
+ // currently being propagated to us from it.
+ wxWindow* const
+ from = static_cast<wxWindow*>(event.GetPropagatedFrom());
+ if ( !from || !from->IsDescendant(child) )
+ {
+ if ( child->ProcessWindowEventLocally(event) )
+ return true;
+ }
+ }
+ }
+
+ return wxFrame::TryBefore(event);
+}
+