/**/

parse arg file

signal on halt
signal on break_c

l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
if AddLibrary("rxmui.library")~=0 then exit

call createApp
call SetNotifies

if file~="" then call domethod("html","gourl",file)

call set("win","open",1)

call handleApp
exit
/***********************************************************************/
handleApp: procedure

ctrl_c=2**12
do forever
    call newhandle("APP","H",ctrl_c)
    if and(h.signals,ctrl_c)>0 then exit
    if h.event="QUIT" then exit

    if h.event="search" then do
        call domethod("html","search",h.newcontents)
        if rc then say h.newcontents "found"
        else say h.newcontents "not found"
    end
end
exit
/***********************************************************************/
err: procedure expose sigl rxmuierror
parse arg res
say sigl "["res"]"
    say getrxmuistring(res) "in line" sigl-1 rxmuierror
    exit
/***********************************************************************/
createApp: procedure
    app.Title="Speedbar"
    app.Version="$VER: Speedbar 1.0 (10.12.99)"
    app.Copyright="©1999, alfie"
    app.Author="alfie"
    app.Description="Speedbar example"
    app.Base="SPEEDBAR"
    app.SubWindow="WIN"
     win.ID="MAIN"
     win.Title="Html Example"
     win.Contents="MGROUP"
     win.UseRightBorderScroller=1
     win.UseBottomBorderScroller=1

      mgroup.0="bg"
        bg.class="group"
        bg.horiz=1
        bg.0=button("abort","_Abort")
        bg.1=button("reload","_Reload")
        bg.2=button("stop","_Stop")
        bg.3=button("play","_Play")
        bg.4=button("flush","_Flush")

      mgroup.1="gg"
        gg.class="group"
        gg.horiz=1
        gg.0=label("_Url")
        gg.1="popu"
         popu.class="popasl"
         popu.string=string("url")

      mgroup.2="g"
       g.class="group"
       g.horiz=1
       g.0="html"
        html.class="htmlview"
        html.frame="readlist"
        html.contents="<html><head><title>test</title></head><body>hello world</body></html>"
       g.1="sbr"
        sbr.class="scrollbar"
        sbr.usewinborder="right"
        sbr.horiz=0

      mgroup.3="sbb"
       sbb.class="scrollbar"
       sbb.usewinborder="bottom"
       sbb.horiz=1

      mgroup.4=text("info")

      mgroup.5="sg"
        sg.class="group"
        sg.horiz=1
        sg.0=label("Searc_h")
        sg.1=string("search")

    res=NewObj("APPLICATION","APP")
    if res~=0 then do
        ioerr=IoErr()
        say ioerr
        call err(res)
    end

    return
/***********************************************************************/
setNotifies: procedure

    call Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")


    call Notify("abort","pressed",0,"html","abort")
    call Notify("reload","pressed",0,"html","reload")
    call Notify("stop","pressed",0,"html","pauseanim")
    call Notify("play","pressed",0,"html","continueanims")
    call Notify("flush","pressed",0,"html","flushimage","triggervalue","triggervalue","triggervalue")

    call Notify("search","newcontents","everytime","app","return","search","triggerattr")


    call Notify("html","clickedurl","everytime","url","set","contents","triggervalue")
    call Notify("html","CURRENTURL","everytime","info","set","contents","triggervalue")

    call Notify("html","virtgroupwidth","everytime","sbb","set","entries","triggervalue")
    call Notify("html","virtgroupleft","everytime","sbb","set","first","triggervalue")

    call Notify("html","width","everytime","sbb","set","visible","triggervalue")
    call Notify("sbb","first","everytime","html","set","virtgroupleft","triggervalue")

    call Notify("html","virtgroupheight","everytime","sbr","set","entries","triggervalue")

    call Notify("html","virtgrouptop","everytime","sbr","set","first","triggervalue")

    call Notify("html","height","everytime","sbr","nonotifyset","visible","triggervalue")


    call Notify("sbr","first","everytime","html","set","virtgrouptop","triggervalue")

    return
/***********************************************************************/
halt:
break_c:
    exit
/**************************************************************************/
