Home » Personal collection » Acorn hard disk » apps » Econet » Oddments/!Tree/!RunImage
Oddments/!Tree/!RunImage
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Personal collection » Acorn hard disk » apps » Econet |
Filename: | Oddments/!Tree/!RunImage |
Read OK: | ✔ |
File size: | 10BF9 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
10REM>SCSI::SCSIDrive4.$.!Develop.Files.Treev1.!Tree.!RunImage 20ON ERROR PROCalert("Major BAD error from Tree",REPORT$+" "+STR$(ERL),0):SYS &000400DD,taskhandle%,&4B534154:END 30: 40tasksize%=256*1024 50smegblocksize%=400 60endprog%=HIMEM 70: 80REM by Richard Samphire 1993 ----------- BOO ! 90: 100SYS&000406C0 110SYS &00000010 TO env$ 120IF INSTR(env$," -quit ") THEN 130doubleclick$=MID$(env$,INSTR(env$,CHR$(34),INSTR(env$,CHR$(34))+1)+1) 140ENDIF 150year$="93" 160ver$="v1.06a (19-09-"+year$+")" 170name$="Tree" 180mag$="� Archimedes World 1993" 190purpose$="Shows tree display of files" 200PROCinitsprites 210taskhandle%=FNinitialise(name$) 220iconbar%=FNiconbar("!"+name$,-1) 230mainmenu%=FNcreatemenu(name$,3,"Info>info%|Options�|Quit",150) 240savemenu%=FNcreatemenu("Save",3,"Text>savetree%|-Draw>savedraw%|Tree>saveas%",150) 250miscmenu%=FNcreatemenu("Misc",4,"Info>info%|-Statistics>stats%|ReDraw Icons|Print text>print%",250) 260othermenu%=FNcreatemenu("Tree",7,"-Misc>miscmenu%|-File>savemenu%|Open Parent|File Info>finfo%|-Search�|-Options�|Quit",250) 270PROCiconputtext(info%,11,FNicontext(info%,11)+year$) 280PROCiconputtext(info%,3,ver$) 290PROCiconputtext(info%,0,name$) 300PROCiconputtext(info%,1,purpose$) 310PROCiconputtext(info%,8,mag$) 320SYS &000406C2 330PROCiconputtext(title%,1,mag$) 340PROCdotitle(200) 350IF FNcheckfreespace<=smegblocksize% THEN PROCalert("Message from Tree","Unable to find enough free memory.",0):END 360heapsize%=smegblocksize% 370SYS "Wimp_SlotSize",tasksize%+heapsize%,-1 380SYS "XOS_Heap",0,endprog%,,heapsize% 390blocksize%=4 400SYS "XOS_Heap",2,endprog%,,4 TO ,,icondata% 410IF doubleclick$<>" " THEN 420PROCloadmyfile(doubleclick$) 430ENDIF 440REPEAT 450SYS &000400C7,0,block% TO reason%,block% 460CASE reason% OF 470WHEN 0 480PROCnull 490WHEN 1 500PROCredrawwindow(0) 510WHEN 2 520PROCopenwindow(0,FALSE) 530WHEN 3 540PROCclosewindow(0) 550WHEN 4 560PROCpointerleave 570WHEN 5 580PROCpointerenter 590WHEN 6 600PROCmouseclick 610WHEN 7 620PROCuserdragbox 630WHEN 8 640PROCkeypressed 650WHEN 9 660PROCmenuselection 670WHEN 10 680PROCscrollrequest 690WHEN 11 700PROClosecaret 710WHEN 12 720PROCgaincaret 730WHEN 17 740PROCusermessage 750WHEN 18 760PROCusermessagerecorded 770WHEN 19 780PROCusermessageacknowledge 790ENDCASE 800UNTIL exit 810SYS &000400DD,taskhandle%,&4B534154 820END 830DEF FNinitialise(name$) 840maxnumber=4096 850mody%=FALSE 860DIM col(199) 870DIM block% 2048 880DIM block2% 2048 890DIM block3% 2048 900DIM buf% 41 910DIM messages% 60 920messages%!0=1 930messages%!4=8 940messages%!8=14 950messages%!12=&404 960messages%!16=&405 970messages%!20=&403 980messages%!24=2 990messages%!28=3 1000messages%!32=4 1010messages%!36=&80140 1020messages%!40=&80144 1030messages%!44=5 1040messages%!48=&80147 1050messages%!52=&400c9 1060messages%!56=&80142 1070SYS &400C0,300,&4B534154,name$,messages% TO wimpversion%,th% 1080searchwindow%=FALSE 1090searchfile=TRUE 1100searchtype=FALSE 1110asct%=ASC("T") 1120ascl%=ASC("L") 1130currentsearch=-1 1140casesens=FALSE 1150iii%=0 1160dirs=FALSE 1170exit = FALSE 1180flufend%=TRUE 1190menunumber% = 0 1200iconsprites=TRUE 1210headings=TRUE 1220sourcedir=TRUE 1230date=TRUE 1240pressed=FALSE 1250fheadings=TRUE 1260fsourcedir=TRUE 1270fdate=TRUE 1280headcount=2 1290makeexit=FALSE 1300tjunc$="+�" 1310endjunc$="'�" 1320linejunc$="|" 1330ftjunc$="+�" 1340fendjunc$="'�" 1350flinejunc$="|" 1360cols=7 1370fincols=7 1380rows=50 1390doprint%=FALSE 1400frows=50 1410columns=FALSE 1420ficonsprites=TRUE 1430lineobj=TRUE 1440flineobj=TRUE 1450tttemp%=0 1460info=TRUE 1470boxr=0 1480boxg=0 1490boxb=0 1500fboxr=0 1510fboxg=0 1520fboxb=0 1530oufile%=OPENIN("<Tree$Dir>.Options") 1540IF oufile%<>0 THEN 1550INPUT #oufile%,headcount 1560INPUT #oufile%,headings 1570INPUT #oufile%,sourcedir 1580INPUT #oufile%,date 1590INPUT #oufile%,linejunc$ 1600INPUT #oufile%,tjunc$ 1610INPUT #oufile%,endjunc$ 1620INPUT #oufile%,cols 1630INPUT #oufile%,iconsprites 1640INPUT #oufile%,rows 1650INPUT #oufile%,boxr 1660INPUT #oufile%,boxg 1670INPUT #oufile%,boxb 1680INPUT #oufile%,lineobj 1690INPUT #oufile%,dirs 1700CLOSE #oufile% 1710fheadings=headings 1720fsourcedir=sourcedir 1730fdate=date 1740flinejunc$=linejunc$ 1750ftjunc$=tjunc$ 1760fendjunc$=endjunc$ 1770fincols=cols 1780ficonsprites=iconsprites 1790frows=rows 1800fboxr=boxr 1810fboxg=boxg 1820fboxb=boxb 1830flineobj=lineobj 1840fdirs=dirs 1850ELSE 1860PROCdefaults(FALSE) 1870ENDIF 1880DIM win% 4096*6 1890DIM ind% 4096*6 1900DIM mainwindow% 512 1910DIM indmain% 512 1920SYS &000400D9,,"<Tree$Dir>.Templates" 1930SYS &000400DB,,win%,ind%,ind%+4096,-1,"info",0 TO ,,ind% 1940win%!64=sprite% 1950SYS &000400C1,,win% TO info% 1960SYS &000400DB,,win%,ind%,ind%+4096,-1,"saveas",0 TO ,,ind% 1970SYS &000400C1,,win% TO saveas% 1980SYS &000400DB,,win%,ind%,ind%+4096,-1,"savetree",0 TO ,,ind% 1990SYS &000400C1,,win% TO savetree% 2000SYS &000400DB,,mainwindow%,indmain%,indmain%+4096,-1,"main",0 TO ,,indmain% 2010SYS &000400C1,,mainwindow% TO main% 2020SYS &000400DB,,win%,ind%,ind%+4096,-1,"pane",0 TO ,,ind% 2030win%!64=sprite% 2040SYS &000400C1,,win% TO pane% 2050SYS &000400DB,,win%,ind%,ind%+4096,-1,"options",0 TO ,,ind% 2060SYS &000400C1,,win% TO options% 2070SYS &000400DB,,win%,ind%,ind%+4096,-1,"stats",0 TO ,,ind% 2080SYS &000400C1,,win% TO stats% 2090SYS &000400DB,,win%,ind%,ind%+4096,-1,"savedraw",0 TO ,,ind% 2100win%!64=sprite% 2110SYS &000400C1,,win% TO savedraw% 2120SYS &000400DB,,win%,ind%,ind%+4096,-1,"fileinfo",0 TO ,,ind% 2130SYS &000400C1,,win% TO finfo% 2140SYS &000400DB,,win%,ind%,ind%+4096,-1,"printtext",0 TO ,,ind% 2150win%!64=sprite% 2160SYS &000400C1,,win% TO print% 2170SYS &000400DB,,win%,ind%,ind%+4096,-1,"dis",0 TO ,,ind% 2180SYS &000400C1,,win% TO mycontrol% 2190SYS &000400DB,,win%,ind%,ind%+4096,-1,"title",0 TO ,,ind% 2200win%!64=sprite% 2210SYS &000400C1,,win% TO title% 2220SYS &000400DB,,win%,ind%,ind%+4096,-1,"search",0 TO ,,ind% 2230win%!64=sprite% 2240SYS &000400C1,,win% TO search% 2250SYS &000400DA 2260slidewindow%=-1 2270slideicon%=-1 2280slidesize%=-1 2290oldworkx%=-1 2300rrange%=-1 2310sizemaxx%=-1 2320sizeminx%=-1 2330=th% 2340DEF FNiconbar(Sprite$,side%) 2350block%!0=side% 2360block%!4=0 2370block%!8=0 2380block%!12=29*2 2390block%!16=40*2 2400block%!20=&3002 2410$(block%+24)=Sprite$ 2420SYS &000400C2,,block% TO icon% 2430=icon% 2440DEF PROCnull 2450CASE slideicon% OF 2460WHEN 28 2470PROCdoslide(slidewindow%,slideicon%,slidesize%,TRUE,255) 2480WHEN 31 2490PROCdoslide(slidewindow%,slideicon%,slidesize%,TRUE,255) 2500WHEN 34 2510PROCdoslide(slidewindow%,slideicon%,slidesize%,TRUE,255) 2520ENDCASE 2530ENDPROC 2540DEF PROCredrawwindow(wind%) 2550SYS&000406C0 2560IF wind%<>0 THEN 2570block%!0=wind% 2580ENDIF 2590SYS &000400C8,,block% TO flag 2600WHILE flag 2610IF block%!0=main% THEN PROCdolines(block%!8,block%!16,block%!24) 2620IF block%!0=pane% THEN PROCdocolourbox(boxr,boxg,boxb,FALSE) 2630SYS &000400CA,,block% TO flag 2640ENDWHILE 2650SYS&000406C2 2660ENDPROC 2670DEF PROCopenwindow(wind%,stag%) 2680IF wind%<>0 THEN 2690block%!0=wind% 2700SYS &000400CB,,block% 2710ENDIF 2720IF block%!0=main% AND searchwindow% THEN 2730mainminx%=block%!4 2740mainminy%=block%!8 2750mainmaxx%=block%!12 2760mainmaxy%=block%!16 2770mainscrollx%=block%!20 2780mainscrolly%=block%!24 2790backhand%=block%!28 2800block%!0=search% 2810SYS &400cb,,block% 2820block%!0=search% 2830block%!4=mainminx%-318 2840block%!8=mainmaxy%-636 2850block%!12=mainmaxx%+block%!4 2860block%!16=mainmaxy% 2870block%!28=backhand% 2880SYS &400C5,,block% 2890block%!0=main% 2900block%!4=mainminx% 2910block%!8=mainminy% 2920block%!12=mainmaxx% 2930block%!16=mainmaxy% 2940block%!20=mainscrollx% 2950block%!24=mainscrolly% 2960block%!28=search% 2970ENDIF 2980IF block%!0=options% THEN 2990mainminx%=block%!4 3000mainminy%=block%!8 3010mainmaxx%=block%!12 3020mainmaxy%=block%!16 3030mainscrollx%=block%!20 3040mainscrolly%=block%!24 3050backhand%=block%!28 3060block%!0=pane% 3070SYS &400cb,,block% 3080block%!0=pane% 3090block%!4=mainminx%+20 3100block%!8=mainminy%+18 3110block%!12=mainmaxx%+block%!4 3120block%!16=mainmaxy%-18 3130block%!28=backhand% 3140SYS &400C5,,block% 3150block%!0=options% 3160block%!4=mainminx% 3170block%!8=mainminy% 3180block%!12=mainmaxx% 3190block%!16=mainmaxy% 3200block%!20=mainscrollx% 3210block%!24=mainscrolly% 3220block%!28=pane% 3230ENDIF 3240SYS &000400C5,,block% 3250ENDPROC 3260DEF PROCclosewindow(wind%) 3270IF wind%<>0 THEN 3280 block%!0=wind% 3290ENDIF 3300IF block%!0=options% THEN 3310 block%!0=pane% 3320 SYS &000400C6,,block% 3330 block%!0=options% 3340ENDIF 3350IF block%!0=main% AND mody% THEN 3360 press%=FNmycontrol 3370 block%!0=mycontrol% 3380 SYS &000400C6,,block% 3390 block%!0=main% 3400 CASE press% OF 3410 WHEN 0 3420 IF makeexit THEN exit=TRUE 3430 SYS "XOS_Heap",4,endprog%,icondata%,-blocksize% TO ,,icondata% 3440 SYS "XOS_Heap",5,endprog%,,-heapsize%+smegblocksize% 3450 heapsize%=smegblocksize% 3460 SYS "Wimp_SlotSize",tasksize%+heapsize%,-1 3470 blocksize%=4 3480 WHEN 1 3490 IF exit THEN exit=FALSE 3500 makeexit=FALSE 3510 ENDPROC 3520 WHEN 2 3530 IF exit THEN 3540 exit=FALSE 3550 makeexit=TRUE 3560 ENDIF 3570 SYS&000400CF,,block2% 3580 xx%=block2%!0 3590 yy%=block2%!4 3600 bb%=block2%!8 3610 flufend%=TRUE 3620 PROCdrawmenu(saveas%,xx%,yy%) 3630 ENDPROC 3640 ENDCASE 3650ENDIF 3660IF block%!0=search% THEN searchwindow%=FALSE 3670IF block%!0=main% THEN 3680 searchwindow%=FALSE 3690 block%!0=search% 3700 SYS &000400C6,,block% 3710 SYS "XOS_Heap",4,endprog%,icondata%,-blocksize% TO ,,icondata% 3720 SYS "XOS_Heap",5,endprog%,,-heapsize%+smegblocksize% 3730 heapsize%=smegblocksize% 3740 SYS "Wimp_SlotSize",tasksize%+heapsize%,-1 3750 blocksize%=4 3760 mody%=FALSE 3770 IF pressed THEN SYS "Wimp_ProcessKey",&1FC 3780 iii%=0 3790 block%!0=main% 3800ENDIF 3810SYS &000400C6,,block% 3820ENDPROC 3830DEF PROCpointerleave 3840ENDPROC 3850DEF PROCpointerenter 3860ENDPROC 3870DEF PROCmouseclick 3880LOCAL ERROR 3890ON ERROR LOCAL PROCalert("Error from Tree",REPORT$,0):ENDPROC 3900x%=block%!0 3910y%=block%!4 3920button%=block%!8 3930window%=block%!12 3940icon%=block%!16 3950CASE button% OF 3960WHEN 1 3970IF window%=search% THEN PROCclicksearch(icon%) 3980IF window%=print% THEN PROCclickprint(icon%) 3990IF window%=savedraw% AND icon%=2 THEN 4000IF INSTR(FNicontext(savedraw%,1),".")=0 THEN 4010PROCalert("Tree","To save, drag the file icon to a directory viewer",2) 4020SYS&000400D4,-1 4030ELSE 4040poowindow%=savedraw% 4050PROCsave(FNicontext(savedraw%,1)) 4060ENDIF 4070ENDIF 4080IF window%=saveas% AND icon%=2 THEN 4090IF INSTR(FNicontext(saveas%,1),".")=0 THEN 4100PROCalert("Tree","To save, drag the file icon to a directory viewer",2) 4110SYS&000400D4,-1 4120ELSE 4130poowindow%=saveas% 4140PROCsave(FNicontext(saveas%,1)) 4150ENDIF 4160ENDIF 4170IF window%=savetree% AND icon%=2 THEN 4180IF INSTR(FNicontext(savetree%,1),".")=0 THEN 4190PROCalert("Tree","To save, drag the file icon to a directory viewer",2) 4200SYS&000400D4,-1 4210ELSE 4220poowindow%=savetree% 4230PROCsave(FNicontext(savetree%,1)) 4240ENDIF 4250ENDIF 4260IF window%=options% THEN PROCclickoptions(icon%) 4270IF window%=pane% THEN PROCclickpane(icon%) 4280IF window%=main% AND icon%>0 THEN 4290PROCuselicon(main%,icon%) 4300PROCgetvars(icon%-1,FALSE) 4310OSCLI("FILER_RUN "+$filename%) 4320ENDIF 4330IF window%=savedraw% AND icon%=3 THEN 4340columns=NOT columns 4350IF columns THEN PROCselicon(savedraw%,3) ELSE PROCuselicon(savedraw%,3) 4360ENDIF 4370WHEN 2 4380IF window%=-2 THEN 4390PROCdrawmenu(mainmenu%,x%-100,228) 4400menunumber%=1 4410ENDIF 4420IF window%=main% THEN 4430PROCgetprinterinfo 4440PROCiconputtext(print%,0,printer$) 4450copies=1 4460PROCiconputtext(print%,2,STR$(copies)) 4470IF columns THEN PROCselicon(savedraw%,3) ELSE PROCuselicon(savedraw%,3) 4480flufend%=FALSE 4490PROCiconputtext(stats%,1,STR$(iii%)) 4500PROCiconputtext(stats%,3,STR$(blocksize%)) 4510IF icon%>0 THEN 4520currentsearch=icon% 4530PROCusmi(othermenu%,3) 4540PROCusmi(othermenu%,4) 4550PROCgetvars(icon%-1,FALSE) 4560PROCiconputtext(finfo%,0,FNgLn($filename%)) 4570IF type%!0>=0 AND type%!0<=&FFF THEN 4580 PROCiconputtext(finfo%,3,"&"+FNpad(type%!0)) 4590 IF FNspriteexists("file_"+FNpad(type%!0)) THEN 4600 PROCseticonsprite(finfo%,1,"Sfile_"+FNpad(type%!0)) 4610 ELSE 4620 PROCseticonsprite(finfo%,1,"Sfile_xxx") 4630 ENDIF 4640ELSE 4650 IF LEFT$(FNgLn($filename%),1)="!" AND type%!0=-1 THEN 4660 PROCiconputtext(finfo%,3,"Application") 4670 IF FNspriteexists(FNgLn($filename%)) THEN 4680 PROCseticonsprite(finfo%,1,"S"+FNgLn($filename%)) 4690 ELSE 4700 PROCseticonsprite(finfo%,1,"Sapplication") 4710 ENDIF 4720 ENDIF 4730 IF LEFT$(FNgLn($filename%),1)<>"!" AND type%!0=-1 THEN 4740 PROCiconputtext(finfo%,3,"Directory") 4750 PROCseticonsprite(finfo%,1,"Sdirectory") 4760 ENDIF 4770 IF type%!0=-2 THEN 4780 PROCiconputtext(finfo%,3,"File") 4790 PROCseticonsprite(finfo%,1,"Sfile_xxx") 4800 ENDIF 4810ENDIF 4820PROCiconputtext(finfo%,5,STR$(readlength%!0)) 4830PROCiconputtext(finfo%,7,FNattributes(attributes%!0)) 4840PROCiconputtext(finfo%,8,FNmyconvert(ladr%!0,eadr%!0)) 4850ELSE 4860PROCsmi(othermenu%,3) 4870PROCsmi(othermenu%,4) 4880ENDIF 4890PROCdrawmenu(othermenu%,x%-100,y%) 4900menunumber%=2 4910ENDIF 4920WHEN 4 4930IF window%=search% THEN PROCclicksearch(icon%) 4940IF window%=print% THEN PROCclickprint(icon%) 4950IF window%=savedraw% AND icon%=3 THEN 4960columns=NOT columns 4970IF columns THEN PROCselicon(savedraw%,3) ELSE PROCuselicon(savedraw%,3) 4980ENDIF 4990IF window%=savedraw% AND icon%=2 THEN 5000IF INSTR(FNicontext(savedraw%,1),".")=0 THEN 5010PROCalert("Tree","To save, drag the file icon to a directory viewer",2) 5020SYS&000400D4,-1 5030ELSE 5040poowindow%=savedraw% 5050PROCsave(FNicontext(savedraw%,1)) 5060ENDIF 5070ENDIF 5080IF window%=saveas% AND icon%=2 THEN 5090IF INSTR(FNicontext(saveas%,1),".")=0 THEN 5100PROCalert("Tree","To save, drag the file icon to a directory viewer",2) 5110SYS&000400D4,-1 5120ELSE 5130poowindow%=saveas% 5140PROCsave(FNicontext(saveas%,1)) 5150SYS&000400D4,-1 5160ENDIF 5170ENDIF 5180IF window%=savetree% AND icon%=2 THEN 5190IF INSTR(FNicontext(savetree%,1),".")=0 THEN 5200PROCalert("Tree","To save, drag the file icon to a directory viewer",2) 5210SYS&000400D4,-1 5220ELSE 5230poowindow%=savetree% 5240PROCsave(FNicontext(savetree%,1)) 5250SYS&000400D4,-1 5260ENDIF 5270ENDIF 5280IF window%=pane% THEN PROCclickpane(icon%) 5290IF window%=options% THEN PROCclickoptions(icon%) 5300IF window%=main% AND icon%>0 THEN 5310PROCuselicon(main%,icon%) 5320PROCgetvars(icon%-1,FALSE) 5330OSCLI("FILER_RUN "+$filename%) 5340ENDIF 5350WHEN 16,64 5360IF window%=main% AND icon%>0 THEN 5370PROCdragmyfile 5380tempicon%=icon% 5390ENDIF 5400IF window%=saveas% AND icon%=0 THEN 5410poowindow%=window% 5420lastwindow%=poowindow% 5430PROCdrawbox(saveas%,0,"file_353") 5440ENDIF 5450IF window%=savetree% AND icon%=0 THEN 5460poowindow%=window% 5470lastwindow%=poowindow% 5480PROCdrawbox(savetree%,0,"file_fff") 5490ENDIF 5500IF window%=savedraw% AND icon%=0 THEN 5510poowindow%=window% 5520lastwindow%=poowindow% 5530PROCdrawbox(savedraw%,0,"file_aff") 5540ENDIF 5550ENDCASE 5560ENDPROC 5570DEF PROCuserdragbox 5580LOCAL ERROR 5590ON ERROR LOCAL PROCalert("Error from Tree",REPORT$,0):ENDPROC 5600SYS "DragASprite_Stop" 5610tt%=block%+256 5620SYS&000400CF,,tt% 5630xx%=tt%!0 5640yy%=tt%!4 5650bb%=tt%!8 5660wind%=tt%!12 5670icon%=tt%!16 5680CASE lastwindow% OF 5690WHEN saveas%,savetree% 5700block%!0=256 5710block%!12=0 5720block%!16=1 5730block%!20=wind% 5740block%!24=icon% 5750block%!28=xx% 5760block%!32=yy% 5770block%!36=1 5780IF lastwindow%=savetree% THEN 5790block%!40=&fff 5800ELSE 5810block%!40=&353 5820ENDIF 5830bblock%=block%+256 5840bblock%!0=lastwindow% 5850bblock%!4=1 5860SYS&000400CE,0,bblock% 5870text%=bblock%!28 5880w$=FNgLn($text%) 5890$(block%+44)=w$+CHR$0 5900SYS&000400E7,17,block%,wind%,icon% 5910IF wind%<>saveas% AND wind%<>savetree% THEN SYS&000400D4,-1 5920WHEN main% 5930poowindow%=main% 5940PROCgetvars(tempicon%-1,FALSE) 5950block%!0=256 5960block%!12=0 5970block%!16=1 5980block%!20=wind% 5990block%!24=icon% 6000block%!28=xx% 6010block%!32=yy% 6020block%!36=readlength%!0 6030block%!40=type%!0 6040$(block%+44)=$filename%+CHR$0 6050SYS&000400E7,17,block%,wind%,icon% 6060PROCuselicon(main%,tempicon%) 6070WHEN savedraw% 6080block%!0=256 6090block%!12=0 6100block%!16=1 6110block%!20=wind% 6120block%!24=icon% 6130block%!28=xx% 6140block%!32=yy% 6150block%!36=1 6160block%!40=&aff 6170bblock%=block%+256 6180bblock%!0=lastwindow% 6190bblock%!4=1 6200SYS&000400CE,0,bblock% 6210text%=bblock%!28 6220w$=FNgLn($text%) 6230$(block%+44)=w$+CHR$0 6240SYS&000400E7,17,block%,wind%,icon% 6250IF wind%<>savedraw% THEN SYS&000400D4,-1 6260WHEN pane% 6270IF slidewindow%>-1 AND slideicon%>-1 AND slidesize%>-1 THEN 6280size%=sizemaxx%-sizeminx% 6290ppos%=(oldworkx%-sizeminx%) 6300num%=(rrange%/size%)*ppos% 6310CASE slideicon% OF 6320WHEN 28,31,34 6330oldworkx%=newx% 6340ENDCASE 6350: 6360slidewindow%=-1 6370slideicon%=-1 6380slidesize%=-1 6390ENDIF 6400ENDCASE 6410ENDPROC 6420DEF PROCkeypressed 6430wind%=block%!0 6440icon%=block%!4 6450key%=block%!24 6460CASE key% OF 6470WHEN 398,13 6480IF wind%=saveas% THEN 6490IF INSTR(FNicontext(saveas%,1),".")=0 THEN 6500PROCalert("Tree","To save, drag the file icon to a directory viewer",2) 6510SYS&000400D4,-1 6520ELSE 6530poowindow%=saveas% 6540PROCsave(FNicontext(saveas%,1)) 6550SYS&000400D4,,-1 6560ENDIF 6570ENDIF 6580IF wind%=savetree% THEN 6590IF INSTR(FNicontext(savetree%,1),".")=0 THEN 6600PROCalert("Tree","To save, drag the file icon to a directory viewer",2) 6610SYS&000400D4,-1 6620ELSE 6630poowindow%=savetree% 6640PROCsave(FNicontext(savetree%,1)) 6650SYS&000400D4,,-1 6660ENDIF 6670ENDIF 6680OTHERWISE 6690SYS "Wimp_ProcessKey",key% 6700ENDCASE 6710ENDPROC 6720DEF PROCmenuselection 6730CASE menunumber% OF 6740WHEN 1 6750SYS&000400D5,,mainmenu%,block%,block%+24 6760trunc$=FNgLn($(block%+24)) 6770IF trunc$="Quit" THEN 6780exit=TRUE 6790makeexit=TRUE 6800PROCclosewindow(main%) 6810ENDIF 6820IF trunc$="Options�" THEN 6830PROCpane 6840PROCopenwindow(options%,FALSE) 6850ENDIF 6860WHEN 2 6870SYS&000400D5,,othermenu%,block%,block%+24 6880trunc$=FNgLn($(block%+24)) 6890IF trunc$="Quit" THEN 6900makeexit=TRUE 6910exit = TRUE 6920PROCclosewindow(main%) 6930ENDIF 6940IF trunc$="ReDraw Icons" THEN PROCmajorredraw 6950IF trunc$="Open Parent" THEN OSCLI("FILER_OPENDIR "+pooup$) 6960IF trunc$="Search�" THEN PROCopensearch 6970IF trunc$="Options�" THEN 6980PROCpane 6990PROCopenwindow(options%,FALSE) 7000ENDIF 7010ENDCASE 7020SYS&000400CF,,block%+256 7030brr%=block%+256 7040button%=brr%!8 7050IF button%=1 THEN 7060IF menunumber%=1 THEN SYS &000400D4,,mainmenu%,brr%!0-68,(64*4)+64 7070IF menunumber%=2 THEN SYS &000400D4,,othermenu%,brr%!0-68,brr%!4 7080ENDIF 7090ENDPROC 7100ENDPROC 7110DEF PROCscrollrequest 7120ENDPROC 7130DEF PROClosecaret 7140ENDPROC 7150DEF PROCgaincaret 7160ENDPROC 7170DEF PROCusermessage 7180LOCAL ERROR 7190ON ERROR LOCAL PROCalert("Error from Tree",REPORT$,0):ENDPROC 7200CASE block%!16 OF 7210WHEN 0 7220exit = TRUE 7230WHEN 2 7240PROCsave(FNgetstring(block%+44)) 7250WHEN &80147 7260PROCgetprinterinfo 7270 7280ENDCASE 7290ENDPROC 7300DEF PROCusermessagerecorded 7310LOCAL ERROR 7320ON ERROR LOCAL PROCalert("Error from Tree",REPORT$,0):ENDPROC 7330CASE block%!16 OF 7340WHEN 0 7350exit = TRUE 7360WHEN &80142 7370IF doprint% AND FALSE THEN 7380doprint%=FALSE 7390PROCalert("Message from Tree","Load the RiscOS 3 !Printers application to print from Tree.",0) 7400ENDIF 7410WHEN 3 7420PROCload(block%!20,block%!24,block%!40,FNgetstring(block%+44)) 7430WHEN 5 7440IF block%!40=&353 THEN 7450block%!12=block%!8 7460SYS&000600E7,17,block%,block%!20 7470PROCload(block%!20,block%!24,block%!40,FNgetstring(block%+44)) 7480ENDIF 7490WHEN 8 7500IF mody% THEN 7510 pressed=TRUE 7520 block%!12=block%!8 7530 SYS "Wimp_SendMessage",19,block%,0 7540 PROCsicon(mycontrol%,6) 7550 PROCclosewindow(main%) 7560ENDIF 7570ENDCASE 7580ENDPROC 7590DEF PROCusermessageacknowledge 7600CASE block%!16 OF 7610WHEN &80142 7620IF doprint% THEN 7630doprint%=FALSE 7640PROCalert("Message from Tree","Load the RiscOS 3 !Printers application to print from Tree.",0) 7650ENDIF 7660ENDCASE 7670ENDPROC 7680DEFFNparseLine(A$,B$(),C$) 7690LOCAL D%,E%:D%=DIM(B$(),1) 7700WHILE (A$<>"")AND(E%<=D%) 7710B$(E%)=FNparseWord(A$,C$) 7720E%+=1 7730ENDWHILE 7740=E% 7750DEFFNparseWord(RETURN A$,B$) 7760LOCAL C$,D%,E%,F$:D%=1:E%=LEN(A$):C$=MID$(A$,D%,1) 7770WHILE (INSTR(B$,C$)=0)AND(D%<=E%):D%+=1:C$=MID$(A$,D%,1):ENDWHILE 7780F$=LEFT$(A$,D%-1):A$=MID$(A$,D%+1):E%=LEN(A$):D%=1:C$=MID$(A$,D%,1) 7790WHILE (INSTR(B$,C$)>0)AND(D%<=E%):D%+=1:C$=MID$(A$,D%,1):ENDWHILE 7800A$=MID$(A$,D%) 7810=F$ 7820DEF FNcreatemenu(title$,entries%,entries$,width%) 7830LOCAL menu%,word$() 7840DIM menu% 24+entries%*24 7850DIM word$(entries%) 7860tr%=FNparseLine(entries$,word$(),"|") 7870tr%-=1 7880$(menu%+0)=title$+CHR$0 7890menu%!12=7 7900menu%!13=2 7910menu%!14=7 7920menu%!15=0 7930menu%!16=width% 7940menu%!20=44 7950menu%!24=0 7960FOR loop%=0 TO tr% 7970p%=(loop%*24)+28 7980IF loop%=entries%-1 THEN menu%!p%=128 ELSE menu%!p%=0 7990IF MID$(word$(loop%),1,1)="-" THEN 8000menu%!p%+=2 8010ENDIF 8020IF title$="Filetypes" THEN menu%!p%+=8 8030p%+=4 8040IF INSTR(word$(loop%),">") = 0 THEN 8050menu%!p%=-1 8060ELSE 8070menu%!p%=EVAL(MID$(word$(loop%),INSTR(word$(loop%),">")+1)) 8080ENDIF 8090p%+=4 8100menu%!p%=&7009031 8110p%+=4 8120IF INSTR(word$(loop%),">") = 0 THEN 8130IF MID$(word$(loop%),1,1)="-" THEN 8140$(menu%+p%)=MID$(word$(loop%),2) 8150ELSE 8160$(menu%+p%)=word$(loop%) 8170ENDIF 8180ELSE 8190IF MID$(word$(loop%),1,1)="-" THEN 8200$(menu%+p%)=MID$(word$(loop%),2,INSTR(word$(loop%),">")-2) 8210ELSE 8220$(menu%+p%)=MID$(word$(loop%),1,INSTR(word$(loop%),">")-1) 8230ENDIF 8240ENDIF 8250NEXTloop% 8260=menu% 8270DEFPROCdrawmenu(m%,xx%,yy%) 8280SYS &000400D4,,m%,xx%,yy% 8290ENDPROC 8300DEFPROCsicon(wind%,icon%) 8310block%!0=wind% 8320block%!4=icon% 8330block%!8=%10000000000000000000000 8340block%!12=%10000000000000000000000 8350SYS &400CD,,block% 8360ENDPROC 8370DEFPROCusicon(wind%,icon%) 8380block%!0=wind% 8390block%!4=icon% 8400block%!8=0 8410block%!12=%10000000000000000000000 8420SYS &400CD,,block% 8430ENDPROC 8440DEFPROCselicon(wind%,icon%) 8450block%!0=wind% 8460block%!4=icon% 8470block%!8=%1000000000000000000000 8480block%!12=%1000000000000000000000 8490SYS &400CD,,block% 8500ENDPROC 8510DEFPROCuselicon(wind%,icon%) 8520block%!0=wind% 8530block%!4=icon% 8540block%!8=0 8550block%!12=%1000000000000000000000 8560SYS &400CD,,block% 8570ENDPROC 8580DEFPROCtmi(m%,i%) 8590ui=m%+(28+(24*i%)) 8600!ui=!ui OR %1 8610ENDPROC 8620DEFPROCutmi(m%,i%) 8630ui=m%+(28+(24*i%)) 8640!ui=!ui ANDNOT %1 8650ENDPROC 8660DEFPROCsmi(m%,i%) 8670ui=m%+(36+(24*i%)) 8680!ui=!ui OR %10000000000000000000000 8690ENDPROC 8700DEFPROCusmi(m%,i%) 8710ui=m%+(36+(24*i%)) 8720!ui=!ui ANDNOT %10000000000000000000000 8730ENDPROC 8740DEFFNgLn(A$) 8750LOCAL B% 8760IF INSTR(A$,".")=0 THEN =A$ 8770IF INSTR(A$,".")>0 THEN 8780B%=LENA$ 8790WHILE(MID$(A$,B%,1)<>".")AND(B%>0) 8800B%-=1 8810ENDWHILE 8820=RIGHT$(A$,LENA$-B%) 8830DEF FNgetstring(array%) 8840LOCAL path$,pointer% 8850path$="" 8860pointer%=array% 8870REPEAT 8880path$+=CHR$?pointer% 8890pointer%+=1 8900UNTIL ?pointer%=0 OR ?pointer%=13 8910=path$ 8920DEFPROCload(window%,icon%,filetype%,path$) 8930LOCAL ERROR 8940ON ERROR LOCAL PROCalert("Error from Tree",REPORT$,0):ENDPROC 8950IF window%=-2 AND filetype%<>&353 THEN PROCdofiles(path$) 8960IF filetype%=&353 THEN 8970PROCclosewindow(main%) 8980PROCloadmyfile(path$) 8990ENDIF 9000ENDPROC 9010DEFPROCsave(p$) 9020LOCAL ERROR 9030ON ERROR LOCAL PROCalert("Error from Tree",REPORT$,0):ENDPROC 9040SYS &00062401 9050CASE poowindow% OF 9060WHEN saveas% 9070SYS&000406C0 9080SYS "OS_File",10,p$,&353,,icondata%,icondata%+blocksize% 9090SYS&000406C2 9100mody%=FALSE 9110IF makeexit THEN exit=TRUE 9120IF flufend% THEN 9130block%!0=main% 9140SYS &000400C6,,block% 9150ENDIF 9160IF pressed THEN SYS "Wimp_ProcessKey",&1FC 9170WHEN savetree% 9180PROCexport(p$,TRUE) 9190WHEN savedraw% 9200PROCdodraw(p$) 9210WHEN main% 9220IF block%!36=-1 THEN 9230PROCgetvars(tempicon%-1,FALSE) 9240block%!0=256 9250block%!12=0 9260block%!16=3 9270block%!36=readlength%!0 9280block%!40=type%!0 9290$(block%+44)=$filename%+CHR$0 9300SYS&000400E7,17,block%,wind%,icon% 9310ELSE 9320PROCgetvars(tempicon%-1,FALSE) 9330IF FNcheckfreespace>=(40*1024) THEN 9340p$=LEFT$(p$,LEN(p$)-(LEN($filename%)+1)) 9350SYS "Wimp_StartTask","filer_action" 9360block%!0=256 9370block%!12=0 9380block%!16=&403 9390cft2=LEN($filename%) 9400WHILE MID$($filename%,cft2,1)<>"." 9410cft2-=1 9420ENDWHILE 9430dddup$=MID$($filename%,1,cft2-1) 9440$(block%+20)=dddup$+CHR$0 9450SYS "Wimp_SendMessage",17,block%,0 9460block%!0=256 9470block%!12=0 9480block%!16=&404 9490$(block%+20)=FNgLn($filename%)+CHR$0 9500SYS "Wimp_SendMessage",17,block%,0 9510block%!0=256 9520block%!12=0 9530block%!16=&405 9540block%!20=0 9550block%!24=%10001 9560$(block%+28)=p$+CHR$0 9570SYS "Wimp_SendMessage",17,block%,0 9580ELSE 9590p$=LEFT$(p$,LEN(p$)-(LEN($filename%)+1)) 9600OSCLI("COPY "+$filename%+" "+p$+"."+FNgLn($filename%)+" R~C") 9610ENDIF 9620ENDIF 9630WHEN print% 9640PROCexport(p$,FALSE) 9650block%!16=3 9660FOR printcount=1 TO copies 9670SYS&000400E7,17,block%,block%!20,block%!24 9680NEXT printcount 9690doprint%=FALSE 9700ENDCASE 9710IF p$<>"<Wimp$Scrap>" AND (poowindow%<>main%) AND poowindow%<>print% THEN PROCiconputtext(poowindow%,1,p$) 9720ENDPROC 9730DEFPROCloadmyfile(p$) 9740LOCAL ERROR 9750ON ERROR LOCAL PROCalert("Error from Tree",REPORT$,0):ENDPROC 9760localsprites=TRUE 9770columns=FALSE 9780archi%=FNmodulepresent("SparkFS") 9790thebigone=0 9800block%!0=main% 9810SYS &000400C3,,block% 9820SYS &000400C1,,mainwindow% TO main% 9830SYS&000406C0 9840block%!0=main% 9850SYS &400cc,,block% 9860workminx=block%!44 9870workminy=block%!48 9880workmaxx=block%!52 9890workmaxy=block%!56 9900infile%=OPENIN(p$) 9910newlen%=EXT#infile% 9920CLOSE #infile% 9930SYS "XOS_Heap",4,endprog%,icondata%,-blocksize% TO ,,icondata% 9940SYS "XOS_Heap",5,endprog%,,-heapsize%+smegblocksize% 9950blocksize%=4 9960heapsize%=smegblocksize% 9970blocksize%+=newlen% 9980duf%=FALSE 9990IF blocksize%>heapsize% THEN 10000 duf%=TRUE 10010 heapsize%+=newlen% 10020 IF FNcheckfreespace<=heapsize% THEN 10030 PROCalert("Message from Tree","Unable to find enough free memory.",0) 10040 heapsize%-=newlen% 10050 blocksize%-=newlen% 10060 ENDPROC 10070 ENDIF 10080SYS "Wimp_SlotSize",tasksize%+heapsize%,-1 10090 SYS "XOS_Heap",5,endprog%,,newlen% 10100ELSE 10110 IF FNcheckfreespace<=heapsize% THEN 10120 PROCalert("Message from Tree","Unable to find enough free memory.",0) 10130 blocksize%-=newlen% 10140 ENDPROC 10150 ENDIF 10160SYS "Wimp_SlotSize",tasksize%+heapsize%,-1 10170 10180ENDIF 10190SYS "XOS_Heap",4,endprog%,icondata%,newlen% TO ,,icondata% 10200IF icondata%=0 THEN 10210PROCalert("Message from Tree","Unable to find enough free memory.",0) 10220blocksize%-=newlen% 10230IF duf% THEN heapsize%-=newlen% 10240ENDPROC 10250ENDIF 10260newbase%=icondata% 10270SYS &00000008,12,p$,newbase% 10280iii%=newbase%!0 10290PROCgetvars(0,FALSE) 10300pa$=$filename% 10310cft=LEN(pa$) 10320WHILE MID$(pa$,cft,1)<>"." 10330cft-=1 10340ENDWHILE 10350pooup$=MID$(pa$,1,cft-1) 10360PROCtitle(main%,pooup$) 10370FOR myup=0 TO iii%-1 10380IF iii%-1<>0 THEN SYS&000406C4,(myup/(iii%-1))*100 10390PROCgetvars(myup,FALSE) 10400Qpos=(numbericons%!0)*50 10410block%!0=main% 10420block%!4=0 10430SYS &400CE,,block% 10440fag%=block%+4 10450um1%=fag%!4 10460um2%=fag%!12 10470block%!0=main% 10480block%!4=myup 10490SYS &400CE,,block% 10500fag%=block%+4 10510fag%!0=main% 10520fag%!8=fag%!8-44 10530fag%!4=um1%+Qpos 10540nut=fag%!8 10550fag%!16=fag%!16-44 10560fag%!12=um2%+Qpos 10570fcack$=FNgLn($filename%) 10580IF fag%!12>thebigone THEN thebigone=fag%!12 10590fag%!24=text% 10600IF type%!0>&FFF OR type%!0<&0 THEN 10610 IF LEFT$(fcack$,1)="!" THEN 10620 IF NOT FNspriteexists(fcack$) AND iconsprites THEN 10630 tty%=OPENIN($filename%+".!Sprites") 10640 IF tty%>0 AND tty%<=255 THEN 10650 wlll%=EXT#tty% 10660 CLOSE#tty% 10670 ENDIF 10680 IF tty%>0 AND tty%<=255 AND localsprites THEN 10690 IF FNfiletypeofafile($filename%+".!Sprites")=&FF9 THEN 10700 IF FNcheckfreespace>wlll% THEN 10710 REMOSCLI("ICONSPRITES "+$filename%+".!Sprites") 10720 IF localsprites THEN PROCloadsprites2 10730 ELSE 10740 PROCalert("Message from Tree","No room for sprites. Forgetting to load any more !Sprite files.",0) 10750 localsprites=FALSE 10760 valid$="Sdirectory" 10770 ENDIF 10780 ENDIF 10790 ENDIF 10800 ENDIF 10810 valid$="S"+fcack$ 10820 IF NOT FNspriteexists(MID$(valid$,2,LEN(valid$))) THEN valid$="Sapplication" 10830 ELSE 10840 valid$="Sdirectory" 10850 ENDIF 10860ELSE 10870 valid$="Sfile_"+FNpad(type%!0) 10880ENDIF 10890IF type%!0=-2 AND valid$="Sdirectory" THEN valid$="Sfile_xxx" 10900IF NOT FNspriteexists(MID$(valid$,2,LEN(valid$))) THEN valid$="Sfile_xxx" 10910$valid%=valid$ 10920fag%!28=valid% 10930fag%!32=LEN(fcack$) 10940SYS &400C2,,fag% 10950NEXTmyup 10960block%!0=workminx 10970block%!4=nut-4 10980block%!8=thebigone+20 10990block%!12=workmaxy 11000SYS &400d7,main%,block% 11010SYS &000400D1,main%,block%!0,block%!4,block%!8,block%!12 11020PROCopenwindow(main%,TRUE) 11030PROCiconputtext(saveas%,1,p$) 11040SYS&000406C2 11050flufend%=FALSE 11060ENDPROC 11070DEF FNicontext(window%,icon%) 11080block%!0=window% : block%!4=icon% 11090SYS &000400CE,,block% 11100IF ((block%!24) AND &100)=0 ERROR 1,"Icon isn't indirected" 11110=$(block%!28) 11120DEF PROCiconputtext(window%,icon%,text$) 11130block2%!0=window% : block2%!4=icon% 11140SYS &000400CE,,block2% 11150IF ((block2%!24) AND &100)=0 ERROR 1,"Icon isn't indirected" 11160$(block2%!28)=text$ 11170block2%!0=window% : block2%!4=icon% 11180block2%!8=0 : block2%!12=0 11190SYS &000400CD,,block2% 11200ENDPROC 11210DEFPROCseticonsprite(w%,i%,s$) 11220block%!0=w% 11230block%!4=i% 11240SYS &000400CE,,block% 11250$block%!32=s$ 11260block%!0=w% 11270block%!8=0 11280block%!12=0 11290SYS&000400CD,,block% 11300ENDPROC 11310DEFPROCdrawbox(wi%,ic%,sn$) 11320SYS &00000035,MODE,11 TO ,,xpixlimit 11330SYS &00000035,MODE,12 TO ,,ypixlimit 11340SYS &00000035,MODE,4 TO ,,xfact 11350SYS &00000035,MODE,5 TO ,,yfact 11360maxX=(xpixlimit+1)<<xfact 11370maxY=(ypixlimit+1)<<yfact 11380block%!0=wi% 11390SYS&000400CB,,block% 11400ys%=block%!16-block%!8:X%=block%!4:Y%=block%!8 11410yoff%=block%!24 11420block%!0=wi%:block%!4=ic% 11430SYS&000400CE,,block% 11440block%!8+=X% 11450block%!12+=Y%+ys%-yoff% 11460block%!16+=X% 11470block%!20+=Y%+ys%-yoff% 11480block%!4=5 11490SYS&000400CF,,block2% 11500block%!24=0-(block2%!0-block%!8) 11510block%!28=0-(block2%!4-block%!12) 11520block%!32=maxX+(block%!16-block2%!0)-2 11530block%!36=maxY+(block%!20-block2%!4)-4 11540block%!0=ic% 11550IF sn$="" THEN 11560SYS&000400D0,,block% 11570ELSE 11580SYS "DragASprite_Start",%11000101,1,sn$,block%+8 11590ENDIF 11600lastwindow%=wi% 11610ENDPROC 11620DEF PROCiconcaret(window%,icon%,chars%) 11630SYS &000400D2,window%,icon%,,,-1,chars% 11640ENDPROC 11650DEFPROCdofiles(pa$) 11660LOCAL ERROR 11670ON ERROR LOCAL PROCalert("Error from Tree",REPORT$,0):ENDPROC 11680columns=FALSE 11690localsprites=TRUE 11700SYS "XOS_Heap",4,endprog%,icondata%,-blocksize% TO ,,icondata% 11710SYS "XOS_Heap",5,endprog%,,-heapsize%+smegblocksize% 11720heapsize%=smegblocksize% 11730SYS "Wimp_SlotSize",tasksize%+heapsize%,-1 11740blocksize%=4 11750IF icondata%=0 THEN PROCalert("Message from Tree","Unable to find enough free memory.",0):ENDPROC 11760block%!0=main% 11770SYS &000400C3,,block% 11780SYS &000400C1,,mainwindow% TO main% 11790SYS&000406C0 11800cft=LEN(pa$) 11810thebigone=0 11820WHILE MID$(pa$,cft,1)<>"." 11830cft-=1 11840ENDWHILE 11850pooup$=MID$(pa$,1,cft-1) 11860PROCtitle(main%,pooup$) 11870block%!0=main% 11880SYS &400cc,,block% 11890workminx=block%!44 11900workminy=block%!48 11910workmaxx=block%!52 11920workmaxy=block%!56 11930iii%=0 11940tttemp%=0 11950archiver%=FNmodulepresent("SparkFS") 11960tempcack$="" 11970PROCread(pooup$,0,FALSE,0) 11980REMPROCgafup 11990PROCdirs(FALSE) 12000IF iii%>0 THEN 12010block%!0=workminx 12020block%!4=nut-4 12030block%!8=thebigone+20 12040block%!12=workmaxy 12050SYS &400d7,main%,block% 12060SYS &000400D1,main%,block%!0,block%!4,block%!8,block%!12 12070PROCopenwindow(main%,TRUE) 12080mody%=TRUE 12090ELSE 12100PROCclosewindow(main%) 12110PROCalert("Error from Tree","Unable to create tree of '"+pooup$+"'",0) 12120mody%=FALSE 12130ENDPROC 12140ENDIF 12150SYS&000406C2 12160ENDPROC 12170DEF FNgetstring(array%) 12180LOCAL path$,pointer% 12190path$="" 12200pointer%=array% 12210REPEAT 12220path$+=CHR$?pointer% 12230pointer%+=1 12240UNTIL ?pointer%=0 OR ?pointer%=13 12250=path$ 12260DEFPROCgetvars(richicon%,resetflag%) 12270LOCAL ERROR 12280ON ERROR LOCAL PROCalert("Error from Tree",REPORT$,0):ENDPROC 12290fixbase%=icondata% 12300total%=fixbase% 12310base%=fixbase%+((richicon%)*400)+4 12320text%=base% 12330valid%=base%+24 12340filename%=base%+48 12350type%=base%+304 12360numbericons%=base%+308 12370readlength%=base%+312 12380attributes%=base%+316 12390ladr%=base%+320 12400eadr%=base%+324 12410treedef%=base%+328 12420IF richicon%=0 THEN richicon%+=1 12430base2%=(icondata%)+((richicon%-1)*400)+4 12440text2%=base2% 12450valid2%=base2%+24 12460filename2%=base2%+48 12470type2%=base2%+304 12480numbericons2%=base2%+308 12490readlength2%=base2%+312 12500attributes2%=base2%+316 12510ladr2%=base2%+320 12520eadr2%=base2%+324 12530treedef2%=base2%+328 12540IF resetflag% THEN 12550$(treedef%)=STRING$(63,"O") 12560ENDIF 12570ENDPROC 12580DEFPROCread(path$,tb,flag,mycounter) 12590LOCAL ERROR 12600ON ERROR LOCAL PROCalert("Error from Tree",REPORT$,0):ENDPROC 12610PROCgogo 12620ENDPROC 12630DEFPROCgogo 12640LOCAL offset,temp$ 12650offset=0 12660REPEAT 12670$(buf%+20)=CHR$0 12680SYS&0002000C,10,path$+CHR$0,buf%,maxnumber,offset,41,"" TO R0,R1,R2,R3,offset 12690temp$=FNgetstring(buf%+20) 12700IF offset=0 THEN ENDPROC 12710IF temp$<>CHR$0 THEN 12720blocksize%=blocksize%+400 12730IF blocksize%>heapsize% THEN 12740SYS "XOS_Heap",5,endprog%,,400 TO ,,,temp% 12750IF temp%<>400 THEN PROCalert("Message from Tree","Unable to find enough free memory. About to try to display all that has been read.",0):ENDPROC 12760heapsize%+=400 12770IF FNcheckfreespace<=smegblocksize% THEN 12780PROCalert("Message from Tree","Unable to find enough free memory. About to try to display all that has been read.",0) 12790heapsize%-=400 12800blocksize%-=400 12810ENDPROC 12820ENDIF 12830SYS "Wimp_SlotSize",tasksize%+heapsize%+smegblocksize%,-1 12840ENDIF 12850SYS "XOS_Heap",4,endprog%,icondata%,400 TO ,,icondata% 12860IF icondata%=0 THEN PROCalert("Message from Tree","Unable to find enough free memory. About to try to display all that has been read.",0):ENDPROC 12870PROCgetvars(iii%,TRUE) 12880fty%=FNfilestype(buf%!16,buf%!0) 12890$filename%=path$+"."+temp$ 12900type%!0=fty% 12910readlength%!0=buf%!8 12920attributes%!0=buf%!12 12930ladr%!0=buf%!0 12940eadr%!0=buf%!4 12950: 12960block%!0=main% 12970block%!4=0 12980SYS &400CE,,block% 12990fag%=block%+4 13000um1%=fag%!4 13010um2%=fag%!12 13020block%!0=main% 13030block%!4=iii% 13040SYS &400CE,,block% 13050fag%=block%+4 13060fag%!0=main% 13070fag%!8=fag%!8-44 13080fag%!4=um1%+tb 13090nut=fag%!8 13100fag%!16=fag%!16-44 13110fag%!12=um2%+tb 13120IF fag%!12>thebigone THEN thebigone=fag%!12 13130IF offset=-1 THEN 13140?(treedef%+mycounter)=ascl% 13150ELSE 13160?(treedef%+mycounter)=asct% 13170ENDIF 13180numbericons%!0=mycounter 13190IF (iii%-1)>=0 THEN 13200FOR smeg%=0 TO (numbericons2%!0) 13210IF ?(treedef2%+smeg%)=asct% AND ?(treedef%+smeg%)<>ascl% THEN ?(treedef%+smeg%)=asct% 13220NEXTsmeg% 13230ENDIF 13240$text%=temp$ 13250fag%!24=text% 13260IF fty%>&FFF OR fty%<&0 THEN 13270 IF LEFT$(temp$,1)="!" THEN 13280 IF NOT FNspriteexists(temp$) AND iconsprites THEN 13290 tty%=OPENIN(path$+"."+temp$+".!Sprites") 13300 IF tty%<>0 THEN 13310 wlll%=EXT#tty% 13320 CLOSE#tty% 13330 ENDIF 13340 IF tty%<>0 AND localsprites THEN 13350 IF FNfiletypeofafile(path$+"."+temp$+".!Sprites")=&FF9 THEN 13360 IF FNcheckfreespace>wlll% THEN 13370 IF localsprites THEN PROCloadsprites 13380 ELSE 13390 PROCalert("Message from Tree","No room for sprites. Forgetting to load any more !Sprite files.",0) 13400 localsprites=FALSE 13410 valid$="Sdirectory" 13420 ENDIF 13430 ENDIF 13440 ENDIF 13450 ENDIF 13460 valid$="S"+temp$ 13470 IF NOT FNspriteexists(MID$(valid$,2,LEN(valid$))) THEN valid$="Sapplication" 13480 ELSE 13490 valid$="Sdirectory" 13500 ENDIF 13510ELSE 13520 valid$="Sfile_"+FNpad(fty%) 13530ENDIF 13540IF type%!0=-2 AND valid$="Sdirectory" THEN valid$="Sfile_xxx" 13550IF NOT FNspriteexists(MID$(valid$,2,LEN(valid$))) THEN valid$="Sfile_xxx" 13560$valid%=valid$ 13570fag%!28=valid% 13580fag%!32=LEN(temp$) 13590SYS &400C2,,fag% 13600iii%+=1 13610total%!0=iii% 13620ENDIF 13630IF buf%!16=2 OR (fty%=&ddc AND archiver%) OR fty%=&fc8 THEN 13640IF temp$<>CHR$0 THEN 13650PROCread(path$+"."+temp$,tb+50,TRUE,mycounter+1) 13660ENDIF 13670ENDIF 13680UNTIL offset=-1 13690ENDPROC 13700: 13710DEFPROCloadsprites 13720LOCAL ERROR 13730ON ERROR LOCAL PROCalert("Message from Tree","Error whilst trying to ICONSPRITE !Sprites file. "+REPORT$+". Not bothering with any more !Sprite files.",0) 13740OSCLI("ICONSPRITES "+path$+"."+temp$+".!Sprites") 13750localsprites=FALSE 13760ENDPROC 13770: 13780DEFPROCloadsprites2 13790LOCAL ERROR 13800ON ERROR LOCAL PROCalert("Message from Tree","Error whilst trying to ICONSPRITE !Sprites file. "+REPORT$+". Not bothering with any more !Sprite files.",0) 13810OSCLI("ICONSPRITES "+$filename%+".!Sprites") 13820localsprites=FALSE 13830ENDPROC 13840: 13850DEFPROCgafup 13860ENDPROC 13870REMsmeg%=iii%-1 13880REMPROCgetvars(smeg%,FALSE) 13890REMWHILE numbericons%!0>0 13900REMPROCgetvars(smeg%,FALSE) 13910REMFOR smeg2%=0 TO (numbericons%!0)-1 13920REM?(treedef%+smeg2%)=ascl% 13930REMNEXT smeg2% 13940REMsmeg%-=1 13950REMENDWHILE 13960FOR smeg2%=iii%-1 TO 1 STEP -1 13970PROCgetvars(smeg2%,FALSE) 13980FOR smeg3%=0 TO (numbericons%!0) 13990 IF ?(treedef%+smeg3%)=ascl% OR ?(treedef%+smeg3%)=ASC"F" THEN 14000 ?(treedef2%+smeg3%)=ASC"F" 14010 ELSE 14020 ?(treedef2%+smeg3%)=ASC"O" 14030 ENDIF 14040 IF ?(treedef%+smeg3%)=ASC"F" THEN 14050 ?(treedef%+smeg3%)=asct% 14060 ?(treedef2%+smeg3%)=ASC"F" 14070 ENDIF 14080NEXTsmeg3% 14090NEXTsmeg2% 14100ENDPROC 14110: 14120DEFFNws(s) 14130DIM sp% s 14140=sp% 14150DEF FNfilestype(obj%,type%) 14160IF obj%=1 AND (type% AND &FFF00000) <> &FFF00000 THEN 14170type%=-2 14180ELSE 14190IF obj%=1 THEN type%=(type% AND &FFF00) >> 8 ELSE type%=-1 14200ENDIF 14210=type% 14220DEFFNpad(qq) 14230far$=STR$~(qq) 14240CASE LEN(far$) OF 14250WHEN 0 14260far$="000" 14270WHEN 1 14280far$="00"+far$ 14290WHEN 2 14300far$="0"+far$ 14310ENDCASE 14320=far$ 14330DEFPROCdolines(miny%,maxy%,scrolly%) 14340SYS&000400E6,fincols 14350top%=ABS(scrolly% DIV 44) 14360bot%=(maxy%-miny%-scrolly%) DIV 44 14370block2%!0=main% 14380SYS&400cb,,block2% 14390topx%=block2%!4-block2%!20 14400topy%=block2%!16-block2%!24 14410tobot%=bot% 14420IF tobot%>iii%-1 THEN tobot%=iii%-1 14430FOR puke%=top% TO tobot% 14440PROCgetvars(puke%,FALSE) 14450FOR subcount%=0 TO (numbericons%!0)-1 14460IF ?(treedef%+subcount%)=asct% AND subcount%<(numbericons%!0) THEN 14470PROCbar(topx%+(subcount%*50),topy%-puke%*44) 14480IF topy%-puke%*44 > tttemp% THEN tttemp%=topy%-puke%*44 14490ENDIF 14500NEXT subcount% 14510IF ?(treedef%+numbericons%!0)=ascl% THEN 14520PROCbotbar(topx%+((numbericons%!0)*50),topy%-puke%*44) 14530IF topy%-puke%*44 > tttemp% THEN tttemp%=topy%-puke%*44 14540ENDIF 14550IF ?(treedef%+numbericons%!0)=asct% THEN 14560PROCtbar(topx%+((numbericons%!0)*50),topy%-puke%*44) 14570IF topy%-puke%*44 > tttemp% THEN tttemp%=topy%-puke%*44 14580ENDIF 14590NEXT puke% 14600ENDPROC 14610DEFPROCtbar(xp%,yp%) 14620xp%+=8 14630LINE xp%,yp%,xp%,yp%-44 14640LINE xp%,yp%-22,xp%+36,yp%-22 14650ENDPROC 14660DEFPROCbotbar(xp%,yp%) 14670xp%+=8 14680LINE xp%,yp%,xp%,yp%-22 14690LINE xp%,yp%-22,xp%+36,yp%-22 14700ENDPROC 14710DEFPROCbar(xp%,yp%) 14720xp%+=8 14730LINE xp%,yp%,xp%,yp%-44 14740ENDPROC 14750DEFPROCtitle(w%,title$) 14760block%!0 = w% 14770SYS &000400CC,,block% 14780po% = !(block%+76) 14790$po% = title$+CHR$0 14800ENDPROC 14810DEFFNspriteexists(sprite$) 14820SYS&000600E9,24,,sprite$ TO R0% 14830IF R0%>600 OR R0%<0 THEN =FALSE ELSE =TRUE 14840DEFPROCmajorredraw 14850SYS&000406C0 14860FOR myup=0 TO iii%-1 14870IF iii%-1<>0 THEN SYS&000406C4,(myup/(iii%-1))*100 14880PROCgetvars(myup,FALSE) 14890temp$=FNgLn($filename%) 14900IF type%!0>&FFF OR type%!0<&0 THEN 14910IF LEFT$(temp$,1)="!" THEN 14920valid$="S"+temp$ 14930ELSE 14940valid$="Sdirectory" 14950ENDIF 14960ELSE 14970valid$="Sfile_"+FNpad(type%!0) 14980ENDIF 14990IF NOT FNspriteexists(MID$(valid$,2,LEN(valid$))) THEN 15000 IF LEFT$(temp$,1)<>"!" THEN 15010 valid$="Sfile_xxx" 15020 ELSE 15030 valid$="SApplication" 15040 ENDIF 15050ENDIF 15060PROCseticonsprite(main%,myup+1,valid$) 15070NEXTmyup 15080SYS&000406C2 15090ENDPROC 15100DEFPROCalert(title$,message$,button%) 15110CLOSE #0 15120LOCAL response% 15130$(block2%+4)=message$ 15140CASE button% OF 15150WHEN 2 : response%=1 15160WHEN 1 : response%=15 15170WHEN 3 : response%=(1<<5)+16 15180WHEN 4 : response%=(1<<6)+16 15190OTHERWISE : response%=16 15200ENDCASE 15210SYS &000400DF,block2%,response%,title$ TO ,response% 15220ENDPROC 15230DEFPROCexport(afile$,msgflg) 15240SYS &000406C0 15250SYS &08,11,afile$,&fff,0,0 15260mmy%=OPENOUT(afile$) 15270IF fheadings AND fsourcedir THEN 15280lll$="Tree display of '"+pooup$+"'" 15290FOR strptr%=1 TO LEN(lll$) 15300BPUT #mmy%,ASC(MID$(lll$,strptr%,strptr%)) 15310NEXT strptr% 15320BPUT #mmy%,10 15330ENDIF 15340IF fheadings AND fdate THEN 15350lll$="Exported on "+TIME$ 15360FOR strptr%=1 TO LEN(lll$) 15370BPUT #mmy%,ASC(MID$(lll$,strptr%,strptr%)) 15380NEXT strptr% 15390BPUT #mmy%,10 15400ENDIF 15410IF fheadings THEN BPUT #mmy%,10 15420FOR puke%=0 TO iii%-1 15430PROCgetvars(puke%,FALSE) 15440IF iii%-1<>0 THEN SYS&000406C4,(puke%/(iii%-1))*100 15450line$=" " 15460FOR subcount%=0 TO (numbericons%!0)-1 15470IF ?(treedef%+subcount%)=asct% AND (subcount%)<numbericons%!0 THEN 15480line$+=flinejunc$+" " 15490ENDIF 15500IF ?(treedef%+subcount%)<>asct% AND ?(treedef%+subcount%)<>ascl% THEN 15510line$+=" " 15520ENDIF 15530NEXT subcount% 15540ffff$=FNgLn($filename%) 15550IF ?(treedef%+numbericons%!0)=ascl% THEN 15560line$+=fendjunc$+ffff$ 15570ENDIF 15580IF ?(treedef%+numbericons%!0)=asct% THEN 15590line$+=ftjunc$+ffff$ 15600ENDIF 15610FOR strptr%=1 TO LEN(line$) 15620BPUT #mmy%,ASC(MID$(line$,strptr%,strptr%)) 15630NEXT strptr% 15640BPUT #mmy%,10 15650NEXT puke% 15660filelength%=EXT#mmy% 15670CLOSE #mmy% 15680SYS&000406C2 15690IF msgflg THEN 15700block%!0=256 15710block%!12=0 15720block%!16=3 15730block%!20=wind% 15740block%!24=icon% 15750block%!28=x% 15760block%!32=y% 15770block%!36=filelength% 15780block%!40=&FFF 15790$(block%+44)=afile$+CHR$0 15800SYS&000400E7,17,block%,wind%,icon% 15810ENDIF 15820ENDPROC 15830DEFPROCclickoptions(ic%) 15840LOCAL ERROR 15850ON ERROR LOCAL PROCalert("Error from Tree",REPORT$,0):ENDPROC 15860CASE ic% OF 15870WHEN 2 15880headcount=oldhead 15890PROCclosewindow(options%) 15900WHEN 0 15910tt1=fincols 15920tt2=cols 15930frows=VAL(FNicontext(pane%,22)) 15940IF frows<1 THEN frows=1 15950fincols=cols 15960fheadings=headings 15970fsourcedir=sourcedir 15980linejunc$=FNPpad(FNicontext(pane%,8),1) 15990tjunc$=FNPpad(FNicontext(pane%,9),2) 16000endjunc$=FNPpad(FNicontext(pane%,10),2) 16010flinejunc$=linejunc$ 16020fendjunc$=endjunc$ 16030ftjunc$=tjunc$ 16040fdate=date 16050fboxr=boxr 16060fboxg=boxg 16070fboxb=boxb 16080IF dirs<>fdirs THEN 16090fdirs=dirs 16100PROCdirs(TRUE) 16110ENDIF 16120flineobj=lineobj 16130IF button%<>1 THEN PROCclosewindow(options%) 16140IF tt1<>tt2 THEN PROCredrawwindow(main%) 16150WHEN 1 16160SYS&000406C0 16170frows=VAL(FNicontext(pane%,22)) 16180IF frows<1 THEN frows=1 16190tt1=fincols 16200tt2=cols 16210fincols=cols 16220ficonsprites=iconsprites 16230fheadings=headings 16240fsourcedir=sourcedir 16250linejunc$=FNPpad(FNicontext(pane%,8),1) 16260tjunc$=FNPpad(FNicontext(pane%,9),2) 16270endjunc$=FNPpad(FNicontext(pane%,10),2) 16280flinejunc$=linejunc$ 16290fendjunc$=endjunc$ 16300ftjunc$=tjunc$ 16310fdate=date 16320fboxr=boxr 16330fboxg=boxg 16340fboxb=boxb 16350flineobj=lineobj 16360IF dirs<>fdirs THEN 16370fdirs=dirs 16380PROCdirs(TRUE) 16390ENDIF 16400IF button%<>1 THEN PROCclosewindow(options%) 16410IF tt1<>tt2 THEN PROCredrawwindow(main%) 16420oufile%=OPENOUT("<Tree$Dir>.Options") 16430PRINT #oufile%,headcount 16440PRINT #oufile%,fheadings 16450PRINT #oufile%,fsourcedir 16460PRINT #oufile%,fdate 16470PRINT #oufile%,flinejunc$ 16480PRINT #oufile%,ftjunc$ 16490PRINT #oufile%,fendjunc$ 16500PRINT #oufile%,fincols 16510PRINT #oufile%,ficonsprites 16520PRINT #oufile%,frows 16530PRINT #oufile%,fboxr 16540PRINT #oufile%,fboxg 16550PRINT #oufile%,fboxb 16560PRINT #oufile%,flineobj 16570PRINT #oufile%,fdirs 16580CLOSE #oufile% 16590SYS&000406C2 16600 16610WHEN 3 16620PROCdefaults(TRUE) 16630ENDCASE 16640ENDPROC 16650DEFPROCclickpane(ic%) 16660CASE ic% OF 16670WHEN 38 16680boxr-=1 16690IF boxr>=0 AND boxr<=255 THEN 16700PROCsetbar(pane%,28,27,255,boxr) 16710PROCiconputtext(pane%,35,STR$(boxr)) 16720PROCdocolourbox(boxr,boxg,boxb,TRUE) 16730ENDIF 16740IF boxr<0 THEN boxr=0 16750WHEN 41 16760boxr+=1 16770IF boxr>=0 AND boxr<=255 THEN 16780PROCsetbar(pane%,28,27,255,boxr) 16790PROCiconputtext(pane%,35,STR$(boxr)) 16800PROCdocolourbox(boxr,boxg,boxb,TRUE) 16810ENDIF 16820IF boxr>255 THEN boxr=255 16830: 16840WHEN 39 16850boxg-=1 16860IF boxg>=0 AND boxg<=255 THEN 16870PROCsetbar(pane%,31,30,255,boxg) 16880PROCiconputtext(pane%,36,STR$(boxg)) 16890PROCdocolourbox(boxr,boxg,boxb,TRUE) 16900ENDIF 16910IF boxg<0 THEN boxg=0 16920WHEN 42 16930boxg+=1 16940IF boxg>=0 AND boxg<=255 THEN 16950PROCsetbar(pane%,31,30,255,boxg) 16960PROCiconputtext(pane%,36,STR$(boxg)) 16970PROCdocolourbox(boxr,boxg,boxb,TRUE) 16980ENDIF 16990IF boxg>255 THEN boxg=255 17000: 17010WHEN 40 17020boxb-=1 17030IF boxb>=0 AND boxb<=255 THEN 17040PROCsetbar(pane%,34,33,255,boxb) 17050PROCiconputtext(pane%,37,STR$(boxb)) 17060PROCdocolourbox(boxr,boxg,boxb,TRUE) 17070ENDIF 17080IF boxb<0 THEN boxb=0 17090WHEN 43 17100boxb+=1 17110IF boxb>=0 AND boxb<=255 THEN 17120PROCsetbar(pane%,34,33,255,boxb) 17130PROCiconputtext(pane%,37,STR$(boxb)) 17140PROCdocolourbox(boxr,boxg,boxb,TRUE) 17150ENDIF 17160IF boxb>255 THEN boxb=255 17170WHEN 44 17180lineobj=NOT lineobj 17190IF lineobj THEN 17200PROCselicon(pane%,44) 17210ELSE 17220PROCuselicon(pane%,44) 17230ENDIF 17240WHEN 2 17250headings=NOT headings 17260PROCheadings 17270WHEN 46,47,48,49 17280dirs=NOT dirs 17290IF dirs THEN 17300PROCselicon(pane%,46) 17310ELSE 17320PROCuselicon(pane%,46) 17330ENDIF 17340WHEN 3 17350sourcedir=NOT sourcedir 17360IF sourcedir THEN 17370headcount+=1 17380PROCselicon(pane%,3) 17390ELSE 17400headcount-=1 17410IF headcount>0 THEN 17420PROCuselicon(pane%,3) 17430ELSE 17440sourcedir=NOT sourcedir 17450headcount=1 17460ENDIF 17470ENDIF 17480WHEN 4 17490date=NOT date 17500IF date THEN 17510headcount+=1 17520PROCselicon(pane%,4) 17530ELSE 17540headcount-=1 17550IF headcount>0 THEN 17560PROCuselicon(pane%,4) 17570ELSE 17580date=NOT date 17590headcount=1 17600ENDIF 17610ENDIF 17620WHEN 13 17630IF button%=4 THEN cols-=1 17640IF button%=1 THEN cols+=1 17650IF cols>=0 AND cols <=15 THEN 17660PROCiconputtext(pane%,14,STR$(cols)) 17670PROCcolourset(cols) 17680ENDIF 17690IF cols<0 THEN cols=0 17700IF cols>15 THEN cols=15 17710WHEN 15 17720IF button%=4 THEN cols+=1 17730IF button%=1 THEN cols-=1 17740IF cols>=0 AND cols <=15 THEN 17750PROCiconputtext(pane%,14,STR$(cols)) 17760PROCcolourset(cols) 17770ENDIF 17780IF cols>15 THEN cols=15 17790IF cols<0 THEN cols=0 17800WHEN 17 17810iconsprites=NOT iconsprites 17820IF iconsprites THEN 17830PROCselicon(pane%,17) 17840ELSE 17850PROCuselicon(pane%,17) 17860ENDIF 17870WHEN 21 17880rows=VAL(FNicontext(pane%,22)) 17890IF button%=4 THEN rows-=1 17900IF button%=1 THEN rows+=1 17910IF rows>=1 AND rows<=999 THEN 17920PROCiconputtext(pane%,22,STR$(rows)) 17930ENDIF 17940IFrows>999 THEN rows=999 17950IFrows<1 THEN rows=1 17960PROCIconCaret(pane%,22,LEN(STR$(rows))) 17970WHEN 23 17980rows=VAL(FNicontext(pane%,22)) 17990IF button%=4 THEN rows+=1 18000IF button%=1 THEN rows-=1 18010IF rows>=1 AND rows<=999 THEN 18020PROCiconputtext(pane%,22,STR$(rows)) 18030ENDIF 18040IFrows>999 THEN rows=999 18050IFrows<1 THEN rows=1 18060PROCIconCaret(pane%,22,LEN(STR$(rows))) 18070WHEN 28,27 18080PROCdragslidericon(pane%,28,27) 18090WHEN 31,30 18100PROCdragslidericon(pane%,31,30) 18110WHEN 34,33 18120PROCdragslidericon(pane%,34,33) 18130ENDCASE 18140ENDPROC 18150DEFPROCpane 18160oldhead=headcount 18170headings=fheadings 18180boxr=fboxr 18190boxg=fboxg 18200boxb=fboxb 18210PROCsetbar(pane%,28,27,255,boxr) 18220PROCsetbar(pane%,31,30,255,boxg) 18230PROCsetbar(pane%,34,33,255,boxb) 18240PROCdocolourbox(boxr,boxg,boxb,TRUE) 18250: 18260PROCiconputtext(pane%,35,STR$(boxr)) 18270PROCiconputtext(pane%,36,STR$(boxg)) 18280PROCiconputtext(pane%,37,STR$(boxb)) 18290: 18300PROCheadings 18310sourcedir=fsourcedir 18320IF sourcedir THEN 18330PROCselicon(pane%,3) 18340ELSE 18350PROCuselicon(pane%,3) 18360ENDIF 18370date=fdate 18380IF date THEN 18390PROCselicon(pane%,4) 18400ELSE 18410PROCuselicon(pane%,4) 18420ENDIF 18430PROCiconputtext(pane%,8,linejunc$) 18440PROCiconputtext(pane%,9,tjunc$) 18450PROCiconputtext(pane%,10,endjunc$) 18460cols=fincols 18470PROCiconputtext(pane%,14,STR$(cols)) 18480PROCcolourset(cols) 18490iconsprites=ficonsprites 18500IF iconsprites THEN 18510PROCselicon(pane%,17) 18520ELSE 18530PROCuselicon(pane%,17) 18540ENDIF 18550rows=frows 18560PROCiconputtext(pane%,22,STR$(rows)) 18570: 18580lineobj=flineobj 18590IF lineobj THEN 18600PROCselicon(pane%,44) 18610ELSE 18620PROCuselicon(pane%,44) 18630ENDIF 18640IF dirs THEN 18650PROCselicon(pane%,46) 18660ELSE 18670PROCuselicon(pane%,46) 18680ENDIF 18690ENDPROC 18700DEFPROCheadings 18710IF headings THEN 18720PROCselicon(pane%,2) 18730PROCusicon(pane%,3) 18740PROCusicon(pane%,4) 18750ELSE 18760PROCuselicon(pane%,2) 18770PROCsicon(pane%,3) 18780PROCsicon(pane%,4) 18790ENDIF 18800ENDPROC 18810DEFPROCcolourset(c) 18820PROCchangebcolour(pane%,14,c) 18830CASE c OF 18840WHEN 0,1,2,3,9,12,14,15 18850PROCchangefcolour(pane%,14,7) 18860OTHERWISE 18870PROCchangefcolour(pane%,14,0) 18880ENDCASE 18890ENDPROC 18900DEFPROCchangebcolour(wi%,ic%,co%) 18910block%!0=wi% 18920block%!4=ic% 18930block%!8=(co%<<28) 18940block%!12=(%1111<<28) 18950SYS &400CD,,block% 18960ENDPROC 18970DEFPROCchangefcolour(wi%,ic%,co%) 18980block%!0=wi% 18990block%!4=ic% 19000block%!8=(co%<<24) 19010block%!12=(%1111<<24) 19020SYS &400CD,,block% 19030ENDPROC 19040DEFFNPpad(st$,n) 19050LOCAL p 19060p=LEN(st$) 19070st$=st$+STRING$(n-p," ") 19080=st$ 19090DEFPROCdefaults(flagg%) 19100dirs=FALSE 19110PROCuselicon(pane%,46) 19120boxr=0 19130boxg=0 19140boxb=0 19150PROCsetbar(pane%,28,27,255,boxr) 19160PROCsetbar(pane%,31,30,255,boxg) 19170PROCsetbar(pane%,34,33,255,boxb) 19180PROCdocolourbox(boxr,boxg,boxb,TRUE) 19190PROCiconputtext(pane%,35,STR$(boxr)) 19200PROCiconputtext(pane%,36,STR$(boxg)) 19210PROCiconputtext(pane%,37,STR$(boxb)) 19220rows=50 19230headings=TRUE 19240sourcedir=TRUE 19250date=TRUE 19260headcount=2 19270tjunc$="+�" 19280endjunc$="'�" 19290linejunc$="|" 19300cols=7 19310iconsprites=TRUE 19320IF flagg% THEN 19330PROCheadings 19340IF sourcedir THEN 19350PROCselicon(pane%,3) 19360ELSE 19370PROCuselicon(pane%,3) 19380ENDIF 19390IF date THEN 19400PROCselicon(pane%,4) 19410ELSE 19420PROCuselicon(pane%,4) 19430ENDIF 19440PROCiconputtext(pane%,8,linejunc$) 19450PROCiconputtext(pane%,9,tjunc$) 19460PROCiconputtext(pane%,10,endjunc$) 19470PROCiconputtext(pane%,14,STR$(cols)) 19480PROCcolourset(cols) 19490IF iconsprites THEN 19500PROCselicon(pane%,17) 19510ELSE 19520PROCuselicon(pane%,17) 19530ENDIF 19540PROCiconputtext(pane%,22,STR$(rows)) 19550ENDIF 19560lineobj=TRUE 19570IF lineobj THEN 19580PROCselicon(pane%,44) 19590ELSE 19600PROCuselicon(pane%,44) 19610ENDIF 19620ENDPROC 19630DEFFNmodulepresent(modulename$) 19640SYS &0002001E,18,modulename$ TO M0,M1,M2,M3,M4,M5 19650IF M2=0 AND M3=0 AND M4=0 AND M5=0 THEN =0 ELSE =1 19660DEFFNfiletypeofafile(file$) 19670LOCAL obj% 19680SYS &00000008,5,file$ TO obj%,,mynewtype% 19690IF obj%=1 AND (mynewtype% AND &FFF00000) <> &FFF00000 THEN 19700mynewtype%=-2 19710ELSE 19720IF obj%=1 THEN mynewtype%=(mynewtype% AND &FFF00) >> 8 ELSE mynewtype%=-1 19730ENDIF 19740=mynewtype% 19750: 19760DEFFNcheckfreespace 19770SYS"Wimp_SlotSize",-1,-1 TO ,,freepool 19780=freepool 19790: 19800DEFPROCdodraw(file$) 19810SYS &08,11,file$,&aff,0,0 19820SYS "Hourglass_On" 19830recalcx%=0 19840X%=OPENOUT(file$) 19850topx%=300 19860dummytopy%=8150 19870topy%=8150 19880tttemp%=200 19890dummyx%=0 19900IF tttemp%<830 THEN tttemp%=830 19910IF columns THEN 19920PROCmakedrawfileheader(topx%-150,topy%-((rows-1)*22)-50,0,topy%+200) 19930ELSE 19940PROCmakedrawfileheader(topx%-150,topy%-((iii%-1)*22)-50,tttemp%+50,topy%+200) 19950ENDIF 19960: 19970PROCobjectheader(0,8+FNfonttablesize("Homerton.Medium"),0,0,0,0,FALSE) 19980PROCfonttable(1,"Homerton.Medium") 19990: 20000PROCobjectheader(11,64+24,0,0,0,0,TRUE) 20010PROCobject 20020: 20030PROCobjectheader(2,24+16+24+4,topx%-100,topy%+144,topx%-100+650,topy%+144,TRUE) 20040PROCpathheader(255,0,0) 20050PROCdrawfilemove(topx%-100,topy%+144) 20060PROCdrawfiledraw(topx%-100+650,topy%+144) 20070PROCendpath 20080: 20090PROCtextobject(1,255,0,0,14,14,topx%-100,topy%+150,"Tree ("+MID$(ver$,1,6)+") - by Richard Samphire 1993") 20100PROCtextobject(1,0,0,0,10,10,topx%-100,topy%+40,"Tree of :") 20110PROCtextobject(1,0,68,153,8,8,topx%-30,topy%+15,pooup$) 20120: 20130pfaf%=0 20140duff%=0 20150Alinecount%=0 20160Blinecount%=0 20170FOR puke%=0 TO iii%-1 20180IF puke%>0 AND (puke% MOD rows = 0) AND columns THEN 20190topx%=(recalcx%+200) 20200col(duff%)=topx% 20210topy%=dummytopy% 20220recalcx%=0 20230pfaf%=0 20240duff%+=1 20250IF duff%>199 THEN 20260duff%=199 20270ERROR 0,"A tree draw file can only have 199 columns." 20280ENDIF 20290ENDIF 20300IF iii%-1<>0 THEN SYS&000406C4,(puke%/(iii%-1))*100 20310PROCgetvars(puke%,FALSE) 20320FOR subcount%=0 TO (numbericons%!0)-1 20330IF ?(treedef%+subcount%)=asct% AND subcount%<(numbericons%!0) THEN 20340IF NOT lineobj THEN PROCdrawbar(topx%+(subcount%*25),topy%-pfaf%*22) 20350Alinecount%+=1 20360ENDIF 20370NEXT subcount% 20380IF ?(treedef%+numbericons%!0)=ascl% THEN 20390IF NOT lineobj THEN PROCdrawbotbar(topx%+((numbericons%!0)*25),topy%-pfaf%*22) 20400PROCsprite(topx%+((numbericons%!0)*25)+24,(topy%-pfaf%*22)-20) 20410PROCtextobject(1,0,0,0,8,8,topx%+((numbericons%!0)*25)+55,(topy%-pfaf%*22)-18,FNgLn($filename%)) 20420Blinecount%+=1 20430ENDIF 20440IF ?(treedef%+numbericons%!0)=asct% THEN 20450IF NOT lineobj THEN PROCdrawtbar(topx%+((numbericons%!0)*25),topy%-pfaf%*22) 20460PROCsprite(topx%+((numbericons%!0)*25)+24,(topy%-pfaf%*22)-20) 20470PROCtextobject(1,0,0,0,8,8,topx%+((numbericons%!0)*25)+55,(topy%-pfaf%*22)-18,FNgLn($filename%)) 20480Blinecount%+=1 20490ENDIF 20500pfaf%+=1 20510NEXT puke% 20520: 20530IF lineobj THEN 20540PROCobjectheader(2,24+16+(Blinecount%*48)+(Alinecount%*24)+4,x,y-22,x+18,y,TRUE) 20550PROCpathheader(fboxr,fboxg,fboxb) 20560topx%=300 20570dummytopy%=8150 20580topy%=8150 20590tttemp%=200 20600dummyx%=0 20610pfaf%=0 20620duff%=0 20630FOR puke%=0 TO iii%-1 20640IF puke%>0 AND (puke% MOD rows = 0) AND columns THEN 20650topx%=col(duff%) 20660topy%=dummytopy% 20670recalcx%=0 20680pfaf%=0 20690duff%+=1 20700ENDIF 20710IF iii%-1<>0 THEN SYS&000406C4,(puke%/(iii%-1))*100 20720PROCgetvars(puke%,FALSE) 20730FOR subcount%=0 TO (numbericons%!0)-1 20740IF ?(treedef%+subcount%)=asct% AND subcount%<(numbericons%!0) THEN 20750PROCdrawbar2(topx%+(subcount%*25),topy%-pfaf%*22) 20760ENDIF 20770NEXT subcount% 20780IF ?(treedef%+numbericons%!0)=ascl% THEN 20790PROCdrawbotbar2(topx%+((numbericons%!0)*25),topy%-pfaf%*22) 20800ENDIF 20810IF ?(treedef%+numbericons%!0)=asct% THEN 20820PROCdrawtbar2(topx%+((numbericons%!0)*25),topy%-pfaf%*22) 20830ENDIF 20840pfaf%+=1 20850NEXT puke% 20860PROCendpath 20870ENDIF 20880: 20890filelength%=EXT#X% 20900IF columns THEN 20910PTR#X%=32 20920block2%!0=FNtodraw(dummyx%+250) 20930SYS "OS_GBPB",2,X%,block2%,4 20940ENDIF 20950CLOSE#X% 20960SYS "Hourglass_Smash" 20970OSCLI("SETTYPE "+file$+" &AFF") 20980block%!0=256 20990block%!12=0 21000block%!16=3 21010block%!20=wind% 21020block%!24=icon% 21030block%!28=x% 21040block%!32=y% 21050block%!36=filelength% 21060block%!40=&aff 21070$(block%+44)=file$+CHR$0 21080SYS&000400E7,17,block%,wind%,icon% 21090ENDPROC 21100: 21110DEFPROCmakedrawfileheader(xl,yl,xh,yh) 21120$(block2%+0)="Draw" 21130block2%!4=201 21140block2%!8=0 21150$(block2%+12)="Tree " 21160block2%!24=FNtodraw(xl) 21170block2%!28=FNtodraw(yl) 21180block2%!32=FNtodraw(xh) 21190block2%!36=FNtodraw(yh) 21200SYS "OS_GBPB",2,X%,block2%,40 21210ENDPROC 21220: 21230DEFPROCobjectheader(type,size,xl,yl,xh,yh,flg) 21240block2%!0=type 21250block2%!4=size 21260IF flg THEN 21270block2%!8=FNtodraw(xl) 21280block2%!12=FNtodraw(yl) 21290block2%!16=FNtodraw(xh) 21300block2%!20=FNtodraw(yh) 21310SYS "OS_GBPB",2,X%,block2%,24 21320ELSE 21330SYS "OS_GBPB",2,X%,block2%,8 21340ENDIF 21350ENDPROC 21360: 21370DEFFNtodraw(num) 21380=num*256 21390: 21400DEFPROCpathheader(r,g,b) 21410block2%!0=-1 21420?(block2%+4)=0 21430?(block2%+5)=r 21440?(block2%+6)=g 21450?(block2%+7)=b 21460block2%!8=0 21470block2%!12=%1101000 21480SYS "OS_GBPB",2,X%,block2%,16 21490ENDPROC 21500: 21510DEFPROCdrawfilemove(x,y) 21520block2%!0=2 21530block2%!4=FNtodraw(x) 21540block2%!8=FNtodraw(y) 21550SYS "OS_GBPB",2,X%,block2%,12 21560ENDPROC 21570: 21580DEFPROCdrawfiledraw(x,y) 21590block2%!0=8 21600block2%!4=FNtodraw(x) 21610block2%!8=FNtodraw(y) 21620SYS "OS_GBPB",2,X%,block2%,12 21630ENDPROC 21640: 21650DEFPROCendpath 21660block2%!0=0 21670SYS "OS_GBPB",2,X%,block2%,4 21680ENDPROC 21690: 21700DEFPROCobject 21710block2%!0=(0+1)*&100 21720block2%!4=0 21730|(block2%+8)=1.0 21740block2%!16=2 21750block2%!20=0 21760block2%!24=0 21770block2%!28=0 21780block2%!32=0 21790block2%!36=1 21800block2%!40=1 21810block2%!44=1 21820block2%!48=0 21830block2%!52=1 21840block2%!56=0 21850block2%!60=4096 21860SYS "OS_GBPB",2,X%,block2%,64 21870ENDPROC 21880: 21890DEFPROCdrawtbar(x,y) 21900PROCobjectheader(2,24+16+24+24+4,x,y-22,x+18,y,TRUE) 21910PROCpathheader(fboxr,fboxg,fboxb) 21920PROCdrawfilemove(x,y) 21930PROCdrawfiledraw(x,y-22) 21940PROCdrawfilemove(x,y-11) 21950PROCdrawfiledraw(x+18,y-11) 21960PROCendpath 21970ENDPROC 21980: 21990DEFPROCdrawbotbar(x,y) 22000PROCobjectheader(2,24+16+24+24+4,x,y-11,x+18,y,TRUE) 22010PROCpathheader(fboxr,fboxg,fboxb) 22020PROCdrawfilemove(x,y) 22030PROCdrawfiledraw(x,y-11) 22040PROCdrawfilemove(x,y-11) 22050PROCdrawfiledraw(x+18,y-11) 22060PROCendpath 22070ENDPROC 22080: 22090DEFPROCdrawbar(x,y) 22100PROCobjectheader(2,24+16+24+4,x,y-22,x+18,y,TRUE) 22110PROCpathheader(fboxr,fboxg,fboxb) 22120PROCdrawfilemove(x,y) 22130PROCdrawfiledraw(x,y-22) 22140PROCendpath 22150ENDPROC 22160: 22170DEFPROCfonttable(number,font$) 22180FOR blank%=0 TO 20+LEN(font$) 22190?(block2%+blank%)=0 22200NEXTblank% 22210?(block2%+0)=number 22220$(block2%+1)=font$+CHR$0 22230SYS "OS_GBPB",2,X%,block2%,FNfonttablesize(font$) 22240ENDPROC 22250: 22260DEFFNfonttablesize(FO$) 22270l=0 22280FO$=FO$+CHR$0 22290l+=LEN(FO$) 22300cs=l MOD 4 22310IF cs>0 THEN cs=4-cs 22320cs+=LEN(FO$) 22330=cs+12 22340: 22350DEFPROCtextobject(number,r,g,b,px,py,x,y,str$) 22360MXP=px*1000 22370MYP=py*1000 22380SYS &40088,,MXP,MYP TO ,MMXP,MMYP 22390MMXP=MMXP*(LEN(str$)/2) 22400sx=0 22410FOR b=0 TO LEN(str$) 22420PROCobjectheader(1,24+FNfontsize(str$),x,y,x+MMXP,y+MMYP,TRUE) 22430IF x>recalcx% THEN recalcx%=x 22440IF x+MMXP>dummyx% THEN dummyx%=x+MMXP 22450FOR blank%=0 TO 40+LEN(str$) 22460?(block2%+blank%)=0 22470NEXTblank% 22480?(block2%+0)=0 22490?(block2%+1)=r 22500?(block2%+2)=g 22510?(block2%+3)=b 22520?(block2%+4)=0 22530?(block2%+5)=255 22540?(block2%+6)=255 22550?(block2%+7)=255 22560block2%!8=number 22570block2%!12=px*640 22580block2%!16=py*640 22590block2%!20=FNtodraw(x) 22600block2%!24=FNtodraw(y) 22610$(block2%+28)=str$+CHR$0 22620SYS "OS_GBPB",2,X%,block2%,FNfontsize(str$) 22630ENDPROC 22640: 22650DEFFNfontsize(FO$) 22660l=0 22670FO$=FO$+CHR$0 22680l+=LEN(FO$) 22690cs=l MOD 4 22700IF cs>0 THEN cs=4-cs 22710cs+=LEN(FO$) 22720=cs+28 22730: 22740DEFPROCsprite(XXMY,YYMY) 22750fcack$=FNgLn($filename%) 22760IF type%!0>&FFF OR type%!0<&0 THEN 22770 IF LEFT$(fcack$,1)="!" THEN 22780 valid$=fcack$ 22790 IF NOT FNspriteexists(valid$) THEN valid$="application" 22800 ELSE 22810 valid$="directory" 22820 ENDIF 22830ELSE 22840 valid$="file_"+FNpad(type%!0) 22850 IF NOT FNspriteexists(valid$) THEN valid$="file_xxx" 22860ENDIF 22870: 22880PROCsubspr 22890ENDPROC 22900: 22910DEFPROCsubspr 22920LOCAL ERROR 22930ON ERROR LOCAL IF ERR=134 THEN PROCsubspr2:ENDPROC 22940SYS &400EA TO newarea 22950SYS &2E,256+24,newarea,valid$ TO ,,sprpointer% 22960: 22970spritelength%=sprpointer%!0 22980mval=(24+spritelength%) MOD 4 22990IF mval>0 THEN mval=4-mval 23000PROCobjectheader(5,24+spritelength%+mval,XXMY,YYMY,XXMY+20,YYMY+20,TRUE) 23010SYS "OS_GBPB",2,X%,sprpointer%,spritelength% 23020block2%!0=0 23030SYS "OS_GBPB",2,X%,block2%,mval 23040ENDPROC 23050: 23060DEFPROCsubspr2 23070LOCAL ERROR 23080ON ERROR LOCAL ERROR 0,REPORT$+STR$(ERL) 23090SYS &400ea TO ,newarea 23100SYS &2e,256+24,newarea,valid$ TO ,,sprpointer% 23110: 23120spritelength%=sprpointer%!0 23130mval=(24+spritelength%) MOD 4 23140IF mval>0 THEN mval=4-mval 23150PROCobjectheader(5,24+spritelength%+mval,XXMY,YYMY,XXMY+20,YYMY+20,TRUE) 23160SYS "OS_GBPB",2,X%,sprpointer%,spritelength% 23170block2%!0=0 23180SYS "OS_GBPB",2,X%,block2%,mval 23190ENDPROC 23200: 23210DEFPROCIconCaret(window%,icon%,chars%) 23220SYS "Wimp_SetCaretPosition",window%,icon%,,,-1,chars% 23230ENDPROC 23240: 23250DEFPROCdrawtbar2(x,y) 23260PROCdrawfilemove(x,y) 23270PROCdrawfiledraw(x,y-22) 23280PROCdrawfilemove(x,y-11) 23290PROCdrawfiledraw(x+18,y-11) 23300ENDPROC 23310: 23320DEFPROCdrawbotbar2(x,y) 23330PROCdrawfilemove(x,y) 23340PROCdrawfiledraw(x,y-11) 23350PROCdrawfilemove(x,y-11) 23360PROCdrawfiledraw(x+18,y-11) 23370ENDPROC 23380: 23390DEFPROCdrawbar2(x,y) 23400PROCdrawfilemove(x,y) 23410PROCdrawfiledraw(x,y-22) 23420ENDPROC 23430: 23440 23450DEFFNattributes(attrib) 23460attribute$="" 23470IF attrib AND %1000 THEN attribute$+="L" 23480IF attrib AND %10 THEN attribute$+="W" 23490IF attrib AND %1 THEN attribute$+="R" 23500attribute$+="/" 23510IF attrib AND %10000000 THEN attribute$+="l" 23520IF attrib AND %100000 THEN attribute$+="w" 23530IF attrib AND %10000 THEN attribute$+="r" 23540=attribute$ 23550: 23560DEFFNmyconvert(laddress,eaddress) 23570IF (laddress AND %11111111111100000000000000000000) = %11111111111100000000000000000000 THEN 23580templ=laddress AND (NOT %11111111111111111111111100000000) 23590?(block2%+4)=templ 23600tempe=eaddress AND (NOT %00000000111111111111111111111111) 23610?(block2%+3)=tempe>>24 23620tempe=eaddress AND (NOT %11111111000000001111111111111111) 23630?(block2%+2)=tempe>>16 23640tempe=eaddress AND (NOT %11111111111111110000000011111111) 23650?(block2%+1)=tempe>>8 23660tempe=eaddress AND (NOT %11111111111111111111111100000000) 23670?(block2%+0)=tempe 23680result%=block2%+256 23690SYS "OS_ConvertStandardDateAndTime",block2%,result%,256 23700=FNgetstring(result%) 23710ENDIF 23720=STR$~(laddress)+" "+STR$~(eaddress) 23730: 23740DEFPROCgetprinterinfo 23750SYS "XPDriver_Info" TO R0,R1,R2,R3,R4,R5,R6,R7 23760IF R1=0 AND R2=0 AND R3=0 AND R4=0 AND R5=0 AND R6=0 THEN 23770driver%=FALSE 23780printer$="None Installed" 23790ELSE 23800driver%=TRUE 23810printer$=FNgetstring(R4) 23820ENDIF 23830ENDPROC 23840: 23850DEFPROCclickprint(ic%) 23860CASE ic% OF 23870WHEN 1 23880copies=VAL(FNicontext(print%,2)) 23890IF copies<0 THEN copies=1 23900IF copies>999 THEN copies=999 23910IF button%=4 THEN copies-=1 23920IF button%=1 THEN copies+=1 23930IF copies<1 THEN copies=1 23940IF copies>999 THEN copies=999 23950PROCiconputtext(print%,2,STR$(copies)) 23960PROCIconCaret(print%,2,LEN(STR$(copies))) 23970WHEN 3 23980copies=VAL(FNicontext(print%,2)) 23990IF copies<1 THEN copies=1 24000IF copies>999 THEN copies=999 24010IF button%=1 THEN copies-=1 24020IF button%=4 THEN copies+=1 24030IF copies<0 THEN copies=1 24040IF copies>999 THEN copies=999 24050PROCiconputtext(print%,2,STR$(copies)) 24060PROCIconCaret(print%,2,LEN(STR$(copies))) 24070WHEN 5 24080copies=VAL(FNicontext(print%,2)) 24090IF copies<1 THEN copies=1 24100IF copies>999 THEN copies=999 24110doprint%=TRUE 24120poowindow%=print% 24130block%!0=256 24140block%!12=0 24150block%!16=&80142 24160block%!20=0 24170block%!24=0 24180block%!28=0 24190block%!32=0 24200block%!36=-1 24210block%!40=&FFF 24220$(block%+44)=FNgLn("<Wimp$Scrap>")+CHR$0 24230SYS "Wimp_SendMessage",18,block%,0 24240IF button%<>1 THEN SYS "Wimp_CreateMenu",-1 24250ENDIF 24260ENDCASE 24270ENDPROC 24280: 24290DEFFNmycontrol 24300block2%!0=mycontrol% 24310SYS &000400CB,,block2% 24320SYS &000400C5,,block2% 24330tBB=-1 24340REPEAT 24350SYS &000400C7,0,block2% TO reason2%,block2% 24360CASE reason2% OF 24370WHEN 1 24380SYS &000400C8,,block2% TO flag 24390WHILE flag 24400PROCdolines(block2%!8,block2%!16,block2%!24) 24410SYS &000400CA,,block2% TO flag 24420ENDWHILE 24430WHEN 2 24440SYS &000400C5,,block2% 24450WHEN 6 24460subbutton%=block2%!8 24470subwindow%=block2%!12 24480subicon%=block2%!16 24490IF subwindow%=mycontrol% THEN 24500CASE subicon% OF 24510WHEN 5 : tBB = 0 24520WHEN 6 : tBB = 1 24530WHEN 7 : tBB = 2 24540ENDCASE 24550ENDIF 24560WHEN 18 24570IF block2%!16=8 THEN 24580 block2%!12=block2%!8 24590 SYS "Wimp_SendMessage",19,block2%,0 24600 PROCsicon(mycontrol%,6) 24610 pressed=TRUE 24620ENDIF 24630ENDCASE 24640 24650UNTIL tBB>-1 24660=tBB 24670: 24680DEFPROCdragslidericon(win%,dragicon%,sizeicon%) 24690block%!0=win% 24700block%!4=sizeicon% 24710SYS "Wimp_GetIconState",,block% 24720sminx%=block%!8 24730sminy%=block%!12 24740smaxx%=block%!16 24750smaxy%=block%!20 24760SYS "Wimp_GetPointerInfo",,block% 24770mx%=block%!0 24780block%!0=win% 24790SYS "Wimp_GetWindowInfo",,block% 24800calcx%=(mx%-(block%!4-block%!20))+block%!44 24810SYS &35,MODE,4 TO ,,xfact% 24820iconminx%=sminx%+(block%!4-block%!20) 24830iconmaxx%=iconminx%+(smaxx%-sminx%) 24840iconminy%=sminy%+(block%!16-block%!24) 24850SYS &35,MODE,5 TO ,,yfact% 24860iconmaxy%=iconminy%+(smaxy%-sminy%)-(1<<yfact%) 24870block%!0=win% 24880block%!4=7 24890block%!8=iconminx% 24900block%!12=iconminy% 24910block%!16=iconmaxx% 24920block%!20=iconmaxy% 24930block%!24=block%!8 24940block%!28=block%!12 24950block%!32=block%!16 24960block%!36=block%!20 24970SYS "Wimp_DragBox",,block% 24980slidewindow%=win% 24990slideicon%=dragicon% 25000slidesize%=sizeicon% 25010lastwindow%=win% 25020block%!0=win% 25030block%!4=dragicon% 25040SYS "Wimp_GetIconState",,block% 25050oldworkx%=block%!16 25060ENDPROC 25070: 25080DEFPROCdoslide(win%,dragicon%,sizeicon%,const%,range%) 25090block%!0=win% 25100block%!4=sizeicon% 25110SYS "Wimp_GetIconState",,block% 25120sizeminx%=block%!8 25130sizeminy%=block%!12 25140sizemaxx%=block%!16 25150sizemaxy%=block%!20 25160MOUSE mx%,my%,mb% 25170block%!0=win% 25180SYS "Wimp_GetWindowInfo",,block% 25190minx%=block%!4 25200scrx%=block%!20 25210newx%=mx%+(scrx%-minx%) 25220IF newx%<>oldworkx% THEN 25230 block%!0=win% 25240 block%!4=dragicon% 25250 SYS "Wimp_GetIconState",,block% 25260 block%!16=newx% 25270 block%!0=win% 25280 block%!4=dragicon% 25290 SYS "Wimp_DeleteIcon",,block% 25300 block%!4=win% 25310 SYS "Wimp_CreateIcon",,block%+4 25320newblock%=block%+4 25330IF oldworkx%<newx% THEN 25340newblock%!4=sizeminx% 25350ELSE 25360newblock%!4=newx% 25370ENDIF 25380newblock%!8=sizeminy% 25390IF oldworkx%>newx% THEN 25400newblock%!12=sizemaxx% 25410ELSE 25420newblock%!12=newx% 25430ENDIF 25440newblock%!16=sizemaxy% 25450SYS "Wimp_UpdateWindow",,newblock% TO flag 25460WHILE flag 25470SYS "Wimp_GetRectangle",,newblock% TO flag 25480ENDWHILE 25490 IF const% THEN 25500 size%=sizemaxx%-sizeminx% 25510 ppos%=(newx%-sizeminx%) 25520 number%=(range%/size%)*ppos% 25530 : 25540 CASE slideicon% OF 25550 WHEN 28 25560 boxr=number% 25570 PROCiconputtext(pane%,35,STR$(boxr)) 25580 PROCdocolourbox(boxr,boxg,boxb,TRUE) 25590 WHEN 31 25600 boxg=number% 25610 PROCiconputtext(pane%,36,STR$(boxg)) 25620 PROCdocolourbox(boxr,boxg,boxb,TRUE) 25630 WHEN 34 25640 boxb=number% 25650 PROCiconputtext(pane%,37,STR$(boxb)) 25660 PROCdocolourbox(boxr,boxg,boxb,TRUE) 25670 ENDCASE 25680 ENDIF 25690ENDIF 25700block%!0=win% 25710block%!4=dragicon% 25720SYS "Wimp_GetIconState",,block% 25730oldworkx%=block%!16 25740rrange%=range% 25750ENDPROC 25760: 25770DEFPROCsetbar(win%,dragicon%,sizeicon%,range%,number%) 25780IF number%<0 THEN number%=0 25790IF number%>range% THEN number%=range% 25800block%!0=win% 25810block%!4=sizeicon% 25820SYS "Wimp_GetIconState",,block% 25830sizeminx%=block%!8 25840sizeminy%=block%!12 25850sizemaxx%=block%!16 25860sizemaxy%=block%!20 25870newx%=sizeminx%+(number%/(range%/(sizemaxx%-sizeminx%))) 25880block%!0=win% 25890block%!4=dragicon% 25900SYS "Wimp_GetIconState",,block% 25910block%!16=newx% 25920block%!0=win% 25930block%!4=dragicon% 25940SYS "Wimp_DeleteIcon",,block% 25950block%!4=win% 25960SYS "Wimp_CreateIcon",,block%+4 25970newblock%=block%+4 25980IF oldworkx%<newx% THEN 25990newblock%!4=sizeminx% 26000ELSE 26010newblock%!4=newx% 26020ENDIF 26030newblock%!8=sizeminy% 26040IF oldworkx%<newx% THEN 26050newblock%!12=newx% 26060ELSE 26070newblock%!12=sizemaxx% 26080ENDIF 26090newblock%!16=sizemaxy% 26100SYS "Wimp_UpdateWindow",,newblock% TO flag 26110WHILE flag 26120SYS "Wimp_GetRectangle",,newblock% TO flag 26130ENDWHILE 26140oldworkx%=newx% 26150ENDPROC 26160: 26170DEFFNgetbarvalue(win%,dragicon%,sizeicon%,range%) 26180block%!0=win% 26190block%!4=sizeicon% 26200SYS "Wimp_GetIconState",,block% 26210sizeminx%=block%!8 26220sizemaxx%=block%!16 26230block%!0=win% 26240block%!4=dragicon% 26250SYS "Wimp_GetIconState",,block% 26260=(range%/(sizemaxx%-sizeminx%))*(block%!16-block%!8) 26270: 26280DEFFNtopal(r,g,b) 26290C=0 26300C=C OR (b<<24) 26310C=C OR (g<<16) 26320C=C OR (r<<8) 26330=C 26340: 26350DEFPROCdocolourbox(r,g,b,flg) 26360block2%!0=pane% 26370SYS&400cb,,block2% 26380btopx%=block2%!4-block2%!20 26390btopy%=block2%!16-block2%!24 26400IF flg THEN 26410block2%!0=pane% 26420block2%!4=45 26430SYS "Wimp_GetIconState",,block2% 26440newblock%=block2%+4 26450newblock%!0=pane% 26460SYS "Wimp_UpdateWindow",,newblock% TO fflag 26470WHILE fflag 26480SYS "ColourTrans_SetGCOL",FNtopal(r,g,b),,,%100000000,0 26490RECTANGLE FILL btopx%+234,btopy%-1036,234,38 26500SYS "Wimp_GetRectangle",,newblock% TO fflag 26510ENDWHILE 26520ELSE 26530SYS "ColourTrans_SetGCOL",FNtopal(r,g,b),,,%100000000,0 26540RECTANGLE FILL btopx%+234,btopy%-1036,234,38 26550ENDIF 26560ENDPROC 26570: 26580DEFPROCdotitle(funny) 26590PROCcentrewindow(title%) 26600SYS &000400C7,0,block2% TO reason2%,block2% 26610t=TIME 26620REPEAT 26630UNTIL TIME>t+funny 26640PROCclosewindow(title%) 26650ENDPROC 26660: 26670DEFPROCinitsprites 26680SYS "OS_ReadModeVariable",-1,5 TO ,,yeig% 26690IF yeig%<2 THEN sprite$="Sprites" ELSE sprite$="Sprites" 26700SYS "OS_File",17,"<Tree$Dir>."+sprite$ TO type%,,,,length% 26710DIM sprite% length%+4 26720!sprite%=length%+4 26730SYS "OS_SpriteOp",266,sprite%,"<Tree$Dir>."+sprite$ 26740ENDPROC 26750: 26760DEFPROCcentrewindow(win%) 26770SYS &00000035,MODE,11 TO ,,xpixlimit 26780SYS &00000035,MODE,12 TO ,,ypixlimit 26790SYS &00000035,MODE,4 TO ,,xfact 26800SYS &00000035,MODE,5 TO ,,yfact 26810maxX=(xpixlimit+1)<<xfact 26820maxY=(ypixlimit+1)<<yfact 26830: 26840block%!0=win% 26850SYS &000400CB,,block% 26860: 26870IF NOT FNisopen(win%) THEN 26880wx%=block%!12-block%!4 26890wx2%=wx% DIV 2 26900cX=maxX DIV 2 26910block%!4=cX-wx2% 26920block%!12=block%!4+wx% 26930wy%=block%!16-block%!8 26940wy2%=wy% DIV 2 26950cY=maxY DIV 2 26960block%!8=cY-wy2% 26970block%!16=block%!8+wy% 26980ENDIF 26990: 27000SYS &000400C5,,block% 27010ENDPROC 27020: 27030DEFPROCdragmyfile 27040PROCgetvars(icon%-1,FALSE) 27050fty%=type%!0 27060temp$=FNgLn($filename%) 27070IF fty%>&FFF OR fty%<&0 THEN 27080 IF LEFT$(temp$,1)="!" THEN 27090 valid$=temp$ 27100 IF NOT FNspriteexists(valid$) THEN valid$="application" 27110 ELSE 27120 valid$="directory" 27130 ENDIF 27140ELSE 27150 valid$="file_"+FNpad(fty%) 27160ENDIF 27170IF type%!0=-2 AND valid$="directory" THEN valid$="file_xxx" 27180IF NOT FNspriteexists(valid$) THEN valid$="file_xxx" 27190: 27200PROCsubspr3 27210SYS &00000035,MODE,4 TO ,,xfact 27220SYS &00000035,MODE,5 TO ,,yfact 27230wpix%=wpix2%<<xfact 27240hpix%=hpix2%<<yfact 27250: 27260block%!0=x%-(wpix% DIV 2) 27270block%!4=y%-(hpix% DIV 2) 27280block%!8=block%!0+wpix% 27290block%!12=block%!4+hpix% 27300: 27310SYS "DragASprite_Start",%11000101,newarea,valid$,block% 27320lastwindow%=main% 27330ENDPROC 27340: 27350DEFPROCsubspr3 27360LOCAL ERROR 27370ON ERROR LOCAL IF ERR=134 THEN PROCsubspr4:ENDPROC 27380SYS &400EA TO newarea 27390SYS &2e,256+40,newarea,valid$ TO ,,,wpix2%,hpix2% 27400ENDPROC 27410: 27420DEFPROCsubspr4 27430LOCAL ERROR 27440ON ERROR LOCAL ERROR 0,REPORT$ 27450SYS &400ea TO ,newarea 27460SYS &2e,256+40,newarea,valid$ TO ,,,wpix2%,hpix2% 27470ENDPROC 27480: 27490DEFPROCdirs(inflg) 27500IF iii%>0 THEN 27510 SYS "Hourglass_On" 27520 IF fdirs THEN 27530 FOR smeg%=1 TO iii% 27540 IF iii%-1<>0 THEN SYS&000406C4,(smeg%/(iii%-1))*100 27550 PROCgetvars(smeg%-1,FALSE) 27560 IF type%!0<>-1 THEN PROCsicon(main%,smeg%) 27570 NEXTsmeg% 27580 ELSE 27590 IF inflg THEN 27600 FOR smeg%=1 TO iii% 27610 IF iii%-1<>0 THEN SYS&000406C4,(smeg%/(iii%-1))*100 27620 PROCgetvars(smeg%-1,FALSE) 27630 IF type%!0<>-1 THEN PROCusicon(main%,smeg%) 27640 NEXTsmeg% 27650 ENDIF 27660 ENDIF 27670 SYS "Hourglass_Smash" 27680ENDIF 27690ENDPROC 27700: 27710DEFPROCopensearch 27720cursearch=currentsearch-1 27730IF cursearch=0 THEN PROCsicon(search%,4) ELSE PROCusicon(search%,4) 27740IF cursearch=iii%-1 THEN PROCsicon(search%,5) ELSE PROCusicon(search%,5) 27750PROCgetvars(cursearch,FALSE) 27760PROCiconputtext(search%,8,FNgLn($filename%)) 27770IF NOT FNisopen(search%) THEN 27780casesens=FALSE 27790PROCuselicon(search%,11) 27800searchfile=TRUE 27810searchtype=FALSE 27820PROCselicon(search%,0) 27830PROCuselicon(search%,1) 27840PROCusicon(search%,2) 27850PROCsicon(search%,3) 27860PROCiconputtext(search%,2,"") 27870PROCiconputtext(search%,3,"") 27880REMPROCcentrewindow(search%) 27890searchwindow%=TRUE 27900PROCopenwindow(main%,FALSE) 27910ENDIF 27920ENDPROC 27930: 27940DEFPROCclicksearch(ic%) 27950CASE ic% OF 27960WHEN 14 27970PROCclosewindow(search%) 27980WHEN 11,12 27990casesens=NOT casesens 28000IF casesens THEN 28010PROCselicon(search%,11) 28020ELSE 28030PROCuselicon(search%,11) 28040ENDIF 28050WHEN 0 28060IF searchtype THEN 28070searchfile=NOT searchfile 28080ENDIF 28090IF searchfile THEN 28100PROCselicon(search%,0) 28110PROCusicon(search%,2) 28120PROCiconcaret(search%,2,LEN(FNicontext(search%,2))) 28130ELSE 28140PROCuselicon(search%,0) 28150PROCsicon(search%,2) 28160PROCiconcaret(search%,3,LEN(FNicontext(search%,3))) 28170ENDIF 28180WHEN 1 28190IF searchfile THEN 28200searchtype=NOT searchtype 28210ENDIF 28220IF searchtype THEN 28230PROCselicon(search%,1) 28240PROCusicon(search%,3) 28250PROCiconcaret(search%,3,LEN(FNicontext(search%,3))) 28260ELSE 28270PROCuselicon(search%,1) 28280PROCsicon(search%,3) 28290PROCiconcaret(search%,2,LEN(FNicontext(search%,2))) 28300ENDIF 28310WHEN 4 28320IF searchfile AND FNicontext(search%,2)="" THEN PROCalert("Message from Tree","Please enter a search filename.",0) 28330IF searchtype AND FNicontext(search%,3)="" THEN PROCalert("Message from Tree","Please enter a search filetype.",0) 28340IF (searchfile AND FNicontext(search%,2)<>"") OR (searchtype AND FNicontext(search%,3)<>"") THEN PROCsearchup(cursearch,FNicontext(search%,2),FNicontext(search%,3)) 28350WHEN 5 28360IF searchfile AND FNicontext(search%,2)="" THEN PROCalert("Message from Tree","Please enter a search filename.",0) 28370IF searchtype AND FNicontext(search%,3)="" THEN PROCalert("Message from Tree","Please enter a search filetype.",0) 28380IF (searchfile AND FNicontext(search%,2)<>"") OR (searchtype AND FNicontext(search%,3)<>"") THEN PROCsearchdown(cursearch,FNicontext(search%,2),FNicontext(search%,3)) 28390ENDCASE 28400ENDPROC 28410: 28420DEFFNisopen(win%) 28430block3%!0=win% 28440SYS "Wimp_GetWindowState",,block3% 28450winflags%=block3%!32 28460IF (winflags% AND %10000000000000000) = 65536 THEN 28470=TRUE 28480ELSE 28490=FALSE 28500ENDIF 28510: 28520DEFPROCviewicon(win%,ic%) 28530block%!0=win% 28540block%!4=ic% 28550SYS "Wimp_GetIconState",,block% 28560middle%=block%!12+(block%!20-block%!12) 28570block%!0=win% 28580SYS "Wimp_GetWindowState",,block% 28590block%!24=middle%+((block%!16-block%!8) DIV 2) 28600SYS "Wimp_OpenWindow",,block% 28610ENDPROC 28620: 28630DEFPROCsearchup(c,searchstring1$,searchstring2$) 28640subsearchstring1$=searchstring1$ 28650subsearchstring2$=searchstring2$ 28660PROCuselicon(main%,c+1) 28670found=-1 28680IF c-1>=0 THEN 28690smeg%=c-1 28700SYS "Hourglass_On" 28710REPEAT 28720PROCgetvars(smeg%,FALSE) 28730IF found=-1 THEN 28740IF casesens THEN 28750ttfilename$=FNgLn($filename%) 28760ttfbo$=FNpad(type%!0) 28770ELSE 28780ttfilename$=FNtolower(FNgLn($filename%)) 28790ttfbo$=FNtolower(FNpad(type%!0)) 28800searchstring1$=FNtolower(searchstring1$) 28810searchstring2$=FNtolower(searchstring2$) 28820ENDIF 28830IF INSTR(subsearchstring1$,"*")>0 THEN 28840fudge=INSTR(subsearchstring1$,"*")-1 28850IF casesens THEN 28860searchstring1$=MID$(subsearchstring1$,1,fudge) 28870ttfilename$=MID$(ttfilename$,1,fudge) 28880ELSE 28890searchstring1$=FNtolower(MID$(subsearchstring1$,1,fudge)) 28900ttfilename$=FNtolower(MID$(ttfilename$,1,fudge)) 28910ENDIF 28920ENDIF 28930IF INSTR(subsearchstring2$,"*")>0 THEN 28940fudge=INSTR(subsearchstring2$,"*")-1 28950IF casesens THEN 28960searchstring2$=MID$(subsearchstring2$,1,fudge) 28970ttfbo$=MID$(ttfbo$,1,fudge) 28980ELSE 28990searchstring2$=FNtolower(MID$(subsearchstring2$,1,fudge)) 29000ttfbo$=FNtolower(MID$(ttfbo$,1,fudge)) 29010ENDIF 29020ENDIF 29030IF ttfilename$=searchstring1$ AND searchfile AND NOT searchtype THEN found=smeg% 29040IF ttfbo$=searchstring2$ AND NOT searchfile AND searchtype THEN found=smeg% 29050IF ttfilename$=searchstring1$ AND ttfbo$=searchstring2$ AND searchfile AND searchtype THEN found=smeg% 29060ENDIF 29070smeg%-=1 29080UNTILfound>-1 OR smeg%<0 29090SYS "Hourglass_Smash" 29100ENDIF 29110IF found=-1 THEN 29120PROCalert("Message from Tree","'"+FNicontext(search%,2)+"' was not found above the current file.",0) 29130ELSE 29140PROCviewicon(main%,found+1) 29150PROCselicon(main%,found+1) 29160cursearch=found 29170IF cursearch=0 THEN PROCsicon(search%,4) ELSE PROCusicon(search%,4) 29180IF cursearch=iii%-1 THEN PROCsicon(search%,5) ELSE PROCusicon(search%,5) 29190PROCgetvars(cursearch,FALSE) 29200PROCiconputtext(search%,8,FNgLn($filename%)) 29210ENDIF 29220ENDPROC 29230: 29240DEFFNtolower(A$) 29250FOR q=1 TO LEN(A$) 29260IF ASC(MID$(A$,q,1))>=ASC"A" AND ASC(MID$(A$,q,1))<=ASC"Z" THEN MID$(A$,q,1)=CHR$(ASC(MID$(A$,q,1))+(ASC"a"-ASC"A")) 29270NEXT q 29280=A$ 29290: 29300DEFPROCsearchdown(c,searchstring1$,searchstring2$) 29310subsearchstring1$=searchstring1$ 29320subsearchstring2$=searchstring2$ 29330PROCuselicon(main%,c+1) 29340found=-1 29350IF c+1<=iii%-1 THEN 29360smeg%=c+1 29370SYS "Hourglass_On" 29380REPEAT 29390PROCgetvars(smeg%,FALSE) 29400IF found=-1 THEN 29410IF casesens THEN 29420ttfilename$=FNgLn($filename%) 29430ttfbo$=FNpad(type%!0) 29440ELSE 29450ttfilename$=FNtolower(FNgLn($filename%)) 29460ttfbo$=FNtolower(FNpad(type%!0)) 29470searchstring1$=FNtolower(searchstring1$) 29480searchstring2$=FNtolower(searchstring2$) 29490ENDIF 29500IF INSTR(subsearchstring1$,"*")>0 THEN 29510fudge=INSTR(subsearchstring1$,"*")-1 29520IF casesens THEN 29530searchstring1$=MID$(subsearchstring1$,1,fudge) 29540ttfilename$=MID$(ttfilename$,1,fudge) 29550ELSE 29560searchstring1$=FNtolower(MID$(subsearchstring1$,1,fudge)) 29570ttfilename$=FNtolower(MID$(ttfilename$,1,fudge)) 29580ENDIF 29590ENDIF 29600IF INSTR(subsearchstring2$,"*")>0 THEN 29610fudge=INSTR(subsearchstring2$,"*")-1 29620IF casesens THEN 29630searchstring2$=MID$(subsearchstring2$,1,fudge) 29640ttfbo$=MID$(ttfbo$,1,fudge) 29650ELSE 29660searchstring2$=FNtolower(MID$(subsearchstring2$,1,fudge)) 29670ttfbo$=FNtolower(MID$(ttfbo$,1,fudge)) 29680ENDIF 29690ENDIF 29700IF ttfilename$=searchstring1$ AND searchfile AND NOT searchtype THEN found=smeg% 29710IF ttfbo$=searchstring2$ AND NOT searchfile AND searchtype THEN found=smeg% 29720IF ttfilename$=searchstring1$ AND ttfbo$=searchstring2$ AND searchfile AND searchtype THEN found=smeg% 29730ENDIF 29740smeg%+=1 29750UNTILfound>-1 OR smeg%>iii%+1 29760SYS "Hourglass_Smash" 29770ENDIF 29780IF found=-1 THEN 29790PROCalert("Message from Tree","'"+FNicontext(search%,2)+"' was not found below the current file.",0) 29800ELSE 29810PROCviewicon(main%,found+1) 29820PROCselicon(main%,found+1) 29830cursearch=found 29840IF cursearch=0 THEN PROCsicon(search%,4) ELSE PROCusicon(search%,4) 29850IF cursearch=iii%-1 THEN PROCsicon(search%,5) ELSE PROCusicon(search%,5) 29860PROCgetvars(cursearch,FALSE) 29870PROCiconputtext(search%,8,FNgLn($filename%)) 29880ENDIF 29890ENDPROC
>�>SCSI::SCSIDrive4.$.!Develop.Files.Treev1.!Tree.!RunImage ^� � �alert("Major BAD error from Tree",�$+" "+�(�),0):ș &000400DD,taskhandle%,&4B534154:� : (tasksize%=256*1024 2smegblocksize%=400 <endprog%=� F: P<� by Richard Samphire 1993 ----------- BOO ! Z: dș&000406C0 nș &00000010 � env$ x� �env$," -quit ") � �5doubleclick$=�env$,�env$,�(34),�env$,�(34))+1)+1) �� �year$="93" �#ver$="v1.06a (19-09-"+year$+")" �name$="Tree" �"mag$="� Archimedes World 1993" �*purpose$="Shows tree display of files" ��initsprites �"taskhandle%=�initialise(name$) �#iconbar%=�iconbar("!"+name$,-1) �Amainmenu%=�createmenu(name$,3,"Info>info%|Options�|Quit",150) �Usavemenu%=�createmenu("Save",3,"Text>savetree%|-Draw>savedraw%|Tree>saveas%",150) �fmiscmenu%=�createmenu("Misc",4,"Info>info%|-Statistics>stats%|ReDraw Icons|Print text>print%",250) othermenu%=�createmenu("Tree",7,"-Misc>miscmenu%|-File>savemenu%|Open Parent|File Info>finfo%|-Search�|-Options�|Quit",250) 4�iconputtext(info%,11,�icontext(info%,11)+year$) �iconputtext(info%,3,ver$) "�iconputtext(info%,0,name$) ,"�iconputtext(info%,1,purpose$) 6�iconputtext(info%,8,mag$) @ș &000406C2 J�iconputtext(title%,1,mag$) T�dotitle(200) ^l� �checkfreespace<=smegblocksize% � �alert("Message from Tree","Unable to find enough free memory.",0):� hheapsize%=smegblocksize% r-ș "Wimp_SlotSize",tasksize%+heapsize%,-1 |'ș "XOS_Heap",0,endprog%,,heapsize% �blocksize%=4 �-ș "XOS_Heap",2,endprog%,,4 � ,,icondata% �� doubleclick$<>" " � ��loadmyfile(doubleclick$) �� �� �*ș &000400C7,0,block% � reason%,block% �Ȏ reason% � �� 0 � �null �� 1 ��redrawwindow(0) �� 2 �openwindow(0,�) � 3 �closewindow(0) &� 4 0�pointerleave :� 5 D�pointerenter N� 6 X�mouseclick b� 7 l�userdragbox v� 8 ��keypressed �� 9 ��menuselection �� 10 ��scrollrequest �� 11 ��losecaret �� 12 ��gaincaret �� 17 ��usermessage �� 18 ��usermessagerecorded � 19 �usermessageacknowledge � � exit *&ș &000400DD,taskhandle%,&4B534154 4� >� �initialise(name$) Hmaxnumber=4096 Rmody%=� \� col(199) f� block% 2048 p� block2% 2048 z� block3% 2048 � � buf% 41 �� messages% 60 �messages%!0=1 �messages%!4=8 �messages%!8=14 �messages%!12=&404 �messages%!16=&405 �messages%!20=&403 �messages%!24=2 �messages%!28=3 �messages%!32=4 �messages%!36=&80140 �messages%!40=&80144 messages%!44=5 messages%!48=&80147 messages%!52=&400c9 $messages%!56=&80142 .>ș &400C0,300,&4B534154,name$,messages% � wimpversion%,th% 8searchwindow%=� Bsearchfile=� Lsearchtype=� Vasct%=�("T") `ascl%=�("L") jcurrentsearch=-1 tcasesens=� ~ iii%=0 � dirs=� �exit = � �flufend%=� �menunumber% = 0 �iconsprites=� �headings=� �sourcedir=� � date=� � pressed=� �fheadings=� �fsourcedir=� �fdate=� headcount=2 makeexit=� tjunc$="+�" endjunc$="'�" (linejunc$="|" 2ftjunc$="+�" <fendjunc$="'�" Fflinejunc$="|" P cols=7 Z fincols=7 drows=50 ndoprint%=� xfrows=50 � columns=� �ficonsprites=� � lineobj=� �flineobj=� � tttemp%=0 � info=� � boxr=0 � boxg=0 � boxb=0 �fboxr=0 �fboxg=0 �fboxb=0 �#oufile%=�("<Tree$Dir>.Options") � oufile%<>0 � � #oufile%,headcount � #oufile%,headings "� #oufile%,sourcedir ,� #oufile%,date 6� #oufile%,linejunc$ @� #oufile%,tjunc$ J� #oufile%,endjunc$ T� #oufile%,cols ^� #oufile%,iconsprites h� #oufile%,rows r� #oufile%,boxr |� #oufile%,boxg �� #oufile%,boxb �� #oufile%,lineobj �� #oufile%,dirs �� #oufile% �fheadings=headings �fsourcedir=sourcedir �fdate=date �flinejunc$=linejunc$ �ftjunc$=tjunc$ �fendjunc$=endjunc$ �fincols=cols �ficonsprites=iconsprites �frows=rows fboxr=boxr fboxg=boxg fboxb=boxb &flineobj=lineobj 0fdirs=dirs :� D�defaults(�) N� X� win% 4096*6 b� ind% 4096*6 l� mainwindow% 512 v� indmain% 512 �(ș &000400D9,,"<Tree$Dir>.Templates" �:ș &000400DB,,win%,ind%,ind%+4096,-1,"info",0 � ,,ind% �win%!64=sprite% �ș &000400C1,,win% � info% �<ș &000400DB,,win%,ind%,ind%+4096,-1,"saveas",0 � ,,ind% � ș &000400C1,,win% � saveas% �>ș &000400DB,,win%,ind%,ind%+4096,-1,"savetree",0 � ,,ind% �"ș &000400C1,,win% � savetree% �Mș &000400DB,,mainwindow%,indmain%,indmain%+4096,-1,"main",0 � ,,indmain% �%ș &000400C1,,mainwindow% � main% �:ș &000400DB,,win%,ind%,ind%+4096,-1,"pane",0 � ,,ind% �win%!64=sprite% �ș &000400C1,,win% � pane% =ș &000400DB,,win%,ind%,ind%+4096,-1,"options",0 � ,,ind% !ș &000400C1,,win% � options% ;ș &000400DB,,win%,ind%,ind%+4096,-1,"stats",0 � ,,ind% ș &000400C1,,win% � stats% *>ș &000400DB,,win%,ind%,ind%+4096,-1,"savedraw",0 � ,,ind% 4win%!64=sprite% >"ș &000400C1,,win% � savedraw% H>ș &000400DB,,win%,ind%,ind%+4096,-1,"fileinfo",0 � ,,ind% Rș &000400C1,,win% � finfo% \?ș &000400DB,,win%,ind%,ind%+4096,-1,"printtext",0 � ,,ind% fwin%!64=sprite% pș &000400C1,,win% � print% z9ș &000400DB,,win%,ind%,ind%+4096,-1,"dis",0 � ,,ind% �#ș &000400C1,,win% � mycontrol% �;ș &000400DB,,win%,ind%,ind%+4096,-1,"title",0 � ,,ind% �win%!64=sprite% �ș &000400C1,,win% � title% �<ș &000400DB,,win%,ind%,ind%+4096,-1,"search",0 � ,,ind% �win%!64=sprite% � ș &000400C1,,win% � search% �ș &000400DA �slidewindow%=-1 �slideicon%=-1 �slidesize%=-1 �oldworkx%=-1 �rrange%=-1 sizemaxx%=-1 sizeminx%=-1 =th% $� �iconbar(Sprite$,side%) .block%!0=side% 8block%!4=0 Bblock%!8=0 Lblock%!12=29*2 Vblock%!16=40*2 `block%!20=&3002 j$(block%+24)=Sprite$ t ș &000400C2,,block% � icon% ~ =icon% �� �null �Ȏ slideicon% � �� 28 �6�doslide(slidewindow%,slideicon%,slidesize%,�,255) �� 31 �6�doslide(slidewindow%,slideicon%,slidesize%,�,255) �� 34 �6�doslide(slidewindow%,slideicon%,slidesize%,�,255) �� �� �� �redrawwindow(wind%) �ș&000406C0 � wind%<>0 � block%!0=wind% � ș &000400C8,,block% � flag (ȕ flag 2=� block%!0=main% � �dolines(block%!8,block%!16,block%!24) <5� block%!0=pane% � �docolourbox(boxr,boxg,boxb,�) Fș &000400CA,,block% � flag P� Zș&000406C2 d� n� �openwindow(wind%,stag%) x� wind%<>0 � �block%!0=wind% �ș &000400CB,,block% �� �&� block%!0=main% � searchwindow% � �mainminx%=block%!4 �mainminy%=block%!8 �mainmaxx%=block%!12 �mainmaxy%=block%!16 �mainscrollx%=block%!20 �mainscrolly%=block%!24 �backhand%=block%!28 �block%!0=search% �ș &400cb,,block% block%!0=search% block%!4=mainminx%-318 block%!8=mainmaxy%-636 " block%!12=mainmaxx%+block%!4 ,block%!16=mainmaxy% 6block%!28=backhand% @ș &400C5,,block% Jblock%!0=main% Tblock%!4=mainminx% ^block%!8=mainminy% hblock%!12=mainmaxx% rblock%!16=mainmaxy% |block%!20=mainscrollx% �block%!24=mainscrolly% �block%!28=search% �� �� block%!0=options% � �mainminx%=block%!4 �mainminy%=block%!8 �mainmaxx%=block%!12 �mainmaxy%=block%!16 �mainscrollx%=block%!20 �mainscrolly%=block%!24 �backhand%=block%!28 �block%!0=pane% �ș &400cb,,block% block%!0=pane% block%!4=mainminx%+20 block%!8=mainminy%+18 & block%!12=mainmaxx%+block%!4 0block%!16=mainmaxy%-18 :block%!28=backhand% Dș &400C5,,block% Nblock%!0=options% Xblock%!4=mainminx% bblock%!8=mainminy% lblock%!12=mainmaxx% vblock%!16=mainmaxy% �block%!20=mainscrollx% �block%!24=mainscrolly% �block%!28=pane% �� �ș &000400C5,,block% �� �� �closewindow(wind%) �� wind%<>0 � � block%!0=wind% �� �� block%!0=options% � � block%!0=pane% � ș &000400C6,,block% block%!0=options% � � block%!0=main% � mody% � press%=�mycontrol * block%!0=mycontrol% 4 ș &000400C6,,block% > block%!0=main% H Ȏ press% � R � 0 \ � makeexit � exit=� fF ș "XOS_Heap",4,endprog%,icondata%,-blocksize% � ,,icondata% p= ș "XOS_Heap",5,endprog%,,-heapsize%+smegblocksize% z" heapsize%=smegblocksize% �3 ș "Wimp_SlotSize",tasksize%+heapsize%,-1 � blocksize%=4 � � 1 � � exit � exit=� � makeexit=� � � � � 2 � � exit � � exit=� � makeexit=� � � � ș&000400CF,,block2% � xx%=block2%!0 yy%=block2%!4 bb%=block2%!8 flufend%=� $$ �drawmenu(saveas%,xx%,yy%) . � 8 � B� L(� block%!0=search% � searchwindow%=� V� block%!0=main% � ` searchwindow%=� j block%!0=search% t ș &000400C6,,block% ~B ș "XOS_Heap",4,endprog%,icondata%,-blocksize% � ,,icondata% �9 ș "XOS_Heap",5,endprog%,,-heapsize%+smegblocksize% � heapsize%=smegblocksize% �/ ș "Wimp_SlotSize",tasksize%+heapsize%,-1 � blocksize%=4 � mody%=� �+ � pressed � ș "Wimp_ProcessKey",&1FC � iii%=0 � block%!0=main% �� �ș &000400C6,,block% �� �� �pointerleave � � �pointerenter � � �mouseclick (� � 2*� � � �alert("Error from Tree",�$,0):� <x%=block%!0 Fy%=block%!4 Pbutton%=block%!8 Zwindow%=block%!12 dicon%=block%!16 nȎ button% � x� 1 �+� window%=search% � �clicksearch(icon%) �)� window%=print% � �clickprint(icon%) �#� window%=savedraw% � icon%=2 � �&� ��icontext(savedraw%,1),".")=0 � �H�alert("Tree","To save, drag the file icon to a directory viewer",2) �ș&000400D4,-1 �� �poowindow%=savedraw% �!�save(�icontext(savedraw%,1)) �� �� �!� window%=saveas% � icon%=2 � �$� ��icontext(saveas%,1),".")=0 � H�alert("Tree","To save, drag the file icon to a directory viewer",2) ș&000400D4,-1 � "poowindow%=saveas% ,�save(�icontext(saveas%,1)) 6� @� J#� window%=savetree% � icon%=2 � T&� ��icontext(savetree%,1),".")=0 � ^H�alert("Tree","To save, drag the file icon to a directory viewer",2) hș&000400D4,-1 r� |poowindow%=savetree% �!�save(�icontext(savetree%,1)) �� �� �-� window%=options% � �clickoptions(icon%) �'� window%=pane% � �clickpane(icon%) �� window%=main% � icon%>0 � ��uselicon(main%,icon%) ��getvars(icon%-1,�) ��("FILER_RUN "+$filename%) �� �#� window%=savedraw% � icon%=3 � �columns=� columns �>� columns � �selicon(savedraw%,3) � �uselicon(savedraw%,3) � � 2 � window%=-2 � &#�drawmenu(mainmenu%,x%-100,228) 0menunumber%=1 :� D� window%=main% � N�getprinterinfo X#�iconputtext(print%,0,printer$) bcopies=1 l$�iconputtext(print%,2,�(copies)) v>� columns � �selicon(savedraw%,3) � �uselicon(savedraw%,3) �flufend%=� �"�iconputtext(stats%,1,�(iii%)) �(�iconputtext(stats%,3,�(blocksize%)) �� icon%>0 � �currentsearch=icon% ��usmi(othermenu%,3) ��usmi(othermenu%,4) ��getvars(icon%-1,�) �+�iconputtext(finfo%,0,�gLn($filename%)) �"� type%!0>=0 � type%!0<=&FFF � �. �iconputtext(finfo%,3,"&"+�pad(type%!0)) �. � �spriteexists("file_"+�pad(type%!0)) � �5 �seticonsprite(finfo%,1,"Sfile_"+�pad(type%!0)) � * �seticonsprite(finfo%,1,"Sfile_xxx") � � */ � ��gLn($filename%),1)="!" � type%!0=-1 � 4* �iconputtext(finfo%,3,"Application") >) � �spriteexists(�gLn($filename%)) � H3 �seticonsprite(finfo%,1,"S"+�gLn($filename%)) R � \- �seticonsprite(finfo%,1,"Sapplication") f � p � z0 � ��gLn($filename%),1)<>"!" � type%!0=-1 � �( �iconputtext(finfo%,3,"Directory") �+ �seticonsprite(finfo%,1,"Sdirectory") � � � � type%!0=-2 � �# �iconputtext(finfo%,3,"File") �* �seticonsprite(finfo%,1,"Sfile_xxx") � � �� �+�iconputtext(finfo%,5,�(readlength%!0)) �5�iconputtext(finfo%,7,�attributes(attributes%!0)) �6�iconputtext(finfo%,8,�myconvert(ladr%!0,eadr%!0)) �� ��smi(othermenu%,3) �smi(othermenu%,4) � #�drawmenu(othermenu%,x%-100,y%) $menunumber%=2 .� 8� 4 B+� window%=search% � �clicksearch(icon%) L)� window%=print% � �clickprint(icon%) V#� window%=savedraw% � icon%=3 � `columns=� columns j>� columns � �selicon(savedraw%,3) � �uselicon(savedraw%,3) t� ~#� window%=savedraw% � icon%=2 � �&� ��icontext(savedraw%,1),".")=0 � �H�alert("Tree","To save, drag the file icon to a directory viewer",2) �ș&000400D4,-1 �� �poowindow%=savedraw% �!�save(�icontext(savedraw%,1)) �� �� �!� window%=saveas% � icon%=2 � �$� ��icontext(saveas%,1),".")=0 � �H�alert("Tree","To save, drag the file icon to a directory viewer",2) �ș&000400D4,-1 � poowindow%=saveas% �save(�icontext(saveas%,1)) ș&000400D4,-1 (� 2� <#� window%=savetree% � icon%=2 � F&� ��icontext(savetree%,1),".")=0 � PH�alert("Tree","To save, drag the file icon to a directory viewer",2) Zș&000400D4,-1 d� npoowindow%=savetree% x!�save(�icontext(savetree%,1)) �ș&000400D4,-1 �� �� �'� window%=pane% � �clickpane(icon%) �-� window%=options% � �clickoptions(icon%) �� window%=main% � icon%>0 � ��uselicon(main%,icon%) ��getvars(icon%-1,�) ��("FILER_RUN "+$filename%) �� �� 16,64 �� window%=main% � icon%>0 � ��dragmyfile tempicon%=icon% � !� window%=saveas% � icon%=0 � "poowindow%=window% ,lastwindow%=poowindow% 6"�drawbox(saveas%,0,"file_353") @� J#� window%=savetree% � icon%=0 � Tpoowindow%=window% ^lastwindow%=poowindow% h$�drawbox(savetree%,0,"file_fff") r� |#� window%=savedraw% � icon%=0 � �poowindow%=window% �lastwindow%=poowindow% �$�drawbox(savedraw%,0,"file_aff") �� �� �� �� �userdragbox �� � �*� � � �alert("Error from Tree",�$,0):� �ș "DragASprite_Stop" �tt%=block%+256 �ș&000400CF,,tt% � xx%=tt%!0 yy%=tt%!4 bb%=tt%!8 wind%=tt%!12 &icon%=tt%!16 0Ȏ lastwindow% � :� saveas%,savetree% Dblock%!0=256 Nblock%!12=0 Xblock%!16=1 bblock%!20=wind% lblock%!24=icon% vblock%!28=xx% �block%!32=yy% �block%!36=1 �� lastwindow%=savetree% � �block%!40=&fff �� �block%!40=&353 �� �bblock%=block%+256 �bblock%!0=lastwindow% �bblock%!4=1 �ș&000400CE,0,bblock% �text%=bblock%!28 �w$=�gLn($text%) $(block%+44)=w$+�0 %ș&000400E7,17,block%,wind%,icon% 8� wind%<>saveas% � wind%<>savetree% � ș&000400D4,-1 � main% *poowindow%=main% 4�getvars(tempicon%-1,�) >block%!0=256 Hblock%!12=0 Rblock%!16=1 \block%!20=wind% fblock%!24=icon% pblock%!28=xx% zblock%!32=yy% �block%!36=readlength%!0 �block%!40=type%!0 �$(block%+44)=$filename%+�0 �%ș&000400E7,17,block%,wind%,icon% ��uselicon(main%,tempicon%) �� savedraw% �block%!0=256 �block%!12=0 �block%!16=1 �block%!20=wind% �block%!24=icon% �block%!28=xx% �block%!32=yy% block%!36=1 block%!40=&aff bblock%=block%+256 $bblock%!0=lastwindow% .bblock%!4=1 8ș&000400CE,0,bblock% Btext%=bblock%!28 Lw$=�gLn($text%) V$(block%+44)=w$+�0 `%ș&000400E7,17,block%,wind%,icon% j'� wind%<>savedraw% � ș&000400D4,-1 t� pane% ~7� slidewindow%>-1 � slideicon%>-1 � slidesize%>-1 � �size%=sizemaxx%-sizeminx% �ppos%=(oldworkx%-sizeminx%) �num%=(rrange%/size%)*ppos% �Ȏ slideicon% � �� 28,31,34 �oldworkx%=newx% �� �: �slidewindow%=-1 �slideicon%=-1 �slidesize%=-1 �� � � � �keypressed wind%=block%!0 (icon%=block%!4 2key%=block%!24 < Ȏ key% � F� 398,13 P� wind%=saveas% � Z$� ��icontext(saveas%,1),".")=0 � dH�alert("Tree","To save, drag the file icon to a directory viewer",2) nș&000400D4,-1 x� �poowindow%=saveas% ��save(�icontext(saveas%,1)) �ș&000400D4,,-1 �� �� �� wind%=savetree% � �&� ��icontext(savetree%,1),".")=0 � �H�alert("Tree","To save, drag the file icon to a directory viewer",2) �ș&000400D4,-1 �� �poowindow%=savetree% �!�save(�icontext(savetree%,1)) �ș&000400D4,,-1 � � "ș "Wimp_ProcessKey",key% ,� 6� @� �menuselection JȎ menunumber% � T� 1 ^+ș&000400D5,,mainmenu%,block%,block%+24 htrunc$=�gLn($(block%+24)) r� trunc$="Quit" � | exit=� �makeexit=� ��closewindow(main%) �� �� trunc$="Options�" � � �pane ��openwindow(options%,�) �� �� 2 �,ș&000400D5,,othermenu%,block%,block%+24 �trunc$=�gLn($(block%+24)) �� trunc$="Quit" � �makeexit=� �exit = � �closewindow(main%) � *� trunc$="ReDraw Icons" � �majorredraw &7� trunc$="Open Parent" � �("FILER_OPENDIR "+pooup$) 0$� trunc$="Search�" � �opensearch :� trunc$="Options�" � D �pane N�openwindow(options%,�) X� b� lș&000400CF,,block%+256 vbrr%=block%+256 �button%=brr%!8 �� button%=1 � �A� menunumber%=1 � ș &000400D4,,mainmenu%,brr%!0-68,(64*4)+64 �?� menunumber%=2 � ș &000400D4,,othermenu%,brr%!0-68,brr%!4 �� �� �� �� �scrollrequest �� �� �losecaret �� �� �gaincaret �� � �usermessage � � *� � � �alert("Error from Tree",�$,0):� Ȏ block%!16 � *� 0 4exit = � >� 2 H �save(�getstring(block%+44)) R� &80147 \�getprinterinfo f p� z� �� �usermessagerecorded �� � �*� � � �alert("Error from Tree",�$,0):� �Ȏ block%!16 � �� 0 �exit = � �� &80142 �� doprint% � � � �doprint%=� �_�alert("Message from Tree","Load the RiscOS 3 !Printers application to print from Tree.",0) �� �� 3 �>�load(block%!20,block%!24,block%!40,�getstring(block%+44)) � 5 � block%!40=&353 � block%!12=block%!8 $#ș&000600E7,17,block%,block%!20 .>�load(block%!20,block%!24,block%!40,�getstring(block%+44)) 8� B� 8 L � mody% � V pressed=� ` block%!12=block%!8 j' ș "Wimp_SendMessage",19,block%,0 t �sicon(mycontrol%,6) ~ �closewindow(main%) �� �� �� �� �usermessageacknowledge �Ȏ block%!16 � �� &80142 �� doprint% � �doprint%=� �_�alert("Message from Tree","Load the RiscOS 3 !Printers application to print from Tree.",0) �� �� �� ݤparseLine(A$,B$(),C$) � D%,E%:D%=�(B$(),1) ȕ (A$<>"")�(E%<=D%) B$(E%)=�parseWord(A$,C$) ( E%+=1 2� <=E% FݤparseWord(� A$,B$) P,� C$,D%,E%,F$:D%=1:E%=�(A$):C$=�A$,D%,1) Z0ȕ (�B$,C$)=0)�(D%<=E%):D%+=1:C$=�A$,D%,1):� d8F$=�A$,D%-1):A$=�A$,D%+1):E%=�(A$):D%=1:C$=�A$,D%,1) n0ȕ (�B$,C$)>0)�(D%<=E%):D%+=1:C$=�A$,D%,1):� xA$=�A$,D%) �=F$ �2� �createmenu(title$,entries%,entries$,width%) �� menu%,word$() �� menu% 24+entries%*24 �� word$(entries%) �(tr%=�parseLine(entries$,word$(),"|") � tr%-=1 �$(menu%+0)=title$+�0 �menu%!12=7 �menu%!13=2 �menu%!14=7 �menu%!15=0 �menu%!16=width% menu%!20=44 menu%!24=0 � loop%=0 � tr% "p%=(loop%*24)+28 ,2� loop%=entries%-1 � menu%!p%=128 � menu%!p%=0 6� �word$(loop%),1,1)="-" � @menu%!p%+=2 J� T&� title$="Filetypes" � menu%!p%+=8 ^ p%+=4 h� �word$(loop%),">") = 0 � rmenu%!p%=-1 |� �3menu%!p%=�(�word$(loop%),�word$(loop%),">")+1)) �� � p%+=4 �menu%!p%=&7009031 � p%+=4 �� �word$(loop%),">") = 0 � �� �word$(loop%),1,1)="-" � � $(menu%+p%)=�word$(loop%),2) �� �$(menu%+p%)=word$(loop%) �� �� �� �word$(loop%),1,1)="-" � 5$(menu%+p%)=�word$(loop%),2,�word$(loop%),">")-2) � 5$(menu%+p%)=�word$(loop%),1,�word$(loop%),">")-1) &� 0� : �loop% D =menu% N��drawmenu(m%,xx%,yy%) Xș &000400D4,,m%,xx%,yy% b� l��sicon(wind%,icon%) vblock%!0=wind% �block%!4=icon% �%block%!8=%10000000000000000000000 �&block%!12=%10000000000000000000000 �ș &400CD,,block% �� ���usicon(wind%,icon%) �block%!0=wind% �block%!4=icon% �block%!8=0 �&block%!12=%10000000000000000000000 �ș &400CD,,block% �� ���selicon(wind%,icon%) !block%!0=wind% !block%!4=icon% !$block%!8=%1000000000000000000000 ! %block%!12=%1000000000000000000000 !*ș &400CD,,block% !4� !>��uselicon(wind%,icon%) !Hblock%!0=wind% !Rblock%!4=icon% !\block%!8=0 !f%block%!12=%1000000000000000000000 !pș &400CD,,block% !z� !���tmi(m%,i%) !�ui=m%+(28+(24*i%)) !�!ui=!ui � %1 !�� !���utmi(m%,i%) !�ui=m%+(28+(24*i%)) !�!ui=!ui �� %1 !�� !���smi(m%,i%) !�ui=m%+(36+(24*i%)) !�&!ui=!ui � %10000000000000000000000 !�� !���usmi(m%,i%) "ui=m%+(36+(24*i%)) "'!ui=!ui �� %10000000000000000000000 "� "$ ݤgLn(A$) ".� B% "8� �A$,".")=0 � =A$ "B� �A$,".")>0 � "L B%=�A$ "Vȕ(�A$,B%,1)<>".")�(B%>0) "` B%-=1 "j� "t=�A$,�A$-B%) "~� �getstring(array%) "�� path$,pointer% "�path$="" "�pointer%=array% "�� "�path$+=�?pointer% "�pointer%+=1 "� � ?pointer%=0 � ?pointer%=13 "� =path$ "�)��load(window%,icon%,filetype%,path$) "�� � "�*� � � �alert("Error from Tree",�$,0):� "�4� window%=-2 � filetype%<>&353 � �dofiles(path$) # � filetype%=&353 � # �closewindow(main%) #�loadmyfile(path$) #� #(� #2��save(p$) #<� � #F*� � � �alert("Error from Tree",�$,0):� #Pș &00062401 #ZȎ poowindow% � #d � saveas% #nș&000406C0 #x;ș "OS_File",10,p$,&353,,icondata%,icondata%+blocksize% #�ș&000406C2 #�mody%=� #�� makeexit � exit=� #�� flufend% � #�block%!0=main% #�ș &000400C6,,block% #�� #�)� pressed � ș "Wimp_ProcessKey",&1FC #�� savetree% #��export(p$,�) #�� savedraw% #��dodraw(p$) #�� main% $� block%!36=-1 � $�getvars(tempicon%-1,�) $block%!0=256 $"block%!12=0 $,block%!16=3 $6block%!36=readlength%!0 $@block%!40=type%!0 $J$(block%+44)=$filename%+�0 $T%ș&000400E7,17,block%,wind%,icon% $^� $h�getvars(tempicon%-1,�) $r"� �checkfreespace>=(40*1024) � $|#p$=�p$,�(p$)-(�($filename%)+1)) $�&ș "Wimp_StartTask","filer_action" $�block%!0=256 $�block%!12=0 $�block%!16=&403 $�cft2=�($filename%) $�ȕ �$filename%,cft2,1)<>"." $�cft2-=1 $�� $� dddup$=�$filename%,1,cft2-1) $�$(block%+20)=dddup$+�0 $�%ș "Wimp_SendMessage",17,block%,0 $�block%!0=256 $�block%!12=0 %block%!16=&404 %$$(block%+20)=�gLn($filename%)+�0 %%ș "Wimp_SendMessage",17,block%,0 %&block%!0=256 %0block%!12=0 %:block%!16=&405 %Dblock%!20=0 %Nblock%!24=%10001 %X$(block%+28)=p$+�0 %b%ș "Wimp_SendMessage",17,block%,0 %l� %v#p$=�p$,�(p$)-(�($filename%)+1)) %�<�("COPY "+$filename%+" "+p$+"."+�gLn($filename%)+" R~C") %�� %�� %�� print% %��export(p$,�) %�block%!16=3 %�� printcount=1 � copies %�-ș&000400E7,17,block%,block%!20,block%!24 %�� printcount %�doprint%=� %�� %�c� p$<>"<Wimp$Scrap>" � (poowindow%<>main%) � poowindow%<>print% � �iconputtext(poowindow%,1,p$) %�� &��loadmyfile(p$) &� � &*� � � �alert("Error from Tree",�$,0):� & localsprites=� &* columns=� &4$archi%=�modulepresent("SparkFS") &>thebigone=0 &Hblock%!0=main% &Rș &000400C3,,block% &\%ș &000400C1,,mainwindow% � main% &fș&000406C0 &pblock%!0=main% &zș &400cc,,block% &�workminx=block%!44 &�workminy=block%!48 &�workmaxx=block%!52 &�workmaxy=block%!56 &�infile%=�(p$) &�newlen%=�#infile% &�� #infile% &�@ș "XOS_Heap",4,endprog%,icondata%,-blocksize% � ,,icondata% &�7ș "XOS_Heap",5,endprog%,,-heapsize%+smegblocksize% &�blocksize%=4 &�heapsize%=smegblocksize% &�blocksize%+=newlen% &� duf%=� '� blocksize%>heapsize% � ' duf%=� ' heapsize%+=newlen% '$$ � �checkfreespace<=heapsize% � '.J �alert("Message from Tree","Unable to find enough free memory.",0) '8 heapsize%-=newlen% 'B blocksize%-=newlen% 'L � 'V � '`-ș "Wimp_SlotSize",tasksize%+heapsize%,-1 'j' ș "XOS_Heap",5,endprog%,,newlen% 't� '~$ � �checkfreespace<=heapsize% � '�J �alert("Message from Tree","Unable to find enough free memory.",0) '� blocksize%-=newlen% '� � '� � '�-ș "Wimp_SlotSize",tasksize%+heapsize%,-1 '� '�� '�<ș "XOS_Heap",4,endprog%,icondata%,newlen% � ,,icondata% '�� icondata%=0 � '�F�alert("Message from Tree","Unable to find enough free memory.",0) '�blocksize%-=newlen% '�� duf% � heapsize%-=newlen% ( � ( � (newbase%=icondata% (ș &00000008,12,p$,newbase% ((iii%=newbase%!0 (2�getvars(0,�) (<pa$=$filename% (Fcft=�(pa$) (Pȕ �pa$,cft,1)<>"." (Z cft-=1 (d� (npooup$=�pa$,1,cft-1) (x�title(main%,pooup$) (�� myup=0 � iii%-1 (�1� iii%-1<>0 � ș&000406C4,(myup/(iii%-1))*100 (��getvars(myup,�) (�Qpos=(numbericons%!0)*50 (�block%!0=main% (�block%!4=0 (�ș &400CE,,block% (�fag%=block%+4 (�um1%=fag%!4 (�um2%=fag%!12 (�block%!0=main% (�block%!4=myup (�ș &400CE,,block% )fag%=block%+4 )fag%!0=main% )fag%!8=fag%!8-44 )"fag%!4=um1%+Qpos ),nut=fag%!8 )6fag%!16=fag%!16-44 )@fag%!12=um2%+Qpos )Jfcack$=�gLn($filename%) )T+� fag%!12>thebigone � thebigone=fag%!12 )^fag%!24=text% )h!� type%!0>&FFF � type%!0<&0 � )r � �fcack$,1)="!" � )|1 � � �spriteexists(fcack$) � iconsprites � )�& tty%=�($filename%+".!Sprites") )� � tty%>0 � tty%<=255 � )� wlll%=�#tty% )� �#tty% )� � )�/ � tty%>0 � tty%<=255 � localsprites � )�= � �filetypeofafile($filename%+".!Sprites")=&FF9 � )�' � �checkfreespace>wlll% � )�= �OSCLI("ICONSPRITES "+$filename%+".!Sprites") )�. � localsprites � �loadsprites2 )� � )�o �alert("Message from Tree","No room for sprites. Forgetting to load any more !Sprite files.",0) )� localsprites=� *# valid$="Sdirectory" * � * � *& � *0 � *: valid$="S"+fcack$ *DG � � �spriteexists(�valid$,2,�(valid$))) � valid$="Sapplication" *N � *X valid$="Sdirectory" *b � *l� *v# valid$="Sfile_"+�pad(type%!0) *�� *�;� type%!0=-2 � valid$="Sdirectory" � valid$="Sfile_xxx" *�@� � �spriteexists(�valid$,2,�(valid$))) � valid$="Sfile_xxx" *�$valid%=valid$ *�fag%!28=valid% *�fag%!32=�(fcack$) *�ș &400C2,,fag% *� �myup *�block%!0=workminx *�block%!4=nut-4 *�block%!8=thebigone+20 *�block%!12=workmaxy *�ș &400d7,main%,block% +;ș &000400D1,main%,block%!0,block%!4,block%!8,block%!12 +�openwindow(main%,�) +�iconputtext(saveas%,1,p$) + ș&000406C2 +*flufend%=� +4� +>� �icontext(window%,icon%) +H%block%!0=window% : block%!4=icon% +Rș &000400CE,,block% +\8� ((block%!24) � &100)=0 � 1,"Icon isn't indirected" +f=$(block%!28) +p'� �iconputtext(window%,icon%,text$) +z'block2%!0=window% : block2%!4=icon% +�ș &000400CE,,block2% +�9� ((block2%!24) � &100)=0 � 1,"Icon isn't indirected" +�$(block2%!28)=text$ +�'block2%!0=window% : block2%!4=icon% +�block2%!8=0 : block2%!12=0 +�ș &000400CD,,block2% +�� +���seticonsprite(w%,i%,s$) +�block%!0=w% +�block%!4=i% +�ș &000400CE,,block% +�$block%!32=s$ +�block%!0=w% ,block%!8=0 ,block%!12=0 ,ș&000400CD,,block% ,$� ,.��drawbox(wi%,ic%,sn$) ,8#ș &00000035,�,11 � ,,xpixlimit ,B#ș &00000035,�,12 � ,,ypixlimit ,Lș &00000035,�,4 � ,,xfact ,Vș &00000035,�,5 � ,,yfact ,`maxX=(xpixlimit+1)<<xfact ,jmaxY=(ypixlimit+1)<<yfact ,tblock%!0=wi% ,~ș&000400CB,,block% ,�2ys%=block%!16-block%!8:X%=block%!4:Y%=block%!8 ,�yoff%=block%!24 ,�block%!0=wi%:block%!4=ic% ,�ș&000400CE,,block% ,�block%!8+=X% ,�block%!12+=Y%+ys%-yoff% ,�block%!16+=X% ,�block%!20+=Y%+ys%-yoff% ,�block%!4=5 ,�ș&000400CF,,block2% ,�$block%!24=0-(block2%!0-block%!8) ,�%block%!28=0-(block2%!4-block%!12) - *block%!32=maxX+(block%!16-block2%!0)-2 - *block%!36=maxY+(block%!20-block2%!4)-4 -block%!0=ic% -� sn$="" � -(ș&000400D0,,block% -2� -<3ș "DragASprite_Start",%11000101,1,sn$,block%+8 -F� -Plastwindow%=wi% -Z� -d&� �iconcaret(window%,icon%,chars%) -n*ș &000400D2,window%,icon%,,,-1,chars% -x� -���dofiles(pa$) -�� � -�*� � � �alert("Error from Tree",�$,0):� -� columns=� -�localsprites=� -�@ș "XOS_Heap",4,endprog%,icondata%,-blocksize% � ,,icondata% -�7ș "XOS_Heap",5,endprog%,,-heapsize%+smegblocksize% -�heapsize%=smegblocksize% -�-ș "Wimp_SlotSize",tasksize%+heapsize%,-1 -�blocksize%=4 -�X� icondata%=0 � �alert("Message from Tree","Unable to find enough free memory.",0):� -�block%!0=main% -�ș &000400C3,,block% .%ș &000400C1,,mainwindow% � main% .ș&000406C0 .cft=�(pa$) ."thebigone=0 .,ȕ �pa$,cft,1)<>"." .6 cft-=1 .@� .Jpooup$=�pa$,1,cft-1) .T�title(main%,pooup$) .^block%!0=main% .hș &400cc,,block% .rworkminx=block%!44 .|workminy=block%!48 .�workmaxx=block%!52 .�workmaxy=block%!56 .� iii%=0 .� tttemp%=0 .�'archiver%=�modulepresent("SparkFS") .�tempcack$="" .��read(pooup$,0,�,0) .��PROCgafup .��dirs(�) .�� iii%>0 � .�block%!0=workminx .�block%!4=nut-4 .�block%!8=thebigone+20 /block%!12=workmaxy /ș &400d7,main%,block% /;ș &000400D1,main%,block%!0,block%!4,block%!8,block%!12 /&�openwindow(main%,�) /0mody%=� /:� /D�closewindow(main%) /NG�alert("Error from Tree","Unable to create tree of '"+pooup$+"'",0) /Xmody%=� /b� /l� /vș&000406C2 /�� /�� �getstring(array%) /�� path$,pointer% /�path$="" /�pointer%=array% /�� /�path$+=�?pointer% /�pointer%+=1 /� � ?pointer%=0 � ?pointer%=13 /� =path$ /�#��getvars(richicon%,resetflag%) /�� � /�*� � � �alert("Error from Tree",�$,0):� 0fixbase%=icondata% 0total%=fixbase% 0&base%=fixbase%+((richicon%)*400)+4 0 text%=base% 0*valid%=base%+24 04filename%=base%+48 0>type%=base%+304 0Hnumbericons%=base%+308 0Rreadlength%=base%+312 0\attributes%=base%+316 0fladr%=base%+320 0peadr%=base%+324 0ztreedef%=base%+328 0� � richicon%=0 � richicon%+=1 0�,base2%=(icondata%)+((richicon%-1)*400)+4 0�text2%=base2% 0�valid2%=base2%+24 0�filename2%=base2%+48 0�type2%=base2%+304 0�numbericons2%=base2%+308 0�readlength2%=base2%+312 0�attributes2%=base2%+316 0�ladr2%=base2%+320 0�eadr2%=base2%+324 0�treedef2%=base2%+328 0�� resetflag% � 1$(treedef%)=�63,"O") 1� 1� 1$#��read(path$,tb,flag,mycounter) 1.� � 18*� � � �alert("Error from Tree",�$,0):� 1B �gogo 1L� 1V ��gogo 1`� offset,temp$ 1joffset=0 1t� 1~$(buf%+20)=�0 1�Lș&0002000C,10,path$+�0,buf%,maxnumber,offset,41,"" � R0,R1,R2,R3,offset 1�temp$=�getstring(buf%+20) 1�� offset=0 � � 1�� temp$<>�0 � 1�blocksize%=blocksize%+400 1�� blocksize%>heapsize% � 1�,ș "XOS_Heap",5,endprog%,,400 � ,,,temp% 1·� temp%<>400 � �alert("Message from Tree","Unable to find enough free memory. About to try to display all that has been read.",0):� 1�heapsize%+=400 1�'� �checkfreespace<=smegblocksize% � 1�v�alert("Message from Tree","Unable to find enough free memory. About to try to display all that has been read.",0) 1�heapsize%-=400 2 blocksize%-=400 2 � 2� 2<ș "Wimp_SlotSize",tasksize%+heapsize%+smegblocksize%,-1 2(� 228ș "XOS_Heap",4,endprog%,icondata%,400 � ,,icondata% 2<�� icondata%=0 � �alert("Message from Tree","Unable to find enough free memory. About to try to display all that has been read.",0):� 2F�getvars(iii%,�) 2P#fty%=�filestype(buf%!16,buf%!0) 2Z$filename%=path$+"."+temp$ 2dtype%!0=fty% 2nreadlength%!0=buf%!8 2xattributes%!0=buf%!12 2�ladr%!0=buf%!0 2�eadr%!0=buf%!4 2�: 2�block%!0=main% 2�block%!4=0 2�ș &400CE,,block% 2�fag%=block%+4 2�um1%=fag%!4 2�um2%=fag%!12 2�block%!0=main% 2�block%!4=iii% 2�ș &400CE,,block% 2�fag%=block%+4 3fag%!0=main% 3fag%!8=fag%!8-44 3fag%!4=um1%+tb 3"nut=fag%!8 3,fag%!16=fag%!16-44 36fag%!12=um2%+tb 3@+� fag%!12>thebigone � thebigone=fag%!12 3J� offset=-1 � 3T?(treedef%+mycounter)=ascl% 3^� 3h?(treedef%+mycounter)=asct% 3r� 3|numbericons%!0=mycounter 3�� (iii%-1)>=0 � 3�!� smeg%=0 � (numbericons2%!0) 3�S� ?(treedef2%+smeg%)=asct% � ?(treedef%+smeg%)<>ascl% � ?(treedef%+smeg%)=asct% 3� �smeg% 3�� 3�$text%=temp$ 3�fag%!24=text% 3�� fty%>&FFF � fty%<&0 � 3� � �temp$,1)="!" � 3�0 � � �spriteexists(temp$) � iconsprites � 3�- tty%=�(path$+"."+temp$+".!Sprites") 3� � tty%<>0 � 3� wlll%=�#tty% 4 �#tty% 4 � 4$ � tty%<>0 � localsprites � 4&B � �filetypeofafile(path$+"."+temp$+".!Sprites")=&FF9 � 40' � �checkfreespace>wlll% � 4:- � localsprites � �loadsprites 4D � 4No �alert("Message from Tree","No room for sprites. Forgetting to load any more !Sprite files.",0) 4X localsprites=� 4b# valid$="Sdirectory" 4l � 4v � 4� � 4� � 4� valid$="S"+temp$ 4�G � � �spriteexists(�valid$,2,�(valid$))) � valid$="Sapplication" 4� � 4� valid$="Sdirectory" 4� � 4�� 4� valid$="Sfile_"+�pad(fty%) 4�� 4�;� type%!0=-2 � valid$="Sdirectory" � valid$="Sfile_xxx" 4�@� � �spriteexists(�valid$,2,�(valid$))) � valid$="Sfile_xxx" 4�$valid%=valid$ 5fag%!28=valid% 5fag%!32=�(temp$) 5ș &400C2,,fag% 5 iii%+=1 5*total%!0=iii% 54� 5>7� buf%!16=2 � (fty%=&ddc � archiver%) � fty%=&fc8 � 5H� temp$<>�0 � 5R.�read(path$+"."+temp$,tb+50,�,mycounter+1) 5\� 5f� 5p� offset=-1 5z� 5�: 5���loadsprites 5�� � 5��� � � �alert("Message from Tree","Error whilst trying to ICONSPRITE !Sprites file. "+�$+". Not bothering with any more !Sprite files.",0) 5�1�("ICONSPRITES "+path$+"."+temp$+".!Sprites") 5�localsprites=� 5�� 5�: 5���loadsprites2 5�� � 5�� � � �alert("Message from Tree","Error whilst trying to ICONSPRITE !Sprites file. "+�$+". Not bothering with any more !Sprite files.",0) 5�,�("ICONSPRITES "+$filename%+".!Sprites") 5�localsprites=� 6� 6: 6��gafup 6$� 6.�smeg%=iii%-1 68�PROCgetvars(smeg%,FALSE) 6B�WHILE numbericons%!0>0 6L�PROCgetvars(smeg%,FALSE) 6V'�FOR smeg2%=0 TO (numbericons%!0)-1 6`�?(treedef%+smeg2%)=ascl% 6j�NEXT smeg2% 6t �smeg%-=1 6~ �ENDWHILE 6�� smeg2%=iii%-1 � 1 � -1 6��getvars(smeg2%,�) 6�!� smeg3%=0 � (numbericons%!0) 6�> � ?(treedef%+smeg3%)=ascl% � ?(treedef%+smeg3%)=�"F" � 6� ?(treedef2%+smeg3%)=�"F" 6� � 6� ?(treedef2%+smeg3%)=�"O" 6� � 6�# � ?(treedef%+smeg3%)=�"F" � 6�# ?(treedef%+smeg3%)=asct% 6�# ?(treedef2%+smeg3%)=�"F" 6� � 7 �smeg3% 7 �smeg2% 7� 7: 7(ݤws(s) 72� sp% s 7<=sp% 7F� �filestype(obj%,type%) 7P1� obj%=1 � (type% � &FFF00000) <> &FFF00000 � 7Ztype%=-2 7d� 7n5� obj%=1 � type%=(type% � &FFF00) >> 8 � type%=-1 7x� 7� =type% 7� ݤpad(qq) 7�far$=�~(qq) 7�Ȏ �(far$) � 7�� 0 7�far$="000" 7�� 1 7�far$="00"+far$ 7�� 2 7�far$="0"+far$ 7�� 7� =far$ 7�#��dolines(miny%,maxy%,scrolly%) 8ș&000400E6,fincols 8top%=�(scrolly% � 44) 8$bot%=(maxy%-miny%-scrolly%) � 44 8"block2%!0=main% 8,ș&400cb,,block2% 86topx%=block2%!4-block2%!20 8@topy%=block2%!16-block2%!24 8Jtobot%=bot% 8T#� tobot%>iii%-1 � tobot%=iii%-1 8^� puke%=top% � tobot% 8h�getvars(puke%,�) 8r&� subcount%=0 � (numbericons%!0)-1 8|@� ?(treedef%+subcount%)=asct% � subcount%<(numbericons%!0) � 8�-�bar(topx%+(subcount%*50),topy%-puke%*44) 8�7� topy%-puke%*44 > tttemp% � tttemp%=topy%-puke%*44 8�� 8�� subcount% 8�(� ?(treedef%+numbericons%!0)=ascl% � 8�7�botbar(topx%+((numbericons%!0)*50),topy%-puke%*44) 8�7� topy%-puke%*44 > tttemp% � tttemp%=topy%-puke%*44 8�� 8�(� ?(treedef%+numbericons%!0)=asct% � 8�5�tbar(topx%+((numbericons%!0)*50),topy%-puke%*44) 8�7� topy%-puke%*44 > tttemp% � tttemp%=topy%-puke%*44 8�� 8�� puke% 9� 9��tbar(xp%,yp%) 9 xp%+=8 9&� xp%,yp%,xp%,yp%-44 90� xp%,yp%-22,xp%+36,yp%-22 9:� 9D��botbar(xp%,yp%) 9N xp%+=8 9X� xp%,yp%,xp%,yp%-22 9b� xp%,yp%-22,xp%+36,yp%-22 9l� 9v��bar(xp%,yp%) 9� xp%+=8 9�� xp%,yp%,xp%,yp%-44 9�� 9���title(w%,title$) 9�block%!0 = w% 9�ș &000400CC,,block% 9�po% = !(block%+76) 9�$po% = title$+�0 9�� 9�ݤspriteexists(sprite$) 9�!ș&000600E9,24,,sprite$ � R0% 9�� R0%>600 � R0%<0 � =� � =� 9���majorredraw :ș&000406C0 :� myup=0 � iii%-1 :1� iii%-1<>0 � ș&000406C4,(myup/(iii%-1))*100 : �getvars(myup,�) :*temp$=�gLn($filename%) :4!� type%!0>&FFF � type%!0<&0 � :>� �temp$,1)="!" � :Hvalid$="S"+temp$ :R� :\valid$="Sdirectory" :f� :p� :z!valid$="Sfile_"+�pad(type%!0) :�� :�-� � �spriteexists(�valid$,2,�(valid$))) � :� � �temp$,1)<>"!" � :� valid$="Sfile_xxx" :� � :� valid$="SApplication" :� � :�� :�'�seticonsprite(main%,myup+1,valid$) :� �myup :�ș&000406C2 :�� :�$��alert(title$,message$,button%) ;� #0 ;� response% ;$(block2%+4)=message$ ;$Ȏ button% � ;.� 2 : response%=1 ;8� 1 : response%=15 ;B � 3 : response%=(1<<5)+16 ;L � 4 : response%=(1<<6)+16 ;V : response%=16 ;`� ;j6ș &000400DF,block2%,response%,title$ � ,response% ;t� ;~��export(afile$,msgflg) ;�ș &000406C0 ;�ș &08,11,afile$,&fff,0,0 ;�mmy%=�(afile$) ;�� fheadings � fsourcedir � ;�'lll$="Tree display of '"+pooup$+"'" ;�� strptr%=1 � �(lll$) ;�%� #mmy%,�(�lll$,strptr%,strptr%)) ;� � strptr% ;�� #mmy%,10 ;�� ;�� fheadings � fdate � ;�lll$="Exported on "+�$ <