Page 1 of 1

Global Drag and Drop

Posted: Sun May 12, 2019 6:59 pm
by pongasoft
I would like to implement a global drag/drop feature so that if a user drags and drop a file ANYWHERE in the UI, then I get a callback. How would I go about implementing such a thing?

I tried to implement my own custom view which implement the onDrag/Drop functions and overlay it in the front, make it transparent, but then no mouse events go to any view below... If I put it below everything then mouse events go to each individual views, but drag/drop is blocked on those views...

Thanks
Yan

Re: Global Drag and Drop

Posted: Mon May 13, 2019 8:03 am
by Arne Scheffler
Hi,
I've redesigned the drag and drop implementation in VSTGUI 4.7. If you use this or a newer version, you can simply set the drop target of your frame instance to a custom IDropTarget object. See lib/dragging.h for more information. For older versions this is not easy and may not be possible without altering the sources of the library.

Cheers,
Arne

Re: Global Drag and Drop

Posted: Mon May 13, 2019 12:57 pm
by pongasoft
I am using VST SDK 3.6.9 so I believe it comes with an earlier version of VSTGUI :(. I guess I won't be able to do it then

Thanks
Yan