Skip to main content

Drag and Drop in AnzioWin

Introduction

Many of today's Windows applications support some form of drag and drop, whereby you can drag a file name to the application from Windows Explorer or a third party application, and drop it onto another. AnzioWin version 15 is no exception.

There are some hidden peculiarities to rlogin that users should be aware of. We will discuss these briefly and then discuss how AnzioWin fits in the picture.

AnzioWin as a drag-drop target

AnzioWin can now accept files that are dragged and dropped onto it, such as from a Windows Explorer window. What does it do with these? That is up to you.

We introduce a concept of an "event", which we hope to expand in the future. You can create a macro (by the usual means), and associate that macro with certain defined events. When the event occurs, if there is a macro associated with it, that macro will be CALLed (at the end of the macro, any running macro will resume).

Dropping a filename onto the AnzioWIn window constitutes an ONDROP event. AnzioWin will save the path name of the file dropped, and the mouse's X and Y coordinates, in variables for later use. Then it will execute the ondrop macro.

Step-by-step

  1. Specify a macro to run on an "ondrop" event, using the command

        EVENT ONDROP

    where is, for instance, "D" (without the quotes).
  2. When a drop occurs, Anzio stores the X and Y coordinates of the drop (in cells, based on 1) and the full path name of the file that was dropped. Then if an ONDROP macro is in play, it is called.
  3. The macro can do any of Anzio's 300+ commands, including sending text to the host.
  4. The macro can fetch the name of the dropped file by using

         $~{ANZ_DROP_NAME}

  5. Similarly:

         $~{ANZ_DROP_X}

         $~{ANZ_DROP_Y}

  6. You can also add a command BASENAME that will get the base name (excluding the directory) of a filename. This command can be embedded in another command, e.g., the macro that is running from ONDROP.

    Therefore, your D macro could send any arbitrary text, send the X and Y coordinates of the drop, sent the full path name of the drop, send the base name of the file, or any combination.

Copyright © 2024 Rasmussen Software, Inc. Legal Information & Privacy Policy
Send comments and suggestions to rsi@anzio.com