2007-01-29 Jonathan Pobst <monkey@jpobst.com>
authorJonathan Pobst <monkey@jpobst.com>
Mon, 29 Jan 2007 21:34:02 +0000 (21:34 -0000)
committerJonathan Pobst <monkey@jpobst.com>
Mon, 29 Jan 2007 21:34:02 +0000 (21:34 -0000)
* DefaultLayout.cs: MdiClient should always be added last, it should
never Dock:Fill under other controls.  [Fixes a part of bug #80223]

svn path=/trunk/mcs/; revision=71913

mcs/class/Managed.Windows.Forms/System.Windows.Forms.Layout/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms.Layout/DefaultLayout.cs

index e8ca501cf4fa06186aa12a2b70d240583a8fc27d..2b3d1abe69837b3980c7f41aaf72b7992ef2e4f7 100644 (file)
@@ -1,3 +1,8 @@
+2007-01-29  Jonathan Pobst  <monkey@jpobst.com>
+
+       * DefaultLayout.cs: MdiClient should always be added last, it should
+       never Dock:Fill under other controls.  [Fixes a part of bug #80223]
+
 2007-01-20  Jonathan Pobst  <monkey@jpobst.com>
 
        * DefaultLayout.cs: Remove special loop for Dock.Fill and handle
index 77e83ef868005af21764b8ffd6396e06443caebf..72e10be3e61141c7804b44fcc61c3fb6ee0c25b4 100644 (file)
@@ -36,7 +36,8 @@ namespace System.Windows.Forms.Layout
                void LayoutDockedChildren (Control parent, Control[] controls)
                {
                        Rectangle space = parent.DisplayRectangle;
-
+                       MdiClient mdi = null;
+                       
                        // Deal with docking; go through in reverse, MS docs say that lowest Z-order is closest to edge
                        for (int i = controls.Length - 1; i >= 0; i--) {
                                Control child = controls[i];
@@ -45,6 +46,12 @@ namespace System.Windows.Forms.Layout
                                    || child.ControlLayoutType == Control.LayoutType.Anchor)
                                        continue;
 
+                               // MdiClient never fills the whole area like other controls, have to do it later
+                               if (child is MdiClient) {
+                                       mdi = (MdiClient)child;
+                                       continue;
+                               }
+                               
                                switch (child.Dock) {
                                case DockStyle.None:
                                        // Do nothing
@@ -77,6 +84,10 @@ namespace System.Windows.Forms.Layout
                                        break;
                                }
                        }
+
+                       // MdiClient gets whatever space is left
+                       if (mdi != null)
+                               mdi.SetImplicitBounds (space.Left, space.Top, space.Width, space.Height);
                }
 
                void LayoutAnchoredChildren (Control parent, Control[] controls)