home *** CD-ROM | disk | FTP | other *** search
- /**** Textra Rexx Command Link ****/
- /* Provides intuition interface for inserting HyperText commands */
- /* into a Textra document (must be Textra's current window) */
-
- /* Written 22nd Dec 1991 by DAB - an English Import */
-
-
- if ~show('L','rexxsupport.library') then do
- say 'Loading RexxSupport library'
- check = addlib('rexxsupport.library',0,-30,0)
- end
- if ~show('L','rexxmathlib.library') then do
- say 'Loading RexxMathLib library'
- check = addlib('rexxmathlib.library',0,-30,0)
- end
- if ~show('L','rexxarplib.library') then do
- say 'Loading RexxArpLib library'
- check = addlib('rexxarplib.library',0,-30,0)
- end
-
- if ~show('P','TEXTRA') then do
- pmt = ' TEXTRA Port not found - have you started Textra ?'
- yn = Request(50,50,pmt,,' ',' ')
- exit
- end
-
- call RexxWindow(DABHOST,DABPORT,240,49,380,150,"DAB's Textra/HyperText Interface")
-
- /* AddGadget(Host,xpos,ypos,GadgetID,GadgetText,GadgetMessage) */
-
- call AddGadget(DABHOST,20,15, "Font" , " Font ", "Font")
- call AddGadget(DABHOST,20,30, "Title" , " Title ", "Title")
- call AddGadget(DABHOST,20,45, "BGColor" , " BGColor ", "BGColor")
- call AddGadget(DABHOST,20,60, "FGColor" , " FGColor ", "FGColor")
- call AddGadget(DABHOST,20,75, "Location" , " Location ", "Location")
- call AddGadget(DABHOST,20,90, "TextColor" , " TextColor ", "TextColor")
- call AddGadget(DABHOST,20,105,"Help" , " Help ", "Help")
-
- call AddGadget(DABHOST,140,15, "EndLink" , " EndLink ", "EndLink")
- call AddGadget(DABHOST,140,30, "Link" , " Link ", "Link")
- call AddGadget(DABHOST,140,45, "Run" , " Run ", "Run")
- call AddGadget(DABHOST,140,60, "Sound" , " Sound ", "Sound")
- call AddGadget(DABHOST,140,75, "Show" , " Show ", "Show")
- call AddGadget(DABHOST,140,90, "Anim" , " Anim ", "Anim")
- call AddGadget(DABHOST,140,105,"Play" , " Play ", "Play")
- call AddGadget(DABHOST,140,120,"ARexx" , " ARexx ", "ARexx")
- call AddGadget(DABHOST,140,135,"Rexx" , " Rexx ", "Rexx")
-
- call AddGadget(DABHOST,260,15, "Bold" , " Bold ", "Bold")
- call AddGadget(DABHOST,260,30, "Underline" , " Underline ", "Underline")
- call AddGadget(DABHOST,260,45, "Italics" , " Italics ", "Italics")
- call AddGadget(DABHOST,260,60, "Center" , " Center ", "Center")
- call AddGadget(DABHOST,260,75, "Indent" , " Indent ", "Indent")
- call AddGadget(DABHOST,260,90, "Format" , " Format ", "Format")
- call AddGadget(DABHOST,260,105,"FreeFormat", " FreeFormat ", "FreeFormat")
-
- start:
-
- quitflag = 0
- do forever until quitflag /* Until quitflag == 1 */
- call WaitPkt(DABPORT) /* RexxSupport function - wait for a message */
- p = GetPkt(DABPORT) /* RexxSupport - get message address pointer */
-
- if p ~== NULL() then do /* NULL = '0000 0000'x */
-
- argstring = getarg(p) /* RexxSupport Get Message String from */
- /* default slot 0 */
- t = reply(p,0) /* RexxSupport - return message packet to sender */
- thisarg = word(argstring,1) /* Rexx - get 1st word from string */
- say argstring
-
- if thisarg == 'CLOSEWINDOW' then do
- call QuitProg(yn)
- if yn = 'OKAY' then do
- call CloseWindow(DABHOST,'')
- quitflag = 1
- end
- end
-
- if thisarg == 'REFRESHWINDOW' then do
- call SetReqColor(DABHOST,BACKGROUNDPEN,1)
- call BackFill(DABHOST) /**** Refresh Background */
- call RefreshGadgets(DABHOST)
- end
-
-
- if thisarg == 'Font' then address TEXTRA @TEXT "\font "
- if thisarg == 'Title' then address TEXTRA @TEXT "\title "
- if thisarg == 'BGColor' then address TEXTRA @TEXT "\bgcolor "
- if thisarg == 'FGColor' then address TEXTRA @TEXT "\fgcolor "
- if thisarg == 'Location' then address TEXTRA @TEXT "\location "
- if thisarg == 'TextColor' then address TEXTRA @TEXT "\textcolor "
- if thisarg == 'Help' then address TEXTRA @TEXT "\help "
-
- if thisarg == 'Link' then address TEXTRA @TEXT "\link {"
- if thisarg == 'Run' then address TEXTRA @TEXT "\run {"
- if thisarg == 'Sound' then address TEXTRA @TEXT "\sound {"
- if thisarg == 'Show' then address TEXTRA @TEXT "\show {"
- if thisarg == 'Anim' then address TEXTRA @TEXT "\anim {"
- if thisarg == 'Play' then address TEXTRA @TEXT "\play {"
- if thisarg == 'ARexx' then address TEXTRA @TEXT "\arexx {"
- if thisarg == 'Rexx' then address TEXTRA @TEXT "\rexx {"
- if thisarg == 'EndLink' then address TEXTRA @TEXT "\endlink "
-
- if thisarg == 'Bold' then address TEXTRA @TEXT "\bold "
- if thisarg == 'Underline' then address TEXTRA @TEXT "\underline "
- if thisarg == 'Italics' then address TEXTRA @TEXT "\italics "
- if thisarg == 'Center' then address TEXTRA @TEXT "\center "
- if thisarg == 'Indent' then address TEXTRA @TEXT "\indent "
- if thisarg == 'Format' then address TEXTRA @TEXT "\format "
- if thisarg == 'FreeFormat' then address TEXTRA @TEXT "\freeformat "
-
- end /** if **/
-
- end /** do **/
-
- exit
-
-
- QuitProg:
- arg yn
- pmt = ' Are You Sure you want to Quit?'
- yn = Request(50,50,pmt,,'OK','Cancel')
- say yn
- return yn
-
-
- /* RexxWindow.rexx */
-
- RexxWindow:
- arg menuhost, menuport, xpos, ypos, wd, ht, titletxt
-
- 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+REFRESHWINDOW'
- flags = 'WINDOWCLOSE+WINDOWDRAG+WINDOWDEPTH+BACKFILL+ACTIVATE'
-
- call SetReqColor(menuhost,OKAYPEN,2) /**** Gadget Text */
- call SetReqColor(menuhost,BACKGROUNDPEN,1) /**** Gadget Background */
- call SetReqColor(menuhost,SHADOWPEN,2) /**** Gadget Shadow */
- call SetReqColor(menuhost,BLOCKPEN,1) /**** WindowDragBar etc. */
- call SetReqColor(menuhost,BOXPEN,0) /**** Gadget 'frame' */
-
- /* Open the window - top left edge at xpos,ypos */
- call OpenWindow(menuhost,xpos,ypos,wd,ht,idcmp,flags,titletxt)
- call SetAPen(menuhost,1)
- call SetBPen(menuhost,1)
- call SetDrMd(menuhost,JAM2)
-
- return 0 /**** RexxWindow */
-