Author: jpobst
Date: 2006-11-15 14:17:59 -0500 (Wed, 15 Nov 2006)
New Revision: 67946
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
Log:
2006-11-15 Jonathan Pobst <[EMAIL PROTECTED]>
* Form.cs: Add the released button to MouseEventArgs.Button
for the OnMouseUp call to the MenuTracker. Fixes menu clicking
on Win32.
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-11-15 18:15:53 UTC (rev 67945)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2006-11-15 19:17:59 UTC (rev 67946)
@@ -1,3 +1,9 @@
+2006-11-15 Jonathan Pobst <[EMAIL PROTECTED]>
+
+ * Form.cs: Add the released button to MouseEventArgs.Button
+ for the OnMouseUp call to the MenuTracker. Fixes menu clicking
+ on Win32.
+
2006-11-15 Chris Toshok <[EMAIL PROTECTED]>
* XplatUIX11.cs: add (untested) a _NET_WM_NAME implementation of
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
2006-11-15 18:15:53 UTC (rev 67945)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
2006-11-15 19:17:59 UTC (rev 67946)
@@ -1940,9 +1940,22 @@
case Msg.WM_RBUTTONUP: {
if (XplatUI.IsEnabled (Handle) &&
active_tracker != null) {
MouseEventArgs args;
-
- args = new MouseEventArgs
(FromParamToMouseButtons ((int) m.WParam.ToInt32()),
- mouse_clicks, LowOrder
((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()), 0);
+ MouseButtons mb =
FromParamToMouseButtons ((int) m.WParam.ToInt32());
+
+ // We add in the button that
was released (not sent in WParam)
+ switch((Msg)m.Msg) {
+ case Msg.WM_LBUTTONUP:
+ mb |=
MouseButtons.Left;
+ break;
+ case Msg.WM_MBUTTONUP:
+ mb |=
MouseButtons.Middle;
+ break;
+ case Msg.WM_RBUTTONUP:
+ mb |=
MouseButtons.Right;
+ break;
+ }
+
+ args = new MouseEventArgs (mb,
mouse_clicks, LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int)
m.LParam.ToInt32 ()), 0);
active_tracker.OnMouseUp(new
MouseEventArgs (args.Button, args.Clicks, Control.MousePosition.X,
Control.MousePosition.Y, args.Delta));
mouse_clicks = 1;
return;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches