Inherits: Control < CanvasItem < Node < Object
Tabs control.
Simple tabs control, similar to TabContainer but is only in charge of drawing tabs, not interact with children.
int | current_tab | 0 |
bool | drag_to_rearrange_enabled | false |
bool | scrolling_enabled | true |
TabAlign | tab_align | 1 |
CloseButtonDisplayPolicy | tab_close_display_policy | 0 |
void | add_tab ( String title="", Texture icon=null ) |
void | ensure_tab_visible ( int idx ) |
bool | get_offset_buttons_visible ( ) const |
bool | get_select_with_rmb ( ) const |
int | get_tab_count ( ) const |
bool | get_tab_disabled ( int tab_idx ) const |
Texture | get_tab_icon ( int tab_idx ) const |
int | get_tab_offset ( ) const |
Rect2 | get_tab_rect ( int tab_idx ) const |
String | get_tab_title ( int tab_idx ) const |
int | get_tabs_rearrange_group ( ) const |
void | move_tab ( int from, int to ) |
void | remove_tab ( int tab_idx ) |
void | set_select_with_rmb ( bool enabled ) |
void | set_tab_disabled ( int tab_idx, bool disabled ) |
void | set_tab_icon ( int tab_idx, Texture icon ) |
void | set_tab_title ( int tab_idx, String title ) |
void | set_tabs_rearrange_group ( int group_id ) |
StyleBox | button | |
StyleBox | button_pressed | |
Texture | close | |
Texture | decrement | |
Texture | decrement_highlight | |
Font | font | |
Color | font_color_bg | Color( 0.69, 0.69, 0.69, 1 ) |
Color | font_color_disabled | Color( 0.9, 0.9, 0.9, 0.2 ) |
Color | font_color_fg | Color( 0.94, 0.94, 0.94, 1 ) |
int | hseparation | 4 |
Texture | increment | |
Texture | increment_highlight | |
int | label_valign_bg | 2 |
int | label_valign_fg | 0 |
StyleBox | panel | |
StyleBox | tab_bg | |
StyleBox | tab_disabled | |
StyleBox | tab_fg | |
int | top_margin | 24 |
Emitted when the active tab is rearranged via mouse drag. See drag_to_rearrange_enabled.
Emitted when a tab is right-clicked.
Emitted when switching to another tab.
Emitted when a tab is clicked, even if it is the current tab.
Emitted when a tab is closed.
Emitted when a tab is hovered by the mouse.
enum TabAlign:
Default | 0 |
Setter | set_current_tab(value) |
Getter | get_current_tab() |
Select tab at index tab_idx
.
Default | false |
Setter | set_drag_to_rearrange_enabled(value) |
Getter | get_drag_to_rearrange_enabled() |
If true
, tabs can be rearranged with mouse drag.
Default | true |
Setter | set_scrolling_enabled(value) |
Getter | get_scrolling_enabled() |
if true
, the mouse's scroll wheel cab be used to navigate the scroll view.
Default | 1 |
Setter | set_tab_align(value) |
Getter | get_tab_align() |
The alignment of all tabs. See TabAlign for details.
Default | 0 |
Setter | set_tab_close_display_policy(value) |
Getter | get_tab_close_display_policy() |
Sets when the close button will appear on the tabs. See CloseButtonDisplayPolicy for details.
Adds a new tab.
Moves the scroll view to make the tab visible.
Returns true
if the offset buttons (the ones that appear when there's not enough space for all tabs) are visible.
Returns true
if select with right mouse button is enabled.
Returns the number of tabs.
Returns true
if the tab at index tab_idx
is disabled.
Returns the Texture for the tab at index tab_idx
or null
if the tab has no Texture.
Returns the number of hidden tabs offsetted to the left.
Returns tab Rect2 with local position and size.
Returns the title of the tab at index tab_idx
. Tab titles default to the name of the indexed child node, but this can be overridden with set_tab_title.
Returns the Tabs
' rearrange group ID.
Moves a tab from from
to to
.
Removes the tab at index tab_idx
.
If true
, enables selecting a tab with the right mouse button.
If disabled
is false
, hides the tab at index tab_idx
.
Note: Its title text will remain unless it is also removed with set_tab_title.
Sets an icon
for the tab at index tab_idx
.
Sets a title
for the tab at index tab_idx
.
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)
.
© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/3.2/classes/class_tabs.html