home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 19 / AACD19.BIN / AACD / Programming / rxmui / examples / bal.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-01-29  |  4.4 KB  |  176 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.  
  9. call rxmuiopt("showerr debugmode")
  10.  
  11. global.idx=0
  12. global.background.0="BACKGROUND"
  13. global.background.1="SHADOW"
  14. global.background.2="SHINE"
  15. global.background.3="FILL"
  16. global.background.4="SHADOWBACK"
  17. global.background.5="SHADOWFILL"
  18. global.background.6="SHADOWSHINE"
  19. global.background.7="FILLBACK"
  20. global.background.8="FILLSHINE"
  21. global.background.9="SHINEBACK"
  22. global.background.10="FILLBACK2"
  23. global.background.11="HSHINEBACK"
  24. global.background.12="HSHADOWBACK"
  25. global.background.13="HSHINESHINE"
  26. global.background.14="HSHADOWSHADOW"
  27. global.background.14="MARKSHINE"
  28. global.background.15="MARKHALFSHINE"
  29. global.background.16="MARKBACKGROUND"
  30.  
  31. call CreateApp
  32. call handleApp
  33.  
  34.  
  35. /***********************************************************************/
  36. CreateApp: procedure expose global.
  37.  
  38.     app.Title="Balancing"
  39.     app.Version="$VER: Balancing 1.0 (26.9.00)"
  40.     app.Copyright="©200, alfie"
  41.     app.Author="alfie"
  42.     app.Description="Balancing example"
  43.     app.Base="BALANCING"
  44.     app.helpfile="a.guide"
  45.     app.SubWindow="WIN"
  46.      win.ID="MAIN"
  47.      win.Title="Balancing"
  48.      win.width=-250
  49.      win.height=-250
  50.      win.Contents="MGROUP"
  51.       mgroup.class="group"
  52.       mgroup.horiz=1
  53.  
  54.        call child("mgroup","g0","group")
  55.         g0.frame="group"
  56.         g0.weight=15
  57.         g0.0=rect("text",50)
  58.         g0.1=rect("text",100)
  59.         g0.2=MakeObj(,"balance")
  60.         g0.3=rect("text",200)
  61.  
  62.        call child("mgroup",MakeObj(,"balance"))
  63.  
  64.        call child("mgroup","g1","group")
  65.         g1.frame="group"
  66.         call child("g1","g10","group")
  67.          g10.horiz=1
  68.          g10.0=rect("text",,1)
  69.          g10.1=MakeObj(,"balance")
  70.          g10.2=rect("text",,1)
  71.         call child("g1","g11","group")
  72.          g11.horiz=1
  73.          g11.0=rect("text")
  74.          g11.1=MakeObj(,"balance")
  75.          g11.2=rect("text")
  76.          g11.3=MakeObj(,"balance")
  77.          g11.4=rect("text")
  78.          g11.5=MakeObj(,"balance")
  79.          g11.6=rect("text")
  80.          g11.7=MakeObj(,"balance")
  81.          g11.8=rect("text")
  82.         call child("g1","g12","group")
  83.          g12.horiz=1
  84.          g12.frame="group"
  85.          call child("g12","g120","group")
  86.           g120.horiz=1
  87.            g120.0=rect("text")
  88.            g120.1=MakeObj(,"balance")
  89.            g120.2=rect("text")
  90.          call child("g12",MakeObj(,"balance"))
  91.          call child("g12","g121","group")
  92.           g121.horiz=1
  93.            g121.0=rect("text")
  94.            g121.1=MakeObj(,"balance")
  95.            g121.2=rect("text")
  96.         call child("g1","g13","group")
  97.          g13.horiz=1
  98.          g13.frame="group"
  99.           g13.0=rect("text",50)
  100.           g13.1=rect("text",100)
  101.           g13.2=MakeObj(,"balance")
  102.           g13.3=rect("text",200)
  103.         call child("g1","g14","group")
  104.          g14.horiz=1
  105.          g14.frame="group"
  106.           g14.0=button("also","Also")
  107.           g14.1=MakeObj(,"balance")
  108.           g14.2=button("try","Try")
  109.           g14.3=MakeObj(,"balance")
  110.           g14.4=button("sizing","Sizing")
  111.           g14.5=MakeObj(,"balance")
  112.           g14.6=button("with","With")
  113.           g14.7=MakeObj(,"balance")
  114.           g14.8=button("shift","Shift")
  115.           g14.9=MakeObj(,"balance")
  116.         call child("g1","g15","group")
  117.          g15.horiz=1
  118.          g15.frame="group"
  119.           g15.0=label("Label 1:")
  120.           g15.1=text("data","data...")
  121.           g15.2=MakeObj(,"balance")
  122.           g15.3=label("Label 2:")
  123.           g15.4=text("more","more data...")
  124.  
  125.     res=NewObj("APPLICATION","APP")
  126.     if res~=0 then call err(res)
  127.  
  128.     call Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  129.  
  130.     call set("win","defaultobject",mgroup.1)
  131.  
  132.     call set("win","open",1)
  133.     call getattr("win","open","o")
  134.     if o=0 then do
  135.         say "can't open window"
  136.         exit
  137.     end
  138.  
  139.     return
  140. /**************************************************************************/
  141. handleApp: procedure
  142.     do forever
  143.         call newhandle("APP","H",2**12)
  144.         if and(h.signals,2**12)>0 then exit
  145.         select
  146.             when h.event="QUIT" then exit
  147.             otherwise nop
  148.         end
  149. end
  150. exit
  151. /***********************************************************************/
  152. err:
  153. parse arg res
  154.     exit
  155. /***********************************************************************/
  156. halt:
  157. break_c:
  158.     exit
  159. /**************************************************************************/
  160. rect: procedure expose global.
  161. parse arg f,w,putid
  162.     name="rect"global.idx
  163.     global.idx=global.idx+1
  164.  
  165.     if f~="" then rec.frame=f
  166.     if w~="" then rec.weight=w
  167.     if putid~="" then rec.objectid=global.idx
  168.  
  169.     i=random(0,17,time(s))
  170.     rec.background=global.background.i
  171.  
  172.     res=newobj("rectangle",name,"rec")
  173.     if res~=0 then call err(res)
  174.     return name
  175. /**************************************************************************/
  176.