DROPID (set drag-and-drop target signatures)

Top  Previous  Next

 

DROPID( signature [, signature] )

DROPID

Specifies a control that can serve as a drag-and-drop target.

signature

A string constant containing an identifier used to indicate valid drag hosts. A single DROPID may contain up to 16 signatures. Any signature that begins with a tilde (~) indicates that the information can also be dropped from an external (Clarion) program. A DROPID signature of '~FILE' indicates the target accepts a comma-delimited list of filenames dragged from the Windows File Manager.

The DROPID attribute (PROP:DROPID, an array) specifies a control that can serve as a drag-and-drop target. DROPID works in conjunction with the DRAGID attribute. The DROPID signature strings (up to 16) define validation keys to match against the signature parameters of the host control's DRAGID. This provides control over where successful drag-and-drop operations are allowed.

A drag-and-drop operation occurs when the user drags information from a control with the DRAGID attribute to a control with the DROPID attribute. For a successful drag-and-drop operation, both controls must have at least one identical signature string in their respective DRAGID and DROPID attributes.

Example:

WinOne WINDOW,AT(0,0,160,400)

       !Allows drags, but not drops:

       LIST,AT(120,0,20,20),USE(?List1),FROM(Que1),DRAGID('FromList1')

       !Allows drops from List1 or the Windows File Manager, but no drags:

       LIST,AT(120,120,20,20),USE(?List2),FROM(Que2),DROPID('FromList1','~FILE')

      END

 

CODE

OPEN(WinOne)

!Drag and Drop Ids can also be assigned at runtime

?List2{PROP:DropID,1) = 'FromList1'

?List1{PROP:DragID,1) = 'FromList1'

!***********************************************

ACCEPT

 CASE EVENT()

 OF EVENT:Drag        !When a drag event is attempted

  IF DRAGID()         !check for success

   SETDROPID(Que1)    !and setup info to pass

  END

 OF EVENT:Drop        !When drop event is successful

  Que2 = DROPID()     !get dropped info

  ADD(Que2)           !and add it to the queue

 END

END

 

See Also:

DRAGID