Kirix Support Forums

Patch to make wxAUI 0.9 work with wxMDIParentFrame

Please post any wxAUI patches or modifications you've created here. Thanks!

Patch to make wxAUI 0.9 work with wxMDIParentFrame

Postby Ben on Sun Jan 01, 2006 12:51 pm

This patch will make wxAUI 0.9 work with wxMDIParentFrame. It works by automatically adding the MDI client window as the center pane when wxFrameManager::SetFrame() is called.


Code: Select all
Index: src/manager.cpp
===================================================================
--- src/manager.cpp   (revision 757)
+++ src/manager.cpp   (working copy)
@@ -901,6 +901,19 @@
{
     m_frame = frame;
     m_frame->PushEventHandler(this);
+
+    // if the owner is going to manage an MDI parent frame,
+    // we need to add the MDI client window as the default
+    // center pane
+
+    if (frame->IsKindOf(CLASSINFO(wxMDIParentFrame)))
+    {
+        wxMDIParentFrame* mdi_frame = (wxMDIParentFrame*)frame;
+       
+        AddPane(mdi_frame->GetClientWindow(),
+                wxPaneInfo().Name(wxT("mdiclient")).
+                CenterPane().PaneBorder(false));
+    }
}


@@ -3139,8 +3152,6 @@
         DoFrameLayout();
         Repaint();
     }
-
-    event.Skip();
}

void wxFrameManager::OnSetCursor(wxSetCursorEvent& event)
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Return to wxAUI Patches & Modifications