Garry's Mod Wiki

DTree_Node

Description

This is used internally - although you're able to use it you probably shouldn't.

This panel is created whenever you add a node to a DTree. The root node of a DTree is also a DTree_Node and controls much of its action. it can be accessed with DTree:Root.

View source

Parent

Derives methods, etc not listed on this page from DPanel.

Events

DTree_Node:DoChildrenOrder()
This is used internally - although you're able to use it you probably shouldn't. Called automatically to update the status of DTree_Node:GetLastChild on children of this node.
boolean DTree_Node:DoClick()
Called when the node is clicked. See also DTree_Node:DoRightClick.
boolean DTree_Node:DoRightClick()
Called when the node is right clicked. See also DTree_Node:DoClick.
DTree_Node:OnModified()
Called when sub-nodes of this DTree_Node were changed, such as being rearranged if that functionality is enabled.
DTree_Node:OnNodeAdded( DTree_Node newNode )
Called when a new sub-node is added this node.
DTree_Node:OnNodeSelected( Panel node )
This is used internally - although you're able to use it you probably shouldn't. Called when this or a sub node is selected. Do not use this, it is not for override. Use DTree:OnNodeSelected or DTree_Node:DoClick instead.

Methods

Panel DTree_Node:AddFolder( string name, string folder, string path, boolean showFiles = false, string wildcard = "*", boolean bDontForceExpandable = false )
A helper function that adds a new node and calls to DTree_Node:MakeFolder on it.
Panel DTree_Node:AddNode( string name, string icon = "icon16/folder.png" )
Add a child node to the DTree_Node
DTree_Node:AddPanel( Panel pnl )
This is used internally - although you're able to use it you probably shouldn't. Adds the given panel to the child nodes list, a DListLayout.
DTree_Node:AnimSlide( table anim, number delta, table data )
This is used internally - although you're able to use it you probably shouldn't. Internal function that handles the expand/collapse animations.
DTree_Node:ChildExpanded( boolean expanded )
This is used internally - although you're able to use it you probably shouldn't. Called when a child node is expanded or collapsed to propagate this event to parent nodes to update layout.
DTree_Node:CleanList()
Cleans up the internal table of items (sub-nodes) of this node from invalid panels or sub-nodes that were moved from this node to another. Appears the be completely unused by the game on its own.
Panel DTree_Node:Copy()
Create and returns a copy of this node, including all the sub-nodes.
DTree_Node:CreateChildNodes()
This is used internally - although you're able to use it you probably shouldn't. Creates the container DListLayout for the DTree_Nodes. This is called automatically so you don't have to.
DTree_Node:ExpandRecurse( boolean expand )
Expands or collapses this node, as well as ALL child nodes of this node. Works opposite of DTree_Node:ExpandTo.
DTree_Node:ExpandTo( boolean expand )
Collapses or expands all nodes from the topmost-level node to this one. Works opposite of DTree_Node:ExpandRecurse.
DTree_Node:FilePopulate( boolean bAndChildren, boolean bExpand )
This is used internally - although you're able to use it you probably shouldn't. Called automatically from DTree_Node:PopulateChildrenAndSelf and DTree_Node:PopulateChildren to populate this node with child nodes of files and folders.
DTree_Node:FilePopulateCallback( table files, table folders, string foldername, string path, boolean bAndChildren, string wildcard )
This is used internally - although you're able to use it you probably shouldn't. Called automatically from DTree_Node:FilePopulate to actually fill the node with sub-nodes based on set preferences like should files be added, etc.
Panel DTree_Node:GetChildNode( number num )
Returns n-th child node. Basically an alias of Panel:GetChild.
Returns the number of child nodes this node has. For use with DTree_Node:GetChildNode
table DTree_Node:GetChildNodes()
Returns a table containing all child nodes of this node.
boolean DTree_Node:GetDirty()
We advise against using this. It may be changed or removed in a future update. Returns value set by DTree_Node:SetDirty.
Returns whether the double clock to collapse/expand functionality is enabled on this node.
This is used internally - although you're able to use it you probably shouldn't. Returns what is set by DTree_Node:SetDraggableName.
boolean DTree_Node:GetDrawLines()
This is used internally - although you're able to use it you probably shouldn't. Returns whether or not this node is drawing lines
boolean DTree_Node:GetExpanded()
Returns whether the node is expanded or not.
string DTree_Node:GetFileName()
Returns the filepath of the file attached to this node.
string DTree_Node:GetFolder()
Returns the folder path to search in, set by DTree_Node:MakeFolder.
Returns whether the expand/collapse button is shown on this node regardless of whether or not it has sub-nodes. See also DTree_Node:SetForceShowExpander.
Returns whether the expand button (little + button) should be shown or hidden.
string DTree_Node:GetIcon()
Returns the image path to the icon of this node.
number DTree_Node:GetIndentSize()
Returns the indentation level of the DTree this node belongs to. Alias of DTree:GetIndentSize, see it for more info.
boolean DTree_Node:GetLastChild()
Returns whether this node is the last child on this level or not.
number DTree_Node:GetLineHeight()
The height of a single DTree_Node of the DTree this node belongs to. Alias of DTree:GetLineHeight.
This is used internally - although you're able to use it you probably shouldn't. We advise against using this. It may be changed or removed in a future update. Seems to be unused entirely. Returns whether the node still needs a filesystem search for sub-nodes.
This is used internally - although you're able to use it you probably shouldn't. Returns whether or not the node is set to be populated from the filesystem.
Panel DTree_Node:GetParentNode()
Returns the parent DTree_Node. Note that Panel:GetParent will not be the same!
string DTree_Node:GetPathID()
Returns the path ID (File Search Paths) used in populating the DTree from the filesystem. See DTree_Node:SetPathID and DTree_Node:MakeFolder.
Panel DTree_Node:GetRoot()
Returns the root node, the DTree this node is under. See also DTree_Node:GetParentNode.
boolean DTree_Node:GetShowFiles()
Returns whether or not nodes for files should/will be added when populating the node from filesystem.
string DTree_Node:GetWildCard()
Returns the wildcard set by DTree_Node:MakeFolder.
DTree_Node:Insert( Panel node, Panel nodeNextTo, boolean before )
Inserts a sub-node into this node before or after the given node.
DTree_Node:InsertNode( Panel node )
This is used internally - although you're able to use it you probably shouldn't. Inserts an existing node as a "child" or a sub-node of this node. Used internally by the drag'n'drop functionality.
DTree_Node:InstallDraggable( Panel node )
This is used internally - although you're able to use it you probably shouldn't. Called automatically internally. Makes the target node compatible with this node's drag'n'drop.
DTree_Node:InternalDoClick()
This is used internally - although you're able to use it you probably shouldn't. See DTree_Node:DoClick
DTree_Node:InternalDoRightClick()
This is used internally - although you're able to use it you probably shouldn't. See DTree_Node:DoRightClick.
boolean DTree_Node:IsRootNode()
Returns true if DTree_Node:GetRoot is the same as DTree_Node:GetParentNode of this node.
DTree_Node:LeaveTree( Panel pnl )
Removes given node as a sub-node of this node. It doesn't actually remove or unparent the panel, just removes it from the internal DListView.
DTree_Node:MakeFolder( string folder, string path, boolean showFiles = false, string wildcard = "*", boolean dontForceExpandable = false )
Makes this node a folder in the filesystem. This will make it automatically populated. See also DTree_Node:AddFolder.
DTree_Node:MoveChildTo( Panel node )
Moves given panel to the top of the children of this node. Despite name of this function, it cannot move the children to any position but the topmost.
DTree_Node:MoveToTop()
Moves this node to the top of the level.
DTree_Node:PerformRootNodeLayout()
This is used internally - although you're able to use it you probably shouldn't. Called automatically to perform layout on this node if this node DTree_Node:IsRootNode.
DTree_Node:PopulateChildren()
This is used internally - although you're able to use it you probably shouldn't. Called automatically from DTree_Node:PopulateChildrenAndSelf.
DTree_Node:PopulateChildrenAndSelf( boolean expand )
This is used internally - although you're able to use it you probably shouldn't. Called automatically from DTree_Node:SetExpanded (or when user manually expands the node) to populate the node with sub-nodes from the filesystem if this was enabled via DTree_Node:MakeFolder.
DTree_Node:SetDirty( boolean dirty )
We advise against using this. It may be changed or removed in a future update. Appears to have no effect on the DTree_Node.
DTree_Node:SetDoubleClickToOpen( boolean enable )
Sets whether double clicking the node should expand/collapse it or not.
DTree_Node:SetDraggableName( string name )
This is used internally - although you're able to use it you probably shouldn't. Used to store name for sub elements for a Panel:Droppable call.
DTree_Node:SetDrawLines( boolean draw )
This is used internally - although you're able to use it you probably shouldn't. Sets whether or not this node should draw visual lines.
DTree_Node:SetExpanded( boolean expand, boolean surpressAnimation = false )
Expands or collapses this node.
DTree_Node:SetFileName( string filename )
This is used internally - although you're able to use it you probably shouldn't. Sets the file full filepath to the file attached to this node
DTree_Node:SetFolder( string folder )
This is used internally - although you're able to use it you probably shouldn't. Sets the folder to search files and folders in. Use DTree_Node:MakeFolder instead.
DTree_Node:SetForceShowExpander( boolean forceShow )
Sets whether or not the expand/collapse button (+/- button) should be shown on this node regardless of whether it has sub-elements or not.
DTree_Node:SetHideExpander( boolean hide )
This is used internally - although you're able to use it you probably shouldn't. Sets whether the expand button (little + button) should be shown or hidden.
DTree_Node:SetIcon( string path )
Sets the material for the icon of the DTree_Node.
DTree_Node:SetLastChild( boolean last )
This is used internally - although you're able to use it you probably shouldn't. Called automatically to set whether this node is the last child on this level or not.
DTree_Node:SetNeedsChildSearch( boolean newState )
This is used internally - although you're able to use it you probably shouldn't. We advise against using this. It may be changed or removed in a future update. Seems to be unused entirely. Sets whether the node still needs a filesystem search for sub-nodes.
DTree_Node:SetNeedsPopulating( boolean needs )
This is used internally - although you're able to use it you probably shouldn't. Sets whether or not the node needs populating from the filesystem.
DTree_Node:SetParentNode( Panel parent )
This is used internally - although you're able to use it you probably shouldn't. Sets the parent node of this node. Not the same as Panel:SetParent. This is set automatically, you shouldn't use this.
DTree_Node:SetPathID( string path )
This is used internally - although you're able to use it you probably shouldn't. Sets the path ID (File Search Paths) for populating the tree from the filesystem. Use DTree_Node:MakeFolder instead.
DTree_Node:SetRoot( Panel root )
This is used internally - although you're able to use it you probably shouldn't. Sets the root node (the DTree) of this node. This is set automatically, you shouldn't use this.
DTree_Node:SetSelected( boolean selected )
This is used internally - although you're able to use it you probably shouldn't. Called automatically to update the "selected" status of this node.
DTree_Node:SetShowFiles( boolean showFiles )
This is used internally - although you're able to use it you probably shouldn't. Sets whether or not nodes for files should be added when populating the node from filesystem.
DTree_Node:SetupCopy()
We advise against using this. It may be changed or removed in a future update. Currently does nothing, not implemented.
DTree_Node:SetWildCard( string wildcard )
This is used internally - although you're able to use it you probably shouldn't. Sets the search wildcard. Use DTree_Node:MakeFolder instead
number DTree_Node:ShowIcons()
Returns whether or not the DTree this node is in has icons enabled. See DTree:ShowIcons for more info.