X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7d671c081808cbafb0dcfb7b36e7e851bb480cb2..b9242cc70049986a7ff1b3c3fedc008d257f490c:/src/mac/carbon/mdi.cpp diff --git a/src/mac/carbon/mdi.cpp b/src/mac/carbon/mdi.cpp index 43681bddfa..248c03e48c 100644 --- a/src/mac/carbon/mdi.cpp +++ b/src/mac/carbon/mdi.cpp @@ -106,8 +106,12 @@ wxMDIParentFrame::~wxMDIParentFrame() { DestroyChildren(); // already delete by DestroyChildren() +#if wxUSE_TOOLBAR m_frameToolBar = NULL; +#endif +#if wxUSE_STATUSBAR m_frameStatusBar = NULL; +#endif m_clientWindow = NULL ; if (m_windowMenu) @@ -229,6 +233,22 @@ void wxMDIParentFrame::ActivatePrevious() // TODO } +bool wxMDIParentFrame::Show( bool show ) +{ + if ( !wxFrame::Show(show) ) + return false; + + // don't really show the MDI frame unless it has any children other than + // MDI children as it is pretty useless in this case + if ( show ) + { + // TODO: check for other children + Move(-10000, -10000); + } + + return true; +} + // Child frame wxMDIChildFrame::wxMDIChildFrame() @@ -258,9 +278,8 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, MacCreateRealWindow( title, pos , size , MacRemoveBordersFromStyle(style) , name ) ; - m_macWindowBackgroundTheme = kThemeBrushDocumentWindowBackground ; - SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ; - + SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE)); + wxModelessWindows.Append(this); return FALSE; } @@ -273,8 +292,12 @@ wxMDIChildFrame::~wxMDIChildFrame() mdiparent->m_currentChild = NULL; DestroyChildren(); // already delete by DestroyChildren() +#if wxUSE_TOOLBAR m_frameToolBar = NULL; +#endif +#if wxUSE_STATUSBAR m_frameStatusBar = NULL; +#endif } void wxMDIChildFrame::SetMenuBar(wxMenuBar *menu_bar) @@ -361,14 +384,8 @@ wxMDIClientWindow::~wxMDIClientWindow() bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style) { - - m_windowId = (int)NewControlId(); - - if ( parent ) - { - parent->AddChild(this); - } - m_backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE); + if ( !wxWindow::Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, style)) + return FALSE; wxModelessWindows.Append(this); return TRUE;