build Constructors 1

data_object Properties 37

AcceptsImeInput
bool
Allow IME input when this is focused.
AllowEmojiReplace
bool
Whether to allow automatic replacement of emoji codes with their actual unicode emoji characters. See Sandbox.UI.Emoji.
AutoComplete
Func`2
If you hook a method up here we'll do autocomplete on it. Return a list if strings for given string input.
CanEdit
bool
Whether the text can be changed at all right now.
CanRedo
bool
Is there anything to redo?
CanUndo
bool
Is there anything to undo?
CaretPosition
int
CharacterRegex
string
If set, will block the input of any character that doesn't match. Will also set Sandbox.UI.TextEntry.HasValidationErrors accordingly.
Disabled
bool
Is the text entry disabled? If disabled, will add a "disabled" class and prevent focus.
HasClearButton
bool
If true then Icon/IconPanel will be set to a clear button that clears the text when clicked.
HasValidationErrors
bool
If true then this control has validation errors and the input shouldn't be accepted.
HistoryCookie
string
If set, the history of this text entry will be stored and restored using this key in the local Sandbox.Internal.GlobalGameNamespace.Cookie.
HistoryMaxItems
int
Maximum amount of items Sandbox.UI.TextEntry.AddToHistory(System.String) will keep. Oldest items will be discarded as new ones are added.
Icon
string
If set, will display a material icon at the end of the text entry.
IconPanel
IconPanel
The Sandbox.UI.IconPanel that displays Sandbox.UI.TextEntry.Icon
Label
Label
The Sandbox.UI.TextEntry.Label that contains the text of this text entry.
MaxLength
Nullable`1
If set, visually signals when the input text is longer than this value. Will also set Sandbox.UI.TextEntry.HasValidationErrors accordingly.
MaxValue
Nullable`1
If we're numeric, this is the highest numeric value allowed
MinLength
Nullable`1
If set, visually signals when the input text is shorter than this value. Will also set Sandbox.UI.TextEntry.HasValidationErrors accordingly.
MinValue
Nullable`1
If we're numeric, this is the lowest numeric value allowed
Multiline
bool
Makes it possible to enter new lines into the text entry. (By pressing the Enter key, which no longer acts as the submit key)
NumberFormat
string
Affects formatting of the text when Sandbox.UI.TextEntry.Numeric is enabled. Accepts any format that is supported by System.Single.ToString(System.String). See examples here.
Numeric
bool
When set to true, ensures only numeric values can be typed. Also applies Sandbox.UI.TextEntry.FixNumeric on text.
OnTextEdited
Action`1
Called when the text of this text entry is changed.
Placeholder
string
Text to display when the text entry is empty. Typically a very short description of the expected contents or function of the text entry.
Prefix
string
If set, will display given text before the text entry box.
PrefixLabel
Label
The Sandbox.UI.TextEntry.Label that shows Sandbox.UI.TextEntry.Prefix text.
ReadOnly
bool
The text can be selected and copied, but not changed. Unlike Sandbox.UI.TextEntry.Disabled this still takes focus, so it reads and behaves like text rather than like a dead control.
SelectionColor
Color
The color used for text selection highlight. Defaults to cyan with transparency.
StringRegex
string
If set, Sandbox.UI.TextEntry.HasValidationErrors will return true if doesn't match regex.
Suffix
string
If set, will display given text after the text entry box.
SuffixLabel
Label
The Sandbox.UI.TextEntry.Label that shows Sandbox.UI.TextEntry.Suffix text.
SupportsMultiEdit
bool
Text
string
Access to the raw text in the text entry.
TextLength
int
Value
string
The value of the text entry. Returns Sandbox.UI.TextEntry.Text, but does special logic when setting text.
WholeNumbers
bool
With Sandbox.UI.TextEntry.Numeric, only allow whole numbers - no decimal point.

functions Methods 33

AddToHistory (str)
Add given string to the history of this text entry. The history can be accessed by the player by pressing up and down arrows with an empty text entry.
AutoCompleteCancel ()
Auto complete was canceled, restore text to what it was before we started, and remove the auto complete popup.
AutoCompleteSelectionChanged ()
Auto complete selection has changed. Update the text entry text to that selected value.
CanEnterCharacter (c)
bool
Called when a character is typed by the player.
ClearHistory ()
Clear the input history that was previously added via Sandbox.UI.TextEntry.AddToHistory(System.String).
ClearUndoHistory ()
Throw the history away - for when the text is replaced by something the user didn't do.
DestroyAutoComplete ()
Close and delete the auto complete popup panel.
FixNumeric ()
string
Called to ensure the Sandbox.UI.TextEntry.Text is absolutely in the correct format, in this case - a valid number format.
GetClipboardValue (cut)
string
IsPanelEmpty ()
bool
The TextEntry has the :empty style when the text is unset
OnBlur (e)
OnButtonEvent (e)
OnButtonTyped (e)
OnDoubleClick (e)
OnDragSelect (e)
OnDraw ()
OnDrop (e)
OnEscape (e)
OnEvent (e)
OnFocus (e)
OnKeyTyped (k)
OnMouseDown (e)
OnMouseMove (e)
OnMouseUp (e)
OnPaste (text)
OnTripleClick (e)
A third click takes the whole line - which is everything, when there's only one line.
OnValueChanged ()
Called when the text entry's value changes.
Redo ()
Put back whatever the last undo took away.
SetProperty (name, value)
Tick ()
Undo ()
Put back the text, caret and selection from before the last edit.
UpdateAutoComplete ()
Open the auto complete popup with values from Sandbox.UI.TextEntry.AutoComplete. Close the popup if we have no auto complete entries.
UpdateValidation ()
Update the validation state of this control.

Inheritance

people
Log in to reply
You can't reply if you're not logged in. That would be crazy.