home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d5xx
/
d501
/
addmenu.lha
/
AddMenu
/
AddMenu.doc
< prev
next >
Wrap
Text File
|
1991-06-27
|
29KB
|
645 lines
AddMenu V1.50 (25th Apr 1991) by Nic Wilson
-------------------------------------------
Written totally in Assembler
----------------------------
using Hisoft Devpac Amiga
-------------------------
on an Amiga A3000 25mhz
-----------------------
Nic Wilson Software
138d South Street
Toowoomba Qld 4350
Australia
Ph (076) 358384 Work or FAX
(076) 358539 After hours
This program has been placed on Shareware for your enjoyment
You may distribute it freely as long as this document and the
program remains unmodified, and accompanies the program.
You may modify the script files as examples as long as you
FULLY test them before distribution.
If you like the program, a donation would be appreciated,
and the latest version of this and other programs will be sent
to you if requested.
FUNCTION
--------
Add an infinite number of Menu Items to the Workbench Tools
Menu in Kickstart V2.0 using script files. Updating is
possible from the menus, from CLI or from Workbench using
different script files. Temporary menu items can also be
added that stay in the menu strip after upating to new script.
REQUIREMENTS
------------
Any Amiga running V2.0 of Kickstart and Workbench including
the A3000. Tested on versions 36.141 to 37.74 Kickstart and
Workbench 36.77 to 37.33.
HISTORY
-------
V1.0 Original release.
V1.1 Added ability to use different script name/path
V1.2 Added quit and update options
V1.3 Added ability to change scripts on update
V1.31 Optimised and fixed error msg for illegal use
under kickstart V1.3.
Fully checked with 'Enforcer' for bugs.
V1.40 New temporary menus via workbench icon added
and ability to update or remove from this icon.
V1.41 Stopped illegal devices, drawers or non-executables
being added to the menu strip. These will cause
workbench screen to flash.
Added switch for temporary menus, so you do not have
to have the icon around if you do not use them.
Added the ability to remove the temporary menus alone.
V1.42 Fixed bug. If Temporary menus were removed, they would
magically reappear when a script was changed.
V1.50 Fixed bug. When updating to new script, old script memory
buffers were not being freed.
Added ability for each menu item to have more than one
executable(SEE 'COMMAND STRINGS' or 'EXAMPLE SCRIPT' BELOW).
USAGE
*****
IMPORTANT
---------
DO NOT USE RUN OR RUNBACK, ADDMENU WILL RETURN THE CLI
TO YOU AND ALLOW IT TO CLOSE WHEN YOU GIVE AN ENDCLI.
ADDMENU MUST RESIDE IN THE C: DIRECTORY. IT WILL NOT WORK
IF IT IS IN ANOTHER DIRECTORY, EVEN IF IF IT HAS BEEN ADDED
TO THE PATH OR ASSIGNED! ADDMENU WORKS IN RATHER A SPECIAL
WAY, IN ORDER TO ALLOW THE CLI WINDOW TO CLOSE AFTER LAUNCH
IT RELAUNCHES ITSELF AGAIN WITH SPECIAL CODE, THIS IS DONE
TO OVERCOME ALL THE NORMAL PROBLEMS ASSOCIATED WITH THIS.
YOU WILL NOTICE THAT SOME PROGRAMS LOSE THE PATH, STACK,
CURRENT DIRECTORY ETC, THIS IS ESPECIALLY TRUE OF PROGRAMS
WRITTEN IN C. ADDMENU DOES NOT SUFFER FROM ANY OF THESE
PROBLEMS. POPCLI TYPE PROGRAMS SUFFER BADLY FROM THIS, MY
AUTOCLI USES THIS SAME CODE AND SUFFERS NO PROBLEM. IT IS
PUBLIC DOMAIN SO SEND S.S.A.E. FOR THE LATEST VERSION.
AddMenu [script] [switch]
Standard redirection of output is supported.
EG. Addmenu >nil: [script] [switch]
[switches]
-q AddMenu must already be running for this switch to be used.
This switch allows the currently running AddMenu to be removed.
If AddMenu is not found running an error message will result.
If this switch is used then it must be the only parameter.
To remove from workbench see 'To Remove Addmenu Completely'
below.
-t Do not use temporary menus and do not place the icon on the
Workbench screen.
[script]
This is an optional parameter, and can be used when AddMenu is
first launched or when updating. By default it reads a script
created by you, called 'addmenu.script'. This file is expected
to be in the S: directory , but if you wish to supply a
different path and name you can use the script parameter. If
this parameter is used you must supply the path to the file and
its name. There is an example file that accompanies this file
to show you how to create it. Below is an explanation of the
script file.
SPECIAL CONDITIONS FOR LOADING
------------------------------
Workbench V2.0+ must already be running.
LOADWB delay is not enough see below.
VERY IMPORTANT!!!!!!!!!!
------------------------
If being used from a startup-sequence the the command
must be placed after the LOADWB command, and a Wait 5 must
be placed in between them to give workbench time to come on
line. The actual time to wait may need to be varied to suit
your system. The delay option of LoadWB is not enough.
68030 machines can try wait times as low as 2. If you have
problems with intermittent gurus on boot then increase this wait.
This wait does not have to delay the boot time of your machine.
if, every program in your startup-sequence that normally outputs
some sort of message to the window, is sent to NIL:, the initial
CLI window will not open. The first window you will see will be
the Workbench window. The wait will then happen in the background
and the menus will be available in a few seconds.
EXAMPLE
LoadWb delay cleanup
Wait 5
AddMenu >nil:
++++++++++++++++++++++++
S T O P P R E S S ! ! !
++++++++++++++++++++++++
It seems that this wait is not required on the new V37 of V2.0
It works fine with no wait at all. just ensure that you lanch
it after the loadwb command.
TEMPORARY MENU ITEMS
********************
This function will default to on unless the -t switch was
used at launch. AddMenu will place a special icon on the
workbench window. If a program is dragged and dumped over
this icon, that program will appear at the bottom of the
menu strip. The program itself will not move at all and
doing this is quite safe. These temporary menus will survive
an update that changes to a different script. They will
continue to appear on the bottom of whatever script you
update with. Once added they can be removed without removing
AddMenu completely by double clicking on the special icon and
selecting the 'REMOVE TEMP' gadget from the window.
If any illegal device or non-executable file is dumped over
the icon the screen will flash and a beep sound will be heard,
and it will not be added to the menu.
ADDMENU's SPECIAL ICON
**********************
This icon does not behave like a normal icon, it is a special
icon that allows manipulation of AddMenu from the workbench.
Double clicking the icon will open a window with five gadgets.
These gadgets allow AddMenu to be removed, temporary menus
removed, updating a script or to cancel the operation. They
are all explained in the relative sections below. This icon
has not been given any specific position on the workbench window.
Workbench will choose the best position for the icon, it can
of course be dragged to any place you wish. I may add the abilty
to snapshot in a future version.
CANCELLING THE WINDOW
*********************
If you double clicked the special icon, the window opened, and
you changed your mind and wish to exit without changes. Click
the 'CANCEL' gadget or the CLOSE gadget on the window. This will
abort the operation and AddMenu will be unchanged.
UPDATING ADDMENU ONCE RUNNING
*****************************
From CLI
--------
If AddMenu is already installed when launched again, then it will
send a message to the running version to update itself, If no
script is supplied then it will update from the default file.
A different script can be supplied as the update, and because this
update can called from inside an addmenu script, this allows you to
change the entire menu, by calling a menu funtion. This allows for
an infinite number of available menu functions. If a different
script is supplied to the current one then it will totally replaced
in favour of the new script. This new script could of course
have an option to return to the original or any number of other
scripts.
From Workbench
--------------
Double click the special AddMenu icon that appeared on the
workbench window when AddMenu was launched. A window will
open. Enter a new script path and filename into the string
gadget and then press RETURN or click the OK gadget. The
menus will be updated if your new script was found and was
valid.
TO REMOVE ADDMENU COMPLETELY
****************************
From CLI
--------
Launch AddMenu again with the -q switch. (SEE Usage Above)
This could also be done by placing an entry in your script
file so quitting could be done from the menus.
From Workbench
--------------
Double click the special icon that appeared on the Workbench
window when AddMenu was launched. Click the REMOVE ALL Gadget.
AddMenu will be completely removed.
TO REMOVE THE TEMPORARY MENUS
*****************************
From CLI
--------
Not possible.
From Workbench only
-------------------
Double click the special icon that appeared on the Workbench
window when AddMenu was launched. Click the REMOVE TEMP Gadget.
All temporary menus will be removed. They cannot be removed
individually.
THE SCRIPT FILE
***************
The script file is a group of commands you would like in the
menu along with the text you want in the actual menu.
The format of this script is important for the program to read
it correctly. If the number of menu items in a single script
overflows the screen height, the menu strips will be made
wider and the items split into columns. The maximum number
of menus items in a single script is 63, but due to a bug
in workbench.library this is not checked for, any extra menus
over this amount will be clipped, athough I dont forsee anyone
placing this many in a single script. The structure of the
script file is as follows.
TEXT STRINGS
------------
The text strings are actually placed in the menu, and each one
must be before its command string. The Text string must start
and end with a plus (+) sign.
COMMAND STRINGS
---------------
The command strings are the strings that are sent to DOS when
a menu item is selected. Each one must come directly after
its text string and start and end with an asterisk (*). There
are now any number of commands allowed per text string,
DO NOT USE THE 'RUN' COMMAND WITHIN A COMMAND STRING, 'RUN'
WILL BE ADDED TO THE FRONT OF YOUR STRING AUTOMATICALLY.
END OF FILE MARKER
------------------
The script file must end with a hash (#) sign on the beginning
of a new line.
COMMENTS
--------
Comments are allowed in the script file but must follow certain
guidelines. They are allowed on a line of their own or beside
a text string or command string. They must be outside the command
or text string characters. The best way to ensure this is to
leave at least one space before the beginning of the comment after
the rightmost plus (+) or asterisk (*) of each comment or text
string. They MUST NOT use the plus (+) sign, the asterisk (*)
or the hash (#) sign within the comment, as these three
characters are used to specify the beginning and end of command,
texts strings or end of file. Comment lines are completely
optional, you do not have to have any at all.
EXAMPLE OF A VALID SCRIPT
-------------------------
;this is a valid comment
this is a valid comment
this is still a valid comment
+NEWSHELL+
*c:newshell*
comments are allowed between menu strings
+NoVirus+ this is still a valid comment
*dh0:novirus* notice the path to the above command
how to execute a group of commands
by executing a standard batch file.
+WordPerfect+
*execute s:wpscript* the wp script would contain commands needed
+XCOPY+ to assign and run it
*dh0:copiers/xcopy* now we give option to quit addmenu
+Quit Addmenu+
*addmenu -q*
now we show how to change menus or update
+PageStream+ This example shows executing a number of
*assign fonts1: dh0:pagestream* commands after a single text string.
*assign fonts2: dh0:pagestream*
*assign pagestream: dh0:pagestream*
*assign drivers: dh0:pagestream*
*cd dh0:pagestream*
*dh0:pagestream/pagestream*
+Another Menu+ the next following menu.
*addmenu s:different.script*
#
Notice the 'end of file' marker (#) on the end of the script.
Please send comments, bug reports etc to the address at the
top of this file.
Nic Wilson
AddMenu V1.50 (25th Apr 1991) by Nic Wilson
-------------------------------------------
Written totally in Assembler
----------------------------
using Hisoft Devpac Amiga
-------------------------
on an Amiga A3000 25mhz
-----------------------
Nic Wilson Software
138d South Street
Toowoomba Qld 4350
Australia
Ph (076) 358384 Work or FAX
(076) 358539 After hours
This program has been placed on Shareware for your enjoyment
You may distribute it freely as long as this document and the
program remains unmodified, and accompanies the program.
You may modify the script files as examples as long as you
FULLY test them before distribution.
If you like the program, a donation would be appreciated,
and the latest version of this and other programs will be sent
to you if requested.
FUNCTION
--------
Add an infinite number of Menu Items to the Workbench Tools
Menu in Kickstart V2.0 using script files. Updating is
possible from the menus, from CLI or from Workbench using
different script files. Temporary menu items can also be
added that stay in the menu strip after upating to new script.
REQUIREMENTS
------------
Any Amiga running V2.0 of Kickstart and Workbench including
the A3000. Tested on versions 36.141 to 37.74 Kickstart and
Workbench 36.77 to 37.33.
HISTORY
-------
V1.0 Original release.
V1.1 Added ability to use different script name/path
V1.2 Added quit and update options
V1.3 Added ability to change scripts on update
V1.31 Optimised and fixed error msg for illegal use
under kickstart V1.3.
Fully checked with 'Enforcer' for bugs.
V1.40 New temporary menus via workbench icon added
and ability to update or remove from this icon.
V1.41 Stopped illegal devices, drawers or non-executables
being added to the menu strip. These will cause
workbench screen to flash.
Added switch for temporary menus, so you do not have
to have the icon around if you do not use them.
Added the ability to remove the temporary menus alone.
V1.42 Fixed bug. If Temporary menus were removed, they would
magically reappear when a script was changed.
V1.50 Fixed bug. When updating to new script, old script memory
buffers were not being freed.
Added ability for each menu item to have more than one
executable(SEE 'COMMAND STRINGS' or 'EXAMPLE SCRIPT' BELOW).
USAGE
*****
IMPORTANT
---------
DO NOT USE RUN OR RUNBACK, ADDMENU WILL RETURN THE CLI
TO YOU AND ALLOW IT TO CLOSE WHEN YOU GIVE AN ENDCLI.
ADDMENU MUST RESIDE IN THE C: DIRECTORY. IT WILL NOT WORK
IF IT IS IN ANOTHER DIRECTORY, EVEN IF IF IT HAS BEEN ADDED
TO THE PATH OR ASSIGNED! ADDMENU WORKS IN RATHER A SPECIAL
WAY, IN ORDER TO ALLOW THE CLI WINDOW TO CLOSE AFTER LAUNCH
IT RELAUNCHES ITSELF AGAIN WITH SPECIAL CODE, THIS IS DONE
TO OVERCOME ALL THE NORMAL PROBLEMS ASSOCIATED WITH THIS.
YOU WILL NOTICE THAT SOME PROGRAMS LOSE THE PATH, STACK,
CURRENT DIRECTORY ETC, THIS IS ESPECIALLY TRUE OF PROGRAMS
WRITTEN IN C. ADDMENU DOES NOT SUFFER FROM ANY OF THESE
PROBLEMS. POPCLI TYPE PROGRAMS SUFFER BADLY FROM THIS, MY
AUTOCLI USES THIS SAME CODE AND SUFFERS NO PROBLEM. IT IS
PUBLIC DOMAIN SO SEND S.S.A.E. FOR THE LATEST VERSION.
AddMenu [script] [switch]
Standard redirection of output is supported.
EG. Addmenu >nil: [script] [switch]
[switches]
-q AddMenu must already be running for this switch to be used.
This switch allows the currently running AddMenu to be removed.
If AddMenu is not found running an error message will result.
If this switch is used then it must be the only parameter.
To remove from workbench see 'To Remove Addmenu Completely'
below.
-t Do not use temporary menus and do not place the icon on the
Workbench screen.
[script]
This is an optional parameter, and can be used when AddMenu is
first launched or when updating. By default it reads a script
created by you, called 'addmenu.script'. This file is expected
to be in the S: directory , but if you wish to supply a
different path and name you can use the script parameter. If
this parameter is used you must supply the path to the file and
its name. There is an example file that accompanies this file
to show you how to create it. Below is an explanation of the
script file.
SPECIAL CONDITIONS FOR LOADING
------------------------------
Workbench V2.0+ must already be running.
LOADWB delay is not enough see below.
VERY IMPORTANT!!!!!!!!!!
------------------------
If being used from a startup-sequence the the command
must be placed after the LOADWB command, and a Wait 5 must
be placed in between them to give workbench time to come on
line. The actual time to wait may need to be varied to suit
your system. The delay option of LoadWB is not enough.
68030 machines can try wait times as low as 2. If you have
problems with intermittent gurus on boot then increase this wait.
This wait does not have to delay the boot time of your machine.
if, every program in your startup-sequence that normally outputs
some sort of message to the window, is sent to NIL:, the initial
CLI window will not open. The first window you will see will be
the Workbench window. The wait will then happen in the background
and the menus will be available in a few seconds.
EXAMPLE
LoadWb delay cleanup
Wait 5
AddMenu >nil:
TEMPORARY MENU ITEMS
********************
This function will default to on unless the -t switch was
used at launch. AddMenu will place a special icon on the
workbench window. If a program is dragged and dumped over
this icon, that program will appear at the bottom of the
menu strip. The program itself will not move at all and
doing this is quite safe. These temporary menus will survive
an update that changes to a different script. They will
continue to appear on the bottom of whatever script you
update with. Once added they can be removed without removing
AddMenu completely by double clicking on the special icon and
selecting the 'REMOVE TEMP' gadget from the window.
If any illegal device or non-executable file is dumped over
the icon the screen will flash and a beep sound will be heard,
and it will not be added to the menu.
ADDMENU's SPECIAL ICON
**********************
This icon does not behave like a normal icon, it is a special
icon that allows manipulation of AddMenu from the workbench.
Double clicking the icon will open a window with five gadgets.
These gadgets allow AddMenu to be removed, temporary menus
removed, updating a script or to cancel the operation. They
are all explained in the relative sections below. This icon
has not been given any specific position on the workbench window.
Workbench will choose the best position for the icon, it can
of course be dragged to any place you wish. I may add the abilty
to snapshot in a future version.
CANCELLING THE WINDOW
*********************
If you double clicked the special icon, the window opened, and
you changed your mind and wish to exit without changes. Click
the 'CANCEL' gadget or the CLOSE gadget on the window. This will
abort the operation and AddMenu will be unchanged.
UPDATING ADDMENU ONCE RUNNING
*****************************
From CLI
--------
If AddMenu is already installed when launched again, then it will
send a message to the running version to update itself, If no
script is supplied then it will update from the default file.
A different script can be supplied as the update, and because this
update can called from inside an addmenu script, this allows you to
change the entire menu, by calling a menu funtion. This allows for
an infinite number of available menu functions. If a different
script is supplied to the current one then it will totally replaced
in favour of the new script. This new script could of course
have an option to return to the original or any number of other
scripts.
From Workbench
--------------
Double click the special AddMenu icon that appeared on the
workbench window when AddMenu was launched. A window will
open. Enter a new script path and filename into the string
gadget and then press RETURN or click the OK gadget. The
menus will be updated if your new script was found and was
valid.
TO REMOVE ADDMENU COMPLETELY
****************************
From CLI
--------
Launch AddMenu again with the -q switch. (SEE Usage Above)
This could also be done by placing an entry in your script
file so quitting could be done from the menus.
From Workbench
--------------
Double click the special icon that appeared on the Workbench
window when AddMenu was launched. Click the REMOVE ALL Gadget.
AddMenu will be completely removed.
TO REMOVE THE TEMPORARY MENUS
*****************************
From CLI
--------
Not possible.
From Workbench only
-------------------
Double click the special icon that appeared on the Workbench
window when AddMenu was launched. Click the REMOVE TEMP Gadget.
All temporary menus will be removed. They cannot be removed
individually.
THE SCRIPT FILE
***************
The script file is a group of commands you would like in the
menu along with the text you want in the actual menu.
The format of this script is important for the program to read
it correctly. If the number of menu items in a single script
overflows the screen height, the menu strips will be made
wider and the items split into columns. The maximum number
of menus items in a single script is 63, but due to a bug
in workbench.library this is not checked for, any extra menus
over this amount will be clipped, athough I dont forsee anyone
placing this many in a single script. The structure of the
script file is as follows.
TEXT STRINGS
------------
The text strings are actually placed in the menu, and each one
must be before its command string. The Text string must start
and end with a plus (+) sign.
COMMAND STRINGS
---------------
The command strings are the strings that are sent to DOS when
a menu item is selected. Each one must come directly after
its text string and start and end with an asterisk (*). There
are now any number of commands allowed per text string,
DO NOT USE THE 'RUN' COMMAND WITHIN A COMMAND STRING, 'RUN'
WILL BE ADDED TO THE FRONT OF YOUR STRING AUTOMATICALLY.
END OF FILE MARKER
------------------
The script file must end with a hash (#) sign on the beginning
of a new line.
COMMENTS
--------
Comments are allowed in the script file but must follow certain
guidelines. They are allowed on a line of their own or beside
a text string or command string. They must be outside the command
or text string characters. The best way to ensure this is to
leave at least one space before the beginning of the comment after
the rightmost plus (+) or asterisk (*) of each comment or text
string. They MUST NOT use the plus (+) sign, the asterisk (*)
or the hash (#) sign within the comment, as these three
characters are used to specify the beginning and end of command,
texts strings or end of file. Comment lines are completely
optional, you do not have to have any at all.
EXAMPLE OF A VALID SCRIPT
-------------------------
;this is a valid comment
this is a valid comment
this is still a valid comment
+NEWSHELL+
*c:newshell*
comments are allowed between menu strings
+NoVirus+ this is still a valid comment
*dh0:novirus* notice the path to the above command
how to execute a group of commands
by executing a standard batch file.
+WordPerfect+
*execute s:wpscript* the wp script would contain commands needed
+XCOPY+ to assign and run it
*dh0:copiers/xcopy* now we give option to quit addmenu
+Quit Addmenu+
*addmenu -q*
now we show how to change menus or update
+PageStream+ This example shows executing a number of
*assign fonts1: dh0:pagestream* commands after a single text string.
*assign fonts2: dh0:pagestream*
*assign pagestream: dh0:pagestream*
*assign drivers: dh0:pagestream*
*cd dh0:pagestream*
*dh0:pagestream/pagestream*
+Another Menu+ the next following menu.
*addmenu s:different.script*
#
Notice the 'end of file' marker (#) on the end of the script.
Please send comments, bug reports etc to the address at the
top of this file.
Nic Wilson