home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / envbrowser.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  2.5 KB  |  93 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 createApp
  10. call handleApp
  11.  
  12. /***********************************************************************/
  13. handleApp: procedure  expose global.
  14.     ctrl_c=2**12
  15.     do forever
  16.         call NewHandle("APP","H",ctrl_c)
  17.         if and(h.signals,ctrl_c)>0 then exit
  18.         select
  19.  
  20.             when h.event="QUIT" then exit
  21.  
  22.             when h.event="PARENT" then do
  23.                 call getattr("dlist","directory","P")
  24.                 call set("dlist","directory",pathpart(p))
  25.             end
  26.  
  27.             when h.event="DOUBLE" then do
  28.                 call getattr("dlist","Path","P")
  29.                 if word(statef(p),1)="DIR" then call set("dlist","directory",p)
  30.             end
  31.  
  32.             when h.event="DISPLAY" then do
  33.                 call getattr("dlist","Path","P")
  34.                 if word(statef(p),1)~="DIR" then cont=ReadFile(p)
  35.                 else cont=""
  36.                 call set("elcont","contents",cont)
  37.             end
  38.  
  39.             otherwise nop
  40.         end
  41.     end
  42.  
  43. /***********************************************************************/
  44. createApp: procedure expose global.
  45.  
  46.     app.title="EnvBrowser"
  47.     app.version="$Ver: EnvBrowser 19.5 (20.7.2000)"
  48.     app.copyright="Copyright 2000 by Alfie"
  49.     app.author="alfie"
  50.     app.description="View environment variables."
  51.     app.base="ENVBROWSER"
  52.     app.SubWindow="mwin"
  53.  
  54.      mwin.ID="MAIN"
  55.      mwin.title="Environment Browser"
  56.      mwin.contents="mgroup"
  57.  
  58.       call child("mgroup","elview","listview")
  59.        elview.list="dlist"
  60.         dlist.class="dirlist"
  61.         dlist.frame="inputlist"
  62.         dlist.directory="env:"
  63.  
  64.       call child("mgroup","elcont","textinputscroll")
  65.        elcont.FIXHEIGHTTXT="0a0a0a0a"x
  66.        elcont.frame="text"
  67.        elcont.multiline=1
  68.        elcont.noinput=1
  69.  
  70.       call child("mgroup",button("parent","_Parent"))
  71.  
  72.     if NewObj("application","app")>0 then exit
  73.  
  74.     call notify("mwin","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  75.  
  76.     call notify("elview","active","everytime","app","return","DISPLAY")
  77.     call notify("elview","doubleclick","everytime","app","return","DOUBLE")
  78.  
  79.     call notify("parent","pressed",0,"app","returnid")
  80.  
  81.     call set("mwin","open",1)
  82.     if ~xget("mwin","open") then do
  83.         say "can't open window"
  84.         exit
  85.     end
  86.  
  87.     return
  88. /***********************************************************************/
  89. halt:
  90. break_c:
  91.     exit
  92. /**************************************************************************/
  93.