home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #2 / Amiga Plus CD - 2004 - No. 02.iso / AmigaPlus / Tools / Development / RxMUI / Examples / Listview.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2004-01-31  |  2.1 KB  |  73 lines

  1. /* A List with 2 columns */
  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. app.Title="ListExample"
  7. app.Version="$VER: ListExample 1.1 (29.1.2002)"
  8. app.Copyright="©2002, alfie"
  9. app.Author="alfie"
  10. app.Description="List Example"
  11. app.Base="RXMUIEXAMPLE"
  12. app.SubWindow="win"
  13.  win.Title="ListExample"
  14.  win.ID="WINL"
  15.  win.Contents="mgroup"
  16.  
  17.   mgroup.0="lv"
  18.    lv.Class="Listview"
  19.    lv.CycleChain=1
  20.    lv.List="l"
  21.     l.Format="BAR,"
  22.     l.0="Alfonso|1"
  23.     l.1="Paolo|2"
  24.     l.2="Emi|3"
  25.  
  26.   mgroup.1="g"
  27.    g.Class="Group"
  28.    g.Horiz=1
  29.     sort.CycleChain=1;   g.0=Button("sort","_Sort")
  30.     add.CycleChain=1;    g.1=Button("add","_Add")
  31.     remove.CycleChain=1; g.2=Button("remove","_Remove")
  32.  
  33.   mgroup.2="gg"
  34.    gg.Class="Group"
  35.    gg.Horiz=1
  36.      sa.CycleChain=1; sa.Reject="|"; gg.0=String("sa")
  37.      sb.CycleChain=1; sb.Reject="|"; gg.1=String("sb")
  38.  
  39. if NewObj("Application","app")>0 then exit
  40.  
  41.  
  42. call Notify("win","CloseRequest",1,"app","ReturnID","quit")
  43.  
  44. call Notify("sort","Pressed",0,"lv","Sort")
  45. call Notify("add","Pressed",0,"l","Insert","","Bottom")
  46. call Notify("add","Pressed",0,"l","Set","Active","Bottom")
  47. call Notify("Remove","Pressed",0,"l","Remove","Active")
  48.  
  49. call Notify("l","ActiveEntry","Everytime","app","Return","say 'Active entry:' h.ActiveEntry","TriggerAttr")
  50. call Notify("l","Active","Everytime","app","Return","say 'Active:' h.Active","TriggerAttr")
  51.  
  52. call Notify("l","Active",-1,"sa","Set","Contents","")
  53. call Notify("l","Active",-1,"sb","Set","Contents","")
  54.  
  55. call Notify("l","ActiveEntry0","Everytime","sa","Set","Contents","TriggerValue")
  56. call Notify("l","ActiveEntry1","Everytime","sb","Set","Contents","TriggerValue")
  57.  
  58. call Notify("sa","NewContents","Everytime","l","ReplaceCol","Active",0,"TriggerValue")
  59. call Notify("sb","NewContents","Everytime","l","ReplaceCol","Active",1,"TriggerValue")
  60.  
  61. call set("l","Active",0)
  62.  
  63. set.DefaultObject="lv"
  64. set.Open=1
  65. call SetAttrs("win","set")
  66.  
  67. do forever
  68.     call NewHandle("app","h",2**12)
  69.     if and(h.signals,2**12)>0 then exit
  70.     if h.event="QUIT" then exit
  71.     interpret h.event
  72. end
  73.