Please enable JavaScript to view this site.

ESL Documentation

Action Statement

Initiate a drag operation.

drag DATA_STR type TYPE_STR using [icon] ICON_FILE

DATA_STR

A string value containing application-defined data. This string is accessible in an on drop response via the built-in function dragdata.

TYPE_STR

A string value identifying the type of data being dragged. This string is passed to all target and potential target objects, via the built-in function dragtype.

Multiple data types are supported by separating the types with a "\n" character.

There two special data types;

"CF_TEXT"

Represents the standard windows text format. It allows ESL text to be dropped into any windows application that understands the text format. Text from other Windows Applications may be dropped into ESL controls which can accept textual data.

"CF_HDROP"

Represents a collection of file names, as used by Windows Explorer to drag highlighted files. Within ESL the collection is defined as a string containing full file names separated by the "\n" character. Use this data type to exchange data with Windows applications that operate with collections of files.

See the dragtype topic for more information on these special data types.

ICON_FILE

The name of a file containing an icon or pointer that will be displayed as the mouse cursor during the drag operation. This file must be in the native format for the operating system you are using. The icon file is read in at runtime.

Description

A source object uses the drag statement in an on drag response to initiate a drag operation. It cannot be used in any other response.

The value TYPE_STR is available to target and potential target objects via the dragtype built-in function, and should be used to determine the type of the data being dragged. This string has a maximum length of 255 bytes.

DATA_STR is used to pass application-specific data to the target object. This string can be as long as any ESL string, but for performance reasons, we recommend that you keep it shorter than 4K. For passing larger data values, use an external file or database to store the data, and pass the filename or record key.

Potential target objects must respond to the on dragover and on drop window events, and should also respond to the on drophelp window event.

Example

 

response to Text_EF

    on drag

        drag text of object type "SomeType\nAnotherType\nCF_TEXT"

        using icon "drag.ico"

....

response to Some_EF

    on dragover

         if (dragtype = "SomeType") then

            allow drop 

        end if

....

response to Another_EF

    on dragover

         if (dragtype = "AnotherType") then

            allow drop 

        end if 

See Also

allow drop Action Statement

dragdata Response Inquiry Built-in Function

dragtype Response Inquiry Built-in Function

response to OBJECT Response Definition on clauses