- Add a dummy item to the maximized menu so it always has the
authorJackson Harper <jackson@novell.com>
Fri, 10 Mar 2006 23:34:55 +0000 (23:34 -0000)
committerJackson Harper <jackson@novell.com>
Fri, 10 Mar 2006 23:34:55 +0000 (23:34 -0000)
        correct height. Otherwise when there are no menus we don't get
our
        icon and buttons.

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

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/MdiWindowManager.cs

index 5b11296e016268ec5b0323c88c8a624137fd4027..ef4aa78f56d1d35ef6e890f044dd9bbbff6ca43d 100644 (file)
@@ -4,6 +4,9 @@
        height.
        * MdiWindowManager.cs: Use the MaximizedMenu for calculating
        height.
+       - Add a dummy item to the maximized menu so it always has the
+       correct height. Otherwise when there are no menus we don't get our
+       icon and buttons.
 
 2006-03-10  Jackson Harper  <jackson@ximian.com>
 
index 8e8003ad3ccc4ccd1b603394668d0725626ad025..4d59d561a6b775a398fbc31e36d96048f521a3a4 100644 (file)
@@ -94,6 +94,8 @@ namespace System.Windows.Forms {
                                res.MergeMenu (clone);
                        }
 
+                       res.MenuItems.Add (new MenuItem ()); // Dummy item to get the menu height correct
+                       
                        res.SetForm (parent);
                        return res;
                }
@@ -128,7 +130,7 @@ namespace System.Windows.Forms {
                private void MeasureIconMenuItem (object sender, MeasureItemEventArgs me)
                {
                        Form parent = (Form) mdi_container.Parent;
-                       int size = MaximizedMenu.Height;
+                       int size = MaximizedMenu.MenuItems [0].MenuHeight;
                        me.ItemHeight = size;
                        me.ItemWidth = size + 2; // some padding
                }