Show / Hide Table of Contents

    Class TextField

    Single-line text entry View
    Inheritance
    System.Object
    Responder
    View
    TextField
    DateField
    TimeField
    Implements
    System.Collections.IEnumerable
    Inherited Members
    View.Enter
    View.Leave
    View.MouseEnter
    View.MouseLeave
    View.Driver
    View.Subviews
    View.Id
    View.IsCurrentTop
    View.WantMousePositionReports
    View.WantContinuousButtonPressed
    View.GetEnumerator()
    View.LayoutStyle
    View.Bounds
    View.X
    View.Y
    View.Width
    View.Height
    View.SuperView
    View.SetNeedsDisplay()
    View.SetNeedsDisplay(Rect)
    View.ChildNeedsDisplay()
    View.Add(View)
    View.Add(View[])
    View.RemoveAll()
    View.Remove(View)
    View.BringSubviewToFront(View)
    View.SendSubviewToBack(View)
    View.SendSubviewBackwards(View)
    View.BringSubviewForward(View)
    View.Clear()
    View.Clear(Rect)
    View.ScreenToView(Int32, Int32)
    View.ClipToBounds()
    View.SetClip(Rect)
    View.DrawFrame(Rect, Int32, Boolean)
    View.DrawHotString(ustring, Attribute, Attribute)
    View.DrawHotString(ustring, Boolean, ColorScheme)
    View.Move(Int32, Int32)
    View.HasFocus
    View.OnEnter()
    View.Focused
    View.MostFocused
    View.ColorScheme
    View.AddRune(Int32, Int32, Rune)
    View.ClearNeedsDisplay()
    View.SetFocus(View)
    View.KeyPress
    View.ProcessHotKey(KeyEvent)
    View.ProcessColdKey(KeyEvent)
    View.KeyDown
    View.OnKeyDown(KeyEvent)
    View.KeyUp
    View.OnKeyUp(KeyEvent)
    View.EnsureFocus()
    View.FocusFirst()
    View.FocusLast()
    View.FocusPrev()
    View.FocusNext()
    View.LayoutSubviews()
    View.ToString()
    View.OnMouseEnter(MouseEvent)
    View.OnMouseLeave(MouseEvent)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Terminal.Gui
    Assembly: Terminal.Gui.dll
    Syntax
    public class TextField : View, IEnumerable
    Remarks
    The TextField View provides editing functionality and mouse support.

    Constructors

    TextField(ustring)

    Public constructor that creates a text field, with layout controlled with X, Y, Width and Height.
    Declaration
    public TextField(ustring text)
    Parameters
    Type Name Description
    NStack.ustring text Initial text contents.

    TextField(Int32, Int32, Int32, ustring)

    Public constructor that creates a text field at an absolute position and size.
    Declaration
    public TextField(int x, int y, int w, ustring text)
    Parameters
    Type Name Description
    System.Int32 x The x coordinate.
    System.Int32 y The y coordinate.
    System.Int32 w The width.
    NStack.ustring text Initial text contents.

    TextField(String)

    Public constructor that creates a text field, with layout controlled with X, Y, Width and Height.
    Declaration
    public TextField(string text)
    Parameters
    Type Name Description
    System.String text Initial text contents.

    Properties

    CanFocus

    Declaration
    public override bool CanFocus { get; set; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    Responder.CanFocus

    CursorPosition

    Sets or gets the current cursor position.
    Declaration
    public int CursorPosition { get; set; }
    Property Value
    Type Description
    System.Int32

    Frame

    Declaration
    public override Rect Frame { get; set; }
    Property Value
    Type Description
    Rect
    Overrides
    View.Frame

    ReadOnly

    If set to true its not allow any changes in the text.
    Declaration
    public bool ReadOnly { get; set; }
    Property Value
    Type Description
    System.Boolean

    Secret

    Sets the secret property.
    Declaration
    public bool Secret { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks
    This makes the text entry suitable for entering passwords.

    SelectedLength

    Length of the selected text.
    Declaration
    public int SelectedLength { get; set; }
    Property Value
    Type Description
    System.Int32

    SelectedStart

    Start position of the selected text.
    Declaration
    public int SelectedStart { get; set; }
    Property Value
    Type Description
    System.Int32

    SelectedText

    The selected text.
    Declaration
    public ustring SelectedText { get; set; }
    Property Value
    Type Description
    NStack.ustring

    Text

    Sets or gets the text held by the view.
    Declaration
    public ustring Text { get; set; }
    Property Value
    Type Description
    NStack.ustring
    Remarks

    Used

    Tracks whether the text field should be considered "used", that is, that the user has moved in the entry, so new input should be appended at the cursor position, rather than clearing the entry
    Declaration
    public bool Used { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    ClearAllSelection()

    Clear the selected text.
    Declaration
    public void ClearAllSelection()

    Copy()

    Copy the selected text to the clipboard.
    Declaration
    public virtual void Copy()

    Cut()

    Cut the selected text to the clipboard.
    Declaration
    public virtual void Cut()

    MouseEvent(MouseEvent)

    Declaration
    public override bool MouseEvent(MouseEvent ev)
    Parameters
    Type Name Description
    MouseEvent ev
    Returns
    Type Description
    System.Boolean
    Overrides
    Responder.MouseEvent(MouseEvent)

    OnLeave()

    Declaration
    public override bool OnLeave()
    Returns
    Type Description
    System.Boolean
    Overrides
    View.OnLeave()

    Paste()

    Paste the selected text from the clipboard.
    Declaration
    public virtual void Paste()

    PositionCursor()

    Sets the cursor position.
    Declaration
    public override void PositionCursor()
    Overrides
    View.PositionCursor()

    ProcessKey(KeyEvent)

    Processes key presses for the TextField.
    Declaration
    public override bool ProcessKey(KeyEvent kb)
    Parameters
    Type Name Description
    KeyEvent kb
    Returns
    Type Description
    System.Boolean
    Overrides
    View.ProcessKey(KeyEvent)
    Remarks
    The TextField control responds to the following keys:
    KeysFunction
    Delete, BackspaceDeletes the character before cursor.

    Redraw(Rect)

    Declaration
    public override void Redraw(Rect region)
    Parameters
    Type Name Description
    Rect region
    Overrides
    View.Redraw(Rect)

    Events

    Changed

    Changed event, raised when the text has clicked.
    Declaration
    public event EventHandler<ustring> Changed
    Event Type
    Type Description
    System.EventHandler<NStack.ustring>
    Remarks
    This event is raised when the Text changes.

    Implements

    System.Collections.IEnumerable
    Back to top Generated by DocFX