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

  1. /**/
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. call Init
  7. call CreateApp
  8. call HandleApp
  9. /***********************************************************************/
  10. Init: procedure expose global.
  11.     l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  12.     if AddLibrary("rxmui.library")~=0 then exit
  13.     call rxmuiopt("debugmode showerr")
  14.     call setrxmuistack(16000)
  15.     return
  16. /***********************************************************************/
  17. CreateApp: procedure expose global.
  18.  
  19.     app.Title="Htmlview editor"
  20.     app.Version="$VER: HtmlviewEditor 1.0 (5.2.2002)"
  21.     app.Copyright="©2002, alfie"
  22.     app.Author="alfie"
  23.     app.Description="Htmlview editor"
  24.     app.Base="HTMLEDIT"
  25.     app.SubWindow="win"
  26.      win.ID="MAIN"
  27.      win.Title="Htmlview editor"
  28.      win.Contents="mgroup"
  29.      win.userightborderscroller=1
  30.      win.sizeright=1
  31.  
  32.       mgroup.0="bg"
  33.         bg.class="group"
  34.         bg.horiz=1
  35.         bg.0=button("open","_Open")
  36.         bg.2=button("save","_Save")
  37.         bg.1=button("insert","_Insert")
  38.  
  39.       mgroup.1="rg"
  40.        rg.class="Register"
  41.        rg.Titles="Text|Preview"
  42.        rg.0="tg"
  43.         tg.Horiz=1
  44.         tg.spacing=0
  45.         tg.class="group"
  46.         tg.Horiz=1
  47.         tg.spacing=0
  48.          tg.0="text"
  49.           text.class="texteditor"
  50.           text.frame="string"
  51.           text.FIXEDFONT=1
  52.           text.UseARexx=1
  53.           text.slider=XNewObj("scrollbar","tescr")
  54.          tg.1="tescr"
  55.        rg.1="sg"
  56.         sg.class="scrollgroup"
  57.         sg.aUseWinBorder=1
  58.         sg.virtgroupcontents="html"
  59.          html.class="htmlview"
  60.          html.frame="virtual"
  61.          html.ntautoload=1
  62.          html.nocontextmenu=0
  63.  
  64.     res=NewObj("APPLICATION","APP")
  65.     if res~=0 then exit
  66.     call Notify("win","closerequest",1,"app","returnid","quit")
  67.  
  68.     call Notify("open","pressed",0,"app","return","call openfile")
  69.     call Notify("insert","pressed",0,"app","return","call insertfile")
  70.     call Notify("save","pressed",0,"app","return","call savefile")
  71.     call Notify("rg","activepage",1,"app","return","call Preview()")
  72.  
  73.     call set("win","open",1)
  74.     return
  75. /***********************************************************************/
  76. HandleApp: procedure expose global.
  77.     do forever
  78.         call NewHandle("APP","H",2**12)
  79.         if and(h.signals,2**12)>0 then exit
  80.  
  81.         select
  82.             when h.event="QUIT" then exit
  83.             otherwise interpret h.event
  84.         end
  85.     end
  86. end
  87. /***********************************************************************/
  88. halt:
  89. break_c:
  90.     exit
  91. /**************************************************************************/
  92. Preview: procedure expose global.
  93.     call getattr("text","contents","c")
  94.     call set("html","contents",c)
  95.     return
  96. /***********************************************************************/
  97. openfile: procedure
  98.     if reqfile(f)~=0 then return
  99.     call domethod("text","open",addpart(f.drawer,f.file))
  100.     call pragma("D",f.drawer)
  101.     return
  102. /***********************************************************************/
  103. insertfile: procedure
  104.     if reqfile(f)~=0 then return
  105.     call domethod("text","insert",addpart(f.drawer,f.file))
  106.     call pragma("D",f.drawer)
  107.     return
  108. /***********************************************************************/
  109. savefile: procedure
  110.     if reqfile(f)~=0 then return
  111.     call domethod("text","save",addpart(f.drawer,f.file))
  112.     call pragma("D",f.drawer)
  113.     return
  114. /***********************************************************************/
  115.