

                Menu
                ~~~~

                © M.Meany, 1991.
                ~~~~~~~~~~~~~~~~

 4 Colour Version
 ~~~~~~~~~~~~~~~~
 The disc menu system was written primarily for the ACC discs, hence the
huge logo at the top. In this form it may be considered PD, use as you
will,however,you are asked not to alter any of the display graphics.

 Should you wish to use a customised version of this menu for either a disc
magazine of your own, or to circulate modules/graphics done by a group, you
must first obtain my written permission. The logo at the top can be
changed and I leave it to you to supply the GFX ( as an IFF brush,
dimensions width 600, height 44, depth 2 ). The contents of the left most
About gadget must be left for me.

 I am open to suggestions for addittional in-built support features.

 Usage
 ~~~~~
 The menu runs by reading configuration files from disc. The first file
read MUST be named acc0 and MUST be located in the current s directory. Sub
menus are supported, these may be located anywhere on the disc. The reason
for doing this is to allow a disc to be built up a directory at a time, as
each directory is added so is a config file for it. All that then remains
is a link to this config file from an exsisting config file.

 The Config Files
 ~~~~~~~~~~~~~~~~
 A config file is basically a straight forward ASCII file. You can create
one using any basic text editor ( including ED on your original Workbench
disc ). Each file referenced from the menu requires two lines in the config
file. The first line defines what text will appear in the menu selection
box and in what colour. The second lines informs the menu what action to
take if this line is selected!

 The menu can load and decrunch config files crunched using Nico Francois
PowerPacker, this can save upto 60% filespace on text files!

 Line 1: The Discriptor
 ======================

 The first line should start with a digit from 0 to 3 that defines what
colour the text following it should be in! Immediately after this digit
should be the text that is displayed. The displayed text should not be more
than thirty two characters, I assume you can count and do not check this!

 The menu selection box is filled with colour 2. This means that you should
avoid using colour 2 for text, unless you wish to add entries that are
invisible until selected!

 I tend to use colour 0 for section headings and information text, colour 1
for entries that do something and colour 3 for sub menu selections. Of
course the choice is entirely yours!

 Eg's.
 -----
  1/ An entry for a text file covering weather prediction techniques (???).
    The entry is to be displayed in colour 0:

0Weather Prediction

  2/ An IFF picture following this showing a satalite picture of the Earth,
to be displayed in colour 3:

3Satalite Picture

  3/ An entry for a sub-menu detailing low pressure zones, displayed in
colour 1:

1>>>>Low Pressure Zones

 Line 2: Action.
 ===============

 The second line informs the menu what to do if this entry was selected. The
first character on the line is the command to the menu, this must normally
be followed by a filename. In all cases it is safest to enter the full
pathname of a file, this leaves nothing to chance.

 The commands supported at present are:

 Command        Action
 -------        ------
   E             Execute the following program (1).
   R             Read the following text file (2).
   V             View the following IFF ILBM picture file (3).
   P             Play the following NoiseTracker module (4).
   p             Stop playing a module (4).
   M             Switch to following sub-menu (5).
   Q             Quit the menu system (6).
   @             No action, ignore selection (7).

 Lets take a look at each entry in turn along with an example!

 (1) Execute a Program.
 ----------------------
 Do not confuse this with the DOS command execute, used to execute script
files. I have used E for Execute since R ( for Run ) was already in use for
Read.

 This entry can be used to run a program from disc. Note the main menu page
stays open, but you should avoid accessing it as nothing will happen!

 Eg's.
 -----
 1/ To allow access to a text editor from within the menu, use something
along the lines of:

Esys:tools/Ed

 In this case, the text editor is called Ed and is located in the directory
sys:tools/. It may be that you wished to allow a certain file to be edited.
Providing the editor accepts a command line argument, most programs do,
then you could use something along the lines of:

Esys:tools/Ed sys:docs/Letter

 This would cause the editor to be run and the parameter 'sys:docs/Letter'
would be passed to it just as if you had typed it in at the CLI.

 (2) Read a Text File
 --------------------
 The menu comes with a built-in text file reader. You specify the name of a
text file and it will be loaded and displayed. The user can browse the file
using a selection of gadgets. There is also a search facility and a print
facility available. The menu is also capable of loading text files that
have been crunched using PowerPacker by Nico Francois.

 Eg's.
 -----
 Remember the weather prediction file mentioned earlier? Well suppose this
file was located in the Weather_Docs directory on a disc called Met: and
the file was named Prediction, this would give the file a full pathname of
'Met:Weather_Docs/Prediction'. So to instruct the menu to display this text
file:

Rmet:weather_docs/predictions

 The text displayer will decrunch the file if necessary.

 If a text file fails to load control is passed back to the menu.

 (3) View an IFF ILBM Picture File
 ---------------------------------
 First, I must thank Steve Marshall for supplying me with the ILBM loader
source used for this routine, it hasn't let me down yet!

 An IFF ILBM is the standard format file produced by most commercial art
packages, ie Delux Paint ( I, II, III and IV ), Photon Paint ( I and II ).

 The menu comes with a built-in picture displayer that handles all
resolution pics I've so far encountered. It can also display 'brushes'
saved from the above mentioned packages. A picture is displayed until the
user presses the left mouse button.

 To get the menu to display a picture file, simply put the name of the file
after the V command:

Vmet:pics/satalite.pic

 This will display the picture called 'satalite.pic' found in the directory
'met:pics/'.

 If a picture fails to load control is passed back to the menu.

 (4) Play a NoiseTracker Module.
 -------------------------------
 I included this feature basically because I have a lot of first-hand
dealing with NoiseTracker modules ... If you want the replayer replaced
with a different one ( eg, MED ), write to me!

 PowerPacked modules can be played by this routine.

 As with all other options so far, the filename of the module should follow
the P command:

Pmet:modules/hurricane.mod

 Here, the module in question is called 'hurricane.mod' and can be found in
the directory 'met:modules'.

 To stop a module playing, you will have to include a 'Kill Music' option (or
something similar ). A module will play until a 'p' command is executed. Note
that the stop module command is a lowercase p while the play command is an
uppercase P. The module will not effect the operation of the system.

 When the program quits, any module still playing will be stopped!
 

 (5) Switch to Sub-Menu
 ----------------------
 To allow the menu system reflect the disc organisation and to allow
related files to be accessed from individual menus, a sub-menu system has
been employed. It does not have to be used as there is no limit ( except
RAM ) on the size of a config file.

 Specifying a sub-menu causes the current menu to be forgotten and a new
config file to be read from disc and used. The only restriction on this is
that the first config file is called acc0 and is located in the s
directory. Other config files can be called whatever you wish and can be
located anywhere on the disc, as with all other commands so far you follow
the command with the filename of the config file.

 If the config file specified cannot be found or loaded then a polite
message appears in the selection box along with a QUIT option. There is no
way of recovering from this, the user is forced to quit the menu, but at
least he/she is told why!

 Eg.
 ---
 Going back to the hypothetical weather disc, suppose the config file for
the low pressure systems menu was located in the directory 'met:configs'
and was called 'low.menu', the following command would load it:

Mmet:configs/low.menu
 
 (6) Quit The Menu.
 ------------------
 Well all good thing have to come to an end and the user will eventually
finish browsing your disc. To give the opportunity of quitting the menu
gracefully, use the Q command. This does not require a filename after it!

 You can have as many Q commands as you wish in any menu ( or sub-menu ).

 Eg.
 ---

Q

 (7) No Action.
 --------------
 This feature allows you to make entries in the menu that, if selected, do
nothing. You can use such entries for subject headings, usage instructions
or just about any other message you wish.

 Eg.
 ---

@

 Bringing It All Together.
 ~~~~~~~~~~~~~~~~~~~~~~~~~
 To finish off I will give an example menu based on the weather disc
examples used above.

 NOTE: IT IS IMPORTANT THAT YOU PRESS RETURN AT THE END OF THE LAST LINE OF
THE FILE, THE MENU PROGRAM SEARCHES FOR LINE FEED BYTES INSERTED IN THE
TEXT BY DOING THIS. FAILURE TO DO THIS WILL RESULT IN THE LAST MENU ENTRY
BEING IGNORED! YOU HAVE BEEN WARNED.

 In the example file below each line is numbered, this is for explanation
only! Do not number the lines in a real config file, it will confuse the
menu program no end! Each line starts after the > symbol.

#### Start, don't include this line!
1 >0   Weather Disc
  >@
2 >1
  >@
3 >1 Predicting The Weather
  >Rmet:weather_docs/predictions 
4 >1
  >@
5 >1 A Satalite Picture
  >Vmet:pics/satalite.pic
6 >1
  >@
7 >1 The Howling Wind
  >Pmet:modules/hurricane.mod
8 >1
  >@
9 >1 Storm Emulation
  >Emet:c/animplayer met:anims/storm
10>1
  >@
11>0   Sub Menus
  >@
12>3 Low Pressure Systems
  >Mmet:configs/low.menu
13>3 High Pressure Systems
  >Mmet:configs/high.menu
14>1
  >@
15>3   !!! QUIT !!
  >Q
#### End, don't include this line!

 As you can see there will be fifteen entries in this menu.

 Entries 2,4,6,8,10 and 14 will show as blank lines that have no effect
when selected.

 Entries 1 and 11 are examples of headings and have no effect when
selected.

 Entry 3 will display a text file.

 Entry 5 will display an IFF picture.

 Entry 7 will play a noisetracker module.

 Entry 9 will cause an animation player to run. It will be passed the name
of the animation file, 'met:anims/storm', to show.

 Entries 12 and 13 will pass control to other config files and hence other
menus.

 Entry 15 allows the user to quit.

 If this was the main menu for the disc, it would be called acc0 and stored
in the s directory.

 Running The Menu
 ~~~~~~~~~~~~~~~~
 The menu requires three things to run:

    1/ An initial config file called acc0 in the s directory.
    2/ The powerpacker.library in the libs directory.
    3/ Run in the c directory.

 For this reason it is safest to run the menu from the startup-sequence of
a disc employing it, no parameters required.

 Do not give the program an icon and run from the Workbench. There is a bug
within the run ( E ) routine at present that requires a parent CLI. To
avoid this use IconX, this can be used to set the s, c and libs directories
to the required disc also.

 Example IconX script:

assign c: met:c
assign libs: met:libs
assign s: met:s
met:menu
assign s: sys:s
assign libs: sys:libs
assign c: sys:c

 Feedback
 ~~~~~~~~
 If you use this menu and would like to see improvements made, send your
suggestions to me. Only letter with a stamped sae will be replied to.

 Mark Meany,
 216 Bluebell Road,
 Southampton,
 Hant's.

 The Future
 ~~~~~~~~~~
 As already mentioned, I am working on an eight colour version of the
program. Hopefully I will have added more support functions also. Details
of this will be available from Amiganuts United at the following address:

        169 Dale Valley Road,
        Southampton,
        Hant's.
        

 Credits
 ~~~~~~~
 Main Programming and GFX : Mark Meany
 ILBM loader + Interrupts : Steve Marshall
 powerpacker.library      : Nico Francois
