Author: jpobst
Date: 2007-04-27 12:49:44 -0400 (Fri, 27 Apr 2007)
New Revision: 76392
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.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/ToolStrip.cs
Log:
2007-04-27 Jonathan Pobst <[EMAIL PROTECTED]>
* Application.cs: Need to handle keyboard menu deselection here.
* Control.cs: Use WM_SYSKEYUP instead of WM_SYSCOMMAND to start menu
keyboard
navigation, allowing keyboard to work on X11.
* ToolStrip.cs: Don't worry about handling the Menu key here anymore.
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
2007-04-27 16:20:34 UTC (rev 76391)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Application.cs
2007-04-27 16:49:44 UTC (rev 76392)
@@ -666,6 +666,13 @@
// If we have a control with keyboard
capture (usually a *Strip)
// give it the message, and then drop
the message
if (keyboard_capture != null) {
+ // WM_SYSKEYUP does not make it
into ProcessCmdKey, so do it here
+ if ((Msg)m.Msg ==
Msg.WM_SYSKEYUP)
+ if
(((Keys)m.WParam.ToInt32 () & Keys.Menu) == Keys.Menu) {
+
keyboard_capture.GetTopLevelToolStrip ().Dismiss
(ToolStripDropDownCloseReason.Keyboard);
+ continue;
+ }
+
m.HWnd =
keyboard_capture.Handle;
keyboard_capture.PreProcessMessage (ref m);
continue;
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-04-27 16:20:34 UTC (rev 76391)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-04-27 16:49:44 UTC (rev 76392)
@@ -1,3 +1,10 @@
+2007-04-27 Jonathan Pobst <[EMAIL PROTECTED]>
+
+ * Application.cs: Need to handle keyboard menu deselection here.
+ * Control.cs: Use WM_SYSKEYUP instead of WM_SYSCOMMAND to start menu
keyboard
+ navigation, allowing keyboard to work on X11.
+ * ToolStrip.cs: Don't worry about handling the Menu key here anymore.
+
2007-04-27 Everaldo Canuto <[EMAIL PROTECTED]>
* MenuAPI.cs: When deactivate menu verify if hotkey (_) is active and
redraw
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
2007-04-27 16:20:34 UTC (rev 76391)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs
2007-04-27 16:49:44 UTC (rev 76392)
@@ -4750,14 +4750,6 @@
WmCaptureChanged (ref m);
return;
}
-
-#if NET_2_0
- // The menu button was pressed (the Alt key)
- case Msg.WM_SYSCOMMAND: {
- WmSysCommand (ref m);
- return;
- }
-#endif
default:
DefWndProc(ref m);
@@ -5098,6 +5090,11 @@
if (form != null && form.ActiveMenu != null) {
form.ActiveMenu.ProcessCmdKey(ref m,
(Keys)m.WParam.ToInt32());
}
+#if NET_2_0
+ else
+ if (ToolStripManager.ProcessMenuKey
(ref m))
+ return;
+#endif
}
DefWndProc (ref m);
@@ -5144,16 +5141,6 @@
OnSystemColorsChanged(EventArgs.Empty);
}
-#if NET_2_0
- private void WmSysCommand (ref Message m)
- {
- if (m.WParam == (IntPtr)61696) // SC_KEYMENU (Alt)
- ToolStripManager.ProcessMenuKey (ref m);
- else
- DefWndProc (ref m);
- }
-#endif
-
private void WmSetCursor (ref Message m) {
if ((cursor == null) || ((HitTest)(m.LParam.ToInt32() &
0xffff) != HitTest.HTCLIENT)) {
DefWndProc(ref 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-27 16:20:34 UTC (rev 76391)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ToolStrip.cs
2007-04-27 16:49:44 UTC (rev 76392)
@@ -979,11 +979,6 @@
protected override bool ProcessCmdKey (ref Message msg, Keys
keyData)
{
- if ((keyData & Keys.Alt) == Keys.Alt &&
this.KeyboardActive) {
- this.GetTopLevelToolStrip ().Dismiss
(ToolStripDropDownCloseReason.Keyboard);
- return true;
- }
-
return base.ProcessCmdKey (ref msg, keyData);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches