Search Results for

    Show / Hide Table of Contents

    Class TextBox

    Text box control which can gather text input from the user.

    Inheritance
    System.Object
    Control
    ContainerControl
    TextBoxBase
    TextBox
    SearchBox
    Implements
    System.IComparable
    IDrawable
    Inherited Members
    TextBoxBase.DelChar
    TextBoxBase.Separators
    TextBoxBase.DefaultHeight
    TextBoxBase.DefaultMargin
    TextBoxBase._text
    TextBoxBase._onStartEditValue
    TextBoxBase._isEditing
    TextBoxBase._viewOffset
    TextBoxBase._targetViewOffset
    TextBoxBase._textSize
    TextBoxBase._isMultiline
    TextBoxBase._isReadOnly
    TextBoxBase._isSelectable
    TextBoxBase._maxLength
    TextBoxBase._isSelecting
    TextBoxBase._selectionStart
    TextBoxBase._selectionEnd
    TextBoxBase._animateTime
    TextBoxBase._changeCursor
    TextBoxBase._consumeAllKeyDownEvents
    TextBoxBase.SetText(String)
    TextBoxBase.SetTextAsUser(String)
    TextBoxBase.Clear()
    TextBoxBase.ClearSelection()
    TextBoxBase.ResetViewOffset()
    TextBoxBase.OnTargetViewOffsetChanged()
    TextBoxBase.Copy()
    TextBoxBase.Cut()
    TextBoxBase.Paste()
    TextBoxBase.Duplicate()
    TextBoxBase.ScrollToCaret()
    TextBoxBase.SelectAll()
    TextBoxBase.Deselect()
    TextBoxBase.CharIndexAtPoint(Float2)
    TextBoxBase.Insert(Char)
    TextBoxBase.Insert(String)
    TextBoxBase.MoveRight(Boolean, Boolean)
    TextBoxBase.MoveLeft(Boolean, Boolean)
    TextBoxBase.MoveDown(Boolean, Boolean)
    TextBoxBase.MoveUp(Boolean, Boolean)
    TextBoxBase.SetSelection(Int32, Boolean)
    TextBoxBase.SetSelection(Int32, Int32, Boolean)
    TextBoxBase.OnIsReadOnlyChanged()
    TextBoxBase.OnIsSelectableChanged()
    TextBoxBase.OnSelectingBegin()
    TextBoxBase.OnSelectingEnd()
    TextBoxBase.OnEditBegin()
    TextBoxBase.OnEditEnd()
    TextBoxBase.OnTextChanged()
    TextBoxBase.Update(Single)
    TextBoxBase.RestoreTextFromStart()
    TextBoxBase.OnGotFocus()
    TextBoxBase.OnLostFocus()
    TextBoxBase.OnEndMouseCapture()
    TextBoxBase.NavigationFocus()
    TextBoxBase.OnSubmit()
    TextBoxBase.OnMouseEnter(Float2)
    TextBoxBase.OnMouseLeave()
    TextBoxBase.OnMouseMove(Float2)
    TextBoxBase.OnMouseDown(Float2, MouseButton)
    TextBoxBase.OnMouseUp(Float2, MouseButton)
    TextBoxBase.OnMouseWheel(Float2, Single)
    TextBoxBase.OnCharInput(Char)
    TextBoxBase.OnKeyUp(KeyboardKeys)
    TextBoxBase.OnKeyDown(KeyboardKeys)
    TextBoxBase.IsMultiline
    TextBoxBase.MaxLength
    TextBoxBase.IsReadOnly
    TextBoxBase.IsSelectable
    TextBoxBase.ClipText
    TextBoxBase.IsMultilineScrollable
    TextBoxBase.BackgroundSelectedColor
    TextBoxBase.CaretColor
    TextBoxBase.CaretFlashSpeed
    TextBoxBase.BackgroundSelectedFlashSpeed
    TextBoxBase.HasBorder
    TextBoxBase.BorderThickness
    TextBoxBase.BorderColor
    TextBoxBase.BorderSelectedColor
    TextBoxBase.TextSize
    TextBoxBase.ViewOffset
    TextBoxBase.IsEditing
    TextBoxBase.Text
    TextBoxBase.TextLength
    TextBoxBase.SelectedText
    TextBoxBase.SelectionLength
    TextBoxBase.SelectionRange
    TextBoxBase.HasSelection
    TextBoxBase.SelectionLeft
    TextBoxBase.SelectionRight
    TextBoxBase.CaretPosition
    TextBoxBase.CaretBounds
    TextBoxBase.TextRectangle
    TextBoxBase.TextClipRectangle
    TextBoxBase.TextChanged
    TextBoxBase.EditEnd
    TextBoxBase.TextBoxEditEnd
    TextBoxBase.KeyDown
    TextBoxBase.KeyUp
    TextBoxBase.TargetViewOffsetChanged
    ContainerControl._children
    ContainerControl._containsFocus
    ContainerControl._isLayoutLocked
    ContainerControl.LockChildrenRecursive()
    ContainerControl.UnlockChildrenRecursive()
    ContainerControl.RemoveChildren()
    ContainerControl.DisposeChildren()
    ContainerControl.AddChild<T>()
    ContainerControl.AddChild<T>(T)
    ContainerControl.RemoveChild(Control)
    ContainerControl.GetChild(Int32)
    ContainerControl.GetChild<T>()
    ContainerControl.GetChildIndex(Control)
    ContainerControl.GetChildIndexAt(Float2)
    ContainerControl.GetChildAt(Float2)
    ContainerControl.GetChildAt(Float2, Func<Control, Boolean>)
    ContainerControl.GetChildAtRecursive(Float2)
    ContainerControl.GetClientArea()
    ContainerControl.SortChildren()
    ContainerControl.SortChildrenRecursive()
    ContainerControl.OnChildResized(Control)
    ContainerControl.OnChildrenChanged()
    ContainerControl.GetDesireClientArea(Rectangle)
    ContainerControl.IntersectsChildContent(Control, Float2, Float2)
    ContainerControl.OnNavigate(NavDirection, Float2, Control, List<Control>)
    ContainerControl.CanNavigateChild(Control)
    ContainerControl.NavigationWrap(NavDirection, Float2, List<Control>, Float2)
    ContainerControl.UpdateContainsFocus()
    ContainerControl.UpdateChildrenBounds()
    ContainerControl.PerformLayoutBeforeChildren()
    ContainerControl.PerformLayoutAfterChildren()
    ContainerControl.OnDestroy()
    ContainerControl.ClearState()
    ContainerControl.Draw()
    ContainerControl.DrawChildren()
    ContainerControl.ContainsPoint(Float2, Boolean)
    ContainerControl.PerformLayout(Boolean)
    ContainerControl.RayCast(Float2, Control)
    ContainerControl.IsTouchPointerOver(Int32)
    ContainerControl.OnTouchEnter(Float2, Int32)
    ContainerControl.OnTouchDown(Float2, Int32)
    ContainerControl.OnTouchMove(Float2, Int32)
    ContainerControl.OnTouchUp(Float2, Int32)
    ContainerControl.OnTouchLeave(Int32)
    ContainerControl.OnDragEnter(Float2, DragData)
    ContainerControl.OnDragMove(Float2, DragData)
    ContainerControl.OnDragLeave()
    ContainerControl.OnDragDrop(Float2, DragData)
    ContainerControl.Children
    ContainerControl.ChildrenCount
    ContainerControl.HasChildren
    ContainerControl.ContainsFocus
    ContainerControl.ClipChildren
    ContainerControl.CullChildren
    ContainerControl.IsTouchOver
    Control.Resize(Float2)
    Control.UpdateBounds()
    Control.UpdateTransform()
    Control.SetAnchorPreset(AnchorPresets, Boolean, Boolean)
    Control.Dispose()
    Control.Focus()
    Control.Defocus()
    Control.OnStartContainsFocus()
    Control.OnEndContainsFocus()
    Control.Focus(Control)
    Control.StartMouseCapture(Boolean)
    Control.EndMouseCapture()
    Control.GetNavTarget(NavDirection)
    Control.GetNavOrigin(NavDirection)
    Control.OnTouchLeave()
    Control.DoDragDrop(DragData)
    Control.LinkTooltip(String, Tooltip)
    Control.UnlinkTooltip()
    Control.OnShowTooltip(String, Float2, Rectangle)
    Control.OnTooltipShown(Tooltip)
    Control.OnTestTooltipOverControl(Float2)
    Control.IntersectsContent(Float2, Float2)
    Control.PointToParent(ContainerControl, Float2)
    Control.PointToParent(Float2)
    Control.PointToParent(Float2)
    Control.PointFromParent(Float2)
    Control.PointFromParent(Float2)
    Control.PointFromParent(ContainerControl, Float2)
    Control.PointToWindow(Float2)
    Control.PointFromWindow(Float2)
    Control.PointToScreen(Float2)
    Control.PointFromScreen(Float2)
    Control.OnLocationChanged()
    Control.SetScaleInternal(Float2)
    Control.SetPivotInternal(Float2)
    Control.SetShearInternal(Float2)
    Control.SetRotationInternal(Single)
    Control.OnVisibleChanged()
    Control.OnParentChangedInternal()
    Control.AddUpdateCallbacks(RootControl)
    Control.RemoveUpdateCallbacks(RootControl)
    Control.SetUpdate(Control.UpdateDelegate, Control.UpdateDelegate)
    Control.OnParentResized()
    Control.CompareTo(Object)
    Control.Compare(Control)
    Control.Top
    Control.Bottom
    Control.Left
    Control.Right
    Control.UpperLeft
    Control.UpperRight
    Control.BottomRight
    Control.BottomLeft
    Control.Scale
    Control.Pivot
    Control.Shear
    Control.Rotation
    Control.HasParent
    Control.BackgroundColor
    Control.BackgroundBrush
    Control.Enabled
    Control.EnabledInHierarchy
    Control.Visible
    Control.VisibleInHierarchy
    Control.IsDisposing
    Control.Root
    Control.RootWindow
    Control.DpiScale
    Control.ScreenPos
    Control.AutoFocus
    Control.IsFocused
    Control.IsNavFocused
    Control.IsMouseOver
    Control.IsDragOver
    Control.Tooltip
    Control.ShowTooltip
    Control.EditorBounds
    Control.LocationChanged
    Control.SizeChanged
    Control.ParentChanged
    Control.VisibleChanged
    Namespace: FlaxEngine.GUI
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [ActorToolbox("GUI")]
    public class TextBox : TextBoxBase, IComparable, IDrawable

    Constructors

    TextBox()

    Initializes a new instance of the TextBox class.

    Declaration
    public TextBox()

    TextBox(Boolean, Single, Single, Single)

    Init

    Declaration
    public TextBox(bool isMultiline, float x, float y, float width = 120F)
    Parameters
    System.Boolean isMultiline

    Enable/disable multiline text input support

    System.Single x

    Position X coordinate

    System.Single y

    Position Y coordinate

    System.Single width

    Width

    Fields

    _watermarkText

    The watermark text.

    Declaration
    protected LocalizedString _watermarkText
    Field Value
    LocalizedString

    ObfuscateCharacter

    The character to Obfuscate the text.

    Declaration
    [EditorOrder(22)]
    [VisibleIf("ObfuscateText", false)]
    [Tooltip("The character to Obfuscate the text.")]
    public char ObfuscateCharacter
    Field Value
    System.Char

    ObfuscateText

    Whether to Obfuscate the text with a different character.

    Declaration
    [EditorOrder(21)]
    [Tooltip("Whether to Obfuscate the text with a different character.")]
    public bool ObfuscateText
    Field Value
    System.Boolean

    Properties

    Bold

    Whether to bold the text.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2001)]
    [Tooltip("Bold the text.")]
    public bool Bold { get; set; }
    Property Value
    System.Boolean

    CaseOption

    The text case.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2000)]
    [Tooltip("The case of the text.")]
    public TextCaseOptions CaseOption { get; set; }
    Property Value
    TextCaseOptions

    Font

    Gets or sets the font.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2026)]
    public FontReference Font { get; set; }
    Property Value
    FontReference

    HorizontalAlignment

    The vertical alignment of the text.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2024)]
    [Tooltip("The horizontal alignment of the text.")]
    public TextAlignment HorizontalAlignment { get; set; }
    Property Value
    TextAlignment

    Italic

    Whether to italicize the text.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2002)]
    [Tooltip("Italicize the text.")]
    public bool Italic { get; set; }
    Property Value
    System.Boolean

    SelectionColor

    Gets or sets the color of the selection (Transparent if not used).

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2022)]
    [Tooltip("The color of the selection (Transparent if not used).")]
    public Color SelectionColor { get; set; }
    Property Value
    Color

    TextColor

    Gets or sets the color of the text.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2020)]
    [Tooltip("The color of the text.")]
    [ExpandGroups]
    public Color TextColor { get; set; }
    Property Value
    Color

    TextMaterial

    Gets or sets the custom material used to render the text. It must has domain set to GUI and have a public texture parameter named Font used to sample font atlas texture with font characters data.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2027)]
    [Tooltip("Custom material used to render the text. It must has domain set to GUI and have a public texture parameter named Font used to sample font atlas texture with font characters data.")]
    public MaterialBase TextMaterial { get; set; }
    Property Value
    MaterialBase

    VerticalAlignment

    The vertical alignment of the text.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2023)]
    [Tooltip("The vertical alignment of the text.")]
    public TextAlignment VerticalAlignment { get; set; }
    Property Value
    TextAlignment

    WatermarkText

    Gets or sets the watermark text to show grayed when textbox is empty.

    Declaration
    [EditorOrder(20)]
    [Tooltip("The watermark text to show grayed when textbox is empty.")]
    public LocalizedString WatermarkText { get; set; }
    Property Value
    LocalizedString

    WatermarkTextColor

    Gets or sets the color of the text.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2021)]
    [Tooltip("The color of the watermark text.")]
    public Color WatermarkTextColor { get; set; }
    Property Value
    Color

    Wrapping

    Gets or sets the text wrapping within the control bounds.

    Declaration
    [EditorDisplay("Text Style", null)]
    [EditorOrder(2025)]
    [Tooltip("The text wrapping within the control bounds.")]
    public TextWrapping Wrapping { get; set; }
    Property Value
    TextWrapping

    Methods

    DrawSelf()

    Draws the control.

    Declaration
    public override void DrawSelf()
    Overrides
    ContainerControl.DrawSelf()

    GetCharPosition(Int32, out Single)

    Calculates character position for given character index.

    Declaration
    public override Float2 GetCharPosition(int index, out float height)
    Parameters
    System.Int32 index

    The text position to get it's coordinates.

    System.Single height

    The character height (at the given character position).

    Returns
    Float2

    The character position (upper left corner which can be used for a caret position).

    Overrides
    TextBoxBase.GetCharPosition(Int32, out Single)

    GetTextSize()

    Calculates total text size. Called by OnTextChanged() to cache the text size.

    Declaration
    public override Float2 GetTextSize()
    Returns
    Float2

    The total text size.

    Overrides
    TextBoxBase.GetTextSize()

    HitTestText(Float2)

    Calculates hit character index at given location.

    Declaration
    public override int HitTestText(Float2 location)
    Parameters
    Float2 location

    The location to test.

    Returns
    System.Int32

    The selected character position index (can be equal to text length if location is outside of the layout rectangle).

    Overrides
    TextBoxBase.HitTestText(Float2)

    OnIsMultilineChanged()

    Called when is multiline gets changed.

    Declaration
    protected override void OnIsMultilineChanged()
    Overrides
    TextBoxBase.OnIsMultilineChanged()

    OnMouseDoubleClick(Float2, MouseButton)

    When mouse double clicks over control's area

    Declaration
    public override bool OnMouseDoubleClick(Float2 location, MouseButton button)
    Parameters
    Float2 location

    Mouse location in Control Space

    MouseButton button

    Mouse buttons state (flags)

    Returns
    System.Boolean

    True if event has been handled, otherwise false

    Overrides
    ContainerControl.OnMouseDoubleClick(Float2, MouseButton)

    OnSizeChanged()

    Called when control size gets changed.

    Declaration
    protected override void OnSizeChanged()
    Overrides
    ContainerControl.OnSizeChanged()

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.DeepClone<T>(T)
    Extensions.RawClone<T>(T)
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat