Class TabView
Control that hosts multiple sub views, presenting a single one at once
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize
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)
Namespace: Terminal.Gui
Assembly: Terminal.Gui.dll
Syntax
public class TabView : View, IDisposable, ISupportInitializeNotification, ISupportInitialize
Constructors
TabView()
Declaration
public TabView()
Fields
DefaultMaxTabTextWidth
The default MaxTabTextWidth to set on new TabView controls
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
Type | Description |
---|---|
TabView.Tab |
Style
Render choices for how to display tabs. After making changes, call ApplyStyleChanges()
Declaration
public TabView.TabStyle Style { get; set; }
Property Value
Type | Description |
---|---|
TabView.TabStyle |
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> |
TabScrollOffset
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()
Updates TabScrollOffset to ensure that SelectedTab is visible
Declaration
public void EnsureSelectedTabIsVisible()
EnsureValidScrollOffsets()
Updates TabScrollOffset to be a valid index of Tabs
Declaration
public void EnsureValidScrollOffsets()
Remarks
Changes will not be immediately visible in the display until you call SetNeedsDisplay()
OnSelectedTabChanged(TabView.Tab, TabView.Tab)
Raises the SelectedTabChanged event
Declaration
protected virtual void OnSelectedTabChanged(TabView.Tab oldTab, TabView.Tab newTab)
Parameters
Type | Name | Description |
---|---|---|
TabView.Tab | oldTab | |
TabView.Tab | newTab |
ProcessKey(KeyEvent)
Declaration
public override bool ProcessKey(KeyEvent keyEvent)
Parameters
Type | Name | Description |
---|---|---|
KeyEvent | keyEvent |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
Redraw(Rect)
Declaration
public override void Redraw(Rect bounds)
Parameters
Type | Name | Description |
---|---|---|
Rect | bounds |
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
Type | Name | Description |
---|---|---|
TabView.Tab | tab |
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
Event for when SelectedTab changes
Declaration
public event EventHandler<TabView.TabChangedEventArgs> SelectedTabChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TabView.TabChangedEventArgs> |
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize