Author: jackson
Date: 2006-07-21 19:45:29 -0400 (Fri, 21 Jul 2006)
New Revision: 62887
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FocusTest.cs
Log:
More testing. This time on the groupbox, which acts as a
container.
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FocusTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FocusTest.cs
2006-07-21 23:20:36 UTC (rev 62886)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FocusTest.cs
2006-07-21 23:45:29 UTC (rev 62887)
@@ -61,6 +61,24 @@
}
}
+ public class GroupBoxPoker: GroupBox {
+
+ public GroupBoxPoker (string s)
+ {
+ Text = s;
+ }
+
+ public void _Select (bool directed, bool forward)
+ {
+ Select (directed, forward);
+ }
+
+ public override string ToString ()
+ {
+ return String.Concat (GetType (), " ", Text);
+ }
+ }
+
[SetUp]
protected virtual void SetUp ()
{
@@ -540,8 +558,30 @@
Assert.AreEqual (flat_controls [0].GetNextControl
(flat_controls [2], true), null, "ctrls-0-7");
Assert.AreEqual (flat_controls [0].GetNextControl
(flat_controls [2], false), null,"ctrls-0-8");
}
-
+
[Test]
+ public void GetNextGroupBoxControlFlat ()
+ {
+ Form form = new Form ();
+ GroupBoxPoker gbp = new GroupBoxPoker ("group-box");
+
+ gbp.Controls.AddRange (flat_controls);
+ form.Controls.Add (gbp);
+ form.Show ();
+
+ Assert.AreEqual (form.GetNextControl (null, true), gbp,
"form-1");
+ Assert.AreEqual (form.GetNextControl (null, false),
flat_controls [2], "form-2");
+
+ Assert.AreEqual (form.GetNextControl (gbp, true),
flat_controls [0], "gb-1");
+ Assert.AreEqual (form.GetNextControl (gbp, false),
null, "gb-2");
+
+ Assert.AreEqual (gbp.GetNextControl (null, true),
flat_controls [0], "gb-3");
+ Assert.AreEqual (gbp.GetNextControl (null, false),
flat_controls [2], "gb-4");
+ Assert.AreEqual (gbp.GetNextControl (gbp, true),
flat_controls [0], "gb-5");
+ Assert.AreEqual (gbp.GetNextControl (gbp, false),
flat_controls [2], "gb-6");
+ }
+
+ [Test]
public void GetNextControlComposite ()
{
Form form = new Form ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches