<doc>
	<legacy_id>2382</legacy_id>
	<name>dragData</name>
	<type>property</type>

	<syntax>
		<example>set the dragData to <i>textToDrag</i></example>
		<example>set the dragData[<i>dataType</i>] to <i>dataToDrag</i></example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Specifies what data is being dragged during a drag and drop.</summary>

	<examples>
<example>set the dragData["html"] to the htmlText of field 1</example>
<example>get URL the dragData["text"]</example>
	</examples>

	<history>
		<introduced version="2.0">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		<changed version="2.9">2.9</changed>
<changed version="7.0">7.0</changed>
		<experimental version=""></experimental>
		<nonexperimental version=""></nonexperimental>
	</history>

	<objects>
		<global/>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
	</platforms>

	<classes>
		<desktop/>
		<server/>
	</classes>

	<security>
	</security>


	<classification>
		<category>User Interaction</category>
	</classification>

	<references>
		<property tag="unicodeText">unicodeText Property</property>
		<property tag="RTFText">RTFText Property</property>
		<property tag="clipboardData">clipboardData Property</property>
		<property tag="HTMLText">HTMLText Property</property>
		<message tag="dragDrop">dragDrop Message</message>
		<message tag="dragStart">dragStart Message</message>
	</references>

	<description>Use the <b>dragData</b> <glossary tag="property">property</glossary> to find out what is being dragged or to change the data being dragged during the drag.<p></p><p><b>Value:</b></p><p>The <b>dragData</b> is an <glossary tag="array">array</glossary> with one or more of the following <glossary tag="element">elements</glossary>:</p><p></p><p>        - text          The text being dragged (from 7.0, it includes as well the Unicode characters)</p><p>        - html         The styled text being dragged, in the same format as the <b>htmlText</b></p><p>        - rtf              The styled text being dragged, in the same format as the <b>RTFText</b></p><p>        - Unicode    The text being dragged, in the same format as the <b>unicodeText</b></p><p>        - image        The data of an image in PNG, JPEG or GIF format</p><p>        - files           The name and location of the file or files being dragged, one per line</p><p>        - styles         Styled text in LiveCode internal styled text format</p><p>        - private       An arbitrary application-defined string. This format will only be visible within the same LiveCode process</p><p>       (i.e. when the current application is acting as source and target for the current drag-drop operation)</p><p></p><p><b>Comments:</b></p><p>If LiveCode is acting as the target of a drag-drop operation (i.e. during the context of a <message tag="dragEnter">dragEnter</message>, <message tag="dragMove">dragMove</message>, <message tag="dragDrop">dragDrop</message> or <message tag="dragLeave">dragLeave message</message>), the <b>dataData</b> property can be queried for the data the source application is offering.</p><p></p><p>Setting a type of data during a <message tag="mouseDown">mouseDown</message> or <message tag="dragStart">dragStart</message> 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.</p><p></p><p>You can query <b>the keys of the dragData</b> to find out what data types are available.</p><p></p><p>Which elements are present in the <b>dragData</b> <glossary tag="array">array</glossary> depends on what type of data is being dragged. It is possible for more than one <keyword tag="element">element</keyword> in the <b>dragData</b> <glossary tag="array">array</glossary> to be populated. Different drop destinations can each use the data type they need. (For example, a <glossary tag="list field">list field's</glossary> <message tag="dragDrop">dragDrop</message> <glossary tag="handler">handler</glossary> might use the dragData["text"] to ignore the styles, while an ordinary field's <message tag="dragDrop">dragDrop</message> <glossary tag="handler">handler</glossary> might use the dragData["HTML"] to retain the styles.</p><p></p><p>LiveCode will automatically synthesize the three text properties <i>text</i>, <i>html</i> and <i>rtf</i> if any text data is present. For example setting the dragData["text"] will result in the dragData["html"] being set appropriately.</p><p></p><p>If you don't specify a <i>dataType</i>, the <b>dragData</b> <glossary tag="property">property</glossary> reports or sets the dragData["text"].</p><p></p><p></p><note>It is necessary to use double quotes around the keys of the <b>dragData</b> array because some of the key names (such as "files") are LiveCode reserved words. Quoting array indexes (other than integers) is a good practice anyway, but in the case of this property, it's necessary to avoid script errors.</note><p></p><p></p><note> From 7.0, the string in <b>dragData</b>["text"] can also contain the Unicode characters</note></description>
</doc>