Author: pbartok
Date: 2006-08-27 14:43:49 -0400 (Sun, 27 Aug 2006)
New Revision: 64444

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
Log:
2006-08-23  Peter Dennis Bartok  <[EMAIL PROTECTED]>

        * TextControl.cs (Insert): Update the caret position even if we don't
          have a handle yet, just don't call the driver in that case.
        * TextBoxBase.cs (set_SelectedText): Set the Start and End selection
          to the end of the new selection text (Fixes #79184)



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-08-27 18:16:27 UTC (rev 64443)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-08-27 18:43:49 UTC (rev 64444)
@@ -1,3 +1,10 @@
+2006-08-23  Peter Dennis Bartok  <[EMAIL PROTECTED]>
+
+       * TextControl.cs (Insert): Update the caret position even if we don't
+         have a handle yet, just don't call the driver in that case.
+       * TextBoxBase.cs (set_SelectedText): Set the Start and End selection
+         to the end of the new selection text (Fixes #79184)
+
 2006-08-23  Peter Dennis Bartok  <[EMAIL PROTECTED]> 
 
        * Form.cs (Activate): Only activate if the handle is created)

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2006-08-27 18:16:27 UTC (rev 64443)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2006-08-27 18:43:49 UTC (rev 64444)
@@ -432,6 +432,8 @@
                        set {
                                if (!read_only) {
                                        
document.ReplaceSelection(CaseAdjust(value));
+                                       
document.SetSelectionStart(document.caret.line, document.caret.pos);
+                                       
document.SetSelectionEnd(document.caret.line, document.caret.pos);
                                        ScrollToCaret();
                                        OnTextChanged(EventArgs.Empty);
                                }

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs   
2006-08-27 18:16:27 UTC (rev 64443)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs   
2006-08-27 18:43:49 UTC (rev 64444)
@@ -2127,14 +2127,16 @@
 
                        UpdateView(line, insert_lines + 1, pos);
 
-                       if (update_caret && owner.IsHandleCreated) {
+                       if (update_caret) {
                                // Move caret to the end of the inserted text
                                if (insert_lines > 1) {
                                        PositionCaret(GetLine(line.line_no + 
insert_lines - 1), ins[ins.Length - 1].Length);
                                } else {
                                        PositionCaret(line, pos + 
ins[0].Length);
                                }
-                               XplatUI.CaretVisible(owner.Handle, true);
+                               if (owner.IsHandleCreated) {
+                                       XplatUI.CaretVisible(owner.Handle, 
true);
+                               }
                        }
                }
 

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

Reply via email to