Re: treeview drag ad drop

new topic     » goto parent     » topic index » view thread      » older message » newer message

©koda wrote

>how does drag and drop function
>work in treeview?
>In sample it doesn't work.

I know that you're not switching to win32lib, but the drag and drop does
work for me (and for others, as far as I know).  What it doesn't do is
change the mouse cursor when this happens (also, the demo only allows you to
drag from a listview).  To give you a brief description of how I do it:

An LVN_BEGINDRAG notification is sent to the parent window through a
WM_NOTIFY message.  I use this to store the selection in sequence dragData,
in this format:

dragData = { id, { selection1, selection2, ... } }

Then, in SubProc, when the left mouse button is released (WM_LBUTTONUP), I
check to see if there is data that's been stored.  If so, I call the
onDragAndDrop proc for the control and clear dragData.  If there is no proc
for that control, I simply clear dragData.

To do the same, allowing a treeview to be the source, you'd need to check
for TVN_BEGINDRAG notifications, and do the same thing.

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu