File Requester v1.2
-------------------
written by Anson Mah, with additions by Kris Hatelid

==========================================================================
   This  program has  been  placed in the public domain,  and is freely
   distributable, but must be accompanied by this document.  Permission
   from the author(s)  is required if there is a desire to use the code
   for commercial puposes.
==========================================================================


This file requester is finally in a distributable state.  It was designed
to be flexible, complex, and yet easy to use and install.  Here is a list
of features (or bugs, as the case may be) :

*	Directory, filename, and file name extension string gadgets

*	(Relatively) fast scrolling of filenames via a scroll or arrow
	gadgets

*	Simple selection between devices via the device gadgets (only
	those devices available will be shown)

*	Selection of file can be made by clicking once and then the
	OK gadget or by double clicking on the file name

*	Application definable requester title, OK gadget text, default
	search path, extensions, and mouse pointer images (for application
	pointer and filename retrieval wait pointer images)

*	If an extension is present, and an extension is not specified in
	the filename gadget, it is added to the name entered

*	Returns to the application a C character pointer (char * or
	UBYTE *)

*	Compiles under Lattice C Version 3.10 and 3.03
*	Will need minor work to use with Aztec C

*	Directories displayed in color different than filenames

*	Directories and filenames displayed in case-insensitive
	alphabetical order

*	If using 1.2, filename string gadget is activated upon the call to
	FileRequest().  Delete the call in FileRequest() to ActivateGadget()
	if (still) using 1.1.

*	Will allow for operation if any dos errors are encountered

*	Lattice object size approximately 14K (only ugly feature)

*	Can be stripped to provide the mininal of file requester needs



Application Notes
-----------------

The requester can be displayed in 2 different widths, 320 pixels or
640 pixels.  Only one of these can be used, as it is a preprocessor
directive that governs the size.  Adjust the LARGE definition (at
beginning of the code) to 1 for 640 pixels, 0 for 320 pixels. The
requester will adjust itself accordingly.

The object file provided has been compiled with LARGE = 0 (for small,
more attractive size <he he, Kris>) and Lattice 3.10.  Just change
the definitions and recompile for other configurations.

To send the requester mouse pointer image definitions, please include
the file FileRequest.h in the application.  See NOTES below for a
description of what is required.

The following is a copy of the documentation internal to the file
requester code (FileRequest.c):


NAME
	FileRequest - request a file selection

SYNOPSIS
	string = FileRequest(screen, title, x, y, path, name, okname,
		extension, general_pointer, wait_pointer);

	UBYTE	*string;
	UBYTE	*FileRequest();
	struct Screen *screen;
	UBYTE	*title;
	UWORD	x, y;
	UBYTE	*path;
	UBYTE	*name;
	UBYTE	*okname;
	UBYTE	*extension;
	struct FRPointer *general_pointer;
	struct FRPointer *wait_pointer;

FUNCTION
	This function allows an application program to receive from
	the user a directory file selection.  File selection is made
	quite intuitively through the use of gadgets and mouse
	selections.

INPUTS
	screen = a pointer to the screen in which the file request
		window will appear;  NULL if WORKBENCHSCREEN
	title = pointer to the null-terminated string which the file
		request window will display;  the default is
		"File Requester"
	x, y = x and y coordinates of the top left corner of the file
		request window;  beware:  the width of the window is
		320 pixels and the height 180 pixels
	path = pointer to the null-terminated default directory path
		specification;  e.g. "df0:devs/printers", "ram:";
		if NULL, then defaults to the current directory

	name =	pointer to the null-terminated default filename;
		e.g. "filename","untitled",etc.
		if NULL, then no filename.

	okname = pointer to the null-terminated name for the "ok" gadget.
		e.g. "LOAD","SAVE","DELETE",etc.
		if NULL, then defaults to OK.

	extension = pointer to an extension.  e.g. "c","info",etc.
		only files with that extension & directories will
		be displayed.  If pattern = "" or NULL, all files
		are displayed.
	general_pointer = pointer to a FRPointer structure, which contains
		the data for the general use mouse pointer. NULL if use
		intuition default pointer.  See below for a description
		of the FRPointer structure.
	wait_pointer = pointer to a FRPointer stucture, which contains
		the data for a wait state mouse pointer. NULL if use
		general_pointer or standard pointer.  See below for a
		description of the FRPointer structure.


RESULT
	pointer (UBYTE *) to a null-terminated string containing the
		full path name of the selected file
	NULL if an error has occured or no file selection was made

NOTES
	Include the file FileRequest.h if you wish to define your own
	pointers for the file request use.  It might be a good idea to
	have at least a wait pointer, to let the user know that the
	program is busy.

	The FRPointer structure is as follows:

	struct FRPointer {
		UWORD *Pointer;
		WORD Height;
		WORD Width;
		WORD XOffset;
		WORD YOffset;
	};
	
	where	Pointer = pointer to the data definition of a Sprite
		Height = height of the pointer in pixels
		Width = width of the pointer
		XOffset = x offset of the sprite from the pointer "hot-spot"
		YOffset = y offset of the sprite from the pointer "hot-spot"

BUGS
	none (hopefully)



For comments (or monetary contributions :-), I (as well as Kris Hatlelid)
can be reached at the addresses below.  I hope the requester is useful!


Anson Mah
2735 E. 2nd Ave.
Vancouver, B.C.
V5M 1E2  Canada
(604) 254-6849

uucp:      ...!ihnp4!alberta!ubc-vision!bdc!mah    (or bdcvax, perhaps)
mailnet:   Anson_Mah@UBC-G.mailnet
           AMah@UNCA-MULTICS.mailnet

CIS, Bix, Source:  not enough $$ to participate

-----------------------
Last minute idea:  it might be advantageous to actually send the file
buffers to the requester as a parameter.  This will need a bit of work,
and will most likely not be done by me (us).
