Author: jackson
Date: 2006-11-01 16:45:01 -0500 (Wed, 01 Nov 2006)
New Revision: 67248

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
Log:

        * TextControl.cs: When replacing the selection move the
        * selection
        start/end/anchor to the end of the new text.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-11-01 21:27:38 UTC (rev 67247)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-11-01 21:45:01 UTC (rev 67248)
@@ -1,5 +1,10 @@
 2006-11-01  Jackson Harper  <[EMAIL PROTECTED]>
 
+       * TextControl.cs: When replacing the selection move the selection
+       start/end/anchor to the end of the new text.
+
+2006-11-01  Jackson Harper  <[EMAIL PROTECTED]>
+
        * XplatUIWin32.cs: When setting the parent change the controls
        visibility to it's visibility flag, not to it's old parents
        visibility (.Visible walks the parent chain).

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs   
2006-11-01 21:27:38 UTC (rev 67247)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs   
2006-11-01 21:45:01 UTC (rev 67248)
@@ -3312,6 +3312,7 @@
                internal void ReplaceSelection(string s) {
                        int             i;
 
+                       int selection_start_pos = LineTagToCharIndex 
(selection_start.line, selection_start.pos);
                        // First, delete any selected text
                        if ((selection_start.pos != selection_end.pos) || 
(selection_start.line != selection_end.line)) {
                                if (!multiline || (selection_start.line == 
selection_end.line)) {
@@ -3351,13 +3352,19 @@
                                }
                        }
 
-
+                       
                        Insert(selection_start.line, null, selection_start.pos, 
true, s);
 
+                       CharIndexToLineTag(selection_start_pos + s.Length, out 
selection_start.line,
+                                       out selection_start.tag, out 
selection_start.pos);
+                       
                        selection_end.line = selection_start.line;
                        selection_end.pos = selection_start.pos;
                        selection_end.tag = selection_start.tag;
-
+                       selection_anchor.line = selection_start.line;
+                       selection_anchor.pos = selection_start.pos;
+                       selection_anchor.tag = selection_start.tag;
+                       
                        SetSelectionVisible (false);
                }
 

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

Reply via email to