home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 20 / AACD20.BIN / AACD / Programming / AmiSlate-Source / SlateRexx / coords.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1995-08-06  |  1.7 KB  |  49 lines

  1. /* Puts coordinates on the AmiSlate title bar */
  2.  
  3. /* Constants for use with AmiSlate's ARexx interface */
  4. AMode.DOT      =  0 
  5. AMode.PEN      =  1 
  6. AMode.LINE     =  2 
  7. AMode.CIRCLE   =  3 
  8. AMode.SQUARE   =  4 
  9. AMode.POLY     =  5 
  10. AMode.FLOOD    =  6 
  11. AMode.CLEAR    =  7 
  12.  
  13. AMessage.TIMEOUT     = 1        /* No events occurred in specified time period */
  14. AMessage.MESSAGE     = 2        /* Message recieved from remote Amiga */
  15. AMessage.MOUSEDOWN   = 4        /* Left mouse button press in drawing area */
  16. AMessage.MOUSEUP     = 8        /* Left mouse button release in drawing area */
  17. AMessage.RESIZE      = 16       /* Window was resized--time to redraw screen? */ 
  18. AMessage.QUIT        = 32       /* AmiSlate is shutting down */
  19. AMessage.CONNECT     = 64       /* Connection established */
  20. AMessage.DISCONNECT  = 128      /* Connection broken */
  21. AMessage.TOOLSELECT  = 256      /* Tool Selected */
  22. AMessage.COLORSELECT = 512      /* Palette Color selected */
  23. AMessage.KEYPRESS    = 1024     /* Key pressed */
  24. AMessage.MOUSEMOVE   = 2048     /* Mouse was moved */
  25.  
  26. /* Get our host's name--always given as first argument when run from Amislate */
  27. parse arg CommandPort ActiveString
  28.  
  29. options results
  30.  
  31. if (length(CommandPort) == 0) then do
  32.         say ""
  33.         say "Usage:  rx coords.rexx <REXXPORTNAME>"
  34.         say "        (REXXPORTNAME is usually AMISLATE)"
  35.         say ""
  36.         say "Or run from the Rexx menu within AmiSlate."
  37.         say ""
  38.         exit 0
  39.         end
  40.  
  41. /* Send all commands to this host */
  42. address (CommandPort) 
  43.  
  44. do while (1)
  45.     waitevent stem evt. MOUSEMOVE MOUSEUP MOUSEDOWN
  46.     SetWindowTitle '"' || "Coords: X=" || evt.mousex || " Y=" || evt.mousey || " B=" || evt.button ||'"'
  47.     end
  48.     
  49.