Author: ivanz
Date: 2008-01-18 14:54:37 -0500 (Fri, 18 Jan 2008)
New Revision: 93286

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGridTextBox.cs
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGridView.cs
Log:
2008-01-18  Ivan N. Zlatev  <[EMAIL PROTECTED]>

         * PropertyGridView.cs, PropertyGridTextBox.cs: 
         Drop WM_LBUTTONDOWN msg sending and use focusing instead.
         [Fixes #339005 and #348209]



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-01-18 19:39:40 UTC (rev 93285)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2008-01-18 19:54:37 UTC (rev 93286)
@@ -1,5 +1,11 @@
 2008-01-18  Ivan N. Zlatev  <[EMAIL PROTECTED]>
 
+        * PropertyGridView.cs, PropertyGridTextBox.cs: 
+        Drop WM_LBUTTONDOWN msg sending and use focusing instead.
+        [Fixes #339005 and #348209]
+
+2008-01-18  Ivan N. Zlatev  <[EMAIL PROTECTED]>
+
         * PropertyGridView.cs: Hide the grid text box before adjusting it
         for the newly selected GridItem.
         [Fixes #338999]

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGridTextBox.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGridTextBox.cs
   2008-01-18 19:39:40 UTC (rev 93285)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGridTextBox.cs
   2008-01-18 19:54:37 UTC (rev 93286)
@@ -85,6 +85,8 @@
                        Controls.Add(dropdown_button);
                        Controls.Add(dialog_button);
 
+                       SetStyle (ControlStyles.Selectable, true);
+
                        ResumeLayout(false);
 
                        dropdown_button.Paint+=new 
PaintEventHandler(dropdown_button_Paint);
@@ -95,6 +97,17 @@
                
                #endregion Contructors
 
+               #region Protected Instance Properties
+
+               protected override void OnGotFocus (EventArgs args)
+               {
+                       base.OnGotFocus (args);
+                       textbox.Focus ();
+                       textbox.SelectionLength = 0;
+               }
+
+               #endregion
+
                #region Public Instance Properties
 
                public bool DialogButtonVisible {
@@ -205,27 +218,6 @@
 
                #endregion Private Helper Methods
 
-               internal void SendMouseDown (Point location)
-               {
-                       if (Visible) {
-                               XplatUI.SendMessage (Handle, 
Msg.WM_LBUTTONDOWN, new IntPtr ((int) MsgButtons.MK_LBUTTON), Control.MakeParam 
(location.X, location.Y));
-                                       
-                               if (textbox.Visible) {
-                                       Point pnt = textbox.PointToClient 
(PointToScreen (location));
-
-                                       //
-                                       // Here we have a little problem:
-                                       //      The actual click that causes 
this function to be called, will generate a MOUSE_MOVE message in XplatUIX11 
(sent to the PropertyGrid itself)
-                                       //      This manual button-down message 
will cause an implicit grab to be taken.
-                                       //      Then when the MOUSE_MOVE is 
processed, the message will be sent to the textbox, since it has a grab.
-                                       // So here's the solution: swallow the 
implicit grab.
-                                       textbox.SwallowCapture = true;
-                                       XplatUI.SendMessage (textbox.Handle, 
Msg.WM_LBUTTONDOWN, new IntPtr ((int)MsgButtons.MK_LBUTTON), Control.MakeParam 
(pnt.X, pnt.Y));
-                                       textbox.SwallowCapture = false;
-                               }
-                       }
-               }       
-
                private void textbox_DoubleClick(object sender, EventArgs e) {
                        EventHandler eh = (EventHandler)(Events 
[ToggleValueEvent]);
                        if (eh != null)

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGridView.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGridView.cs  
    2008-01-18 19:39:40 UTC (rev 93285)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/PropertyGridView.cs  
    2008-01-18 19:54:37 UTC (rev 93286)
@@ -273,8 +273,6 @@
                                                        foundItem.Expanded = 
!foundItem.Expanded;
 
                                        this.property_grid.SelectedGridItem = 
foundItem;
-                                       
-                                       grid_textbox.SendMouseDown 
(grid_textbox.PointToClient (PointToScreen (e.Location)));
                                }
                                
                                base.OnMouseDown (e);
@@ -1018,7 +1016,7 @@
                                                ClientRectangle.Width - xloc - 
(vbar.Visible ? vbar.Width : 0),
                                                row_height - 2);
                        grid_textbox.Visible = true;
-
+                       grid_textbox.Select ();
                        ResumeLayout (false);
                }
 

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to