Response Inquiry Built-in Function
Return the type of the data being dragged.
dragtype
Description
Use the dragtype function only within a response to OBJECT on dragover, on drop, or on drophelp response definition. It returns the TYPE_STR string specified in the drag action that began the drag operation. If you use it anywhere else, dragtype will return a null string.
The ESL application can exchange textual data with other Windows applications by using the "CF_TEXT" dragtype.
The dragtype "CF_HDROP" is used to represent the standard Windows file names collection. This dragtype is used by applications, such Windows Explorer, to drag collections of highlighted files. The dragdata for this format consists of full file names separated by "\n" character. This format can be used to exchange collections of files with other Windows applications, which recognize the "CF_HDROP" data type.
When using drag and drop with Windows Applications written in a different language; The "CF_TEXT" and "CF_HDROP" dragtypes correspond to CF_TEXT and CF_HDROP Win32 clipboard formats. For all other dragtypes, ESL calls Win32 API function RegisterClipboardFormat with the argument of the 'type' statement. ESL only supports HGLOBAL media. Content of HGLOBAL matches the argument of the drag statement (string) for all types except for the "CF_HDROP".
The "on dragover" response is called once for each datatype available. The "on drop" response will be called for the most recent "allow drop" call.
Example
response to Text_EF
on dragover
if (dragtype = "CF_TEXT") then
allow drop
end if
on drop
change object text to dragdata
.....
response to ListBox_LB
on dragover
if (dragtype = "CF_HDROP") then
allow drop
end if
on drop
add to object insert dragdata
response to SomeRegion_RG
on drag
drag "c:\\myfile.txt\nc:\\another.txt" type "CF_HDROP" using icon "files.ico"
See Also
allow drop Action Statement
drag Action Statement
dragdata Response Inquiry Built-in Function
response to OBJECT Response Definition on clauses