TreeItem

继承: Object

类别: 核心

简要说明

控件中的单个项 Tree .

方法

无效

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

无效

clear_custom_bg_color ( int column )

无效

clear_custom_color ( int column )

无效

deselect ( int column )

无效

erase_button ( int column, int button_idx )

Texture

get_button ( int column, int button_idx ) const

int

get_button_count ( int column ) const

TreeCellMode

get_cell_mode ( int column ) const

TreeItem

get_children ( )

Color

get_custom_bg_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

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_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 )

无效

move_to_bottom ( )

无效

move_to_top ( )

无效

remove_child ( Object child )

无效

select ( int column )

无效

set_button ( int column, int button_idx, Texture button )

无效

set_button_disabled ( int column, int button_idx, bool disabled )

无效

set_cell_mode ( int column, TreeCellMode mode )

无效

set_checked ( int column, bool checked )

无效

set_custom_as_button ( int column, bool enable )

无效

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

无效

set_custom_color ( int column, Color color )

无效

set_custom_draw ( int column, Object object, String callback )

无效

set_editable ( int column, bool enabled )

无效

set_expand_right ( int column, bool enable )

无效

set_icon ( int column, Texture texture )

无效

set_icon_max_width ( int column, int width )

无效

set_icon_region ( int column, Rect2 region )

无效

set_metadata ( int column, Variant meta )

无效

set_range ( int column, float value )

无效

set_range_config ( int column, float min, float max, float step, bool expr=false )

无效

set_selectable ( int column, bool selectable )

无效

set_text ( int column, String text )

无效

set_text_align ( int column, TextAlign text_align )

无效

set_tooltip ( int column, String tooltip )

枚举

枚举 TreeCellMode

  • CELL_MODE_STRING = 0 ---单元格包含字符串。

  • CELL_MODE_CHECK = 1 ---可以检查单元格。

  • CELL_MODE_RANGE = 2 ---单元格包含一个范围。

  • CELL_MODE_ICON = 3 ---单元格包含一个图标。

  • CELL_MODE_CUSTOM = 4

枚举 TextAlign

  • ALIGN_LEFT = 0 ---文本左对齐。见 set_text_align() .

  • ALIGN_CENTER = 1 ---文本居中。见 set_text_align() .

  • ALIGN_RIGHT = 2 ---文本右对齐。见 set_text_align() .

描述

控件中的单个项 Tree . 可能有孩子 TreeItem 以及样式化和包含按钮。

属性描述

设定器

设置折叠(值)

吸气剂

是否已折叠()

如果 true ,Treeitem崩溃。

  • int custom_minimum_height

设定器

设置自定义最小高度(值)

吸气剂

获取自定义最小高度()。

自定义最小高度。

  • bool disable_folding

设定器

设置禁用折叠(值)

吸气剂

折叠功能是否被禁用()。

如果 true ,此树项禁用折叠。

方法说明

添加按钮 Texture button 在列 column . 这个 button_idx 索引用于在调用其他方法时标识按钮。如果未指定,则使用下一个可用索引,可以通过调用 get_button_count 在这个方法之后。或者,按钮可以 disabled 并且有一个 tooltip .

  • 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 )

删除索引处的按钮 button_idx 编队 column .

返回 Texture 在索引处的按钮 button_idx 编队 column .

  • int get_button_count ( int column ) const

返回列中的按钮数 column . 如果未指定索引,则可用于获取最近添加的按钮索引。

返回列的单元格模式。

返回TreeItem的子项。

  • Color get_custom_bg_color ( int column ) const

返回列的自定义背景色 column .

  • bool get_expand_right ( int column ) const

返回 true 如果 expand_right 被设置。

返回给定列的图标 Texture . 未设置图标时出错。

  • int get_icon_max_width ( int column ) const

返回列图标的最大宽度。

  • Rect2 get_icon_region ( int column ) const

返回图标 Texture 区域 Rect2 .

返回树中的下一个树项。

返回树中的下一个可见树项。

如果 wrap 如果启用,则当对最后一个可见元素调用时,该方法将环绕到树中的第一个可见元素,否则它将返回 null .

返回父树项。

返回树中的前一个树项。

返回树中以前可见的树项。

如果 wrap 如果启用,则当对第一个可见元素调用时,该方法将环绕到树中的最后一个可见元素,否则它将返回 null .

返回给定列的文本。

返回给定列的文本对齐方式。

返回给定列的工具提示。

  • bool is_button_disabled ( int column, int button_idx ) const

返回 true 如果索引处的按钮 button_idx 因为给定的列被禁用。

  • bool is_checked ( int column ) const

返回 true 如果选中给定列。

  • bool is_custom_set_as_button ( int column ) const

返回 true if列 column 可编辑。

  • bool is_selectable ( int column ) const

返回 true if列 column 可选择。

返回 true if列 column 被选中。

  • void move_to_bottom ( )

将此树项移动到 Tree 等级制度。

  • void move_to_top ( )

将此树项移动到 Tree 等级制度。

  • void remove_child ( Object child )

移除给定的子树项。

  • void select ( int column )

选择列 column .

设置给定列的按钮 Texture 在索引 button_idxbutton .

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

如果 true ,禁用索引处的按钮 button_idx 编队 column .

将给定列的单元格模式设置为 mode . 见 CELL_MODE_* 常量。

  • void set_checked ( int column, bool checked )

如果 true ,列 column 检查。

  • 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 )

设置给定列的自定义颜色。

将给定列的自定义绘制回调设置为 callback 方法对 object .

这个 callback 应该接受两个参数: TreeItem 它的位置和大小 Rect2 .

  • void set_editable ( int column, bool enabled )

如果 true ,列 column 可编辑。

  • void set_expand_right ( int column, bool enable )

如果 true ,列 column 扩展到右侧。

设置给定列的图标 Texture .

  • void set_icon_max_width ( int column, int width )

设置给定列的图标的最大宽度。

  • void set_icon_region ( int column, Rect2 region )

设置给定列的图标的纹理区域。

  • void set_range ( int column, float value )

  • void set_selectable ( int column, bool selectable )

如果 true ,给定列是可选的。

设置给定列的文本对齐方式。见 TextAlign 对于可能的值。

  • void set_tooltip ( int column, String tooltip )

设置给定列的工具提示文本。