Error getting tags :
error 404Error getting tags :
error 404 dragDrop | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
dragDrop
Basics
Expander triangle
Type
Message
Syntax
dragDrop
Introduced
2.0
Environment
Desktop,Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Sent to the object where data was dropped when a drag and drop finishes.
Examples

on dragDrop -- check whether a file is being dropped
if the dragData["files"] is empty then beep 2
pass dragDrop
end dragDrop

Additional Comments
Expander triangle

Handle the dragDrop message to perform an action when the user drops data, or trap the message to prevent text from being dropped.

Comments:

The dragDrop message is sent to the control where data is being dragged.

Important! If the acceptDropproperty is set to false at the time the drop occurs, no dragDropmessage is sent.

Revolution automatically handles the mechanics of dragging and dropping text between and within unlocked fields. To support this type of drag and drop operation, you don't need to do any scripting: the text is dropped into the field automatically when Revolution receives the dragDrop message.

To prevent an unlocked field from accepting a drag and drop, trap the dragDrop message. If you don't want to allow a particular field to accept text drops, place a dragDrop handler in the field that does not contain a pass control structure:

on dragDrop -- in script of field or one of its owners

-- do nothing, but trap the message

end dragDrop

On the other hand, if you want to perform some action when text is dropped into an unlocked field, you need to pass the dragDrop message once you're done with it in order to allow the drop to take place:

on dragDrop

set the cursor to 9023

pass dragDrop -- needed for drop to occur

end dragDrop

To accept drops to a locked field or a control other than a field, handle the dragDrop message, using the dragData property to determine what data is being dragged. For these objects, your dragDrop handler must get the dragged data and put it into the object (or perform whatever action you want to do on a drop); the behavior is not automated as it is for unlocked fields.

User Comments
Expander triangle