s&box docs

public class Editor.LineEdit : Editor.Widget

A single line text entry. See `Editor.TextEdit` for multi line version.

Constructors

Showing 2 constructors

Methods

Showing 26 methods

public void AddHistory(string text)

public void Clear()

Clear the text.

public void Copy()

public void Cut()

public void Deselect()

De-select all of the text.

protected virtual bool FocusNext()

If we have our menus open, let use tab/shift tab to navigate instead of switching to next control

protected virtual bool FocusPrevious()

If we have our menus open, let use tab/shift tab to navigate instead of switching to next control

public void Insert(string val)

protected virtual void OnEditingFinished()

The text entry lost keyboard focus.

protected virtual void OnKeyPress(Editor.KeyEvent e)

protected virtual void OnReturnPressed()

Called when the user presses the return (Enter) key.

protected virtual void OnTextChanged(string value)

Called when the input text changes.

protected virtual void OnTextEdited(string value)

Called when the text was edited.

public void Paste()

public void Redo()

public virtual void RestoreHistoryFromCookie()

public virtual void SaveHistoryCookie()

public void SelectAll()

Select all of the text.

public void SetAutoComplete(System.Action`2<Editor.Menu,string> func)

public void SetSelection(int start, int length)

Set the selected text region.

public void SetValidator(string str)

public void Undo()

Properties

Showing 21 properties

public bool Editor.LineEdit.AutoCompleteVisible { get; set; }

Whether the auto complete`Editor.Menu` is visible or not.

public bool Editor.LineEdit.ClearButtonEnabled { get; set; }

Show a button to clear the text input when it is not empty.

public int Editor.LineEdit.CursorPosition { get; set; }

Position of the text cursor, at which newly typed letters will be inserted.

public Sandbox.Rect Editor.LineEdit.CursorRect { get; set; }

public string Editor.LineEdit.DisplayText { get; set; }

public Editor.Widget Editor.LineEdit.ForwardNavigationEvents { get; set; }

Forward up, down and enter keys to this control. This is useful if you have a search box that you want to also allow to navigate a list of items.

public bool Editor.LineEdit.HasSelectedText { get; set; }

Whether the user has any text selected within this text entry.

public string Editor.LineEdit.HistoryCookie { get; set; }

public bool Editor.LineEdit.HistoryVisible { get; set; }

True if history menu is visible

public int Editor.LineEdit.MaxHistoryItems { get; set; }

if set > 1 we will support history items (which you need to add using AddHistory)

public int Editor.LineEdit.MaxLength { get; set; }

User entered text can never be longer than this many characters (not bytes).

public string Editor.LineEdit.PlaceholderText { get; set; }

The placeholder text, it will be displayed only when the text entry is empty. Typically used to as a short description of the expected input, or as an example input.

public virtual bool Editor.LineEdit.ReadOnly { get; set; }

public string Editor.LineEdit.RegexValidator { get; set; }

public string Editor.LineEdit.SelectedText { get; set; }

The selected text, if any.

public int Editor.LineEdit.SelectionEnd { get; set; }

Character at which the text selection ends, or -1 if there is no selection.

public int Editor.LineEdit.SelectionStart { get; set; }

Character at which the text selection begins, or -1 if there is no selection.

public string Editor.LineEdit.Text { get; set; }

The text of this text entry.

public virtual string Editor.LineEdit.Value { get; set; }

Alias of `Editor.LineEdit.Text`, except disallows setting text when `Editor.Widget.IsFocused` is .

Metadata

FieldValue
NamespaceEditor
Typeclass
AssemblySandbox.Tools
Doc IDT:Editor.LineEdit

On this page

Constructorspublic LineEdit(Editor.Widget parent = null)public LineEdit(System.String title, Editor.Widget parent = null)Methodspublic System.Void AddHistory(System.String text)public Editor.Option AddOptionToEnd(Editor.Option option)public Editor.Option AddOptionToFront(Editor.Option option)public System.Void Clear()public System.Void Copy()public System.Void Cut()public System.Void Deselect()protected virtual System.Boolean FocusNext()protected virtual System.Boolean FocusPrevious()public System.Void Insert(System.String val)protected virtual System.Void OnBlur(Editor.FocusChangeReason reason)protected virtual System.Void OnEditingFinished()protected virtual System.Void OnFocus(Editor.FocusChangeReason reason)protected virtual System.Void OnKeyPress(Editor.KeyEvent e)protected virtual System.Void OnReturnPressed()protected virtual System.Void OnTextChanged(System.String value)protected virtual System.Void OnTextEdited(System.String value)public System.Void Paste()public System.Void Redo()public virtual System.Void RestoreHistoryFromCookie()public virtual System.Void SaveHistoryCookie()public System.Void SelectAll()public System.Void SetAutoComplete(System.Action`2<Editor.Menu,System.String> func)public System.Void SetSelection(System.Int32 start, System.Int32 length)public System.Void SetValidator(System.String str)public System.Void Undo()Propertiespublic Sandbox.TextFlag Editor.LineEdit.Alignment { get; set; }public Editor.AutoComplete Editor.LineEdit.AutoComplete { get; set; }public System.Boolean Editor.LineEdit.AutoCompleteVisible { get; set; }public System.Boolean Editor.LineEdit.ClearButtonEnabled { get; set; }public System.Int32 Editor.LineEdit.CursorPosition { get; set; }public Sandbox.Rect Editor.LineEdit.CursorRect { get; set; }public System.String Editor.LineEdit.DisplayText { get; set; }public Editor.Widget Editor.LineEdit.ForwardNavigationEvents { get; set; }public System.Boolean Editor.LineEdit.HasSelectedText { get; set; }public System.String Editor.LineEdit.HistoryCookie { get; set; }public System.Boolean Editor.LineEdit.HistoryVisible { get; set; }public System.Int32 Editor.LineEdit.MaxHistoryItems { get; set; }public System.Int32 Editor.LineEdit.MaxLength { get; set; }public System.String Editor.LineEdit.PlaceholderText { get; set; }public virtual System.Boolean Editor.LineEdit.ReadOnly { get; set; }public System.String Editor.LineEdit.RegexValidator { get; set; }public System.String Editor.LineEdit.SelectedText { get; set; }public System.Int32 Editor.LineEdit.SelectionEnd { get; set; }public System.Int32 Editor.LineEdit.SelectionStart { get; set; }public System.String Editor.LineEdit.Text { get; set; }public virtual System.String Editor.LineEdit.Value { get; set; }Metadata