Class TabView
Control that hosts multiple sub views, presenting a single one at once
Inheritance
System.Object
TabView
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize
Assembly: Terminal.Gui.dll
Syntax
public class TabView : View
Constructors
TabView()
Declaration
Fields
DefaultMaxTabTextWidth
Declaration
public const uint DefaultMaxTabTextWidth = 30U
Field Value
Type |
Description |
System.UInt32 |
|
Properties
MaxTabTextWidth
The maximum number of characters to render in a Tab header. This prevents one long tab
from pushing out all the others.
Declaration
public uint MaxTabTextWidth { get; set; }
Property Value
Type |
Description |
System.UInt32 |
|
SelectedTab
The currently selected member of
Tabs chosen by the user
Declaration
public TabView.Tab SelectedTab { get; set; }
Property Value
Style
Declaration
public TabView.TabStyle Style { get; set; }
Property Value
Tabs
All tabs currently hosted by the control
Declaration
public IReadOnlyCollection<TabView.Tab> Tabs { get; }
Property Value
Type |
Description |
System.Collections.Generic.IReadOnlyCollection<TabView.Tab> |
|
When there are too many tabs to render, this indicates the first
tab to render on the screen.
Declaration
public int TabScrollOffset { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
AddTab(TabView.Tab, Boolean)
Adds the given
tab
to
Tabs
Declaration
public void AddTab(TabView.Tab tab, bool andSelect)
Parameters
Type |
Name |
Description |
TabView.Tab |
tab |
|
System.Boolean |
andSelect |
True to make the newly added Tab the SelectedTab |
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()
Declaration
public void ApplyStyleChanges()
Dispose(Boolean)
Disposes the control and all
Tabs
Declaration
protected override void Dispose(bool disposing)
Parameters
Type |
Name |
Description |
System.Boolean |
disposing |
|
Overrides
EnsureSelectedTabIsVisible()
Declaration
public void EnsureSelectedTabIsVisible()
Declaration
public void EnsureValidScrollOffsets()
OnSelectedTabChanged(TabView.Tab, TabView.Tab)
Declaration
protected virtual void OnSelectedTabChanged(TabView.Tab oldTab, TabView.Tab newTab)
Parameters
ProcessKey(KeyEvent)
If the view is focused, gives the view a
chance to process the keystroke.
Declaration
public override bool ProcessKey(KeyEvent keyEvent)
Parameters
Type |
Name |
Description |
KeyEvent |
keyEvent |
Contains the details about the key that produced the event. |
Returns
Type |
Description |
System.Boolean |
|
Overrides
Redraw(Rect)
Redraws this view and its subviews; only redraws the views that have been flagged for a re-display.
Declaration
public override void Redraw(Rect bounds)
Parameters
Type |
Name |
Description |
Rect |
bounds |
The bounds (view-relative region) to redraw. |
Overrides
RemoveTab(TabView.Tab)
Removes the given
tab
from
Tabs.
Caller is responsible for disposing the tab's hosted
View
if appropriate.
Declaration
public void RemoveTab(TabView.Tab tab)
Parameters
SwitchTabBy(Int32)
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
Declaration
public void SwitchTabBy(int amount)
Parameters
Type |
Name |
Description |
System.Int32 |
amount |
|
Events
SelectedTabChanged
Declaration
public event EventHandler<TabView.TabChangedEventArgs> SelectedTabChanged
Event Type
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize