For each ESL object that is a target object, write an on dragover and an on drop response. You should also have an on drophelp response if you want to provide context-sensitive help.
The on dragover response must use the built-in function dragtype to check for dragtype(s) that the target can accept, and call allow drop if the type is acceptable. If the allow drop action statement is not executed, ESL automatically changes the mouse cursor to indicate to the user that a drag is not allowed. Also, an on drop response will never be triggered for the target object if it does not call allow drop.
The on dragover response should be as short as possible, because it can be triggered frequently. You should not perform a database query during an on dragover response, for instance.
response to PrinterIcon_IR
on dragover
if (dragtype = "Customer") then
# the PrinterIcon_IR knows how to
# handle Customer application objects
allow drop end if
The on dragover response can also use the built-in functions xcoord and ycoord to determine the location of the mouse pointer. The allow drop action statement only applies to the ESL object for which the response is being taken. If the user moves the mouse cursor over another ESL object, then the on dragover response for that ESL object determines whether a drop is allowed for that object.