Class TreeItem
class TreeItem;
Constructors
| Name | Description |
|---|---|
this
(id)
|
|
this
(id, label, iconRes)
|
|
this
(id, label, iconRes)
|
|
this
(id, labelRes, iconRes)
|
Fields
| Name | Type | Description |
|---|---|---|
_children
|
ObjectList!(dcanvas.widgets.tree.TreeItem) | |
_expanded
|
bool | |
_iconRes
|
string | |
_id
|
string | |
_intParam
|
int | |
_level
|
int | |
_objectParam
|
Object | |
_parent
|
TreeItem | |
_text
|
UIString |
Properties
| Name | Type | Description |
|---|---|---|
canCollapse[get]
|
bool | returns true if item supports collapse |
childCount[get]
|
int | returns number of children of this widget |
defaultItem[get]
|
TreeItem | |
expanded[get]
|
bool | |
hasChildren[get]
|
bool | returns true if item has at least one child |
iconRes[get]
|
string | |
iconRes[set]
|
TreeItem | |
id[get]
|
string | |
id[set]
|
TreeItem | |
intParam[get]
|
int | |
intParam[set]
|
TreeItem | |
isDefault[get]
|
bool | |
isRoot[get]
|
bool | returns true if this item is root item |
isSelected[get]
|
bool | |
level[get]
|
int | |
objectParam[get]
|
Object | |
objectParam[set]
|
TreeItem | |
parent[get]
|
TreeItem | |
root[get]
|
TreeItems | returns topmost item |
selectedItem[get]
|
TreeItem | |
text[get]
|
dstring | get widget text |
text[set]
|
TreeItem | set text to show |
textResource[set]
|
TreeItem | set text resource ID to show |
topParent[get]
|
TreeItem | |
expanded[set]
|
TreeItem | |
level[set]
|
TreeItem | |
parent[set]
|
TreeItem |
Methods
| Name | Description |
|---|---|
addChild
(item, index)
|
adds child, returns added item |
child
(index)
|
returns child by index |
childIndex
(item)
|
returns index of widget in child list, -1 if passed widget is not a child of this widget |
clear
()
|
|
collapse
()
|
|
collapseAll
()
|
expand this node and all children |
compareId
(id)
|
|
expand
()
|
|
expandAll
()
|
expand this node and all children |
findItemById
(id)
|
returns item by id, null if not found |
isFullyExpanded
()
|
Returns true if this item and all parents are expanded. |
isVisible
()
|
Returns true if all parents are expanded. |
newChild
(id, label, iconRes)
|
create and add new child item |
opApply
(callback)
|
Support foreach |
removeChild
(index)
|
removes child, returns removed item |
removeChild
(child)
|
removes child by reference, returns removed item |
removeChild
(ID)
|
removes child by ID, returns removed item |
activateItem
(item)
|
|
nextVisible
(item, found)
|
|
onUpdate
(item)
|
notify listeners |
prevVisible
(item, prevFoundVisible)
|
|
selectItem
(item)
|
|
toggleExpand
(item)
|
Aliases
| Name | Description |
|---|---|
~this
|