
     First off, a couple of misc functions we mentioned...

     WORD Dgetdrv(VOID)

     This function returns the current GEMDOS drive code. A: is represented
     by returning 0,  B: by returning 1 and so on


     LONG Dgetpatgh(buf,drv)
     char *buf;
     WORD drv;

     This function gets the current  path.  Buf  is  pointer to the current
     path string on exit. You  put  the  number  for  the drive you want to
     examine in drv.

     This function can return the following values

     E_OK    (0)     Operation succesful
     EDRIVE  (-49)   Invalid drive specification

     Note there is no  way  to  decide  the  length  of  buf necessary. For
     safeties sake, you should allow at least 200 bytes.


     THE ALERT BOX FUNCTION

     WORD form_alert(default,alertstring)
     WORD default;
     CHAR *alertstring;

     Displays an alert box on the  screen.  Default holds the number of the
     button which is set to activate if return is pressed. Alertstring is a
     string of the format..

     [#][Alert text][Buttons]

     # defines the form of the icon shown in the box

             0       None
             1       Diamond with exclamation mark
             2       Upside down triangle with question mark
             3       Octagon with STOP in it

     The alert text is a set  of  text  lines  using | as a carriage return
     with up to 5 lines of up to 40 characters.

     Button text is the text contained in each of the up to 3 buttons, with
     up to 10 chracters in each. These again are separated by '|' symbols.


     THE FILE SELECTOR FUNCTIONS

     WORD fsel_input(path, file, buttons)
     CHAR *path, *file;
     WORD *button;

     Displays the standard GEM file  selector. 'path' contains the starting
     file path.  'file'  contains  a  wildcard  to  use  initially  for the
     filename. 'button' will contain either 0  on exit if the user selected
     cancel, or 1 if 'OK'. After  returning,  'file' and 'path' contain the
     information entered by the user. This function returns a 0 if an error
     occurred or a 1 otherwise.

     WORD fsel_exinput((path, file, buttons)
     CHAR *path, *file;
     WORD *button;
     CHAR *title;

     This displays the extended file  selector. The only difference between
     this and the standard file selector is that the text pointed to by the
     string 'title' is displayed within the file selector when it is shown.

     RESOURCE FUNCTIONS

     WORD rsrc_load(filename)
     CHAR *filename

     Loads a  resource  file  from  the  file  'filename'  into  memory and
     converts all character- based  coordinates  in  the resource file into
     screen coordinates. Returns 0 if successful or non-zero if not.

     WORD rsrc_gaddr(type, index, address)
     WORD type, index;
     VOIDPP address;

     This function puts the address of an  object in address. The object is
     of type as follows..

             type value      Look for
             0 (R_TREE)      Object tree
             1 (R_OBJECT)    Individual object
             2 (R_TEDINFO)   TEDINFO structure
             3 (R_ICONBLK)   ICONBLK structure
             4 (R_BITBLK)    BITBLK structure
             5 (R_STRING)    String data
             6 (R_IMAGEDATA) Free Image data
             7 (R_OBSPEC)    ob_spec field within OBJECTs
             8 (R_TEPTEXT)   te_ptext field within a TEDINFO
             9 (R_TEPTMPLT)  te_pmtplt field within a TEDINFO
            10 (R_TEPVALID)  te_pvalid field within a TEDINFO
            11 (R_IBPMASK)   ib_pmask field within an ICONBLK
            12 (R_IBPDATA)   ib_pdata field within an ICONBLK
            13 (R_IBPTEXT)   ib_ptext field within an ICONBLK
            14 (R_BIPDATA)   bi_pdata within a BITBLK
            15 (R_FRSTR)     Free string
            16 (R_FRIMG)     Free image

     and the address placed in address  is  the object found after counting
     'index' objects of that type.


     WORD form_center(tree,x,y,w,h)
     OBJECT *tree;
     WORD *x,*y,*w,*h;

     Form_center modifies the coordinate values of objects within a tree so
     it will appear in the centre  of  the  screen. *tree points to a valid
     OBJECT structure, and on  return  x,y,w  and  h  contain the necessary
     clipping rectangle for when the  object  is  drawn. Note it is usually
     used on the root object of a  tree, since all child object coordinates
     are defined relative to the root object's position.
     Always returns 1.

     WORD form_dial(mode, x1,y1,w1,h1,x2,y2,w2,h2)
     WORD mode, x1,y1,w1,h1,x2,y2,w2,h2;

     Controls the process of drawing a dialog  on the screen. The values of
     its parameters depend on the value of the mode parameter..

     mode    Name         Function
     0       FMD_START    reserves the screen space defined by the x2-h2
                          rectangle for drawing on the screen. These
                          coordinates are usually obtained via
                          form_center().

     1       FMD_GROW     draws an expanding grow box from the rectangle
                          x1-h1 to x2-h2. This call is optional.

     2       FMD_SHRINK   draws a contracting shrink box from x2-h2 to
                          x1-h1. Again this call is optional.

     3       FMD_FINISH   releases the screen space defined in x2-h2 back
                          to the AES. This sends a wind_redraw mesage to
                          all windows wholly or partially within this area.

     This function returns 0 if sucessful,  non-zero  if not. Note that the
     AES currently takes no notice of a  FMD_START mode call, but to ensure
     future compatability it should be used anyway.

     WORD obc_draw(tree, obj, depth, x,y,w,h)
     WORD obj,depth,x,y,w,h;
     OBJECT *tree;

     This function actually displays the  dialog  on  the screen, ready for
     use by form_dial(). *tree specifies  the  tree  to draw, obj specifies
     the object at which to start  drawing, and depth specifies the 'layer'
     to draw to. The maximum value for depth is 7.

     x,y,w and h define an AES clipping rectangle to limit drawing within.
     Returns 0 if successful, non-zero if not.


     WORD form_do(tree,editobj)
     OBJECT *tree;
     WORD editobj;

     *tree points to a valid resource tree. editobj points to the editable
     object which the cursor  will  begin  in.  If  no  such object exists,
     editobj should be zero.

     NOTE: All resource trees  MUST  have  an  object  with  either EXIT or
     TOUCHEXIT properties. The function  handles  all  interaction with the
     user until an object  with  EXIT  or  TOUCHEXIT  is selected, at which
     point it quits and returns the  number  of  that object. If the object
     was double clicked, bit 15 of the  return  word  will be set, so to be
     certain of getting the  right value  back,  the return value should be
     masked against 0x7FFF.
