1. Help on treeview handling requested
- Posted by Thomas K. <thomas.kunstmann at gmx.net> Nov 18, 2006
- 534 views
Say, I have a list of children in a Treeview and I want to move one of them 1 position upward/downward. How can I do it? Do I have to delete that child first to insert it at his new position, or is there some way of manipulating the TV_ITEM STRUCT? And how about moving a parent containing several children up/down? Help is very much appreciated! Thank you. PS: I studied already all TV examples in archive. I found nothing (workin).
2. Re: Help on treeview handling requested
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Nov 19, 2006
- 512 views
On Sat, 18 Nov 2006 14:59:06 -0800, "Thomas K." <guest at RapidEuphoria.com> wrote: >Say, I have a list of children in a Treeview and I want to move one of them 1 >position upward/downward. How can I do it? Do you want to drag items with the mouse or under program control? To be honest, I'm not completely sure Windows will let you drag things about within the same parent (in explorer you get a no entry icon). >Do I have to delete that child first to insert it at his new position, or is >there some way of manipulating the TV_ITEM STRUCT? >And how about moving a parent containing several children up/down? Help is very >much appreciated! Thank you. Delete and re-insert is one way to do it, but I think you'd have to recursively do that with all child records. Another possibility is to use TV_SORTCB, not that I've tried that either. > >PS: I studied already all TV examples in archive. I found nothing (workin). Did you stumble across my -- demo_treeviews.exw -- fast(ish) treeviews in arwen. If not, I'll post it on my website. For every item in the treeview, it keeps (in Eu) a {handle,text,loaded,parent_idx} entry, and my thought is it may be reasonably easy to stick a 5th field onto that for display order purposes (I am currently using lParam as index into that table). As it happens, the program is due a revamp over icon handling, I may have a look at drag & drop while I'm there. I have found the quite detailed instructions for this in win32.chm. (It may be worth waiting for a week or two till I've finished that.) Regards, Pete
3. Re: Help on treeview handling requested
- Posted by Thomas K. <thomas.kunstmann at gmx.net> Nov 19, 2006
- 522 views
- Last edited Nov 20, 2006
Thank u Pete for your response. I was already bit disappointed as nobody seemed to pick up on my question, even tho I think it's an essential one. How nice to have things well organized in a TV and you can move parents and children easily around as you like. But not in Eu (or win32lib). Even sorting the tree isn't available! I want to drag and drop - it works - and I want to move items up and down too using a button. As I'm not too acquainted with windows programming (more: I'm a very ignorant programmer!), I was interested into the general methodology of the programming of TVs; the answer, that I have to delete the children and insert (or add) them again doesn't please me very much. No, I don't know demo_treeviews.exw; if you would be so kind to send me your hompage URL I would like to visit you and have a look at the code - pure curiosity. But on the other hand I can easily wait 2 more weeks for a nice solution. The problem of a nice TV is chasing me for a long time and I don't understand how little Euphoria programmers were sofar interested into this. Well, thanks again for your response, and best regards, Thomas