/// <summary> /// Initializes a new instance of the <see cref="TextBox"/> class. /// </summary> /// <param name="name">The name.</param> public TextBox(string name) : base(name) { Config.Width = Theme.ControlWidth; Config.Height = Theme.ControlHeight; this.MaxLength = int.MaxValue; // create the cursor to show where you are editing text this.TextBoxCursor = new TextBoxCursor(Name + "TextBoxCursor") { Config = { PositionX = 0, PositionY = 0, Width = 10, Height = 10 } }; // this shows the text this.Label = new Label(Name + "-TextItem"); // this draws a square over the text that is being edited this.TextBoxSelection = new TextBoxSelectionBox(Name + "-TextBoxSelection"); this.textBoxUtility = new TextBoxUtility { Debug = true }; }
/// <summary> /// Initializes a new instance of the <see cref="TextBox"/> class. /// </summary> /// <param name="name">The name.</param> public TextBox(string name) : base(name) { Config.Width = Theme.ControlWidth; Config.Height = Theme.ControlHeight; this.MaxLength = int.MaxValue; // create the cursor to show where you are editing text this.TextBoxCursor = new TextBoxCursor(Name + "TextBoxCursor") { Config = { PositionX = 0, PositionY = 0, Width = 10, Height = 10 } }; // this shows the text this.Label = new Label(Name + "-TextItem"); // this draws a square over the text that is being edited this.TextBoxSelection = new TextBoxSelectionBox(Name + "-TextBoxSelection"); this.textBoxUtility = new TextBoxUtility { Debug = true }; }
/// <summary> /// Delete only the selection. /// </summary> public void DeleteSelectedText() { TextBoxUtility.DeleteSelection(this); }
/// <summary> /// Select everything in the text-box. /// Override to perform text selection /// </summary> public void DoSelectAll() { TextBoxUtility.DoSelectAll(this); }