This Question is Assumed Answered

1 "correct" answer available (5 pts) 14 "helpful" answers available (3 pts)
3 Replies Last post: Jul 24, 2008 6:28 PM by carl

TreeControl's selection

Jul 24, 2008 12:33 AM

Click to view Poseidon.UD's profile Level 2 Poseidon.UD 37 posts since
Jul 3, 2008

what is TreeControl's selection 's sort.

for example ,my tree 's nodes are a,b,c,d,e,f,g

selected order is 'e','g','f','a' (ctrl+mouse)

in the section nodes ,the order isn't 'e','g','f','a'. if i want the order is 'e','g','f','a',what can i do?

Click to view carl's profile Curl carl 74 posts since
Oct 17, 2007
1. Re: TreeControl's selection Jul 24, 2008 1:36 AM
TreeControl does produce SelectionChanged events.

You could potentially subclass TreeControl, or just add an event handler, and keep an array of TreeNodes, updating it each time from the changes in TreeControl.selection (pull missing nodes from the array, add new selections at the end).
Click to view Poseidon.UD's profile Level 2 Poseidon.UD 37 posts since
Jul 3, 2008
2. Re: TreeControl's selection Jul 24, 2008 5:32 PM
in response to: carl

now ,this problem is solved.

in ui, on-pointer-press method is changed,add my {array-of TreeNode},manage it .

thank u.

Click to view carl's profile Curl carl 74 posts since
Oct 17, 2007
3. Re: TreeControl's selection Jul 24, 2008 6:28 PM
in response to: Poseidon.UD
You might want to use
{on SelectionChanged at tc:TreeControl ...}
instead, as it's also possible to modify the selection using the keyboard.