diff options
author | Peter Dennis Bartok <pbartok@mono-cvs.ximian.com> | 2006-02-28 03:09:01 +0300 |
---|---|---|
committer | Peter Dennis Bartok <pbartok@mono-cvs.ximian.com> | 2006-02-28 03:09:01 +0300 |
commit | 1b88f8ea789ac56f768d9964e64dfd528f524c14 (patch) | |
tree | d1f4114c7800553d385d6b047a21e0ff5048336b /mcs | |
parent | ba62056db0634deb22c521e89307459987beedb9 (diff) |
2006-02-27 Peter Dennis Bartok <pbartok@novell.com>
* Control.cs: Separated special WM_SYSKEYUP keyboard handling. That way
it's easier for a child control to handle the other messages without
having to duplicate the special functionality
* TextBoxBase.cs
- WndProc: Removed calling base handler for WM_KEYDOWN and added
code to handle processing the key ourselves, in order to get
access to the result of KeyEventArgs.Handled. We now only call
ProcessKey if they key hasn't been handled already. Fixes #77526.
- set_Text: If null or empty string is given, just clear the
document. Fixes part of #77526
svn path=/trunk/mcs/; revision=57363
Diffstat (limited to 'mcs')
3 files changed, 37 insertions, 10 deletions
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 304dceb8b6b..835bb1f15cd 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,16 @@ +2006-02-27 Peter Dennis Bartok <pbartok@novell.com> + + * Control.cs: Separated special WM_SYSKEYUP keyboard handling. That way + it's easier for a child control to handle the other messages without + having to duplicate the special functionality + * TextBoxBase.cs + - WndProc: Removed calling base handler for WM_KEYDOWN and added + code to handle processing the key ourselves, in order to get + access to the result of KeyEventArgs.Handled. We now only call + ProcessKey if they key hasn't been handled already. Fixes #77526. + - set_Text: If null or empty string is given, just clear the + document. Fixes part of #77526 + 2006-02-27 Jackson Harper <jackson@ximian.com> * SizeGrip.cs: Paint the background color before painting the grip diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs index 82a058af643..dfb50eaa5ed 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs @@ -3823,17 +3823,13 @@ namespace System.Windows.Forms return; } - case Msg.WM_SYSKEYDOWN: - case Msg.WM_KEYDOWN: - case Msg.WM_SYSKEYUP: - case Msg.WM_KEYUP: - case Msg.WM_SYSCHAR: - case Msg.WM_CHAR: { + case Msg.WM_SYSKEYUP: { if (ProcessKeyMessage(ref m)) { + m.Result = IntPtr.Zero; return; } - if ((m.Msg == (int)Msg.WM_SYSKEYUP) && ((m.WParam.ToInt32() & (int)Keys.KeyCode) == (int)Keys.Menu)) { + if ((m.WParam.ToInt32() & (int)Keys.KeyCode) == (int)Keys.Menu) { Form form; form = FindForm(); @@ -3846,6 +3842,19 @@ namespace System.Windows.Forms return; } + case Msg.WM_SYSKEYDOWN: + case Msg.WM_KEYDOWN: + case Msg.WM_KEYUP: + case Msg.WM_SYSCHAR: + case Msg.WM_CHAR: { + if (ProcessKeyMessage(ref m)) { + m.Result = IntPtr.Zero; + return; + } + DefWndProc (ref m); + return; + } + case Msg.WM_HELP: { Point mouse_pos; if (m.LParam != IntPtr.Zero) { diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs index bf884756d6d..a7f80416f8a 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs @@ -474,7 +474,7 @@ namespace System.Windows.Forms { return; } - if (value != null) { + if ((value != null) && (value != "")) { Line line; if (multiline) { @@ -504,6 +504,8 @@ namespace System.Windows.Forms { document.SetSelectionEnd(line, value.Length); document.PositionCaret(line, value.Length); } + } else { + document.Empty(); } base.Text = value; // Not needed, base.Text already fires it @@ -1128,8 +1130,11 @@ namespace System.Windows.Forms { } case Msg.WM_KEYDOWN: { - base.WndProc(ref m); - ProcessKey((Keys)m.WParam.ToInt32() | XplatUI.State.ModifierKeys); + if (ProcessKeyMessage(ref m) || ProcessKey((Keys)m.WParam.ToInt32() | XplatUI.State.ModifierKeys)) { + m.Result = IntPtr.Zero; + return; + } + DefWndProc (ref m); return; } |