Silverfrost Logo About Us | Contact Us

Drag and drop - %dr

%dr takes a call-back function that is called when a file is dropped on to a window. If a collection of files is dropped, the call-back is called for each file in turn. This can be achieved, for example, by the following actions:

Open the File Manager or Explorer and select one or more files.

Drag the files to the format window containing %dr.

Use clearwin_string@('DROPPED_FILE') in the call-back associated with %dr.

For example, a text editor could use this feature by opening the droppped file for editing.

The following code illustrates how %dr works:

       INTEGER i,winio@
       EXTERNAL drop_func
       i=winio@('%ca[Drag and drop]%bg[grey]&')
       i=winio@('Drop files here....&')       
c --------------------------------------------------
       INTEGER FUNCTION drop_func()
       INCLUDE <clearwin.ins>
       CHARACTER*129 filename
       INTEGER i
       i=winio@('%ca[Dropped file]%bg[grey]&')
       i=winio@('%2nl%cn%tt[Next file]')       



Copyright © 1999-2018 Silverfrost Limited