Author: jpobst
Date: 2008-02-07 16:48:22 -0500 (Thu, 07 Feb 2008)
New Revision: 95193

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs
   trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MdiFormTest.cs
Log:
2008-02-07  Jonathan Pobst  <[EMAIL PROTECTED]>

        * MdiClient.cs: Make sure the NormalBounds always gets set.  It
        was being reset by the implicit menu merge for menustrips.
        [Fixes bug #336296]

2008-02-07  Jonathan Pobst  <[EMAIL PROTECTED]>

        * MdiFormTest.cs: Add test for bug #336296.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-02-07 21:34:47 UTC (rev 95192)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-02-07 21:48:22 UTC (rev 95193)
@@ -1,5 +1,11 @@
 2008-02-07  Jonathan Pobst  <[EMAIL PROTECTED]>
 
+       * MdiClient.cs: Make sure the NormalBounds always gets set.  It
+       was being reset by the implicit menu merge for menustrips.
+       [Fixes bug #336296]
+
+2008-02-07  Jonathan Pobst  <[EMAIL PROTECTED]>
+
        * Form.cs: Don't do the previous change when WindowState = Normal,
        or it messes up where the window is placed.  Fixes test failure.
 

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs     
2008-02-07 21:34:47 UTC (rev 95192)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiClient.cs     
2008-02-07 21:48:22 UTC (rev 95193)
@@ -881,15 +881,15 @@
                                ActivateChild (form);
                                return;
                        }
+                               
+                       if (old_window_state == FormWindowState.Normal)
+                               wm.NormalBounds = form.Bounds;
 
                        if (SetWindowStates (wm))
                                return;
 
                        if (old_window_state == new_window_state)
                                return;
-                               
-                       if (old_window_state == FormWindowState.Normal)
-                               wm.NormalBounds = form.Bounds;
 
                        mdiclient_layout = old_window_state == 
FormWindowState.Maximized || new_window_state == FormWindowState.Maximized;
 

Modified: 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog   
2008-02-07 21:34:47 UTC (rev 95192)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog   
2008-02-07 21:48:22 UTC (rev 95193)
@@ -1,5 +1,9 @@
 2008-02-07  Jonathan Pobst  <[EMAIL PROTECTED]>
 
+       * MdiFormTest.cs: Add test for bug #336296.
+
+2008-02-07  Jonathan Pobst  <[EMAIL PROTECTED]>
+
        * MdiFormTest.cs: Add test for bug #325473.
 
 2008-02-06  Jonathan Pobst  <[EMAIL PROTECTED]>

Modified: 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MdiFormTest.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MdiFormTest.cs  
    2008-02-07 21:34:47 UTC (rev 95192)
+++ 
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/MdiFormTest.cs  
    2008-02-07 21:48:22 UTC (rev 95193)
@@ -371,7 +371,40 @@
                        
                        parent.Dispose ();
                }
-               
+
+#if NET_2_0
+               [Test]
+               public void RestoreWithMainMenuStrip ()
+               {
+                       Form parent = new Form ();
+
+                       Form child1 = new Form ();
+
+                       parent.ShowInTaskbar = false;
+                       parent.IsMdiContainer = true;
+                       parent.ClientSize = new Size (500, 500);
+
+                       MenuStrip ms = new MenuStrip ();
+                       ms.Items.Add (new ToolStripMenuItem ("main", null, new 
ToolStripMenuItem ("item1")));
+                       parent.Controls.Add (ms);
+                       parent.MainMenuStrip = ms;
+
+                       parent.Show ();
+
+                       child1.MdiParent = parent;
+                       child1.Show ();
+
+                       Size s = child1.Size;
+                       
+                       child1.WindowState = FormWindowState.Maximized;
+                       child1.WindowState = FormWindowState.Normal;
+
+                       Assert.AreEqual (s, child1.Size, "A1");
+
+                       parent.Dispose ();
+               }
+#endif
+
                /* These tests are all failing on WinXP with XP Theme. 
                 * offset seems to be 22,22 normally, and 22,29 with XP theme.
                 * Find a way to test this reliably.

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

Reply via email to