bright-gpu-74537
10/17/2020, 8:26 PMbright-gpu-74537
10/17/2020, 8:27 PMable-action-74275
10/17/2020, 8:27 PMbright-gpu-74537
10/17/2020, 8:28 PMable-action-74275
10/17/2020, 8:28 PMbright-gpu-74537
10/17/2020, 8:28 PMhaxe
public function addNode(text:String, icon:String = null, isExpandable:Bool = false, expanded:Bool = false):TreeViewNode {
_hbox.styleString = "spacing: 0";
var node = new TreeViewNode(_tree);
node.expandable = isExpandable;
if (expanded == true) {
node.expand();
}
node.parentNode = this;
node.marginLeft = 16;
node.text = text;
node.icon = icon;
var nodes:Array<TreeViewNode> = findComponents(TreeViewNode);
nodes.push(node);
nodes.sort(function(node1:TreeViewNode, node2:TreeViewNode) {
if (node1.expandable == true && node2.expandable == false) {
return -1;
} else if (node1.expandable == false && node2.expandable == true) {
return 1;
}
return Reflect.compare(node1.text, node2.text);
});
var index = nodes.indexOf(node);
addComponentAt(node, index + 1);
updateUI();
return node;
}bright-gpu-74537
10/17/2020, 8:28 PMbright-gpu-74537
10/17/2020, 8:28 PMbright-gpu-74537
10/17/2020, 8:29 PMable-action-74275
10/17/2020, 8:30 PMbright-gpu-74537
10/17/2020, 8:30 PMbright-gpu-74537
10/17/2020, 8:31 PMable-action-74275
10/17/2020, 8:33 PMbright-gpu-74537
10/17/2020, 8:33 PMbright-gpu-74537
10/17/2020, 8:33 PMbright-gpu-74537
10/17/2020, 8:35 PMbright-gpu-74537
10/17/2020, 8:35 PMable-action-74275
10/17/2020, 8:35 PMable-action-74275
10/17/2020, 8:36 PMable-action-74275
10/17/2020, 8:36 PMbright-gpu-74537
10/17/2020, 8:36 PMable-action-74275
10/17/2020, 8:37 PMable-action-74275
10/17/2020, 8:37 PMbright-gpu-74537
10/17/2020, 8:37 PMable-action-74275
10/17/2020, 8:38 PMable-action-74275
10/17/2020, 8:38 PMable-action-74275
10/17/2020, 8:38 PMbright-gpu-74537
10/17/2020, 8:38 PMbright-gpu-74537
10/17/2020, 8:39 PMbright-gpu-74537
10/17/2020, 8:39 PM