Author: jpobst
Date: 2007-09-10 17:19:51 -0400 (Mon, 10 Sep 2007)
New Revision: 85607

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusStrip.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs
Log:
2007-09-10  Jonathan Pobst  <[EMAIL PROTECTED]>

        * StatusStrip.cs: Synchronize SetDisplayedItems with the ToolStrip 
version.
        * ToolStrip.cs: If a ToolStripItem set to not visible is added to a 
ToolStrip,
        don't set it to available.
        * ToolStripItem.cs: When Visible is changed, tell the owner to perform 
a layout.
        [Fixes bug #82727, part II]

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-09-10 21:16:23 UTC (rev 85606)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-09-10 21:19:51 UTC (rev 85607)
@@ -1,5 +1,13 @@
 2007-09-10  Jonathan Pobst  <[EMAIL PROTECTED]>
 
+       * StatusStrip.cs: Synchronize SetDisplayedItems with the ToolStrip 
version.
+       * ToolStrip.cs: If a ToolStripItem set to not visible is added to a 
ToolStrip,
+       don't set it to available.
+       * ToolStripItem.cs: When Visible is changed, tell the owner to perform 
a layout.
+       [Fixes bug #82727, part II]
+
+2007-09-10  Jonathan Pobst  <[EMAIL PROTECTED]>
+
        * StatusStrip.cs: Change item placement to None if not visible.
        * ToolStripItem.cs: Invalidate when InternalVisible changes.
        These should have been committed to fix 82723, but I missed them.

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusStrip.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusStrip.cs   
2007-09-10 21:16:23 UTC (rev 85606)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusStrip.cs   
2007-09-10 21:19:51 UTC (rev 85607)
@@ -247,15 +247,11 @@
                {
                        this.displayed_items.Clear ();
 
-                       foreach (ToolStripItem tsi in this.Items) {
-                               tsi.Parent = this;
-                               
-                               if (tsi.Placement == 
ToolStripItemPlacement.Main) {
+                       foreach (ToolStripItem tsi in this.Items)
+                               if (tsi.Placement == 
ToolStripItemPlacement.Main && tsi.Available) {
                                        this.displayed_items.AddNoOwnerOrLayout 
(tsi);
-                                       tsi.InternalVisible = true;     
-                               } else
-                                       tsi.InternalVisible = false;
-                       }
+                                       tsi.Parent = this;
+                               }
                }
                
                protected override void WndProc (ref Message m)

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs     
2007-09-10 21:16:23 UTC (rev 85606)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs     
2007-09-10 21:19:51 UTC (rev 85607)
@@ -781,7 +781,9 @@
 
                protected internal virtual void OnItemAdded 
(ToolStripItemEventArgs e)
                {
-                       e.Item.Available = true;
+                       if (e.Item.InternalVisible)
+                               e.Item.Available = true;
+                               
                        e.Item.SetPlacement (ToolStripItemPlacement.Main);
                        this.DoAutoSize ();
                        

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs 
2007-09-10 21:16:23 UTC (rev 85606)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs 
2007-09-10 21:19:51 UTC (rev 85607)
@@ -777,6 +777,8 @@
                                if (this.visible != value) {
                                        this.available = value;
                                        this.SetVisibleCore (value);
+                                       if (this.Owner != null)
+                                               this.Owner.PerformLayout ();
                                }
                        }
                }
@@ -1237,12 +1239,12 @@
                {
                        this.visible = visible;
                        this.OnVisibleChanged (EventArgs.Empty);
-                       this.Invalidate ();
                        
                        if (this.visible)
                                BeginAnimation ();
                        else
                                StopAnimation ();
+                       this.Invalidate ();
                }
                #endregion
 

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

Reply via email to