QD_SetDropHandler

QD_SetDropHandler(areaRef; dropHandler):error
areaRef Longint Area reference
dropHandler Text Drop handler method
error Longint Error result

Specify the drop handler method for a QDrop area

Parameter areaRef is the reference to the plug-in area.

Parameter dropHandler is the name of the handler method.

Structure of the Drop Handler Method

A drop handler method must comply with the following calling interface:

DropHandlerMethod (dropArea(L))
$1 – dropAreaLongintArea reference

In your drop handler you can get information about the dropped items by calling QD_CountDroppedFiles and QD_GetDroppedFile.

Example

   // Set the handler method to X_DROP_HANDLER

C_LONGINT($error)

$error:=QD_SetDropHandler (xDrop;"X_DROP_HANDLER")
   // Drop handler method X_DROP_HANDLER

C_LONGINT($1;$area)

$area:=$1

C_LONGINT($error;$numFiles;$ii)
C_TEXT($filePath)

$error:=QD_CountDroppedFiles ($area;$numFiles)
For ($ii;1;$numFiles)
   
   $error:=QD_GetDroppedFile ($area;$ii;$filePath)
   If ($error=0)
      ALERT($filePath)
   Else 
      ALERT("Error "+String($error))
   End if 
   
End for 

Related commands

QD_GetDropHandler Get the drop handler method name of a QDrop area