Class TreeItem

class TreeItem;

Constructors

NameDescription
this (id)
this (id, label, iconRes)
this (id, label, iconRes)
this (id, labelRes, iconRes)

Fields

NameTypeDescription
_children ObjectList!(dcanvas.widgets.tree.TreeItem)
_expanded bool
_iconRes string
_id string
_intParam int
_level int
_objectParam Object
_parent TreeItem
_text UIString

Properties

NameTypeDescription
canCollapse[get] boolreturns true if item supports collapse
childCount[get] intreturns number of children of this widget
defaultItem[get] TreeItem
expanded[get] bool
hasChildren[get] boolreturns 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] boolreturns true if this item is root item
isSelected[get] bool
level[get] int
objectParam[get] Object
objectParam[set] TreeItem
parent[get] TreeItem
root[get] TreeItemsreturns topmost item
selectedItem[get] TreeItem
text[get] dstringget widget text
text[set] TreeItemset text to show
textResource[set] TreeItemset text resource ID to show
topParent[get] TreeItem
expanded[set] TreeItem
level[set] TreeItem
parent[set] TreeItem

Methods

NameDescription
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

NameDescription
~this