-- LTHelp2Impl.mesa  
-- Created by:
-- JFung.pasa		  20-Jun-84 13:54:18

-- Last edited by:
-- JFung.pasa		  13-Sep-84 10:33:10


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

LTHelp2Impl: 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: PROCEDURE RETURNS [okay: BOOLEAN] =
          BEGIN
          PutLine["---click Left button for more---"L];
          okay ← ILT.Confirm[];
          END;



     HelpCommands: PUBLIC PROCEDURE =
          BEGIN
	  I: INTEGER;
	  
          PutCR[];
          PutLine[
"COMMAND ITEMS:

	Install File!:  Install file will fetch and load the file specified in the file parameter into the volume selected.  This command is to be used in conjunction with the device parameter in selecting the type of device where the file is located.  A confirming mouse icon will appear in the file sub-window with the name of the volume to which the file will be installed.  During processing, two positive indications are provided.  First, your command subwindow will be redisplayed by some twiddler graphic symbol, here a star-symbol is used.  Secondly, the message subwindow will display the number of bytes which have been transfered to your disk.  This gives you an idea of how much longer the transfer will take.  Usually for a 2.5 Mb file size in a local net, it takes in the neighborhood of 3-5 minutes.  This command is abortable by depressing the STOP key (the red key located on the right hand corner).

	Boot!: 	Boot command is used to boot the volume selected. 
	
	Erase!:  Erase command is used to erase the contents of your volume.  
		
	Set VMem!: Set VMem command is used to vary the size of the Interlisp's vitual memory backing store.  This command is drived by the size specified on the VMem Size parameter.  A warning message will be posed if you are trying to 'shrink' your virtual memory backing store.  If no size is specified on an empty volume, the system will attempt to allocate the largest VMem possible, this is roughly about 100 pages smaller than your logical volume size.  "L];

	IF NOT More[] THEN RETURN;
          PutCR[];
          PutLine[
"     	Make Script!: Make Script gives user the tool to name their own volume names and sizes and then re-partition his/her disk accordingly.  This command adds the user's definiton together with standard system supplied options into the script file which is located in your Installation Utility floppy.  This command pops a new window with the following parameters:

	DiskType: {10Mb, 29Mb, 43Mb}	DriveSize: nnnnn	Free Pages: nnnn
	Volume1 Name: SystemTools		Volume1 Size: 3500
	Volume2 Name: 				Volume2 Size: 0
	Volume3 Name: 				Volume3 Size: 0
	Volume4 Name: 				Volume4 Size: 0
	Volume5 Name: 				Volume5 Size: 0
	Volume6 Name: 				Volume6 Size: 0
	Volume7 Name: 				Volume7 Size: 0
	Volume8 Name: 				Volume8 Size: 0
	Volume9 Name: 				Volume9 Size: 0
	Volume10 Name: 				Volume10 Size: 0
	
	Make Script!				Quit!

Selecting the DiskType will yield the total disk drive size in pages and the free pages count less the Volume1 size.  Volume1 has been predefined for you.  When editing the Volumex Name, it will dynamically updates the 'Free Pages' field, this lets you know your current free pages count.  When you are all done with the specification, then click the 'Make Script' command, which will prompt you for a confirmation and ask for Installation Utility floppy.  At the end of the floppy operation, do a 2-boot on your floppy you should see your definition appears as the first item in the menu.  "L];


	IF NOT More[] THEN RETURN;
        PutCR[];
        PutLine[
"	 Copy VMem!: Copy VMem performs a cross-volume copy of the virtual memory backing store from one logical volume to another logical volume. Copy VMem pops up a separate window with two data parameters: Source Volume and Destination Volume.  Both of these are menu items and are popped by pressing both buttons on the parameter.  Two command items exist, Start and Quit.  'Start' starts the copy operation, 'Quit' deactivates the option window.  Again, two positive indicators are provided on this operation. They are the 'twiddling' graphic and the 'pages copied' information.  Note this command only copies the VMem size you specifed and not the entire volume contents.  

	Scavenge!: Scavenge performs a file-scavenge on the volume selected.  This command is be used whenever you suspect the integrity of your disk volume.  It is recommended whenever you encounter strange behaviors on your system.  At the end of this operation, it produces an MSScavenge.log file in that volume.  Reading this file will reveal the damaged files which have been repaired if any.
	
	Floppy!:  Floppy command will support floppy feaures on your Dandelion.  This is yet to be implemented.
	
	Quit!:	Quit deactivates the window and returns the tool to the bouncing box state."L];

          END;
     END.