Table of Contents

Class TabView

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

Control that hosts multiple sub views, presenting a single one at once

public class TabView : View, IDisposable, ISupportInitializeNotification, ISupportInitialize
Inheritance
TabView
Implements
Inherited Members

Constructors

TabView()

Initializes a TabView class using Computed layout.

Fields

DefaultMaxTabTextWidth

The default MaxTabTextWidth to set on new TabView controls

Properties

MaxTabTextWidth

The maximum number of characters to render in a Tab header. This prevents one long tab from pushing out all the others.

SelectedTab

The currently selected member of Tabs chosen by the user

Style

Render choices for how to display tabs. After making changes, call ApplyStyleChanges()

TabScrollOffset

When there are too many tabs to render, this indicates the first tab to render on the screen.

Tabs

All tabs currently hosted by the control

Methods

AddTab(Tab, bool)

Adds the given tab to Tabs

ApplyStyleChanges()

Updates the control to use the latest state settings in Style. This can change the size of the client area of the tab (for rendering the selected tab's content). This method includes a call to SetNeedsDisplay()

Dispose(bool)

Disposes the control and all Tabs

EnsureSelectedTabIsVisible()

Updates TabScrollOffset to ensure that SelectedTab is visible

EnsureValidScrollOffsets()

Updates TabScrollOffset to be a valid index of Tabs

OnSelectedTabChanged(Tab, Tab)

Raises the SelectedTabChanged event

ProcessKey(KeyEvent)

If the view is focused, gives the view a chance to process the keystroke.

Redraw(Rect)

Redraws this view and its subviews; only redraws the views that have been flagged for a re-display.

RemoveTab(Tab)

Removes the given tab from Tabs. Caller is responsible for disposing the tab's hosted View if appropriate.

SwitchTabBy(int)

Changes the SelectedTab by the given amount.
Positive for right, negative for left. If no tab is currently selected then the first tab will become selected

Events

SelectedTabChanged

Event for when SelectedTab changes

TabClicked

Event fired when a TabView.Tab is clicked. Can be used to cancel navigation, show context menu (e.g. on right click) etc.