home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 255.lha / RexxArpLib_v2.2 / docs / rexxarplib.doc next >
Text File  |  1989-06-13  |  30KB  |  645 lines

  1.  
  2.  
  3.                    RexxArpLib.Library Version 2.2
  4.                    ==============================
  5.  
  6.                       Copyright (C) 1988, 1989
  7.                                 by
  8.                           W.G.J. Langeveld
  9.  
  10. Version 2.2a:
  11. -------------
  12.  
  13.     A small bug fix in IffImage().
  14.  
  15.     5 April 1989, WGL
  16.  
  17.  
  18. Version 2.2:
  19. ------------
  20.  
  21.     New in version 2.2 is an extension to the FileList() function. It can
  22. now expand the file names to include the full path, by supplying another
  23. argument. It will now also return the number of files in the .0 field of the
  24. stem variable, to make it more similar to ExecIO. A bug was fixed...
  25.     Also, version 2.2 now uses ARP's Getenv and Setenv calls, so that with
  26. ARP 1.3 you can use environment variables in the ENV: directory.
  27.     Another addition is a new option for IFFImage() allowing one to load
  28. images without changing the screen's colors.
  29.     Missing from the documentation so far has been that rexxarplib.library
  30. *requires* the presence of screenshare.library and diskfont.library in your
  31. current libs: directory. Several reports about library functions only returning
  32. error 12 have been due to these libraries not being present.
  33.     There was also a mistake in the documentation. The function that used
  34. to be listed as FreeMenu() is really called RemoveMenu().
  35.     The behavior of GetEnv() was changed by popular request. It will no
  36. longer generate an error when the argument is not an existing env variable.
  37. Instead it will return an empty string.
  38.  
  39.     20 February 1989, 8 March 1989, WGL
  40.  
  41. Version 2.1:
  42. ------------
  43.  
  44.     New in version 2.1 are the general function ScreenColor, and the
  45. CreateHost-related functions ReadHost, SetGadget and IFFImage. The allowed
  46. flag for AddItem and AddSubItem is now a specific one (this is an "incompatible"
  47. change). CloseWindow now allows the host to stay around through a second
  48. argument. The window flag DELTAMOVE was added for OpenWindow, and the window
  49. location is now available in reports (%e and %f).
  50.     The function IFFImage needs some explanation. It allows you to display
  51. (a portion of) an IFF image in your CreateHost window. For the time being, this
  52. function makes use of the iff.library written by Christian Weber. However, there
  53. is a suspicion that this library may cause the occasional system crash, and it is
  54. known that DPaint-style brushes are not supported. Only straight IFF picture
  55. files are known to work more or less reliably. At some point I intend to use
  56. something else.
  57.  
  58. Version 2.0:
  59. ------------
  60.  
  61.     Originally, this library was supposed to be an ARexx interface to the
  62. ARP library. However, although it indeed interfaces to some of the ARP
  63. functions, it has become much more of an interface to various Intuition
  64. functions. I have considered renaming the library to something else, but by now
  65. everyone refers to it by this name, so I'll leave it like it is.
  66.     Version 2.0 is pretty much the final version. The library has grown
  67. considerably since the first release, and it is about as big as a library should
  68. ever get. If I find the need for a lot of other functions, they'll have to go
  69. into a different library.
  70.     The library contains over 50 functions now. One is Charlie's famous ARP
  71. file requester, another is a simple combination string/boolean requester that
  72. does auto-everything. All you have to do is specify the strings you want it to
  73. display. Then there are environment variable things, and a simple message window
  74. you can keep hanging around. On popular request, there is now a wildcard
  75. expander (not to be confused with a 'directory' function!) that uses the new Rexx
  76. Variables Interface (RVI).
  77.     The major new things though, are the interface routines to Intuition.
  78. You can now open screens and windows, add boolean and string gadgets to them as
  79. well as menus, draw lines and areas and circles and whatever. You can make your
  80. gadgets, menus, and windows send messages to wherever you like and you can 
  81. format those messages, though they have to ARexx messages, in any way you like,
  82. using any information that's currently available. All this is rather hard to
  83. explain. You'll really have to play with it and look at some examples.
  84.     As usual, this stuff is NOT public domain, but freely distributable.
  85.  
  86.     So have fun!
  87.  
  88.     Willy.
  89.  
  90.  
  91.  
  92. The functions are listed below.
  93. --------------------------------------------------------------------------------
  94.  
  95. GetFile
  96. =======
  97.  
  98.     Calling sequence:
  99.  
  100.     result = GetFile(x, y, pathname, filename, hailstring, publicscreen)
  101.  
  102.     x            = x coordinate of top-left corner of requester.
  103.     y            = y coordinate of top-left corner of requester.
  104.     pathname     = Default path name, first path name to be searched.
  105.         filename     = Default file name.
  106.         hailstring   = User instruction string.
  107.         result       = The selected path/file name
  108.         publicscreen = Name of a public screen (optional).
  109.  
  110.     All arguments are optional, but the order is fixed. Therefore if only
  111. the second or third argument is specified, it needs to be prefixed by
  112. sufficient commas.
  113.     The selected path concatenated with the selected file name are
  114. returned as 'result'. Notice, that the result is not necessarily an existing
  115. file. It is up to the user to ascertain that the result is suitable for his
  116. purposes. If the user hits "CANCEL", the result is an empty string. Notice
  117. that another way the result comes out to be empty is when the user leaves the
  118. requester hitting "OKAY" when both the path and file string gadgets are
  119. empty.
  120.     If 'publicscreen' is specified, the function will try to find the screen
  121. of that name. If it is set up properly, the requester will open on that 
  122. screen. If not, the requester will appear on the Workbench. The mechanism that
  123. is currently used for this is subject to change.
  124.  
  125. Request
  126. =======
  127.  
  128.     Calling sequence:
  129.  
  130.     result = Request(x, y, prompts, string, okaytext, canceltext, publicscreen)
  131.  
  132.     x             = x coordinate of top-left corner of requester.
  133.     y             = y coordinate of top-left corner of requester.
  134.         prompts       = A string which will be displayed above any gadgets.
  135.                         Any embedded '\' characters will be treated as a line
  136.                         break.
  137.         string        = The default string to be displayed in a string gadget.
  138.                         If omitted, no string gadget will be provided.
  139.     okaytext      = The text to be used for an Okay gadget.
  140.                     If omitted, no okay gadget will be provided.
  141.     canceltext    = The text to be used for a Cancel gadget.
  142.                     If omitted, no cancel gadget will be provided.
  143.         publicscreen  = Name of a public screen (optional).
  144.  
  145.     All arguments are optional, but the order is fixed. Therefore if
  146. only the second or third argument is specified, it needs to be prefixed by
  147. sufficient commas.
  148.     If a string gadget is present, but no okay gadget, the string
  149. will be returned after modification by the user in result when the user
  150. hits <return>.
  151.     If both a string gadget and an okay gadget are present, the string
  152. will be returned in result only when the user clicks on the okay gadget.
  153.     If no string gadget is present, clicking of the okay gadget (if 
  154. present) will cause the return in result of the string "OKAY".
  155.     In any case, if the user clicks either the cancel gadget or the
  156. close gadget, an empty string will be returned. Notice that another way the
  157. result comes out to be empty is when the user leaves the requester hitting
  158. "OKAY" when the string gadget is empty.
  159.     If 'publicscreen' is specified, the function will try to find the screen
  160. of that name. If it is set up properly, the requester will open on that 
  161. screen. If not, the requester will appear on the Workbench. The mechanism that
  162. is currently used for this is subject to change.
  163.  
  164. PostMsg
  165. =======
  166.  
  167.     This function sets up a window with text. It returns immediately to
  168. the caller. Subsequent calls will erase lines and fill them with new text.
  169. If a line has zero length, the line will NOT be erased. This has the advantage
  170. that you can change the text in a line without redisplaying text in another
  171. line. It has the disadvantage that in order to erase lines, you have to
  172. specify at least a single space for each line you want to erase.
  173. The window will remain open, until a call is made with too few arguments. 
  174. This is NOT a reentrant function: there is only one window pointer, and
  175. subsequent calls by ANY REXX process will affect the window.
  176.  
  177.     Calling sequence:
  178.  
  179.     result = PostMsg(x, y, strings, publicscreen)
  180.  
  181.     x             = x coordinate of top-left corner of requester.
  182.     y             = y coordinate of top-left corner of requester.
  183.         string        = A string which will be displayed above any gadgets.
  184.                         Any embedded '\' characters will be treated as a line
  185.                         break.
  186.     result        = 1 for success, 0 otherwise.
  187.         publicscreen  = Name of a public screen (optional).
  188.  
  189.     All arguments are optional, but the order is fixed. Therefore if
  190. only the second or third argument is specified, it needs to be prefixed by
  191. sufficient commas.
  192.     Examples:
  193.        Postmsg(50, 50, "This is line 1\This is line 2")
  194. will cause a window to appear with two lines of text. A subsequent call
  195.        Postmsg(50, 50, "\This is a new line 2")
  196. will cause the second line of the window to be replaced by the new text. The
  197. construct:
  198.        PostMsg(50, 50, " \")
  199. will erase the first line but leave the second one alone (notice the space).
  200.     If too few arguments are specified, this function will cause the
  201. window to be closed.
  202.     If 'publicscreen' is specified, the function will try to find the screen
  203. of that name. If it is set up properly, the requester will open on that 
  204. screen. If not, the requester will appear on the Workbench. The mechanism that
  205. is currently used for this is subject to change.
  206.  
  207. Getenv
  208. ======
  209.  
  210.     Calling sequence:
  211.  
  212.     result = Getenv(variable)
  213.  
  214.     variable   = Environment variable.
  215.         result     = The value of the environment variable.
  216.  
  217.     This function gets the value of an environment variable. If the
  218. variable does not exist, an empty string will be returned.
  219.  
  220. Setenv
  221. ======
  222.  
  223.     Calling sequence:
  224.  
  225.     result = Setenv(variable, valuestring)
  226.  
  227.     variable    = Environment variable.
  228.     valuestring = The new value for the environment variable.
  229.         result      = Always 1.
  230.  
  231.     This function (creates and) sets the environment variable to a
  232. a (new) value. If 'valuestring' is missing, the function will remove the
  233. environment variable.
  234.  
  235. ScreenToBack, ScreenToFront
  236. ===========================
  237.  
  238.     These functions depth arrange screens. If no argument is specified,
  239. the screen operated on is the Workbench screen. If the name of a public screen
  240. is specified, it will be affected.
  241.  
  242.     Calling sequence:
  243.  
  244.     result = screentoback(publicscreen)
  245.     result = screentofront(publicscreen)
  246.  
  247.         publicscreen  = Name of a public screen (optional).
  248.  
  249.     The argument is optional. If 'publicscreen' is specified, the function
  250. will try to find the screen of that name. If it is set up properly, the screen
  251. will be moved to the back/front. If not, the function will operate on the
  252. Workbench screen. The mechanism that is currently used for this is subject to
  253. change.
  254.  
  255. ScreenRows, ScreenCols, ScreenLace, ScreenColor
  256. ===============================================
  257.  
  258.     These functions retrieve info about screens. If no argument is
  259. specified, the screen operated on is the Workbench screen. If the name of a
  260. public screen is specified, it will be used.
  261.  
  262.     Calling sequences:
  263.  
  264.     result = ScreenRows(publicscreen)     /* return number of rows */
  265.     result = ScreenCols(publicscreen)     /* return number of columns */
  266.     result = ScreenLace(publicscreen)     /* return interlace */
  267.     result = ScreenColor(publicscreen, n) /* return color n */
  268.  
  269.         publicscreen  = Name of a public screen (optional).
  270.  
  271.     ScreenRows and ScreenCols retrieve the number of rows and columns in
  272. pixels. The function ScreenLace() returns 0 if the screen is not interlaced, and
  273. 1 if it is. The function returns -1 if the information could not be found.
  274. ScreenColor retrieves the RGB values of the selected color in the format:
  275. <red><space><green><space><blue>, e.g:   15 0 0  for an all red screen.
  276.     Except with ScreenColor, the first argument is optional.  If
  277. 'publicscreen' is specified, the function will try to find the screen of that
  278. name. If it is set up properly, information about the screen will be returned.
  279. If not, the function will operate on the Workbench screen. The mechanism that is
  280. currently used for this is subject to change. ScreenColor only operates on
  281. public screens.
  282.  
  283. OpenScreen, CloseScreen
  284. =======================
  285.  
  286.     These functions allow you to open public custom screens.
  287.  
  288.     Calling sequence:
  289.  
  290.     result = OpenScreen(topedge, depth, modes, defaulttitle, publicscreen)
  291.     result = CloseScreen(publicscreen)
  292.  
  293.     topedge       = Y coordinate of top edge of the screen.
  294.     depth         = Number of bitplanes.
  295.     modes         = Viewmodes and type of screen. The currently supported
  296.                         viewmodes are "HIRES", "LACE", and "HAM". The one
  297.                         currently supported type is "SCREENBEHIND".
  298.     defaulttitle  = Default title for the screen title bar.
  299.         publicscreen  = Name of a public screen (optional).
  300.  
  301.     result        = 0 on failure, 1 on success.
  302.  
  303.     The last argument is required, therefore you must supply sufficient
  304. commas and a name for the public screen to be created/closed. With openscreen,
  305. leaving out any of the other arguments will cause defaults to be used. They are
  306. topedge = 0, depth = 2, modes = 0 (meaning LORES, no LACE), and no default
  307. title. This is equivalent to specifying 0 for all arguments (a depth of 0 is
  308. illegal and will be changed to 2). All created screens are CUSTOM screens.
  309.     The mechanism that is currently used for public screens is subject to
  310. change.
  311.     ***NOTE: It is perfectly possible to apply closescreen() to another
  312. application's custom screen (if it is public, using the same conventions as
  313. used here). If you attempt this, a software failure is almost guaranteed. Only
  314. use closescreen() on screens you created using openscreen()!
  315.  
  316. FileList
  317. ========
  318.  
  319.     This function does ARP pattern matching. Given a pattern, it will
  320. return all files and/or directories matching the pattern.
  321.  
  322.     Calling sequence:
  323.  
  324.     number = FileList(pattern, stem, type, expand)
  325.  
  326.     pattern       = a search pattern using ARP wildcards.
  327.         stem          = the NAME of a stem variable to be created.
  328.         type          = D - directories only. F - files only.
  329.         expand        = E - expand full path name.
  330.  
  331.     number        = the number of files matching the pattern.
  332.  
  333.     When files with names matching the  pattern are found, a stem variable
  334. with the name given by 'stem' is created in the current Rexx context. It has
  335. fields 1, 2, ... , <number> containing the names of the files. The return value
  336. and also the stem variable's field 0 are equal to the number of files. The last
  337. two arguments are optional: with 'type', when an F is specified, only files are
  338. listed. When a D is specified only directories are listed. With 'expand', if an
  339. E is specified, the full path name is expanded. Example: a simple directory
  340. program looks like
  341.  
  342.     /* Directory program, list everything, with full path */
  343.     arg pattern
  344.     if pattern = "" then pattern = "*"
  345.     numfils = FileList(pattern, myfilelist, , E)
  346.     do i = 1 to numfils; say myfilelist.i; end
  347.     exit
  348.  
  349. CreateHost
  350. ==========
  351.  
  352.     This function allows you to create a single window with gadgets, menus,
  353. text, graphics, etc. Of course, multiple copies of the function may be started
  354. up to create more windows, but each must have a unique 'controlport'. This
  355. function should be started up asynchronously, using runwsh, and one should wait
  356. for the 'controlport' to appear using e.g. WaitForPort.
  357.  
  358.     Calling sequence:
  359.  
  360.     runwsh 'call CreateHost(controlport, notifyport, publicscreen)'
  361.  
  362.     controlport   = Name of the message port this window should listen to.
  363.     notifyport    = Name of the message port that should be notified when
  364.                         an IDCMP event occurs.
  365.         publicscreen  = Name of a public screen (optional).
  366.  
  367.     When the function is first called, it will open a message port with the
  368. name given by "controlport". The function will then wait for commands coming in
  369. through this port. This may be accomplished using one of many intuition
  370. functions, as explained later. One of the first commands should be to open the
  371. associated window by calling OpenWindow (see later). It will then open a window
  372. as specified in the OpenWindow call. If any message arrives through the IDCMP of
  373. this window, a REXX message will be sent to the port specified as "notifyport"
  374. which either you should set up in your rexx macro for this purpose, or should be
  375. an otherwise existing rexx message port belonging to another process. In the
  376. case you set up your own port, make sure the message is replied to after having
  377. been  retrieved and examined. If the  notifyport does not exist, no message will
  378. be sent. The window can be closed by the rexx macro by calling the function
  379. CloseWindow (see later). On startup, the notify port is the same for all classes
  380. of messages. This can be changed using the SetNotify() function, see later.
  381.     The last argument is optional.  If 'publicscreen' is specified, the
  382. function will try to find the screen of that name. If it is set up properly, the
  383. window will be opened on it. If not, the window will be opened on the Workbench
  384. screen. The mechanism that is currently used for this is subject to change.
  385.  
  386. Supported Intuition (and other) functions with createhost
  387. =========================================================
  388.  
  389.     The following functions are implemented as CreateHost functions. The 
  390. first argument is always the name of the control port of the host that is
  391. supposed to execute the command. A little secret: you can send commands
  392. *directly* to the controlport also by constructs like "Address controlport
  393. commandname". However, this only works for commands without further arguments.
  394. For example, from WShell, "address controlport CloseWindow" is equivalent to
  395. "call CloseWindow(controlport)". This can come in incredibly handy at times.
  396. For example, when you want command hosts to send message to themselves: you
  397. can tell a host to send IDCMP events of class CLOSEWINDOW to itself...
  398. Boggles the mind yet? Read on...
  399.  
  400.    call ActivateGadget(controlport, gadgetid)
  401.         Tries to activate a string gadget with id 'gadgetid'.
  402.  
  403.    call ActivateWindow(controlport)
  404.  
  405.    call AreaCircle(controlport, xcenter, ycenter, radius)
  406.  
  407.    call AreaDraw(controlport, x, y)
  408.         Only 100 vertices are currently allowed before each AreaEnd().
  409.  
  410.    call AreaEllipse(controlport, xcenter, ycenter, radius1, radius2)
  411.  
  412.    call AreaEnd(controlport)
  413.         Only 100 vertices are currently allowed before each AreaEnd().
  414.  
  415.    call AreaMove(controlport, x, y) 
  416.         Only 100 vertices are currently allowed before each AreaEnd().
  417.  
  418.    call AddGadget(controlport, x, y, gadgetid, gadgettext, messagetext, hsize)
  419.         If hsize is specified, this call creates a string gadget of that
  420.         horizontal size and gadgettext is the default string. If hsize is
  421.         not specified, this call creates an autosizing boolean gadget, where
  422.         the text in gadgettext is displayed. In both cases, the string in
  423.         messagetext is sent to controlport (see also under OpenWindow). As
  424.         usual, the gadgettext for boolean gadgets may contain \ characters
  425.         to cause multiple lines of text (See e.g. PostMsg()).
  426.  
  427.    call AddItem(controlport, itemname, message, commandchar, mutualexclude, flag)
  428.         Add a new item with name 'itemname'. Optionally, you may specify a
  429.         command key abbreviation (right-Amiga 'commandchar') and a mutual exclude
  430.         mask. See Intuition manual. A special value of the mutual exclude mask
  431.         is -1: this means that the item will be toggle selectable. If the flag
  432.         argument is "SAMELINE", the item will be on the same line as the previous
  433.         item, otherwise, or if the argument is not present, it will be on the 
  434.         next line.
  435.         See also AddMenu(), AddSubItem(), RemoveMenu(), SetItem().
  436.  
  437.    call AddMenu(controlport, menuname)
  438.         Add a new menu with name 'menuname'. See also AddItem(), AddSubItem(),
  439.         RemoveMenu(), SetItem().
  440.  
  441.    call AddSubItem(controlport,itemname,message,commandchar,mutualexclude,flag)
  442.         Add a new subitem with name 'itemname'. Optionally, you may specify a
  443.         command key abbreviation (right-Amiga 'commandchar') and a mutual exclude
  444.         mask. See Intuition manual. A special value of the mutual exclude mask
  445.         is -1: this means that the item will be toggle selectable. If the flag
  446.         argument is "SAMELINE", the item will be on the same line as the previous
  447.         item, otherwise, or if the argument is not present, it will be on the 
  448.         next line.
  449.         See also AddMenu(), AddItem(), RemoveMenu(), SetItem().
  450.  
  451.    call BackFill(controlport)
  452.         This is not an intuition function. See OpenWindow().
  453.  
  454.    call CloseWindow(controlport, flag)
  455.         This function closes the window and deallocates all resources. The 'flag'
  456.         argument is optional. If present, and if the flag is equal to "CONTINUE",
  457.         the host will remain active. Otherwise, the host will exit.
  458.  
  459.    call Draw(controlport, x, y)
  460.  
  461.    call DrawCircle(controlport, xcenter, ycenter, radius)
  462.  
  463.    call DrawEllipse(controlport, xcenter, ycenter, radius1, radius2)
  464.  
  465.    call Exit(controlport)
  466.         This function closes the window, deallocates all resources and causes
  467.         the host to exit. Exit(), Quit() and Stop() are identical.
  468.  
  469.    call Flood(controlport, mode, x, y)
  470.         If mode is 0, the flood continues until pixels of the outline pen
  471.         color are found. If the mode is 1, the flood continues until pixels
  472.         of a different color than the pixel at x, y are found.
  473.  
  474.    call RemoveMenu(controlport)
  475.         Gets rid of any attached menu.
  476.  
  477.    call IFFImage(controlport, filename, x, y, width, height, flag)
  478.         Displays a chunk of size 'width', 'height' of an IFF ILBM file named
  479.         'filename' at x, y in the window. If x, y, width, and/or height are
  480.         omitted, suitable defaults are chosen. The colormap of the IFF file,
  481.         if any, is NOT used on the Workbench, but IS used on custom screens.
  482.         The 'flag' option can be set to 'NOCOLOR' (N is sufficient) to prevent
  483.         modifying the custom screen's colors.
  484.  
  485.    call ModifyHost(controlport, IDCMPclass, messagestring)
  486.         This function allows you to set the message string that is sent to 
  487.         the notifyport for a particular class of IDCMP events. See OpenWindow.
  488.  
  489.    call Move(controlport, x, y)
  490.  
  491.    call OpenWindow(controlport, leftedge, topedge, width, height,
  492.                                 idcmp, flags, title)
  493.         width and height may be set to 0 to get the maximum size of the window.
  494.         idcmp is a string that specifies the IDCMP for the window. Supported are:
  495.  
  496.            IDCMP message    |  default arg[0]          
  497.         --------------------+-------------------
  498.           "CLOSEWINDOW"     |  "%l"            
  499.           "MOUSEBUTTONS"    |  "%l"            
  500.           "GADGETUP"        |  <its string>   
  501.           "GADGETDOWN"      |  <its string>   
  502.           "MENUPICK"        |  "%l"            
  503.           "NEWSIZE"         |  "%l"            
  504.           "VANILLAKEY"      |  "%l"            
  505.           "RAWKEY"          |  "%l"            
  506.           "NEWPREFS"        |  "%l"            
  507.           "DISKINSERTED"    |  "%l"            
  508.           "DISKREMOVED"     |  "%l"            
  509.           "ACTIVEWINDOW"    |  "%l"            
  510.           "INACTIVEWINDOW"  |  "%l"            
  511.           "REFRESHWINDOW"   |  "%l"            
  512.           "MOUSEMOVE"       |  "%l"            
  513.           "DELTAMOVE"       |  "%l"            
  514.  
  515.         Any number of these may be specified in the OpenWindow call, by conca-
  516.         tenation. When any of these messages arrives at the IDCMP, a REXX
  517.         message is created with a particular string in Arg[0]. This string is
  518.         by default the one given in the table above, after substitution has
  519.         taken place for any two-character sequence starting with '%'.
  520.         The following substitutions will be made:
  521.  
  522.         Sequence: | Typical Use: |     Meaning:
  523.         ----------+--------------+---------------
  524.             %%    |              | A single % sign
  525.             %a    | Vanillakeys  | 'Code' is interpreted as an ASCII character.
  526.             %b    | Buttons      | SELECTDOWN, SELECTUP, MENUDOWN, MENUUP.
  527.             %c    |              | 'Code' is given as an integer.
  528.             %d    | Gadgets      | the gadget id.
  529.             %e    | Window       | the TopEdge of the window
  530.             %f    | Window       | the LeftEdge of the window
  531.             %g    | Gadgets      | the string inside a string gadget goes here.
  532.             %h    | Newsize      | the window height.
  533.             %i    | Menus        | the item number.
  534.             %l    | Any          | the name of the IDCMP class.
  535.             %m    | Menus        | the menu number.
  536.             %q    |              | 'Qualifier' is given as an integer.
  537.             %s    | Menus        | the sub-item number.
  538.             %t    | Time         | the number of seconds since January 1 1980.
  539.             %w    | Newsize      | the window width.
  540.             %x    | Mouse        | the X position of the mouse pointer.
  541.             %y    | Mouse        | the Y position of the mouse pointer.
  542.           %0-%15  |              | which Arg to use.
  543.  
  544.         For example, if the message string of some gadget is
  545.  
  546.             "Mouse is %x, %y%3gadget string is %g"
  547.  
  548.         the following might be sent to the notifyport in Arg[0] when someone
  549.         hits return in that gadget, after typing "This is a test":
  550.  
  551.             Mouse is 320, 200
  552.  
  553.         while Arg[3] of the Rexx message would contain the string:
  554.  
  555.             gadget string is This is a test
  556.  
  557.         The default string for non-gadgets/menus is "%l", which means that they
  558.         only report their name. For example, if one would click in the window,
  559.         one would only receive a message with "MOUSEBUTTONS" in Arg[0]. However,
  560.         all arguments of the message that will be sent to the notifyport may be
  561.         changed using the ModifyHost() call, see there. Any of the escape
  562.         sequences above may be used in any string. Obviously, sometimes
  563.         particular sequences may not be very appropriate for certain uses.
  564.  
  565.         'flags' specifies the various window flags. Currently supported are:
  566.         "WINDOWCLOSE", "WINDOWSIZING" (and "SIZEBRIGHT", "SIZEBBOTTOM"),
  567.         "WINDOWDEPTH", "WINDOWDRAG", "BORDERLESS", "ACTIVATE" and
  568.         "NOCAREREFRESH".   A special flag can be set: "BACKFILL". It implies
  569.         a call to BackFill() after opening the window. It sets the window's
  570.         background to the current requester-style background color.
  571.  
  572.    call Quit(controlport)
  573.         This function closes the window, deallocates all resources and causes
  574.         the host to exit. Exit(), Quit() and Stop() are identical.
  575.  
  576.    call ReadGadget(controlport, gadgetid)
  577.         This function will cause the gadget 'gadgetid' to send its message
  578.         text (after substitutions, of course).
  579.  
  580.    call ReadHost(controlport, notifyport, messagetext)
  581.         This function will cause the message text (after substitutions, of
  582.         course) to be sent to the notifyport.
  583.  
  584.    call RectFill(controlport, xmin, ymin, xmax, ymax) 
  585.  
  586.    call RefreshGadgets(controlport)
  587.  
  588.    call RemoveGadget(controlport, gadgetid)
  589.  
  590.    call SetAPen(controlport, pennumber)
  591.  
  592.    call SetBPen(controlport, pennumber)
  593.  
  594.    call SetDrMd(controlport, mode)
  595.         mode can be any of JAM1, JAM2, INVERSVID or COMPLEMENT.
  596.  
  597.    call SetDrPt(controlport, pattern)
  598.         pattern is interpreted as a long integer of which the bits form the
  599.         pattern.
  600.  
  601.    call SetFont(controlport, FontName, FontSize)
  602.  
  603.    call SetGadget(controlport, gadgetid, action)
  604.         Given a gadget id, perform action on the gadget. Supported are ON and
  605.         OFF, to set or clear the highlighting state of the gadget.
  606.  
  607.    call SetItem(controlport, menunumber, itemnuber, subitemnumber, action)
  608.         Given menu, item (and optionally subitem) numbers, perform action on
  609.         the menu item. Supported are ON and OFF, to set or clear the check mark.
  610.  
  611.    call SetNotify(controlport, IDCMPclass, newnotifyport)
  612.         This function allows you to change the name of the NotifyPort that 
  613.         message strings are sent to for a particular class of IDCMP events.
  614.  
  615.    call SetReqColor(controlport, pentype, colornumber)
  616.         This function allows you to change the color number assigned to
  617.         one of the various pentypes. Currently the pentypes are: BLOCKPEN,
  618.         DETAILPEN, BACKGROUNDPEN, PROMPTPEN, BOXPEN, SHADOWPEN, OKAYPEN,
  619.         and CANCELPEN.
  620.  
  621.    call SetOPen(controlport, pennumber)
  622.  
  623.    call SetRGB4(controlport, pennumber, red, green, blue)
  624.         red, green and blue are values for the RGB content of the color to be
  625.         assigned to the pen. The values are taken mod 16.
  626.  
  627.    call Stop(controlport)
  628.         This function closes the window, deallocates all resources and causes
  629.         the host to exit. Exit(), Quit() and Stop() are identical.
  630.  
  631.    call Text(controlport, string) 
  632.  
  633.    call WindowText(controlport, text)
  634.         The string in text may contain \'s to indicate multiple lines of text.
  635.  
  636.    call WindowToBack(controlport)
  637.  
  638.    call WindowToFront(controlport)
  639.  
  640.    call WritePixel(controlport, x, y)
  641.  
  642.  
  643.  
  644.  
  645.