User Tools

Site Tools


dropid_return_drag_and_drop_string_.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== DROPID (return drag-and-drop string) ====== Previous pageReturn to chapter overviewNext page

NewC7.jpg

DROPID( [thread] [, control] )

blk2blue.jpg

DROPID Returns matching host and target signatures on a successful drag-and-drop operation.
thread The label of a numeric variable to receive the thread number of the target control. If the target control is in an external program, thread receives zero (0).
control The label of a numeric variable to receive the field equate label of the target control.

The DROPID procedure returns the matching host and target control signatures on a successful drag-and-drop operation (just as DRAGID does), or the specific string set by the SETDROPID procedure.

Return Data Type: STRING

Example:

DragDrop    PROCEDURE

Que1 QUEUE

     STRING(90)

    END

Que2 QUEUE

     STRING(90)

    END

WinOne WINDOW('Drag & Drop'),AT(10,10,240,320),SYSTEM,MDI

       !Drag but no drop:

       LIST,AT(12,0,200,80),USE(?List1),FROM(Que1),DRAGID('List1')

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

       LIST,AT(12,120,200,80),USE(?List2),FROM(Que2),DROPID('List1','~FILE')

      END

CODE

OPEN(WinOne)

ACCEPT

 CASE EVENT()

 OF EVENT:Drag                  !When a drag event is attempted

  IF DRAGID()                   !check for success

   GET(Que1,CHOICE())

   SETDROPID(Que1)              !and setup info to pass

  END

 OF EVENT:Drop                  !When drop event is successful

  IF INSTRING(',',DROPID(),1,1) !Check for multiple files from File Manager

   Que2 = |                     !and only get first

   SUB(DROPID(),1,INSTRING(',',DROPID(),1,1)-1)

   ADD(Que2)                    !and add it to the queue

  ELSE

   Que2 = DROPID()              !get dropped info, from List1 or File Manager

   ADD(Que2)                    !and add it to the queue

  END

 END

END

See Also:

DRAGID

SETDROPID

dropid_return_drag_and_drop_string_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)