View Single Post
Old 22 August 2014, 16:11   #1
AGS
XoXo/Tasko Developer
 
AGS's Avatar
 
Join Date: Dec 2013
Location: Munich
Age: 48
Posts: 450
Question Drag & Drop Implementation howto

Hi,

I would like to implement drag & drop accross different windows into my filemanager(s) (each is a window) and am unsure how this might work.

The "drag" part however already works. Unsureness concerns the "drop" part. As the drag & drop is handled by the window class, which is responbsible for reading mouse pos and drawing the dragged item(s), the "drop" part would work basically like this:

- window class checks mousbutton release
- window class uses WhichLayer() and looks it up in the list of window instances to find the window of the filemanager over which the content is dropped
- window class gets the pointer to the window object from wd_Userdata and traverses the list of all other objects that are attached to that window to find out which object in detail is under the mouse. for this any object that is a valid dropzone has a special bit set, just for the case that two or more objects are nested (like a frame object and a button in it) so that we know which one of those is a valid receiver of the "drop"

Now the question is, what message should be sent to that object? Basically that object and its window may belong to any app that runs under this GUI engine. However the destination object must know that the drop comes from a filemanager object and its address.

Any ideas you wish to share?

A
AGS is offline  
 
Page generated in 0.07687 seconds with 11 queries