DTree
Events
DTree:ChildExpanded( boolean bExpand )
This is used internally - although you're able to use it you probably shouldn't.
Calls directly to Panel:InvalidateLayout.
Called by DTree_Nodes when a sub element has been expanded or collapsed.
Used as a placeholder function alongside DTree:ExpandTo, DTree:SetExpanded and DTree:MoveChildTo.
The DTree acts a root node and methods with the same name in DTree_Node call to the parent.
Called when the any node is clicked. Called by DTree_Node:DoClick.
Called when the any node is right clicked. Called by DTree_Node:DoRightClick.
DTree:OnNodeSelected( Panel node )
This function is called when a node within a tree is selected.
Methods
This is used internally - although you're able to use it you probably shouldn't.
Does nothing. Used as a placeholder empty function alongside DTree:MoveChildTo, DTree:SetExpanded and DTree:ChildExpanded.
The DTree acts a root node and methods with the same name in DTree_Node call to the parent.
boolean DTree:GetClickOnDragHover()
Returns the status of DTree:SetClickOnDragHover. See that for more info.
number DTree:GetIndentSize()
Returns the indentation size of the DTree, the distance between each "level" of the tree is offset on the left from the previous level.
Currently this feature has no effect on the DTree element.
number DTree:GetLineHeight()
Returns the height of each DTree_Node in the tree.
Panel DTree:GetSelectedItem()
Returns the currently selected node.
boolean DTree:GetShowIcons()
Returns whether or not the Silkicons next to each node of the DTree will be displayed.
Individual icons can be set with DTree_Node:SetIcon or passed as the second argument in DTree:AddNode.
DTree:LayoutTree()
We advise against using this. It may be changed or removed in a future update.
Does nothing.
Moves given node to the top of DTrees children. (Makes it the topmost mode)
Used as a placeholder function alongside DTree:ExpandTo, DTree:SetExpanded and DTree:ChildExpanded.
The DTree acts a root node and methods with the same name in DTree_Node call to the parent.
Returns the root DTree_Node, the node that is the parent to all other nodes of the DTree.
DTree:SetClickOnDragHover( boolean enable )
Enables the "click when drag-hovering" functionality.
If enabled, when hovering over any DTree_Node of this DTree while dragging a panel, the node will be automatically clicked on (and subsequently DTree:OnNodeSelected will be called) to open any attached panels, such as spawnlists in spawnmenu.
See also: PANEL:DragHoverClick.
DTree:SetExpanded( boolean bExpand )
This is used internally - although you're able to use it you probably shouldn't.
Does nothing. Is not called by the DTree itself.
Used as a placeholder empty function alongside DTree:ExpandTo, DTree:MoveChildTo and DTree:ChildExpanded to prevent errors when DTree_Node:SetExpanded is incorrectly used on a DTree.
DTree:SetIndentSize( number size )
Sets the indentation size of the DTree, the distance between each "level" of the tree is offset on the left from the previous level.
Currently this feature has no effect on the DTree element.
DTree:SetLineHeight( number h )
Sets the height of each DTree_Node in the tree.
The default value is 17.
DTree:SetSelectedItem( Panel node )
Set the currently selected top-level node.
DTree:SetShowIcons( boolean show )
Sets whether or not the Silkicons next to each node of the DTree will be displayed.
Individual icons can be set with DTree_Node:SetIcon or passed as the second argument in DTree:AddNode.
Example
Example of using DTree