Message 1 of 2
TreeView ActiveX Control to hide/unhide nodes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need some help in using the TreeView ActiveX Controls to find children of parent nodes. I used the help doc that ships with max "How to develop a Scene Browser using TreeView ActiveX Control" for the basis of my script. The script uses treeView to check on/off the .isHidden state of parent nodes and hopefully the children and sub children.
Right now it works for parent nodes fine, but I need help having it automatically check on/off the entire heirarchy from the parent down. Can anyone help in the code to cycle through the entire parent.child path in treeView?
Section of code that I need help in:
on tv NodeCheck theNode do
(
theSceneNode = (getNodeByName theNode.text)
if theSceneNode != undefined do
(
theSceneNode.isHidden = not theNode.checked
for c=1 to theNode.children do
(
theNode.child.firstSibling.checked=theNode.checked
theNode.child.lastSibling.checked=theNode.checked
theNode.child.next.checked=theNode.checked -- Note This works for a forced method.
--Append a "next." before theNode.child checked will check the next child node.
--I need this to cycle through the children and grand-children regardless of the count.
-- evaluate ("theNode.child.next.checked=theNode.checked") doesn't seem to work
-- where I can append the "next." to the string and then evaluate.
)
)
Any help would be greatly appreciated.
CT
Right now it works for parent nodes fine, but I need help having it automatically check on/off the entire heirarchy from the parent down. Can anyone help in the code to cycle through the entire parent.child path in treeView?
Section of code that I need help in:
on tv NodeCheck theNode do
(
theSceneNode = (getNodeByName theNode.text)
if theSceneNode != undefined do
(
theSceneNode.isHidden = not theNode.checked
for c=1 to theNode.children do
(
theNode.child.firstSibling.checked=theNode.checked
theNode.child.lastSibling.checked=theNode.checked
theNode.child.next.checked=theNode.checked -- Note This works for a forced method.
--Append a "next." before theNode.child checked will check the next child node.
--I need this to cycle through the children and grand-children regardless of the count.
-- evaluate ("theNode.child.next.checked=theNode.checked") doesn't seem to work
-- where I can append the "next." to the string and then evaluate.
)
)
Any help would be greatly appreciated.
CT