Search Results for

    Show / Hide Table of Contents

    Class ConsoleDriver

    ConsoleDriver is an abstract class that defines the requirements for a console driver. There are currently three implementations: Terminal.Gui.CursesDriver (for Unix and Mac), Terminal.Gui.WindowsDriver, and Terminal.Gui.NetDriver that uses the .NET Console API.
    Inheritance
    System.Object
    ConsoleDriver
    FakeDriver
    Inherited Members
    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)
    System.Object.ToString()
    Namespace: Terminal.Gui
    Assembly: Terminal.Gui.dll
    Syntax
    public abstract class ConsoleDriver

    Fields

    | Improve this Doc View Source

    BlocksMeterSegment

    Blocks Segment indicator for meter views (e.g. ProgressBar.
    Declaration
    public Rune BlocksMeterSegment
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    BottomTee

    The bottom tee.
    Declaration
    public Rune BottomTee
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    Checked

    Checkmark.
    Declaration
    public Rune Checked
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    ContinuousMeterSegment

    Continuous Segment indicator for meter views (e.g. ProgressBar.
    Declaration
    public Rune ContinuousMeterSegment
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    Diamond

    Diamond character
    Declaration
    public Rune Diamond
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    DownArrow

    Down Arrow.
    Declaration
    public Rune DownArrow
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    HDLine

    Horizontal double line character.
    Declaration
    public Rune HDLine
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    HLine

    Horizontal line character.
    Declaration
    public Rune HLine
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    HRLine

    Horizontal line character for rounded corners.
    Declaration
    public Rune HRLine
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    LeftArrow

    Left Arrow.
    Declaration
    public Rune LeftArrow
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    LeftBracket

    Left frame/bracket (e.g. '[' for Button).
    Declaration
    public Rune LeftBracket
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    LeftDefaultIndicator

    Left indicator for default action (e.g. for Button).
    Declaration
    public Rune LeftDefaultIndicator
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    LeftTee

    Left tee
    Declaration
    public Rune LeftTee
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    LLCorner

    Lower left corner
    Declaration
    public Rune LLCorner
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    LLDCorner

    Lower left double corner
    Declaration
    public Rune LLDCorner
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    LLRCorner

    Lower left rounded corner
    Declaration
    public Rune LLRCorner
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    LRCorner

    Lower right corner
    Declaration
    public Rune LRCorner
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    LRDCorner

    Lower right double corner
    Declaration
    public Rune LRDCorner
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    LRRCorner

    Lower right rounded corner
    Declaration
    public Rune LRRCorner
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    RightArrow

    Right Arrow.
    Declaration
    public Rune RightArrow
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    RightBracket

    Right frame/bracket (e.g. ']' for Button).
    Declaration
    public Rune RightBracket
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    RightDefaultIndicator

    Right indicator for default action (e.g. for Button).
    Declaration
    public Rune RightDefaultIndicator
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    RightTee

    Right tee
    Declaration
    public Rune RightTee
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    Selected

    Selected mark.
    Declaration
    public Rune Selected
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    Stipple

    Stipple pattern
    Declaration
    public Rune Stipple
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    TerminalResized

    The handler fired when the terminal is resized.
    Declaration
    protected Action TerminalResized
    Field Value
    Type Description
    System.Action
    | Improve this Doc View Source

    TopTee

    Top tee
    Declaration
    public Rune TopTee
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    ULCorner

    Upper left corner
    Declaration
    public Rune ULCorner
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    ULDCorner

    Upper left double corner
    Declaration
    public Rune ULDCorner
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    ULRCorner

    Upper left rounded corner
    Declaration
    public Rune ULRCorner
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    UnChecked

    Un-checked checkmark.
    Declaration
    public Rune UnChecked
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    UnSelected

    Un-selected selected mark.
    Declaration
    public Rune UnSelected
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    UpArrow

    Up Arrow.
    Declaration
    public Rune UpArrow
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    URCorner

    Upper right corner
    Declaration
    public Rune URCorner
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    URDCorner

    Upper right double corner
    Declaration
    public Rune URDCorner
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    URRCorner

    Upper right rounded corner
    Declaration
    public Rune URRCorner
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    VDLine

    Vertical double line character.
    Declaration
    public Rune VDLine
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    VLine

    Vertical line character.
    Declaration
    public Rune VLine
    Field Value
    Type Description
    System.Rune
    | Improve this Doc View Source

    VRLine

    Vertical line character for rounded corners.
    Declaration
    public Rune VRLine
    Field Value
    Type Description
    System.Rune

    Properties

    | Improve this Doc View Source

    Clip

    Controls the current clipping region that AddRune/AddStr is subject to.
    Declaration
    public Rect Clip { get; set; }
    Property Value
    Type Description
    Rect The clip.
    | Improve this Doc View Source

    Clipboard

    Get the operation system clipboard.
    Declaration
    public abstract IClipboard Clipboard { get; }
    Property Value
    Type Description
    IClipboard
    | Improve this Doc View Source

    Cols

    The current number of columns in the terminal.
    Declaration
    public abstract int Cols { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Contents

    The format is rows, columns and 3 values on the last column: Rune, Attribute and Dirty Flag
    Declaration
    public virtual int[,, ] Contents { get; }
    Property Value
    Type Description
    System.Int32[,,]
    | Improve this Doc View Source

    Diagnostics

    Set flags to enable/disable ConsoleDriver diagnostics.
    Declaration
    public static ConsoleDriver.DiagnosticFlags Diagnostics { get; set; }
    Property Value
    Type Description
    ConsoleDriver.DiagnosticFlags
    | Improve this Doc View Source

    HeightAsBuffer

    If false height is measured by the window height and thus no scrolling. If true then height is measured by the buffer height, enabling scrolling.
    Declaration
    public abstract bool HeightAsBuffer { get; set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Left

    The current left in the terminal.
    Declaration
    public abstract int Left { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Rows

    The current number of rows in the terminal.
    Declaration
    public abstract int Rows { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Top

    The current top in the terminal.
    Declaration
    public abstract int Top { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    AddRune(Rune)

    Adds the specified rune to the display at the current cursor position
    Declaration
    public abstract void AddRune(Rune rune)
    Parameters
    Type Name Description
    System.Rune rune Rune to add.
    | Improve this Doc View Source

    AddStr(ustring)

    Adds the specified
    Declaration
    public abstract void AddStr(ustring str)
    Parameters
    Type Name Description
    NStack.ustring str String.
    | Improve this Doc View Source

    CookMouse()

    Enables the cooked event processing from the mouse driver
    Declaration
    public abstract void CookMouse()
    | Improve this Doc View Source

    CreateColors(Boolean)

    Create all Colors with the ColorScheme for the console driver.
    Declaration
    public void CreateColors(bool hasColors = true)
    Parameters
    Type Name Description
    System.Boolean hasColors Flag indicating if colors are supported.
    | Improve this Doc View Source

    DrawFrame(Rect, Int32, Boolean)

    Draws a frame on the specified region with the specified padding around the frame.
    Declaration
    public virtual void DrawFrame(Rect region, int padding, bool fill)
    Parameters
    Type Name Description
    Rect region Screen relative region where the frame will be drawn.
    System.Int32 padding Padding to add on the sides.
    System.Boolean fill If set to true it will clear the contents with the current color, otherwise the contents will be left untouched.
    | Improve this Doc View Source

    DrawWindowFrame(Rect, Int32, Int32, Int32, Int32, Boolean, Boolean, Border)

    Draws a frame for a window with padding and an optional visible border inside the padding.
    Declaration
    public virtual void DrawWindowFrame(Rect region, int paddingLeft = 0, int paddingTop = 0, int paddingRight = 0, int paddingBottom = 0, bool border = true, bool fill = false, Border borderContent = null)
    Parameters
    Type Name Description
    Rect region Screen relative region where the frame will be drawn.
    System.Int32 paddingLeft Number of columns to pad on the left (if 0 the border will not appear on the left).
    System.Int32 paddingTop Number of rows to pad on the top (if 0 the border and title will not appear on the top).
    System.Int32 paddingRight Number of columns to pad on the right (if 0 the border will not appear on the right).
    System.Int32 paddingBottom Number of rows to pad on the bottom (if 0 the border will not appear on the bottom).
    System.Boolean border If set to true and any padding dimension is > 0 the border will be drawn.
    System.Boolean fill If set to true it will clear the content area (the area inside the padding) with the current color, otherwise the content area will be left untouched.
    Border borderContent The Border to be used if defined.
    | Improve this Doc View Source

    DrawWindowTitle(Rect, ustring, Int32, Int32, Int32, Int32, TextAlignment)

    Draws the title for a Window-style view incorporating padding.
    Declaration
    public virtual void DrawWindowTitle(Rect region, ustring title, int paddingLeft, int paddingTop, int paddingRight, int paddingBottom, TextAlignment textAlignment = TextAlignment.Left)
    Parameters
    Type Name Description
    Rect region Screen relative region where the frame will be drawn.
    NStack.ustring title The title for the window. The title will only be drawn if title is not null or empty and paddingTop is greater than 0.
    System.Int32 paddingLeft Number of columns to pad on the left (if 0 the border will not appear on the left).
    System.Int32 paddingTop Number of rows to pad on the top (if 0 the border and title will not appear on the top).
    System.Int32 paddingRight Number of columns to pad on the right (if 0 the border will not appear on the right).
    System.Int32 paddingBottom Number of rows to pad on the bottom (if 0 the border will not appear on the bottom).
    TextAlignment textAlignment Not yet implemented.
    | Improve this Doc View Source

    End()

    Ends the execution of the console driver.
    Declaration
    public abstract void End()
    | Improve this Doc View Source

    EnsureCursorVisibility()

    Ensure the cursor visibility
    Declaration
    public abstract bool EnsureCursorVisibility()
    Returns
    Type Description
    System.Boolean true upon success
    | Improve this Doc View Source

    GetAttribute()

    Gets the current Attribute.
    Declaration
    public abstract Attribute GetAttribute()
    Returns
    Type Description
    Attribute The current attribute.
    | Improve this Doc View Source

    GetColors(Int32, out Color, out Color)

    Gets the foreground and background colors based on the value.
    Declaration
    public abstract bool GetColors(int value, out Color foreground, out Color background)
    Parameters
    Type Name Description
    System.Int32 value The value.
    Color foreground The foreground.
    Color background The background.
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    GetCursorVisibility(out CursorVisibility)

    Retreive the cursor caret visibility
    Declaration
    public abstract bool GetCursorVisibility(out CursorVisibility visibility)
    Parameters
    Type Name Description
    CursorVisibility visibility The current CursorVisibility
    Returns
    Type Description
    System.Boolean true upon success
    | Improve this Doc View Source

    Init(Action)

    Initializes the driver
    Declaration
    public abstract void Init(Action terminalResized)
    Parameters
    Type Name Description
    System.Action terminalResized Method to invoke when the terminal is resized.
    | Improve this Doc View Source

    IsValidContent(Int32, Int32, Rect)

    Ensures that the column and line are in a valid range from the size of the driver.
    Declaration
    public bool IsValidContent(int col, int row, Rect clip)
    Parameters
    Type Name Description
    System.Int32 col The column.
    System.Int32 row The row.
    Rect clip The clip.
    Returns
    Type Description
    System.Boolean trueif it's a valid range,falseotherwise.
    | Improve this Doc View Source

    MakeAttribute(Color, Color)

    Make the attribute for the foreground and background colors.
    Declaration
    public abstract Attribute MakeAttribute(Color fore, Color back)
    Parameters
    Type Name Description
    Color fore Foreground.
    Color back Background.
    Returns
    Type Description
    Attribute
    | Improve this Doc View Source

    MakeColor(Color, Color)

    Make the Colors for the ColorScheme.
    Declaration
    public abstract Attribute MakeColor(Color foreground, Color background)
    Parameters
    Type Name Description
    Color foreground The foreground color.
    Color background The background color.
    Returns
    Type Description
    Attribute The attribute for the foreground and background colors.
    | Improve this Doc View Source

    MakePrintable(Rune)

    Ensures a Rune is not a control character and can be displayed by translating characters below 0x20 to equivalent, printable, Unicode chars.
    Declaration
    public static Rune MakePrintable(Rune c)
    Parameters
    Type Name Description
    System.Rune c Rune to translate
    Returns
    Type Description
    System.Rune
    | Improve this Doc View Source

    Move(Int32, Int32)

    Moves the cursor to the specified column and row.
    Declaration
    public abstract void Move(int col, int row)
    Parameters
    Type Name Description
    System.Int32 col Column to move the cursor to.
    System.Int32 row Row to move the cursor to.
    | Improve this Doc View Source

    PrepareToRun(MainLoop, Action<KeyEvent>, Action<KeyEvent>, Action<KeyEvent>, Action<MouseEvent>)

    Prepare the driver and set the key and mouse events handlers.
    Declaration
    public abstract void PrepareToRun(MainLoop mainLoop, Action<KeyEvent> keyHandler, Action<KeyEvent> keyDownHandler, Action<KeyEvent> keyUpHandler, Action<MouseEvent> mouseHandler)
    Parameters
    Type Name Description
    MainLoop mainLoop The main loop.
    System.Action<KeyEvent> keyHandler The handler for ProcessKey
    System.Action<KeyEvent> keyDownHandler The handler for key down events
    System.Action<KeyEvent> keyUpHandler The handler for key up events
    System.Action<MouseEvent> mouseHandler The handler for mouse events
    | Improve this Doc View Source

    Refresh()

    Updates the screen to reflect all the changes that have been done to the display buffer
    Declaration
    public abstract void Refresh()
    | Improve this Doc View Source

    ResizeScreen()

    Resizes the clip area when the screen is resized.
    Declaration
    public abstract void ResizeScreen()
    | Improve this Doc View Source

    SendKeys(Char, ConsoleKey, Boolean, Boolean, Boolean)

    Allows sending keys without typing on a keyboard.
    Declaration
    public abstract void SendKeys(char keyChar, ConsoleKey key, bool shift, bool alt, bool control)
    Parameters
    Type Name Description
    System.Char keyChar The character key.
    System.ConsoleKey key The key.
    System.Boolean shift If shift key is sending.
    System.Boolean alt If alt key is sending.
    System.Boolean control If control key is sending.
    | Improve this Doc View Source

    SetAttribute(Attribute)

    Selects the specified attribute as the attribute to use for future calls to AddRune, AddString.
    Declaration
    public abstract void SetAttribute(Attribute c)
    Parameters
    Type Name Description
    Attribute c C.
    | Improve this Doc View Source

    SetColors(ConsoleColor, ConsoleColor)

    Set Colors from limit sets of colors.
    Declaration
    public abstract void SetColors(ConsoleColor foreground, ConsoleColor background)
    Parameters
    Type Name Description
    System.ConsoleColor foreground Foreground.
    System.ConsoleColor background Background.
    | Improve this Doc View Source

    SetColors(Int16, Int16)

    Advanced uses - set colors to any pre-set pairs, you would need to init_color that independently with the R, G, B values.
    Declaration
    public abstract void SetColors(short foregroundColorId, short backgroundColorId)
    Parameters
    Type Name Description
    System.Int16 foregroundColorId Foreground color identifier.
    System.Int16 backgroundColorId Background color identifier.
    | Improve this Doc View Source

    SetCursorVisibility(CursorVisibility)

    Change the cursor caret visibility
    Declaration
    public abstract bool SetCursorVisibility(CursorVisibility visibility)
    Parameters
    Type Name Description
    CursorVisibility visibility The wished CursorVisibility
    Returns
    Type Description
    System.Boolean true upon success
    | Improve this Doc View Source

    SetTerminalResized(Action)

    Set the handler when the terminal is resized.
    Declaration
    public void SetTerminalResized(Action terminalResized)
    Parameters
    Type Name Description
    System.Action terminalResized
    | Improve this Doc View Source

    StartReportingMouseMoves()

    Start of mouse moves.
    Declaration
    public abstract void StartReportingMouseMoves()
    | Improve this Doc View Source

    StopReportingMouseMoves()

    Stop reporting mouses moves.
    Declaration
    public abstract void StopReportingMouseMoves()
    | Improve this Doc View Source

    Suspend()

    Suspend the application, typically needs to save the state, suspend the app and upon return, reset the console driver.
    Declaration
    public abstract void Suspend()
    | Improve this Doc View Source

    UncookMouse()

    Disables the cooked event processing from the mouse driver. At startup, it is assumed mouse events are cooked.
    Declaration
    public abstract void UncookMouse()
    | Improve this Doc View Source

    UpdateCursor()

    Updates the location of the cursor position
    Declaration
    public abstract void UpdateCursor()
    | Improve this Doc View Source

    UpdateOffScreen()

    Reset and recreate the contents and the driver buffer.
    Declaration
    public abstract void UpdateOffScreen()
    | Improve this Doc View Source

    UpdateScreen()

    Redraws the physical screen with the contents that have been queued up via any of the printing commands.
    Declaration
    public abstract void UpdateScreen()
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX