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

  1. /**/
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  7. if AddLibrary("rxmui.library")~=0 then exit
  8. call rxmuiopt("debugmode showerr")
  9.  
  10. call createApp
  11. call SetNotifies
  12.  
  13. call set("win","open",1)
  14. call getattr("win","open","o")
  15. if o=0 then do
  16.     say "can't open window"
  17.     exit
  18. end
  19.  
  20. call handleApp
  21. exit
  22. /***********************************************************************/
  23. handleApp: procedure
  24. ctrl_c=2**12
  25. s=0
  26. do forever
  27.     call handle("APP","H",s)
  28.     do i=0 to h.num-1
  29.         if h.i="QUIT" then exit
  30.         say h.num-1 h.i
  31.     end
  32.     s=Wait(or(h.signals,ctrl_c))
  33.     if and(s,ctrl_c)>0 then exit
  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="Speedbar Example"
  53.      win.Contents="MGROUP"
  54.       mgroup.0="SPG"
  55.        spg.class="GROUP"
  56.        spg.horiz=1
  57.         spg.0="SPEEDBAR"
  58.          speedbar.class="SPEEDBAR"
  59.          speedbar.spread=0
  60.          speedbar.Horiz=1
  61.          speedbar.RaisingFrame=1
  62.          speedbar.Borderless=1
  63.           speedbar.0.Img="Pics/back.iff"
  64.           speedbar.0.Text="Back"
  65.           speedbar.1.Img="Pics/forward.iff"
  66.           speedbar.1.Text="Forward"
  67.           speedbar.2.Img="Pics/reload.iff"
  68.           speedbar.2.Text="Reload"
  69.           speedbar.3.Img="Pics/stop.iff"
  70.           speedbar.3.Text="Stop"
  71.           speedbar.4.Img="SPACER"
  72.           speedbar.5.Img="Pics/home.iff"
  73.           speedbar.5.Text="Home"
  74.           speedbar.6.Img="Pics/find.iff"
  75.           speedbar.6.Text="Find"
  76.         spg.1=hspace()
  77.       mgroup.1=HBar()
  78.       mgroup.2=vspace()
  79.        cg.class="group"
  80.        cg.0="cgf"
  81.         cgf.class="group"
  82.         cgf.columns=4
  83.          cgf.0=label("_BorderLess")
  84.          cgf.1=checkmark("BL",1,'b')
  85.          cgf.2=label("_RaisingFrame")
  86.          cgf.3=checkmark("RF",1,'r')
  87.          cgf.4=label("_SmallImages")
  88.          cgf.5=checkmark("SI",,'s')
  89.          cgf.6=label("Sunn_y")
  90.          cgf.7=checkmark("SN",,'y')
  91.        cg.1=MakeObj(,"HGroup",label("_View Mode"),MakeObj("cycle","Cycle","TextGfx|Gfx|Text","v"))
  92.       mgroup.3=MakeObj(,"HFRAMEGROUP","Config",MakeObj(,"HCenter","cg"))
  93.       mgroup.4=vspace()
  94.  
  95.     res=NewObj("APPLICATION","APP")
  96.     if res~=0 then do
  97.         ioerr=IoErr()
  98.         say ioerr
  99.         call err(res)
  100.     end
  101.     return
  102. /***********************************************************************/
  103. setNotifies: procedure
  104.     res=Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  105.     if res~=0 then call err(res)
  106.     res=Notify("BL","SELECTED","EVERYTIME","SPEEDBAR","SET","BORDERLESS","TRIGGERVALUE")
  107.     if res~=0 then call err(res)
  108.     res=Notify("RF","SELECTED","EVERYTIME","SPEEDBAR","SET","RAISINGFRAME","TRIGGERVALUE")
  109.     if res~=0 then call err(res)
  110.     res=Notify("SI","SELECTED","EVERYTIME","SPEEDBAR","SET","SMALLIMAGES","TRIGGERVALUE")
  111.     if res~=0 then call err(res)
  112.     res=Notify("SN","SELECTED","EVERYTIME","SPEEDBAR","SET","SUNNY","TRIGGERVALUE")
  113.     if res~=0 then call err(res)
  114.     res=Notify("SPEEDBAR.0","PRESSED",0,"APP","RETURNID")
  115.     if res~=0 then call err(res)
  116.     res=Notify("CYCLE","ACTIVE",0,"APP","RETURNID")
  117.     if res~=0 then call err(res)
  118.     res=Notify("CYCLE","ACTIVE",0,"SPEEDBAR","SET","VIEWMODE","TEXTGFX")
  119.     if res~=0 then call err(res)
  120.     res=Notify("CYCLE","ACTIVE",2,"SPEEDBAR","SET","VIEWMODE","TEXT")
  121.     if res~=0 then call err(res)
  122.     res=Notify("CYCLE","ACTIVE",1,"SPEEDBAR","SET","VIEWMODE","GFX")
  123.     if res~=0 then call err(res)
  124.     return
  125. /***********************************************************************/
  126. halt:
  127. break_c:
  128.     exit
  129. /**************************************************************************/
  130.