+ return wxFrame::SetMenuBar( menu_bar ) ;
+}
+
+void wxMDIChildFrame::MacActivate(long timestamp, bool activating)
+{
+ wxLogDebug("MDI child=%p MacActivate(0x%08lx,%s)",this,timestamp,activating?"ACTIV":"deact");
+ wxMDIParentFrame *mdiparent = wxDynamicCast(m_parent, wxMDIParentFrame);
+ wxASSERT(mdiparent);
+ if(activating)
+ {
+ if(s_macDeactivateWindow == m_parent)
+ {
+ wxLogDebug("parent had been scheduled for deactivation, rehighlighting");
+ UMAHighlightAndActivateWindow((WindowRef)s_macDeactivateWindow->MacGetWindowRef(), true);
+ wxLogDebug("done highliting parent");
+ s_macDeactivateWindow = NULL;
+ }
+ else if((mdiparent->m_currentChild==this) || !s_macDeactivateWindow)
+ mdiparent->wxFrame::MacActivate(timestamp,activating);
+
+ if(mdiparent->m_currentChild && mdiparent->m_currentChild!=this)
+ mdiparent->m_currentChild->wxFrame::MacActivate(timestamp,false);
+ mdiparent->m_currentChild = this;
+
+ if(s_macDeactivateWindow==this)
+ {
+ wxLogDebug("Avoided deactivation/activation of this=%p",this);
+ s_macDeactivateWindow=NULL;
+ }
+ else
+ wxFrame::MacActivate(timestamp, activating);
+ }
+ else
+ {
+ // We were scheduled for deactivation, and now we do it.
+ if(s_macDeactivateWindow==this)
+ {
+ s_macDeactivateWindow = NULL;
+ wxFrame::MacActivate(timestamp,activating);
+ if(mdiparent->m_currentChild==this)
+ mdiparent->wxFrame::MacActivate(timestamp,activating);
+ }
+ else // schedule ourselves for deactivation
+ {
+ if(s_macDeactivateWindow)
+ wxLogDebug("window=%p SHOULD have been deactivated, oh well!",s_macDeactivateWindow);
+ wxLogDebug("Scheduling delayed deactivation");
+ s_macDeactivateWindow = this;
+ }
+ }