home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 509.lha / RexxArpLibLibrary_v3.0 / docs / rexxarplib.doc.pp / rexxarplib.doc
Text File  |  1991-05-06  |  54KB  |  1,092 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 3.0
  23.                     ==============================
  24.  
  25.                  Copyright (C) 1988, 1989, 1990, 1991
  26.  
  27.                                 by
  28.  
  29.                           W.G.J. Langeveld
  30.  
  31.                  Stanford Linear Accelerrator Center
  32.  
  33.                         All Rights Reserved
  34.  
  35.  
  36. Version 3.0:
  37. ------------
  38.  
  39.     This version of rexxarplib makes use of a lot of AmigaDOS 2.0
  40. features and has various bugs fixed and a few other enhancements. Yet, it is
  41. smaller than previous versions because it is now completely compiled using
  42. SAS/C version 5.10a.
  43.     Under AmigaDOS 2.0, rexxarplib will now use the ASL file requester
  44. rather than the ARP one. The GetFile() function acquired some new arguments
  45. in order to allow you to use most of the features of the ASL requester (such
  46. as specifying its size and adding pattern gadgets or setting it up as a
  47. directory requester or using multiple select). *NOTE*. Various features of
  48. the ASL file requester only work correctly under versions of AmigaDOS
  49. *after* 2.02. Some features may not appear to work at all in early versions
  50. of 2.0, one of them is the "NOFILES" option. If you definitely *want* to use
  51. the ARP file requester, you can, by specifying a flag.
  52.     There is a new function called GetFont() which brings up the new
  53. ASL font requester. It too has lots of options and arguments. The SetFont()
  54. function never worked correctly but should now be fixed. It has also acquired
  55. a few more arguments, to go with the font requester.
  56.     Furthermore, under AmigaDOS 2.0, you should no longer need
  57. screenshare.library (at least not for rexxarplib.library - other programs may
  58. still require it!). It uses 2.0 public screens everywhere. This also means
  59. that you can use rexxarplib functions to operate on other applications'
  60. screens (if they are AmigaDOS 2.0 public ones). Applications that still open
  61. screenshare shared screens are still supported: if screenshare.library is
  62. available and a requested public screen does not exist as a 2.0 public
  63. screen, rexxarplib will try to find a screenshare-style screen of that name.
  64. Under AmigaDOS 1.3, rexxarplib of course uses screenshare.library exclusively.
  65. Support was also added for the long missing BACKDROP flag to OpenWindow.
  66.     Rexxarplib.library uses as much as possible the 2.0 3-D look, though
  67. there are cases where it decides (based on the colors for example) to use a
  68. slightly different rendering. In order to support more of the new 2.0
  69. features, the number of arguments to OpenScreen has been increased. You can
  70. now specify the width and height, as well as the coordinates of the top-left
  71. corner, and you can give it AutoScroll and Overscan flags. You can make
  72. as large a screen as AmigaDOS 2.0 allows and scroll around for example. Also,
  73. a MoveScreen() function was added to allow moving screens around from ARexx.
  74.     Under 2.0 you can now specify "Workbench" as a Public Screen Name.
  75. This means that some functions (such as ScreenColor()) will now also work for
  76. the Workbench. For some reason, ShowTitle() does not which is just as well
  77. anyway.    The number of arguments to ScreenColor() was increased so you can set
  78. the colors of a screen without having to open a window on it and you can also
  79. determine the colors of the screen using this function.
  80.     This version has new Getenv() and Setenv() functions. These functions
  81. are now compatible with the 2.0 environment variable system and use the
  82. GetVar, SetVar and DeleteVar routines. If GetVar fails, it will fall back
  83. to the ARP Getenv function. Under 1.3, the behavior is the same as before.
  84.     There is a new flag argument with AddGadget() for string gadgets.
  85. One possible flag is RIDGEBORDER. This causes string gadgets to have the
  86. "standard" 2.0 three-dimensional border. This is not the default, because
  87. this type of border requires a little more space and might break ARexx
  88. programs that assume the size is as before. Another flag was added to
  89. allow the gadget to be defined as a NUMERIC gadget.
  90.     Other than that, gadgets on two-color screens should now have visible
  91. gadget borders (by default - it is still possible to change them) and the
  92. colors should default to the proper values for the screen the window opens
  93. up on. Note that under 2.0 the colors your application comes up with may
  94. be a little different from what you would have expected. You can adjust the
  95. colors by using the SetReqColor() function.
  96.     Bugs fixed: the Flood() routine ran *very* slowly because it didn't
  97. have a TmpRas. Now, a TmpRas is allocated before the Flood operation is
  98. actually done, and the function is orders of magnitude faster. This actually
  99. used to work correctly in an earlier version of rexxarplib but broke in one
  100. of the more recent ones. Under AmigaDOS 1.3 the colors that some requesters
  101. used could be random in certain conditions. The createhost function didn't
  102. check correctly whether there were any messages it had sent out that were not
  103. yet replied to before closing down. The FileList function used a construct
  104. that was not reentrant. A minor problem in PostMsg() was also fixed. A little
  105. bug in AddGadget was fixed which could potentially cause enforcer hits if
  106. certain arguments were left unspecified. All these should be fixed.
  107.     Many thanks to the various beta testers - you know who you are!
  108.  
  109.     25 April 1991, WGL
  110.  
  111.  
  112. Version 2.52:
  113. -------------
  114.  
  115.     This release was necessary to fix problems with AmigaDOS 2.0
  116. shared screens. As of version 1.45, screenshare.library supports 2.0-style
  117. shared screens, but the previous versions of rexxarplib contained code that
  118. would prevent some functions to work with such screens because they have
  119. slightly different properties. Do not forget to install the new
  120. screenshare.library in libs:.
  121.  
  122.     16 October 1990, WGL
  123.  
  124.  
  125. Version 2.5:
  126. ------------
  127.  
  128.     Minor update. Two bugs in the FileList function were fixed: the third
  129. argument wouldn't work right if there was a fourth, and the Noexpand option was
  130. broken in the previous version. A problem in the documentation of some of the
  131. screen functions (ScreenRows/Cols/Lace/Color/ToBack/ToFront) was corrected. A
  132. ShowTitle function was added. The CreateHost function was modified, such that if
  133. the named public screen does not exist, the window will open on the WorkBench.
  134. Under 2.0, rexxarplib's screens now get the "3D" look. Some other esthetical
  135. problems with 2.0 were also fixed.
  136.  
  137.     22 August 1990, WGL
  138.  
  139.  
  140. Version 2.42 (internal release):
  141. -------------------------------
  142.  
  143.     Another minor update. The PostMsg() code was fixed for two little bugs:
  144. (1) when calling PostMsg() in rapid sequence from different ARexx programs, it
  145. was possible to wind up with an orphaned PostMsg window that would never go
  146. away; (2) after updating an existing PostMsg() window on a shared custom screen,
  147. it was impossible to ever close that screen.
  148.     The Area... functions have been completely rewritten. While they used to
  149. be simple interfaces to the AmigaDOS equivalents, they are no longer, although
  150. they still use the AmigaDOS functions down below. Advantages: areafills are now
  151. clipped against the window borders, there are 16 specific pattern fills and 125
  152. dithering patterns, the fills no longer take up as much memory as they used to,
  153. and the probability of a system crash with these functions is considerably
  154. reduced. "Problems": AreaEnd() now has an optional argument and SetOPen is now
  155. obsolete (See AreaEnd()), and fills involving areacircles and areaellipses that
  156. don't fit inside the window may now fail and only produce the outline of the
  157. fill.
  158.     Other minor changes: ScreenToFront/Back now return 0 when the screen
  159. doesn't exist, rather than signalling an error. Windows no longer have their
  160. minimum size set to their original size, so you can use sizing gadgets to
  161. make windows smaller too. Boolean gadgets now also have their GADGIMMEDIATE
  162. flag set, so that GADGETDOWN messages are actually possible now. Note, that
  163. when you request to receive both GADGETUP and GADGETDOWN messages, each
  164. gadget will report to you its message string *twice*. They can be distinguished
  165. by including %l in the message string, so that you can parse on UP vs. DOWN.
  166. The OpenScreen() function acquired another flag, TRUNCATE. See the description
  167. of OpenScreen(). A few little bugs were fixed in IFFImage. Note: iff.library
  168. apparently still has some bugs. It may still cause crashes of the machine when
  169. used with DPaint brushes. When in doubt, use full IFF pictures. Send mail to
  170. Chris Weber to have it fixed...
  171.     And finally, the entire code was carefully checked and improved to avoid
  172. crashes under low-memory situations.
  173.  
  174.     21 January 1990, WGL
  175.  
  176.  
  177. Version 2.3:
  178. -------------
  179.  
  180.     Minor update. A new option was added to FileList to inhibit expansion of
  181. file names where not wanted. DrawCircle apparently never worked, can't believe
  182. noone noticed: it is fixed now. A small bug in the simple requester code was
  183. found and fixed, as well as a few similar ones in the file requester interface
  184. code. Finally: the 'version' command will now properly display the version
  185. number of rexxarplib and rexxmathlib.
  186.  
  187.     20 May 1989, WGL
  188.  
  189.  
  190. Version 2.2a:
  191. -------------
  192.  
  193.     A small bug fix in IffImage().
  194.  
  195.     5 April 1989, WGL
  196.  
  197.  
  198. Version 2.2:
  199. ------------
  200.  
  201.     New in version 2.2 is an extension to the FileList() function. It can
  202. now expand the file names to include the full path, by supplying another
  203. argument. It will now also return the number of files in the .0 field of the
  204. stem variable, to make it more similar to ExecIO. A bug was fixed...
  205.     Also, version 2.2 now uses ARP's Getenv and Setenv calls, so that with
  206. ARP 1.3 you can use environment variables in the ENV: directory.
  207.     Another addition is a new option for IFFImage() allowing one to load
  208. images without changing the screen's colors.
  209.     Missing from the documentation so far has been that rexxarplib.library
  210. *requires* the presence of screenshare.library and diskfont.library in your
  211. current libs: directory. Several reports about library functions only returning
  212. error 12 have been due to these libraries not being present.
  213.     There was also a mistake in the documentation. The function that used
  214. to be listed as FreeMenu() is really called RemoveMenu().
  215.     The behavior of GetEnv() was changed by popular request. It will no
  216. longer generate an error when the argument is not an existing env variable.
  217. Instead it will return an empty string.
  218.  
  219.     20 February 1989, 8 March 1989, WGL
  220.  
  221. Version 2.1:
  222. ------------
  223.  
  224.     New in version 2.1 are the general function ScreenColor, and the
  225. CreateHost-related functions ReadHost, SetGadget and IFFImage. The allowed
  226. flag for AddItem and AddSubItem is now a specific one (this is an "incompatible"
  227. change). CloseWindow now allows the host to stay around through a second
  228. argument. The window flag DELTAMOVE was added for OpenWindow, and the window
  229. location is now available in reports (%e and %f).
  230.     The function IFFImage needs some explanation. It allows you to display
  231. (a portion of) an IFF image in your CreateHost window. For the time being, this
  232. function makes use of the iff.library written by Christian Weber. However, there
  233. is a suspicion that this library may cause the occasional system crash, and it is
  234. known that DPaint-style brushes are not supported. Only straight IFF picture
  235. files are known to work more or less reliably. At some point I intend to use
  236. something else.
  237.  
  238. Version 2.0:
  239. ------------
  240.  
  241.     Originally, this library was supposed to be an ARexx interface to the
  242. ARP library. However, although it indeed interfaces to some of the ARP
  243. functions, it has become much more of an interface to various Intuition
  244. functions. I have considered renaming the library to something else, but by now
  245. everyone refers to it by this name, so I'll leave it like it is.
  246.     Version 2.0 is pretty much the final version. The library has grown
  247. considerably since the first release, and it is about as big as a library should
  248. ever get. If I find the need for a lot of other functions, they'll have to go
  249. into a different library.
  250.     The library contains over 50 functions now. One is Charlie's famous ARP
  251. file requester, another is a simple combination string/boolean requester that
  252. does auto-everything. All you have to do is specify the strings you want it to
  253. display. Then there are environment variable things, and a simple message window
  254. you can keep hanging around. On popular request, there is now a wildcard
  255. expander (not to be confused with a 'directory' function!) that uses the new Rexx
  256. Variables Interface (RVI).
  257.     The major new things though, are the interface routines to Intuition.
  258. You can now open screens and windows, add boolean and string gadgets to them as
  259. well as menus, draw lines and areas and circles and whatever. You can make your
  260. gadgets, menus, and windows send messages to wherever you like and you can
  261. format those messages, though they have to ARexx messages, in any way you like,
  262. using any information that's currently available. All this is rather hard to
  263. explain. You'll really have to play with it and look at some examples.
  264.     As usual, this stuff is NOT public domain, but freely distributable.
  265.  
  266.     So have fun!
  267.  
  268.     Willy.
  269.  
  270.  
  271.  
  272. The functions are listed below.
  273. --------------------------------------------------------------------------------
  274.  
  275. GetFile
  276. =======
  277.  
  278.     Calling sequence:
  279.  
  280.     result = GetFile(x, y, pathname, filename, hailstring, publicscreen,
  281.                          options, stemname, width, height, pattern)
  282.  
  283.     x            = x coordinate of top-left corner of requester.
  284.     y            = y coordinate of top-left corner of requester.
  285.     pathname     = Default path name, first path name to be searched.
  286.         filename     = Default file name.
  287.         hailstring   = User instruction string.
  288.         publicscreen = Name of a public screen (optional).
  289.  
  290.     Under 2.0, we use ASL and the following arguments are recognized:
  291.         options      = One or more of:
  292.                        NOFILES        Directory requester
  293.                        PATGAD         Add a pattern gadget
  294.                        SAVE           "Save" requester (different color)
  295.                        MULTISELECT    Enable multiple selections. This
  296.                                       option requires the presence of the
  297.                                       name of a stem variable (see next)
  298.                                       or else this option is ignored.
  299.                        MATCHDIRS      Pattern in filename applies to dirs too.
  300.                        DOARP          Use the ARP requester instead.
  301.         stemname     = Name of a stem variable to receive the result.
  302.         width        = Preferred width of the requester
  303.         height       = Preferred height of the requester
  304.         pattern      = Default pattern.
  305.  
  306.         result       = See below.
  307.  
  308.     All arguments are optional, but the order is fixed. Therefore if only
  309. the second or third argument is specified, it needs to be prefixed by
  310. sufficient commas.
  311.     The selected path concatenated with the selected file name are
  312. returned as 'result' unless the stemname is specified. If the stemname is
  313. specified, the result will always be given in the form of a stem variable:
  314. stemname.0 will contain the number of returned file names, and stemname.i
  315. with i = 1 through stemname.0 will contain the file names. The 'result'
  316. will be set to the number of files returned. In addition, stemname.Width,
  317. stemname.Height, stemname.TopEdge and stemname.LeftEdge will contain the
  318. last used size and position of the file requester. If PATGAD is specified
  319. among the options, stemname.Pattern will contain the (possibly modified)
  320. pattern.
  321.     About patterns: there are two ways to make the file requester
  322. only list files that match a certain pattern. The pattern may be specified
  323. as part of default directory argument or as the default pattern argument
  324. if PATGAD is specified as an option. The pattern present in the default
  325. directory specification will not be displayed anywhere, even if the PATGAD
  326. option is used and a pattern gadget is provided. Yet, only files matching
  327. the pattern will be shown. If PATGAD is used together with a pattern
  328. in the default pattern argument, the requester will show only the files
  329. that match that pattern, and that pattern itself will be shown in the
  330. pattern gadget. If there is both a pattern in the default directory and
  331. the default pattern arguments, then all files must match both patterns.
  332. However, this last restriction is only present as neither the directory
  333. nor the pattern gadget contents are modified.
  334.     The result is not necessarily an existing file. It is up to the user
  335. to ascertain that the result is suitable for his purposes. If the user hits
  336. "CANCEL", the result is an empty string and/or stemname.0 = 0. It is also
  337. possible for the user to enter a pattern in the File gadget. Such a pattern
  338. is not expanded, and returned as a file name.
  339.     Notice that another way the result comes out to be empty is when the
  340. user leaves the requester hitting "OKAY" when both the path and file string
  341. gadgets are empty.
  342.     If 'publicscreen' is specified, the function will try to find the screen
  343. of that name. If it is set up properly, the requester will open on that
  344. screen. If not, the requester will appear on the Workbench. Under AmigaDOS
  345. 1.3, screenshare.library is used for this purpose. Under AmigaDOS 2.0
  346. a "public" screen of that name will be looked for and if this fails,
  347. screenshare.library is used, if it is in libs:.
  348.  
  349. GetFont
  350. =======
  351.  
  352.     This function is AmigaDOS 2.0-only.
  353.  
  354.     Calling sequence:
  355.  
  356.     result = GetFont(x, y, fontname, fontsize, hailstring, publicscreen,
  357.                          options, stemname, minheight, maxheight,
  358.                          fontstyle, fontflags, frontpen, backpen)
  359.  
  360.     x            = x coordinate of top-left corner of requester.
  361.     y            = y coordinate of top-left corner of requester.
  362.     fontname     = Default font name, first font to be displayed.
  363.         fontsize     = Default font size.
  364.         hailstring   = User instruction string.
  365.         publicscreen = Name of a public screen (optional).
  366.         options      = One or more of:
  367.                        BACKPEN       Allow selection of background pen
  368.                        DRAWMODE      Allow selection of drawing mode
  369.                        FIXEDWIDTH    Only allow fixed-width fonts
  370.                        FRONTPEN      Allow selection of foreground pen
  371.                        STYLE         Allow selection of style attributes
  372.         stemname     = Name of a stem variable to receive the result.
  373.         minheight    = Minimum allowable font height.
  374.         maxheight    = Maximum allowable font height.
  375.         fontstyle    = Initial font style
  376.         fontflags    = Initial font flags
  377.         frontpen     = Initial front pen
  378.         backpen      = Initial back pen
  379.  
  380.     result       = See below.
  381.  
  382.     All arguments are optional, but the order is fixed. Therefore if only
  383. the second or third argument is specified, it needs to be prefixed by
  384. sufficient commas.
  385.     The selected font, concatenated with a "/" and the selected size is
  386. returned as 'result' unless the stemname is specified. If the stemname is
  387. specified, the result will always be given in the form of a stem variable:
  388.         stemname.Name     = font name
  389.         stemname.YSize    = vertical size of font
  390.         stemname.Style    = style flags for font (see SetFont())
  391.         stemname.Flags    = font flags           (see SetFont())
  392.         stemname.FrontPen = foreground pen
  393.         stemname.BackPen  = background pen
  394.         stemname.DrawMode = drawing mode (JAM1, JAM2, COMPLEMENT)
  395. In this case, 'result' will be just the font name if a selection was made.
  396.     Notice, that the result is not necessarily an existing font. It is
  397. up to the user to ascertain that the result is suitable for his purposes. If
  398. the user hits "CANCEL", the 'result' is an empty string.
  399.     Notice that another way the result comes out to be empty is when the
  400. user leaves the requester hitting "OKAY" when both the font and size string
  401. gadgets are empty. In this case, though, the stem variable may still contain
  402. the last selected or default values for items other than the name and size.
  403.     If 'publicscreen' is specified, the function will try to find the screen
  404. of that name. If it is set up properly, the requester will open on that screen.
  405. If not, the requester will appear on the Workbench. Under AmigaDOS 2.0 (this
  406. function only works under AmigaDOS 2.0) a "public" screen of that name will be
  407. looked for and if this fails, screenshare.library is used, if it is in libs:.
  408.     This function requires the presence of diskfont.library in libs:.
  409.  
  410. Request
  411. =======
  412.  
  413.     Calling sequence:
  414.  
  415.     result = Request(x, y, prompts, string, okaytext, canceltext, publicscreen)
  416.  
  417.     x             = x coordinate of top-left corner of requester.
  418.     y             = y coordinate of top-left corner of requester.
  419.         prompts       = A string which will be displayed above any gadgets.
  420.                         Any embedded '\' characters will be treated as a line
  421.                         break.
  422.         string        = The default string to be displayed in a string gadget.
  423.                         If omitted, no string gadget will be provided.
  424.     okaytext      = The text to be used for an Okay gadget.
  425.                     If omitted, no okay gadget will be provided.
  426.     canceltext    = The text to be used for a Cancel gadget.
  427.                     If omitted, no cancel gadget will be provided.
  428.         publicscreen  = Name of a public screen (optional).
  429.  
  430.     All arguments are optional, but the order is fixed. Therefore if
  431. only the second or third argument is specified, it needs to be prefixed by
  432. sufficient commas.
  433.     If a string gadget is present, but no okay gadget, the string
  434. will be returned after modification by the user in result when the user
  435. hits <return>.
  436.     If both a string gadget and an okay gadget are present, the string
  437. will be returned in result only when the user clicks on the okay gadget.
  438.     If no string gadget is present, clicking of the okay gadget (if
  439. present) will cause the return in result of the string "OKAY".
  440.     In any case, if the user clicks either the cancel gadget or the
  441. close gadget, an empty string will be returned. Notice that another way the
  442. result comes out to be empty is when the user leaves the requester hitting
  443. "OKAY" when the string gadget is empty.
  444.     If 'publicscreen' is specified, the function will try to find the screen
  445. of that name. If it is set up properly, the requester will open on that
  446. screen. If not, the requester will appear on the Workbench. Under AmigaDOS
  447. 1.3, screenshare.library is used for this purpose. Under AmigaDOS 2.0
  448. a "public" screen of that name will be looked for and if this fails,
  449. screenshare.library is used, if it is in libs:.
  450.  
  451. PostMsg
  452. =======
  453.  
  454.     This function sets up a window with text. It returns immediately to
  455. the caller. Subsequent calls will erase lines and fill them with new text.
  456. If a line has zero length, the line will NOT be erased. This has the advantage
  457. that you can change the text in a line without redisplaying text in another
  458. line. It has the disadvantage that in order to erase lines, you have to
  459. specify at least a single space for each line you want to erase.
  460. The window will remain open, until a call is made with too few arguments.
  461. This is NOT a reentrant function: there is only one window pointer, and
  462. subsequent calls by ANY REXX process will affect the window.
  463.  
  464.     Calling sequence:
  465.  
  466.     result = PostMsg(x, y, strings, publicscreen)
  467.  
  468.     x             = x coordinate of top-left corner of requester.
  469.     y             = y coordinate of top-left corner of requester.
  470.         string        = A string which will be displayed above any gadgets.
  471.                         Any embedded '\' characters will be treated as a line
  472.                         break.
  473.     result        = 1 for success, 0 otherwise.
  474.         publicscreen  = Name of a public screen (optional).
  475.  
  476.     All arguments are optional, but the order is fixed. Therefore if
  477. only the second or third argument is specified, it needs to be prefixed by
  478. sufficient commas.
  479.     Examples:
  480.        Postmsg(50, 50, "This is line 1\This is line 2")
  481. will cause a window to appear with two lines of text. A subsequent call
  482.        Postmsg(50, 50, "\This is a new line 2")
  483. will cause the second line of the window to be replaced by the new text. The
  484. construct:
  485.        PostMsg(50, 50, " \")
  486. will erase the first line but leave the second one alone (notice the space).
  487.     If too few arguments are specified, this function will cause the
  488. window to be closed.
  489.     If 'publicscreen' is specified, the function will try to find the
  490. screen of that name. If it is set up properly, the requester will open on
  491. that screen. If not, the requester will appear on the Workbench. Under
  492. AmigaDOS 1.3, screenshare.library is used for this purpose. Under AmigaDOS
  493. 2.0 a "public" screen of that name will be looked for and if this fails,
  494. screenshare.library is used, if it is in libs:.
  495.  
  496. Getenv
  497. ======
  498.  
  499.     Calling sequence:
  500.  
  501.     result = Getenv(variable)
  502.  
  503.     variable   = Environment variable.
  504.         result     = The value of the environment variable.
  505.  
  506.     This function gets the value of an environment variable. If the
  507. variable does not exist, an empty string will be returned.
  508.  
  509. Setenv
  510. ======
  511.  
  512.     Calling sequence:
  513.  
  514.     result = Setenv(variable, valuestring)
  515.  
  516.     variable    = Environment variable.
  517.     valuestring = The new value for the environment variable.
  518.         result      = Always 1.
  519.  
  520.     This function (creates and) sets the environment variable to a
  521. a (new) value. If 'valuestring' is missing, the function will remove the
  522. environment variable.
  523.  
  524. ScreenToBack, ScreenToFront
  525. ===========================
  526.  
  527.     These functions depth arrange screens. If no argument is specified,
  528. the screen operated on is the Workbench screen. If the name of a public screen
  529. is specified, it will be affected.
  530.  
  531.     Calling sequence:
  532.  
  533.     result = screentoback(publicscreen)
  534.     result = screentofront(publicscreen)
  535.  
  536.         publicscreen  = Name of a public screen (optional).
  537.  
  538.     The argument is optional. If 'publicscreen' is specified, the
  539. function will try to find the screen of that name. If it is set up properly,
  540. the function will operate on that screen. If not, the function will operate on
  541. the Workbench. Under AmigaDOS 1.3, screenshare.library is used for this
  542. purpose. Under AmigaDOS 2.0 a "public" screen of that name will be looked for
  543. and if this fails, screenshare.library is used, if it is in libs:.
  544.  
  545. ScreenRows, ScreenCols, ScreenLace
  546. ==================================
  547.  
  548.     These functions retrieve info about screens. If no argument is
  549. specified, the screen operated on is the Workbench screen. If the name of
  550. a public screen is specified, it will be used.
  551.  
  552.     Calling sequences:
  553.  
  554.     result = ScreenRows(publicscreen)     /* return number of rows */
  555.     result = ScreenCols(publicscreen)     /* return number of columns */
  556.     result = ScreenLace(publicscreen)     /* return interlace */
  557.  
  558.         publicscreen  = Name of a public screen (optional)
  559.  
  560.     ScreenRows and ScreenCols retrieve the number of rows and columns in
  561. pixels. The function ScreenLace() returns 0 if the screen is not interlaced, and
  562. 1 if it is. The functions return -1 if the information could not be found, as is
  563. the case if the named public screen does not exist. Notice, that
  564. ScreenRows/Cols/Lace can be used to determine whether a public screen of a
  565. particular name exists.
  566.     The argument is optional. If 'publicscreen' is specified, the
  567. function will try to find the screen of that name. If it is set up properly,
  568. the function will operate on that screen. If not, the function will operate on
  569. the Workbench. Under AmigaDOS 1.3, screenshare.library is used for this
  570. purpose. Under AmigaDOS 2.0 a "public" screen of that name will be looked for
  571. and if this fails, screenshare.library is used, if it is in libs:.
  572.  
  573. ScreenColor
  574. ===========
  575.  
  576.     result = ScreenColor(publicscreen, n)          /* get color n     */
  577.  
  578.            or
  579.  
  580.         result = ScreenColor(publicscreen, n, R, G, B) /* get/set color n */
  581.  
  582.         publicscreen  = Name of a public screen.
  583.         n             = Number of color to retrieve/modify
  584.         R             = The amount of red in the new color   (0 - 15)
  585.         G             = The amount of green in the new color (0 - 15)
  586.         B             = The amount of blue in the new color  (0 - 15)
  587.  
  588.     ScreenColor retrieves the RGB values of the selected color in the
  589. format: <red><space><green><space><blue>, e.g:   15 0 0  for an all red
  590. screen. When the R G and B arguments are also given, the indicated color of
  591. the screen is modified to the new values. The *old* color values will be
  592. returned in result. ScreenColor only operates on public screens. The function
  593. will try to find the screen of that name. If it is set up properly, the
  594. function will operate on that screen. Under AmigaDOS 1.3, screenshare.library
  595. is used for this purpose. Under AmigaDOS 2.0 a "public" screen of that name
  596. will be looked for and if this fails, screenshare.library is used, if it is
  597. in libs:.
  598.  
  599. MoveScreen
  600. ==========
  601.  
  602.     result = MoveScreen(publicscreen, dx, dy)
  603.  
  604.         publicscreen  = Name of a public screen.
  605.         dx            = Amount to move it in X
  606.         dy            = Amount to move it in Y
  607.  
  608.         result        = 0 on failure. <xy> on success.
  609.  
  610.         MoveScreen moves an existing public screen by the specified amounts
  611. in x and y. Arguments that are left out are interpreted as 0. This function
  612. is of rather limited use in AmigaDOS 1.3: only movement in the y direction
  613. is supported, and negative values beyond the top of the screen are not allowed.
  614. If the function failed, 0 is returned, otherwise a string is returned with the
  615. actual position of the screen in the form <x> <space> <y>. Note that by leaving
  616. out both arguments, you will find the current position of the screen.
  617.     The function will try to find the screen of that name. If it is set
  618. up properly, the function will operate on that screen. Under AmigaDOS 1.3,
  619. screenshare.library is used for this purpose. Under AmigaDOS 2.0 a "public"
  620. screen of that name will be looked for and if this fails, screenshare.library
  621. is used, if it is in libs:.
  622.  
  623. OpenScreen, CloseScreen
  624. =======================
  625.  
  626.     These functions allow you to open public custom screens.
  627.  
  628.     Calling sequence:
  629.  
  630.     result = OpenScreen(topedge, depth, modes, defaulttitle, publicscreen,
  631.                             penlist, width, height, leftedge)
  632.     result = CloseScreen(publicscreen)
  633.  
  634.     topedge       = Y coordinate of top edge of the screen.
  635.     depth         = Number of bitplanes.
  636.     modes         = Viewmodes and type of screen. The currently supported
  637.                         viewmodes are "HIRES", "LACE", and "HAM". Currently
  638.                         supported types are "SCREENBEHIND", "TRUNCATE",
  639.                         "AUTOSCROLL" and "OVERSCAN".
  640.     defaulttitle  = Default title for the screen title bar.
  641.         publicscreen  = Name of the public screen
  642.         penlist       = String of the form <pen1><pen2>...<pen9>. Example:
  643.                         "121213102"   where:
  644.              |||||||||
  645.              ||||||||+-> HIGHLIGHTTEXTPEN special color text
  646.              |||||||+--> BACKGROUNDPEN    always color 0
  647.              ||||||+---> FILLTEXTPEN      text over FILLPEN
  648.              |||||+----> FILLPEN          active-window/selected-gadget fill
  649.              ||||+-----> SHADOWPEN        dark edge on 3D objects
  650.              |||+------> SHINEPEN         bright edge on 3D objects
  651.              ||+-------> TEXTPEN          text on background
  652.              |+--------> BLOCKPEN         Intuition block pen
  653.              +---------> DETAILPEN        Intuition detail pen
  654.         width         = Width of the screen
  655.         height        = Height of the screen
  656.         leftedge      = X-coordinate of left edge of the screen
  657.  
  658.     result        = 0 on failure, 1 on success.
  659.  
  660.     The screen name is required, therefore you must supply sufficient
  661. commas and a name for the public screen to be created/closed. With openscreen,
  662. leaving out any of the other arguments will cause defaults to be used. They are
  663. topedge = 0, depth = 2, modes = 0 (meaning LORES, no LACE), no default title,
  664. leftedge = 0, width and height the same as of the Workbench. This is equivalent
  665. to specifying 0 for all arguments (a depth of 0 is illegal and will be changed
  666. to 2). All created screens are CUSTOM screens under AmigaDOS 1.3 using
  667. "screenshare.library" and PUBLIC screens under AmigaDOS 2.0.
  668. The "TRUNCATE" screen type is not really an Intuition construct. It is only
  669. useful when "topedge" is non-zero: the screen will have the size of its visible
  670. portion at the time it is opened. Otherwise a full sized screen is opened,
  671. which is just displaced by "topedge". With rexxarplib version 2.8 and later,
  672. this option is really obsolete, since one can now specify the height of the
  673. screen.
  674.     ***NOTE: It is perfectly possible to apply closescreen() to another
  675. application's custom screen (if it is public, using the same conventions as
  676. used here). If you attempt this under AmigaDOS 1.3, a software failure is
  677. almost guaranteed. Only use closescreen() on screens you created using
  678. openscreen()!
  679.  
  680. ShowTitle
  681. =========
  682.  
  683.     This function shows or hides the title bar of a named public
  684. screen.
  685.  
  686.     Calling sequence:
  687.  
  688.     result = ShowTitle(publicscreen, yesno)
  689.  
  690.     publicscreen  = name of a publicscreen
  691.     yesno         = 0 or 1.
  692.  
  693.     If yesno is set to 1, the screen title of the named public screen
  694. will be shown, if set to 0, it will be hidden. The function will try to find
  695. the screen of that name. If it is set up properly, the function will operate
  696. on that screen. If not, the function will operate on the Workbench. Under
  697. AmigaDOS 1.3, screenshare.library is used for this purpose. Under AmigaDOS
  698. 2.0 a "public" screen of that name will be looked for and if this fails,
  699. screenshare.library is used, if it is in libs:. This function does not
  700. operate on the Workbench.
  701.  
  702.  
  703. FileList
  704. ========
  705.  
  706.     This function does ARP pattern matching. Given a pattern, it will
  707. return all files and/or directories matching the pattern.
  708.  
  709.     Calling sequence:
  710.  
  711.     number = FileList(pattern, stem, type, expand)
  712.  
  713.     pattern       = a search pattern using ARP wildcards.
  714.         stem          = the NAME of a stem variable to be created.
  715.         type          = D - directories only. F - files only.
  716.         expand        = E - expand full path name. N - remove path name
  717.                     not specified: don't expand, but don't remove either.
  718.  
  719.     number        = the number of files matching the pattern.
  720.  
  721.     When files with names matching the  pattern are found, a stem variable
  722. with the name given by 'stem' is created in the current Rexx context. It has
  723. fields 1, 2, ... , <number> containing the names of the files. The return value
  724. and also the stem variable's field 0 are equal to the number of files. The last
  725. two arguments are optional: with 'type', when an F is specified, only files are
  726. listed. When a D is specified only directories are listed. With 'expand', if an
  727. E is specified, the full path name is expanded. If an N is specified, any
  728. pathname part of the pattern will be removed. Example: a simple directory
  729. program looks like
  730.  
  731.     /* Directory program, list everything, with full path */
  732.     arg pattern
  733.     if pattern = "" then pattern = "*"
  734.     numfils = FileList(pattern, myfilelist, , E)
  735.     do i = 1 to numfils; say myfilelist.i; end
  736.     exit
  737.  
  738. CreateHost
  739. ==========
  740.  
  741.     This function allows you to create a single window with gadgets, menus,
  742. text, graphics, etc. Of course, multiple copies of the function may be started
  743. up to create more windows, but each must have a unique 'controlport'. This
  744. function should be started up asynchronously, using runwsh, and one should wait
  745. for the 'controlport' to appear using e.g. WaitForPort.
  746.  
  747.     Calling sequence:
  748.  
  749.     runwsh 'call CreateHost(controlport, notifyport, publicscreen)'
  750.  
  751.     controlport   = Name of the message port this window should listen to.
  752.     notifyport    = Name of the message port that should be notified when
  753.                         an IDCMP event occurs.
  754.         publicscreen  = Name of a public screen (optional).
  755.  
  756.     When the function is first called, it will open a message port with the
  757. name given by "controlport". The function will then wait for commands coming in
  758. through this port. This may be accomplished using one of many intuition
  759. functions, as explained later. One of the first commands should be to open the
  760. associated window by calling OpenWindow (see later). It will then open a window
  761. as specified in the OpenWindow call. If any message arrives through the IDCMP of
  762. this window, a REXX message will be sent to the port specified as "notifyport"
  763. which either you should set up in your rexx macro for this purpose, or should be
  764. an otherwise existing rexx message port belonging to another process. In the
  765. case you set up your own port, make sure the message is replied to after having
  766. been  retrieved and examined. If the  notifyport does not exist, no message will
  767. be sent. The window can be closed by the rexx macro by calling the function
  768. CloseWindow (see later). On startup, the notify port is the same for all classes
  769. of messages. This can be changed using the SetNotify() function, see later.
  770.     The last argument is optional. If 'publicscreen' is specified, the
  771. function will try to find the screen of that name. If it is set up properly,
  772. the window will open on that screen. If not, the window will open on
  773. the Workbench. Under AmigaDOS 1.3, screenshare.library is used for this
  774. purpose. Under AmigaDOS 2.0 a "public" screen of that name will be looked for
  775. and if this fails, screenshare.library is used, if it is in libs:.
  776.  
  777. Supported Intuition (and other) functions with createhost
  778. =========================================================
  779.  
  780.     The following functions are implemented as CreateHost functions. The
  781. first argument is always the name of the control port of the host that is
  782. supposed to execute the command. A little secret: you can send commands
  783. *directly* to the controlport also by constructs like "Address controlport
  784. commandname". However, this only works for commands without further arguments.
  785. For example, from WShell, "address controlport CloseWindow" is equivalent to
  786. "call CloseWindow(controlport)". This can come in incredibly handy at times.
  787. For example, when you want command hosts to send message to themselves: you
  788. can tell a host to send IDCMP events of class CLOSEWINDOW to itself...
  789. Boggles the mind yet? Read on...
  790.  
  791.    call ActivateGadget(controlport, gadgetid)
  792.         Tries to activate a string gadget with id 'gadgetid'.
  793.  
  794.    call ActivateWindow(controlport)
  795.  
  796.    call AreaCircle(controlport, xcenter, ycenter, radius)
  797.  
  798.    call AreaDraw(controlport, x, y)
  799.  
  800.    call AreaEllipse(controlport, xcenter, ycenter, radius1, radius2)
  801.  
  802.    call AreaEnd(controlport, pen)
  803.         The "pen" argument is optional, and overrides the default, which is
  804.         that the area fill should be done using the current A pen (set with
  805.         SetAPen()). Pen values less than 256 have the usual meaning. Pen
  806.         values of 256 + i, where i = 0 through 15, cause the fill to be
  807.         performed using one of 16 standard fill patterns. Pen values of
  808.     512 + i, where i = 0 through 124, cause the fill to be performed
  809.     using one of 125 dithering patterns. The dithering patterns use pens
  810.     0 through 7. If these pens are set to black, white, red, green, blue,
  811.     cyan, magenta and yellow respectively, then the dithering patterns
  812.     form 125 different colors. To calculate a particular color index for
  813.         use as "pen", take the color's R G and B values, where R, G and B
  814.         are 0, 1, 2, 3 or 4,  and use:
  815.  
  816.         pen = R * 25 + G * 5 + B
  817.  
  818.         For example, full white would be (R = 4, G = 4, B = 4) and pen = 124.
  819.     A bluish grey would be (2, 2, 3), pen = 63.
  820.     Adding 1024 to the pen number causes AreaEnd to have no effect at all.
  821.     Adding 2048 to the pen number will cause the fill to have an outline
  822.     with the outline pen being the current A pen.
  823.     The SetOPen function no longer affects Area draws as of this revision.
  824.         Bug: For some reason, area circles and ellipses don't seem to get
  825.         outlines when requested.
  826.  
  827.    call AreaMove(controlport, x, y)
  828.  
  829.    call AddGadget(controlport, x, y, gadgetid, gadgettext, messagetext,
  830.                   hsize, flags)
  831.         If hsize is specified, this call creates a string gadget of that
  832.         horizontal size and gadgettext is the default string. If hsize is
  833.         not specified, this call creates an autosizing boolean gadget, where
  834.         the text in gadgettext is displayed. In both cases, the string in
  835.         messagetext is sent to controlport (see also under OpenWindow). As
  836.         usual, the gadgettext for boolean gadgets may contain \ characters
  837.         to cause multiple lines of text (See e.g. PostMsg()). Under 2.0,
  838.         a flag can be specified for string gadgets: RIDGEBORDER. This will
  839.         cause the gadget to be displayed in the "2.0" style. Since this style
  840.         of gadget is a little different in size and location than non-ridge
  841.         border gadgets, the default is the usual gadget border under 1.3 and
  842.         a "recessed" gagdet under 2.0.
  843.  
  844.    call AddItem(controlport, itemname, message, commandchar, mutualexclude, flag)
  845.         Add a new item with name 'itemname'. Optionally, you may specify a
  846.         command key abbreviation (right-Amiga 'commandchar') and a mutual exclude
  847.         mask. See Intuition manual. A special value of the mutual exclude mask
  848.         is -1: this means that the item will be toggle selectable. If the flag
  849.         argument is "SAMELINE", the item will be on the same line as the previous
  850.         item, otherwise, or if the argument is not present, it will be on the
  851.         next line.
  852.         See also AddMenu(), AddSubItem(), RemoveMenu(), SetItem().
  853.  
  854.    call AddMenu(controlport, menuname)
  855.         Add a new menu with name 'menuname'. See also AddItem(), AddSubItem(),
  856.         RemoveMenu(), SetItem().
  857.  
  858.    call AddSubItem(controlport,itemname,message,commandchar,mutualexclude,flag)
  859.         Add a new subitem with name 'itemname'. Optionally, you may specify a
  860.         command key abbreviation (right-Amiga 'commandchar') and a mutual exclude
  861.         mask. See Intuition manual. A special value of the mutual exclude mask
  862.         is -1: this means that the item will be toggle selectable. If the flag
  863.         argument is "SAMELINE", the item will be on the same line as the previous
  864.         item, otherwise, or if the argument is not present, it will be on the
  865.         next line.
  866.         See also AddMenu(), AddItem(), RemoveMenu(), SetItem().
  867.  
  868.    call BackFill(controlport)
  869.         This is not an intuition function. See OpenWindow().
  870.  
  871.    call CloseWindow(controlport, flag)
  872.         This function closes the window and deallocates all resources. The 'flag'
  873.         argument is optional. If present, and if the flag is equal to "CONTINUE",
  874.         the host will remain active. Otherwise, the host will exit.
  875.  
  876.    call Draw(controlport, x, y)
  877.  
  878.    call DrawCircle(controlport, xcenter, ycenter, radius)
  879.  
  880.    call DrawEllipse(controlport, xcenter, ycenter, radius1, radius2)
  881.  
  882.    call Exit(controlport)
  883.         This function closes the window, deallocates all resources and causes
  884.         the host to exit. Exit(), Quit() and Stop() are identical.
  885.  
  886.    call Flood(controlport, mode, x, y)
  887.         If mode is 0, the flood continues until pixels of the outline pen
  888.         color are found. If the mode is 1, the flood continues until pixels
  889.         of a different color than the pixel at x, y are found.
  890.  
  891.    call RemoveMenu(controlport)
  892.         Gets rid of any attached menu.
  893.  
  894.    call IFFImage(controlport, filename, x, y, width, height, flag)
  895.         Displays a chunk of size 'width', 'height' of an IFF ILBM file named
  896.         'filename' at x, y in the window. If x, y, width, and/or height are
  897.         omitted, suitable defaults are chosen. The colormap of the IFF file,
  898.         if any, is NOT used on the Workbench, but IS used on custom screens.
  899.         The 'flag' option can be set to 'NOCOLOR' (N is sufficient) to prevent
  900.         modifying the custom screen's colors.
  901.  
  902.    call ModifyHost(controlport, IDCMPclass, messagestring)
  903.         This function allows you to set the message string that is sent to
  904.         the notifyport for a particular class of IDCMP events. See OpenWindow.
  905.  
  906.    call Move(controlport, x, y)
  907.  
  908.    call OpenWindow(controlport, leftedge, topedge, width, height,
  909.                                 idcmp, flags, title)
  910.         width and height may be set to 0 to get the maximum size of the window.
  911.         idcmp is a string that specifies the IDCMP for the window. Supported are:
  912.  
  913.            IDCMP message    |  default arg[0]
  914.         --------------------+-------------------
  915.           "CLOSEWINDOW"     |  "%l"
  916.           "MOUSEBUTTONS"    |  "%l"
  917.           "GADGETUP"        |  <its string>
  918.           "GADGETDOWN"      |  <its string>
  919.           "MENUPICK"        |  "%l"
  920.           "NEWSIZE"         |  "%l"
  921.           "VANILLAKEY"      |  "%l"
  922.           "RAWKEY"          |  "%l"
  923.           "NEWPREFS"        |  "%l"
  924.           "DISKINSERTED"    |  "%l"
  925.           "DISKREMOVED"     |  "%l"
  926.           "ACTIVEWINDOW"    |  "%l"
  927.           "INACTIVEWINDOW"  |  "%l"
  928.           "REFRESHWINDOW"   |  "%l"
  929.           "MOUSEMOVE"       |  "%l"
  930.           "DELTAMOVE"       |  "%l"
  931.  
  932.         Any number of these may be specified in the OpenWindow call, by conca-
  933.         tenation. When any of these messages arrives at the IDCMP, a REXX
  934.         message is created with a particular string in Arg[0]. This string is
  935.         by default the one given in the table above, after substitution has
  936.         taken place for any two-character sequence starting with '%'.
  937.         The following substitutions will be made:
  938.  
  939.         Sequence: | Typical Use: |     Meaning:
  940.         ----------+--------------+---------------
  941.             %%    |              | A single % sign
  942.             %a    | Vanillakeys  | 'Code' is interpreted as an ASCII character.
  943.             %b    | Buttons      | SELECTDOWN, SELECTUP, MENUDOWN, MENUUP.
  944.             %c    |              | 'Code' is given as an integer.
  945.             %d    | Gadgets      | the gadget id.
  946.             %e    | Window       | the TopEdge of the window
  947.             %f    | Window       | the LeftEdge of the window
  948.             %g    | Gadgets      | the string inside a string gadget goes here.
  949.             %h    | Newsize      | the window height.
  950.             %i    | Menus        | the item number.
  951.             %l    | Any          | the name of the IDCMP class.
  952.             %m    | Menus        | the menu number.
  953.             %q    |              | 'Qualifier' is given as an integer.
  954.             %s    | Menus        | the sub-item number.
  955.             %t    | Time         | the number of seconds since January 1 1980.
  956.             %w    | Newsize      | the window width.
  957.             %x    | Mouse        | the X position of the mouse pointer.
  958.             %y    | Mouse        | the Y position of the mouse pointer.
  959.           %0-%15  |              | which Arg to use.
  960.  
  961.         For example, if the message string of some gadget is
  962.  
  963.             "Mouse is %x, %y%3gadget string is %g"
  964.  
  965.         the following might be sent to the notifyport in Arg[0] when someone
  966.         hits return in that gadget, after typing "This is a test":
  967.  
  968.             Mouse is 320, 200
  969.  
  970.         while Arg[3] of the Rexx message would contain the string:
  971.  
  972.             gadget string is This is a test
  973.  
  974.         The default string for non-gadgets/menus is "%l", which means that they
  975.         only report their name. For example, if one would click in the window,
  976.         one would only receive a message with "MOUSEBUTTONS" in Arg[0]. However,
  977.         all arguments of the message that will be sent to the notifyport may be
  978.         changed using the ModifyHost() call, see there. Any of the escape
  979.         sequences above may be used in any string. Obviously, sometimes
  980.         particular sequences may not be very appropriate for certain uses.
  981.  
  982.         'flags' specifies the various window flags. Currently supported are:
  983.         "WINDOWCLOSE", "WINDOWSIZING" (and "SIZEBRIGHT", "SIZEBBOTTOM"),
  984.         "WINDOWDEPTH", "WINDOWDRAG", "BORDERLESS", "ACTIVATE", "BACKDROP" and
  985.         "NOCAREREFRESH".   A special flag can be set: "BACKFILL". It implies
  986.         a call to BackFill() after opening the window. It sets the window's
  987.         background to the current requester-style background color.
  988.  
  989.    call Quit(controlport)
  990.         This function closes the window, deallocates all resources and causes
  991.         the host to exit. Exit(), Quit() and Stop() are identical.
  992.  
  993.    call ReadGadget(controlport, gadgetid)
  994.         This function will cause the gadget 'gadgetid' to send its message
  995.         text (after substitutions, of course).
  996.  
  997.    call ReadHost(controlport, notifyport, messagetext)
  998.         This function will cause the message text (after substitutions, of
  999.         course) to be sent to the notifyport.
  1000.  
  1001.    call RectFill(controlport, xmin, ymin, xmax, ymax)
  1002.  
  1003.    call RefreshGadgets(controlport)
  1004.  
  1005.    call RemoveGadget(controlport, gadgetid)
  1006.  
  1007.    call SetAPen(controlport, pennumber)
  1008.  
  1009.    call SetBPen(controlport, pennumber)
  1010.  
  1011.    call SetDrMd(controlport, mode)
  1012.         mode can be any of JAM1, JAM2, INVERSVID or COMPLEMENT.
  1013.  
  1014.    call SetDrPt(controlport, pattern)
  1015.         pattern is interpreted as a long integer of which the bits form the
  1016.         pattern.
  1017.  
  1018.    call SetFont(controlport, FontName, FontSize, FontStyle, FontFlags, XSize)
  1019.         Change the font to the one specified. If the font doesn't exist or
  1020.         doesn't exist in the specified FontSize, the function does
  1021.         nothing. If the font does exist, the closest match FontStyle and
  1022.         FontFlags font is returned that is currently in memory or if it is
  1023.         not in memory, that is currently in fonts:. If XSize is specified,
  1024.         the font will be rejected also if the horizontal size doesn't match.
  1025.         FontStyle bits:
  1026.  
  1027.               none = Normal
  1028.               1    = Underlined
  1029.               2    = Bold
  1030.               4    = Italic
  1031.               8    = Extended face (wider than normal)
  1032.               64   = Color font
  1033.  
  1034.         Note that the function calls SetSoftStyle() internally to fake any
  1035.         of the attributes if the closest font doesn't match the requirements.
  1036.         FontFlag bits:
  1037.  
  1038.               1    = Font is in ROM
  1039.               2    = Font is from diskfont.library
  1040.               4    = Font is reverse path (left to right)
  1041.               8    = designed for hires non-interlaced
  1042.               16   = designed for lores interlaced
  1043.               32   = Font is proportional
  1044.               64   = Font is designed
  1045.  
  1046.         This function requires that diskfont.library is present in libs:.
  1047.  
  1048.    call SetGadget(controlport, gadgetid, action)
  1049.         Given a gadget id, perform action on the gadget. Supported are ON and
  1050.         OFF, to set or clear the highlighting state of the gadget.
  1051.  
  1052.    call SetItem(controlport, menunumber, itemnuber, subitemnumber, action)
  1053.         Given menu, item (and optionally subitem) numbers, perform action on
  1054.         the menu item. Supported are ON and OFF, to set or clear the check mark.
  1055.         Remember that menu, item and subitem numbers start from 0.
  1056.  
  1057.    call SetNotify(controlport, IDCMPclass, newnotifyport)
  1058.         This function allows you to change the name of the NotifyPort that
  1059.         message strings are sent to for a particular class of IDCMP events.
  1060.  
  1061.    call SetReqColor(controlport, pentype, colornumber)
  1062.         This function allows you to change the color number assigned to
  1063.         one of the various pentypes. Currently the pentypes are: BLOCKPEN,
  1064.         DETAILPEN, BACKGROUNDPEN, PROMPTPEN, BOXPEN, SHADOWPEN, OKAYPEN,
  1065.         and CANCELPEN.
  1066.  
  1067.    call SetOPen(controlport, pennumber)
  1068.         SetOpen is mostly obsolete, see AreaEnd().
  1069.  
  1070.    call SetRGB4(controlport, pennumber, red, green, blue)
  1071.         red, green and blue are values for the RGB content of the color to be
  1072.         assigned to the pen. The values are taken mod 16.
  1073.  
  1074.    call Stop(controlport)
  1075.         This function closes the window, deallocates all resources and causes
  1076.         the host to exit. Exit(), Quit() and Stop() are identical.
  1077.  
  1078.    call Text(controlport, string)
  1079.  
  1080.    call WindowText(controlport, text)
  1081.         The string in text may contain \'s to indicate multiple lines of text.
  1082.  
  1083.    call WindowToBack(controlport)
  1084.  
  1085.    call WindowToFront(controlport)
  1086.  
  1087.    call WritePixel(controlport, x, y)
  1088.  
  1089.  
  1090.  
  1091.  
  1092.