TabContainer

Inherits: Container < Control < CanvasItem < Node < Object

Contenedor con pestaña.

Descripción

Arranges Control children into a tabbed view, creating a tab for each one. The active tab's corresponding Control has its visible property set to true, and all other children's to false.

Ignores non-Control children.

Note: The drawing of the clickable tabs themselves is handled by this node. Adding Tabs as children is not needed.

Propiedades

bool

all_tabs_in_front

false

int

current_tab

0

bool

drag_to_rearrange_enabled

false

TabAlign

tab_align

1

bool

tabs_visible

true

bool

use_hidden_tabs_for_min_size

false

Métodos

Control

get_current_tab_control ( ) const

Popup

get_popup ( ) const

int

get_previous_tab ( ) const

Control

get_tab_control ( int tab_idx ) const

int

get_tab_count ( ) const

bool

get_tab_disabled ( int tab_idx ) const

bool

get_tab_hidden ( int tab_idx ) const

Texture

get_tab_icon ( int tab_idx ) const

int

get_tab_idx_at_point ( Vector2 point ) const

String

get_tab_title ( int tab_idx ) const

int

get_tabs_rearrange_group ( ) const

void

set_popup ( Node popup )

void

set_tab_disabled ( int tab_idx, bool disabled )

void

set_tab_hidden ( int tab_idx, bool hidden )

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 )

Propiedades del Theme

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

int

label_valign_bg

2

int

label_valign_fg

0

int

side_margin

8

int

top_margin

24

Font

font

Texture

decrement

Texture

decrement_highlight

Texture

increment

Texture

increment_highlight

Texture

menu

Texture

menu_highlight

StyleBox

panel

StyleBox

tab_bg

StyleBox

tab_disabled

StyleBox

tab_fg

Señales

  • pre_popup_pressed ( )

Se emite cuando se hace clic en el botón Popup del TabContainer. Consulte set_popup para obtener más detalles.


  • tab_changed ( int tab )

Emitido cuando se cambia a otra pestaña.


  • tab_selected ( int tab )

Se emite cuando se selecciona una pestaña, aunque sea la actual.

Enumeraciones

enum TabAlign:

  • ALIGN_LEFT = 0 --- Alinea las pestañas a la izquierda.

  • ALIGN_CENTER = 1 --- Alinea las pestañas al centro.

  • ALIGN_RIGHT = 2 --- Alinee las pestañas a la derecha.

Descripciones de Propiedades

  • bool all_tabs_in_front

Default

false

Setter

set_all_tabs_in_front(value)

Getter

is_all_tabs_in_front()

If true, all tabs are drawn in front of the panel. If false, inactive tabs are drawn behind the panel.


  • int current_tab

Default

0

Setter

set_current_tab(value)

Getter

get_current_tab()

El actual índice de pestañas. Cuando se establece, la propiedad visible de este índice del nodo Control se establece en true y todas las demás se establecen en false.


  • bool drag_to_rearrange_enabled

Default

false

Setter

set_drag_to_rearrange_enabled(value)

Getter

get_drag_to_rearrange_enabled()

Si true, las pestañas se pueden reorganizar con el arrastre del ratón.


Default

1

Setter

set_tab_align(value)

Getter

get_tab_align()

La alineación de todas las pestañas en el contenedor de pestañas. Vea las constantes TabAlign para más detalles.


Default

true

Setter

set_tabs_visible(value)

Getter

are_tabs_visible()

Si true, las pestañas son visibles. Si false, el contenido y los títulos de las pestañas están ocultos.


  • bool use_hidden_tabs_for_min_size

Default

false

Setter

set_use_hidden_tabs_for_min_size(value)

Getter

get_use_hidden_tabs_for_min_size()

Si true, los nodos hijos Control que están ocultos tienen en cuenta su tamaño mínimo en el total, en lugar de sólo el visible actualmente.

Descripciones de Métodos

  • Control get_current_tab_control ( ) const

Devuelve el nodo hijo Control situado en el pestaña activa.


  • Popup get_popup ( ) const

Returns the Popup node instance if one has been set already with set_popup.

Warning: This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their CanvasItem.visible property.


  • int get_previous_tab ( ) const

Devuelve la pestaña anteriormente activa.


Devuelve el nodo Control de la pestaña en el índice tab_idx.


  • int get_tab_count ( ) const

Devuelve el número de pestañas.


  • bool get_tab_disabled ( int tab_idx ) const

Devuelve true si la pestaña del índice tab_idx está desactivada.


  • bool get_tab_hidden ( int tab_idx ) const

Returns true if the tab at index tab_idx is hidden.


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


  • int get_tab_idx_at_point ( Vector2 point ) const

Returns the index of the tab at local coordinates point. Returns -1 if the point is outside the control boundaries or if there's no tab at the queried position.


Devuelve el título de la pestaña en el índice tab_idx. Los títulos de las pestañas predeterminan el nombre del nodo hijo indexado, pero esto puede ser sobrescrito con set_tab_title.


  • int get_tabs_rearrange_group ( ) const

Devuelve el TabContainer reordena la identificación de grupo.


  • void set_popup ( Node popup )

Si se configura en una instancia de nodo Popup, aparece un icono de menú emergente en la esquina superior derecha del TabContainer. Al hacer clic en él se expandirá el nodo Popup.


  • void set_tab_disabled ( int tab_idx, bool disabled )

If disabled is true, disables the tab at index tab_idx, making it non-interactable.


  • void set_tab_hidden ( int tab_idx, bool hidden )

If hidden is true, hides the tab at index tab_idx, making it disappear from the tab area.


Establece un icono para la pestaña en el índice tab_idx.


  • void set_tab_title ( int tab_idx, String title )

Sets a title for the tab at index tab_idx. Tab titles default to the name of the indexed child node.


  • void set_tabs_rearrange_group ( int group_id )

Defines rearrange group id, choose for each TabContainer the same value to enable tab drag between TabContainer. Enable drag with drag_to_rearrange_enabled.

Theme Property Descriptions

Default

Color( 0.69, 0.69, 0.69, 1 )

El color de la fuente de las pestañas inactivas.


  • Color font_color_disabled

Default

Color( 0.9, 0.9, 0.9, 0.2 )

El color de la fuente de las pestañas desactivadas.


Default

Color( 0.94, 0.94, 0.94, 1 )

Color de la fuente de la pestaña actualmente seleccionada.


  • int hseparation

Default

4

Horizontal separation between tabs.


  • int label_valign_bg

Default

2


  • int label_valign_fg

Default

0


  • int side_margin

Default

8

El espacio en los bordes izquierdo y derecho de la barra de pestañas.


  • int top_margin

Default

24


La fuente usada para dibujar los nombres de las pestañas.


Icono para el botón de la flecha izquierda que aparece cuando hay demasiadas pestañas que no caben en el ancho del contenedor. Cuando el botón está desactivado (es decir, la primera pestaña es visible), aparece semi-transparente.


Icono para el botón de la flecha izquierda que aparece cuando hay demasiadas pestañas que no caben en el ancho del contenedor. Se utiliza cuando el cursor se mantiene encima del botón.


Icono para el botón de la flecha derecha que aparece cuando hay demasiadas pestañas que no caben en el ancho del contenedor. Cuando el botón está desactivado (es decir, la última pestaña es visible) aparece semi-transparente.


Icono para el botón de la flecha derecha que aparece cuando hay demasiadas pestañas que no caben en el ancho del contenedor. Se utiliza cuando el cursor esta encima del botón.


El icono para el botón de menú (ver set_popup).


El icono del botón de menú (ver set_popup) cuando se pasa el cursor por encima de él.


El estilo para el relleno de fondo.


El estilo de las pestañas inactivas.


El estilo de las pestañas desactivadas.


El estilo de la pestaña actualmente seleccionada.