Tabs

    Category: Core

    Tabs Control.

    Properties

    Methods

    void ( String title=”“, icon=null )
    voidensure_tab_visible ( idx )
    bool ( ) const
    bool ( ) const
    int ( ) const
    bool ( int tab_idx ) const
    get_tab_icon ( tab_idx ) const
    int ( ) const
    Rect2 ( int tab_idx ) const
    get_tab_title ( tab_idx ) const
    int ( ) const
    voidmove_tab ( from, int to )
    void ( int tab_idx )
    void ( bool enabled )
    void ( int tab_idx, disabled )
    voidset_tab_icon ( tab_idx, Texture icon )
    void ( int tab_idx, title )
    voidset_tabs_rearrange_group ( group_id )

    Signals

    • reposition_active_tab_request ( int idx_to )

    • right_button_pressed ( tab )

    • tab_changed ( int tab )

    • tab_clicked ( tab )

    • tab_close ( int tab )

    Enumerations

    enum TabAlign:

    • ALIGN_LEFT = 0 — Align the tabs to the left.
    • ALIGN_CENTER = 1 — Align the tabs to the center.
    • ALIGN_RIGHT = 2 — Align the tabs to the right.
    • ALIGN_MAX = 3 — Represents the size of the enum.

    enum CloseButtonDisplayPolicy:

    • CLOSE_BUTTON_SHOW_NEVER = 0
    • CLOSE_BUTTON_SHOW_ACTIVE_ONLY = 1
    • CLOSE_BUTTON_SHOW_ALWAYS = 2
    • CLOSE_BUTTON_MAX = 3 — Represents the size of the CloseButtonDisplayPolicy enum.

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

    Property Descriptions

    • int current_tab
    Setterset_current_tab(value)
    Getterget_current_tab()

    Select tab at index .


    • drag_to_rearrange_enabled

    If true, tabs can be rearranged with mouse drag.


    • bool scrolling_enabled
    Setterset_scrolling_enabled(value)
    Getterget_scrolling_enabled()

    • tab_align

    Setterset_tab_close_display_policy(value)
    Getterget_tab_close_display_policy()

    Method Descriptions

    • void add_tab ( title=”“, Texture icon=null )

    Adds a new tab.


    Moves the Scroll view to make the tab visible.


    • get_offset_buttons_visible ( ) const

    • bool get_select_with_rmb ( ) const

    Returns true if select with right mouse button is enabled.


    • get_tab_count ( ) const

    Returns the number of tabs.


    • bool get_tab_disabled ( tab_idx ) const

    Returns true if the tab at index tab_idx is disabled.


    • Texture get_tab_icon ( tab_idx ) const

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


    • int get_tab_offset ( ) const

    • get_tab_rect ( int tab_idx ) const

    Returns tab with local position and size.


    • String get_tab_title ( tab_idx ) const

    • int get_tabs_rearrange_group ( ) const

    Returns the Tabs rearrange group id.


    • void move_tab ( from, int to )

    Rearrange tab.


    • void remove_tab ( tab_idx )

    Removes tab at index tab_idx


    • void set_select_with_rmb ( bool enabled )

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


    • void set_tab_disabled ( tab_idx, bool disabled )

    If disabled is , hides the tab at index tab_idx. Note that its title text will remain, unless also removed with .


    • void set_tab_icon ( int tab_idx, icon )

    Sets an icon for the tab at index tab_idx.


    Sets a title for the tab at index tab_idx.


    • void set_tabs_rearrange_group ( int group_id )