}
}
#endif
-
+
return pt;
}
void wxFrame::AttachMenuBar( wxMenuBar *menuBar )
{
- wxToplLevelWindowMac* tlw = wxFindWinFromMacWindow(FrontNonFloatingWindow()) ;
+ wxFrame* tlf = wxDynamicCast( wxFindWinFromMacWindow( FrontNonFloatingWindow() ) , wxFrame );
+ bool makeCurrent = false;
- bool makeCurrent = false ;
-
// if this is already the current menubar or we are the frontmost window
- if ( m_frameMenuBar == wxMenuBar::MacGetInstalledMenuBar() || tlw == this )
- makeCurrent = true ;
- // or we have a situation where this is a App Level Menubar like MDI
- else if ( tlw != NULL && tlw->GetMenuBar() == NULL && ((wxFrame*)wxTheApp->GetTopWindow()) == this )
- makeCurrent = true ;
-
- wxFrameBase::AttachMenuBar(menuBar);
+ if ( (tlf == this) || (m_frameMenuBar == wxMenuBar::MacGetInstalledMenuBar()) )
+ makeCurrent = true;
+ // or there is an app-level menubar like MDI
+ else if ( tlf && (tlf->GetMenuBar() == NULL) && (((wxFrame*)wxTheApp->GetTopWindow()) == this) )
+ makeCurrent = true;
+
+ wxFrameBase::AttachMenuBar( menuBar );
if (m_frameMenuBar)
{
m_frameMenuBar->SetInvokingWindow( this );
if (makeCurrent)
- m_frameMenuBar->MacInstallMenuBar() ;
+ m_frameMenuBar->MacInstallMenuBar();
}
}
{
if ( m_frameToolBar == toolbar )
return ;
-
+
#if wxMAC_USE_NATIVE_TOOLBAR
if ( m_frameToolBar )
m_frameToolBar->MacInstallNativeToolbar( false ) ;
}
}
}
+
+void wxFrame::PositionBars()
+{
+#if wxUSE_STATUSBAR
+ PositionStatusBar();
+#endif
+#if wxUSE_TOOLBAR
+ PositionToolBar();
+#endif
+}
+
#endif