X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/29e92efbe7f6d97ed4c089297228d3475bec5353..b409fa19591179c71e10c6d3c88814f2d96f3af9:/src/mac/carbon/mdi.cpp diff --git a/src/mac/carbon/mdi.cpp b/src/mac/carbon/mdi.cpp index 248c03e48c..fa7f6c0b61 100644 --- a/src/mac/carbon/mdi.cpp +++ b/src/mac/carbon/mdi.cpp @@ -9,10 +9,12 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "mdi.h" #endif +#include "wx/wxprec.h" + #include "wx/mdi.h" #include "wx/menu.h" #include "wx/settings.h" @@ -105,26 +107,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; } @@ -133,6 +119,15 @@ void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar) wxFrame::SetMenuBar( menu_bar ) ; } +void wxMDIParentFrame::GetRectForTopLevelChildren(int *x, int *y, int *w, int *h) +{ + if(x) + *x = 0; + if(y) + *y = 0; + wxDisplaySize(w,h); +} + void wxMDIParentFrame::MacActivate(long timestamp, bool activating) { wxLogDebug(wxT("MDI PARENT=%p MacActivate(0x%08lx,%s)"),this,timestamp,activating?wxT("ACTIV"):wxT("deact")); @@ -235,17 +230,19 @@ void wxMDIParentFrame::ActivatePrevious() 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); + if(!GetToolBar()) + Move(-10000, -10000); } + if ( !wxFrame::Show(show) ) + return false; + return true; } @@ -291,13 +288,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)