home *** CD-ROM | disk | FTP | other *** search
RISC OS BBC BASIC V Source | 1996-06-16 | 7.2 KB | 344 lines |
- > <DeHTML$Dir>.!RunImage
- -=[-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-]=-
- -=[ DeHTML v0.01 ]=-
- -=[ Front End by Chime/DiGiTAL ViSiON '95 ]=-
- -=[ DeHTMLer by Philip R. Banks 1995 ]=-
- -=[-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-]=-
- q% &400,icons% &400,ic% 128,temp% &400
- +task$="DeHTML":icon_memory%=icons%+&400
- error:
- "<DeHTML$Dir>.DeHTML"
- "Wimp_Initialise",200,&4B534154,task$
- version%,task%
- "Hourglass_On"
- 8info_win%=
- load_win("Info","<DeHTML$Dir>.Templates")
- =save_win%=
- load_win("xfer_send","<DeHTML$Dir>.Templates")
- %bar_icon%=
- icon_on_bar("!dehtml")
- 4m_menu%=
- make_menu("DeHTML\Info>info_win%\Quit")
- *xdragstart%=
- swi("XDragASprite_Start")
- finished%=
- get_args
- "Hourglass_Off"
- error
- closedown
- get_args
- mess%,mess$,key$,start_file$,end_file$
- "OS_GetEnv"
- mess%
- #mess$=
- process(
- get_adr(mess%))
- )key$="infile,outfile,length/k,quit/s"
- "OS_ReadArgs",key$,mess$,q%,1024
- q%!0=0
- start_file$=""
- start_file$=
- get_adr(q%!0)
- q%!4=0
- end_file$=""
- end_file$=
- get_adr(q%!4)
- q%!8=0
- line_length%=76
- line_length%=
- get_adr(q%!8))
- autoquit%=(q%!12<>0)
- start_file$<>""
- end_file$<>""
- convert(line_length%)
- upper(c$)
- d$,e$,l:d$=""
- l=1
- e$=
- c$,l,1)
- (e$)>=97
- (e$)<=122
- (e$)-32)
- d$+=e$
- process(a$)
- pos%
- upper(
- a$,5))="BASIC"
- pos%=
- a$,"""")
- pos%=
- a$,"""",pos%+1)
- a$=
- a$,pos%+1)
- strip(a$)
- put_text(window%,icon%,text$)
- ;#temp%!0=window% : temp%!4=icon%
- "Wimp_GetIconState",,temp%
- $(temp%!28)=text$
- >#temp%!0=window% : temp%!4=icon%
- temp%!8=0 : temp%!12=0
- "Wimp_SetIconState",,temp%
- open(w%)
- D'!q%=w%:
- "Wimp_GetWindowState",,q%
- "Wimp_OpenWindow",,q%
- error
- I !q%=
- J#$(q%+4)=
- $+" (Line "+
- +")"+
- "Wimp_ReportError",q%,1,task$
- find(f$)
- "OS_File",5,f$
- =(f%=1)
- load_win(window$,template$)
- c%,i%,n%,j%,sp$,sp2$
- "Wimp_OpenTemplate",,template$
- "Wimp_LoadTemplate",,q%,icons%,icon_memory%,-1,window$,0
- ,,icons%
- q%!64=1
- "Wimp_CreateWindow",,q%
- "Wimp_CloseTemplate"
- win_to_top(window%)
- !q%=window%
- "Wimp_GetWindowState",,q%
- q%!28=-1
- "Wimp_OpenWindow",,q%
- closedown
- "Wimp_CloseDown",task%,&4B534154
- mask%,event%,a,c
- mask%=%10000001100000110001
- "Wimp_Poll",mask%,q%
- event%
- event%
- 1 :
- Wimp_PollDrawWindow
- 2 :
- "Wimp_OpenWindow",,q%
- 3 :
- "Wimp_CloseWindow",,q%
- 6 :
- click
- 7 :
- save_message
- 9 :
- 17,18 :
- message_received
- finished%
- save_message
- xdragstart%<>-1
- "XDragASprite_Stop"
- "Wimp_GetPointerInfo",,q%
- q%!32=q%!4:q%!28=!q%
- q%!24=q%!16:q%!20=q%!12
- q%!16=1:q%!12=0
- q%!40=&FFF
- q%!36=0
- 3$(q%+44)=
- leaf_name(
- icon_text(save_win%,1))+
- !q%=60
- "Wimp_SendMessage",17,q%,q%!20,q%!24
- leaf_name(s$)
- s$,".")>0
- s$,".")+1)
- message_received
- file$
- q%!16
- 0 : finished%=
- 2 :
- q%!36<>-1
- ( end_file$=
- get_adr(q%+44)
- /
- put_text(save_win%,1,end_file$)
- -
- "Wimp_GetCaretPosition",,q%
- Y
- !q%=save_win%
- "Wimp_SetCaretPosition",save_win%,1,,,-1,
- (end_file$)
-
- save_file
-
- close(save_win%)
-
- 3 :
- q%!40=&FAF
- 2 start_file$=
- strip(
- get_adr(q%+44))
- -
- ack(4):
- win_to_top(save_win%)
- <
- "Wimp_SetCaretPosition",save_win%,1,,,-1,9
- =
- put_text(save_win%,1,
- leaf_name(start_file$))
-
- key_pressed
- !q%
- save_win% :
- q%!4=1
- !
- q%!24
- (
- 13 :
- save_file
- ,
- 398,399 :
- up/down
- 5
- "Wimp_ProcessKey",q%!24
-
-
- big_rep(s$)
- !q%=0:$(q%+4)=s$+
- "Wimp_ReportError",q%,%10001,task$
- ack(m%)
- q%!12=q%!8
- q%!16=m%
- "Wimp_SendMessage",17,q%,q%!4
- icon_text(window%,icon%)
- ?temp%!0=window%:temp%!4=icon%:
- "Wimp_GetIconState",,temp%
- =$(temp%!28)
- !q%=1
- finished%=
- "Wimp_GetPointerInfo",,q%
- (q%!8
- 1)>0
- "Wimp_CreateMenu",,m_open%
- click
- temp_v%
- (q%!8
- 2)>0
- q%!12
- -2 :
- "Wimp_CreateMenu",,m_menu%,!q%-64,184:m_open%=m_menu%
- q%!12
- save_win% :
- q%!16
- .
- 2 :
- (q%!8
- &50)>0
- save_dragbox
- )
- 0 :
- (q%!8
- 5)>0
- save_file
-
- save_file
- file$
- Gq%!0=save_win%:q%!4=1:
- "Wimp_GetIconState",,q%:end_file$=$(q%!28)
- end_file$,".")
- 0 :
- report("To save, drag the icon to a directory window")
- convert(line_length%):
- close(save_win%)
- save_dragbox
- x%,y%,ysize%
- .!q%=save_win%:
- "Wimp_GetWindowState",,q%
- 'x%=q%!4-q%!20:y%=q%!16-q%!24:q%!4=2
- "Wimp_GetIconState",,q%
- *q%!8+=x%:q%!12+=y%:q%!16+=x%:q%!20+=y%
- -q%!24=0:q%!28=0:q%!32=(
- mv(11)+1)<<
- mv(4)
- *q%!36=(
- mv(12)+1)<<
- mv(5):!q%=0:q%!4=5
- xdragstart%<>-1
- read_cmos(28)
- 2)>0
- xdragstart%,%11000101,1,"file_fff",q%+8,q%+24
- "Wimp_DragBox",,q%
- mv(m%)
- "OS_ReadModeVariable",-1,m%
- ,,v%
- read_cmos(byte%)
- "OS_Byte",161,byte%
- ,,byte%
- =byte%
- set_icon_flags(!temp%,temp%!4,temp%!8,temp%!12)
- "Wimp_SetIconState",,temp%
- close(w%)
- *!temp%=w%:
- "Wimp_CloseWindow",,temp%
- Wimp_PollDrawWindow
- more%
- "Wimp_RedrawWindow",,q%
- more%
- more%
- "Wimp_GetRectangle",,q%
- more%
- get_adr(array%)
- s$:s$=""
- (?array%>31
- (s$)<255):s$+=
- (?array%):array%+=1:
- make_menu(menu$)
- menu%,index%,width%,length%,k%,s%,unknown%
- menu% 28+
- Wimp_MenuNoOfEntries(menu$)*24
- menu%!12=&70207
- +menu%!16=140 : menu%!20=44 : menu%!24=0
- index%=menu%+28
- $menu%=
- menu$,
- menu$,"\")-1)
- #width%=
- menu$,
- menu$,"\")-1))
- $menu$+="\" : Menu_NoOfEntries%=0
- menu$<>""
- menu$=
- menu$,
- menu$,"\")+1)
- menu$
- 1 !index%=0 : index%!4=-1 : index%!8=&7000021
- length%=
- menu$,"\")-1
- k%=
- menu$,length%),">")
- % s%=
- menu$,k%+1,length%-k%))
- index%!4=s%
- length%=k%-1
- " $(index%+12)=
- menu$,length%)
- length%>width%
- width%=length%
- index%+=24
- menu%!16=width%*16+32
- "(index%!-24=index%!-24
- &80 : =menu%
- Wimp_MenuNoOfEntries(menu$)
- n% ,j% : n%=0 : j%=0
- menu$,"\",j%+1)
- j%<>0
- n%+=1
- j%=0
- icon_on_bar(s$)
- icon%
- .Cq%!0=-1:q%!4=0:q%!8=0:q%!12=68:q%!16=68:q%!20=&2002:$(q%+24)=s$
- "Wimp_CreateIcon",,q%
- icon%
- =icon%
- strip(s$)
- s$)=" ":s$=
- s$,1)=" ":s$=
- s$,2):
- swi(swi$)
- swi%,ok%
- "XOS_SWINumberFromString",,swi$
- swi%;ok%
- (ok%
- 1)>0 swi%=-1
- ; =swi%
-