]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/tabmdi.cpp
don't provide unnecessary (as default) arguments to wxPen ctor, this incidentally...
[wxWidgets.git] / src / aui / tabmdi.cpp
index b6d33ca85b1e7f0580e55281b8332a65c8d47c34..f5057af3baa1fb2b9b476203bca31ec9be58a6d8 100644 (file)
@@ -110,9 +110,11 @@ bool wxAuiMDIParentFrame::Create(wxWindow *parent,
     }
 #endif // wxUSE_MENUS
 
-    wxFrame::Create(parent, id, title, pos, size, style, name);
-    OnCreateClient();
-    return true;
+    if ( !wxFrame::Create(parent, id, title, pos, size, style, name) )
+        return false;
+
+    m_pClientWindow = OnCreateClient();
+    return m_pClientWindow != NULL;
 }
 
 
@@ -177,12 +179,15 @@ void wxAuiMDIParentFrame::SetChildMenuBar(wxAuiMDIChildFrame* pChild)
     if (!pChild)
     {
         // No Child, set Our menu bar back.
-        SetMenuBar(m_pMyMenuBar);
+        if (m_pMyMenuBar)
+            SetMenuBar(m_pMyMenuBar);
+        else
+            SetMenuBar(GetMenuBar());
 
         // Make sure we know our menu bar is in use
         m_pMyMenuBar = NULL;
     }
-     else
+    else
     {
         if (pChild->GetMenuBar() == NULL)
             return;
@@ -249,8 +254,7 @@ wxAuiMDIClientWindow *wxAuiMDIParentFrame::GetClientWindow() const
 
 wxAuiMDIClientWindow *wxAuiMDIParentFrame::OnCreateClient()
 {
-    m_pClientWindow = new wxAuiMDIClientWindow( this );
-    return m_pClientWindow;
+    return new wxAuiMDIClientWindow( this );
 }
 
 void wxAuiMDIParentFrame::ActivateNext()
@@ -311,7 +315,7 @@ void wxAuiMDIParentFrame::AddWindowMenu(wxMenuBar *pMenuBar)
         int pos = pMenuBar->FindMenu(wxGetStockLabel(wxID_HELP,wxSTOCK_NOFLAGS));
         if (pos == wxNOT_FOUND)
             pMenuBar->Append(m_pWindowMenu, _("&Window"));
-             else
+        else
             pMenuBar->Insert(pos, m_pWindowMenu, _("&Window"));
     }
 }
@@ -363,7 +367,7 @@ void wxAuiMDIParentFrame::Tile(wxOrientation orient)
     {
         client_window->Split(cur_idx, wxLEFT);
     }
-     else if (orient == wxHORIZONTAL)
+    else if (orient == wxHORIZONTAL)
     {
         client_window->Split(cur_idx, wxTOP);
     }
@@ -443,10 +447,10 @@ bool wxAuiMDIChildFrame::Create(wxAuiMDIParentFrame* parent,
 
     // create the window off-screen to prevent flicker
     wxPanel::Create(pClientWindow,
-                   id,
-                   wxPoint(cli_size.x+1, cli_size.y+1),
-                   size,
-                   wxNO_BORDER, name);
+                    id,
+                    wxPoint(cli_size.x+1, cli_size.y+1),
+                    size,
+                    wxNO_BORDER, name);
 
     DoShow(false);