Drag and drop from scrollview to a panel

danvica

Member
Licensed User
Longtime User
I need to let the user drag and drop some items (pictures) from a scrollview into a panel.

I found different approaches to d&d but all of them manages different kind of views into the same panel.

I tried to study and modify the usefull examples in this thread http://www.b4x.com/forum/basic4andr...9962-example-drag-panel-buttons-edittext.html but the main problem is that when a get the focus in the scrollview all the events raised are relative to that view.

BTW how to convert the relative coordinate of a view to screen (absolute) ones ? This could be usefull.

Thanks.
Daniele
 

danvica

Member
Licensed User
Longtime User
Wow, that was fast.

I implemented your class and it works !

Still a lot to study...

Many thanks.
 
Upvote 0

luke2012

Well-Known Member
Licensed User
Longtime User
Very easy to do with the CheckList class. I changed a few lines in the class to make it possible. Try the attached demo. Your "after drop" code must be inserted where I wrote "AFTER DROP CODE".

Hi @Informatix.
using this class it's possible to move (drag) a item within the list and let the item to be dropped between two other items?

P.S.
I follow your guidelines in order to handle the drop code but I don't known how to handle the panels below the DragAndDrop panel.

More in detail, for example, while moving the DragAndDrop panel, I wish to dinamically highlight (and do also other actions) the panel / panels below the DragAndDrop panel (sv.panel.GetView(x) where x is the index of the panel below the DD panel).

Is it possible?
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…