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¶
|
||
|
||
|
||
|
||
|
||
|
Métodos¶
get_current_tab_control ( ) const |
|
get_popup ( ) const |
|
get_previous_tab ( ) const |
|
get_tab_control ( int tab_idx ) const |
|
get_tab_count ( ) const |
|
get_tab_disabled ( int tab_idx ) const |
|
get_tab_hidden ( int tab_idx ) const |
|
get_tab_icon ( int tab_idx ) const |
|
get_tab_idx_at_point ( Vector2 point ) const |
|
get_tab_title ( int tab_idx ) const |
|
get_tabs_rearrange_group ( ) const |
|
void |
|
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¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
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 |
|
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 |
|
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 |
|
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.
TabAlign tab_align
Default |
|
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.
bool tabs_visible
Default |
|
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.
Default |
|
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.
Devuelve true
si la pestaña del índice tab_idx
está desactivada.
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.
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.
If disabled
is true
, disables the tab at index tab_idx
, making it non-interactable.
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
.
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¶
Color font_color_bg
Default |
|
El color de la fuente de las pestañas inactivas.
Color font_color_disabled
Default |
|
El color de la fuente de las pestañas desactivadas.
Color font_color_fg
Default |
|
Color de la fuente de la pestaña actualmente seleccionada.
int hseparation
Default |
|
Horizontal separation between tabs.
int label_valign_bg
Default |
|
int label_valign_fg
Default |
|
int side_margin
Default |
|
El espacio en los bordes izquierdo y derecho de la barra de pestañas.
int top_margin
Default |
|
Font font
La fuente usada para dibujar los nombres de las pestañas.
Texture decrement
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.
Texture decrement_highlight
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.
Texture increment
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.
Texture increment_highlight
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.
StyleBox panel
El estilo para el relleno de fondo.
StyleBox tab_bg
El estilo de las pestañas inactivas.
StyleBox tab_disabled
El estilo de las pestañas desactivadas.
StyleBox tab_fg
El estilo de la pestaña actualmente seleccionada.