X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/facd6764872eede45605ba7c9dfa0e1d0c708fa2..75a937411ce0aa5856b135f2d0f9406ac83e9cce:/src/mac/carbon/mdi.cpp diff --git a/src/mac/carbon/mdi.cpp b/src/mac/carbon/mdi.cpp index 31d91ad9c8..b009b1ebe6 100644 --- a/src/mac/carbon/mdi.cpp +++ b/src/mac/carbon/mdi.cpp @@ -105,26 +105,10 @@ bool wxMDIParentFrame::Create(wxWindow *parent, wxMDIParentFrame::~wxMDIParentFrame() { DestroyChildren(); - // already delete by DestroyChildren() -#if wxUSE_TOOLBAR - m_frameToolBar = NULL; -#endif -#if wxUSE_STATUSBAR - m_frameStatusBar = NULL; -#endif + // already deleted by DestroyChildren() m_clientWindow = NULL ; - if (m_windowMenu) - { - delete m_windowMenu; - m_windowMenu = (wxMenu*) NULL; - } - - if ( m_clientWindow ) - { - delete m_clientWindow; - m_clientWindow = NULL ; - } + delete m_windowMenu; } @@ -233,6 +217,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() @@ -275,13 +275,6 @@ wxMDIChildFrame::~wxMDIChildFrame() if(mdiparent->m_currentChild == this) 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) @@ -368,14 +361,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;