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 TreeItems y ser estilizado así como contener botones.

Puedes quitar un TreeItem usando el Object.free.

Propiedades

bool

collapsed

int

custom_minimum_height

bool

disable_folding

Métodos

void

add_button ( int column, Texture button, int button_idx=-1, bool disabled=false, String tooltip="" )

Variant

call_recursive ( String method, ... ) vararg

void

clear_custom_bg_color ( int column )

void

clear_custom_color ( int column )

void

deselect ( int column )

void

erase_button ( int column, int button_idx )

Texture

get_button ( int column, int button_idx ) const

int

get_button_count ( int column ) const

String

get_button_tooltip ( int column, int button_idx ) const

TreeCellMode

get_cell_mode ( int column ) const

TreeItem

get_children ( )

Color

get_custom_bg_color ( int column ) const

Color

get_custom_color ( int column ) const

bool

get_expand_right ( int column ) const

Texture

get_icon ( int column ) const

int

get_icon_max_width ( int column ) const

Color

get_icon_modulate ( int column ) const

Rect2

get_icon_region ( int column ) const

Variant

get_metadata ( int column ) const

TreeItem

get_next ( )

TreeItem

get_next_visible ( bool wrap=false )

TreeItem

get_parent ( )

TreeItem

get_prev ( )

TreeItem

get_prev_visible ( bool wrap=false )

float

get_range ( int column ) const

Dictionary

get_range_config ( int column )

String

get_suffix ( int column ) const

String

get_text ( int column ) const

TextAlign

get_text_align ( int column ) const

String

get_tooltip ( int column ) const

bool

is_button_disabled ( int column, int button_idx ) const

bool

is_checked ( int column ) const

bool

is_custom_set_as_button ( int column ) const

bool

is_editable ( int column )

bool

is_selectable ( int column ) const

bool

is_selected ( int column )

void

move_to_bottom ( )

void

move_to_top ( )

void

remove_child ( Object child )

void

select ( int column )

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

set_icon ( int column, Texture texture )

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

set_range ( int column, float value )

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

set_text ( int column, String text )

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

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

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.


  • void erase_button ( int column, int button_idx )

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.


  • int get_button_count ( int column ) const

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.


  • String get_button_tooltip ( int column, int button_idx ) const

Devuelve la string de sugerencia para el botón en el índice button_idx en la columna column.


Devuelve el modo de celda de la columna.


Devuelve el primer objeto hijo del TreeItem o un objeto nulo si no hay ninguno.


  • Color get_custom_bg_color ( int column ) const

Devuelve el color de fondo personalizado de la columna column.


  • Color get_custom_color ( int column ) const

Devuelve el color personalizado de la columna column.


  • bool get_expand_right ( int column ) const

Devuelve true si expand_right está configurado.


Returns the given column's icon Texture. Error if no icon is set.


  • int get_icon_max_width ( int column ) const

Devuelve el ancho máximo del icono de la columna.


  • Color get_icon_modulate ( int column ) const

Devuelve el Color modulando el icono de la columna.


  • Rect2 get_icon_region ( int column ) const

Returns the icon Texture region as Rect2.


Returns the metadata value that was set for the given column using set_metadata.


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.


Devuelve el TreeItem padre o un objeto nulo si no hay ninguno.


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.


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.


  • bool is_button_disabled ( int column, int button_idx ) const

Devuelve true si el botón en el índice button_idx para la columna dada está desactivada.


  • bool is_checked ( int column ) const

Devuelve true si la columna dada está marcada.


  • bool is_custom_set_as_button ( int column ) const


Devuelve true si la columna column es editable.


  • bool is_selectable ( int column ) const

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.


  • void set_button_disabled ( int column, int button_idx, bool disabled )

Si true, desactiva el botón en el índice button_idx en la columna column.


Establece el modo de la celda de la columna dada en mode. Ver las constantes de TreeCellMode.


  • void set_checked ( int column, bool checked )

Si true, la columna column está marcada.


  • void set_custom_as_button ( int column, bool enable )


  • void set_custom_bg_color ( int column, Color color, bool just_outline=false )

Establece el color de fondo personalizado de la columna y si sólo se debe usar como contorno.


  • void set_custom_color ( int column, Color color )

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.


  • void set_editable ( int column, bool enabled )

Si true, la columna column es editable.


  • void set_expand_right ( int column, bool enable )

Si true, la columna column se expande a la derecha.


Sets the given column's icon Texture.


  • void set_icon_max_width ( int column, int width )

Establece el ancho máximo del icono de la columna dada.


  • void set_icon_modulate ( int column, Color modulate )

Modula el icono de la columna dada con modulate.


  • void set_icon_region ( int column, Rect2 region )

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.


  • void set_range ( int column, float value )

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.


  • void set_selectable ( int column, bool selectable )

Si true, la columna dada es seleccionable.


  • void set_suffix ( int column, String text )

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.


  • void set_tooltip ( int column, String tooltip )

Establece el texto de la sugerencia de la columna dada.