(show_error.c)		
----------------------------------------------------------------------------
NAME

SYNOPSIS
	
	void show_error(err)
	int err;
FUNCTION
      given a standard studio16 error code, this calls telluser()
      with a description of the error
INPUTS
      error code as defined in studio16.h
RESULTS
   NONE
----------------------------------------------------------------------------
(window.c)		CloseWind
----------------------------------------------------------------------------
NAME
	CloseWind -
SYNOPSIS
	struct window *CloseWind(wind)
	struct Window *wind;
FUNCTION
	This function closes a window, frees the title bar gadget and frees
	 any memory used while opening the window.
INPUTS
	wind - a pointer to the window structer of the window to close.
RESULTS
	NONE
----------------------------------------------------------------------------
(window.c)		ColorGadList
----------------------------------------------------------------------------
NAME
	ColorGadList -
SYNOPSIS
	void ColorGadList(ngh)		/* CHANGE GADGET COLORS */
	struct NewGadgetHeader *ngh;
FUNCTION
	To set the colors used to render a chain of gadgets to the 
	StudioBase->defaults.colors. Since this module requires the
	Studio library and uses gadlibrary structures it should not
	be implimented in either library.
INPUTS
	ngh - Pointer to a chain of NewGadgetHeader structures
RESULTS
	NONE
----------------------------------------------------------------------------
(window.c)		FindFileName
----------------------------------------------------------------------------
NAME
	FindFileName -
SYNOPSIS
	char *FindFileName(name)
	char *name;
FUNCTION
	This function parces the string returned by the _main(cmdline)
	funtion and derives the file name used to run the new module. If you
	choose to use this function, the name that appears in the instance
	list will always match the name in the ModList.
INPUTS
	name - a pointer to the command line used to launch the new module
		void _main(name)
RESULTS
	char pointer into the same input string, offset to remove any path
	used to launch the module.
----------------------------------------------------------------------------
(menu.c)		FUNCTION
----------------------------------------------------------------------------
NAME
FUNCTION
SYNOPSIS
	struct MenuItem *BuildChannelMenu(search,flags)
	int search,flags;
	Builds a linked list of MenuItems each containing a chankey
	the list may be built for specific needs by using the search
	parameter. For Instance if search=CK_CHAN_HILO|CH_CHAN_PLAY,
	a list of play channels that could display HILO info would
	be built.
	The other parameter 'flags' it used to determine what kind
	of menu you wish, if NULL a single select list is created
	if MENU_MULTI_SELECT multiple items may be selected
INPUTS
	search - ChanKey flags that describe the type of channels
		you want
	flags - internal use flags used to build different types
		of menus.
RESULTS
	(struct MenuItem *) of the first item of the menu.
----------------------------------------------------------------------------
(menu.c)		FUNCTION
----------------------------------------------------------------------------
NAME
FUNCTION
SYNOPSIS
	void FreeChannelMenu(MenuI)
	struct MenuItem *MenuI;
	Undos all memory allocation of BuildChannelMenu
INPUTS
	(struct MenuItem *) of the first item of a menu
RESULTS
	NONE
----------------------------------------------------------------------------
(menu.c)		FUNCTION
----------------------------------------------------------------------------
NAME
FUNCTION
SYNOPSIS
	int MenuCheckSum(FirstMI)
	struct MenuItem *FirstMI;
	Returns a checksum for a menu. This is useful for 
	determining whether a new handler has been added
	to the system
INPUTS
	(struct MenuItem *) to the first MenuItem of the list
RESULTS
	(int) check sum number
----------------------------------------------------------------------------
(menu.c)		FUNCTION
----------------------------------------------------------------------------
NAME
FUNCTION
SYNOPSIS
	struct MenuItem *FindCheckedItem(MenuI)
	struct MenuItem *MenuI;
	Finds the next occurance of a checked item;
	to find all checked items;

	t=0;
	mi=Titles.FirstItem;
	while ((mi=FindCheckedItem(mi)))
		{
		Chan[t]=ItemChan(mi);
		t++;
		mi=mi->NextItem;
		}
	NumOfItemsChecked=t;

INPUTS
	struct MenuItem *
RESULTS
	(struct MenuItem *) if an item was checked or NULL
----------------------------------------------------------------------------
(menu.c)		FUNCTION
----------------------------------------------------------------------------
NAME
FUNCTION
SYNOPSIS
	int *ItemData(MenuI)
	struct MenuItem *MenuI;
	Returns the Data for a particular MenuItem
INPUTS
	(struct MenuItem *) of the item that you want the Data
RESULTS
	(int *) of the data of the menu item or NULL
----------------------------------------------------------------------------
(menu.c)		FUNCTION
----------------------------------------------------------------------------
NAME
FUNCTION
SYNOPSIS
	int ItemNum(MenuI)
	struct MenuItem *MenuI;
	Return the Item number for the MenuItem Passed,
	this number should not be used as a discrete value
	since it changes as handlers are added/deleted from a
	system. Its primary use is for saving checked items
	in ModStates
INPUTS
	(struct MenuItem *) 
RESULTS
	(int) menu item number;
----------------------------------------------------------------------------
(menu.c)		FUNCTION
----------------------------------------------------------------------------
NAME
FUNCTION
SYNOPSIS
	int *CheckItem(MenuI)
	struct MenuItem *MenuI;
	Sets the CHECKED flag for the partcular menu item
	(same as MenuI|=CHECKED;
INPUTS
	(struct MenuItem *) of the MenuItem to check
RESULTS
	(int *) of the data of the MenuItem or NULL
----------------------------------------------------------------------------
(menu.c)		FUNCTION
----------------------------------------------------------------------------
NAME
FUNCTION
SYNOPSIS
	int *CheckNum(MenuI,num)
	struct MenuItem *MenuI;
	int num;
	Checks the num MenuItem, This function is used with
	the function ItemNum()
INPUTS
	First MenuItem and Int.
RESULTS
	(int *) of the Data of the MenuItem or NULL if not found
----------------------------------------------------------------------------
(menu.c)		FUNCTION
----------------------------------------------------------------------------
NAME
FUNCTION
SYNOPSIS
	int *CheckData(MenuI,Data)
	struct MenuItem *MenuI;
	int *Data;
	Checks the item number of the menu with this particular
	Data.
INPUTS
	FirstMenuItem and a (int *) Data
RESULTS
	(int *) of the Data of the MenuItem or NULL if not found
----------------------------------------------------------------------------
(menu.c)		FUNCTION
----------------------------------------------------------------------------
NAME
FUNCTION
SYNOPSIS
	void S16Text(rport,text,len,x,y)
	struct RastPort *rport;
	char *text;
	short len,x,y;
	Alternative to Move() SetDrMd() SetAPen Text() sequence
INPUTS
	*rport - of where to draw text
	*text - the text to be rendered
	len - length of string or NULL for whole string
RESULTS
	NONE
----------------------------------------------------------------------------
(menu.c)		FUNCTION
----------------------------------------------------------------------------
NAME
FUNCTION
SYNOPSIS
	void MakeMenuesFit(menu)
	struct Menu *menu;
	Thes function makes sure a Menu will not overwrap accross
	the edge of a screen, this function is called automatically
	when you open a window with OpenNewWind() with a menu pointer.
	Use this function if you decide to change the menus while
	a window is open.
INPUTS
RESULTS
----------------------------------------------------------------------------
(menu.c)		FUNCTION
----------------------------------------------------------------------------
NAME
FUNCTION
SYNOPSIS
	struct MenuItem *BuildHandlerMenu(search,flags)
	int search,flags;
	Builds a linked list of MenuItems each containing a Data
	the list may be built for specific needs by using the search
	parameter. For Instance if search=CK_CHAN_HILO|CH_CHAN_PLAY,
	a list of play channels that could display HILO info would
	be built.
	The other parameter 'flags' it used to determine what kind
	of menu you wish, if NULL a single select list is created
	if MENU_MULTI_SELECT multiple items may be selected
INPUTS
	search - ChanKey flags that describe the type of channels
		you want
	flags - internal use flags used to build different types
		of menus.
RESULTS
	(struct MenuItem *) of the first item of the menu.
----------------------------------------------------------------------------
(menu.c)		FUNCTION
----------------------------------------------------------------------------
NAME
FUNCTION
SYNOPSIS
	void FreeHandlerMenu(MenuI)
	struct MenuItem *MenuI;
	Undos all memory allocation of BuildHandlerMenu
INPUTS
	(struct MenuItem *) of the first item of a menu
RESULTS
	NONE
----------------------------------------------------------------------------
(menu.c)		HandleIntuitMess
----------------------------------------------------------------------------
NAME
	HandleIntuitMess -
SYNOPSIS
	void 	HandleIntuitMess(wind,message)
	struct Window *wind;
	struct IntuiMessage *message;
FUNCTION
	This function is a wedge for recieving intuition messages.  It should
	always be called right after recieing intuition messages.  It handles
	changing the title bar colors.
INPUTS
	wind - a pointer to the callers window structure
	message - a pointer to the intuition message just recieved.
RESULTS
	NONE
----------------------------------------------------------------------------
(window.c)		OpenNewWind
----------------------------------------------------------------------------
NAME
	OpenNewWind -
SYNOPSIS
	struct window *OpenNewWind(nwind,state,x,menu)
	struct NewWindow *nwind;
	struct StandardModState *state;
	int x;
	struct Menu *menu;
FUNCTION
	This function opens a new Studio 16 window and creates all the gadgets
	that appears in the title bar.
INPUTS
	nwind - a pointer to a intuition NewWindow structure
	state - a pointer to a modules StandardModState structure
	x - flags variable
	 PREFERENCES	You want the window preference gadget in title bar
	 DONTMOVEWINDOW	Ignore the StandardModState default window position
	 HIDEMESSAGE	Send the studio message SE_CMD_HIDE_WINDOW rather than
	            	using the intuituition WINDOWCLOSE message

	menu - pointer to a Menu structure.
RESULTS
	NONE
----------------------------------------------------------------------------
(inter.c)		ParseStringForIllegalChars
----------------------------------------------------------------------------
NAME
	ParseStringForIllegalChars
SYNOPSIS
	void ParseStringForIllegalChars(str,other)
	char *str;
	char *other;
FUNCTION
	This Function will look for illegal characters and change them
	to a '!' symbol. The current list of characters that are considered
	illegal are ',' '"' ";" control and alt chars.  Other characters 
	can be eliminated by passing a second parameter, a string of
	other illegal characters.
INPUTS
	str - char * to a null terminated string
	other - char * to a null terminated string
RESULTS
	NONE
----------------------------------------------------------------------------
(window.c)		RefreshBar
----------------------------------------------------------------------------
NAME
	RefreshBar -
SYNOPSIS
	struct GadgetColors svclrs;
	void RefreshBar(wind,x)
	struct Window *wind;
	short x;
FUNCTION
	Refreshes the title bar of a wind using the curent value of
	the wind flag 'WINDOWACTIVE' to determine the color the bar
	should be rendered.
INPUTS
	wind - a pointer to the window stucture of the window to be refreshed
	x - a flag variable. 
	if x==NULL always refresh
	if x!=NULL only refresh if the color should be changed
RESULTS
	NONE
----------------------------------------------------------------------------
(window.c)		RefreshWind
----------------------------------------------------------------------------
NAME
	RefreshWind -
SYNOPSIS
	void RefreshWind(wind)
	struct Window *wind;
FUNCTION
	This function refresh the entire window including the title bar,
	the border and all of the window gadgets.  This function will
	overwrite any information displayed on the window including the
	gadgets, so you must refresh all gadgets and other wind elements
	after this function is called.
INPUTS
	wind - Pointer to the window you wish to refresh;
RESULTS
	NONE
----------------------------------------------------------------------------
(window.c)		WindTitleChange
----------------------------------------------------------------------------
NAME
	WindTitleChange -
SYNOPSIS
	void WindTitleChange(wind,cs)
	struct Window *wind;
	char *cs;
FUNCTION
	Changes the text displayed in the title bar of a studio16 window
INPUTS
	wind - pointer to the window that needs its title bar altered
	cs - a pointer to the new title bar text.
RESULTS
	NONE
----------------------------------------------------------------------------
