private void InitVariantsText(string text) { variantsTextBox.Controller.InitText(text); variantsTextBox.Controller.ClearMinorSelections(); Selection selection = variantsTextBox.Controller.LastSelection; int index = variantsTextBox.Controller.Lines.LinesCount - 1; if (string.IsNullOrEmpty(pattern)) { int startIndex = StartVariantIndex; if (startIndex != -1) { index = startIndex; } } Place place = new Place(0, index); selection.anchor = selection.caret = variantsTextBox.Controller.Lines.IndexOf(place); variantsTextBox.Invalidate(); Nest.size = tabBar.Height + variantsTextBox.CharHeight * ( !string.IsNullOrEmpty(text) && variantsTextBox.Controller != null ? variantsTextBox.GetScrollSizeY() + 2 : 1 ) + 4; variantsTextBox.Controller.NeedScrollToCaret(); SetNeedResize(); }
private void OnTextChange() { int size = textBox.CharHeight * (textBox.Controller != null ? textBox.GetScrollSizeY() : 1) + tabBar.Height; if (size > Nest.size) { Nest.size = size + 1; textBox.Controller.NeedScrollToCaret(); SetNeedResize(); } }
override public void Focus() { textBox.Focus(); startViMode = MulticaretTextBox.initMacrosExecutor != null && MulticaretTextBox.initMacrosExecutor.viMode != ViMode.Insert; textBox.Text = text; textBox.Controller.ClearMinorSelections(); for (int i = 0; i < textBox.Controller.Lines.LinesCount; i++) { Line line = textBox.Controller.Lines[i]; if (i == 0) { textBox.Controller.PutCursor(new Place(0, i), false); } else { textBox.Controller.PutNewCursor(new Place(0, i)); } int right = line.NormalCount; if (isDirectory != null && i < isDirectory.Count && !isDirectory[i]) { for (int j = right; j-- > 1;) { if (line.chars[j].c == '.') { right = j; break; } } } if (!startViMode) { textBox.Controller.PutCursor(new Place(right, i), true); } } textBox.Invalidate(); Nest.size = tabBar.Height + textBox.CharHeight * ( !string.IsNullOrEmpty(text) && textBox.Controller != null ? textBox.GetScrollSizeY() : 1 ) + 4; SetNeedResize(); }
public void InitText(string text) { text = text ?? ""; this.text = text; textBox.Controller.InitText(text); Nest.size = tabBar.Height + textBox.CharHeight * (textBox.Controller != null ? textBox.GetScrollSizeY() : 1); SetNeedResize(); }