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.

    public int GetCurrentTab()

Getter for CurrentTab

    public bool GetDragToRearrangeEnabled()

Getter for DragToRearrangeEnabled

    public bool GetOffsetButtonsVisible()

    public bool GetScrollingEnabled()

Getter for ScrollingEnabled

    public bool GetSelectWithRmb()

Returns true if select with right mouse button is enabled.

    public TabAlignEnum GetTabAlign()

Getter for TabAlign

    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)

Rearrange tab.

    public void RemoveTab(int tabIdx)

Removes tab at index tabIdx

    public void SetCurrentTab(int tabIdx)

Setter for CurrentTab

    public void SetDragToRearrangeEnabled(bool enabled)

Setter for DragToRearrangeEnabled

    public void SetScrollingEnabled(bool enabled)

Setter for ScrollingEnabled

    public void SetSelectWithRmb(bool enabled)

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

    public void SetTabAlign(TabAlignEnum align)

Setter for TabAlign

    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 that its title text will remain, unless 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 rearrange group id, choose for each Tabs the same value to enable tab drag 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  

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  
Tags: