dragData | |||||||
Type | property | ||||||
Dictionary | LCS | ||||||
Library | LiveCode Script | ||||||
Syntax |
| ||||||
Summary | Specifies what data is being dragged during a drag and drop. | ||||||
Introduced | 2.0 | ||||||
OS | mac, windows, linux | ||||||
Platforms | desktop, server | ||||||
Example |
| ||||||
Values |
| ||||||
Related | Keyword: element Property: clipboardData, RTFText, unicodeText, HTMLText Message: dragDrop, dragEnter, dragMove, mouseDown, dragLeave, dragStart Function: arrayDecode, arrayEncode, textDecode, textEncode Glossary: property, handler, array, list field, element, message | ||||||
Description | Use the dragData property to find out what is being dragged or to change the data being dragged during the drag. If LiveCode is acting as the target of a drag-drop operation (i.e. during the context of a dragEnter, dragMove, dragDrop or dragLeave message), the dataData property can be queried for the data the source application is offering. Setting a type of data during a mouseDown or dragStart handler will cause a drop-drop operation to commence when the handler finishes. Only one type of data can be set at once, although LiveCode will automatically convert between all the text formats. You can query the keys of the dragData to find out what data types are available. Which elements are present in the dragData array depends on what type of data is being dragged. It is possible for more than one element in the dragData array to be populated. Different drop destinations can each use the data type they need. (For example, a list field's dragDrop handler might use the dragData["text"] to ignore the styles, while an ordinary field's dragDrop handler might use the dragData["HTML"] to retain the styles. LiveCode will automatically synthesize the three text properties text, html and rtf if any text data is present. For example setting the dragData["text"] will result in the dragData["html"] being set appropriately. If you don't specify a dataType, the dragData property reports or sets the dragData["text"].
| ||||||
Tags | ui |