+bool wxMDIParentFrame::ShouldBeVisible() const
+{
+ for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxWindow *win = node->GetData();
+
+ if ( win->IsShown()
+ && !wxDynamicCast(win, wxMDIChildFrame)
+#if wxUSE_STATUSBAR
+ && win != (wxWindow*) GetStatusBar()
+#endif
+ && win != GetClientWindow() )
+ {
+ // if we have a non-MDI child, do remain visible so that it could
+ // be used
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool wxMDIParentFrame::Show( bool show )
+{
+ m_shouldBeShown = 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 )
+ {
+ if ( !ShouldBeVisible() && m_currentChild )
+ {
+ // don't make the window visible now but remember that we should
+ // have had done it
+ m_shouldBeShown = true;
+
+ return false;
+ }
+ }
+
+ return wxFrame::Show(show);
+}
+
+// ----------------------------------------------------------------------------