-- LTHelpImpl.mesa  
-- Created by:
-- JFung.pasa		  8-Dec-83 17:00:08

-- Last edited by:
-- JFung.pasa		  27-Aug-84 14:25:29


DIRECTORY
     Ascii,
     Cursor USING [Set],
     LispToolOps,
     Put USING [Char, CR, Line, LongDecimal, LongString, Text],
     String,
     UserInput USING [WaitForConfirmation, WaitNoButtons];

LTHelpImpl: PROGRAM
     IMPORTS Ascii, Cursor, LispToolOps, Put, String, UserInput EXPORTS LispToolOps
     =
     BEGIN OPEN ILT: LispToolOps;

     debug: BOOLEAN ← FALSE;

     -- Routines to allow the LispTool to talk to the window.

     PutChar: PUBLIC PROCEDURE [ch: CHARACTER, minWidth: CARDINAL ← 0] =
          BEGIN
          Put.Char[ILT.toolData.fileSW, ch];
          THROUGH [1..minWidth) DO
               Put.Char[ILT.toolData.fileSW, Ascii.SP]; ENDLOOP;
          END;

     PutCR: PUBLIC PROCEDURE = BEGIN Put.CR[ILT.toolData.fileSW]; END;

     PutText: PUBLIC PROCEDURE [text: LONG STRING, minWidth: CARDINAL ← 0] =
          BEGIN
          Put.Text[ILT.toolData.fileSW, text];
          THROUGH [text.length..minWidth) DO
               Put.Char[ILT.toolData.fileSW, Ascii.SP]; ENDLOOP;
          END;

     PutLine: PUBLIC PROCEDURE [text: LONG STRING] =
          BEGIN Put.Line[ILT.toolData.fileSW, text]; END;

     <<     PutNumber: PUBLIC PROCEDURE [
          number: UNSPECIFIED, radix: CARDINAL, minWidth: CARDINAL ← 0] =
          BEGIN
          text: STRING = [40];
          String.AppendNumber[text, number, radix];
          THROUGH [text.length..minWidth) DO PutChar[Ascii.SP]; ENDLOOP;
          PutText[text];
          END;

     PutLongNumber: PUBLIC PROCEDURE [
          number: LONG UNSPECIFIED, radix: CARDINAL, minWidth: CARDINAL ← 0] =
          BEGIN
          text: STRING = [40];
          String.AppendLongNumber[text, number, radix];
          THROUGH [text.length..minWidth) DO PutChar[Ascii.SP]; ENDLOOP;
          PutText[text];
          END;

     PutTextCentered: PUBLIC PROCEDURE [text: LONG STRING, width: CARDINAL ← 0] =
          BEGIN
          leftBlanks: CARDINAL = (width - text.length)/2;
          rightBlanks: CARDINAL = width - text.length - leftBlanks;
          THROUGH [0..leftBlanks) DO PutChar[Ascii.SP]; ENDLOOP;
          PutText[text];
          THROUGH [0..rightBlanks) DO PutChar[Ascii.SP]; ENDLOOP;
          END;

>>

     More: PUBLIC PROCEDURE RETURNS [okay: BOOLEAN] =
          BEGIN
          PutLine["---click Left button for more---"L];
          okay ← ILT.Confirm[];
          END;



     DisplayWriteUp: PUBLIC PROCEDURE =
          BEGIN
          IF ILT.toolData.docType = general THEN HelpGeneral ELSE HelpErrorMsg;
          END;


     HelpErrorMsg: PROCEDURE =
          BEGIN
	  I: INTEGER;
	  
	  FOR I IN [0..30] DO PutLine[""L]; I←I+1; ENDLOOP;	--clean up the window first

          PutLine[
"	'Aborted': 	Install File command aborted by user.
	
	
	'Incorrect user/password': 	User/Password not authenticated.
	
	'No Sysout file installed': 	No lisp sysout file detected in volume.
	
	'Insufficient free pages!': 	The Diagnostics volume size is too small.  Contact your Customer Support person.
	
	'Not enough room for file!': 	The VMem size specified is too large for the volume.

	'Scan error on ...':	Invalid domain/organization name.  Only following characters are vaild: 
""- * @ : Ascii.SP (space character) ['a..'z] ['A..'Z] ['0..'9]  The first character should be a letter.""."L];
          END;



     HelpGeneral: PROCEDURE =
          BEGIN
	  I: INTEGER;
	  
	  FOR I IN [0..30] DO PutLine[""L]; I←I+1; ENDLOOP;	--clean up the window first

          PutLine[
"	 Welcome to the Interlisp-D world. This writeup also exists on your 1108 User's Guide under the section titled ""Loading Interlisp-D from your file server"".  It is provided here for your convenience for online reference.

        Users unfamiliar with mouse and window operations should read the Help function in the Diagnostics tool which presents detailed instructions on this kind interface.

	The System Tools is a window based tool and is composed of five regions.  The 1)Herald name, 2)Message Subwindow, 3)Parameter Subwindow, 4)Command Subwindow and 5)File Subwindow.

The Herald name appears at the top line and it merely indicates the tool's name and its creation date.

The Message subwindow displays the error messages, if any, that are encountered in the command operation.

	The Parameter subwindow is a form subwindow and currently contains the following parameters:
	       
	Doc.: {General, ErrorMsg}	Device: {IFS, FS, FLOPPY}	VMem Size = 
	File: [Host]<Directory>SubDirectory>fileName.sysout
	Volume Menu:			Volume Size = 			Free Size =
	User:				Password:			 
	Domain:				Organization:
	
The Command subwindow is another form subwindow and currently contains the following commands:

	Install File!	Boot!		Erase!		Set VMem!	Make Script!	Help!
	Remote List!	Copy VMem!	Scavenge!	Floppy!		Quit!
	
	
The File subwindow displays the event messages relevant to that command."L];

          IF NOT More[] THEN RETURN;
          PutCR[];
          PutLine[
"PARAMETER ITEMS:
	       
	Doc.:  The document parameter is an enumerated item which is used in conjunction with the Help command.  It is used to select which online document is to be displayed in the file subwindow for a quick reference.  'General' displays the overall features of the tool, while the 'ErrorMsg' displays the semantics of the error messages in the tool.

	Device:  Device is another enumerated item which gives the user the selection of the type of device where the lisp sysout file is located.  Currently, two types of file servers, IFS(Interim File Server) & FS(Xerox File Server) are supported.  An additional Floppy device on your Dandelion is planned for reading sysout floppies into the lisp volume.

	File:   File specifies the pathname of the file to be installed.  The syntax of the complete pathname depends on the particular file system on your host machine.
	
	For example, on a Xerox's IFS the pathname looks like [Host]<Directory>[SubDirectory>]FileName.ext!version.  
	A typical example would be [Rosebowl]<Lisp>Fugue>Lisp.sysout.

	On a Xerox's product file server the pathname looks like [Host:Domain:Organization]<Directory>[SubDirectory>]FileName.ext!version.  
	A typical example would be [Phylex:XSIS North:Xerox]<Demo>Demo.sysout
	An equivalent but shorter way would be [Phylex:]<Demos>Demo.sysout

	On a Unix file server the pathname looks like [host]</directory[subdirectory/]/>filename.ext  
	A typical example would be [safe]</a/lisp/fugue4/>lisp.sysout
	
	On a VAX-VMS file server the pathname looks like [Host]<Directory[.SubDirectory]>FileName.ext;version.  
	A typical example would be [Taos]<DEIProd.Prior]Lisp.sys

	On a DEC-2060 TOPS-20 file server, the pathname looks like [Host]<Directory[.SubDirectory]>FileName.Sys.version.  
	A typical example would be [Sumex-2060]<Dolphin.Fugue6.BetaTest>Lisp.sysout.
	"L];


          IF NOT More[] THEN RETURN;
          PutCR[];
          PutLine[
"  	 Volume Menu:  Volume Menu is another enumerated menu which only gets displayed by chording your mouse button(pressing both buttons on a 2-button mouse or middle button on a 3-button mouse).  A menu with the exact volume names as configured in your machine will pop up.  If 'Lisp' volume is present in your machine, it will get selected as the default volume else nothing gets selected.  To change your volume selection, simply move your mouse to the volume desired and click the left-button. 

	VMem Size:  VMem Size dynamically shows the size in pages(1 page=512 bytes) of your Interlisp's virtual memory size on that volume.  This parameter is only meaningful to a lisp-type volume.
	
	Volume Size:  Volume Size dynamically shows the volume size in pages.
		
	Free Size:  Free Size dynamically shows the available size in pages.

	User:		is your Pup/NS registered user name.
	Password:	is your associated password for login.
	Domain:		is your domain name as defined in your Clearinghouse database. Necessary for XNS service.
	Organization:	is your organization name as defined in your Clearinghouse database. Necessary for XNS service"L];


          IF NOT More[] THEN RETURN;
	  ILT.HelpCommands[];
          END;

     END.