Przeglądaj źródła

* TextControl.cs: These are 1 based.
* TextBoxBase.cs: When setting the selected text, don't change
* the
selected text tags, this is done by ReplaceText, just position
the
cursor at the end of the new text.


svn path=/trunk/mcs/; revision=67417

Jackson Harper 19 lat temu
rodzic
commit
c23ce01853

+ 7 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog

@@ -1,3 +1,10 @@
+2006-11-06  Jackson Harper  <[email protected]>
+
+	* TextControl.cs: These are 1 based.
+	* TextBoxBase.cs: When setting the selected text, don't change the
+	selected text tags, this is done by ReplaceText, just position the
+	cursor at the end of the new text.
+
 2006-11-06  Alexander Olk  <[email protected]>
 
 	* ListView.cs: Allow label edit only when, when LabelEdit is

+ 1 - 2
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs

@@ -435,8 +435,7 @@ namespace System.Windows.Forms {
 			set {
 				if (!read_only) {
 					document.ReplaceSelection(CaseAdjust(value));
-					document.SetSelectionStart(document.caret.line, document.caret.pos);
-					document.SetSelectionEnd(document.caret.line, document.caret.pos);
+					document.PositionCaret (document.selection_end.line, document.selection_end.pos);
 					ScrollToCaret();
 					OnTextChanged(EventArgs.Empty);
 				}

+ 1 - 1
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs

@@ -3362,7 +3362,7 @@ if (owner.backcolor_set || (owner.Enabled && !owner.read_only)) {
 			
 			Insert(selection_start.line, null, selection_start.pos, true, s);
 
-			CharIndexToLineTag(selection_start_pos + s.Length, out selection_start.line,
+			CharIndexToLineTag(selection_start_pos + s.Length + 1, out selection_start.line,
 					out selection_start.tag, out selection_start.pos);
 			
 			selection_end.line = selection_start.line;