home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Programming / RxMUI / Examples / listview.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-09-23  |  2.4 KB  |  101 lines

  1. /* */
  2.  
  3. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  4. if AddLibrary("rxmui.library")~=0 then exit
  5.  
  6. lv.list="l"
  7. lv.input=1
  8. l.format="COL=0 BAR,COL=1"
  9.  l.0="Alfonso|1"
  10.  l.1="Paolo|2"
  11.  l.2="Emi|3"
  12. res=newobj("listview","lv")
  13. if res~=0 then call err(res)
  14.  
  15. app.Title="ListExample"
  16. app.Version="$VER: ListExample 1.0 (22.11.99)"
  17. app.Copyright="©1999, alfie"
  18. app.Author="alfie"
  19. app.Description="List Example"
  20. app.Base="SHOW"
  21. app.SubWindow="WIN"
  22.  win.Title="ListExample"
  23.  win.ID="SHOW"
  24.  win.Contents="MGROUP"
  25.   mgroup.0="lv"
  26.   mgroup.1="G"
  27.    g.class="GROUP"
  28.    g.horiz=1
  29.     g.0=Button("SORT","_Sort")
  30.     g.1=Button("ADD","_Add")
  31.     g.2=Button("REMOVE","_Remove")
  32.   mgroup.2="GG"
  33.    gg.class="GROUP"
  34.    gg.horiz=1
  35.     sa.reject="|";gg.0=String("SA")
  36.     sb.reject="|";gg.1=String("SB")
  37.  
  38. res=NewObj("application","app")
  39. if res~=0 then call err(res)
  40.  
  41. res=Notify("win","closerequest",1,"app","returnid","quit")
  42. if res~=0 then call err(res)
  43.  
  44. res=Notify("sort","pressed",0,"lv","sort")
  45. if res~=0 then call err(res)
  46.  
  47. res=Notify("add","pressed",0,"lv","insert","","bottom")
  48. if res~=0 then call err(res)
  49.  
  50. res=Notify("add","pressed",0,"lv","set","active","bottom")
  51. if res~=0 then call err(res)
  52.  
  53. res=Notify("remove","pressed",0,"lv","remove","active")
  54. if res~=0 then call err(res)
  55.  
  56. res=Notify("lv","activeentry","everytime","app","returnid")
  57. if res~=0 then call err(res)
  58.  
  59. res=Notify("lv","active",-1,"sa","set","contents","")
  60. if res~=0 then call err(res)
  61.  
  62. res=Notify("lv","active",-1,"sb","set","contents","")
  63. if res~=0 then call err(res)
  64.  
  65. res=Notify("lv","activeentry0","everytime","sa","set","contents","triggervalue")
  66. if res~=0 then call err(res)
  67.  
  68. res=Notify("lv","activeentry1","everytime","sb","set","contents","triggervalue")
  69. if res~=0 then call err(res)
  70.  
  71. res=Notify("sa","newcontents","everytime","lv","replacecol","active",0,"triggervalue")
  72. if res~=0 then call err(res)
  73.  
  74. res=Notify("sb","newcontents","everytime","lv","replacecol","active",1,"triggervalue")
  75. if res~=0 then call err(res)
  76.  
  77. call set("lv","active",0)
  78.  
  79. res=set("win","defaultobject","lv")
  80. if res~=0 then call err(res)
  81.  
  82. res=set("win","open",1)
  83. if res~=0 then call err(res)
  84.  
  85. s=0
  86. do forever
  87.     call handle("APP","H",s)
  88.     do i=0 to h.num-1
  89.         say h.num-1 h.i
  90.         if h.i="QUIT" then exit
  91.     end
  92.     s=Wait(or(h.signals,2**12))
  93.     if and(s,2**12)~=0 then exit
  94. end
  95. exit
  96.  
  97. err: procedure expose sigl
  98. parse arg res
  99.     say getrxmuistring(res) "in line" sigl-1
  100.     exit
  101.