B4J Question Drag&drop

ivanomonti

Expert
Licensed User
Longtime User
I created this agenda of mine where I'm finishing thanks to the whole community and the fantastic B4J but I'm still missing two aspects of Drag & Drop which is partly ok.

Scenario item (buttons) scattered, when I pass over to do the Drag&Drop and can I intercept the properties of the object in question?

as selected object contains some vlori that I have to recover (list) in order to copy the document with the DragDrop in the right folder! (each button has its own id and its archive folders, see image below).


main-lavagna-001.png
 

stevel05

Expert
Licensed User
Longtime User
You would need to make each object a drag target which would then call the DragEntered and DragOver event subs and get the target from the DragEvent Object and just ignore the drop event if it is accidentally dropped in the wrong place.
 
Upvote 0

ivanomonti

Expert
Licensed User
Longtime User
You would need to make each object a drag target which would then call the DragEntered and DragOver event subs and get the target from the DragEvent Object and just ignore the drop event if it is accidentally dropped in the wrong place.


senary:

I drag the document on the Maria button, the Maria button has an id, the same id is the name of the Maria folder where inside there are subfolders (documents, photos, videos).

so you generate a path like

...\123451\foto\
...\123451\video\
...\123451\documenti\

now it all works when I do the dropo with a constant, but in my case for each button I have a variable that is id

When passing the Drag&Drop is it possible to recognize object (button) and take its Tag?
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
The DragEvent GetEventTarget method should return the object the drag is currently over, so: e.GetEventTarget

Assuming they are all buttons
Try
B4X:
Dim Btn As Button = e.GetEventTarget
Log(Btn.Tag)
 
Upvote 0
Top