Author: everaldo
Date: 2007-04-04 05:01:49 -0400 (Wed, 04 Apr 2007)
New Revision: 75377

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
Log:
        * MenuAPI.cs: 
        - Remove unneeded parameters in UpdateCursor.
        - Fix UpdateCursor to check if menu is active.
        - Call UpdateCursor when menu deactivate my click.
        [Fixes remaining issues from #80410]

2007-04-04  Everaldo Canuto  <[EMAIL PROTECTED]>



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-04 08:29:24 UTC (rev 75376)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-04 09:01:49 UTC (rev 75377)
@@ -1,5 +1,13 @@
 2007-04-04  Everaldo Canuto  <[EMAIL PROTECTED]>
 
+       * MenuAPI.cs: 
+       - Remove unneeded parameters in UpdateCursor.
+       - Fix UpdateCursor to check if menu is active.
+       - Call UpdateCursor when menu deactivate my click.
+       [Fixes remaining issues from #80410]
+
+2007-04-04  Everaldo Canuto  <[EMAIL PROTECTED]>
+
        * Control.cs: GetRealChildAtPoint method added, it make an
        recursive child control search for the point. 
 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs       
2007-04-04 08:29:24 UTC (rev 75376)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs       
2007-04-04 09:01:49 UTC (rev 75377)
@@ -79,11 +79,15 @@
                        return new Point (x, y);
                }       
 
-               private void UpdateCursor (int x, int y)
+               private void UpdateCursor ()
                {
                        Control child_control = 
grab_control.GetRealChildAtPoint (Cursor.Position);
-                       if (child_control != null)
-                               XplatUI.SetCursor(child_control.Handle, 
Cursors.Default.handle);
+                       if (child_control != null) {
+                               if (active)
+                                       XplatUI.SetCursor 
(child_control.Handle, Cursors.Default.handle);
+                               else
+                                       XplatUI.SetCursor 
(child_control.Handle, child_control.Cursor.handle);
+                       }
                }
 
                void Deactivate ()
@@ -162,7 +166,7 @@
                {
                        MenuItem item = GetItemAtXY (args.X, args.Y);
 
-                       UpdateCursor (args.X, args.Y);
+                       UpdateCursor ();
 
                        if (CurrentMenu.SelectedItem == item)
                                return;
@@ -217,8 +221,10 @@
                                return;
                        
                        /* Deactivate the menu when is topmenu and popdown and 
*/
-                       if (((CurrentMenu == TopMenu) && !(CurrentMenu is 
ContextMenu) && popdown_menu) || !item.IsPopup)
+                       if (((CurrentMenu == TopMenu) && !(CurrentMenu is 
ContextMenu) && popdown_menu) || !item.IsPopup) {
                                Deactivate ();
+                               UpdateCursor ();
+                       }
                        
                        /* Perform click when is not a popup */
                        if (!item.IsPopup) {

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

Reply via email to