Tabs control.
    public class Tabs : Control

Simple tabs control, similar to TabContainer but is only in charge of drawing tabs, not interact with children.

Inheritance Chain

Constructors

    public Tabs()

Signals

    "reposition_active_tab_request" (int idx_to)

    "right_button_pressed" (int tab)

    "tab_changed" (int tab)

    "tab_clicked" (int tab)

    "tab_close" (int tab)

    "tab_hover" (int tab)

Properties

    public int CurrentTab { get; set; }

Select tab at index tab_idx.

    public bool DragToRearrangeEnabled { get; set; }

If true, tabs can be rearranged with mouse drag.

    public bool ScrollingEnabled { get; set; }

    public TabAlignEnum TabAlign { get; set; }

The alignment of all tabs. See enum TabAlign constants for details.

    public CloseButtonDisplayPolicy TabCloseDisplayPolicy { get; set; }

Methods

    public void AddTab(string title = "", Texture icon = null)

Adds a new tab.

    public void EnsureTabVisible(int idx)

Moves the scroll view to make the tab visible.

    [Obsolete("GetCurrentTab is deprecated. Use the CurrentTab property instead.")]
    public int GetCurrentTab()

Getter for CurrentTab

    [Obsolete("GetDragToRearrangeEnabled is deprecated. Use the DragToRearrangeEnabled property instead.")]
    public bool GetDragToRearrangeEnabled()

Getter for DragToRearrangeEnabled

    public bool GetOffsetButtonsVisible()

    [Obsolete("GetScrollingEnabled is deprecated. Use the ScrollingEnabled property instead.")]
    public bool GetScrollingEnabled()

Getter for ScrollingEnabled

    public bool GetSelectWithRmb()

Returns true if select with right mouse button is enabled.

    [Obsolete("GetTabAlign is deprecated. Use the TabAlign property instead.")]
    public TabAlignEnum GetTabAlign()

Getter for TabAlign

    [Obsolete("GetTabCloseDisplayPolicy is deprecated. Use the TabCloseDisplayPolicy property instead.")]
    public CloseButtonDisplayPolicy GetTabCloseDisplayPolicy()

Getter for TabCloseDisplayPolicy

    public int GetTabCount()

Returns the number of tabs.

    public bool GetTabDisabled(int tabIdx)

Returns true if the tab at index tabIdx is disabled.

    public Texture GetTabIcon(int tabIdx)

Returns the Texture for the tab at index tabIdx or null if the tab has no Texture.

    public int GetTabOffset()

    public Rect2 GetTabRect(int tabIdx)

Returns tab Rect2 with local position and size.

    public int GetTabsRearrangeGroup()

Returns the Tabs’ rearrange group ID.

    public string GetTabTitle(int tabIdx)

Returns the title of the tab at index tabIdx. Tab titles default to the name of the indexed child node, but this can be overridden with SetTabTitle(int, string).

    public void MoveTab(int from, int to)

Moves a tab from from to to.

    public void RemoveTab(int tabIdx)

Removes the tab at index tabIdx.

    [Obsolete("SetCurrentTab is deprecated. Use the CurrentTab property instead.")]
    public void SetCurrentTab(int tabIdx)

Setter for CurrentTab

    [Obsolete("SetDragToRearrangeEnabled is deprecated. Use the DragToRearrangeEnabled property instead.")]
    public void SetDragToRearrangeEnabled(bool enabled)

Setter for DragToRearrangeEnabled

    [Obsolete("SetScrollingEnabled is deprecated. Use the ScrollingEnabled property instead.")]
    public void SetScrollingEnabled(bool enabled)

Setter for ScrollingEnabled

    public void SetSelectWithRmb(bool enabled)

If true, enables selecting a tab with the right mouse button.

    [Obsolete("SetTabAlign is deprecated. Use the TabAlign property instead.")]
    public void SetTabAlign(TabAlignEnum align)

Setter for TabAlign

    [Obsolete("SetTabCloseDisplayPolicy is deprecated. Use the TabCloseDisplayPolicy property instead.")]
    public void SetTabCloseDisplayPolicy(CloseButtonDisplayPolicy policy)

Setter for TabCloseDisplayPolicy

    public void SetTabDisabled(int tabIdx, bool disabled)

If disabled is false, hides the tab at index tabIdx.

Note: Its title text will remain unless it is also removed with SetTabTitle(int, string).

    public void SetTabIcon(int tabIdx, Texture icon)

Sets an icon for the tab at index tabIdx.

    public void SetTabsRearrangeGroup(int groupId)

Defines the rearrange group ID. Choose for each Tabs the same value to dragging tabs between Tabs. Enable drag with set_drag_to_rearrange_enabled(true).

    public void SetTabTitle(int tabIdx, string title)

Sets a title for the tab at index tabIdx.

Inner Types

CloseButtonDisplayPolicy

Name Value Description
ShowNever 0  
ShowActiveOnly 1  
ShowAlways 2  
Max 3 Represents the size of the [enum CloseButtonDisplayPolicy] enum.

TabAlignEnum

Name Value Description
Left 0 Align the tabs to the left.
Center 1 Align the tabs to the center.
Right 2 Align the tabs to the right.
Max 3 Represents the size of the [enum TabAlign] enum.
Tags: