Author: jpobst
Date: 2007-05-29 12:47:11 -0400 (Tue, 29 May 2007)
New Revision: 78142

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs
   trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs
Log:
2007-05-29  Jonathan Pobst  <[EMAIL PROTECTED]>

        * Control.cs: ResumeLayout(false) should recalculate anchor distances.
        * ScrollableControl.cs: Force an UpdateDistances when we move the
        scrollbars.
        [Fixes bug #80605]

2007-05-29  Jonathan Pobst  <[EMAIL PROTECTED]>

        * ControlTest.cs: Test to show the effects of ResumeLayout(false).

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-05-29 16:46:33 UTC (rev 78141)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-05-29 16:47:11 UTC (rev 78142)
@@ -1,3 +1,10 @@
+2007-05-29  Jonathan Pobst  <[EMAIL PROTECTED]>
+
+       * Control.cs: ResumeLayout(false) should recalculate anchor distances.
+       * ScrollableControl.cs: Force an UpdateDistances when we move the
+       scrollbars.
+       [Fixes bug #80605]
+
 2007-05-29  Andreia Gaita  <[EMAIL PROTECTED]>
 
        * PageSetupDialog.cs: Fix #80728 - Changing the printer doesn't

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-05-29 16:46:33 UTC (rev 78141)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-05-29 16:47:11 UTC (rev 78142)
@@ -608,7 +608,7 @@
                                        for (int i = 0; i < controls.Length; 
i++)
                                                AddImplicit (controls [i]);
                                } finally {
-                                       owner.ResumeLayout ();
+                                       owner.ResumeLayout (false);
                                }
                        }
 
@@ -3917,6 +3917,10 @@
                        }
 
                        if (layout_suspended == 0) {
+                               if (!performLayout)
+                                       foreach (Control c in 
Controls.GetAllControls ())
+                                               c.recalculate_distances = true;
+
                                if (performLayout && layout_pending) {
                                        PerformLayout();
                                }
@@ -4018,6 +4022,8 @@
                        else
                                return;
                        
+                       UpdateDistances ();
+                       
                        if (parent != null)
                                parent.PerformLayout(this, "Bounds");
                }

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs 
    2007-05-29 16:46:33 UTC (rev 78141)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ScrollableControl.cs 
    2007-05-29 16:47:11 UTC (rev 78142)
@@ -864,7 +864,7 @@
 
                        UpdateSizeGripVisible ();
 
-                       ResumeLayout ();
+                       ResumeLayout (false);
                        
                        // We should now scroll the active control into view, 
                        // the funny part is that ScrollableControl does not 
have 

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-29 16:46:33 UTC (rev 78141)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog   
2007-05-29 16:47:11 UTC (rev 78142)
@@ -1,3 +1,7 @@
+2007-05-29  Jonathan Pobst  <[EMAIL PROTECTED]>
+
+       * ControlTest.cs: Test to show the effects of ResumeLayout(false).
+
 2007-05-28  Carlos Alberto Cortez <[EMAIL PROTECTED]>
 
        * ListView.cs:

Modified: 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs  
    2007-05-29 16:46:33 UTC (rev 78141)
+++ 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs  
    2007-05-29 16:47:11 UTC (rev 78142)
@@ -2208,6 +2208,36 @@
                        
                        Assert.AreEqual (f.ClientSize.Width, c.Width, "L1");
                }
+               
+               [Test]
+               public void ResumeLayoutEffects ()
+               {
+                       Form f = new Form ();
+                       f.ShowInTaskbar = false;
+                       f.ClientSize = new Size (300, 300);
+                       
+                       Button button1 = new Button ();
+                       f.Controls.Add (button1);
+                       button1.Anchor = AnchorStyles.Right | 
AnchorStyles.Bottom;
+                       button1.Location = new Point (f.ClientSize.Width - 
button1.Width, f.ClientSize.Height - button1.Height);
+
+                       f.Show ();
+                       
+                       Assert.AreEqual (new Point (225, 277), 
button1.Location, "A1");
+                       
+                       f.SuspendLayout ();
+                       f.Height += 10;
+                       f.ResumeLayout (false);
+                       f.PerformLayout ();
+
+                       Assert.AreEqual (new Point (225, 277), 
button1.Location, "A2");
+
+                       f.SuspendLayout ();
+                       f.Height += 10;
+                       f.ResumeLayout ();
+
+                       Assert.AreEqual (new Point (225, 287), 
button1.Location, "A3");
+               }
        }
 
        [TestFixture]

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to