LineEditclass

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

objectWidgetLineEdit
Namespace
Editor
Assembly
Sandbox.Tools
Declaration
public class Editor.LineEdit : Editor.Widget

Constructors2

Showing 2 constructors

Methods26

Showing 26 methods

public void AddHistory(string text)PUBLIC

ParameterTypeDescription
textstring
Returns:void

public Editor.Option AddOptionToFront(Editor.Option option)PUBLIC

ParameterTypeDescription
optionOption
Returns:Option

public void Clear()PUBLIC

Clear the text.

Returns:void

public void Copy()PUBLIC

Returns:void

public void Cut()PUBLIC

Returns:void

public void Deselect()PUBLIC

De-select all of the text.

Returns:void

protected virtual bool FocusNext()PROTECTEDVIRTUAL

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

Returns:bool

protected virtual bool FocusPrevious()PROTECTEDVIRTUAL

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

Returns:bool

public void Insert(string val)PUBLIC

ParameterTypeDescription
valstring
Returns:void

protected virtual void OnEditingFinished()PROTECTEDVIRTUAL

The text entry lost keyboard focus.

Returns:void

protected virtual void OnKeyPress(Editor.KeyEvent e)PROTECTEDVIRTUAL

ParameterTypeDescription
eKeyEvent
Returns:void

protected virtual void OnReturnPressed()PROTECTEDVIRTUAL

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

Returns:void

protected virtual void OnTextChanged(string value)PROTECTEDVIRTUAL

Called when the input text changes.

ParameterTypeDescription
valuestring
Returns:void

protected virtual void OnTextEdited(string value)PROTECTEDVIRTUAL

Called when the text was edited.

ParameterTypeDescription
valuestring
Returns:void

public void Paste()PUBLIC

Returns:void

public void Redo()PUBLIC

Returns:void

public virtual void RestoreHistoryFromCookie()PUBLICVIRTUAL

Returns:void

public virtual void SaveHistoryCookie()PUBLICVIRTUAL

Returns:void

public void SelectAll()PUBLIC

Select all of the text.

Returns:void

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

ParameterTypeDescription
funcAction<Menu,string>
Returns:void

public void SetSelection(int start, int length)PUBLIC

Set the selected text region.

ParameterTypeDescription
startint
lengthint
Returns:void

public void SetValidator(string str)PUBLIC

ParameterTypeDescription
strstring
Returns:void

public void Undo()PUBLIC

Returns:void

Properties21

Showing 21 properties

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

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

Returns:bool

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

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

Returns:bool

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

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

Returns:int

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

Returns:Rect

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

Returns:string

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

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.

Returns:Widget

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

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

Returns:bool

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

Returns:string

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

True if history menu is visible

Returns:bool

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

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

Returns:int

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

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

Returns:int

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

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.

Returns:string

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

Returns:bool

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

Returns:string

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

The selected text, if any.

Returns:string

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

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

Returns:int

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

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

Returns:int

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

The text of this text entry.

Returns:string

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

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

Returns:string

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