/* */ signal on halt signal on break_c call Init call CreateApp call set("mwin","open",1) call HandleApp /***********************************************************************/ init: procedure l="rmh.library";if ~show("L",l) then;if ~AddLib(l,0,-30) then exit if AddLibrary("rxmui.library")~=0 then exit call RxMUIOpt("DebugMode ShowErr") call SetRxMUIStack(64000) return /***********************************************************************/ CreateApp: procedure app.Title="Listview example" app.Version="$VER: Listview examples 1.0 (5.12.2000)" app.Copyright="©2000, alfie" app.Author="alfie" app.Description="Listview example" app.Base="RXMUIEXAMPLE" app.SubWindow="mwin" mwin.Title="Listview example" mwin.ScreenTitle="Listview example" mwin.ID="MWIN" mwin.Contents="mgroup" mgroup.0="bg" bg.class="group" bg.Columns=3 bg.SameSize=1 bg.0 = Button("selall","Select _All") bg.1 = Button("selnone","Select _None") bg.2 = Button("seltoggle","Select _Toggle") bg.3 = Button("remact","Remove Acti_ve") bg.4 = Button("remall","Remove A_ll") bg.5 = Button("remsel","Remove Selecte_d") bg.6 = Button("getactive","Get act_ive") bg.7 = Button("getall","Get _all") bg.8 = Button("getsel","Get Sele_cted") bg.9 = Button("sort","_Sort") bg.10 = Button("readd","Add _Entryes") bg.11 = ToggleButton("showsecret","S_how Secret") mgroup.1="lg" lg.class="group" lg.0="lview" lview.Class="nlistview" lview.List="list" list.Title="First|Second|Third" list.Format="BAR," list.Columns=3 list.TitleClick=2 list.MultiSelect="shifted" list.DragSortable=1 list.DragType="immediate" list.MincoLSortable=0 list.TitleMark=0 res=NewObj("application","app") if res~=0 then exit call notify("selall","pressed",0,"list","select","all","on") call notify("selnone","pressed",0,"list","select","all","off") call notify("seltoggle","pressed",0,"list","select","all","toggle") call notify("remall","pressed",0,"list","clear") call notify("remact","pressed",0,"list","remove","active") call notify("remsel","pressed",0,"list","remove","selected") call notify("getactive","pressed",0,"app","return","call GetActive") call notify("getall","pressed",0,"app","return","call GetAll") call notify("getsel","pressed",0,"app","return","call GetSel") call notify("readd","pressed",0,"app","return","call AddEntries") call Notify("sort","pressed",0,"list","sort") call Notify("showsecret","Selected",0,"list","set","format","BAR,") call Notify("showsecret","Selected",1,"list","set","format","BAR,BAR,") call Notify("list","titleclick","everytime","list","sort2","triggervalue","add2values") call Notify("list","sorttype","everytime","list","set","titlemark","triggervalue") call Notify("mwin","closerequest",1,"app","returnid","quit") call AddEntries return /***********************************************************************/ HandleApp: procedure ctrl_c=2**12 do forever call NewHandle("app","h",ctrl_c) if and(h.Signals,2**12)~=0 then exit select when h.Event="QUIT" then exit otherwise interpret h.Event end end end /***********************************************************************/ AddEntries: procedure call DoMethod("list","insert","Alfonso|Ranieri|Secret 1","bottom") call DoMethod("list","insert","Emi|Ranieri|Secret 2","bottom") call DoMethod("list","insert","Paolo|Ranieri|Secret 3","bottom") call DoMethod("list","insert","Tiziana|Spognardi|Secret 4","bottom") return /***********************************************************************/ GetActive: procedure a=xget("list","active") if a>-1 then do call DoMethod("list","GetEntry",a,"e") say "Active ["a"]:" e end else say "No entry active" say return /***********************************************************************/ GetAll: procedure call DoMethod("list","GetEntries","A") if a.num>0 then do i=0 to a.num-1 say i":" a.i end else say "No entries" say return /***********************************************************************/ GetSel: procedure call DoMethod("list","GetSelected","a") if a.num>0 then do i=0 to a.num-1 call DoMethod("list","GetEntry",i,"e") say i":" e end else say "No entries" say return /***********************************************************************/ halt: break_c: exit /***********************************************************************/