Class TabBar

Namespace
Forma
Assembly
Forma.dll

Godot-style tab strip with per-tab state, tooltips, metadata and optional close buttons.

public sealed class TabBar : TemplatedControl, IAddChild<Control>, IAddChild, INotifyPropertyChanged, IDisposable
Inheritance
TabBar
Implements
Inherited Members

Constructors

TabBar()

public TabBar()

Properties

AccessibilityRole

public override AccessibilityRole AccessibilityRole { get; }

Property Value

AccessibilityRole

ClipTabs

Clips overflowed fit-content tabs to the strip bounds, matching Godot's clip_tabs behavior.

public bool ClipTabs { get; set; }

Property Value

bool

CloseDisplayPolicy

public TabCloseDisplayPolicy CloseDisplayPolicy { get; set; }

Property Value

TabCloseDisplayPolicy

CloseWithMiddleMouse

Emits the close signal when a tab is middle-clicked, matching Godot's close_with_middle_mouse property.

public bool CloseWithMiddleMouse { get; set; }

Property Value

bool

CurrentTab

public int CurrentTab { get; set; }

Property Value

int

DeselectEnabled

Allows the current tab to become -1, matching Godot's deselect_enabled property.

public bool DeselectEnabled { get; set; }

Property Value

bool

DragToRearrangeEnabled

Enables pointer drag reordering, matching Godot's drag_to_rearrange_enabled property.

public bool DragToRearrangeEnabled { get; set; }

Property Value

bool

Font

public SpriteFont Font { get; set; }

Property Value

SpriteFont

MaxTabWidth

Optional maximum width for an individual tab; zero leaves titles unconstrained.

public int MaxTabWidth { get; set; }

Property Value

int

OffsetButtonsVisible

Whether the tab content currently exceeds the available strip width.

public bool OffsetButtonsVisible { get; }

Property Value

bool

PreviousTab

The tab selected immediately before the current one, matching Godot's previous property/get_previous_tab.

public int PreviousTab { get; }

Property Value

int

ScrollToSelected

When overflow is clipped, keeps the selected tab in the visible portion of the strip.

public bool ScrollToSelected { get; set; }

Property Value

bool

ScrollingEnabled

Enables overflow navigation controls, matching Godot's scrolling_enabled property.

public bool ScrollingEnabled { get; set; }

Property Value

bool

SelectWithRightMouseButton

Allows right-clicking a tab to select it, matching Godot's select_with_rmb property.

public bool SelectWithRightMouseButton { get; set; }

Property Value

bool

SwitchOnDragHover

Retained drag-hover switching policy, matching Godot's switch_on_drag_hover property.

public bool SwitchOnDragHover { get; set; }

Property Value

bool

TabAlignment

public TabBarAlignment TabAlignment { get; set; }

Property Value

TabBarAlignment

TabCount

public int TabCount { get; }

Property Value

int

TabItems

public IReadOnlyList<TabBarItem> TabItems { get; }

Property Value

IReadOnlyList<TabBarItem>

TabOffset

The first tab index displayed when the strip overflows, matching Godot's tab_offset property.

public int TabOffset { get; set; }

Property Value

int

TabSizing

public TabBarSizingMode TabSizing { get; set; }

Property Value

TabBarSizingMode

Tabs

public IReadOnlyList<string> Tabs { get; }

Property Value

IReadOnlyList<string>

TabsRearrangeGroup

Optional group identifier reserved for compatibility with Godot tab-strip rearrangement groups.

public int TabsRearrangeGroup { get; set; }

Property Value

int

UIFont

public UIFont UIFont { get; set; }

Property Value

UIFont

Methods

AddTab(string, Texture2D)

public int AddTab(string title = "", Texture2D icon = null)

Parameters

title string
icon Texture2D

Returns

int

ClearTabs()

public void ClearTabs()

EnsureTabVisible(int)

Scrolls an overflowed strip so that tab intersects its visible bounds.

public void EnsureTabVisible(int tab)

Parameters

tab int

GetClipTabs()

public bool GetClipTabs()

Returns

bool

GetCloseWithMiddleMouse()

public bool GetCloseWithMiddleMouse()

Returns

bool

GetCurrentTab()

public int GetCurrentTab()

Returns

int

GetDeselectEnabled()

public bool GetDeselectEnabled()

Returns

bool

GetDragToRearrangeEnabled()

public bool GetDragToRearrangeEnabled()

Returns

bool

GetMaxTabWidth()

public int GetMaxTabWidth()

Returns

int

GetNextAvailable(int)

Returns the next visible, enabled tab after tab, or -1 when none exists.

public int GetNextAvailable(int tab = -1)

Parameters

tab int

Returns

int

GetOffsetButtonsVisible()

public bool GetOffsetButtonsVisible()

Returns

bool

GetPreviousAvailable(int)

Returns the previous visible, enabled tab before tab, or -1 when none exists.

public int GetPreviousAvailable(int tab = -1)

Parameters

tab int

Returns

int

GetPreviousTab()

public int GetPreviousTab()

Returns

int

GetScrollToSelected()

public bool GetScrollToSelected()

Returns

bool

GetScrollingEnabled()

public bool GetScrollingEnabled()

Returns

bool

GetSelectWithRmb()

public bool GetSelectWithRmb()

Returns

bool

GetSwitchOnDragHover()

public bool GetSwitchOnDragHover()

Returns

bool

GetTabAlignment()

public TabBarAlignment GetTabAlignment()

Returns

TabBarAlignment

GetTabButtonIcon(int)

public Texture2D GetTabButtonIcon(int tab)

Parameters

tab int

Returns

Texture2D

GetTabCloseDisplayPolicy()

public TabCloseDisplayPolicy GetTabCloseDisplayPolicy()

Returns

TabCloseDisplayPolicy

GetTabCount()

public int GetTabCount()

Returns

int

GetTabIcon(int)

public Texture2D GetTabIcon(int tab)

Parameters

tab int

Returns

Texture2D

GetTabLanguage(int)

public string GetTabLanguage(int tab)

Parameters

tab int

Returns

string

GetTabMetadata(int)

public object GetTabMetadata(int tab)

Parameters

tab int

Returns

object

GetTabOffset()

public int GetTabOffset()

Returns

int

GetTabRect(int)

public Rectangle GetTabRect(int tab)

Parameters

tab int

Returns

Rectangle

GetTabSizing()

public TabBarSizingMode GetTabSizing()

Returns

TabBarSizingMode

GetTabTextDirection(int)

public TextDirection GetTabTextDirection(int tab)

Parameters

tab int

Returns

TextDirection

GetTabTitle(int)

public string GetTabTitle(int tab)

Parameters

tab int

Returns

string

GetTabTooltip(int)

public string GetTabTooltip(int tab)

Parameters

tab int

Returns

string

GetTabsRearrangeGroup()

public int GetTabsRearrangeGroup()

Returns

int

GetTooltip(Point)

Returns the tooltip at a global pointer position. Override to provide dynamic help text.

public override string GetTooltip(Point position)

Parameters

position Point

Returns

string

IsTabDisabled(int)

public bool IsTabDisabled(int tab)

Parameters

tab int

Returns

bool

IsTabHidden(int)

public bool IsTabHidden(int tab)

Parameters

tab int

Returns

bool

MoveTab(int, int)

Moves a tab while preserving the tab that is currently selected.

public void MoveTab(int from, int to)

Parameters

from int
to int

RemoveTab(int)

public void RemoveTab(int tab)

Parameters

tab int

SelectNextAvailable()

Selects the following visible, enabled tab and reports whether selection changed.

public bool SelectNextAvailable()

Returns

bool

SelectPreviousAvailable()

Selects the preceding visible, enabled tab and reports whether selection changed.

public bool SelectPreviousAvailable()

Returns

bool

SetClipTabs(bool)

public void SetClipTabs(bool clip)

Parameters

clip bool

SetCloseWithMiddleMouse(bool)

public void SetCloseWithMiddleMouse(bool enabled)

Parameters

enabled bool

SetCurrentTab(int)

public void SetCurrentTab(int tab)

Parameters

tab int

SetDeselectEnabled(bool)

public void SetDeselectEnabled(bool enabled)

Parameters

enabled bool

SetDragToRearrangeEnabled(bool)

public void SetDragToRearrangeEnabled(bool enabled)

Parameters

enabled bool

SetMaxTabWidth(int)

public void SetMaxTabWidth(int width)

Parameters

width int

SetScrollToSelected(bool)

public void SetScrollToSelected(bool enabled)

Parameters

enabled bool

SetScrollingEnabled(bool)

public void SetScrollingEnabled(bool enabled)

Parameters

enabled bool

SetSelectWithRmb(bool)

public void SetSelectWithRmb(bool enabled)

Parameters

enabled bool

SetSwitchOnDragHover(bool)

public void SetSwitchOnDragHover(bool enabled)

Parameters

enabled bool

SetTabAlignment(TabBarAlignment)

public void SetTabAlignment(TabBarAlignment alignment)

Parameters

alignment TabBarAlignment

SetTabButtonIcon(int, Texture2D)

public void SetTabButtonIcon(int tab, Texture2D icon)

Parameters

tab int
icon Texture2D

SetTabCloseDisplayPolicy(TabCloseDisplayPolicy)

public void SetTabCloseDisplayPolicy(TabCloseDisplayPolicy policy)

Parameters

policy TabCloseDisplayPolicy

SetTabCount(int)

public void SetTabCount(int count)

Parameters

count int

SetTabDisabled(int, bool)

public void SetTabDisabled(int tab, bool disabled)

Parameters

tab int
disabled bool

SetTabHidden(int, bool)

public void SetTabHidden(int tab, bool hidden)

Parameters

tab int
hidden bool

SetTabIcon(int, Texture2D)

public void SetTabIcon(int tab, Texture2D icon)

Parameters

tab int
icon Texture2D

SetTabLanguage(int, string)

public void SetTabLanguage(int tab, string language)

Parameters

tab int
language string

SetTabMetadata(int, object)

public void SetTabMetadata(int tab, object metadata)

Parameters

tab int
metadata object

SetTabSizing(TabBarSizingMode)

public void SetTabSizing(TabBarSizingMode sizing)

Parameters

sizing TabBarSizingMode

SetTabTextDirection(int, TextDirection)

public void SetTabTextDirection(int tab, TextDirection direction)

Parameters

tab int
direction TextDirection

SetTabTitle(int, string)

public void SetTabTitle(int tab, string title)

Parameters

tab int
title string

SetTabTooltip(int, string)

public void SetTabTooltip(int tab, string tooltip)

Parameters

tab int
tooltip string

SetTabsRearrangeGroup(int)

public void SetTabsRearrangeGroup(int groupId)

Parameters

groupId int

Events

ActiveTabRearranged

Raised while a dragged active tab is moved to a new index.

public event Action<TabBar, int> ActiveTabRearranged

Event Type

Action<TabBar, int>

TabButtonPressed

public event Action<TabBar, int> TabButtonPressed

Event Type

Action<TabBar, int>

TabChanged

public event Action<TabBar, int> TabChanged

Event Type

Action<TabBar, int>

TabClicked

public event Action<TabBar, int> TabClicked

Event Type

Action<TabBar, int>

TabClosePressed

public event Action<TabBar, int> TabClosePressed

Event Type

Action<TabBar, int>

TabHovered

public event Action<TabBar, int> TabHovered

Event Type

Action<TabBar, int>

TabRightClicked

public event Action<TabBar, int> TabRightClicked

Event Type

Action<TabBar, int>

TabSelected

public event Action<TabBar, int> TabSelected

Event Type

Action<TabBar, int>