home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 418.lha / rexxarplib_v2.5 / docs / rexxarplib.doc < prev    next >
Text File  |  1990-09-01  |  37KB  |  784 lines

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