X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a756f210019dd5b51331b7181c816d3882146a30..205b0c9c6aa69c02a7774846e677910bf1609a53:/src/mac/frame.cpp diff --git a/src/mac/frame.cpp b/src/mac/frame.cpp index 990ba1a514..7f1860a837 100644 --- a/src/mac/frame.cpp +++ b/src/mac/frame.cpp @@ -109,6 +109,7 @@ bool wxFrame::Create(wxWindow *parent, MacCreateRealWindow( title, pos , size , MacRemoveBordersFromStyle(style) , name ) ; m_macWindowBackgroundTheme = kThemeBrushDocumentWindowBackground ; + SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ; wxModelessWindows.Append(this); @@ -131,7 +132,8 @@ bool wxFrame::Enable(bool enable) if ( m_frameMenuBar && m_frameMenuBar == wxMenuBar::MacGetInstalledMenuBar() ) { - for ( int i = 0 ; i < m_frameMenuBar->GetMenuCount() ; ++ i ) + int iMaxMenu = m_frameMenuBar->GetMenuCount(); + for ( int i = 0 ; i < iMaxMenu ; ++ i ) { m_frameMenuBar->EnableTop( i , enable ) ; } @@ -229,9 +231,35 @@ void wxFrame::OnActivate(wxActivateEvent& event) { m_frameMenuBar->MacInstallMenuBar() ; } + else if (wxTheApp->GetTopWindow() && wxTheApp->GetTopWindow()->IsKindOf(CLASSINFO(wxFrame))) + { + // Trying toplevel frame menbar + if( ((wxFrame*)wxTheApp->GetTopWindow())->GetMenuBar() ) + ((wxFrame*)wxTheApp->GetTopWindow())->GetMenuBar()->MacInstallMenuBar(); + } } } +void wxFrame::DetachMenuBar() +{ + if ( m_frameMenuBar ) + { + m_frameMenuBar->UnsetInvokingWindow(); + } + + wxFrameBase::DetachMenuBar(); +} + +void wxFrame::AttachMenuBar( wxMenuBar *menuBar ) +{ + wxFrameBase::AttachMenuBar(menuBar); + + if (m_frameMenuBar) + { + m_frameMenuBar->SetInvokingWindow( this ); + } +} + void wxFrame::DoGetClientSize(int *x, int *y) const { wxWindow::DoGetClientSize( x , y ) ;