Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
TreeItem¶
Inherits: Object
Control para un solo elemento dentro de un Tree.
Descripción¶
Control para un solo elemento dentro de un Tree. Puede tener hijos TreeItem
s y ser estilizado así como contener botones.
Puedes quitar un TreeItem
usando el Object.free.
Propiedades¶
Métodos¶
void |
add_button ( int column, Texture button, int button_idx=-1, bool disabled=false, String tooltip="" ) |
call_recursive ( String method, ... ) vararg |
|
void |
clear_custom_bg_color ( int column ) |
void |
clear_custom_color ( int column ) |
void |
|
void |
erase_button ( int column, int button_idx ) |
get_button ( int column, int button_idx ) const |
|
get_button_count ( int column ) const |
|
get_button_tooltip ( int column, int button_idx ) const |
|
get_cell_mode ( int column ) const |
|
get_children ( ) |
|
get_custom_bg_color ( int column ) const |
|
get_custom_color ( int column ) const |
|
get_expand_right ( int column ) const |
|
get_icon_max_width ( int column ) const |
|
get_icon_modulate ( int column ) const |
|
get_icon_region ( int column ) const |
|
get_metadata ( int column ) const |
|
get_next ( ) |
|
get_next_visible ( bool wrap=false ) |
|
get_parent ( ) |
|
get_prev ( ) |
|
get_prev_visible ( bool wrap=false ) |
|
get_range_config ( int column ) |
|
get_suffix ( int column ) const |
|
get_text_align ( int column ) const |
|
get_tooltip ( int column ) const |
|
is_button_disabled ( int column, int button_idx ) const |
|
is_checked ( int column ) const |
|
is_custom_set_as_button ( int column ) const |
|
is_editable ( int column ) |
|
is_selectable ( int column ) const |
|
is_selected ( int column ) |
|
void |
move_to_bottom ( ) |
void |
move_to_top ( ) |
void |
remove_child ( Object child ) |
void |
|
void |
set_button ( int column, int button_idx, Texture button ) |
void |
set_button_disabled ( int column, int button_idx, bool disabled ) |
void |
set_cell_mode ( int column, TreeCellMode mode ) |
void |
set_checked ( int column, bool checked ) |
void |
set_custom_as_button ( int column, bool enable ) |
void |
set_custom_bg_color ( int column, Color color, bool just_outline=false ) |
void |
set_custom_color ( int column, Color color ) |
void |
set_custom_draw ( int column, Object object, String callback ) |
void |
set_editable ( int column, bool enabled ) |
void |
set_expand_right ( int column, bool enable ) |
void |
|
void |
set_icon_max_width ( int column, int width ) |
void |
set_icon_modulate ( int column, Color modulate ) |
void |
set_icon_region ( int column, Rect2 region ) |
void |
set_metadata ( int column, Variant meta ) |
void |
|
void |
set_range_config ( int column, float min, float max, float step, bool expr=false ) |
void |
set_selectable ( int column, bool selectable ) |
void |
set_suffix ( int column, String text ) |
void |
|
void |
set_text_align ( int column, TextAlign text_align ) |
void |
set_tooltip ( int column, String tooltip ) |
Enumeraciones¶
enum TreeCellMode:
CELL_MODE_STRING = 0 --- La celda contiene una string.
CELL_MODE_CHECK = 1 --- Cell contains a checkbox.
CELL_MODE_RANGE = 2 --- La celda contiene un rango.
CELL_MODE_ICON = 3 --- La celda contiene un icono.
CELL_MODE_CUSTOM = 4
enum TextAlign:
ALIGN_LEFT = 0 --- Alinee el texto a la izquierda. Ver
set_text_align()
.ALIGN_CENTER = 1 --- Centrar el texto. Ver
set_text_align()
.ALIGN_RIGHT = 2 --- Alinea el texto a la derecha. Ver
set_text_align()
.
Descripciones de Propiedades¶
bool collapsed
Setter |
set_collapsed(value) |
Getter |
is_collapsed() |
Si true
, el TreeItem se colapsa.
int custom_minimum_height
Setter |
set_custom_minimum_height(value) |
Getter |
get_custom_minimum_height() |
La altura mínima personalizada.
bool disable_folding
Setter |
set_disable_folding(value) |
Getter |
is_folding_disabled() |
Si true
, el plegado está deshabilitado para este TreeItem.
Descripciones de Métodos¶
void add_button ( int column, Texture button, int button_idx=-1, bool disabled=false, String tooltip="" )
Adds a button with Texture button
at column column
. The button_idx
index is used to identify the button when calling other methods. If not specified, the next available index is used, which may be retrieved by calling get_button_count immediately after this method. Optionally, the button can be disabled
and have a tooltip
.
Llama al method
en el actual TreeItem y sus hijos de forma recursiva. Pasa los parámetros como una lista separada por comas.
void clear_custom_bg_color ( int column )
Restablece el color de fondo de la columna dada a su valor predeterminado.
void clear_custom_color ( int column )
Restablece el color de la columna dada a su valor predeterminado.
void deselect ( int column )
Deselecciona la columna dada.
Elimina el botón en el índice button_idx
en la columna column
.
Returns the Texture of the button at index button_idx
in column column
.
Devuelve el número de botones en la columna column
. Puede utilizarse para obtener el índice del último botón añadido, si no se especificó ningún índice.
Devuelve la string de sugerencia para el botón en el índice button_idx
en la columna column
.
TreeCellMode get_cell_mode ( int column ) const
Devuelve el modo de celda de la columna.
TreeItem get_children ( )
Devuelve el primer objeto hijo del TreeItem o un objeto nulo si no hay ninguno.
Devuelve el color de fondo personalizado de la columna column
.
Devuelve el color personalizado de la columna column
.
Devuelve true
si expand_right
está configurado.
Returns the given column's icon Texture. Error if no icon is set.
Devuelve el ancho máximo del icono de la columna.
Devuelve el Color modulando el icono de la columna.
Returns the icon Texture region as Rect2.
Returns the metadata value that was set for the given column using set_metadata.
TreeItem get_next ( )
Devuelve el siguiente TreeItem del árbol o un objeto nulo si no hay ninguno.
Devuelve el siguiente elemento visible del árbol o un objeto nulo si no hay ninguno.
Si wrap
está habilitado, el método envolverá al primer elemento visible del árbol cuando sea llamado al último elemento visible, de lo contrario devuelve null
.
TreeItem get_parent ( )
Devuelve el TreeItem padre o un objeto nulo si no hay ninguno.
TreeItem get_prev ( )
Devuelve el TreeItem anterior del árbol o un objeto nulo si no hay ninguno.
Devuelve el anterior TreeItem visible en el árbol o un objeto nulo si no hay ninguno.
Si wrap
está habilitado, el método se ajustará al último elemento visible del árbol cuando sea llamado al primer elemento visible, de lo contrario devuelve null
.
Returns the value of a CELL_MODE_RANGE column.
Dictionary get_range_config ( int column )
Returns a dictionary containing the range parameters for a given column. The keys are "min", "max", "step", and "expr".
Gets the suffix string shown after the column value.
Devuelve el texto de la columna dada.
Devuelve la alineación del texto de la columna dada.
Devuelve la sugerencia de la columna dada.
Devuelve true
si el botón en el índice button_idx
para la columna dada está desactivada.
Devuelve true
si la columna dada está marcada.
Devuelve true
si la columna column
es editable.
Devuelve true
si la columna column
es seleccionable.
Devuelve true
si se selecciona la columna column
.
void move_to_bottom ( )
Mueve este TreeItem al fondo de la jerarquía Tree.
void move_to_top ( )
Mueve este TreeItem al fondo de la jerarquía Tree.
void remove_child ( Object child )
Retira al niño dado TreeItem
y a todos sus hijos del Tree. Tenga en cuenta que no libera el elemento de la memoria, por lo que puede ser reutilizado más tarde. Para eliminar completamente un TreeItem
usa el Object.free.
void select ( int column )
Selecciona la columna column
.
Sets the given column's button Texture at index button_idx
to button
.
Si true
, desactiva el botón en el índice button_idx
en la columna column
.
void set_cell_mode ( int column, TreeCellMode mode )
Establece el modo de la celda de la columna dada en mode
. Ver las constantes de TreeCellMode.
Si true
, la columna column
está marcada.
Establece el color de fondo personalizado de la columna y si sólo se debe usar como contorno.
Establece el color personalizado de la columna dada.
Establece el método de devolución de llamada de la columna dada en callback
en object
.
El callback
debe aceptar dos argumentos: el TreeItem
que se dibuja y su posición y tamaño como un Rect2.
Si true
, la columna column
es editable.
Si true
, la columna column
se expande a la derecha.
Sets the given column's icon Texture.
Establece el ancho máximo del icono de la columna dada.
Modula el icono de la columna dada con modulate
.
Establece la región de textura del icono de la columna dada.
Sets the metadata value for the given column, which can be retrieved later using get_metadata. This can be used, for example, to store a reference to the original data.
Sets the value of a CELL_MODE_RANGE column.
Sets the range of accepted values for a column. The column must be in the CELL_MODE_RANGE mode.
If expr
is true
, the edit mode slider will use an exponential scale as with Range.exp_edit.
Si true
, la columna dada es seleccionable.
Sets a string to be shown after a column's value (for example, a unit abbreviation).
Sets the given column's text value.
Establece la alineación del texto de la columna dada. Ver TextAlign para los posibles valores.
Establece el texto de la sugerencia de la columna dada.