Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hello!
Does anyone have a working example of expanding and collapsing a ProUITreeNode on doubleclick?
I work with WF3.0-M180.
Is it right, that I have to read the selected names or is there a better way?
The attached function works fine, but is that the correct way?
Thanks,
Lars
{
...
err = ProUITreeActivateActionSet(DlgName, trTREE, OnActivate_trTree, NULL);
...
}
void OnActivate_trTree(char *Dialog, char *Control, ProAppData Daten)
{
ProErrorerr;
intnNodes;
char**Nodes = NULL;
ProBooleanIsExpanded;
err = ProUITreeSelectednamesGet(Dialog, Control, &nNodes, &Nodes);
for (int i = 0; i < nNodes; i++)
{
ProUITreeNodeIsExpanded(Dialog, Control, Nodes[i], &IsExpanded);
if (IsExpanded == PRO_B_TRUE)
ProUITreeNodeCollapse(Dialog, Control, Nodes[i]);
else
ProUITreeNodeExpand(Dialog, Control, Nodes[i], PRO_B_FALSE);
}
err = ProStringarrayFree(Nodes, nNodes);
}