home *** CD-ROM | disk | FTP | other *** search
- /* fastmenu.rexx */
- /* this opens a window with buttons which run macros */
- /* Marvin Weinstein, 1989 */
-
- if ~show('L','rexxsupport.library') then
- call addlib('rexxsupport.library',0,-30)
- if ~show('L','rexxarplib.library') then
- call addlib('rexxarplib.library',0,-30)
- if ~show('L','rexxmathlib.library') then
- call addlib('rexxmathlib.library',0,-30)
-
- /*
- * Make sure the libraries are in memory ... not needed if the library
- * files have been copied to LIBS:.
- */
- address command ':c/loadlib :libs/rexxsupport.library'
- if ~showlist('L','rexxarplib.library') then do
- say "Loading RexxArpLib Library ..."
- address command ':c/loadlib :libraries/rexxarplib/screenshare.library'
- address command ':c/loadlib :libraries/rexxarplib/rexxarplib.library'
- end
- if ~showlist('L','rexxmathlib.library') then do
- say "Loading RexxMathLib Library ..."
- address command ':c/loadlib :libraries/rexxmathlib/rexxmathlib.library'
- end
-
- call MenuWindow(FASTHOST,FASTPORT)
- call AddMenu(FASTHOST,"Basic Commands")
- call AddItem(FASTHOST,"Quit","quit",Q)
-
- call AddGadget(FASTHOST,6,11 ,"BOFA" ," New CLI ", /* + */,
- "'address command newcli'")
- call AddGadget(FASTHOST,6,22 ,"EDIT" ," Edit ", /* + */,
- "'address command e'")
- call AddGadget(FASTHOST,6,33 ,"CAL" ," Calendar ", /* + */,
- "arexx_disk:examples/month")
- call AddGadget(FASTHOST,6,44 ,"CLEAR"," Clear ","'call postmsg'")
- callsin = " 'call ''ARexx_Disk:examples/graph''(''sin(x)'',
- 25,0.00,6.28,''5.0 * sin(x)'')' "
- call AddGadget(FASTHOST,6,55 ,"SINX" ," Show Sin(x) ",callsin)
- calllog = " 'call ''ARexx_Disk:examples/graph''(''log(x)'',
- 25,0.01,5.00,''45. * log(x)'')' "
- call AddGadget(FASTHOST,6,66 ,"LOGX" ," Show Log(x) ",calllog)
- callabout = "'call postmsg 0,0,''This is a configurable ""fast menu""'''"
-
- call SetNotify(FASTHOST,GADGETUP,REXX)
- call SetNotify(FASTHOST,CLOSEWINDOW,FASTHOST)
- call SetNotify(FASTHOST,MENUPICK,FASTHOST)
-
- exit
-
- /* MenuWindow.rexx - menu making function */
-
- MenuWindow:
- arg menuhost, menuport
-
- parse version 'V' vers .
- if vers > 1.06
- then address AREXX "'x=createhost(" menuhost "," menuport ")'"
- else "runwsh >nil:" "'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+GADGETUP+MENUPICK'
- flags = 'WINDOWCLOSE+WINDOWDRAG+WINDOWDEPTH'
-
- call SetReqColor(menuhost,OKAY,1)
- /* call SetReqColor(menuhost,BACK,1) */
- call SetReqColor(menuhost,SHADOW,0)
- call SetReqColor(menuhost,BLOCK,1)
- call SetReqColor(menuhost,BOX,1)
-
- wd = 120;ht = 6*11+11
- /* Open the menu window in the lower right-hand corner */
- call OpenWindow(menuhost,screencols()-wd,screenrows()-ht,wd,ht, /* */,
- idcmp, flags)
- call SetAPen(menuhost,1)
- call SetBPen(menuhost,1)
- call SetDrMd(menuhost,JAM2)
-
-
- return 0
-