Skip to content

Latest commit

 

History

History
569 lines (216 loc) · 20.2 KB

File metadata and controls

569 lines (216 loc) · 20.2 KB

Terminal Gui's Built-in Views

Terminal.Gui provides the following set of built-in views and controls for building terminal user interfaces:

AttributePicker

Allows the user to pick an xref:Terminal.Gui.Drawing.Attribute by selecting foreground and background colors, and text styles.

AttributePicker

Bar

A container for xref:Terminal.Gui.Views.Shortcut items that arranges them horizontally or vertically. Serves as the base class for xref:Terminal.Gui.Views.Menu, xref:Terminal.Gui.Views.MenuBar, and xref:Terminal.Gui.Views.StatusBar.

Bar

Button

Raises the xref:Terminal.Gui.ViewBase.View.Accepting and xref:Terminal.Gui.ViewBase.View.Accepted events when the user presses xref:Terminal.Gui.ViewBase.View.HotKey, Enter, or Space or clicks with the mouse.

Button

CharMap

A scrollable map of the Unicode codepoints.

CharMap

CheckBox

Shows a checkbox that can be cycled between two or three states.

CheckBox

Code

A read-only view that renders syntax-highlighted source code.

Code

ColorPicker

Color Picker supporting RGB, HSL, and HSV color models. Supports choosing colors with sliders and color names from the xref:Terminal.Gui.Drawing.IColorNameResolver.

ColorPicker

ColorPicker16

A simple color picker that supports the legacy 16 ANSI colors.

ColorPicker16

DateEditor

Provides date editing functionality using xref:Terminal.Gui.Views.TextValidateField with culture-aware formatting.

DateEditor

DatePicker

Lets the user pick a date from a visual calendar.

DatePicker

Dialog

A modal dialog window with buttons across the bottom. When a button is pressed, xref:Terminal.Gui.App.IRunnable%601.Result is set to the button's index (0-based).

Dialog

Dialog<T>

A generic modal dialog window with buttons across the bottom. Derive from this class to create dialogs that return custom result types.

Dialog-1

DropDownList

A dropdown/combo-box control that combines a xref:Terminal.Gui.Views.TextField with a popover xref:Terminal.Gui.Views.ListView for selecting from a list of items.

DropDownList

DropDownList<T>

A type-safe dropdown control for selecting a single value from an enum. Provides the same interface as xref:Terminal.Gui.Views.OptionSelector%601 but rendered as a compact dropdown list.

DropDownList-1

FileDialog

The base-class for xref:Terminal.Gui.Views.OpenDialog and xref:Terminal.Gui.Views.SaveDialog

FileDialog

FlagSelector

Provides a user interface for displaying and selecting non-mutually-exclusive flags from a provided dictionary. xref:Terminal.Gui.Views.FlagSelector%601 provides a type-safe version where a [Flags] enum can be provided.

FlagSelector

FlagSelector<T>

Provides a user interface for displaying and selecting non-mutually-exclusive flags in a type-safe way. xref:Terminal.Gui.Views.FlagSelector provides a non-type-safe version. TFlagsEnum must be a valid enum type with the '[Flags]' attribute.

FlagSelector-1

FrameView

A non-overlapped container for other views with a border and optional title.

FrameView

GraphView

Displays graphs (bar, scatter, etc.) with flexible labels, scaling, and scrolling.

GraphView

HexView

Provides a hex editor with the left side showing the hex values of the bytes in a Stream and the right side showing the contents (filtered to printable Unicode glyphs).

HexView

ImageView

Displays an image represented as a 2D array of xref:Terminal.Gui.Drawing.Color pixels. Supports two rendering modes: cell-based (one colored space per pixel, works everywhere) and sixel-based (when the terminal supports it).

ImageView

Label

Displays text that describes the View next in the xref:Terminal.Gui.ViewBase.View.SubViews. When the user presses a hotkey that matches the xref:Terminal.Gui.ViewBase.View.HotKey of the Label, the next xref:Terminal.Gui.ViewBase.View in xref:Terminal.Gui.ViewBase.View.SubViews will be activated.

Label

LegendAnnotation

Used by xref:Terminal.Gui.Views.GraphView to render symbol definitions in a graph, e.g. colors and their meanings

LegendAnnotation

Line

Draws a single line using the xref:Terminal.Gui.Drawing.LineStyle specified by xref:Terminal.Gui.Views.Line.Style.

Line

LinearMultiSelector

Convenience non-generic xref:Terminal.Gui.Views.LinearMultiSelector%601 closed over xref:System.String. Allows designer scenarios (e.g. AllViewsTester) and reflection-based instantiation to discover and create the view without supplying a type argument.

LinearMultiSelector

LinearMultiSelector<T>

A linear range view that allows selection of zero or more options from a typed list.

LinearMultiSelector-1

LinearRange

Convenience non-generic xref:Terminal.Gui.Views.LinearRange%601 closed over xref:System.String. Allows designer scenarios (e.g. AllViewsTester) and reflection-based instantiation to discover and create the view without supplying a type argument.

LinearRange

LinearRange<T>

A linear range view representing a contiguous range of options. The current value is a xref:Terminal.Gui.Views.LinearRangeSpan%601 whose xref:Terminal.Gui.Views.LinearRangeSpan%601.Kind is one of xref:Terminal.Gui.Views.LinearRangeSpanKind.None, xref:Terminal.Gui.Views.LinearRangeSpanKind.LeftBounded, xref:Terminal.Gui.Views.LinearRangeSpanKind.RightBounded, or xref:Terminal.Gui.Views.LinearRangeSpanKind.Closed.

LinearRange-1

LinearRangeViewBase<T>

Abstract base for linear range views (xref:Terminal.Gui.Views.LinearSelector%601, xref:Terminal.Gui.Views.LinearMultiSelector%601, xref:Terminal.Gui.Views.LinearRange%601) that present a list of typed options navigable by keyboard or mouse, and expose the current selection as a strongly-typed value via xref:Terminal.Gui.ViewBase.IValue%601.

LinearSelector

Convenience non-generic xref:Terminal.Gui.Views.LinearSelector%601 closed over xref:System.String. Allows designer scenarios (e.g. AllViewsTester) and reflection-based instantiation to discover and create the view without supplying a type argument.

LinearSelector

LinearSelector<T>

A linear range view that allows selection of a single option from a typed list of options.

LinearSelector-1

Link

Displays a clickable hyperlink with optional display text and a target URL.

Link

ListView

Provides a scrollable list of data where each item can be activated to perform an action.

ListView

ListView<T>

Provides a scrollable list of data where each item can be activated to perform an action, with a strongly-typed xref:Terminal.Gui.Views.ListView%601.Value property that returns the selected object of type T from the underlying xref:System.Collections.ObjectModel.ObservableCollection%601.

ListView-1

Markdown

A read-only view that renders Markdown-formatted text with styled headings, lists, links, code blocks, and more.

Markdown

MarkdownCodeBlock

A read-only view that renders a single Markdown fenced code block with a dimmed background and an optional copy button.

MarkdownCodeBlock

MarkdownTable

A read-only view that renders a single Markdown table with box-drawing borders via xref:Terminal.Gui.Drawing.LineCanvas and styled header/body text with inline Markdown formatting.

MarkdownTable

Menu

A vertically-oriented xref:Terminal.Gui.Views.Bar that contains xref:Terminal.Gui.Views.MenuItem items, supporting cascading sub-menus, selection tracking, and the xref:Terminal.Gui.ViewBase.IValue%601 pattern.

Menu

MenuBar

A horizontal xref:Terminal.Gui.Views.Menu that contains xref:Terminal.Gui.Views.MenuBarItem items. Each xref:Terminal.Gui.Views.MenuBarItem owns a xref:Terminal.Gui.Views.PopoverMenu that is displayed as a drop-down when the item is selected. Typically placed at the top of a window or view.

MenuBar

MenuBarItem

A xref:Terminal.Gui.Views.MenuItem-derived item for use in a xref:Terminal.Gui.Views.MenuBar. Each xref:Terminal.Gui.Views.MenuBarItem holds either a xref:Terminal.Gui.Views.MenuBarItem.PopoverMenu (modal, default) or an inline xref:Terminal.Gui.Views.MenuItem.SubMenu (non-modal) that is displayed as a drop-down menu when the item is selected. The behavior is controlled by the xref:Terminal.Gui.Views.MenuBarItem.UsePopoverMenu property.

MenuBarItem

MenuItem

A xref:Terminal.Gui.Views.Shortcut-derived item for use in a xref:Terminal.Gui.Views.Menu. Displays a command, help text, and key binding and supports nested xref:Terminal.Gui.Views.MenuItem.SubMenus for cascading menu hierarchies.

MenuItem

NumericUpDown

Enables the user to increase or decrease an int by clicking on the up or down buttons.

NumericUpDown

NumericUpDown<T>

Enables the user to increase or decrease a value with the mouse or keyboard in type-safe way.

NumericUpDown-1

OpenDialog

Provides an interactive xref:Terminal.Gui.Views.Dialog for selecting files or directories for opening

OpenDialog

OptionSelector

Provides a user interface for displaying and selecting a single item from a list of options. Each option is represented by a checkbox, but only one can be selected at a time. xref:Terminal.Gui.Views.OptionSelector%601 provides a type-safe version where a enum can be provided.

OptionSelector

OptionSelector<T>

Provides a user interface for displaying and selecting a single item from a list of options in a type-safe way. Each option is represented by a checkbox, but only one can be selected at a time. xref:Terminal.Gui.Views.OptionSelector provides a non-type-safe version.

OptionSelector-1

PopoverMenu

A xref:Terminal.Gui.App.IPopover-derived view that provides a cascading menu. Can be used as a context menu or a drop-down menu as part of xref:Terminal.Gui.Views.MenuBar.

ProgressBar

A Progress Bar view that can indicate progress of an activity visually.

ProgressBar

Prompt<T>

A dialog that wraps any xref:Terminal.Gui.ViewBase.View with Ok/Cancel buttons, extracting a typed result when the user accepts.

Prompt-2

Runnable

Base implementation of xref:Terminal.Gui.App.IRunnable for views that can be run as blocking sessions without returning a result.

Runnable

Runnable<T>

Base implementation of xref:Terminal.Gui.App.IRunnable%601 for views that can be run as blocking sessions.

Runnable-1

RunnableWrapper<T>

Wraps any xref:Terminal.Gui.ViewBase.View to make it runnable with a typed result without adding dialog buttons.

SaveDialog

Provides an interactive xref:Terminal.Gui.Views.Dialog for selecting files or directories for saving

SaveDialog

ScrollBar

Indicates the size of scrollable content and controls the position of the visible content, either vertically or horizontally. Two xref:Terminal.Gui.Views.Buttons are provided, one to scroll up or left and one to scroll down or right. Between the buttons is a xref:Terminal.Gui.Views.ScrollSlider that can be dragged to control the position of the visible content. The ScrollSlier is sized to show the proportion of the scrollable content to the size of the xref:Terminal.Gui.ViewBase.View.Viewport.

ScrollBar

ScrollButton

A xref:Terminal.Gui.Views.Button used to scroll content forward or backward. It enables mouse hold-repeat for continuous scrolling when the mouse button is held down. The button displays an arrow glyph determined by the combination of xref:Terminal.Gui.Views.ScrollButton.Direction and xref:Terminal.Gui.Views.ScrollButton.Orientation:

OrientationDirectionGlyph
HorizontalBackward xref:Terminal.Gui.Drawing.Glyphs.LeftArrow
HorizontalForward xref:Terminal.Gui.Drawing.Glyphs.RightArrow
VerticalBackward xref:Terminal.Gui.Drawing.Glyphs.UpArrow
VerticalForward xref:Terminal.Gui.Drawing.Glyphs.DownArrow

ScrollButton

ScrollSlider

Represents the proportion of the visible content to the Viewport in a xref:Terminal.Gui.Views.ScrollBar. Can be dragged with the mouse, constrained by the size of the Viewport of it's superview. Can be oriented either vertically or horizontally.

ScrollSlider

SelectorBase

The abstract base class for xref:Terminal.Gui.Views.OptionSelector%601 and xref:Terminal.Gui.Views.FlagSelector%601.

Shortcut

Displays a command, help text, and a key binding. Serves as the foundational building block for xref:Terminal.Gui.Views.Bar, xref:Terminal.Gui.Views.Menu, xref:Terminal.Gui.Views.MenuBar, and xref:Terminal.Gui.Views.StatusBar.

Shortcut

SpinnerView

Displays a spinning glyph or combinations of glyphs to indicate progress or activity

SpinnerView

StatusBar

A status bar is a xref:Terminal.Gui.ViewBase.View that snaps to the bottom of the Viewport displaying set of xref:Terminal.Gui.Views.Shortcuts. The xref:Terminal.Gui.Views.StatusBar should be context-sensitive. This means, if the main menu and an open text editor are visible, the items probably shown will be F1 Help F2 Save F3 Load. While a dialog to ask a file to load is executed, the remaining commands will probably be F1 Help. So for each context must be a new instance of a status bar.

StatusBar

TableView

Displays and enables infinite scrolling through tabular data based on a xref:Terminal.Gui.Views.ITableSource. See the TableView Deep Dive for more.

TableView

Tabs

A tabbed container xref:Terminal.Gui.ViewBase.View that renders each SubView as a selectable tab with a header drawn by xref:Terminal.Gui.ViewBase.Border. The currently focused SubView is the selected (front-most) tab.

Tabs

TextField

Single-line text editor.

TextField

TextValidateField

Masked text editor that validates input through a xref:Terminal.Gui.Views.ITextValidateProvider.

TextValidateField

TextView

Fully featured multi-line text editor.

TextView

TimeEditor

Provides time editing functionality using xref:Terminal.Gui.Views.TextValidateField with culture-aware formatting.

TimeEditor

TreeView

Convenience implementation of generic xref:Terminal.Gui.Views.TreeView%601 for any tree were all nodes implement xref:Terminal.Gui.Views.ITreeNode. See TreeView Deep Dive for more information.

TreeView

TreeView<T>

Hierarchical tree view with expandable branches. Branch objects are dynamically determined when expanded using a user defined xref:Terminal.Gui.Views.ITreeBuilder%601. See TreeView Deep Dive for more information.

TreeView-1

Window

An overlapped container for other views with a border and optional title.

Window

Wizard

A multi-step dialog for collecting related data across sequential steps.

Wizard

WizardStep

A single step in a xref:Terminal.Gui.Views.Wizard. Can contain arbitrary xref:Terminal.Gui.ViewBase.Views and display help text in the right xref:Terminal.Gui.ViewBase.Padding.

WizardStep