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

  1. /* AttachedList example */
  2.  
  3. call init
  4. call createApp
  5. call handleApp()
  6. /* never reached */
  7. /***********************************************************************/
  8. init: procedure
  9.     l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  10.     if AddLibrary("rxmui.library")~=0 then exit
  11.     call RxMUIOpt("DebugMode ShowErr")
  12.     return
  13. /***********************************************************************/
  14. createApp: procedure
  15.     app.Title="AttachedListExample"
  16.     app.Version="$VER: AttachedListExample 1.0 (8.7.2001)"
  17.     app.Copyright="©2001 by Alfonso Ranieri"
  18.     app.Author="Alfonso Ranieri"
  19.     app.Description="AttachedList Example"
  20.     app.Base="ALIST"
  21.     app.SubWindow="mwin"
  22.      mwin.Title="AttachedList Example"
  23.      mwin.ID="MWIN"
  24.      mwin.Contents="mgroup"
  25.       mgroup.0="lv"
  26.        lv.class="Listview"
  27.        l.format="COL=0 BAR,COL=1"
  28.        l.CycleChain=1
  29.        lv.list="l"
  30.         l.0="Alfonso|337665323"
  31.         l.1="Paolo|32898765"
  32.         l.2="Emi|338299222"
  33.       mgroup.1="g"
  34.        g.class="group"
  35.        g.horiz=1
  36.          sort.CycleChain=1
  37.         g.0=Button("sort","_Sort")
  38.          add.CycleChain=1
  39.         g.1=Button("add","_Add")
  40.          remove.CycleChain=1
  41.         g.2=Button("remove","_Remove")
  42.       mgroup.2="sg"
  43.        sg.class="group"
  44.        sg.horiz=1
  45.          sa.CycleChain=1
  46.          sa.reject="|"
  47.         sg.0=String("sa")
  48.          sb.CycleChain=1
  49.          sb.reject="|"
  50.         sg.1=String("sb")
  51.  
  52.     if NewObj("application","app")~=0 then exit
  53.  
  54.     call Notify("mwin","closerequest",1,"app","returnid","quit")
  55.  
  56.     call Notify("sort","pressed",0,"lv","sort")
  57.  
  58.     call Notify("add","pressed",0,"lv","insert","","bottom")
  59.     call Notify("add","pressed",0,"lv","set","active","bottom")
  60.  
  61.     call Notify("remove","pressed",0,"lv","remove","active")
  62.  
  63.     call Notify("lv","active",-1,"sa","set","contents","")
  64.     call Notify("lv","active",-1,"sb","set","contents","")
  65.     call Notify("lv","activeentry0","everytime","sa","set","contents","triggervalue")
  66.     call Notify("lv","activeentry1","everytime","sb","set","contents","triggervalue")
  67.  
  68.     call Notify("sa","newcontents","everytime","lv","replacecol","active",0,"triggervalue")
  69.     call Notify("sb","newcontents","everytime","lv","replacecol","active",1,"triggervalue")
  70.  
  71.     call set("sa","AttachedList","lv")
  72.     call set("sb","AttachedList","lv")
  73.  
  74.     call set("mwin","defaultobject","lv")
  75.  
  76.     call set("mwin","open",1)
  77.     if ~xget("mwin","open") then exit
  78.  
  79.     return
  80. /***********************************************************************/
  81. handleApp: procedure
  82.     ctrl_c=2**12
  83.     do forever
  84.         call NewHandle("app","h",ctrl_c)
  85.         if h.event="QUIT" then exit
  86.         else interpret h.event
  87.     end
  88. /* never reached */
  89. /***********************************************************************/
  90.