home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / html.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  4.1 KB  |  146 lines

  1. /**/
  2.  
  3. parse arg file
  4.  
  5. signal on halt
  6. signal on break_c
  7.  
  8. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  9. if AddLibrary("rxmui.library")~=0 then exit
  10.  
  11. call createApp
  12. call SetNotifies
  13.  
  14. if file~="" then call domethod("html","gourl",file)
  15.  
  16. call set("win","open",1)
  17.  
  18. call handleApp
  19. exit
  20. /***********************************************************************/
  21. handleApp: procedure
  22.  
  23. ctrl_c=2**12
  24. do forever
  25.     call newhandle("APP","H",ctrl_c)
  26.     if and(h.signals,ctrl_c)>0 then exit
  27.     if h.event="QUIT" then exit
  28.  
  29.     if h.event="search" then do
  30.         call domethod("html","search",h.newcontents)
  31.         if rc then say h.newcontents "found"
  32.         else say h.newcontents "not found"
  33.     end
  34. end
  35. exit
  36. /***********************************************************************/
  37. err: procedure expose sigl rxmuierror
  38. parse arg res
  39. say sigl "["res"]"
  40.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  41.     exit
  42. /***********************************************************************/
  43. createApp: procedure
  44.     app.Title="Speedbar"
  45.     app.Version="$VER: Speedbar 1.0 (10.12.99)"
  46.     app.Copyright="©1999, alfie"
  47.     app.Author="alfie"
  48.     app.Description="Speedbar example"
  49.     app.Base="SPEEDBAR"
  50.     app.SubWindow="WIN"
  51.      win.ID="MAIN"
  52.      win.Title="Html Example"
  53.      win.Contents="MGROUP"
  54.      win.UseRightBorderScroller=1
  55.      win.UseBottomBorderScroller=1
  56.  
  57.       mgroup.0="bg"
  58.         bg.class="group"
  59.         bg.horiz=1
  60.         bg.0=button("abort","_Abort")
  61.         bg.1=button("reload","_Reload")
  62.         bg.2=button("stop","_Stop")
  63.         bg.3=button("play","_Play")
  64.         bg.4=button("flush","_Flush")
  65.  
  66.       mgroup.1="gg"
  67.         gg.class="group"
  68.         gg.horiz=1
  69.         gg.0=label("_Url")
  70.         gg.1="popu"
  71.          popu.class="popasl"
  72.          popu.string=string("url")
  73.  
  74.       mgroup.2="g"
  75.        g.class="group"
  76.        g.horiz=1
  77.        g.0="html"
  78.         html.class="htmlview"
  79.         html.frame="readlist"
  80.         html.contents="<html><head><title>test</title></head><body>hello world</body></html>"
  81.        g.1="sbr"
  82.         sbr.class="scrollbar"
  83.         sbr.usewinborder="right"
  84.         sbr.horiz=0
  85.  
  86.       mgroup.3="sbb"
  87.        sbb.class="scrollbar"
  88.        sbb.usewinborder="bottom"
  89.        sbb.horiz=1
  90.  
  91.       mgroup.4=text("info")
  92.  
  93.       mgroup.5="sg"
  94.         sg.class="group"
  95.         sg.horiz=1
  96.         sg.0=label("Searc_h")
  97.         sg.1=string("search")
  98.  
  99.     res=NewObj("APPLICATION","APP")
  100.     if res~=0 then do
  101.         ioerr=IoErr()
  102.         say ioerr
  103.         call err(res)
  104.     end
  105.  
  106.     return
  107. /***********************************************************************/
  108. setNotifies: procedure
  109.  
  110.     call Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  111.  
  112.  
  113.     call Notify("abort","pressed",0,"html","abort")
  114.     call Notify("reload","pressed",0,"html","reload")
  115.     call Notify("stop","pressed",0,"html","pauseanim")
  116.     call Notify("play","pressed",0,"html","continueanims")
  117.     call Notify("flush","pressed",0,"html","flushimage","triggervalue","triggervalue","triggervalue")
  118.  
  119.     call Notify("search","newcontents","everytime","app","return","search","triggerattr")
  120.  
  121.  
  122.     call Notify("html","clickedurl","everytime","url","set","contents","triggervalue")
  123.     call Notify("html","CURRENTURL","everytime","info","set","contents","triggervalue")
  124.  
  125.     call Notify("html","virtgroupwidth","everytime","sbb","set","entries","triggervalue")
  126.     call Notify("html","virtgroupleft","everytime","sbb","set","first","triggervalue")
  127.  
  128.     call Notify("html","width","everytime","sbb","set","visible","triggervalue")
  129.     call Notify("sbb","first","everytime","html","set","virtgroupleft","triggervalue")
  130.  
  131.     call Notify("html","virtgroupheight","everytime","sbr","set","entries","triggervalue")
  132.  
  133.     call Notify("html","virtgrouptop","everytime","sbr","set","first","triggervalue")
  134.  
  135.     call Notify("html","height","everytime","sbr","nonotifyset","visible","triggervalue")
  136.  
  137.  
  138.     call Notify("sbr","first","everytime","html","set","virtgrouptop","triggervalue")
  139.  
  140.     return
  141. /***********************************************************************/
  142. halt:
  143. break_c:
  144.     exit
  145. /**************************************************************************/
  146.