home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
d
/
disclook
/
!Disc
/
!RunImage
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1994-02-11
|
17KB
|
757 lines
DiscLook II 1.00
(c) 1993 RJ Developments
By Ian Clark
$+" at line "+
quit%=
Error
quit%=
noquit%=
"WimpExt_CloseDown",id%
"XOS_Module",7,,msg%
"Wimp_CloseDown"
ON ERROR LOCAL SYS"WimpExt_CloseDown",id%:SYS"Wimp_CloseDown",id%,&4B534154:RUN
"Hourglass_On"
,msgpath$="<Disc$Dir>.Resources.Messages"
"MessageTrans_FileInfo",,msgpath$
,,msgsize%
"OS_Module",6,,,20+
msgpath$
,,msg%
.$(msg%+16)="<Disc$Dir>.Resources.Messages"
msblk% msgsize%
"MessageTrans_OpenFile",msg%,msg%+16,msblk%
block% 800
buffer% 4
handles% 8
indirected% 238
ok% 32
qui% 32
ibtxt% 50
ibsp% 255
imm% 32
prefs% 32
bkprefs% 30
mount%=
curfs$="ADFS"
actfs$="ADFS"
menhelp%=
noquit%=
nohd%=
cfs%=
cfs$=""
fstick%=1
drive%=0
drm%=0
0 on%=
?prefs%=1
prefs%?1=1
prefs%?2=0
prefs%?3=1
prefs%?4=1
$(prefs%+8)="1234"+
$(prefs%+20)="1234"+
8%$qui%="Quit"+
0+"Cancel"+
$ok%="OK"+
:#$imm%="OK"+
0+"Cancel"+
;d$ibsp%="sFloppyLook;whThe Disc Look II icon.|mA RJ Developments program.|mCode
1993 Ian Clark."
shutdown%=
running%=
task%=
open%=
toquit%=
password%=0
correct%=0
C<!block%=&502:block%!4=&400C0:block%!8=&43B00:block%!12=0
"Wimp_Initialise",310,&4B534154,"Disc Look II",block%
ver%,id%
ver%<310
0,"Disc Look II needs Risc OS 3.10 or later"
"WimpExt_Initialise",14,id%,%010010010
ver%
ver%<195
0,"Disc Look II needs Wimp Extentions 1.95 or later. (There is a copy inside the !DMen directory.)"
"OS_File",13,"<Disc$Dir>.Resources.Sprites"
,,,,size%
size%+=4:
sprite% size%
!sprite%=size%:sprite%!8=16
"OS_SpriteOp",&209,sprite%
"OS_SpriteOp",&20A,sprite%,"<Disc$Dir>.Resources.Sprites"
x%=0
handles%!x%=%101:
"WimpExt_LoadTemplates",handles%,block%,indirected%,indirected%+238,-1,"<Disc$Dir>.Resources.Templates",sprite%
P8infow%=!handles%:titlew%=handles%!4:curw%=handles%!8
"WimpExt_SetIconString",,,titlew%,5,"1.00"
"WimpExt_OpenWindowTop",titlew%
"WimpExt_PrePoll"
"Wimp_Poll",0,block%
code%
"WimpExt_Action",id%,block%,code%
code%
code%
1 :
"WimpExt_AutoRedraw",,block%
2 :
"Wimp_OpenWindow",,block%
3 :
"Wimp_CloseWindow",,block%
code%=0
"WimpExt_SetIconString",,,infow%,3,"
1993 Ian Clark ("+
Gm("Date")+")"
"WimpExt_SetIconString",,,infow%,0,
Gm("Ver")
GetFSs
"ADFS_Drives"
,flop%,hard%
Drivemenu(flop%,hard%)
d0curfs$=
String(devicem%+16+(24*(fstick%+1)))
!block%=titlew%
"Wimp_CloseWindow",,block%
Ibtxt
h on%=
x%=END
PROCImm("Disc Look 2 is currently using "+STR$x%+" bytes, that's "+STR$(INT(x%/1024))+"K")
"Hourglass_Off"
title$
title$=
Gm("MT01")
barmenu% 28+(24*6)
actm% 28+(24*6)
formatm% 28+(24*6)
otherformatm% 28+(24*6)
$barmenu%=title$
width%=(
title$-1)*16
barmenu%?12=7
barmenu%?13=2
barmenu%?14=7
barmenu%?15=0
barmenu%!20=44
barmenu%!24=0
The procedure below adds a single item to a menu.
Item Text Flag Item Menu Submenu Pointer
| | | | |
\ / \/\/ \ / \ /
Additem(
Gm("MI00"),2,1,barmenu%,infow%)
Additem(
Gm("MI01"),0,2,barmenu%,devicem%)
Additem(
Gm("MI02"),8,3,barmenu%,drivem%)
Additem(
Gm("MI03"),0,4,barmenu%,actm%)
Additem(
Gm("MI04"),2,5,barmenu%,-1)
Additem(
Gm("MI05"),&80,6,barmenu%,-1)
barmenu%!16=width%
title$=
Gm("MT04")
$actm%=title$
width%=(
title$-1)*16
actm%?12=7
actm%?13=2
actm%?14=7
actm%?15=0
actm%!20=44
actm%!24=0
Additem(
Gm("MI40"),0,1,actm%,-1)
Additem(
Gm("MI41"),0,2,actm%,-1)
Additem(
Gm("MI42"),0,3,actm%,formatm%)
Additem(
Gm("MI43"),0,4,actm%,-1)
Additem(
Gm("MI44"),0,5,actm%,-1)
Additem(
Gm("MI45"),&80,6,actm%,-1)
actm%!16=width%
title$=
Gm("MT05")
$formatm%=title$
width%=(
title$-1)*16
formatm%?12=7
formatm%?13=2
formatm%?14=7
formatm%?15=0
formatm%!20=44
formatm%!24=0
Additem(
Gm("MI55"),8,1,formatm%,curw%)
Additem(
Gm("MI50"),0,2,formatm%,-1)
Additem(
Gm("MI51"),0,3,formatm%,-1)
Additem(
Gm("MI52"),0,4,formatm%,-1)
Additem(
Gm("MI53"),0,5,formatm%,-1)
Additem(
Gm("MI54"),&80,6,formatm%,otherformatm%)
formatm%!16=width%
title$=
Gm("MT05")
$otherformatm%=title$
width%=(
title$-1)*16
otherformatm%?12=7
otherformatm%?13=2
otherformatm%?14=7
otherformatm%?15=0
otherformatm%!20=44
otherformatm%!24=0
Additem(
Gm("MI60"),0,1,otherformatm%,-1)
Additem(
Gm("MI61"),0,2,otherformatm%,-1)
Additem(
Gm("MI62"),0,3,otherformatm%,-1)
Additem(
Gm("MI63"),0,4,otherformatm%,-1)
Additem(
Gm("MI64"),0,5,otherformatm%,-1)
Additem(
Gm("MI65"),&80,6,otherformatm%,-1)
otherformatm%!16=width%
Imm(text$)
Errbox(
Gm("MS01"),text$,1)
Errbox(title$,text$,bflag%)
bt%,pressed%
bflag%
1 : bt%=ok%
2 : bt%=imm%
3 : bt%=qui%
: bt%=ok%
"WimpExt_ControlImmediate",,2,title$,text$,bt%,1
pressed%
=pressed%
Decodemenu
buffer%
buffer% 512
"Wimp_DecodeMenu",,menu%,block%,buffer%
menu%
barmenu% :
$buffer%
Gm("MI05") : quit%=
Gm("MI00") :
Gm("MS02"))
Gm("MI04") :
FSWarn
Gm("MI01")+".CFS#+" :
SwapCFS
Gm("MI03")+"."+
Gm("MI41") :
Dismount
Gm("MI03")+"."+
Gm("MI44") :
Verify
Gm("MI03")+"."+
Gm("MI45") :
Showfree
!block%=3
block%!4=2
block%!8<>-1
Format(block%!8,block%!12)
$buffer%,
Gm("MI01"))+1)=
Gm("MI01")+"."
NewFS($buffer%)
$buffer%,
Gm("MI02"))+1)=
Gm("MI02")+"."
Newdrive($buffer%)
Additem(item$,flag%,item%,menu%,submenu%)
item$>12
Gm1("ER00",item$)
item$+1)*16>width%
width%=(
item$+1)*16
P%=menu%+28+(24*(item%-1))
OPT 0
EQUD flag%
EQUD submenu%
EQUD &7000021
!EQUS item$+
item$-1),
Error
67795 :
Imm("Drive '"+curfs$+" "+
drive%+"' is empty!"):
67756 :
Imm("Bad drive regarding '"+curfs$+" "+
drive%+"'!"):
}bt%=
Errbox("Error "+
+" from Disc Look II","Error: '"+
$+"' - Internal error code "+
+", "+
+". What should I do?",3)
bt%
0 :
"WimpExt_CloseDown",id%:
"Wimp_CloseDown":
quit%
noquit%
"WimpExt_PrePoll"
"Wimp_Poll",0,block%
code%
"WimpExt_Action",id%,block%,code%
code%
code%
1 :
"WimpExt_AutoRedraw",,block%
2 :
"Wimp_OpenWindow",,block%
3 :
"Wimp_CloseWindow",,block%
6 :
Click(block%!8,block%!12,block%!16,!block%,block%!4)
8 :
Processkey
9 :
Decodemenu
17,18 :
Receive
Exists(path$)
"OS_File",17,path$
found%
found%=0 =
Click(b%,w%,i%,x%,y%)
-2 :
$
baricon% :
n
2 : menu%=barmenu%:
"WimpExt_CreateMenu",,barmenu%,x%-64,96+(44*6)+(24*2)
/
4 :
Opendir
!
infow% :
3 :
Gm("IW03"))
4 :
Gm("IW02"))
String(pointertostring%)
?pointertostring%>25
tx$<255
$1tx$+=
(?pointertostring%):pointertostring%+=1
Receive
block%!16
0 : quit%=
WHEN 3 : CASE block%!40 OF
WHEN &FFF : PROCReadtextfile(FNString(block%+44))
ENDCASE
&502 :
block%!32
/&
infow% :
Infohelp
03
Menuhelp(block%!32,block%!36)
&400C0 :
block%!20=curw%
Currentform
Drivewarn
&43B00 :
String(block%+20),8)="DiscLook"
Extcommand(
String(block%+20),9))
Sendhelp(help$)
"WimpExt_SendHelp",help$,block%
Menuhelp(w%,i%)
menuhelp%
menuhelp% 512
menhelp%
w%=barmenu%
i%=3
"Wimp_GetMenuState",0,menuhelp%
!menuhelp%
-1 :
Sendhelp("Ohh! Your sooooooo good with that mouse!!")
0 :
Sendhelp("This option leads to a standard info box.")
1 :
menuhelp%!4
-1 :
Sendhelp("Move right to select a filing system")
0 :
cfs%
Sendhelp("Click here to turn CFS off.")
Sendhelp("Click here to turn CFS on.")
Sendhelp("Click here to select this as the current filing system.")
4 :
Sendhelp("Click here to re-calculate the device menu, usefull if any filing systems have started up since the program was loaded, eg the RAM filer.")
Ibtxt
drive$
drive%<>-1 drive$=":"+
drive%
drive$="$"
R text$=cfs$+actfs$+":"+drive$
$ibtxt%=text$
width%
($ibtxt%)*16>100
width%=
($ibtxt%)*16
width%=100
on% !block%=-7:block%!4=baricon%:
"Wimp_DeleteIcon",,block%
!block%=-6
block%!4=0
block%!8=-16
block%!12=width%
block%!16=90
block%!20=&1700310B
block%!24=ibtxt%
block%!28=ibsp%
block%!32=50
"Wimp_CreateIcon",251658240,block%
baricon%
a on%=
"WimpExt_PrePoll":
"Wimp_Poll",0,block%
code%:
"WimpExt_Action",id%,block%,code%
code%
code%=1
"WimpExt_AutoRedraw",,block%
code%=0
Opendir
drive$
drive%=-1 drive$="$"
drive$=
drive%
discname$=""
CheckSWI(curfs$+"_DescribeDisc")
curfs$+"_DescribeDisc",":"+drive$,block%
n$discname$=":"+
String(block%+22)
discname$,1))<=32
discname$=
discname$)