Author: everaldo
Date: 2007-04-04 04:29:24 -0400 (Wed, 04 Apr 2007)
New Revision: 75376

Modified:
   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/Form.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs
Log:
2007-04-04  Everaldo Canuto  <[EMAIL PROTECTED]>

        * Control.cs: GetRealChildAtPoint method added, it make an
        recursive child control search for the point. 

        * Form.cs: Makes use of GetRealChildAtPoint in mouse event after closes
        menu.

        * MenuAPI.cs: Makes use of GetRealChildAtPoint in UpdateCursor.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-04 07:33:03 UTC (rev 75375)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-04 08:29:24 UTC (rev 75376)
@@ -1,3 +1,13 @@
+2007-04-04  Everaldo Canuto  <[EMAIL PROTECTED]>
+
+       * Control.cs: GetRealChildAtPoint method added, it make an
+       recursive child control search for the point. 
+
+       * Form.cs: Makes use of GetRealChildAtPoint in mouse event after closes
+       menu.
+
+       * MenuAPI.cs: Makes use of GetRealChildAtPoint in UpdateCursor.
+
 2007-04-03  Everaldo Canuto  <[EMAIL PROTECTED]>
 
        * Form.cs: Fix mouse position when send back mouse event after closes

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-04 07:33:03 UTC (rev 75375)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs       
2007-04-04 08:29:24 UTC (rev 75376)
@@ -3409,6 +3409,23 @@
                        return has_focus;
                }
 
+               internal Control GetRealChildAtPoint (Point pt) {
+                       if (!IsHandleCreated)
+                               CreateHandle ();
+
+                       foreach (Control control in child_controls) {
+                               if (control.Bounds.Contains (PointToClient 
(pt))) {
+                                       Control child = 
control.GetRealChildAtPoint (pt);
+                                       if (child == null)
+                                               return control;
+                                       else
+                                               return child;
+                               }
+                       }
+
+                       return null;
+               }
+
                public Control GetChildAtPoint(Point pt) {
                        // MS's version causes the handle to be created.  The 
stack trace shows that get_Handle is called here, but
                        // we'll just call CreateHandle instead.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2007-04-04 07:33:03 UTC (rev 75375)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs  
2007-04-04 08:29:24 UTC (rev 75376)
@@ -2383,7 +2383,7 @@
                                                                                
                        0);
 
                                                if (!active_tracker.OnMouseDown 
(args)) {
-                                                       Control control = 
this.GetChildAtPoint (PointToClient (Cursor.Position));
+                                                       Control control = 
GetRealChildAtPoint (Cursor.Position);
                                                        if (control != null) {
                                                                Point pt = 
control.PointToClient (Cursor.Position);
                                                                
XplatUI.SendMessage (control.Handle, (Msg) m.Msg, m.WParam, MakeParam (pt.X, 
pt.Y));

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 07:33:03 UTC (rev 75375)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MenuAPI.cs       
2007-04-04 08:29:24 UTC (rev 75376)
@@ -81,9 +81,7 @@
 
                private void UpdateCursor (int x, int y)
                {
-                       Point pt = grab_control.PointToClient (new Point (x, 
y));
-                       
-                       Control child_control = grab_control.GetChildAtPoint 
(pt);
+                       Control child_control = 
grab_control.GetRealChildAtPoint (Cursor.Position);
                        if (child_control != null)
                                XplatUI.SetCursor(child_control.Handle, 
Cursors.Default.handle);
                }

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

Reply via email to