Author: rolf
Date: 2006-11-09 07:04:45 -0500 (Thu, 09 Nov 2006)
New Revision: 67590
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBarPanel.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/StatusBarPanelTest.cs
Log:
2006-11-09 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
* StatusBarPanel.cs:
- Width is set to MinWidth if Width is smaller than
MinWidth. Fixes #79842.
- MinWidth now always overrides Width (MSDN says MinWidth
is set to Width when AutoSize = None, but they do not
behave like that).
- Style has now the the correct default value.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-11-09 11:46:10 UTC (rev 67589)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-11-09 12:04:45 UTC (rev 67590)
@@ -1,4 +1,14 @@
- 2006-11-09 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
+2006-11-09 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
+
+ * StatusBarPanel.cs:
+ - Width is set to MinWidth if Width is smaller than
+ MinWidth. Fixes #79842.
+ - MinWidth now always overrides Width (MSDN says MinWidth
+ is set to Width when AutoSize = None, but they do not
+ behave like that).
+ - Style has now the the correct default value.
+
+2006-11-09 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
* TrackBar.cs:
- The control is completely invalidated on
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBarPanel.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBarPanel.cs
2006-11-09 11:46:10 UTC (rev 67589)
+++
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/StatusBarPanel.cs
2006-11-09 12:04:45 UTC (rev 67590)
@@ -45,7 +45,7 @@
private HorizontalAlignment alignment =
HorizontalAlignment.Left;
private StatusBarPanelAutoSize auto_size =
StatusBarPanelAutoSize.None;
private StatusBarPanelBorderStyle border_style =
StatusBarPanelBorderStyle.Sunken;
- private StatusBarPanelStyle style;
+ private StatusBarPanelStyle style = StatusBarPanelStyle.Text;
private int width = 100;
private int twidth = -1;
private int min_width = 10;
@@ -102,8 +102,10 @@
[RefreshProperties(RefreshProperties.All)]
public int MinWidth {
get {
- if (AutoSize == StatusBarPanelAutoSize.None)
- return Width;
+ /*
+ MSDN says that when AutoSize = None then
MinWidth is automatically
+ set to Width, but neither v1.1 nor v2.0 behave
that way.
+ */
return min_width;
}
set {
@@ -127,11 +129,8 @@
if (initializing)
twidth = value;
else
- width = value;
+ SetWidth(value);
- if (min_width > width)
- width = min_width;
-
Invalidate ();
}
}
@@ -189,6 +188,8 @@
internal void SetWidth (int width)
{
this.width = width;
+ if (min_width > this.width)
+ this.width = min_width;
}
public override string ToString ()
@@ -210,7 +211,7 @@
if (!initializing || twidth == -1)
return;
- width = twidth;
+ SetWidth(twidth);
twidth = -1;
initializing = false;
}
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2006-11-09 11:46:10 UTC (rev 67589)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2006-11-09 12:04:45 UTC (rev 67590)
@@ -1,6 +1,7 @@
2006-11-09 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
- * StatusBarPanelTest.cs: Added tests for bug #79842.
+ * StatusBarPanelTest.cs: Added tests for bug #79842
+ and tests for default properties.
2006-11-09 Rolf Bjarne Kvinge <[EMAIL PROTECTED]>
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/StatusBarPanelTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/StatusBarPanelTest.cs
2006-11-09 11:46:10 UTC (rev 67589)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/StatusBarPanelTest.cs
2006-11-09 12:04:45 UTC (rev 67590)
@@ -16,13 +16,10 @@
public class StatusBarPanelTest
{
[Test]
- [ExpectedException (typeof (ArgumentException))]
- [Category ("NotWorking")]
public void MinimumWidth1 ()
{
StatusBarPanel p = new StatusBarPanel ();
Assert.AreEqual (10, p.MinWidth, "1");
- p.Width = 9;
}
[Test]
@@ -52,9 +49,21 @@
p.Width = 50;
p.MinWidth = 100;
Assert.AreEqual (100, p.Width, "#3");
+
+ p = new StatusBarPanel ();
+ p.MinWidth = 200;
+ Assert.AreEqual (200, p.Width, "#4");
}
[Test]
+ public void MinWidth_AutoSize_None ()
+ {
+ StatusBarPanel p = new StatusBarPanel ();
+ p.Width = 50;
+ Assert.AreEqual (10, p.MinWidth, "#1");
+ }
+
+ [Test]
public void ToStringTest ()
{
StatusBarPanel p = new StatusBarPanel ();
@@ -67,5 +76,20 @@
Assert.AreEqual ("StatusBarPanel: {}}", p.ToString(),
"3");
}
+ [Test]
+ public void DefaultPropertiesTest ()
+ {
+ StatusBarPanel p = new StatusBarPanel ();
+ Assert.AreEqual (100, p.Width, "#1");
+ Assert.AreEqual (10, p.MinWidth, "#2");
+ Assert.AreEqual (String.Empty, p.Text, "#3");
+ Assert.AreEqual (HorizontalAlignment.Left, p.Alignment,
"#4");
+ Assert.AreEqual (StatusBarPanelAutoSize.None,
p.AutoSize, "#5");
+ Assert.AreEqual (StatusBarPanelBorderStyle.Sunken,
p.BorderStyle, "#6");
+ Assert.AreEqual (StatusBarPanelStyle.Text, p.Style,
"#7");
+ Assert.AreEqual (String.Empty, p.ToolTipText, "#8");
+
+ }
+
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches