TreeItem¶
继承: Object
类别: 核心
方法¶
无效 |
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 ) |
无效 |
|
无效 |
erase_button ( int column, int button_idx ) |
get_button ( int column, int button_idx ) const |
|
get_button_count ( int column ) const |
|
get_cell_mode ( int column ) const |
|
get_children ( ) |
|
get_custom_bg_color ( int column ) const |
|
get_expand_right ( int column ) const |
|
get_icon_max_width ( 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_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 ) |
|
无效 |
move_to_bottom ( ) |
无效 |
move_to_top ( ) |
无效 |
remove_child ( Object child ) |
无效 |
|
无效 |
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_max_width ( int column, int width ) |
无效 |
set_icon_region ( int column, Rect2 region ) |
无效 |
set_metadata ( int column, Variant meta ) |
无效 |
|
无效 |
set_range_config ( int column, float min, float max, float step, bool expr=false ) |
无效 |
set_selectable ( int column, bool selectable ) |
无效 |
|
无效 |
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()
.
属性描述¶
bool collapsed
设定器 |
设置折叠(值) |
吸气剂 |
是否已折叠() |
如果 true
,Treeitem崩溃。
int custom_minimum_height
设定器 |
设置自定义最小高度(值) |
吸气剂 |
获取自定义最小高度()。 |
自定义最小高度。
bool disable_folding
设定器 |
设置禁用折叠(值) |
吸气剂 |
折叠功能是否被禁用()。 |
如果 true
,此树项禁用折叠。
方法说明¶
void add_button ( int column, Texture button, int button_idx=-1, bool disabled=false, String tooltip="" )
添加按钮 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 )
取消选择给定列。
删除索引处的按钮 button_idx
编队 column
.
返回 Texture 在索引处的按钮 button_idx
编队 column
.
返回列中的按钮数 column
. 如果未指定索引,则可用于获取最近添加的按钮索引。
TreeCellMode get_cell_mode ( int column ) const
返回列的单元格模式。
TreeItem get_children ( )
返回TreeItem的子项。
返回列的自定义背景色 column
.
返回 true
如果 expand_right
被设置。
返回给定列的图标 Texture . 未设置图标时出错。
返回列图标的最大宽度。
TreeItem get_next ( )
返回树中的下一个树项。
返回树中的下一个可见树项。
如果 wrap
如果启用,则当对最后一个可见元素调用时,该方法将环绕到树中的第一个可见元素,否则它将返回 null
.
TreeItem get_parent ( )
返回父树项。
TreeItem get_prev ( )
返回树中的前一个树项。
返回树中以前可见的树项。
如果 wrap
如果启用,则当对第一个可见元素调用时,该方法将环绕到树中的最后一个可见元素,否则它将返回 null
.
Dictionary get_range_config ( int column )
返回给定列的文本。
返回给定列的文本对齐方式。
返回给定列的工具提示。
返回 true
如果索引处的按钮 button_idx
因为给定的列被禁用。
返回 true
如果选中给定列。
返回 true
if列 column
可编辑。
返回 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_idx
到 button
.
如果 true
,禁用索引处的按钮 button_idx
编队 column
.
void set_cell_mode ( int column, TreeCellMode mode )
将给定列的单元格模式设置为 mode
. 见 CELL_MODE_*
常量。
如果 true
,列 column
检查。
设置给定列的自定义背景色,以及是否仅将其用作大纲。
设置给定列的自定义颜色。
将给定列的自定义绘制回调设置为 callback
方法对 object
.
这个 callback
应该接受两个参数: TreeItem
它的位置和大小 Rect2 .
如果 true
,列 column
可编辑。
如果 true
,列 column
扩展到右侧。
设置给定列的图标 Texture .
设置给定列的图标的最大宽度。
设置给定列的图标的纹理区域。
如果 true
,给定列是可选的。
设置给定列的文本对齐方式。见 TextAlign 对于可能的值。
设置给定列的工具提示文本。