home *** CD-ROM | disk | FTP | other *** search
- /* FastMenu1.rexx */
- /* this opens a window with buttons which run macros */
- /* Marvin Weinstein, 1989 */
- /* Modified by Steven D. Kapplin, 1989 */
- /* Requires RexxArpLib, RexxSupport, and ScreenShare libraries in Libs: */
- /* Menuitems and Gadgetitems can have multi-line scripts. See for an */
- /* example the entry for Calendar which contains a two line script. A */
- /* similar setup can be done for gadgets as well as for menu items. I */
- /* have included a second rexx program, PrtSetup.rexx, as an example of */
- /* adding gadgets. FastMenu1.rexx does not use gadgets, so the window */
- /* is made as small as possible so that it fits in the menu bar of the */
- /* Workbench screen, however, you can position the menu anywhere on the */
- /* screen by adding the necessary parameters when FastMenu1 is invoked. */
- /* See the command syntax by simply executing FastMenu1 ? for a short */
- /* message showing the syntax. In the event no parameters are supplied */
- /* or parameters are missing, default parameters are used. The defaults*/
- /* are xpos=0, ypos=150, width=240, height=10. The minimum width is */
- /* 240 pixels. You can customize this menu to include whatever you want*/
- /* by adding or deleting or modifying the commands. Be sure to pay */
- /* close attention to the quoting conventions because they are critical */
- /* to having your commands work. Several libraryies must be present */
- /* for FastMenu1 to work. Be sure they are in the libs: directory. If */
- /* they are not present or if FastMenu1's port has already been created */
- /* FastMenu1 will exit with a short error message. */
-
- if show('P','FASTHOST') then do
- say 'FASTHOST Port in Use or ARexx Menu Program Running ... Aborting'
- exit 10
- end
-
- parse arg xpos ypos width height .
-
- if xpos = "?" then do
- say "SYNTAX: FastMenu1 <xpos> <ypos> <wid> <ht>"
- say " xpos = x offset for window (default = 0)"
- say " ypos = y offset for window (default = 150)"
- say " wid = window width (min = 240, default = 240)"
- say " ht = window height (min = 10, default = 10)"
- exit 0
- end
-
- if ~exists('libs:rexxarplib.library') then do
- say 'RexxArpLib.library not in Libs: ... Aborting'
- exit 10
- end
-
- if ~exists('libs:rexxsupport.library') then do
- say 'RexxSupport.library not in Libs: ... Aborting'
- exit 10
- end
-
- if ~exists('libs:screenshare.library') then do
- say 'ScreenShare.library not in Libs: ... Aborting'
- exit 10
- end
-
- if ~show('L','rexxsupport.library') then
- call addlib('rexxsupport.library',0,-30)
- if ~show('L','rexxarplib.library') then
- call addlib('rexxarplib.library',0,-30)
-
-
- call MenuWindow(FASTHOST,FASTPORT,xpos,ypos,width,height)
-
- call AddMenu(FASTHOST,"Tools ")
- call AddItem(FASTHOST," New WShell ","'address command newwsh'",W)
- call AddItem(FASTHOST," RExxRun ","REXX:RExxRun",X)
- call AddItem(FASTHOST," Editors ","")
- call AddSubItem(FASTHOST," Edit E ","'address command ''sys:tools/e'''",E)
- call AddSubItem(FASTHOST," Edit CED ","'address command ''sys:Tools/CED'''",C)
- call AddItem(FASTHOST," ShowPrint ","'address command ''runwsh sys:BigC/ShowPrint'''",S)
- call AddItem(FASTHOST," Printer Setup ","REXX:PrtSetup",U)
- call AddItem(FASTHOST," Printer Select ","REXX:PrtSelect",L)
- call AddItem(FASTHOST," Print File ","REXX:RExxPrint",P)
- call AddItem(FASTHOST," DiskTools ","")
- call AddSubItem(FASTHOST," Clean VD0: ","'address command ''dh0:System/DiskUtils/CleanRamDisk'''",V)
- call AddSubItem(FASTHOST," Clean Memory ","'address command ''sys:tools/Clean'''")
- call AddSubItem(FASTHOST," NewZap ","'address command ''sys:System/DiskUtils/Zap'''",Z)
- call AddItem(FASTHOST," GOMF ","")
- call AddSubItem(FASTHOST," Nuke ","'address command ''sys:System/Nuke'''")
- call AddSubItem(FASTHOST," Recall GOMF ","'address command ''sys:System/Recall'''")
- call AddItem(FASTHOST," Quit Fast Menu ","'address FASTHOST quit'",Q)
-
- call AddMenu(FASTHOST,"DeskTop ")
- call AddItem(FASTHOST," Card Index ","'address command ''runwsh dh0:BigC/AmigaDex'''",A)
- call AddItem(FASTHOST," Calendar ","'pragma(''D'',''dh0:DeskTop/Organizers'');address command ''runwsh dh0:DeskTop/Organizers/Calendar'''",D)
- call AddItem(FASTHOST," Rollodex ","'pragma(''D'',''dh0:DeskTop/Organizers'');address command ''runwsh dh0:DeskTop/Organizers/Rollodex'''",R)
- call AddItem(FASTHOST," Note Pad ","'address command ''runwsh dh0:BigC/MemoPad'''",N)
- call AddItem(FASTHOST," Calculators ","")
- call AddSubItem(FASTHOST," Programmer ","'address command ''runwsh dh0:DeskTop/Calculators/Programmer'''")
- call AddSubItem(FASTHOST," Financial ","'address command ''runwsh dh0:DeskTop/Calculators/Financial'''")
- call AddSubItem(FASTHOST," Scientific ","'address command ''runwsh dh0:DeskTop/Calculators/Scientific'''")
-
- call AddMenu(FASTHOST,"Applications ")
- call AddItem(FASTHOST," Terminal ","'pragma(''D'',''Online!:'');address command ''runwsh Online!:Online!'''")
- call AddItem(FASTHOST," Word Processor ","'pragma(''D'',''ProWrite:'');address command ''runwsh ProWrite:Prowrite'''")
- call AddItem(FASTHOST," Spreadsheet ","'pragma(''D'',''Analyze!:'');address command ''runwsh Analyze!:Analyze!'''")
- call AddItem(FASTHOST," Data Base ","'pragma(''D'',''Filer:'');address command ''runwsh Filer:FileIIsg'''")
- call AddItem(FASTHOST," Paint ","'pragma(''D'',''Dpaint:'');address command ''runwsh Dpaint:Dpaint'''")
- call AddItem(FASTHOST," CanDo ","'pragma(''D'',''Cando:'');address command ''runwsh Cando:Cando'''")
-
- call AddMenu(FASTHOST,"Devices ")
- call AddItem(FASTHOST," Mounts ","")
- call AddSubItem(FASTHOST," Add PATH: ","'address command ''mount PATH:'''")
- call AddSubItem(FASTHOST," Rem PATH: ","'address command ''assign path: remove'';address command ''assign tao: remove'''",,,SAMELINE)
- call AddSubItem(FASTHOST," MSDos DI0: ","'address command ''mount DI0: FROM devs:mountlist.msdosfs'''")
- call AddSubItem(FASTHOST," Kill DI0: ","'address command ''Kill DI0:'''",,,SAMELINE)
- call AddSubItem(FASTHOST," MSDos DI1: ","'address command ''mount DI1: FROM devs:mountlist.msdosfs'''")
- call AddSubItem(FASTHOST," Kill DI1: ","'address command ''Kill DI1:'''",,,SAMELINE)
- call AddItem(FASTHOST," Set Paths For: ","")
- call AddSubItem(FASTHOST," LIBS: ","'address command ''assign LIBS: path:dh0:Libs,dh0:Libs/Bmaps'''")
- call AddSubItem(FASTHOST," C: ","'address command ''assign C: path:dh0:C,dh0:C/ExtC'''")
- call AddSubItem(FASTHOST," FONTS: ","'address command ''assign FONTS: path:dh0:Fonts,dh1:BigFonts'''")
- call AddItem(FASTHOST," Kill Paths For:","")
- call AddSubItem(FASTHOST," LIBS: ","'address command ''assign LIBS: dh0:Libs'''")
- call AddSubItem(FASTHOST," C: ","'address command ''assign C: dh0:C'''")
- call AddSubItem(FASTHOST," FONTS: ","'address command ''assign FONTS: dh0:Fonts'''")
-
- call SetNotify(FASTHOST,GADGETUP,FASTHOST)
- call SetNotify(FASTHOST,CLOSEWINDOW,FASTHOST)
- call SetNotify(FASTHOST,MENUPICK,REXX)
-
- exit
-
- /* MenuWindow.rexx - menu making function */
-
- MenuWindow:
- arg menuhost, menuport, xpos, ypos, width, height
-
- address AREXX "'x=createhost(" menuhost "," menuport ")'"
-
- mp = openport(menuport)
- do for 10/(10/50) while ~showlist('p',menuhost)
- call delay 10
- end
-
- if ~(mp & showlist('p',menuhost)) then
- return
-
- idcmp = 'CLOSEWINDOW+MENUPICK'
- flags = 'WINDOWDRAG+BORDERLESS+BACKFILL+WINDOWCLOSE'
-
- if width = "" | width < 240 then width = 240
- if height = "" | height < 10 then height = 10
- if xpos ="" then xpos = 150
- if ypos ="" then ypos = 0
-
- txt_wid = trunc((width-26)/8) + 1
- win_text = center('ARexx Menu',txt_wid)
-
- call SetReqColor(menuhost,BLOCK,3)
-
- /* Open the menu window in the upper left-hand corner */
- call OpenWindow(menuhost,xpos,ypos,width,height,idcmp, flags,win_text)
-
- return 0
-