Class TextField
- Namespace
- RichHudFramework.UI
- Assembly
- RichHudClient.dll
Unlined clickable textbox with a background and border designed to look like text fields in the SE terminal.
public class TextField : LabelBoxBase, IReadOnlyHudElement, IReadOnlyHudNode, IReadOnlyHudParent, IClickableElement, IBindInputElement, IFocusableElement, ILabelElement, IMinLabelElement, IValueControl<ITextBuilder>, IValueControl
- Inheritance
-
TextField
- Implements
- Inherited Members
Constructors
TextField()
public TextField()
TextField(HudParentBase)
public TextField(HudParentBase parent)
Parameters
parentHudParentBase
Fields
border
Border around the text field
protected readonly BorderBox border
Field Value
lastColor
Last color set before highlighting/taking focus
protected Color lastColor
Field Value
lastTextColor
Last text color set before highlighting/taking focus
protected Color lastTextColor
Field Value
textBox
Interactable text element backing the field
protected readonly TextBox textBox
Field Value
Properties
AutoResize
If true, the element will automatically resize to fit the text.
public override bool AutoResize { get; set; }
Property Value
BindInput
Custom bind input interface for this element
public IBindInput BindInput { get; }
Property Value
BorderColor
Color of the thin border surrounding the text field
public Color BorderColor { get; set; }
Property Value
BorderThickness
Thickness of the border around the text field
public float BorderThickness { get; set; }
Property Value
BuilderMode
Line formatting mode used by the field
public TextBuilderModes BuilderMode { get; set; }
Property Value
CharFilterFunc
Used to restrict the range of characters allowed for input.
public Func<char, bool> CharFilterFunc { get; set; }
Property Value
EnableEditing
Determines whether or not the textbox will allow the user to edit its contents
public bool EnableEditing { get; set; }
Property Value
EnableTextHighlighting
Determines whether the user will be allowed to highlight text
public bool EnableTextHighlighting { get; set; }
Property Value
FocusColor
Background color when the text field has input focus
public Color FocusColor { get; set; }
Property Value
FocusHandler
Interface used to manage the element's input focus state
public IFocusHandler FocusHandler { get; }
Property Value
FocusTextColor
Text formatting used when the control gains focus.
public Color FocusTextColor { get; set; }
Property Value
Format
Default formatting used by the text field.
public GlyphFormat Format { get; set; }
Property Value
HighlightColor
Background color when the text field is moused over
public Color HighlightColor { get; set; }
Property Value
HighlightEnabled
If true then the text field will change color when moused over
public bool HighlightEnabled { get; set; }
Property Value
InputOpen
Indicates whether or not the text field will accept input
public bool InputOpen { get; }
Property Value
IsMousedOver
Indicates whether or not the element is capturing the cursor.
public override bool IsMousedOver { get; }
Property Value
MouseInput
Mouse input interface for this clickable element
public IMouseInput MouseInput { get; }
Property Value
SelectionEmpty
If true, then text box currently has a range of characters selected.
public bool SelectionEmpty { get; }
Property Value
SelectionEnd
Index of the last character in the selected range.
public Vector2I SelectionEnd { get; }
Property Value
SelectionStart
Index of the first character in the selected range.
public Vector2I SelectionStart { get; }
Property Value
Text
Text rendered by the text field.
public RichText Text { get; set; }
Property Value
TextBoard
TextBoard backing the text field.
public ITextBoard TextBoard { get; }
Property Value
TextPadding
Padding around text element
public override Vector2 TextPadding { get; set; }
Property Value
TextSize
Size of the text as rendered
public override Vector2 TextSize { get; set; }
Property Value
UpdateValueCallback
Registers a text update callback. For use in object initializers.
public EventHandler UpdateValueCallback { set; }
Property Value
UseFocusFormatting
If true, then the text field will change formatting when it takes focus.
public bool UseFocusFormatting { get; set; }
Property Value
Value
Returns an interface to the rich text content of the control.
Supports object.ToString() for getting plain text copies.
public ITextBuilder Value { get; }
Property Value
VertCenterText
If true, the text will be vertically centered.
public bool VertCenterText { get; set; }
Property Value
Methods
CloseInput()
Closes field input and clears the text selection.
public void CloseInput()
CursorEnter(object, EventArgs)
Sets highlighting formatting when the field is moused over
protected virtual void CursorEnter(object sender, EventArgs args)
Parameters
CursorExit(object, EventArgs)
Clears highlighting when the cursor leaves
protected virtual void CursorExit(object sender, EventArgs args)
Parameters
GainFocus(object, EventArgs)
Sets focus formatting
protected virtual void GainFocus(object sender, EventArgs args)
Parameters
LoseFocus(object, EventArgs)
Resets focus formatting
protected virtual void LoseFocus(object sender, EventArgs args)
Parameters
OpenInput()
Opens the field for input and moves the caret to the end.
public void OpenInput()
Events
ValueChanged
Invoked whenever a change is made to the text. Invokes once every 500ms, at most.
public event EventHandler ValueChanged