Author: jpobst
Date: 2007-05-23 16:23:34 -0400 (Wed, 23 May 2007)
New Revision: 77864
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Layout/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Layout/DefaultLayout.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DefaultLayoutTest.cs
Log:
2007-05-23 Jonathan Pobst <[EMAIL PROTECTED]>
* DefaultLayout.cs: Take parent's padding into account when docking
children.
2007-05-23 Jonathan Pobst <[EMAIL PROTECTED]>
* DefaultLayoutTest.cs: Add test for docking when parent has Padding.
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Layout/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Layout/ChangeLog
2007-05-23 20:10:28 UTC (rev 77863)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Layout/ChangeLog
2007-05-23 20:23:34 UTC (rev 77864)
@@ -1,3 +1,8 @@
+2007-05-23 Jonathan Pobst <[EMAIL PROTECTED]>
+
+ * DefaultLayout.cs: Take parent's padding into account when docking
+ children.
+
2007-05-07 Jonathan Pobst <[EMAIL PROTECTED]>
Applying contributed patch from Stefan Noack.
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Layout/DefaultLayout.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Layout/DefaultLayout.cs
2007-05-23 20:10:28 UTC (rev 77863)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.Layout/DefaultLayout.cs
2007-05-23 20:23:34 UTC (rev 77864)
@@ -39,6 +39,13 @@
Rectangle space = parent.DisplayRectangle;
MdiClient mdi = null;
+#if NET_2_0
+ space.X += parent.Padding.Left;
+ space.Y += parent.Padding.Top;
+ space.Width -= parent.Padding.Horizontal;
+ space.Height -= parent.Padding.Vertical;
+#endif
+
// 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];
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2007-05-23 20:10:28 UTC (rev 77863)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2007-05-23 20:23:34 UTC (rev 77864)
@@ -1,3 +1,7 @@
+2007-05-23 Jonathan Pobst <[EMAIL PROTECTED]>
+
+ * DefaultLayoutTest.cs: Add test for docking when parent has Padding.
+
2007-05-23 Everaldo Canuto <[EMAIL PROTECTED]>
* TestHelper.cs: Remove Event log we already have a EventLogger class.
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DefaultLayoutTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DefaultLayoutTest.cs
2007-05-23 20:10:28 UTC (rev 77863)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DefaultLayoutTest.cs
2007-05-23 20:23:34 UTC (rev 77864)
@@ -504,6 +504,25 @@
ResumeLayout (false);
}
}
+
+#if NET_2_0
+ [Test]
+ public void TestDockFillWithPadding ()
+ {
+ Form f = new Form ();
+ f.ShowInTaskbar = false;
+ f.Padding = new Padding (15, 15, 15, 15);
+
+ Control c = new Control ();
+ c.Dock = DockStyle.Fill;
+ f.Controls.Add (c);
+
+ f.Show ();
+ Assert.AreEqual (new Size (f.ClientSize.Width - 30,
f.ClientSize.Height - 30), c.Size, "K1");
+
+ f.Dispose ();
+ }
+#endif
}
[TestFixture]
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches