Search Results for

    Show / Hide Table of Contents

    Class TextField

    Single-line text entry View
    Inheritance
    System.Object
    Responder
    View
    TextField
    DateField
    TimeField
    Implements
    System.IDisposable
    System.ComponentModel.ISupportInitializeNotification
    System.ComponentModel.ISupportInitialize
    Remarks
    The TextField View provides editing functionality and mouse support.
    Inherited Members
    View.Added
    View.Removed
    View.Enter
    View.Leave
    View.MouseEnter
    View.MouseLeave
    View.MouseClick
    View.CanFocusChanged
    View.EnabledChanged
    View.VisibleChanged
    View.HotKeyChanged
    View.HotKey
    View.HotKeySpecifier
    View.Shortcut
    View.ShortcutTag
    View.ShortcutAction
    View.Data
    View.Driver
    View.Subviews
    View.TabIndexes
    View.TabIndex
    View.TabStop
    View.Id
    View.IsCurrentTop
    View.WantMousePositionReports
    View.WantContinuousButtonPressed
    View.LayoutStyle
    View.Bounds
    View.X
    View.Y
    View.Width
    View.Height
    View.ForceValidatePosDim
    View.GetMinWidthHeight(Size)
    View.SetMinWidthHeight()
    View.TextFormatter
    View.SuperView
    View.UpdateTextFormatterText()
    View.ProcessResizeView()
    View.SetNeedsDisplay()
    View.ClearLayoutNeeded()
    View.SetNeedsDisplay(Rect)
    View.SetChildNeedsDisplay()
    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, Boolean)
    View.HasFocus
    View.OnAdded(View)
    View.OnRemoved(View)
    View.Focused
    View.MostFocused
    View.ColorScheme
    View.AddRune(Int32, Int32, Rune)
    View.ClearNeedsDisplay()
    View.DrawContent
    View.OnDrawContent(Rect)
    View.DrawContentComplete
    View.OnDrawContentComplete(Rect)
    View.SetFocus()
    View.KeyPress
    View.InvokeKeybindings(KeyEvent)
    View.AddKeyBinding(Key, Command[])
    View.ReplaceKeyBinding(Key, Key)
    View.ContainsKeyBinding(Key)
    View.ClearKeybindings()
    View.ClearKeybinding(Key)
    View.ClearKeybinding(Command[])
    View.AddCommand(Command, Func<Nullable<Boolean>>)
    View.GetSupportedCommands()
    View.GetKeyFromCommand(Command[])
    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.LayoutStarted
    View.LayoutComplete
    View.Initialized
    View.LayoutSubviews()
    View.AutoSize
    View.PreserveTrailingSpaces
    View.TextAlignment
    View.VerticalTextAlignment
    View.TextDirection
    View.IsInitialized
    View.IsAdded
    View.Enabled
    View.Visible
    View.Border
    View.ToString()
    View.GetAutoSize()
    View.GetHotKeySpecifierLength(Boolean)
    View.GetTextFormatterBoundsSize()
    View.GetBoundsTextFormatterSize()
    View.OnMouseEnter(MouseEvent)
    View.OnMouseLeave(MouseEvent)
    View.OnMouseEvent(MouseEvent)
    View.OnMouseClick(View.MouseEventArgs)
    View.OnCanFocusChanged()
    View.OnEnabledChanged()
    View.OnVisibleChanged()
    View.Dispose(Boolean)
    View.BeginInit()
    View.EndInit()
    View.SetWidth(Int32, Int32)
    View.SetHeight(Int32, Int32)
    View.GetCurrentWidth(Int32)
    View.GetCurrentHeight(Int32)
    View.GetTopSuperView()
    Responder.Dispose()
    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, IDisposable, ISupportInitializeNotification, ISupportInitialize

    Constructors

    | Improve this Doc View Source

    TextField()

    Initializes a new instance of the TextField class using Computed positioning.
    Declaration
    public TextField()
    | Improve this Doc View Source

    TextField(ustring)

    Initializes a new instance of the TextField class using Computed positioning.
    Declaration
    public TextField(ustring text)
    Parameters
    Type Name Description
    NStack.ustring text Initial text contents.
    | Improve this Doc View Source

    TextField(Int32, Int32, Int32, ustring)

    Initializes a new instance of the TextField class using Absolute positioning.
    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.
    | Improve this Doc View Source

    TextField(String)

    Initializes a new instance of the TextField class using Computed positioning.
    Declaration
    public TextField(string text)
    Parameters
    Type Name Description
    System.String text Initial text contents.

    Properties

    | Improve this Doc View Source

    Autocomplete

    Provides autocomplete context menu based on suggestions at the current cursor position. Populate AllSuggestions to enable this feature.
    Declaration
    public IAutocomplete Autocomplete { get; protected set; }
    Property Value
    Type Description
    IAutocomplete
    | Improve this Doc View Source

    CanFocus

    Declaration
    public override bool CanFocus { get; set; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    View.CanFocus
    | Improve this Doc View Source

    ContextMenu

    Get the ContextMenu for this view.
    Declaration
    public ContextMenu ContextMenu { get; }
    Property Value
    Type Description
    ContextMenu
    | Improve this Doc View Source

    CursorPosition

    Sets or gets the current cursor position.
    Declaration
    public virtual int CursorPosition { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    DesiredCursorVisibility

    Get / Set the wished cursor when the field is focused
    Declaration
    public CursorVisibility DesiredCursorVisibility { get; set; }
    Property Value
    Type Description
    CursorVisibility
    | Improve this Doc View Source

    Frame

    Declaration
    public override Rect Frame { get; set; }
    Property Value
    Type Description
    Rect
    Overrides
    View.Frame
    | Improve this Doc View Source

    HasHistoryChanges

    Indicates whatever the text has history changes or not. true if the text has history changes false otherwise.
    Declaration
    public bool HasHistoryChanges { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsDirty

    Indicates whatever the text was changed or not. true if the text was changed false otherwise.
    Declaration
    public bool IsDirty { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    ScrollOffset

    Gets the left offset position.
    Declaration
    public int ScrollOffset { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Secret

    Sets the secret property.
    Declaration
    public bool Secret { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    SelectedLength

    Length of the selected text.
    Declaration
    public int SelectedLength { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    SelectedStart

    Start position of the selected text.
    Declaration
    public int SelectedStart { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    SelectedText

    The selected text.
    Declaration
    public ustring SelectedText { get; }
    Property Value
    Type Description
    NStack.ustring
    | Improve this Doc View Source

    Text

    Sets or gets the text held by the view.
    Declaration
    public ustring Text { get; set; }
    Property Value
    Type Description
    NStack.ustring
    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    ClearAllSelection()

    Clear the selected text.
    Declaration
    public void ClearAllSelection()
    | Improve this Doc View Source

    ClearHistoryChanges()

    Allows clearing the Terminal.Gui.HistoryText.HistoryTextItem items updating the original text.
    Declaration
    public void ClearHistoryChanges()
    | Improve this Doc View Source

    Copy()

    Copy the selected text to the clipboard.
    Declaration
    public virtual void Copy()
    | Improve this Doc View Source

    Cut()

    Cut the selected text to the clipboard.
    Declaration
    public virtual void Cut()
    | Improve this Doc View Source

    DeleteAll()

    Deletes all text.
    Declaration
    public void DeleteAll()
    | Improve this Doc View Source

    DeleteCharLeft(Boolean)

    Deletes the left character.
    Declaration
    public virtual void DeleteCharLeft(bool useOldCursorPos = true)
    Parameters
    Type Name Description
    System.Boolean useOldCursorPos
    | Improve this Doc View Source

    DeleteCharRight()

    Deletes the right character.
    Declaration
    public virtual void DeleteCharRight()
    | Improve this Doc View Source

    GetNormalColor()

    Declaration
    public override Attribute GetNormalColor()
    Returns
    Type Description
    Attribute
    Overrides
    View.GetNormalColor()
    | Improve this Doc View Source

    InsertText(String, Boolean)

    Inserts the given toAdd text at the current cursor position exactly as if the user had just typed it
    Declaration
    public void InsertText(string toAdd, bool useOldCursorPos = true)
    Parameters
    Type Name Description
    System.String toAdd Text to add
    System.Boolean useOldCursorPos If uses the Terminal.Gui.TextField.oldCursorPos.
    | Improve this Doc View Source

    KillWordBackwards()

    Deletes word backwards.
    Declaration
    public virtual void KillWordBackwards()
    | Improve this Doc View Source

    KillWordForwards()

    Deletes word forwards.
    Declaration
    public virtual void KillWordForwards()
    | Improve this Doc View Source

    MouseEvent(MouseEvent)

    Declaration
    public override bool MouseEvent(MouseEvent ev)
    Parameters
    Type Name Description
    MouseEvent ev
    Returns
    Type Description
    System.Boolean
    Overrides
    Responder.MouseEvent(MouseEvent)
    | Improve this Doc View Source

    OnEnter(View)

    Declaration
    public override bool OnEnter(View view)
    Parameters
    Type Name Description
    View view
    Returns
    Type Description
    System.Boolean
    Overrides
    View.OnEnter(View)
    | Improve this Doc View Source

    OnLeave(View)

    Declaration
    public override bool OnLeave(View view)
    Parameters
    Type Name Description
    View view
    Returns
    Type Description
    System.Boolean
    Overrides
    View.OnLeave(View)
    | Improve this Doc View Source

    OnTextChanging(ustring)

    Virtual method that invoke the TextChanging event if it's defined.
    Declaration
    public virtual TextChangingEventArgs OnTextChanging(ustring newText)
    Parameters
    Type Name Description
    NStack.ustring newText The new text to be replaced.
    Returns
    Type Description
    TextChangingEventArgs Returns the TextChangingEventArgs
    | Improve this Doc View Source

    Paste()

    Paste the selected text from the clipboard.
    Declaration
    public virtual void Paste()
    | Improve this Doc View Source

    PositionCursor()

    Sets the cursor position.
    Declaration
    public override void PositionCursor()
    Overrides
    View.PositionCursor()
    | Improve this Doc View Source

    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)
    | Improve this Doc View Source

    Redraw(Rect)

    Declaration
    public override void Redraw(Rect bounds)
    Parameters
    Type Name Description
    Rect bounds
    Overrides
    View.Redraw(Rect)
    | Improve this Doc View Source

    SelectAll()

    Selects all text.
    Declaration
    public void SelectAll()

    Events

    | Improve this Doc View Source

    TextChanged

    Changed event, raised when the text has changed.
    Declaration
    public event Action<ustring> TextChanged
    Event Type
    Type Description
    System.Action<NStack.ustring>
    | Improve this Doc View Source

    TextChanging

    Changing event, raised before the Text changes and can be canceled or changing the new text.
    Declaration
    public event Action<TextChangingEventArgs> TextChanging
    Event Type
    Type Description
    System.Action<TextChangingEventArgs>

    Implements

    System.IDisposable
    System.ComponentModel.ISupportInitializeNotification
    System.ComponentModel.ISupportInitialize
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX