TabBar
Standalone tab strip: records and selection without page management.
TabBar draws headers and stores tab records. It does not turn child Controls into pages or manage their Visible state. Use TabContainer for ready-made page management. For a custom switcher, associate tabs with your model/page through metadata and explicitly refresh the UI.
AddTab adds a title and optional icon. SetTabCount changes record count: new records have empty titles, shrinking discards the tail. This does not create/remove Entities. Indices 0…TabCount-1 include hidden/disabled tabs and change with MoveTab/RemoveTab. Use your own metadata ID instead of persisting an index. MoveTab(from, to) takes a final index in the existing list; to = TabCount does not append, use TabCount - 1.
CurrentTab = -1 means no selection. DeselectEnabled permits this even with available tabs. Direct CurrentTab assignment accepts disabled/hidden records; user input and SelectNextAvailable/SelectPreviousAvailable skip them. Navigation does not wrap; next from -1 starts at the first available tab, previous from -1 returns false.
Notifications depend on the operation. CurrentTab emits TabSelected, then TabChanged on change; repeating an index emits only TabSelected. MoveTab reorders the record and adjusts current/previous without those signals. Removing before the current tab shifts its index without TabChanged; removing the current record emits TabChanged without TabSelected. SetTabCount and ClearTabs write state directly and normally do not notify selection. Explicitly synchronize your page/model after structural changes.
The first AddTab in the tree selects and notifies when DeselectEnabled is off. Construction outside the tree can establish selection without signals. The first SetTabCount can apply an earlier queued CurrentTab and then notify; do not build initialization solely around expecting a signal. Populate records, set selection, then explicitly refresh dependent UI once.
SetTabHidden hides the header but does not automatically deselect it in standalone TabBar. SetTabDisabled also does not switch away from an already selected tab. Enforce your selection rules in code if showing a disabled page is forbidden.
TabClosePressed is a close request rather than deletion. Check unsaved changes, remove your page/model and call RemoveTab if closing is allowed. TabButtonPressed belongs to a separate icon button; TabClicked/TabRmbClicked represent user input. Programmatic selection is not a click.
Metadata holds a Variant: numbers/strings work well as stable keys, while Array/Dictionary can remain shared reference containers. GetTabTitle returns the original title even when display is translated. SetTabLanguage controls shaping rather than application locale or stored text.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
TabBarConstructor
public TabBar();Creates an empty strip: TabCount = 0, CurrentTab = PreviousTab = -1, DeselectEnabled = false. Child Controls do not automatically become pages.
Properties15
ClipTabsProperty
public bool ClipTabs { get; set; }Constrain the strip to available width, default true. Overflow uses navigation buttons and an index offset. false includes header widths in minimum size and resets the offset; not child ClipContents.
CloseWithMiddleMouseProperty
public bool CloseWithMiddleMouse { get; set; }Allows a middle-button close request, default true. Does not automatically remove records or control close-button visibility.
CurrentTabProperty
public int CurrentTab { get; set; }Selected index, -1 for none. Direct setter accepts hidden/disabled; -1 requires DeselectEnabled or no available records. Emits TabSelected even for the same index, TabChanged only on change. An initial request before initialization can be queued.
DeselectEnabledProperty
public bool DeselectEnabled { get; set; }Allows selection -1 with available tabs, default false. Disabling without selection attempts to choose the next available tab from the start.
DragToRearrangeEnabledProperty
public bool DragToRearrangeEnabled { get; set; }Allows user drag-to-reorder, default false. Does not prevent code-driven MoveTab; cross-strip transfers additionally require matching TabsRearrangeGroup.
MaxTabWidthProperty
public int MaxTabWidth { get; set; }Pixel width limit used to shorten header text, default 0 disables the per-header limit. Requires ≥ 0. Icons, buttons and margins retain their minimum, so the complete header can exceed this value. Available layout maximum also contributes.
ScrollToSelectedProperty
public bool ScrollToSelected { get; set; }Automatically reveal the selected header, default true. Enabling immediately calls EnsureTabVisible for the current index. false retains selection without guaranteeing visibility; explicit EnsureTabVisible remains available.
ScrollingEnabledProperty
public bool ScrollingEnabled { get; set; }Allows strip scrolling through wheel/touch input, default true. Does not block EnsureTabVisible or automatic CurrentTab reveal, or hide overflow buttons.
SelectWithRmbProperty
public bool SelectWithRmb { get; set; }Allows right-button selection, default false. TabRmbClicked and displaying your menu are separate actions; programmatic CurrentTab is not restricted by this flag.
SwitchOnDragHoverProperty
public bool SwitchOnDragHover { get; set; }Switches tabs after a hover delay while dragging content, default true. Does not make a drop acceptable. Dragging tabs themselves does not use this hover path.
TabAlignmentProperty
public TabBar.AlignmentMode TabAlignment { get; set; }Horizontal header alignment Left/Center/Right, default Left. Layout direction is handled separately; not alignment of your pages.
TabCloseDisplayPolicyProperty
public TabBar.CloseButtonDisplayPolicy TabCloseDisplayPolicy { get; set; }Built-in close-button display: default ShowNever, ShowActiveOnly or ShowAlways. Activation emits TabClosePressed; the application handles removal.
TabCountProperty
public int TabCount { get; set; }Record count including hidden/disabled, default 0. Setter requires a value ≥ 0: grows empty tabs or removes the tail and clamps CurrentTab. Normally changes selection without signals; first application can execute queued CurrentTab.
TabSizingProperty
public TabBar.SizingMode TabSizing { get; set; }Header sizing, default FitContent. Uniform uses the widest width; Justify proportionally expands widths when space is available; Expand uses equal widths if the widest fits, otherwise falls back to FitContent. MaxTabWidth and available layout can further constrain text.
TabsRearrangeGroupProperty
public int TabsRearrangeGroup { get; set; }Tab-transfer group between TabBars; default -1 disables cross-strip transfers. Use matching nonnegative IDs and DragToRearrangeEnabled on participants. Not an Entity group or stable tab ID.
Methods62
AddTabvoid
public void AddTab(string title = "", Texture2D icon = null);Appends a record with a title and optional shared icon. Selects it when first and DeselectEnabled is off; selection signals emit in the tree. Does not create a page.
| Name | Type | Default |
|---|---|---|
title | string | "" |
icon | Texture2D | null |
titleAppends a record with a title and optional shared icon. Selects it when first and DeselectEnabled is off; selection signals emit in the tree. Does not create a page.
iconAppends a record with a title and optional shared icon. Selects it when first and DeselectEnabled is off; selection signals emit in the tree. Does not create a page.
ClearTabsvoid
public void ClearTabs();Removes all records and resets current/previous to -1 and offset to 0. Does not emit TabChanged/TabSelected or remove child Controls. Explicitly refresh your own page.
EnsureTabVisiblevoid
public void EnsureTabVisible(int idx);Adjusts the scroll index for a header without changing CurrentTab. Works in the tree with overflow buttons visible, independently of ScrollingEnabled. Does nothing for -1, hidden or already-in-window indices. Does not promise full display of a header wider than the strip.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxRecord index 0…TabCount-1. GetTabRect also accepts negative indices from the end; EnsureTabVisible(-1) does nothing.
GetClipTabsbool
public bool GetClipTabs();Constrain the strip to available width, default true. Overflow uses navigation buttons and an index offset. false includes header widths in minimum size and resets the offset; not child ClipContents.
boolStrip-width constraint flag.
GetCloseWithMiddleMousebool
public bool GetCloseWithMiddleMouse();Allows a middle-button close request, default true. Does not automatically remove records or control close-button visibility.
boolMiddle-button close flag.
GetCurrentTabint
public int GetCurrentTab();Selected index, -1 for none. Direct setter accepts hidden/disabled; -1 requires DeselectEnabled or no available records. Emits TabSelected even for the same index, TabChanged only on change. An initial request before initialization can be queued.
intCurrent record index, or -1.
GetDeselectEnabledbool
public bool GetDeselectEnabled();Allows selection -1 with available tabs, default false. Disabling without selection attempts to choose the next available tab from the start.
boolWhether explicit deselection is allowed.
GetDragToRearrangeEnabledbool
public bool GetDragToRearrangeEnabled();Allows user drag-to-reorder, default false. Does not prevent code-driven MoveTab; cross-strip transfers additionally require matching TabsRearrangeGroup.
boolUser drag-to-reorder flag.
GetMaxTabWidthint
public int GetMaxTabWidth();Pixel width limit used to shorten header text, default 0 disables the per-header limit. Requires ≥ 0. Icons, buttons and margins retain their minimum, so the complete header can exceed this value. Available layout maximum also contributes.
intHeader-text width limit in pixels, 0 for none.
GetOffsetButtonsVisiblebool
public bool GetOffsetButtonsVisible();Whether overflow buttons are displayed after geometry calculation. Not the ScrollingEnabled setting or proof that the selected tab is visible.
boolOverflow-button visibility from current layout.
GetPreviousTabint
public int GetPreviousTab();Index before the last selection assignment, adjusted by reorder/removal. Reselection makes previous equal current; not necessarily the last different tab.
intPrevious index adjusted for structural changes.
GetScrollToSelectedbool
public bool GetScrollToSelected();Automatically reveal the selected header, default true. Enabling immediately calls EnsureTabVisible for the current index. false retains selection without guaranteeing visibility; explicit EnsureTabVisible remains available.
boolAutomatic selection-reveal flag.
GetScrollingEnabledbool
public bool GetScrollingEnabled();Allows strip scrolling through wheel/touch input, default true. Does not block EnsureTabVisible or automatic CurrentTab reveal, or hide overflow buttons.
boolUser-input scrolling flag.
GetSelectWithRmbbool
public bool GetSelectWithRmb();Allows right-button selection, default false. TabRmbClicked and displaying your menu are separate actions; programmatic CurrentTab is not restricted by this flag.
boolRight-button selection flag.
GetSwitchOnDragHoverbool
public bool GetSwitchOnDragHover();Switches tabs after a hover delay while dragging content, default true. Does not make a drop acceptable. Dragging tabs themselves does not use this hover path.
boolSwitch-on-drag-hover flag.
GetTabAlignmentTabBar.AlignmentMode
public TabBar.AlignmentMode GetTabAlignment();Horizontal header alignment Left/Center/Right, default Left. Layout direction is handled separately; not alignment of your pages.
TabBar.AlignmentModeCurrent AlignmentMode.
GetTabButtonIconTexture2D
public Texture2D GetTabButtonIcon(int tabIdx);Shared auxiliary-button Texture2D, or null, rather than the main icon.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
tabIdxRecord index 0…TabCount-1. GetTabRect also accepts negative indices from the end; EnsureTabVisible(-1) does nothing.
Texture2DShared auxiliary-button Texture2D, or null.
GetTabCloseDisplayPolicyTabBar.CloseButtonDisplayPolicy
public TabBar.CloseButtonDisplayPolicy GetTabCloseDisplayPolicy();Built-in close-button display: default ShowNever, ShowActiveOnly or ShowAlways. Activation emits TabClosePressed; the application handles removal.
TabBar.CloseButtonDisplayPolicyCurrent CloseButtonDisplayPolicy.
GetTabCountint
public int GetTabCount();Record count including hidden/disabled, default 0. Setter requires a value ≥ 0: grows empty tabs or removes the tail and clamps CurrentTab. Normally changes selection without signals; first application can execute queued CurrentTab.
intRecord count including hidden/disabled.
GetTabIconTexture2D
public Texture2D GetTabIcon(int tabIdx);Returns the shared main icon, or null, separately from the auxiliary button.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
tabIdxRecord index 0…TabCount-1. GetTabRect also accepts negative indices from the end; EnsureTabVisible(-1) does nothing.
Texture2DShared main Texture2D, or null.
GetTabIconMaxWidthint
public int GetTabIconMaxWidth(int tabIdx);Stored per-tab width limit rather than actual width after theme constraints.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
tabIdxRecord index 0…TabCount-1. GetTabRect also accepts negative indices from the end; EnsureTabVisible(-1) does nothing.
intStored per-tab pixel limit.
GetTabIdxAtPointint
public int GetTabIdxAtPoint(Vector2 point);Index of the header under a local point in the current window, or -1. Excludes hidden records but can return disabled ones. Geometry query rather than selection or selection-permission validation.
| Name | Type | Default |
|---|---|---|
point | Vector2 | — |
pointPoint in TabBar local coordinates.
intHeader index under the point, or -1.
GetTabLanguagestring
public string GetTabLanguage(int tabIdx);Returns the tab shaping language, or empty for the control locale.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
stringShaping language, or empty.
GetTabMetadataVariant
public Variant GetTabMetadata(int tabIdx);Returns metadata Variant, Nil when unassigned. Reference containers inside the Variant can share contents with the original value.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
VariantMetadata Variant, or Nil.
GetTabOffsetint
public int GetTabOffset();Returns the current starting index of the scrolling tab window rather than a pixel offset. Indexing uses the full list, including hidden records.
intWindow starting index rather than pixels.
GetTabRectRect2
public Rect2 GetTabRect(int tabIdx);Returns the header rectangle in TabBar local coordinates from the current layout cache. Negative indices count from the end (-1 is last). A rectangle for an off-window/hidden tab does not prove visibility or a hit; use GetTabIdxAtPoint to query a point.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
tabIdxRecord index 0…TabCount-1. GetTabRect also accepts negative indices from the end; EnsureTabVisible(-1) does nothing.
Rect2Rect2 in strip-local coordinates.
GetTabSizingTabBar.SizingMode
public TabBar.SizingMode GetTabSizing();Header sizing, default FitContent. Uniform uses the widest width; Justify proportionally expands widths when space is available; Expand uses equal widths if the widest fits, otherwise falls back to FitContent. MaxTabWidth and available layout can further constrain text.
TabBar.SizingModeCurrent SizingMode.
GetTabTextDirectionControl.TextDirection
public Control.TextDirection GetTabTextDirection(int tabIdx);Returns the stored header text direction, default Inherited.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
Control.TextDirectionStored Control.TextDirection.
GetTabTitlestring
public string GetTabTitle(int tabIdx);Returns the original title rather than its translation or a stable ID.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
stringOriginal title string.
GetTabTooltipstring
public string GetTabTooltip(int tabIdx);Returns the stored tooltip string.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
stringStored tooltip.
GetTabsRearrangeGroupint
public int GetTabsRearrangeGroup();Tab-transfer group between TabBars; default -1 disables cross-strip transfers. Use matching nonnegative IDs and DragToRearrangeEnabled on participants. Not an Entity group or stable tab ID.
intTransfer group ID, or -1.
IsTabDisabledbool
public bool IsTabDisabled(int tabIdx);Returns the record disabled flag, separate from hidden and current selection.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
boolRecord disabled flag.
public bool IsTabHidden(int tabIdx);Returns the header hidden flag rather than visibility of your application page.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
boolRecord hidden flag.
MoveTabvoid
public void MoveTab(int from, int to);Moves the complete record, including metadata/flags, to final index to; both indices are 0…TabCount-1. Preserves selected record while adjusting current/previous; does not itself emit TabChanged/TabSelected/ActiveTabRearranged.
| Name | Type | Default |
|---|---|---|
from | int | — |
to | int | — |
fromCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
toCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
RemoveTabvoid
public void RemoveTab(int tabIdx);Removes an existing record. Later indices shift; current/previous are adjusted. Removing the current record emits TabChanged without TabSelected in the tree and seeks an available replacement. Removing before it can change the index without a signal.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
SelectNextAvailablebool
public bool SelectNextAvailable();Selects the next higher-index record that is neither hidden nor disabled. Does not wrap; starts at the first from -1. Returns true on successful selection.
booltrue when the next record was found and selected.
SelectPreviousAvailablebool
public bool SelectPreviousAvailable();Selects the previous lower-index record that is neither hidden nor disabled. Does not wrap; returns false when CurrentTab = -1.
booltrue when the previous record was found and selected.
SetClipTabsvoid
public void SetClipTabs(bool clipTabs);Constrain the strip to available width, default true. Overflow uses navigation buttons and an index offset. false includes header widths in minimum size and resets the offset; not child ClipContents.
| Name | Type | Default |
|---|---|---|
clipTabs | bool | — |
clipTabsConstrain the strip to available width, default true. Overflow uses navigation buttons and an index offset. false includes header widths in minimum size and resets the offset; not child ClipContents.
SetCloseWithMiddleMousevoid
public void SetCloseWithMiddleMouse(bool enabled);Allows a middle-button close request, default true. Does not automatically remove records or control close-button visibility.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledAllows a middle-button close request, default true. Does not automatically remove records or control close-button visibility.
SetCurrentTabvoid
public void SetCurrentTab(int tabIdx);Selected index, -1 for none. Direct setter accepts hidden/disabled; -1 requires DeselectEnabled or no available records. Emits TabSelected even for the same index, TabChanged only on change. An initial request before initialization can be queued.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
SetDeselectEnabledvoid
public void SetDeselectEnabled(bool enabled);Allows selection -1 with available tabs, default false. Disabling without selection attempts to choose the next available tab from the start.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledAllows selection -1 with available tabs, default false. Disabling without selection attempts to choose the next available tab from the start.
SetDragToRearrangeEnabledvoid
public void SetDragToRearrangeEnabled(bool enabled);Allows user drag-to-reorder, default false. Does not prevent code-driven MoveTab; cross-strip transfers additionally require matching TabsRearrangeGroup.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledAllows user drag-to-reorder, default false. Does not prevent code-driven MoveTab; cross-strip transfers additionally require matching TabsRearrangeGroup.
SetMaxTabWidthvoid
public void SetMaxTabWidth(int width);Pixel width limit used to shorten header text, default 0 disables the per-header limit. Requires ≥ 0. Icons, buttons and margins retain their minimum, so the complete header can exceed this value. Available layout maximum also contributes.
| Name | Type | Default |
|---|---|---|
width | int | — |
widthPixel width limit used to shorten header text, default 0 disables the per-header limit. Requires ≥ 0. Icons, buttons and margins retain their minimum, so the complete header can exceed this value. Available layout maximum also contributes.
SetScrollToSelectedvoid
public void SetScrollToSelected(bool enabled);Automatically reveal the selected header, default true. Enabling immediately calls EnsureTabVisible for the current index. false retains selection without guaranteeing visibility; explicit EnsureTabVisible remains available.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledAutomatically reveal the selected header, default true. Enabling immediately calls EnsureTabVisible for the current index. false retains selection without guaranteeing visibility; explicit EnsureTabVisible remains available.
SetScrollingEnabledvoid
public void SetScrollingEnabled(bool enabled);Allows strip scrolling through wheel/touch input, default true. Does not block EnsureTabVisible or automatic CurrentTab reveal, or hide overflow buttons.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledAllows strip scrolling through wheel/touch input, default true. Does not block EnsureTabVisible or automatic CurrentTab reveal, or hide overflow buttons.
SetSelectWithRmbvoid
public void SetSelectWithRmb(bool enabled);Allows right-button selection, default false. TabRmbClicked and displaying your menu are separate actions; programmatic CurrentTab is not restricted by this flag.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledAllows right-button selection, default false. TabRmbClicked and displaying your menu are separate actions; programmatic CurrentTab is not restricted by this flag.
SetSwitchOnDragHovervoid
public void SetSwitchOnDragHover(bool enabled);Switches tabs after a hover delay while dragging content, default true. Does not make a drop acceptable. Dragging tabs themselves does not use this hover path.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledSwitches tabs after a hover delay while dragging content, default true. Does not make a drop acceptable. Dragging tabs themselves does not use this hover path.
SetTabAlignmentvoid
public void SetTabAlignment(TabBar.AlignmentMode alignment);Horizontal header alignment Left/Center/Right, default Left. Layout direction is handled separately; not alignment of your pages.
| Name | Type | Default |
|---|---|---|
alignment | TabBar.AlignmentMode | — |
alignmentHorizontal header alignment Left/Center/Right, default Left. Layout direction is handled separately; not alignment of your pages.
SetTabButtonIconvoid
public void SetTabButtonIcon(int tabIdx, Texture2D icon);Sets a shared auxiliary-header-button icon; null removes the button. Separate from the main icon and built-in close button. Activation emits TabButtonPressed without deleting the tab.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
icon | Texture2D | — |
tabIdxRecord index 0…TabCount-1. GetTabRect also accepts negative indices from the end; EnsureTabVisible(-1) does nothing.
iconSets a shared auxiliary-header-button icon; null removes the button. Separate from the main icon and built-in close button. Activation emits TabButtonPressed without deleting the tab.
SetTabCloseDisplayPolicyvoid
public void SetTabCloseDisplayPolicy(TabBar.CloseButtonDisplayPolicy policy);Built-in close-button display: default ShowNever, ShowActiveOnly or ShowAlways. Activation emits TabClosePressed; the application handles removal.
| Name | Type | Default |
|---|---|---|
policy | TabBar.CloseButtonDisplayPolicy | — |
policyBuilt-in close-button display: default ShowNever, ShowActiveOnly or ShowAlways. Activation emits TabClosePressed; the application handles removal.
SetTabCountvoid
public void SetTabCount(int count);Record count including hidden/disabled, default 0. Setter requires a value ≥ 0: grows empty tabs or removes the tail and clamps CurrentTab. Normally changes selection without signals; first application can execute queued CurrentTab.
| Name | Type | Default |
|---|---|---|
count | int | — |
countRecord count including hidden/disabled, default 0. Setter requires a value ≥ 0: grows empty tabs or removes the tail and clamps CurrentTab. Normally changes selection without signals; first application can execute queued CurrentTab.
SetTabDisabledvoid
public void SetTabDisabled(int tabIdx, bool disabled);Changes the disabled flag for user selection/available navigation. Does not deselect a current record or block direct CurrentTab.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
disabled | bool | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
disabledChanges the disabled flag for user selection/available navigation. Does not deselect a current record or block direct CurrentTab.
public void SetTabHidden(int tabIdx, bool hidden);Hides the header without removing its record. Does not change TabCount or automatically switch current selection in standalone TabBar.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
hidden | bool | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
hiddenHides the header without removing its record. Does not change TabCount or automatically switch current selection in standalone TabBar.
SetTabIconvoid
public void SetTabIcon(int tabIdx, Texture2D icon);Assigns a shared main Texture2D; null removes it. Does not copy the resource; setter refreshes geometry and minimum size. Use SetTabIconMaxWidth to limit drawing rather than modifying the source texture.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
icon | Texture2D | — |
tabIdxRecord index 0…TabCount-1. GetTabRect also accepts negative indices from the end; EnsureTabVisible(-1) does nothing.
iconAssigns a shared main Texture2D; null removes it. Does not copy the resource; setter refreshes geometry and minimum size. Use SetTabIconMaxWidth to limit drawing rather than modifying the source texture.
SetTabIconMaxWidthvoid
public void SetTabIconMaxWidth(int tabIdx, int width);Main-icon pixel width limit, 0 for no per-tab limit. Positive values downscale preserving aspect; a stricter theme icon_max_width takes priority. Does not enlarge small icons or modify the source resource.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
width | int | — |
tabIdxRecord index 0…TabCount-1. GetTabRect also accepts negative indices from the end; EnsureTabVisible(-1) does nothing.
widthMain-icon pixel width limit, 0 for no per-tab limit. Positive values downscale preserving aspect; a stricter theme icon_max_width takes priority. Does not enlarge small icons or modify the source resource.
SetTabLanguagevoid
public void SetTabLanguage(int tabIdx, string language);Sets shaping language for one title; empty uses the control locale. Does not translate the original string or switch application locale.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
language | string | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
languageSets shaping language for one title; empty uses the control locale. Does not translate the original string or switch application locale.
SetTabMetadatavoid
public void SetTabMetadata(int tabIdx, Variant metadata);Sets record Variant data, such as your stable ID. MoveTab moves it with the record. Array/Dictionary remain shared containers; copy separately when independent data is needed.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
metadata | Variant | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
metadataSets record Variant data, such as your stable ID. MoveTab moves it with the record. Array/Dictionary remain shared containers; copy separately when independent data is needed.
SetTabSizingvoid
public void SetTabSizing(TabBar.SizingMode tabSizing);Header sizing, default FitContent. Uniform uses the widest width; Justify proportionally expands widths when space is available; Expand uses equal widths if the widest fits, otherwise falls back to FitContent. MaxTabWidth and available layout can further constrain text.
| Name | Type | Default |
|---|---|---|
tabSizing | TabBar.SizingMode | — |
tabSizingHeader sizing, default FitContent. Uniform uses the widest width; Justify proportionally expands widths when space is available; Expand uses equal widths if the widest fits, otherwise falls back to FitContent. MaxTabWidth and available layout can further constrain text.
SetTabTextDirectionvoid
public void SetTabTextDirection(int tabIdx, Control.TextDirection direction);Sets one title’s shaping direction. Inherited uses layout direction; Ltr/Rtl do not reverse the stored string.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
direction | Control.TextDirection | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
directionSets one title’s shaping direction. Inherited uses layout direction; Ltr/Rtl do not reverse the stored string.
SetTabTitlevoid
public void SetTabTitle(int tabIdx, string title);Sets the original title and refreshes shaping/geometry. Display can use translation; index and metadata are unchanged.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
title | string | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
titleSets the original title and refreshes shaping/geometry. Display can use translation; index and metadata are unchanged.
SetTabTooltipvoid
public void SetTabTooltip(int tabIdx, string tooltip);Sets a separate header tooltip. Does not change title, index or metadata.
| Name | Type | Default |
|---|---|---|
tabIdx | int | — |
tooltip | string | — |
tabIdxCurrent record index 0…TabCount-1; only SetCurrentTab accepts -1 for deselection.
tooltipSets a separate header tooltip. Does not change title, index or metadata.
SetTabsRearrangeGroupvoid
public void SetTabsRearrangeGroup(int groupId);Tab-transfer group between TabBars; default -1 disables cross-strip transfers. Use matching nonnegative IDs and DragToRearrangeEnabled on participants. Not an Entity group or stable tab ID.
| Name | Type | Default |
|---|---|---|
groupId | int | — |
groupIdTab-transfer group between TabBars; default -1 disables cross-strip transfers. Use matching nonnegative IDs and DragToRearrangeEnabled on participants. Not an Entity group or stable tab ID.
Signals and events8
ActiveTabRearrangedEvent
public event TabBar.ActiveTabRearrangedEventHandler ActiveTabRearranged;Drag-path notification of the new index for the tab being activated. Code-driven MoveTab does not itself emit it. Resolve your own metadata ID again after reordering.
| Name | Type | Default |
|---|---|---|
idxTo | long | — |
idxToTab index at notification time rather than a stable ID.
TabButtonPressedEvent
public event TabBar.TabButtonPressedEventHandler TabButtonPressed;Auxiliary SetTabButtonIcon button was activated. Separate from TabClosePressed; no automatic deletion.
| Name | Type | Default |
|---|---|---|
tab | long | — |
tabRecord index at event time; selection notifications can supply -1.
TabChangedEvent
public event TabBar.TabChangedEventHandler TabChanged;Notification from CurrentTab on selection change, or RemoveTab when deleting the current record. Not universal index observation: MoveTab, ClearTabs and ordinary SetTabCount can change state without it. -1 means no selection.
| Name | Type | Default |
|---|---|---|
tab | long | — |
tabRecord index at event time; selection notifications can supply -1.
TabClickedEvent
public event TabBar.TabClickedEventHandler TabClicked;User clicked a tab. Programmatic CurrentTab does not emit it; clicking again may leave selection unchanged.
| Name | Type | Default |
|---|---|---|
tab | long | — |
tabRecord index at event time; selection notifications can supply -1.
TabClosePressedEvent
public event TabBar.TabClosePressedEventHandler TabClosePressed;Close request from the close button/allowed middle click. Does not itself remove the record. Check whether closing is allowed, then explicitly remove the model/page and call RemoveTab.
| Name | Type | Default |
|---|---|---|
tab | long | — |
tabRecord index at event time; selection notifications can supply -1.
TabHoveredEvent
public event TabBar.TabHoveredEventHandler TabHovered;Pointer entered a different header. Not selection; leaving the strip does not guarantee a separate event with -1. Disabled headers can also participate in hover geometry.
| Name | Type | Default |
|---|---|---|
tab | long | — |
tabTab index at notification time rather than a stable ID.
TabRmbClickedEvent
public event TabBar.TabRmbClickedEventHandler TabRmbClicked;Right click on a tab. SelectWithRmb separately controls right-button selection; use the signal for your own context menu.
| Name | Type | Default |
|---|---|---|
tab | long | — |
tabRecord index at event time; selection notifications can supply -1.
TabSelectedEvent
public event TabBar.TabSelectedEventHandler TabSelected;CurrentTab selection request, including reselection and programmatic assignment. Precedes TabChanged on change. Structural MoveTab/RemoveTab/ClearTabs/ordinary SetTabCount need not emit it.
| Name | Type | Default |
|---|---|---|
tab | long | — |
tabRecord index at event time; selection notifications can supply -1.
TabBar.AlignmentMode
| Value | Description |
|---|---|
Center = 1 | Aligns tabs in the middle. |
Left = 0 | Aligns tabs to the left. |
Max = 3 | Represents the size of the |
Right = 2 | Aligns tabs to the right. |
TabBar.CloseButtonDisplayPolicy
| Value | Description |
|---|---|
Max = 3 | Represents the size of the |
ShowActiveOnly = 1 | Only show the close button on the currently active tab. |
ShowAlways = 2 | Show the close button on all tabs. |
ShowNever = 0 | Never show the close buttons. |
TabBar.SizingMode
| Value | Description |
|---|---|
Expand = 3 | Size tabs equally, expanding to the full width of the tab bar if there is room, otherwise fall back to |
FitContent = 0 | Size tabs individually according to the size of their content. |
Justify = 2 | Size tabs individually according to their content, expanding to the full width of the tab bar. |
Max = 4 | Represents the size of the |
Uniform = 1 | Size tabs uniformly, with the widest tab determining the size of all tabs. This may trigger clipping sooner than other sizing modes due to increased tab sizes. |
Theme properties
These are Theme resource keys, not C# properties. Use the matching Control GetTheme…() and AddTheme…Override() methods for each value type.
| Key and type | Description |
|---|---|
drop_mark_colorColor | Modulation color for the Color(1, 1, 1, 1) |
font_disabled_colorColor | Font color of disabled tabs. Default:Color(0.875, 0.875, 0.875, 0.5) |
font_hovered_colorColor | Font color of the currently hovered tab. Does not apply to the selected tab. Default:Color(0.95, 0.95, 0.95, 1) |
font_outline_colorColor | The tint of text outline of the tab name. Default:Color(0, 0, 0, 1) |
font_selected_colorColor | Font color of the currently selected tab. Default:Color(0.95, 0.95, 0.95, 1) |
font_unselected_colorColor | Font color of the other, unselected tabs. Default:Color(0.7, 0.7, 0.7, 1) |
icon_disabled_colorColor | Icon color of disabled tabs. Default:Color(1, 1, 1, 1) |
icon_hovered_colorColor | Icon color of the currently hovered tab. Does not apply to the selected tab. Default:Color(1, 1, 1, 1) |
icon_selected_colorColor | Icon color of the currently selected tab. Default:Color(1, 1, 1, 1) |
icon_unselected_colorColor | Icon color of the other, unselected tabs. Default:Color(1, 1, 1, 1) |
h_separationint | The horizontal separation between the elements inside tabs. Default:4 |
hover_switch_wait_msecint | During a drag-and-drop, this is how many milliseconds to wait before switching the tab. Default:500 |
icon_max_widthint | The maximum allowed width of the tab's icon. This limit is applied on top of the default size of the icon, but before the value set with 0 |
outline_sizeint | The size of the tab text outline.
Note: If using a font with 0 |
tab_separationint | The space between tabs in the tab bar. Default:0 |
fontFont | The font used to draw tab names. |
font_sizeint | Font size of the tab names. |
closeTexture2D | The icon for the close button (see |
decrementTexture2D | Icon for the left arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the first tab is visible), it appears semi-transparent. |
decrement_highlightTexture2D | Icon for the left arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. |
drop_markTexture2D | Icon shown to indicate where a dragged tab will be dropped (see |
incrementTexture2D | Icon for the right arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the last tab is visible) it appears semi-transparent. |
increment_highlightTexture2D | Icon for the right arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. |
drag_ended_soundAudioStream | Played when a tab is done being dragged to rearrange it. Can only be heard if |
drag_started_soundAudioStream | Played when a tab is beginning to be dragged to rearrange it. Can only be heard if |
focus_soundAudioStream | Played when this |
hover_soundAudioStream | Played when a tab is hovered with the mouse. |
pressed_disabled_soundAudioStream | Played when the tab close button is pressed while the tab is disabled, or when pressing the previous/next tab navigation buttons when already at the beginning/end of the list. |
pressed_soundAudioStream | Played when the tab close or previous/next tab navigation buttons are pressed. |
button_highlightStyleBox | Background of the tab and close buttons when they're being hovered with the cursor. |
button_pressedStyleBox | Background of the tab and close buttons when it's being pressed. |
tab_disabledStyleBox | The style of disabled tabs. |
tab_focusStyleBox |
|
tab_hoveredStyleBox | The style of the currently hovered tab. Does not apply to the selected tab.
Note: This style will be drawn with the same width as |
tab_selectedStyleBox | The style of the currently selected tab. |
tab_unselectedStyleBox | The style of the other, unselected tabs. |