Author: toshok
Date: 2006-12-06 20:18:18 -0500 (Wed, 06 Dec 2006)
New Revision: 69148
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ButtonTest.cs
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormTest.cs
Log:
In Test/System.Windows.Forms:
* FormTest.cs: make sure Form.ImeMode is NoControl by default.
* ButtonTest.cs: add a unit test for Button.DefaultImeMode.
2006-12-06 Chris Toshok <[EMAIL PROTECTED]>
In System.Windows.Forms:
* Form.cs: we don't need to explicitly set ImeMode to
ImeMode.NoControl - that's a natural fallout of Control.ImeMode's
behavior in the face of ImeMode.Inherit.
* ButtonBase.cs: change DefaultImeMode to ImeMode.Disable, and
change the ctor's assignment to use ImeMode instead of ime_mode.
* Control.cs (get_ImeMode): don't assume DefaultImeMode ==
ImeModeInherit. Only check for the parent's imemode (and return
NoControl if there is no parent) if ime_Mode == ImeMode.Inherit.
This fixes the button unit test, which sets both ImeMode and
DefaultImeMode to ImeMode.Disable.
also make the ime_mode field private.
2006-12-06 Chris Toshok <[EMAIL PROTECTED]>
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs
2006-12-07 01:04:29 UTC (rev 69147)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ButtonBase.cs
2006-12-07 01:18:18 UTC (rev 69148)
@@ -136,7 +136,7 @@
image = null;
image_list = null;
image_alignment = ContentAlignment.MiddleCenter;
- ime_mode = ImeMode.Disable;
+ ImeMode = ImeMode.Disable;
text_alignment = ContentAlignment.MiddleCenter;
is_default = false;
is_pressed = false;
@@ -244,13 +244,8 @@
[Browsable(false)]
[EditorBrowsable (EditorBrowsableState.Never)]
public new ImeMode ImeMode {
- get {
- return base.ImeMode;
- }
-
- set {
- base.ImeMode = value;
- }
+ get { return base.ImeMode; }
+ set { base.ImeMode = value; }
}
[Localizable(true)]
@@ -325,9 +320,7 @@
}
protected override ImeMode DefaultImeMode {
- get {
- return ImeMode.Inherit;
- }
+ get { return ImeMode.Disable; }
}
protected override Size DefaultSize {
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-12-07 01:04:29 UTC (rev 69147)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-12-07 01:18:18 UTC (rev 69148)
@@ -1,5 +1,22 @@
2006-12-06 Chris Toshok <[EMAIL PROTECTED]>
+ * Form.cs: we don't need to explicitly set ImeMode to
+ ImeMode.NoControl - that's a natural fallout of Control.ImeMode's
+ behavior in the face of ImeMode.Inherit.
+
+ * ButtonBase.cs: change DefaultImeMode to ImeMode.Disable, and
+ change the ctor's assignment to use ImeMode instead of ime_mode.
+
+ * Control.cs (get_ImeMode): don't assume DefaultImeMode ==
+ ImeModeInherit. Only check for the parent's imemode (and return
+ NoControl if there is no parent) if ime_Mode == ImeMode.Inherit.
+ This fixes the button unit test, which sets both ImeMode and
+ DefaultImeMode to ImeMode.Disable.
+
+ also make the ime_mode field private.
+
+2006-12-06 Chris Toshok <[EMAIL PROTECTED]>
+
* Control.cs: make control_style private.
* TextBoxBase.cs: fix the HandleClick override. it was explicitly
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
2006-12-07 01:04:29 UTC (rev 69147)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
2006-12-07 01:18:18 UTC (rev 69148)
@@ -84,7 +84,7 @@
Size client_size; // size of the client area (window excluding
decorations)
Rectangle client_rect; // rectangle with the client area
(window excluding decorations)
ControlStyles control_style; // rather win32-specific, style
bits for control
- internal ImeMode ime_mode = ImeMode.Inherit;
+ ImeMode ime_mode;
bool layout_pending; // true if our parent needs to re-layout us
object control_tag; // object that contains data about our
control
internal int mouse_clicks; //
Counter for mouse clicks
@@ -722,6 +722,7 @@
dist_top = 0;
dist_bottom = 0;
tab_stop = true;
+ ime_mode = ImeMode.Inherit;
#if NET_2_0
use_compatible_text_rendering =
Application.use_compatible_text_rendering;
@@ -2123,12 +2124,12 @@
[MWFCategory("Behavior")]
public ImeMode ImeMode {
get {
- if (ime_mode == DefaultImeMode) {
+ if (ime_mode == ImeMode.Inherit) {
if (parent != null)
return parent.ImeMode;
else
return ImeMode.NoControl; //
default value
- }
+ }
return ime_mode;
}
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
2006-12-07 01:04:29 UTC (rev 69147)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
2006-12-07 01:18:18 UTC (rev 69148)
@@ -170,7 +170,6 @@
maximize_box = true;
help_button = false;
show_in_taskbar = true;
- ime_mode = ImeMode.NoControl;
is_visible = false;
is_toplevel = true;
size_grip_style = SizeGripStyle.Auto;
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ButtonTest.cs
===================================================================
---
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ButtonTest.cs
2006-12-07 01:04:29 UTC (rev 69147)
+++
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ButtonTest.cs
2006-12-07 01:18:18 UTC (rev 69148)
@@ -57,6 +57,7 @@
Assert.AreEqual (16, B1.ImageList.ImageSize.Width,
"#3g");
}
+
[Test]
public void IMeModeTest ()
{
@@ -120,6 +121,12 @@
public class ButtonInheritorTest : Button {
[Test]
+ public void DefaultImeModeTest ()
+ {
+ Assert.AreEqual (ImeMode.Disable, DefaultImeMode, "1");
+ }
+
+ [Test]
[ExpectedException (typeof (ArgumentNullException))]
public void Constructor_Null ()
{
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2006-12-07 01:04:29 UTC (rev 69147)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
2006-12-07 01:18:18 UTC (rev 69148)
@@ -1,5 +1,11 @@
2006-12-06 Chris Toshok <[EMAIL PROTECTED]>
+ * FormTest.cs: make sure Form.ImeMode is NoControl by default.
+
+ * ButtonTest.cs: add a unit test for Button.DefaultImeMode.
+
+2006-12-06 Chris Toshok <[EMAIL PROTECTED]>
+
* RadioButtonTest.cs: add a couple of test involving TabStop.
2006-12-06 Chris Toshok <[EMAIL PROTECTED]>
Modified:
trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormTest.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormTest.cs
2006-12-07 01:04:29 UTC (rev 69147)
+++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormTest.cs
2006-12-07 01:18:18 UTC (rev 69148)
@@ -72,6 +72,7 @@
Assert.IsFalse (myform.TopMost, "#36");
Assert.AreEqual (Color.Empty, myform.TransparencyKey,
"#37");
Assert.AreEqual (FormWindowState.Normal,
myform.WindowState, "#38");
+ Assert.AreEqual (ImeMode.NoControl, myform.ImeMode,
"#39");
myform.Dispose ();
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches