Drag and Drop Question

Trevor DeVore lists at mangomultimedia.com
Tue Oct 26 16:01:06 EDT 2004


On Oct 26, 2004, at 10:04 AM, Trevor DeVore wrote:
> I want to create a drag and drop behavior between two objects in a Rev 
> app.  When the user clicks on one object I want some visual feedback 
> that they have started a drag and drop operation.  In this case I 
> would like to have a floating palette that follows the mouse around 
> until the user drops.  I would also like to use the built in drag and 
> drop behavior which allows you to set the dragData on mouseDown so 
> that objects receive the dragEnter/dragLeave/dragDrop messages.  These 
> messages allow me to hilite objects that will accept the drop.
>
> So the problem I'm encountering is as follows.  It seems that once a 
> drag and drop operation begins messages are no longer sent (except 
> dragEnter/dragLeave/etc.) in the app until the operation is complete.  
> This makes it rather difficult to script a palette that follows the 
> mouse around.  I did a simple test to confirm this.  I made a stack 
> with a handler which puts new text into a field every 1/2 second.  
> When I start a drag and drop operation the field text is not updated 
> until the drag drop operation has completed.  Is this just the way 
> drag and drop is or am I missing something here?

OK, so I've been playing with dragMove and it doesn't seem to be 
behaving as documented.  The docs state:

"The dragMove message is sent to the control the mouse pointer is over, 
or to the card if no control is under the mouse pointer."

In my tests the dragMove message is only sent if the mouse is over a 
control.  Anyone else see this?

dragEnd also seems to be behaving contrary to the docs.  The docs say:

"The dragEnd message is sent to the control that the drag started from. 
If the data is not dropped onto a control that accepts it, the dragEnd 
message is still sent."

I do not get the dragEnd message sent to the control that started the 
drag unless I drop onto a control with a dragDrop message.  Putting a 
dragDrop handler in the card works if you end the drop on a control but 
if you drop on a card then no message is received.  I guess I can just 
put a graphic that covers the entire card to solve that issue.  So are 
the docs incorrect, or are there bugs in the drag and drop behavior or 
is it just me having a rough day?


-- 
Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com



More information about the use-livecode mailing list