home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
a
/
abode
/
!Abode
/
Source
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1994-08-23
|
18KB
|
831 lines
><Abode$Dir>.Source
This application is FreeWare. (c) 1992,1993,1994 Dick Alstein
Appl$="Abode"
Version$="1.20 (23-Aug-94)"
error
quit%=
.mask%=(1<<4)+(1<<5)+(1<<7)+(1<<11)+(1<<12)
"OS_ReadMonotonicTime"
blinktime%
F blinktime%=(blinktime%+blinkperiod%)-(blinktime%
blinkperiod%)
"Wimp_PollIdle",mask%,blk%,blinktime%
reason%
reason%
blinkcaret
+
"OS_ReadMonotonicTime"
time%
time%>rmamintime%
B
minimizerma%
"XOS_ChangeDynamicArea",1,-(1<<24)
! rmamintime%=time%+100
)
2 :
"XWimp_OpenWindow",,blk%
)
3 :
"Wimp_CloseWindow",,blk%
?
6 :
mouseclick(blk%!0,blk%!4,blk%!8,blk%!12,blk%!16)
)
8 :
key(blk%!0,blk%!4,blk%!24)
9 :
menuselect(blk%)
1
17,18 :
receive(blk%!4,blk%!8,blk%!16)
quit%
msg_exit
"Wimp_CloseDown"
access(name$,type%)
ofs%,read%,item$,itemtype%,i%,N$
"OS_File",5,name$
,,,,,attr%
type%=2
&+ attr%=(attr%
&F7)
(access%
&08)
(# attr%=(attr%
&C4)
access%
dontlocksetup%
*$ N$=
upcase(
leafname(name$))
+
msg_lookup0(N$)<>""
attr%=attr%
-
"XOS_File",4,name$,,,,attr%
;flg%
(flg%
complain(
msg_lookup1("NoAccess",name$))
type%=2
ofs%=0
6
7B
"OS_GBPB",10,name$,blk%,1,ofs%,40,"*"
,,,read%,ofs%
read%
itemtype%=blk%!16
:) item$=name$+"."+
str(blk%+20)
;$
access(item$,itemtype%)
=
(read%=0)
(flg%
basicload(file$)
dodir%
"Wimp_StartTask","Dir "+
dirname(file$)
"XOS_Module",18,"ARMBasicEditor"
;flg%
((flg%
1)=0)
-1)
insertcmd("EDIT")
insertcmd("MODE MODE")
"Wimp_StartTask","Basic -load "+file$
blinkcaret
blink%
"Wimp_GetCaretPosition",,ct%
(ct%!0<>-1)
(ct%!16<>-1)
ct%!16=(ct%!16)
(1<<25)
TI
"Wimp_SetCaretPosition",ct%!0,ct%!4,ct%!8,ct%!12,ct%!16,ct%!20
complain(text$)
dummy%
dummy%=
errbox(text$,17)
defaultstatus
mode%=1
access%=&03
dodir%=
confirm%=
blink%=
newtype$="Text"
cmd$=""
dontlocksetup%=
pullfront%=
pullfrontkey%=&1EA
blinkperiod%=25
minimizerma%=
taskwindow%=
dirname(F$)
p%,q%
F$,".",p%)
q% > 0
p%=q%+1
q%=0
F$,p%-2)
errbox(err$,boxes%)
errblk%!0=0
$(errblk%+4)=err$+
"Wimp_ReportError",errblk%,boxes%,Appl$
,click%
=(click%=1)
error
"Wimp_CloseDown" :
errbox(
$+" (line "+
)+")",3)
"Wimp_CloseDown"
flg%
errblk% &100
"Wimp_Initialise",200,&4B534154,Appl$
osversion%,thistask%
error
blk% &400
indsize%=&400
indir% indsize%
indirend%=indir%+indsize%
ptrinfo% 20
varbuf% 256
newtype$="Text"
emptystr% 4
$emptystr%=""
ct% 24
accessbit%(4)
accessbit%(0)=&08
accessbit%(1)=&01
accessbit%(2)=&02
accessbit%(3)=&10
accessbit%(4)=&20
msg_init
"OS_ReadMonotonicTime"
rmamintime%
readscreenvars
loadstatus
%spfilename$="<Abode$Dir>.Sprites"
"OS_ReadModeVariable",27,0
;flg% :
test if hires modes available
(flg%
2)=0
spfilename$+="22"
"OS_File",17,spfilename$
,,,,spsize%
spsize%+=16
sparea% spsize%
sparea%!0=spsize%
sparea%!8=16
"OS_SpriteOp",256+9,sparea%
"OS_SpriteOp",256+10,sparea%,spfilename$
spname% 14
$spname%="abode_"+
(mode%)
mode%=4
(access%
accessbit%(0))
$spname%+="b"
$spname%+="a"
blk%!0=-1
blk%!4=0 : blk%!8=0
blk%!12=68 : blk%!16=68
blk%!20=&7000311A
blk%!24=spname%
blk%!28=sparea%
blk%!32=12
"Wimp_CreateIcon",,blk%
baricon%
"Wimp_OpenTemplate",,"<Abode$Dir>.Templates"
*infowin%=
loadtemplate("Info",sparea%)
!$(blk%!(92+32*3+20))=Version$
.accesswin%=
loadtemplate("Access",sparea%)
,optwin%=
loadtemplate("Options",sparea%)
'pullfrontkeystr%=blk%!(92+32*11+20)
1grabkeywin%=
loadtemplate("GrabKeys",sparea%)
"Wimp_CloseTemplate"
I%=0
selecticon(accesswin%,I%,(access%
accessbit%(I%)))
selecticon(optwin%,1,dodir%)
selecticon(optwin%,2,dontlocksetup%)
selecticon(optwin%,3,confirm%)
selecticon(optwin%,4,blink%)
selecticon(optwin%,5,pullfront%)
selecticon(optwin%,6,minimizerma%)
shadeicon(optwin%,8,
blink%)
shadeicon(optwin%,9,
blink%)
selecticon(optwin%,14,taskwindow%)
:blk%!0=grabkeywin% :
open grabkeys window off-screen
"Wimp_GetWindowState",,blk%
blk%!4=(blk%!4)-10000
blk%!8=(blk%!8)-10000
blk%!12=(blk%!12)-10000
blk%!16=(blk%!16)-10000
blk%!28=-1
"Wimp_OpenWindow",,blk%
preparemenus
insertcmd(s$)
i%=1
"OS_Byte",138,0,
s$,i%,1))
"OS_Byte",138,0,13
key(window%,icon%,key%)
val%,ok%
(window%=optwin%)
(icon%=11)
val%=0
validhotkey(key%)
- $(pullfrontkeystr%)=
hotkeyname(key%)
!
selecticon(optwin%,11,0)
I
"Wimp_SetCaretPosition",optwin%,11,,,-1,
($(pullfrontkeystr%))
pullfrontkey%=key%
(key%=27)
(key%=13)
6 $(pullfrontkeystr%)=
hotkeyname(pullfrontkey%)
!
selecticon(optwin%,11,0)
I
"Wimp_SetCaretPosition",optwin%,11,,,-1,
($(pullfrontkeystr%))
pullfront%
(key%=pullfrontkey%)
*
"Wimp_GetPointerInfo",,ptrinfo%
(ptrinfo%!12)>=0
blk%!0=ptrinfo%!12
(
"Wimp_GetWindowState",,blk%
!
((blk%!32)
(1<<17))
blk%!28=-2
blk%!28=-1
-
"Wimp_SendMessage",2,blk%,blk%!0
!
"Wimp_ProcessKey",key%
validhotkey(val%)
ok%=
(val%
&F)
1,2,3,4,5,6,7,8,9
ok%=(val%>=&181)
10,11,12
ok%=(val%>=&1CA)
hotkeyname(val%)
name$
name$=""
(val%
&10)
name$+=
(139)
(val%
&20)
name$+="^"
name$+="F"+
(val%
=name$
leafname(f$)
p%,q%
p%=q%+1
q%=
f$,".",p%)
q%=0
f$,p%)
loadstatus
type$
("<Abode$Dir>.Status")
F%=0
complain(
msg_lookup0("NoStLoad"))
defaultstatus
#F%,mode%,access%,dodir%,confirm%,blink%,type$,cmd$
#F%,dontlocksetup%,pullfront%,pullfrontkey%
#F%,blinkperiod%,minimizerma%,taskwindow%
mode% < 1
mode% > 5
mode%=1
(type$)>0)
(type$)<12)
newtype$=type$
newtype$="Text"
loadtemplate(name$,spptr%)
handle%,i%
"Wimp_CloseTemplate" :
error
"Wimp_LoadTemplate",,blk%+4,indir%,indirend%,-1,name$,0
,,indir%
blk%!68=spptr%
blk%!88>0
i%=0
blk%!88
f%=blk%!(92+i%*32+16)
(f%
&103)=&102
B# blk%!(92+i%*32+24)=spptr%
C
"Wimp_CreateWindow",,blk%+4
handle%
=handle%
msg_init
fname$,flags%,size%,buf%
K!fname$="<Abode$Dir>.Messages"
"MessageTrans_FileInfo",,fname$
flags%,,size%
flags%
buf%=0
buf% size%
MsgDesc% 17+
(fname$)
$(MsgDesc%+16)=fname$
"MessageTrans_OpenFile",MsgDesc%,MsgDesc%+16,buf%
msg_exit
"MessageTrans_CloseFile",MsgDesc%
MsgDesc%=0
msg_lookup0(token$)
result%,flg%
"XMessageTrans_Lookup",MsgDesc%,token$,0
,,result%;flg%
(flg%
` =""
str(result%)
msg_lookup1(token$,param$)
result%
"MessageTrans_Lookup",MsgDesc%,token$,blk%,&100,param$
,,result%
str(result%)
mouseclick(xpos%,ypos%,button%,wndw%,icon%)
wndw%
button%
mode%=5
setmode(1)
setmode(mode%+1)
mainmenu(1)
mode%
x'
insertcmd("MODE MODE")
y+
"Wimp_StartTask","Basic"
{1 access%=(access%
accessbit%(0))
|C
selecticon(accesswin%,0,(access%
accessbit%(0)))
setmode(4)
runcmd(cmd$)
accesswin%
+
iconselected(accesswin%,icon%)
/ access%=access%
(accessbit%(icon%))
1 access%=access%
accessbit%(icon%))
!
(icon%=0)
(mode%=4)
setmode(mode%)
optwin%
icon%
1 : dodir%=
dodir%
/
2 : dontlocksetup%=
dontlocksetup%
#
3 : confirm%=
confirm%
blink%=
blink%
+
"Wimp_GetCaretPosition",,ct%
<
blink%)
(ct%!16<>-1)
((ct%!16)
(1<<25)>0)
* ct%!16=(ct%!16)
(1<<25))
O
"Wimp_SetCaretPosition",ct%!0,ct%!4,ct%!8,ct%!12,ct%!16,ct%!20
*
shadeicon(optwin%,8,
blink%)
*
shadeicon(optwin%,9,
blink%)
A
((button%=4)
(icon%=9))
((button%=1)
(icon%=8))
!
blinkperiod%>16
#
blinkperiod%>40
! blinkperiod%-=2
! blinkperiod%-=1
A
((button%=4)
(icon%=8))
((button%=1)
(icon%=9))
"
blinkperiod%<100
#
blinkperiod%<40
! blinkperiod%+=1
! blinkperiod%+=2
'
5 : pullfront%=
pullfront%
+
6 : minimizerma%=
minimizerma%
savestatus