home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 3 / Meeting_Pearls_III.iso / Pearls / tcp / Networking / TCP / Server / AmiSlate / SlateRexx / boxme.rexx next >
OS/2 REXX Batch file  |  1995-03-24  |  2KB  |  57 lines

  1. /* BoxMe.rexx
  2.  
  3.    An ARexx script designed to work with AmiSlate.
  4.    
  5.    Draws a box around the current mouse position whenever the user
  6.    presses or lets go of the left mouse button in the drawing window.
  7.    
  8. */
  9. parse arg CommandPort ActiveString
  10.  
  11.  
  12. if (length(CommandPort) == 0) then do
  13.     say ""
  14.     say "Usage:  rx boxme.rexx <REXXPORTNAME>"
  15.     say "        (REXXPORTNAME is usually AMISLATE)"
  16.     say ""
  17.     say "Or run from the Rexx menu within AmiSlate."
  18.     say ""
  19.     exit 0
  20.     end
  21.     
  22.  
  23. address (CommandPort)
  24. options results
  25.  
  26. /* Constants for use with AmiSlate's ARexx interface */
  27. AMessage.TIMEOUT     = 1    /* No events occurred in specified time period */
  28. AMessage.MESSAGE     = 2    /* Message recieved from remote Amiga */
  29. AMessage.MOUSEDOWN   = 4    /* Left mouse button press in drawing area */
  30. AMessage.MOUSEUP     = 8    /* Left mouse button release in drawing area */
  31. AMessage.RESIZE      = 16    /* Window was resized--time to redraw screen? */
  32. AMessage.QUIT        = 32    /* AmiSlate is shutting down */
  33. AMessage.CONNECT     = 64    /* Connection established */
  34. AMessage.DISCONNECT  = 128    /* Connection broken */
  35. AMessage.TOOLSELECT  = 256    /* Tool Selected */
  36. AMessage.COLORSELECT = 512    /* Palette Color selected */
  37. AMessage.KEYPRESS    = 1024    /* Key pressed */
  38.  
  39. do while (1=1)
  40.     WaitEvent MOUSEDOWN MOUSEUP QUIT stem e.
  41.     t = e.type
  42.     if (t = AMessage.MOUSEDOWN) then do
  43.         setfpen 7
  44.         square e.x-5 e.y-5 e.x+5 e.y+5
  45.         end
  46.  
  47.     if (t = AMessage.MOUSEUP) then do
  48.         setfpen 1
  49.         square e.x-5 e.y-5 e.x+5 e.y+5
  50.         end
  51.  
  52.     if (t = AMessage.QUIT) then exit
  53.  
  54.     e.type = 0
  55.     end
  56.  
  57.