Author: everaldo
Date: 2006-11-08 06:12:09 -0500 (Wed, 08 Nov 2006)
New Revision: 67510

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
Log:
Ignore right click for menu actions

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-11-08 08:00:34 UTC (rev 67509)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-11-08 11:12:09 UTC (rev 67510)
@@ -1,5 +1,10 @@
 2006-11-07  Everaldo Canuto  <[EMAIL PROTECTED]>
 
+       * MenuAPI.cs: Ignore right click for menu actions and fixes
+       menu border when clicked.  Fixes #79846.
+
+2006-11-07  Everaldo Canuto  <[EMAIL PROTECTED]>
+
        * XplatUIX11.cs, XplatUIX11.cs: Fix MouseRelease to only release
        MouseState after create wParam for message, this fixes mouse button 
        equal none in mouse up events.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs       
2006-11-08 08:00:34 UTC (rev 67509)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs       
2006-11-08 11:12:09 UTC (rev 67510)
@@ -147,8 +147,10 @@
                        if (item.IsPopup) {
                                active = true;
                                item.Parent.InvalidateItem (item);
-                       } else if (item.Parent is MainMenu)
-                               active = false;
+                       } else if (item.Parent is MainMenu){
+                               active = true;
+                               item.Parent.InvalidateItem (item);
+                       }
                        grab_control.ActiveTracker = this;
                }
 
@@ -170,6 +172,9 @@
 
                public void OnMouseUp (MouseEventArgs args)
                {
+                       if ((args.Button & MouseButtons.Left) == 0)
+                               return;
+                       
                        MenuItem item = GetItemAtXY (args.X, args.Y);
 
                        if (item == null) {
@@ -177,15 +182,13 @@
                                Deactivate ();
                        }
                        else {
-                               /* releasing the mouse button on a
-                                * popup item leaves things active */
-                               if (item.IsPopup && !popdown_menu)
-                                       return;
-
-                               /* otherwise we hide the menu and
-                                * click the menu item */
-                               Deactivate ();
-                               item.PerformClick ();
+                               /* hide the menu when popdown */
+                               if (popdown_menu || !item.IsPopup)
+                                       Deactivate ();
+                               
+                               /* Perform click when is not a popup */
+                               if (!item.IsPopup)
+                                       item.PerformClick ();
                        }
                }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to