X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a57ac1c418349c0d918588e456e0c8dad00f8eb8..e8c1be041f43e843e0e57cb1591d38664e98d43c:/src/mac/carbon/mdi.cpp diff --git a/src/mac/carbon/mdi.cpp b/src/mac/carbon/mdi.cpp index 158f2df45c..c3951ca0e1 100644 --- a/src/mac/carbon/mdi.cpp +++ b/src/mac/carbon/mdi.cpp @@ -9,18 +9,17 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "mdi.h" -#endif - #include "wx/wxprec.h" #if wxUSE_MDI -#include "wx/mdi.h" -#include "wx/menu.h" -#include "wx/settings.h" -#include "wx/log.h" +#ifndef WX_PRECOMP + #include "wx/mdi.h" + #include "wx/log.h" + #include "wx/menu.h" + #include "wx/settings.h" + #include "wx/statusbr.h" +#endif #include "wx/mac/private.h" #include "wx/mac/uma.h" @@ -135,8 +134,11 @@ void wxMDIParentFrame::AddChild(wxWindowBase *child) { m_currentChild = wxDynamicCast(child, wxMDIChildFrame); - if ( m_currentChild && IsShown() && ShouldBeVisible() ) + if ( m_currentChild && IsShown() && !ShouldBeVisible() ) { + // we shouldn't remain visible any more + wxFrame::Show(false); + m_shouldBeShown = true; } } @@ -287,11 +289,14 @@ bool wxMDIParentFrame::ShouldBeVisible() const node; node = node->GetNext() ) { - if ( !wxDynamicCast(node->GetData(), wxMDIChildFrame) + wxWindow *win = node->GetData(); + + if ( win->IsShown() + && !wxDynamicCast(win, wxMDIChildFrame) #if wxUSE_STATUSBAR - && node->GetData() != GetStatusBar() + && win != GetStatusBar() #endif // wxUSE_STATUSBAR - && node->GetData() != GetClientWindow() ) + && win != GetClientWindow() ) { // if we have a non-MDI child, do remain visible so that it could // be used