Old 2nd July 2007, 21:31   #1
abu
mlipod moderator
(Senior Member)
 
abu's Avatar
 
Join Date: Jun 2005
Location: Germany
Posts: 3,457
Handling drag/drop in treeview

I add a new treeview item and several subitems to the ML treeview with ML_IPC_TREEITEM_ADD. Later, I'd like to rearrange the subitems with drag/drop, but I don't know how to do that.
Dragging works fine, and Winamp displays the horizontal "insertion bar" in the TV. But when I drop, I only get a ML_MSG_TREE_ONDROPTARGET. This contains the param of the dragged item, and a POINT. How can I get the target position from that (the tree item after which it was dropped)?

WinAmp Pro 5.5 with ml_iPod 3.10 + dev.patches (download it)
ml_iPod documentation Wiki - ml_iPod FAQ - search ml_iPod forum - iPhone/iTouch - Found a bug?
Donations to support the ml_iPod project can be done HERE
abu is offline   Reply With Quote
Old 2nd July 2007, 23:52   #2
Benski
Ben Allison
Former Winamp Developer
 
Benski's Avatar
 
Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,057
When you get called with ML_MSG_TREE_ONDROP, param3 will be the destination tree ID.
Benski is offline   Reply With Quote
Old 3rd July 2007, 09:38   #3
abu
mlipod moderator
(Senior Member)
 
abu's Avatar
 
Join Date: Jun 2005
Location: Germany
Posts: 3,457
Oh, cool.
That information is missing in the header:
code:
#define ML_MSG_TREE_ONDROP 0x104 // param1 = param of tree item, param2 = POINT * to the mouse position
// if you support dropping, send the appropriate ML_IPC_HANDLEDROP using SendMessage() and return 1, otherwise return -1.


WinAmp Pro 5.5 with ml_iPod 3.10 + dev.patches (download it)
ml_iPod documentation Wiki - ml_iPod FAQ - search ml_iPod forum - iPhone/iTouch - Found a bug?
Donations to support the ml_iPod project can be done HERE
abu is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump