Author: jpobst
Date: 2007-04-02 17:24:42 -0400 (Mon, 02 Apr 2007)
New Revision: 75312
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
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripPanel.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripSplitStackLayout.cs
Log:
2007-04-02 Jonathan Pobst <[EMAIL PROTECTED]>
* StatusStrip.cs: Layout fixes for PDN.
* ToolStrip.cs: Set item's available to true, and placement to main when
added.
* ToolStripItem.cs: Fix an Available issue, check that Parent is really
changing in setter before doing any work, add InternalVisible.
* ToolStripPanel.cs: Remove unused variable to fix compiler warning.
* ToolStripSplitStackLayout.cs: If we run out of things to hide, don't
infinite loop.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-04-02 21:23:47 UTC (rev 75311)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-04-02 21:24:42 UTC (rev 75312)
@@ -1,3 +1,14 @@
+2007-04-02 Jonathan Pobst <[EMAIL PROTECTED]>
+
+ * StatusStrip.cs: Layout fixes for PDN.
+ * ToolStrip.cs: Set item's available to true, and placement to main when
+ added.
+ * ToolStripItem.cs: Fix an Available issue, check that Parent is really
+ changing in setter before doing any work, add InternalVisible.
+ * ToolStripPanel.cs: Remove unused variable to fix compiler warning.
+ * ToolStripSplitStackLayout.cs: If we run out of things to hide, don't
+ infinite loop.
+
2007-04-02 Jackson Harper <[EMAIL PROTECTED]>
* TextBox.cs: LBUTTON does not make the textbox select all of it's
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusStrip.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusStrip.cs
2007-04-02 21:23:47 UTC (rev 75311)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusStrip.cs
2007-04-02 21:24:42 UTC (rev 75312)
@@ -154,7 +154,8 @@
protected virtual void OnSpringTableLayoutCore ()
{
- this.SetDisplayedItems ();
+ if (!this.Created)
+ return;
ToolStripItemOverflow[] overflow = new
ToolStripItemOverflow[this.Items.Count];
ToolStripItemPlacement[] placement = new
ToolStripItemPlacement[this.Items.Count];
@@ -169,6 +170,7 @@
overflow[i] = tsi.Overflow;
widths[i] = tsi.GetPreferredSize
(proposedSize).Width + tsi.Margin.Horizontal;
placement[i] = tsi.Overflow ==
ToolStripItemOverflow.Always ? ToolStripItemPlacement.None :
ToolStripItemPlacement.Main;
+ placement[i] = tsi.Available ? placement[i] :
ToolStripItemPlacement.None;
total_width += placement[i] ==
ToolStripItemPlacement.Main ? widths[i] : 0;
if (tsi is ToolStripStatusLabel && (tsi as
ToolStripStatusLabel).Spring)
spring_count++;
@@ -198,6 +200,10 @@
removed_one = true;
break;
}
+
+ // There's nothing left to remove, break or we
will loop forever
+ if (!removed_one)
+ break;
}
if (spring_count > 0) {
@@ -226,7 +232,9 @@
}
i++;
- }
+ }
+
+ this.SetDisplayedItems ();
}
protected override void SetDisplayedItems ()
@@ -234,8 +242,11 @@
this.displayed_items.Clear ();
foreach (ToolStripItem tsi in this.Items)
- if (tsi.Available)
+ if (tsi.Placement ==
ToolStripItemPlacement.Main) {
this.displayed_items.AddNoOwnerOrLayout
(tsi);
+ tsi.InternalVisible = true;
+ } else
+ tsi.InternalVisible = false;
}
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-04-02 21:23:47 UTC (rev 75311)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs
2007-04-02 21:24:42 UTC (rev 75312)
@@ -575,6 +575,8 @@
protected internal virtual void OnItemAdded
(ToolStripItemEventArgs e)
{
+ e.Item.Available = true;
+ e.Item.SetPlacement (ToolStripItemPlacement.Main);
this.DoAutoSize ();
this.PerformLayout ();
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs
2007-04-02 21:23:47 UTC (rev 75311)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripItem.cs
2007-04-02 21:24:42 UTC (rev 75312)
@@ -45,6 +45,7 @@
private bool allow_drop;
private ToolStripItemAlignment alignment;
private AnchorStyles anchor;
+ private bool available;
private bool auto_size;
private bool auto_tool_tip;
private Color back_color;
@@ -104,6 +105,7 @@
this.anchor = AnchorStyles.Left | AnchorStyles.Top;
this.auto_size = true;
this.auto_tool_tip = this.DefaultAutoToolTip;
+ this.available = true;
this.back_color = Control.DefaultBackColor;
this.background_image_layout = ImageLayout.Tile;
this.can_select = true;
@@ -249,9 +251,10 @@
[Browsable (false)]
[DesignerSerializationVisibility
(DesignerSerializationVisibility.Hidden)]
public bool Available {
- get { return this.visible; }
+ get { return this.available; }
set {
- if (this.visible != value) {
+ if (this.available != value) {
+ available = value;
visible = value;
if (this.parent != null)
@@ -689,6 +692,7 @@
}
set {
if (this.visible != value) {
+ this.available = value;
this.SetVisibleCore (value);
}
}
@@ -724,9 +728,11 @@
protected internal ToolStrip Parent {
get { return this.parent; }
set {
- ToolStrip old_parent = this.parent;
- this.parent = value;
- OnParentChanged(old_parent, this.parent);
+ if (this.parent != value) {
+ ToolStrip old_parent = this.parent;
+ this.parent = value;
+ OnParentChanged(old_parent,
this.parent);
+ }
}
}
protected internal virtual bool ShowKeyboardCues { get { return
false; } }
@@ -1456,6 +1462,11 @@
this.placement = placement;
}
+ internal bool InternalVisible {
+ get { return this.visible; }
+ set { this.visible = value; }
+ }
+
internal Point Location {
get { return this.bounds.Location; }
set {
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripPanel.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripPanel.cs
2007-04-02 21:23:47 UTC (rev 75311)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripPanel.cs
2007-04-02 21:24:42 UTC (rev 75312)
@@ -308,8 +308,6 @@
}
// Find how big we are so we can autosize ourself
- int height = 0;
-
if (this.rows.Count > 0) {
int last_row_bottom = this.rows[this.rows.Count
- 1].Bounds.Bottom;
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripSplitStackLayout.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripSplitStackLayout.cs
2007-04-02 21:23:47 UTC (rev 75311)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStripSplitStackLayout.cs
2007-04-02 21:24:42 UTC (rev 75312)
@@ -204,6 +204,10 @@
removed_one = true;
break;
}
+
+ // There's nothing left to remove, break or we
will loop forever
+ if (!removed_one)
+ break;
}
i = 0;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches