]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/frame.cpp
attempt to recommit , contained binary data for some reason
[wxWidgets.git] / src / mac / frame.cpp
index adc15790af5a511acb22c6768a1ae5fbfcae9e03..7f1860a837a605dfcc91e3e140b98b93ff758e54 100644 (file)
@@ -101,7 +101,7 @@ bool wxFrame::Create(wxWindow *parent,
            long style,
            const wxString& name)
 {
-  SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
+  SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
 
     if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) )
         return FALSE;
@@ -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 ) ;
                }
@@ -170,7 +172,7 @@ void wxFrame::PositionStatusBar()
 // Responds to colour changes, and passes event on to children.
 void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)
 {
-    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_APPWORKSPACE));
+    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
     Refresh();
 
     if ( m_frameStatusBar )
@@ -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 ) ;