diff --git a/FastColoredTextBox/AutocompleteItem.cs b/FastColoredTextBox/AutocompleteItem.cs index 59feec4d..1b2ee9e0 100644 --- a/FastColoredTextBox/AutocompleteItem.cs +++ b/FastColoredTextBox/AutocompleteItem.cs @@ -181,11 +181,11 @@ public override void OnSelected(AutocompleteMenu popupMenu, SelectedEventArgs e) { for (int iLine = p1.iLine + 1; iLine <= p2.iLine; iLine++) { - e.Tb.Selection.Start = new Place(0, iLine); + e.Tb.Selection.SetStartAndEnd(new Place(0, iLine)); e.Tb.DoAutoIndent(iLine); } } - e.Tb.Selection.Start = p1; + e.Tb.Selection.SetStartAndEnd(p1); //move caret position right and find char ^ while (e.Tb.Selection.CharBeforeStart != '^') if (!e.Tb.Selection.GoRightThroughFolded()) diff --git a/FastColoredTextBox/Bookmarks.cs b/FastColoredTextBox/Bookmarks.cs index ad220d98..98b8ef04 100644 --- a/FastColoredTextBox/Bookmarks.cs +++ b/FastColoredTextBox/Bookmarks.cs @@ -231,7 +231,7 @@ public class Bookmark /// public virtual void DoVisible() { - TB.Selection.Start = new Place(0, LineIndex); + TB.Selection.SetStartAndEnd(new Place(0, LineIndex)); TB.DoRangeVisible(TB.Selection, true); TB.Invalidate(); } diff --git a/FastColoredTextBox/Commands.cs b/FastColoredTextBox/Commands.cs index c83ac962..885354a5 100644 --- a/FastColoredTextBox/Commands.cs +++ b/FastColoredTextBox/Commands.cs @@ -33,7 +33,7 @@ public override void Undo() case '\n': MergeLines(sel.Start.iLine, ts); break; case '\r': break; case '\b': - ts.CurrentTB.Selection.Start = lastSel.Start; + ts.CurrentTB.Selection.SetStartAndEnd(lastSel.Start); char cc = '\x0'; if (deletedChar != '\x0') { @@ -45,12 +45,12 @@ public override void Undo() ts.CurrentTB.ExpandBlock(sel.Start.iLine); for (int i = sel.FromX; i < lastSel.FromX; i++) ts[sel.Start.iLine].RemoveAt(sel.Start.iChar); - ts.CurrentTB.Selection.Start = sel.Start; + ts.CurrentTB.Selection.SetStartAndEnd(sel.Start); break; default: ts.CurrentTB.ExpandBlock(sel.Start.iLine); ts[sel.Start.iLine].RemoveAt(sel.Start.iChar); - ts.CurrentTB.Selection.Start = sel.Start; + ts.CurrentTB.Selection.SetStartAndEnd(sel.Start); break; } @@ -112,7 +112,7 @@ internal static void InsertChar(char c, ref char deletedChar, TextSource ts) { deletedChar = ts[tb.Selection.Start.iLine][tb.Selection.Start.iChar - 1].c; ts[tb.Selection.Start.iLine].RemoveAt(tb.Selection.Start.iChar - 1); - tb.Selection.Start = new Place(tb.Selection.Start.iChar - 1, tb.Selection.Start.iLine); + tb.Selection.SetStartAndEnd(new Place(tb.Selection.Start.iChar - 1, tb.Selection.Start.iLine)); } break; case '\t': @@ -123,11 +123,11 @@ internal static void InsertChar(char c, ref char deletedChar, TextSource ts) for (int i = 0; i < spaceCountNextTabStop; i++) ts[tb.Selection.Start.iLine].Insert(tb.Selection.Start.iChar, new Char(' ')); - tb.Selection.Start = new Place(tb.Selection.Start.iChar + spaceCountNextTabStop, tb.Selection.Start.iLine); + tb.Selection.SetStartAndEnd(new Place(tb.Selection.Start.iChar + spaceCountNextTabStop, tb.Selection.Start.iLine)); break; default: ts[tb.Selection.Start.iLine].Insert(tb.Selection.Start.iChar, new Char(c)); - tb.Selection.Start = new Place(tb.Selection.Start.iChar + 1, tb.Selection.Start.iLine); + tb.Selection.SetStartAndEnd(new Place(tb.Selection.Start.iChar + 1, tb.Selection.Start.iLine)); break; } } @@ -144,7 +144,7 @@ internal static void InsertLine(TextSource ts) else BreakLines(tb.Selection.Start.iLine, tb.Selection.Start.iChar, ts); - tb.Selection.Start = new Place(0, tb.Selection.Start.iLine + 1); + tb.Selection.SetStartAndEnd(new Place(0, tb.Selection.Start.iLine + 1)); ts.NeedRecalc(new TextSource.TextChangedEventArgs(0, 1)); } @@ -172,7 +172,7 @@ internal static void MergeLines(int i, TextSource ts) ts[i].AddRange(ts[i + 1]); ts.RemoveLine(i + 1); } - tb.Selection.Start = new Place(pos, i); + tb.Selection.SetStartAndEnd(new Place(pos, i)); ts.NeedRecalc(new TextSource.TextChangedEventArgs(0, 1)); } @@ -238,11 +238,11 @@ internal static void InsertText(string insertedText, TextSource ts) { tb.Selection.BeginUpdate(); char cc = '\x0'; - + if (ts.Count == 0) { InsertCharCommand.InsertLine(ts); - tb.Selection.Start = Place.Empty; + tb.Selection.SetStartAndEnd(Place.Empty); } tb.ExpandBlock(tb.Selection.Start.iLine); var len = insertedText.Length; @@ -311,7 +311,7 @@ public override void Undo() tb.Selection.BeginUpdate(); for (int i = 0; i public override void Undo() { - ts.CurrentTB.Selection.Start = new Place(sel.FromX, Math.Min(sel.Start.iLine, sel.End.iLine)); + ts.CurrentTB.Selection.SetStartAndEnd(new Place(sel.FromX, Math.Min(sel.Start.iLine, sel.End.iLine))); ts.OnTextChanging(); InsertTextCommand.InsertText(deletedText, ts); ts.OnTextChanged(sel.Start.iLine, sel.End.iLine); @@ -455,7 +455,7 @@ internal static void ClearSelected(TextSource ts) InsertCharCommand.MergeLines(fromLine, ts); } // - tb.Selection.Start = new Place(fromChar, fromLine); + tb.Selection.SetStartAndEnd(new Place(fromChar, fromLine)); // ts.NeedRecalc(new TextSource.TextChangedEventArgs(fromLine, toLine)); } @@ -512,7 +512,7 @@ public override void Undo() tb.Selection.BeginUpdate(); for (int i = 0; i < ranges.Count; i++) { - tb.Selection.Start = ranges[i].ReplacedRange.Start; + tb.Selection.SetStartAndEnd(ranges[i].ReplacedRange.Start); for (int j = 0; j < ranges[i].ReplaceText.Length; j++) tb.Selection.GoRight(true); ClearSelectedCommand.ClearSelected(ts); @@ -597,12 +597,12 @@ public override void Undo() var iLine = iLines[i]; if(iLine < ts.Count) - tb.Selection.Start = new Place(0, iLine); + tb.Selection.SetStartAndEnd(new Place(0, iLine)); else - tb.Selection.Start = new Place(ts[ts.Count - 1].Count, ts.Count - 1); + tb.Selection.SetStartAndEnd(new Place(ts[ts.Count - 1].Count, ts.Count - 1)); InsertCharCommand.InsertLine(ts); - tb.Selection.Start = new Place(0, iLine); + tb.Selection.SetStartAndEnd(new Place(0, iLine)); var text = prevText[prevText.Count - i - 1]; InsertTextCommand.InsertText(text, ts); ts[iLine].IsChanged = true; @@ -633,12 +633,12 @@ public override void Execute() for(int i = iLines.Count - 1; i >= 0; i--) { var iLine = iLines[i]; - + prevText.Add(ts[iLine].Text);//backward ts.RemoveLine(iLine); //ts.OnTextChanged(ranges[i].Start.iLine, ranges[i].End.iLine); } - tb.Selection.Start = new Place(0, 0); + tb.Selection.SetStartAndEnd(new Place(0, 0)); tb.Selection.EndUpdate(); ts.NeedRecalc(new TextSource.TextChangedEventArgs(0, 1)); diff --git a/FastColoredTextBox/FastColoredTextBox.cs b/FastColoredTextBox/FastColoredTextBox.cs index 9af2ff3c..2a5d2588 100644 --- a/FastColoredTextBox/FastColoredTextBox.cs +++ b/FastColoredTextBox/FastColoredTextBox.cs @@ -145,7 +145,8 @@ public FastColoredTextBox() InitTextSource(CreateTextSource()); if (lines.Count == 0) lines.InsertLine(0, lines.CreateLine()); - selection = new Range(this) {Start = new Place(0, 0)}; + selection = new Range(this); + selection.SetStartAndEnd(new Place(0, 0)); //default settings Cursor = Cursors.IBeam; BackColor = Color.White; @@ -1477,7 +1478,7 @@ public string SelectedText public int SelectionStart { get { return Math.Min(PlaceToPosition(Selection.Start), PlaceToPosition(Selection.End)); } - set { Selection.Start = PositionToPlace(value); } + set { Selection.SetStartAndEnd(PositionToPlace(value)); } } /// @@ -2262,7 +2263,7 @@ public void Navigate(int iLine) { if (iLine >= LinesCount) return; lastNavigatedDateTime = lines[iLine].LastVisit; - Selection.Start = new Place(0, iLine); + Selection.SetStartAndEnd(new Place(0, iLine)); DoSelectionVisible(); } @@ -2607,8 +2608,8 @@ public virtual void Cut() if (Selection.Start.iLine >= 0 && Selection.Start.iLine < LinesCount) { int iLine = Selection.Start.iLine; - RemoveLines(new List {iLine}); - Selection.Start = new Place(0, Math.Max(0, Math.Min(iLine, LinesCount - 1))); + RemoveLines(new List { iLine }); + Selection.SetStartAndEnd(new Place(0, Math.Max(0, Math.Min(iLine, LinesCount - 1)))); } } } @@ -2662,9 +2663,9 @@ public void SelectAll() public void GoEnd() { if (lines.Count > 0) - Selection.Start = new Place(lines[lines.Count - 1].Count, lines.Count - 1); + Selection.SetStartAndEnd(new Place(lines[lines.Count - 1].Count, lines.Count - 1)); else - Selection.Start = new Place(0, 0); + Selection.SetStartAndEnd(new Place(0, 0)); DoCaretVisible(); } @@ -2674,7 +2675,7 @@ public void GoEnd() /// public void GoHome() { - Selection.Start = new Place(0, 0); + Selection.SetStartAndEnd(new Place(0, 0)); DoCaretVisible(); //VerticalScroll.Value = 0; @@ -2855,9 +2856,9 @@ public virtual void AppendText(string text, Style style) try { if (lines.Count > 0) - Selection.Start = new Place(lines[lines.Count - 1].Count, lines.Count - 1); + Selection.SetStartAndEnd(new Place(lines[lines.Count - 1].Count, lines.Count - 1)); else - Selection.Start = new Place(0, 0); + Selection.SetStartAndEnd(new Place(0, 0)); //remember last caret position Place last = Selection.Start; @@ -3038,7 +3039,7 @@ private void InsertVirtualSpaces() Selection.BeginUpdate(); try { - Selection.Start = new Place(lineLength, Selection.Start.iLine); + Selection.SetStartAndEnd(new Place(lineLength, Selection.Start.iLine)); lines.Manager.ExecuteCommand(new InsertTextCommand(TextSource, new string(' ', count))); } finally @@ -4162,7 +4163,7 @@ public virtual void MoveSelectedLinesDown() for (int i = Selection.Start.iLine; i <= Selection.End.iLine; i++) temp.Add(i); RemoveLines(temp); - Selection.Start = new Place(GetLineLength(iLine), iLine); + Selection.SetStartAndEnd(new Place(GetLineLength(iLine), iLine)); SelectedText = "\n" + text; Selection.Start = new Place(prevSelection.Start.iChar, prevSelection.Start.iLine + 1); Selection.End = new Place(prevSelection.End.iChar, prevSelection.End.iLine + 1); @@ -4190,7 +4191,7 @@ public virtual void MoveSelectedLinesUp() for (int i = Selection.Start.iLine; i <= Selection.End.iLine; i++) temp.Add(i); RemoveLines(temp); - Selection.Start = new Place(0, iLine - 1); + Selection.SetStartAndEnd(new Place(0, iLine - 1)); SelectedText = text + "\n"; Selection.Start = new Place(prevSelection.Start.iChar, prevSelection.Start.iLine - 1); Selection.End = new Place(prevSelection.End.iChar, prevSelection.End.iLine - 1); @@ -4569,13 +4570,13 @@ protected void DoAutoIndentChars(int iLine, Regex regex) continue; if (oldSel.Start.iLine == i && oldSel.Start.iChar > cap.Index) - oldSel.Start = new Place(oldSel.Start.iChar + addSpaces, i); + oldSel.SetStartAndEnd(new Place(oldSel.Start.iChar + addSpaces, i)); if (addSpaces > 0) texts[i] = texts[i].Insert(cap.Index, new string(' ', addSpaces)); else texts[i] = texts[i].Remove(cap.Index + addSpaces, -addSpaces); - + changed[i] = true; was = true; } @@ -4724,7 +4725,7 @@ public virtual void DoAutoIndent(int iLine) //insert start spaces if (needToInsert == 0) return; - Selection.Start = new Place(0, iLine); + Selection.SetStartAndEnd(new Place(0, iLine)); if (needToInsert > 0) InsertText(new String(' ', needToInsert)); else @@ -4734,7 +4735,7 @@ public virtual void DoAutoIndent(int iLine) ClearSelected(); } - Selection.Start = new Place(Math.Min(lines[iLine].Count, Math.Max(0, oldStart.iChar + needToInsert)), iLine); + Selection.SetStartAndEnd(new Place(Math.Min(lines[iLine].Count, Math.Max(0, oldStart.iChar + needToInsert)), iLine)); } /// @@ -5584,15 +5585,15 @@ private void OnMouseClickText(MouseEventArgs e) if (Selection.ColumnSelectionMode) { - Selection.Start = PointToPlaceSimple(e.Location); + Selection.SetStartAndEnd(PointToPlaceSimple(e.Location)); Selection.ColumnSelectionMode = true; } else { if (VirtualSpace) - Selection.Start = PointToPlaceSimple(e.Location); + Selection.SetStartAndEnd(PointToPlaceSimple(e.Location)); else - Selection.Start = PointToPlace(e.Location); + Selection.SetStartAndEnd(PointToPlace(e.Location)); } if ((lastModifiers & Keys.Shift) != 0) @@ -5823,11 +5824,11 @@ protected override void OnMouseMove(MouseEventArgs e) Selection.BeginUpdate(); if (Selection.ColumnSelectionMode) { - Selection.Start = place; + Selection.SetStartAndEnd(place); Selection.ColumnSelectionMode = true; } else - Selection.Start = place; + Selection.SetStartAndEnd(place); Selection.End = oldEnd; Selection.EndUpdate(); DoCaretVisible(); @@ -6661,7 +6662,7 @@ public virtual void CollapseBlock(int fromLine, int toLine) int newLine = FindNextVisibleLine(to); if (newLine == to) newLine = FindPrevVisibleLine(from); - Selection.Start = new Place(0, newLine); + Selection.SetStartAndEnd(new Place(0, newLine)); // needRecalc = true; Invalidate(); @@ -6713,7 +6714,7 @@ public virtual void IncreaseIndent() { if (!Selection.ReadOnly) { - Selection.Start = new Place(this[Selection.Start.iLine].StartSpacesCount, Selection.Start.iLine); + Selection.SetStartAndEnd(new Place(this[Selection.Start.iLine].StartSpacesCount, Selection.Start.iLine)); //insert tab as spaces int spaces = TabLength - (Selection.Start.iChar % TabLength); //replace mode? select forward chars @@ -6754,7 +6755,7 @@ public virtual void IncreaseIndent() for (int i = from; i <= to; i++) { if (lines[i].Count == 0) continue; - Selection.Start = new Place(startChar, i); + Selection.SetStartAndEnd(new Place(startChar, i)); lines.Manager.ExecuteCommand(new InsertTextCommand(TextSource, new String(' ', TabLength))); } @@ -6965,7 +6966,7 @@ public virtual void InsertLinePrefix(string prefix) int spaces = GetMinStartSpacesCount(from, to); for (int i = from; i <= to; i++) { - Selection.Start = new Place(spaces, i); + Selection.SetStartAndEnd(new Place(spaces, i)); lines.Manager.ExecuteCommand(new InsertTextCommand(TextSource, prefix)); } Selection.Start = new Place(0, from); @@ -7141,7 +7142,7 @@ public Range GetBracketsRange(Place placeInsideBrackets, char leftBracket, char if (range.CharAfterStart == rightBracket) counter--; if (counter == 1) { - range.Start = new Place(range.Start.iChar + (!includeBrackets ? 1 : 0), range.Start.iLine); + range.SetStartAndEnd(new Place(range.Start.iChar + (!includeBrackets ? 1 : 0), range.Start.iLine)); leftBracketPosition = range; break; } @@ -7519,7 +7520,7 @@ public void OpenFile(string fileName, Encoding enc) IsChanged = false; throw; } - Selection.Start = Place.Empty; + Selection.SetStartAndEnd(Place.Empty); DoSelectionVisible(); } @@ -7689,7 +7690,7 @@ void ISupportInitialize.BeginInit() void ISupportInitialize.EndInit() { OnTextChanged(); - Selection.Start = Place.Empty; + Selection.SetStartAndEnd(Place.Empty); DoCaretVisible(); IsChanged = false; ClearUndo(); @@ -7755,7 +7756,7 @@ private void DoDragDrop_old(Place place, string text) { Selection.BeginUpdate(); // Insert text - Selection.Start = place; + Selection.SetStartAndEnd(place); InsertText(text); // Select inserted text Selection = new Range(this, place, Selection.Start); @@ -7862,7 +7863,7 @@ protected virtual void DoDragDrop(Place place, string text) { Selection.BeginUpdate(); // Insert text - Selection.Start = place; + Selection.SetStartAndEnd(place); InsertText(text); // Select inserted text Selection = new Range(this, place, Selection.Start); @@ -8022,7 +8023,7 @@ protected override void OnDragOver(DragEventArgs e) if (e.Data.GetDataPresent(DataFormats.Text)) { Point p = PointToClient(new Point(e.X, e.Y)); - Selection.Start = PointToPlace(p); + Selection.SetStartAndEnd(PointToPlace(p)); if (p.Y < 6 && VerticalScroll.Visible && VerticalScroll.Value > 0) VerticalScroll.Value = Math.Max(0, VerticalScroll.Value - charHeight); diff --git a/FastColoredTextBox/FindForm.cs b/FastColoredTextBox/FindForm.cs index b20282d5..aba3f058 100644 --- a/FastColoredTextBox/FindForm.cs +++ b/FastColoredTextBox/FindForm.cs @@ -62,7 +62,7 @@ public virtual void FindNext(string pattern) // if (range.Start >= startPlace && startPlace > Place.Empty) { - tb.Selection.Start = new Place(0, 0); + tb.Selection.SetStartAndEnd(new Place(0, 0)); FindNext(pattern); return; } diff --git a/FastColoredTextBox/Range.cs b/FastColoredTextBox/Range.cs index 2faabd9f..33038aed 100644 --- a/FastColoredTextBox/Range.cs +++ b/FastColoredTextBox/Range.cs @@ -157,9 +157,9 @@ public void SelectAll() { ColumnSelectionMode = false; - Start = new Place(0, 0); + SetStartAndEnd(new Place(0, 0)); if (tb.LinesCount == 0) - Start = new Place(0, 0); + SetStartAndEnd(new Place(0, 0)); else { end = new Place(0, 0); @@ -177,7 +177,7 @@ public Place Start get { return start; } set { - end = start = value; + start = value; preferedPos = -1; OnSelectionChanged(); } @@ -728,6 +728,12 @@ internal void GoEnd(bool shift) preferedPos = -1; } + /// + /// Setter changing both, the Start and End property to the same value + /// + /// The new place + public void SetStartAndEnd(Place value) { End = Start = value; } + /// /// Set style for range /// @@ -1214,7 +1220,7 @@ public Range GetFragment(Style style, bool allowLineBreaks) var mask = tb.GetStyleIndexMask(new Style[] { style }); // Range r = new Range(tb); - r.Start = Start; + r.SetStartAndEnd(Start); //go left, check style while (r.GoLeftThroughFolded()) { @@ -1229,7 +1235,7 @@ public Range GetFragment(Style style, bool allowLineBreaks) } Place startFragment = r.Start; - r.Start = Start; + r.SetStartAndEnd(Start); //go right, check style do { @@ -1252,7 +1258,7 @@ public Range GetFragment(Style style, bool allowLineBreaks) public Range GetFragment(string allowedSymbolsPattern, RegexOptions options) { Range r = new Range(tb); - r.Start = Start; + r.SetStartAndEnd(Start); Regex regex = new Regex(allowedSymbolsPattern, options); //go left, check symbols while (r.GoLeftThroughFolded()) @@ -1265,7 +1271,7 @@ public Range GetFragment(string allowedSymbolsPattern, RegexOptions options) } Place startFragment = r.Start; - r.Start = Start; + r.SetStartAndEnd(Start); //go right, check symbols do { diff --git a/FastColoredTextBox/ReplaceForm.cs b/FastColoredTextBox/ReplaceForm.cs index 2d7d7c1d..51c01f0c 100644 --- a/FastColoredTextBox/ReplaceForm.cs +++ b/FastColoredTextBox/ReplaceForm.cs @@ -85,7 +85,7 @@ public bool Find(string pattern) } if (range.Start >= startPlace && startPlace > Place.Empty) { - tb.Selection.Start = new Place(0, 0); + tb.Selection.SetStartAndEnd(new Place(0, 0)); return Find(pattern); } return false; @@ -155,7 +155,7 @@ private void btReplaceAll_Click(object sender, EventArgs e) if (ranges.Count > 0) { tb.TextSource.Manager.ExecuteCommand(new ReplaceTextCommand(tb.TextSource, ranges, tbReplace.Text)); - tb.Selection.Start = new Place(0, 0); + tb.Selection.SetStartAndEnd(new Place(0, 0)); } // tb.Invalidate(); diff --git a/Tester/MainForm.Designer.cs b/Tester/MainForm.Designer.cs index e983d906..cc642a44 100644 --- a/Tester/MainForm.Designer.cs +++ b/Tester/MainForm.Designer.cs @@ -106,14 +106,16 @@ private void InitializeComponent() this.button38 = new System.Windows.Forms.Button(); this.label39 = new System.Windows.Forms.Label(); this.button39 = new System.Windows.Forms.Button(); + this.label40 = new System.Windows.Forms.Label(); + this.button40 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // button1 // - this.button1.Location = new System.Drawing.Point(296, 4); - this.button1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button1.Location = new System.Drawing.Point(333, 5); + this.button1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(100, 28); + this.button1.Size = new System.Drawing.Size(112, 35); this.button1.TabIndex = 0; this.button1.Text = "Show"; this.button1.UseVisualStyleBackColor = true; @@ -121,30 +123,30 @@ private void InitializeComponent() // // label1 // - this.label1.Location = new System.Drawing.Point(11, 5); + this.label1.Location = new System.Drawing.Point(12, 6); this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(277, 42); + this.label1.Size = new System.Drawing.Size(312, 52); this.label1.TabIndex = 1; this.label1.Text = "Powerful sample. It shows syntax highlighting and many features."; this.label1.TextAlign = System.Drawing.ContentAlignment.TopRight; // // label2 // - this.label2.Location = new System.Drawing.Point(11, 108); + this.label2.Location = new System.Drawing.Point(12, 135); this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(277, 37); + this.label2.Size = new System.Drawing.Size(312, 46); this.label2.TabIndex = 3; this.label2.Text = "Marker sample. It shows how to make marker tool."; this.label2.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button2 // - this.button2.Location = new System.Drawing.Point(296, 108); - this.button2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button2.Location = new System.Drawing.Point(333, 135); + this.button2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(100, 28); + this.button2.Size = new System.Drawing.Size(112, 35); this.button2.TabIndex = 2; this.button2.Text = "Show"; this.button2.UseVisualStyleBackColor = true; @@ -152,20 +154,20 @@ private void InitializeComponent() // // label3 // - this.label3.Location = new System.Drawing.Point(11, 158); + this.label3.Location = new System.Drawing.Point(12, 198); this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(277, 37); + this.label3.Size = new System.Drawing.Size(312, 46); this.label3.TabIndex = 5; this.label3.Text = "Custom style sample. This example shows how to create own custom style."; this.label3.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button3 // - this.button3.Location = new System.Drawing.Point(296, 158); - this.button3.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button3.Location = new System.Drawing.Point(333, 198); + this.button3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button3.Name = "button3"; - this.button3.Size = new System.Drawing.Size(100, 28); + this.button3.Size = new System.Drawing.Size(112, 35); this.button3.TabIndex = 4; this.button3.Text = "Show"; this.button3.UseVisualStyleBackColor = true; @@ -173,10 +175,10 @@ private void InitializeComponent() // // label4 // - this.label4.Location = new System.Drawing.Point(11, 203); + this.label4.Location = new System.Drawing.Point(12, 254); this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(277, 69); + this.label4.Size = new System.Drawing.Size(312, 86); this.label4.TabIndex = 7; this.label4.Text = "VisibleRangeChangedDelayed usage sample. This example shows how to highlight synt" + "ax for extremally large text by VisibleRangeChangedDelayed event."; @@ -184,10 +186,10 @@ private void InitializeComponent() // // button4 // - this.button4.Location = new System.Drawing.Point(296, 220); - this.button4.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button4.Location = new System.Drawing.Point(333, 275); + this.button4.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button4.Name = "button4"; - this.button4.Size = new System.Drawing.Size(100, 28); + this.button4.Size = new System.Drawing.Size(112, 35); this.button4.TabIndex = 6; this.button4.Text = "Show"; this.button4.UseVisualStyleBackColor = true; @@ -195,10 +197,10 @@ private void InitializeComponent() // // label5 // - this.label5.Location = new System.Drawing.Point(15, 50); + this.label5.Location = new System.Drawing.Point(17, 62); this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(273, 54); + this.label5.Size = new System.Drawing.Size(307, 68); this.label5.TabIndex = 9; this.label5.Text = "Simplest custom syntax highlighting sample. It shows how to make custom syntax hi" + "ghlighting."; @@ -206,10 +208,10 @@ private void InitializeComponent() // // button5 // - this.button5.Location = new System.Drawing.Point(296, 57); - this.button5.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button5.Location = new System.Drawing.Point(333, 71); + this.button5.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button5.Name = "button5"; - this.button5.Size = new System.Drawing.Size(100, 28); + this.button5.Size = new System.Drawing.Size(112, 35); this.button5.TabIndex = 8; this.button5.Text = "Show"; this.button5.UseVisualStyleBackColor = true; @@ -217,20 +219,20 @@ private void InitializeComponent() // // label6 // - this.label6.Location = new System.Drawing.Point(11, 644); + this.label6.Location = new System.Drawing.Point(12, 805); this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(277, 32); + this.label6.Size = new System.Drawing.Size(312, 40); this.label6.TabIndex = 11; this.label6.Text = "Joke sample :)"; this.label6.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button6 // - this.button6.Location = new System.Drawing.Point(296, 638); - this.button6.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button6.Location = new System.Drawing.Point(333, 798); + this.button6.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button6.Name = "button6"; - this.button6.Size = new System.Drawing.Size(100, 28); + this.button6.Size = new System.Drawing.Size(112, 35); this.button6.TabIndex = 10; this.button6.Text = "Show"; this.button6.UseVisualStyleBackColor = true; @@ -238,10 +240,10 @@ private void InitializeComponent() // // label7 // - this.label7.Location = new System.Drawing.Point(420, 5); + this.label7.Location = new System.Drawing.Point(472, 6); this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(277, 50); + this.label7.Size = new System.Drawing.Size(312, 62); this.label7.TabIndex = 13; this.label7.Text = "Simplest code folding sample. This example shows how to make simplest code foldin" + "g."; @@ -249,10 +251,10 @@ private void InitializeComponent() // // button7 // - this.button7.Location = new System.Drawing.Point(705, 5); - this.button7.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button7.Location = new System.Drawing.Point(793, 6); + this.button7.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button7.Name = "button7"; - this.button7.Size = new System.Drawing.Size(100, 28); + this.button7.Size = new System.Drawing.Size(112, 35); this.button7.TabIndex = 12; this.button7.Text = "Show"; this.button7.UseVisualStyleBackColor = true; @@ -260,10 +262,10 @@ private void InitializeComponent() // // label8 // - this.label8.Location = new System.Drawing.Point(420, 107); + this.label8.Location = new System.Drawing.Point(472, 134); this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(277, 50); + this.label8.Size = new System.Drawing.Size(312, 62); this.label8.TabIndex = 15; this.label8.Text = "Autocomplete sample. This example shows simplest way to create autocomplete funct" + "ionality."; @@ -271,10 +273,10 @@ private void InitializeComponent() // // button8 // - this.button8.Location = new System.Drawing.Point(705, 121); - this.button8.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button8.Location = new System.Drawing.Point(793, 151); + this.button8.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button8.Name = "button8"; - this.button8.Size = new System.Drawing.Size(100, 28); + this.button8.Size = new System.Drawing.Size(112, 35); this.button8.TabIndex = 14; this.button8.Text = "Show"; this.button8.UseVisualStyleBackColor = true; @@ -282,10 +284,10 @@ private void InitializeComponent() // // label9 // - this.label9.Location = new System.Drawing.Point(420, 377); + this.label9.Location = new System.Drawing.Point(472, 471); this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(277, 73); + this.label9.Size = new System.Drawing.Size(312, 91); this.label9.TabIndex = 17; this.label9.Text = "Dynamic syntax highlighting. This example finds the functions declared in the pro" + "gram and dynamically highlights all of their entry into the code of LISP."; @@ -293,10 +295,10 @@ private void InitializeComponent() // // button9 // - this.button9.Location = new System.Drawing.Point(705, 394); - this.button9.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button9.Location = new System.Drawing.Point(793, 492); + this.button9.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button9.Name = "button9"; - this.button9.Size = new System.Drawing.Size(100, 28); + this.button9.Size = new System.Drawing.Size(112, 35); this.button9.TabIndex = 16; this.button9.Text = "Show"; this.button9.UseVisualStyleBackColor = true; @@ -304,10 +306,10 @@ private void InitializeComponent() // // label10 // - this.label10.Location = new System.Drawing.Point(420, 457); + this.label10.Location = new System.Drawing.Point(472, 571); this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(277, 55); + this.label10.Size = new System.Drawing.Size(312, 69); this.label10.TabIndex = 19; this.label10.Text = "Syntax highlighting by XML description file. This example shows how to use XML fi" + "le for description of syntax highlighting."; @@ -315,10 +317,10 @@ private void InitializeComponent() // // button10 // - this.button10.Location = new System.Drawing.Point(705, 465); - this.button10.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button10.Location = new System.Drawing.Point(793, 581); + this.button10.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button10.Name = "button10"; - this.button10.Size = new System.Drawing.Size(100, 28); + this.button10.Size = new System.Drawing.Size(112, 35); this.button10.TabIndex = 18; this.button10.Text = "Show"; this.button10.UseVisualStyleBackColor = true; @@ -326,20 +328,20 @@ private void InitializeComponent() // // label11 // - this.label11.Location = new System.Drawing.Point(420, 523); + this.label11.Location = new System.Drawing.Point(472, 654); this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(277, 46); + this.label11.Size = new System.Drawing.Size(312, 58); this.label11.TabIndex = 21; this.label11.Text = "This example supports IME entering mode and rendering of wide characters."; this.label11.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button11 // - this.button11.Location = new System.Drawing.Point(705, 523); - this.button11.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button11.Location = new System.Drawing.Point(793, 654); + this.button11.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button11.Name = "button11"; - this.button11.Size = new System.Drawing.Size(100, 28); + this.button11.Size = new System.Drawing.Size(112, 35); this.button11.TabIndex = 20; this.button11.Text = "Show"; this.button11.UseVisualStyleBackColor = true; @@ -347,20 +349,20 @@ private void InitializeComponent() // // label12 // - this.label12.Location = new System.Drawing.Point(11, 288); + this.label12.Location = new System.Drawing.Point(12, 360); this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(277, 32); + this.label12.Size = new System.Drawing.Size(312, 40); this.label12.TabIndex = 23; this.label12.Text = "Powerfull C# source file editor"; this.label12.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button12 // - this.button12.Location = new System.Drawing.Point(296, 282); - this.button12.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button12.Location = new System.Drawing.Point(333, 352); + this.button12.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button12.Name = "button12"; - this.button12.Size = new System.Drawing.Size(100, 28); + this.button12.Size = new System.Drawing.Size(112, 35); this.button12.TabIndex = 22; this.button12.Text = "Show"; this.button12.UseVisualStyleBackColor = true; @@ -368,20 +370,20 @@ private void InitializeComponent() // // label13 // - this.label13.Location = new System.Drawing.Point(11, 334); + this.label13.Location = new System.Drawing.Point(12, 418); this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(277, 32); + this.label13.Size = new System.Drawing.Size(312, 40); this.label13.TabIndex = 25; this.label13.Text = "Example of image drawing"; this.label13.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button13 // - this.button13.Location = new System.Drawing.Point(296, 334); - this.button13.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button13.Location = new System.Drawing.Point(333, 418); + this.button13.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button13.Name = "button13"; - this.button13.Size = new System.Drawing.Size(100, 28); + this.button13.Size = new System.Drawing.Size(112, 35); this.button13.TabIndex = 24; this.button13.Text = "Show"; this.button13.UseVisualStyleBackColor = true; @@ -389,10 +391,10 @@ private void InitializeComponent() // // label14 // - this.label14.Location = new System.Drawing.Point(420, 166); + this.label14.Location = new System.Drawing.Point(472, 208); this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(277, 50); + this.label14.Size = new System.Drawing.Size(312, 62); this.label14.TabIndex = 27; this.label14.Text = "Autocomplete sample 2.\r\nThis example demonstrates more flexible variant of Autoco" + "mpleteMenu using."; @@ -400,10 +402,10 @@ private void InitializeComponent() // // button14 // - this.button14.Location = new System.Drawing.Point(705, 174); - this.button14.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button14.Location = new System.Drawing.Point(793, 218); + this.button14.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button14.Name = "button14"; - this.button14.Size = new System.Drawing.Size(100, 28); + this.button14.Size = new System.Drawing.Size(112, 35); this.button14.TabIndex = 26; this.button14.Text = "Show"; this.button14.UseVisualStyleBackColor = true; @@ -411,20 +413,20 @@ private void InitializeComponent() // // label15 // - this.label15.Location = new System.Drawing.Point(420, 582); + this.label15.Location = new System.Drawing.Point(472, 728); this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(277, 28); + this.label15.Size = new System.Drawing.Size(312, 35); this.label15.TabIndex = 29; this.label15.Text = "AutoIndent sample"; this.label15.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button15 // - this.button15.Location = new System.Drawing.Point(705, 576); - this.button15.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button15.Location = new System.Drawing.Point(793, 720); + this.button15.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button15.Name = "button15"; - this.button15.Size = new System.Drawing.Size(100, 28); + this.button15.Size = new System.Drawing.Size(112, 35); this.button15.TabIndex = 28; this.button15.Text = "Show"; this.button15.UseVisualStyleBackColor = true; @@ -432,10 +434,10 @@ private void InitializeComponent() // // button16 // - this.button16.Location = new System.Drawing.Point(705, 629); - this.button16.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button16.Location = new System.Drawing.Point(793, 786); + this.button16.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button16.Name = "button16"; - this.button16.Size = new System.Drawing.Size(100, 28); + this.button16.Size = new System.Drawing.Size(112, 35); this.button16.TabIndex = 30; this.button16.Text = "Show"; this.button16.UseVisualStyleBackColor = true; @@ -443,30 +445,30 @@ private void InitializeComponent() // // label16 // - this.label16.Location = new System.Drawing.Point(420, 636); + this.label16.Location = new System.Drawing.Point(472, 795); this.label16.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(277, 28); + this.label16.Size = new System.Drawing.Size(312, 35); this.label16.TabIndex = 31; this.label16.Text = "Bookmarks sample"; this.label16.TextAlign = System.Drawing.ContentAlignment.TopRight; // // label17 // - this.label17.Location = new System.Drawing.Point(11, 384); + this.label17.Location = new System.Drawing.Point(12, 480); this.label17.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label17.Name = "label17"; - this.label17.Size = new System.Drawing.Size(277, 32); + this.label17.Size = new System.Drawing.Size(312, 40); this.label17.TabIndex = 33; this.label17.Text = "Logger sample. It shows how to add text with predefined style."; this.label17.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button17 // - this.button17.Location = new System.Drawing.Point(296, 384); - this.button17.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button17.Location = new System.Drawing.Point(333, 480); + this.button17.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button17.Name = "button17"; - this.button17.Size = new System.Drawing.Size(100, 28); + this.button17.Size = new System.Drawing.Size(112, 35); this.button17.TabIndex = 32; this.button17.Text = "Show"; this.button17.UseVisualStyleBackColor = true; @@ -474,20 +476,20 @@ private void InitializeComponent() // // label18 // - this.label18.Location = new System.Drawing.Point(420, 334); + this.label18.Location = new System.Drawing.Point(472, 418); this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label18.Name = "label18"; - this.label18.Size = new System.Drawing.Size(277, 32); + this.label18.Size = new System.Drawing.Size(312, 40); this.label18.TabIndex = 35; this.label18.Text = "Tooltip sample."; this.label18.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button18 // - this.button18.Location = new System.Drawing.Point(705, 334); - this.button18.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button18.Location = new System.Drawing.Point(793, 418); + this.button18.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button18.Name = "button18"; - this.button18.Size = new System.Drawing.Size(100, 28); + this.button18.Size = new System.Drawing.Size(112, 35); this.button18.TabIndex = 34; this.button18.Text = "Show"; this.button18.UseVisualStyleBackColor = true; @@ -495,20 +497,20 @@ private void InitializeComponent() // // label19 // - this.label19.Location = new System.Drawing.Point(11, 432); + this.label19.Location = new System.Drawing.Point(12, 540); this.label19.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label19.Name = "label19"; - this.label19.Size = new System.Drawing.Size(277, 32); + this.label19.Size = new System.Drawing.Size(312, 40); this.label19.TabIndex = 37; this.label19.Text = "Split sample. This example shows how to make split-screen mode."; this.label19.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button19 // - this.button19.Location = new System.Drawing.Point(296, 432); - this.button19.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button19.Location = new System.Drawing.Point(333, 540); + this.button19.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button19.Name = "button19"; - this.button19.Size = new System.Drawing.Size(100, 28); + this.button19.Size = new System.Drawing.Size(112, 35); this.button19.TabIndex = 36; this.button19.Text = "Show"; this.button19.UseVisualStyleBackColor = true; @@ -516,20 +518,20 @@ private void InitializeComponent() // // label20 // - this.label20.Location = new System.Drawing.Point(11, 482); + this.label20.Location = new System.Drawing.Point(12, 602); this.label20.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label20.Name = "label20"; - this.label20.Size = new System.Drawing.Size(277, 32); + this.label20.Size = new System.Drawing.Size(312, 40); this.label20.TabIndex = 39; this.label20.Text = "Lazy loading sample."; this.label20.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button20 // - this.button20.Location = new System.Drawing.Point(296, 482); - this.button20.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button20.Location = new System.Drawing.Point(333, 602); + this.button20.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button20.Name = "button20"; - this.button20.Size = new System.Drawing.Size(100, 28); + this.button20.Size = new System.Drawing.Size(112, 35); this.button20.TabIndex = 38; this.button20.Text = "Show"; this.button20.UseVisualStyleBackColor = true; @@ -537,20 +539,20 @@ private void InitializeComponent() // // label21 // - this.label21.Location = new System.Drawing.Point(420, 688); + this.label21.Location = new System.Drawing.Point(472, 860); this.label21.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label21.Name = "label21"; - this.label21.Size = new System.Drawing.Size(277, 28); + this.label21.Size = new System.Drawing.Size(312, 35); this.label21.TabIndex = 41; this.label21.Text = "Console sample"; this.label21.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button21 // - this.button21.Location = new System.Drawing.Point(705, 682); - this.button21.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button21.Location = new System.Drawing.Point(793, 852); + this.button21.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button21.Name = "button21"; - this.button21.Size = new System.Drawing.Size(100, 28); + this.button21.Size = new System.Drawing.Size(112, 35); this.button21.TabIndex = 40; this.button21.Text = "Show"; this.button21.UseVisualStyleBackColor = true; @@ -558,20 +560,20 @@ private void InitializeComponent() // // label22 // - this.label22.Location = new System.Drawing.Point(420, 65); + this.label22.Location = new System.Drawing.Point(472, 81); this.label22.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label22.Name = "label22"; - this.label22.Size = new System.Drawing.Size(277, 32); + this.label22.Size = new System.Drawing.Size(312, 40); this.label22.TabIndex = 43; this.label22.Text = "Custom code folding sample."; this.label22.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button22 // - this.button22.Location = new System.Drawing.Point(705, 59); - this.button22.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button22.Location = new System.Drawing.Point(793, 74); + this.button22.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button22.Name = "button22"; - this.button22.Size = new System.Drawing.Size(100, 28); + this.button22.Size = new System.Drawing.Size(112, 35); this.button22.TabIndex = 42; this.button22.Text = "Show"; this.button22.UseVisualStyleBackColor = true; @@ -579,20 +581,20 @@ private void InitializeComponent() // // label23 // - this.label23.Location = new System.Drawing.Point(11, 538); + this.label23.Location = new System.Drawing.Point(12, 672); this.label23.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label23.Name = "label23"; - this.label23.Size = new System.Drawing.Size(277, 32); + this.label23.Size = new System.Drawing.Size(312, 40); this.label23.TabIndex = 45; this.label23.Text = "Bilingual highlighter sample"; this.label23.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button23 // - this.button23.Location = new System.Drawing.Point(296, 530); - this.button23.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button23.Location = new System.Drawing.Point(333, 662); + this.button23.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button23.Name = "button23"; - this.button23.Size = new System.Drawing.Size(100, 28); + this.button23.Size = new System.Drawing.Size(112, 35); this.button23.TabIndex = 44; this.button23.Text = "Show"; this.button23.UseVisualStyleBackColor = true; @@ -600,20 +602,20 @@ private void InitializeComponent() // // label24 // - this.label24.Location = new System.Drawing.Point(11, 588); + this.label24.Location = new System.Drawing.Point(12, 735); this.label24.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label24.Name = "label24"; - this.label24.Size = new System.Drawing.Size(277, 32); + this.label24.Size = new System.Drawing.Size(312, 40); this.label24.TabIndex = 47; this.label24.Text = "Hyperlink sample"; this.label24.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button24 // - this.button24.Location = new System.Drawing.Point(296, 581); - this.button24.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button24.Location = new System.Drawing.Point(333, 726); + this.button24.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button24.Name = "button24"; - this.button24.Size = new System.Drawing.Size(100, 28); + this.button24.Size = new System.Drawing.Size(112, 35); this.button24.TabIndex = 46; this.button24.Text = "Show"; this.button24.UseVisualStyleBackColor = true; @@ -621,20 +623,20 @@ private void InitializeComponent() // // label25 // - this.label25.Location = new System.Drawing.Point(819, 4); + this.label25.Location = new System.Drawing.Point(921, 5); this.label25.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label25.Name = "label25"; - this.label25.Size = new System.Drawing.Size(277, 39); + this.label25.Size = new System.Drawing.Size(312, 49); this.label25.TabIndex = 49; this.label25.Text = "Custom TextSource sample. This example shows how to display very large string\r\n"; this.label25.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button25 // - this.button25.Location = new System.Drawing.Point(1104, 5); - this.button25.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button25.Location = new System.Drawing.Point(1242, 6); + this.button25.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button25.Name = "button25"; - this.button25.Size = new System.Drawing.Size(100, 28); + this.button25.Size = new System.Drawing.Size(112, 35); this.button25.TabIndex = 48; this.button25.Text = "Show"; this.button25.UseVisualStyleBackColor = true; @@ -642,20 +644,20 @@ private void InitializeComponent() // // label26 // - this.label26.Location = new System.Drawing.Point(844, 63); + this.label26.Location = new System.Drawing.Point(950, 79); this.label26.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label26.Name = "label26"; - this.label26.Size = new System.Drawing.Size(252, 28); + this.label26.Size = new System.Drawing.Size(284, 35); this.label26.TabIndex = 51; this.label26.Text = "Hints sample"; this.label26.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button26 // - this.button26.Location = new System.Drawing.Point(1104, 57); - this.button26.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button26.Location = new System.Drawing.Point(1242, 71); + this.button26.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button26.Name = "button26"; - this.button26.Size = new System.Drawing.Size(100, 28); + this.button26.Size = new System.Drawing.Size(112, 35); this.button26.TabIndex = 50; this.button26.Text = "Show"; this.button26.UseVisualStyleBackColor = true; @@ -663,10 +665,10 @@ private void InitializeComponent() // // label27 // - this.label27.Location = new System.Drawing.Point(844, 107); + this.label27.Location = new System.Drawing.Point(950, 134); this.label27.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label27.Name = "label27"; - this.label27.Size = new System.Drawing.Size(252, 60); + this.label27.Size = new System.Drawing.Size(284, 75); this.label27.TabIndex = 53; this.label27.Text = "ReadOnly blocks sample. Are you needed readonly blocks of text? Yep, we can do it" + "..."; @@ -674,10 +676,10 @@ private void InitializeComponent() // // button27 // - this.button27.Location = new System.Drawing.Point(1104, 108); - this.button27.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button27.Location = new System.Drawing.Point(1242, 135); + this.button27.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button27.Name = "button27"; - this.button27.Size = new System.Drawing.Size(100, 28); + this.button27.Size = new System.Drawing.Size(112, 35); this.button27.TabIndex = 52; this.button27.Text = "Show"; this.button27.UseVisualStyleBackColor = true; @@ -685,10 +687,10 @@ private void InitializeComponent() // // label28 // - this.label28.Location = new System.Drawing.Point(844, 171); + this.label28.Location = new System.Drawing.Point(950, 214); this.label28.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label28.Name = "label28"; - this.label28.Size = new System.Drawing.Size(252, 60); + this.label28.Size = new System.Drawing.Size(284, 75); this.label28.TabIndex = 55; this.label28.Text = "Predefined styles sample. Here we create large text with predefined styles, hyper" + "links and tooltips..."; @@ -696,10 +698,10 @@ private void InitializeComponent() // // button28 // - this.button28.Location = new System.Drawing.Point(1104, 172); - this.button28.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button28.Location = new System.Drawing.Point(1242, 215); + this.button28.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button28.Name = "button28"; - this.button28.Size = new System.Drawing.Size(100, 28); + this.button28.Size = new System.Drawing.Size(112, 35); this.button28.TabIndex = 54; this.button28.Text = "Show"; this.button28.UseVisualStyleBackColor = true; @@ -707,20 +709,20 @@ private void InitializeComponent() // // label29 // - this.label29.Location = new System.Drawing.Point(844, 239); + this.label29.Location = new System.Drawing.Point(950, 299); this.label29.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label29.Name = "label29"; - this.label29.Size = new System.Drawing.Size(252, 43); + this.label29.Size = new System.Drawing.Size(284, 54); this.label29.TabIndex = 57; this.label29.Text = "This sample shows how to use macros for hard formatting of the code."; this.label29.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button29 // - this.button29.Location = new System.Drawing.Point(1104, 240); - this.button29.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button29.Location = new System.Drawing.Point(1242, 300); + this.button29.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button29.Name = "button29"; - this.button29.Size = new System.Drawing.Size(100, 28); + this.button29.Size = new System.Drawing.Size(112, 35); this.button29.TabIndex = 56; this.button29.Text = "Show"; this.button29.UseVisualStyleBackColor = true; @@ -728,20 +730,20 @@ private void InitializeComponent() // // label30 // - this.label30.Location = new System.Drawing.Point(844, 300); + this.label30.Location = new System.Drawing.Point(950, 375); this.label30.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label30.Name = "label30"; - this.label30.Size = new System.Drawing.Size(252, 30); + this.label30.Size = new System.Drawing.Size(284, 38); this.label30.TabIndex = 59; this.label30.Text = "How to use OpenType fonts."; this.label30.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button30 // - this.button30.Location = new System.Drawing.Point(1104, 295); - this.button30.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button30.Location = new System.Drawing.Point(1242, 369); + this.button30.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button30.Name = "button30"; - this.button30.Size = new System.Drawing.Size(100, 28); + this.button30.Size = new System.Drawing.Size(112, 35); this.button30.TabIndex = 58; this.button30.Text = "Show"; this.button30.UseVisualStyleBackColor = true; @@ -749,20 +751,20 @@ private void InitializeComponent() // // label31 // - this.label31.Location = new System.Drawing.Point(844, 361); + this.label31.Location = new System.Drawing.Point(950, 451); this.label31.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label31.Name = "label31"; - this.label31.Size = new System.Drawing.Size(252, 30); + this.label31.Size = new System.Drawing.Size(284, 38); this.label31.TabIndex = 61; this.label31.Text = "Ruler sample."; this.label31.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button31 // - this.button31.Location = new System.Drawing.Point(1104, 354); - this.button31.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button31.Location = new System.Drawing.Point(1242, 442); + this.button31.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button31.Name = "button31"; - this.button31.Size = new System.Drawing.Size(100, 28); + this.button31.Size = new System.Drawing.Size(112, 35); this.button31.TabIndex = 60; this.button31.Text = "Show"; this.button31.UseVisualStyleBackColor = true; @@ -770,20 +772,20 @@ private void InitializeComponent() // // label32 // - this.label32.Location = new System.Drawing.Point(420, 223); + this.label32.Location = new System.Drawing.Point(472, 279); this.label32.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label32.Name = "label32"; - this.label32.Size = new System.Drawing.Size(277, 50); + this.label32.Size = new System.Drawing.Size(312, 62); this.label32.TabIndex = 63; this.label32.Text = "Autocomplete sample 3.\r\n How to make dynamic autocomplete menu."; this.label32.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button32 // - this.button32.Location = new System.Drawing.Point(705, 230); - this.button32.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button32.Location = new System.Drawing.Point(793, 288); + this.button32.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button32.Name = "button32"; - this.button32.Size = new System.Drawing.Size(100, 28); + this.button32.Size = new System.Drawing.Size(112, 35); this.button32.TabIndex = 62; this.button32.Text = "Show"; this.button32.UseVisualStyleBackColor = true; @@ -791,10 +793,10 @@ private void InitializeComponent() // // label33 // - this.label33.Location = new System.Drawing.Point(420, 274); + this.label33.Location = new System.Drawing.Point(472, 342); this.label33.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label33.Name = "label33"; - this.label33.Size = new System.Drawing.Size(277, 50); + this.label33.Size = new System.Drawing.Size(312, 62); this.label33.TabIndex = 65; this.label33.Text = "Autocomplete sample 4.\r\nHow to make intellisense menu with predefined list of cla" + "sses and methods."; @@ -802,10 +804,10 @@ private void InitializeComponent() // // button33 // - this.button33.Location = new System.Drawing.Point(705, 282); - this.button33.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button33.Location = new System.Drawing.Point(793, 352); + this.button33.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button33.Name = "button33"; - this.button33.Size = new System.Drawing.Size(100, 28); + this.button33.Size = new System.Drawing.Size(112, 35); this.button33.TabIndex = 64; this.button33.Text = "Show"; this.button33.UseVisualStyleBackColor = true; @@ -813,20 +815,20 @@ private void InitializeComponent() // // label34 // - this.label34.Location = new System.Drawing.Point(844, 412); + this.label34.Location = new System.Drawing.Point(950, 515); this.label34.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label34.Name = "label34"; - this.label34.Size = new System.Drawing.Size(252, 30); + this.label34.Size = new System.Drawing.Size(284, 38); this.label34.TabIndex = 67; this.label34.Text = "Document map sample."; this.label34.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button34 // - this.button34.Location = new System.Drawing.Point(1104, 406); - this.button34.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button34.Location = new System.Drawing.Point(1242, 508); + this.button34.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button34.Name = "button34"; - this.button34.Size = new System.Drawing.Size(100, 28); + this.button34.Size = new System.Drawing.Size(112, 35); this.button34.TabIndex = 66; this.button34.Text = "Show"; this.button34.UseVisualStyleBackColor = true; @@ -834,20 +836,20 @@ private void InitializeComponent() // // label35 // - this.label35.Location = new System.Drawing.Point(844, 470); + this.label35.Location = new System.Drawing.Point(950, 588); this.label35.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label35.Name = "label35"; - this.label35.Size = new System.Drawing.Size(252, 30); + this.label35.Size = new System.Drawing.Size(284, 38); this.label35.TabIndex = 69; this.label35.Text = "DiffMerge sample."; this.label35.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button35 // - this.button35.Location = new System.Drawing.Point(1104, 464); - this.button35.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button35.Location = new System.Drawing.Point(1242, 580); + this.button35.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button35.Name = "button35"; - this.button35.Size = new System.Drawing.Size(100, 28); + this.button35.Size = new System.Drawing.Size(112, 35); this.button35.TabIndex = 68; this.button35.Text = "Show"; this.button35.UseVisualStyleBackColor = true; @@ -855,20 +857,20 @@ private void InitializeComponent() // // label36 // - this.label36.Location = new System.Drawing.Point(844, 523); + this.label36.Location = new System.Drawing.Point(950, 654); this.label36.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label36.Name = "label36"; - this.label36.Size = new System.Drawing.Size(252, 30); + this.label36.Size = new System.Drawing.Size(284, 38); this.label36.TabIndex = 71; this.label36.Text = "Custom scrollbars sample."; this.label36.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button36 // - this.button36.Location = new System.Drawing.Point(1104, 517); - this.button36.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button36.Location = new System.Drawing.Point(1242, 646); + this.button36.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button36.Name = "button36"; - this.button36.Size = new System.Drawing.Size(100, 28); + this.button36.Size = new System.Drawing.Size(112, 35); this.button36.TabIndex = 70; this.button36.Text = "Show"; this.button36.UseVisualStyleBackColor = true; @@ -876,20 +878,20 @@ private void InitializeComponent() // // label37 // - this.label37.Location = new System.Drawing.Point(844, 576); + this.label37.Location = new System.Drawing.Point(950, 720); this.label37.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label37.Name = "label37"; - this.label37.Size = new System.Drawing.Size(252, 30); + this.label37.Size = new System.Drawing.Size(284, 38); this.label37.TabIndex = 73; this.label37.Text = "Custom wordwrap sample."; this.label37.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button37 // - this.button37.Location = new System.Drawing.Point(1104, 570); - this.button37.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button37.Location = new System.Drawing.Point(1242, 712); + this.button37.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button37.Name = "button37"; - this.button37.Size = new System.Drawing.Size(100, 28); + this.button37.Size = new System.Drawing.Size(112, 35); this.button37.TabIndex = 72; this.button37.Text = "Show"; this.button37.UseVisualStyleBackColor = true; @@ -897,20 +899,20 @@ private void InitializeComponent() // // label38 // - this.label38.Location = new System.Drawing.Point(844, 628); + this.label38.Location = new System.Drawing.Point(950, 785); this.label38.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label38.Name = "label38"; - this.label38.Size = new System.Drawing.Size(252, 30); + this.label38.Size = new System.Drawing.Size(284, 38); this.label38.TabIndex = 75; this.label38.Text = "AutoIndentChars sample."; this.label38.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button38 // - this.button38.Location = new System.Drawing.Point(1104, 622); - this.button38.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.button38.Location = new System.Drawing.Point(1242, 778); + this.button38.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button38.Name = "button38"; - this.button38.Size = new System.Drawing.Size(100, 28); + this.button38.Size = new System.Drawing.Size(112, 35); this.button38.TabIndex = 74; this.button38.Text = "Show"; this.button38.UseVisualStyleBackColor = true; @@ -918,30 +920,53 @@ private void InitializeComponent() // // label39 // - this.label39.Location = new System.Drawing.Point(847, 679); + this.label39.Location = new System.Drawing.Point(953, 849); this.label39.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label39.Name = "label39"; - this.label39.Size = new System.Drawing.Size(252, 36); + this.label39.Size = new System.Drawing.Size(284, 45); this.label39.TabIndex = 77; this.label39.Text = "Custom TextSource with supporting of line filtering."; this.label39.TextAlign = System.Drawing.ContentAlignment.TopRight; // // button39 // - this.button39.Location = new System.Drawing.Point(1107, 679); - this.button39.Margin = new System.Windows.Forms.Padding(4); + this.button39.Location = new System.Drawing.Point(1245, 849); + this.button39.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.button39.Name = "button39"; - this.button39.Size = new System.Drawing.Size(100, 28); + this.button39.Size = new System.Drawing.Size(112, 35); this.button39.TabIndex = 76; this.button39.Text = "Show"; this.button39.UseVisualStyleBackColor = true; this.button39.Click += new System.EventHandler(this.button39_Click); // + // label40 + // + this.label40.Location = new System.Drawing.Point(12, 860); + this.label40.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label40.Name = "label40"; + this.label40.Size = new System.Drawing.Size(312, 40); + this.label40.TabIndex = 79; + this.label40.Text = "demonstrate replace text issue"; + this.label40.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // button40 + // + this.button40.Location = new System.Drawing.Point(333, 853); + this.button40.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.button40.Name = "button40"; + this.button40.Size = new System.Drawing.Size(112, 35); + this.button40.TabIndex = 78; + this.button40.Text = "Show"; + this.button40.UseVisualStyleBackColor = true; + this.button40.Click += new System.EventHandler(this.button40_Click); + // // MainForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1220, 720); + this.ClientSize = new System.Drawing.Size(1372, 984); + this.Controls.Add(this.label40); + this.Controls.Add(this.button40); this.Controls.Add(this.label39); this.Controls.Add(this.button39); this.Controls.Add(this.label38); @@ -1021,7 +1046,7 @@ private void InitializeComponent() this.Controls.Add(this.label1); this.Controls.Add(this.button1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.Name = "MainForm"; this.Text = "MainForm"; this.DoubleClick += new System.EventHandler(this.MainForm_DoubleClick); @@ -1109,5 +1134,7 @@ private void InitializeComponent() private System.Windows.Forms.Button button38; private System.Windows.Forms.Label label39; private System.Windows.Forms.Button button39; + private System.Windows.Forms.Label label40; + private System.Windows.Forms.Button button40; } } \ No newline at end of file diff --git a/Tester/MainForm.cs b/Tester/MainForm.cs index 71fdacb5..175180a6 100644 --- a/Tester/MainForm.cs +++ b/Tester/MainForm.cs @@ -217,5 +217,10 @@ private void button39_Click(object sender, EventArgs e) { new CustomTextSourceSample2().Show(); } + + private void button40_Click(object sender, EventArgs e) + { + new ReplaceTextIssue().Show(); + } } } diff --git a/Tester/PowerfulCSharpEditor.cs b/Tester/PowerfulCSharpEditor.cs index af7fa332..3de6b898 100644 --- a/Tester/PowerfulCSharpEditor.cs +++ b/Tester/PowerfulCSharpEditor.cs @@ -824,7 +824,7 @@ private void cloneLinesToolStripMenuItem_Click(object sender, EventArgs e) //get text of selected lines string text = Environment.NewLine + CurrentTB.Selection.Text; //move caret to end of selected lines - CurrentTB.Selection.Start = CurrentTB.Selection.End; + CurrentTB.Selection.SetStartAndEnd(CurrentTB.Selection.End); //insert text CurrentTB.InsertText(text); } @@ -840,7 +840,7 @@ private void cloneLinesAndCommentToolStripMenuItem_Click(object sender, EventArg //comment lines CurrentTB.InsertLinePrefix("//"); //move caret to end of selected lines - CurrentTB.Selection.Start = CurrentTB.Selection.End; + CurrentTB.Selection.SetStartAndEnd(CurrentTB.Selection.End); //insert text CurrentTB.InsertText(text); //end of autoUndo block diff --git a/Tester/PowerfulSample.cs b/Tester/PowerfulSample.cs index d103c0a2..e07daa64 100644 --- a/Tester/PowerfulSample.cs +++ b/Tester/PowerfulSample.cs @@ -256,7 +256,7 @@ void GoLeftBracket(FastColoredTextBox tb, char leftBracket, char rightBracket) if (counter == 1) { //found - tb.Selection.Start = range.Start; + tb.Selection.SetStartAndEnd(range.Start); tb.DoSelectionVisible(); break; } @@ -279,7 +279,7 @@ void GoRightBracket(FastColoredTextBox tb, char leftBracket, char rightBracket) if (counter == -1) { //found - tb.Selection.Start = range.Start; + tb.Selection.SetStartAndEnd(range.Start); tb.Selection.GoRightThroughFolded(); tb.DoSelectionVisible(); break; diff --git a/Tester/ReplaceTextIssue.Designer.cs b/Tester/ReplaceTextIssue.Designer.cs new file mode 100644 index 00000000..9c39bcb6 --- /dev/null +++ b/Tester/ReplaceTextIssue.Designer.cs @@ -0,0 +1,120 @@ +namespace Tester +{ + partial class ReplaceTextIssue + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ReplaceTextIssue)); + this.label1 = new System.Windows.Forms.Label(); + this.btGotToEnd = new System.Windows.Forms.Button(); + this.fctb = new FastColoredTextBoxNS.FastColoredTextBox(); + ((System.ComponentModel.ISupportInitialize)(this.fctb)).BeginInit(); + this.SuspendLayout(); + // + // label1 + // + this.label1.Dock = System.Windows.Forms.DockStyle.Top; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204))); + this.label1.Location = new System.Drawing.Point(0, 0); + this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(532, 33); + this.label1.TabIndex = 4; + this.label1.Text = "This example shows the reported bug"; + // + // btGotToEnd + // + this.btGotToEnd.Dock = System.Windows.Forms.DockStyle.Bottom; + this.btGotToEnd.Location = new System.Drawing.Point(0, 445); + this.btGotToEnd.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.btGotToEnd.Name = "btGotToEnd"; + this.btGotToEnd.Size = new System.Drawing.Size(532, 35); + this.btGotToEnd.TabIndex = 6; + this.btGotToEnd.Text = "Execute"; + this.btGotToEnd.UseVisualStyleBackColor = true; + this.btGotToEnd.Click += new System.EventHandler(this.btGotToEnd_Click); + // + // fctb + // + this.fctb.AutoCompleteBracketsList = new char[] { + '(', + ')', + '{', + '}', + '[', + ']', + '\"', + '\"', + '\'', + '\''}; + this.fctb.AutoIndentCharsPatterns = "^\\s*[\\w\\.]+(\\s\\w+)?\\s*(?=)\\s*(?[^;=]+);\r\n^\\s*(case|default)\\s*[^:]*" + + "(?:)\\s*(?[^;]+);"; + this.fctb.AutoScrollMinSize = new System.Drawing.Size(0, 22); + this.fctb.BackBrush = null; + this.fctb.CharHeight = 22; + this.fctb.CharWidth = 11; + this.fctb.Cursor = System.Windows.Forms.Cursors.IBeam; + this.fctb.DisabledColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(180)))), ((int)(((byte)(180)))), ((int)(((byte)(180))))); + this.fctb.Dock = System.Windows.Forms.DockStyle.Fill; + this.fctb.Font = new System.Drawing.Font("Consolas", 9.75F); + this.fctb.IsReplaceMode = false; + this.fctb.Location = new System.Drawing.Point(0, 33); + this.fctb.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.fctb.Name = "fctb"; + this.fctb.Paddings = new System.Windows.Forms.Padding(0); + this.fctb.ReadOnly = true; + this.fctb.SelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(255))))); + this.fctb.ServiceColors = ((FastColoredTextBoxNS.ServiceColors)(resources.GetObject("fctb.ServiceColors"))); + this.fctb.Size = new System.Drawing.Size(532, 412); + this.fctb.TabIndex = 5; + this.fctb.WordWrap = true; + this.fctb.Zoom = 100; + // + // ReplaceTextIssue + // + this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(532, 480); + this.Controls.Add(this.fctb); + this.Controls.Add(this.label1); + this.Controls.Add(this.btGotToEnd); + this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.Name = "ReplaceTextIssue"; + this.Text = "ReplaceTextIssue"; + ((System.ComponentModel.ISupportInitialize)(this.fctb)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private FastColoredTextBoxNS.FastColoredTextBox fctb; + private System.Windows.Forms.Button btGotToEnd; + } +} \ No newline at end of file diff --git a/Tester/ReplaceTextIssue.cs b/Tester/ReplaceTextIssue.cs new file mode 100644 index 00000000..99bd73c1 --- /dev/null +++ b/Tester/ReplaceTextIssue.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using FastColoredTextBoxNS; + +namespace Tester +{ + public partial class ReplaceTextIssue : Form + { + private readonly Style GreenStyle = new TextStyle(Brushes.Green, null, FontStyle.Italic); + private readonly Style RedStyle = new TextStyle(Brushes.Red, null, FontStyle.Regular); + + public ReplaceTextIssue() + { + InitializeComponent(); + fctb.Text = @"0 Lorem +1 ipsum +2 dolor +3 sit +4 amet"; + //fctb.style + fctb.TextChanged += Fctb_TextChanged; + fctb.Range.SetStyle(GreenStyle); + } + + private void Fctb_TextChanged(object sender, TextChangedEventArgs e) + { + e.ChangedRange.SetStyle(RedStyle); + } + + private void btGotToEnd_Click(object sender, EventArgs e) + { + var replaces = new List(); + for (int i = 0; i < 5; ++i) + { + replaces.Add(new ReplaceMultipleTextCommand.ReplaceRange() { ReplacedRange = new Range(fctb, 0, i, 2, i), ReplaceText = $"replaced line {i} " }); + } + fctb.BeginUpdate(); + fctb.TextSource.Manager.ExecuteCommand(new ReplaceMultipleTextCommand(fctb.TextSource, replaces)); + fctb.EndUpdate(); + } + } +} diff --git a/Tester/ReplaceTextIssue.resx b/Tester/ReplaceTextIssue.resx new file mode 100644 index 00000000..4ac35412 --- /dev/null +++ b/Tester/ReplaceTextIssue.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdGYXN0Q29sb3JlZFRleHRCb3gsIFZlcnNpb249Mi4xNi4yNi4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWZiOGFhMTJiOTk0ZWY2MWIMAwAAAFFTeXN0 + ZW0uRHJhd2luZywgVmVyc2lvbj0yLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2Vu + PWIwM2Y1ZjdmMTFkNTBhM2EFAQAAACJGYXN0Q29sb3JlZFRleHRCb3hOUy5TZXJ2aWNlQ29sb3JzBgAA + ACg8Q29sbGFwc2VNYXJrZXJGb3JlQ29sb3I+a19fQmFja2luZ0ZpZWxkKDxDb2xsYXBzZU1hcmtlckJh + Y2tDb2xvcj5rX19CYWNraW5nRmllbGQqPENvbGxhcHNlTWFya2VyQm9yZGVyQ29sb3I+a19fQmFja2lu + Z0ZpZWxkJjxFeHBhbmRNYXJrZXJGb3JlQ29sb3I+a19fQmFja2luZ0ZpZWxkJjxFeHBhbmRNYXJrZXJC + YWNrQ29sb3I+a19fQmFja2luZ0ZpZWxkKDxFeHBhbmRNYXJrZXJCb3JkZXJDb2xvcj5rX19CYWNraW5n + RmllbGQEBAQEBAQUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAFFN5c3RlbS5EcmF3aW5nLkNvbG9yAwAA + ABRTeXN0ZW0uRHJhd2luZy5Db2xvcgMAAAAUU3lzdGVtLkRyYXdpbmcuQ29sb3IDAAAAFFN5c3RlbS5E + cmF3aW5nLkNvbG9yAwAAABRTeXN0ZW0uRHJhd2luZy5Db2xvcgMAAAACAAAABfz///8UU3lzdGVtLkRy + YXdpbmcuQ29sb3IEAAAABG5hbWUFdmFsdWUKa25vd25Db2xvcgVzdGF0ZQEAAAAJBwcDAAAACgAAAAAA + AAAAlgABAAH7/////P///woAAAAAAAAAAKQAAQAB+v////z///8KAAAAAAAAAACWAAEAAfn////8//// + CgAAAAAAAAAAjQABAAH4/////P///woAAAAAAAAAAKQAAQAB9/////z///8KAAAAAAAAAACWAAEACw== + + + \ No newline at end of file diff --git a/Tester/Tester.csproj b/Tester/Tester.csproj index 455d7028..02a58280 100644 --- a/Tester/Tester.csproj +++ b/Tester/Tester.csproj @@ -125,6 +125,12 @@ DocumentMapSample.cs + + Form + + + ReplaceTextIssue.cs + Form @@ -343,6 +349,9 @@ DocumentMapSample.cs + + ReplaceTextIssue.cs + RulerSample.cs diff --git a/TesterVB/BookmarksSample.resx b/TesterVB/BookmarksSample.resx index 73dd7f6f..cfc0d3ec 100644 --- a/TesterVB/BookmarksSample.resx +++ b/TesterVB/BookmarksSample.resx @@ -153,7 +153,7 @@ Public Class BookmarksSample Dim id As Integer = bookmarks(iBookmark) For i As Integer = 0 To fctb.LinesCount - 1 If fctb(i).UniqueId = id Then - fctb.Selection.Start = New Place(0, i) + fctb.Selection.SetStartAndEnd(New Place(0, i)) fctb.DoSelectionVisible() fctb.Invalidate() Exit For