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
ClipTabs
Clips overflowed fit-content tabs to the strip bounds, matching Godot's clip_tabs behavior.
public bool ClipTabs { get; set; }
Property Value
CloseDisplayPolicy
public TabCloseDisplayPolicy CloseDisplayPolicy { get; set; }
Property Value
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
CurrentTab
public int CurrentTab { get; set; }
Property Value
DeselectEnabled
Allows the current tab to become -1, matching Godot's deselect_enabled property.
public bool DeselectEnabled { get; set; }
Property Value
DragToRearrangeEnabled
Enables pointer drag reordering, matching Godot's drag_to_rearrange_enabled property.
public bool DragToRearrangeEnabled { get; set; }
Property Value
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
OffsetButtonsVisible
Whether the tab content currently exceeds the available strip width.
public bool OffsetButtonsVisible { get; }
Property Value
PreviousTab
The tab selected immediately before the current one, matching Godot's previous property/get_previous_tab.
public int PreviousTab { get; }
Property Value
ScrollToSelected
When overflow is clipped, keeps the selected tab in the visible portion of the strip.
public bool ScrollToSelected { get; set; }
Property Value
ScrollingEnabled
Enables overflow navigation controls, matching Godot's scrolling_enabled property.
public bool ScrollingEnabled { get; set; }
Property Value
SelectWithRightMouseButton
Allows right-clicking a tab to select it, matching Godot's select_with_rmb property.
public bool SelectWithRightMouseButton { get; set; }
Property Value
SwitchOnDragHover
Retained drag-hover switching policy, matching Godot's switch_on_drag_hover property.
public bool SwitchOnDragHover { get; set; }
Property Value
TabAlignment
public TabBarAlignment TabAlignment { get; set; }
Property Value
TabCount
public int TabCount { get; }
Property Value
TabItems
public IReadOnlyList<TabBarItem> TabItems { get; }
Property Value
TabOffset
The first tab index displayed when the strip overflows, matching Godot's tab_offset property.
public int TabOffset { get; set; }
Property Value
TabSizing
public TabBarSizingMode TabSizing { get; set; }
Property Value
Tabs
public IReadOnlyList<string> Tabs { get; }
Property Value
TabsRearrangeGroup
Optional group identifier reserved for compatibility with Godot tab-strip rearrangement groups.
public int TabsRearrangeGroup { get; set; }
Property Value
UIFont
public UIFont UIFont { get; set; }
Property Value
Methods
AddTab(string, Texture2D)
public int AddTab(string title = "", Texture2D icon = null)
Parameters
titlestringiconTexture2D
Returns
ClearTabs()
public void ClearTabs()
EnsureTabVisible(int)
Scrolls an overflowed strip so that tab intersects its visible bounds.
public void EnsureTabVisible(int tab)
Parameters
tabint
GetClipTabs()
public bool GetClipTabs()
Returns
GetCloseWithMiddleMouse()
public bool GetCloseWithMiddleMouse()
Returns
GetCurrentTab()
public int GetCurrentTab()
Returns
GetDeselectEnabled()
public bool GetDeselectEnabled()
Returns
GetDragToRearrangeEnabled()
public bool GetDragToRearrangeEnabled()
Returns
GetMaxTabWidth()
public int GetMaxTabWidth()
Returns
GetNextAvailable(int)
Returns the next visible, enabled tab after tab, or -1 when none exists.
public int GetNextAvailable(int tab = -1)
Parameters
tabint
Returns
GetOffsetButtonsVisible()
public bool GetOffsetButtonsVisible()
Returns
GetPreviousAvailable(int)
Returns the previous visible, enabled tab before tab, or -1 when none exists.
public int GetPreviousAvailable(int tab = -1)
Parameters
tabint
Returns
GetPreviousTab()
public int GetPreviousTab()
Returns
GetScrollToSelected()
public bool GetScrollToSelected()
Returns
GetScrollingEnabled()
public bool GetScrollingEnabled()
Returns
GetSelectWithRmb()
public bool GetSelectWithRmb()
Returns
GetSwitchOnDragHover()
public bool GetSwitchOnDragHover()
Returns
GetTabAlignment()
public TabBarAlignment GetTabAlignment()
Returns
GetTabButtonIcon(int)
public Texture2D GetTabButtonIcon(int tab)
Parameters
tabint
Returns
- Texture2D
GetTabCloseDisplayPolicy()
public TabCloseDisplayPolicy GetTabCloseDisplayPolicy()
Returns
GetTabCount()
public int GetTabCount()
Returns
GetTabIcon(int)
public Texture2D GetTabIcon(int tab)
Parameters
tabint
Returns
- Texture2D
GetTabLanguage(int)
public string GetTabLanguage(int tab)
Parameters
tabint
Returns
GetTabMetadata(int)
public object GetTabMetadata(int tab)
Parameters
tabint
Returns
GetTabOffset()
public int GetTabOffset()
Returns
GetTabRect(int)
public Rectangle GetTabRect(int tab)
Parameters
tabint
Returns
- Rectangle
GetTabSizing()
public TabBarSizingMode GetTabSizing()
Returns
GetTabTextDirection(int)
public TextDirection GetTabTextDirection(int tab)
Parameters
tabint
Returns
GetTabTitle(int)
public string GetTabTitle(int tab)
Parameters
tabint
Returns
GetTabTooltip(int)
public string GetTabTooltip(int tab)
Parameters
tabint
Returns
GetTabsRearrangeGroup()
public int GetTabsRearrangeGroup()
Returns
GetTooltip(Point)
Returns the tooltip at a global pointer position. Override to provide dynamic help text.
public override string GetTooltip(Point position)
Parameters
positionPoint
Returns
IsTabDisabled(int)
public bool IsTabDisabled(int tab)
Parameters
tabint
Returns
IsTabHidden(int)
public bool IsTabHidden(int tab)
Parameters
tabint
Returns
MoveTab(int, int)
Moves a tab while preserving the tab that is currently selected.
public void MoveTab(int from, int to)
Parameters
RemoveTab(int)
public void RemoveTab(int tab)
Parameters
tabint
SelectNextAvailable()
Selects the following visible, enabled tab and reports whether selection changed.
public bool SelectNextAvailable()
Returns
SelectPreviousAvailable()
Selects the preceding visible, enabled tab and reports whether selection changed.
public bool SelectPreviousAvailable()
Returns
SetClipTabs(bool)
public void SetClipTabs(bool clip)
Parameters
clipbool
SetCloseWithMiddleMouse(bool)
public void SetCloseWithMiddleMouse(bool enabled)
Parameters
enabledbool
SetCurrentTab(int)
public void SetCurrentTab(int tab)
Parameters
tabint
SetDeselectEnabled(bool)
public void SetDeselectEnabled(bool enabled)
Parameters
enabledbool
SetDragToRearrangeEnabled(bool)
public void SetDragToRearrangeEnabled(bool enabled)
Parameters
enabledbool
SetMaxTabWidth(int)
public void SetMaxTabWidth(int width)
Parameters
widthint
SetScrollToSelected(bool)
public void SetScrollToSelected(bool enabled)
Parameters
enabledbool
SetScrollingEnabled(bool)
public void SetScrollingEnabled(bool enabled)
Parameters
enabledbool
SetSelectWithRmb(bool)
public void SetSelectWithRmb(bool enabled)
Parameters
enabledbool
SetSwitchOnDragHover(bool)
public void SetSwitchOnDragHover(bool enabled)
Parameters
enabledbool
SetTabAlignment(TabBarAlignment)
public void SetTabAlignment(TabBarAlignment alignment)
Parameters
alignmentTabBarAlignment
SetTabButtonIcon(int, Texture2D)
public void SetTabButtonIcon(int tab, Texture2D icon)
Parameters
tabinticonTexture2D
SetTabCloseDisplayPolicy(TabCloseDisplayPolicy)
public void SetTabCloseDisplayPolicy(TabCloseDisplayPolicy policy)
Parameters
policyTabCloseDisplayPolicy
SetTabCount(int)
public void SetTabCount(int count)
Parameters
countint
SetTabDisabled(int, bool)
public void SetTabDisabled(int tab, bool disabled)
Parameters
SetTabHidden(int, bool)
public void SetTabHidden(int tab, bool hidden)
Parameters
SetTabIcon(int, Texture2D)
public void SetTabIcon(int tab, Texture2D icon)
Parameters
tabinticonTexture2D
SetTabLanguage(int, string)
public void SetTabLanguage(int tab, string language)
Parameters
SetTabMetadata(int, object)
public void SetTabMetadata(int tab, object metadata)
Parameters
SetTabSizing(TabBarSizingMode)
public void SetTabSizing(TabBarSizingMode sizing)
Parameters
sizingTabBarSizingMode
SetTabTextDirection(int, TextDirection)
public void SetTabTextDirection(int tab, TextDirection direction)
Parameters
tabintdirectionTextDirection
SetTabTitle(int, string)
public void SetTabTitle(int tab, string title)
Parameters
SetTabTooltip(int, string)
public void SetTabTooltip(int tab, string tooltip)
Parameters
SetTabsRearrangeGroup(int)
public void SetTabsRearrangeGroup(int groupId)
Parameters
groupIdint
Events
ActiveTabRearranged
Raised while a dragged active tab is moved to a new index.
public event Action<TabBar, int> ActiveTabRearranged
Event Type
TabButtonPressed
public event Action<TabBar, int> TabButtonPressed
Event Type
TabChanged
public event Action<TabBar, int> TabChanged
Event Type
TabClicked
public event Action<TabBar, int> TabClicked
Event Type
TabClosePressed
public event Action<TabBar, int> TabClosePressed
Event Type
TabHovered
public event Action<TabBar, int> TabHovered
Event Type
TabRightClicked
public event Action<TabBar, int> TabRightClicked
Event Type
TabSelected
public event Action<TabBar, int> TabSelected