Class TabView
Control that hosts multiple sub views, presenting a single one at once
Assembly: Terminal.Gui.dll
Syntax
public class TabView : View, IDisposable, ISupportInitializeNotification, ISupportInitialize
Constructors
|
Edit this page
View Source
TabView()
Declaration
Fields
|
Edit this page
View Source
DefaultMaxTabTextWidth
Declaration
public const uint DefaultMaxTabTextWidth = 30
Field Value
Properties
|
Edit this page
View Source
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
|
Edit this page
View Source
SelectedTab
The currently selected member of
Tabs chosen by the user
Declaration
public TabView.Tab SelectedTab { get; set; }
Property Value
|
Edit this page
View Source
Style
Declaration
public TabView.TabStyle Style { get; set; }
Property Value
|
Edit this page
View Source
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
|
Edit this page
View Source
Tabs
All tabs currently hosted by the control
Declaration
public IReadOnlyCollection<TabView.Tab> Tabs { get; }
Property Value
Methods
|
Edit this page
View Source
AddTab(Tab, bool)
Adds the given
tab to
Tabs
Declaration
public void AddTab(TabView.Tab tab, bool andSelect)
Parameters
|
Edit this page
View Source
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()
|
Edit this page
View Source
Dispose(bool)
Disposes the control and all
Tabs
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type |
Name |
Description |
| bool |
disposing |
|
Overrides
|
Edit this page
View Source
EnsureSelectedTabIsVisible()
Declaration
public void EnsureSelectedTabIsVisible()
|
Edit this page
View Source
Declaration
public void EnsureValidScrollOffsets()
|
Edit this page
View Source
OnSelectedTabChanged(Tab, Tab)
Declaration
protected virtual void OnSelectedTabChanged(TabView.Tab oldTab, TabView.Tab newTab)
Parameters
|
Edit this page
View Source
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
Overrides
|
Edit this page
View Source
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
|
Edit this page
View Source
RemoveTab(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
|
Edit this page
View Source
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
Declaration
public void SwitchTabBy(int amount)
Parameters
| Type |
Name |
Description |
| int |
amount |
|
Events
|
Edit this page
View Source
SelectedTabChanged
Declaration
public event EventHandler<TabView.TabChangedEventArgs> SelectedTabChanged
Event Type
|
Edit this page
View Source
TabClicked
Event fired when a
TabView.Tab is clicked. Can be used to cancel navigation,
show context menu (e.g. on right click) etc.
Declaration
public event EventHandler<TabView.TabMouseEventArgs> TabClicked
Event Type
Implements