[Mono-bugs] [Bug 82575][Nor] Changed - Form: PreferredSize does not return the correct value
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Aug 27 11:45:13 EDT 2007
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by everaldo at simios.org.
http://bugzilla.ximian.com/show_bug.cgi?id=82575
--- shadow/82575 2007-08-27 11:21:45.000000000 -0400
+++ shadow/82575.tmp.23165 2007-08-27 11:45:13.000000000 -0400
@@ -66,6 +66,62 @@
Debug.Assert (PreferredSize == SizeFromClientSize
(preferred_client_size));
Debug.Assert (SizeFromClientSize
(preferred_client_size) != preferred_client_size);
}
}
+
+------- Additional Comments From everaldo at simios.org 2007-08-27 11:45 -------
+So I just added a Console.WriteLine to your program:
+
+using System;
+using System.Diagnostics;
+using System.Drawing;
+using System.Windows.Forms;
+
+class TestForm : Form
+{
+ static void Main ()
+ {
+ new TestForm ();
+ }
+
+ public TestForm ()
+ {
+ AutoSize = true;
+ Control control = new Control ();
+ control.Size = new Size (Width * 2, Height * 2);
+ Controls.Add (control);
+ Size preferred_client_size = new Size (control.Width +
+control.Margin.Right, control.Height + control.Margin.Bottom);
+
+ Console.WriteLine ("> {0} {1}", PreferredSize, SizeFromClientSize
+(preferred_client_size));
+ Console.WriteLine ("> {0} {1}", SizeFromClientSize
+(preferred_client_size), preferred_client_size);
+
+ Debug.Assert (PreferredSize == SizeFromClientSize
+(preferred_client_size));
+ Debug.Assert (SizeFromClientSize (preferred_client_size) !=
+preferred_client_size);
+ }
+}
+
+
+And it gives this results on win32:
+
+
+
+(.net)
+everaldo at windows ~
+$ ./test.exe
+> {Width=611, Height=630} {Width=611, Height=630}
+> {Width=611, Height=630} {Width=603, Height=603}
+
+(mono/win32)
+everaldo at windows ~
+$ mono test.exe
+> {Width=603, Height=603} {Width=611, Height=630}
+> {Width=611, Height=630} {Width=603, Height=603}
+
+
+
More information about the mono-bugs
mailing list