Home » Archimedes archive » Acorn User » AU 1998-08.adf » Freeware » PD/Xuen11/!Xuen/!runimage

PD/Xuen11/!Xuen/!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 » Archimedes archive » Acorn User » AU 1998-08.adf » Freeware
Filename: PD/Xuen11/!Xuen/!runimage
Read OK:
File size: F1F0 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM ***********************************************
   20REM Name    : Xuen
   30REM Purpose : Make RiscOS Desktop more efficient(!)
   40REM Author  : Barny Short
   50REM Date    : 30-May-1998
   60REM ***********************************************
   70appversion$="11.0"
   80REM ***********************************************
   90
  100GlobalErrorState%=0
  110RandomToolTip%=1:REM Enable(=1)/Disable(=0) random tool tips
  120ON ERROR PROCerror(REPORT$+" at line "+STR$ERL):CLOSE#0:END
  130
  140REMON ERROR GOTO@@@@
  150
  160LIBRARY "<Obey$Dir>.Resources.Libs.OS"
  170LIBRARY "<Obey$Dir>.Resources.Libs.Filer"
  180LIBRARY "<Obey$Dir>.Resources.Libs.Wimp"
  190LIBRARY "<Obey$Dir>.Resources.Libs.Tooltip"
  200
  210PictureType%=&d94:REM Artworks
  220DocumentType%=&bc5:REM Impression Document
  230User$="Admin":REM Default User name is Admin
  240
  250app$="Xuen"
  260AppPath$=""
  270AppDate$=""
  280DIM apppath 255, apppathvar 32, appdatevar 32
  290$appdatevar="<Sys$Time> <Sys$Date>"+CHR$0
  300$apppathvar="<Xuenbs$Dir>"+CHR$0
  310
  320REM Aquire the start path to use for delete operations
  330SYS"OS_GSTrans",apppathvar,apppath,255
  340AppPath$=FNstring(apppath)
  350
  360
  370DIM errorblock% 2048, block% 2048, block2% 2048, clistring 255
  380DIM winblock% 2048, winopenblock% 2048, transblock% 2048, ptrblock% 2048
  390DIM unknownstring% 32
  400$unknownstring% = "unknown_app"+CHR$0
  410
  420DIM InvalidDrive$(255)
  430InvalidDriveCount%=0
  440
  450DIM dragspritename% 256, boundspritebox% 32
  460
  470
  480REM Auto link buffer add stuff
  490alba_destinationdir$=""
  500alba_type%=-1:REM -1 means nothing in cache
  510alba_newlinkfile$=""
  520alba_newlinkleaf$=""
  530alba_time%=0
  540
  550CACHE_SIZE% = 4096
  560pause% = 200
  570open_type%=1
  580close_type%=2
  590add_window%=1
  600subtract_window%=2
  610drag_type%=5
  620adjust%=1
  630menu%=2
  640select%=4
  650iconbarhandle%=0
  660dircount%=0
  670linkloadaddr%=0
  680objecttype%=0
  690linkmenu%=0
  700addlink%=0
  710iconbar_timer%=TIME:iconbar_timerflag%=0
  720whandle_tooltip%=0:ToolTip%=0:tooltip_timer%=0
  730override_tooltip%=0:OldToolTip%=0
  740whandle_tree%=0
  750internalstackposition%=-2
  760oldstackposition%=0
  770currentwindow%=0
  780currentmenuhandle%=0
  790firstmenuhandle%=-3
  800IconBarMenuOpen%=0
  810StartMenuSeperator%=-1
  820StartMenuSeperator2%=-1
  830StartMenuSeperator3%=-1
  840SysFilePrefix%=126
  850BottomEdgeFlag=0
  860after%=0
  870whandle_dummyback%=0
  880LastRightEdge%=0
  890CascadeRow%=0
  900CurrentButton%=0
  910tptr%=0
  920
  930REM Filer tree related stuff
  940FilerViewW% = 642
  950FilerViewH% = 512
  960
  970GlobalMenuItemCount%=0
  980GlobalMenuSepCount%=0
  990GlobalToolTip$=""
 1000GlobalState% = 0
 1010GlobalStatePreBoot% = 0
 1020GlobalStatePostBoot% = 1
 1030GlobalStateIdle% = 2
 1040GlobalStateShutDown% = 3
 1050GlobalStep% = 0
 1060GlobalShowBootMenuFlag%=0
 1070RECURSE_BOOT% = 1
 1080RECURSE_RUN% = 2
 1090
 1100REM Insert your choice of random tooltips here
 1110RandTipMax%=5:REM Total number of random tooltips
 1120DIM RandTip$(RandTipMax%)
 1130RandTip$(1)="If it's getting complicated, you're doing it wrong"
 1140RandTip$(2)="You use computers too much!"
 1150RandTip$(3)="Hablo espanol!"
 1160RandTip$(4)="Have you read Dilbert today?"
 1170RandTip$(5)="Take your vits!"
 1180
 1190IconBarAnimSize%=6
 1200DIM IconBarAnim$(IconBarAnimSize%)
 1210IconBarAnim$(0)="Sxuen0"
 1220IconBarAnim$(1)="Sxuen30"
 1230IconBarAnim$(2)="Sxuen60"
 1240IconBarAnim$(3)="Sxuen90"
 1250IconBarAnim$(4)="Sxuen120"
 1260IconBarAnim$(5)="Sxuen150"
 1270IconBarAnimStep=0
 1280IconBarAnimDir=0.5
 1290
 1300WindowListIcon%=-1
 1310WindowListTimer%=0
 1320
 1330MaxWindowListSize%=64
 1340WindowListSize%=0
 1350DIM WindowListName$(MaxWindowListSize%)
 1360DIM WindowListHandle%(MaxWindowListSize%)
 1370
 1380CurrentMenuType%=0
 1390MainMenuType% = 0
 1400WindowListMenuType% = 1
 1410ShortCutMenuType% = 2
 1420
 1430MenuIsOpenFlag%=0
 1440
 1450DIM dblock% 1024, bootblock% 1024, shortcutmenu% 16000, shortcutmenudata% 20384
 1460DIM main_menu% 256, tool_menu% 256, typebuf% 256, iconbarlabel% 32, iconbardata% 32
 1470DIM string% 1024, bootstring% 1024, infodata% 2048, tooltipdata% 2048, tooltipicon% 512
 1480DIM cache% CACHE_SIZE%
 1490DIM dirlist%(32), dirptr%(32)
 1500
 1510cache_ext%=0
 1520task_handle%=0
 1530drag_button%=adjust%
 1540DX%=0
 1550drag_icon%=0
 1560path$=""
 1570in_leftregion=FALSE
 1580in_rightregion=FALSE
 1590qf_timer=TIME
 1600regionxs%=16
 1610regionys%=64
 1620$iconbarlabel%=""+CHR$0
 1630$iconbardata%="S!xuen"+CHR$0
 1640globalmenuptr%=shortcutmenu%
 1650
 1660$iconbardata%=IconBarAnim$(0)+CHR$0
 1670
 1680
 1690REM ***************************************************
 1700
 1710quit%=FALSE
 1720
 1730SYS"Hourglass_On"
 1740PROCinit
 1750REM PROCerror("Xuen path = "+AppPath$+CHR$0)
 1760PROCGetScreenSize
 1770PROCCreateToolTip
 1780PROCloadcache
 1790SYS"Hourglass_Off"
 1800
 1810REM If ALT is pressed then skip auto booting/loading anything
 1820IF NOT(INKEY-3) THEN
 1830 PROCRecurseDirectory(AppPath$+".Users."+User$+".Links.~~Boot", RECURSE_BOOT%)
 1840 IF NOT(quit%) PROCRecurseDirectory(AppPath$+".Users."+User$+".Links.~~Run", RECURSE_RUN%)
 1850 GlobalState%=GlobalStatePostBoot%
 1860 IF NOT(quit%) PROCRecurseDirectory(AppPath$+".Users."+User$+".Links", RECURSE_BOOT%)
 1870ENDIF
 1880
 1890GlobalState%=GlobalStateIdle%
 1900
 1910WHILE NOT quit%
 1920PROCpoll
 1930ENDWHILE
 1940
 1950REM Ensure all buffers are empty
 1960PROCalba_purge(0)
 1970GlobalState%=GlobalStateShutDown%
 1980REM Reset quit to enable another quit
 1990REM during program shutdown to be detected ...
 2000quit%=FALSE
 2010PROCRecurseDirectory(AppPath$+".Users."+User$+".Links.~~RunQuit", RECURSE_RUN%)
 2020PROCDestroyToolTip
 2030SYS "Wimp_CloseDown"
 2040END
 2050
 2060REM Error handler
 2070PROCerror(REPORT$+" at line "+STR$ERL):CLOSE#0
 2080GlobalErrorState%+=1
 2090IF GlobalErrorState%=1 GOTO 1960
 2100IF GlobalErrorState%=2 GOTO 2030
 2110REM Multiple errors have occured - die ungracefully
 2120END
 2130
 2140REM ***************************************************
 2150
 2160DEFPROCGetDate
 2170REM Aquire date and time
 2180SYS"OS_GSTrans",appdatevar,apppath,255
 2190AppDate$=FNstring(apppath)
 2200ENDPROC
 2210
 2220REM ***************************************************
 2230
 2240REM poll loop
 2250DEFPROCpoll
 2260SYS"Wimp_Poll",0,block% TO reason%
 2270REM IF reason%<>0 PROCerror(STR$(reason%)+CHR$0)
 2280CASE reason% OF
 2290WHEN 0:PROCnull_reason
 2300WHEN 2:PROCPollReason2
 2310WHEN 3:SYS "Wimp_CloseWindow",,block%
 2320WHEN 6:PROCclick(block%!12)
 2330WHEN 7:PROCdragdrop
 2340REMWHEN 8:PROCkeypressed
 2350WHEN 9:PROCmenuselect
 2360WHEN 17,18:PROCreceive(reason%)
 2370REM WHEN 19:PROCerror("Unsupported window definition.")
 2380ENDCASE
 2390ENDPROC
 2400
 2410REM ***************************************************
 2420
 2430DEFPROCPollReason2
 2440IF ((!block%) >= OS_MX%) THEN
 2450REM PROCerror("Window tobeopened:"+STR$~(!block%)+"  behind: "+STR$~(block%!28)+CHR$0)
 2460SYS "Wimp_OpenWindow",,block%
 2470ELSE
 2480REMcurrentwindow%=!block%:PROCOpenToolTip(2)
 2490REM This is very wierd - the windowhandle is invalid and equals
 2500REM the mouse pointer x position - must be a menu I reckon or
 2510REM could be a bug in RISCOS.
 2520MenuIsOpenFlag%=1
 2530ENDIF
 2540
 2550ENDPROC
 2560
 2570DEFPROCGetScreenSize
 2580SYS"OS_ReadModeVariable",-1,4 TO ,,OS_EX%:REM Eigen
 2590SYS"OS_ReadModeVariable",-1,5 TO ,,OS_EY%
 2600SYS"OS_ReadModeVariable",-1,11 TO ,,OS_WX%:REM Size
 2610SYS"OS_ReadModeVariable",-1,12 TO ,,OS_WY%
 2620OS_MX%=(1+OS_WX%) << OS_EX%
 2630OS_MY%=(1+OS_WY%) << OS_EY%
 2640ENDPROC
 2650
 2660REMDEFPROCkeypressed
 2670REMLOCAL Char%
 2680REMChar%=block%!24
 2690REMIF Char%=&1CD PROCerror("Insert pressed on icon "+CHR$0)
 2700REMREM Is this the delete or backspace key?
 2710REMIF (Char%=8 OR Char%=&7f) THEN
 2720REMREM Is this in a menu?
 2730REMPROCerror("Window handle = "+STR$~(block%!0)+" -- main_menu% = "+STR$~(main_menu%)+CHR$0)
 2740REMELSE
 2750REMSYS "Wimp_ProcessKey",Char%
 2760REMENDIF
 2770REMENDPROC
 2780
 2790DEFPROCReopenDummyWindow
 2800 !block2%=whandle_dummyback%
 2810 SYS"Wimp_GetWindowState",,block2%
 2820 block2%!8=-1024:block2%!16=-1024
 2830 block2%!28=-2
 2840 SYS"Wimp_OpenWindow",,block2% 
 2850 after%=whandle_dummyback%
 2860 REM MenuIsOpenFlag%=0
 2870 
 2880 
 2890  WindowListSize%=0
 2900ENDPROC
 2910
 2920DEFPROCcascade
 2930LOCAL q%,OldAfter%,after%
 2940LOCAL sx%, sy%, ox%, oy%
 2950LOCAL ReopenFlag%, StackFlag%, ValidFlag%
 2960LOCAL PaneFlag%, IsOpenFlag%, IsMoveableFlag%
 2970LOCAL CurrentWin%,CurrentIcon%
 2980LOCAL n%
 2990
 3000PROCBuildWindowList
 3010
 3020cascade%=0
 3030LastRightEdge%=0
 3040CascadeRow%=0
 3050
 3060SYS"Wimp_GetPointerInfo",,block2%
 3070CurrentWinPtr%=block2%!12
 3080CurrentIcon%=block2%!16
 3090
 3100IF WindowListSize%=0 ENDPROC
 3110
 3120FORn%=0 TO (WindowListSize%-1)
 3130 q%=winblock%
 3140 PaneFlag%=FALSE
 3150 REM Get Current window immediately under pointer
 3160 CurrentWin% = WindowListHandle%(n%)
 3170 !q%=CurrentWin%
 3180 REM Try and cascade this desktop window ...
 3190 SYS "Wimp_GetWindowState",,q%
 3200 
 3210 q%!28=-1
 3220 
 3230 REM Reposition window
 3240 PaneFlag%=FALSE
 3250 IF (((q%!32) AND ((2^22)+(2^23)))>0) PaneFlag%=TRUE
 3260 IF (((q%!32) AND 32)=32) PaneFlag%=TRUE
 3270 IsOpenFlag% = ((q%!32) AND (2^16))
 3280 IsMoveableFlag% = ((q%!32) AND 2)
 3290
 3300 ReopenFlag%=TRUE
 3310 StackFlag%=TRUE
 3320 ValidFlag%=TRUE
 3330 
 3340 IF (StackFlag%=TRUE) THEN
 3350  ox%=q%!4
 3360  oy%=q%!16
 3370  sx%=(q%!12)-(q%!4)
 3380  sy%=(q%!16)-(q%!8)
 3390  
 3400  REM Try and fit as many windows horizontally as possible
 3410  IF ((LastRightEdge%+sx%)<(OS_MX%-40)) THEN
 3420   q%!4=LastRightEdge%
 3430   q%!16=(OS_MY%-40)-(CascadeRow%*40):REM 1160
 3440   q%!12=(q%!4)+sx%
 3450   IF ((q%!12)>(OS_MX%-40)) q%!12=(OS_MX%-40)
 3460   q%!8=(q%!16)-sy%
 3470   IF ((q%!8)<40) q%!8=40
 3480   LastRightEdge%=(q%!12)+48
 3490   ELSE
 3500   LastRightEdge%=0
 3510   CascadeRow%+=1
 3520   q%!4=(CascadeRow%*8)
 3530   q%!16=(OS_MY%-40)-(CascadeRow%*40):REM 1160
 3540   q%!12=(q%!4)+sx%
 3550   IF ((q%!12)>(OS_MX%-40)) q%!12=(OS_MX%-40)
 3560   q%!8=(q%!16)-sy%
 3570   IF ((q%!8)<40) q%!8=40
 3580   LastRightEdge%=(q%!12)+48
 3590  ENDIF
 3600
 3610  REM Having allowed space for this window in the
 3620  REM window cascade, are we sure we want to move
 3630  REM it just yet?
 3640  IF (ReopenFlag%=TRUE) THEN
 3650   SYS "XWimp_SendMessage",2,q%,CurrentWin%
 3660  ENDIF    
 3670  cascade%+=1  
 3680 ENDIF:REM End of IF StackFlag ...
 3690NEXT n%
 3700ENDPROC
 3710
 3720REM *********************************************
 3730REM * Animate the icon bar icon                 *
 3740REM *********************************************
 3750DEFPROCAnimateIconBar
 3760$iconbardata%=IconBarAnim$(IconBarAnimStep)
 3770IconBarAnimStep+=IconBarAnimDir
 3780IF (IconBarAnimStep<0 OR IconBarAnimStep=IconBarAnimSize%) THEN
 3790IconBarAnimStep=0
 3800REM  IconBarAnimDir = IconBarAnimDir*-1
 3810REM IconBarAnimStep+=IconBarAnimDir
 3820ENDIF
 3830REM Activate an update on the task bar icon .....
 3840!block2%=-2
 3850block2%!4=iconbarhandle%
 3860SYS"Wimp_GetIconState",,block2%
 3870block2%!8=0:REM Don't change anything,
 3880block2%!12=0:REM Just signal an update ...
 3890REM Insert the relevant word depending on system state ...
 3900IF (GlobalState%<GlobalStateIdle%) $iconbarlabel%="Zz..."+CHR$0
 3910IF (GlobalState%=GlobalStateIdle%) $iconbarlabel%="     "+CHR$0:REM User$+CHR$0
 3920IF (GlobalState%=GlobalStateShutDown%) $iconbarlabel%="Bye.."+CHR$0
 3930GlobalStep%+=1
 3940SYS"Wimp_SetIconState",,block2%
 3950ENDPROC
 3960
 3970REM *********************************************
 3980REM Idle WIMP poll
 3990REM *********************************************
 4000DEFPROCnull_reason
 4010LOCAL window%,icon%,wlicon%,button%
 4020
 4030SYS"Wimp_GetPointerInfo",,ptrblock%
 4040X%=ptrblock%!0
 4050Y%=ptrblock%!4
 4060button%=ptrblock%!8
 4070window%=ptrblock%!12
 4080icon%=ptrblock%!16
 4090currentwindow%=window%
 4100
 4110IF (CurrentMenuType% = WindowListMenuType% AND (button% AND7)>0) THEN
 4120 IF (window%=currentmenuhandle% AND icon%>=0) THEN
 4130  wlicon% = icon% DIV3
 4140  IF (wlicon%<>WindowListIcon%) THEN
 4150   WindowListIcon%=wlicon%:WindowListTimer%=TIME
 4160  ENDIF
 4170  IF (TIME>(WindowListTimer%+200)) THEN
 4180   REM Open this window
 4190   PROCwindowmenuselect(wlicon%)
 4200REM   IF ((button% AND7)=4) SYS"Wimp_CreateMenu",,-1
 4210   REM PROCerror("Icon handle = "+STR$(icon% DIV3)+" ("+STR$icon%+")"+CHR$0)
 4220   WindowListIcon%=-1
 4230  ENDIF
 4240  
 4250  ELSE
 4260  WindowListIcon%=-1
 4270 ENDIF
 4280 ELSE
 4290 WindowListIcon%=-1
 4300ENDIF
 4310
 4320REM Purge the buffer once every 10s
 4330PROCalba_purge(1000)
 4340PROCAnimateIconBar
 4350IF (ToolTip%=1) PROCUpdateToolTipTime
 4360
 4370REM This may be needed to stop flicker
 4380REM *fx19
 4390IF (((ptrblock%!12)=-2 AND (ptrblock%!16=iconbarhandle%))) THEN
 4400PROCmove_overiconbar
 4410ELSE
 4420OldToolTip%=0
 4430
 4440REMIF (((TIME-tooltip_timer%)>100) AND ToolTip%>0) THEN
 4450IF (ToolTip%>0) THEN
 4460IF (ptrblock%!16 <> whandle_tooltip%) iconbar_timerflag%=0
 4470PROCCloseToolTip
 4480ELSE
 4490REMiconbar_timer%=TIME
 4500iconbar_timerflag%=0
 4510ENDIF
 4520ENDIF
 4530
 4540IF ((X%>regionxs% AND X%<(OS_MX%-regionxs%)) OR Y%>regionys%) PROCoutoffocus
 4550IF (Y%=0) THEN
 4560 IF (BottomEdgeFlag=0) PROCpointeronbottomedge
 4570 ELSE
 4580 BottomEdgeFlag=0
 4590ENDIF
 4600
 4610ENDPROC
 4620
 4630REM ***************************************************
 4640
 4650DEFPROCpointeronbottomedge
 4660LOCAL stackposition%
 4670REM Make iconbar at top of stack
 4680BottomEdgeFlag=1
 4690SYS"Wimp_ProcessKey",&1dc
 4700ENDPROC
 4710
 4720DEFPROCpointernotoniconbar
 4730IF (ToolTip%=0 OR (ToolTip%<>0 AND currentwindow%<>whandle_tooltip%)) THEN
 4740 IF firstmenuhandle%=-2 firstmenuhandle%=currentwindow%
 4750ENDIF
 4760
 4770!block%=-2
 4780SYS"Wimp_GetWindowState",,block%
 4790stackposition%=block%!28
 4800IF (stackposition%<>oldstackposition%) THEN
 4810IF (currentwindow%<>firstmenuhandle% AND firstmenuhandle%>-2) THEN
 4820SYS"Wimp_ProcessKey",&1dc
 4830firstmenuhandle%=-3
 4840!block%=-2
 4850SYS"Wimp_GetWindowState",,block%
 4860stackposition%=block%!28
 4870oldstackposition%=stackposition%
 4880ENDIF
 4890ENDIF
 4900ENDPROC
 4910
 4920
 4930DEFPROCoutoffocus
 4940IF (in_leftregion) THEN PROCleaveleftregion
 4950IF (in_rightregion) THEN PROCleaverightregion
 4960qf_timer=TIME
 4970ENDPROC
 4980
 4990DEFPROCleaveleftregion
 5000in_leftregion=FALSE
 5010ENDPROC
 5020
 5030DEFPROCleaverightregion
 5040in_rightregion=FALSE
 5050ENDPROC
 5060
 5070DEFPROCfocusdelay
 5080IF ((TIME-pause%)>qf_timer) THEN qf_timer=-1:PROCOpenInfoBox
 5090ENDPROC
 5100
 5110DEFPROCleft_corner
 5120IF (in_leftregion=FALSE) ec_timer=TIME:ec_flag=FALSE
 5130in_leftregion=TRUE
 5140REM Check if windows need opening
 5150IF (TIME-ec_timer>=50 AND ec_flag=FALSE) THEN
 5160PROCreopenfiler:ec_flag=TRUE
 5170ENDIF
 5180
 5190ENDPROC
 5200
 5210DEFPROCright_corner
 5220IF (in_rightregion=FALSE) ec_timer=TIME:ec_flag=FALSE
 5230in_rightregion=TRUE
 5240REM Check if windows need closing
 5250REMIF (TIME-ec_timer>=100 AND ec_flag=FALSE) THEN
 5260IF (ec_flag=FALSE) THEN
 5270PROCclosefiler:PROCCloseInfoBox:ec_flag=TRUE
 5280ENDIF
 5290ENDPROC
 5300
 5310REM ***************************************************
 5320
 5330DEFPROCOpenInfoBox
 5340
 5350
 5360
 5370!block%=whandle_info%
 5380SYS"Wimp_GetWindowState",,block%
 5390SYS"Wimp_OpenWindow",,block%
 5400ENDPROC
 5410
 5420DEFPROCCloseInfoBox
 5430!block%=whandle_info%
 5440SYS"Wimp_CloseWindow",,block%
 5450ENDPROC
 5460
 5470REM ***************************************************
 5480
 5490DEFPROCinit_drag(icon%)
 5500qf_timer=-1
 5510SYS"Wimp_GetPointerInfo",,block%
 5520ox%=block%!0
 5530oy%=block%!4
 5540block%!4=icon%
 5550drag_icon%=icon%
 5560block%!4=drag_type%
 5570block%!8=ox%-32
 5580block%!12=oy%-32
 5590block%!16=ox%+32
 5600block%!20=oy%+32
 5610block%!24=&80000000
 5620block%!28=&80000000
 5630block%!32=&7FFFFFFF
 5640block%!36=&7FFFFFFF
 5650SYS"Wimp_DragBox",,block%
 5660
 5670REM Start a sprite drag ....
 5680IF (icon%=add_window%) $dragspritename%="yes"+CHR$0
 5690IF (icon%=subtract_window%) $dragspritename%="no"+CHR$0
 5700!boundspritebox%=0
 5710boundspritebox%!4=0
 5720boundspritebox%!8=ox%+24
 5730boundspritebox%!12=oy%+24
 5740SYS"DragASprite_Start",2+8+64+128,1,dragspritename%,boundspritebox%
 5750ENDPROC
 5760
 5770DEFPROCdragdrop
 5780SYS"Wimp_GetPointerInfo",,block%
 5790block%!20=block%!12
 5800block%!24=block%!16
 5810block%!28=!block%
 5820block%!32=block%!4
 5830block%!36=0
 5840!block%=64:block%!12=0
 5850block%!16=1:block%!40=&fff
 5860$(block%+44) =""
 5870SYS"Wimp_SendMessage",18,block%,block%!20,block%!24
 5880
 5890REM Cancel a sprite drag .......
 5900SYS"DragASprite_Stop"
 5910ENDPROC
 5920
 5930REM ************************************************
 5940REM function to deal with incoming messages
 5950REM ************************************************
 5960DEFPROCreceive(reason%)
 5970message%=block%!16
 5980REM PROCerror("Message : &"+STR$~(message%)+CHR$0)
 5990CASE message% OF
 6000WHEN 0:quit%=TRUE
 6010WHEN 3:PROCdata_load_add_link:REM PROCerror("DataLoad:"+FNstring(block%+44)+" Leafname:"+FNGetLeafName(block%+44)+" Type:&"+STR$~(!(block%+40))+CHR$0)
 6020WHEN 2:PROCdata_ack
 6030WHEN 5:PROCdata_open
 6040WHEN 10:PROCdesktop_ack
 6050WHEN &502:PROCservice_help
 6060WHEN &400C0:PROCsubmenu_warning
 6070WHEN &400C1:PROCGetScreenSize
 6080WHEN &400C9:IconBarMenuOpen%=0
 6090ENDCASE
 6100ENDPROC
 6110
 6120DEFPROCservice_help
 6130block%!12 =block%!8
 6140block%!16=&503
 6150!block%=256
 6160IF (block%!32 = -2) THEN
 6170 $(block%+20) ="\TXuen icon.|M\Sshow shortcuts.|MClick MENU to show options.|M\Ashow currently open window list.|MDrag and drop an icon onto the Xuen icon to install it into the shortcuts menu.|M"+CHR$0
 6180 SYS"Wimp_SendMessage",17,block%,block%!4
 6190ELSE
 6200 $(block%+20) ="This is the Xuen application.|M"+CHR$0
 6210 SYS"Wimp_SendMessage",17,block%,block%!4
 6220
 6230ENDIF
 6240
 6250REM IF (block%!32 = main_menu%) THEN
 6260IF (CurrentMenuType% = MainMenuType%) THEN
 6270REM $(block%+20) ="'Advanced' option enables the boot configuration to be changed from the shortcut menu.|M'Toolbox' has some useful little programming tools such as saving the ROM and RAM spritefiles to the current directory.|M"+CHR$0
 6280REM SYS"Wimp_SendMessage",17,block%,block%!4
 6290ENDIF
 6300ENDPROC
 6310
 6320REM *******************************************************
 6330REM User has double clicked on a fileicon
 6340REM Response - store a link to this file in the ~ directory
 6350REM *******************************************************
 6360DEFPROCdata_open
 6370LOCAL type%, destinationdir$
 6380REM Flush cache if stuff in it ...
 6390IF (alba_type%>0 AND alba_type%<>4096) THEN PROCalba_purge(0)
 6400
 6410alba_newlinkfile$=FNstring(block%+44)
 6420alba_newlinkleaf$=FNGetLeafName(block%+44)
 6430type%=!(block%+40)
 6440alba_type%=type%
 6450REM PROCerror("Type = "+STR$(type%)+CHR$0)
 6460destinationdir$=AppPath$+".Users."+User$+".Links."
 6470
 6480
 6490IF (type%=4096) THEN
 6500REM Store this directory access
 6510destinationdir$=destinationdir$+CHR$(SysFilePrefix%)+"Folders"
 6520ENDIF
 6530
 6540IF (type%=8192) THEN
 6550REM Store this application access
 6560destinationdir$=destinationdir$+CHR$(SysFilePrefix%)+"Programs"
 6570ENDIF
 6580
 6590IF (type%<4096) THEN
 6600 IF (type%=DocumentType%) THEN
 6610 destinationdir$=destinationdir$+CHR$(SysFilePrefix%)+"Document"
 6620 ENDIF
 6630 
 6640 IF (type%=PictureType%) THEN
 6650 destinationdir$=destinationdir$+CHR$(SysFilePrefix%)+"Picture"
 6660 ENDIF
 6670
 6680 IF (type%<>PictureType% AND type%<>DocumentType%) THEN
 6690 destinationdir$=destinationdir$+CHR$(SysFilePrefix%)+"Files"
 6700 ENDIF
 6710ENDIF
 6720
 6730alba_destinationdir$=destinationdir$
 6740alba_time%=TIME
 6750
 6760REM Ignore all links generated during the preboot/run stage
 6770IF GlobalState%=0 alba_type%=-1
 6780ENDPROC
 6790
 6800DEFPROCautoaddnewshortcut
 6810LOCAL autodropdirectory$
 6820LOCAL number%, next%,numberofitems%
 6830LOCAL oldestdate%,oldestname$,oldesttype%,oldestnext%,oldnext%
 6840LOCAL delstring$
 6850autodropdirectory$ = alba_destinationdir$
 6860PROCensuredir(autodropdirectory$)
 6870REM Auto insert directorys have a limit of 9 items
 6880REM Is link directory empty?
 6890numberofitems%=0
 6900next%=0
 6910oldestdate%=0
 6920WHILE(next%<>-1 AND numberofitems%<=16)
 6930$string%=autodropdirectory$+CHR$0
 6940oldnext%=next%
 6950SYS "OS_GBPB",11,string%,dblock%,1,next%,63,"*" TO ,,,number%,next%
 6960IF next%<>-1 THEN
 6970numberofitems%+=1
 6980IF ((dblock%!24)<oldestdate% OR oldestdate%=0) oldestdate%=dblock%!24:oldestname$=FNstring(dblock%+29):oldestnext%=oldnext%
 6990ENDIF
 7000ENDWHILE
 7010IF (numberofitems%<9) THEN
 7020 REM If so then automatically insert
 7030 PROCaddnewshortcut(autodropdirectory$,alba_newlinkfile$,alba_newlinkleaf$)
 7040ELSE
 7050 REM Intelligently delete an old file and
 7060 REM Get filetype of this file
 7070 $string%=autodropdirectory$+CHR$0
 7080 SYS "OS_GBPB",12,string%,dblock%,1,oldestnext%,63,"*"
 7090 oldesttype%=dblock%!20
 7100  REM PROCerror("Oldest file to remove : "+oldestname$+" of type "+STR$~(oldesttype%)+CHR$0)
 7110 REM Delete the oldest link in this dir ...
 7120 REM Final check - Only allow delete on &af3 files.
 7130 IF (oldesttype%=&af3) THEN
 7140 delstring$="delete "+autodropdirectory$+"."+oldestname$
 7150 REM PROCerror("about to OSCLI "+delstring$+CHR$0)
 7160 OSCLI(delstring$+CHR$0)
 7170 REM insert a new one ...
 7180 PROCaddnewshortcut(autodropdirectory$,alba_newlinkfile$,alba_newlinkleaf$)
 7190 ENDIF
 7200ENDIF
 7210alba_type%=-1
 7220ENDPROC
 7230
 7240REM Prompt user to select directory for new link
 7250DEFPROCdata_load_add_link
 7260LOCAL path$,leaf$,type%,leafptr%,linkname$
 7270IF (FNCheckLinksDirExists=0) ENDPROC
 7280path$=FNstring(block%+44)
 7290leaf$=FNGetLeafName(block%+44)
 7300type%=!(block%+40)
 7310linkname$=AppPath$+".Users."+User$+".Links."+leaf$
 7320newlinkleaf$=leaf$
 7330newlinkfile$=FNstring(block%+44)
 7340REM Is link directory empty?
 7350$string%=AppPath$+".Users."+User$+".Links"+CHR$0
 7360SYS "OS_GBPB",10,string%,dblock%,1,0,63,"*" TO ,,,number%
 7370IF number%=0 THEN
 7380REM If so then automatically add to root directory
 7390PROCaddnewshortcut(AppPath$+".Users."+User$+".Links",newlinkfile$,newlinkleaf$)
 7400ELSE
 7410PROCshowshortcutmenu(1)
 7420ENDIF
 7430ENDPROC
 7440
 7450REM Add new link to the shortcut directory
 7460DEFPROCaddnewshortcut(dropdirectory$,add_newlinkfile$,add_newlinkleaf$)
 7470LOCAL linkname$,leafptr%,IgnoreLink%,Index%,Char%
 7480linkname$=dropdirectory$+"."+add_newlinkleaf$
 7490$string%=add_newlinkfile$+CHR$0
 7500REMPROCerror("Contents of "+linkname$+"="+add_newlinkfile$+CHR$0)
 7510leafptr%=string%
 7520REM Check for any illegal characters in filename and if so
 7530REM ignore the generation of this link
 7540IgnoreLink%=FALSE
 7550FORIndex%=0TO LEN(add_newlinkleaf$)
 7560Char%=ASC(MID$(add_newlinkleaf$,Index%,1))
 7570IF Char%=ASC"$" OR Char%=ASC"." THEN
 7580 IgnoreLink%=TRUE
 7590ENDIF
 7600NEXT
 7610IF IgnoreLink%=FALSE THEN
 7620 REM Check to see if this file already exists and if so
 7630 REM prompt for overwrite.
 7640 X%=OPENOUT(linkname$+CHR$0)
 7650 WHILE((?leafptr%) > 31)
 7660 BPUT#X%, ?leafptr%
 7670 leafptr%+=1
 7680 ENDWHILE
 7690 BPUT#X%, 10:REM Output a terminating LF
 7700 CLOSE#X%
 7710 REM Set type appropriately
 7720 OSCLI("SetType "+linkname$+" af3"+CHR$0)
 7730ENDIF
 7740ENDPROC
 7750
 7760DEFPROCalba_purge(expiry%)
 7770IF (alba_type%<0) THEN ENDPROC
 7780IF (expiry%>0 AND (alba_time%+expiry%)>TIME) THEN ENDPROC
 7790PROCautoaddnewshortcut
 7800ENDPROC
 7810
 7820REM ***************************************************
 7830REM Window and iconbar click handler
 7840REM See below for menu click handler
 7850REM **************************************************
 7860DEFPROCclick(win%)
 7870CASE win% OF
 7880WHEN -2:PROCclick_iconbar(block%!8)
 7890WHEN whandle_info%:PROCclick_info(block%!8)
 7900ENDCASE
 7910ENDPROC
 7920
 7930REM **************************************************
 7940REM Menu click handler
 7950REM **************************************************
 7960DEFPROCmenuselect
 7970CASE CurrentMenuType% OF
 7980WHEN MainMenuType%:PROCmainmenuselect
 7990WHEN ShortCutMenuType%:PROCshortcutmenuselect
 8000WHEN WindowListMenuType%:PROCwindowmenuselect(!block%)
 8010ENDCASE
 8020ENDPROC
 8030
 8040REM ***************************************************
 8050
 8060DEFPROCclick_iconbar(button%)
 8070CurrentButton%=button%
 8080CASE button% OF
 8090WHEN 0:PROCmove_overiconbar
 8100WHEN 1:PROCclick_iconbaradjust
 8110WHEN 2:PROCclick_iconbargeneral
 8120WHEN 4:PROCclick_iconbarselect
 8130ENDCASE
 8140ENDPROC
 8150
 8160DEFPROCclick_iconbargeneral
 8170IF ToolTip%=1 PROCPersistCloseToolTip
 8180SYS"Wimp_GetPointerInfo",,block%
 8190override_tooltip%=1
 8200IconBarMenuOpen%=1:REM Inhibit tool tip display over menu
 8210IF (CurrentButton%=1) PROCshowwindowmenu:ENDPROC
 8220IF (CurrentButton%=2) PROCshowmainmenu:ENDPROC
 8230IF (CurrentButton%=4) PROCshowshortcutmenu(0):ENDPROC 
 8240ENDPROC
 8250
 8260                 
 8270DEFPROCclick_iconbarselect
 8280IF (INKEY-1) AND (INKEY-2) THEN
 8290 REM Open cache windows
 8300 PROCreopenfiler
 8310 ENDPROC
 8320ENDIF
 8330IF (INKEY-2) THEN
 8340 REM Start drag to add a window
 8350 SYS"Wimp_GetPointerInfo",,block%
 8360 IF (block%!8) PROCinit_drag(add_window%)
 8370 ELSE
 8380 REM Click menu
 8390 PROCclick_iconbargeneral
 8400ENDIF
 8410ENDPROC
 8420
 8430DEFPROCclick_iconbaradjust
 8440IF (INKEY-1) AND (INKEY-2) THEN
 8450REM Close cache windows
 8460PROCclosefiler:PROCCloseInfoBox
 8470ENDPROC
 8480ENDIF
 8490IF (INKEY-2) THEN
 8500SYS"Wimp_GetPointerInfo",,block%
 8510REM Start drag to remove a window
 8520IF (block%!8) PROCinit_drag(subtract_window%)
 8530ELSE
 8540PROCclick_iconbargeneral
 8550ENDIF
 8560ENDPROC
 8570
 8580REM **************************************************
 8590REM Pointer is over the iconbar
 8600REM **************************************************
 8610DEFPROCmove_overiconbar
 8620IF IconBarMenuOpen%=1 iconbar_timerflag%=0
 8630REM Is pointer over iconbar icon? If so inc iconbar_timer
 8640IF (iconbar_timerflag%=0 AND IconBarMenuOpen%<>1) iconbar_timerflag%=1:iconbar_timer%=TIME
 8650IF (((TIME-iconbar_timer%)>25) AND iconbar_timerflag%=1 AND OldToolTip%<>1) THEN
 8660 REM What sort of tool tip?
 8670 RSeed%=RND(-TIME)
 8680 
 8690 IF (RandomToolTip%=1) THEN
 8700  IF (RND(5)=1) THEN
 8710   PROCOpenToolTip(2):iconbar_timerflag%=2
 8720   ELSE
 8730   PROCOpenToolTip(1):iconbar_timerflag%=2
 8740  ENDIF
 8750 ELSE
 8760  PROCOpenToolTip(1):iconbar_timerflag%=2 
 8770 ENDIF
 8780ENDIF
 8790
 8800REM Is user dragging over icon bar icon with a button
 8810REM pressed for over 2 s ?
 8820Y%=ptrblock%!4
 8830IF (((TIME-iconbar_timer%)>200) AND IconBarMenuOpen%=0 AND ((ptrblock%!8 AND7)>0) ) THEN
 8840 IF ToolTip%=1 PROCPersistCloseToolTip
 8850 override_tooltip%=1
 8860 IconBarMenuOpen%=1:REM Inhibit tool tip display over menu
 8870 IF INKEY-3 THEN
 8880  PROCshowshortcutmenu(0)
 8890  ELSE
 8900  REM Close all other menus
 8910  REM SYS"Wimp_CreateMenu",,-1
 8920  PROCshowwindowmenu
 8930 ENDIF
 8940ENDIF
 8950
 8960REM Has tool tip been open for long enough?
 8970IF (((TIME-iconbar_timer%)>1000) AND ToolTip%>0) PROCPersistCloseToolTip:iconbar_timerflag%=0
 8980ENDPROC
 8990
 9000
 9010REM **************************************************
 9020
 9030DEFFNCheckLinksDirExists
 9040LOCAL dir$,result%
 9050dir$=AppPath$+".Users."+User$+".Links"
 9060REM Does the Links directory exist?
 9070$string%=dir$+CHR$0
 9080SYS"OS_File",17,string% TO result%
 9090REM If not, create one.
 9100IF (result%=0) THEN OSCLI("CDIR "+dir$+CHR$0)
 9110SYS"OS_File",17,string% TO result%
 9120REM Has it created it? If not, error.
 9130IF (result%=0) THEN
 9140PROCerror("Fatal : Couldn't create "+dir$+CHR$0)
 9150=0
 9160ENDIF
 9170=1
 9180
 9190REM **************************************************
 9200
 9210DEFPROCshowmainmenu
 9220CurrentMenuType% = MainMenuType%
 9230PROCshowmenu(main_menu%,!block%-64, 96+(8*44)+24)
 9240ENDPROC
 9250
 9260REM **************************************************
 9270REM Build list of currently valid open windows
 9280REM **************************************************
 9290DEFPROCBuildWindowList
 9300LOCAL q%,OldAfter%
 9310LOCAL sx%, sy%, ox%, oy%
 9320LOCAL ReopenFlag%, StackFlag%, ValidFlag%
 9330LOCAL PaneFlag%, IsOpenFlag%, IsMoveableFlag%
 9340LOCAL CurrentWin%,CurrentIcon%
 9350LOCAL WindowName$, ErrorFlag%,Windex%
 9360
 9370q%=winblock%
 9380PaneFlag%=FALSE
 9390WindowName$=""
 9400
 9410REM Start from bottom of window stack by
 9420REM opening the dummy window at the bottom ...
 9430PROCReopenDummyWindow
 9440 
 9450REM Get Current window immediately under pointer
 9460SYS"Wimp_GetPointerInfo",,block2%
 9470CurrentWinPtr%=block2%!12
 9480CurrentIcon%=block2%!16
 9490
 9500after%=whandle_dummyback%
 9510
 9520REM Go through all windows ...
 9530REPEAT
 9540OldAfter%=after%
 9550!q%=after%
 9560REM _Try_ and reopen this desktop window ...
 9570SYS "XWimp_GetWindowState",,q% TO ;ErrorFlag%
 9580CurrentWin%=!q%
 9590IF (after%=-1 OR (ErrorFlag%AND1)=1) ENDPROC
 9600Windex%=0
 9610REPEAT
 9620IF (CurrentWin%=WindowListHandle%(Windex%)) Windex%=-2
 9630Windex%+=1
 9640UNTIL Windex%>=WindowListSize% OR Windex%<0
 9650after%=q%!28
 9660 
 9670 PaneFlag%=FALSE
 9680 IF (((q%!32) AND ((2^22)+(2^23)))>0) PaneFlag%=TRUE
 9690 IF (((q%!32) AND 32)=32) PaneFlag%=TRUE
 9700 IsOpenFlag% = ((q%!32) AND (2^16))
 9710 IsMoveableFlag% = ((q%!32) AND 2)
 9720
 9730 ReopenFlag%=TRUE
 9740 StackFlag%=TRUE
 9750 ValidFlag%=TRUE
 9760 
 9770 REM If this window is not at all on screen then ignore it
 9780 REM OS_M? = ?X|Y ScreenOS?Size
 9790 ox%=q%!4:ttox%=ox%
 9800 oy%=q%!16:ttoy%=oy%
 9810 sx%=(q%!12)-(q%!4):ttsx%=sx%
 9820 sy%=(q%!16)-(q%!8):ttsy%=sy%
 9830IF (ox%>OS_MX%) OR (oy%>OS_MY%) OR ((ox%+sx%)<0) OR ((oy%+sy%)<0) THEN ValidFlag%=FALSE
 9840
 9850
 9860REM Is this the currently open menu window? 
 9870IF (CurrentWin%=currentmenuhandle%) ValidFlag%=FALSE
 9880
 9890REM Is this the icon bar?
 9900REM IF (CurrentWin%=-2) ValidFlag%=FALSE
 9910
 9920REM Under pointer and _no_ horiz/vert scroll bars and fully visible (likely to be part of menu so leave alone)
 9930IF (CurrentWin%=CurrentWinPtr% AND ((q%!32) AND (2^28))=0 AND ((q%!32) AND (2^30))=0 AND ((q%!32) AND (2^17))>0 AND after%=-1) ValidFlag%=FALSE
 9940
 9950 IF (CurrentWin%=whandle_tooltip%) ValidFlag%=FALSE
 9960 IF (PaneFlag%=TRUE) ValidFlag%=FALSE
 9970 
 9980 IF (ValidFlag%=TRUE) THEN
 9990
10000  IF (WindowListSize%<MaxWindowListSize%) THEN
10010   WindowListHandle%(WindowListSize%)=CurrentWin%
10020   WindowListSize%+=1
10030  ENDIF
10040 ENDIF:REM End of IF ValidFlag% ...
10050 
10060UNTIL CurrentWin%=-1
10070ENDPROC
10080
10090
10100REM **************************************************
10110REM Open the Window List menu
10120REM **************************************************
10130DEFPROCshowwindowmenu
10140LOCAL TitleBarFlag%, CurrentWin%, SourceTaskHandle%
10150LOCAL TitleBarPtr%, TitleBarLength%, ErrorFlag%, SuccessFlag%
10160LOCAL Index%,WindowName$,KludgeLength%,IsIndirected%
10170
10180LOCAL currentmenuptr%, locali%, width%, title$, item$
10190LOCAL WindowNum%
10200LOCAL a%
10210
10220IF (ToolTip%=1) PROCPersistCloseToolTip
10230SYS"Hourglass_On"
10240REM Build List of current windows
10250PROCBuildWindowList
10260
10270REM Build menu
10280initialmenusize%=WindowListSize%
10290currentmenuptr% = shortcutmenu%
10300title$="Windows"
10310TitlePtr%=currentmenuptr%
10320$TitlePtr%=title$
10330width%=(LEN(title$)-2)*16
10340currentmenuptr%!12 = &00070207
10350currentmenuptr%!20=44
10360currentmenuptr%!24=0
10370ptr%=currentmenuptr%+28
10380
10390IF (initialmenusize%>0) THEN
10400 locali%=0
10410 FORWindowNum%=(WindowListSize%-1) TO 0 STEP-1
10420  REM Initialise menu object
10430  IsDirect%=0
10440  !ptr%=8:REM mflags = &80 means last menu item
10450  ptr%!4=-1:REM pointer to sub menu
10460  ptr%!8=&7000313-512:REM icon type
10470  CurrentWin% = WindowListHandle%(WindowNum%)
10480  REM Get Task Handle
10490  !block2%=0
10500  SYS"XWimp_SendMessage",0,block2%,CurrentWin% TO ,,SourceTaskHandle% ;ErrorFlag%
10510  REM Is this window definition a valid one?
10520  SourceTaskName% = unknownstring%
10530  IF ((ErrorFlag%AND1)=0) THEN
10540   SYS"XTaskManager_TaskNameFromHandle",SourceTaskHandle% TO SourceTaskName% ;ErrorFlag%
10550   IF ((ErrorFlag%AND1)=1) SourceTaskName%=unknownstring%
10560  ENDIF
10570  
10580  WindowName$="???"
10590  IF ((ErrorFlag%AND1)=0) THEN
10600   !block2%=CurrentWin%
10610   REM Get Window Info NB. Set Bit0 of R1 to disable icon info
10620   SYS "Wimp_GetWindowInfo",,block2%+1 TO ; ErrorFlag%
10630   TitleBarFlag% = !(block2%+60)
10640   IF ((TitleBarFlag% AND 1) AND (ErrorFlag%AND1)=0) THEN
10650    REM This title contains text
10660    IF (TitleBarFlag% AND 256) THEN
10670     REM Title data is indirected
10680     TitleBarPtr% = !(block2%+76)
10690     TitleBarLength%=!(block2%+84)
10700     REM Major Kludge !!! TODO
10710     !block2%=0
10720     SYS"Wimp_SendMessage",0,block2%,CurrentWin% TO ,,SourceTaskHandle%
10730     REM Copy source task data to destination task data  
10740     SYS"XWimp_TransferBlock",SourceTaskHandle%,TitleBarPtr%,task_handle%,transblock%,TitleBarLength% TO ;ErrorFlag%
10750     REM Have we got the whole name?
10760     SuccessFlag%=0
10770     IF TitleBarLength%>0 THEN
10780      FORIndex%=0TO (TitleBarLength%-1)
10790       IF (?(transblock%+Index%)<32) SuccessFlag%=1
10800      NEXT
10810     ENDIF
10820     REM PROCerror("InDirected name = "+$(transblock%)+CHR$0)
10830   
10840     IF SuccessFlag%=0 THEN
10850      Index%-=1
10860      REM Get rest of title bar (Major Kludge) TODO
10870      KludgeLength%=0
10880      REPEAT
10890       SYS"XWimp_TransferBlock",SourceTaskHandle%,TitleBarPtr%+Index%,task_handle%,transblock%+Index%,1 TO ;ErrorFlag%
10900       Index%+=1
10910       KludgeLength%+=1
10920      UNTIL ?(TitleBarPtr%+(Index%-1))<32 OR ((ErrorFlag%AND1)=1) OR KludgeLength%>253
10930      ?(transblock%+Index%) = 13
10940      ?(transblock%+Index%+1) = 0
10950     ENDIF 
10960    
10970     TitleBarPtr% = transblock%
10980     ELSE
10990     REM Is Directed data
11000     REM PROCerror("Direct window name = "+$(block2%+76)+CHR$0)
11010     TitleBarPtr% = block2%+76
11020     TitleBarLength%=12
11030     IsDirect%=1
11040    ENDIF:REM End of IF is indirected?
11050    
11060    REM Has the title string got anything in it?
11070    IF (?TitleBarPtr%>=32 AND (ErrorFlag%AND1)=0) THEN
11080     IF (IsDirect%=0) THEN
11090      TitleBarString$ = FNgetname(TitleBarPtr%)
11100      REM PROCerror("Aquired title:"+TitleBarString$+CHR$0)
11110      ELSE
11120      TitleBarString$=""
11130      Z%=0
11140      REPEAT
11150       Y%=?(TitleBarPtr%+Z%)
11160       IF (Y%>=32) TitleBarString$=TitleBarString$+CHR$(Y%)
11170      Z%+=1
11180      UNTIL Z%>11 OR Y%<32
11190     ENDIF
11200     
11210     WindowName$ = TitleBarString$
11220     IF (LEN(TitleBarString$)>45) THEN
11230      WindowName$ = LEFT$(TitleBarString$, 4)
11240      WindowName$ = WindowName$ + "..."
11250      WindowName$ = WindowName$ + RIGHT$(TitleBarString$, 38)
11260     ENDIF
11270    ENDIF
11280   ENDIF :REM End of Has text?
11290  
11300   item$=WindowName$
11310   
11320   $(shortcutmenudata%+(locali%*64)) = item$+CHR$0
11330
11340   taskname$ = FNstring(SourceTaskName%)
11350   taskiconname$=taskname$
11360   IF (LEN(taskname$)>0) THEN
11370    sn=3
11380    IF INSTR(taskname$,"Filer")>0 taskiconname$ = "small_dir":sn=0
11390    IF taskname$="unknown_app" taskiconname$="small_app":sn=0
11400    IF taskname$="Task Manager" taskiconname$="switcher":sn=1
11410    IF taskname$="Palette Utility" taskiconname$="palette":sn=1
11420    IF taskname$="Calculator" taskiconname$="!calc":sn=1
11430    IF taskname$="Characters" taskiconname$="!chars":sn=1
11440    IF taskname$="StrongHelp" taskiconname$="!stronghlp":sn=1
11450    IF (sn AND1)=1 THEN ptr%!8=&7000B13-512:REM half size icon
11460    IF (sn AND2)=2 THEN taskiconname$ = "!"+taskname$
11470   ENDIF
11480   REM PROCerror("Entry:"+item$+" Icon:"+taskiconname$+" Handle:"+STR$(CurrentWin%)+" TaskName:"+taskname$+CHR$0)
11490   REM Does taskiconname sprite exist?
11500   IF NOT(FNSpriteExist(taskiconname$)) taskiconname$="application"
11510   REM Is taskiconname too long to fit in name buffer?
11520   IF (LEN(taskiconname$)>12) taskiconname$="application"
11530   REM Build rest of item data
11540   $(shortcutmenudata%+(locali%*64)+46) = "S"+taskiconname$+CHR$0
11550   !(shortcutmenudata%+(locali%*64)+60) = CurrentWin%
11560   ptr%!12 = shortcutmenudata%+(locali%*64)
11570   ptr%!16 = shortcutmenudata%+(locali%*64)+46
11580   ptr%!20 = 46:REM menu item string buffer = 46 bytes
11590   a%=(LEN(item$)+4)*16
11600   ptr%+=24
11610   locali%+=1
11620   IF (a%>width%) THEN width%=a%
11630   ELSE
11640   initialmenusize%-=1
11650  ENDIF
11660 NEXT
11670ENDIF
11680REM If menu is empty, define an 'empty' item
11690IF initialmenusize%=0 THEN
11700 REM Make default first entry be greyed out label 'empty'
11710 initialmenusize%+=1
11720 item$="Empty"+CHR$0
11730 !ptr%=&80
11740 ptr%!4=-1:REM pointer to sub menu
11750 ptr%!8=&2400029:REM greyed out UNSELECTABLE icon type
11760 $(ptr%+12)=item$
11770 a%=(LEN(item$)+4)*16
11780 IF a%>width% width%=a%
11790 ptr%+=24
11800ENDIF
11810REM Define last item in menu
11820currentmenuptr%!16=width%
11830!(ptr%-24)=&88:REM Set last menu item
11840SYS"Hourglass_Off"
11850REM Open menu
11860SYS"Wimp_GetPointerInfo",,block%
11870CurrentMenuType% = WindowListMenuType%
11880WindowListIcon%=-1
11890PROCshowmenu(shortcutmenu%,!block%-64, 96+((initialmenusize%)*44))
11900ENDPROC
11910
11920REM ***********************************************
11930REM Does Sprite Exist?
11940REM ***********************************************
11950DEFFNSpriteExist(SpriteName$)
11960LOCAL ROMBase%, RAMBase%, ErrorFlag%
11970SYS "Wimp_BaseOfSprites" TO ROMBase%,RAMBase%
11980$dragspritename% = SpriteName$
11990SYS"XOS_SpriteOp",296,ROMBase%,dragspritename% TO ; ErrorFlag%
12000IF (ErrorFlag% AND 1)=0 THEN =TRUE
12010SYS"XOS_SpriteOp",296,RAMBase%,dragspritename% TO ; ErrorFlag%
12020IF (ErrorFlag% AND 1)=0 THEN =TRUE
12030=FALSE
12040
12050REM **************************************************
12060REM Start building the shortcutmenu
12070REM **************************************************
12080DEFPROCshowshortcutmenu(arg%)
12090IF (ToolTip%=1) PROCPersistCloseToolTip
12100addlink%=arg%
12110IF (FNCheckLinksDirExists=0) ENDPROC
12120dirptr%(0)=shortcutmenu%
12130REM linkmenudepth%=0:REM At top level
12140
12150REMPROCSingleDirectoryRead(AppPath$+".Users."+User$+".Links", User$, 0, 0)
12160PROCSingleDirectoryRead(AppPath$+".Users."+User$+".Links", "ShortCuts", 0, 0)
12170initialmenudottedlinesize%=0
12180initialmenusize%=dirlist%(0)
12190IF initialmenusize%=0 initialmenusize%=1
12200initialmenusize% = GlobalMenuItemCount%
12210SYS"Wimp_GetPointerInfo",,block%
12220CurrentMenuType% = ShortCutMenuType%
12230PROCshowmenu(shortcutmenu%,!block%-64, 96+(GlobalMenuItemCount%*44)+(GlobalMenuSepCount%*24))
12240ENDPROC
12250
12260
12270
12280REM *****************************************************
12290REM Read contents of a directory into the menu data areas
12300REM storing filename and icon type
12310REM *****************************************************
12320DEFPROCSingleDirectoryRead(localdir$,dirfilename$,linkdepth%, addwrite%)
12330LOCAL oldlocaldir$,olddirfilename$,oldlinkdepth%, olddirptr%
12340LOCAL dirsize%, DirScan%
12350LOCAL dir$,next%,type%,item$,currentdir%,ptr%
12360LOCAL currentmenuptr%, locali%, width%,title$
12370LOCAL TitlePtr%, MenuExtent%,itemsprite$
12380LOCAL filetype%, filetypeinfo%,linktype%,objecttype%,linktypeinfo%
12390LOCAL ValidLoadFlag%, KeepMenuItem%
12400LOCAL NumberOfLinks%, UseLargeSprite%
12410
12420SYS"Hourglass_On"
12430
12440oldlocaldir$ = localdir$
12450olddirfilename$ = dirfilename$
12460oldlinkdepth% = linkdepth%
12470olddirptr%=dirptr%(linkdepth%)
12480DirScan%=FALSE
12490
12500IF (addlink%=1) THEN
12510 itemsprite$="Pptr_link"
12520 ELSE
12530 itemsprite$=""
12540ENDIF
12550
12560REPEAT:REM Repeat until loaded in directory with no errors
12570localdir$ = oldlocaldir$
12580dirfilename$ = olddirfilename$
12590linkdepth% = oldlinkdepth%
12600dirptr%(oldlinkdepth%)=olddirptr%
12610DirScan%=TRUE
12620
12630REM Calculate pointer to shortcutmenu% & index into
12640REM shortcutmenudata%
12650dir$=localdir$
12660a%=0
12670currentmenuptr%=shortcutmenu%
12680i%=0
12690WHILE a%<linkdepth%
12700currentmenuptr%+=(28+(dirlist%(a%)*24))
12710i%+=dirlist%(a%)
12720a%+=1
12730ENDWHILE
12740
12750REM Initialise root menu seperator to be undefined
12760IF (linkdepth%=0) THEN
12770 StartMenuSeperator%=-1
12780 StartMenuSeperator2%=-1
12790 StartMenuSeperator3%=-1
12800ENDIF
12810
12820REMPROCerror("MenuPtr = "+STR$~(currentmenuptr%)+CHR$0)
12830next%=0
12840numberofitems%=0
12850
12860REM Get number of items in current directory localdir$
12870WHILE (next%<>-1)
12880$string%=dir$+CHR$0
12890SYS "OS_GBPB",10,string%,dblock%,1,next%,63,"*" TO ,,,number%,next%
12900IF next%<>-1 THEN
12910 numberofitems%+=1
12920 item$=FNgetname(dblock%+&14)
12930 REM Discount this menu item if its a ~~ item and advanced
12940 REM menus disabled. 
12950 IF (GlobalShowBootMenuFlag%=0 AND MID$(item$,1,1)=CHR$(SysFilePrefix%) AND MID$(item$,2,1)=CHR$(SysFilePrefix%)) THEN numberofitems%-=1
12960ENDIF
12970ENDWHILE
12980
12990
13000REM PROCerror("Directory size = "+STR$(numberofitems%)+CHR$0)
13010
13020dirlist%(linkdepth%)=numberofitems%
13030nextmenuptr%=currentmenuptr%+(28+((numberofitems%+addwrite%)*24))
13040dirptr%(linkdepth%+1)=nextmenuptr%
13050
13060locali%=i%
13070REM Build titleless menu
13080REM title$="Menu "+STR$(currentdir%)+CHR$0
13090title$=dirfilename$+CHR$0
13100IF (linkdepth%=1) THEN
13110 IF (LEFT$(dirfilename$,1)=CHR$(SysFilePrefix%)) THEN
13120  IF (MID$(dirfilename$,2,1)<>CHR$(SysFilePrefix%)) THEN
13130   title$=RIGHT$(dirfilename$,LEN(dirfilename$)-1)+CHR$0
13140  ENDIF
13150  IF (MID$(dirfilename$,2,1)=CHR$(SysFilePrefix%)) THEN
13160   title$=RIGHT$(dirfilename$,LEN(dirfilename$)-2)+CHR$0
13170  ENDIF
13180 ENDIF
13190ENDIF
13200
13210TitlePtr%=currentmenuptr%
13220$TitlePtr%=title$
13230width%=(LEN(title$)-2)*16
13240currentmenuptr%!12 = &00070207
13250currentmenuptr%!20=44
13260currentmenuptr%!24=0
13270ptr%=currentmenuptr%+28
13280
13290next%=0
13300GlobalMenuItemCount%=0
13310GlobalMenuSepCount%=0
13320NumberOfLinks%=numberofitems%
13330
13340WHILE (next%<NumberOfLinks% AND DirScan%=TRUE)
13350KeepMenuItem%=TRUE
13360ValidLoadFlag%=TRUE
13370UseLargeSprite%=FALSE
13380SYS "OS_GBPB",10,dir$,dblock%,1,next%,63,"*"
13390next%+=1
13400locali%=i%
13410REM Get Object type (2 = directory, 1 = file)
13420type% = dblock%?&10
13430REM Get name of this object
13440item$=FNgetname(dblock%+&14)
13450REM Get file attributes
13460filetypeinfo%= !dblock% >>> 20
13470filetype%=(!dblock% >> 8)AND &FFF
13480
13490REM Initialise menu object
13500!ptr%=8:REM mflags = &80=LastMenuItem &8=WarnSubmenuOpen
13510ptr%!4=-1:REM pointer to sub menu
13520REM Store this filer object, whatever it is
13530!(shortcutmenudata%+(locali%*64)+32+28) = type%
13540
13550REM Is this object a directory?
13560IF (type% =2) THEN
13570 REM If so, then add to directory list
13580 $(shortcutmenudata%+(locali%*64)+32) = itemsprite$+CHR$0
13590 ptr%!4 = nextmenuptr%:REM Pointer to submenu
13600 ELSE
13610 REM This is a link and not a directory
13620 REM  PROCerror("Processing "+item$+CHR$0)
13630 REM Get filetype of link object
13640 $string%=FNGetLinkContents(dir$+"."+item$)+CHR$0
13650 
13660 IF (FNCheckValidDrive(FNstring(string%)) =1) THEN
13670  SYS "OS_File",17,string% TO objecttype%,,linkloadaddr%
13680  linktype%=(linkloadaddr%>>8) AND &FFF
13690  linktypeinfo%= linkloadaddr% >>> 20
13700 ELSE
13710  objecttype%=0
13720 ENDIF
13730 REMPROCerror(FNGetLinkContents(dir$+"."+item$)+" is a "+STR$(linktypeinfo%)+CHR$0)
13740 IF (objecttype%=0) THEN
13750  REM PROCerror("Error : Link("+FNGetLinkContents(dir$+"."+item$)+") not found."+CHR$0)
13760  REM Delete this link and rescan the directory
13770  REM Safety first - ensure this file is actually a link in
13780  REM case the <Xuenbs$Dir> system variable has become corrupt (!)
13790  IF (filetype%=&af3) THEN
13800   REM PROCerror("Invalid link "+dir$+"."+item$+" has been found and will be deleted when you click OK."+CHR$0)
13810   OSCLI("delete "+dir$+"."+item$+CHR$0)
13820   DirScan%=FALSE
13830   ValidLoadFlag%=FALSE
13840   ELSE
13850   PROCerror("Error: Another prog has altered the <Xuenbs$Dir> system variable or someone has placed a non-link "+dir$+"."+item$+" into the links directory. Rerun the !Xuen application or remove the offending file from the !Xuen.Links directory."+CHR$0)
13860  ENDIF
13870  ENDIF
13880 
13890 IF (objecttype%=1) THEN
13900  REM This link is a pointer to a file
13910  REM PROCerror(FNstring(string%)+" is a file"+CHR$0)
13920  $(shortcutmenudata%+(locali%*64)+32) = "Ssmall_"+STR$~(linktype%)+";"+itemsprite$+CHR$0
13930  IF NOT(FNSpriteExist("small_"+STR$~linktype%)) THEN
13940   REM Small icon don't exist - use large type and flag it so.
13950   $(shortcutmenudata%+(locali%*64)+32) = "Sfile_"+STR$~(linktype%)+";"+itemsprite$+CHR$0:UseLargeSprite%=TRUE     
13960  ENDIF
13970  
13980 ENDIF
13990
14000 REM For some wierd reason the following two variables must
14010 REM be evaluated outside of the objecttype test. I think
14020 REM it must be something to do with the pipeline and/or a
14030 REM bug in the BASIC rom.
14040 shriek%=ASC("!")
14050 namestart%=ASC(LEFT$(item$,1))
14060 IF (objecttype%=2) THEN
14070  REM This link is a pointer to an application or directory
14080  IF (namestart%<>shriek%) THEN
14090   $(shortcutmenudata%+(locali%*64)+32) = "Ssmall_dir;"+itemsprite$+CHR$0
14100   ELSE
14110   $(shortcutmenudata%+(locali%*64)+32) = "Ssm"+item$+";"+itemsprite$+CHR$0
14120   IF NOT(FNSpriteExist("sm"+item$)) THEN
14130    REM Small icon don't exist - use large type and flag it so.
14140    $(shortcutmenudata%+(locali%*64)+32) = "S"+item$+";"+itemsprite$+CHR$0:UseLargeSprite%=TRUE     
14150   ENDIF
14160  ENDIF
14170 ENDIF
14180
14190ENDIF
14200
14210REM Build rest of menu item attributes
14220ptr%!8=&7000313:REM icon type
14230REM IF (type%=2 AND objecttype%=0) ptr%!8=&7400313:REM Invalid
14240IF (addlink%=1) THEN
14250 ptr%!8=&3000313
14260ENDIF
14270IF (UseLargeSprite%) ptr%!8 = (ptr%!8)+&800
14280$(shortcutmenudata%+(locali%*64))=item$+CHR$0
14290ptr%!12 = shortcutmenudata%+(locali%*64)
14300ptr%!16 = shortcutmenudata%+(locali%*64)+32
14310ptr%!20 = 28:REM menu item string buffer = 28 bytes
14320
14330REM Are we dealing with any ~ or ~~ filenames ?
14340IF (linkdepth%=0 AND MID$(item$,1,1)=CHR$(SysFilePrefix%)) THEN
14350
14360 REM Single ~ prefix filenames
14370 IF (MID$(item$,2,1)<>CHR$(SysFilePrefix%)) THEN
14380  IF (StartMenuSeperator%<0) THEN
14390   StartMenuSeperator%=locali%
14400   REM Does this item need a dotted line above it?
14410   IF (locali%>0) THEN
14420    !(ptr%-24)=(!(ptr%-24)) + 2
14430    GlobalMenuSepCount%+=1
14440   ENDIF
14450  ENDIF
14460 REMIF (locali%>=StartMenuSeperator% AND StartMenuSeperator%>=0)
14470 $(shortcutmenudata%+(locali%*64))=RIGHT$(item$,LEN(item$)-1)+CHR$0
14480 REM StartMenuSeperator2%=locali%+1
14490 ENDIF
14500  
14510 REM Double ~ prefix filenames
14520 IF (MID$(item$,2,1)=CHR$(SysFilePrefix%)) THEN
14530  IF (GlobalShowBootMenuFlag%=0) THEN
14540   KeepMenuItem%=FALSE
14550   ELSE
14560   IF (StartMenuSeperator2%<0) THEN
14570    StartMenuSeperator2%=locali%
14580    REM Does this item need a dotted line above it?
14590    IF (locali%>0)
14600     !(ptr%-24)=(!(ptr%-24)) + 2
14610     GlobalMenuSepCount%+=1
14620     ENDIF
14630   ENDIF
14640   REM IF (locali%>=StartMenuSeperator2% AND StartMenuSeperator2%>=0)
14650   $(shortcutmenudata%+(locali%*64))=RIGHT$(item$,LEN(item$)-2)+CHR$0
14660   StartMenuSeperator3%=locali%+1
14670   ENDIF
14680  ENDIF
14690  
14700ENDIF:REM End of 'Are we dealing with ...
14710
14720IF (KeepMenuItem%) THEN
14730 a%=(LEN(item$)+4)*16
14740 IF a%>width% width%=a%
14750 ptr%+=24
14760 i%+=1
14770 GlobalMenuItemCount% +=1
14780ENDIF
14790ENDWHILE
14800
14810REM Do we need to add an extra writeable icon on end of menu?
14820IF (addwrite%) THEN
14821 locali%=i%
14830 item$="New"
14840 !ptr%=4+&80:REM mflags = &80=LastMenuItem &4=Writeable
14850 ptr%!4=-1:REM pointer to sub menu
14852 ptr%!8 = &7200111:REM icon type
14870 $(shortcutmenudata%+(locali%*64))=item$+CHR$0
14871 $(shortcutmenudata%+(locali%*64)+32)=CHR$0
14880 ptr%!12 = shortcutmenudata%+(locali%*64)
14890 ptr%!16 = shortcutmenudata%+(locali%*64)+32
14900 ptr%!20 = 28:REM menu item string buffer = 28 bytes
14901 a%=(LEN(item$)+4)*16
15060 IF a%>width% width%=a%
15070 ptr%+=24
15080 i%+=1
15090 GlobalMenuItemCount% +=1
15091 numberofitems%+=1
15110ENDIF
15120
15130REM Has this list got anything in it?
15140IF (numberofitems%>0) THEN
15150!(ptr%-24)= (!(ptr%-24) OR&88):REM Set last menu item
15160ELSE
15170width%=(LEN(title$)-2)*16
15180REM Make default first entry be greyed out label 'empty'
15190item$="Empty"+CHR$0
15200$(shortcutmenudata%+(locali%*64)+32) = itemsprite$+CHR$0
15210!ptr%=&88:REM mflags = &80 means last menu item 8=IssueWarn
15220ptr%!4=-1:REM pointer to sub menu
15230ptr%!8=&3000313:REM grey colour SELECTABLE icon type (Add link)
15240$(shortcutmenudata%+(locali%*64))=item$
15250$(ptr%+12)=item$
15260ptr%!12 = shortcutmenudata%+(locali%*64)
15270ptr%!16 = shortcutmenudata%+(locali%*64)+32
15280ptr%!20 = 28:REM menu item string buffer = 28 bytes
15290a%=(LEN(item$)+4)*16
15300IF a%>width% width%=a%
15310i%+=1
15320GlobalMenuItemCount%+=1
15330ENDIF
15340currentmenuptr%!16=width%
15350
15360REM End of directory scanning
15370UNTIL DirScan%=TRUE
15380dirlist%(linkdepth%)=numberofitems%
15390
15400REM IF (dirlist%(linkdepth%)=0) dirlist%(linkdepth%)=1
15410SYS"Hourglass_Off"
15420ENDPROC
15430
15440REM *************************************************
15450REM A Submenu is about to open
15460REM *************************************************
15470DEFPROCsubmenu_warning
15480LOCAL ptr%,localdir$,depth%,index%,selection%,leaf$,i%
15490LOCAL prefix$
15500localdir$=AppPath$+".Users."+User$+".Links"
15510
15520REM Navigate menu index data to determine where we are
15530depth%=0
15540index%=0
15550ptr%=block%+32
15560WHILE !((block%+32)+(depth%*4)) <> -1
15570selection%=!((block%+32)+(depth%*4))
15580leaf$=FNstring(shortcutmenudata%+((index%+selection%)*64))
15590REM Is this a system directory name?
15600i%=selection%
15610IF (depth%=0) THEN
15620 prefix$=""
15630 IF (i%>=StartMenuSeperator% AND StartMenuSeperator%>=0) prefix$=CHR$(SysFilePrefix%)
15640 IF (i%>=StartMenuSeperator2% AND StartMenuSeperator2%>=0) prefix$=CHR$(SysFilePrefix%)+CHR$(SysFilePrefix%)
15650 IF (i%>=StartMenuSeperator3% AND StartMenuSeperator3%>=0) prefix$=""
15660 leaf$=prefix$+leaf$
15670ENDIF
15680
15690localdir$=localdir$+"."+leaf$
15700index%+=dirlist%(depth%)
15710depth%+=1
15720ENDWHILE
15730PROCSingleDirectoryRead(localdir$,leaf$,depth%, 0)
15740SYS"Wimp_CreateSubMenu",,block%!20,block%!24,block%!28
15750ENDPROC
15760
15770REM *****************************************************
15780REM Recursive Directory boot
15790REM *****************************************************
15800DEFPROCRecurseDirectory(localdir$, recurseaction%)
15810LOCAL dir$, next%,type%, item$, objectcount%, currentdir%,filetype%
15820LOCAL number%,LD%
15830LOCAL linktype%,linkdir$
15840dir$=localdir$
15850next%=0
15860WHILE next%<>-1 AND NOT(quit%)
15870
15880SYS "OS_GBPB",12,dir$,bootblock%,1,next%,63,"*" TO ,,,number%,next%
15890REM Get Object type (2 = directory, 1 = file)
15900type% = bootblock%?&10
15910filetype% = bootblock%!20
15920REM Get name of this object
15930item$=FNgetname(bootblock%+24)
15940REM Has this directory got anything in it?
15950IF (next%<>-1) THEN
15960 REM Is this a directory (ie type=2) 
15970 IF (type%=2) THEN
15980   PROCRecurseDirectory(dir$+"."+item$, recurseaction%)
15990 ELSE
16000   REM Must be a link to a file or application
16010   REM What type of thing does this link point to?
16020   REM PROCerror("Opening "+dir$+CHR$0)
16030   LD%=OPENIN(dir$+"."+item$+CHR$0)
16040   linkdir$=""
16050   REPEAT
16060   LD$=CHR$(BGET#LD%)
16070   IF (ASC(LD$)>31) linkdir$+=LD$
16080   UNTIL ASC(LD$)<32 OR EOF#LD%
16090   CLOSE#LD% 
16100   REM What type is the linkdir?
16110   $bootstring%=linkdir$+CHR$0
16120   IF (FNCheckValidDrive(linkdir$) =1) THEN
16130    SYS "XOS_File",5,bootstring% TO linktype%
16140    IF (LEFT$(item$,1)="!" OR linktype%<>2) THEN
16150     REM Must be either a file or app or dir so let's boot it
16160     REM If directory, only boot if begin with a ! (Save time)
16170     IF (recurseaction%=RECURSE_BOOT%) THEN
16180       $clistring = "Filer_Boot "+linkdir$+CHR$0
16190       SYS "XOS_CLI", clistring
16200     ENDIF
16210     IF (recurseaction%=RECURSE_RUN%) THEN
16220       $clistring = "Filer_Run "+linkdir$+CHR$0
16230       SYS "XOS_CLI", clistring
16240     ENDIF
16250    ENDIF
16260    ELSE
16270    REM Remove this link
16280    IF (filetype%=&af3) THEN
16290REM    PROCerror("Deleting "+dir$+"."+item$+CHR$0)
16300    OSCLI("delete "+dir$+"."+item$+CHR$0)
16310    ENDIF
16320    
16330   ENDIF
16340 ENDIF
16350ENDIF
16360
16370REM Enable user to carry on during bootup and
16380REM trap any unwanted links that are generated at bootup
16390PROCpoll
16400PROCpoll
16410PROCpoll
16420
16430ENDWHILE
16440ENDPROC
16450
16460REM ***********************************************
16470
16480DEFFNCheckValidDrive(isvpath$)
16490LOCAL fs_drive$, pptr%, char$, a%
16500REM Check that isvpath$ resides on a valid file system
16510REM and a valid drive.
16520REM If not then return 0 else return 1
16530pptr%=1
16540fs_drive$=""
16550REPEAT
16560char$=MID$(isvpath$,pptr%,1)
16570IF (char$<>".") fs_drive$=fs_drive$+char$
16580pptr%=pptr%+1
16590UNTIL (pptr%>LEN(isvpath$) OR char$=".")
16600REM Check fs_drive$ with all currently invalid devices
16610a%=0
16620WHILE(a%<InvalidDriveCount%)
16630IF (fs_drive$=InvalidDrive$(a%)) a%=InvalidDriveCount%+1
16640a%+=1
16650ENDWHILE
16660REM return if it matches an invalid drive
16670IF (a%>InvalidDriveCount%) THEN =0
16680REM Is this device valid?
16690$clistring=fs_drive$+CHR$0
16700SYS"XOS_File",5,clistring TO result%
16710IF (result%<=8192) THEN
16720 REM This is a valid drive
16730 =1
16740ENDIF
16750REM Update list of invalid drives
16760InvalidDrive$(InvalidDriveCount%) = fs_drive$
16770InvalidDriveCount%+=1
16780=0
16790
16800REM ***************************************
16810REM Return first line of the given file
16820REM ***************************************
16830DEFFNGetLinkContents(glinkfilename$)
16840LOCAL linkdir$,LD%
16850   LD%=OPENIN(glinkfilename$+CHR$0)
16860   linkdir$=""
16870   REPEAT
16880   LD$=CHR$(BGET#LD%)
16890   IF (ASC(LD$)>31) linkdir$+=LD$
16900   UNTIL ASC(LD$)<32 OR EOF#LD%
16910   CLOSE#LD%
16920   =linkdir$
16930
16940REM **************************************
16950REM Click on shortcut menu list
16960REM **************************************
16970DEFPROCshortcutmenuselect
16980LOCAL currentmenuptr%,lastmenuptr%,dir$,linkdir$,dropdir$,currentdropdir$,leaf$
16990LOCAL droppardir$,parent$
17000LOCAL ReOpenFlag%
17010LOCAL IconFlagsAddr%
17020LOCAL prefix$,IsLinkDirectory%,IsGreyedOut%
17030LOCAL LeftAlt%, RightAlt%,ThisIsWriteable%,RebuildLastSubMenu%
17040LOCAL AddWriteableFlag%
17050
17060AddWriteableFlag%=0
17070IsGreyedOut%=0
17080IsLinkDirectory%=0
17090LeftAlt%=0:RightAlt%=0:ThisIsWriteable%=0:RebuildLastSubMenu%=0
17100IF INKEY-6 LeftAlt%=1
17110IF INKEY-9 RightAlt%=1
17120
17130REM PROCerror("Clicked on shortcut menu - blaj"+CHR$0)
17140
17150ReOpenFlag%=FALSE
17160dir$=AppPath$+".Users."+User$+".Links"
17170dropdir$=dir$
17180droppardir$=dir$
17190parent$=User$
17200leaf$=User$
17210currentdropdir$=dir$
17220currentmenuptr%=shortcutmenu%
17230lastmenuptr%=currentmenuptr%
17240globalmenuptr%=shortcutmenu%
17250REM block%+00 is selection number of menu,
17260nestlevel%=0
17270sel1%=block%!nestlevel%
17280
17290REM Recurse menu directory pointers until selection found
17300REPEAT
17310selection%=block%!(nestlevel%*4)
17320nextselection%=block%!((nestlevel%+1)*4)
17330REMPROCerror("Menu Selection = "+STR$(selection%)+CHR$0)
17340REM Get pointer to icon definition from menu definition
17350submenuptr%=!(currentmenuptr%+28+(selection%*24)+4)
17360dataptr%=!(currentmenuptr%+28+(selection%*24)+12)
17370parent$=leaf$
17380leaf$=FNstring(dataptr%)
17390ItemFlags% = !(currentmenuptr%+28+(selection%*24))
17400REM Is this a system file name? not writeable ... )
17410IF (nestlevel%=0 AND (ItemFlags% AND 4)=0) THEN
17420 prefix$=""
17430 IF (selection%>=StartMenuSeperator% AND StartMenuSeperator%>=0) prefix$=CHR$(SysFilePrefix%)
17440 IF (selection%>=StartMenuSeperator2% AND StartMenuSeperator2%>=0) prefix$ = CHR$(SysFilePrefix%)+CHR$(SysFilePrefix%)
17450 IF (selection%>=StartMenuSeperator3% AND StartMenuSeperator3%>=0) prefix$ = ""
17460 leaf$=prefix$+leaf$
17470ENDIF
17480REM Construct path to object
17490currentdropdir$=dropdir$
17500IF (selection%<>-1) THEN
17510 dir$=dir$+"."+leaf$
17520 IF (nextselection%<>-1) THEN
17530  droppardir$=droppardir$+"."+leaf$
17540  IF (submenuptr%<>-1) lastmenuptr%=submenuptr%
17550  ELSE
17560  REM nextselection=-1 so Must be at selected item of last menu
17570  IF (submenuptr%<>-1) IsLinkDirectory%=1
17580  IconFlagsAddr%=currentmenuptr%+28+8+(selection%*24)
17590  IF (!IconFlagsAddr%=&3000313) IsGreyedOut%=1:REM PROCerror("Is greyed out!"+CHR$0)    
17600 ENDIF
17610 nestlevel%+=1
17620 REM Is this menu entry a pointer to a submenu?
17630 IF (submenuptr%<>-1) THEN
17640  dropdir$=dropdir$+"."+leaf$
17650  currentmenuptr%=submenuptr%
17660 ENDIF
17670ENDIF
17680UNTIL nextselection%=-1
17690submenuptr%=!(currentmenuptr%+28+(selection%*24)+4)
17700nestlevel%-=1
17710
17720REMPROCerror("Clicked on "+leaf$+"["+STR$nestlevel%+"] in directory "+droppardir$+CHR$0)
17730REM Is this menu item writeable?
17740REM If so, create a new directory out of the "writings"
17750ItemFlags% = !(lastmenuptr%+28+(selection%*24))
17760IF ((ItemFlags% AND 4)=4) THEN
17770REM PROCerror("Selection:"+STR$selection%+" At level:"+STR$nestlevel%+" Writable ... ItemFlags="+STR$~ItemFlags%+CHR$0)
17780 REM Create new directory
17790 OSCLI("CDIR "+dropdir$+"."+leaf$+CHR$0)
17800 REM Rebuild last sub menu
17810 RebuildLastSubMenu%=1
17820 ReOpenFlag%=TRUE
17830 
17840 ELSE
17850
17860 IF (addlink%=1) THEN
17870  REM PROCerror("Adding shortcut["+newlinkleaf$+"] into "+dropdir$+CHR$0)
17880  PROCaddnewshortcut(currentdropdir$,newlinkfile$,newlinkleaf$)
17890  REM Rebuild last sub menu
17900  RebuildLastSubMenu%=1
17910  ReOpenFlag%=TRUE
17920 ENDIF
17930
17940 IF (addlink%=0) THEN 
17950  REM Should we insert a writeable something into this menu?
17960  IF (LeftAlt%<>0) THEN
17970REM  PROCerror("Inserting a writeable icon into level:"+STR$nestlevel%+CHR$0)
17980   AddWriteableFlag%=1
17990   RebuildLastSubMenu%=1
18000  
18210   ReOpenFlag%=TRUE
18220  ENDIF
18230 
18240  REM Is the Right ALT key pressed?
18250  REM If so delete this link LALT(-6) RALT(-9) L/R ALT(-3)
18260  IF (RightAlt%<>0 AND IsLinkDirectory%=0 AND IsGreyedOut%=0) THEN
18270   REM PROCerror("Deleting link "+dir$+CHR$0)
18280   OSCLI("delete "+dir$+CHR$0)
18290   REM Alter menu structure
18300   IconFlagsAddr%=currentmenuptr%+28+8+(selection%*24)
18310   !IconFlagsAddr% = (!IconFlagsAddr%)+(2^22):REM Grey out sprite
18320   !IconFlagsAddr% = !IconFlagsAddr% AND &ffffff:REM Grey out
18330   !IconFlagsAddr% = !IconFlagsAddr%+&1000000:REM text
18340   REM RebuildLastSubMenu%=1
18350   ReOpenFlag%=1
18360  ENDIF
18370  
18380  REM Should we delete this directory of links?
18390  IF (RightAlt%<>0 AND IsLinkDirectory%=1 AND IsGreyedOut%=0) THEN
18400   REM PROCerror("Deleting directory "+dir$+CHR$0)
18410   $string% = "delete "+dir$+CHR$0
18420   SYS "XOS_CLI",string% TO ; ErrorFlag%
18430   IF (ErrorFlag% AND 1) PROCerror("Error removing "+dir$+". The directory may not be empty."+CHR$0)
18440   REMOSCLI("delete "+dir$+CHR$0)
18450   REM Alter menu structure
18460   IconFlagsAddr%=currentmenuptr%+28+8+(selection%*24)
18470   REM  PROCerror("Flags:"+STR$~(!IconFlagsAddr%)+CHR$0)
18480   REM !IconFlagsAddr% = (!IconFlagsAddr%)+(2^22):REM Grey sprite
18490   REM !IconFlagsAddr% = !IconFlagsAddr% AND &ffffff:REM Grey out
18500   REM !IconFlagsAddr% = !IconFlagsAddr%+&1000000:REM text
18510   RebuildLastSubMenu%=1
18520   ReOpenFlag%=1   
18530  ENDIF
18540 
18550  REM Is this runnable?
18560  REM PROCerror("submenu="+STR$submenuptr%+" Dir?:"+STR$IsLinkDirectory%+CHR$0)
18570  IF (LeftAlt%=0 AND RightAlt%=0 AND IsLinkDirectory%=0 AND IsGreyedOut%=0) THEN
18580   REM Get the desktop filer to run this link
18590   dir$="Filer_Run "+FNGetLinkContents(dir$)
18600   REM PROCerror("* "+dir$+CHR$0)
18610   REM PROCerror("OSCLI "+dir$+CHR$0)
18620   OSCLI(dir$+CHR$0)
18630  ENDIF
18640 ENDIF:REM IF adlink%=0 ...
18650ENDIF:REM IF writeable ...
18660
18670REM Check if ADJUST pressed in which case, reprint menus.
18680SYS"Wimp_GetPointerInfo",,block2%
18690button%=block2%!8
18700IF button%=1 ReOpenFlag%=TRUE
18710
18720IF (RebuildLastSubMenu%) THEN
18730REM PROCerror("Rebuilding submenu '"+parent$+"' from "+droppardir$+" at Depth="+STR$(nestlevel%)+CHR$0)
18740PROCSingleDirectoryRead(droppardir$,parent$,nestlevel%,AddWriteableFlag%)
18750ENDIF
18760 
18770IF (ReOpenFlag%) THEN
18780 PROCshowmenu(shortcutmenu%,0,0)
18790 ELSE
18800 IconBarMenuOpen%=0:REM Reenable icon bar tooltip
18810ENDIF
18820ENDPROC
18830
18840DEFPROCclick_info(button%)
18850CASE button% OF
18860WHEN 2:CurrentMenuType%=MainMenuType%:PROCshowmenu(main_menu%,!block%-64, (block%!4)+32)
18870ENDCASE
18880ENDPROC
18890
18900DEFPROCwindowmenuselect(WindowMenuIndex%)
18910LOCAL OpenWin%, ErrorFlag%, button%
18920LOCAL WinMenuItemFlag%, Action%
18930REM block%+00 is selection number of first menu,
18940REM block%+04 is selection number of second level etc.
18950REMsel1%=!block%:sel2%=block%!4
18960sel1%=WindowMenuIndex%
18970SYS"Wimp_GetPointerInfo",,block%
18980button%=block%!8
18990REM PROCerror("["+STR$sel1%+"] Opening "+$(shortcutmenudata%+(sel1%*64))+CHR$0)
19000OpenWin%=!(shortcutmenudata%+(sel1%*64)+60)
19010!winopenblock%=OpenWin%
19020SYS"XWimp_GetWindowState",,winopenblock% TO ; ErrorFlag%
19030IF (ErrorFlag%<>0) THEN
19040 winopenblock%!28=-1
19050 Action%=0:REM Open Window
19060 IF (INKEY-1) Action%=1:REM Open parent (SHIFT)
19070 REM IF (INKEY-3) Action%=2:REM Close (ALT)
19080
19090 IF (Action%=0) THEN
19100  SYS "XWimp_SendMessage",2, winopenblock%,OpenWin%
19110 ENDIF
19120 
19130 IF (Action%=1) THEN
19140  SYS "XWimp_SendMessage",3, winopenblock%,OpenWin%
19150 ENDIF
19160 
19170  IF (Action%=2) THEN
19180   !winopenblock%=OpenWin%
19190   SYS "XWimp_CloseWindow",,winopenblock%
19200   REM Grey out this menu entry
19210   WinMenuItemFlag% = !(shortcutmenu%+28+(sel1%*24)+8)
19220   WinMenuItemFlag% = WinMenuItemFlag% OR &400000 
19230   !(shortcutmenu%+28+(sel1%*24)+8) = WinMenuItemFlag%
19240  ENDIF
19250  
19260ENDIF
19270
19280REM Check if ADJUST pressed in which case, reprint menus.
19290IF button%=1 THEN
19300PROCshowmenu(shortcutmenu%,0,0)
19310CurrentMenuType% = WindowListMenuType%
19320ELSE
19330REM SYS"Wimp_CreateMenu",,-1
19340IconBarMenuOpen%=0:REM Reenable icon bar tooltip
19350ENDIF
19360
19370ENDPROC
19380
19390DEFPROCmainmenuselect
19400REM block%+00 is selection number of first menu,
19410REM block%+04 is selection number of second level etc.
19420sel1%=!block%:sel2%=block%!4
19430SYS"Wimp_GetPointerInfo",,block%
19440button%=block%!8
19450CASE sel1% OF
19460WHEN 0:PROCOpenInfoBox
19470WHEN 1:PROCClickToolMenu(sel2%)
19480WHEN 2:PROCerror("Sorry, TODO."+CHR$0):REM PROCClickUserMenu
19490WHEN 3:PROCClickHelpButton
19500WHEN 4:PROCToggleAdvancedMenus
19510WHEN 5:PROCcascade
19520WHEN 6:PROCShowTree
19530WHEN 7:quit%=TRUE
19540ENDCASE
19550REM Check if ADJUST pressed in which case, reprint menus.
19560IF button%=1 THEN
19570PROCshowmenu(main_menu%,0,0)
19580ELSE
19590IconBarMenuOpen%=0:REM Reenable icon bar tooltip
19600ENDIF
19610ENDPROC
19620
19630DEFPROCClickHelpButton
19640OSCLI("Filer_Run <xuenbs$dir>.!help")
19650ENDPROC
19660
19670DEFPROCClickToolMenu(sel2%)
19680CASE sel2% OF
19690WHEN 0:PROCclear
19700WHEN 1:PROCsmash
19710WHEN 2:PROCOpenLinks
19720WHEN 3:PROCSaveSpritePools
19730ENDCASE
19740ENDPROC
19750
19760DEFPROCSaveSpritePools
19770OSCLI("Filer_Run "+AppPath$+".Resources.GetSprites"+CHR$0)
19780ENDPROC
19790
19800DEFPROCsmash
19810OSCLI("Filer_Run "+AppPath$+".Resources.SmashClose"+CHR$0)
19820ENDPROC
19830
19840DEFPROCOpenLinks
19850OSCLI("Filer_Opendir "+AppPath$+".Users."+User$+".Links"+CHR$0)
19860ENDPROC
19870
19880DEFPROCshowmenu(menu%,mx%,my%)
19890SYS"Wimp_CreateMenu",,menu%,mx%,my% TO currentmenuhandle%
19900ENDPROC
19910
19920REM ***************************************************
19930
19940DEFPROCShowTree
19950!block% = whandle_tree%
19960block%!4 = 64
19970block%!8 = 64
19980block%!12 = 1024
19990block%!16 = 912
20000block%!20 = 0
20010block%!24 = 0
20020block%!28 = -1
20030SYS"Wimp_OpenWindow",,block%
20040
20050REM PROCerror("Sorry, TODO."+CHR$0)
20060ENDPROC
20070
20080REM ***************************************************
20090
20100DEFPROCToggleAdvancedMenus
20110LOCAL flag%
20120GlobalShowBootMenuFlag% = GlobalShowBootMenuFlag% EOR 1
20130flags%=!(main_menu%+28+(4*24))
20140flags% = flag% EOR (GlobalShowBootMenuFlag%<<0)
20150REM PROCerror("Flags = "+STR$~(flags%)+CHR$0)
20160!(main_menu%+28+(4*24))=flags%
20170ENDPROC
20180
20190REM ***************************************************
20200
20210
20220REM Tell WIMP to initialise a new menu.
20230REM This should really be done by loading in a MENU template.
20240DEFPROCsetupmenu(menu%)
20250READ title$,num%:$menu%=title$
20260width%=(LEN(title$)-2)*16
20270menu%!12=&00070207:menu%!20=44:menu%!24=0
20280ptr%=menu%+28:FOR i%=1TOnum%
20290READ mflags%,subptr%,item$
20300!ptr%=mflags%:ptr%!4=subptr%
20310ptr%!8=&7000021:$(ptr%+12)=item$
20320a%=(LEN(item$)+1)*16
20330IF a%>width% width%=a%
20340ptr%+=24:NEXT
20350menu%!16=width%
20360ENDPROC
20370
20380REM ***************************************************
20390
20400DEFPROCinit
20410REM Do ~~Open and ~~Close files exist? If not, create empty
20420REM copies of them to prevent !Start crashing.
20430
20440PROCensuredir(AppPath$+".Users")
20450PROCensuredir(AppPath$+".Users."+User$)
20460PROCensuredir(AppPath$+".Users."+User$+".Links")
20470PROCensuredir(AppPath$+".Users."+User$+".Links")
20480PROCensuredir(AppPath$+".Users."+User$+".Links.~~Boot")
20490PROCensuredir(AppPath$+".Users."+User$+".Links.~~Run")
20500PROCensuredir(AppPath$+".Users."+User$+".Links.~~RunQuit")
20510
20520$string%=AppPath$+".Users."+User$+".~~Open"
20530SYS"OS_File",17,string% TO result%
20540IF (result%=0) THEN X%=OPENOUT(AppPath$+".Users."+User$+".~~Open"):CLOSE#X%
20550$string%=AppPath$+".Users."+User$+".~~Close"
20560SYS"OS_File",17,string% TO result%
20570IF (result%=0) THEN X%=OPENOUT(AppPath$+".Users."+User$+".~~Close"):CLOSE#X%
20580
20590SYS "Wimp_Initialise",200,&4B534154,app$ TO current_wimp_version%,task_handle%
20600
20610REM Create INFO window
20620!infodata% = 0: infodata%!4 = 0
20630infodata%!8 = 642: infodata%!12 = 212
20640infodata%!16 = 0: infodata%!20 = 0
20650infodata%!24 = -1:REM Top
20660infodata%!28 = 1+2+16+64
20670infodata%!32 = &01090207
20680infodata%!36 = &000C0103
20690infodata%!40 = 0: infodata%!44 = 0
20700infodata%!48 = 642: infodata%!52 = 212
20710infodata%!56 = %111000000000000000000011001
20720infodata%!60 = 0
20730infodata%!64 = 1
20740infodata%!68 = 0
20750$(infodata%+72) = "Info"
20760infodata%!84=0:REM No icons yet ...
20770REM Create INFO icon block ...
20780tptr%=infodata%+88
20790tptr% = FNAddIcon(8,164, 642-156,40, "Xuen",tptr%,infodata%+84,0)
20800tptr% = FNAddIcon(8,112, 642-156,40, "Desktop Tool",tptr%,infodata%+84, 0)
20810tptr% = FNAddIcon(8,60, 642-156,40, "Barny Short", tptr%, infodata%+84, 0)
20820tptr% = FNAddIcon(8,8, 642-156,40, appversion$+" May-98", tptr%, infodata%+84, 0)
20830tptr% = FNAddIcon(642-136,8, 128,212-16,"!xuen",tptr%,infodata%+84,1)
20840SYS"Wimp_CreateWindow",,infodata% TO whandle_info%
20850
20860
20870REM Create TREE window
20880!infodata% = 0: infodata%!4 = 0
20890infodata%!8 = FilerViewW%: infodata%!12 = FilerViewH%
20900infodata%!16 = 0: infodata%!20 = 0
20910infodata%!24 = -1:REM Top
20920infodata%!28 = 1+2+16+64+(1<<2)+(1<<3)
20930infodata%!32 = &01090207
20940infodata%!36 = &000C0103
20950infodata%!40 = 0: infodata%!44 = 0
20960infodata%!48 = FilerViewW%: infodata%!52 = FilerViewH%
20970infodata%!56 = %111000000000000000000011001
20980infodata%!60 = 0
20990infodata%!64 = 1
21000infodata%!68 = 0
21010$(infodata%+72) = "Filer Tree"
21020infodata%!84=0:REM No icons yet ...
21030REM Create INFO icon block ...
21040tptr%=infodata%+88
21050tptr% = FNAddIcon(144,(FilerViewH%/4)*3, 642-156,40, "A",tptr%,infodata%+84,0)
21060tptr% = FNAddIcon(144,(FilerViewH%/4)*2, 642-156,40, "B",tptr%,infodata%+84, 0)
21070tptr% = FNAddIcon(144,FilerViewH%/4, 642-156,40, "C", tptr%, infodata%+84, 0)
21080tptr% = FNAddIcon(144,8, 642-156,40, "D", tptr%, infodata%+84, 0)
21090tptr% = FNAddIcon(8,8, 128,212-16,"!xuen",tptr%,infodata%+84,1)
21100SYS"Wimp_CreateWindow",,infodata% TO whandle_tree%
21110
21120
21130
21140REM Create toolbox menu
21150RESTORE 21360
21160PROCsetupmenu(tool_menu%)
21170REM Create main menu
21180RESTORE 21260
21190PROCsetupmenu(main_menu%)
21200REM Install an icon on the icon bar using the shortcut icon
21210iconbarhandle%=FNcreate_icon(-2,0,-16,84,106,&1700310B,"!xuen",iconbarlabel%,iconbardata%,32)
21220ENDPROC
21230
21240REM ***************************************************
21250
21260DATA "Xuen",8
21270DATA 0,whandle_info%,"Info"
21280DATA 0,tool_menu%,"Toolbox"
21290DATA 0,-1,"User"
21300DATA 0,-1,"Help"
21310DATA 0,-1,"Advanced"
21320DATA 0,-1,"Cascade"
21330DATA 2,-1,"Tree"
21340DATA &80,-1,"Quit"
21350
21360DATA "Toolbox",4
21370DATA 0,-1,"Clean"
21380DATA 0,-1,"SmashnClose"
21390DATA 0,-1,"Edit Links"
21400DATA &80,-1,"SaveSprites"
21410
21420REM ********************************************************
21430  

5� ***********************************************
� Name    : Xuen
5� Purpose : Make RiscOS Desktop more efficient(!)
(� Author  : Barny Short
2� Date    : 30-May-1998
<5� ***********************************************
Fappversion$="11.0"
P5� ***********************************************
Z
dGlobalErrorState%=0
n>RandomToolTip%=1:� Enable(=1)/Disable(=0) random tool tips
x'� � �error(�$+" at line "+Þ):�#0:�
�
��ON ERROR GOTO@@@@
�
�%ț "<Obey$Dir>.Resources.Libs.OS"
�(ț "<Obey$Dir>.Resources.Libs.Filer"
�'ț "<Obey$Dir>.Resources.Libs.Wimp"
�*ț "<Obey$Dir>.Resources.Libs.Tooltip"
�
� PictureType%=&d94:� Artworks
�,DocumentType%=&bc5:� Impression Document
�.User$="Admin":� Default User name is Admin
�
�app$="Xuen"
AppPath$=""
AppDate$=""
/� apppath 255, apppathvar 32, appdatevar 32
"*$appdatevar="<Sys$Time> <Sys$Date>"+�0
,!$apppathvar="<Xuenbs$Dir>"+�0
6
@8� Aquire the start path to use for delete operations
J)È™"OS_GSTrans",apppathvar,apppath,255
TAppPath$=�string(apppath)
^
h
r@� errorblock% 2048, block% 2048, block2% 2048, clistring 255
|J� winblock% 2048, winopenblock% 2048, transblock% 2048, ptrblock% 2048
�� unknownstring% 32
�&$unknownstring% = "unknown_app"+�0
�
�� InvalidDrive$(255)
�InvalidDriveCount%=0
�
�-� dragspritename% 256, boundspritebox% 32
�
�
� � Auto link buffer add stuff
�alba_destinationdir$=""
�-alba_type%=-1:� -1 means nothing in cache
�alba_newlinkfile$=""
alba_newlinkleaf$=""
alba_time%=0

&CACHE_SIZE% = 4096
0pause% = 200
:open_type%=1
Dclose_type%=2
Nadd_window%=1
Xsubtract_window%=2
bdrag_type%=5
l
adjust%=1
vmenu%=2
�
select%=4
�iconbarhandle%=0
�dircount%=0
�linkloadaddr%=0
�objecttype%=0
�linkmenu%=0
�addlink%=0
�)iconbar_timer%=�:iconbar_timerflag%=0
�2whandle_tooltip%=0:ToolTip%=0:tooltip_timer%=0
�%override_tooltip%=0:OldToolTip%=0
�whandle_tree%=0
�internalstackposition%=-2
�oldstackposition%=0
currentwindow%=0
currentmenuhandle%=0
firstmenuhandle%=-3
 IconBarMenuOpen%=0
*StartMenuSeperator%=-1
4StartMenuSeperator2%=-1
>StartMenuSeperator3%=-1
HSysFilePrefix%=126
RBottomEdgeFlag=0
\after%=0
fwhandle_dummyback%=0
pLastRightEdge%=0
zCascadeRow%=0
�CurrentButton%=0
�tptr%=0
�
�� Filer tree related stuff
�FilerViewW% = 642
�FilerViewH% = 512
�
�GlobalMenuItemCount%=0
�GlobalMenuSepCount%=0
�GlobalToolTip$=""
�GlobalState% = 0
�GlobalStatePreBoot% = 0
�GlobalStatePostBoot% = 1
GlobalStateIdle% = 2
GlobalStateShutDown% = 3
GlobalStep% = 0
$GlobalShowBootMenuFlag%=0
.RECURSE_BOOT% = 1
8RECURSE_RUN% = 2
B
L0� Insert your choice of random tooltips here
V3RandTipMax%=5:� Total number of random tooltips
`� RandTip$(RandTipMax%)
jDRandTip$(1)="If it's getting complicated, you're doing it wrong"
t-RandTip$(2)="You use computers too much!"
~ RandTip$(3)="Hablo espanol!"
�.RandTip$(4)="Have you read Dilbert today?"
�!RandTip$(5)="Take your vits!"
�
�IconBarAnimSize%=6
�$� IconBarAnim$(IconBarAnimSize%)
�IconBarAnim$(0)="Sxuen0"
�IconBarAnim$(1)="Sxuen30"
�IconBarAnim$(2)="Sxuen60"
�IconBarAnim$(3)="Sxuen90"
�IconBarAnim$(4)="Sxuen120"
�IconBarAnim$(5)="Sxuen150"
�IconBarAnimStep=0
IconBarAnimDir=0.5


WindowListIcon%=-1
WindowListTimer%=0
(
2MaxWindowListSize%=64
<WindowListSize%=0
F)� WindowListName$(MaxWindowListSize%)
P+� WindowListHandle%(MaxWindowListSize%)
Z
dCurrentMenuType%=0
nMainMenuType% = 0
xWindowListMenuType% = 1
�ShortCutMenuType% = 2
�
�MenuIsOpenFlag%=0
�
�Q� dblock% 1024, bootblock% 1024, shortcutmenu% 16000, shortcutmenudata% 20384
�U� main_menu% 256, tool_menu% 256, typebuf% 256, iconbarlabel% 32, iconbardata% 32
�Y� string% 1024, bootstring% 1024, infodata% 2048, tooltipdata% 2048, tooltipicon% 512
�� cache% CACHE_SIZE%
�� dirlist%(32), dirptr%(32)
�
�cache_ext%=0
�task_handle%=0
�drag_button%=adjust%
	DX%=0
drag_icon%=0
path$=""
"in_leftregion=�
,in_rightregion=�
6qf_timer=�
@regionxs%=16
Jregionys%=64
T$iconbarlabel%=""+�0
^$iconbardata%="S!xuen"+�0
h globalmenuptr%=shortcutmenu%
r
|$$iconbardata%=IconBarAnim$(0)+�0
�
�
�9� ***************************************************
�
�quit%=�
�
�ș"Hourglass_On"
�	�init
�.� PROCerror("Xuen path = "+AppPath$+CHR$0)
��GetScreenSize
��CreateToolTip
��loadcache
�ș"Hourglass_Off"

?� If ALT is pressed then skip auto booting/loading anything
� �(�-3) �
&O �RecurseDirectory(AppPath$+".Users."+User$+".Links.~~Boot", RECURSE_BOOT%)
0X � �(quit%) �RecurseDirectory(AppPath$+".Users."+User$+".Links.~~Run", RECURSE_RUN%)
:& GlobalState%=GlobalStatePostBoot%
DS � �(quit%) �RecurseDirectory(AppPath$+".Users."+User$+".Links", RECURSE_BOOT%)
N�
X
b!GlobalState%=GlobalStateIdle%
l
vȕ � quit%
�	�poll
��
�
�"� Ensure all buffers are empty
��alba_purge(0)
�%GlobalState%=GlobalStateShutDown%
�'� Reset quit to enable another quit
�0� during program shutdown to be detected ...
�quit%=�
�P�RecurseDirectory(AppPath$+".Users."+User$+".Links.~~RunQuit", RECURSE_RUN%)
��DestroyToolTip
�ș "Wimp_CloseDown"
��

� Error handler
!�error(�$+" at line "+Þ):�#0
 GlobalErrorState%+=1
* � GlobalErrorState%=1 � �thG
4 � GlobalErrorState%=2 � �dnG
>5� Multiple errors have occured - die ungracefully
H�
R
\9� ***************************************************
f
p
��GetDate
z� Aquire date and time
�)ș"OS_GSTrans",appdatevar,apppath,255
�AppDate$=�string(apppath)
��
�
�9� ***************************************************
�
�� poll loop
�
��poll
�$ș"Wimp_Poll",0,block% � reason%
�2� IF reason%<>0 PROCerror(STR$(reason%)+CHR$0)
�Ȏ reason% �
�� 0:�null_reason
�� 2:�PollReason2
	%� 3:ș "Wimp_CloseWindow",,block%
	� 6:�click(block%!12)
	� 7:�dragdrop
	$�WHEN 8:PROCkeypressed
	.� 9:�menuselect
	8� 17,18:�receive(reason%)
	B9� WHEN 19:PROCerror("Unsupported window definition.")
	L�
	V�
	`
	j9� ***************************************************
	t
	~��PollReason2
	�� ((!block%) >= OS_MX%) �
	�X� PROCerror("Window tobeopened:"+STR$~(!block%)+"  behind: "+STR$~(block%!28)+CHR$0)
	� ș "Wimp_OpenWindow",,block%
	��
	�.�currentwindow%=!block%:PROCOpenToolTip(2)
	�A� This is very wierd - the windowhandle is invalid and equals
	�?� the mouse pointer x position - must be a menu I reckon or
	�� could be a bug in RISCOS.
	�MenuIsOpenFlag%=1
	��
	�
	��


��GetScreenSize
3ș"OS_ReadModeVariable",-1,4 � ,,OS_EX%:� Eigen
+ș"OS_ReadModeVariable",-1,5 � ,,OS_EY%
(3ș"OS_ReadModeVariable",-1,11 � ,,OS_WX%:� Size
2,ș"OS_ReadModeVariable",-1,12 � ,,OS_WY%
<OS_MX%=(1+OS_WX%) << OS_EX%
FOS_MY%=(1+OS_WY%) << OS_EY%
P�
Z
d�DEFPROCkeypressed
n�LOCAL Char%
x�Char%=block%!24
�=�IF Char%=&1CD PROCerror("Insert pressed on icon "+CHR$0)
�-�REM Is this the delete or backspace key?
�#�IF (Char%=8 OR Char%=&7f) THEN
��REM Is this in a menu?
�^�PROCerror("Window handle = "+STR$~(block%!0)+" -- main_menu% = "+STR$~(main_menu%)+CHR$0)
�	�ELSE
� �SYS "Wimp_ProcessKey",Char%
�
�ENDIF
��ENDPROC
�
���ReopenDummyWindow
�  !block2%=whandle_dummyback%
�% ș"Wimp_GetWindowState",,block2%
% block2%!8=-1024:block2%!16=-1024
 block2%!28=-2
" È™"Wimp_OpenWindow",,block2% 
" after%=whandle_dummyback%
, � MenuIsOpenFlag%=0
6 
@ 
J  WindowListSize%=0
T�
^
h
��cascade
r� q%,OldAfter%,after%
|� sx%, sy%, ox%, oy%
�)� ReopenFlag%, StackFlag%, ValidFlag%
�-� PaneFlag%, IsOpenFlag%, IsMoveableFlag%
�� CurrentWin%,CurrentIcon%
�� n%
�
��BuildWindowList
�
�cascade%=0
�LastRightEdge%=0
�CascadeRow%=0
�
�$ș"Wimp_GetPointerInfo",,block2%
�CurrentWinPtr%=block2%!12
CurrentIcon%=block2%!16

� WindowListSize%=0 �
&
0�n%=0 � (WindowListSize%-1)
: q%=winblock%
D PaneFlag%=�
N3 � Get Current window immediately under pointer
X( CurrentWin% = WindowListHandle%(n%)
b !q%=CurrentWin%
l. � Try and cascade this desktop window ...
v! È™ "Wimp_GetWindowState",,q%
� 
�
 q%!28=-1
� 
� � Reposition window
� PaneFlag%=�
�2 � (((q%!32) � ((2^22)+(2^23)))>0) PaneFlag%=�
�& � (((q%!32) � 32)=32) PaneFlag%=�
�% IsOpenFlag% = ((q%!32) � (2^16))
�$ IsMoveableFlag% = ((q%!32) � 2)
�
� ReopenFlag%=�
� StackFlag%=�
� ValidFlag%=�

 

 � (StackFlag%=�) �

  ox%=q%!4

   oy%=q%!16

*  sx%=(q%!12)-(q%!4)

4  sy%=(q%!16)-(q%!8)

>  

H<  � Try and fit as many windows horizontally as possible

R,  � ((LastRightEdge%+sx%)<(OS_MX%-40)) �

\   q%!4=LastRightEdge%

f0   q%!16=(OS_MY%-40)-(CascadeRow%*40):� 1160

p   q%!12=(q%!4)+sx%

z0   � ((q%!12)>(OS_MX%-40)) q%!12=(OS_MX%-40)

�   q%!8=(q%!16)-sy%

�   � ((q%!8)<40) q%!8=40

�    LastRightEdge%=(q%!12)+48

�   �

�   LastRightEdge%=0

�   CascadeRow%+=1

�   q%!4=(CascadeRow%*8)

�0   q%!16=(OS_MY%-40)-(CascadeRow%*40):� 1160

�   q%!12=(q%!4)+sx%

�0   � ((q%!12)>(OS_MX%-40)) q%!12=(OS_MX%-40)

�   q%!8=(q%!16)-sy%

�   � ((q%!8)<40) q%!8=40

�    LastRightEdge%=(q%!12)+48
  �

3  � Having allowed space for this window in the
$3  � window cascade, are we sure we want to move
.  � it just yet?
8  � (ReopenFlag%=�) �
B.   È™ "XWimp_SendMessage",2,q%,CurrentWin%
L  �    
V  cascade%+=1  
`  �:� End of IF StackFlag ...
j� n%
t�
~
�3� *********************************************
�3� * Animate the icon bar icon                 *
�3� *********************************************
���AnimateIconBar
�/$iconbardata%=IconBarAnim$(IconBarAnimStep)
�#IconBarAnimStep+=IconBarAnimDir
�>� (IconBarAnimStep<0 � IconBarAnimStep=IconBarAnimSize%) �
�IconBarAnimStep=0
�)�  IconBarAnimDir = IconBarAnimDir*-1
�%� IconBarAnimStep+=IconBarAnimDir
��
�3� Activate an update on the task bar icon .....
!block2%=-2

block2%!4=iconbarhandle%
"È™"Wimp_GetIconState",,block2%
(block2%!8=0:� Don't change anything,
(,block2%!12=0:� Just signal an update ...
2<� Insert the relevant word depending on system state ...
<?� (GlobalState%<GlobalStateIdle%) $iconbarlabel%="Zz..."+�0
FM� (GlobalState%=GlobalStateIdle%) $iconbarlabel%="     "+�0:� User$+CHR$0
PC� (GlobalState%=GlobalStateShutDown%) $iconbarlabel%="Bye.."+�0
ZGlobalStep%+=1
d"È™"Wimp_SetIconState",,block2%
n�
x
�3� *********************************************
�� Idle WIMP poll
�3� *********************************************
���null_reason
�#� window%,icon%,wlicon%,button%
�
�&ș"Wimp_GetPointerInfo",,ptrblock%
�X%=ptrblock%!0
�Y%=ptrblock%!4
�button%=ptrblock%!8
�window%=ptrblock%!12
�icon%=ptrblock%!16
�currentwindow%=window%

A� (CurrentMenuType% = WindowListMenuType% � (button% �7)>0) �
0 � (window%=currentmenuhandle% � icon%>=0) �
"  wlicon% = icon% �3
,$  � (wlicon%<>WindowListIcon%) �
61   WindowListIcon%=wlicon%:WindowListTimer%=�
@  �
J$  � (�>(WindowListTimer%+200)) �
T   � Open this window
^!   �windowmenuselect(wlicon%)
h6�   IF ((button% AND7)=4) SYS"Wimp_CreateMenu",,-1
rN   � PROCerror("Icon handle = "+STR$(icon% DIV3)+" ("+STR$icon%+")"+CHR$0)
|   WindowListIcon%=-1
�  �
�  
�  �
�  WindowListIcon%=-1
� �
� �
� WindowListIcon%=-1
��
�
�%� Purge the buffer once every 10s
��alba_purge(1000)
��AnimateIconBar
�%� (ToolTip%=1) �UpdateToolTipTime

(� This may be needed to stop flicker
� *fx19
&=� (((ptrblock%!12)=-2 � (ptrblock%!16=iconbarhandle%))) �
0�move_overiconbar
:�
DOldToolTip%=0
N
X9�IF (((TIME-tooltip_timer%)>100) AND ToolTip%>0) THEN
b� (ToolTip%>0) �
l=� (ptrblock%!16 <> whandle_tooltip%) iconbar_timerflag%=0
v�CloseToolTip
��
��iconbar_timer%=TIME
�iconbar_timerflag%=0
��
��
�
�I� ((X%>regionxs% � X%<(OS_MX%-regionxs%)) � Y%>regionys%) �outoffocus
�� (Y%=0) �
�. � (BottomEdgeFlag=0) �pointeronbottomedge
� �
� BottomEdgeFlag=0
��
�
�

9� ***************************************************
 
*��pointeronbottomedge
4� stackposition%
>"� Make iconbar at top of stack
HBottomEdgeFlag=1
RÈ™"Wimp_ProcessKey",&1dc
\�
f
p��pointernotoniconbar
zG� (ToolTip%=0 � (ToolTip%<>0 � currentwindow%<>whandle_tooltip%)) �
�: � firstmenuhandle%=-2 firstmenuhandle%=currentwindow%
��
�
�!block%=-2
�#ș"Wimp_GetWindowState",,block%
�stackposition%=block%!28
�+� (stackposition%<>oldstackposition%) �
�@� (currentwindow%<>firstmenuhandle% � firstmenuhandle%>-2) �
�ș"Wimp_ProcessKey",&1dc
�firstmenuhandle%=-3
�!block%=-2
�#ș"Wimp_GetWindowState",,block%
�stackposition%=block%!28
$oldstackposition%=stackposition%
�
�
$�
.
8
B��outoffocus
L(� (in_leftregion) � �leaveleftregion
V*� (in_rightregion) � �leaverightregion
`qf_timer=�
j�
t
~��leaveleftregion
�in_leftregion=�
��
�
���leaverightregion
�in_rightregion=�
��
�
���focusdelay
�6� ((�-pause%)>qf_timer) � qf_timer=-1:�OpenInfoBox
��
�
���left_corner
,� (in_leftregion=�) ec_timer=�:ec_flag=�

in_leftregion=�
#� Check if windows need opening
$� (�-ec_timer>=50 � ec_flag=�) �
(�reopenfiler:ec_flag=�
2�
<
F�
P
Z��right_corner
d-� (in_rightregion=�) ec_timer=�:ec_flag=�
nin_rightregion=�
x#� Check if windows need closing
�3�IF (TIME-ec_timer>=100 AND ec_flag=FALSE) THEN
�� (ec_flag=�) �
�'�closefiler:�CloseInfoBox:ec_flag=�
��
��
�
�9� ***************************************************
�
���OpenInfoBox
�
�
�
�!block%=whandle_info%
#È™"Wimp_GetWindowState",,block%
È™"Wimp_OpenWindow",,block%
�
"
,��CloseInfoBox
6!block%=whandle_info%
@ È™"Wimp_CloseWindow",,block%
J�
T
^9� ***************************************************
h
r��init_drag(icon%)
|qf_timer=-1
�#ș"Wimp_GetPointerInfo",,block%
�ox%=block%!0
�oy%=block%!4
�block%!4=icon%
�drag_icon%=icon%
�block%!4=drag_type%
�block%!8=ox%-32
�block%!12=oy%-32
�block%!16=ox%+32
�block%!20=oy%+32
�block%!24=&80000000
�block%!28=&80000000
�block%!32=&7FFFFFFF
block%!36=&7FFFFFFF
È™"Wimp_DragBox",,block%

&� Start a sprite drag ....
03� (icon%=add_window%) $dragspritename%="yes"+�0
:7� (icon%=subtract_window%) $dragspritename%="no"+�0
D!boundspritebox%=0
Nboundspritebox%!4=0
Xboundspritebox%!8=ox%+24
bboundspritebox%!12=oy%+24
lFÈ™"DragASprite_Start",2+8+64+128,1,dragspritename%,boundspritebox%
v�
�
���dragdrop
�#ș"Wimp_GetPointerInfo",,block%
�block%!20=block%!12
�block%!24=block%!16
�block%!28=!block%
�block%!32=block%!4
�block%!36=0
�!block%=64:block%!12=0
�block%!16=1:block%!40=&fff
�$(block%+44) =""
�6ș"Wimp_SendMessage",18,block%,block%!20,block%!24
�
"� Cancel a sprite drag .......
È™"DragASprite_Stop"
�
 
*6� ************************************************
4-� function to deal with incoming messages
>6� ************************************************
H��receive(reason%)
Rmessage%=block%!16
\4� PROCerror("Message : &"+STR$~(message%)+CHR$0)
fȎ message% �
p� 0:quit%=�
z�� 3:�data_load_add_link:� PROCerror("DataLoad:"+FNstring(block%+44)+" Leafname:"+FNGetLeafName(block%+44)+" Type:&"+STR$~(!(block%+40))+CHR$0)
�� 2:�data_ack
�� 5:�data_open
�� 10:�desktop_ack
�� &502:�service_help
�� &400C0:�submenu_warning
�� &400C1:�GetScreenSize
�� &400C9:IconBarMenuOpen%=0
��
��
�
���service_help
�block%!12 =block%!8
�block%!16=&503
!block%=256
� (block%!32 = -2) �
� $(block%+20) ="\TXuen icon.|M\Sshow shortcuts.|MClick MENU to show options.|M\Ashow currently open window list.|MDrag and drop an icon onto the Xuen icon to install it into the shortcuts menu.|M"+�0
$, È™"Wimp_SendMessage",17,block%,block%!4
.�
87 $(block%+20) ="This is the Xuen application.|M"+�0
B, È™"Wimp_SendMessage",17,block%,block%!4
L
V�
`
j&� IF (block%!32 = main_menu%) THEN
t*� (CurrentMenuType% = MainMenuType%) �
~�� $(block%+20) ="'Advanced' option enables the boot configuration to be changed from the shortcut menu.|M'Toolbox' has some useful little programming tools such as saving the ROM and RAM spritefiles to the current directory.|M"+CHR$0
�.� SYS"Wimp_SendMessage",17,block%,block%!4
��
��
�
�=� *******************************************************
�+� User has double clicked on a fileicon
�=� Response - store a link to this file in the ~ directory
�=� *******************************************************
���data_open
�� type%, destinationdir$
�$� Flush cache if stuff in it ...
�8� (alba_type%>0 � alba_type%<>4096) � �alba_purge(0)


(alba_newlinkfile$=�string(block%+44)
-alba_newlinkleaf$=�GetLeafName(block%+44)
type%=!(block%+40)
(alba_type%=type%
2,� PROCerror("Type = "+STR$(type%)+CHR$0)
<6destinationdir$=AppPath$+".Users."+User$+".Links."
F
P
Z� (type%=4096) �
d!� Store this directory access
n?destinationdir$=destinationdir$+�(SysFilePrefix%)+"Folders"
x�
�
�� (type%=8192) �
�#� Store this application access
�@destinationdir$=destinationdir$+�(SysFilePrefix%)+"Programs"
��
�
�� (type%<4096) �
� � (type%=DocumentType%) �
�A destinationdir$=destinationdir$+�(SysFilePrefix%)+"Document"
� �
� 
� � (type%=PictureType%) �
�@ destinationdir$=destinationdir$+�(SysFilePrefix%)+"Picture"
 �

5 � (type%<>PictureType% � type%<>DocumentType%) �
"> destinationdir$=destinationdir$+�(SysFilePrefix%)+"Files"
, �
6�
@
J(alba_destinationdir$=destinationdir$
Talba_time%=�
^
h=� Ignore all links generated during the preboot/run stage
r"� GlobalState%=0 alba_type%=-1
|�
�
���autoaddnewshortcut
�� autodropdirectory$
�#� number%, next%,numberofitems%
�>� oldestdate%,oldestname$,oldesttype%,oldestnext%,oldnext%
�� delstring$
�-autodropdirectory$ = alba_destinationdir$
�"�ensuredir(autodropdirectory$)
�4� Auto insert directorys have a limit of 9 items
�� Is link directory empty?
�numberofitems%=0
�next%=0
�oldestdate%=0
&ȕ(next%<>-1 � numberofitems%<=16)
"$string%=autodropdirectory$+�0
oldnext%=next%
&Eș "OS_GBPB",11,string%,dblock%,1,next%,63,"*" � ,,,number%,next%
0� next%<>-1 �
:numberofitems%+=1
D|� ((dblock%!24)<oldestdate% � oldestdate%=0) oldestdate%=dblock%!24:oldestname$=�string(dblock%+29):oldestnext%=oldnext%
N�
X�
b� (numberofitems%<9) �
l& � If so then automatically insert
vL �addnewshortcut(autodropdirectory$,alba_newlinkfile$,alba_newlinkleaf$)
��
�+ � Intelligently delete an old file and
�  � Get filetype of this file
�# $string%=autodropdirectory$+�0
�9 ș "OS_GBPB",12,string%,dblock%,1,oldestnext%,63,"*"
� oldesttype%=dblock%!20
�^  � PROCerror("Oldest file to remove : "+oldestname$+" of type "+STR$~(oldesttype%)+CHR$0)
�- � Delete the oldest link in this dir ...
�5 � Final check - Only allow delete on &af3 files.
� � (oldesttype%=&af3) �
�< delstring$="delete "+autodropdirectory$+"."+oldestname$
�4 � PROCerror("about to OSCLI "+delstring$+CHR$0)
� �(delstring$+�0)
 � insert a new one ...
L �addnewshortcut(autodropdirectory$,alba_newlinkfile$,alba_newlinkleaf$)
 �
 �
*alba_type%=-1
4�
>
H2� Prompt user to select directory for new link
R��data_load_add_link
\*� path$,leaf$,type%,leafptr%,linkname$
f � (�CheckLinksDirExists=0) �
ppath$=�string(block%+44)
z!leaf$=�GetLeafName(block%+44)
�type%=!(block%+40)
�6linkname$=AppPath$+".Users."+User$+".Links."+leaf$
�newlinkleaf$=leaf$
�#newlinkfile$=�string(block%+44)
�� Is link directory empty?
�1$string%=AppPath$+".Users."+User$+".Links"+�0
�;ș "OS_GBPB",10,string%,dblock%,1,0,63,"*" � ,,,number%
�� number%=0 �
�4� If so then automatically add to root directory
�P�addnewshortcut(AppPath$+".Users."+User$+".Links",newlinkfile$,newlinkleaf$)
��
��showshortcutmenu(1)
��
�

,� Add new link to the shortcut directory
$F��addnewshortcut(dropdirectory$,add_newlinkfile$,add_newlinkleaf$)
.1� linkname$,leafptr%,IgnoreLink%,Index%,Char%
81linkname$=dropdirectory$+"."+add_newlinkleaf$
B $string%=add_newlinkfile$+�0
LC�PROCerror("Contents of "+linkname$+"="+add_newlinkfile$+CHR$0)
Vleafptr%=string%
`<� Check for any illegal characters in filename and if so
j(� ignore the generation of this link
tIgnoreLink%=�
~"�Index%=0� �(add_newlinkleaf$)
�(Char%=�(�add_newlinkleaf$,Index%,1))
�� Char%=�"$" � Char%=�"." �
� IgnoreLink%=�
��
��
�� IgnoreLink%=� �
�9 � Check to see if this file already exists and if so
� � prompt for overwrite.
� X%=�(linkname$+�0)
� ȕ((?leafptr%) > 31)
� �#X%, ?leafptr%
� leafptr%+=1
 �

' �#X%, 10:� Output a terminating LF
	 �#X%
 � Set type appropriately
(& �("SetType "+linkname$+" af3"+�0)
2�
<�
F
P��alba_purge(expiry%)
Z� (alba_type%<0) � �
d.� (expiry%>0 � (alba_time%+expiry%)>�) � �
n�autoaddnewshortcut
x�
�
�9� ***************************************************
�&� Window and iconbar click handler
�&� See below for menu click handler
�8� **************************************************
���click(win%)
�
Ȏ win% �
�!� -2:�click_iconbar(block%!8)
�)� whandle_info%:�click_info(block%!8)
��
��
�
�8� **************************************************
� Menu click handler
8� **************************************************
��menuselect
"Ȏ CurrentMenuType% �
,#� MainMenuType%:�mainmenuselect
6+� ShortCutMenuType%:�shortcutmenuselect
@4� WindowListMenuType%:�windowmenuselect(!block%)
J�
T�
^
h9� ***************************************************
r
|��click_iconbar(button%)
�CurrentButton%=button%
�Ȏ button% �
�� 0:�move_overiconbar
�� 1:�click_iconbaradjust
�� 2:�click_iconbargeneral
�� 4:�click_iconbarselect
��
��
�
���click_iconbargeneral
�%� ToolTip%=1 �PersistCloseToolTip
�#ș"Wimp_GetPointerInfo",,block%
�override_tooltip%=1
 ;IconBarMenuOpen%=1:� Inhibit tool tip display over menu
 *� (CurrentButton%=1) �showwindowmenu:�
 (� (CurrentButton%=2) �showmainmenu:�
 &0� (CurrentButton%=4) �showshortcutmenu(0):� 
 0�
 :
 D                 
 N��click_iconbarselect
 X� (�-1) � (�-2) �
 b � Open cache windows
 l �reopenfiler
 v �
 ��
 �
� (�-2) �
 �! � Start drag to add a window
 �$ ș"Wimp_GetPointerInfo",,block%
 �) � (block%!8) �init_drag(add_window%)
 � �
 � � Click menu
 � �click_iconbargeneral
 ��
 ��
 �
 ���click_iconbaradjust
 �� (�-1) � (�-2) �
!� Close cache windows
!�closefiler:�CloseInfoBox
!�
! �
!*
� (�-2) �
!4#È™"Wimp_GetPointerInfo",,block%
!>#� Start drag to remove a window
!H-� (block%!8) �init_drag(subtract_window%)
!R�
!\�click_iconbargeneral
!f�
!p�
!z
!�8� **************************************************
!�!� Pointer is over the iconbar
!�8� **************************************************
!���move_overiconbar
!�-� IconBarMenuOpen%=1 iconbar_timerflag%=0
!�;� Is pointer over iconbar icon? If so inc iconbar_timer
!�X� (iconbar_timerflag%=0 � IconBarMenuOpen%<>1) iconbar_timerflag%=1:iconbar_timer%=�
!�I� (((�-iconbar_timer%)>25) � iconbar_timerflag%=1 � OldToolTip%<>1) �
!� � What sort of tool tip?
!� RSeed%=�(-�)
!� 
!� � (RandomToolTip%=1) �
!�  � (�(5)=1) �
"+   �OpenToolTip(2):iconbar_timerflag%=2
"   �
"+   �OpenToolTip(1):iconbar_timerflag%=2
"$  �
". �
"8+  �OpenToolTip(1):iconbar_timerflag%=2 
"B �
"L�
"V
"`7� Is user dragging over icon bar icon with a button
"j� pressed for over 2 s ?
"tY%=ptrblock%!4
"~O� (((�-iconbar_timer%)>200) � IconBarMenuOpen%=0 � ((ptrblock%!8 �7)>0) ) �
"�& � ToolTip%=1 �PersistCloseToolTip
"� override_tooltip%=1
"�< IconBarMenuOpen%=1:� Inhibit tool tip display over menu
"� � �-3 �
"�  �showshortcutmenu(0)
"�  �
"�  � Close all other menus
"�   � SYS"Wimp_CreateMenu",,-1
"�  �showwindowmenu
"� �
"��
"�
#-� Has tool tip been open for long enough?
#
X� (((�-iconbar_timer%)>1000) � ToolTip%>0) �PersistCloseToolTip:iconbar_timerflag%=0
#�
#
#(
#28� **************************************************
#<
#FݤCheckLinksDirExists
#P� dir$,result%
#Z*dir$=AppPath$+".Users."+User$+".Links"
#d%� Does the Links directory exist?
#n$string%=dir$+�0
#x$ș"OS_File",17,string% � result%
#�� If not, create one.
#�&� (result%=0) � �("CDIR "+dir$+�0)
#�$ș"OS_File",17,string% � result%
#�'� Has it created it? If not, error.
#�� (result%=0) �
#�.�error("Fatal : Couldn't create "+dir$+�0)
#�=0
#��
#�=1
#�
#�8� **************************************************
#�
#���showmainmenu
$$CurrentMenuType% = MainMenuType%
$2�showmenu(main_menu%,!block%-64, 96+(8*44)+24)
$�
$"
$,8� **************************************************
$60� Build list of currently valid open windows
$@8� **************************************************
$J��BuildWindowList
$T� q%,OldAfter%
$^� sx%, sy%, ox%, oy%
$h)� ReopenFlag%, StackFlag%, ValidFlag%
$r-� PaneFlag%, IsOpenFlag%, IsMoveableFlag%
$|� CurrentWin%,CurrentIcon%
$�%� WindowName$, ErrorFlag%,Windex%
$�
$�q%=winblock%
$�PaneFlag%=�
$�WindowName$=""
$�
$�*� Start from bottom of window stack by
$�0� opening the dummy window at the bottom ...
$��ReopenDummyWindow
$� 
$�2� Get Current window immediately under pointer
$�$ș"Wimp_GetPointerInfo",,block2%
$�CurrentWinPtr%=block2%!12
%CurrentIcon%=block2%!16
%
%after%=whandle_dummyback%
%&
%0 � Go through all windows ...
%:�
%DOldAfter%=after%
%N!q%=after%
%X.� _Try_ and reopen this desktop window ...
%b/ș "XWimp_GetWindowState",,q% � ;ErrorFlag%
%lCurrentWin%=!q%
%v&� (after%=-1 � (ErrorFlag%�1)=1) �
%�
Windex%=0
%��
%�9� (CurrentWin%=WindowListHandle%(Windex%)) Windex%=-2
%�Windex%+=1
%�*� Windex%>=WindowListSize% � Windex%<0
%�after%=q%!28
%� 
%� PaneFlag%=�
%�2 � (((q%!32) � ((2^22)+(2^23)))>0) PaneFlag%=�
%�& � (((q%!32) � 32)=32) PaneFlag%=�
%�% IsOpenFlag% = ((q%!32) � (2^16))
%�$ IsMoveableFlag% = ((q%!32) � 2)
%�
& ReopenFlag%=�
& StackFlag%=�
& ValidFlag%=�
&  
&*< � If this window is not at all on screen then ignore it
&4! � OS_M? = ?X|Y ScreenOS?Size
&> ox%=q%!4:ttox%=ox%
&H oy%=q%!16:ttoy%=oy%
&R! sx%=(q%!12)-(q%!4):ttsx%=sx%
&\! sy%=(q%!16)-(q%!8):ttsy%=sy%
&fP� (ox%>OS_MX%) � (oy%>OS_MY%) � ((ox%+sx%)<0) � ((oy%+sy%)<0) � ValidFlag%=�
&p
&z
&�.� Is this the currently open menu window? 
&�3� (CurrentWin%=currentmenuhandle%) ValidFlag%=�
&�
&�� Is this the icon bar?
&�*� IF (CurrentWin%=-2) ValidFlag%=FALSE
&�
&�p� Under pointer and _no_ horiz/vert scroll bars and fully visible (likely to be part of menu so leave alone)
&ʀ� (CurrentWin%=CurrentWinPtr% � ((q%!32) � (2^28))=0 � ((q%!32) � (2^30))=0 � ((q%!32) � (2^17))>0 � after%=-1) ValidFlag%=�
&�
&�2 � (CurrentWin%=whandle_tooltip%) ValidFlag%=�
&�! � (PaneFlag%=�) ValidFlag%=�
&� 
&� � (ValidFlag%=�) �
'
'.  � (WindowListSize%<MaxWindowListSize%) �
'5   WindowListHandle%(WindowListSize%)=CurrentWin%
'$   WindowListSize%+=1
'.  �
'8! �:� End of IF ValidFlag% ...
'B 
'L� CurrentWin%=-1
'V�
'`
'j
't8� **************************************************
'~� Open the Window List menu
'�8� **************************************************
'���showwindowmenu
'�3� TitleBarFlag%, CurrentWin%, SourceTaskHandle%
'�=� TitleBarPtr%, TitleBarLength%, ErrorFlag%, SuccessFlag%
'�4� Index%,WindowName$,KludgeLength%,IsIndirected%
'�
'�5� currentmenuptr%, locali%, width%, title$, item$
'�� WindowNum%
'�� a%
'�
'�'� (ToolTip%=1) �PersistCloseToolTip
'�ș"Hourglass_On"
(#� Build List of current windows
(
�BuildWindowList
(
(� Build menu
(($initialmenusize%=WindowListSize%
(2#currentmenuptr% = shortcutmenu%
(<title$="Windows"
(FTitlePtr%=currentmenuptr%
(P$TitlePtr%=title$
(Zwidth%=(�(title$)-2)*16
(d"currentmenuptr%!12 = &00070207
(ncurrentmenuptr%!20=44
(xcurrentmenuptr%!24=0
(�ptr%=currentmenuptr%+28
(�
(�� (initialmenusize%>0) �
(� locali%=0
(�, �WindowNum%=(WindowListSize%-1) � 0 �-1
(�  � Initialise menu object
(�  IsDirect%=0
(�1  !ptr%=8:� mflags = &80 means last menu item
(�%  ptr%!4=-1:� pointer to sub menu
(�%  ptr%!8=&7000313-512:� icon type
(�1  CurrentWin% = WindowListHandle%(WindowNum%)
(�  � Get Task Handle
(�  !block2%=0
)S  ș"XWimp_SendMessage",0,block2%,CurrentWin% � ,,SourceTaskHandle% ;ErrorFlag%
).  � Is this window definition a valid one?
)&  SourceTaskName% = unknownstring%
)"  � ((ErrorFlag%�1)=0) �
),Z   ș"XTaskManager_TaskNameFromHandle",SourceTaskHandle% � SourceTaskName% ;ErrorFlag%
)6:   � ((ErrorFlag%�1)=1) SourceTaskName%=unknownstring%
)@  �
)J  
)T  WindowName$="???"
)^  � ((ErrorFlag%�1)=0) �
)h   !block2%=CurrentWin%
)r@   � Get Window Info NB. Set Bit0 of R1 to disable icon info
)|8   ș "Wimp_GetWindowInfo",,block2%+1 � ; ErrorFlag%
)�$   TitleBarFlag% = !(block2%+60)
)�3   � ((TitleBarFlag% � 1) � (ErrorFlag%�1)=0) �
)�"    � This title contains text
)�!    � (TitleBarFlag% � 256) �
)�#     � Title data is indirected
)�%     TitleBarPtr% = !(block2%+76)
)�&     TitleBarLength%=!(block2%+84)
)�      � Major Kludge !!! TODO
)�     !block2%=0
)�I     ș"Wimp_SendMessage",0,block2%,CurrentWin% � ,,SourceTaskHandle%
)�;     � Copy source task data to destination task data  
)�v     ș"XWimp_TransferBlock",SourceTaskHandle%,TitleBarPtr%,task_handle%,transblock%,TitleBarLength% � ;ErrorFlag%
)�&     � Have we got the whole name?
*     SuccessFlag%=0
*     � TitleBarLength%>0 �
*(      �Index%=0� (TitleBarLength%-1)
*&6       � (?(transblock%+Index%)<32) SuccessFlag%=1
*0      �
*:
     �
*D?     � PROCerror("InDirected name = "+$(transblock%)+CHR$0)
*N   
*X     � SuccessFlag%=0 �
*b      Index%-=1
*l5      � Get rest of title bar (Major Kludge) TODO
*v      KludgeLength%=0
*�      �
*�x       ș"XWimp_TransferBlock",SourceTaskHandle%,TitleBarPtr%+Index%,task_handle%,transblock%+Index%,1 � ;ErrorFlag%
*�       Index%+=1
*�       KludgeLength%+=1
*�R      � ?(TitleBarPtr%+(Index%-1))<32 � ((ErrorFlag%�1)=1) � KludgeLength%>253
*�$      ?(transblock%+Index%) = 13
*�%      ?(transblock%+Index%+1) = 0
*�     � 
*�    
*�#     TitleBarPtr% = transblock%
*�
     �
*�     � Is Directed data
*�A     � PROCerror("Direct window name = "+$(block2%+76)+CHR$0)
+"     TitleBarPtr% = block2%+76
+     TitleBarLength%=12
+     IsDirect%=1
+ $    �:� End of IF is indirected?
+*    
+42    � Has the title string got anything in it?
+>2    � (?TitleBarPtr%>=32 � (ErrorFlag%�1)=0) �
+H     � (IsDirect%=0) �
+R2      TitleBarString$ = �getname(TitleBarPtr%)
+\=      � PROCerror("Aquired title:"+TitleBarString$+CHR$0)
+f      �
+p      TitleBarString$=""
+z      Z%=0
+�      �
+�        Y%=?(TitleBarPtr%+Z%)
+�;       � (Y%>=32) TitleBarString$=TitleBarString$+�(Y%)
+�      Z%+=1
+�      � Z%>11 � Y%<32
+�
     �
+�	     
+�&     WindowName$ = TitleBarString$
+�$     � (�(TitleBarString$)>45) �
+�,      WindowName$ = �TitleBarString$, 4)
+�+      WindowName$ = WindowName$ + "..."
+�;      WindowName$ = WindowName$ + �TitleBarString$, 38)
+�
     �
,	    �
,   � :� End of Has text?
,  
,$   item$=WindowName$
,.   
,83   $(shortcutmenudata%+(locali%*64)) = item$+�0
,B
,L+   taskname$ = �string(SourceTaskName%)
,V   taskiconname$=taskname$
,`   � (�(taskname$)>0) �
,j    sn=3
,t@    � �taskname$,"Filer")>0 taskiconname$ = "small_dir":sn=0
,~@    � taskname$="unknown_app" taskiconname$="small_app":sn=0
,�@    � taskname$="Task Manager" taskiconname$="switcher":sn=1
,�B    � taskname$="Palette Utility" taskiconname$="palette":sn=1
,�;    � taskname$="Calculator" taskiconname$="!calc":sn=1
,�<    � taskname$="Characters" taskiconname$="!chars":sn=1
,�@    � taskname$="StrongHelp" taskiconname$="!stronghlp":sn=1
,�:    � (sn �1)=1 � ptr%!8=&7000B13-512:� half size icon
,�3    � (sn �2)=2 � taskiconname$ = "!"+taskname$
,�   �
,�s   � PROCerror("Entry:"+item$+" Icon:"+taskiconname$+" Handle:"+STR$(CurrentWin%)+" TaskName:"+taskname$+CHR$0)
,�(   � Does taskiconname sprite exist?
,�C   � �(�SpriteExist(taskiconname$)) taskiconname$="application"
,�8   � Is taskiconname too long to fit in name buffer?
-:   � (�(taskiconname$)>12) taskiconname$="application"
-
    � Build rest of item data
-B   $(shortcutmenudata%+(locali%*64)+46) = "S"+taskiconname$+�0
-9   !(shortcutmenudata%+(locali%*64)+60) = CurrentWin%
-(/   ptr%!12 = shortcutmenudata%+(locali%*64)
-22   ptr%!16 = shortcutmenudata%+(locali%*64)+46
-<8   ptr%!20 = 46:� menu item string buffer = 46 bytes
-F   a%=(�(item$)+4)*16
-P   ptr%+=24
-Z   locali%+=1
-d    � (a%>width%) � width%=a%
-n   �
-x   initialmenusize%-=1
-�  �
-� �
-��
-�.� If menu is empty, define an 'empty' item
-�� initialmenusize%=0 �
-�; � Make default first entry be greyed out label 'empty'
-� initialmenusize%+=1
-� item$="Empty"+�0
-� !ptr%=&80
-�$ ptr%!4=-1:� pointer to sub menu
-�8 ptr%!8=&2400029:� greyed out UNSELECTABLE icon type
-� $(ptr%+12)=item$
-� a%=(�(item$)+4)*16
. � a%>width% width%=a%
.
 ptr%+=24
.�
."� Define last item in menu
.,currentmenuptr%!16=width%
.6'!(ptr%-24)=&88:� Set last menu item
.@È™"Hourglass_Off"
.J� Open menu
.T#È™"Wimp_GetPointerInfo",,block%
.^*CurrentMenuType% = WindowListMenuType%
.hWindowListIcon%=-1
.rC�showmenu(shortcutmenu%,!block%-64, 96+((initialmenusize%)*44))
.|�
.�
.�5� ***********************************************
.�� Does Sprite Exist?
.�5� ***********************************************
.�ݤSpriteExist(SpriteName$)
.�$� ROMBase%, RAMBase%, ErrorFlag%
.�/ș "Wimp_BaseOfSprites" � ROMBase%,RAMBase%
.�"$dragspritename% = SpriteName$
.�@ș"XOS_SpriteOp",296,ROMBase%,dragspritename% � ; ErrorFlag%
.�� (ErrorFlag% � 1)=0 � =�
.�@ș"XOS_SpriteOp",296,RAMBase%,dragspritename% � ; ErrorFlag%
.�� (ErrorFlag% � 1)=0 � =�
.�=�
/
/8� **************************************************
/%� Start building the shortcutmenu
/&8� **************************************************
/0��showshortcutmenu(arg%)
/:'� (ToolTip%=1) �PersistCloseToolTip
/Daddlink%=arg%
/N � (�CheckLinksDirExists=0) �
/Xdirptr%(0)=shortcutmenu%
/b'� linkmenudepth%=0:REM At top level
/l
/vL�PROCSingleDirectoryRead(AppPath$+".Users."+User$+".Links", User$, 0, 0)
/�N�SingleDirectoryRead(AppPath$+".Users."+User$+".Links", "ShortCuts", 0, 0)
/� initialmenudottedlinesize%=0
/� initialmenusize%=dirlist%(0)
/�+� initialmenusize%=0 initialmenusize%=1
/�+initialmenusize% = GlobalMenuItemCount%
/�#ș"Wimp_GetPointerInfo",,block%
/�(CurrentMenuType% = ShortCutMenuType%
/�^�showmenu(shortcutmenu%,!block%-64, 96+(GlobalMenuItemCount%*44)+(GlobalMenuSepCount%*24))
/��
/�
/�
/�
/�;� *****************************************************
0;� Read contents of a directory into the menu data areas
0$� storing filename and icon type
0;� *****************************************************
0 G��SingleDirectoryRead(localdir$,dirfilename$,linkdepth%, addwrite%)
0*<� oldlocaldir$,olddirfilename$,oldlinkdepth%, olddirptr%
04� dirsize%, DirScan%
0>-� dir$,next%,type%,item$,currentdir%,ptr%
0H-� currentmenuptr%, locali%, width%,title$
0R(� TitlePtr%, MenuExtent%,itemsprite$
0\B� filetype%, filetypeinfo%,linktype%,objecttype%,linktypeinfo%
0f#� ValidLoadFlag%, KeepMenuItem%
0p%� NumberOfLinks%, UseLargeSprite%
0z
0�ș"Hourglass_On"
0�
0�oldlocaldir$ = localdir$
0�"olddirfilename$ = dirfilename$
0�oldlinkdepth% = linkdepth%
0�"olddirptr%=dirptr%(linkdepth%)
0�DirScan%=�
0�
0�� (addlink%=1) �
0� itemsprite$="Pptr_link"
0� �
0� itemsprite$=""
0��
1
17�:� Repeat until loaded in directory with no errors
1localdir$ = oldlocaldir$
1$"dirfilename$ = olddirfilename$
1.linkdepth% = oldlinkdepth%
18%dirptr%(oldlinkdepth%)=olddirptr%
1BDirScan%=�
1L
1V5� Calculate pointer to shortcutmenu% & index into
1`� shortcutmenudata%
1jdir$=localdir$
1ta%=0
1~!currentmenuptr%=shortcutmenu%
1�i%=0
1�ȕ a%<linkdepth%
1�+currentmenuptr%+=(28+(dirlist%(a%)*24))
1�i%+=dirlist%(a%)
1�	a%+=1
1��
1�
1�4� Initialise root menu seperator to be undefined
1�� (linkdepth%=0) �
1� StartMenuSeperator%=-1
1� StartMenuSeperator2%=-1
1� StartMenuSeperator3%=-1
2�
2

29�PROCerror("MenuPtr = "+STR$~(currentmenuptr%)+CHR$0)
2next%=0
2(numberofitems%=0
22
2<8� Get number of items in current directory localdir$
2FÈ• (next%<>-1)
2P$string%=dir$+�0
2ZEș "OS_GBPB",10,string%,dblock%,1,next%,63,"*" � ,,,number%,next%
2d� next%<>-1 �
2n numberofitems%+=1
2x  item$=�getname(dblock%+&14)
2�< � Discount this menu item if its a ~~ item and advanced
2� � menus disabled. 
2�v � (GlobalShowBootMenuFlag%=0 � �item$,1,1)=�(SysFilePrefix%) � �item$,2,1)=�(SysFilePrefix%)) � numberofitems%-=1
2��
2��
2�
2�
2�?� PROCerror("Directory size = "+STR$(numberofitems%)+CHR$0)
2�
2�'dirlist%(linkdepth%)=numberofitems%
2�Enextmenuptr%=currentmenuptr%+(28+((numberofitems%+addwrite%)*24))
2�&dirptr%(linkdepth%+1)=nextmenuptr%
2�
3locali%=i%
3� Build titleless menu
3,� title$="Menu "+STR$(currentdir%)+CHR$0
3"title$=dirfilename$+�0
3,� (linkdepth%=1) �
36- � (�dirfilename$,1)=�(SysFilePrefix%)) �
3@1  � (�dirfilename$,2,1)<>�(SysFilePrefix%)) �
3J1   title$=�dirfilename$,�(dirfilename$)-1)+�0
3T  �
3^0  � (�dirfilename$,2,1)=�(SysFilePrefix%)) �
3h1   title$=�dirfilename$,�(dirfilename$)-2)+�0
3r  �
3| �
3��
3�
3�TitlePtr%=currentmenuptr%
3�$TitlePtr%=title$
3�width%=(�(title$)-2)*16
3�"currentmenuptr%!12 = &00070207
3�currentmenuptr%!20=44
3�currentmenuptr%!24=0
3�ptr%=currentmenuptr%+28
3�
3�next%=0
3�GlobalMenuItemCount%=0
3�GlobalMenuSepCount%=0
4!NumberOfLinks%=numberofitems%
4
4*ȕ (next%<NumberOfLinks% � DirScan%=�)
4&KeepMenuItem%=�
40ValidLoadFlag%=�
4:UseLargeSprite%=�
4D/È™ "OS_GBPB",10,dir$,dblock%,1,next%,63,"*"
4Nnext%+=1
4Xlocali%=i%
4b/� Get Object type (2 = directory, 1 = file)
4ltype% = dblock%?&10
4v� Get name of this object
4�item$=�getname(dblock%+&14)
4�� Get file attributes
4�"filetypeinfo%= !dblock% >>> 20
4�#filetype%=(!dblock% >> 8)� &FFF
4�
4�� Initialise menu object
4�:!ptr%=8:� mflags = &80=LastMenuItem &8=WarnSubmenuOpen
4�#ptr%!4=-1:� pointer to sub menu
4�-� Store this filer object, whatever it is
4�3!(shortcutmenudata%+(locali%*64)+32+28) = type%
4�
4�!� Is this object a directory?
4�� (type% =2) �
5( � If so, then add to directory list
5: $(shortcutmenudata%+(locali%*64)+32) = itemsprite$+�0
5/ ptr%!4 = nextmenuptr%:� Pointer to submenu
5  �
5*) � This is a link and not a directory
54, �  PROCerror("Processing "+item$+CHR$0)
5>" � Get filetype of link object
5H1 $string%=�GetLinkContents(dir$+"."+item$)+�0
5R 
5\0 � (�CheckValidDrive(�string(string%)) =1) �
5f:  ș "OS_File",17,string% � objecttype%,,linkloadaddr%
5p)  linktype%=(linkloadaddr%>>8) � &FFF
5z)  linktypeinfo%= linkloadaddr% >>> 20
5� �
5�  objecttype%=0
5� �
5�U �PROCerror(FNGetLinkContents(dir$+"."+item$)+" is a "+STR$(linktypeinfo%)+CHR$0)
5� � (objecttype%=0) �
5�Y  � PROCerror("Error : Link("+FNGetLinkContents(dir$+"."+item$)+") not found."+CHR$0)
5�1  � Delete this link and rescan the directory
5�=  � Safety first - ensure this file is actually a link in
5�D  � case the <Xuenbs$Dir> system variable has become corrupt (!)
5�  � (filetype%=&af3) �
5�q   � PROCerror("Invalid link "+dir$+"."+item$+" has been found and will be deleted when you click OK."+CHR$0)
5�%   �("delete "+dir$+"."+item$+�0)
5�   DirScan%=�
6   ValidLoadFlag%=�
6   �
6�   �error("Error: Another prog has altered the <Xuenbs$Dir> system variable or someone has placed a non-link "+dir$+"."+item$+" into the links directory. Rerun the !Xuen application or remove the offending file from the !Xuen.Links directory."+�0)
6$  �
6.  �
68 
6B � (objecttype%=1) �
6L(  � This link is a pointer to a file
6V7  � PROCerror(FNstring(string%)+" is a file"+CHR$0)
6`W  $(shortcutmenudata%+(locali%*64)+32) = "Ssmall_"+�~(linktype%)+";"+itemsprite$+�0
6j/  � �(�SpriteExist("small_"+�~linktype%)) �
6t@   � Small icon don't exist - use large type and flag it so.
6~n   $(shortcutmenudata%+(locali%*64)+32) = "Sfile_"+�~(linktype%)+";"+itemsprite$+�0:UseLargeSprite%=�     
6�  �
6�  
6� �
6�
6�= � For some wierd reason the following two variables must
6�; � be evaluated outside of the objecttype test. I think
6�< � it must be something to do with the pipeline and/or a
6� � bug in the BASIC rom.
6� shriek%=�("!")
6� namestart%=�(�item$,1))
6� � (objecttype%=2) �
6�=  � This link is a pointer to an application or directory
7  � (namestart%<>shriek%) �
7
J   $(shortcutmenudata%+(locali%*64)+32) = "Ssmall_dir;"+itemsprite$+�0
7   �
7L   $(shortcutmenudata%+(locali%*64)+32) = "Ssm"+item$+";"+itemsprite$+�0
7(&   � �(�SpriteExist("sm"+item$)) �
72A    � Small icon don't exist - use large type and flag it so.
7<b    $(shortcutmenudata%+(locali%*64)+32) = "S"+item$+";"+itemsprite$+�0:UseLargeSprite%=�     
7F   �
7P  �
7Z �
7d
7n�
7x
7�(� Build rest of menu item attributes
7�ptr%!8=&7000313:� icon type
7�@� IF (type%=2 AND objecttype%=0) ptr%!8=&7400313:REM Invalid
7�� (addlink%=1) �
7� ptr%!8=&3000313
7��
7�.� (UseLargeSprite%) ptr%!8 = (ptr%!8)+&800
7�.$(shortcutmenudata%+(locali%*64))=item$+�0
7�,ptr%!12 = shortcutmenudata%+(locali%*64)
7�/ptr%!16 = shortcutmenudata%+(locali%*64)+32
7�5ptr%!20 = 28:� menu item string buffer = 28 bytes
7�
7�1� Are we dealing with any ~ or ~~ filenames ?
86� (linkdepth%=0 � �item$,1,1)=�(SysFilePrefix%)) �
8
8  � Single ~ prefix filenames
8") � (�item$,2,1)<>�(SysFilePrefix%)) �
8,!  � (StartMenuSeperator%<0) �
86"   StartMenuSeperator%=locali%
8@4   � Does this item need a dotted line above it?
8J   � (locali%>0) �
8T#    !(ptr%-24)=(!(ptr%-24)) + 2
8^    GlobalMenuSepCount%+=1
8h   �
8r  �
8|B �IF (locali%>=StartMenuSeperator% AND StartMenuSeperator%>=0)
8�< $(shortcutmenudata%+(locali%*64))=�item$,�(item$)-1)+�0
8�% � StartMenuSeperator2%=locali%+1
8� �
8�  
8�  � Double ~ prefix filenames
8�( � (�item$,2,1)=�(SysFilePrefix%)) �
8�%  � (GlobalShowBootMenuFlag%=0) �
8�   KeepMenuItem%=�
8�   �
8�#   � (StartMenuSeperator2%<0) �
8�$    StartMenuSeperator2%=locali%
8�5    � Does this item need a dotted line above it?
8�    � (locali%>0)
9$     !(ptr%-24)=(!(ptr%-24)) + 2
9     GlobalMenuSepCount%+=1
9
     �
9&   �
90G   � IF (locali%>=StartMenuSeperator2% AND StartMenuSeperator2%>=0)
9:>   $(shortcutmenudata%+(locali%*64))=�item$,�(item$)-2)+�0
9D%   StartMenuSeperator3%=locali%+1
9N   �
9X  �
9b  
9l'�:� End of 'Are we dealing with ...
9v
9�� (KeepMenuItem%) �
9� a%=(�(item$)+4)*16
9� � a%>width% width%=a%
9�
 ptr%+=24
9�
 i%+=1
9� GlobalMenuItemCount% +=1
9��
9��
9�
9�?� Do we need to add an extra writeable icon on end of menu?
9�� (addwrite%) �
9� locali%=i%
9� item$="New"
9�9 !ptr%=4+&80:� mflags = &80=LastMenuItem &4=Writeable
:$ ptr%!4=-1:� pointer to sub menu
:" ptr%!8 = &7200111:� icon type
:/ $(shortcutmenudata%+(locali%*64))=item$+�0
:, $(shortcutmenudata%+(locali%*64)+32)=�0
: - ptr%!12 = shortcutmenudata%+(locali%*64)
:*0 ptr%!16 = shortcutmenudata%+(locali%*64)+32
:46 ptr%!20 = 28:� menu item string buffer = 28 bytes
:5 a%=(�(item$)+4)*16
:� � a%>width% width%=a%
:�
 ptr%+=24
:�
 i%+=1
:� GlobalMenuItemCount% +=1
:� numberofitems%+=1
;�
;
;'� Has this list got anything in it?
;$� (numberofitems%>0) �
;.6!(ptr%-24)= (!(ptr%-24) �&88):� Set last menu item
;8�
;Bwidth%=(�(title$)-2)*16
;L:� Make default first entry be greyed out label 'empty'
;Vitem$="Empty"+�0
;`9$(shortcutmenudata%+(locali%*64)+32) = itemsprite$+�0
;j=!ptr%=&88:� mflags = &80 means last menu item 8=IssueWarn
;t#ptr%!4=-1:� pointer to sub menu
;~Aptr%!8=&3000313:� grey colour SELECTABLE icon type (Add link)
;�+$(shortcutmenudata%+(locali%*64))=item$
;�$(ptr%+12)=item$
;�,ptr%!12 = shortcutmenudata%+(locali%*64)
;�/ptr%!16 = shortcutmenudata%+(locali%*64)+32
;�5ptr%!20 = 28:� menu item string buffer = 28 bytes
;�a%=(�(item$)+4)*16
;�� a%>width% width%=a%
;�	i%+=1
;�GlobalMenuItemCount%+=1
;��
;�currentmenuptr%!16=width%
;�
<� End of directory scanning
<
� DirScan%=�
<'dirlist%(linkdepth%)=numberofitems%
<
<(8� IF (dirlist%(linkdepth%)=0) dirlist%(linkdepth%)=1
<2È™"Hourglass_Off"
<<�
<F
<P7� *************************************************
<Z � A Submenu is about to open
<d7� *************************************************
<n��submenu_warning
<x6� ptr%,localdir$,depth%,index%,selection%,leaf$,i%
<�
� prefix$
<�/localdir$=AppPath$+".Users."+User$+".Links"
<�
<�8� Navigate menu index data to determine where we are
<�depth%=0
<�index%=0
<�ptr%=block%+32
<�&ȕ !((block%+32)+(depth%*4)) <> -1
<�(selection%=!((block%+32)+(depth%*4))
<�=leaf$=�string(shortcutmenudata%+((index%+selection%)*64))
<�&� Is this a system directory name?
<�i%=selection%
<�� (depth%=0) �
= prefix$=""
=S � (i%>=StartMenuSeperator% � StartMenuSeperator%>=0) prefix$=�(SysFilePrefix%)
=g � (i%>=StartMenuSeperator2% � StartMenuSeperator2%>=0) prefix$=�(SysFilePrefix%)+�(SysFilePrefix%)
="F � (i%>=StartMenuSeperator3% � StartMenuSeperator3%>=0) prefix$=""
=, leaf$=prefix$+leaf$
=6�
=@
=J!localdir$=localdir$+"."+leaf$
=Tindex%+=dirlist%(depth%)
=^
depth%+=1
=h�
=r3�SingleDirectoryRead(localdir$,leaf$,depth%, 0)
=|9È™"Wimp_CreateSubMenu",,block%!20,block%!24,block%!28
=��
=�
=�;� *****************************************************
=�� Recursive Directory boot
=�;� *****************************************************
=�1��RecurseDirectory(localdir$, recurseaction%)
=�C� dir$, next%,type%, item$, objectcount%, currentdir%,filetype%
=�� number%,LD%
=�� linktype%,linkdir$
=�dir$=localdir$
=�next%=0
=�ȕ next%<>-1 � �(quit%)
=�
>Eș "OS_GBPB",12,dir$,bootblock%,1,next%,63,"*" � ,,,number%,next%
>/� Get Object type (2 = directory, 1 = file)
>type% = bootblock%?&10
>&filetype% = bootblock%!20
>0� Get name of this object
>:!item$=�getname(bootblock%+24)
>D,� Has this directory got anything in it?
>N� (next%<>-1) �
>X' � Is this a directory (ie type=2) 
>b � (type%=2) �
>l8   �RecurseDirectory(dir$+"."+item$, recurseaction%)
>v �
>�0   � Must be a link to a file or application
>�4   � What type of thing does this link point to?
>�)   � PROCerror("Opening "+dir$+CHR$0)
>�   LD%=�(dir$+"."+item$+�0)
>�   linkdir$=""
>�   �
>�   LD$=�(�#LD%)
>�"   � (�(LD$)>31) linkdir$+=LD$
>�   � �(LD$)<32 � �#LD%
>�
   �#LD% 
>�"   � What type is the linkdir?
>�   $bootstring%=linkdir$+�0
>�*   � (�CheckValidDrive(linkdir$) =1) �
?/    ș "XOS_File",5,bootstring% � linktype%
?*    � (�item$,1)="!" � linktype%<>2) �
??     � Must be either a file or app or dir so let's boot it
? @     � If directory, only boot if begin with a ! (Save time)
?*+     � (recurseaction%=RECURSE_BOOT%) �
?41       $clistring = "Filer_Boot "+linkdir$+�0
?>"       È™ "XOS_CLI", clistring
?H
     �
?R*     � (recurseaction%=RECURSE_RUN%) �
?\0       $clistring = "Filer_Run "+linkdir$+�0
?f"       È™ "XOS_CLI", clistring
?p
     �
?z	    �
?�	    �
?�    � Remove this link
?�    � (filetype%=&af3) �
?�4�    PROCerror("Deleting "+dir$+"."+item$+CHR$0)
?�&    �("delete "+dir$+"."+item$+�0)
?�	    �
?�    
?�   �
?� �
?��
?�
?�/� Enable user to carry on during bootup and
?�:� trap any unwanted links that are generated at bootup
@	�poll
@	�poll
@	�poll
@$
@.�
@8�
@B
@L5� ***********************************************
@V
@`ݤCheckValidDrive(isvpath$)
@j!� fs_drive$, pptr%, char$, a%
@t8� Check that isvpath$ resides on a valid file system
@~� and a valid drive.
@�(� If not then return 0 else return 1
@�pptr%=1
@�fs_drive$=""
@��
@�char$=�isvpath$,pptr%,1)
@�,� (char$<>".") fs_drive$=fs_drive$+char$
@�pptr%=pptr%+1
@�%� (pptr%>�(isvpath$) � char$=".")
@�8� Check fs_drive$ with all currently invalid devices
@�a%=0
@�ȕ(a%<InvalidDriveCount%)
@�;� (fs_drive$=InvalidDrive$(a%)) a%=InvalidDriveCount%+1
A	a%+=1
A
�
A+� return if it matches an invalid drive
A"� (a%>InvalidDriveCount%) � =0
A(� Is this device valid?
A2$clistring=fs_drive$+�0
A<&ș"XOS_File",5,clistring � result%
AF� (result%<=8192) �
AP � This is a valid drive
AZ =1
Ad�
An#� Update list of invalid drives
Ax1InvalidDrive$(InvalidDriveCount%) = fs_drive$
A�InvalidDriveCount%+=1
A�=0
A�
A�-� ***************************************
A�)� Return first line of the given file
A�-� ***************************************
A�%ݤGetLinkContents(glinkfilename$)
A�� linkdir$,LD%
A�   LD%=�(glinkfilename$+�0)
A�   linkdir$=""
A�   �
A�   LD$=�(�#LD%)
A�"   � (�(LD$)>31) linkdir$+=LD$
B   � �(LD$)<32 � �#LD%
B   �#LD%
B   =linkdir$
B"
B,,� **************************************
B6!� Click on shortcut menu list
B@,� **************************************
BJ��shortcutmenuselect
BTO� currentmenuptr%,lastmenuptr%,dir$,linkdir$,dropdir$,currentdropdir$,leaf$
B^� droppardir$,parent$
Bh� ReOpenFlag%
Br� IconFlagsAddr%
B|+� prefix$,IsLinkDirectory%,IsGreyedOut%
B�>� LeftAlt%, RightAlt%,ThisIsWriteable%,RebuildLastSubMenu%
B�� AddWriteableFlag%
B�
B�AddWriteableFlag%=0
B�IsGreyedOut%=0
B�IsLinkDirectory%=0
B�CLeftAlt%=0:RightAlt%=0:ThisIsWriteable%=0:RebuildLastSubMenu%=0
B�� �-6 LeftAlt%=1
B�� �-9 RightAlt%=1
B�
B�8� PROCerror("Clicked on shortcut menu - blaj"+CHR$0)
B�
B�ReOpenFlag%=�
C*dir$=AppPath$+".Users."+User$+".Links"
Cdropdir$=dir$
Cdroppardir$=dir$
C&parent$=User$
C0leaf$=User$
C:currentdropdir$=dir$
CD!currentmenuptr%=shortcutmenu%
CN lastmenuptr%=currentmenuptr%
CX globalmenuptr%=shortcutmenu%
Cb,� block%+00 is selection number of menu,
Clnestlevel%=0
Cvsel1%=block%!nestlevel%
C�
C�;� Recurse menu directory pointers until selection found
C��
C�$selection%=block%!(nestlevel%*4)
C�,nextselection%=block%!((nestlevel%+1)*4)
C�:�PROCerror("Menu Selection = "+STR$(selection%)+CHR$0)
C�9� Get pointer to icon definition from menu definition
C�7submenuptr%=!(currentmenuptr%+28+(selection%*24)+4)
C�5dataptr%=!(currentmenuptr%+28+(selection%*24)+12)
C�parent$=leaf$
C�leaf$=�string(dataptr%)
C�6ItemFlags% = !(currentmenuptr%+28+(selection%*24))
C�5� Is this a system file name? not writeable ... )
D+� (nestlevel%=0 � (ItemFlags% � 4)=0) �
D prefix$=""
D[ � (selection%>=StartMenuSeperator% � StartMenuSeperator%>=0) prefix$=�(SysFilePrefix%)
D q � (selection%>=StartMenuSeperator2% � StartMenuSeperator2%>=0) prefix$ = �(SysFilePrefix%)+�(SysFilePrefix%)
D*P � (selection%>=StartMenuSeperator3% � StartMenuSeperator3%>=0) prefix$ = ""
D4 leaf$=prefix$+leaf$
D>�
DH� Construct path to object
DRcurrentdropdir$=dropdir$
D\� (selection%<>-1) �
Df dir$=dir$+"."+leaf$
Dp � (nextselection%<>-1) �
Dz'  droppardir$=droppardir$+"."+leaf$
D�2  � (submenuptr%<>-1) lastmenuptr%=submenuptr%
D�  �
D�A  � nextselection=-1 so Must be at selected item of last menu
D�,  � (submenuptr%<>-1) IsLinkDirectory%=1
D�9  IconFlagsAddr%=currentmenuptr%+28+8+(selection%*24)
D�Y  � (!IconFlagsAddr%=&3000313) IsGreyedOut%=1:� PROCerror("Is greyed out!"+CHR$0)    
D� �
D� nestlevel%+=1
D�1 � Is this menu entry a pointer to a submenu?
D� � (submenuptr%<>-1) �
D�!  dropdir$=dropdir$+"."+leaf$
D�!  currentmenuptr%=submenuptr%
D� �
E�
E� nextselection%=-1
E7submenuptr%=!(currentmenuptr%+28+(selection%*24)+4)
E$nestlevel%-=1
E.
E8Z�PROCerror("Clicked on "+leaf$+"["+STR$nestlevel%+"] in directory "+droppardir$+CHR$0)
EB"� Is this menu item writeable?
EL9� If so, create a new directory out of the "writings"
EV3ItemFlags% = !(lastmenuptr%+28+(selection%*24))
E`� ((ItemFlags% � 4)=4) �
Ejy� PROCerror("Selection:"+STR$selection%+" At level:"+STR$nestlevel%+" Writable ... ItemFlags="+STR$~ItemFlags%+CHR$0)
Et � Create new directory
E~% �("CDIR "+dropdir$+"."+leaf$+�0)
E� � Rebuild last sub menu
E� RebuildLastSubMenu%=1
E� ReOpenFlag%=�
E� 
E� �
E�
E� � (addlink%=1) �
E�K  � PROCerror("Adding shortcut["+newlinkleaf$+"] into "+dropdir$+CHR$0)
E�@  �addnewshortcut(currentdropdir$,newlinkfile$,newlinkleaf$)
E�  � Rebuild last sub menu
E�  RebuildLastSubMenu%=1
E�  ReOpenFlag%=�
F �
F

F � (addlink%=0) � 
F>  � Should we insert a writeable something into this menu?
F(  � (LeftAlt%<>0) �
F2O�  PROCerror("Inserting a writeable icon into level:"+STR$nestlevel%+CHR$0)
F<   AddWriteableFlag%=1
FF   RebuildLastSubMenu%=1
FP  
G"   ReOpenFlag%=�
G,  �
G6 
G@%  � Is the Right ALT key pressed?
GJ<  � If so delete this link LALT(-6) RALT(-9) L/R ALT(-3)
GT>  � (RightAlt%<>0 � IsLinkDirectory%=0 � IsGreyedOut%=0) �
G^/   � PROCerror("Deleting link "+dir$+CHR$0)
Gh   �("delete "+dir$+�0)
Gr   � Alter menu structure
G|:   IconFlagsAddr%=currentmenuptr%+28+8+(selection%*24)
G�C   !IconFlagsAddr% = (!IconFlagsAddr%)+(2^22):� Grey out sprite
G�=   !IconFlagsAddr% = !IconFlagsAddr% � &ffffff:� Grey out
G�8   !IconFlagsAddr% = !IconFlagsAddr%+&1000000:� text
G�   � RebuildLastSubMenu%=1
G�   ReOpenFlag%=1
G�  �
G�  
G�1  � Should we delete this directory of links?
G�>  � (RightAlt%<>0 � IsLinkDirectory%=1 � IsGreyedOut%=0) �
G�4   � PROCerror("Deleting directory "+dir$+CHR$0)
G�#   $string% = "delete "+dir$+�0
G�*   ș "XOS_CLI",string% � ; ErrorFlag%
G�_   � (ErrorFlag% � 1) �error("Error removing "+dir$+". The directory may not be empty."+�0)
H#   �OSCLI("delete "+dir$+CHR$0)
H   � Alter menu structure
H:   IconFlagsAddr%=currentmenuptr%+28+8+(selection%*24)
H&:   �  PROCerror("Flags:"+STR$~(!IconFlagsAddr%)+CHR$0)
H0C   � !IconFlagsAddr% = (!IconFlagsAddr%)+(2^22):REM Grey sprite
H:C   � !IconFlagsAddr% = !IconFlagsAddr% AND &ffffff:REM Grey out
HD<   � !IconFlagsAddr% = !IconFlagsAddr%+&1000000:REM text
HN   RebuildLastSubMenu%=1
HX   ReOpenFlag%=1   
Hb  �
Hl 
Hv  � Is this runnable?
H�Q  � PROCerror("submenu="+STR$submenuptr%+" Dir?:"+STR$IsLinkDirectory%+CHR$0)
H�J  � (LeftAlt%=0 � RightAlt%=0 � IsLinkDirectory%=0 � IsGreyedOut%=0) �
H�/   � Get the desktop filer to run this link
H�/   dir$="Filer_Run "+�GetLinkContents(dir$)
H�#   � PROCerror("* "+dir$+CHR$0)
H�'   � PROCerror("OSCLI "+dir$+CHR$0)
H�   �(dir$+�0)
H�  �
H� �:� IF adlink%=0 ...
H��:� IF writeable ...
H�
H�;� Check if ADJUST pressed in which case, reprint menus.
H�$ș"Wimp_GetPointerInfo",,block2%
Ibutton%=block2%!8
I� button%=1 ReOpenFlag%=�
I
I � (RebuildLastSubMenu%) �
I*i� PROCerror("Rebuilding submenu '"+parent$+"' from "+droppardir$+" at Depth="+STR$(nestlevel%)+CHR$0)
I4J�SingleDirectoryRead(droppardir$,parent$,nestlevel%,AddWriteableFlag%)
I>�
IH 
IR� (ReOpenFlag%) �
I\! �showmenu(shortcutmenu%,0,0)
If �
Ip3 IconBarMenuOpen%=0:� Reenable icon bar tooltip
Iz�
I��
I�
I���click_info(button%)
I�Ȏ button% �
I�V� 2:CurrentMenuType%=MainMenuType%:�showmenu(main_menu%,!block%-64, (block%!4)+32)
I��
I��
I�
I�(��windowmenuselect(WindowMenuIndex%)
I�#� OpenWin%, ErrorFlag%, button%
I�� WinMenuItemFlag%, Action%
I�2� block%+00 is selection number of first menu,
I�8� block%+04 is selection number of second level etc.
J!�sel1%=!block%:sel2%=block%!4
Jsel1%=WindowMenuIndex%
J#È™"Wimp_GetPointerInfo",,block%
J$button%=block%!8
J.Q� PROCerror("["+STR$sel1%+"] Opening "+$(shortcutmenudata%+(sel1%*64))+CHR$0)
J8/OpenWin%=!(shortcutmenudata%+(sel1%*64)+60)
JB!winopenblock%=OpenWin%
JL:ș"XWimp_GetWindowState",,winopenblock% � ; ErrorFlag%
JV� (ErrorFlag%<>0) �
J` winopenblock%!28=-1
Jj Action%=0:� Open Window
Jt, � (�-1) Action%=1:� Open parent (SHIFT)
J~- � IF (INKEY-3) Action%=2:REM Close (ALT)
J�
J� � (Action%=0) �
J�6  ș "XWimp_SendMessage",2, winopenblock%,OpenWin%
J� �
J� 
J� � (Action%=1) �
J�6  ș "XWimp_SendMessage",3, winopenblock%,OpenWin%
J� �
J� 
J�  � (Action%=2) �
J�   !winopenblock%=OpenWin%
J�,   ș "XWimp_CloseWindow",,winopenblock%
K!   � Grey out this menu entry
K
:   WinMenuItemFlag% = !(shortcutmenu%+28+(sel1%*24)+8)
K5   WinMenuItemFlag% = WinMenuItemFlag% � &400000 
K:   !(shortcutmenu%+28+(sel1%*24)+8) = WinMenuItemFlag%
K(  �
K2  
K<�
KF
KP;� Check if ADJUST pressed in which case, reprint menus.
KZ� button%=1 �
Kd �showmenu(shortcutmenu%,0,0)
Kn*CurrentMenuType% = WindowListMenuType%
Kx�
K�� SYS"Wimp_CreateMenu",,-1
K�2IconBarMenuOpen%=0:� Reenable icon bar tooltip
K��
K�
K��
K�
K���mainmenuselect
K�2� block%+00 is selection number of first menu,
K�8� block%+04 is selection number of second level etc.
K� sel1%=!block%:sel2%=block%!4
K�#ș"Wimp_GetPointerInfo",,block%
K�button%=block%!8
K�Ȏ sel1% �
L� 0:�OpenInfoBox
L� 1:�ClickToolMenu(sel2%)
L5� 2:�error("Sorry, TODO."+�0):� PROCClickUserMenu
L"� 3:�ClickHelpButton
L,� 4:�ToggleAdvancedMenus
L6� 5:�cascade
L@� 6:�ShowTree
LJ� 7:quit%=�
LT�
L^;� Check if ADJUST pressed in which case, reprint menus.
Lh� button%=1 �
Lr�showmenu(main_menu%,0,0)
L|�
L�2IconBarMenuOpen%=0:� Reenable icon bar tooltip
L��
L��
L�
L���ClickHelpButton
L�%�("Filer_Run <xuenbs$dir>.!help")
L��
L�
L���ClickToolMenu(sel2%)
L�Ȏ sel2% �
L�� 0:�clear
L�� 1:�smash
L�� 2:�OpenLinks
M� 3:�SaveSpritePools
M�
M�
M&
M0��SaveSpritePools
M:7�("Filer_Run "+AppPath$+".Resources.GetSprites"+�0)
MD�
MN
MX��smash
Mb7�("Filer_Run "+AppPath$+".Resources.SmashClose"+�0)
Ml�
Mv
M���OpenLinks
M�<�("Filer_Opendir "+AppPath$+".Users."+User$+".Links"+�0)
M��
M�
M���showmenu(menu%,mx%,my%)
M�;ș"Wimp_CreateMenu",,menu%,mx%,my% � currentmenuhandle%
M��
M�
M�9� ***************************************************
M�
M���ShowTree
M�!block% = whandle_tree%
M�block%!4 = 64
Nblock%!8 = 64
Nblock%!12 = 1024
Nblock%!16 = 912
N block%!20 = 0
N*block%!24 = 0
N4block%!28 = -1
N>È™"Wimp_OpenWindow",,block%
NH
NR%� PROCerror("Sorry, TODO."+CHR$0)
N\�
Nf
Np9� ***************************************************
Nz
N���ToggleAdvancedMenus
N�� flag%
N�9GlobalShowBootMenuFlag% = GlobalShowBootMenuFlag% � 1
N�"flags%=!(main_menu%+28+(4*24))
N�1flags% = flag% � (GlobalShowBootMenuFlag%<<0)
N�/� PROCerror("Flags = "+STR$~(flags%)+CHR$0)
N�"!(main_menu%+28+(4*24))=flags%
N��
N�
N�9� ***************************************************
N�
N�
N�)� Tell WIMP to initialise a new menu.
O?� This should really be done by loading in a MENU template.
O��setupmenu(menu%)
O� title$,num%:$menu%=title$
O$width%=(�(title$)-2)*16
O.-menu%!12=&00070207:menu%!20=44:menu%!24=0
O8ptr%=menu%+28:� i%=1�num%
OB� mflags%,subptr%,item$
OL !ptr%=mflags%:ptr%!4=subptr%
OV$ptr%!8=&7000021:$(ptr%+12)=item$
O`a%=(�(item$)+1)*16
Oj� a%>width% width%=a%
Otptr%+=24:�
O~menu%!16=width%
O��
O�
O�9� ***************************************************
O�
O�
��init
O�=� Do ~~Open and ~~Close files exist? If not, create empty
O�0� copies of them to prevent !Start crashing.
O�
O�!�ensuredir(AppPath$+".Users")
O�(�ensuredir(AppPath$+".Users."+User$)
O�1�ensuredir(AppPath$+".Users."+User$+".Links")
O�1�ensuredir(AppPath$+".Users."+User$+".Links")
P8�ensuredir(AppPath$+".Users."+User$+".Links.~~Boot")
P
7�ensuredir(AppPath$+".Users."+User$+".Links.~~Run")
P;�ensuredir(AppPath$+".Users."+User$+".Links.~~RunQuit")
P
P(/$string%=AppPath$+".Users."+User$+".~~Open"
P2$ș"OS_File",17,string% � result%
P<A� (result%=0) � X%=�(AppPath$+".Users."+User$+".~~Open"):�#X%
PF0$string%=AppPath$+".Users."+User$+".~~Close"
PP$ș"OS_File",17,string% � result%
PZB� (result%=0) � X%=�(AppPath$+".Users."+User$+".~~Close"):�#X%
Pd
PnPș "Wimp_Initialise",200,&4B534154,app$ � current_wimp_version%,task_handle%
Px
P�� Create INFO window
P�#!infodata% = 0: infodata%!4 = 0
P�)infodata%!8 = 642: infodata%!12 = 212
P�&infodata%!16 = 0: infodata%!20 = 0
P�infodata%!24 = -1:� Top
P�infodata%!28 = 1+2+16+64
P�infodata%!32 = &01090207
P�infodata%!36 = &000C0103
P�&infodata%!40 = 0: infodata%!44 = 0
P�*infodata%!48 = 642: infodata%!52 = 212
P�/infodata%!56 = %111000000000000000000011001
P�infodata%!60 = 0
P�infodata%!64 = 1
Qinfodata%!68 = 0
Q$(infodata%+72) = "Info"
Q%infodata%!84=0:� No icons yet ...
Q" � Create INFO icon block ...
Q,tptr%=infodata%+88
Q6Dtptr% = �AddIcon(8,164, 642-156,40, "Xuen",tptr%,infodata%+84,0)
Q@Mtptr% = �AddIcon(8,112, 642-156,40, "Desktop Tool",tptr%,infodata%+84, 0)
QJMtptr% = �AddIcon(8,60, 642-156,40, "Barny Short", tptr%, infodata%+84, 0)
QTTtptr% = �AddIcon(8,8, 642-156,40, appversion$+" May-98", tptr%, infodata%+84, 0)
Q^Htptr% = �AddIcon(642-136,8, 128,212-16,"!xuen",tptr%,infodata%+84,1)
Qh4ș"Wimp_CreateWindow",,infodata% � whandle_info%
Qr
Q|
Q�� Create TREE window
Q�#!infodata% = 0: infodata%!4 = 0
Q�9infodata%!8 = FilerViewW%: infodata%!12 = FilerViewH%
Q�&infodata%!16 = 0: infodata%!20 = 0
Q�infodata%!24 = -1:� Top
Q�*infodata%!28 = 1+2+16+64+(1<<2)+(1<<3)
Q�infodata%!32 = &01090207
Q�infodata%!36 = &000C0103
Q�&infodata%!40 = 0: infodata%!44 = 0
Q�:infodata%!48 = FilerViewW%: infodata%!52 = FilerViewH%
Q�/infodata%!56 = %111000000000000000000011001
Q�infodata%!60 = 0
Q�infodata%!64 = 1
Rinfodata%!68 = 0
R"$(infodata%+72) = "Filer Tree"
R%infodata%!84=0:� No icons yet ...
R& � Create INFO icon block ...
R0tptr%=infodata%+88
R:Qtptr% = �AddIcon(144,(FilerViewH%/4)*3, 642-156,40, "A",tptr%,infodata%+84,0)
RDRtptr% = �AddIcon(144,(FilerViewH%/4)*2, 642-156,40, "B",tptr%,infodata%+84, 0)
RNPtptr% = �AddIcon(144,FilerViewH%/4, 642-156,40, "C", tptr%, infodata%+84, 0)
RXDtptr% = �AddIcon(144,8, 642-156,40, "D", tptr%, infodata%+84, 0)
RbBtptr% = �AddIcon(8,8, 128,212-16,"!xuen",tptr%,infodata%+84,1)
Rl4ș"Wimp_CreateWindow",,infodata% � whandle_tree%
Rv
R�
R�
R�� Create toolbox menu
R�
� �@pS
R��setupmenu(tool_menu%)
R�� Create main menu
R�
� �PLS
R��setupmenu(main_menu%)
R�=� Install an icon on the icon bar using the shortcut icon
R�`iconbarhandle%=�create_icon(-2,0,-16,84,106,&1700310B,"!xuen",iconbarlabel%,iconbardata%,32)
R��
R�
R�9� ***************************************************
S
S� "Xuen",8
S� 0,whandle_info%,"Info"
S � 0,tool_menu%,"Toolbox"
S*� 0,-1,"User"
S4� 0,-1,"Help"
S>� 0,-1,"Advanced"
SH� 0,-1,"Cascade"
SR� 2,-1,"Tree"
S\� &80,-1,"Quit"
Sf
Sp� "Toolbox",4
Sz� 0,-1,"Clean"
S�� 0,-1,"SmashnClose"
S�� 0,-1,"Edit Links"
S�� &80,-1,"SaveSprites"
S�
S�>� ********************************************************
S�  
�
00000000  0d 00 0a 35 f4 20 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |...5. **********|
00000010  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000030  2a 2a 2a 2a 2a 0d 00 14  14 f4 20 4e 61 6d 65 20  |*****..... Name |
00000040  20 20 20 3a 20 58 75 65  6e 0d 00 1e 35 f4 20 50  |   : Xuen...5. P|
00000050  75 72 70 6f 73 65 20 3a  20 4d 61 6b 65 20 52 69  |urpose : Make Ri|
00000060  73 63 4f 53 20 44 65 73  6b 74 6f 70 20 6d 6f 72  |scOS Desktop mor|
00000070  65 20 65 66 66 69 63 69  65 6e 74 28 21 29 0d 00  |e efficient(!)..|
00000080  28 1b f4 20 41 75 74 68  6f 72 20 20 3a 20 42 61  |(.. Author  : Ba|
00000090  72 6e 79 20 53 68 6f 72  74 0d 00 32 1b f4 20 44  |rny Short..2.. D|
000000a0  61 74 65 20 20 20 20 3a  20 33 30 2d 4d 61 79 2d  |ate    : 30-May-|
000000b0  31 39 39 38 0d 00 3c 35  f4 20 2a 2a 2a 2a 2a 2a  |1998..<5. ******|
000000c0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000000e0  2a 2a 2a 2a 2a 2a 2a 2a  2a 0d 00 46 16 61 70 70  |*********..F.app|
000000f0  76 65 72 73 69 6f 6e 24  3d 22 31 31 2e 30 22 0d  |version$="11.0".|
00000100  00 50 35 f4 20 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |.P5. ***********|
00000110  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000130  2a 2a 2a 2a 0d 00 5a 04  0d 00 64 17 47 6c 6f 62  |****..Z...d.Glob|
00000140  61 6c 45 72 72 6f 72 53  74 61 74 65 25 3d 30 0d  |alErrorState%=0.|
00000150  00 6e 3e 52 61 6e 64 6f  6d 54 6f 6f 6c 54 69 70  |.n>RandomToolTip|
00000160  25 3d 31 3a f4 20 45 6e  61 62 6c 65 28 3d 31 29  |%=1:. Enable(=1)|
00000170  2f 44 69 73 61 62 6c 65  28 3d 30 29 20 72 61 6e  |/Disable(=0) ran|
00000180  64 6f 6d 20 74 6f 6f 6c  20 74 69 70 73 0d 00 78  |dom tool tips..x|
00000190  27 ee 20 85 20 f2 65 72  72 6f 72 28 f6 24 2b 22  |'. . .error(.$+"|
000001a0  20 61 74 20 6c 69 6e 65  20 22 2b c3 9e 29 3a d9  | at line "+..):.|
000001b0  23 30 3a e0 0d 00 82 04  0d 00 8c 16 f4 4f 4e 20  |#0:..........ON |
000001c0  45 52 52 4f 52 20 47 4f  54 4f 40 40 40 40 0d 00  |ERROR GOTO@@@@..|
000001d0  96 04 0d 00 a0 25 c8 9b  20 22 3c 4f 62 65 79 24  |.....%.. "<Obey$|
000001e0  44 69 72 3e 2e 52 65 73  6f 75 72 63 65 73 2e 4c  |Dir>.Resources.L|
000001f0  69 62 73 2e 4f 53 22 0d  00 aa 28 c8 9b 20 22 3c  |ibs.OS"...(.. "<|
00000200  4f 62 65 79 24 44 69 72  3e 2e 52 65 73 6f 75 72  |Obey$Dir>.Resour|
00000210  63 65 73 2e 4c 69 62 73  2e 46 69 6c 65 72 22 0d  |ces.Libs.Filer".|
00000220  00 b4 27 c8 9b 20 22 3c  4f 62 65 79 24 44 69 72  |..'.. "<Obey$Dir|
00000230  3e 2e 52 65 73 6f 75 72  63 65 73 2e 4c 69 62 73  |>.Resources.Libs|
00000240  2e 57 69 6d 70 22 0d 00  be 2a c8 9b 20 22 3c 4f  |.Wimp"...*.. "<O|
00000250  62 65 79 24 44 69 72 3e  2e 52 65 73 6f 75 72 63  |bey$Dir>.Resourc|
00000260  65 73 2e 4c 69 62 73 2e  54 6f 6f 6c 74 69 70 22  |es.Libs.Tooltip"|
00000270  0d 00 c8 04 0d 00 d2 20  50 69 63 74 75 72 65 54  |....... PictureT|
00000280  79 70 65 25 3d 26 64 39  34 3a f4 20 41 72 74 77  |ype%=&d94:. Artw|
00000290  6f 72 6b 73 0d 00 dc 2c  44 6f 63 75 6d 65 6e 74  |orks...,Document|
000002a0  54 79 70 65 25 3d 26 62  63 35 3a f4 20 49 6d 70  |Type%=&bc5:. Imp|
000002b0  72 65 73 73 69 6f 6e 20  44 6f 63 75 6d 65 6e 74  |ression Document|
000002c0  0d 00 e6 2e 55 73 65 72  24 3d 22 41 64 6d 69 6e  |....User$="Admin|
000002d0  22 3a f4 20 44 65 66 61  75 6c 74 20 55 73 65 72  |":. Default User|
000002e0  20 6e 61 6d 65 20 69 73  20 41 64 6d 69 6e 0d 00  | name is Admin..|
000002f0  f0 04 0d 00 fa 0f 61 70  70 24 3d 22 58 75 65 6e  |......app$="Xuen|
00000300  22 0d 01 04 0f 41 70 70  50 61 74 68 24 3d 22 22  |"....AppPath$=""|
00000310  0d 01 0e 0f 41 70 70 44  61 74 65 24 3d 22 22 0d  |....AppDate$="".|
00000320  01 18 2f de 20 61 70 70  70 61 74 68 20 32 35 35  |../. apppath 255|
00000330  2c 20 61 70 70 70 61 74  68 76 61 72 20 33 32 2c  |, apppathvar 32,|
00000340  20 61 70 70 64 61 74 65  76 61 72 20 33 32 0d 01  | appdatevar 32..|
00000350  22 2a 24 61 70 70 64 61  74 65 76 61 72 3d 22 3c  |"*$appdatevar="<|
00000360  53 79 73 24 54 69 6d 65  3e 20 3c 53 79 73 24 44  |Sys$Time> <Sys$D|
00000370  61 74 65 3e 22 2b bd 30  0d 01 2c 21 24 61 70 70  |ate>"+.0..,!$app|
00000380  70 61 74 68 76 61 72 3d  22 3c 58 75 65 6e 62 73  |pathvar="<Xuenbs|
00000390  24 44 69 72 3e 22 2b bd  30 0d 01 36 04 0d 01 40  |$Dir>"+.0..6...@|
000003a0  38 f4 20 41 71 75 69 72  65 20 74 68 65 20 73 74  |8. Aquire the st|
000003b0  61 72 74 20 70 61 74 68  20 74 6f 20 75 73 65 20  |art path to use |
000003c0  66 6f 72 20 64 65 6c 65  74 65 20 6f 70 65 72 61  |for delete opera|
000003d0  74 69 6f 6e 73 0d 01 4a  29 c8 99 22 4f 53 5f 47  |tions..J).."OS_G|
000003e0  53 54 72 61 6e 73 22 2c  61 70 70 70 61 74 68 76  |STrans",apppathv|
000003f0  61 72 2c 61 70 70 70 61  74 68 2c 32 35 35 0d 01  |ar,apppath,255..|
00000400  54 1d 41 70 70 50 61 74  68 24 3d a4 73 74 72 69  |T.AppPath$=.stri|
00000410  6e 67 28 61 70 70 70 61  74 68 29 0d 01 5e 04 0d  |ng(apppath)..^..|
00000420  01 68 04 0d 01 72 40 de  20 65 72 72 6f 72 62 6c  |.h...r@. errorbl|
00000430  6f 63 6b 25 20 32 30 34  38 2c 20 62 6c 6f 63 6b  |ock% 2048, block|
00000440  25 20 32 30 34 38 2c 20  62 6c 6f 63 6b 32 25 20  |% 2048, block2% |
00000450  32 30 34 38 2c 20 63 6c  69 73 74 72 69 6e 67 20  |2048, clistring |
00000460  32 35 35 0d 01 7c 4a de  20 77 69 6e 62 6c 6f 63  |255..|J. winbloc|
00000470  6b 25 20 32 30 34 38 2c  20 77 69 6e 6f 70 65 6e  |k% 2048, winopen|
00000480  62 6c 6f 63 6b 25 20 32  30 34 38 2c 20 74 72 61  |block% 2048, tra|
00000490  6e 73 62 6c 6f 63 6b 25  20 32 30 34 38 2c 20 70  |nsblock% 2048, p|
000004a0  74 72 62 6c 6f 63 6b 25  20 32 30 34 38 0d 01 86  |trblock% 2048...|
000004b0  17 de 20 75 6e 6b 6e 6f  77 6e 73 74 72 69 6e 67  |.. unknownstring|
000004c0  25 20 33 32 0d 01 90 26  24 75 6e 6b 6e 6f 77 6e  |% 32...&$unknown|
000004d0  73 74 72 69 6e 67 25 20  3d 20 22 75 6e 6b 6e 6f  |string% = "unkno|
000004e0  77 6e 5f 61 70 70 22 2b  bd 30 0d 01 9a 04 0d 01  |wn_app"+.0......|
000004f0  a4 18 de 20 49 6e 76 61  6c 69 64 44 72 69 76 65  |... InvalidDrive|
00000500  24 28 32 35 35 29 0d 01  ae 18 49 6e 76 61 6c 69  |$(255)....Invali|
00000510  64 44 72 69 76 65 43 6f  75 6e 74 25 3d 30 0d 01  |dDriveCount%=0..|
00000520  b8 04 0d 01 c2 2d de 20  64 72 61 67 73 70 72 69  |.....-. dragspri|
00000530  74 65 6e 61 6d 65 25 20  32 35 36 2c 20 62 6f 75  |tename% 256, bou|
00000540  6e 64 73 70 72 69 74 65  62 6f 78 25 20 33 32 0d  |ndspritebox% 32.|
00000550  01 cc 04 0d 01 d6 04 0d  01 e0 20 f4 20 41 75 74  |.......... . Aut|
00000560  6f 20 6c 69 6e 6b 20 62  75 66 66 65 72 20 61 64  |o link buffer ad|
00000570  64 20 73 74 75 66 66 0d  01 ea 1b 61 6c 62 61 5f  |d stuff....alba_|
00000580  64 65 73 74 69 6e 61 74  69 6f 6e 64 69 72 24 3d  |destinationdir$=|
00000590  22 22 0d 01 f4 2d 61 6c  62 61 5f 74 79 70 65 25  |""...-alba_type%|
000005a0  3d 2d 31 3a f4 20 2d 31  20 6d 65 61 6e 73 20 6e  |=-1:. -1 means n|
000005b0  6f 74 68 69 6e 67 20 69  6e 20 63 61 63 68 65 0d  |othing in cache.|
000005c0  01 fe 18 61 6c 62 61 5f  6e 65 77 6c 69 6e 6b 66  |...alba_newlinkf|
000005d0  69 6c 65 24 3d 22 22 0d  02 08 18 61 6c 62 61 5f  |ile$=""....alba_|
000005e0  6e 65 77 6c 69 6e 6b 6c  65 61 66 24 3d 22 22 0d  |newlinkleaf$="".|
000005f0  02 12 10 61 6c 62 61 5f  74 69 6d 65 25 3d 30 0d  |...alba_time%=0.|
00000600  02 1c 04 0d 02 26 16 43  41 43 48 45 5f 53 49 5a  |.....&.CACHE_SIZ|
00000610  45 25 20 3d 20 34 30 39  36 0d 02 30 10 70 61 75  |E% = 4096..0.pau|
00000620  73 65 25 20 3d 20 32 30  30 0d 02 3a 10 6f 70 65  |se% = 200..:.ope|
00000630  6e 5f 74 79 70 65 25 3d  31 0d 02 44 11 63 6c 6f  |n_type%=1..D.clo|
00000640  73 65 5f 74 79 70 65 25  3d 32 0d 02 4e 11 61 64  |se_type%=2..N.ad|
00000650  64 5f 77 69 6e 64 6f 77  25 3d 31 0d 02 58 16 73  |d_window%=1..X.s|
00000660  75 62 74 72 61 63 74 5f  77 69 6e 64 6f 77 25 3d  |ubtract_window%=|
00000670  32 0d 02 62 10 64 72 61  67 5f 74 79 70 65 25 3d  |2..b.drag_type%=|
00000680  35 0d 02 6c 0d 61 64 6a  75 73 74 25 3d 31 0d 02  |5..l.adjust%=1..|
00000690  76 0b 6d 65 6e 75 25 3d  32 0d 02 80 0d 73 65 6c  |v.menu%=2....sel|
000006a0  65 63 74 25 3d 34 0d 02  8a 14 69 63 6f 6e 62 61  |ect%=4....iconba|
000006b0  72 68 61 6e 64 6c 65 25  3d 30 0d 02 94 0f 64 69  |rhandle%=0....di|
000006c0  72 63 6f 75 6e 74 25 3d  30 0d 02 9e 13 6c 69 6e  |rcount%=0....lin|
000006d0  6b 6c 6f 61 64 61 64 64  72 25 3d 30 0d 02 a8 11  |kloadaddr%=0....|
000006e0  6f 62 6a 65 63 74 74 79  70 65 25 3d 30 0d 02 b2  |objecttype%=0...|
000006f0  0f 6c 69 6e 6b 6d 65 6e  75 25 3d 30 0d 02 bc 0e  |.linkmenu%=0....|
00000700  61 64 64 6c 69 6e 6b 25  3d 30 0d 02 c6 29 69 63  |addlink%=0...)ic|
00000710  6f 6e 62 61 72 5f 74 69  6d 65 72 25 3d 91 3a 69  |onbar_timer%=.:i|
00000720  63 6f 6e 62 61 72 5f 74  69 6d 65 72 66 6c 61 67  |conbar_timerflag|
00000730  25 3d 30 0d 02 d0 32 77  68 61 6e 64 6c 65 5f 74  |%=0...2whandle_t|
00000740  6f 6f 6c 74 69 70 25 3d  30 3a 54 6f 6f 6c 54 69  |ooltip%=0:ToolTi|
00000750  70 25 3d 30 3a 74 6f 6f  6c 74 69 70 5f 74 69 6d  |p%=0:tooltip_tim|
00000760  65 72 25 3d 30 0d 02 da  25 6f 76 65 72 72 69 64  |er%=0...%overrid|
00000770  65 5f 74 6f 6f 6c 74 69  70 25 3d 30 3a 4f 6c 64  |e_tooltip%=0:Old|
00000780  54 6f 6f 6c 54 69 70 25  3d 30 0d 02 e4 13 77 68  |ToolTip%=0....wh|
00000790  61 6e 64 6c 65 5f 74 72  65 65 25 3d 30 0d 02 ee  |andle_tree%=0...|
000007a0  1d 69 6e 74 65 72 6e 61  6c 73 74 61 63 6b 70 6f  |.internalstackpo|
000007b0  73 69 74 69 6f 6e 25 3d  2d 32 0d 02 f8 17 6f 6c  |sition%=-2....ol|
000007c0  64 73 74 61 63 6b 70 6f  73 69 74 69 6f 6e 25 3d  |dstackposition%=|
000007d0  30 0d 03 02 14 63 75 72  72 65 6e 74 77 69 6e 64  |0....currentwind|
000007e0  6f 77 25 3d 30 0d 03 0c  18 63 75 72 72 65 6e 74  |ow%=0....current|
000007f0  6d 65 6e 75 68 61 6e 64  6c 65 25 3d 30 0d 03 16  |menuhandle%=0...|
00000800  17 66 69 72 73 74 6d 65  6e 75 68 61 6e 64 6c 65  |.firstmenuhandle|
00000810  25 3d 2d 33 0d 03 20 16  49 63 6f 6e 42 61 72 4d  |%=-3.. .IconBarM|
00000820  65 6e 75 4f 70 65 6e 25  3d 30 0d 03 2a 1a 53 74  |enuOpen%=0..*.St|
00000830  61 72 74 4d 65 6e 75 53  65 70 65 72 61 74 6f 72  |artMenuSeperator|
00000840  25 3d 2d 31 0d 03 34 1b  53 74 61 72 74 4d 65 6e  |%=-1..4.StartMen|
00000850  75 53 65 70 65 72 61 74  6f 72 32 25 3d 2d 31 0d  |uSeperator2%=-1.|
00000860  03 3e 1b 53 74 61 72 74  4d 65 6e 75 53 65 70 65  |.>.StartMenuSepe|
00000870  72 61 74 6f 72 33 25 3d  2d 31 0d 03 48 16 53 79  |rator3%=-1..H.Sy|
00000880  73 46 69 6c 65 50 72 65  66 69 78 25 3d 31 32 36  |sFilePrefix%=126|
00000890  0d 03 52 14 42 6f 74 74  6f 6d 45 64 67 65 46 6c  |..R.BottomEdgeFl|
000008a0  61 67 3d 30 0d 03 5c 0c  61 66 74 65 72 25 3d 30  |ag=0..\.after%=0|
000008b0  0d 03 66 18 77 68 61 6e  64 6c 65 5f 64 75 6d 6d  |..f.whandle_dumm|
000008c0  79 62 61 63 6b 25 3d 30  0d 03 70 14 4c 61 73 74  |yback%=0..p.Last|
000008d0  52 69 67 68 74 45 64 67  65 25 3d 30 0d 03 7a 11  |RightEdge%=0..z.|
000008e0  43 61 73 63 61 64 65 52  6f 77 25 3d 30 0d 03 84  |CascadeRow%=0...|
000008f0  14 43 75 72 72 65 6e 74  42 75 74 74 6f 6e 25 3d  |.CurrentButton%=|
00000900  30 0d 03 8e 0b 74 70 74  72 25 3d 30 0d 03 98 04  |0....tptr%=0....|
00000910  0d 03 a2 1e f4 20 46 69  6c 65 72 20 74 72 65 65  |..... Filer tree|
00000920  20 72 65 6c 61 74 65 64  20 73 74 75 66 66 0d 03  | related stuff..|
00000930  ac 15 46 69 6c 65 72 56  69 65 77 57 25 20 3d 20  |..FilerViewW% = |
00000940  36 34 32 0d 03 b6 15 46  69 6c 65 72 56 69 65 77  |642....FilerView|
00000950  48 25 20 3d 20 35 31 32  0d 03 c0 04 0d 03 ca 1a  |H% = 512........|
00000960  47 6c 6f 62 61 6c 4d 65  6e 75 49 74 65 6d 43 6f  |GlobalMenuItemCo|
00000970  75 6e 74 25 3d 30 0d 03  d4 19 47 6c 6f 62 61 6c  |unt%=0....Global|
00000980  4d 65 6e 75 53 65 70 43  6f 75 6e 74 25 3d 30 0d  |MenuSepCount%=0.|
00000990  03 de 15 47 6c 6f 62 61  6c 54 6f 6f 6c 54 69 70  |...GlobalToolTip|
000009a0  24 3d 22 22 0d 03 e8 14  47 6c 6f 62 61 6c 53 74  |$=""....GlobalSt|
000009b0  61 74 65 25 20 3d 20 30  0d 03 f2 1b 47 6c 6f 62  |ate% = 0....Glob|
000009c0  61 6c 53 74 61 74 65 50  72 65 42 6f 6f 74 25 20  |alStatePreBoot% |
000009d0  3d 20 30 0d 03 fc 1c 47  6c 6f 62 61 6c 53 74 61  |= 0....GlobalSta|
000009e0  74 65 50 6f 73 74 42 6f  6f 74 25 20 3d 20 31 0d  |tePostBoot% = 1.|
000009f0  04 06 18 47 6c 6f 62 61  6c 53 74 61 74 65 49 64  |...GlobalStateId|
00000a00  6c 65 25 20 3d 20 32 0d  04 10 1c 47 6c 6f 62 61  |le% = 2....Globa|
00000a10  6c 53 74 61 74 65 53 68  75 74 44 6f 77 6e 25 20  |lStateShutDown% |
00000a20  3d 20 33 0d 04 1a 13 47  6c 6f 62 61 6c 53 74 65  |= 3....GlobalSte|
00000a30  70 25 20 3d 20 30 0d 04  24 1d 47 6c 6f 62 61 6c  |p% = 0..$.Global|
00000a40  53 68 6f 77 42 6f 6f 74  4d 65 6e 75 46 6c 61 67  |ShowBootMenuFlag|
00000a50  25 3d 30 0d 04 2e 15 52  45 43 55 52 53 45 5f 42  |%=0....RECURSE_B|
00000a60  4f 4f 54 25 20 3d 20 31  0d 04 38 14 52 45 43 55  |OOT% = 1..8.RECU|
00000a70  52 53 45 5f 52 55 4e 25  20 3d 20 32 0d 04 42 04  |RSE_RUN% = 2..B.|
00000a80  0d 04 4c 30 f4 20 49 6e  73 65 72 74 20 79 6f 75  |..L0. Insert you|
00000a90  72 20 63 68 6f 69 63 65  20 6f 66 20 72 61 6e 64  |r choice of rand|
00000aa0  6f 6d 20 74 6f 6f 6c 74  69 70 73 20 68 65 72 65  |om tooltips here|
00000ab0  0d 04 56 33 52 61 6e 64  54 69 70 4d 61 78 25 3d  |..V3RandTipMax%=|
00000ac0  35 3a f4 20 54 6f 74 61  6c 20 6e 75 6d 62 65 72  |5:. Total number|
00000ad0  20 6f 66 20 72 61 6e 64  6f 6d 20 74 6f 6f 6c 74  | of random toolt|
00000ae0  69 70 73 0d 04 60 1b de  20 52 61 6e 64 54 69 70  |ips..`.. RandTip|
00000af0  24 28 52 61 6e 64 54 69  70 4d 61 78 25 29 0d 04  |$(RandTipMax%)..|
00000b00  6a 44 52 61 6e 64 54 69  70 24 28 31 29 3d 22 49  |jDRandTip$(1)="I|
00000b10  66 20 69 74 27 73 20 67  65 74 74 69 6e 67 20 63  |f it's getting c|
00000b20  6f 6d 70 6c 69 63 61 74  65 64 2c 20 79 6f 75 27  |omplicated, you'|
00000b30  72 65 20 64 6f 69 6e 67  20 69 74 20 77 72 6f 6e  |re doing it wron|
00000b40  67 22 0d 04 74 2d 52 61  6e 64 54 69 70 24 28 32  |g"..t-RandTip$(2|
00000b50  29 3d 22 59 6f 75 20 75  73 65 20 63 6f 6d 70 75  |)="You use compu|
00000b60  74 65 72 73 20 74 6f 6f  20 6d 75 63 68 21 22 0d  |ters too much!".|
00000b70  04 7e 20 52 61 6e 64 54  69 70 24 28 33 29 3d 22  |.~ RandTip$(3)="|
00000b80  48 61 62 6c 6f 20 65 73  70 61 6e 6f 6c 21 22 0d  |Hablo espanol!".|
00000b90  04 88 2e 52 61 6e 64 54  69 70 24 28 34 29 3d 22  |...RandTip$(4)="|
00000ba0  48 61 76 65 20 79 6f 75  20 72 65 61 64 20 44 69  |Have you read Di|
00000bb0  6c 62 65 72 74 20 74 6f  64 61 79 3f 22 0d 04 92  |lbert today?"...|
00000bc0  21 52 61 6e 64 54 69 70  24 28 35 29 3d 22 54 61  |!RandTip$(5)="Ta|
00000bd0  6b 65 20 79 6f 75 72 20  76 69 74 73 21 22 0d 04  |ke your vits!"..|
00000be0  9c 04 0d 04 a6 16 49 63  6f 6e 42 61 72 41 6e 69  |......IconBarAni|
00000bf0  6d 53 69 7a 65 25 3d 36  0d 04 b0 24 de 20 49 63  |mSize%=6...$. Ic|
00000c00  6f 6e 42 61 72 41 6e 69  6d 24 28 49 63 6f 6e 42  |onBarAnim$(IconB|
00000c10  61 72 41 6e 69 6d 53 69  7a 65 25 29 0d 04 ba 1c  |arAnimSize%)....|
00000c20  49 63 6f 6e 42 61 72 41  6e 69 6d 24 28 30 29 3d  |IconBarAnim$(0)=|
00000c30  22 53 78 75 65 6e 30 22  0d 04 c4 1d 49 63 6f 6e  |"Sxuen0"....Icon|
00000c40  42 61 72 41 6e 69 6d 24  28 31 29 3d 22 53 78 75  |BarAnim$(1)="Sxu|
00000c50  65 6e 33 30 22 0d 04 ce  1d 49 63 6f 6e 42 61 72  |en30"....IconBar|
00000c60  41 6e 69 6d 24 28 32 29  3d 22 53 78 75 65 6e 36  |Anim$(2)="Sxuen6|
00000c70  30 22 0d 04 d8 1d 49 63  6f 6e 42 61 72 41 6e 69  |0"....IconBarAni|
00000c80  6d 24 28 33 29 3d 22 53  78 75 65 6e 39 30 22 0d  |m$(3)="Sxuen90".|
00000c90  04 e2 1e 49 63 6f 6e 42  61 72 41 6e 69 6d 24 28  |...IconBarAnim$(|
00000ca0  34 29 3d 22 53 78 75 65  6e 31 32 30 22 0d 04 ec  |4)="Sxuen120"...|
00000cb0  1e 49 63 6f 6e 42 61 72  41 6e 69 6d 24 28 35 29  |.IconBarAnim$(5)|
00000cc0  3d 22 53 78 75 65 6e 31  35 30 22 0d 04 f6 15 49  |="Sxuen150"....I|
00000cd0  63 6f 6e 42 61 72 41 6e  69 6d 53 74 65 70 3d 30  |conBarAnimStep=0|
00000ce0  0d 05 00 16 49 63 6f 6e  42 61 72 41 6e 69 6d 44  |....IconBarAnimD|
00000cf0  69 72 3d 30 2e 35 0d 05  0a 04 0d 05 14 16 57 69  |ir=0.5........Wi|
00000d00  6e 64 6f 77 4c 69 73 74  49 63 6f 6e 25 3d 2d 31  |ndowListIcon%=-1|
00000d10  0d 05 1e 16 57 69 6e 64  6f 77 4c 69 73 74 54 69  |....WindowListTi|
00000d20  6d 65 72 25 3d 30 0d 05  28 04 0d 05 32 19 4d 61  |mer%=0..(...2.Ma|
00000d30  78 57 69 6e 64 6f 77 4c  69 73 74 53 69 7a 65 25  |xWindowListSize%|
00000d40  3d 36 34 0d 05 3c 15 57  69 6e 64 6f 77 4c 69 73  |=64..<.WindowLis|
00000d50  74 53 69 7a 65 25 3d 30  0d 05 46 29 de 20 57 69  |tSize%=0..F). Wi|
00000d60  6e 64 6f 77 4c 69 73 74  4e 61 6d 65 24 28 4d 61  |ndowListName$(Ma|
00000d70  78 57 69 6e 64 6f 77 4c  69 73 74 53 69 7a 65 25  |xWindowListSize%|
00000d80  29 0d 05 50 2b de 20 57  69 6e 64 6f 77 4c 69 73  |)..P+. WindowLis|
00000d90  74 48 61 6e 64 6c 65 25  28 4d 61 78 57 69 6e 64  |tHandle%(MaxWind|
00000da0  6f 77 4c 69 73 74 53 69  7a 65 25 29 0d 05 5a 04  |owListSize%)..Z.|
00000db0  0d 05 64 16 43 75 72 72  65 6e 74 4d 65 6e 75 54  |..d.CurrentMenuT|
00000dc0  79 70 65 25 3d 30 0d 05  6e 15 4d 61 69 6e 4d 65  |ype%=0..n.MainMe|
00000dd0  6e 75 54 79 70 65 25 20  3d 20 30 0d 05 78 1b 57  |nuType% = 0..x.W|
00000de0  69 6e 64 6f 77 4c 69 73  74 4d 65 6e 75 54 79 70  |indowListMenuTyp|
00000df0  65 25 20 3d 20 31 0d 05  82 19 53 68 6f 72 74 43  |e% = 1....ShortC|
00000e00  75 74 4d 65 6e 75 54 79  70 65 25 20 3d 20 32 0d  |utMenuType% = 2.|
00000e10  05 8c 04 0d 05 96 15 4d  65 6e 75 49 73 4f 70 65  |.......MenuIsOpe|
00000e20  6e 46 6c 61 67 25 3d 30  0d 05 a0 04 0d 05 aa 51  |nFlag%=0.......Q|
00000e30  de 20 64 62 6c 6f 63 6b  25 20 31 30 32 34 2c 20  |. dblock% 1024, |
00000e40  62 6f 6f 74 62 6c 6f 63  6b 25 20 31 30 32 34 2c  |bootblock% 1024,|
00000e50  20 73 68 6f 72 74 63 75  74 6d 65 6e 75 25 20 31  | shortcutmenu% 1|
00000e60  36 30 30 30 2c 20 73 68  6f 72 74 63 75 74 6d 65  |6000, shortcutme|
00000e70  6e 75 64 61 74 61 25 20  32 30 33 38 34 0d 05 b4  |nudata% 20384...|
00000e80  55 de 20 6d 61 69 6e 5f  6d 65 6e 75 25 20 32 35  |U. main_menu% 25|
00000e90  36 2c 20 74 6f 6f 6c 5f  6d 65 6e 75 25 20 32 35  |6, tool_menu% 25|
00000ea0  36 2c 20 74 79 70 65 62  75 66 25 20 32 35 36 2c  |6, typebuf% 256,|
00000eb0  20 69 63 6f 6e 62 61 72  6c 61 62 65 6c 25 20 33  | iconbarlabel% 3|
00000ec0  32 2c 20 69 63 6f 6e 62  61 72 64 61 74 61 25 20  |2, iconbardata% |
00000ed0  33 32 0d 05 be 59 de 20  73 74 72 69 6e 67 25 20  |32...Y. string% |
00000ee0  31 30 32 34 2c 20 62 6f  6f 74 73 74 72 69 6e 67  |1024, bootstring|
00000ef0  25 20 31 30 32 34 2c 20  69 6e 66 6f 64 61 74 61  |% 1024, infodata|
00000f00  25 20 32 30 34 38 2c 20  74 6f 6f 6c 74 69 70 64  |% 2048, tooltipd|
00000f10  61 74 61 25 20 32 30 34  38 2c 20 74 6f 6f 6c 74  |ata% 2048, toolt|
00000f20  69 70 69 63 6f 6e 25 20  35 31 32 0d 05 c8 18 de  |ipicon% 512.....|
00000f30  20 63 61 63 68 65 25 20  43 41 43 48 45 5f 53 49  | cache% CACHE_SI|
00000f40  5a 45 25 0d 05 d2 1f de  20 64 69 72 6c 69 73 74  |ZE%..... dirlist|
00000f50  25 28 33 32 29 2c 20 64  69 72 70 74 72 25 28 33  |%(32), dirptr%(3|
00000f60  32 29 0d 05 dc 04 0d 05  e6 10 63 61 63 68 65 5f  |2)........cache_|
00000f70  65 78 74 25 3d 30 0d 05  f0 12 74 61 73 6b 5f 68  |ext%=0....task_h|
00000f80  61 6e 64 6c 65 25 3d 30  0d 05 fa 18 64 72 61 67  |andle%=0....drag|
00000f90  5f 62 75 74 74 6f 6e 25  3d 61 64 6a 75 73 74 25  |_button%=adjust%|
00000fa0  0d 06 04 09 44 58 25 3d  30 0d 06 0e 10 64 72 61  |....DX%=0....dra|
00000fb0  67 5f 69 63 6f 6e 25 3d  30 0d 06 18 0c 70 61 74  |g_icon%=0....pat|
00000fc0  68 24 3d 22 22 0d 06 22  13 69 6e 5f 6c 65 66 74  |h$=""..".in_left|
00000fd0  72 65 67 69 6f 6e 3d a3  0d 06 2c 14 69 6e 5f 72  |region=...,.in_r|
00000fe0  69 67 68 74 72 65 67 69  6f 6e 3d a3 0d 06 36 0e  |ightregion=...6.|
00000ff0  71 66 5f 74 69 6d 65 72  3d 91 0d 06 40 10 72 65  |qf_timer=...@.re|
00001000  67 69 6f 6e 78 73 25 3d  31 36 0d 06 4a 10 72 65  |gionxs%=16..J.re|
00001010  67 69 6f 6e 79 73 25 3d  36 34 0d 06 54 18 24 69  |gionys%=64..T.$i|
00001020  63 6f 6e 62 61 72 6c 61  62 65 6c 25 3d 22 22 2b  |conbarlabel%=""+|
00001030  bd 30 0d 06 5e 1d 24 69  63 6f 6e 62 61 72 64 61  |.0..^.$iconbarda|
00001040  74 61 25 3d 22 53 21 78  75 65 6e 22 2b bd 30 0d  |ta%="S!xuen"+.0.|
00001050  06 68 20 67 6c 6f 62 61  6c 6d 65 6e 75 70 74 72  |.h globalmenuptr|
00001060  25 3d 73 68 6f 72 74 63  75 74 6d 65 6e 75 25 0d  |%=shortcutmenu%.|
00001070  06 72 04 0d 06 7c 24 24  69 63 6f 6e 62 61 72 64  |.r...|$$iconbard|
00001080  61 74 61 25 3d 49 63 6f  6e 42 61 72 41 6e 69 6d  |ata%=IconBarAnim|
00001090  24 28 30 29 2b bd 30 0d  06 86 04 0d 06 90 04 0d  |$(0)+.0.........|
000010a0  06 9a 39 f4 20 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |..9. ***********|
000010b0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000010d0  2a 2a 2a 2a 2a 2a 2a 2a  0d 06 a4 04 0d 06 ae 0b  |********........|
000010e0  71 75 69 74 25 3d a3 0d  06 b8 04 0d 06 c2 14 c8  |quit%=..........|
000010f0  99 22 48 6f 75 72 67 6c  61 73 73 5f 4f 6e 22 0d  |."Hourglass_On".|
00001100  06 cc 09 f2 69 6e 69 74  0d 06 d6 2e f4 20 50 52  |....init..... PR|
00001110  4f 43 65 72 72 6f 72 28  22 58 75 65 6e 20 70 61  |OCerror("Xuen pa|
00001120  74 68 20 3d 20 22 2b 41  70 70 50 61 74 68 24 2b  |th = "+AppPath$+|
00001130  43 48 52 24 30 29 0d 06  e0 12 f2 47 65 74 53 63  |CHR$0).....GetSc|
00001140  72 65 65 6e 53 69 7a 65  0d 06 ea 12 f2 43 72 65  |reenSize.....Cre|
00001150  61 74 65 54 6f 6f 6c 54  69 70 0d 06 f4 0e f2 6c  |ateToolTip.....l|
00001160  6f 61 64 63 61 63 68 65  0d 06 fe 15 c8 99 22 48  |oadcache......"H|
00001170  6f 75 72 67 6c 61 73 73  5f 4f 66 66 22 0d 07 08  |ourglass_Off"...|
00001180  04 0d 07 12 3f f4 20 49  66 20 41 4c 54 20 69 73  |....?. If ALT is|
00001190  20 70 72 65 73 73 65 64  20 74 68 65 6e 20 73 6b  | pressed then sk|
000011a0  69 70 20 61 75 74 6f 20  62 6f 6f 74 69 6e 67 2f  |ip auto booting/|
000011b0  6c 6f 61 64 69 6e 67 20  61 6e 79 74 68 69 6e 67  |loading anything|
000011c0  0d 07 1c 0e e7 20 ac 28  a6 2d 33 29 20 8c 0d 07  |..... .(.-3) ...|
000011d0  26 4f 20 f2 52 65 63 75  72 73 65 44 69 72 65 63  |&O .RecurseDirec|
000011e0  74 6f 72 79 28 41 70 70  50 61 74 68 24 2b 22 2e  |tory(AppPath$+".|
000011f0  55 73 65 72 73 2e 22 2b  55 73 65 72 24 2b 22 2e  |Users."+User$+".|
00001200  4c 69 6e 6b 73 2e 7e 7e  42 6f 6f 74 22 2c 20 52  |Links.~~Boot", R|
00001210  45 43 55 52 53 45 5f 42  4f 4f 54 25 29 0d 07 30  |ECURSE_BOOT%)..0|
00001220  58 20 e7 20 ac 28 71 75  69 74 25 29 20 f2 52 65  |X . .(quit%) .Re|
00001230  63 75 72 73 65 44 69 72  65 63 74 6f 72 79 28 41  |curseDirectory(A|
00001240  70 70 50 61 74 68 24 2b  22 2e 55 73 65 72 73 2e  |ppPath$+".Users.|
00001250  22 2b 55 73 65 72 24 2b  22 2e 4c 69 6e 6b 73 2e  |"+User$+".Links.|
00001260  7e 7e 52 75 6e 22 2c 20  52 45 43 55 52 53 45 5f  |~~Run", RECURSE_|
00001270  52 55 4e 25 29 0d 07 3a  26 20 47 6c 6f 62 61 6c  |RUN%)..:& Global|
00001280  53 74 61 74 65 25 3d 47  6c 6f 62 61 6c 53 74 61  |State%=GlobalSta|
00001290  74 65 50 6f 73 74 42 6f  6f 74 25 0d 07 44 53 20  |tePostBoot%..DS |
000012a0  e7 20 ac 28 71 75 69 74  25 29 20 f2 52 65 63 75  |. .(quit%) .Recu|
000012b0  72 73 65 44 69 72 65 63  74 6f 72 79 28 41 70 70  |rseDirectory(App|
000012c0  50 61 74 68 24 2b 22 2e  55 73 65 72 73 2e 22 2b  |Path$+".Users."+|
000012d0  55 73 65 72 24 2b 22 2e  4c 69 6e 6b 73 22 2c 20  |User$+".Links", |
000012e0  52 45 43 55 52 53 45 5f  42 4f 4f 54 25 29 0d 07  |RECURSE_BOOT%)..|
000012f0  4e 05 cd 0d 07 58 04 0d  07 62 21 47 6c 6f 62 61  |N....X...b!Globa|
00001300  6c 53 74 61 74 65 25 3d  47 6c 6f 62 61 6c 53 74  |lState%=GlobalSt|
00001310  61 74 65 49 64 6c 65 25  0d 07 6c 04 0d 07 76 0e  |ateIdle%..l...v.|
00001320  c8 95 20 ac 20 71 75 69  74 25 0d 07 80 09 f2 70  |.. . quit%.....p|
00001330  6f 6c 6c 0d 07 8a 05 ce  0d 07 94 04 0d 07 9e 22  |oll............"|
00001340  f4 20 45 6e 73 75 72 65  20 61 6c 6c 20 62 75 66  |. Ensure all buf|
00001350  66 65 72 73 20 61 72 65  20 65 6d 70 74 79 0d 07  |fers are empty..|
00001360  a8 12 f2 61 6c 62 61 5f  70 75 72 67 65 28 30 29  |...alba_purge(0)|
00001370  0d 07 b2 25 47 6c 6f 62  61 6c 53 74 61 74 65 25  |...%GlobalState%|
00001380  3d 47 6c 6f 62 61 6c 53  74 61 74 65 53 68 75 74  |=GlobalStateShut|
00001390  44 6f 77 6e 25 0d 07 bc  27 f4 20 52 65 73 65 74  |Down%...'. Reset|
000013a0  20 71 75 69 74 20 74 6f  20 65 6e 61 62 6c 65 20  | quit to enable |
000013b0  61 6e 6f 74 68 65 72 20  71 75 69 74 0d 07 c6 30  |another quit...0|
000013c0  f4 20 64 75 72 69 6e 67  20 70 72 6f 67 72 61 6d  |. during program|
000013d0  20 73 68 75 74 64 6f 77  6e 20 74 6f 20 62 65 20  | shutdown to be |
000013e0  64 65 74 65 63 74 65 64  20 2e 2e 2e 0d 07 d0 0b  |detected .......|
000013f0  71 75 69 74 25 3d a3 0d  07 da 50 f2 52 65 63 75  |quit%=....P.Recu|
00001400  72 73 65 44 69 72 65 63  74 6f 72 79 28 41 70 70  |rseDirectory(App|
00001410  50 61 74 68 24 2b 22 2e  55 73 65 72 73 2e 22 2b  |Path$+".Users."+|
00001420  55 73 65 72 24 2b 22 2e  4c 69 6e 6b 73 2e 7e 7e  |User$+".Links.~~|
00001430  52 75 6e 51 75 69 74 22  2c 20 52 45 43 55 52 53  |RunQuit", RECURS|
00001440  45 5f 52 55 4e 25 29 0d  07 e4 13 f2 44 65 73 74  |E_RUN%).....Dest|
00001450  72 6f 79 54 6f 6f 6c 54  69 70 0d 07 ee 17 c8 99  |royToolTip......|
00001460  20 22 57 69 6d 70 5f 43  6c 6f 73 65 44 6f 77 6e  | "Wimp_CloseDown|
00001470  22 0d 07 f8 05 e0 0d 08  02 04 0d 08 0c 13 f4 20  |".............. |
00001480  45 72 72 6f 72 20 68 61  6e 64 6c 65 72 0d 08 16  |Error handler...|
00001490  21 f2 65 72 72 6f 72 28  f6 24 2b 22 20 61 74 20  |!.error(.$+" at |
000014a0  6c 69 6e 65 20 22 2b c3  9e 29 3a d9 23 30 0d 08  |line "+..):.#0..|
000014b0  20 18 47 6c 6f 62 61 6c  45 72 72 6f 72 53 74 61  | .GlobalErrorSta|
000014c0  74 65 25 2b 3d 31 0d 08  2a 20 e7 20 47 6c 6f 62  |te%+=1..* . Glob|
000014d0  61 6c 45 72 72 6f 72 53  74 61 74 65 25 3d 31 20  |alErrorState%=1 |
000014e0  e5 20 8d 74 68 47 0d 08  34 20 e7 20 47 6c 6f 62  |. .thG..4 . Glob|
000014f0  61 6c 45 72 72 6f 72 53  74 61 74 65 25 3d 32 20  |alErrorState%=2 |
00001500  e5 20 8d 64 6e 47 0d 08  3e 35 f4 20 4d 75 6c 74  |. .dnG..>5. Mult|
00001510  69 70 6c 65 20 65 72 72  6f 72 73 20 68 61 76 65  |iple errors have|
00001520  20 6f 63 63 75 72 65 64  20 2d 20 64 69 65 20 75  | occured - die u|
00001530  6e 67 72 61 63 65 66 75  6c 6c 79 0d 08 48 05 e0  |ngracefully..H..|
00001540  0d 08 52 04 0d 08 5c 39  f4 20 2a 2a 2a 2a 2a 2a  |..R...\9. ******|
00001550  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00001570  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 0d 08 66  |*************..f|
00001580  04 0d 08 70 0d dd f2 47  65 74 44 61 74 65 0d 08  |...p...GetDate..|
00001590  7a 1a f4 20 41 71 75 69  72 65 20 64 61 74 65 20  |z.. Aquire date |
000015a0  61 6e 64 20 74 69 6d 65  0d 08 84 29 c8 99 22 4f  |and time...).."O|
000015b0  53 5f 47 53 54 72 61 6e  73 22 2c 61 70 70 64 61  |S_GSTrans",appda|
000015c0  74 65 76 61 72 2c 61 70  70 70 61 74 68 2c 32 35  |tevar,apppath,25|
000015d0  35 0d 08 8e 1d 41 70 70  44 61 74 65 24 3d a4 73  |5....AppDate$=.s|
000015e0  74 72 69 6e 67 28 61 70  70 70 61 74 68 29 0d 08  |tring(apppath)..|
000015f0  98 05 e1 0d 08 a2 04 0d  08 ac 39 f4 20 2a 2a 2a  |..........9. ***|
00001600  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00001630  0d 08 b6 04 0d 08 c0 0f  f4 20 70 6f 6c 6c 20 6c  |......... poll l|
00001640  6f 6f 70 0d 08 ca 0a dd  f2 70 6f 6c 6c 0d 08 d4  |oop......poll...|
00001650  24 c8 99 22 57 69 6d 70  5f 50 6f 6c 6c 22 2c 30  |$.."Wimp_Poll",0|
00001660  2c 62 6c 6f 63 6b 25 20  b8 20 72 65 61 73 6f 6e  |,block% . reason|
00001670  25 0d 08 de 32 f4 20 49  46 20 72 65 61 73 6f 6e  |%...2. IF reason|
00001680  25 3c 3e 30 20 50 52 4f  43 65 72 72 6f 72 28 53  |%<>0 PROCerror(S|
00001690  54 52 24 28 72 65 61 73  6f 6e 25 29 2b 43 48 52  |TR$(reason%)+CHR|
000016a0  24 30 29 0d 08 e8 10 c8  8e 20 72 65 61 73 6f 6e  |$0)...... reason|
000016b0  25 20 ca 0d 08 f2 14 c9  20 30 3a f2 6e 75 6c 6c  |% ...... 0:.null|
000016c0  5f 72 65 61 73 6f 6e 0d  08 fc 14 c9 20 32 3a f2  |_reason..... 2:.|
000016d0  50 6f 6c 6c 52 65 61 73  6f 6e 32 0d 09 06 25 c9  |PollReason2...%.|
000016e0  20 33 3a c8 99 20 22 57  69 6d 70 5f 43 6c 6f 73  | 3:.. "Wimp_Clos|
000016f0  65 57 69 6e 64 6f 77 22  2c 2c 62 6c 6f 63 6b 25  |eWindow",,block%|
00001700  0d 09 10 19 c9 20 36 3a  f2 63 6c 69 63 6b 28 62  |..... 6:.click(b|
00001710  6c 6f 63 6b 25 21 31 32  29 0d 09 1a 11 c9 20 37  |lock%!12)..... 7|
00001720  3a f2 64 72 61 67 64 72  6f 70 0d 09 24 1a f4 57  |:.dragdrop..$..W|
00001730  48 45 4e 20 38 3a 50 52  4f 43 6b 65 79 70 72 65  |HEN 8:PROCkeypre|
00001740  73 73 65 64 0d 09 2e 13  c9 20 39 3a f2 6d 65 6e  |ssed..... 9:.men|
00001750  75 73 65 6c 65 63 74 0d  09 38 1d c9 20 31 37 2c  |uselect..8.. 17,|
00001760  31 38 3a f2 72 65 63 65  69 76 65 28 72 65 61 73  |18:.receive(reas|
00001770  6f 6e 25 29 0d 09 42 39  f4 20 57 48 45 4e 20 31  |on%)..B9. WHEN 1|
00001780  39 3a 50 52 4f 43 65 72  72 6f 72 28 22 55 6e 73  |9:PROCerror("Uns|
00001790  75 70 70 6f 72 74 65 64  20 77 69 6e 64 6f 77 20  |upported window |
000017a0  64 65 66 69 6e 69 74 69  6f 6e 2e 22 29 0d 09 4c  |definition.")..L|
000017b0  05 cb 0d 09 56 05 e1 0d  09 60 04 0d 09 6a 39 f4  |....V....`...j9.|
000017c0  20 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  | ***************|
000017d0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000017f0  2a 2a 2a 2a 0d 09 74 04  0d 09 7e 11 dd f2 50 6f  |****..t...~...Po|
00001800  6c 6c 52 65 61 73 6f 6e  32 0d 09 88 1d e7 20 28  |llReason2..... (|
00001810  28 21 62 6c 6f 63 6b 25  29 20 3e 3d 20 4f 53 5f  |(!block%) >= OS_|
00001820  4d 58 25 29 20 8c 0d 09  92 58 f4 20 50 52 4f 43  |MX%) ....X. PROC|
00001830  65 72 72 6f 72 28 22 57  69 6e 64 6f 77 20 74 6f  |error("Window to|
00001840  62 65 6f 70 65 6e 65 64  3a 22 2b 53 54 52 24 7e  |beopened:"+STR$~|
00001850  28 21 62 6c 6f 63 6b 25  29 2b 22 20 20 62 65 68  |(!block%)+"  beh|
00001860  69 6e 64 3a 20 22 2b 53  54 52 24 7e 28 62 6c 6f  |ind: "+STR$~(blo|
00001870  63 6b 25 21 32 38 29 2b  43 48 52 24 30 29 0d 09  |ck%!28)+CHR$0)..|
00001880  9c 20 c8 99 20 22 57 69  6d 70 5f 4f 70 65 6e 57  |. .. "Wimp_OpenW|
00001890  69 6e 64 6f 77 22 2c 2c  62 6c 6f 63 6b 25 0d 09  |indow",,block%..|
000018a0  a6 05 cc 0d 09 b0 2e f4  63 75 72 72 65 6e 74 77  |........currentw|
000018b0  69 6e 64 6f 77 25 3d 21  62 6c 6f 63 6b 25 3a 50  |indow%=!block%:P|
000018c0  52 4f 43 4f 70 65 6e 54  6f 6f 6c 54 69 70 28 32  |ROCOpenToolTip(2|
000018d0  29 0d 09 ba 41 f4 20 54  68 69 73 20 69 73 20 76  |)...A. This is v|
000018e0  65 72 79 20 77 69 65 72  64 20 2d 20 74 68 65 20  |ery wierd - the |
000018f0  77 69 6e 64 6f 77 68 61  6e 64 6c 65 20 69 73 20  |windowhandle is |
00001900  69 6e 76 61 6c 69 64 20  61 6e 64 20 65 71 75 61  |invalid and equa|
00001910  6c 73 0d 09 c4 3f f4 20  74 68 65 20 6d 6f 75 73  |ls...?. the mous|
00001920  65 20 70 6f 69 6e 74 65  72 20 78 20 70 6f 73 69  |e pointer x posi|
00001930  74 69 6f 6e 20 2d 20 6d  75 73 74 20 62 65 20 61  |tion - must be a|
00001940  20 6d 65 6e 75 20 49 20  72 65 63 6b 6f 6e 20 6f  | menu I reckon o|
00001950  72 0d 09 ce 1f f4 20 63  6f 75 6c 64 20 62 65 20  |r..... could be |
00001960  61 20 62 75 67 20 69 6e  20 52 49 53 43 4f 53 2e  |a bug in RISCOS.|
00001970  0d 09 d8 15 4d 65 6e 75  49 73 4f 70 65 6e 46 6c  |....MenuIsOpenFl|
00001980  61 67 25 3d 31 0d 09 e2  05 cd 0d 09 ec 04 0d 09  |ag%=1...........|
00001990  f6 05 e1 0d 0a 00 04 0d  0a 0a 13 dd f2 47 65 74  |.............Get|
000019a0  53 63 72 65 65 6e 53 69  7a 65 0d 0a 14 33 c8 99  |ScreenSize...3..|
000019b0  22 4f 53 5f 52 65 61 64  4d 6f 64 65 56 61 72 69  |"OS_ReadModeVari|
000019c0  61 62 6c 65 22 2c 2d 31  2c 34 20 b8 20 2c 2c 4f  |able",-1,4 . ,,O|
000019d0  53 5f 45 58 25 3a f4 20  45 69 67 65 6e 0d 0a 1e  |S_EX%:. Eigen...|
000019e0  2b c8 99 22 4f 53 5f 52  65 61 64 4d 6f 64 65 56  |+.."OS_ReadModeV|
000019f0  61 72 69 61 62 6c 65 22  2c 2d 31 2c 35 20 b8 20  |ariable",-1,5 . |
00001a00  2c 2c 4f 53 5f 45 59 25  0d 0a 28 33 c8 99 22 4f  |,,OS_EY%..(3.."O|
00001a10  53 5f 52 65 61 64 4d 6f  64 65 56 61 72 69 61 62  |S_ReadModeVariab|
00001a20  6c 65 22 2c 2d 31 2c 31  31 20 b8 20 2c 2c 4f 53  |le",-1,11 . ,,OS|
00001a30  5f 57 58 25 3a f4 20 53  69 7a 65 0d 0a 32 2c c8  |_WX%:. Size..2,.|
00001a40  99 22 4f 53 5f 52 65 61  64 4d 6f 64 65 56 61 72  |."OS_ReadModeVar|
00001a50  69 61 62 6c 65 22 2c 2d  31 2c 31 32 20 b8 20 2c  |iable",-1,12 . ,|
00001a60  2c 4f 53 5f 57 59 25 0d  0a 3c 1f 4f 53 5f 4d 58  |,OS_WY%..<.OS_MX|
00001a70  25 3d 28 31 2b 4f 53 5f  57 58 25 29 20 3c 3c 20  |%=(1+OS_WX%) << |
00001a80  4f 53 5f 45 58 25 0d 0a  46 1f 4f 53 5f 4d 59 25  |OS_EX%..F.OS_MY%|
00001a90  3d 28 31 2b 4f 53 5f 57  59 25 29 20 3c 3c 20 4f  |=(1+OS_WY%) << O|
00001aa0  53 5f 45 59 25 0d 0a 50  05 e1 0d 0a 5a 04 0d 0a  |S_EY%..P....Z...|
00001ab0  64 16 f4 44 45 46 50 52  4f 43 6b 65 79 70 72 65  |d..DEFPROCkeypre|
00001ac0  73 73 65 64 0d 0a 6e 10  f4 4c 4f 43 41 4c 20 43  |ssed..n..LOCAL C|
00001ad0  68 61 72 25 0d 0a 78 14  f4 43 68 61 72 25 3d 62  |har%..x..Char%=b|
00001ae0  6c 6f 63 6b 25 21 32 34  0d 0a 82 3d f4 49 46 20  |lock%!24...=.IF |
00001af0  43 68 61 72 25 3d 26 31  43 44 20 50 52 4f 43 65  |Char%=&1CD PROCe|
00001b00  72 72 6f 72 28 22 49 6e  73 65 72 74 20 70 72 65  |rror("Insert pre|
00001b10  73 73 65 64 20 6f 6e 20  69 63 6f 6e 20 22 2b 43  |ssed on icon "+C|
00001b20  48 52 24 30 29 0d 0a 8c  2d f4 52 45 4d 20 49 73  |HR$0)...-.REM Is|
00001b30  20 74 68 69 73 20 74 68  65 20 64 65 6c 65 74 65  | this the delete|
00001b40  20 6f 72 20 62 61 63 6b  73 70 61 63 65 20 6b 65  | or backspace ke|
00001b50  79 3f 0d 0a 96 23 f4 49  46 20 28 43 68 61 72 25  |y?...#.IF (Char%|
00001b60  3d 38 20 4f 52 20 43 68  61 72 25 3d 26 37 66 29  |=8 OR Char%=&7f)|
00001b70  20 54 48 45 4e 0d 0a a0  1b f4 52 45 4d 20 49 73  | THEN.....REM Is|
00001b80  20 74 68 69 73 20 69 6e  20 61 20 6d 65 6e 75 3f  | this in a menu?|
00001b90  0d 0a aa 5e f4 50 52 4f  43 65 72 72 6f 72 28 22  |...^.PROCerror("|
00001ba0  57 69 6e 64 6f 77 20 68  61 6e 64 6c 65 20 3d 20  |Window handle = |
00001bb0  22 2b 53 54 52 24 7e 28  62 6c 6f 63 6b 25 21 30  |"+STR$~(block%!0|
00001bc0  29 2b 22 20 2d 2d 20 6d  61 69 6e 5f 6d 65 6e 75  |)+" -- main_menu|
00001bd0  25 20 3d 20 22 2b 53 54  52 24 7e 28 6d 61 69 6e  |% = "+STR$~(main|
00001be0  5f 6d 65 6e 75 25 29 2b  43 48 52 24 30 29 0d 0a  |_menu%)+CHR$0)..|
00001bf0  b4 09 f4 45 4c 53 45 0d  0a be 20 f4 53 59 53 20  |...ELSE... .SYS |
00001c00  22 57 69 6d 70 5f 50 72  6f 63 65 73 73 4b 65 79  |"Wimp_ProcessKey|
00001c10  22 2c 43 68 61 72 25 0d  0a c8 0a f4 45 4e 44 49  |",Char%.....ENDI|
00001c20  46 0d 0a d2 0c f4 45 4e  44 50 52 4f 43 0d 0a dc  |F.....ENDPROC...|
00001c30  04 0d 0a e6 17 dd f2 52  65 6f 70 65 6e 44 75 6d  |.......ReopenDum|
00001c40  6d 79 57 69 6e 64 6f 77  0d 0a f0 20 20 21 62 6c  |myWindow...  !bl|
00001c50  6f 63 6b 32 25 3d 77 68  61 6e 64 6c 65 5f 64 75  |ock2%=whandle_du|
00001c60  6d 6d 79 62 61 63 6b 25  0d 0a fa 25 20 c8 99 22  |mmyback%...% .."|
00001c70  57 69 6d 70 5f 47 65 74  57 69 6e 64 6f 77 53 74  |Wimp_GetWindowSt|
00001c80  61 74 65 22 2c 2c 62 6c  6f 63 6b 32 25 0d 0b 04  |ate",,block2%...|
00001c90  25 20 62 6c 6f 63 6b 32  25 21 38 3d 2d 31 30 32  |% block2%!8=-102|
00001ca0  34 3a 62 6c 6f 63 6b 32  25 21 31 36 3d 2d 31 30  |4:block2%!16=-10|
00001cb0  32 34 0d 0b 0e 12 20 62  6c 6f 63 6b 32 25 21 32  |24.... block2%!2|
00001cc0  38 3d 2d 32 0d 0b 18 22  20 c8 99 22 57 69 6d 70  |8=-2..." .."Wimp|
00001cd0  5f 4f 70 65 6e 57 69 6e  64 6f 77 22 2c 2c 62 6c  |_OpenWindow",,bl|
00001ce0  6f 63 6b 32 25 20 0d 0b  22 1e 20 61 66 74 65 72  |ock2% ..". after|
00001cf0  25 3d 77 68 61 6e 64 6c  65 5f 64 75 6d 6d 79 62  |%=whandle_dummyb|
00001d00  61 63 6b 25 0d 0b 2c 18  20 f4 20 4d 65 6e 75 49  |ack%..,. . MenuI|
00001d10  73 4f 70 65 6e 46 6c 61  67 25 3d 30 0d 0b 36 05  |sOpenFlag%=0..6.|
00001d20  20 0d 0b 40 05 20 0d 0b  4a 17 20 20 57 69 6e 64  | ..@. ..J.  Wind|
00001d30  6f 77 4c 69 73 74 53 69  7a 65 25 3d 30 0d 0b 54  |owListSize%=0..T|
00001d40  05 e1 0d 0b 5e 04 0d 0b  68 0d dd f2 63 61 73 63  |....^...h...casc|
00001d50  61 64 65 0d 0b 72 19 ea  20 71 25 2c 4f 6c 64 41  |ade..r.. q%,OldA|
00001d60  66 74 65 72 25 2c 61 66  74 65 72 25 0d 0b 7c 18  |fter%,after%..|.|
00001d70  ea 20 73 78 25 2c 20 73  79 25 2c 20 6f 78 25 2c  |. sx%, sy%, ox%,|
00001d80  20 6f 79 25 0d 0b 86 29  ea 20 52 65 6f 70 65 6e  | oy%...). Reopen|
00001d90  46 6c 61 67 25 2c 20 53  74 61 63 6b 46 6c 61 67  |Flag%, StackFlag|
00001da0  25 2c 20 56 61 6c 69 64  46 6c 61 67 25 0d 0b 90  |%, ValidFlag%...|
00001db0  2d ea 20 50 61 6e 65 46  6c 61 67 25 2c 20 49 73  |-. PaneFlag%, Is|
00001dc0  4f 70 65 6e 46 6c 61 67  25 2c 20 49 73 4d 6f 76  |OpenFlag%, IsMov|
00001dd0  65 61 62 6c 65 46 6c 61  67 25 0d 0b 9a 1e ea 20  |eableFlag%..... |
00001de0  43 75 72 72 65 6e 74 57  69 6e 25 2c 43 75 72 72  |CurrentWin%,Curr|
00001df0  65 6e 74 49 63 6f 6e 25  0d 0b a4 08 ea 20 6e 25  |entIcon%..... n%|
00001e00  0d 0b ae 04 0d 0b b8 14  f2 42 75 69 6c 64 57 69  |.........BuildWi|
00001e10  6e 64 6f 77 4c 69 73 74  0d 0b c2 04 0d 0b cc 0e  |ndowList........|
00001e20  63 61 73 63 61 64 65 25  3d 30 0d 0b d6 14 4c 61  |cascade%=0....La|
00001e30  73 74 52 69 67 68 74 45  64 67 65 25 3d 30 0d 0b  |stRightEdge%=0..|
00001e40  e0 11 43 61 73 63 61 64  65 52 6f 77 25 3d 30 0d  |..CascadeRow%=0.|
00001e50  0b ea 04 0d 0b f4 24 c8  99 22 57 69 6d 70 5f 47  |......$.."Wimp_G|
00001e60  65 74 50 6f 69 6e 74 65  72 49 6e 66 6f 22 2c 2c  |etPointerInfo",,|
00001e70  62 6c 6f 63 6b 32 25 0d  0b fe 1d 43 75 72 72 65  |block2%....Curre|
00001e80  6e 74 57 69 6e 50 74 72  25 3d 62 6c 6f 63 6b 32  |ntWinPtr%=block2|
00001e90  25 21 31 32 0d 0c 08 1b  43 75 72 72 65 6e 74 49  |%!12....CurrentI|
00001ea0  63 6f 6e 25 3d 62 6c 6f  63 6b 32 25 21 31 36 0d  |con%=block2%!16.|
00001eb0  0c 12 04 0d 0c 1c 19 e7  20 57 69 6e 64 6f 77 4c  |........ WindowL|
00001ec0  69 73 74 53 69 7a 65 25  3d 30 20 e1 0d 0c 26 04  |istSize%=0 ...&.|
00001ed0  0d 0c 30 1f e3 6e 25 3d  30 20 b8 20 28 57 69 6e  |..0..n%=0 . (Win|
00001ee0  64 6f 77 4c 69 73 74 53  69 7a 65 25 2d 31 29 0d  |dowListSize%-1).|
00001ef0  0c 3a 11 20 71 25 3d 77  69 6e 62 6c 6f 63 6b 25  |.:. q%=winblock%|
00001f00  0d 0c 44 10 20 50 61 6e  65 46 6c 61 67 25 3d a3  |..D. PaneFlag%=.|
00001f10  0d 0c 4e 33 20 f4 20 47  65 74 20 43 75 72 72 65  |..N3 . Get Curre|
00001f20  6e 74 20 77 69 6e 64 6f  77 20 69 6d 6d 65 64 69  |nt window immedi|
00001f30  61 74 65 6c 79 20 75 6e  64 65 72 20 70 6f 69 6e  |ately under poin|
00001f40  74 65 72 0d 0c 58 28 20  43 75 72 72 65 6e 74 57  |ter..X( CurrentW|
00001f50  69 6e 25 20 3d 20 57 69  6e 64 6f 77 4c 69 73 74  |in% = WindowList|
00001f60  48 61 6e 64 6c 65 25 28  6e 25 29 0d 0c 62 14 20  |Handle%(n%)..b. |
00001f70  21 71 25 3d 43 75 72 72  65 6e 74 57 69 6e 25 0d  |!q%=CurrentWin%.|
00001f80  0c 6c 2e 20 f4 20 54 72  79 20 61 6e 64 20 63 61  |.l. . Try and ca|
00001f90  73 63 61 64 65 20 74 68  69 73 20 64 65 73 6b 74  |scade this deskt|
00001fa0  6f 70 20 77 69 6e 64 6f  77 20 2e 2e 2e 0d 0c 76  |op window .....v|
00001fb0  21 20 c8 99 20 22 57 69  6d 70 5f 47 65 74 57 69  |! .. "Wimp_GetWi|
00001fc0  6e 64 6f 77 53 74 61 74  65 22 2c 2c 71 25 0d 0c  |ndowState",,q%..|
00001fd0  80 05 20 0d 0c 8a 0d 20  71 25 21 32 38 3d 2d 31  |.. .... q%!28=-1|
00001fe0  0d 0c 94 05 20 0d 0c 9e  18 20 f4 20 52 65 70 6f  |.... .... . Repo|
00001ff0  73 69 74 69 6f 6e 20 77  69 6e 64 6f 77 0d 0c a8  |sition window...|
00002000  10 20 50 61 6e 65 46 6c  61 67 25 3d a3 0d 0c b2  |. PaneFlag%=....|
00002010  32 20 e7 20 28 28 28 71  25 21 33 32 29 20 80 20  |2 . (((q%!32) . |
00002020  28 28 32 5e 32 32 29 2b  28 32 5e 32 33 29 29 29  |((2^22)+(2^23)))|
00002030  3e 30 29 20 50 61 6e 65  46 6c 61 67 25 3d b9 0d  |>0) PaneFlag%=..|
00002040  0c bc 26 20 e7 20 28 28  28 71 25 21 33 32 29 20  |..& . (((q%!32) |
00002050  80 20 33 32 29 3d 33 32  29 20 50 61 6e 65 46 6c  |. 32)=32) PaneFl|
00002060  61 67 25 3d b9 0d 0c c6  25 20 49 73 4f 70 65 6e  |ag%=....% IsOpen|
00002070  46 6c 61 67 25 20 3d 20  28 28 71 25 21 33 32 29  |Flag% = ((q%!32)|
00002080  20 80 20 28 32 5e 31 36  29 29 0d 0c d0 24 20 49  | . (2^16))...$ I|
00002090  73 4d 6f 76 65 61 62 6c  65 46 6c 61 67 25 20 3d  |sMoveableFlag% =|
000020a0  20 28 28 71 25 21 33 32  29 20 80 20 32 29 0d 0c  | ((q%!32) . 2)..|
000020b0  da 04 0d 0c e4 12 20 52  65 6f 70 65 6e 46 6c 61  |...... ReopenFla|
000020c0  67 25 3d b9 0d 0c ee 11  20 53 74 61 63 6b 46 6c  |g%=..... StackFl|
000020d0  61 67 25 3d b9 0d 0c f8  11 20 56 61 6c 69 64 46  |ag%=..... ValidF|
000020e0  6c 61 67 25 3d b9 0d 0d  02 05 20 0d 0d 0c 17 20  |lag%=..... .... |
000020f0  e7 20 28 53 74 61 63 6b  46 6c 61 67 25 3d b9 29  |. (StackFlag%=.)|
00002100  20 8c 0d 0d 16 0e 20 20  6f 78 25 3d 71 25 21 34  | .....  ox%=q%!4|
00002110  0d 0d 20 0f 20 20 6f 79  25 3d 71 25 21 31 36 0d  |.. .  oy%=q%!16.|
00002120  0d 2a 18 20 20 73 78 25  3d 28 71 25 21 31 32 29  |.*.  sx%=(q%!12)|
00002130  2d 28 71 25 21 34 29 0d  0d 34 18 20 20 73 79 25  |-(q%!4)..4.  sy%|
00002140  3d 28 71 25 21 31 36 29  2d 28 71 25 21 38 29 0d  |=(q%!16)-(q%!8).|
00002150  0d 3e 06 20 20 0d 0d 48  3c 20 20 f4 20 54 72 79  |.>.  ..H<  . Try|
00002160  20 61 6e 64 20 66 69 74  20 61 73 20 6d 61 6e 79  | and fit as many|
00002170  20 77 69 6e 64 6f 77 73  20 68 6f 72 69 7a 6f 6e  | windows horizon|
00002180  74 61 6c 6c 79 20 61 73  20 70 6f 73 73 69 62 6c  |tally as possibl|
00002190  65 0d 0d 52 2c 20 20 e7  20 28 28 4c 61 73 74 52  |e..R,  . ((LastR|
000021a0  69 67 68 74 45 64 67 65  25 2b 73 78 25 29 3c 28  |ightEdge%+sx%)<(|
000021b0  4f 53 5f 4d 58 25 2d 34  30 29 29 20 8c 0d 0d 5c  |OS_MX%-40)) ...\|
000021c0  1a 20 20 20 71 25 21 34  3d 4c 61 73 74 52 69 67  |.   q%!4=LastRig|
000021d0  68 74 45 64 67 65 25 0d  0d 66 30 20 20 20 71 25  |htEdge%..f0   q%|
000021e0  21 31 36 3d 28 4f 53 5f  4d 59 25 2d 34 30 29 2d  |!16=(OS_MY%-40)-|
000021f0  28 43 61 73 63 61 64 65  52 6f 77 25 2a 34 30 29  |(CascadeRow%*40)|
00002200  3a f4 20 31 31 36 30 0d  0d 70 17 20 20 20 71 25  |:. 1160..p.   q%|
00002210  21 31 32 3d 28 71 25 21  34 29 2b 73 78 25 0d 0d  |!12=(q%!4)+sx%..|
00002220  7a 30 20 20 20 e7 20 28  28 71 25 21 31 32 29 3e  |z0   . ((q%!12)>|
00002230  28 4f 53 5f 4d 58 25 2d  34 30 29 29 20 71 25 21  |(OS_MX%-40)) q%!|
00002240  31 32 3d 28 4f 53 5f 4d  58 25 2d 34 30 29 0d 0d  |12=(OS_MX%-40)..|
00002250  84 17 20 20 20 71 25 21  38 3d 28 71 25 21 31 36  |..   q%!8=(q%!16|
00002260  29 2d 73 79 25 0d 0d 8e  1c 20 20 20 e7 20 28 28  |)-sy%....   . ((|
00002270  71 25 21 38 29 3c 34 30  29 20 71 25 21 38 3d 34  |q%!8)<40) q%!8=4|
00002280  30 0d 0d 98 20 20 20 20  4c 61 73 74 52 69 67 68  |0...    LastRigh|
00002290  74 45 64 67 65 25 3d 28  71 25 21 31 32 29 2b 34  |tEdge%=(q%!12)+4|
000022a0  38 0d 0d a2 08 20 20 20  cc 0d 0d ac 17 20 20 20  |8....   .....   |
000022b0  4c 61 73 74 52 69 67 68  74 45 64 67 65 25 3d 30  |LastRightEdge%=0|
000022c0  0d 0d b6 15 20 20 20 43  61 73 63 61 64 65 52 6f  |....   CascadeRo|
000022d0  77 25 2b 3d 31 0d 0d c0  1b 20 20 20 71 25 21 34  |w%+=1....   q%!4|
000022e0  3d 28 43 61 73 63 61 64  65 52 6f 77 25 2a 38 29  |=(CascadeRow%*8)|
000022f0  0d 0d ca 30 20 20 20 71  25 21 31 36 3d 28 4f 53  |...0   q%!16=(OS|
00002300  5f 4d 59 25 2d 34 30 29  2d 28 43 61 73 63 61 64  |_MY%-40)-(Cascad|
00002310  65 52 6f 77 25 2a 34 30  29 3a f4 20 31 31 36 30  |eRow%*40):. 1160|
00002320  0d 0d d4 17 20 20 20 71  25 21 31 32 3d 28 71 25  |....   q%!12=(q%|
00002330  21 34 29 2b 73 78 25 0d  0d de 30 20 20 20 e7 20  |!4)+sx%...0   . |
00002340  28 28 71 25 21 31 32 29  3e 28 4f 53 5f 4d 58 25  |((q%!12)>(OS_MX%|
00002350  2d 34 30 29 29 20 71 25  21 31 32 3d 28 4f 53 5f  |-40)) q%!12=(OS_|
00002360  4d 58 25 2d 34 30 29 0d  0d e8 17 20 20 20 71 25  |MX%-40)....   q%|
00002370  21 38 3d 28 71 25 21 31  36 29 2d 73 79 25 0d 0d  |!8=(q%!16)-sy%..|
00002380  f2 1c 20 20 20 e7 20 28  28 71 25 21 38 29 3c 34  |..   . ((q%!8)<4|
00002390  30 29 20 71 25 21 38 3d  34 30 0d 0d fc 20 20 20  |0) q%!8=40...   |
000023a0  20 4c 61 73 74 52 69 67  68 74 45 64 67 65 25 3d  | LastRightEdge%=|
000023b0  28 71 25 21 31 32 29 2b  34 38 0d 0e 06 07 20 20  |(q%!12)+48....  |
000023c0  cd 0d 0e 10 04 0d 0e 1a  33 20 20 f4 20 48 61 76  |........3  . Hav|
000023d0  69 6e 67 20 61 6c 6c 6f  77 65 64 20 73 70 61 63  |ing allowed spac|
000023e0  65 20 66 6f 72 20 74 68  69 73 20 77 69 6e 64 6f  |e for this windo|
000023f0  77 20 69 6e 20 74 68 65  0d 0e 24 33 20 20 f4 20  |w in the..$3  . |
00002400  77 69 6e 64 6f 77 20 63  61 73 63 61 64 65 2c 20  |window cascade, |
00002410  61 72 65 20 77 65 20 73  75 72 65 20 77 65 20 77  |are we sure we w|
00002420  61 6e 74 20 74 6f 20 6d  6f 76 65 0d 0e 2e 14 20  |ant to move.... |
00002430  20 f4 20 69 74 20 6a 75  73 74 20 79 65 74 3f 0d  | . it just yet?.|
00002440  0e 38 19 20 20 e7 20 28  52 65 6f 70 65 6e 46 6c  |.8.  . (ReopenFl|
00002450  61 67 25 3d b9 29 20 8c  0d 0e 42 2e 20 20 20 c8  |ag%=.) ...B.   .|
00002460  99 20 22 58 57 69 6d 70  5f 53 65 6e 64 4d 65 73  |. "XWimp_SendMes|
00002470  73 61 67 65 22 2c 32 2c  71 25 2c 43 75 72 72 65  |sage",2,q%,Curre|
00002480  6e 74 57 69 6e 25 0d 0e  4c 0b 20 20 cd 20 20 20  |ntWin%..L.  .   |
00002490  20 0d 0e 56 13 20 20 63  61 73 63 61 64 65 25 2b  | ..V.  cascade%+|
000024a0  3d 31 20 20 0d 0e 60 20  20 cd 3a f4 20 45 6e 64  |=1  ..`  .:. End|
000024b0  20 6f 66 20 49 46 20 53  74 61 63 6b 46 6c 61 67  | of IF StackFlag|
000024c0  20 2e 2e 2e 0d 0e 6a 08  ed 20 6e 25 0d 0e 74 05  | .....j.. n%..t.|
000024d0  e1 0d 0e 7e 04 0d 0e 88  33 f4 20 2a 2a 2a 2a 2a  |...~....3. *****|
000024e0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00002500  2a 2a 2a 2a 2a 2a 2a 2a  0d 0e 92 33 f4 20 2a 20  |********...3. * |
00002510  41 6e 69 6d 61 74 65 20  74 68 65 20 69 63 6f 6e  |Animate the icon|
00002520  20 62 61 72 20 69 63 6f  6e 20 20 20 20 20 20 20  | bar icon       |
00002530  20 20 20 20 20 20 20 20  20 20 2a 0d 0e 9c 33 f4  |          *...3.|
00002540  20 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  | ***************|
00002550  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00002560  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 0d 0e  |**************..|
00002570  a6 14 dd f2 41 6e 69 6d  61 74 65 49 63 6f 6e 42  |....AnimateIconB|
00002580  61 72 0d 0e b0 2f 24 69  63 6f 6e 62 61 72 64 61  |ar.../$iconbarda|
00002590  74 61 25 3d 49 63 6f 6e  42 61 72 41 6e 69 6d 24  |ta%=IconBarAnim$|
000025a0  28 49 63 6f 6e 42 61 72  41 6e 69 6d 53 74 65 70  |(IconBarAnimStep|
000025b0  29 0d 0e ba 23 49 63 6f  6e 42 61 72 41 6e 69 6d  |)...#IconBarAnim|
000025c0  53 74 65 70 2b 3d 49 63  6f 6e 42 61 72 41 6e 69  |Step+=IconBarAni|
000025d0  6d 44 69 72 0d 0e c4 3e  e7 20 28 49 63 6f 6e 42  |mDir...>. (IconB|
000025e0  61 72 41 6e 69 6d 53 74  65 70 3c 30 20 84 20 49  |arAnimStep<0 . I|
000025f0  63 6f 6e 42 61 72 41 6e  69 6d 53 74 65 70 3d 49  |conBarAnimStep=I|
00002600  63 6f 6e 42 61 72 41 6e  69 6d 53 69 7a 65 25 29  |conBarAnimSize%)|
00002610  20 8c 0d 0e ce 15 49 63  6f 6e 42 61 72 41 6e 69  | .....IconBarAni|
00002620  6d 53 74 65 70 3d 30 0d  0e d8 29 f4 20 20 49 63  |mStep=0...).  Ic|
00002630  6f 6e 42 61 72 41 6e 69  6d 44 69 72 20 3d 20 49  |onBarAnimDir = I|
00002640  63 6f 6e 42 61 72 41 6e  69 6d 44 69 72 2a 2d 31  |conBarAnimDir*-1|
00002650  0d 0e e2 25 f4 20 49 63  6f 6e 42 61 72 41 6e 69  |...%. IconBarAni|
00002660  6d 53 74 65 70 2b 3d 49  63 6f 6e 42 61 72 41 6e  |mStep+=IconBarAn|
00002670  69 6d 44 69 72 0d 0e ec  05 cd 0d 0e f6 33 f4 20  |imDir........3. |
00002680  41 63 74 69 76 61 74 65  20 61 6e 20 75 70 64 61  |Activate an upda|
00002690  74 65 20 6f 6e 20 74 68  65 20 74 61 73 6b 20 62  |te on the task b|
000026a0  61 72 20 69 63 6f 6e 20  2e 2e 2e 2e 2e 0d 0f 00  |ar icon ........|
000026b0  0f 21 62 6c 6f 63 6b 32  25 3d 2d 32 0d 0f 0a 1c  |.!block2%=-2....|
000026c0  62 6c 6f 63 6b 32 25 21  34 3d 69 63 6f 6e 62 61  |block2%!4=iconba|
000026d0  72 68 61 6e 64 6c 65 25  0d 0f 14 22 c8 99 22 57  |rhandle%...".."W|
000026e0  69 6d 70 5f 47 65 74 49  63 6f 6e 53 74 61 74 65  |imp_GetIconState|
000026f0  22 2c 2c 62 6c 6f 63 6b  32 25 0d 0f 1e 28 62 6c  |",,block2%...(bl|
00002700  6f 63 6b 32 25 21 38 3d  30 3a f4 20 44 6f 6e 27  |ock2%!8=0:. Don'|
00002710  74 20 63 68 61 6e 67 65  20 61 6e 79 74 68 69 6e  |t change anythin|
00002720  67 2c 0d 0f 28 2c 62 6c  6f 63 6b 32 25 21 31 32  |g,..(,block2%!12|
00002730  3d 30 3a f4 20 4a 75 73  74 20 73 69 67 6e 61 6c  |=0:. Just signal|
00002740  20 61 6e 20 75 70 64 61  74 65 20 2e 2e 2e 0d 0f  | an update .....|
00002750  32 3c f4 20 49 6e 73 65  72 74 20 74 68 65 20 72  |2<. Insert the r|
00002760  65 6c 65 76 61 6e 74 20  77 6f 72 64 20 64 65 70  |elevant word dep|
00002770  65 6e 64 69 6e 67 20 6f  6e 20 73 79 73 74 65 6d  |ending on system|
00002780  20 73 74 61 74 65 20 2e  2e 2e 0d 0f 3c 3f e7 20  | state .....<?. |
00002790  28 47 6c 6f 62 61 6c 53  74 61 74 65 25 3c 47 6c  |(GlobalState%<Gl|
000027a0  6f 62 61 6c 53 74 61 74  65 49 64 6c 65 25 29 20  |obalStateIdle%) |
000027b0  24 69 63 6f 6e 62 61 72  6c 61 62 65 6c 25 3d 22  |$iconbarlabel%="|
000027c0  5a 7a 2e 2e 2e 22 2b bd  30 0d 0f 46 4d e7 20 28  |Zz..."+.0..FM. (|
000027d0  47 6c 6f 62 61 6c 53 74  61 74 65 25 3d 47 6c 6f  |GlobalState%=Glo|
000027e0  62 61 6c 53 74 61 74 65  49 64 6c 65 25 29 20 24  |balStateIdle%) $|
000027f0  69 63 6f 6e 62 61 72 6c  61 62 65 6c 25 3d 22 20  |iconbarlabel%=" |
00002800  20 20 20 20 22 2b bd 30  3a f4 20 55 73 65 72 24  |    "+.0:. User$|
00002810  2b 43 48 52 24 30 0d 0f  50 43 e7 20 28 47 6c 6f  |+CHR$0..PC. (Glo|
00002820  62 61 6c 53 74 61 74 65  25 3d 47 6c 6f 62 61 6c  |balState%=Global|
00002830  53 74 61 74 65 53 68 75  74 44 6f 77 6e 25 29 20  |StateShutDown%) |
00002840  24 69 63 6f 6e 62 61 72  6c 61 62 65 6c 25 3d 22  |$iconbarlabel%="|
00002850  42 79 65 2e 2e 22 2b bd  30 0d 0f 5a 12 47 6c 6f  |Bye.."+.0..Z.Glo|
00002860  62 61 6c 53 74 65 70 25  2b 3d 31 0d 0f 64 22 c8  |balStep%+=1..d".|
00002870  99 22 57 69 6d 70 5f 53  65 74 49 63 6f 6e 53 74  |."Wimp_SetIconSt|
00002880  61 74 65 22 2c 2c 62 6c  6f 63 6b 32 25 0d 0f 6e  |ate",,block2%..n|
00002890  05 e1 0d 0f 78 04 0d 0f  82 33 f4 20 2a 2a 2a 2a  |....x....3. ****|
000028a0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000028c0  2a 2a 2a 2a 2a 2a 2a 2a  2a 0d 0f 8c 14 f4 20 49  |*********..... I|
000028d0  64 6c 65 20 57 49 4d 50  20 70 6f 6c 6c 0d 0f 96  |dle WIMP poll...|
000028e0  33 f4 20 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |3. *************|
000028f0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00002910  0d 0f a0 11 dd f2 6e 75  6c 6c 5f 72 65 61 73 6f  |......null_reaso|
00002920  6e 0d 0f aa 23 ea 20 77  69 6e 64 6f 77 25 2c 69  |n...#. window%,i|
00002930  63 6f 6e 25 2c 77 6c 69  63 6f 6e 25 2c 62 75 74  |con%,wlicon%,but|
00002940  74 6f 6e 25 0d 0f b4 04  0d 0f be 26 c8 99 22 57  |ton%.......&.."W|
00002950  69 6d 70 5f 47 65 74 50  6f 69 6e 74 65 72 49 6e  |imp_GetPointerIn|
00002960  66 6f 22 2c 2c 70 74 72  62 6c 6f 63 6b 25 0d 0f  |fo",,ptrblock%..|
00002970  c8 12 58 25 3d 70 74 72  62 6c 6f 63 6b 25 21 30  |..X%=ptrblock%!0|
00002980  0d 0f d2 12 59 25 3d 70  74 72 62 6c 6f 63 6b 25  |....Y%=ptrblock%|
00002990  21 34 0d 0f dc 17 62 75  74 74 6f 6e 25 3d 70 74  |!4....button%=pt|
000029a0  72 62 6c 6f 63 6b 25 21  38 0d 0f e6 18 77 69 6e  |rblock%!8....win|
000029b0  64 6f 77 25 3d 70 74 72  62 6c 6f 63 6b 25 21 31  |dow%=ptrblock%!1|
000029c0  32 0d 0f f0 16 69 63 6f  6e 25 3d 70 74 72 62 6c  |2....icon%=ptrbl|
000029d0  6f 63 6b 25 21 31 36 0d  0f fa 1a 63 75 72 72 65  |ock%!16....curre|
000029e0  6e 74 77 69 6e 64 6f 77  25 3d 77 69 6e 64 6f 77  |ntwindow%=window|
000029f0  25 0d 10 04 04 0d 10 0e  41 e7 20 28 43 75 72 72  |%.......A. (Curr|
00002a00  65 6e 74 4d 65 6e 75 54  79 70 65 25 20 3d 20 57  |entMenuType% = W|
00002a10  69 6e 64 6f 77 4c 69 73  74 4d 65 6e 75 54 79 70  |indowListMenuTyp|
00002a20  65 25 20 80 20 28 62 75  74 74 6f 6e 25 20 80 37  |e% . (button% .7|
00002a30  29 3e 30 29 20 8c 0d 10  18 30 20 e7 20 28 77 69  |)>0) ....0 . (wi|
00002a40  6e 64 6f 77 25 3d 63 75  72 72 65 6e 74 6d 65 6e  |ndow%=currentmen|
00002a50  75 68 61 6e 64 6c 65 25  20 80 20 69 63 6f 6e 25  |uhandle% . icon%|
00002a60  3e 3d 30 29 20 8c 0d 10  22 18 20 20 77 6c 69 63  |>=0) ...".  wlic|
00002a70  6f 6e 25 20 3d 20 69 63  6f 6e 25 20 81 33 0d 10  |on% = icon% .3..|
00002a80  2c 24 20 20 e7 20 28 77  6c 69 63 6f 6e 25 3c 3e  |,$  . (wlicon%<>|
00002a90  57 69 6e 64 6f 77 4c 69  73 74 49 63 6f 6e 25 29  |WindowListIcon%)|
00002aa0  20 8c 0d 10 36 31 20 20  20 57 69 6e 64 6f 77 4c  | ...61   WindowL|
00002ab0  69 73 74 49 63 6f 6e 25  3d 77 6c 69 63 6f 6e 25  |istIcon%=wlicon%|
00002ac0  3a 57 69 6e 64 6f 77 4c  69 73 74 54 69 6d 65 72  |:WindowListTimer|
00002ad0  25 3d 91 0d 10 40 07 20  20 cd 0d 10 4a 24 20 20  |%=...@.  ...J$  |
00002ae0  e7 20 28 91 3e 28 57 69  6e 64 6f 77 4c 69 73 74  |. (.>(WindowList|
00002af0  54 69 6d 65 72 25 2b 32  30 30 29 29 20 8c 0d 10  |Timer%+200)) ...|
00002b00  54 19 20 20 20 f4 20 4f  70 65 6e 20 74 68 69 73  |T.   . Open this|
00002b10  20 77 69 6e 64 6f 77 0d  10 5e 21 20 20 20 f2 77  | window..^!   .w|
00002b20  69 6e 64 6f 77 6d 65 6e  75 73 65 6c 65 63 74 28  |indowmenuselect(|
00002b30  77 6c 69 63 6f 6e 25 29  0d 10 68 36 f4 20 20 20  |wlicon%)..h6.   |
00002b40  49 46 20 28 28 62 75 74  74 6f 6e 25 20 41 4e 44  |IF ((button% AND|
00002b50  37 29 3d 34 29 20 53 59  53 22 57 69 6d 70 5f 43  |7)=4) SYS"Wimp_C|
00002b60  72 65 61 74 65 4d 65 6e  75 22 2c 2c 2d 31 0d 10  |reateMenu",,-1..|
00002b70  72 4e 20 20 20 f4 20 50  52 4f 43 65 72 72 6f 72  |rN   . PROCerror|
00002b80  28 22 49 63 6f 6e 20 68  61 6e 64 6c 65 20 3d 20  |("Icon handle = |
00002b90  22 2b 53 54 52 24 28 69  63 6f 6e 25 20 44 49 56  |"+STR$(icon% DIV|
00002ba0  33 29 2b 22 20 28 22 2b  53 54 52 24 69 63 6f 6e  |3)+" ("+STR$icon|
00002bb0  25 2b 22 29 22 2b 43 48  52 24 30 29 0d 10 7c 19  |%+")"+CHR$0)..|.|
00002bc0  20 20 20 57 69 6e 64 6f  77 4c 69 73 74 49 63 6f  |   WindowListIco|
00002bd0  6e 25 3d 2d 31 0d 10 86  07 20 20 cd 0d 10 90 06  |n%=-1....  .....|
00002be0  20 20 0d 10 9a 07 20 20  cc 0d 10 a4 18 20 20 57  |  ....  .....  W|
00002bf0  69 6e 64 6f 77 4c 69 73  74 49 63 6f 6e 25 3d 2d  |indowListIcon%=-|
00002c00  31 0d 10 ae 06 20 cd 0d  10 b8 06 20 cc 0d 10 c2  |1.... ..... ....|
00002c10  17 20 57 69 6e 64 6f 77  4c 69 73 74 49 63 6f 6e  |. WindowListIcon|
00002c20  25 3d 2d 31 0d 10 cc 05  cd 0d 10 d6 04 0d 10 e0  |%=-1............|
00002c30  25 f4 20 50 75 72 67 65  20 74 68 65 20 62 75 66  |%. Purge the buf|
00002c40  66 65 72 20 6f 6e 63 65  20 65 76 65 72 79 20 31  |fer once every 1|
00002c50  30 73 0d 10 ea 15 f2 61  6c 62 61 5f 70 75 72 67  |0s.....alba_purg|
00002c60  65 28 31 30 30 30 29 0d  10 f4 13 f2 41 6e 69 6d  |e(1000).....Anim|
00002c70  61 74 65 49 63 6f 6e 42  61 72 0d 10 fe 25 e7 20  |ateIconBar...%. |
00002c80  28 54 6f 6f 6c 54 69 70  25 3d 31 29 20 f2 55 70  |(ToolTip%=1) .Up|
00002c90  64 61 74 65 54 6f 6f 6c  54 69 70 54 69 6d 65 0d  |dateToolTipTime.|
00002ca0  11 08 04 0d 11 12 28 f4  20 54 68 69 73 20 6d 61  |......(. This ma|
00002cb0  79 20 62 65 20 6e 65 65  64 65 64 20 74 6f 20 73  |y be needed to s|
00002cc0  74 6f 70 20 66 6c 69 63  6b 65 72 0d 11 1c 0b f4  |top flicker.....|
00002cd0  20 2a 66 78 31 39 0d 11  26 3d e7 20 28 28 28 70  | *fx19..&=. (((p|
00002ce0  74 72 62 6c 6f 63 6b 25  21 31 32 29 3d 2d 32 20  |trblock%!12)=-2 |
00002cf0  80 20 28 70 74 72 62 6c  6f 63 6b 25 21 31 36 3d  |. (ptrblock%!16=|
00002d00  69 63 6f 6e 62 61 72 68  61 6e 64 6c 65 25 29 29  |iconbarhandle%))|
00002d10  29 20 8c 0d 11 30 15 f2  6d 6f 76 65 5f 6f 76 65  |) ...0..move_ove|
00002d20  72 69 63 6f 6e 62 61 72  0d 11 3a 05 cc 0d 11 44  |riconbar..:....D|
00002d30  11 4f 6c 64 54 6f 6f 6c  54 69 70 25 3d 30 0d 11  |.OldToolTip%=0..|
00002d40  4e 04 0d 11 58 39 f4 49  46 20 28 28 28 54 49 4d  |N...X9.IF (((TIM|
00002d50  45 2d 74 6f 6f 6c 74 69  70 5f 74 69 6d 65 72 25  |E-tooltip_timer%|
00002d60  29 3e 31 30 30 29 20 41  4e 44 20 54 6f 6f 6c 54  |)>100) AND ToolT|
00002d70  69 70 25 3e 30 29 20 54  48 45 4e 0d 11 62 14 e7  |ip%>0) THEN..b..|
00002d80  20 28 54 6f 6f 6c 54 69  70 25 3e 30 29 20 8c 0d  | (ToolTip%>0) ..|
00002d90  11 6c 3d e7 20 28 70 74  72 62 6c 6f 63 6b 25 21  |.l=. (ptrblock%!|
00002da0  31 36 20 3c 3e 20 77 68  61 6e 64 6c 65 5f 74 6f  |16 <> whandle_to|
00002db0  6f 6c 74 69 70 25 29 20  69 63 6f 6e 62 61 72 5f  |oltip%) iconbar_|
00002dc0  74 69 6d 65 72 66 6c 61  67 25 3d 30 0d 11 76 11  |timerflag%=0..v.|
00002dd0  f2 43 6c 6f 73 65 54 6f  6f 6c 54 69 70 0d 11 80  |.CloseToolTip...|
00002de0  05 cc 0d 11 8a 18 f4 69  63 6f 6e 62 61 72 5f 74  |.......iconbar_t|
00002df0  69 6d 65 72 25 3d 54 49  4d 45 0d 11 94 18 69 63  |imer%=TIME....ic|
00002e00  6f 6e 62 61 72 5f 74 69  6d 65 72 66 6c 61 67 25  |onbar_timerflag%|
00002e10  3d 30 0d 11 9e 05 cd 0d  11 a8 05 cd 0d 11 b2 04  |=0..............|
00002e20  0d 11 bc 49 e7 20 28 28  58 25 3e 72 65 67 69 6f  |...I. ((X%>regio|
00002e30  6e 78 73 25 20 80 20 58  25 3c 28 4f 53 5f 4d 58  |nxs% . X%<(OS_MX|
00002e40  25 2d 72 65 67 69 6f 6e  78 73 25 29 29 20 84 20  |%-regionxs%)) . |
00002e50  59 25 3e 72 65 67 69 6f  6e 79 73 25 29 20 f2 6f  |Y%>regionys%) .o|
00002e60  75 74 6f 66 66 6f 63 75  73 0d 11 c6 0e e7 20 28  |utoffocus..... (|
00002e70  59 25 3d 30 29 20 8c 0d  11 d0 2e 20 e7 20 28 42  |Y%=0) ..... . (B|
00002e80  6f 74 74 6f 6d 45 64 67  65 46 6c 61 67 3d 30 29  |ottomEdgeFlag=0)|
00002e90  20 f2 70 6f 69 6e 74 65  72 6f 6e 62 6f 74 74 6f  | .pointeronbotto|
00002ea0  6d 65 64 67 65 0d 11 da  06 20 cc 0d 11 e4 15 20  |medge.... ..... |
00002eb0  42 6f 74 74 6f 6d 45 64  67 65 46 6c 61 67 3d 30  |BottomEdgeFlag=0|
00002ec0  0d 11 ee 05 cd 0d 11 f8  04 0d 12 02 05 e1 0d 12  |................|
00002ed0  0c 04 0d 12 16 39 f4 20  2a 2a 2a 2a 2a 2a 2a 2a  |.....9. ********|
00002ee0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00002f00  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 0d 12 20 04 0d  |***********.. ..|
00002f10  12 2a 19 dd f2 70 6f 69  6e 74 65 72 6f 6e 62 6f  |.*...pointeronbo|
00002f20  74 74 6f 6d 65 64 67 65  0d 12 34 14 ea 20 73 74  |ttomedge..4.. st|
00002f30  61 63 6b 70 6f 73 69 74  69 6f 6e 25 0d 12 3e 22  |ackposition%..>"|
00002f40  f4 20 4d 61 6b 65 20 69  63 6f 6e 62 61 72 20 61  |. Make iconbar a|
00002f50  74 20 74 6f 70 20 6f 66  20 73 74 61 63 6b 0d 12  |t top of stack..|
00002f60  48 14 42 6f 74 74 6f 6d  45 64 67 65 46 6c 61 67  |H.BottomEdgeFlag|
00002f70  3d 31 0d 12 52 1c c8 99  22 57 69 6d 70 5f 50 72  |=1..R..."Wimp_Pr|
00002f80  6f 63 65 73 73 4b 65 79  22 2c 26 31 64 63 0d 12  |ocessKey",&1dc..|
00002f90  5c 05 e1 0d 12 66 04 0d  12 70 19 dd f2 70 6f 69  |\....f...p...poi|
00002fa0  6e 74 65 72 6e 6f 74 6f  6e 69 63 6f 6e 62 61 72  |nternotoniconbar|
00002fb0  0d 12 7a 47 e7 20 28 54  6f 6f 6c 54 69 70 25 3d  |..zG. (ToolTip%=|
00002fc0  30 20 84 20 28 54 6f 6f  6c 54 69 70 25 3c 3e 30  |0 . (ToolTip%<>0|
00002fd0  20 80 20 63 75 72 72 65  6e 74 77 69 6e 64 6f 77  | . currentwindow|
00002fe0  25 3c 3e 77 68 61 6e 64  6c 65 5f 74 6f 6f 6c 74  |%<>whandle_toolt|
00002ff0  69 70 25 29 29 20 8c 0d  12 84 3a 20 e7 20 66 69  |ip%)) ....: . fi|
00003000  72 73 74 6d 65 6e 75 68  61 6e 64 6c 65 25 3d 2d  |rstmenuhandle%=-|
00003010  32 20 66 69 72 73 74 6d  65 6e 75 68 61 6e 64 6c  |2 firstmenuhandl|
00003020  65 25 3d 63 75 72 72 65  6e 74 77 69 6e 64 6f 77  |e%=currentwindow|
00003030  25 0d 12 8e 05 cd 0d 12  98 04 0d 12 a2 0e 21 62  |%.............!b|
00003040  6c 6f 63 6b 25 3d 2d 32  0d 12 ac 23 c8 99 22 57  |lock%=-2...#.."W|
00003050  69 6d 70 5f 47 65 74 57  69 6e 64 6f 77 53 74 61  |imp_GetWindowSta|
00003060  74 65 22 2c 2c 62 6c 6f  63 6b 25 0d 12 b6 1c 73  |te",,block%....s|
00003070  74 61 63 6b 70 6f 73 69  74 69 6f 6e 25 3d 62 6c  |tackposition%=bl|
00003080  6f 63 6b 25 21 32 38 0d  12 c0 2b e7 20 28 73 74  |ock%!28...+. (st|
00003090  61 63 6b 70 6f 73 69 74  69 6f 6e 25 3c 3e 6f 6c  |ackposition%<>ol|
000030a0  64 73 74 61 63 6b 70 6f  73 69 74 69 6f 6e 25 29  |dstackposition%)|
000030b0  20 8c 0d 12 ca 40 e7 20  28 63 75 72 72 65 6e 74  | ....@. (current|
000030c0  77 69 6e 64 6f 77 25 3c  3e 66 69 72 73 74 6d 65  |window%<>firstme|
000030d0  6e 75 68 61 6e 64 6c 65  25 20 80 20 66 69 72 73  |nuhandle% . firs|
000030e0  74 6d 65 6e 75 68 61 6e  64 6c 65 25 3e 2d 32 29  |tmenuhandle%>-2)|
000030f0  20 8c 0d 12 d4 1c c8 99  22 57 69 6d 70 5f 50 72  | ......."Wimp_Pr|
00003100  6f 63 65 73 73 4b 65 79  22 2c 26 31 64 63 0d 12  |ocessKey",&1dc..|
00003110  de 17 66 69 72 73 74 6d  65 6e 75 68 61 6e 64 6c  |..firstmenuhandl|
00003120  65 25 3d 2d 33 0d 12 e8  0e 21 62 6c 6f 63 6b 25  |e%=-3....!block%|
00003130  3d 2d 32 0d 12 f2 23 c8  99 22 57 69 6d 70 5f 47  |=-2...#.."Wimp_G|
00003140  65 74 57 69 6e 64 6f 77  53 74 61 74 65 22 2c 2c  |etWindowState",,|
00003150  62 6c 6f 63 6b 25 0d 12  fc 1c 73 74 61 63 6b 70  |block%....stackp|
00003160  6f 73 69 74 69 6f 6e 25  3d 62 6c 6f 63 6b 25 21  |osition%=block%!|
00003170  32 38 0d 13 06 24 6f 6c  64 73 74 61 63 6b 70 6f  |28...$oldstackpo|
00003180  73 69 74 69 6f 6e 25 3d  73 74 61 63 6b 70 6f 73  |sition%=stackpos|
00003190  69 74 69 6f 6e 25 0d 13  10 05 cd 0d 13 1a 05 cd  |ition%..........|
000031a0  0d 13 24 05 e1 0d 13 2e  04 0d 13 38 04 0d 13 42  |..$........8...B|
000031b0  10 dd f2 6f 75 74 6f 66  66 6f 63 75 73 0d 13 4c  |...outoffocus..L|
000031c0  28 e7 20 28 69 6e 5f 6c  65 66 74 72 65 67 69 6f  |(. (in_leftregio|
000031d0  6e 29 20 8c 20 f2 6c 65  61 76 65 6c 65 66 74 72  |n) . .leaveleftr|
000031e0  65 67 69 6f 6e 0d 13 56  2a e7 20 28 69 6e 5f 72  |egion..V*. (in_r|
000031f0  69 67 68 74 72 65 67 69  6f 6e 29 20 8c 20 f2 6c  |ightregion) . .l|
00003200  65 61 76 65 72 69 67 68  74 72 65 67 69 6f 6e 0d  |eaverightregion.|
00003210  13 60 0e 71 66 5f 74 69  6d 65 72 3d 91 0d 13 6a  |.`.qf_timer=...j|
00003220  05 e1 0d 13 74 04 0d 13  7e 15 dd f2 6c 65 61 76  |....t...~...leav|
00003230  65 6c 65 66 74 72 65 67  69 6f 6e 0d 13 88 13 69  |eleftregion....i|
00003240  6e 5f 6c 65 66 74 72 65  67 69 6f 6e 3d a3 0d 13  |n_leftregion=...|
00003250  92 05 e1 0d 13 9c 04 0d  13 a6 16 dd f2 6c 65 61  |.............lea|
00003260  76 65 72 69 67 68 74 72  65 67 69 6f 6e 0d 13 b0  |verightregion...|
00003270  14 69 6e 5f 72 69 67 68  74 72 65 67 69 6f 6e 3d  |.in_rightregion=|
00003280  a3 0d 13 ba 05 e1 0d 13  c4 04 0d 13 ce 10 dd f2  |................|
00003290  66 6f 63 75 73 64 65 6c  61 79 0d 13 d8 36 e7 20  |focusdelay...6. |
000032a0  28 28 91 2d 70 61 75 73  65 25 29 3e 71 66 5f 74  |((.-pause%)>qf_t|
000032b0  69 6d 65 72 29 20 8c 20  71 66 5f 74 69 6d 65 72  |imer) . qf_timer|
000032c0  3d 2d 31 3a f2 4f 70 65  6e 49 6e 66 6f 42 6f 78  |=-1:.OpenInfoBox|
000032d0  0d 13 e2 05 e1 0d 13 ec  04 0d 13 f6 11 dd f2 6c  |...............l|
000032e0  65 66 74 5f 63 6f 72 6e  65 72 0d 14 00 2c e7 20  |eft_corner...,. |
000032f0  28 69 6e 5f 6c 65 66 74  72 65 67 69 6f 6e 3d a3  |(in_leftregion=.|
00003300  29 20 65 63 5f 74 69 6d  65 72 3d 91 3a 65 63 5f  |) ec_timer=.:ec_|
00003310  66 6c 61 67 3d a3 0d 14  0a 13 69 6e 5f 6c 65 66  |flag=.....in_lef|
00003320  74 72 65 67 69 6f 6e 3d  b9 0d 14 14 23 f4 20 43  |tregion=....#. C|
00003330  68 65 63 6b 20 69 66 20  77 69 6e 64 6f 77 73 20  |heck if windows |
00003340  6e 65 65 64 20 6f 70 65  6e 69 6e 67 0d 14 1e 24  |need opening...$|
00003350  e7 20 28 91 2d 65 63 5f  74 69 6d 65 72 3e 3d 35  |. (.-ec_timer>=5|
00003360  30 20 80 20 65 63 5f 66  6c 61 67 3d a3 29 20 8c  |0 . ec_flag=.) .|
00003370  0d 14 28 1a f2 72 65 6f  70 65 6e 66 69 6c 65 72  |..(..reopenfiler|
00003380  3a 65 63 5f 66 6c 61 67  3d b9 0d 14 32 05 cd 0d  |:ec_flag=...2...|
00003390  14 3c 04 0d 14 46 05 e1  0d 14 50 04 0d 14 5a 12  |.<...F....P...Z.|
000033a0  dd f2 72 69 67 68 74 5f  63 6f 72 6e 65 72 0d 14  |..right_corner..|
000033b0  64 2d e7 20 28 69 6e 5f  72 69 67 68 74 72 65 67  |d-. (in_rightreg|
000033c0  69 6f 6e 3d a3 29 20 65  63 5f 74 69 6d 65 72 3d  |ion=.) ec_timer=|
000033d0  91 3a 65 63 5f 66 6c 61  67 3d a3 0d 14 6e 14 69  |.:ec_flag=...n.i|
000033e0  6e 5f 72 69 67 68 74 72  65 67 69 6f 6e 3d b9 0d  |n_rightregion=..|
000033f0  14 78 23 f4 20 43 68 65  63 6b 20 69 66 20 77 69  |.x#. Check if wi|
00003400  6e 64 6f 77 73 20 6e 65  65 64 20 63 6c 6f 73 69  |ndows need closi|
00003410  6e 67 0d 14 82 33 f4 49  46 20 28 54 49 4d 45 2d  |ng...3.IF (TIME-|
00003420  65 63 5f 74 69 6d 65 72  3e 3d 31 30 30 20 41 4e  |ec_timer>=100 AN|
00003430  44 20 65 63 5f 66 6c 61  67 3d 46 41 4c 53 45 29  |D ec_flag=FALSE)|
00003440  20 54 48 45 4e 0d 14 8c  13 e7 20 28 65 63 5f 66  | THEN..... (ec_f|
00003450  6c 61 67 3d a3 29 20 8c  0d 14 96 27 f2 63 6c 6f  |lag=.) ....'.clo|
00003460  73 65 66 69 6c 65 72 3a  f2 43 6c 6f 73 65 49 6e  |sefiler:.CloseIn|
00003470  66 6f 42 6f 78 3a 65 63  5f 66 6c 61 67 3d b9 0d  |foBox:ec_flag=..|
00003480  14 a0 05 cd 0d 14 aa 05  e1 0d 14 b4 04 0d 14 be  |................|
00003490  39 f4 20 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |9. *************|
000034a0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000034c0  2a 2a 2a 2a 2a 2a 0d 14  c8 04 0d 14 d2 11 dd f2  |******..........|
000034d0  4f 70 65 6e 49 6e 66 6f  42 6f 78 0d 14 dc 04 0d  |OpenInfoBox.....|
000034e0  14 e6 04 0d 14 f0 04 0d  14 fa 19 21 62 6c 6f 63  |...........!bloc|
000034f0  6b 25 3d 77 68 61 6e 64  6c 65 5f 69 6e 66 6f 25  |k%=whandle_info%|
00003500  0d 15 04 23 c8 99 22 57  69 6d 70 5f 47 65 74 57  |...#.."Wimp_GetW|
00003510  69 6e 64 6f 77 53 74 61  74 65 22 2c 2c 62 6c 6f  |indowState",,blo|
00003520  63 6b 25 0d 15 0e 1f c8  99 22 57 69 6d 70 5f 4f  |ck%......"Wimp_O|
00003530  70 65 6e 57 69 6e 64 6f  77 22 2c 2c 62 6c 6f 63  |penWindow",,bloc|
00003540  6b 25 0d 15 18 05 e1 0d  15 22 04 0d 15 2c 12 dd  |k%......."...,..|
00003550  f2 43 6c 6f 73 65 49 6e  66 6f 42 6f 78 0d 15 36  |.CloseInfoBox..6|
00003560  19 21 62 6c 6f 63 6b 25  3d 77 68 61 6e 64 6c 65  |.!block%=whandle|
00003570  5f 69 6e 66 6f 25 0d 15  40 20 c8 99 22 57 69 6d  |_info%..@ .."Wim|
00003580  70 5f 43 6c 6f 73 65 57  69 6e 64 6f 77 22 2c 2c  |p_CloseWindow",,|
00003590  62 6c 6f 63 6b 25 0d 15  4a 05 e1 0d 15 54 04 0d  |block%..J....T..|
000035a0  15 5e 39 f4 20 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |.^9. ***********|
000035b0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000035d0  2a 2a 2a 2a 2a 2a 2a 2a  0d 15 68 04 0d 15 72 16  |********..h...r.|
000035e0  dd f2 69 6e 69 74 5f 64  72 61 67 28 69 63 6f 6e  |..init_drag(icon|
000035f0  25 29 0d 15 7c 0f 71 66  5f 74 69 6d 65 72 3d 2d  |%)..|.qf_timer=-|
00003600  31 0d 15 86 23 c8 99 22  57 69 6d 70 5f 47 65 74  |1...#.."Wimp_Get|
00003610  50 6f 69 6e 74 65 72 49  6e 66 6f 22 2c 2c 62 6c  |PointerInfo",,bl|
00003620  6f 63 6b 25 0d 15 90 10  6f 78 25 3d 62 6c 6f 63  |ock%....ox%=bloc|
00003630  6b 25 21 30 0d 15 9a 10  6f 79 25 3d 62 6c 6f 63  |k%!0....oy%=bloc|
00003640  6b 25 21 34 0d 15 a4 12  62 6c 6f 63 6b 25 21 34  |k%!4....block%!4|
00003650  3d 69 63 6f 6e 25 0d 15  ae 14 64 72 61 67 5f 69  |=icon%....drag_i|
00003660  63 6f 6e 25 3d 69 63 6f  6e 25 0d 15 b8 17 62 6c  |con%=icon%....bl|
00003670  6f 63 6b 25 21 34 3d 64  72 61 67 5f 74 79 70 65  |ock%!4=drag_type|
00003680  25 0d 15 c2 13 62 6c 6f  63 6b 25 21 38 3d 6f 78  |%....block%!8=ox|
00003690  25 2d 33 32 0d 15 cc 14  62 6c 6f 63 6b 25 21 31  |%-32....block%!1|
000036a0  32 3d 6f 79 25 2d 33 32  0d 15 d6 14 62 6c 6f 63  |2=oy%-32....bloc|
000036b0  6b 25 21 31 36 3d 6f 78  25 2b 33 32 0d 15 e0 14  |k%!16=ox%+32....|
000036c0  62 6c 6f 63 6b 25 21 32  30 3d 6f 79 25 2b 33 32  |block%!20=oy%+32|
000036d0  0d 15 ea 17 62 6c 6f 63  6b 25 21 32 34 3d 26 38  |....block%!24=&8|
000036e0  30 30 30 30 30 30 30 0d  15 f4 17 62 6c 6f 63 6b  |0000000....block|
000036f0  25 21 32 38 3d 26 38 30  30 30 30 30 30 30 0d 15  |%!28=&80000000..|
00003700  fe 17 62 6c 6f 63 6b 25  21 33 32 3d 26 37 46 46  |..block%!32=&7FF|
00003710  46 46 46 46 46 0d 16 08  17 62 6c 6f 63 6b 25 21  |FFFFF....block%!|
00003720  33 36 3d 26 37 46 46 46  46 46 46 46 0d 16 12 1c  |36=&7FFFFFFF....|
00003730  c8 99 22 57 69 6d 70 5f  44 72 61 67 42 6f 78 22  |.."Wimp_DragBox"|
00003740  2c 2c 62 6c 6f 63 6b 25  0d 16 1c 04 0d 16 26 1e  |,,block%......&.|
00003750  f4 20 53 74 61 72 74 20  61 20 73 70 72 69 74 65  |. Start a sprite|
00003760  20 64 72 61 67 20 2e 2e  2e 2e 0d 16 30 33 e7 20  | drag ......03. |
00003770  28 69 63 6f 6e 25 3d 61  64 64 5f 77 69 6e 64 6f  |(icon%=add_windo|
00003780  77 25 29 20 24 64 72 61  67 73 70 72 69 74 65 6e  |w%) $dragspriten|
00003790  61 6d 65 25 3d 22 79 65  73 22 2b bd 30 0d 16 3a  |ame%="yes"+.0..:|
000037a0  37 e7 20 28 69 63 6f 6e  25 3d 73 75 62 74 72 61  |7. (icon%=subtra|
000037b0  63 74 5f 77 69 6e 64 6f  77 25 29 20 24 64 72 61  |ct_window%) $dra|
000037c0  67 73 70 72 69 74 65 6e  61 6d 65 25 3d 22 6e 6f  |gspritename%="no|
000037d0  22 2b bd 30 0d 16 44 16  21 62 6f 75 6e 64 73 70  |"+.0..D.!boundsp|
000037e0  72 69 74 65 62 6f 78 25  3d 30 0d 16 4e 17 62 6f  |ritebox%=0..N.bo|
000037f0  75 6e 64 73 70 72 69 74  65 62 6f 78 25 21 34 3d  |undspritebox%!4=|
00003800  30 0d 16 58 1c 62 6f 75  6e 64 73 70 72 69 74 65  |0..X.boundsprite|
00003810  62 6f 78 25 21 38 3d 6f  78 25 2b 32 34 0d 16 62  |box%!8=ox%+24..b|
00003820  1d 62 6f 75 6e 64 73 70  72 69 74 65 62 6f 78 25  |.boundspritebox%|
00003830  21 31 32 3d 6f 79 25 2b  32 34 0d 16 6c 46 c8 99  |!12=oy%+24..lF..|
00003840  22 44 72 61 67 41 53 70  72 69 74 65 5f 53 74 61  |"DragASprite_Sta|
00003850  72 74 22 2c 32 2b 38 2b  36 34 2b 31 32 38 2c 31  |rt",2+8+64+128,1|
00003860  2c 64 72 61 67 73 70 72  69 74 65 6e 61 6d 65 25  |,dragspritename%|
00003870  2c 62 6f 75 6e 64 73 70  72 69 74 65 62 6f 78 25  |,boundspritebox%|
00003880  0d 16 76 05 e1 0d 16 80  04 0d 16 8a 0e dd f2 64  |..v............d|
00003890  72 61 67 64 72 6f 70 0d  16 94 23 c8 99 22 57 69  |ragdrop...#.."Wi|
000038a0  6d 70 5f 47 65 74 50 6f  69 6e 74 65 72 49 6e 66  |mp_GetPointerInf|
000038b0  6f 22 2c 2c 62 6c 6f 63  6b 25 0d 16 9e 17 62 6c  |o",,block%....bl|
000038c0  6f 63 6b 25 21 32 30 3d  62 6c 6f 63 6b 25 21 31  |ock%!20=block%!1|
000038d0  32 0d 16 a8 17 62 6c 6f  63 6b 25 21 32 34 3d 62  |2....block%!24=b|
000038e0  6c 6f 63 6b 25 21 31 36  0d 16 b2 15 62 6c 6f 63  |lock%!16....bloc|
000038f0  6b 25 21 32 38 3d 21 62  6c 6f 63 6b 25 0d 16 bc  |k%!28=!block%...|
00003900  16 62 6c 6f 63 6b 25 21  33 32 3d 62 6c 6f 63 6b  |.block%!32=block|
00003910  25 21 34 0d 16 c6 0f 62  6c 6f 63 6b 25 21 33 36  |%!4....block%!36|
00003920  3d 30 0d 16 d0 1a 21 62  6c 6f 63 6b 25 3d 36 34  |=0....!block%=64|
00003930  3a 62 6c 6f 63 6b 25 21  31 32 3d 30 0d 16 da 1e  |:block%!12=0....|
00003940  62 6c 6f 63 6b 25 21 31  36 3d 31 3a 62 6c 6f 63  |block%!16=1:bloc|
00003950  6b 25 21 34 30 3d 26 66  66 66 0d 16 e4 14 24 28  |k%!40=&fff....$(|
00003960  62 6c 6f 63 6b 25 2b 34  34 29 20 3d 22 22 0d 16  |block%+44) =""..|
00003970  ee 36 c8 99 22 57 69 6d  70 5f 53 65 6e 64 4d 65  |.6.."Wimp_SendMe|
00003980  73 73 61 67 65 22 2c 31  38 2c 62 6c 6f 63 6b 25  |ssage",18,block%|
00003990  2c 62 6c 6f 63 6b 25 21  32 30 2c 62 6c 6f 63 6b  |,block%!20,block|
000039a0  25 21 32 34 0d 16 f8 04  0d 17 02 22 f4 20 43 61  |%!24.......". Ca|
000039b0  6e 63 65 6c 20 61 20 73  70 72 69 74 65 20 64 72  |ncel a sprite dr|
000039c0  61 67 20 2e 2e 2e 2e 2e  2e 2e 0d 17 0c 18 c8 99  |ag .............|
000039d0  22 44 72 61 67 41 53 70  72 69 74 65 5f 53 74 6f  |"DragASprite_Sto|
000039e0  70 22 0d 17 16 05 e1 0d  17 20 04 0d 17 2a 36 f4  |p"....... ...*6.|
000039f0  20 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  | ***************|
00003a00  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00003a20  2a 0d 17 34 2d f4 20 66  75 6e 63 74 69 6f 6e 20  |*..4-. function |
00003a30  74 6f 20 64 65 61 6c 20  77 69 74 68 20 69 6e 63  |to deal with inc|
00003a40  6f 6d 69 6e 67 20 6d 65  73 73 61 67 65 73 0d 17  |oming messages..|
00003a50  3e 36 f4 20 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |>6. ************|
00003a60  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00003a80  2a 2a 2a 2a 0d 17 48 16  dd f2 72 65 63 65 69 76  |****..H...receiv|
00003a90  65 28 72 65 61 73 6f 6e  25 29 0d 17 52 16 6d 65  |e(reason%)..R.me|
00003aa0  73 73 61 67 65 25 3d 62  6c 6f 63 6b 25 21 31 36  |ssage%=block%!16|
00003ab0  0d 17 5c 34 f4 20 50 52  4f 43 65 72 72 6f 72 28  |..\4. PROCerror(|
00003ac0  22 4d 65 73 73 61 67 65  20 3a 20 26 22 2b 53 54  |"Message : &"+ST|
00003ad0  52 24 7e 28 6d 65 73 73  61 67 65 25 29 2b 43 48  |R$~(message%)+CH|
00003ae0  52 24 30 29 0d 17 66 11  c8 8e 20 6d 65 73 73 61  |R$0)..f... messa|
00003af0  67 65 25 20 ca 0d 17 70  0f c9 20 30 3a 71 75 69  |ge% ...p.. 0:qui|
00003b00  74 25 3d b9 0d 17 7a 92  c9 20 33 3a f2 64 61 74  |t%=...z.. 3:.dat|
00003b10  61 5f 6c 6f 61 64 5f 61  64 64 5f 6c 69 6e 6b 3a  |a_load_add_link:|
00003b20  f4 20 50 52 4f 43 65 72  72 6f 72 28 22 44 61 74  |. PROCerror("Dat|
00003b30  61 4c 6f 61 64 3a 22 2b  46 4e 73 74 72 69 6e 67  |aLoad:"+FNstring|
00003b40  28 62 6c 6f 63 6b 25 2b  34 34 29 2b 22 20 4c 65  |(block%+44)+" Le|
00003b50  61 66 6e 61 6d 65 3a 22  2b 46 4e 47 65 74 4c 65  |afname:"+FNGetLe|
00003b60  61 66 4e 61 6d 65 28 62  6c 6f 63 6b 25 2b 34 34  |afName(block%+44|
00003b70  29 2b 22 20 54 79 70 65  3a 26 22 2b 53 54 52 24  |)+" Type:&"+STR$|
00003b80  7e 28 21 28 62 6c 6f 63  6b 25 2b 34 30 29 29 2b  |~(!(block%+40))+|
00003b90  43 48 52 24 30 29 0d 17  84 11 c9 20 32 3a f2 64  |CHR$0)..... 2:.d|
00003ba0  61 74 61 5f 61 63 6b 0d  17 8e 12 c9 20 35 3a f2  |ata_ack..... 5:.|
00003bb0  64 61 74 61 5f 6f 70 65  6e 0d 17 98 15 c9 20 31  |data_open..... 1|
00003bc0  30 3a f2 64 65 73 6b 74  6f 70 5f 61 63 6b 0d 17  |0:.desktop_ack..|
00003bd0  a2 18 c9 20 26 35 30 32  3a f2 73 65 72 76 69 63  |... &502:.servic|
00003be0  65 5f 68 65 6c 70 0d 17  ac 1d c9 20 26 34 30 30  |e_help..... &400|
00003bf0  43 30 3a f2 73 75 62 6d  65 6e 75 5f 77 61 72 6e  |C0:.submenu_warn|
00003c00  69 6e 67 0d 17 b6 1b c9  20 26 34 30 30 43 31 3a  |ing..... &400C1:|
00003c10  f2 47 65 74 53 63 72 65  65 6e 53 69 7a 65 0d 17  |.GetScreenSize..|
00003c20  c0 1f c9 20 26 34 30 30  43 39 3a 49 63 6f 6e 42  |... &400C9:IconB|
00003c30  61 72 4d 65 6e 75 4f 70  65 6e 25 3d 30 0d 17 ca  |arMenuOpen%=0...|
00003c40  05 cb 0d 17 d4 05 e1 0d  17 de 04 0d 17 e8 12 dd  |................|
00003c50  f2 73 65 72 76 69 63 65  5f 68 65 6c 70 0d 17 f2  |.service_help...|
00003c60  17 62 6c 6f 63 6b 25 21  31 32 20 3d 62 6c 6f 63  |.block%!12 =bloc|
00003c70  6b 25 21 38 0d 17 fc 12  62 6c 6f 63 6b 25 21 31  |k%!8....block%!1|
00003c80  36 3d 26 35 30 33 0d 18  06 0f 21 62 6c 6f 63 6b  |6=&503....!block|
00003c90  25 3d 32 35 36 0d 18 10  18 e7 20 28 62 6c 6f 63  |%=256..... (bloc|
00003ca0  6b 25 21 33 32 20 3d 20  2d 32 29 20 8c 0d 18 1a  |k%!32 = -2) ....|
00003cb0  cb 20 24 28 62 6c 6f 63  6b 25 2b 32 30 29 20 3d  |. $(block%+20) =|
00003cc0  22 5c 54 58 75 65 6e 20  69 63 6f 6e 2e 7c 4d 5c  |"\TXuen icon.|M\|
00003cd0  53 73 68 6f 77 20 73 68  6f 72 74 63 75 74 73 2e  |Sshow shortcuts.|
00003ce0  7c 4d 43 6c 69 63 6b 20  4d 45 4e 55 20 74 6f 20  ||MClick MENU to |
00003cf0  73 68 6f 77 20 6f 70 74  69 6f 6e 73 2e 7c 4d 5c  |show options.|M\|
00003d00  41 73 68 6f 77 20 63 75  72 72 65 6e 74 6c 79 20  |Ashow currently |
00003d10  6f 70 65 6e 20 77 69 6e  64 6f 77 20 6c 69 73 74  |open window list|
00003d20  2e 7c 4d 44 72 61 67 20  61 6e 64 20 64 72 6f 70  |.|MDrag and drop|
00003d30  20 61 6e 20 69 63 6f 6e  20 6f 6e 74 6f 20 74 68  | an icon onto th|
00003d40  65 20 58 75 65 6e 20 69  63 6f 6e 20 74 6f 20 69  |e Xuen icon to i|
00003d50  6e 73 74 61 6c 6c 20 69  74 20 69 6e 74 6f 20 74  |nstall it into t|
00003d60  68 65 20 73 68 6f 72 74  63 75 74 73 20 6d 65 6e  |he shortcuts men|
00003d70  75 2e 7c 4d 22 2b bd 30  0d 18 24 2c 20 c8 99 22  |u.|M"+.0..$, .."|
00003d80  57 69 6d 70 5f 53 65 6e  64 4d 65 73 73 61 67 65  |Wimp_SendMessage|
00003d90  22 2c 31 37 2c 62 6c 6f  63 6b 25 2c 62 6c 6f 63  |",17,block%,bloc|
00003da0  6b 25 21 34 0d 18 2e 05  cc 0d 18 38 37 20 24 28  |k%!4.......87 $(|
00003db0  62 6c 6f 63 6b 25 2b 32  30 29 20 3d 22 54 68 69  |block%+20) ="Thi|
00003dc0  73 20 69 73 20 74 68 65  20 58 75 65 6e 20 61 70  |s is the Xuen ap|
00003dd0  70 6c 69 63 61 74 69 6f  6e 2e 7c 4d 22 2b bd 30  |plication.|M"+.0|
00003de0  0d 18 42 2c 20 c8 99 22  57 69 6d 70 5f 53 65 6e  |..B, .."Wimp_Sen|
00003df0  64 4d 65 73 73 61 67 65  22 2c 31 37 2c 62 6c 6f  |dMessage",17,blo|
00003e00  63 6b 25 2c 62 6c 6f 63  6b 25 21 34 0d 18 4c 04  |ck%,block%!4..L.|
00003e10  0d 18 56 05 cd 0d 18 60  04 0d 18 6a 26 f4 20 49  |..V....`...j&. I|
00003e20  46 20 28 62 6c 6f 63 6b  25 21 33 32 20 3d 20 6d  |F (block%!32 = m|
00003e30  61 69 6e 5f 6d 65 6e 75  25 29 20 54 48 45 4e 0d  |ain_menu%) THEN.|
00003e40  18 74 2a e7 20 28 43 75  72 72 65 6e 74 4d 65 6e  |.t*. (CurrentMen|
00003e50  75 54 79 70 65 25 20 3d  20 4d 61 69 6e 4d 65 6e  |uType% = MainMen|
00003e60  75 54 79 70 65 25 29 20  8c 0d 18 7e ed f4 20 24  |uType%) ...~.. $|
00003e70  28 62 6c 6f 63 6b 25 2b  32 30 29 20 3d 22 27 41  |(block%+20) ="'A|
00003e80  64 76 61 6e 63 65 64 27  20 6f 70 74 69 6f 6e 20  |dvanced' option |
00003e90  65 6e 61 62 6c 65 73 20  74 68 65 20 62 6f 6f 74  |enables the boot|
00003ea0  20 63 6f 6e 66 69 67 75  72 61 74 69 6f 6e 20 74  | configuration t|
00003eb0  6f 20 62 65 20 63 68 61  6e 67 65 64 20 66 72 6f  |o be changed fro|
00003ec0  6d 20 74 68 65 20 73 68  6f 72 74 63 75 74 20 6d  |m the shortcut m|
00003ed0  65 6e 75 2e 7c 4d 27 54  6f 6f 6c 62 6f 78 27 20  |enu.|M'Toolbox' |
00003ee0  68 61 73 20 73 6f 6d 65  20 75 73 65 66 75 6c 20  |has some useful |
00003ef0  6c 69 74 74 6c 65 20 70  72 6f 67 72 61 6d 6d 69  |little programmi|
00003f00  6e 67 20 74 6f 6f 6c 73  20 73 75 63 68 20 61 73  |ng tools such as|
00003f10  20 73 61 76 69 6e 67 20  74 68 65 20 52 4f 4d 20  | saving the ROM |
00003f20  61 6e 64 20 52 41 4d 20  73 70 72 69 74 65 66 69  |and RAM spritefi|
00003f30  6c 65 73 20 74 6f 20 74  68 65 20 63 75 72 72 65  |les to the curre|
00003f40  6e 74 20 64 69 72 65 63  74 6f 72 79 2e 7c 4d 22  |nt directory.|M"|
00003f50  2b 43 48 52 24 30 0d 18  88 2e f4 20 53 59 53 22  |+CHR$0..... SYS"|
00003f60  57 69 6d 70 5f 53 65 6e  64 4d 65 73 73 61 67 65  |Wimp_SendMessage|
00003f70  22 2c 31 37 2c 62 6c 6f  63 6b 25 2c 62 6c 6f 63  |",17,block%,bloc|
00003f80  6b 25 21 34 0d 18 92 05  cd 0d 18 9c 05 e1 0d 18  |k%!4............|
00003f90  a6 04 0d 18 b0 3d f4 20  2a 2a 2a 2a 2a 2a 2a 2a  |.....=. ********|
00003fa0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00003fc0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 0d  |***************.|
00003fd0  18 ba 2b f4 20 55 73 65  72 20 68 61 73 20 64 6f  |..+. User has do|
00003fe0  75 62 6c 65 20 63 6c 69  63 6b 65 64 20 6f 6e 20  |uble clicked on |
00003ff0  61 20 66 69 6c 65 69 63  6f 6e 0d 18 c4 3d f4 20  |a fileicon...=. |
00004000  52 65 73 70 6f 6e 73 65  20 2d 20 73 74 6f 72 65  |Response - store|
00004010  20 61 20 6c 69 6e 6b 20  74 6f 20 74 68 69 73 20  | a link to this |
00004020  66 69 6c 65 20 69 6e 20  74 68 65 20 7e 20 64 69  |file in the ~ di|
00004030  72 65 63 74 6f 72 79 0d  18 ce 3d f4 20 2a 2a 2a  |rectory...=. ***|
00004040  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00004070  2a 2a 2a 2a 0d 18 d8 0f  dd f2 64 61 74 61 5f 6f  |****......data_o|
00004080  70 65 6e 0d 18 e2 1c ea  20 74 79 70 65 25 2c 20  |pen..... type%, |
00004090  64 65 73 74 69 6e 61 74  69 6f 6e 64 69 72 24 0d  |destinationdir$.|
000040a0  18 ec 24 f4 20 46 6c 75  73 68 20 63 61 63 68 65  |..$. Flush cache|
000040b0  20 69 66 20 73 74 75 66  66 20 69 6e 20 69 74 20  | if stuff in it |
000040c0  2e 2e 2e 0d 18 f6 38 e7  20 28 61 6c 62 61 5f 74  |......8. (alba_t|
000040d0  79 70 65 25 3e 30 20 80  20 61 6c 62 61 5f 74 79  |ype%>0 . alba_ty|
000040e0  70 65 25 3c 3e 34 30 39  36 29 20 8c 20 f2 61 6c  |pe%<>4096) . .al|
000040f0  62 61 5f 70 75 72 67 65  28 30 29 0d 19 00 04 0d  |ba_purge(0).....|
00004100  19 0a 28 61 6c 62 61 5f  6e 65 77 6c 69 6e 6b 66  |..(alba_newlinkf|
00004110  69 6c 65 24 3d a4 73 74  72 69 6e 67 28 62 6c 6f  |ile$=.string(blo|
00004120  63 6b 25 2b 34 34 29 0d  19 14 2d 61 6c 62 61 5f  |ck%+44)...-alba_|
00004130  6e 65 77 6c 69 6e 6b 6c  65 61 66 24 3d a4 47 65  |newlinkleaf$=.Ge|
00004140  74 4c 65 61 66 4e 61 6d  65 28 62 6c 6f 63 6b 25  |tLeafName(block%|
00004150  2b 34 34 29 0d 19 1e 16  74 79 70 65 25 3d 21 28  |+44)....type%=!(|
00004160  62 6c 6f 63 6b 25 2b 34  30 29 0d 19 28 14 61 6c  |block%+40)..(.al|
00004170  62 61 5f 74 79 70 65 25  3d 74 79 70 65 25 0d 19  |ba_type%=type%..|
00004180  32 2c f4 20 50 52 4f 43  65 72 72 6f 72 28 22 54  |2,. PROCerror("T|
00004190  79 70 65 20 3d 20 22 2b  53 54 52 24 28 74 79 70  |ype = "+STR$(typ|
000041a0  65 25 29 2b 43 48 52 24  30 29 0d 19 3c 36 64 65  |e%)+CHR$0)..<6de|
000041b0  73 74 69 6e 61 74 69 6f  6e 64 69 72 24 3d 41 70  |stinationdir$=Ap|
000041c0  70 50 61 74 68 24 2b 22  2e 55 73 65 72 73 2e 22  |pPath$+".Users."|
000041d0  2b 55 73 65 72 24 2b 22  2e 4c 69 6e 6b 73 2e 22  |+User$+".Links."|
000041e0  0d 19 46 04 0d 19 50 04  0d 19 5a 14 e7 20 28 74  |..F...P...Z.. (t|
000041f0  79 70 65 25 3d 34 30 39  36 29 20 8c 0d 19 64 21  |ype%=4096) ...d!|
00004200  f4 20 53 74 6f 72 65 20  74 68 69 73 20 64 69 72  |. Store this dir|
00004210  65 63 74 6f 72 79 20 61  63 63 65 73 73 0d 19 6e  |ectory access..n|
00004220  3f 64 65 73 74 69 6e 61  74 69 6f 6e 64 69 72 24  |?destinationdir$|
00004230  3d 64 65 73 74 69 6e 61  74 69 6f 6e 64 69 72 24  |=destinationdir$|
00004240  2b bd 28 53 79 73 46 69  6c 65 50 72 65 66 69 78  |+.(SysFilePrefix|
00004250  25 29 2b 22 46 6f 6c 64  65 72 73 22 0d 19 78 05  |%)+"Folders"..x.|
00004260  cd 0d 19 82 04 0d 19 8c  14 e7 20 28 74 79 70 65  |.......... (type|
00004270  25 3d 38 31 39 32 29 20  8c 0d 19 96 23 f4 20 53  |%=8192) ....#. S|
00004280  74 6f 72 65 20 74 68 69  73 20 61 70 70 6c 69 63  |tore this applic|
00004290  61 74 69 6f 6e 20 61 63  63 65 73 73 0d 19 a0 40  |ation access...@|
000042a0  64 65 73 74 69 6e 61 74  69 6f 6e 64 69 72 24 3d  |destinationdir$=|
000042b0  64 65 73 74 69 6e 61 74  69 6f 6e 64 69 72 24 2b  |destinationdir$+|
000042c0  bd 28 53 79 73 46 69 6c  65 50 72 65 66 69 78 25  |.(SysFilePrefix%|
000042d0  29 2b 22 50 72 6f 67 72  61 6d 73 22 0d 19 aa 05  |)+"Programs"....|
000042e0  cd 0d 19 b4 04 0d 19 be  14 e7 20 28 74 79 70 65  |.......... (type|
000042f0  25 3c 34 30 39 36 29 20  8c 0d 19 c8 1e 20 e7 20  |%<4096) ..... . |
00004300  28 74 79 70 65 25 3d 44  6f 63 75 6d 65 6e 74 54  |(type%=DocumentT|
00004310  79 70 65 25 29 20 8c 0d  19 d2 41 20 64 65 73 74  |ype%) ....A dest|
00004320  69 6e 61 74 69 6f 6e 64  69 72 24 3d 64 65 73 74  |inationdir$=dest|
00004330  69 6e 61 74 69 6f 6e 64  69 72 24 2b bd 28 53 79  |inationdir$+.(Sy|
00004340  73 46 69 6c 65 50 72 65  66 69 78 25 29 2b 22 44  |sFilePrefix%)+"D|
00004350  6f 63 75 6d 65 6e 74 22  0d 19 dc 06 20 cd 0d 19  |ocument".... ...|
00004360  e6 05 20 0d 19 f0 1d 20  e7 20 28 74 79 70 65 25  |.. .... . (type%|
00004370  3d 50 69 63 74 75 72 65  54 79 70 65 25 29 20 8c  |=PictureType%) .|
00004380  0d 19 fa 40 20 64 65 73  74 69 6e 61 74 69 6f 6e  |...@ destination|
00004390  64 69 72 24 3d 64 65 73  74 69 6e 61 74 69 6f 6e  |dir$=destination|
000043a0  64 69 72 24 2b bd 28 53  79 73 46 69 6c 65 50 72  |dir$+.(SysFilePr|
000043b0  65 66 69 78 25 29 2b 22  50 69 63 74 75 72 65 22  |efix%)+"Picture"|
000043c0  0d 1a 04 06 20 cd 0d 1a  0e 04 0d 1a 18 35 20 e7  |.... ........5 .|
000043d0  20 28 74 79 70 65 25 3c  3e 50 69 63 74 75 72 65  | (type%<>Picture|
000043e0  54 79 70 65 25 20 80 20  74 79 70 65 25 3c 3e 44  |Type% . type%<>D|
000043f0  6f 63 75 6d 65 6e 74 54  79 70 65 25 29 20 8c 0d  |ocumentType%) ..|
00004400  1a 22 3e 20 64 65 73 74  69 6e 61 74 69 6f 6e 64  |."> destinationd|
00004410  69 72 24 3d 64 65 73 74  69 6e 61 74 69 6f 6e 64  |ir$=destinationd|
00004420  69 72 24 2b bd 28 53 79  73 46 69 6c 65 50 72 65  |ir$+.(SysFilePre|
00004430  66 69 78 25 29 2b 22 46  69 6c 65 73 22 0d 1a 2c  |fix%)+"Files"..,|
00004440  06 20 cd 0d 1a 36 05 cd  0d 1a 40 04 0d 1a 4a 28  |. ...6....@...J(|
00004450  61 6c 62 61 5f 64 65 73  74 69 6e 61 74 69 6f 6e  |alba_destination|
00004460  64 69 72 24 3d 64 65 73  74 69 6e 61 74 69 6f 6e  |dir$=destination|
00004470  64 69 72 24 0d 1a 54 10  61 6c 62 61 5f 74 69 6d  |dir$..T.alba_tim|
00004480  65 25 3d 91 0d 1a 5e 04  0d 1a 68 3d f4 20 49 67  |e%=...^...h=. Ig|
00004490  6e 6f 72 65 20 61 6c 6c  20 6c 69 6e 6b 73 20 67  |nore all links g|
000044a0  65 6e 65 72 61 74 65 64  20 64 75 72 69 6e 67 20  |enerated during |
000044b0  74 68 65 20 70 72 65 62  6f 6f 74 2f 72 75 6e 20  |the preboot/run |
000044c0  73 74 61 67 65 0d 1a 72  22 e7 20 47 6c 6f 62 61  |stage..r". Globa|
000044d0  6c 53 74 61 74 65 25 3d  30 20 61 6c 62 61 5f 74  |lState%=0 alba_t|
000044e0  79 70 65 25 3d 2d 31 0d  1a 7c 05 e1 0d 1a 86 04  |ype%=-1..|......|
000044f0  0d 1a 90 18 dd f2 61 75  74 6f 61 64 64 6e 65 77  |......autoaddnew|
00004500  73 68 6f 72 74 63 75 74  0d 1a 9a 18 ea 20 61 75  |shortcut..... au|
00004510  74 6f 64 72 6f 70 64 69  72 65 63 74 6f 72 79 24  |todropdirectory$|
00004520  0d 1a a4 23 ea 20 6e 75  6d 62 65 72 25 2c 20 6e  |...#. number%, n|
00004530  65 78 74 25 2c 6e 75 6d  62 65 72 6f 66 69 74 65  |ext%,numberofite|
00004540  6d 73 25 0d 1a ae 3e ea  20 6f 6c 64 65 73 74 64  |ms%...>. oldestd|
00004550  61 74 65 25 2c 6f 6c 64  65 73 74 6e 61 6d 65 24  |ate%,oldestname$|
00004560  2c 6f 6c 64 65 73 74 74  79 70 65 25 2c 6f 6c 64  |,oldesttype%,old|
00004570  65 73 74 6e 65 78 74 25  2c 6f 6c 64 6e 65 78 74  |estnext%,oldnext|
00004580  25 0d 1a b8 10 ea 20 64  65 6c 73 74 72 69 6e 67  |%..... delstring|
00004590  24 0d 1a c2 2d 61 75 74  6f 64 72 6f 70 64 69 72  |$...-autodropdir|
000045a0  65 63 74 6f 72 79 24 20  3d 20 61 6c 62 61 5f 64  |ectory$ = alba_d|
000045b0  65 73 74 69 6e 61 74 69  6f 6e 64 69 72 24 0d 1a  |estinationdir$..|
000045c0  cc 22 f2 65 6e 73 75 72  65 64 69 72 28 61 75 74  |.".ensuredir(aut|
000045d0  6f 64 72 6f 70 64 69 72  65 63 74 6f 72 79 24 29  |odropdirectory$)|
000045e0  0d 1a d6 34 f4 20 41 75  74 6f 20 69 6e 73 65 72  |...4. Auto inser|
000045f0  74 20 64 69 72 65 63 74  6f 72 79 73 20 68 61 76  |t directorys hav|
00004600  65 20 61 20 6c 69 6d 69  74 20 6f 66 20 39 20 69  |e a limit of 9 i|
00004610  74 65 6d 73 0d 1a e0 1e  f4 20 49 73 20 6c 69 6e  |tems..... Is lin|
00004620  6b 20 64 69 72 65 63 74  6f 72 79 20 65 6d 70 74  |k directory empt|
00004630  79 3f 0d 1a ea 14 6e 75  6d 62 65 72 6f 66 69 74  |y?....numberofit|
00004640  65 6d 73 25 3d 30 0d 1a  f4 0b 6e 65 78 74 25 3d  |ems%=0....next%=|
00004650  30 0d 1a fe 11 6f 6c 64  65 73 74 64 61 74 65 25  |0....oldestdate%|
00004660  3d 30 0d 1b 08 26 c8 95  28 6e 65 78 74 25 3c 3e  |=0...&..(next%<>|
00004670  2d 31 20 80 20 6e 75 6d  62 65 72 6f 66 69 74 65  |-1 . numberofite|
00004680  6d 73 25 3c 3d 31 36 29  0d 1b 12 22 24 73 74 72  |ms%<=16)..."$str|
00004690  69 6e 67 25 3d 61 75 74  6f 64 72 6f 70 64 69 72  |ing%=autodropdir|
000046a0  65 63 74 6f 72 79 24 2b  bd 30 0d 1b 1c 12 6f 6c  |ectory$+.0....ol|
000046b0  64 6e 65 78 74 25 3d 6e  65 78 74 25 0d 1b 26 45  |dnext%=next%..&E|
000046c0  c8 99 20 22 4f 53 5f 47  42 50 42 22 2c 31 31 2c  |.. "OS_GBPB",11,|
000046d0  73 74 72 69 6e 67 25 2c  64 62 6c 6f 63 6b 25 2c  |string%,dblock%,|
000046e0  31 2c 6e 65 78 74 25 2c  36 33 2c 22 2a 22 20 b8  |1,next%,63,"*" .|
000046f0  20 2c 2c 2c 6e 75 6d 62  65 72 25 2c 6e 65 78 74  | ,,,number%,next|
00004700  25 0d 1b 30 11 e7 20 6e  65 78 74 25 3c 3e 2d 31  |%..0.. next%<>-1|
00004710  20 8c 0d 1b 3a 15 6e 75  6d 62 65 72 6f 66 69 74  | ...:.numberofit|
00004720  65 6d 73 25 2b 3d 31 0d  1b 44 7c e7 20 28 28 64  |ems%+=1..D|. ((d|
00004730  62 6c 6f 63 6b 25 21 32  34 29 3c 6f 6c 64 65 73  |block%!24)<oldes|
00004740  74 64 61 74 65 25 20 84  20 6f 6c 64 65 73 74 64  |tdate% . oldestd|
00004750  61 74 65 25 3d 30 29 20  6f 6c 64 65 73 74 64 61  |ate%=0) oldestda|
00004760  74 65 25 3d 64 62 6c 6f  63 6b 25 21 32 34 3a 6f  |te%=dblock%!24:o|
00004770  6c 64 65 73 74 6e 61 6d  65 24 3d a4 73 74 72 69  |ldestname$=.stri|
00004780  6e 67 28 64 62 6c 6f 63  6b 25 2b 32 39 29 3a 6f  |ng(dblock%+29):o|
00004790  6c 64 65 73 74 6e 65 78  74 25 3d 6f 6c 64 6e 65  |ldestnext%=oldne|
000047a0  78 74 25 0d 1b 4e 05 cd  0d 1b 58 05 ce 0d 1b 62  |xt%..N....X....b|
000047b0  1a e7 20 28 6e 75 6d 62  65 72 6f 66 69 74 65 6d  |.. (numberofitem|
000047c0  73 25 3c 39 29 20 8c 0d  1b 6c 26 20 f4 20 49 66  |s%<9) ...l& . If|
000047d0  20 73 6f 20 74 68 65 6e  20 61 75 74 6f 6d 61 74  | so then automat|
000047e0  69 63 61 6c 6c 79 20 69  6e 73 65 72 74 0d 1b 76  |ically insert..v|
000047f0  4c 20 f2 61 64 64 6e 65  77 73 68 6f 72 74 63 75  |L .addnewshortcu|
00004800  74 28 61 75 74 6f 64 72  6f 70 64 69 72 65 63 74  |t(autodropdirect|
00004810  6f 72 79 24 2c 61 6c 62  61 5f 6e 65 77 6c 69 6e  |ory$,alba_newlin|
00004820  6b 66 69 6c 65 24 2c 61  6c 62 61 5f 6e 65 77 6c  |kfile$,alba_newl|
00004830  69 6e 6b 6c 65 61 66 24  29 0d 1b 80 05 cc 0d 1b  |inkleaf$).......|
00004840  8a 2b 20 f4 20 49 6e 74  65 6c 6c 69 67 65 6e 74  |.+ . Intelligent|
00004850  6c 79 20 64 65 6c 65 74  65 20 61 6e 20 6f 6c 64  |ly delete an old|
00004860  20 66 69 6c 65 20 61 6e  64 0d 1b 94 20 20 f4 20  | file and...  . |
00004870  47 65 74 20 66 69 6c 65  74 79 70 65 20 6f 66 20  |Get filetype of |
00004880  74 68 69 73 20 66 69 6c  65 0d 1b 9e 23 20 24 73  |this file...# $s|
00004890  74 72 69 6e 67 25 3d 61  75 74 6f 64 72 6f 70 64  |tring%=autodropd|
000048a0  69 72 65 63 74 6f 72 79  24 2b bd 30 0d 1b a8 39  |irectory$+.0...9|
000048b0  20 c8 99 20 22 4f 53 5f  47 42 50 42 22 2c 31 32  | .. "OS_GBPB",12|
000048c0  2c 73 74 72 69 6e 67 25  2c 64 62 6c 6f 63 6b 25  |,string%,dblock%|
000048d0  2c 31 2c 6f 6c 64 65 73  74 6e 65 78 74 25 2c 36  |,1,oldestnext%,6|
000048e0  33 2c 22 2a 22 0d 1b b2  1b 20 6f 6c 64 65 73 74  |3,"*".... oldest|
000048f0  74 79 70 65 25 3d 64 62  6c 6f 63 6b 25 21 32 30  |type%=dblock%!20|
00004900  0d 1b bc 5e 20 20 f4 20  50 52 4f 43 65 72 72 6f  |...^  . PROCerro|
00004910  72 28 22 4f 6c 64 65 73  74 20 66 69 6c 65 20 74  |r("Oldest file t|
00004920  6f 20 72 65 6d 6f 76 65  20 3a 20 22 2b 6f 6c 64  |o remove : "+old|
00004930  65 73 74 6e 61 6d 65 24  2b 22 20 6f 66 20 74 79  |estname$+" of ty|
00004940  70 65 20 22 2b 53 54 52  24 7e 28 6f 6c 64 65 73  |pe "+STR$~(oldes|
00004950  74 74 79 70 65 25 29 2b  43 48 52 24 30 29 0d 1b  |ttype%)+CHR$0)..|
00004960  c6 2d 20 f4 20 44 65 6c  65 74 65 20 74 68 65 20  |.- . Delete the |
00004970  6f 6c 64 65 73 74 20 6c  69 6e 6b 20 69 6e 20 74  |oldest link in t|
00004980  68 69 73 20 64 69 72 20  2e 2e 2e 0d 1b d0 35 20  |his dir ......5 |
00004990  f4 20 46 69 6e 61 6c 20  63 68 65 63 6b 20 2d 20  |. Final check - |
000049a0  4f 6e 6c 79 20 61 6c 6c  6f 77 20 64 65 6c 65 74  |Only allow delet|
000049b0  65 20 6f 6e 20 26 61 66  33 20 66 69 6c 65 73 2e  |e on &af3 files.|
000049c0  0d 1b da 1b 20 e7 20 28  6f 6c 64 65 73 74 74 79  |.... . (oldestty|
000049d0  70 65 25 3d 26 61 66 33  29 20 8c 0d 1b e4 3c 20  |pe%=&af3) ....< |
000049e0  64 65 6c 73 74 72 69 6e  67 24 3d 22 64 65 6c 65  |delstring$="dele|
000049f0  74 65 20 22 2b 61 75 74  6f 64 72 6f 70 64 69 72  |te "+autodropdir|
00004a00  65 63 74 6f 72 79 24 2b  22 2e 22 2b 6f 6c 64 65  |ectory$+"."+olde|
00004a10  73 74 6e 61 6d 65 24 0d  1b ee 34 20 f4 20 50 52  |stname$...4 . PR|
00004a20  4f 43 65 72 72 6f 72 28  22 61 62 6f 75 74 20 74  |OCerror("about t|
00004a30  6f 20 4f 53 43 4c 49 20  22 2b 64 65 6c 73 74 72  |o OSCLI "+delstr|
00004a40  69 6e 67 24 2b 43 48 52  24 30 29 0d 1b f8 15 20  |ing$+CHR$0).... |
00004a50  ff 28 64 65 6c 73 74 72  69 6e 67 24 2b bd 30 29  |.(delstring$+.0)|
00004a60  0d 1c 02 1b 20 f4 20 69  6e 73 65 72 74 20 61 20  |.... . insert a |
00004a70  6e 65 77 20 6f 6e 65 20  2e 2e 2e 0d 1c 0c 4c 20  |new one ......L |
00004a80  f2 61 64 64 6e 65 77 73  68 6f 72 74 63 75 74 28  |.addnewshortcut(|
00004a90  61 75 74 6f 64 72 6f 70  64 69 72 65 63 74 6f 72  |autodropdirector|
00004aa0  79 24 2c 61 6c 62 61 5f  6e 65 77 6c 69 6e 6b 66  |y$,alba_newlinkf|
00004ab0  69 6c 65 24 2c 61 6c 62  61 5f 6e 65 77 6c 69 6e  |ile$,alba_newlin|
00004ac0  6b 6c 65 61 66 24 29 0d  1c 16 06 20 cd 0d 1c 20  |kleaf$).... ... |
00004ad0  05 cd 0d 1c 2a 11 61 6c  62 61 5f 74 79 70 65 25  |....*.alba_type%|
00004ae0  3d 2d 31 0d 1c 34 05 e1  0d 1c 3e 04 0d 1c 48 32  |=-1..4....>...H2|
00004af0  f4 20 50 72 6f 6d 70 74  20 75 73 65 72 20 74 6f  |. Prompt user to|
00004b00  20 73 65 6c 65 63 74 20  64 69 72 65 63 74 6f 72  | select director|
00004b10  79 20 66 6f 72 20 6e 65  77 20 6c 69 6e 6b 0d 1c  |y for new link..|
00004b20  52 18 dd f2 64 61 74 61  5f 6c 6f 61 64 5f 61 64  |R...data_load_ad|
00004b30  64 5f 6c 69 6e 6b 0d 1c  5c 2a ea 20 70 61 74 68  |d_link..\*. path|
00004b40  24 2c 6c 65 61 66 24 2c  74 79 70 65 25 2c 6c 65  |$,leaf$,type%,le|
00004b50  61 66 70 74 72 25 2c 6c  69 6e 6b 6e 61 6d 65 24  |afptr%,linkname$|
00004b60  0d 1c 66 20 e7 20 28 a4  43 68 65 63 6b 4c 69 6e  |..f . (.CheckLin|
00004b70  6b 73 44 69 72 45 78 69  73 74 73 3d 30 29 20 e1  |ksDirExists=0) .|
00004b80  0d 1c 70 1c 70 61 74 68  24 3d a4 73 74 72 69 6e  |..p.path$=.strin|
00004b90  67 28 62 6c 6f 63 6b 25  2b 34 34 29 0d 1c 7a 21  |g(block%+44)..z!|
00004ba0  6c 65 61 66 24 3d a4 47  65 74 4c 65 61 66 4e 61  |leaf$=.GetLeafNa|
00004bb0  6d 65 28 62 6c 6f 63 6b  25 2b 34 34 29 0d 1c 84  |me(block%+44)...|
00004bc0  16 74 79 70 65 25 3d 21  28 62 6c 6f 63 6b 25 2b  |.type%=!(block%+|
00004bd0  34 30 29 0d 1c 8e 36 6c  69 6e 6b 6e 61 6d 65 24  |40)...6linkname$|
00004be0  3d 41 70 70 50 61 74 68  24 2b 22 2e 55 73 65 72  |=AppPath$+".User|
00004bf0  73 2e 22 2b 55 73 65 72  24 2b 22 2e 4c 69 6e 6b  |s."+User$+".Link|
00004c00  73 2e 22 2b 6c 65 61 66  24 0d 1c 98 16 6e 65 77  |s."+leaf$....new|
00004c10  6c 69 6e 6b 6c 65 61 66  24 3d 6c 65 61 66 24 0d  |linkleaf$=leaf$.|
00004c20  1c a2 23 6e 65 77 6c 69  6e 6b 66 69 6c 65 24 3d  |..#newlinkfile$=|
00004c30  a4 73 74 72 69 6e 67 28  62 6c 6f 63 6b 25 2b 34  |.string(block%+4|
00004c40  34 29 0d 1c ac 1e f4 20  49 73 20 6c 69 6e 6b 20  |4)..... Is link |
00004c50  64 69 72 65 63 74 6f 72  79 20 65 6d 70 74 79 3f  |directory empty?|
00004c60  0d 1c b6 31 24 73 74 72  69 6e 67 25 3d 41 70 70  |...1$string%=App|
00004c70  50 61 74 68 24 2b 22 2e  55 73 65 72 73 2e 22 2b  |Path$+".Users."+|
00004c80  55 73 65 72 24 2b 22 2e  4c 69 6e 6b 73 22 2b bd  |User$+".Links"+.|
00004c90  30 0d 1c c0 3b c8 99 20  22 4f 53 5f 47 42 50 42  |0...;.. "OS_GBPB|
00004ca0  22 2c 31 30 2c 73 74 72  69 6e 67 25 2c 64 62 6c  |",10,string%,dbl|
00004cb0  6f 63 6b 25 2c 31 2c 30  2c 36 33 2c 22 2a 22 20  |ock%,1,0,63,"*" |
00004cc0  b8 20 2c 2c 2c 6e 75 6d  62 65 72 25 0d 1c ca 11  |. ,,,number%....|
00004cd0  e7 20 6e 75 6d 62 65 72  25 3d 30 20 8c 0d 1c d4  |. number%=0 ....|
00004ce0  34 f4 20 49 66 20 73 6f  20 74 68 65 6e 20 61 75  |4. If so then au|
00004cf0  74 6f 6d 61 74 69 63 61  6c 6c 79 20 61 64 64 20  |tomatically add |
00004d00  74 6f 20 72 6f 6f 74 20  64 69 72 65 63 74 6f 72  |to root director|
00004d10  79 0d 1c de 50 f2 61 64  64 6e 65 77 73 68 6f 72  |y...P.addnewshor|
00004d20  74 63 75 74 28 41 70 70  50 61 74 68 24 2b 22 2e  |tcut(AppPath$+".|
00004d30  55 73 65 72 73 2e 22 2b  55 73 65 72 24 2b 22 2e  |Users."+User$+".|
00004d40  4c 69 6e 6b 73 22 2c 6e  65 77 6c 69 6e 6b 66 69  |Links",newlinkfi|
00004d50  6c 65 24 2c 6e 65 77 6c  69 6e 6b 6c 65 61 66 24  |le$,newlinkleaf$|
00004d60  29 0d 1c e8 05 cc 0d 1c  f2 18 f2 73 68 6f 77 73  |)..........shows|
00004d70  68 6f 72 74 63 75 74 6d  65 6e 75 28 31 29 0d 1c  |hortcutmenu(1)..|
00004d80  fc 05 cd 0d 1d 06 05 e1  0d 1d 10 04 0d 1d 1a 2c  |...............,|
00004d90  f4 20 41 64 64 20 6e 65  77 20 6c 69 6e 6b 20 74  |. Add new link t|
00004da0  6f 20 74 68 65 20 73 68  6f 72 74 63 75 74 20 64  |o the shortcut d|
00004db0  69 72 65 63 74 6f 72 79  0d 1d 24 46 dd f2 61 64  |irectory..$F..ad|
00004dc0  64 6e 65 77 73 68 6f 72  74 63 75 74 28 64 72 6f  |dnewshortcut(dro|
00004dd0  70 64 69 72 65 63 74 6f  72 79 24 2c 61 64 64 5f  |pdirectory$,add_|
00004de0  6e 65 77 6c 69 6e 6b 66  69 6c 65 24 2c 61 64 64  |newlinkfile$,add|
00004df0  5f 6e 65 77 6c 69 6e 6b  6c 65 61 66 24 29 0d 1d  |_newlinkleaf$)..|
00004e00  2e 31 ea 20 6c 69 6e 6b  6e 61 6d 65 24 2c 6c 65  |.1. linkname$,le|
00004e10  61 66 70 74 72 25 2c 49  67 6e 6f 72 65 4c 69 6e  |afptr%,IgnoreLin|
00004e20  6b 25 2c 49 6e 64 65 78  25 2c 43 68 61 72 25 0d  |k%,Index%,Char%.|
00004e30  1d 38 31 6c 69 6e 6b 6e  61 6d 65 24 3d 64 72 6f  |.81linkname$=dro|
00004e40  70 64 69 72 65 63 74 6f  72 79 24 2b 22 2e 22 2b  |pdirectory$+"."+|
00004e50  61 64 64 5f 6e 65 77 6c  69 6e 6b 6c 65 61 66 24  |add_newlinkleaf$|
00004e60  0d 1d 42 20 24 73 74 72  69 6e 67 25 3d 61 64 64  |..B $string%=add|
00004e70  5f 6e 65 77 6c 69 6e 6b  66 69 6c 65 24 2b bd 30  |_newlinkfile$+.0|
00004e80  0d 1d 4c 43 f4 50 52 4f  43 65 72 72 6f 72 28 22  |..LC.PROCerror("|
00004e90  43 6f 6e 74 65 6e 74 73  20 6f 66 20 22 2b 6c 69  |Contents of "+li|
00004ea0  6e 6b 6e 61 6d 65 24 2b  22 3d 22 2b 61 64 64 5f  |nkname$+"="+add_|
00004eb0  6e 65 77 6c 69 6e 6b 66  69 6c 65 24 2b 43 48 52  |newlinkfile$+CHR|
00004ec0  24 30 29 0d 1d 56 14 6c  65 61 66 70 74 72 25 3d  |$0)..V.leafptr%=|
00004ed0  73 74 72 69 6e 67 25 0d  1d 60 3c f4 20 43 68 65  |string%..`<. Che|
00004ee0  63 6b 20 66 6f 72 20 61  6e 79 20 69 6c 6c 65 67  |ck for any illeg|
00004ef0  61 6c 20 63 68 61 72 61  63 74 65 72 73 20 69 6e  |al characters in|
00004f00  20 66 69 6c 65 6e 61 6d  65 20 61 6e 64 20 69 66  | filename and if|
00004f10  20 73 6f 0d 1d 6a 28 f4  20 69 67 6e 6f 72 65 20  | so..j(. ignore |
00004f20  74 68 65 20 67 65 6e 65  72 61 74 69 6f 6e 20 6f  |the generation o|
00004f30  66 20 74 68 69 73 20 6c  69 6e 6b 0d 1d 74 11 49  |f this link..t.I|
00004f40  67 6e 6f 72 65 4c 69 6e  6b 25 3d a3 0d 1d 7e 22  |gnoreLink%=...~"|
00004f50  e3 49 6e 64 65 78 25 3d  30 b8 20 a9 28 61 64 64  |.Index%=0. .(add|
00004f60  5f 6e 65 77 6c 69 6e 6b  6c 65 61 66 24 29 0d 1d  |_newlinkleaf$)..|
00004f70  88 28 43 68 61 72 25 3d  97 28 c1 61 64 64 5f 6e  |.(Char%=.(.add_n|
00004f80  65 77 6c 69 6e 6b 6c 65  61 66 24 2c 49 6e 64 65  |ewlinkleaf$,Inde|
00004f90  78 25 2c 31 29 29 0d 1d  92 1f e7 20 43 68 61 72  |x%,1))..... Char|
00004fa0  25 3d 97 22 24 22 20 84  20 43 68 61 72 25 3d 97  |%=."$" . Char%=.|
00004fb0  22 2e 22 20 8c 0d 1d 9c  12 20 49 67 6e 6f 72 65  |"." ..... Ignore|
00004fc0  4c 69 6e 6b 25 3d b9 0d  1d a6 05 cd 0d 1d b0 05  |Link%=..........|
00004fd0  ed 0d 1d ba 15 e7 20 49  67 6e 6f 72 65 4c 69 6e  |...... IgnoreLin|
00004fe0  6b 25 3d a3 20 8c 0d 1d  c4 39 20 f4 20 43 68 65  |k%=. ....9 . Che|
00004ff0  63 6b 20 74 6f 20 73 65  65 20 69 66 20 74 68 69  |ck to see if thi|
00005000  73 20 66 69 6c 65 20 61  6c 72 65 61 64 79 20 65  |s file already e|
00005010  78 69 73 74 73 20 61 6e  64 20 69 66 20 73 6f 0d  |xists and if so.|
00005020  1d ce 1c 20 f4 20 70 72  6f 6d 70 74 20 66 6f 72  |... . prompt for|
00005030  20 6f 76 65 72 77 72 69  74 65 2e 0d 1d d8 17 20  | overwrite..... |
00005040  58 25 3d ae 28 6c 69 6e  6b 6e 61 6d 65 24 2b bd  |X%=.(linkname$+.|
00005050  30 29 0d 1d e2 19 20 c8  95 28 28 3f 6c 65 61 66  |0).... ..((?leaf|
00005060  70 74 72 25 29 20 3e 20  33 31 29 0d 1d ec 14 20  |ptr%) > 31).... |
00005070  d5 23 58 25 2c 20 3f 6c  65 61 66 70 74 72 25 0d  |.#X%, ?leafptr%.|
00005080  1d f6 10 20 6c 65 61 66  70 74 72 25 2b 3d 31 0d  |... leafptr%+=1.|
00005090  1e 00 06 20 ce 0d 1e 0a  27 20 d5 23 58 25 2c 20  |... ....' .#X%, |
000050a0  31 30 3a f4 20 4f 75 74  70 75 74 20 61 20 74 65  |10:. Output a te|
000050b0  72 6d 69 6e 61 74 69 6e  67 20 4c 46 0d 1e 14 09  |rminating LF....|
000050c0  20 d9 23 58 25 0d 1e 1e  1d 20 f4 20 53 65 74 20  | .#X%.... . Set |
000050d0  74 79 70 65 20 61 70 70  72 6f 70 72 69 61 74 65  |type appropriate|
000050e0  6c 79 0d 1e 28 26 20 ff  28 22 53 65 74 54 79 70  |ly..(& .("SetTyp|
000050f0  65 20 22 2b 6c 69 6e 6b  6e 61 6d 65 24 2b 22 20  |e "+linkname$+" |
00005100  61 66 33 22 2b bd 30 29  0d 1e 32 05 cd 0d 1e 3c  |af3"+.0)..2....<|
00005110  05 e1 0d 1e 46 04 0d 1e  50 19 dd f2 61 6c 62 61  |....F...P...alba|
00005120  5f 70 75 72 67 65 28 65  78 70 69 72 79 25 29 0d  |_purge(expiry%).|
00005130  1e 5a 18 e7 20 28 61 6c  62 61 5f 74 79 70 65 25  |.Z.. (alba_type%|
00005140  3c 30 29 20 8c 20 e1 0d  1e 64 2e e7 20 28 65 78  |<0) . ...d.. (ex|
00005150  70 69 72 79 25 3e 30 20  80 20 28 61 6c 62 61 5f  |piry%>0 . (alba_|
00005160  74 69 6d 65 25 2b 65 78  70 69 72 79 25 29 3e 91  |time%+expiry%)>.|
00005170  29 20 8c 20 e1 0d 1e 6e  17 f2 61 75 74 6f 61 64  |) . ...n..autoad|
00005180  64 6e 65 77 73 68 6f 72  74 63 75 74 0d 1e 78 05  |dnewshortcut..x.|
00005190  e1 0d 1e 82 04 0d 1e 8c  39 f4 20 2a 2a 2a 2a 2a  |........9. *****|
000051a0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000051c0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 0d 1e  |**************..|
000051d0  96 26 f4 20 57 69 6e 64  6f 77 20 61 6e 64 20 69  |.&. Window and i|
000051e0  63 6f 6e 62 61 72 20 63  6c 69 63 6b 20 68 61 6e  |conbar click han|
000051f0  64 6c 65 72 0d 1e a0 26  f4 20 53 65 65 20 62 65  |dler...&. See be|
00005200  6c 6f 77 20 66 6f 72 20  6d 65 6e 75 20 63 6c 69  |low for menu cli|
00005210  63 6b 20 68 61 6e 64 6c  65 72 0d 1e aa 38 f4 20  |ck handler...8. |
00005220  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00005250  2a 2a 0d 1e b4 11 dd f2  63 6c 69 63 6b 28 77 69  |**......click(wi|
00005260  6e 25 29 0d 1e be 0d c8  8e 20 77 69 6e 25 20 ca  |n%)...... win% .|
00005270  0d 1e c8 21 c9 20 2d 32  3a f2 63 6c 69 63 6b 5f  |...!. -2:.click_|
00005280  69 63 6f 6e 62 61 72 28  62 6c 6f 63 6b 25 21 38  |iconbar(block%!8|
00005290  29 0d 1e d2 29 c9 20 77  68 61 6e 64 6c 65 5f 69  |)...). whandle_i|
000052a0  6e 66 6f 25 3a f2 63 6c  69 63 6b 5f 69 6e 66 6f  |nfo%:.click_info|
000052b0  28 62 6c 6f 63 6b 25 21  38 29 0d 1e dc 05 cb 0d  |(block%!8)......|
000052c0  1e e6 05 e1 0d 1e f0 04  0d 1e fa 38 f4 20 2a 2a  |...........8. **|
000052d0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00005300  0d 1f 04 18 f4 20 4d 65  6e 75 20 63 6c 69 63 6b  |..... Menu click|
00005310  20 68 61 6e 64 6c 65 72  0d 1f 0e 38 f4 20 2a 2a  | handler...8. **|
00005320  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00005350  0d 1f 18 10 dd f2 6d 65  6e 75 73 65 6c 65 63 74  |......menuselect|
00005360  0d 1f 22 19 c8 8e 20 43  75 72 72 65 6e 74 4d 65  |.."... CurrentMe|
00005370  6e 75 54 79 70 65 25 20  ca 0d 1f 2c 23 c9 20 4d  |nuType% ...,#. M|
00005380  61 69 6e 4d 65 6e 75 54  79 70 65 25 3a f2 6d 61  |ainMenuType%:.ma|
00005390  69 6e 6d 65 6e 75 73 65  6c 65 63 74 0d 1f 36 2b  |inmenuselect..6+|
000053a0  c9 20 53 68 6f 72 74 43  75 74 4d 65 6e 75 54 79  |. ShortCutMenuTy|
000053b0  70 65 25 3a f2 73 68 6f  72 74 63 75 74 6d 65 6e  |pe%:.shortcutmen|
000053c0  75 73 65 6c 65 63 74 0d  1f 40 34 c9 20 57 69 6e  |uselect..@4. Win|
000053d0  64 6f 77 4c 69 73 74 4d  65 6e 75 54 79 70 65 25  |dowListMenuType%|
000053e0  3a f2 77 69 6e 64 6f 77  6d 65 6e 75 73 65 6c 65  |:.windowmenusele|
000053f0  63 74 28 21 62 6c 6f 63  6b 25 29 0d 1f 4a 05 cb  |ct(!block%)..J..|
00005400  0d 1f 54 05 e1 0d 1f 5e  04 0d 1f 68 39 f4 20 2a  |..T....^...h9. *|
00005410  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00005440  2a 2a 0d 1f 72 04 0d 1f  7c 1c dd f2 63 6c 69 63  |**..r...|...clic|
00005450  6b 5f 69 63 6f 6e 62 61  72 28 62 75 74 74 6f 6e  |k_iconbar(button|
00005460  25 29 0d 1f 86 1a 43 75  72 72 65 6e 74 42 75 74  |%)....CurrentBut|
00005470  74 6f 6e 25 3d 62 75 74  74 6f 6e 25 0d 1f 90 10  |ton%=button%....|
00005480  c8 8e 20 62 75 74 74 6f  6e 25 20 ca 0d 1f 9a 19  |.. button% .....|
00005490  c9 20 30 3a f2 6d 6f 76  65 5f 6f 76 65 72 69 63  |. 0:.move_overic|
000054a0  6f 6e 62 61 72 0d 1f a4  1c c9 20 31 3a f2 63 6c  |onbar..... 1:.cl|
000054b0  69 63 6b 5f 69 63 6f 6e  62 61 72 61 64 6a 75 73  |ick_iconbaradjus|
000054c0  74 0d 1f ae 1d c9 20 32  3a f2 63 6c 69 63 6b 5f  |t..... 2:.click_|
000054d0  69 63 6f 6e 62 61 72 67  65 6e 65 72 61 6c 0d 1f  |iconbargeneral..|
000054e0  b8 1c c9 20 34 3a f2 63  6c 69 63 6b 5f 69 63 6f  |... 4:.click_ico|
000054f0  6e 62 61 72 73 65 6c 65  63 74 0d 1f c2 05 cb 0d  |nbarselect......|
00005500  1f cc 05 e1 0d 1f d6 04  0d 1f e0 1a dd f2 63 6c  |..............cl|
00005510  69 63 6b 5f 69 63 6f 6e  62 61 72 67 65 6e 65 72  |ick_iconbargener|
00005520  61 6c 0d 1f ea 25 e7 20  54 6f 6f 6c 54 69 70 25  |al...%. ToolTip%|
00005530  3d 31 20 f2 50 65 72 73  69 73 74 43 6c 6f 73 65  |=1 .PersistClose|
00005540  54 6f 6f 6c 54 69 70 0d  1f f4 23 c8 99 22 57 69  |ToolTip...#.."Wi|
00005550  6d 70 5f 47 65 74 50 6f  69 6e 74 65 72 49 6e 66  |mp_GetPointerInf|
00005560  6f 22 2c 2c 62 6c 6f 63  6b 25 0d 1f fe 17 6f 76  |o",,block%....ov|
00005570  65 72 72 69 64 65 5f 74  6f 6f 6c 74 69 70 25 3d  |erride_tooltip%=|
00005580  31 0d 20 08 3b 49 63 6f  6e 42 61 72 4d 65 6e 75  |1. .;IconBarMenu|
00005590  4f 70 65 6e 25 3d 31 3a  f4 20 49 6e 68 69 62 69  |Open%=1:. Inhibi|
000055a0  74 20 74 6f 6f 6c 20 74  69 70 20 64 69 73 70 6c  |t tool tip displ|
000055b0  61 79 20 6f 76 65 72 20  6d 65 6e 75 0d 20 12 2a  |ay over menu. .*|
000055c0  e7 20 28 43 75 72 72 65  6e 74 42 75 74 74 6f 6e  |. (CurrentButton|
000055d0  25 3d 31 29 20 f2 73 68  6f 77 77 69 6e 64 6f 77  |%=1) .showwindow|
000055e0  6d 65 6e 75 3a e1 0d 20  1c 28 e7 20 28 43 75 72  |menu:.. .(. (Cur|
000055f0  72 65 6e 74 42 75 74 74  6f 6e 25 3d 32 29 20 f2  |rentButton%=2) .|
00005600  73 68 6f 77 6d 61 69 6e  6d 65 6e 75 3a e1 0d 20  |showmainmenu:.. |
00005610  26 30 e7 20 28 43 75 72  72 65 6e 74 42 75 74 74  |&0. (CurrentButt|
00005620  6f 6e 25 3d 34 29 20 f2  73 68 6f 77 73 68 6f 72  |on%=4) .showshor|
00005630  74 63 75 74 6d 65 6e 75  28 30 29 3a e1 20 0d 20  |tcutmenu(0):. . |
00005640  30 05 e1 0d 20 3a 04 0d  20 44 15 20 20 20 20 20  |0... :.. D.     |
00005650  20 20 20 20 20 20 20 20  20 20 20 20 0d 20 4e 19  |            . N.|
00005660  dd f2 63 6c 69 63 6b 5f  69 63 6f 6e 62 61 72 73  |..click_iconbars|
00005670  65 6c 65 63 74 0d 20 58  15 e7 20 28 a6 2d 31 29  |elect. X.. (.-1)|
00005680  20 80 20 28 a6 2d 32 29  20 8c 0d 20 62 19 20 f4  | . (.-2) .. b. .|
00005690  20 4f 70 65 6e 20 63 61  63 68 65 20 77 69 6e 64  | Open cache wind|
000056a0  6f 77 73 0d 20 6c 11 20  f2 72 65 6f 70 65 6e 66  |ows. l. .reopenf|
000056b0  69 6c 65 72 0d 20 76 06  20 e1 0d 20 80 05 cd 0d  |iler. v. .. ....|
000056c0  20 8a 0d e7 20 28 a6 2d  32 29 20 8c 0d 20 94 21  | ... (.-2) .. .!|
000056d0  20 f4 20 53 74 61 72 74  20 64 72 61 67 20 74 6f  | . Start drag to|
000056e0  20 61 64 64 20 61 20 77  69 6e 64 6f 77 0d 20 9e  | add a window. .|
000056f0  24 20 c8 99 22 57 69 6d  70 5f 47 65 74 50 6f 69  |$ .."Wimp_GetPoi|
00005700  6e 74 65 72 49 6e 66 6f  22 2c 2c 62 6c 6f 63 6b  |nterInfo",,block|
00005710  25 0d 20 a8 29 20 e7 20  28 62 6c 6f 63 6b 25 21  |%. .) . (block%!|
00005720  38 29 20 f2 69 6e 69 74  5f 64 72 61 67 28 61 64  |8) .init_drag(ad|
00005730  64 5f 77 69 6e 64 6f 77  25 29 0d 20 b2 06 20 cc  |d_window%). .. .|
00005740  0d 20 bc 11 20 f4 20 43  6c 69 63 6b 20 6d 65 6e  |. .. . Click men|
00005750  75 0d 20 c6 1a 20 f2 63  6c 69 63 6b 5f 69 63 6f  |u. .. .click_ico|
00005760  6e 62 61 72 67 65 6e 65  72 61 6c 0d 20 d0 05 cd  |nbargeneral. ...|
00005770  0d 20 da 05 e1 0d 20 e4  04 0d 20 ee 19 dd f2 63  |. .... ... ....c|
00005780  6c 69 63 6b 5f 69 63 6f  6e 62 61 72 61 64 6a 75  |lick_iconbaradju|
00005790  73 74 0d 20 f8 15 e7 20  28 a6 2d 31 29 20 80 20  |st. ... (.-1) . |
000057a0  28 a6 2d 32 29 20 8c 0d  21 02 19 f4 20 43 6c 6f  |(.-2) ..!... Clo|
000057b0  73 65 20 63 61 63 68 65  20 77 69 6e 64 6f 77 73  |se cache windows|
000057c0  0d 21 0c 1d f2 63 6c 6f  73 65 66 69 6c 65 72 3a  |.!...closefiler:|
000057d0  f2 43 6c 6f 73 65 49 6e  66 6f 42 6f 78 0d 21 16  |.CloseInfoBox.!.|
000057e0  05 e1 0d 21 20 05 cd 0d  21 2a 0d e7 20 28 a6 2d  |...! ...!*.. (.-|
000057f0  32 29 20 8c 0d 21 34 23  c8 99 22 57 69 6d 70 5f  |2) ..!4#.."Wimp_|
00005800  47 65 74 50 6f 69 6e 74  65 72 49 6e 66 6f 22 2c  |GetPointerInfo",|
00005810  2c 62 6c 6f 63 6b 25 0d  21 3e 23 f4 20 53 74 61  |,block%.!>#. Sta|
00005820  72 74 20 64 72 61 67 20  74 6f 20 72 65 6d 6f 76  |rt drag to remov|
00005830  65 20 61 20 77 69 6e 64  6f 77 0d 21 48 2d e7 20  |e a window.!H-. |
00005840  28 62 6c 6f 63 6b 25 21  38 29 20 f2 69 6e 69 74  |(block%!8) .init|
00005850  5f 64 72 61 67 28 73 75  62 74 72 61 63 74 5f 77  |_drag(subtract_w|
00005860  69 6e 64 6f 77 25 29 0d  21 52 05 cc 0d 21 5c 19  |indow%).!R...!\.|
00005870  f2 63 6c 69 63 6b 5f 69  63 6f 6e 62 61 72 67 65  |.click_iconbarge|
00005880  6e 65 72 61 6c 0d 21 66  05 cd 0d 21 70 05 e1 0d  |neral.!f...!p...|
00005890  21 7a 04 0d 21 84 38 f4  20 2a 2a 2a 2a 2a 2a 2a  |!z..!.8. *******|
000058a0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000058c0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 0d 21 8e 21 f4  |***********.!.!.|
000058d0  20 50 6f 69 6e 74 65 72  20 69 73 20 6f 76 65 72  | Pointer is over|
000058e0  20 74 68 65 20 69 63 6f  6e 62 61 72 0d 21 98 38  | the iconbar.!.8|
000058f0  f4 20 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |. **************|
00005900  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00005920  2a 2a 2a 2a 0d 21 a2 16  dd f2 6d 6f 76 65 5f 6f  |****.!....move_o|
00005930  76 65 72 69 63 6f 6e 62  61 72 0d 21 ac 2d e7 20  |vericonbar.!.-. |
00005940  49 63 6f 6e 42 61 72 4d  65 6e 75 4f 70 65 6e 25  |IconBarMenuOpen%|
00005950  3d 31 20 69 63 6f 6e 62  61 72 5f 74 69 6d 65 72  |=1 iconbar_timer|
00005960  66 6c 61 67 25 3d 30 0d  21 b6 3b f4 20 49 73 20  |flag%=0.!.;. Is |
00005970  70 6f 69 6e 74 65 72 20  6f 76 65 72 20 69 63 6f  |pointer over ico|
00005980  6e 62 61 72 20 69 63 6f  6e 3f 20 49 66 20 73 6f  |nbar icon? If so|
00005990  20 69 6e 63 20 69 63 6f  6e 62 61 72 5f 74 69 6d  | inc iconbar_tim|
000059a0  65 72 0d 21 c0 58 e7 20  28 69 63 6f 6e 62 61 72  |er.!.X. (iconbar|
000059b0  5f 74 69 6d 65 72 66 6c  61 67 25 3d 30 20 80 20  |_timerflag%=0 . |
000059c0  49 63 6f 6e 42 61 72 4d  65 6e 75 4f 70 65 6e 25  |IconBarMenuOpen%|
000059d0  3c 3e 31 29 20 69 63 6f  6e 62 61 72 5f 74 69 6d  |<>1) iconbar_tim|
000059e0  65 72 66 6c 61 67 25 3d  31 3a 69 63 6f 6e 62 61  |erflag%=1:iconba|
000059f0  72 5f 74 69 6d 65 72 25  3d 91 0d 21 ca 49 e7 20  |r_timer%=..!.I. |
00005a00  28 28 28 91 2d 69 63 6f  6e 62 61 72 5f 74 69 6d  |(((.-iconbar_tim|
00005a10  65 72 25 29 3e 32 35 29  20 80 20 69 63 6f 6e 62  |er%)>25) . iconb|
00005a20  61 72 5f 74 69 6d 65 72  66 6c 61 67 25 3d 31 20  |ar_timerflag%=1 |
00005a30  80 20 4f 6c 64 54 6f 6f  6c 54 69 70 25 3c 3e 31  |. OldToolTip%<>1|
00005a40  29 20 8c 0d 21 d4 1d 20  f4 20 57 68 61 74 20 73  |) ..!.. . What s|
00005a50  6f 72 74 20 6f 66 20 74  6f 6f 6c 20 74 69 70 3f  |ort of tool tip?|
00005a60  0d 21 de 11 20 52 53 65  65 64 25 3d b3 28 2d 91  |.!.. RSeed%=.(-.|
00005a70  29 0d 21 e8 05 20 0d 21  f2 1b 20 e7 20 28 52 61  |).!.. .!.. . (Ra|
00005a80  6e 64 6f 6d 54 6f 6f 6c  54 69 70 25 3d 31 29 20  |ndomToolTip%=1) |
00005a90  8c 0d 21 fc 12 20 20 e7  20 28 b3 28 35 29 3d 31  |..!..  . (.(5)=1|
00005aa0  29 20 8c 0d 22 06 2b 20  20 20 f2 4f 70 65 6e 54  |) ..".+   .OpenT|
00005ab0  6f 6f 6c 54 69 70 28 32  29 3a 69 63 6f 6e 62 61  |oolTip(2):iconba|
00005ac0  72 5f 74 69 6d 65 72 66  6c 61 67 25 3d 32 0d 22  |r_timerflag%=2."|
00005ad0  10 08 20 20 20 cc 0d 22  1a 2b 20 20 20 f2 4f 70  |..   ..".+   .Op|
00005ae0  65 6e 54 6f 6f 6c 54 69  70 28 31 29 3a 69 63 6f  |enToolTip(1):ico|
00005af0  6e 62 61 72 5f 74 69 6d  65 72 66 6c 61 67 25 3d  |nbar_timerflag%=|
00005b00  32 0d 22 24 07 20 20 cd  0d 22 2e 06 20 cc 0d 22  |2."$.  ..".. .."|
00005b10  38 2b 20 20 f2 4f 70 65  6e 54 6f 6f 6c 54 69 70  |8+  .OpenToolTip|
00005b20  28 31 29 3a 69 63 6f 6e  62 61 72 5f 74 69 6d 65  |(1):iconbar_time|
00005b30  72 66 6c 61 67 25 3d 32  20 0d 22 42 06 20 cd 0d  |rflag%=2 ."B. ..|
00005b40  22 4c 05 cd 0d 22 56 04  0d 22 60 37 f4 20 49 73  |"L..."V.."`7. Is|
00005b50  20 75 73 65 72 20 64 72  61 67 67 69 6e 67 20 6f  | user dragging o|
00005b60  76 65 72 20 69 63 6f 6e  20 62 61 72 20 69 63 6f  |ver icon bar ico|
00005b70  6e 20 77 69 74 68 20 61  20 62 75 74 74 6f 6e 0d  |n with a button.|
00005b80  22 6a 1c f4 20 70 72 65  73 73 65 64 20 66 6f 72  |"j.. pressed for|
00005b90  20 6f 76 65 72 20 32 20  73 20 3f 0d 22 74 12 59  | over 2 s ?."t.Y|
00005ba0  25 3d 70 74 72 62 6c 6f  63 6b 25 21 34 0d 22 7e  |%=ptrblock%!4."~|
00005bb0  4f e7 20 28 28 28 91 2d  69 63 6f 6e 62 61 72 5f  |O. (((.-iconbar_|
00005bc0  74 69 6d 65 72 25 29 3e  32 30 30 29 20 80 20 49  |timer%)>200) . I|
00005bd0  63 6f 6e 42 61 72 4d 65  6e 75 4f 70 65 6e 25 3d  |conBarMenuOpen%=|
00005be0  30 20 80 20 28 28 70 74  72 62 6c 6f 63 6b 25 21  |0 . ((ptrblock%!|
00005bf0  38 20 80 37 29 3e 30 29  20 29 20 8c 0d 22 88 26  |8 .7)>0) ) ..".&|
00005c00  20 e7 20 54 6f 6f 6c 54  69 70 25 3d 31 20 f2 50  | . ToolTip%=1 .P|
00005c10  65 72 73 69 73 74 43 6c  6f 73 65 54 6f 6f 6c 54  |ersistCloseToolT|
00005c20  69 70 0d 22 92 18 20 6f  76 65 72 72 69 64 65 5f  |ip.".. override_|
00005c30  74 6f 6f 6c 74 69 70 25  3d 31 0d 22 9c 3c 20 49  |tooltip%=1.".< I|
00005c40  63 6f 6e 42 61 72 4d 65  6e 75 4f 70 65 6e 25 3d  |conBarMenuOpen%=|
00005c50  31 3a f4 20 49 6e 68 69  62 69 74 20 74 6f 6f 6c  |1:. Inhibit tool|
00005c60  20 74 69 70 20 64 69 73  70 6c 61 79 20 6f 76 65  | tip display ove|
00005c70  72 20 6d 65 6e 75 0d 22  a6 0c 20 e7 20 a6 2d 33  |r menu.".. . .-3|
00005c80  20 8c 0d 22 b0 1a 20 20  f2 73 68 6f 77 73 68 6f  | .."..  .showsho|
00005c90  72 74 63 75 74 6d 65 6e  75 28 30 29 0d 22 ba 07  |rtcutmenu(0)."..|
00005ca0  20 20 cc 0d 22 c4 1d 20  20 f4 20 43 6c 6f 73 65  |  .."..  . Close|
00005cb0  20 61 6c 6c 20 6f 74 68  65 72 20 6d 65 6e 75 73  | all other menus|
00005cc0  0d 22 ce 20 20 20 f4 20  53 59 53 22 57 69 6d 70  |.".   . SYS"Wimp|
00005cd0  5f 43 72 65 61 74 65 4d  65 6e 75 22 2c 2c 2d 31  |_CreateMenu",,-1|
00005ce0  0d 22 d8 15 20 20 f2 73  68 6f 77 77 69 6e 64 6f  |."..  .showwindo|
00005cf0  77 6d 65 6e 75 0d 22 e2  06 20 cd 0d 22 ec 05 cd  |wmenu.".. .."...|
00005d00  0d 22 f6 04 0d 23 00 2d  f4 20 48 61 73 20 74 6f  |."...#.-. Has to|
00005d10  6f 6c 20 74 69 70 20 62  65 65 6e 20 6f 70 65 6e  |ol tip been open|
00005d20  20 66 6f 72 20 6c 6f 6e  67 20 65 6e 6f 75 67 68  | for long enough|
00005d30  3f 0d 23 0a 58 e7 20 28  28 28 91 2d 69 63 6f 6e  |?.#.X. (((.-icon|
00005d40  62 61 72 5f 74 69 6d 65  72 25 29 3e 31 30 30 30  |bar_timer%)>1000|
00005d50  29 20 80 20 54 6f 6f 6c  54 69 70 25 3e 30 29 20  |) . ToolTip%>0) |
00005d60  f2 50 65 72 73 69 73 74  43 6c 6f 73 65 54 6f 6f  |.PersistCloseToo|
00005d70  6c 54 69 70 3a 69 63 6f  6e 62 61 72 5f 74 69 6d  |lTip:iconbar_tim|
00005d80  65 72 66 6c 61 67 25 3d  30 0d 23 14 05 e1 0d 23  |erflag%=0.#....#|
00005d90  1e 04 0d 23 28 04 0d 23  32 38 f4 20 2a 2a 2a 2a  |...#(..#28. ****|
00005da0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00005dc0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 0d 23  |**************.#|
00005dd0  3c 04 0d 23 46 19 dd a4  43 68 65 63 6b 4c 69 6e  |<..#F...CheckLin|
00005de0  6b 73 44 69 72 45 78 69  73 74 73 0d 23 50 12 ea  |ksDirExists.#P..|
00005df0  20 64 69 72 24 2c 72 65  73 75 6c 74 25 0d 23 5a  | dir$,result%.#Z|
00005e00  2a 64 69 72 24 3d 41 70  70 50 61 74 68 24 2b 22  |*dir$=AppPath$+"|
00005e10  2e 55 73 65 72 73 2e 22  2b 55 73 65 72 24 2b 22  |.Users."+User$+"|
00005e20  2e 4c 69 6e 6b 73 22 0d  23 64 25 f4 20 44 6f 65  |.Links".#d%. Doe|
00005e30  73 20 74 68 65 20 4c 69  6e 6b 73 20 64 69 72 65  |s the Links dire|
00005e40  63 74 6f 72 79 20 65 78  69 73 74 3f 0d 23 6e 14  |ctory exist?.#n.|
00005e50  24 73 74 72 69 6e 67 25  3d 64 69 72 24 2b bd 30  |$string%=dir$+.0|
00005e60  0d 23 78 24 c8 99 22 4f  53 5f 46 69 6c 65 22 2c  |.#x$.."OS_File",|
00005e70  31 37 2c 73 74 72 69 6e  67 25 20 b8 20 72 65 73  |17,string% . res|
00005e80  75 6c 74 25 0d 23 82 19  f4 20 49 66 20 6e 6f 74  |ult%.#... If not|
00005e90  2c 20 63 72 65 61 74 65  20 6f 6e 65 2e 0d 23 8c  |, create one..#.|
00005ea0  26 e7 20 28 72 65 73 75  6c 74 25 3d 30 29 20 8c  |&. (result%=0) .|
00005eb0  20 ff 28 22 43 44 49 52  20 22 2b 64 69 72 24 2b  | .("CDIR "+dir$+|
00005ec0  bd 30 29 0d 23 96 24 c8  99 22 4f 53 5f 46 69 6c  |.0).#.$.."OS_Fil|
00005ed0  65 22 2c 31 37 2c 73 74  72 69 6e 67 25 20 b8 20  |e",17,string% . |
00005ee0  72 65 73 75 6c 74 25 0d  23 a0 27 f4 20 48 61 73  |result%.#.'. Has|
00005ef0  20 69 74 20 63 72 65 61  74 65 64 20 69 74 3f 20  | it created it? |
00005f00  49 66 20 6e 6f 74 2c 20  65 72 72 6f 72 2e 0d 23  |If not, error..#|
00005f10  aa 13 e7 20 28 72 65 73  75 6c 74 25 3d 30 29 20  |... (result%=0) |
00005f20  8c 0d 23 b4 2e f2 65 72  72 6f 72 28 22 46 61 74  |..#...error("Fat|
00005f30  61 6c 20 3a 20 43 6f 75  6c 64 6e 27 74 20 63 72  |al : Couldn't cr|
00005f40  65 61 74 65 20 22 2b 64  69 72 24 2b bd 30 29 0d  |eate "+dir$+.0).|
00005f50  23 be 06 3d 30 0d 23 c8  05 cd 0d 23 d2 06 3d 31  |#..=0.#....#..=1|
00005f60  0d 23 dc 04 0d 23 e6 38  f4 20 2a 2a 2a 2a 2a 2a  |.#...#.8. ******|
00005f70  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00005f90  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 0d 23 f0 04  |************.#..|
00005fa0  0d 23 fa 12 dd f2 73 68  6f 77 6d 61 69 6e 6d 65  |.#....showmainme|
00005fb0  6e 75 0d 24 04 24 43 75  72 72 65 6e 74 4d 65 6e  |nu.$.$CurrentMen|
00005fc0  75 54 79 70 65 25 20 3d  20 4d 61 69 6e 4d 65 6e  |uType% = MainMen|
00005fd0  75 54 79 70 65 25 0d 24  0e 32 f2 73 68 6f 77 6d  |uType%.$.2.showm|
00005fe0  65 6e 75 28 6d 61 69 6e  5f 6d 65 6e 75 25 2c 21  |enu(main_menu%,!|
00005ff0  62 6c 6f 63 6b 25 2d 36  34 2c 20 39 36 2b 28 38  |block%-64, 96+(8|
00006000  2a 34 34 29 2b 32 34 29  0d 24 18 05 e1 0d 24 22  |*44)+24).$....$"|
00006010  04 0d 24 2c 38 f4 20 2a  2a 2a 2a 2a 2a 2a 2a 2a  |..$,8. *********|
00006020  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00006040  2a 2a 2a 2a 2a 2a 2a 2a  2a 0d 24 36 30 f4 20 42  |*********.$60. B|
00006050  75 69 6c 64 20 6c 69 73  74 20 6f 66 20 63 75 72  |uild list of cur|
00006060  72 65 6e 74 6c 79 20 76  61 6c 69 64 20 6f 70 65  |rently valid ope|
00006070  6e 20 77 69 6e 64 6f 77  73 0d 24 40 38 f4 20 2a  |n windows.$@8. *|
00006080  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000060b0  2a 0d 24 4a 15 dd f2 42  75 69 6c 64 57 69 6e 64  |*.$J...BuildWind|
000060c0  6f 77 4c 69 73 74 0d 24  54 12 ea 20 71 25 2c 4f  |owList.$T.. q%,O|
000060d0  6c 64 41 66 74 65 72 25  0d 24 5e 18 ea 20 73 78  |ldAfter%.$^.. sx|
000060e0  25 2c 20 73 79 25 2c 20  6f 78 25 2c 20 6f 79 25  |%, sy%, ox%, oy%|
000060f0  0d 24 68 29 ea 20 52 65  6f 70 65 6e 46 6c 61 67  |.$h). ReopenFlag|
00006100  25 2c 20 53 74 61 63 6b  46 6c 61 67 25 2c 20 56  |%, StackFlag%, V|
00006110  61 6c 69 64 46 6c 61 67  25 0d 24 72 2d ea 20 50  |alidFlag%.$r-. P|
00006120  61 6e 65 46 6c 61 67 25  2c 20 49 73 4f 70 65 6e  |aneFlag%, IsOpen|
00006130  46 6c 61 67 25 2c 20 49  73 4d 6f 76 65 61 62 6c  |Flag%, IsMoveabl|
00006140  65 46 6c 61 67 25 0d 24  7c 1e ea 20 43 75 72 72  |eFlag%.$|.. Curr|
00006150  65 6e 74 57 69 6e 25 2c  43 75 72 72 65 6e 74 49  |entWin%,CurrentI|
00006160  63 6f 6e 25 0d 24 86 25  ea 20 57 69 6e 64 6f 77  |con%.$.%. Window|
00006170  4e 61 6d 65 24 2c 20 45  72 72 6f 72 46 6c 61 67  |Name$, ErrorFlag|
00006180  25 2c 57 69 6e 64 65 78  25 0d 24 90 04 0d 24 9a  |%,Windex%.$...$.|
00006190  10 71 25 3d 77 69 6e 62  6c 6f 63 6b 25 0d 24 a4  |.q%=winblock%.$.|
000061a0  0f 50 61 6e 65 46 6c 61  67 25 3d a3 0d 24 ae 12  |.PaneFlag%=..$..|
000061b0  57 69 6e 64 6f 77 4e 61  6d 65 24 3d 22 22 0d 24  |WindowName$="".$|
000061c0  b8 04 0d 24 c2 2a f4 20  53 74 61 72 74 20 66 72  |...$.*. Start fr|
000061d0  6f 6d 20 62 6f 74 74 6f  6d 20 6f 66 20 77 69 6e  |om bottom of win|
000061e0  64 6f 77 20 73 74 61 63  6b 20 62 79 0d 24 cc 30  |dow stack by.$.0|
000061f0  f4 20 6f 70 65 6e 69 6e  67 20 74 68 65 20 64 75  |. opening the du|
00006200  6d 6d 79 20 77 69 6e 64  6f 77 20 61 74 20 74 68  |mmy window at th|
00006210  65 20 62 6f 74 74 6f 6d  20 2e 2e 2e 0d 24 d6 16  |e bottom ....$..|
00006220  f2 52 65 6f 70 65 6e 44  75 6d 6d 79 57 69 6e 64  |.ReopenDummyWind|
00006230  6f 77 0d 24 e0 05 20 0d  24 ea 32 f4 20 47 65 74  |ow.$.. .$.2. Get|
00006240  20 43 75 72 72 65 6e 74  20 77 69 6e 64 6f 77 20  | Current window |
00006250  69 6d 6d 65 64 69 61 74  65 6c 79 20 75 6e 64 65  |immediately unde|
00006260  72 20 70 6f 69 6e 74 65  72 0d 24 f4 24 c8 99 22  |r pointer.$.$.."|
00006270  57 69 6d 70 5f 47 65 74  50 6f 69 6e 74 65 72 49  |Wimp_GetPointerI|
00006280  6e 66 6f 22 2c 2c 62 6c  6f 63 6b 32 25 0d 24 fe  |nfo",,block2%.$.|
00006290  1d 43 75 72 72 65 6e 74  57 69 6e 50 74 72 25 3d  |.CurrentWinPtr%=|
000062a0  62 6c 6f 63 6b 32 25 21  31 32 0d 25 08 1b 43 75  |block2%!12.%..Cu|
000062b0  72 72 65 6e 74 49 63 6f  6e 25 3d 62 6c 6f 63 6b  |rrentIcon%=block|
000062c0  32 25 21 31 36 0d 25 12  04 0d 25 1c 1d 61 66 74  |2%!16.%...%..aft|
000062d0  65 72 25 3d 77 68 61 6e  64 6c 65 5f 64 75 6d 6d  |er%=whandle_dumm|
000062e0  79 62 61 63 6b 25 0d 25  26 04 0d 25 30 20 f4 20  |yback%.%&..%0 . |
000062f0  47 6f 20 74 68 72 6f 75  67 68 20 61 6c 6c 20 77  |Go through all w|
00006300  69 6e 64 6f 77 73 20 2e  2e 2e 0d 25 3a 05 f5 0d  |indows ....%:...|
00006310  25 44 14 4f 6c 64 41 66  74 65 72 25 3d 61 66 74  |%D.OldAfter%=aft|
00006320  65 72 25 0d 25 4e 0e 21  71 25 3d 61 66 74 65 72  |er%.%N.!q%=after|
00006330  25 0d 25 58 2e f4 20 5f  54 72 79 5f 20 61 6e 64  |%.%X.. _Try_ and|
00006340  20 72 65 6f 70 65 6e 20  74 68 69 73 20 64 65 73  | reopen this des|
00006350  6b 74 6f 70 20 77 69 6e  64 6f 77 20 2e 2e 2e 0d  |ktop window ....|
00006360  25 62 2f c8 99 20 22 58  57 69 6d 70 5f 47 65 74  |%b/.. "XWimp_Get|
00006370  57 69 6e 64 6f 77 53 74  61 74 65 22 2c 2c 71 25  |WindowState",,q%|
00006380  20 b8 20 3b 45 72 72 6f  72 46 6c 61 67 25 0d 25  | . ;ErrorFlag%.%|
00006390  6c 13 43 75 72 72 65 6e  74 57 69 6e 25 3d 21 71  |l.CurrentWin%=!q|
000063a0  25 0d 25 76 26 e7 20 28  61 66 74 65 72 25 3d 2d  |%.%v&. (after%=-|
000063b0  31 20 84 20 28 45 72 72  6f 72 46 6c 61 67 25 80  |1 . (ErrorFlag%.|
000063c0  31 29 3d 31 29 20 e1 0d  25 80 0d 57 69 6e 64 65  |1)=1) ..%..Winde|
000063d0  78 25 3d 30 0d 25 8a 05  f5 0d 25 94 39 e7 20 28  |x%=0.%....%.9. (|
000063e0  43 75 72 72 65 6e 74 57  69 6e 25 3d 57 69 6e 64  |CurrentWin%=Wind|
000063f0  6f 77 4c 69 73 74 48 61  6e 64 6c 65 25 28 57 69  |owListHandle%(Wi|
00006400  6e 64 65 78 25 29 29 20  57 69 6e 64 65 78 25 3d  |ndex%)) Windex%=|
00006410  2d 32 0d 25 9e 0e 57 69  6e 64 65 78 25 2b 3d 31  |-2.%..Windex%+=1|
00006420  0d 25 a8 2a fd 20 57 69  6e 64 65 78 25 3e 3d 57  |.%.*. Windex%>=W|
00006430  69 6e 64 6f 77 4c 69 73  74 53 69 7a 65 25 20 84  |indowListSize% .|
00006440  20 57 69 6e 64 65 78 25  3c 30 0d 25 b2 10 61 66  | Windex%<0.%..af|
00006450  74 65 72 25 3d 71 25 21  32 38 0d 25 bc 05 20 0d  |ter%=q%!28.%.. .|
00006460  25 c6 10 20 50 61 6e 65  46 6c 61 67 25 3d a3 0d  |%.. PaneFlag%=..|
00006470  25 d0 32 20 e7 20 28 28  28 71 25 21 33 32 29 20  |%.2 . (((q%!32) |
00006480  80 20 28 28 32 5e 32 32  29 2b 28 32 5e 32 33 29  |. ((2^22)+(2^23)|
00006490  29 29 3e 30 29 20 50 61  6e 65 46 6c 61 67 25 3d  |))>0) PaneFlag%=|
000064a0  b9 0d 25 da 26 20 e7 20  28 28 28 71 25 21 33 32  |..%.& . (((q%!32|
000064b0  29 20 80 20 33 32 29 3d  33 32 29 20 50 61 6e 65  |) . 32)=32) Pane|
000064c0  46 6c 61 67 25 3d b9 0d  25 e4 25 20 49 73 4f 70  |Flag%=..%.% IsOp|
000064d0  65 6e 46 6c 61 67 25 20  3d 20 28 28 71 25 21 33  |enFlag% = ((q%!3|
000064e0  32 29 20 80 20 28 32 5e  31 36 29 29 0d 25 ee 24  |2) . (2^16)).%.$|
000064f0  20 49 73 4d 6f 76 65 61  62 6c 65 46 6c 61 67 25  | IsMoveableFlag%|
00006500  20 3d 20 28 28 71 25 21  33 32 29 20 80 20 32 29  | = ((q%!32) . 2)|
00006510  0d 25 f8 04 0d 26 02 12  20 52 65 6f 70 65 6e 46  |.%...&.. ReopenF|
00006520  6c 61 67 25 3d b9 0d 26  0c 11 20 53 74 61 63 6b  |lag%=..&.. Stack|
00006530  46 6c 61 67 25 3d b9 0d  26 16 11 20 56 61 6c 69  |Flag%=..&.. Vali|
00006540  64 46 6c 61 67 25 3d b9  0d 26 20 05 20 0d 26 2a  |dFlag%=..& . .&*|
00006550  3c 20 f4 20 49 66 20 74  68 69 73 20 77 69 6e 64  |< . If this wind|
00006560  6f 77 20 69 73 20 6e 6f  74 20 61 74 20 61 6c 6c  |ow is not at all|
00006570  20 6f 6e 20 73 63 72 65  65 6e 20 74 68 65 6e 20  | on screen then |
00006580  69 67 6e 6f 72 65 20 69  74 0d 26 34 21 20 f4 20  |ignore it.&4! . |
00006590  4f 53 5f 4d 3f 20 3d 20  3f 58 7c 59 20 53 63 72  |OS_M? = ?X|Y Scr|
000065a0  65 65 6e 4f 53 3f 53 69  7a 65 0d 26 3e 17 20 6f  |eenOS?Size.&>. o|
000065b0  78 25 3d 71 25 21 34 3a  74 74 6f 78 25 3d 6f 78  |x%=q%!4:ttox%=ox|
000065c0  25 0d 26 48 18 20 6f 79  25 3d 71 25 21 31 36 3a  |%.&H. oy%=q%!16:|
000065d0  74 74 6f 79 25 3d 6f 79  25 0d 26 52 21 20 73 78  |ttoy%=oy%.&R! sx|
000065e0  25 3d 28 71 25 21 31 32  29 2d 28 71 25 21 34 29  |%=(q%!12)-(q%!4)|
000065f0  3a 74 74 73 78 25 3d 73  78 25 0d 26 5c 21 20 73  |:ttsx%=sx%.&\! s|
00006600  79 25 3d 28 71 25 21 31  36 29 2d 28 71 25 21 38  |y%=(q%!16)-(q%!8|
00006610  29 3a 74 74 73 79 25 3d  73 79 25 0d 26 66 50 e7  |):ttsy%=sy%.&fP.|
00006620  20 28 6f 78 25 3e 4f 53  5f 4d 58 25 29 20 84 20  | (ox%>OS_MX%) . |
00006630  28 6f 79 25 3e 4f 53 5f  4d 59 25 29 20 84 20 28  |(oy%>OS_MY%) . (|
00006640  28 6f 78 25 2b 73 78 25  29 3c 30 29 20 84 20 28  |(ox%+sx%)<0) . (|
00006650  28 6f 79 25 2b 73 79 25  29 3c 30 29 20 8c 20 56  |(oy%+sy%)<0) . V|
00006660  61 6c 69 64 46 6c 61 67  25 3d a3 0d 26 70 04 0d  |alidFlag%=..&p..|
00006670  26 7a 04 0d 26 84 2e f4  20 49 73 20 74 68 69 73  |&z..&... Is this|
00006680  20 74 68 65 20 63 75 72  72 65 6e 74 6c 79 20 6f  | the currently o|
00006690  70 65 6e 20 6d 65 6e 75  20 77 69 6e 64 6f 77 3f  |pen menu window?|
000066a0  20 0d 26 8e 33 e7 20 28  43 75 72 72 65 6e 74 57  | .&.3. (CurrentW|
000066b0  69 6e 25 3d 63 75 72 72  65 6e 74 6d 65 6e 75 68  |in%=currentmenuh|
000066c0  61 6e 64 6c 65 25 29 20  56 61 6c 69 64 46 6c 61  |andle%) ValidFla|
000066d0  67 25 3d a3 0d 26 98 04  0d 26 a2 1b f4 20 49 73  |g%=..&...&... Is|
000066e0  20 74 68 69 73 20 74 68  65 20 69 63 6f 6e 20 62  | this the icon b|
000066f0  61 72 3f 0d 26 ac 2a f4  20 49 46 20 28 43 75 72  |ar?.&.*. IF (Cur|
00006700  72 65 6e 74 57 69 6e 25  3d 2d 32 29 20 56 61 6c  |rentWin%=-2) Val|
00006710  69 64 46 6c 61 67 25 3d  46 41 4c 53 45 0d 26 b6  |idFlag%=FALSE.&.|
00006720  04 0d 26 c0 70 f4 20 55  6e 64 65 72 20 70 6f 69  |..&.p. Under poi|
00006730  6e 74 65 72 20 61 6e 64  20 5f 6e 6f 5f 20 68 6f  |nter and _no_ ho|
00006740  72 69 7a 2f 76 65 72 74  20 73 63 72 6f 6c 6c 20  |riz/vert scroll |
00006750  62 61 72 73 20 61 6e 64  20 66 75 6c 6c 79 20 76  |bars and fully v|
00006760  69 73 69 62 6c 65 20 28  6c 69 6b 65 6c 79 20 74  |isible (likely t|
00006770  6f 20 62 65 20 70 61 72  74 20 6f 66 20 6d 65 6e  |o be part of men|
00006780  75 20 73 6f 20 6c 65 61  76 65 20 61 6c 6f 6e 65  |u so leave alone|
00006790  29 0d 26 ca 80 e7 20 28  43 75 72 72 65 6e 74 57  |).&... (CurrentW|
000067a0  69 6e 25 3d 43 75 72 72  65 6e 74 57 69 6e 50 74  |in%=CurrentWinPt|
000067b0  72 25 20 80 20 28 28 71  25 21 33 32 29 20 80 20  |r% . ((q%!32) . |
000067c0  28 32 5e 32 38 29 29 3d  30 20 80 20 28 28 71 25  |(2^28))=0 . ((q%|
000067d0  21 33 32 29 20 80 20 28  32 5e 33 30 29 29 3d 30  |!32) . (2^30))=0|
000067e0  20 80 20 28 28 71 25 21  33 32 29 20 80 20 28 32  | . ((q%!32) . (2|
000067f0  5e 31 37 29 29 3e 30 20  80 20 61 66 74 65 72 25  |^17))>0 . after%|
00006800  3d 2d 31 29 20 56 61 6c  69 64 46 6c 61 67 25 3d  |=-1) ValidFlag%=|
00006810  a3 0d 26 d4 04 0d 26 de  32 20 e7 20 28 43 75 72  |..&...&.2 . (Cur|
00006820  72 65 6e 74 57 69 6e 25  3d 77 68 61 6e 64 6c 65  |rentWin%=whandle|
00006830  5f 74 6f 6f 6c 74 69 70  25 29 20 56 61 6c 69 64  |_tooltip%) Valid|
00006840  46 6c 61 67 25 3d a3 0d  26 e8 21 20 e7 20 28 50  |Flag%=..&.! . (P|
00006850  61 6e 65 46 6c 61 67 25  3d b9 29 20 56 61 6c 69  |aneFlag%=.) Vali|
00006860  64 46 6c 61 67 25 3d a3  0d 26 f2 05 20 0d 26 fc  |dFlag%=..&.. .&.|
00006870  17 20 e7 20 28 56 61 6c  69 64 46 6c 61 67 25 3d  |. . (ValidFlag%=|
00006880  b9 29 20 8c 0d 27 06 04  0d 27 10 2e 20 20 e7 20  |.) ..'...'..  . |
00006890  28 57 69 6e 64 6f 77 4c  69 73 74 53 69 7a 65 25  |(WindowListSize%|
000068a0  3c 4d 61 78 57 69 6e 64  6f 77 4c 69 73 74 53 69  |<MaxWindowListSi|
000068b0  7a 65 25 29 20 8c 0d 27  1a 35 20 20 20 57 69 6e  |ze%) ..'.5   Win|
000068c0  64 6f 77 4c 69 73 74 48  61 6e 64 6c 65 25 28 57  |dowListHandle%(W|
000068d0  69 6e 64 6f 77 4c 69 73  74 53 69 7a 65 25 29 3d  |indowListSize%)=|
000068e0  43 75 72 72 65 6e 74 57  69 6e 25 0d 27 24 19 20  |CurrentWin%.'$. |
000068f0  20 20 57 69 6e 64 6f 77  4c 69 73 74 53 69 7a 65  |  WindowListSize|
00006900  25 2b 3d 31 0d 27 2e 07  20 20 cd 0d 27 38 21 20  |%+=1.'..  ..'8! |
00006910  cd 3a f4 20 45 6e 64 20  6f 66 20 49 46 20 56 61  |.:. End of IF Va|
00006920  6c 69 64 46 6c 61 67 25  20 2e 2e 2e 0d 27 42 05  |lidFlag% ....'B.|
00006930  20 0d 27 4c 14 fd 20 43  75 72 72 65 6e 74 57 69  | .'L.. CurrentWi|
00006940  6e 25 3d 2d 31 0d 27 56  05 e1 0d 27 60 04 0d 27  |n%=-1.'V...'`..'|
00006950  6a 04 0d 27 74 38 f4 20  2a 2a 2a 2a 2a 2a 2a 2a  |j..'t8. ********|
00006960  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00006980  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 0d 27 7e 1f f4 20  |**********.'~.. |
00006990  4f 70 65 6e 20 74 68 65  20 57 69 6e 64 6f 77 20  |Open the Window |
000069a0  4c 69 73 74 20 6d 65 6e  75 0d 27 88 38 f4 20 2a  |List menu.'.8. *|
000069b0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000069e0  2a 0d 27 92 14 dd f2 73  68 6f 77 77 69 6e 64 6f  |*.'....showwindo|
000069f0  77 6d 65 6e 75 0d 27 9c  33 ea 20 54 69 74 6c 65  |wmenu.'.3. Title|
00006a00  42 61 72 46 6c 61 67 25  2c 20 43 75 72 72 65 6e  |BarFlag%, Curren|
00006a10  74 57 69 6e 25 2c 20 53  6f 75 72 63 65 54 61 73  |tWin%, SourceTas|
00006a20  6b 48 61 6e 64 6c 65 25  0d 27 a6 3d ea 20 54 69  |kHandle%.'.=. Ti|
00006a30  74 6c 65 42 61 72 50 74  72 25 2c 20 54 69 74 6c  |tleBarPtr%, Titl|
00006a40  65 42 61 72 4c 65 6e 67  74 68 25 2c 20 45 72 72  |eBarLength%, Err|
00006a50  6f 72 46 6c 61 67 25 2c  20 53 75 63 63 65 73 73  |orFlag%, Success|
00006a60  46 6c 61 67 25 0d 27 b0  34 ea 20 49 6e 64 65 78  |Flag%.'.4. Index|
00006a70  25 2c 57 69 6e 64 6f 77  4e 61 6d 65 24 2c 4b 6c  |%,WindowName$,Kl|
00006a80  75 64 67 65 4c 65 6e 67  74 68 25 2c 49 73 49 6e  |udgeLength%,IsIn|
00006a90  64 69 72 65 63 74 65 64  25 0d 27 ba 04 0d 27 c4  |directed%.'...'.|
00006aa0  35 ea 20 63 75 72 72 65  6e 74 6d 65 6e 75 70 74  |5. currentmenupt|
00006ab0  72 25 2c 20 6c 6f 63 61  6c 69 25 2c 20 77 69 64  |r%, locali%, wid|
00006ac0  74 68 25 2c 20 74 69 74  6c 65 24 2c 20 69 74 65  |th%, title$, ite|
00006ad0  6d 24 0d 27 ce 10 ea 20  57 69 6e 64 6f 77 4e 75  |m$.'... WindowNu|
00006ae0  6d 25 0d 27 d8 08 ea 20  61 25 0d 27 e2 04 0d 27  |m%.'... a%.'...'|
00006af0  ec 27 e7 20 28 54 6f 6f  6c 54 69 70 25 3d 31 29  |.'. (ToolTip%=1)|
00006b00  20 f2 50 65 72 73 69 73  74 43 6c 6f 73 65 54 6f  | .PersistCloseTo|
00006b10  6f 6c 54 69 70 0d 27 f6  14 c8 99 22 48 6f 75 72  |olTip.'...."Hour|
00006b20  67 6c 61 73 73 5f 4f 6e  22 0d 28 00 23 f4 20 42  |glass_On".(.#. B|
00006b30  75 69 6c 64 20 4c 69 73  74 20 6f 66 20 63 75 72  |uild List of cur|
00006b40  72 65 6e 74 20 77 69 6e  64 6f 77 73 0d 28 0a 14  |rent windows.(..|
00006b50  f2 42 75 69 6c 64 57 69  6e 64 6f 77 4c 69 73 74  |.BuildWindowList|
00006b60  0d 28 14 04 0d 28 1e 10  f4 20 42 75 69 6c 64 20  |.(...(... Build |
00006b70  6d 65 6e 75 0d 28 28 24  69 6e 69 74 69 61 6c 6d  |menu.(($initialm|
00006b80  65 6e 75 73 69 7a 65 25  3d 57 69 6e 64 6f 77 4c  |enusize%=WindowL|
00006b90  69 73 74 53 69 7a 65 25  0d 28 32 23 63 75 72 72  |istSize%.(2#curr|
00006ba0  65 6e 74 6d 65 6e 75 70  74 72 25 20 3d 20 73 68  |entmenuptr% = sh|
00006bb0  6f 72 74 63 75 74 6d 65  6e 75 25 0d 28 3c 14 74  |ortcutmenu%.(<.t|
00006bc0  69 74 6c 65 24 3d 22 57  69 6e 64 6f 77 73 22 0d  |itle$="Windows".|
00006bd0  28 46 1d 54 69 74 6c 65  50 74 72 25 3d 63 75 72  |(F.TitlePtr%=cur|
00006be0  72 65 6e 74 6d 65 6e 75  70 74 72 25 0d 28 50 15  |rentmenuptr%.(P.|
00006bf0  24 54 69 74 6c 65 50 74  72 25 3d 74 69 74 6c 65  |$TitlePtr%=title|
00006c00  24 0d 28 5a 1b 77 69 64  74 68 25 3d 28 a9 28 74  |$.(Z.width%=(.(t|
00006c10  69 74 6c 65 24 29 2d 32  29 2a 31 36 0d 28 64 22  |itle$)-2)*16.(d"|
00006c20  63 75 72 72 65 6e 74 6d  65 6e 75 70 74 72 25 21  |currentmenuptr%!|
00006c30  31 32 20 3d 20 26 30 30  30 37 30 32 30 37 0d 28  |12 = &00070207.(|
00006c40  6e 19 63 75 72 72 65 6e  74 6d 65 6e 75 70 74 72  |n.currentmenuptr|
00006c50  25 21 32 30 3d 34 34 0d  28 78 18 63 75 72 72 65  |%!20=44.(x.curre|
00006c60  6e 74 6d 65 6e 75 70 74  72 25 21 32 34 3d 30 0d  |ntmenuptr%!24=0.|
00006c70  28 82 1b 70 74 72 25 3d  63 75 72 72 65 6e 74 6d  |(..ptr%=currentm|
00006c80  65 6e 75 70 74 72 25 2b  32 38 0d 28 8c 04 0d 28  |enuptr%+28.(...(|
00006c90  96 1c e7 20 28 69 6e 69  74 69 61 6c 6d 65 6e 75  |... (initialmenu|
00006ca0  73 69 7a 65 25 3e 30 29  20 8c 0d 28 a0 0e 20 6c  |size%>0) ..(.. l|
00006cb0  6f 63 61 6c 69 25 3d 30  0d 28 aa 2c 20 e3 57 69  |ocali%=0.(., .Wi|
00006cc0  6e 64 6f 77 4e 75 6d 25  3d 28 57 69 6e 64 6f 77  |ndowNum%=(Window|
00006cd0  4c 69 73 74 53 69 7a 65  25 2d 31 29 20 b8 20 30  |ListSize%-1) . 0|
00006ce0  20 88 2d 31 0d 28 b4 1e  20 20 f4 20 49 6e 69 74  | .-1.(..  . Init|
00006cf0  69 61 6c 69 73 65 20 6d  65 6e 75 20 6f 62 6a 65  |ialise menu obje|
00006d00  63 74 0d 28 be 11 20 20  49 73 44 69 72 65 63 74  |ct.(..  IsDirect|
00006d10  25 3d 30 0d 28 c8 31 20  20 21 70 74 72 25 3d 38  |%=0.(.1  !ptr%=8|
00006d20  3a f4 20 6d 66 6c 61 67  73 20 3d 20 26 38 30 20  |:. mflags = &80 |
00006d30  6d 65 61 6e 73 20 6c 61  73 74 20 6d 65 6e 75 20  |means last menu |
00006d40  69 74 65 6d 0d 28 d2 25  20 20 70 74 72 25 21 34  |item.(.%  ptr%!4|
00006d50  3d 2d 31 3a f4 20 70 6f  69 6e 74 65 72 20 74 6f  |=-1:. pointer to|
00006d60  20 73 75 62 20 6d 65 6e  75 0d 28 dc 25 20 20 70  | sub menu.(.%  p|
00006d70  74 72 25 21 38 3d 26 37  30 30 30 33 31 33 2d 35  |tr%!8=&7000313-5|
00006d80  31 32 3a f4 20 69 63 6f  6e 20 74 79 70 65 0d 28  |12:. icon type.(|
00006d90  e6 31 20 20 43 75 72 72  65 6e 74 57 69 6e 25 20  |.1  CurrentWin% |
00006da0  3d 20 57 69 6e 64 6f 77  4c 69 73 74 48 61 6e 64  |= WindowListHand|
00006db0  6c 65 25 28 57 69 6e 64  6f 77 4e 75 6d 25 29 0d  |le%(WindowNum%).|
00006dc0  28 f0 17 20 20 f4 20 47  65 74 20 54 61 73 6b 20  |(..  . Get Task |
00006dd0  48 61 6e 64 6c 65 0d 28  fa 10 20 20 21 62 6c 6f  |Handle.(..  !blo|
00006de0  63 6b 32 25 3d 30 0d 29  04 53 20 20 c8 99 22 58  |ck2%=0.).S  .."X|
00006df0  57 69 6d 70 5f 53 65 6e  64 4d 65 73 73 61 67 65  |Wimp_SendMessage|
00006e00  22 2c 30 2c 62 6c 6f 63  6b 32 25 2c 43 75 72 72  |",0,block2%,Curr|
00006e10  65 6e 74 57 69 6e 25 20  b8 20 2c 2c 53 6f 75 72  |entWin% . ,,Sour|
00006e20  63 65 54 61 73 6b 48 61  6e 64 6c 65 25 20 3b 45  |ceTaskHandle% ;E|
00006e30  72 72 6f 72 46 6c 61 67  25 0d 29 0e 2e 20 20 f4  |rrorFlag%.)..  .|
00006e40  20 49 73 20 74 68 69 73  20 77 69 6e 64 6f 77 20  | Is this window |
00006e50  64 65 66 69 6e 69 74 69  6f 6e 20 61 20 76 61 6c  |definition a val|
00006e60  69 64 20 6f 6e 65 3f 0d  29 18 26 20 20 53 6f 75  |id one?.).&  Sou|
00006e70  72 63 65 54 61 73 6b 4e  61 6d 65 25 20 3d 20 75  |rceTaskName% = u|
00006e80  6e 6b 6e 6f 77 6e 73 74  72 69 6e 67 25 0d 29 22  |nknownstring%.)"|
00006e90  1c 20 20 e7 20 28 28 45  72 72 6f 72 46 6c 61 67  |.  . ((ErrorFlag|
00006ea0  25 80 31 29 3d 30 29 20  8c 0d 29 2c 5a 20 20 20  |%.1)=0) ..),Z   |
00006eb0  c8 99 22 58 54 61 73 6b  4d 61 6e 61 67 65 72 5f  |.."XTaskManager_|
00006ec0  54 61 73 6b 4e 61 6d 65  46 72 6f 6d 48 61 6e 64  |TaskNameFromHand|
00006ed0  6c 65 22 2c 53 6f 75 72  63 65 54 61 73 6b 48 61  |le",SourceTaskHa|
00006ee0  6e 64 6c 65 25 20 b8 20  53 6f 75 72 63 65 54 61  |ndle% . SourceTa|
00006ef0  73 6b 4e 61 6d 65 25 20  3b 45 72 72 6f 72 46 6c  |skName% ;ErrorFl|
00006f00  61 67 25 0d 29 36 3a 20  20 20 e7 20 28 28 45 72  |ag%.)6:   . ((Er|
00006f10  72 6f 72 46 6c 61 67 25  80 31 29 3d 31 29 20 53  |rorFlag%.1)=1) S|
00006f20  6f 75 72 63 65 54 61 73  6b 4e 61 6d 65 25 3d 75  |ourceTaskName%=u|
00006f30  6e 6b 6e 6f 77 6e 73 74  72 69 6e 67 25 0d 29 40  |nknownstring%.)@|
00006f40  07 20 20 cd 0d 29 4a 06  20 20 0d 29 54 17 20 20  |.  ..)J.  .)T.  |
00006f50  57 69 6e 64 6f 77 4e 61  6d 65 24 3d 22 3f 3f 3f  |WindowName$="???|
00006f60  22 0d 29 5e 1c 20 20 e7  20 28 28 45 72 72 6f 72  |".)^.  . ((Error|
00006f70  46 6c 61 67 25 80 31 29  3d 30 29 20 8c 0d 29 68  |Flag%.1)=0) ..)h|
00006f80  1b 20 20 20 21 62 6c 6f  63 6b 32 25 3d 43 75 72  |.   !block2%=Cur|
00006f90  72 65 6e 74 57 69 6e 25  0d 29 72 40 20 20 20 f4  |rentWin%.)r@   .|
00006fa0  20 47 65 74 20 57 69 6e  64 6f 77 20 49 6e 66 6f  | Get Window Info|
00006fb0  20 4e 42 2e 20 53 65 74  20 42 69 74 30 20 6f 66  | NB. Set Bit0 of|
00006fc0  20 52 31 20 74 6f 20 64  69 73 61 62 6c 65 20 69  | R1 to disable i|
00006fd0  63 6f 6e 20 69 6e 66 6f  0d 29 7c 38 20 20 20 c8  |con info.)|8   .|
00006fe0  99 20 22 57 69 6d 70 5f  47 65 74 57 69 6e 64 6f  |. "Wimp_GetWindo|
00006ff0  77 49 6e 66 6f 22 2c 2c  62 6c 6f 63 6b 32 25 2b  |wInfo",,block2%+|
00007000  31 20 b8 20 3b 20 45 72  72 6f 72 46 6c 61 67 25  |1 . ; ErrorFlag%|
00007010  0d 29 86 24 20 20 20 54  69 74 6c 65 42 61 72 46  |.).$   TitleBarF|
00007020  6c 61 67 25 20 3d 20 21  28 62 6c 6f 63 6b 32 25  |lag% = !(block2%|
00007030  2b 36 30 29 0d 29 90 33  20 20 20 e7 20 28 28 54  |+60).).3   . ((T|
00007040  69 74 6c 65 42 61 72 46  6c 61 67 25 20 80 20 31  |itleBarFlag% . 1|
00007050  29 20 80 20 28 45 72 72  6f 72 46 6c 61 67 25 80  |) . (ErrorFlag%.|
00007060  31 29 3d 30 29 20 8c 0d  29 9a 22 20 20 20 20 f4  |1)=0) ..)."    .|
00007070  20 54 68 69 73 20 74 69  74 6c 65 20 63 6f 6e 74  | This title cont|
00007080  61 69 6e 73 20 74 65 78  74 0d 29 a4 21 20 20 20  |ains text.).!   |
00007090  20 e7 20 28 54 69 74 6c  65 42 61 72 46 6c 61 67  | . (TitleBarFlag|
000070a0  25 20 80 20 32 35 36 29  20 8c 0d 29 ae 23 20 20  |% . 256) ..).#  |
000070b0  20 20 20 f4 20 54 69 74  6c 65 20 64 61 74 61 20  |   . Title data |
000070c0  69 73 20 69 6e 64 69 72  65 63 74 65 64 0d 29 b8  |is indirected.).|
000070d0  25 20 20 20 20 20 54 69  74 6c 65 42 61 72 50 74  |%     TitleBarPt|
000070e0  72 25 20 3d 20 21 28 62  6c 6f 63 6b 32 25 2b 37  |r% = !(block2%+7|
000070f0  36 29 0d 29 c2 26 20 20  20 20 20 54 69 74 6c 65  |6).).&     Title|
00007100  42 61 72 4c 65 6e 67 74  68 25 3d 21 28 62 6c 6f  |BarLength%=!(blo|
00007110  63 6b 32 25 2b 38 34 29  0d 29 cc 20 20 20 20 20  |ck2%+84).).     |
00007120  20 f4 20 4d 61 6a 6f 72  20 4b 6c 75 64 67 65 20  | . Major Kludge |
00007130  21 21 21 20 54 4f 44 4f  0d 29 d6 13 20 20 20 20  |!!! TODO.)..    |
00007140  20 21 62 6c 6f 63 6b 32  25 3d 30 0d 29 e0 49 20  | !block2%=0.).I |
00007150  20 20 20 20 c8 99 22 57  69 6d 70 5f 53 65 6e 64  |    .."Wimp_Send|
00007160  4d 65 73 73 61 67 65 22  2c 30 2c 62 6c 6f 63 6b  |Message",0,block|
00007170  32 25 2c 43 75 72 72 65  6e 74 57 69 6e 25 20 b8  |2%,CurrentWin% .|
00007180  20 2c 2c 53 6f 75 72 63  65 54 61 73 6b 48 61 6e  | ,,SourceTaskHan|
00007190  64 6c 65 25 0d 29 ea 3b  20 20 20 20 20 f4 20 43  |dle%.).;     . C|
000071a0  6f 70 79 20 73 6f 75 72  63 65 20 74 61 73 6b 20  |opy source task |
000071b0  64 61 74 61 20 74 6f 20  64 65 73 74 69 6e 61 74  |data to destinat|
000071c0  69 6f 6e 20 74 61 73 6b  20 64 61 74 61 20 20 0d  |ion task data  .|
000071d0  29 f4 76 20 20 20 20 20  c8 99 22 58 57 69 6d 70  |).v     .."XWimp|
000071e0  5f 54 72 61 6e 73 66 65  72 42 6c 6f 63 6b 22 2c  |_TransferBlock",|
000071f0  53 6f 75 72 63 65 54 61  73 6b 48 61 6e 64 6c 65  |SourceTaskHandle|
00007200  25 2c 54 69 74 6c 65 42  61 72 50 74 72 25 2c 74  |%,TitleBarPtr%,t|
00007210  61 73 6b 5f 68 61 6e 64  6c 65 25 2c 74 72 61 6e  |ask_handle%,tran|
00007220  73 62 6c 6f 63 6b 25 2c  54 69 74 6c 65 42 61 72  |sblock%,TitleBar|
00007230  4c 65 6e 67 74 68 25 20  b8 20 3b 45 72 72 6f 72  |Length% . ;Error|
00007240  46 6c 61 67 25 0d 29 fe  26 20 20 20 20 20 f4 20  |Flag%.).&     . |
00007250  48 61 76 65 20 77 65 20  67 6f 74 20 74 68 65 20  |Have we got the |
00007260  77 68 6f 6c 65 20 6e 61  6d 65 3f 0d 2a 08 17 20  |whole name?.*.. |
00007270  20 20 20 20 53 75 63 63  65 73 73 46 6c 61 67 25  |    SuccessFlag%|
00007280  3d 30 0d 2a 12 1e 20 20  20 20 20 e7 20 54 69 74  |=0.*..     . Tit|
00007290  6c 65 42 61 72 4c 65 6e  67 74 68 25 3e 30 20 8c  |leBarLength%>0 .|
000072a0  0d 2a 1c 28 20 20 20 20  20 20 e3 49 6e 64 65 78  |.*.(      .Index|
000072b0  25 3d 30 b8 20 28 54 69  74 6c 65 42 61 72 4c 65  |%=0. (TitleBarLe|
000072c0  6e 67 74 68 25 2d 31 29  0d 2a 26 36 20 20 20 20  |ngth%-1).*&6    |
000072d0  20 20 20 e7 20 28 3f 28  74 72 61 6e 73 62 6c 6f  |   . (?(transblo|
000072e0  63 6b 25 2b 49 6e 64 65  78 25 29 3c 33 32 29 20  |ck%+Index%)<32) |
000072f0  53 75 63 63 65 73 73 46  6c 61 67 25 3d 31 0d 2a  |SuccessFlag%=1.*|
00007300  30 0b 20 20 20 20 20 20  ed 0d 2a 3a 0a 20 20 20  |0.      ..*:.   |
00007310  20 20 cd 0d 2a 44 3f 20  20 20 20 20 f4 20 50 52  |  ..*D?     . PR|
00007320  4f 43 65 72 72 6f 72 28  22 49 6e 44 69 72 65 63  |OCerror("InDirec|
00007330  74 65 64 20 6e 61 6d 65  20 3d 20 22 2b 24 28 74  |ted name = "+$(t|
00007340  72 61 6e 73 62 6c 6f 63  6b 25 29 2b 43 48 52 24  |ransblock%)+CHR$|
00007350  30 29 0d 2a 4e 07 20 20  20 0d 2a 58 1b 20 20 20  |0).*N.   .*X.   |
00007360  20 20 e7 20 53 75 63 63  65 73 73 46 6c 61 67 25  |  . SuccessFlag%|
00007370  3d 30 20 8c 0d 2a 62 13  20 20 20 20 20 20 49 6e  |=0 ..*b.      In|
00007380  64 65 78 25 2d 3d 31 0d  2a 6c 35 20 20 20 20 20  |dex%-=1.*l5     |
00007390  20 f4 20 47 65 74 20 72  65 73 74 20 6f 66 20 74  | . Get rest of t|
000073a0  69 74 6c 65 20 62 61 72  20 28 4d 61 6a 6f 72 20  |itle bar (Major |
000073b0  4b 6c 75 64 67 65 29 20  54 4f 44 4f 0d 2a 76 19  |Kludge) TODO.*v.|
000073c0  20 20 20 20 20 20 4b 6c  75 64 67 65 4c 65 6e 67  |      KludgeLeng|
000073d0  74 68 25 3d 30 0d 2a 80  0b 20 20 20 20 20 20 f5  |th%=0.*..      .|
000073e0  0d 2a 8a 78 20 20 20 20  20 20 20 c8 99 22 58 57  |.*.x       .."XW|
000073f0  69 6d 70 5f 54 72 61 6e  73 66 65 72 42 6c 6f 63  |imp_TransferBloc|
00007400  6b 22 2c 53 6f 75 72 63  65 54 61 73 6b 48 61 6e  |k",SourceTaskHan|
00007410  64 6c 65 25 2c 54 69 74  6c 65 42 61 72 50 74 72  |dle%,TitleBarPtr|
00007420  25 2b 49 6e 64 65 78 25  2c 74 61 73 6b 5f 68 61  |%+Index%,task_ha|
00007430  6e 64 6c 65 25 2c 74 72  61 6e 73 62 6c 6f 63 6b  |ndle%,transblock|
00007440  25 2b 49 6e 64 65 78 25  2c 31 20 b8 20 3b 45 72  |%+Index%,1 . ;Er|
00007450  72 6f 72 46 6c 61 67 25  0d 2a 94 14 20 20 20 20  |rorFlag%.*..    |
00007460  20 20 20 49 6e 64 65 78  25 2b 3d 31 0d 2a 9e 1b  |   Index%+=1.*..|
00007470  20 20 20 20 20 20 20 4b  6c 75 64 67 65 4c 65 6e  |       KludgeLen|
00007480  67 74 68 25 2b 3d 31 0d  2a a8 52 20 20 20 20 20  |gth%+=1.*.R     |
00007490  20 fd 20 3f 28 54 69 74  6c 65 42 61 72 50 74 72  | . ?(TitleBarPtr|
000074a0  25 2b 28 49 6e 64 65 78  25 2d 31 29 29 3c 33 32  |%+(Index%-1))<32|
000074b0  20 84 20 28 28 45 72 72  6f 72 46 6c 61 67 25 80  | . ((ErrorFlag%.|
000074c0  31 29 3d 31 29 20 84 20  4b 6c 75 64 67 65 4c 65  |1)=1) . KludgeLe|
000074d0  6e 67 74 68 25 3e 32 35  33 0d 2a b2 24 20 20 20  |ngth%>253.*.$   |
000074e0  20 20 20 3f 28 74 72 61  6e 73 62 6c 6f 63 6b 25  |   ?(transblock%|
000074f0  2b 49 6e 64 65 78 25 29  20 3d 20 31 33 0d 2a bc  |+Index%) = 13.*.|
00007500  25 20 20 20 20 20 20 3f  28 74 72 61 6e 73 62 6c  |%      ?(transbl|
00007510  6f 63 6b 25 2b 49 6e 64  65 78 25 2b 31 29 20 3d  |ock%+Index%+1) =|
00007520  20 30 0d 2a c6 0b 20 20  20 20 20 cd 20 0d 2a d0  | 0.*..     . .*.|
00007530  08 20 20 20 20 0d 2a da  23 20 20 20 20 20 54 69  |.    .*.#     Ti|
00007540  74 6c 65 42 61 72 50 74  72 25 20 3d 20 74 72 61  |tleBarPtr% = tra|
00007550  6e 73 62 6c 6f 63 6b 25  0d 2a e4 0a 20 20 20 20  |nsblock%.*..    |
00007560  20 cc 0d 2a ee 1b 20 20  20 20 20 f4 20 49 73 20  | ..*..     . Is |
00007570  44 69 72 65 63 74 65 64  20 64 61 74 61 0d 2a f8  |Directed data.*.|
00007580  41 20 20 20 20 20 f4 20  50 52 4f 43 65 72 72 6f  |A     . PROCerro|
00007590  72 28 22 44 69 72 65 63  74 20 77 69 6e 64 6f 77  |r("Direct window|
000075a0  20 6e 61 6d 65 20 3d 20  22 2b 24 28 62 6c 6f 63  | name = "+$(bloc|
000075b0  6b 32 25 2b 37 36 29 2b  43 48 52 24 30 29 0d 2b  |k2%+76)+CHR$0).+|
000075c0  02 22 20 20 20 20 20 54  69 74 6c 65 42 61 72 50  |."     TitleBarP|
000075d0  74 72 25 20 3d 20 62 6c  6f 63 6b 32 25 2b 37 36  |tr% = block2%+76|
000075e0  0d 2b 0c 1b 20 20 20 20  20 54 69 74 6c 65 42 61  |.+..     TitleBa|
000075f0  72 4c 65 6e 67 74 68 25  3d 31 32 0d 2b 16 14 20  |rLength%=12.+.. |
00007600  20 20 20 20 49 73 44 69  72 65 63 74 25 3d 31 0d  |    IsDirect%=1.|
00007610  2b 20 24 20 20 20 20 cd  3a f4 20 45 6e 64 20 6f  |+ $    .:. End o|
00007620  66 20 49 46 20 69 73 20  69 6e 64 69 72 65 63 74  |f IF is indirect|
00007630  65 64 3f 0d 2b 2a 08 20  20 20 20 0d 2b 34 32 20  |ed?.+*.    .+42 |
00007640  20 20 20 f4 20 48 61 73  20 74 68 65 20 74 69 74  |   . Has the tit|
00007650  6c 65 20 73 74 72 69 6e  67 20 67 6f 74 20 61 6e  |le string got an|
00007660  79 74 68 69 6e 67 20 69  6e 20 69 74 3f 0d 2b 3e  |ything in it?.+>|
00007670  32 20 20 20 20 e7 20 28  3f 54 69 74 6c 65 42 61  |2    . (?TitleBa|
00007680  72 50 74 72 25 3e 3d 33  32 20 80 20 28 45 72 72  |rPtr%>=32 . (Err|
00007690  6f 72 46 6c 61 67 25 80  31 29 3d 30 29 20 8c 0d  |orFlag%.1)=0) ..|
000076a0  2b 48 1a 20 20 20 20 20  e7 20 28 49 73 44 69 72  |+H.     . (IsDir|
000076b0  65 63 74 25 3d 30 29 20  8c 0d 2b 52 32 20 20 20  |ect%=0) ..+R2   |
000076c0  20 20 20 54 69 74 6c 65  42 61 72 53 74 72 69 6e  |   TitleBarStrin|
000076d0  67 24 20 3d 20 a4 67 65  74 6e 61 6d 65 28 54 69  |g$ = .getname(Ti|
000076e0  74 6c 65 42 61 72 50 74  72 25 29 0d 2b 5c 3d 20  |tleBarPtr%).+\= |
000076f0  20 20 20 20 20 f4 20 50  52 4f 43 65 72 72 6f 72  |     . PROCerror|
00007700  28 22 41 71 75 69 72 65  64 20 74 69 74 6c 65 3a  |("Aquired title:|
00007710  22 2b 54 69 74 6c 65 42  61 72 53 74 72 69 6e 67  |"+TitleBarString|
00007720  24 2b 43 48 52 24 30 29  0d 2b 66 0b 20 20 20 20  |$+CHR$0).+f.    |
00007730  20 20 cc 0d 2b 70 1c 20  20 20 20 20 20 54 69 74  |  ..+p.      Tit|
00007740  6c 65 42 61 72 53 74 72  69 6e 67 24 3d 22 22 0d  |leBarString$="".|
00007750  2b 7a 0e 20 20 20 20 20  20 5a 25 3d 30 0d 2b 84  |+z.      Z%=0.+.|
00007760  0b 20 20 20 20 20 20 f5  0d 2b 8e 20 20 20 20 20  |.      ..+.     |
00007770  20 20 20 59 25 3d 3f 28  54 69 74 6c 65 42 61 72  |   Y%=?(TitleBar|
00007780  50 74 72 25 2b 5a 25 29  0d 2b 98 3b 20 20 20 20  |Ptr%+Z%).+.;    |
00007790  20 20 20 e7 20 28 59 25  3e 3d 33 32 29 20 54 69  |   . (Y%>=32) Ti|
000077a0  74 6c 65 42 61 72 53 74  72 69 6e 67 24 3d 54 69  |tleBarString$=Ti|
000077b0  74 6c 65 42 61 72 53 74  72 69 6e 67 24 2b bd 28  |tleBarString$+.(|
000077c0  59 25 29 0d 2b a2 0f 20  20 20 20 20 20 5a 25 2b  |Y%).+..      Z%+|
000077d0  3d 31 0d 2b ac 19 20 20  20 20 20 20 fd 20 5a 25  |=1.+..      . Z%|
000077e0  3e 31 31 20 84 20 59 25  3c 33 32 0d 2b b6 0a 20  |>11 . Y%<32.+.. |
000077f0  20 20 20 20 cd 0d 2b c0  09 20 20 20 20 20 0d 2b  |    ..+..     .+|
00007800  ca 26 20 20 20 20 20 57  69 6e 64 6f 77 4e 61 6d  |.&     WindowNam|
00007810  65 24 20 3d 20 54 69 74  6c 65 42 61 72 53 74 72  |e$ = TitleBarStr|
00007820  69 6e 67 24 0d 2b d4 24  20 20 20 20 20 e7 20 28  |ing$.+.$     . (|
00007830  a9 28 54 69 74 6c 65 42  61 72 53 74 72 69 6e 67  |.(TitleBarString|
00007840  24 29 3e 34 35 29 20 8c  0d 2b de 2c 20 20 20 20  |$)>45) ..+.,    |
00007850  20 20 57 69 6e 64 6f 77  4e 61 6d 65 24 20 3d 20  |  WindowName$ = |
00007860  c0 54 69 74 6c 65 42 61  72 53 74 72 69 6e 67 24  |.TitleBarString$|
00007870  2c 20 34 29 0d 2b e8 2b  20 20 20 20 20 20 57 69  |, 4).+.+      Wi|
00007880  6e 64 6f 77 4e 61 6d 65  24 20 3d 20 57 69 6e 64  |ndowName$ = Wind|
00007890  6f 77 4e 61 6d 65 24 20  2b 20 22 2e 2e 2e 22 0d  |owName$ + "...".|
000078a0  2b f2 3b 20 20 20 20 20  20 57 69 6e 64 6f 77 4e  |+.;      WindowN|
000078b0  61 6d 65 24 20 3d 20 57  69 6e 64 6f 77 4e 61 6d  |ame$ = WindowNam|
000078c0  65 24 20 2b 20 c2 54 69  74 6c 65 42 61 72 53 74  |e$ + .TitleBarSt|
000078d0  72 69 6e 67 24 2c 20 33  38 29 0d 2b fc 0a 20 20  |ring$, 38).+..  |
000078e0  20 20 20 cd 0d 2c 06 09  20 20 20 20 cd 0d 2c 10  |   ..,..    ..,.|
000078f0  1c 20 20 20 cd 20 3a f4  20 45 6e 64 20 6f 66 20  |.   . :. End of |
00007900  48 61 73 20 74 65 78 74  3f 0d 2c 1a 06 20 20 0d  |Has text?.,..  .|
00007910  2c 24 18 20 20 20 69 74  65 6d 24 3d 57 69 6e 64  |,$.   item$=Wind|
00007920  6f 77 4e 61 6d 65 24 0d  2c 2e 07 20 20 20 0d 2c  |owName$.,..   .,|
00007930  38 33 20 20 20 24 28 73  68 6f 72 74 63 75 74 6d  |83   $(shortcutm|
00007940  65 6e 75 64 61 74 61 25  2b 28 6c 6f 63 61 6c 69  |enudata%+(locali|
00007950  25 2a 36 34 29 29 20 3d  20 69 74 65 6d 24 2b bd  |%*64)) = item$+.|
00007960  30 0d 2c 42 04 0d 2c 4c  2b 20 20 20 74 61 73 6b  |0.,B..,L+   task|
00007970  6e 61 6d 65 24 20 3d 20  a4 73 74 72 69 6e 67 28  |name$ = .string(|
00007980  53 6f 75 72 63 65 54 61  73 6b 4e 61 6d 65 25 29  |SourceTaskName%)|
00007990  0d 2c 56 1e 20 20 20 74  61 73 6b 69 63 6f 6e 6e  |.,V.   taskiconn|
000079a0  61 6d 65 24 3d 74 61 73  6b 6e 61 6d 65 24 0d 2c  |ame$=taskname$.,|
000079b0  60 1b 20 20 20 e7 20 28  a9 28 74 61 73 6b 6e 61  |`.   . (.(taskna|
000079c0  6d 65 24 29 3e 30 29 20  8c 0d 2c 6a 0c 20 20 20  |me$)>0) ..,j.   |
000079d0  20 73 6e 3d 33 0d 2c 74  40 20 20 20 20 e7 20 a7  | sn=3.,t@    . .|
000079e0  74 61 73 6b 6e 61 6d 65  24 2c 22 46 69 6c 65 72  |taskname$,"Filer|
000079f0  22 29 3e 30 20 74 61 73  6b 69 63 6f 6e 6e 61 6d  |")>0 taskiconnam|
00007a00  65 24 20 3d 20 22 73 6d  61 6c 6c 5f 64 69 72 22  |e$ = "small_dir"|
00007a10  3a 73 6e 3d 30 0d 2c 7e  40 20 20 20 20 e7 20 74  |:sn=0.,~@    . t|
00007a20  61 73 6b 6e 61 6d 65 24  3d 22 75 6e 6b 6e 6f 77  |askname$="unknow|
00007a30  6e 5f 61 70 70 22 20 74  61 73 6b 69 63 6f 6e 6e  |n_app" taskiconn|
00007a40  61 6d 65 24 3d 22 73 6d  61 6c 6c 5f 61 70 70 22  |ame$="small_app"|
00007a50  3a 73 6e 3d 30 0d 2c 88  40 20 20 20 20 e7 20 74  |:sn=0.,.@    . t|
00007a60  61 73 6b 6e 61 6d 65 24  3d 22 54 61 73 6b 20 4d  |askname$="Task M|
00007a70  61 6e 61 67 65 72 22 20  74 61 73 6b 69 63 6f 6e  |anager" taskicon|
00007a80  6e 61 6d 65 24 3d 22 73  77 69 74 63 68 65 72 22  |name$="switcher"|
00007a90  3a 73 6e 3d 31 0d 2c 92  42 20 20 20 20 e7 20 74  |:sn=1.,.B    . t|
00007aa0  61 73 6b 6e 61 6d 65 24  3d 22 50 61 6c 65 74 74  |askname$="Palett|
00007ab0  65 20 55 74 69 6c 69 74  79 22 20 74 61 73 6b 69  |e Utility" taski|
00007ac0  63 6f 6e 6e 61 6d 65 24  3d 22 70 61 6c 65 74 74  |conname$="palett|
00007ad0  65 22 3a 73 6e 3d 31 0d  2c 9c 3b 20 20 20 20 e7  |e":sn=1.,.;    .|
00007ae0  20 74 61 73 6b 6e 61 6d  65 24 3d 22 43 61 6c 63  | taskname$="Calc|
00007af0  75 6c 61 74 6f 72 22 20  74 61 73 6b 69 63 6f 6e  |ulator" taskicon|
00007b00  6e 61 6d 65 24 3d 22 21  63 61 6c 63 22 3a 73 6e  |name$="!calc":sn|
00007b10  3d 31 0d 2c a6 3c 20 20  20 20 e7 20 74 61 73 6b  |=1.,.<    . task|
00007b20  6e 61 6d 65 24 3d 22 43  68 61 72 61 63 74 65 72  |name$="Character|
00007b30  73 22 20 74 61 73 6b 69  63 6f 6e 6e 61 6d 65 24  |s" taskiconname$|
00007b40  3d 22 21 63 68 61 72 73  22 3a 73 6e 3d 31 0d 2c  |="!chars":sn=1.,|
00007b50  b0 40 20 20 20 20 e7 20  74 61 73 6b 6e 61 6d 65  |.@    . taskname|
00007b60  24 3d 22 53 74 72 6f 6e  67 48 65 6c 70 22 20 74  |$="StrongHelp" t|
00007b70  61 73 6b 69 63 6f 6e 6e  61 6d 65 24 3d 22 21 73  |askiconname$="!s|
00007b80  74 72 6f 6e 67 68 6c 70  22 3a 73 6e 3d 31 0d 2c  |tronghlp":sn=1.,|
00007b90  ba 3a 20 20 20 20 e7 20  28 73 6e 20 80 31 29 3d  |.:    . (sn .1)=|
00007ba0  31 20 8c 20 70 74 72 25  21 38 3d 26 37 30 30 30  |1 . ptr%!8=&7000|
00007bb0  42 31 33 2d 35 31 32 3a  f4 20 68 61 6c 66 20 73  |B13-512:. half s|
00007bc0  69 7a 65 20 69 63 6f 6e  0d 2c c4 33 20 20 20 20  |ize icon.,.3    |
00007bd0  e7 20 28 73 6e 20 80 32  29 3d 32 20 8c 20 74 61  |. (sn .2)=2 . ta|
00007be0  73 6b 69 63 6f 6e 6e 61  6d 65 24 20 3d 20 22 21  |skiconname$ = "!|
00007bf0  22 2b 74 61 73 6b 6e 61  6d 65 24 0d 2c ce 08 20  |"+taskname$.,.. |
00007c00  20 20 cd 0d 2c d8 73 20  20 20 f4 20 50 52 4f 43  |  ..,.s   . PROC|
00007c10  65 72 72 6f 72 28 22 45  6e 74 72 79 3a 22 2b 69  |error("Entry:"+i|
00007c20  74 65 6d 24 2b 22 20 49  63 6f 6e 3a 22 2b 74 61  |tem$+" Icon:"+ta|
00007c30  73 6b 69 63 6f 6e 6e 61  6d 65 24 2b 22 20 48 61  |skiconname$+" Ha|
00007c40  6e 64 6c 65 3a 22 2b 53  54 52 24 28 43 75 72 72  |ndle:"+STR$(Curr|
00007c50  65 6e 74 57 69 6e 25 29  2b 22 20 54 61 73 6b 4e  |entWin%)+" TaskN|
00007c60  61 6d 65 3a 22 2b 74 61  73 6b 6e 61 6d 65 24 2b  |ame:"+taskname$+|
00007c70  43 48 52 24 30 29 0d 2c  e2 28 20 20 20 f4 20 44  |CHR$0).,.(   . D|
00007c80  6f 65 73 20 74 61 73 6b  69 63 6f 6e 6e 61 6d 65  |oes taskiconname|
00007c90  20 73 70 72 69 74 65 20  65 78 69 73 74 3f 0d 2c  | sprite exist?.,|
00007ca0  ec 43 20 20 20 e7 20 ac  28 a4 53 70 72 69 74 65  |.C   . .(.Sprite|
00007cb0  45 78 69 73 74 28 74 61  73 6b 69 63 6f 6e 6e 61  |Exist(taskiconna|
00007cc0  6d 65 24 29 29 20 74 61  73 6b 69 63 6f 6e 6e 61  |me$)) taskiconna|
00007cd0  6d 65 24 3d 22 61 70 70  6c 69 63 61 74 69 6f 6e  |me$="application|
00007ce0  22 0d 2c f6 38 20 20 20  f4 20 49 73 20 74 61 73  |".,.8   . Is tas|
00007cf0  6b 69 63 6f 6e 6e 61 6d  65 20 74 6f 6f 20 6c 6f  |kiconname too lo|
00007d00  6e 67 20 74 6f 20 66 69  74 20 69 6e 20 6e 61 6d  |ng to fit in nam|
00007d10  65 20 62 75 66 66 65 72  3f 0d 2d 00 3a 20 20 20  |e buffer?.-.:   |
00007d20  e7 20 28 a9 28 74 61 73  6b 69 63 6f 6e 6e 61 6d  |. (.(taskiconnam|
00007d30  65 24 29 3e 31 32 29 20  74 61 73 6b 69 63 6f 6e  |e$)>12) taskicon|
00007d40  6e 61 6d 65 24 3d 22 61  70 70 6c 69 63 61 74 69  |name$="applicati|
00007d50  6f 6e 22 0d 2d 0a 20 20  20 20 f4 20 42 75 69 6c  |on".-.    . Buil|
00007d60  64 20 72 65 73 74 20 6f  66 20 69 74 65 6d 20 64  |d rest of item d|
00007d70  61 74 61 0d 2d 14 42 20  20 20 24 28 73 68 6f 72  |ata.-.B   $(shor|
00007d80  74 63 75 74 6d 65 6e 75  64 61 74 61 25 2b 28 6c  |tcutmenudata%+(l|
00007d90  6f 63 61 6c 69 25 2a 36  34 29 2b 34 36 29 20 3d  |ocali%*64)+46) =|
00007da0  20 22 53 22 2b 74 61 73  6b 69 63 6f 6e 6e 61 6d  | "S"+taskiconnam|
00007db0  65 24 2b bd 30 0d 2d 1e  39 20 20 20 21 28 73 68  |e$+.0.-.9   !(sh|
00007dc0  6f 72 74 63 75 74 6d 65  6e 75 64 61 74 61 25 2b  |ortcutmenudata%+|
00007dd0  28 6c 6f 63 61 6c 69 25  2a 36 34 29 2b 36 30 29  |(locali%*64)+60)|
00007de0  20 3d 20 43 75 72 72 65  6e 74 57 69 6e 25 0d 2d  | = CurrentWin%.-|
00007df0  28 2f 20 20 20 70 74 72  25 21 31 32 20 3d 20 73  |(/   ptr%!12 = s|
00007e00  68 6f 72 74 63 75 74 6d  65 6e 75 64 61 74 61 25  |hortcutmenudata%|
00007e10  2b 28 6c 6f 63 61 6c 69  25 2a 36 34 29 0d 2d 32  |+(locali%*64).-2|
00007e20  32 20 20 20 70 74 72 25  21 31 36 20 3d 20 73 68  |2   ptr%!16 = sh|
00007e30  6f 72 74 63 75 74 6d 65  6e 75 64 61 74 61 25 2b  |ortcutmenudata%+|
00007e40  28 6c 6f 63 61 6c 69 25  2a 36 34 29 2b 34 36 0d  |(locali%*64)+46.|
00007e50  2d 3c 38 20 20 20 70 74  72 25 21 32 30 20 3d 20  |-<8   ptr%!20 = |
00007e60  34 36 3a f4 20 6d 65 6e  75 20 69 74 65 6d 20 73  |46:. menu item s|
00007e70  74 72 69 6e 67 20 62 75  66 66 65 72 20 3d 20 34  |tring buffer = 4|
00007e80  36 20 62 79 74 65 73 0d  2d 46 19 20 20 20 61 25  |6 bytes.-F.   a%|
00007e90  3d 28 a9 28 69 74 65 6d  24 29 2b 34 29 2a 31 36  |=(.(item$)+4)*16|
00007ea0  0d 2d 50 0f 20 20 20 70  74 72 25 2b 3d 32 34 0d  |.-P.   ptr%+=24.|
00007eb0  2d 5a 11 20 20 20 6c 6f  63 61 6c 69 25 2b 3d 31  |-Z.   locali%+=1|
00007ec0  0d 2d 64 20 20 20 20 e7  20 28 61 25 3e 77 69 64  |.-d    . (a%>wid|
00007ed0  74 68 25 29 20 8c 20 77  69 64 74 68 25 3d 61 25  |th%) . width%=a%|
00007ee0  0d 2d 6e 08 20 20 20 cc  0d 2d 78 1a 20 20 20 69  |.-n.   ..-x.   i|
00007ef0  6e 69 74 69 61 6c 6d 65  6e 75 73 69 7a 65 25 2d  |nitialmenusize%-|
00007f00  3d 31 0d 2d 82 07 20 20  cd 0d 2d 8c 06 20 ed 0d  |=1.-..  ..-.. ..|
00007f10  2d 96 05 cd 0d 2d a0 2e  f4 20 49 66 20 6d 65 6e  |-....-... If men|
00007f20  75 20 69 73 20 65 6d 70  74 79 2c 20 64 65 66 69  |u is empty, defi|
00007f30  6e 65 20 61 6e 20 27 65  6d 70 74 79 27 20 69 74  |ne an 'empty' it|
00007f40  65 6d 0d 2d aa 1a e7 20  69 6e 69 74 69 61 6c 6d  |em.-... initialm|
00007f50  65 6e 75 73 69 7a 65 25  3d 30 20 8c 0d 2d b4 3b  |enusize%=0 ..-.;|
00007f60  20 f4 20 4d 61 6b 65 20  64 65 66 61 75 6c 74 20  | . Make default |
00007f70  66 69 72 73 74 20 65 6e  74 72 79 20 62 65 20 67  |first entry be g|
00007f80  72 65 79 65 64 20 6f 75  74 20 6c 61 62 65 6c 20  |reyed out label |
00007f90  27 65 6d 70 74 79 27 0d  2d be 18 20 69 6e 69 74  |'empty'.-.. init|
00007fa0  69 61 6c 6d 65 6e 75 73  69 7a 65 25 2b 3d 31 0d  |ialmenusize%+=1.|
00007fb0  2d c8 15 20 69 74 65 6d  24 3d 22 45 6d 70 74 79  |-.. item$="Empty|
00007fc0  22 2b bd 30 0d 2d d2 0e  20 21 70 74 72 25 3d 26  |"+.0.-.. !ptr%=&|
00007fd0  38 30 0d 2d dc 24 20 70  74 72 25 21 34 3d 2d 31  |80.-.$ ptr%!4=-1|
00007fe0  3a f4 20 70 6f 69 6e 74  65 72 20 74 6f 20 73 75  |:. pointer to su|
00007ff0  62 20 6d 65 6e 75 0d 2d  e6 38 20 70 74 72 25 21  |b menu.-.8 ptr%!|
00008000  38 3d 26 32 34 30 30 30  32 39 3a f4 20 67 72 65  |8=&2400029:. gre|
00008010  79 65 64 20 6f 75 74 20  55 4e 53 45 4c 45 43 54  |yed out UNSELECT|
00008020  41 42 4c 45 20 69 63 6f  6e 20 74 79 70 65 0d 2d  |ABLE icon type.-|
00008030  f0 15 20 24 28 70 74 72  25 2b 31 32 29 3d 69 74  |.. $(ptr%+12)=it|
00008040  65 6d 24 0d 2d fa 17 20  61 25 3d 28 a9 28 69 74  |em$.-.. a%=(.(it|
00008050  65 6d 24 29 2b 34 29 2a  31 36 0d 2e 04 1a 20 e7  |em$)+4)*16.... .|
00008060  20 61 25 3e 77 69 64 74  68 25 20 77 69 64 74 68  | a%>width% width|
00008070  25 3d 61 25 0d 2e 0e 0d  20 70 74 72 25 2b 3d 32  |%=a%.... ptr%+=2|
00008080  34 0d 2e 18 05 cd 0d 2e  22 1e f4 20 44 65 66 69  |4.......".. Defi|
00008090  6e 65 20 6c 61 73 74 20  69 74 65 6d 20 69 6e 20  |ne last item in |
000080a0  6d 65 6e 75 0d 2e 2c 1d  63 75 72 72 65 6e 74 6d  |menu..,.currentm|
000080b0  65 6e 75 70 74 72 25 21  31 36 3d 77 69 64 74 68  |enuptr%!16=width|
000080c0  25 0d 2e 36 27 21 28 70  74 72 25 2d 32 34 29 3d  |%..6'!(ptr%-24)=|
000080d0  26 38 38 3a f4 20 53 65  74 20 6c 61 73 74 20 6d  |&88:. Set last m|
000080e0  65 6e 75 20 69 74 65 6d  0d 2e 40 15 c8 99 22 48  |enu item..@..."H|
000080f0  6f 75 72 67 6c 61 73 73  5f 4f 66 66 22 0d 2e 4a  |ourglass_Off"..J|
00008100  0f f4 20 4f 70 65 6e 20  6d 65 6e 75 0d 2e 54 23  |.. Open menu..T#|
00008110  c8 99 22 57 69 6d 70 5f  47 65 74 50 6f 69 6e 74  |.."Wimp_GetPoint|
00008120  65 72 49 6e 66 6f 22 2c  2c 62 6c 6f 63 6b 25 0d  |erInfo",,block%.|
00008130  2e 5e 2a 43 75 72 72 65  6e 74 4d 65 6e 75 54 79  |.^*CurrentMenuTy|
00008140  70 65 25 20 3d 20 57 69  6e 64 6f 77 4c 69 73 74  |pe% = WindowList|
00008150  4d 65 6e 75 54 79 70 65  25 0d 2e 68 16 57 69 6e  |MenuType%..h.Win|
00008160  64 6f 77 4c 69 73 74 49  63 6f 6e 25 3d 2d 31 0d  |dowListIcon%=-1.|
00008170  2e 72 43 f2 73 68 6f 77  6d 65 6e 75 28 73 68 6f  |.rC.showmenu(sho|
00008180  72 74 63 75 74 6d 65 6e  75 25 2c 21 62 6c 6f 63  |rtcutmenu%,!bloc|
00008190  6b 25 2d 36 34 2c 20 39  36 2b 28 28 69 6e 69 74  |k%-64, 96+((init|
000081a0  69 61 6c 6d 65 6e 75 73  69 7a 65 25 29 2a 34 34  |ialmenusize%)*44|
000081b0  29 29 0d 2e 7c 05 e1 0d  2e 86 04 0d 2e 90 35 f4  |))..|.........5.|
000081c0  20 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  | ***************|
000081d0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000081f0  0d 2e 9a 18 f4 20 44 6f  65 73 20 53 70 72 69 74  |..... Does Sprit|
00008200  65 20 45 78 69 73 74 3f  0d 2e a4 35 f4 20 2a 2a  |e Exist?...5. **|
00008210  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00008230  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 0d 2e ae  |*************...|
00008240  1e dd a4 53 70 72 69 74  65 45 78 69 73 74 28 53  |...SpriteExist(S|
00008250  70 72 69 74 65 4e 61 6d  65 24 29 0d 2e b8 24 ea  |priteName$)...$.|
00008260  20 52 4f 4d 42 61 73 65  25 2c 20 52 41 4d 42 61  | ROMBase%, RAMBa|
00008270  73 65 25 2c 20 45 72 72  6f 72 46 6c 61 67 25 0d  |se%, ErrorFlag%.|
00008280  2e c2 2f c8 99 20 22 57  69 6d 70 5f 42 61 73 65  |../.. "Wimp_Base|
00008290  4f 66 53 70 72 69 74 65  73 22 20 b8 20 52 4f 4d  |OfSprites" . ROM|
000082a0  42 61 73 65 25 2c 52 41  4d 42 61 73 65 25 0d 2e  |Base%,RAMBase%..|
000082b0  cc 22 24 64 72 61 67 73  70 72 69 74 65 6e 61 6d  |."$dragspritenam|
000082c0  65 25 20 3d 20 53 70 72  69 74 65 4e 61 6d 65 24  |e% = SpriteName$|
000082d0  0d 2e d6 40 c8 99 22 58  4f 53 5f 53 70 72 69 74  |...@.."XOS_Sprit|
000082e0  65 4f 70 22 2c 32 39 36  2c 52 4f 4d 42 61 73 65  |eOp",296,ROMBase|
000082f0  25 2c 64 72 61 67 73 70  72 69 74 65 6e 61 6d 65  |%,dragspritename|
00008300  25 20 b8 20 3b 20 45 72  72 6f 72 46 6c 61 67 25  |% . ; ErrorFlag%|
00008310  0d 2e e0 1d e7 20 28 45  72 72 6f 72 46 6c 61 67  |..... (ErrorFlag|
00008320  25 20 80 20 31 29 3d 30  20 8c 20 3d b9 0d 2e ea  |% . 1)=0 . =....|
00008330  40 c8 99 22 58 4f 53 5f  53 70 72 69 74 65 4f 70  |@.."XOS_SpriteOp|
00008340  22 2c 32 39 36 2c 52 41  4d 42 61 73 65 25 2c 64  |",296,RAMBase%,d|
00008350  72 61 67 73 70 72 69 74  65 6e 61 6d 65 25 20 b8  |ragspritename% .|
00008360  20 3b 20 45 72 72 6f 72  46 6c 61 67 25 0d 2e f4  | ; ErrorFlag%...|
00008370  1d e7 20 28 45 72 72 6f  72 46 6c 61 67 25 20 80  |.. (ErrorFlag% .|
00008380  20 31 29 3d 30 20 8c 20  3d b9 0d 2e fe 06 3d a3  | 1)=0 . =.....=.|
00008390  0d 2f 08 04 0d 2f 12 38  f4 20 2a 2a 2a 2a 2a 2a  |./.../.8. ******|
000083a0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000083c0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 0d 2f 1c 25  |************./.%|
000083d0  f4 20 53 74 61 72 74 20  62 75 69 6c 64 69 6e 67  |. Start building|
000083e0  20 74 68 65 20 73 68 6f  72 74 63 75 74 6d 65 6e  | the shortcutmen|
000083f0  75 0d 2f 26 38 f4 20 2a  2a 2a 2a 2a 2a 2a 2a 2a  |u./&8. *********|
00008400  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00008420  2a 2a 2a 2a 2a 2a 2a 2a  2a 0d 2f 30 1c dd f2 73  |*********./0...s|
00008430  68 6f 77 73 68 6f 72 74  63 75 74 6d 65 6e 75 28  |howshortcutmenu(|
00008440  61 72 67 25 29 0d 2f 3a  27 e7 20 28 54 6f 6f 6c  |arg%)./:'. (Tool|
00008450  54 69 70 25 3d 31 29 20  f2 50 65 72 73 69 73 74  |Tip%=1) .Persist|
00008460  43 6c 6f 73 65 54 6f 6f  6c 54 69 70 0d 2f 44 11  |CloseToolTip./D.|
00008470  61 64 64 6c 69 6e 6b 25  3d 61 72 67 25 0d 2f 4e  |addlink%=arg%./N|
00008480  20 e7 20 28 a4 43 68 65  63 6b 4c 69 6e 6b 73 44  | . (.CheckLinksD|
00008490  69 72 45 78 69 73 74 73  3d 30 29 20 e1 0d 2f 58  |irExists=0) ../X|
000084a0  1c 64 69 72 70 74 72 25  28 30 29 3d 73 68 6f 72  |.dirptr%(0)=shor|
000084b0  74 63 75 74 6d 65 6e 75  25 0d 2f 62 27 f4 20 6c  |tcutmenu%./b'. l|
000084c0  69 6e 6b 6d 65 6e 75 64  65 70 74 68 25 3d 30 3a  |inkmenudepth%=0:|
000084d0  52 45 4d 20 41 74 20 74  6f 70 20 6c 65 76 65 6c  |REM At top level|
000084e0  0d 2f 6c 04 0d 2f 76 4c  f4 50 52 4f 43 53 69 6e  |./l../vL.PROCSin|
000084f0  67 6c 65 44 69 72 65 63  74 6f 72 79 52 65 61 64  |gleDirectoryRead|
00008500  28 41 70 70 50 61 74 68  24 2b 22 2e 55 73 65 72  |(AppPath$+".User|
00008510  73 2e 22 2b 55 73 65 72  24 2b 22 2e 4c 69 6e 6b  |s."+User$+".Link|
00008520  73 22 2c 20 55 73 65 72  24 2c 20 30 2c 20 30 29  |s", User$, 0, 0)|
00008530  0d 2f 80 4e f2 53 69 6e  67 6c 65 44 69 72 65 63  |./.N.SingleDirec|
00008540  74 6f 72 79 52 65 61 64  28 41 70 70 50 61 74 68  |toryRead(AppPath|
00008550  24 2b 22 2e 55 73 65 72  73 2e 22 2b 55 73 65 72  |$+".Users."+User|
00008560  24 2b 22 2e 4c 69 6e 6b  73 22 2c 20 22 53 68 6f  |$+".Links", "Sho|
00008570  72 74 43 75 74 73 22 2c  20 30 2c 20 30 29 0d 2f  |rtCuts", 0, 0)./|
00008580  8a 20 69 6e 69 74 69 61  6c 6d 65 6e 75 64 6f 74  |. initialmenudot|
00008590  74 65 64 6c 69 6e 65 73  69 7a 65 25 3d 30 0d 2f  |tedlinesize%=0./|
000085a0  94 20 69 6e 69 74 69 61  6c 6d 65 6e 75 73 69 7a  |. initialmenusiz|
000085b0  65 25 3d 64 69 72 6c 69  73 74 25 28 30 29 0d 2f  |e%=dirlist%(0)./|
000085c0  9e 2b e7 20 69 6e 69 74  69 61 6c 6d 65 6e 75 73  |.+. initialmenus|
000085d0  69 7a 65 25 3d 30 20 69  6e 69 74 69 61 6c 6d 65  |ize%=0 initialme|
000085e0  6e 75 73 69 7a 65 25 3d  31 0d 2f a8 2b 69 6e 69  |nusize%=1./.+ini|
000085f0  74 69 61 6c 6d 65 6e 75  73 69 7a 65 25 20 3d 20  |tialmenusize% = |
00008600  47 6c 6f 62 61 6c 4d 65  6e 75 49 74 65 6d 43 6f  |GlobalMenuItemCo|
00008610  75 6e 74 25 0d 2f b2 23  c8 99 22 57 69 6d 70 5f  |unt%./.#.."Wimp_|
00008620  47 65 74 50 6f 69 6e 74  65 72 49 6e 66 6f 22 2c  |GetPointerInfo",|
00008630  2c 62 6c 6f 63 6b 25 0d  2f bc 28 43 75 72 72 65  |,block%./.(Curre|
00008640  6e 74 4d 65 6e 75 54 79  70 65 25 20 3d 20 53 68  |ntMenuType% = Sh|
00008650  6f 72 74 43 75 74 4d 65  6e 75 54 79 70 65 25 0d  |ortCutMenuType%.|
00008660  2f c6 5e f2 73 68 6f 77  6d 65 6e 75 28 73 68 6f  |/.^.showmenu(sho|
00008670  72 74 63 75 74 6d 65 6e  75 25 2c 21 62 6c 6f 63  |rtcutmenu%,!bloc|
00008680  6b 25 2d 36 34 2c 20 39  36 2b 28 47 6c 6f 62 61  |k%-64, 96+(Globa|
00008690  6c 4d 65 6e 75 49 74 65  6d 43 6f 75 6e 74 25 2a  |lMenuItemCount%*|
000086a0  34 34 29 2b 28 47 6c 6f  62 61 6c 4d 65 6e 75 53  |44)+(GlobalMenuS|
000086b0  65 70 43 6f 75 6e 74 25  2a 32 34 29 29 0d 2f d0  |epCount%*24))./.|
000086c0  05 e1 0d 2f da 04 0d 2f  e4 04 0d 2f ee 04 0d 2f  |.../.../.../.../|
000086d0  f8 3b f4 20 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |.;. ************|
000086e0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00008700  2a 2a 2a 2a 2a 2a 2a 2a  2a 0d 30 02 3b f4 20 52  |*********.0.;. R|
00008710  65 61 64 20 63 6f 6e 74  65 6e 74 73 20 6f 66 20  |ead contents of |
00008720  61 20 64 69 72 65 63 74  6f 72 79 20 69 6e 74 6f  |a directory into|
00008730  20 74 68 65 20 6d 65 6e  75 20 64 61 74 61 20 61  | the menu data a|
00008740  72 65 61 73 0d 30 0c 24  f4 20 73 74 6f 72 69 6e  |reas.0.$. storin|
00008750  67 20 66 69 6c 65 6e 61  6d 65 20 61 6e 64 20 69  |g filename and i|
00008760  63 6f 6e 20 74 79 70 65  0d 30 16 3b f4 20 2a 2a  |con type.0.;. **|
00008770  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000087a0  2a 2a 2a 0d 30 20 47 dd  f2 53 69 6e 67 6c 65 44  |***.0 G..SingleD|
000087b0  69 72 65 63 74 6f 72 79  52 65 61 64 28 6c 6f 63  |irectoryRead(loc|
000087c0  61 6c 64 69 72 24 2c 64  69 72 66 69 6c 65 6e 61  |aldir$,dirfilena|
000087d0  6d 65 24 2c 6c 69 6e 6b  64 65 70 74 68 25 2c 20  |me$,linkdepth%, |
000087e0  61 64 64 77 72 69 74 65  25 29 0d 30 2a 3c ea 20  |addwrite%).0*<. |
000087f0  6f 6c 64 6c 6f 63 61 6c  64 69 72 24 2c 6f 6c 64  |oldlocaldir$,old|
00008800  64 69 72 66 69 6c 65 6e  61 6d 65 24 2c 6f 6c 64  |dirfilename$,old|
00008810  6c 69 6e 6b 64 65 70 74  68 25 2c 20 6f 6c 64 64  |linkdepth%, oldd|
00008820  69 72 70 74 72 25 0d 30  34 18 ea 20 64 69 72 73  |irptr%.04.. dirs|
00008830  69 7a 65 25 2c 20 44 69  72 53 63 61 6e 25 0d 30  |ize%, DirScan%.0|
00008840  3e 2d ea 20 64 69 72 24  2c 6e 65 78 74 25 2c 74  |>-. dir$,next%,t|
00008850  79 70 65 25 2c 69 74 65  6d 24 2c 63 75 72 72 65  |ype%,item$,curre|
00008860  6e 74 64 69 72 25 2c 70  74 72 25 0d 30 48 2d ea  |ntdir%,ptr%.0H-.|
00008870  20 63 75 72 72 65 6e 74  6d 65 6e 75 70 74 72 25  | currentmenuptr%|
00008880  2c 20 6c 6f 63 61 6c 69  25 2c 20 77 69 64 74 68  |, locali%, width|
00008890  25 2c 74 69 74 6c 65 24  0d 30 52 28 ea 20 54 69  |%,title$.0R(. Ti|
000088a0  74 6c 65 50 74 72 25 2c  20 4d 65 6e 75 45 78 74  |tlePtr%, MenuExt|
000088b0  65 6e 74 25 2c 69 74 65  6d 73 70 72 69 74 65 24  |ent%,itemsprite$|
000088c0  0d 30 5c 42 ea 20 66 69  6c 65 74 79 70 65 25 2c  |.0\B. filetype%,|
000088d0  20 66 69 6c 65 74 79 70  65 69 6e 66 6f 25 2c 6c  | filetypeinfo%,l|
000088e0  69 6e 6b 74 79 70 65 25  2c 6f 62 6a 65 63 74 74  |inktype%,objectt|
000088f0  79 70 65 25 2c 6c 69 6e  6b 74 79 70 65 69 6e 66  |ype%,linktypeinf|
00008900  6f 25 0d 30 66 23 ea 20  56 61 6c 69 64 4c 6f 61  |o%.0f#. ValidLoa|
00008910  64 46 6c 61 67 25 2c 20  4b 65 65 70 4d 65 6e 75  |dFlag%, KeepMenu|
00008920  49 74 65 6d 25 0d 30 70  25 ea 20 4e 75 6d 62 65  |Item%.0p%. Numbe|
00008930  72 4f 66 4c 69 6e 6b 73  25 2c 20 55 73 65 4c 61  |rOfLinks%, UseLa|
00008940  72 67 65 53 70 72 69 74  65 25 0d 30 7a 04 0d 30  |rgeSprite%.0z..0|
00008950  84 14 c8 99 22 48 6f 75  72 67 6c 61 73 73 5f 4f  |...."Hourglass_O|
00008960  6e 22 0d 30 8e 04 0d 30  98 1c 6f 6c 64 6c 6f 63  |n".0...0..oldloc|
00008970  61 6c 64 69 72 24 20 3d  20 6c 6f 63 61 6c 64 69  |aldir$ = localdi|
00008980  72 24 0d 30 a2 22 6f 6c  64 64 69 72 66 69 6c 65  |r$.0."olddirfile|
00008990  6e 61 6d 65 24 20 3d 20  64 69 72 66 69 6c 65 6e  |name$ = dirfilen|
000089a0  61 6d 65 24 0d 30 ac 1e  6f 6c 64 6c 69 6e 6b 64  |ame$.0..oldlinkd|
000089b0  65 70 74 68 25 20 3d 20  6c 69 6e 6b 64 65 70 74  |epth% = linkdept|
000089c0  68 25 0d 30 b6 22 6f 6c  64 64 69 72 70 74 72 25  |h%.0."olddirptr%|
000089d0  3d 64 69 72 70 74 72 25  28 6c 69 6e 6b 64 65 70  |=dirptr%(linkdep|
000089e0  74 68 25 29 0d 30 c0 0e  44 69 72 53 63 61 6e 25  |th%).0..DirScan%|
000089f0  3d a3 0d 30 ca 04 0d 30  d4 14 e7 20 28 61 64 64  |=..0...0... (add|
00008a00  6c 69 6e 6b 25 3d 31 29  20 8c 0d 30 de 1c 20 69  |link%=1) ..0.. i|
00008a10  74 65 6d 73 70 72 69 74  65 24 3d 22 50 70 74 72  |temsprite$="Pptr|
00008a20  5f 6c 69 6e 6b 22 0d 30  e8 06 20 cc 0d 30 f2 13  |_link".0.. ..0..|
00008a30  20 69 74 65 6d 73 70 72  69 74 65 24 3d 22 22 0d  | itemsprite$="".|
00008a40  30 fc 05 cd 0d 31 06 04  0d 31 10 37 f5 3a f4 20  |0....1...1.7.:. |
00008a50  52 65 70 65 61 74 20 75  6e 74 69 6c 20 6c 6f 61  |Repeat until loa|
00008a60  64 65 64 20 69 6e 20 64  69 72 65 63 74 6f 72 79  |ded in directory|
00008a70  20 77 69 74 68 20 6e 6f  20 65 72 72 6f 72 73 0d  | with no errors.|
00008a80  31 1a 1c 6c 6f 63 61 6c  64 69 72 24 20 3d 20 6f  |1..localdir$ = o|
00008a90  6c 64 6c 6f 63 61 6c 64  69 72 24 0d 31 24 22 64  |ldlocaldir$.1$"d|
00008aa0  69 72 66 69 6c 65 6e 61  6d 65 24 20 3d 20 6f 6c  |irfilename$ = ol|
00008ab0  64 64 69 72 66 69 6c 65  6e 61 6d 65 24 0d 31 2e  |ddirfilename$.1.|
00008ac0  1e 6c 69 6e 6b 64 65 70  74 68 25 20 3d 20 6f 6c  |.linkdepth% = ol|
00008ad0  64 6c 69 6e 6b 64 65 70  74 68 25 0d 31 38 25 64  |dlinkdepth%.18%d|
00008ae0  69 72 70 74 72 25 28 6f  6c 64 6c 69 6e 6b 64 65  |irptr%(oldlinkde|
00008af0  70 74 68 25 29 3d 6f 6c  64 64 69 72 70 74 72 25  |pth%)=olddirptr%|
00008b00  0d 31 42 0e 44 69 72 53  63 61 6e 25 3d b9 0d 31  |.1B.DirScan%=..1|
00008b10  4c 04 0d 31 56 35 f4 20  43 61 6c 63 75 6c 61 74  |L..1V5. Calculat|
00008b20  65 20 70 6f 69 6e 74 65  72 20 74 6f 20 73 68 6f  |e pointer to sho|
00008b30  72 74 63 75 74 6d 65 6e  75 25 20 26 20 69 6e 64  |rtcutmenu% & ind|
00008b40  65 78 20 69 6e 74 6f 0d  31 60 17 f4 20 73 68 6f  |ex into.1`.. sho|
00008b50  72 74 63 75 74 6d 65 6e  75 64 61 74 61 25 0d 31  |rtcutmenudata%.1|
00008b60  6a 12 64 69 72 24 3d 6c  6f 63 61 6c 64 69 72 24  |j.dir$=localdir$|
00008b70  0d 31 74 08 61 25 3d 30  0d 31 7e 21 63 75 72 72  |.1t.a%=0.1~!curr|
00008b80  65 6e 74 6d 65 6e 75 70  74 72 25 3d 73 68 6f 72  |entmenuptr%=shor|
00008b90  74 63 75 74 6d 65 6e 75  25 0d 31 88 08 69 25 3d  |tcutmenu%.1..i%=|
00008ba0  30 0d 31 92 14 c8 95 20  61 25 3c 6c 69 6e 6b 64  |0.1.... a%<linkd|
00008bb0  65 70 74 68 25 0d 31 9c  2b 63 75 72 72 65 6e 74  |epth%.1.+current|
00008bc0  6d 65 6e 75 70 74 72 25  2b 3d 28 32 38 2b 28 64  |menuptr%+=(28+(d|
00008bd0  69 72 6c 69 73 74 25 28  61 25 29 2a 32 34 29 29  |irlist%(a%)*24))|
00008be0  0d 31 a6 14 69 25 2b 3d  64 69 72 6c 69 73 74 25  |.1..i%+=dirlist%|
00008bf0  28 61 25 29 0d 31 b0 09  61 25 2b 3d 31 0d 31 ba  |(a%).1..a%+=1.1.|
00008c00  05 ce 0d 31 c4 04 0d 31  ce 34 f4 20 49 6e 69 74  |...1...1.4. Init|
00008c10  69 61 6c 69 73 65 20 72  6f 6f 74 20 6d 65 6e 75  |ialise root menu|
00008c20  20 73 65 70 65 72 61 74  6f 72 20 74 6f 20 62 65  | seperator to be|
00008c30  20 75 6e 64 65 66 69 6e  65 64 0d 31 d8 16 e7 20  | undefined.1... |
00008c40  28 6c 69 6e 6b 64 65 70  74 68 25 3d 30 29 20 8c  |(linkdepth%=0) .|
00008c50  0d 31 e2 1b 20 53 74 61  72 74 4d 65 6e 75 53 65  |.1.. StartMenuSe|
00008c60  70 65 72 61 74 6f 72 25  3d 2d 31 0d 31 ec 1c 20  |perator%=-1.1.. |
00008c70  53 74 61 72 74 4d 65 6e  75 53 65 70 65 72 61 74  |StartMenuSeperat|
00008c80  6f 72 32 25 3d 2d 31 0d  31 f6 1c 20 53 74 61 72  |or2%=-1.1.. Star|
00008c90  74 4d 65 6e 75 53 65 70  65 72 61 74 6f 72 33 25  |tMenuSeperator3%|
00008ca0  3d 2d 31 0d 32 00 05 cd  0d 32 0a 04 0d 32 14 39  |=-1.2....2...2.9|
00008cb0  f4 50 52 4f 43 65 72 72  6f 72 28 22 4d 65 6e 75  |.PROCerror("Menu|
00008cc0  50 74 72 20 3d 20 22 2b  53 54 52 24 7e 28 63 75  |Ptr = "+STR$~(cu|
00008cd0  72 72 65 6e 74 6d 65 6e  75 70 74 72 25 29 2b 43  |rrentmenuptr%)+C|
00008ce0  48 52 24 30 29 0d 32 1e  0b 6e 65 78 74 25 3d 30  |HR$0).2..next%=0|
00008cf0  0d 32 28 14 6e 75 6d 62  65 72 6f 66 69 74 65 6d  |.2(.numberofitem|
00008d00  73 25 3d 30 0d 32 32 04  0d 32 3c 38 f4 20 47 65  |s%=0.22..2<8. Ge|
00008d10  74 20 6e 75 6d 62 65 72  20 6f 66 20 69 74 65 6d  |t number of item|
00008d20  73 20 69 6e 20 63 75 72  72 65 6e 74 20 64 69 72  |s in current dir|
00008d30  65 63 74 6f 72 79 20 6c  6f 63 61 6c 64 69 72 24  |ectory localdir$|
00008d40  0d 32 46 12 c8 95 20 28  6e 65 78 74 25 3c 3e 2d  |.2F... (next%<>-|
00008d50  31 29 0d 32 50 14 24 73  74 72 69 6e 67 25 3d 64  |1).2P.$string%=d|
00008d60  69 72 24 2b bd 30 0d 32  5a 45 c8 99 20 22 4f 53  |ir$+.0.2ZE.. "OS|
00008d70  5f 47 42 50 42 22 2c 31  30 2c 73 74 72 69 6e 67  |_GBPB",10,string|
00008d80  25 2c 64 62 6c 6f 63 6b  25 2c 31 2c 6e 65 78 74  |%,dblock%,1,next|
00008d90  25 2c 36 33 2c 22 2a 22  20 b8 20 2c 2c 2c 6e 75  |%,63,"*" . ,,,nu|
00008da0  6d 62 65 72 25 2c 6e 65  78 74 25 0d 32 64 11 e7  |mber%,next%.2d..|
00008db0  20 6e 65 78 74 25 3c 3e  2d 31 20 8c 0d 32 6e 16  | next%<>-1 ..2n.|
00008dc0  20 6e 75 6d 62 65 72 6f  66 69 74 65 6d 73 25 2b  | numberofitems%+|
00008dd0  3d 31 0d 32 78 20 20 69  74 65 6d 24 3d a4 67 65  |=1.2x  item$=.ge|
00008de0  74 6e 61 6d 65 28 64 62  6c 6f 63 6b 25 2b 26 31  |tname(dblock%+&1|
00008df0  34 29 0d 32 82 3c 20 f4  20 44 69 73 63 6f 75 6e  |4).2.< . Discoun|
00008e00  74 20 74 68 69 73 20 6d  65 6e 75 20 69 74 65 6d  |t this menu item|
00008e10  20 69 66 20 69 74 73 20  61 20 7e 7e 20 69 74 65  | if its a ~~ ite|
00008e20  6d 20 61 6e 64 20 61 64  76 61 6e 63 65 64 0d 32  |m and advanced.2|
00008e30  8c 17 20 f4 20 6d 65 6e  75 73 20 64 69 73 61 62  |.. . menus disab|
00008e40  6c 65 64 2e 20 0d 32 96  76 20 e7 20 28 47 6c 6f  |led. .2.v . (Glo|
00008e50  62 61 6c 53 68 6f 77 42  6f 6f 74 4d 65 6e 75 46  |balShowBootMenuF|
00008e60  6c 61 67 25 3d 30 20 80  20 c1 69 74 65 6d 24 2c  |lag%=0 . .item$,|
00008e70  31 2c 31 29 3d bd 28 53  79 73 46 69 6c 65 50 72  |1,1)=.(SysFilePr|
00008e80  65 66 69 78 25 29 20 80  20 c1 69 74 65 6d 24 2c  |efix%) . .item$,|
00008e90  32 2c 31 29 3d bd 28 53  79 73 46 69 6c 65 50 72  |2,1)=.(SysFilePr|
00008ea0  65 66 69 78 25 29 29 20  8c 20 6e 75 6d 62 65 72  |efix%)) . number|
00008eb0  6f 66 69 74 65 6d 73 25  2d 3d 31 0d 32 a0 05 cd  |ofitems%-=1.2...|
00008ec0  0d 32 aa 05 ce 0d 32 b4  04 0d 32 be 04 0d 32 c8  |.2....2...2...2.|
00008ed0  3f f4 20 50 52 4f 43 65  72 72 6f 72 28 22 44 69  |?. PROCerror("Di|
00008ee0  72 65 63 74 6f 72 79 20  73 69 7a 65 20 3d 20 22  |rectory size = "|
00008ef0  2b 53 54 52 24 28 6e 75  6d 62 65 72 6f 66 69 74  |+STR$(numberofit|
00008f00  65 6d 73 25 29 2b 43 48  52 24 30 29 0d 32 d2 04  |ems%)+CHR$0).2..|
00008f10  0d 32 dc 27 64 69 72 6c  69 73 74 25 28 6c 69 6e  |.2.'dirlist%(lin|
00008f20  6b 64 65 70 74 68 25 29  3d 6e 75 6d 62 65 72 6f  |kdepth%)=numbero|
00008f30  66 69 74 65 6d 73 25 0d  32 e6 45 6e 65 78 74 6d  |fitems%.2.Enextm|
00008f40  65 6e 75 70 74 72 25 3d  63 75 72 72 65 6e 74 6d  |enuptr%=currentm|
00008f50  65 6e 75 70 74 72 25 2b  28 32 38 2b 28 28 6e 75  |enuptr%+(28+((nu|
00008f60  6d 62 65 72 6f 66 69 74  65 6d 73 25 2b 61 64 64  |mberofitems%+add|
00008f70  77 72 69 74 65 25 29 2a  32 34 29 29 0d 32 f0 26  |write%)*24)).2.&|
00008f80  64 69 72 70 74 72 25 28  6c 69 6e 6b 64 65 70 74  |dirptr%(linkdept|
00008f90  68 25 2b 31 29 3d 6e 65  78 74 6d 65 6e 75 70 74  |h%+1)=nextmenupt|
00008fa0  72 25 0d 32 fa 04 0d 33  04 0e 6c 6f 63 61 6c 69  |r%.2...3..locali|
00008fb0  25 3d 69 25 0d 33 0e 1a  f4 20 42 75 69 6c 64 20  |%=i%.3... Build |
00008fc0  74 69 74 6c 65 6c 65 73  73 20 6d 65 6e 75 0d 33  |titleless menu.3|
00008fd0  18 2c f4 20 74 69 74 6c  65 24 3d 22 4d 65 6e 75  |.,. title$="Menu|
00008fe0  20 22 2b 53 54 52 24 28  63 75 72 72 65 6e 74 64  | "+STR$(currentd|
00008ff0  69 72 25 29 2b 43 48 52  24 30 0d 33 22 1a 74 69  |ir%)+CHR$0.3".ti|
00009000  74 6c 65 24 3d 64 69 72  66 69 6c 65 6e 61 6d 65  |tle$=dirfilename|
00009010  24 2b bd 30 0d 33 2c 16  e7 20 28 6c 69 6e 6b 64  |$+.0.3,.. (linkd|
00009020  65 70 74 68 25 3d 31 29  20 8c 0d 33 36 2d 20 e7  |epth%=1) ..36- .|
00009030  20 28 c0 64 69 72 66 69  6c 65 6e 61 6d 65 24 2c  | (.dirfilename$,|
00009040  31 29 3d bd 28 53 79 73  46 69 6c 65 50 72 65 66  |1)=.(SysFilePref|
00009050  69 78 25 29 29 20 8c 0d  33 40 31 20 20 e7 20 28  |ix%)) ..3@1  . (|
00009060  c1 64 69 72 66 69 6c 65  6e 61 6d 65 24 2c 32 2c  |.dirfilename$,2,|
00009070  31 29 3c 3e bd 28 53 79  73 46 69 6c 65 50 72 65  |1)<>.(SysFilePre|
00009080  66 69 78 25 29 29 20 8c  0d 33 4a 31 20 20 20 74  |fix%)) ..3J1   t|
00009090  69 74 6c 65 24 3d c2 64  69 72 66 69 6c 65 6e 61  |itle$=.dirfilena|
000090a0  6d 65 24 2c a9 28 64 69  72 66 69 6c 65 6e 61 6d  |me$,.(dirfilenam|
000090b0  65 24 29 2d 31 29 2b bd  30 0d 33 54 07 20 20 cd  |e$)-1)+.0.3T.  .|
000090c0  0d 33 5e 30 20 20 e7 20  28 c1 64 69 72 66 69 6c  |.3^0  . (.dirfil|
000090d0  65 6e 61 6d 65 24 2c 32  2c 31 29 3d bd 28 53 79  |ename$,2,1)=.(Sy|
000090e0  73 46 69 6c 65 50 72 65  66 69 78 25 29 29 20 8c  |sFilePrefix%)) .|
000090f0  0d 33 68 31 20 20 20 74  69 74 6c 65 24 3d c2 64  |.3h1   title$=.d|
00009100  69 72 66 69 6c 65 6e 61  6d 65 24 2c a9 28 64 69  |irfilename$,.(di|
00009110  72 66 69 6c 65 6e 61 6d  65 24 29 2d 32 29 2b bd  |rfilename$)-2)+.|
00009120  30 0d 33 72 07 20 20 cd  0d 33 7c 06 20 cd 0d 33  |0.3r.  ..3|. ..3|
00009130  86 05 cd 0d 33 90 04 0d  33 9a 1d 54 69 74 6c 65  |....3...3..Title|
00009140  50 74 72 25 3d 63 75 72  72 65 6e 74 6d 65 6e 75  |Ptr%=currentmenu|
00009150  70 74 72 25 0d 33 a4 15  24 54 69 74 6c 65 50 74  |ptr%.3..$TitlePt|
00009160  72 25 3d 74 69 74 6c 65  24 0d 33 ae 1b 77 69 64  |r%=title$.3..wid|
00009170  74 68 25 3d 28 a9 28 74  69 74 6c 65 24 29 2d 32  |th%=(.(title$)-2|
00009180  29 2a 31 36 0d 33 b8 22  63 75 72 72 65 6e 74 6d  |)*16.3."currentm|
00009190  65 6e 75 70 74 72 25 21  31 32 20 3d 20 26 30 30  |enuptr%!12 = &00|
000091a0  30 37 30 32 30 37 0d 33  c2 19 63 75 72 72 65 6e  |070207.3..curren|
000091b0  74 6d 65 6e 75 70 74 72  25 21 32 30 3d 34 34 0d  |tmenuptr%!20=44.|
000091c0  33 cc 18 63 75 72 72 65  6e 74 6d 65 6e 75 70 74  |3..currentmenupt|
000091d0  72 25 21 32 34 3d 30 0d  33 d6 1b 70 74 72 25 3d  |r%!24=0.3..ptr%=|
000091e0  63 75 72 72 65 6e 74 6d  65 6e 75 70 74 72 25 2b  |currentmenuptr%+|
000091f0  32 38 0d 33 e0 04 0d 33  ea 0b 6e 65 78 74 25 3d  |28.3...3..next%=|
00009200  30 0d 33 f4 1a 47 6c 6f  62 61 6c 4d 65 6e 75 49  |0.3..GlobalMenuI|
00009210  74 65 6d 43 6f 75 6e 74  25 3d 30 0d 33 fe 19 47  |temCount%=0.3..G|
00009220  6c 6f 62 61 6c 4d 65 6e  75 53 65 70 43 6f 75 6e  |lobalMenuSepCoun|
00009230  74 25 3d 30 0d 34 08 21  4e 75 6d 62 65 72 4f 66  |t%=0.4.!NumberOf|
00009240  4c 69 6e 6b 73 25 3d 6e  75 6d 62 65 72 6f 66 69  |Links%=numberofi|
00009250  74 65 6d 73 25 0d 34 12  04 0d 34 1c 2a c8 95 20  |tems%.4...4.*.. |
00009260  28 6e 65 78 74 25 3c 4e  75 6d 62 65 72 4f 66 4c  |(next%<NumberOfL|
00009270  69 6e 6b 73 25 20 80 20  44 69 72 53 63 61 6e 25  |inks% . DirScan%|
00009280  3d b9 29 0d 34 26 13 4b  65 65 70 4d 65 6e 75 49  |=.).4&.KeepMenuI|
00009290  74 65 6d 25 3d b9 0d 34  30 14 56 61 6c 69 64 4c  |tem%=..40.ValidL|
000092a0  6f 61 64 46 6c 61 67 25  3d b9 0d 34 3a 15 55 73  |oadFlag%=..4:.Us|
000092b0  65 4c 61 72 67 65 53 70  72 69 74 65 25 3d a3 0d  |eLargeSprite%=..|
000092c0  34 44 2f c8 99 20 22 4f  53 5f 47 42 50 42 22 2c  |4D/.. "OS_GBPB",|
000092d0  31 30 2c 64 69 72 24 2c  64 62 6c 6f 63 6b 25 2c  |10,dir$,dblock%,|
000092e0  31 2c 6e 65 78 74 25 2c  36 33 2c 22 2a 22 0d 34  |1,next%,63,"*".4|
000092f0  4e 0c 6e 65 78 74 25 2b  3d 31 0d 34 58 0e 6c 6f  |N.next%+=1.4X.lo|
00009300  63 61 6c 69 25 3d 69 25  0d 34 62 2f f4 20 47 65  |cali%=i%.4b/. Ge|
00009310  74 20 4f 62 6a 65 63 74  20 74 79 70 65 20 28 32  |t Object type (2|
00009320  20 3d 20 64 69 72 65 63  74 6f 72 79 2c 20 31 20  | = directory, 1 |
00009330  3d 20 66 69 6c 65 29 0d  34 6c 17 74 79 70 65 25  |= file).4l.type%|
00009340  20 3d 20 64 62 6c 6f 63  6b 25 3f 26 31 30 0d 34  | = dblock%?&10.4|
00009350  76 1d f4 20 47 65 74 20  6e 61 6d 65 20 6f 66 20  |v.. Get name of |
00009360  74 68 69 73 20 6f 62 6a  65 63 74 0d 34 80 1f 69  |this object.4..i|
00009370  74 65 6d 24 3d a4 67 65  74 6e 61 6d 65 28 64 62  |tem$=.getname(db|
00009380  6c 6f 63 6b 25 2b 26 31  34 29 0d 34 8a 19 f4 20  |lock%+&14).4... |
00009390  47 65 74 20 66 69 6c 65  20 61 74 74 72 69 62 75  |Get file attribu|
000093a0  74 65 73 0d 34 94 22 66  69 6c 65 74 79 70 65 69  |tes.4."filetypei|
000093b0  6e 66 6f 25 3d 20 21 64  62 6c 6f 63 6b 25 20 3e  |nfo%= !dblock% >|
000093c0  3e 3e 20 32 30 0d 34 9e  23 66 69 6c 65 74 79 70  |>> 20.4.#filetyp|
000093d0  65 25 3d 28 21 64 62 6c  6f 63 6b 25 20 3e 3e 20  |e%=(!dblock% >> |
000093e0  38 29 80 20 26 46 46 46  0d 34 a8 04 0d 34 b2 1c  |8). &FFF.4...4..|
000093f0  f4 20 49 6e 69 74 69 61  6c 69 73 65 20 6d 65 6e  |. Initialise men|
00009400  75 20 6f 62 6a 65 63 74  0d 34 bc 3a 21 70 74 72  |u object.4.:!ptr|
00009410  25 3d 38 3a f4 20 6d 66  6c 61 67 73 20 3d 20 26  |%=8:. mflags = &|
00009420  38 30 3d 4c 61 73 74 4d  65 6e 75 49 74 65 6d 20  |80=LastMenuItem |
00009430  26 38 3d 57 61 72 6e 53  75 62 6d 65 6e 75 4f 70  |&8=WarnSubmenuOp|
00009440  65 6e 0d 34 c6 23 70 74  72 25 21 34 3d 2d 31 3a  |en.4.#ptr%!4=-1:|
00009450  f4 20 70 6f 69 6e 74 65  72 20 74 6f 20 73 75 62  |. pointer to sub|
00009460  20 6d 65 6e 75 0d 34 d0  2d f4 20 53 74 6f 72 65  | menu.4.-. Store|
00009470  20 74 68 69 73 20 66 69  6c 65 72 20 6f 62 6a 65  | this filer obje|
00009480  63 74 2c 20 77 68 61 74  65 76 65 72 20 69 74 20  |ct, whatever it |
00009490  69 73 0d 34 da 33 21 28  73 68 6f 72 74 63 75 74  |is.4.3!(shortcut|
000094a0  6d 65 6e 75 64 61 74 61  25 2b 28 6c 6f 63 61 6c  |menudata%+(local|
000094b0  69 25 2a 36 34 29 2b 33  32 2b 32 38 29 20 3d 20  |i%*64)+32+28) = |
000094c0  74 79 70 65 25 0d 34 e4  04 0d 34 ee 21 f4 20 49  |type%.4...4.!. I|
000094d0  73 20 74 68 69 73 20 6f  62 6a 65 63 74 20 61 20  |s this object a |
000094e0  64 69 72 65 63 74 6f 72  79 3f 0d 34 f8 12 e7 20  |directory?.4... |
000094f0  28 74 79 70 65 25 20 3d  32 29 20 8c 0d 35 02 28  |(type% =2) ..5.(|
00009500  20 f4 20 49 66 20 73 6f  2c 20 74 68 65 6e 20 61  | . If so, then a|
00009510  64 64 20 74 6f 20 64 69  72 65 63 74 6f 72 79 20  |dd to directory |
00009520  6c 69 73 74 0d 35 0c 3a  20 24 28 73 68 6f 72 74  |list.5.: $(short|
00009530  63 75 74 6d 65 6e 75 64  61 74 61 25 2b 28 6c 6f  |cutmenudata%+(lo|
00009540  63 61 6c 69 25 2a 36 34  29 2b 33 32 29 20 3d 20  |cali%*64)+32) = |
00009550  69 74 65 6d 73 70 72 69  74 65 24 2b bd 30 0d 35  |itemsprite$+.0.5|
00009560  16 2f 20 70 74 72 25 21  34 20 3d 20 6e 65 78 74  |./ ptr%!4 = next|
00009570  6d 65 6e 75 70 74 72 25  3a f4 20 50 6f 69 6e 74  |menuptr%:. Point|
00009580  65 72 20 74 6f 20 73 75  62 6d 65 6e 75 0d 35 20  |er to submenu.5 |
00009590  06 20 cc 0d 35 2a 29 20  f4 20 54 68 69 73 20 69  |. ..5*) . This i|
000095a0  73 20 61 20 6c 69 6e 6b  20 61 6e 64 20 6e 6f 74  |s a link and not|
000095b0  20 61 20 64 69 72 65 63  74 6f 72 79 0d 35 34 2c  | a directory.54,|
000095c0  20 f4 20 20 50 52 4f 43  65 72 72 6f 72 28 22 50  | .  PROCerror("P|
000095d0  72 6f 63 65 73 73 69 6e  67 20 22 2b 69 74 65 6d  |rocessing "+item|
000095e0  24 2b 43 48 52 24 30 29  0d 35 3e 22 20 f4 20 47  |$+CHR$0).5>" . G|
000095f0  65 74 20 66 69 6c 65 74  79 70 65 20 6f 66 20 6c  |et filetype of l|
00009600  69 6e 6b 20 6f 62 6a 65  63 74 0d 35 48 31 20 24  |ink object.5H1 $|
00009610  73 74 72 69 6e 67 25 3d  a4 47 65 74 4c 69 6e 6b  |string%=.GetLink|
00009620  43 6f 6e 74 65 6e 74 73  28 64 69 72 24 2b 22 2e  |Contents(dir$+".|
00009630  22 2b 69 74 65 6d 24 29  2b bd 30 0d 35 52 05 20  |"+item$)+.0.5R. |
00009640  0d 35 5c 30 20 e7 20 28  a4 43 68 65 63 6b 56 61  |.5\0 . (.CheckVa|
00009650  6c 69 64 44 72 69 76 65  28 a4 73 74 72 69 6e 67  |lidDrive(.string|
00009660  28 73 74 72 69 6e 67 25  29 29 20 3d 31 29 20 8c  |(string%)) =1) .|
00009670  0d 35 66 3a 20 20 c8 99  20 22 4f 53 5f 46 69 6c  |.5f:  .. "OS_Fil|
00009680  65 22 2c 31 37 2c 73 74  72 69 6e 67 25 20 b8 20  |e",17,string% . |
00009690  6f 62 6a 65 63 74 74 79  70 65 25 2c 2c 6c 69 6e  |objecttype%,,lin|
000096a0  6b 6c 6f 61 64 61 64 64  72 25 0d 35 70 29 20 20  |kloadaddr%.5p)  |
000096b0  6c 69 6e 6b 74 79 70 65  25 3d 28 6c 69 6e 6b 6c  |linktype%=(linkl|
000096c0  6f 61 64 61 64 64 72 25  3e 3e 38 29 20 80 20 26  |oadaddr%>>8) . &|
000096d0  46 46 46 0d 35 7a 29 20  20 6c 69 6e 6b 74 79 70  |FFF.5z)  linktyp|
000096e0  65 69 6e 66 6f 25 3d 20  6c 69 6e 6b 6c 6f 61 64  |einfo%= linkload|
000096f0  61 64 64 72 25 20 3e 3e  3e 20 32 30 0d 35 84 06  |addr% >>> 20.5..|
00009700  20 cc 0d 35 8e 13 20 20  6f 62 6a 65 63 74 74 79  | ..5..  objectty|
00009710  70 65 25 3d 30 0d 35 98  06 20 cd 0d 35 a2 55 20  |pe%=0.5.. ..5.U |
00009720  f4 50 52 4f 43 65 72 72  6f 72 28 46 4e 47 65 74  |.PROCerror(FNGet|
00009730  4c 69 6e 6b 43 6f 6e 74  65 6e 74 73 28 64 69 72  |LinkContents(dir|
00009740  24 2b 22 2e 22 2b 69 74  65 6d 24 29 2b 22 20 69  |$+"."+item$)+" i|
00009750  73 20 61 20 22 2b 53 54  52 24 28 6c 69 6e 6b 74  |s a "+STR$(linkt|
00009760  79 70 65 69 6e 66 6f 25  29 2b 43 48 52 24 30 29  |ypeinfo%)+CHR$0)|
00009770  0d 35 ac 18 20 e7 20 28  6f 62 6a 65 63 74 74 79  |.5.. . (objectty|
00009780  70 65 25 3d 30 29 20 8c  0d 35 b6 59 20 20 f4 20  |pe%=0) ..5.Y  . |
00009790  50 52 4f 43 65 72 72 6f  72 28 22 45 72 72 6f 72  |PROCerror("Error|
000097a0  20 3a 20 4c 69 6e 6b 28  22 2b 46 4e 47 65 74 4c  | : Link("+FNGetL|
000097b0  69 6e 6b 43 6f 6e 74 65  6e 74 73 28 64 69 72 24  |inkContents(dir$|
000097c0  2b 22 2e 22 2b 69 74 65  6d 24 29 2b 22 29 20 6e  |+"."+item$)+") n|
000097d0  6f 74 20 66 6f 75 6e 64  2e 22 2b 43 48 52 24 30  |ot found."+CHR$0|
000097e0  29 0d 35 c0 31 20 20 f4  20 44 65 6c 65 74 65 20  |).5.1  . Delete |
000097f0  74 68 69 73 20 6c 69 6e  6b 20 61 6e 64 20 72 65  |this link and re|
00009800  73 63 61 6e 20 74 68 65  20 64 69 72 65 63 74 6f  |scan the directo|
00009810  72 79 0d 35 ca 3d 20 20  f4 20 53 61 66 65 74 79  |ry.5.=  . Safety|
00009820  20 66 69 72 73 74 20 2d  20 65 6e 73 75 72 65 20  | first - ensure |
00009830  74 68 69 73 20 66 69 6c  65 20 69 73 20 61 63 74  |this file is act|
00009840  75 61 6c 6c 79 20 61 20  6c 69 6e 6b 20 69 6e 0d  |ually a link in.|
00009850  35 d4 44 20 20 f4 20 63  61 73 65 20 74 68 65 20  |5.D  . case the |
00009860  3c 58 75 65 6e 62 73 24  44 69 72 3e 20 73 79 73  |<Xuenbs$Dir> sys|
00009870  74 65 6d 20 76 61 72 69  61 62 6c 65 20 68 61 73  |tem variable has|
00009880  20 62 65 63 6f 6d 65 20  63 6f 72 72 75 70 74 20  | become corrupt |
00009890  28 21 29 0d 35 de 1a 20  20 e7 20 28 66 69 6c 65  |(!).5..  . (file|
000098a0  74 79 70 65 25 3d 26 61  66 33 29 20 8c 0d 35 e8  |type%=&af3) ..5.|
000098b0  71 20 20 20 f4 20 50 52  4f 43 65 72 72 6f 72 28  |q   . PROCerror(|
000098c0  22 49 6e 76 61 6c 69 64  20 6c 69 6e 6b 20 22 2b  |"Invalid link "+|
000098d0  64 69 72 24 2b 22 2e 22  2b 69 74 65 6d 24 2b 22  |dir$+"."+item$+"|
000098e0  20 68 61 73 20 62 65 65  6e 20 66 6f 75 6e 64 20  | has been found |
000098f0  61 6e 64 20 77 69 6c 6c  20 62 65 20 64 65 6c 65  |and will be dele|
00009900  74 65 64 20 77 68 65 6e  20 79 6f 75 20 63 6c 69  |ted when you cli|
00009910  63 6b 20 4f 4b 2e 22 2b  43 48 52 24 30 29 0d 35  |ck OK."+CHR$0).5|
00009920  f2 25 20 20 20 ff 28 22  64 65 6c 65 74 65 20 22  |.%   .("delete "|
00009930  2b 64 69 72 24 2b 22 2e  22 2b 69 74 65 6d 24 2b  |+dir$+"."+item$+|
00009940  bd 30 29 0d 35 fc 11 20  20 20 44 69 72 53 63 61  |.0).5..   DirSca|
00009950  6e 25 3d a3 0d 36 06 17  20 20 20 56 61 6c 69 64  |n%=..6..   Valid|
00009960  4c 6f 61 64 46 6c 61 67  25 3d a3 0d 36 10 08 20  |LoadFlag%=..6.. |
00009970  20 20 cc 0d 36 1a fb 20  20 20 f2 65 72 72 6f 72  |  ..6..   .error|
00009980  28 22 45 72 72 6f 72 3a  20 41 6e 6f 74 68 65 72  |("Error: Another|
00009990  20 70 72 6f 67 20 68 61  73 20 61 6c 74 65 72 65  | prog has altere|
000099a0  64 20 74 68 65 20 3c 58  75 65 6e 62 73 24 44 69  |d the <Xuenbs$Di|
000099b0  72 3e 20 73 79 73 74 65  6d 20 76 61 72 69 61 62  |r> system variab|
000099c0  6c 65 20 6f 72 20 73 6f  6d 65 6f 6e 65 20 68 61  |le or someone ha|
000099d0  73 20 70 6c 61 63 65 64  20 61 20 6e 6f 6e 2d 6c  |s placed a non-l|
000099e0  69 6e 6b 20 22 2b 64 69  72 24 2b 22 2e 22 2b 69  |ink "+dir$+"."+i|
000099f0  74 65 6d 24 2b 22 20 69  6e 74 6f 20 74 68 65 20  |tem$+" into the |
00009a00  6c 69 6e 6b 73 20 64 69  72 65 63 74 6f 72 79 2e  |links directory.|
00009a10  20 52 65 72 75 6e 20 74  68 65 20 21 58 75 65 6e  | Rerun the !Xuen|
00009a20  20 61 70 70 6c 69 63 61  74 69 6f 6e 20 6f 72 20  | application or |
00009a30  72 65 6d 6f 76 65 20 74  68 65 20 6f 66 66 65 6e  |remove the offen|
00009a40  64 69 6e 67 20 66 69 6c  65 20 66 72 6f 6d 20 74  |ding file from t|
00009a50  68 65 20 21 58 75 65 6e  2e 4c 69 6e 6b 73 20 64  |he !Xuen.Links d|
00009a60  69 72 65 63 74 6f 72 79  2e 22 2b bd 30 29 0d 36  |irectory."+.0).6|
00009a70  24 07 20 20 cd 0d 36 2e  07 20 20 cd 0d 36 38 05  |$.  ..6..  ..68.|
00009a80  20 0d 36 42 18 20 e7 20  28 6f 62 6a 65 63 74 74  | .6B. . (objectt|
00009a90  79 70 65 25 3d 31 29 20  8c 0d 36 4c 28 20 20 f4  |ype%=1) ..6L(  .|
00009aa0  20 54 68 69 73 20 6c 69  6e 6b 20 69 73 20 61 20  | This link is a |
00009ab0  70 6f 69 6e 74 65 72 20  74 6f 20 61 20 66 69 6c  |pointer to a fil|
00009ac0  65 0d 36 56 37 20 20 f4  20 50 52 4f 43 65 72 72  |e.6V7  . PROCerr|
00009ad0  6f 72 28 46 4e 73 74 72  69 6e 67 28 73 74 72 69  |or(FNstring(stri|
00009ae0  6e 67 25 29 2b 22 20 69  73 20 61 20 66 69 6c 65  |ng%)+" is a file|
00009af0  22 2b 43 48 52 24 30 29  0d 36 60 57 20 20 24 28  |"+CHR$0).6`W  $(|
00009b00  73 68 6f 72 74 63 75 74  6d 65 6e 75 64 61 74 61  |shortcutmenudata|
00009b10  25 2b 28 6c 6f 63 61 6c  69 25 2a 36 34 29 2b 33  |%+(locali%*64)+3|
00009b20  32 29 20 3d 20 22 53 73  6d 61 6c 6c 5f 22 2b c3  |2) = "Ssmall_"+.|
00009b30  7e 28 6c 69 6e 6b 74 79  70 65 25 29 2b 22 3b 22  |~(linktype%)+";"|
00009b40  2b 69 74 65 6d 73 70 72  69 74 65 24 2b bd 30 0d  |+itemsprite$+.0.|
00009b50  36 6a 2f 20 20 e7 20 ac  28 a4 53 70 72 69 74 65  |6j/  . .(.Sprite|
00009b60  45 78 69 73 74 28 22 73  6d 61 6c 6c 5f 22 2b c3  |Exist("small_"+.|
00009b70  7e 6c 69 6e 6b 74 79 70  65 25 29 29 20 8c 0d 36  |~linktype%)) ..6|
00009b80  74 40 20 20 20 f4 20 53  6d 61 6c 6c 20 69 63 6f  |t@   . Small ico|
00009b90  6e 20 64 6f 6e 27 74 20  65 78 69 73 74 20 2d 20  |n don't exist - |
00009ba0  75 73 65 20 6c 61 72 67  65 20 74 79 70 65 20 61  |use large type a|
00009bb0  6e 64 20 66 6c 61 67 20  69 74 20 73 6f 2e 0d 36  |nd flag it so..6|
00009bc0  7e 6e 20 20 20 24 28 73  68 6f 72 74 63 75 74 6d  |~n   $(shortcutm|
00009bd0  65 6e 75 64 61 74 61 25  2b 28 6c 6f 63 61 6c 69  |enudata%+(locali|
00009be0  25 2a 36 34 29 2b 33 32  29 20 3d 20 22 53 66 69  |%*64)+32) = "Sfi|
00009bf0  6c 65 5f 22 2b c3 7e 28  6c 69 6e 6b 74 79 70 65  |le_"+.~(linktype|
00009c00  25 29 2b 22 3b 22 2b 69  74 65 6d 73 70 72 69 74  |%)+";"+itemsprit|
00009c10  65 24 2b bd 30 3a 55 73  65 4c 61 72 67 65 53 70  |e$+.0:UseLargeSp|
00009c20  72 69 74 65 25 3d b9 20  20 20 20 20 0d 36 88 07  |rite%=.     .6..|
00009c30  20 20 cd 0d 36 92 06 20  20 0d 36 9c 06 20 cd 0d  |  ..6..  .6.. ..|
00009c40  36 a6 04 0d 36 b0 3d 20  f4 20 46 6f 72 20 73 6f  |6...6.= . For so|
00009c50  6d 65 20 77 69 65 72 64  20 72 65 61 73 6f 6e 20  |me wierd reason |
00009c60  74 68 65 20 66 6f 6c 6c  6f 77 69 6e 67 20 74 77  |the following tw|
00009c70  6f 20 76 61 72 69 61 62  6c 65 73 20 6d 75 73 74  |o variables must|
00009c80  0d 36 ba 3b 20 f4 20 62  65 20 65 76 61 6c 75 61  |.6.; . be evalua|
00009c90  74 65 64 20 6f 75 74 73  69 64 65 20 6f 66 20 74  |ted outside of t|
00009ca0  68 65 20 6f 62 6a 65 63  74 74 79 70 65 20 74 65  |he objecttype te|
00009cb0  73 74 2e 20 49 20 74 68  69 6e 6b 0d 36 c4 3c 20  |st. I think.6.< |
00009cc0  f4 20 69 74 20 6d 75 73  74 20 62 65 20 73 6f 6d  |. it must be som|
00009cd0  65 74 68 69 6e 67 20 74  6f 20 64 6f 20 77 69 74  |ething to do wit|
00009ce0  68 20 74 68 65 20 70 69  70 65 6c 69 6e 65 20 61  |h the pipeline a|
00009cf0  6e 64 2f 6f 72 20 61 0d  36 ce 1c 20 f4 20 62 75  |nd/or a.6.. . bu|
00009d00  67 20 69 6e 20 74 68 65  20 42 41 53 49 43 20 72  |g in the BASIC r|
00009d10  6f 6d 2e 0d 36 d8 13 20  73 68 72 69 65 6b 25 3d  |om..6.. shriek%=|
00009d20  97 28 22 21 22 29 0d 36  e2 1c 20 6e 61 6d 65 73  |.("!").6.. names|
00009d30  74 61 72 74 25 3d 97 28  c0 69 74 65 6d 24 2c 31  |tart%=.(.item$,1|
00009d40  29 29 0d 36 ec 18 20 e7  20 28 6f 62 6a 65 63 74  |)).6.. . (object|
00009d50  74 79 70 65 25 3d 32 29  20 8c 0d 36 f6 3d 20 20  |type%=2) ..6.=  |
00009d60  f4 20 54 68 69 73 20 6c  69 6e 6b 20 69 73 20 61  |. This link is a|
00009d70  20 70 6f 69 6e 74 65 72  20 74 6f 20 61 6e 20 61  | pointer to an a|
00009d80  70 70 6c 69 63 61 74 69  6f 6e 20 6f 72 20 64 69  |pplication or di|
00009d90  72 65 63 74 6f 72 79 0d  37 00 1f 20 20 e7 20 28  |rectory.7..  . (|
00009da0  6e 61 6d 65 73 74 61 72  74 25 3c 3e 73 68 72 69  |namestart%<>shri|
00009db0  65 6b 25 29 20 8c 0d 37  0a 4a 20 20 20 24 28 73  |ek%) ..7.J   $(s|
00009dc0  68 6f 72 74 63 75 74 6d  65 6e 75 64 61 74 61 25  |hortcutmenudata%|
00009dd0  2b 28 6c 6f 63 61 6c 69  25 2a 36 34 29 2b 33 32  |+(locali%*64)+32|
00009de0  29 20 3d 20 22 53 73 6d  61 6c 6c 5f 64 69 72 3b  |) = "Ssmall_dir;|
00009df0  22 2b 69 74 65 6d 73 70  72 69 74 65 24 2b bd 30  |"+itemsprite$+.0|
00009e00  0d 37 14 08 20 20 20 cc  0d 37 1e 4c 20 20 20 24  |.7..   ..7.L   $|
00009e10  28 73 68 6f 72 74 63 75  74 6d 65 6e 75 64 61 74  |(shortcutmenudat|
00009e20  61 25 2b 28 6c 6f 63 61  6c 69 25 2a 36 34 29 2b  |a%+(locali%*64)+|
00009e30  33 32 29 20 3d 20 22 53  73 6d 22 2b 69 74 65 6d  |32) = "Ssm"+item|
00009e40  24 2b 22 3b 22 2b 69 74  65 6d 73 70 72 69 74 65  |$+";"+itemsprite|
00009e50  24 2b bd 30 0d 37 28 26  20 20 20 e7 20 ac 28 a4  |$+.0.7(&   . .(.|
00009e60  53 70 72 69 74 65 45 78  69 73 74 28 22 73 6d 22  |SpriteExist("sm"|
00009e70  2b 69 74 65 6d 24 29 29  20 8c 0d 37 32 41 20 20  |+item$)) ..72A  |
00009e80  20 20 f4 20 53 6d 61 6c  6c 20 69 63 6f 6e 20 64  |  . Small icon d|
00009e90  6f 6e 27 74 20 65 78 69  73 74 20 2d 20 75 73 65  |on't exist - use|
00009ea0  20 6c 61 72 67 65 20 74  79 70 65 20 61 6e 64 20  | large type and |
00009eb0  66 6c 61 67 20 69 74 20  73 6f 2e 0d 37 3c 62 20  |flag it so..7<b |
00009ec0  20 20 20 24 28 73 68 6f  72 74 63 75 74 6d 65 6e  |   $(shortcutmen|
00009ed0  75 64 61 74 61 25 2b 28  6c 6f 63 61 6c 69 25 2a  |udata%+(locali%*|
00009ee0  36 34 29 2b 33 32 29 20  3d 20 22 53 22 2b 69 74  |64)+32) = "S"+it|
00009ef0  65 6d 24 2b 22 3b 22 2b  69 74 65 6d 73 70 72 69  |em$+";"+itemspri|
00009f00  74 65 24 2b bd 30 3a 55  73 65 4c 61 72 67 65 53  |te$+.0:UseLargeS|
00009f10  70 72 69 74 65 25 3d b9  20 20 20 20 20 0d 37 46  |prite%=.     .7F|
00009f20  08 20 20 20 cd 0d 37 50  07 20 20 cd 0d 37 5a 06  |.   ..7P.  ..7Z.|
00009f30  20 cd 0d 37 64 04 0d 37  6e 05 cd 0d 37 78 04 0d  | ..7d..7n...7x..|
00009f40  37 82 28 f4 20 42 75 69  6c 64 20 72 65 73 74 20  |7.(. Build rest |
00009f50  6f 66 20 6d 65 6e 75 20  69 74 65 6d 20 61 74 74  |of menu item att|
00009f60  72 69 62 75 74 65 73 0d  37 8c 1f 70 74 72 25 21  |ributes.7..ptr%!|
00009f70  38 3d 26 37 30 30 30 33  31 33 3a f4 20 69 63 6f  |8=&7000313:. ico|
00009f80  6e 20 74 79 70 65 0d 37  96 40 f4 20 49 46 20 28  |n type.7.@. IF (|
00009f90  74 79 70 65 25 3d 32 20  41 4e 44 20 6f 62 6a 65  |type%=2 AND obje|
00009fa0  63 74 74 79 70 65 25 3d  30 29 20 70 74 72 25 21  |cttype%=0) ptr%!|
00009fb0  38 3d 26 37 34 30 30 33  31 33 3a 52 45 4d 20 49  |8=&7400313:REM I|
00009fc0  6e 76 61 6c 69 64 0d 37  a0 14 e7 20 28 61 64 64  |nvalid.7... (add|
00009fd0  6c 69 6e 6b 25 3d 31 29  20 8c 0d 37 aa 14 20 70  |link%=1) ..7.. p|
00009fe0  74 72 25 21 38 3d 26 33  30 30 30 33 31 33 0d 37  |tr%!8=&3000313.7|
00009ff0  b4 05 cd 0d 37 be 2e e7  20 28 55 73 65 4c 61 72  |....7... (UseLar|
0000a000  67 65 53 70 72 69 74 65  25 29 20 70 74 72 25 21  |geSprite%) ptr%!|
0000a010  38 20 3d 20 28 70 74 72  25 21 38 29 2b 26 38 30  |8 = (ptr%!8)+&80|
0000a020  30 0d 37 c8 2e 24 28 73  68 6f 72 74 63 75 74 6d  |0.7..$(shortcutm|
0000a030  65 6e 75 64 61 74 61 25  2b 28 6c 6f 63 61 6c 69  |enudata%+(locali|
0000a040  25 2a 36 34 29 29 3d 69  74 65 6d 24 2b bd 30 0d  |%*64))=item$+.0.|
0000a050  37 d2 2c 70 74 72 25 21  31 32 20 3d 20 73 68 6f  |7.,ptr%!12 = sho|
0000a060  72 74 63 75 74 6d 65 6e  75 64 61 74 61 25 2b 28  |rtcutmenudata%+(|
0000a070  6c 6f 63 61 6c 69 25 2a  36 34 29 0d 37 dc 2f 70  |locali%*64).7./p|
0000a080  74 72 25 21 31 36 20 3d  20 73 68 6f 72 74 63 75  |tr%!16 = shortcu|
0000a090  74 6d 65 6e 75 64 61 74  61 25 2b 28 6c 6f 63 61  |tmenudata%+(loca|
0000a0a0  6c 69 25 2a 36 34 29 2b  33 32 0d 37 e6 35 70 74  |li%*64)+32.7.5pt|
0000a0b0  72 25 21 32 30 20 3d 20  32 38 3a f4 20 6d 65 6e  |r%!20 = 28:. men|
0000a0c0  75 20 69 74 65 6d 20 73  74 72 69 6e 67 20 62 75  |u item string bu|
0000a0d0  66 66 65 72 20 3d 20 32  38 20 62 79 74 65 73 0d  |ffer = 28 bytes.|
0000a0e0  37 f0 04 0d 37 fa 31 f4  20 41 72 65 20 77 65 20  |7...7.1. Are we |
0000a0f0  64 65 61 6c 69 6e 67 20  77 69 74 68 20 61 6e 79  |dealing with any|
0000a100  20 7e 20 6f 72 20 7e 7e  20 66 69 6c 65 6e 61 6d  | ~ or ~~ filenam|
0000a110  65 73 20 3f 0d 38 04 36  e7 20 28 6c 69 6e 6b 64  |es ?.8.6. (linkd|
0000a120  65 70 74 68 25 3d 30 20  80 20 c1 69 74 65 6d 24  |epth%=0 . .item$|
0000a130  2c 31 2c 31 29 3d bd 28  53 79 73 46 69 6c 65 50  |,1,1)=.(SysFileP|
0000a140  72 65 66 69 78 25 29 29  20 8c 0d 38 0e 04 0d 38  |refix%)) ..8...8|
0000a150  18 20 20 f4 20 53 69 6e  67 6c 65 20 7e 20 70 72  |.  . Single ~ pr|
0000a160  65 66 69 78 20 66 69 6c  65 6e 61 6d 65 73 0d 38  |efix filenames.8|
0000a170  22 29 20 e7 20 28 c1 69  74 65 6d 24 2c 32 2c 31  |") . (.item$,2,1|
0000a180  29 3c 3e bd 28 53 79 73  46 69 6c 65 50 72 65 66  |)<>.(SysFilePref|
0000a190  69 78 25 29 29 20 8c 0d  38 2c 21 20 20 e7 20 28  |ix%)) ..8,!  . (|
0000a1a0  53 74 61 72 74 4d 65 6e  75 53 65 70 65 72 61 74  |StartMenuSeperat|
0000a1b0  6f 72 25 3c 30 29 20 8c  0d 38 36 22 20 20 20 53  |or%<0) ..86"   S|
0000a1c0  74 61 72 74 4d 65 6e 75  53 65 70 65 72 61 74 6f  |tartMenuSeperato|
0000a1d0  72 25 3d 6c 6f 63 61 6c  69 25 0d 38 40 34 20 20  |r%=locali%.8@4  |
0000a1e0  20 f4 20 44 6f 65 73 20  74 68 69 73 20 69 74 65  | . Does this ite|
0000a1f0  6d 20 6e 65 65 64 20 61  20 64 6f 74 74 65 64 20  |m need a dotted |
0000a200  6c 69 6e 65 20 61 62 6f  76 65 20 69 74 3f 0d 38  |line above it?.8|
0000a210  4a 16 20 20 20 e7 20 28  6c 6f 63 61 6c 69 25 3e  |J.   . (locali%>|
0000a220  30 29 20 8c 0d 38 54 23  20 20 20 20 21 28 70 74  |0) ..8T#    !(pt|
0000a230  72 25 2d 32 34 29 3d 28  21 28 70 74 72 25 2d 32  |r%-24)=(!(ptr%-2|
0000a240  34 29 29 20 2b 20 32 0d  38 5e 1e 20 20 20 20 47  |4)) + 2.8^.    G|
0000a250  6c 6f 62 61 6c 4d 65 6e  75 53 65 70 43 6f 75 6e  |lobalMenuSepCoun|
0000a260  74 25 2b 3d 31 0d 38 68  08 20 20 20 cd 0d 38 72  |t%+=1.8h.   ..8r|
0000a270  07 20 20 cd 0d 38 7c 42  20 f4 49 46 20 28 6c 6f  |.  ..8|B .IF (lo|
0000a280  63 61 6c 69 25 3e 3d 53  74 61 72 74 4d 65 6e 75  |cali%>=StartMenu|
0000a290  53 65 70 65 72 61 74 6f  72 25 20 41 4e 44 20 53  |Seperator% AND S|
0000a2a0  74 61 72 74 4d 65 6e 75  53 65 70 65 72 61 74 6f  |tartMenuSeperato|
0000a2b0  72 25 3e 3d 30 29 0d 38  86 3c 20 24 28 73 68 6f  |r%>=0).8.< $(sho|
0000a2c0  72 74 63 75 74 6d 65 6e  75 64 61 74 61 25 2b 28  |rtcutmenudata%+(|
0000a2d0  6c 6f 63 61 6c 69 25 2a  36 34 29 29 3d c2 69 74  |locali%*64))=.it|
0000a2e0  65 6d 24 2c a9 28 69 74  65 6d 24 29 2d 31 29 2b  |em$,.(item$)-1)+|
0000a2f0  bd 30 0d 38 90 25 20 f4  20 53 74 61 72 74 4d 65  |.0.8.% . StartMe|
0000a300  6e 75 53 65 70 65 72 61  74 6f 72 32 25 3d 6c 6f  |nuSeperator2%=lo|
0000a310  63 61 6c 69 25 2b 31 0d  38 9a 06 20 cd 0d 38 a4  |cali%+1.8.. ..8.|
0000a320  06 20 20 0d 38 ae 20 20  f4 20 44 6f 75 62 6c 65  |.  .8.  . Double|
0000a330  20 7e 20 70 72 65 66 69  78 20 66 69 6c 65 6e 61  | ~ prefix filena|
0000a340  6d 65 73 0d 38 b8 28 20  e7 20 28 c1 69 74 65 6d  |mes.8.( . (.item|
0000a350  24 2c 32 2c 31 29 3d bd  28 53 79 73 46 69 6c 65  |$,2,1)=.(SysFile|
0000a360  50 72 65 66 69 78 25 29  29 20 8c 0d 38 c2 25 20  |Prefix%)) ..8.% |
0000a370  20 e7 20 28 47 6c 6f 62  61 6c 53 68 6f 77 42 6f  | . (GlobalShowBo|
0000a380  6f 74 4d 65 6e 75 46 6c  61 67 25 3d 30 29 20 8c  |otMenuFlag%=0) .|
0000a390  0d 38 cc 16 20 20 20 4b  65 65 70 4d 65 6e 75 49  |.8..   KeepMenuI|
0000a3a0  74 65 6d 25 3d a3 0d 38  d6 08 20 20 20 cc 0d 38  |tem%=..8..   ..8|
0000a3b0  e0 23 20 20 20 e7 20 28  53 74 61 72 74 4d 65 6e  |.#   . (StartMen|
0000a3c0  75 53 65 70 65 72 61 74  6f 72 32 25 3c 30 29 20  |uSeperator2%<0) |
0000a3d0  8c 0d 38 ea 24 20 20 20  20 53 74 61 72 74 4d 65  |..8.$    StartMe|
0000a3e0  6e 75 53 65 70 65 72 61  74 6f 72 32 25 3d 6c 6f  |nuSeperator2%=lo|
0000a3f0  63 61 6c 69 25 0d 38 f4  35 20 20 20 20 f4 20 44  |cali%.8.5    . D|
0000a400  6f 65 73 20 74 68 69 73  20 69 74 65 6d 20 6e 65  |oes this item ne|
0000a410  65 64 20 61 20 64 6f 74  74 65 64 20 6c 69 6e 65  |ed a dotted line|
0000a420  20 61 62 6f 76 65 20 69  74 3f 0d 38 fe 15 20 20  | above it?.8..  |
0000a430  20 20 e7 20 28 6c 6f 63  61 6c 69 25 3e 30 29 0d  |  . (locali%>0).|
0000a440  39 08 24 20 20 20 20 20  21 28 70 74 72 25 2d 32  |9.$     !(ptr%-2|
0000a450  34 29 3d 28 21 28 70 74  72 25 2d 32 34 29 29 20  |4)=(!(ptr%-24)) |
0000a460  2b 20 32 0d 39 12 1f 20  20 20 20 20 47 6c 6f 62  |+ 2.9..     Glob|
0000a470  61 6c 4d 65 6e 75 53 65  70 43 6f 75 6e 74 25 2b  |alMenuSepCount%+|
0000a480  3d 31 0d 39 1c 0a 20 20  20 20 20 cd 0d 39 26 08  |=1.9..     ..9&.|
0000a490  20 20 20 cd 0d 39 30 47  20 20 20 f4 20 49 46 20  |   ..90G   . IF |
0000a4a0  28 6c 6f 63 61 6c 69 25  3e 3d 53 74 61 72 74 4d  |(locali%>=StartM|
0000a4b0  65 6e 75 53 65 70 65 72  61 74 6f 72 32 25 20 41  |enuSeperator2% A|
0000a4c0  4e 44 20 53 74 61 72 74  4d 65 6e 75 53 65 70 65  |ND StartMenuSepe|
0000a4d0  72 61 74 6f 72 32 25 3e  3d 30 29 0d 39 3a 3e 20  |rator2%>=0).9:> |
0000a4e0  20 20 24 28 73 68 6f 72  74 63 75 74 6d 65 6e 75  |  $(shortcutmenu|
0000a4f0  64 61 74 61 25 2b 28 6c  6f 63 61 6c 69 25 2a 36  |data%+(locali%*6|
0000a500  34 29 29 3d c2 69 74 65  6d 24 2c a9 28 69 74 65  |4))=.item$,.(ite|
0000a510  6d 24 29 2d 32 29 2b bd  30 0d 39 44 25 20 20 20  |m$)-2)+.0.9D%   |
0000a520  53 74 61 72 74 4d 65 6e  75 53 65 70 65 72 61 74  |StartMenuSeperat|
0000a530  6f 72 33 25 3d 6c 6f 63  61 6c 69 25 2b 31 0d 39  |or3%=locali%+1.9|
0000a540  4e 08 20 20 20 cd 0d 39  58 07 20 20 cd 0d 39 62  |N.   ..9X.  ..9b|
0000a550  06 20 20 0d 39 6c 27 cd  3a f4 20 45 6e 64 20 6f  |.  .9l'.:. End o|
0000a560  66 20 27 41 72 65 20 77  65 20 64 65 61 6c 69 6e  |f 'Are we dealin|
0000a570  67 20 77 69 74 68 20 2e  2e 2e 0d 39 76 04 0d 39  |g with ....9v..9|
0000a580  80 17 e7 20 28 4b 65 65  70 4d 65 6e 75 49 74 65  |... (KeepMenuIte|
0000a590  6d 25 29 20 8c 0d 39 8a  17 20 61 25 3d 28 a9 28  |m%) ..9.. a%=(.(|
0000a5a0  69 74 65 6d 24 29 2b 34  29 2a 31 36 0d 39 94 1a  |item$)+4)*16.9..|
0000a5b0  20 e7 20 61 25 3e 77 69  64 74 68 25 20 77 69 64  | . a%>width% wid|
0000a5c0  74 68 25 3d 61 25 0d 39  9e 0d 20 70 74 72 25 2b  |th%=a%.9.. ptr%+|
0000a5d0  3d 32 34 0d 39 a8 0a 20  69 25 2b 3d 31 0d 39 b2  |=24.9.. i%+=1.9.|
0000a5e0  1d 20 47 6c 6f 62 61 6c  4d 65 6e 75 49 74 65 6d  |. GlobalMenuItem|
0000a5f0  43 6f 75 6e 74 25 20 2b  3d 31 0d 39 bc 05 cd 0d  |Count% +=1.9....|
0000a600  39 c6 05 ce 0d 39 d0 04  0d 39 da 3f f4 20 44 6f  |9....9...9.?. Do|
0000a610  20 77 65 20 6e 65 65 64  20 74 6f 20 61 64 64 20  | we need to add |
0000a620  61 6e 20 65 78 74 72 61  20 77 72 69 74 65 61 62  |an extra writeab|
0000a630  6c 65 20 69 63 6f 6e 20  6f 6e 20 65 6e 64 20 6f  |le icon on end o|
0000a640  66 20 6d 65 6e 75 3f 0d  39 e4 13 e7 20 28 61 64  |f menu?.9... (ad|
0000a650  64 77 72 69 74 65 25 29  20 8c 0d 39 e5 0f 20 6c  |dwrite%) ..9.. l|
0000a660  6f 63 61 6c 69 25 3d 69  25 0d 39 ee 10 20 69 74  |ocali%=i%.9.. it|
0000a670  65 6d 24 3d 22 4e 65 77  22 0d 39 f8 39 20 21 70  |em$="New".9.9 !p|
0000a680  74 72 25 3d 34 2b 26 38  30 3a f4 20 6d 66 6c 61  |tr%=4+&80:. mfla|
0000a690  67 73 20 3d 20 26 38 30  3d 4c 61 73 74 4d 65 6e  |gs = &80=LastMen|
0000a6a0  75 49 74 65 6d 20 26 34  3d 57 72 69 74 65 61 62  |uItem &4=Writeab|
0000a6b0  6c 65 0d 3a 02 24 20 70  74 72 25 21 34 3d 2d 31  |le.:.$ ptr%!4=-1|
0000a6c0  3a f4 20 70 6f 69 6e 74  65 72 20 74 6f 20 73 75  |:. pointer to su|
0000a6d0  62 20 6d 65 6e 75 0d 3a  04 22 20 70 74 72 25 21  |b menu.:." ptr%!|
0000a6e0  38 20 3d 20 26 37 32 30  30 31 31 31 3a f4 20 69  |8 = &7200111:. i|
0000a6f0  63 6f 6e 20 74 79 70 65  0d 3a 16 2f 20 24 28 73  |con type.:./ $(s|
0000a700  68 6f 72 74 63 75 74 6d  65 6e 75 64 61 74 61 25  |hortcutmenudata%|
0000a710  2b 28 6c 6f 63 61 6c 69  25 2a 36 34 29 29 3d 69  |+(locali%*64))=i|
0000a720  74 65 6d 24 2b bd 30 0d  3a 17 2c 20 24 28 73 68  |tem$+.0.:., $(sh|
0000a730  6f 72 74 63 75 74 6d 65  6e 75 64 61 74 61 25 2b  |ortcutmenudata%+|
0000a740  28 6c 6f 63 61 6c 69 25  2a 36 34 29 2b 33 32 29  |(locali%*64)+32)|
0000a750  3d bd 30 0d 3a 20 2d 20  70 74 72 25 21 31 32 20  |=.0.: - ptr%!12 |
0000a760  3d 20 73 68 6f 72 74 63  75 74 6d 65 6e 75 64 61  |= shortcutmenuda|
0000a770  74 61 25 2b 28 6c 6f 63  61 6c 69 25 2a 36 34 29  |ta%+(locali%*64)|
0000a780  0d 3a 2a 30 20 70 74 72  25 21 31 36 20 3d 20 73  |.:*0 ptr%!16 = s|
0000a790  68 6f 72 74 63 75 74 6d  65 6e 75 64 61 74 61 25  |hortcutmenudata%|
0000a7a0  2b 28 6c 6f 63 61 6c 69  25 2a 36 34 29 2b 33 32  |+(locali%*64)+32|
0000a7b0  0d 3a 34 36 20 70 74 72  25 21 32 30 20 3d 20 32  |.:46 ptr%!20 = 2|
0000a7c0  38 3a f4 20 6d 65 6e 75  20 69 74 65 6d 20 73 74  |8:. menu item st|
0000a7d0  72 69 6e 67 20 62 75 66  66 65 72 20 3d 20 32 38  |ring buffer = 28|
0000a7e0  20 62 79 74 65 73 0d 3a  35 17 20 61 25 3d 28 a9  | bytes.:5. a%=(.|
0000a7f0  28 69 74 65 6d 24 29 2b  34 29 2a 31 36 0d 3a d4  |(item$)+4)*16.:.|
0000a800  1a 20 e7 20 61 25 3e 77  69 64 74 68 25 20 77 69  |. . a%>width% wi|
0000a810  64 74 68 25 3d 61 25 0d  3a de 0d 20 70 74 72 25  |dth%=a%.:.. ptr%|
0000a820  2b 3d 32 34 0d 3a e8 0a  20 69 25 2b 3d 31 0d 3a  |+=24.:.. i%+=1.:|
0000a830  f2 1d 20 47 6c 6f 62 61  6c 4d 65 6e 75 49 74 65  |.. GlobalMenuIte|
0000a840  6d 43 6f 75 6e 74 25 20  2b 3d 31 0d 3a f3 16 20  |mCount% +=1.:.. |
0000a850  6e 75 6d 62 65 72 6f 66  69 74 65 6d 73 25 2b 3d  |numberofitems%+=|
0000a860  31 0d 3b 06 05 cd 0d 3b  10 04 0d 3b 1a 27 f4 20  |1.;....;...;.'. |
0000a870  48 61 73 20 74 68 69 73  20 6c 69 73 74 20 67 6f  |Has this list go|
0000a880  74 20 61 6e 79 74 68 69  6e 67 20 69 6e 20 69 74  |t anything in it|
0000a890  3f 0d 3b 24 1a e7 20 28  6e 75 6d 62 65 72 6f 66  |?.;$.. (numberof|
0000a8a0  69 74 65 6d 73 25 3e 30  29 20 8c 0d 3b 2e 36 21  |items%>0) ..;.6!|
0000a8b0  28 70 74 72 25 2d 32 34  29 3d 20 28 21 28 70 74  |(ptr%-24)= (!(pt|
0000a8c0  72 25 2d 32 34 29 20 84  26 38 38 29 3a f4 20 53  |r%-24) .&88):. S|
0000a8d0  65 74 20 6c 61 73 74 20  6d 65 6e 75 20 69 74 65  |et last menu ite|
0000a8e0  6d 0d 3b 38 05 cc 0d 3b  42 1b 77 69 64 74 68 25  |m.;8...;B.width%|
0000a8f0  3d 28 a9 28 74 69 74 6c  65 24 29 2d 32 29 2a 31  |=(.(title$)-2)*1|
0000a900  36 0d 3b 4c 3a f4 20 4d  61 6b 65 20 64 65 66 61  |6.;L:. Make defa|
0000a910  75 6c 74 20 66 69 72 73  74 20 65 6e 74 72 79 20  |ult first entry |
0000a920  62 65 20 67 72 65 79 65  64 20 6f 75 74 20 6c 61  |be greyed out la|
0000a930  62 65 6c 20 27 65 6d 70  74 79 27 0d 3b 56 14 69  |bel 'empty'.;V.i|
0000a940  74 65 6d 24 3d 22 45 6d  70 74 79 22 2b bd 30 0d  |tem$="Empty"+.0.|
0000a950  3b 60 39 24 28 73 68 6f  72 74 63 75 74 6d 65 6e  |;`9$(shortcutmen|
0000a960  75 64 61 74 61 25 2b 28  6c 6f 63 61 6c 69 25 2a  |udata%+(locali%*|
0000a970  36 34 29 2b 33 32 29 20  3d 20 69 74 65 6d 73 70  |64)+32) = itemsp|
0000a980  72 69 74 65 24 2b bd 30  0d 3b 6a 3d 21 70 74 72  |rite$+.0.;j=!ptr|
0000a990  25 3d 26 38 38 3a f4 20  6d 66 6c 61 67 73 20 3d  |%=&88:. mflags =|
0000a9a0  20 26 38 30 20 6d 65 61  6e 73 20 6c 61 73 74 20  | &80 means last |
0000a9b0  6d 65 6e 75 20 69 74 65  6d 20 38 3d 49 73 73 75  |menu item 8=Issu|
0000a9c0  65 57 61 72 6e 0d 3b 74  23 70 74 72 25 21 34 3d  |eWarn.;t#ptr%!4=|
0000a9d0  2d 31 3a f4 20 70 6f 69  6e 74 65 72 20 74 6f 20  |-1:. pointer to |
0000a9e0  73 75 62 20 6d 65 6e 75  0d 3b 7e 41 70 74 72 25  |sub menu.;~Aptr%|
0000a9f0  21 38 3d 26 33 30 30 30  33 31 33 3a f4 20 67 72  |!8=&3000313:. gr|
0000aa00  65 79 20 63 6f 6c 6f 75  72 20 53 45 4c 45 43 54  |ey colour SELECT|
0000aa10  41 42 4c 45 20 69 63 6f  6e 20 74 79 70 65 20 28  |ABLE icon type (|
0000aa20  41 64 64 20 6c 69 6e 6b  29 0d 3b 88 2b 24 28 73  |Add link).;.+$(s|
0000aa30  68 6f 72 74 63 75 74 6d  65 6e 75 64 61 74 61 25  |hortcutmenudata%|
0000aa40  2b 28 6c 6f 63 61 6c 69  25 2a 36 34 29 29 3d 69  |+(locali%*64))=i|
0000aa50  74 65 6d 24 0d 3b 92 14  24 28 70 74 72 25 2b 31  |tem$.;..$(ptr%+1|
0000aa60  32 29 3d 69 74 65 6d 24  0d 3b 9c 2c 70 74 72 25  |2)=item$.;.,ptr%|
0000aa70  21 31 32 20 3d 20 73 68  6f 72 74 63 75 74 6d 65  |!12 = shortcutme|
0000aa80  6e 75 64 61 74 61 25 2b  28 6c 6f 63 61 6c 69 25  |nudata%+(locali%|
0000aa90  2a 36 34 29 0d 3b a6 2f  70 74 72 25 21 31 36 20  |*64).;./ptr%!16 |
0000aaa0  3d 20 73 68 6f 72 74 63  75 74 6d 65 6e 75 64 61  |= shortcutmenuda|
0000aab0  74 61 25 2b 28 6c 6f 63  61 6c 69 25 2a 36 34 29  |ta%+(locali%*64)|
0000aac0  2b 33 32 0d 3b b0 35 70  74 72 25 21 32 30 20 3d  |+32.;.5ptr%!20 =|
0000aad0  20 32 38 3a f4 20 6d 65  6e 75 20 69 74 65 6d 20  | 28:. menu item |
0000aae0  73 74 72 69 6e 67 20 62  75 66 66 65 72 20 3d 20  |string buffer = |
0000aaf0  32 38 20 62 79 74 65 73  0d 3b ba 16 61 25 3d 28  |28 bytes.;..a%=(|
0000ab00  a9 28 69 74 65 6d 24 29  2b 34 29 2a 31 36 0d 3b  |.(item$)+4)*16.;|
0000ab10  c4 19 e7 20 61 25 3e 77  69 64 74 68 25 20 77 69  |... a%>width% wi|
0000ab20  64 74 68 25 3d 61 25 0d  3b ce 09 69 25 2b 3d 31  |dth%=a%.;..i%+=1|
0000ab30  0d 3b d8 1b 47 6c 6f 62  61 6c 4d 65 6e 75 49 74  |.;..GlobalMenuIt|
0000ab40  65 6d 43 6f 75 6e 74 25  2b 3d 31 0d 3b e2 05 cd  |emCount%+=1.;...|
0000ab50  0d 3b ec 1d 63 75 72 72  65 6e 74 6d 65 6e 75 70  |.;..currentmenup|
0000ab60  74 72 25 21 31 36 3d 77  69 64 74 68 25 0d 3b f6  |tr%!16=width%.;.|
0000ab70  04 0d 3c 00 1f f4 20 45  6e 64 20 6f 66 20 64 69  |..<... End of di|
0000ab80  72 65 63 74 6f 72 79 20  73 63 61 6e 6e 69 6e 67  |rectory scanning|
0000ab90  0d 3c 0a 10 fd 20 44 69  72 53 63 61 6e 25 3d b9  |.<... DirScan%=.|
0000aba0  0d 3c 14 27 64 69 72 6c  69 73 74 25 28 6c 69 6e  |.<.'dirlist%(lin|
0000abb0  6b 64 65 70 74 68 25 29  3d 6e 75 6d 62 65 72 6f  |kdepth%)=numbero|
0000abc0  66 69 74 65 6d 73 25 0d  3c 1e 04 0d 3c 28 38 f4  |fitems%.<...<(8.|
0000abd0  20 49 46 20 28 64 69 72  6c 69 73 74 25 28 6c 69  | IF (dirlist%(li|
0000abe0  6e 6b 64 65 70 74 68 25  29 3d 30 29 20 64 69 72  |nkdepth%)=0) dir|
0000abf0  6c 69 73 74 25 28 6c 69  6e 6b 64 65 70 74 68 25  |list%(linkdepth%|
0000ac00  29 3d 31 0d 3c 32 15 c8  99 22 48 6f 75 72 67 6c  |)=1.<2..."Hourgl|
0000ac10  61 73 73 5f 4f 66 66 22  0d 3c 3c 05 e1 0d 3c 46  |ass_Off".<<...<F|
0000ac20  04 0d 3c 50 37 f4 20 2a  2a 2a 2a 2a 2a 2a 2a 2a  |..<P7. *********|
0000ac30  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000ac50  2a 2a 2a 2a 2a 2a 2a 2a  0d 3c 5a 20 f4 20 41 20  |********.<Z . A |
0000ac60  53 75 62 6d 65 6e 75 20  69 73 20 61 62 6f 75 74  |Submenu is about|
0000ac70  20 74 6f 20 6f 70 65 6e  0d 3c 64 37 f4 20 2a 2a  | to open.<d7. **|
0000ac80  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000aca0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 0d  |***************.|
0000acb0  3c 6e 15 dd f2 73 75 62  6d 65 6e 75 5f 77 61 72  |<n...submenu_war|
0000acc0  6e 69 6e 67 0d 3c 78 36  ea 20 70 74 72 25 2c 6c  |ning.<x6. ptr%,l|
0000acd0  6f 63 61 6c 64 69 72 24  2c 64 65 70 74 68 25 2c  |ocaldir$,depth%,|
0000ace0  69 6e 64 65 78 25 2c 73  65 6c 65 63 74 69 6f 6e  |index%,selection|
0000acf0  25 2c 6c 65 61 66 24 2c  69 25 0d 3c 82 0d ea 20  |%,leaf$,i%.<... |
0000ad00  70 72 65 66 69 78 24 0d  3c 8c 2f 6c 6f 63 61 6c  |prefix$.<./local|
0000ad10  64 69 72 24 3d 41 70 70  50 61 74 68 24 2b 22 2e  |dir$=AppPath$+".|
0000ad20  55 73 65 72 73 2e 22 2b  55 73 65 72 24 2b 22 2e  |Users."+User$+".|
0000ad30  4c 69 6e 6b 73 22 0d 3c  96 04 0d 3c a0 38 f4 20  |Links".<...<.8. |
0000ad40  4e 61 76 69 67 61 74 65  20 6d 65 6e 75 20 69 6e  |Navigate menu in|
0000ad50  64 65 78 20 64 61 74 61  20 74 6f 20 64 65 74 65  |dex data to dete|
0000ad60  72 6d 69 6e 65 20 77 68  65 72 65 20 77 65 20 61  |rmine where we a|
0000ad70  72 65 0d 3c aa 0c 64 65  70 74 68 25 3d 30 0d 3c  |re.<..depth%=0.<|
0000ad80  b4 0c 69 6e 64 65 78 25  3d 30 0d 3c be 12 70 74  |..index%=0.<..pt|
0000ad90  72 25 3d 62 6c 6f 63 6b  25 2b 33 32 0d 3c c8 26  |r%=block%+32.<.&|
0000ada0  c8 95 20 21 28 28 62 6c  6f 63 6b 25 2b 33 32 29  |.. !((block%+32)|
0000adb0  2b 28 64 65 70 74 68 25  2a 34 29 29 20 3c 3e 20  |+(depth%*4)) <> |
0000adc0  2d 31 0d 3c d2 28 73 65  6c 65 63 74 69 6f 6e 25  |-1.<.(selection%|
0000add0  3d 21 28 28 62 6c 6f 63  6b 25 2b 33 32 29 2b 28  |=!((block%+32)+(|
0000ade0  64 65 70 74 68 25 2a 34  29 29 0d 3c dc 3d 6c 65  |depth%*4)).<.=le|
0000adf0  61 66 24 3d a4 73 74 72  69 6e 67 28 73 68 6f 72  |af$=.string(shor|
0000ae00  74 63 75 74 6d 65 6e 75  64 61 74 61 25 2b 28 28  |tcutmenudata%+((|
0000ae10  69 6e 64 65 78 25 2b 73  65 6c 65 63 74 69 6f 6e  |index%+selection|
0000ae20  25 29 2a 36 34 29 29 0d  3c e6 26 f4 20 49 73 20  |%)*64)).<.&. Is |
0000ae30  74 68 69 73 20 61 20 73  79 73 74 65 6d 20 64 69  |this a system di|
0000ae40  72 65 63 74 6f 72 79 20  6e 61 6d 65 3f 0d 3c f0  |rectory name?.<.|
0000ae50  11 69 25 3d 73 65 6c 65  63 74 69 6f 6e 25 0d 3c  |.i%=selection%.<|
0000ae60  fa 12 e7 20 28 64 65 70  74 68 25 3d 30 29 20 8c  |... (depth%=0) .|
0000ae70  0d 3d 04 0f 20 70 72 65  66 69 78 24 3d 22 22 0d  |.=.. prefix$="".|
0000ae80  3d 0e 53 20 e7 20 28 69  25 3e 3d 53 74 61 72 74  |=.S . (i%>=Start|
0000ae90  4d 65 6e 75 53 65 70 65  72 61 74 6f 72 25 20 80  |MenuSeperator% .|
0000aea0  20 53 74 61 72 74 4d 65  6e 75 53 65 70 65 72 61  | StartMenuSepera|
0000aeb0  74 6f 72 25 3e 3d 30 29  20 70 72 65 66 69 78 24  |tor%>=0) prefix$|
0000aec0  3d bd 28 53 79 73 46 69  6c 65 50 72 65 66 69 78  |=.(SysFilePrefix|
0000aed0  25 29 0d 3d 18 67 20 e7  20 28 69 25 3e 3d 53 74  |%).=.g . (i%>=St|
0000aee0  61 72 74 4d 65 6e 75 53  65 70 65 72 61 74 6f 72  |artMenuSeperator|
0000aef0  32 25 20 80 20 53 74 61  72 74 4d 65 6e 75 53 65  |2% . StartMenuSe|
0000af00  70 65 72 61 74 6f 72 32  25 3e 3d 30 29 20 70 72  |perator2%>=0) pr|
0000af10  65 66 69 78 24 3d bd 28  53 79 73 46 69 6c 65 50  |efix$=.(SysFileP|
0000af20  72 65 66 69 78 25 29 2b  bd 28 53 79 73 46 69 6c  |refix%)+.(SysFil|
0000af30  65 50 72 65 66 69 78 25  29 0d 3d 22 46 20 e7 20  |ePrefix%).="F . |
0000af40  28 69 25 3e 3d 53 74 61  72 74 4d 65 6e 75 53 65  |(i%>=StartMenuSe|
0000af50  70 65 72 61 74 6f 72 33  25 20 80 20 53 74 61 72  |perator3% . Star|
0000af60  74 4d 65 6e 75 53 65 70  65 72 61 74 6f 72 33 25  |tMenuSeperator3%|
0000af70  3e 3d 30 29 20 70 72 65  66 69 78 24 3d 22 22 0d  |>=0) prefix$="".|
0000af80  3d 2c 18 20 6c 65 61 66  24 3d 70 72 65 66 69 78  |=,. leaf$=prefix|
0000af90  24 2b 6c 65 61 66 24 0d  3d 36 05 cd 0d 3d 40 04  |$+leaf$.=6...=@.|
0000afa0  0d 3d 4a 21 6c 6f 63 61  6c 64 69 72 24 3d 6c 6f  |.=J!localdir$=lo|
0000afb0  63 61 6c 64 69 72 24 2b  22 2e 22 2b 6c 65 61 66  |caldir$+"."+leaf|
0000afc0  24 0d 3d 54 1c 69 6e 64  65 78 25 2b 3d 64 69 72  |$.=T.index%+=dir|
0000afd0  6c 69 73 74 25 28 64 65  70 74 68 25 29 0d 3d 5e  |list%(depth%).=^|
0000afe0  0d 64 65 70 74 68 25 2b  3d 31 0d 3d 68 05 ce 0d  |.depth%+=1.=h...|
0000aff0  3d 72 33 f2 53 69 6e 67  6c 65 44 69 72 65 63 74  |=r3.SingleDirect|
0000b000  6f 72 79 52 65 61 64 28  6c 6f 63 61 6c 64 69 72  |oryRead(localdir|
0000b010  24 2c 6c 65 61 66 24 2c  64 65 70 74 68 25 2c 20  |$,leaf$,depth%, |
0000b020  30 29 0d 3d 7c 39 c8 99  22 57 69 6d 70 5f 43 72  |0).=|9.."Wimp_Cr|
0000b030  65 61 74 65 53 75 62 4d  65 6e 75 22 2c 2c 62 6c  |eateSubMenu",,bl|
0000b040  6f 63 6b 25 21 32 30 2c  62 6c 6f 63 6b 25 21 32  |ock%!20,block%!2|
0000b050  34 2c 62 6c 6f 63 6b 25  21 32 38 0d 3d 86 05 e1  |4,block%!28.=...|
0000b060  0d 3d 90 04 0d 3d 9a 3b  f4 20 2a 2a 2a 2a 2a 2a  |.=...=.;. ******|
0000b070  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000b090  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 0d  |***************.|
0000b0a0  3d a4 1e f4 20 52 65 63  75 72 73 69 76 65 20 44  |=... Recursive D|
0000b0b0  69 72 65 63 74 6f 72 79  20 62 6f 6f 74 0d 3d ae  |irectory boot.=.|
0000b0c0  3b f4 20 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |;. *************|
0000b0d0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000b0f0  2a 2a 2a 2a 2a 2a 2a 2a  0d 3d b8 31 dd f2 52 65  |********.=.1..Re|
0000b100  63 75 72 73 65 44 69 72  65 63 74 6f 72 79 28 6c  |curseDirectory(l|
0000b110  6f 63 61 6c 64 69 72 24  2c 20 72 65 63 75 72 73  |ocaldir$, recurs|
0000b120  65 61 63 74 69 6f 6e 25  29 0d 3d c2 43 ea 20 64  |eaction%).=.C. d|
0000b130  69 72 24 2c 20 6e 65 78  74 25 2c 74 79 70 65 25  |ir$, next%,type%|
0000b140  2c 20 69 74 65 6d 24 2c  20 6f 62 6a 65 63 74 63  |, item$, objectc|
0000b150  6f 75 6e 74 25 2c 20 63  75 72 72 65 6e 74 64 69  |ount%, currentdi|
0000b160  72 25 2c 66 69 6c 65 74  79 70 65 25 0d 3d cc 11  |r%,filetype%.=..|
0000b170  ea 20 6e 75 6d 62 65 72  25 2c 4c 44 25 0d 3d d6  |. number%,LD%.=.|
0000b180  18 ea 20 6c 69 6e 6b 74  79 70 65 25 2c 6c 69 6e  |.. linktype%,lin|
0000b190  6b 64 69 72 24 0d 3d e0  12 64 69 72 24 3d 6c 6f  |kdir$.=..dir$=lo|
0000b1a0  63 61 6c 64 69 72 24 0d  3d ea 0b 6e 65 78 74 25  |caldir$.=..next%|
0000b1b0  3d 30 0d 3d f4 1b c8 95  20 6e 65 78 74 25 3c 3e  |=0.=.... next%<>|
0000b1c0  2d 31 20 80 20 ac 28 71  75 69 74 25 29 0d 3d fe  |-1 . .(quit%).=.|
0000b1d0  04 0d 3e 08 45 c8 99 20  22 4f 53 5f 47 42 50 42  |..>.E.. "OS_GBPB|
0000b1e0  22 2c 31 32 2c 64 69 72  24 2c 62 6f 6f 74 62 6c  |",12,dir$,bootbl|
0000b1f0  6f 63 6b 25 2c 31 2c 6e  65 78 74 25 2c 36 33 2c  |ock%,1,next%,63,|
0000b200  22 2a 22 20 b8 20 2c 2c  2c 6e 75 6d 62 65 72 25  |"*" . ,,,number%|
0000b210  2c 6e 65 78 74 25 0d 3e  12 2f f4 20 47 65 74 20  |,next%.>./. Get |
0000b220  4f 62 6a 65 63 74 20 74  79 70 65 20 28 32 20 3d  |Object type (2 =|
0000b230  20 64 69 72 65 63 74 6f  72 79 2c 20 31 20 3d 20  | directory, 1 = |
0000b240  66 69 6c 65 29 0d 3e 1c  1a 74 79 70 65 25 20 3d  |file).>..type% =|
0000b250  20 62 6f 6f 74 62 6c 6f  63 6b 25 3f 26 31 30 0d  | bootblock%?&10.|
0000b260  3e 26 1d 66 69 6c 65 74  79 70 65 25 20 3d 20 62  |>&.filetype% = b|
0000b270  6f 6f 74 62 6c 6f 63 6b  25 21 32 30 0d 3e 30 1d  |ootblock%!20.>0.|
0000b280  f4 20 47 65 74 20 6e 61  6d 65 20 6f 66 20 74 68  |. Get name of th|
0000b290  69 73 20 6f 62 6a 65 63  74 0d 3e 3a 21 69 74 65  |is object.>:!ite|
0000b2a0  6d 24 3d a4 67 65 74 6e  61 6d 65 28 62 6f 6f 74  |m$=.getname(boot|
0000b2b0  62 6c 6f 63 6b 25 2b 32  34 29 0d 3e 44 2c f4 20  |block%+24).>D,. |
0000b2c0  48 61 73 20 74 68 69 73  20 64 69 72 65 63 74 6f  |Has this directo|
0000b2d0  72 79 20 67 6f 74 20 61  6e 79 74 68 69 6e 67 20  |ry got anything |
0000b2e0  69 6e 20 69 74 3f 0d 3e  4e 13 e7 20 28 6e 65 78  |in it?.>N.. (nex|
0000b2f0  74 25 3c 3e 2d 31 29 20  8c 0d 3e 58 27 20 f4 20  |t%<>-1) ..>X' . |
0000b300  49 73 20 74 68 69 73 20  61 20 64 69 72 65 63 74  |Is this a direct|
0000b310  6f 72 79 20 28 69 65 20  74 79 70 65 3d 32 29 20  |ory (ie type=2) |
0000b320  0d 3e 62 12 20 e7 20 28  74 79 70 65 25 3d 32 29  |.>b. . (type%=2)|
0000b330  20 8c 0d 3e 6c 38 20 20  20 f2 52 65 63 75 72 73  | ..>l8   .Recurs|
0000b340  65 44 69 72 65 63 74 6f  72 79 28 64 69 72 24 2b  |eDirectory(dir$+|
0000b350  22 2e 22 2b 69 74 65 6d  24 2c 20 72 65 63 75 72  |"."+item$, recur|
0000b360  73 65 61 63 74 69 6f 6e  25 29 0d 3e 76 06 20 cc  |seaction%).>v. .|
0000b370  0d 3e 80 30 20 20 20 f4  20 4d 75 73 74 20 62 65  |.>.0   . Must be|
0000b380  20 61 20 6c 69 6e 6b 20  74 6f 20 61 20 66 69 6c  | a link to a fil|
0000b390  65 20 6f 72 20 61 70 70  6c 69 63 61 74 69 6f 6e  |e or application|
0000b3a0  0d 3e 8a 34 20 20 20 f4  20 57 68 61 74 20 74 79  |.>.4   . What ty|
0000b3b0  70 65 20 6f 66 20 74 68  69 6e 67 20 64 6f 65 73  |pe of thing does|
0000b3c0  20 74 68 69 73 20 6c 69  6e 6b 20 70 6f 69 6e 74  | this link point|
0000b3d0  20 74 6f 3f 0d 3e 94 29  20 20 20 f4 20 50 52 4f  | to?.>.)   . PRO|
0000b3e0  43 65 72 72 6f 72 28 22  4f 70 65 6e 69 6e 67 20  |Cerror("Opening |
0000b3f0  22 2b 64 69 72 24 2b 43  48 52 24 30 29 0d 3e 9e  |"+dir$+CHR$0).>.|
0000b400  1f 20 20 20 4c 44 25 3d  8e 28 64 69 72 24 2b 22  |.   LD%=.(dir$+"|
0000b410  2e 22 2b 69 74 65 6d 24  2b bd 30 29 0d 3e a8 12  |."+item$+.0).>..|
0000b420  20 20 20 6c 69 6e 6b 64  69 72 24 3d 22 22 0d 3e  |   linkdir$="".>|
0000b430  b2 08 20 20 20 f5 0d 3e  bc 13 20 20 20 4c 44 24  |..   ..>..   LD$|
0000b440  3d bd 28 9a 23 4c 44 25  29 0d 3e c6 22 20 20 20  |=.(.#LD%).>."   |
0000b450  e7 20 28 97 28 4c 44 24  29 3e 33 31 29 20 6c 69  |. (.(LD$)>31) li|
0000b460  6e 6b 64 69 72 24 2b 3d  4c 44 24 0d 3e d0 1a 20  |nkdir$+=LD$.>.. |
0000b470  20 20 fd 20 97 28 4c 44  24 29 3c 33 32 20 84 20  |  . .(LD$)<32 . |
0000b480  c5 23 4c 44 25 0d 3e da  0d 20 20 20 d9 23 4c 44  |.#LD%.>..   .#LD|
0000b490  25 20 0d 3e e4 22 20 20  20 f4 20 57 68 61 74 20  |% .>."   . What |
0000b4a0  74 79 70 65 20 69 73 20  74 68 65 20 6c 69 6e 6b  |type is the link|
0000b4b0  64 69 72 3f 0d 3e ee 1f  20 20 20 24 62 6f 6f 74  |dir?.>..   $boot|
0000b4c0  73 74 72 69 6e 67 25 3d  6c 69 6e 6b 64 69 72 24  |string%=linkdir$|
0000b4d0  2b bd 30 0d 3e f8 2a 20  20 20 e7 20 28 a4 43 68  |+.0.>.*   . (.Ch|
0000b4e0  65 63 6b 56 61 6c 69 64  44 72 69 76 65 28 6c 69  |eckValidDrive(li|
0000b4f0  6e 6b 64 69 72 24 29 20  3d 31 29 20 8c 0d 3f 02  |nkdir$) =1) ..?.|
0000b500  2f 20 20 20 20 c8 99 20  22 58 4f 53 5f 46 69 6c  |/    .. "XOS_Fil|
0000b510  65 22 2c 35 2c 62 6f 6f  74 73 74 72 69 6e 67 25  |e",5,bootstring%|
0000b520  20 b8 20 6c 69 6e 6b 74  79 70 65 25 0d 3f 0c 2a  | . linktype%.?.*|
0000b530  20 20 20 20 e7 20 28 c0  69 74 65 6d 24 2c 31 29  |    . (.item$,1)|
0000b540  3d 22 21 22 20 84 20 6c  69 6e 6b 74 79 70 65 25  |="!" . linktype%|
0000b550  3c 3e 32 29 20 8c 0d 3f  16 3f 20 20 20 20 20 f4  |<>2) ..?.?     .|
0000b560  20 4d 75 73 74 20 62 65  20 65 69 74 68 65 72 20  | Must be either |
0000b570  61 20 66 69 6c 65 20 6f  72 20 61 70 70 20 6f 72  |a file or app or|
0000b580  20 64 69 72 20 73 6f 20  6c 65 74 27 73 20 62 6f  | dir so let's bo|
0000b590  6f 74 20 69 74 0d 3f 20  40 20 20 20 20 20 f4 20  |ot it.? @     . |
0000b5a0  49 66 20 64 69 72 65 63  74 6f 72 79 2c 20 6f 6e  |If directory, on|
0000b5b0  6c 79 20 62 6f 6f 74 20  69 66 20 62 65 67 69 6e  |ly boot if begin|
0000b5c0  20 77 69 74 68 20 61 20  21 20 28 53 61 76 65 20  | with a ! (Save |
0000b5d0  74 69 6d 65 29 0d 3f 2a  2b 20 20 20 20 20 e7 20  |time).?*+     . |
0000b5e0  28 72 65 63 75 72 73 65  61 63 74 69 6f 6e 25 3d  |(recurseaction%=|
0000b5f0  52 45 43 55 52 53 45 5f  42 4f 4f 54 25 29 20 8c  |RECURSE_BOOT%) .|
0000b600  0d 3f 34 31 20 20 20 20  20 20 20 24 63 6c 69 73  |.?41       $clis|
0000b610  74 72 69 6e 67 20 3d 20  22 46 69 6c 65 72 5f 42  |tring = "Filer_B|
0000b620  6f 6f 74 20 22 2b 6c 69  6e 6b 64 69 72 24 2b bd  |oot "+linkdir$+.|
0000b630  30 0d 3f 3e 22 20 20 20  20 20 20 20 c8 99 20 22  |0.?>"       .. "|
0000b640  58 4f 53 5f 43 4c 49 22  2c 20 63 6c 69 73 74 72  |XOS_CLI", clistr|
0000b650  69 6e 67 0d 3f 48 0a 20  20 20 20 20 cd 0d 3f 52  |ing.?H.     ..?R|
0000b660  2a 20 20 20 20 20 e7 20  28 72 65 63 75 72 73 65  |*     . (recurse|
0000b670  61 63 74 69 6f 6e 25 3d  52 45 43 55 52 53 45 5f  |action%=RECURSE_|
0000b680  52 55 4e 25 29 20 8c 0d  3f 5c 30 20 20 20 20 20  |RUN%) ..?\0     |
0000b690  20 20 24 63 6c 69 73 74  72 69 6e 67 20 3d 20 22  |  $clistring = "|
0000b6a0  46 69 6c 65 72 5f 52 75  6e 20 22 2b 6c 69 6e 6b  |Filer_Run "+link|
0000b6b0  64 69 72 24 2b bd 30 0d  3f 66 22 20 20 20 20 20  |dir$+.0.?f"     |
0000b6c0  20 20 c8 99 20 22 58 4f  53 5f 43 4c 49 22 2c 20  |  .. "XOS_CLI", |
0000b6d0  63 6c 69 73 74 72 69 6e  67 0d 3f 70 0a 20 20 20  |clistring.?p.   |
0000b6e0  20 20 cd 0d 3f 7a 09 20  20 20 20 cd 0d 3f 84 09  |  ..?z.    ..?..|
0000b6f0  20 20 20 20 cc 0d 3f 8e  1a 20 20 20 20 f4 20 52  |    ..?..    . R|
0000b700  65 6d 6f 76 65 20 74 68  69 73 20 6c 69 6e 6b 0d  |emove this link.|
0000b710  3f 98 1c 20 20 20 20 e7  20 28 66 69 6c 65 74 79  |?..    . (filety|
0000b720  70 65 25 3d 26 61 66 33  29 20 8c 0d 3f a2 34 f4  |pe%=&af3) ..?.4.|
0000b730  20 20 20 20 50 52 4f 43  65 72 72 6f 72 28 22 44  |    PROCerror("D|
0000b740  65 6c 65 74 69 6e 67 20  22 2b 64 69 72 24 2b 22  |eleting "+dir$+"|
0000b750  2e 22 2b 69 74 65 6d 24  2b 43 48 52 24 30 29 0d  |."+item$+CHR$0).|
0000b760  3f ac 26 20 20 20 20 ff  28 22 64 65 6c 65 74 65  |?.&    .("delete|
0000b770  20 22 2b 64 69 72 24 2b  22 2e 22 2b 69 74 65 6d  | "+dir$+"."+item|
0000b780  24 2b bd 30 29 0d 3f b6  09 20 20 20 20 cd 0d 3f  |$+.0).?..    ..?|
0000b790  c0 08 20 20 20 20 0d 3f  ca 08 20 20 20 cd 0d 3f  |..    .?..   ..?|
0000b7a0  d4 06 20 cd 0d 3f de 05  cd 0d 3f e8 04 0d 3f f2  |.. ..?....?...?.|
0000b7b0  2f f4 20 45 6e 61 62 6c  65 20 75 73 65 72 20 74  |/. Enable user t|
0000b7c0  6f 20 63 61 72 72 79 20  6f 6e 20 64 75 72 69 6e  |o carry on durin|
0000b7d0  67 20 62 6f 6f 74 75 70  20 61 6e 64 0d 3f fc 3a  |g bootup and.?.:|
0000b7e0  f4 20 74 72 61 70 20 61  6e 79 20 75 6e 77 61 6e  |. trap any unwan|
0000b7f0  74 65 64 20 6c 69 6e 6b  73 20 74 68 61 74 20 61  |ted links that a|
0000b800  72 65 20 67 65 6e 65 72  61 74 65 64 20 61 74 20  |re generated at |
0000b810  62 6f 6f 74 75 70 0d 40  06 09 f2 70 6f 6c 6c 0d  |bootup.@...poll.|
0000b820  40 10 09 f2 70 6f 6c 6c  0d 40 1a 09 f2 70 6f 6c  |@...poll.@...pol|
0000b830  6c 0d 40 24 04 0d 40 2e  05 ce 0d 40 38 05 e1 0d  |l.@$..@....@8...|
0000b840  40 42 04 0d 40 4c 35 f4  20 2a 2a 2a 2a 2a 2a 2a  |@B..@L5. *******|
0000b850  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000b870  2a 2a 2a 2a 2a 2a 2a 2a  0d 40 56 04 0d 40 60 1f  |********.@V..@`.|
0000b880  dd a4 43 68 65 63 6b 56  61 6c 69 64 44 72 69 76  |..CheckValidDriv|
0000b890  65 28 69 73 76 70 61 74  68 24 29 0d 40 6a 21 ea  |e(isvpath$).@j!.|
0000b8a0  20 66 73 5f 64 72 69 76  65 24 2c 20 70 70 74 72  | fs_drive$, pptr|
0000b8b0  25 2c 20 63 68 61 72 24  2c 20 61 25 0d 40 74 38  |%, char$, a%.@t8|
0000b8c0  f4 20 43 68 65 63 6b 20  74 68 61 74 20 69 73 76  |. Check that isv|
0000b8d0  70 61 74 68 24 20 72 65  73 69 64 65 73 20 6f 6e  |path$ resides on|
0000b8e0  20 61 20 76 61 6c 69 64  20 66 69 6c 65 20 73 79  | a valid file sy|
0000b8f0  73 74 65 6d 0d 40 7e 18  f4 20 61 6e 64 20 61 20  |stem.@~.. and a |
0000b900  76 61 6c 69 64 20 64 72  69 76 65 2e 0d 40 88 28  |valid drive..@.(|
0000b910  f4 20 49 66 20 6e 6f 74  20 74 68 65 6e 20 72 65  |. If not then re|
0000b920  74 75 72 6e 20 30 20 65  6c 73 65 20 72 65 74 75  |turn 0 else retu|
0000b930  72 6e 20 31 0d 40 92 0b  70 70 74 72 25 3d 31 0d  |rn 1.@..pptr%=1.|
0000b940  40 9c 10 66 73 5f 64 72  69 76 65 24 3d 22 22 0d  |@..fs_drive$="".|
0000b950  40 a6 05 f5 0d 40 b0 1c  63 68 61 72 24 3d c1 69  |@....@..char$=.i|
0000b960  73 76 70 61 74 68 24 2c  70 70 74 72 25 2c 31 29  |svpath$,pptr%,1)|
0000b970  0d 40 ba 2c e7 20 28 63  68 61 72 24 3c 3e 22 2e  |.@.,. (char$<>".|
0000b980  22 29 20 66 73 5f 64 72  69 76 65 24 3d 66 73 5f  |") fs_drive$=fs_|
0000b990  64 72 69 76 65 24 2b 63  68 61 72 24 0d 40 c4 11  |drive$+char$.@..|
0000b9a0  70 70 74 72 25 3d 70 70  74 72 25 2b 31 0d 40 ce  |pptr%=pptr%+1.@.|
0000b9b0  25 fd 20 28 70 70 74 72  25 3e a9 28 69 73 76 70  |%. (pptr%>.(isvp|
0000b9c0  61 74 68 24 29 20 84 20  63 68 61 72 24 3d 22 2e  |ath$) . char$=".|
0000b9d0  22 29 0d 40 d8 38 f4 20  43 68 65 63 6b 20 66 73  |").@.8. Check fs|
0000b9e0  5f 64 72 69 76 65 24 20  77 69 74 68 20 61 6c 6c  |_drive$ with all|
0000b9f0  20 63 75 72 72 65 6e 74  6c 79 20 69 6e 76 61 6c  | currently inval|
0000ba00  69 64 20 64 65 76 69 63  65 73 0d 40 e2 08 61 25  |id devices.@..a%|
0000ba10  3d 30 0d 40 ec 1d c8 95  28 61 25 3c 49 6e 76 61  |=0.@....(a%<Inva|
0000ba20  6c 69 64 44 72 69 76 65  43 6f 75 6e 74 25 29 0d  |lidDriveCount%).|
0000ba30  40 f6 3b e7 20 28 66 73  5f 64 72 69 76 65 24 3d  |@.;. (fs_drive$=|
0000ba40  49 6e 76 61 6c 69 64 44  72 69 76 65 24 28 61 25  |InvalidDrive$(a%|
0000ba50  29 29 20 61 25 3d 49 6e  76 61 6c 69 64 44 72 69  |)) a%=InvalidDri|
0000ba60  76 65 43 6f 75 6e 74 25  2b 31 0d 41 00 09 61 25  |veCount%+1.A..a%|
0000ba70  2b 3d 31 0d 41 0a 05 ce  0d 41 14 2b f4 20 72 65  |+=1.A....A.+. re|
0000ba80  74 75 72 6e 20 69 66 20  69 74 20 6d 61 74 63 68  |turn if it match|
0000ba90  65 73 20 61 6e 20 69 6e  76 61 6c 69 64 20 64 72  |es an invalid dr|
0000baa0  69 76 65 0d 41 1e 22 e7  20 28 61 25 3e 49 6e 76  |ive.A.". (a%>Inv|
0000bab0  61 6c 69 64 44 72 69 76  65 43 6f 75 6e 74 25 29  |alidDriveCount%)|
0000bac0  20 8c 20 3d 30 0d 41 28  1b f4 20 49 73 20 74 68  | . =0.A(.. Is th|
0000bad0  69 73 20 64 65 76 69 63  65 20 76 61 6c 69 64 3f  |is device valid?|
0000bae0  0d 41 32 1b 24 63 6c 69  73 74 72 69 6e 67 3d 66  |.A2.$clistring=f|
0000baf0  73 5f 64 72 69 76 65 24  2b bd 30 0d 41 3c 26 c8  |s_drive$+.0.A<&.|
0000bb00  99 22 58 4f 53 5f 46 69  6c 65 22 2c 35 2c 63 6c  |."XOS_File",5,cl|
0000bb10  69 73 74 72 69 6e 67 20  b8 20 72 65 73 75 6c 74  |istring . result|
0000bb20  25 0d 41 46 17 e7 20 28  72 65 73 75 6c 74 25 3c  |%.AF.. (result%<|
0000bb30  3d 38 31 39 32 29 20 8c  0d 41 50 1c 20 f4 20 54  |=8192) ..AP. . T|
0000bb40  68 69 73 20 69 73 20 61  20 76 61 6c 69 64 20 64  |his is a valid d|
0000bb50  72 69 76 65 0d 41 5a 07  20 3d 31 0d 41 64 05 cd  |rive.AZ. =1.Ad..|
0000bb60  0d 41 6e 23 f4 20 55 70  64 61 74 65 20 6c 69 73  |.An#. Update lis|
0000bb70  74 20 6f 66 20 69 6e 76  61 6c 69 64 20 64 72 69  |t of invalid dri|
0000bb80  76 65 73 0d 41 78 31 49  6e 76 61 6c 69 64 44 72  |ves.Ax1InvalidDr|
0000bb90  69 76 65 24 28 49 6e 76  61 6c 69 64 44 72 69 76  |ive$(InvalidDriv|
0000bba0  65 43 6f 75 6e 74 25 29  20 3d 20 66 73 5f 64 72  |eCount%) = fs_dr|
0000bbb0  69 76 65 24 0d 41 82 19  49 6e 76 61 6c 69 64 44  |ive$.A..InvalidD|
0000bbc0  72 69 76 65 43 6f 75 6e  74 25 2b 3d 31 0d 41 8c  |riveCount%+=1.A.|
0000bbd0  06 3d 30 0d 41 96 04 0d  41 a0 2d f4 20 2a 2a 2a  |.=0.A...A.-. ***|
0000bbe0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000bc00  2a 2a 2a 2a 0d 41 aa 29  f4 20 52 65 74 75 72 6e  |****.A.). Return|
0000bc10  20 66 69 72 73 74 20 6c  69 6e 65 20 6f 66 20 74  | first line of t|
0000bc20  68 65 20 67 69 76 65 6e  20 66 69 6c 65 0d 41 b4  |he given file.A.|
0000bc30  2d f4 20 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |-. *************|
0000bc40  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
0000bc50  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 0d 41 be 25 dd a4  |**********.A.%..|
0000bc60  47 65 74 4c 69 6e 6b 43  6f 6e 74 65 6e 74 73 28  |GetLinkContents(|
0000bc70  67 6c 69 6e 6b 66 69 6c  65 6e 61 6d 65 24 29 0d  |glinkfilename$).|
0000bc80  41 c8 12 ea 20 6c 69 6e  6b 64 69 72 24 2c 4c 44  |A... linkdir$,LD|
0000bc90  25 0d 41 d2 1f 20 20 20  4c 44 25 3d 8e 28 67 6c  |%.A..   LD%=.(gl|
0000bca0  69 6e 6b 66 69 6c 65 6e  61 6d 65 24 2b bd 30 29  |inkfilename$+.0)|
0000bcb0  0d 41 dc 12 20 20 20 6c  69 6e 6b 64 69 72 24 3d  |.A..   linkdir$=|
0000bcc0  22 22 0d 41 e6 08 20 20  20 f5 0d 41 f0 13 20 20  |"".A..   ..A..  |
0000bcd0  20 4c 44 24 3d bd 28 9a  23 4c 44 25 29 0d 41 fa  | LD$=.(.#LD%).A.|
0000bce0  22 20 20 20 e7 20 28 97  28 4c 44 24 29 3e 33 31  |"   . (.(LD$)>31|
0000bcf0  29 20 6c 69 6e 6b 64 69  72 24 2b 3d 4c 44 24 0d  |) linkdir$+=LD$.|
0000bd00  42 04 1a 20 20 20 fd 20  97 28 4c 44 24 29 3c 33  |B..   . .(LD$)<3|
0000bd10  32 20 84 20 c5 23 4c 44  25 0d 42 0e 0c 20 20 20  |2 . .#LD%.B..   |
0000bd20  d9 23 4c 44 25 0d 42 18  10 20 20 20 3d 6c 69 6e  |.#LD%.B..   =lin|
0000bd30  6b 64 69 72 24 0d 42 22  04 0d 42 2c 2c f4 20 2a  |kdir$.B"..B,,. *|
0000bd40  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000bd60  2a 2a 2a 2a 2a 0d 42 36  21 f4 20 43 6c 69 63 6b  |*****.B6!. Click|
0000bd70  20 6f 6e 20 73 68 6f 72  74 63 75 74 20 6d 65 6e  | on shortcut men|
0000bd80  75 20 6c 69 73 74 0d 42  40 2c f4 20 2a 2a 2a 2a  |u list.B@,. ****|
0000bd90  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000bdb0  2a 2a 0d 42 4a 18 dd f2  73 68 6f 72 74 63 75 74  |**.BJ...shortcut|
0000bdc0  6d 65 6e 75 73 65 6c 65  63 74 0d 42 54 4f ea 20  |menuselect.BTO. |
0000bdd0  63 75 72 72 65 6e 74 6d  65 6e 75 70 74 72 25 2c  |currentmenuptr%,|
0000bde0  6c 61 73 74 6d 65 6e 75  70 74 72 25 2c 64 69 72  |lastmenuptr%,dir|
0000bdf0  24 2c 6c 69 6e 6b 64 69  72 24 2c 64 72 6f 70 64  |$,linkdir$,dropd|
0000be00  69 72 24 2c 63 75 72 72  65 6e 74 64 72 6f 70 64  |ir$,currentdropd|
0000be10  69 72 24 2c 6c 65 61 66  24 0d 42 5e 19 ea 20 64  |ir$,leaf$.B^.. d|
0000be20  72 6f 70 70 61 72 64 69  72 24 2c 70 61 72 65 6e  |roppardir$,paren|
0000be30  74 24 0d 42 68 11 ea 20  52 65 4f 70 65 6e 46 6c  |t$.Bh.. ReOpenFl|
0000be40  61 67 25 0d 42 72 14 ea  20 49 63 6f 6e 46 6c 61  |ag%.Br.. IconFla|
0000be50  67 73 41 64 64 72 25 0d  42 7c 2b ea 20 70 72 65  |gsAddr%.B|+. pre|
0000be60  66 69 78 24 2c 49 73 4c  69 6e 6b 44 69 72 65 63  |fix$,IsLinkDirec|
0000be70  74 6f 72 79 25 2c 49 73  47 72 65 79 65 64 4f 75  |tory%,IsGreyedOu|
0000be80  74 25 0d 42 86 3e ea 20  4c 65 66 74 41 6c 74 25  |t%.B.>. LeftAlt%|
0000be90  2c 20 52 69 67 68 74 41  6c 74 25 2c 54 68 69 73  |, RightAlt%,This|
0000bea0  49 73 57 72 69 74 65 61  62 6c 65 25 2c 52 65 62  |IsWriteable%,Reb|
0000beb0  75 69 6c 64 4c 61 73 74  53 75 62 4d 65 6e 75 25  |uildLastSubMenu%|
0000bec0  0d 42 90 17 ea 20 41 64  64 57 72 69 74 65 61 62  |.B... AddWriteab|
0000bed0  6c 65 46 6c 61 67 25 0d  42 9a 04 0d 42 a4 17 41  |leFlag%.B...B..A|
0000bee0  64 64 57 72 69 74 65 61  62 6c 65 46 6c 61 67 25  |ddWriteableFlag%|
0000bef0  3d 30 0d 42 ae 12 49 73  47 72 65 79 65 64 4f 75  |=0.B..IsGreyedOu|
0000bf00  74 25 3d 30 0d 42 b8 16  49 73 4c 69 6e 6b 44 69  |t%=0.B..IsLinkDi|
0000bf10  72 65 63 74 6f 72 79 25  3d 30 0d 42 c2 43 4c 65  |rectory%=0.B.CLe|
0000bf20  66 74 41 6c 74 25 3d 30  3a 52 69 67 68 74 41 6c  |ftAlt%=0:RightAl|
0000bf30  74 25 3d 30 3a 54 68 69  73 49 73 57 72 69 74 65  |t%=0:ThisIsWrite|
0000bf40  61 62 6c 65 25 3d 30 3a  52 65 62 75 69 6c 64 4c  |able%=0:RebuildL|
0000bf50  61 73 74 53 75 62 4d 65  6e 75 25 3d 30 0d 42 cc  |astSubMenu%=0.B.|
0000bf60  14 e7 20 a6 2d 36 20 4c  65 66 74 41 6c 74 25 3d  |.. .-6 LeftAlt%=|
0000bf70  31 0d 42 d6 15 e7 20 a6  2d 39 20 52 69 67 68 74  |1.B... .-9 Right|
0000bf80  41 6c 74 25 3d 31 0d 42  e0 04 0d 42 ea 38 f4 20  |Alt%=1.B...B.8. |
0000bf90  50 52 4f 43 65 72 72 6f  72 28 22 43 6c 69 63 6b  |PROCerror("Click|
0000bfa0  65 64 20 6f 6e 20 73 68  6f 72 74 63 75 74 20 6d  |ed on shortcut m|
0000bfb0  65 6e 75 20 2d 20 62 6c  61 6a 22 2b 43 48 52 24  |enu - blaj"+CHR$|
0000bfc0  30 29 0d 42 f4 04 0d 42  fe 11 52 65 4f 70 65 6e  |0).B...B..ReOpen|
0000bfd0  46 6c 61 67 25 3d a3 0d  43 08 2a 64 69 72 24 3d  |Flag%=..C.*dir$=|
0000bfe0  41 70 70 50 61 74 68 24  2b 22 2e 55 73 65 72 73  |AppPath$+".Users|
0000bff0  2e 22 2b 55 73 65 72 24  2b 22 2e 4c 69 6e 6b 73  |."+User$+".Links|
0000c000  22 0d 43 12 11 64 72 6f  70 64 69 72 24 3d 64 69  |".C..dropdir$=di|
0000c010  72 24 0d 43 1c 14 64 72  6f 70 70 61 72 64 69 72  |r$.C..droppardir|
0000c020  24 3d 64 69 72 24 0d 43  26 11 70 61 72 65 6e 74  |$=dir$.C&.parent|
0000c030  24 3d 55 73 65 72 24 0d  43 30 0f 6c 65 61 66 24  |$=User$.C0.leaf$|
0000c040  3d 55 73 65 72 24 0d 43  3a 18 63 75 72 72 65 6e  |=User$.C:.curren|
0000c050  74 64 72 6f 70 64 69 72  24 3d 64 69 72 24 0d 43  |tdropdir$=dir$.C|
0000c060  44 21 63 75 72 72 65 6e  74 6d 65 6e 75 70 74 72  |D!currentmenuptr|
0000c070  25 3d 73 68 6f 72 74 63  75 74 6d 65 6e 75 25 0d  |%=shortcutmenu%.|
0000c080  43 4e 20 6c 61 73 74 6d  65 6e 75 70 74 72 25 3d  |CN lastmenuptr%=|
0000c090  63 75 72 72 65 6e 74 6d  65 6e 75 70 74 72 25 0d  |currentmenuptr%.|
0000c0a0  43 58 20 67 6c 6f 62 61  6c 6d 65 6e 75 70 74 72  |CX globalmenuptr|
0000c0b0  25 3d 73 68 6f 72 74 63  75 74 6d 65 6e 75 25 0d  |%=shortcutmenu%.|
0000c0c0  43 62 2c f4 20 62 6c 6f  63 6b 25 2b 30 30 20 69  |Cb,. block%+00 i|
0000c0d0  73 20 73 65 6c 65 63 74  69 6f 6e 20 6e 75 6d 62  |s selection numb|
0000c0e0  65 72 20 6f 66 20 6d 65  6e 75 2c 0d 43 6c 10 6e  |er of menu,.Cl.n|
0000c0f0  65 73 74 6c 65 76 65 6c  25 3d 30 0d 43 76 1b 73  |estlevel%=0.Cv.s|
0000c100  65 6c 31 25 3d 62 6c 6f  63 6b 25 21 6e 65 73 74  |el1%=block%!nest|
0000c110  6c 65 76 65 6c 25 0d 43  80 04 0d 43 8a 3b f4 20  |level%.C...C.;. |
0000c120  52 65 63 75 72 73 65 20  6d 65 6e 75 20 64 69 72  |Recurse menu dir|
0000c130  65 63 74 6f 72 79 20 70  6f 69 6e 74 65 72 73 20  |ectory pointers |
0000c140  75 6e 74 69 6c 20 73 65  6c 65 63 74 69 6f 6e 20  |until selection |
0000c150  66 6f 75 6e 64 0d 43 94  05 f5 0d 43 9e 24 73 65  |found.C....C.$se|
0000c160  6c 65 63 74 69 6f 6e 25  3d 62 6c 6f 63 6b 25 21  |lection%=block%!|
0000c170  28 6e 65 73 74 6c 65 76  65 6c 25 2a 34 29 0d 43  |(nestlevel%*4).C|
0000c180  a8 2c 6e 65 78 74 73 65  6c 65 63 74 69 6f 6e 25  |.,nextselection%|
0000c190  3d 62 6c 6f 63 6b 25 21  28 28 6e 65 73 74 6c 65  |=block%!((nestle|
0000c1a0  76 65 6c 25 2b 31 29 2a  34 29 0d 43 b2 3a f4 50  |vel%+1)*4).C.:.P|
0000c1b0  52 4f 43 65 72 72 6f 72  28 22 4d 65 6e 75 20 53  |ROCerror("Menu S|
0000c1c0  65 6c 65 63 74 69 6f 6e  20 3d 20 22 2b 53 54 52  |election = "+STR|
0000c1d0  24 28 73 65 6c 65 63 74  69 6f 6e 25 29 2b 43 48  |$(selection%)+CH|
0000c1e0  52 24 30 29 0d 43 bc 39  f4 20 47 65 74 20 70 6f  |R$0).C.9. Get po|
0000c1f0  69 6e 74 65 72 20 74 6f  20 69 63 6f 6e 20 64 65  |inter to icon de|
0000c200  66 69 6e 69 74 69 6f 6e  20 66 72 6f 6d 20 6d 65  |finition from me|
0000c210  6e 75 20 64 65 66 69 6e  69 74 69 6f 6e 0d 43 c6  |nu definition.C.|
0000c220  37 73 75 62 6d 65 6e 75  70 74 72 25 3d 21 28 63  |7submenuptr%=!(c|
0000c230  75 72 72 65 6e 74 6d 65  6e 75 70 74 72 25 2b 32  |urrentmenuptr%+2|
0000c240  38 2b 28 73 65 6c 65 63  74 69 6f 6e 25 2a 32 34  |8+(selection%*24|
0000c250  29 2b 34 29 0d 43 d0 35  64 61 74 61 70 74 72 25  |)+4).C.5dataptr%|
0000c260  3d 21 28 63 75 72 72 65  6e 74 6d 65 6e 75 70 74  |=!(currentmenupt|
0000c270  72 25 2b 32 38 2b 28 73  65 6c 65 63 74 69 6f 6e  |r%+28+(selection|
0000c280  25 2a 32 34 29 2b 31 32  29 0d 43 da 11 70 61 72  |%*24)+12).C..par|
0000c290  65 6e 74 24 3d 6c 65 61  66 24 0d 43 e4 1b 6c 65  |ent$=leaf$.C..le|
0000c2a0  61 66 24 3d a4 73 74 72  69 6e 67 28 64 61 74 61  |af$=.string(data|
0000c2b0  70 74 72 25 29 0d 43 ee  36 49 74 65 6d 46 6c 61  |ptr%).C.6ItemFla|
0000c2c0  67 73 25 20 3d 20 21 28  63 75 72 72 65 6e 74 6d  |gs% = !(currentm|
0000c2d0  65 6e 75 70 74 72 25 2b  32 38 2b 28 73 65 6c 65  |enuptr%+28+(sele|
0000c2e0  63 74 69 6f 6e 25 2a 32  34 29 29 0d 43 f8 35 f4  |ction%*24)).C.5.|
0000c2f0  20 49 73 20 74 68 69 73  20 61 20 73 79 73 74 65  | Is this a syste|
0000c300  6d 20 66 69 6c 65 20 6e  61 6d 65 3f 20 6e 6f 74  |m file name? not|
0000c310  20 77 72 69 74 65 61 62  6c 65 20 2e 2e 2e 20 29  | writeable ... )|
0000c320  0d 44 02 2b e7 20 28 6e  65 73 74 6c 65 76 65 6c  |.D.+. (nestlevel|
0000c330  25 3d 30 20 80 20 28 49  74 65 6d 46 6c 61 67 73  |%=0 . (ItemFlags|
0000c340  25 20 80 20 34 29 3d 30  29 20 8c 0d 44 0c 0f 20  |% . 4)=0) ..D.. |
0000c350  70 72 65 66 69 78 24 3d  22 22 0d 44 16 5b 20 e7  |prefix$="".D.[ .|
0000c360  20 28 73 65 6c 65 63 74  69 6f 6e 25 3e 3d 53 74  | (selection%>=St|
0000c370  61 72 74 4d 65 6e 75 53  65 70 65 72 61 74 6f 72  |artMenuSeperator|
0000c380  25 20 80 20 53 74 61 72  74 4d 65 6e 75 53 65 70  |% . StartMenuSep|
0000c390  65 72 61 74 6f 72 25 3e  3d 30 29 20 70 72 65 66  |erator%>=0) pref|
0000c3a0  69 78 24 3d bd 28 53 79  73 46 69 6c 65 50 72 65  |ix$=.(SysFilePre|
0000c3b0  66 69 78 25 29 0d 44 20  71 20 e7 20 28 73 65 6c  |fix%).D q . (sel|
0000c3c0  65 63 74 69 6f 6e 25 3e  3d 53 74 61 72 74 4d 65  |ection%>=StartMe|
0000c3d0  6e 75 53 65 70 65 72 61  74 6f 72 32 25 20 80 20  |nuSeperator2% . |
0000c3e0  53 74 61 72 74 4d 65 6e  75 53 65 70 65 72 61 74  |StartMenuSeperat|
0000c3f0  6f 72 32 25 3e 3d 30 29  20 70 72 65 66 69 78 24  |or2%>=0) prefix$|
0000c400  20 3d 20 bd 28 53 79 73  46 69 6c 65 50 72 65 66  | = .(SysFilePref|
0000c410  69 78 25 29 2b bd 28 53  79 73 46 69 6c 65 50 72  |ix%)+.(SysFilePr|
0000c420  65 66 69 78 25 29 0d 44  2a 50 20 e7 20 28 73 65  |efix%).D*P . (se|
0000c430  6c 65 63 74 69 6f 6e 25  3e 3d 53 74 61 72 74 4d  |lection%>=StartM|
0000c440  65 6e 75 53 65 70 65 72  61 74 6f 72 33 25 20 80  |enuSeperator3% .|
0000c450  20 53 74 61 72 74 4d 65  6e 75 53 65 70 65 72 61  | StartMenuSepera|
0000c460  74 6f 72 33 25 3e 3d 30  29 20 70 72 65 66 69 78  |tor3%>=0) prefix|
0000c470  24 20 3d 20 22 22 0d 44  34 18 20 6c 65 61 66 24  |$ = "".D4. leaf$|
0000c480  3d 70 72 65 66 69 78 24  2b 6c 65 61 66 24 0d 44  |=prefix$+leaf$.D|
0000c490  3e 05 cd 0d 44 48 1e f4  20 43 6f 6e 73 74 72 75  |>...DH.. Constru|
0000c4a0  63 74 20 70 61 74 68 20  74 6f 20 6f 62 6a 65 63  |ct path to objec|
0000c4b0  74 0d 44 52 1c 63 75 72  72 65 6e 74 64 72 6f 70  |t.DR.currentdrop|
0000c4c0  64 69 72 24 3d 64 72 6f  70 64 69 72 24 0d 44 5c  |dir$=dropdir$.D\|
0000c4d0  18 e7 20 28 73 65 6c 65  63 74 69 6f 6e 25 3c 3e  |.. (selection%<>|
0000c4e0  2d 31 29 20 8c 0d 44 66  18 20 64 69 72 24 3d 64  |-1) ..Df. dir$=d|
0000c4f0  69 72 24 2b 22 2e 22 2b  6c 65 61 66 24 0d 44 70  |ir$+"."+leaf$.Dp|
0000c500  1d 20 e7 20 28 6e 65 78  74 73 65 6c 65 63 74 69  |. . (nextselecti|
0000c510  6f 6e 25 3c 3e 2d 31 29  20 8c 0d 44 7a 27 20 20  |on%<>-1) ..Dz'  |
0000c520  64 72 6f 70 70 61 72 64  69 72 24 3d 64 72 6f 70  |droppardir$=drop|
0000c530  70 61 72 64 69 72 24 2b  22 2e 22 2b 6c 65 61 66  |pardir$+"."+leaf|
0000c540  24 0d 44 84 32 20 20 e7  20 28 73 75 62 6d 65 6e  |$.D.2  . (submen|
0000c550  75 70 74 72 25 3c 3e 2d  31 29 20 6c 61 73 74 6d  |uptr%<>-1) lastm|
0000c560  65 6e 75 70 74 72 25 3d  73 75 62 6d 65 6e 75 70  |enuptr%=submenup|
0000c570  74 72 25 0d 44 8e 07 20  20 cc 0d 44 98 41 20 20  |tr%.D..  ..D.A  |
0000c580  f4 20 6e 65 78 74 73 65  6c 65 63 74 69 6f 6e 3d  |. nextselection=|
0000c590  2d 31 20 73 6f 20 4d 75  73 74 20 62 65 20 61 74  |-1 so Must be at|
0000c5a0  20 73 65 6c 65 63 74 65  64 20 69 74 65 6d 20 6f  | selected item o|
0000c5b0  66 20 6c 61 73 74 20 6d  65 6e 75 0d 44 a2 2c 20  |f last menu.D., |
0000c5c0  20 e7 20 28 73 75 62 6d  65 6e 75 70 74 72 25 3c  | . (submenuptr%<|
0000c5d0  3e 2d 31 29 20 49 73 4c  69 6e 6b 44 69 72 65 63  |>-1) IsLinkDirec|
0000c5e0  74 6f 72 79 25 3d 31 0d  44 ac 39 20 20 49 63 6f  |tory%=1.D.9  Ico|
0000c5f0  6e 46 6c 61 67 73 41 64  64 72 25 3d 63 75 72 72  |nFlagsAddr%=curr|
0000c600  65 6e 74 6d 65 6e 75 70  74 72 25 2b 32 38 2b 38  |entmenuptr%+28+8|
0000c610  2b 28 73 65 6c 65 63 74  69 6f 6e 25 2a 32 34 29  |+(selection%*24)|
0000c620  0d 44 b6 59 20 20 e7 20  28 21 49 63 6f 6e 46 6c  |.D.Y  . (!IconFl|
0000c630  61 67 73 41 64 64 72 25  3d 26 33 30 30 30 33 31  |agsAddr%=&300031|
0000c640  33 29 20 49 73 47 72 65  79 65 64 4f 75 74 25 3d  |3) IsGreyedOut%=|
0000c650  31 3a f4 20 50 52 4f 43  65 72 72 6f 72 28 22 49  |1:. PROCerror("I|
0000c660  73 20 67 72 65 79 65 64  20 6f 75 74 21 22 2b 43  |s greyed out!"+C|
0000c670  48 52 24 30 29 20 20 20  20 0d 44 c0 06 20 cd 0d  |HR$0)    .D.. ..|
0000c680  44 ca 12 20 6e 65 73 74  6c 65 76 65 6c 25 2b 3d  |D.. nestlevel%+=|
0000c690  31 0d 44 d4 31 20 f4 20  49 73 20 74 68 69 73 20  |1.D.1 . Is this |
0000c6a0  6d 65 6e 75 20 65 6e 74  72 79 20 61 20 70 6f 69  |menu entry a poi|
0000c6b0  6e 74 65 72 20 74 6f 20  61 20 73 75 62 6d 65 6e  |nter to a submen|
0000c6c0  75 3f 0d 44 de 1a 20 e7  20 28 73 75 62 6d 65 6e  |u?.D.. . (submen|
0000c6d0  75 70 74 72 25 3c 3e 2d  31 29 20 8c 0d 44 e8 21  |uptr%<>-1) ..D.!|
0000c6e0  20 20 64 72 6f 70 64 69  72 24 3d 64 72 6f 70 64  |  dropdir$=dropd|
0000c6f0  69 72 24 2b 22 2e 22 2b  6c 65 61 66 24 0d 44 f2  |ir$+"."+leaf$.D.|
0000c700  21 20 20 63 75 72 72 65  6e 74 6d 65 6e 75 70 74  |!  currentmenupt|
0000c710  72 25 3d 73 75 62 6d 65  6e 75 70 74 72 25 0d 44  |r%=submenuptr%.D|
0000c720  fc 06 20 cd 0d 45 06 05  cd 0d 45 10 17 fd 20 6e  |.. ..E....E... n|
0000c730  65 78 74 73 65 6c 65 63  74 69 6f 6e 25 3d 2d 31  |extselection%=-1|
0000c740  0d 45 1a 37 73 75 62 6d  65 6e 75 70 74 72 25 3d  |.E.7submenuptr%=|
0000c750  21 28 63 75 72 72 65 6e  74 6d 65 6e 75 70 74 72  |!(currentmenuptr|
0000c760  25 2b 32 38 2b 28 73 65  6c 65 63 74 69 6f 6e 25  |%+28+(selection%|
0000c770  2a 32 34 29 2b 34 29 0d  45 24 11 6e 65 73 74 6c  |*24)+4).E$.nestl|
0000c780  65 76 65 6c 25 2d 3d 31  0d 45 2e 04 0d 45 38 5a  |evel%-=1.E...E8Z|
0000c790  f4 50 52 4f 43 65 72 72  6f 72 28 22 43 6c 69 63  |.PROCerror("Clic|
0000c7a0  6b 65 64 20 6f 6e 20 22  2b 6c 65 61 66 24 2b 22  |ked on "+leaf$+"|
0000c7b0  5b 22 2b 53 54 52 24 6e  65 73 74 6c 65 76 65 6c  |["+STR$nestlevel|
0000c7c0  25 2b 22 5d 20 69 6e 20  64 69 72 65 63 74 6f 72  |%+"] in director|
0000c7d0  79 20 22 2b 64 72 6f 70  70 61 72 64 69 72 24 2b  |y "+droppardir$+|
0000c7e0  43 48 52 24 30 29 0d 45  42 22 f4 20 49 73 20 74  |CHR$0).EB". Is t|
0000c7f0  68 69 73 20 6d 65 6e 75  20 69 74 65 6d 20 77 72  |his menu item wr|
0000c800  69 74 65 61 62 6c 65 3f  0d 45 4c 39 f4 20 49 66  |iteable?.EL9. If|
0000c810  20 73 6f 2c 20 63 72 65  61 74 65 20 61 20 6e 65  | so, create a ne|
0000c820  77 20 64 69 72 65 63 74  6f 72 79 20 6f 75 74 20  |w directory out |
0000c830  6f 66 20 74 68 65 20 22  77 72 69 74 69 6e 67 73  |of the "writings|
0000c840  22 0d 45 56 33 49 74 65  6d 46 6c 61 67 73 25 20  |".EV3ItemFlags% |
0000c850  3d 20 21 28 6c 61 73 74  6d 65 6e 75 70 74 72 25  |= !(lastmenuptr%|
0000c860  2b 32 38 2b 28 73 65 6c  65 63 74 69 6f 6e 25 2a  |+28+(selection%*|
0000c870  32 34 29 29 0d 45 60 1c  e7 20 28 28 49 74 65 6d  |24)).E`.. ((Item|
0000c880  46 6c 61 67 73 25 20 80  20 34 29 3d 34 29 20 8c  |Flags% . 4)=4) .|
0000c890  0d 45 6a 79 f4 20 50 52  4f 43 65 72 72 6f 72 28  |.Ejy. PROCerror(|
0000c8a0  22 53 65 6c 65 63 74 69  6f 6e 3a 22 2b 53 54 52  |"Selection:"+STR|
0000c8b0  24 73 65 6c 65 63 74 69  6f 6e 25 2b 22 20 41 74  |$selection%+" At|
0000c8c0  20 6c 65 76 65 6c 3a 22  2b 53 54 52 24 6e 65 73  | level:"+STR$nes|
0000c8d0  74 6c 65 76 65 6c 25 2b  22 20 57 72 69 74 61 62  |tlevel%+" Writab|
0000c8e0  6c 65 20 2e 2e 2e 20 49  74 65 6d 46 6c 61 67 73  |le ... ItemFlags|
0000c8f0  3d 22 2b 53 54 52 24 7e  49 74 65 6d 46 6c 61 67  |="+STR$~ItemFlag|
0000c900  73 25 2b 43 48 52 24 30  29 0d 45 74 1b 20 f4 20  |s%+CHR$0).Et. . |
0000c910  43 72 65 61 74 65 20 6e  65 77 20 64 69 72 65 63  |Create new direc|
0000c920  74 6f 72 79 0d 45 7e 25  20 ff 28 22 43 44 49 52  |tory.E~% .("CDIR|
0000c930  20 22 2b 64 72 6f 70 64  69 72 24 2b 22 2e 22 2b  | "+dropdir$+"."+|
0000c940  6c 65 61 66 24 2b bd 30  29 0d 45 88 1c 20 f4 20  |leaf$+.0).E.. . |
0000c950  52 65 62 75 69 6c 64 20  6c 61 73 74 20 73 75 62  |Rebuild last sub|
0000c960  20 6d 65 6e 75 0d 45 92  1a 20 52 65 62 75 69 6c  | menu.E.. Rebuil|
0000c970  64 4c 61 73 74 53 75 62  4d 65 6e 75 25 3d 31 0d  |dLastSubMenu%=1.|
0000c980  45 9c 12 20 52 65 4f 70  65 6e 46 6c 61 67 25 3d  |E.. ReOpenFlag%=|
0000c990  b9 0d 45 a6 05 20 0d 45  b0 06 20 cc 0d 45 ba 04  |..E.. .E.. ..E..|
0000c9a0  0d 45 c4 15 20 e7 20 28  61 64 64 6c 69 6e 6b 25  |.E.. . (addlink%|
0000c9b0  3d 31 29 20 8c 0d 45 ce  4b 20 20 f4 20 50 52 4f  |=1) ..E.K  . PRO|
0000c9c0  43 65 72 72 6f 72 28 22  41 64 64 69 6e 67 20 73  |Cerror("Adding s|
0000c9d0  68 6f 72 74 63 75 74 5b  22 2b 6e 65 77 6c 69 6e  |hortcut["+newlin|
0000c9e0  6b 6c 65 61 66 24 2b 22  5d 20 69 6e 74 6f 20 22  |kleaf$+"] into "|
0000c9f0  2b 64 72 6f 70 64 69 72  24 2b 43 48 52 24 30 29  |+dropdir$+CHR$0)|
0000ca00  0d 45 d8 40 20 20 f2 61  64 64 6e 65 77 73 68 6f  |.E.@  .addnewsho|
0000ca10  72 74 63 75 74 28 63 75  72 72 65 6e 74 64 72 6f  |rtcut(currentdro|
0000ca20  70 64 69 72 24 2c 6e 65  77 6c 69 6e 6b 66 69 6c  |pdir$,newlinkfil|
0000ca30  65 24 2c 6e 65 77 6c 69  6e 6b 6c 65 61 66 24 29  |e$,newlinkleaf$)|
0000ca40  0d 45 e2 1d 20 20 f4 20  52 65 62 75 69 6c 64 20  |.E..  . Rebuild |
0000ca50  6c 61 73 74 20 73 75 62  20 6d 65 6e 75 0d 45 ec  |last sub menu.E.|
0000ca60  1b 20 20 52 65 62 75 69  6c 64 4c 61 73 74 53 75  |.  RebuildLastSu|
0000ca70  62 4d 65 6e 75 25 3d 31  0d 45 f6 13 20 20 52 65  |bMenu%=1.E..  Re|
0000ca80  4f 70 65 6e 46 6c 61 67  25 3d b9 0d 46 00 06 20  |OpenFlag%=..F.. |
0000ca90  cd 0d 46 0a 04 0d 46 14  16 20 e7 20 28 61 64 64  |..F...F.. . (add|
0000caa0  6c 69 6e 6b 25 3d 30 29  20 8c 20 0d 46 1e 3e 20  |link%=0) . .F.> |
0000cab0  20 f4 20 53 68 6f 75 6c  64 20 77 65 20 69 6e 73  | . Should we ins|
0000cac0  65 72 74 20 61 20 77 72  69 74 65 61 62 6c 65 20  |ert a writeable |
0000cad0  73 6f 6d 65 74 68 69 6e  67 20 69 6e 74 6f 20 74  |something into t|
0000cae0  68 69 73 20 6d 65 6e 75  3f 0d 46 28 17 20 20 e7  |his menu?.F(.  .|
0000caf0  20 28 4c 65 66 74 41 6c  74 25 3c 3e 30 29 20 8c  | (LeftAlt%<>0) .|
0000cb00  0d 46 32 4f f4 20 20 50  52 4f 43 65 72 72 6f 72  |.F2O.  PROCerror|
0000cb10  28 22 49 6e 73 65 72 74  69 6e 67 20 61 20 77 72  |("Inserting a wr|
0000cb20  69 74 65 61 62 6c 65 20  69 63 6f 6e 20 69 6e 74  |iteable icon int|
0000cb30  6f 20 6c 65 76 65 6c 3a  22 2b 53 54 52 24 6e 65  |o level:"+STR$ne|
0000cb40  73 74 6c 65 76 65 6c 25  2b 43 48 52 24 30 29 0d  |stlevel%+CHR$0).|
0000cb50  46 3c 1a 20 20 20 41 64  64 57 72 69 74 65 61 62  |F<.   AddWriteab|
0000cb60  6c 65 46 6c 61 67 25 3d  31 0d 46 46 1c 20 20 20  |leFlag%=1.FF.   |
0000cb70  52 65 62 75 69 6c 64 4c  61 73 74 53 75 62 4d 65  |RebuildLastSubMe|
0000cb80  6e 75 25 3d 31 0d 46 50  06 20 20 0d 47 22 14 20  |nu%=1.FP.  .G". |
0000cb90  20 20 52 65 4f 70 65 6e  46 6c 61 67 25 3d b9 0d  |  ReOpenFlag%=..|
0000cba0  47 2c 07 20 20 cd 0d 47  36 05 20 0d 47 40 25 20  |G,.  ..G6. .G@% |
0000cbb0  20 f4 20 49 73 20 74 68  65 20 52 69 67 68 74 20  | . Is the Right |
0000cbc0  41 4c 54 20 6b 65 79 20  70 72 65 73 73 65 64 3f  |ALT key pressed?|
0000cbd0  0d 47 4a 3c 20 20 f4 20  49 66 20 73 6f 20 64 65  |.GJ<  . If so de|
0000cbe0  6c 65 74 65 20 74 68 69  73 20 6c 69 6e 6b 20 4c  |lete this link L|
0000cbf0  41 4c 54 28 2d 36 29 20  52 41 4c 54 28 2d 39 29  |ALT(-6) RALT(-9)|
0000cc00  20 4c 2f 52 20 41 4c 54  28 2d 33 29 0d 47 54 3e  | L/R ALT(-3).GT>|
0000cc10  20 20 e7 20 28 52 69 67  68 74 41 6c 74 25 3c 3e  |  . (RightAlt%<>|
0000cc20  30 20 80 20 49 73 4c 69  6e 6b 44 69 72 65 63 74  |0 . IsLinkDirect|
0000cc30  6f 72 79 25 3d 30 20 80  20 49 73 47 72 65 79 65  |ory%=0 . IsGreye|
0000cc40  64 4f 75 74 25 3d 30 29  20 8c 0d 47 5e 2f 20 20  |dOut%=0) ..G^/  |
0000cc50  20 f4 20 50 52 4f 43 65  72 72 6f 72 28 22 44 65  | . PROCerror("De|
0000cc60  6c 65 74 69 6e 67 20 6c  69 6e 6b 20 22 2b 64 69  |leting link "+di|
0000cc70  72 24 2b 43 48 52 24 30  29 0d 47 68 1b 20 20 20  |r$+CHR$0).Gh.   |
0000cc80  ff 28 22 64 65 6c 65 74  65 20 22 2b 64 69 72 24  |.("delete "+dir$|
0000cc90  2b bd 30 29 0d 47 72 1d  20 20 20 f4 20 41 6c 74  |+.0).Gr.   . Alt|
0000cca0  65 72 20 6d 65 6e 75 20  73 74 72 75 63 74 75 72  |er menu structur|
0000ccb0  65 0d 47 7c 3a 20 20 20  49 63 6f 6e 46 6c 61 67  |e.G|:   IconFlag|
0000ccc0  73 41 64 64 72 25 3d 63  75 72 72 65 6e 74 6d 65  |sAddr%=currentme|
0000ccd0  6e 75 70 74 72 25 2b 32  38 2b 38 2b 28 73 65 6c  |nuptr%+28+8+(sel|
0000cce0  65 63 74 69 6f 6e 25 2a  32 34 29 0d 47 86 43 20  |ection%*24).G.C |
0000ccf0  20 20 21 49 63 6f 6e 46  6c 61 67 73 41 64 64 72  |  !IconFlagsAddr|
0000cd00  25 20 3d 20 28 21 49 63  6f 6e 46 6c 61 67 73 41  |% = (!IconFlagsA|
0000cd10  64 64 72 25 29 2b 28 32  5e 32 32 29 3a f4 20 47  |ddr%)+(2^22):. G|
0000cd20  72 65 79 20 6f 75 74 20  73 70 72 69 74 65 0d 47  |rey out sprite.G|
0000cd30  90 3d 20 20 20 21 49 63  6f 6e 46 6c 61 67 73 41  |.=   !IconFlagsA|
0000cd40  64 64 72 25 20 3d 20 21  49 63 6f 6e 46 6c 61 67  |ddr% = !IconFlag|
0000cd50  73 41 64 64 72 25 20 80  20 26 66 66 66 66 66 66  |sAddr% . &ffffff|
0000cd60  3a f4 20 47 72 65 79 20  6f 75 74 0d 47 9a 38 20  |:. Grey out.G.8 |
0000cd70  20 20 21 49 63 6f 6e 46  6c 61 67 73 41 64 64 72  |  !IconFlagsAddr|
0000cd80  25 20 3d 20 21 49 63 6f  6e 46 6c 61 67 73 41 64  |% = !IconFlagsAd|
0000cd90  64 72 25 2b 26 31 30 30  30 30 30 30 3a f4 20 74  |dr%+&1000000:. t|
0000cda0  65 78 74 0d 47 a4 1e 20  20 20 f4 20 52 65 62 75  |ext.G..   . Rebu|
0000cdb0  69 6c 64 4c 61 73 74 53  75 62 4d 65 6e 75 25 3d  |ildLastSubMenu%=|
0000cdc0  31 0d 47 ae 14 20 20 20  52 65 4f 70 65 6e 46 6c  |1.G..   ReOpenFl|
0000cdd0  61 67 25 3d 31 0d 47 b8  07 20 20 cd 0d 47 c2 06  |ag%=1.G..  ..G..|
0000cde0  20 20 0d 47 cc 31 20 20  f4 20 53 68 6f 75 6c 64  |  .G.1  . Should|
0000cdf0  20 77 65 20 64 65 6c 65  74 65 20 74 68 69 73 20  | we delete this |
0000ce00  64 69 72 65 63 74 6f 72  79 20 6f 66 20 6c 69 6e  |directory of lin|
0000ce10  6b 73 3f 0d 47 d6 3e 20  20 e7 20 28 52 69 67 68  |ks?.G.>  . (Righ|
0000ce20  74 41 6c 74 25 3c 3e 30  20 80 20 49 73 4c 69 6e  |tAlt%<>0 . IsLin|
0000ce30  6b 44 69 72 65 63 74 6f  72 79 25 3d 31 20 80 20  |kDirectory%=1 . |
0000ce40  49 73 47 72 65 79 65 64  4f 75 74 25 3d 30 29 20  |IsGreyedOut%=0) |
0000ce50  8c 0d 47 e0 34 20 20 20  f4 20 50 52 4f 43 65 72  |..G.4   . PROCer|
0000ce60  72 6f 72 28 22 44 65 6c  65 74 69 6e 67 20 64 69  |ror("Deleting di|
0000ce70  72 65 63 74 6f 72 79 20  22 2b 64 69 72 24 2b 43  |rectory "+dir$+C|
0000ce80  48 52 24 30 29 0d 47 ea  23 20 20 20 24 73 74 72  |HR$0).G.#   $str|
0000ce90  69 6e 67 25 20 3d 20 22  64 65 6c 65 74 65 20 22  |ing% = "delete "|
0000cea0  2b 64 69 72 24 2b bd 30  0d 47 f4 2a 20 20 20 c8  |+dir$+.0.G.*   .|
0000ceb0  99 20 22 58 4f 53 5f 43  4c 49 22 2c 73 74 72 69  |. "XOS_CLI",stri|
0000cec0  6e 67 25 20 b8 20 3b 20  45 72 72 6f 72 46 6c 61  |ng% . ; ErrorFla|
0000ced0  67 25 0d 47 fe 5f 20 20  20 e7 20 28 45 72 72 6f  |g%.G._   . (Erro|
0000cee0  72 46 6c 61 67 25 20 80  20 31 29 20 f2 65 72 72  |rFlag% . 1) .err|
0000cef0  6f 72 28 22 45 72 72 6f  72 20 72 65 6d 6f 76 69  |or("Error removi|
0000cf00  6e 67 20 22 2b 64 69 72  24 2b 22 2e 20 54 68 65  |ng "+dir$+". The|
0000cf10  20 64 69 72 65 63 74 6f  72 79 20 6d 61 79 20 6e  | directory may n|
0000cf20  6f 74 20 62 65 20 65 6d  70 74 79 2e 22 2b bd 30  |ot be empty."+.0|
0000cf30  29 0d 48 08 23 20 20 20  f4 4f 53 43 4c 49 28 22  |).H.#   .OSCLI("|
0000cf40  64 65 6c 65 74 65 20 22  2b 64 69 72 24 2b 43 48  |delete "+dir$+CH|
0000cf50  52 24 30 29 0d 48 12 1d  20 20 20 f4 20 41 6c 74  |R$0).H..   . Alt|
0000cf60  65 72 20 6d 65 6e 75 20  73 74 72 75 63 74 75 72  |er menu structur|
0000cf70  65 0d 48 1c 3a 20 20 20  49 63 6f 6e 46 6c 61 67  |e.H.:   IconFlag|
0000cf80  73 41 64 64 72 25 3d 63  75 72 72 65 6e 74 6d 65  |sAddr%=currentme|
0000cf90  6e 75 70 74 72 25 2b 32  38 2b 38 2b 28 73 65 6c  |nuptr%+28+8+(sel|
0000cfa0  65 63 74 69 6f 6e 25 2a  32 34 29 0d 48 26 3a 20  |ection%*24).H&: |
0000cfb0  20 20 f4 20 20 50 52 4f  43 65 72 72 6f 72 28 22  |  .  PROCerror("|
0000cfc0  46 6c 61 67 73 3a 22 2b  53 54 52 24 7e 28 21 49  |Flags:"+STR$~(!I|
0000cfd0  63 6f 6e 46 6c 61 67 73  41 64 64 72 25 29 2b 43  |conFlagsAddr%)+C|
0000cfe0  48 52 24 30 29 0d 48 30  43 20 20 20 f4 20 21 49  |HR$0).H0C   . !I|
0000cff0  63 6f 6e 46 6c 61 67 73  41 64 64 72 25 20 3d 20  |conFlagsAddr% = |
0000d000  28 21 49 63 6f 6e 46 6c  61 67 73 41 64 64 72 25  |(!IconFlagsAddr%|
0000d010  29 2b 28 32 5e 32 32 29  3a 52 45 4d 20 47 72 65  |)+(2^22):REM Gre|
0000d020  79 20 73 70 72 69 74 65  0d 48 3a 43 20 20 20 f4  |y sprite.H:C   .|
0000d030  20 21 49 63 6f 6e 46 6c  61 67 73 41 64 64 72 25  | !IconFlagsAddr%|
0000d040  20 3d 20 21 49 63 6f 6e  46 6c 61 67 73 41 64 64  | = !IconFlagsAdd|
0000d050  72 25 20 41 4e 44 20 26  66 66 66 66 66 66 3a 52  |r% AND &ffffff:R|
0000d060  45 4d 20 47 72 65 79 20  6f 75 74 0d 48 44 3c 20  |EM Grey out.HD< |
0000d070  20 20 f4 20 21 49 63 6f  6e 46 6c 61 67 73 41 64  |  . !IconFlagsAd|
0000d080  64 72 25 20 3d 20 21 49  63 6f 6e 46 6c 61 67 73  |dr% = !IconFlags|
0000d090  41 64 64 72 25 2b 26 31  30 30 30 30 30 30 3a 52  |Addr%+&1000000:R|
0000d0a0  45 4d 20 74 65 78 74 0d  48 4e 1c 20 20 20 52 65  |EM text.HN.   Re|
0000d0b0  62 75 69 6c 64 4c 61 73  74 53 75 62 4d 65 6e 75  |buildLastSubMenu|
0000d0c0  25 3d 31 0d 48 58 17 20  20 20 52 65 4f 70 65 6e  |%=1.HX.   ReOpen|
0000d0d0  46 6c 61 67 25 3d 31 20  20 20 0d 48 62 07 20 20  |Flag%=1   .Hb.  |
0000d0e0  cd 0d 48 6c 05 20 0d 48  76 19 20 20 f4 20 49 73  |..Hl. .Hv.  . Is|
0000d0f0  20 74 68 69 73 20 72 75  6e 6e 61 62 6c 65 3f 0d  | this runnable?.|
0000d100  48 80 51 20 20 f4 20 50  52 4f 43 65 72 72 6f 72  |H.Q  . PROCerror|
0000d110  28 22 73 75 62 6d 65 6e  75 3d 22 2b 53 54 52 24  |("submenu="+STR$|
0000d120  73 75 62 6d 65 6e 75 70  74 72 25 2b 22 20 44 69  |submenuptr%+" Di|
0000d130  72 3f 3a 22 2b 53 54 52  24 49 73 4c 69 6e 6b 44  |r?:"+STR$IsLinkD|
0000d140  69 72 65 63 74 6f 72 79  25 2b 43 48 52 24 30 29  |irectory%+CHR$0)|
0000d150  0d 48 8a 4a 20 20 e7 20  28 4c 65 66 74 41 6c 74  |.H.J  . (LeftAlt|
0000d160  25 3d 30 20 80 20 52 69  67 68 74 41 6c 74 25 3d  |%=0 . RightAlt%=|
0000d170  30 20 80 20 49 73 4c 69  6e 6b 44 69 72 65 63 74  |0 . IsLinkDirect|
0000d180  6f 72 79 25 3d 30 20 80  20 49 73 47 72 65 79 65  |ory%=0 . IsGreye|
0000d190  64 4f 75 74 25 3d 30 29  20 8c 0d 48 94 2f 20 20  |dOut%=0) ..H./  |
0000d1a0  20 f4 20 47 65 74 20 74  68 65 20 64 65 73 6b 74  | . Get the deskt|
0000d1b0  6f 70 20 66 69 6c 65 72  20 74 6f 20 72 75 6e 20  |op filer to run |
0000d1c0  74 68 69 73 20 6c 69 6e  6b 0d 48 9e 2f 20 20 20  |this link.H./   |
0000d1d0  64 69 72 24 3d 22 46 69  6c 65 72 5f 52 75 6e 20  |dir$="Filer_Run |
0000d1e0  22 2b a4 47 65 74 4c 69  6e 6b 43 6f 6e 74 65 6e  |"+.GetLinkConten|
0000d1f0  74 73 28 64 69 72 24 29  0d 48 a8 23 20 20 20 f4  |ts(dir$).H.#   .|
0000d200  20 50 52 4f 43 65 72 72  6f 72 28 22 2a 20 22 2b  | PROCerror("* "+|
0000d210  64 69 72 24 2b 43 48 52  24 30 29 0d 48 b2 27 20  |dir$+CHR$0).H.' |
0000d220  20 20 f4 20 50 52 4f 43  65 72 72 6f 72 28 22 4f  |  . PROCerror("O|
0000d230  53 43 4c 49 20 22 2b 64  69 72 24 2b 43 48 52 24  |SCLI "+dir$+CHR$|
0000d240  30 29 0d 48 bc 11 20 20  20 ff 28 64 69 72 24 2b  |0).H..   .(dir$+|
0000d250  bd 30 29 0d 48 c6 07 20  20 cd 0d 48 d0 19 20 cd  |.0).H..  ..H.. .|
0000d260  3a f4 20 49 46 20 61 64  6c 69 6e 6b 25 3d 30 20  |:. IF adlink%=0 |
0000d270  2e 2e 2e 0d 48 da 18 cd  3a f4 20 49 46 20 77 72  |....H...:. IF wr|
0000d280  69 74 65 61 62 6c 65 20  2e 2e 2e 0d 48 e4 04 0d  |iteable ....H...|
0000d290  48 ee 3b f4 20 43 68 65  63 6b 20 69 66 20 41 44  |H.;. Check if AD|
0000d2a0  4a 55 53 54 20 70 72 65  73 73 65 64 20 69 6e 20  |JUST pressed in |
0000d2b0  77 68 69 63 68 20 63 61  73 65 2c 20 72 65 70 72  |which case, repr|
0000d2c0  69 6e 74 20 6d 65 6e 75  73 2e 0d 48 f8 24 c8 99  |int menus..H.$..|
0000d2d0  22 57 69 6d 70 5f 47 65  74 50 6f 69 6e 74 65 72  |"Wimp_GetPointer|
0000d2e0  49 6e 66 6f 22 2c 2c 62  6c 6f 63 6b 32 25 0d 49  |Info",,block2%.I|
0000d2f0  02 15 62 75 74 74 6f 6e  25 3d 62 6c 6f 63 6b 32  |..button%=block2|
0000d300  25 21 38 0d 49 0c 1d e7  20 62 75 74 74 6f 6e 25  |%!8.I... button%|
0000d310  3d 31 20 52 65 4f 70 65  6e 46 6c 61 67 25 3d b9  |=1 ReOpenFlag%=.|
0000d320  0d 49 16 04 0d 49 20 1d  e7 20 28 52 65 62 75 69  |.I...I .. (Rebui|
0000d330  6c 64 4c 61 73 74 53 75  62 4d 65 6e 75 25 29 20  |ldLastSubMenu%) |
0000d340  8c 0d 49 2a 69 f4 20 50  52 4f 43 65 72 72 6f 72  |..I*i. PROCerror|
0000d350  28 22 52 65 62 75 69 6c  64 69 6e 67 20 73 75 62  |("Rebuilding sub|
0000d360  6d 65 6e 75 20 27 22 2b  70 61 72 65 6e 74 24 2b  |menu '"+parent$+|
0000d370  22 27 20 66 72 6f 6d 20  22 2b 64 72 6f 70 70 61  |"' from "+droppa|
0000d380  72 64 69 72 24 2b 22 20  61 74 20 44 65 70 74 68  |rdir$+" at Depth|
0000d390  3d 22 2b 53 54 52 24 28  6e 65 73 74 6c 65 76 65  |="+STR$(nestleve|
0000d3a0  6c 25 29 2b 43 48 52 24  30 29 0d 49 34 4a f2 53  |l%)+CHR$0).I4J.S|
0000d3b0  69 6e 67 6c 65 44 69 72  65 63 74 6f 72 79 52 65  |ingleDirectoryRe|
0000d3c0  61 64 28 64 72 6f 70 70  61 72 64 69 72 24 2c 70  |ad(droppardir$,p|
0000d3d0  61 72 65 6e 74 24 2c 6e  65 73 74 6c 65 76 65 6c  |arent$,nestlevel|
0000d3e0  25 2c 41 64 64 57 72 69  74 65 61 62 6c 65 46 6c  |%,AddWriteableFl|
0000d3f0  61 67 25 29 0d 49 3e 05  cd 0d 49 48 05 20 0d 49  |ag%).I>...IH. .I|
0000d400  52 15 e7 20 28 52 65 4f  70 65 6e 46 6c 61 67 25  |R.. (ReOpenFlag%|
0000d410  29 20 8c 0d 49 5c 21 20  f2 73 68 6f 77 6d 65 6e  |) ..I\! .showmen|
0000d420  75 28 73 68 6f 72 74 63  75 74 6d 65 6e 75 25 2c  |u(shortcutmenu%,|
0000d430  30 2c 30 29 0d 49 66 06  20 cc 0d 49 70 33 20 49  |0,0).If. ..Ip3 I|
0000d440  63 6f 6e 42 61 72 4d 65  6e 75 4f 70 65 6e 25 3d  |conBarMenuOpen%=|
0000d450  30 3a f4 20 52 65 65 6e  61 62 6c 65 20 69 63 6f  |0:. Reenable ico|
0000d460  6e 20 62 61 72 20 74 6f  6f 6c 74 69 70 0d 49 7a  |n bar tooltip.Iz|
0000d470  05 cd 0d 49 84 05 e1 0d  49 8e 04 0d 49 98 19 dd  |...I....I...I...|
0000d480  f2 63 6c 69 63 6b 5f 69  6e 66 6f 28 62 75 74 74  |.click_info(butt|
0000d490  6f 6e 25 29 0d 49 a2 10  c8 8e 20 62 75 74 74 6f  |on%).I.... butto|
0000d4a0  6e 25 20 ca 0d 49 ac 56  c9 20 32 3a 43 75 72 72  |n% ..I.V. 2:Curr|
0000d4b0  65 6e 74 4d 65 6e 75 54  79 70 65 25 3d 4d 61 69  |entMenuType%=Mai|
0000d4c0  6e 4d 65 6e 75 54 79 70  65 25 3a f2 73 68 6f 77  |nMenuType%:.show|
0000d4d0  6d 65 6e 75 28 6d 61 69  6e 5f 6d 65 6e 75 25 2c  |menu(main_menu%,|
0000d4e0  21 62 6c 6f 63 6b 25 2d  36 34 2c 20 28 62 6c 6f  |!block%-64, (blo|
0000d4f0  63 6b 25 21 34 29 2b 33  32 29 0d 49 b6 05 cb 0d  |ck%!4)+32).I....|
0000d500  49 c0 05 e1 0d 49 ca 04  0d 49 d4 28 dd f2 77 69  |I....I...I.(..wi|
0000d510  6e 64 6f 77 6d 65 6e 75  73 65 6c 65 63 74 28 57  |ndowmenuselect(W|
0000d520  69 6e 64 6f 77 4d 65 6e  75 49 6e 64 65 78 25 29  |indowMenuIndex%)|
0000d530  0d 49 de 23 ea 20 4f 70  65 6e 57 69 6e 25 2c 20  |.I.#. OpenWin%, |
0000d540  45 72 72 6f 72 46 6c 61  67 25 2c 20 62 75 74 74  |ErrorFlag%, butt|
0000d550  6f 6e 25 0d 49 e8 1f ea  20 57 69 6e 4d 65 6e 75  |on%.I... WinMenu|
0000d560  49 74 65 6d 46 6c 61 67  25 2c 20 41 63 74 69 6f  |ItemFlag%, Actio|
0000d570  6e 25 0d 49 f2 32 f4 20  62 6c 6f 63 6b 25 2b 30  |n%.I.2. block%+0|
0000d580  30 20 69 73 20 73 65 6c  65 63 74 69 6f 6e 20 6e  |0 is selection n|
0000d590  75 6d 62 65 72 20 6f 66  20 66 69 72 73 74 20 6d  |umber of first m|
0000d5a0  65 6e 75 2c 0d 49 fc 38  f4 20 62 6c 6f 63 6b 25  |enu,.I.8. block%|
0000d5b0  2b 30 34 20 69 73 20 73  65 6c 65 63 74 69 6f 6e  |+04 is selection|
0000d5c0  20 6e 75 6d 62 65 72 20  6f 66 20 73 65 63 6f 6e  | number of secon|
0000d5d0  64 20 6c 65 76 65 6c 20  65 74 63 2e 0d 4a 06 21  |d level etc..J.!|
0000d5e0  f4 73 65 6c 31 25 3d 21  62 6c 6f 63 6b 25 3a 73  |.sel1%=!block%:s|
0000d5f0  65 6c 32 25 3d 62 6c 6f  63 6b 25 21 34 0d 4a 10  |el2%=block%!4.J.|
0000d600  1a 73 65 6c 31 25 3d 57  69 6e 64 6f 77 4d 65 6e  |.sel1%=WindowMen|
0000d610  75 49 6e 64 65 78 25 0d  4a 1a 23 c8 99 22 57 69  |uIndex%.J.#.."Wi|
0000d620  6d 70 5f 47 65 74 50 6f  69 6e 74 65 72 49 6e 66  |mp_GetPointerInf|
0000d630  6f 22 2c 2c 62 6c 6f 63  6b 25 0d 4a 24 14 62 75  |o",,block%.J$.bu|
0000d640  74 74 6f 6e 25 3d 62 6c  6f 63 6b 25 21 38 0d 4a  |tton%=block%!8.J|
0000d650  2e 51 f4 20 50 52 4f 43  65 72 72 6f 72 28 22 5b  |.Q. PROCerror("[|
0000d660  22 2b 53 54 52 24 73 65  6c 31 25 2b 22 5d 20 4f  |"+STR$sel1%+"] O|
0000d670  70 65 6e 69 6e 67 20 22  2b 24 28 73 68 6f 72 74  |pening "+$(short|
0000d680  63 75 74 6d 65 6e 75 64  61 74 61 25 2b 28 73 65  |cutmenudata%+(se|
0000d690  6c 31 25 2a 36 34 29 29  2b 43 48 52 24 30 29 0d  |l1%*64))+CHR$0).|
0000d6a0  4a 38 2f 4f 70 65 6e 57  69 6e 25 3d 21 28 73 68  |J8/OpenWin%=!(sh|
0000d6b0  6f 72 74 63 75 74 6d 65  6e 75 64 61 74 61 25 2b  |ortcutmenudata%+|
0000d6c0  28 73 65 6c 31 25 2a 36  34 29 2b 36 30 29 0d 4a  |(sel1%*64)+60).J|
0000d6d0  42 1b 21 77 69 6e 6f 70  65 6e 62 6c 6f 63 6b 25  |B.!winopenblock%|
0000d6e0  3d 4f 70 65 6e 57 69 6e  25 0d 4a 4c 3a c8 99 22  |=OpenWin%.JL:.."|
0000d6f0  58 57 69 6d 70 5f 47 65  74 57 69 6e 64 6f 77 53  |XWimp_GetWindowS|
0000d700  74 61 74 65 22 2c 2c 77  69 6e 6f 70 65 6e 62 6c  |tate",,winopenbl|
0000d710  6f 63 6b 25 20 b8 20 3b  20 45 72 72 6f 72 46 6c  |ock% . ; ErrorFl|
0000d720  61 67 25 0d 4a 56 17 e7  20 28 45 72 72 6f 72 46  |ag%.JV.. (ErrorF|
0000d730  6c 61 67 25 3c 3e 30 29  20 8c 0d 4a 60 18 20 77  |lag%<>0) ..J`. w|
0000d740  69 6e 6f 70 65 6e 62 6c  6f 63 6b 25 21 32 38 3d  |inopenblock%!28=|
0000d750  2d 31 0d 4a 6a 1c 20 41  63 74 69 6f 6e 25 3d 30  |-1.Jj. Action%=0|
0000d760  3a f4 20 4f 70 65 6e 20  57 69 6e 64 6f 77 0d 4a  |:. Open Window.J|
0000d770  74 2c 20 e7 20 28 a6 2d  31 29 20 41 63 74 69 6f  |t, . (.-1) Actio|
0000d780  6e 25 3d 31 3a f4 20 4f  70 65 6e 20 70 61 72 65  |n%=1:. Open pare|
0000d790  6e 74 20 28 53 48 49 46  54 29 0d 4a 7e 2d 20 f4  |nt (SHIFT).J~- .|
0000d7a0  20 49 46 20 28 49 4e 4b  45 59 2d 33 29 20 41 63  | IF (INKEY-3) Ac|
0000d7b0  74 69 6f 6e 25 3d 32 3a  52 45 4d 20 43 6c 6f 73  |tion%=2:REM Clos|
0000d7c0  65 20 28 41 4c 54 29 0d  4a 88 04 0d 4a 92 14 20  |e (ALT).J...J.. |
0000d7d0  e7 20 28 41 63 74 69 6f  6e 25 3d 30 29 20 8c 0d  |. (Action%=0) ..|
0000d7e0  4a 9c 36 20 20 c8 99 20  22 58 57 69 6d 70 5f 53  |J.6  .. "XWimp_S|
0000d7f0  65 6e 64 4d 65 73 73 61  67 65 22 2c 32 2c 20 77  |endMessage",2, w|
0000d800  69 6e 6f 70 65 6e 62 6c  6f 63 6b 25 2c 4f 70 65  |inopenblock%,Ope|
0000d810  6e 57 69 6e 25 0d 4a a6  06 20 cd 0d 4a b0 05 20  |nWin%.J.. ..J.. |
0000d820  0d 4a ba 14 20 e7 20 28  41 63 74 69 6f 6e 25 3d  |.J.. . (Action%=|
0000d830  31 29 20 8c 0d 4a c4 36  20 20 c8 99 20 22 58 57  |1) ..J.6  .. "XW|
0000d840  69 6d 70 5f 53 65 6e 64  4d 65 73 73 61 67 65 22  |imp_SendMessage"|
0000d850  2c 33 2c 20 77 69 6e 6f  70 65 6e 62 6c 6f 63 6b  |,3, winopenblock|
0000d860  25 2c 4f 70 65 6e 57 69  6e 25 0d 4a ce 06 20 cd  |%,OpenWin%.J.. .|
0000d870  0d 4a d8 05 20 0d 4a e2  15 20 20 e7 20 28 41 63  |.J.. .J..  . (Ac|
0000d880  74 69 6f 6e 25 3d 32 29  20 8c 0d 4a ec 1e 20 20  |tion%=2) ..J..  |
0000d890  20 21 77 69 6e 6f 70 65  6e 62 6c 6f 63 6b 25 3d  | !winopenblock%=|
0000d8a0  4f 70 65 6e 57 69 6e 25  0d 4a f6 2c 20 20 20 c8  |OpenWin%.J.,   .|
0000d8b0  99 20 22 58 57 69 6d 70  5f 43 6c 6f 73 65 57 69  |. "XWimp_CloseWi|
0000d8c0  6e 64 6f 77 22 2c 2c 77  69 6e 6f 70 65 6e 62 6c  |ndow",,winopenbl|
0000d8d0  6f 63 6b 25 0d 4b 00 21  20 20 20 f4 20 47 72 65  |ock%.K.!   . Gre|
0000d8e0  79 20 6f 75 74 20 74 68  69 73 20 6d 65 6e 75 20  |y out this menu |
0000d8f0  65 6e 74 72 79 0d 4b 0a  3a 20 20 20 57 69 6e 4d  |entry.K.:   WinM|
0000d900  65 6e 75 49 74 65 6d 46  6c 61 67 25 20 3d 20 21  |enuItemFlag% = !|
0000d910  28 73 68 6f 72 74 63 75  74 6d 65 6e 75 25 2b 32  |(shortcutmenu%+2|
0000d920  38 2b 28 73 65 6c 31 25  2a 32 34 29 2b 38 29 0d  |8+(sel1%*24)+8).|
0000d930  4b 14 35 20 20 20 57 69  6e 4d 65 6e 75 49 74 65  |K.5   WinMenuIte|
0000d940  6d 46 6c 61 67 25 20 3d  20 57 69 6e 4d 65 6e 75  |mFlag% = WinMenu|
0000d950  49 74 65 6d 46 6c 61 67  25 20 84 20 26 34 30 30  |ItemFlag% . &400|
0000d960  30 30 30 20 0d 4b 1e 3a  20 20 20 21 28 73 68 6f  |000 .K.:   !(sho|
0000d970  72 74 63 75 74 6d 65 6e  75 25 2b 32 38 2b 28 73  |rtcutmenu%+28+(s|
0000d980  65 6c 31 25 2a 32 34 29  2b 38 29 20 3d 20 57 69  |el1%*24)+8) = Wi|
0000d990  6e 4d 65 6e 75 49 74 65  6d 46 6c 61 67 25 0d 4b  |nMenuItemFlag%.K|
0000d9a0  28 07 20 20 cd 0d 4b 32  06 20 20 0d 4b 3c 05 cd  |(.  ..K2.  .K<..|
0000d9b0  0d 4b 46 04 0d 4b 50 3b  f4 20 43 68 65 63 6b 20  |.KF..KP;. Check |
0000d9c0  69 66 20 41 44 4a 55 53  54 20 70 72 65 73 73 65  |if ADJUST presse|
0000d9d0  64 20 69 6e 20 77 68 69  63 68 20 63 61 73 65 2c  |d in which case,|
0000d9e0  20 72 65 70 72 69 6e 74  20 6d 65 6e 75 73 2e 0d  | reprint menus..|
0000d9f0  4b 5a 11 e7 20 62 75 74  74 6f 6e 25 3d 31 20 8c  |KZ.. button%=1 .|
0000da00  0d 4b 64 20 f2 73 68 6f  77 6d 65 6e 75 28 73 68  |.Kd .showmenu(sh|
0000da10  6f 72 74 63 75 74 6d 65  6e 75 25 2c 30 2c 30 29  |ortcutmenu%,0,0)|
0000da20  0d 4b 6e 2a 43 75 72 72  65 6e 74 4d 65 6e 75 54  |.Kn*CurrentMenuT|
0000da30  79 70 65 25 20 3d 20 57  69 6e 64 6f 77 4c 69 73  |ype% = WindowLis|
0000da40  74 4d 65 6e 75 54 79 70  65 25 0d 4b 78 05 cc 0d  |tMenuType%.Kx...|
0000da50  4b 82 1e f4 20 53 59 53  22 57 69 6d 70 5f 43 72  |K... SYS"Wimp_Cr|
0000da60  65 61 74 65 4d 65 6e 75  22 2c 2c 2d 31 0d 4b 8c  |eateMenu",,-1.K.|
0000da70  32 49 63 6f 6e 42 61 72  4d 65 6e 75 4f 70 65 6e  |2IconBarMenuOpen|
0000da80  25 3d 30 3a f4 20 52 65  65 6e 61 62 6c 65 20 69  |%=0:. Reenable i|
0000da90  63 6f 6e 20 62 61 72 20  74 6f 6f 6c 74 69 70 0d  |con bar tooltip.|
0000daa0  4b 96 05 cd 0d 4b a0 04  0d 4b aa 05 e1 0d 4b b4  |K....K...K....K.|
0000dab0  04 0d 4b be 14 dd f2 6d  61 69 6e 6d 65 6e 75 73  |..K....mainmenus|
0000dac0  65 6c 65 63 74 0d 4b c8  32 f4 20 62 6c 6f 63 6b  |elect.K.2. block|
0000dad0  25 2b 30 30 20 69 73 20  73 65 6c 65 63 74 69 6f  |%+00 is selectio|
0000dae0  6e 20 6e 75 6d 62 65 72  20 6f 66 20 66 69 72 73  |n number of firs|
0000daf0  74 20 6d 65 6e 75 2c 0d  4b d2 38 f4 20 62 6c 6f  |t menu,.K.8. blo|
0000db00  63 6b 25 2b 30 34 20 69  73 20 73 65 6c 65 63 74  |ck%+04 is select|
0000db10  69 6f 6e 20 6e 75 6d 62  65 72 20 6f 66 20 73 65  |ion number of se|
0000db20  63 6f 6e 64 20 6c 65 76  65 6c 20 65 74 63 2e 0d  |cond level etc..|
0000db30  4b dc 20 73 65 6c 31 25  3d 21 62 6c 6f 63 6b 25  |K. sel1%=!block%|
0000db40  3a 73 65 6c 32 25 3d 62  6c 6f 63 6b 25 21 34 0d  |:sel2%=block%!4.|
0000db50  4b e6 23 c8 99 22 57 69  6d 70 5f 47 65 74 50 6f  |K.#.."Wimp_GetPo|
0000db60  69 6e 74 65 72 49 6e 66  6f 22 2c 2c 62 6c 6f 63  |interInfo",,bloc|
0000db70  6b 25 0d 4b f0 14 62 75  74 74 6f 6e 25 3d 62 6c  |k%.K..button%=bl|
0000db80  6f 63 6b 25 21 38 0d 4b  fa 0e c8 8e 20 73 65 6c  |ock%!8.K.... sel|
0000db90  31 25 20 ca 0d 4c 04 14  c9 20 30 3a f2 4f 70 65  |1% ..L... 0:.Ope|
0000dba0  6e 49 6e 66 6f 42 6f 78  0d 4c 0e 1d c9 20 31 3a  |nInfoBox.L... 1:|
0000dbb0  f2 43 6c 69 63 6b 54 6f  6f 6c 4d 65 6e 75 28 73  |.ClickToolMenu(s|
0000dbc0  65 6c 32 25 29 0d 4c 18  35 c9 20 32 3a f2 65 72  |el2%).L.5. 2:.er|
0000dbd0  72 6f 72 28 22 53 6f 72  72 79 2c 20 54 4f 44 4f  |ror("Sorry, TODO|
0000dbe0  2e 22 2b bd 30 29 3a f4  20 50 52 4f 43 43 6c 69  |."+.0):. PROCCli|
0000dbf0  63 6b 55 73 65 72 4d 65  6e 75 0d 4c 22 18 c9 20  |ckUserMenu.L".. |
0000dc00  33 3a f2 43 6c 69 63 6b  48 65 6c 70 42 75 74 74  |3:.ClickHelpButt|
0000dc10  6f 6e 0d 4c 2c 1c c9 20  34 3a f2 54 6f 67 67 6c  |on.L,.. 4:.Toggl|
0000dc20  65 41 64 76 61 6e 63 65  64 4d 65 6e 75 73 0d 4c  |eAdvancedMenus.L|
0000dc30  36 10 c9 20 35 3a f2 63  61 73 63 61 64 65 0d 4c  |6.. 5:.cascade.L|
0000dc40  40 11 c9 20 36 3a f2 53  68 6f 77 54 72 65 65 0d  |@.. 6:.ShowTree.|
0000dc50  4c 4a 0f c9 20 37 3a 71  75 69 74 25 3d b9 0d 4c  |LJ.. 7:quit%=..L|
0000dc60  54 05 cb 0d 4c 5e 3b f4  20 43 68 65 63 6b 20 69  |T...L^;. Check i|
0000dc70  66 20 41 44 4a 55 53 54  20 70 72 65 73 73 65 64  |f ADJUST pressed|
0000dc80  20 69 6e 20 77 68 69 63  68 20 63 61 73 65 2c 20  | in which case, |
0000dc90  72 65 70 72 69 6e 74 20  6d 65 6e 75 73 2e 0d 4c  |reprint menus..L|
0000dca0  68 11 e7 20 62 75 74 74  6f 6e 25 3d 31 20 8c 0d  |h.. button%=1 ..|
0000dcb0  4c 72 1d f2 73 68 6f 77  6d 65 6e 75 28 6d 61 69  |Lr..showmenu(mai|
0000dcc0  6e 5f 6d 65 6e 75 25 2c  30 2c 30 29 0d 4c 7c 05  |n_menu%,0,0).L|.|
0000dcd0  cc 0d 4c 86 32 49 63 6f  6e 42 61 72 4d 65 6e 75  |..L.2IconBarMenu|
0000dce0  4f 70 65 6e 25 3d 30 3a  f4 20 52 65 65 6e 61 62  |Open%=0:. Reenab|
0000dcf0  6c 65 20 69 63 6f 6e 20  62 61 72 20 74 6f 6f 6c  |le icon bar tool|
0000dd00  74 69 70 0d 4c 90 05 cd  0d 4c 9a 05 e1 0d 4c a4  |tip.L....L....L.|
0000dd10  04 0d 4c ae 15 dd f2 43  6c 69 63 6b 48 65 6c 70  |..L....ClickHelp|
0000dd20  42 75 74 74 6f 6e 0d 4c  b8 25 ff 28 22 46 69 6c  |Button.L.%.("Fil|
0000dd30  65 72 5f 52 75 6e 20 3c  78 75 65 6e 62 73 24 64  |er_Run <xuenbs$d|
0000dd40  69 72 3e 2e 21 68 65 6c  70 22 29 0d 4c c2 05 e1  |ir>.!help").L...|
0000dd50  0d 4c cc 04 0d 4c d6 1a  dd f2 43 6c 69 63 6b 54  |.L...L....ClickT|
0000dd60  6f 6f 6c 4d 65 6e 75 28  73 65 6c 32 25 29 0d 4c  |oolMenu(sel2%).L|
0000dd70  e0 0e c8 8e 20 73 65 6c  32 25 20 ca 0d 4c ea 0e  |.... sel2% ..L..|
0000dd80  c9 20 30 3a f2 63 6c 65  61 72 0d 4c f4 0e c9 20  |. 0:.clear.L... |
0000dd90  31 3a f2 73 6d 61 73 68  0d 4c fe 12 c9 20 32 3a  |1:.smash.L... 2:|
0000dda0  f2 4f 70 65 6e 4c 69 6e  6b 73 0d 4d 08 18 c9 20  |.OpenLinks.M... |
0000ddb0  33 3a f2 53 61 76 65 53  70 72 69 74 65 50 6f 6f  |3:.SaveSpritePoo|
0000ddc0  6c 73 0d 4d 12 05 cb 0d  4d 1c 05 e1 0d 4d 26 04  |ls.M....M....M&.|
0000ddd0  0d 4d 30 15 dd f2 53 61  76 65 53 70 72 69 74 65  |.M0...SaveSprite|
0000dde0  50 6f 6f 6c 73 0d 4d 3a  37 ff 28 22 46 69 6c 65  |Pools.M:7.("File|
0000ddf0  72 5f 52 75 6e 20 22 2b  41 70 70 50 61 74 68 24  |r_Run "+AppPath$|
0000de00  2b 22 2e 52 65 73 6f 75  72 63 65 73 2e 47 65 74  |+".Resources.Get|
0000de10  53 70 72 69 74 65 73 22  2b bd 30 29 0d 4d 44 05  |Sprites"+.0).MD.|
0000de20  e1 0d 4d 4e 04 0d 4d 58  0b dd f2 73 6d 61 73 68  |..MN..MX...smash|
0000de30  0d 4d 62 37 ff 28 22 46  69 6c 65 72 5f 52 75 6e  |.Mb7.("Filer_Run|
0000de40  20 22 2b 41 70 70 50 61  74 68 24 2b 22 2e 52 65  | "+AppPath$+".Re|
0000de50  73 6f 75 72 63 65 73 2e  53 6d 61 73 68 43 6c 6f  |sources.SmashClo|
0000de60  73 65 22 2b bd 30 29 0d  4d 6c 05 e1 0d 4d 76 04  |se"+.0).Ml...Mv.|
0000de70  0d 4d 80 0f dd f2 4f 70  65 6e 4c 69 6e 6b 73 0d  |.M....OpenLinks.|
0000de80  4d 8a 3c ff 28 22 46 69  6c 65 72 5f 4f 70 65 6e  |M.<.("Filer_Open|
0000de90  64 69 72 20 22 2b 41 70  70 50 61 74 68 24 2b 22  |dir "+AppPath$+"|
0000dea0  2e 55 73 65 72 73 2e 22  2b 55 73 65 72 24 2b 22  |.Users."+User$+"|
0000deb0  2e 4c 69 6e 6b 73 22 2b  bd 30 29 0d 4d 94 05 e1  |.Links"+.0).M...|
0000dec0  0d 4d 9e 04 0d 4d a8 1d  dd f2 73 68 6f 77 6d 65  |.M...M....showme|
0000ded0  6e 75 28 6d 65 6e 75 25  2c 6d 78 25 2c 6d 79 25  |nu(menu%,mx%,my%|
0000dee0  29 0d 4d b2 3b c8 99 22  57 69 6d 70 5f 43 72 65  |).M.;.."Wimp_Cre|
0000def0  61 74 65 4d 65 6e 75 22  2c 2c 6d 65 6e 75 25 2c  |ateMenu",,menu%,|
0000df00  6d 78 25 2c 6d 79 25 20  b8 20 63 75 72 72 65 6e  |mx%,my% . curren|
0000df10  74 6d 65 6e 75 68 61 6e  64 6c 65 25 0d 4d bc 05  |tmenuhandle%.M..|
0000df20  e1 0d 4d c6 04 0d 4d d0  39 f4 20 2a 2a 2a 2a 2a  |..M...M.9. *****|
0000df30  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000df50  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 0d 4d  |**************.M|
0000df60  da 04 0d 4d e4 0e dd f2  53 68 6f 77 54 72 65 65  |...M....ShowTree|
0000df70  0d 4d ee 1b 21 62 6c 6f  63 6b 25 20 3d 20 77 68  |.M..!block% = wh|
0000df80  61 6e 64 6c 65 5f 74 72  65 65 25 0d 4d f8 11 62  |andle_tree%.M..b|
0000df90  6c 6f 63 6b 25 21 34 20  3d 20 36 34 0d 4e 02 11  |lock%!4 = 64.N..|
0000dfa0  62 6c 6f 63 6b 25 21 38  20 3d 20 36 34 0d 4e 0c  |block%!8 = 64.N.|
0000dfb0  14 62 6c 6f 63 6b 25 21  31 32 20 3d 20 31 30 32  |.block%!12 = 102|
0000dfc0  34 0d 4e 16 13 62 6c 6f  63 6b 25 21 31 36 20 3d  |4.N..block%!16 =|
0000dfd0  20 39 31 32 0d 4e 20 11  62 6c 6f 63 6b 25 21 32  | 912.N .block%!2|
0000dfe0  30 20 3d 20 30 0d 4e 2a  11 62 6c 6f 63 6b 25 21  |0 = 0.N*.block%!|
0000dff0  32 34 20 3d 20 30 0d 4e  34 12 62 6c 6f 63 6b 25  |24 = 0.N4.block%|
0000e000  21 32 38 20 3d 20 2d 31  0d 4e 3e 1f c8 99 22 57  |!28 = -1.N>..."W|
0000e010  69 6d 70 5f 4f 70 65 6e  57 69 6e 64 6f 77 22 2c  |imp_OpenWindow",|
0000e020  2c 62 6c 6f 63 6b 25 0d  4e 48 04 0d 4e 52 25 f4  |,block%.NH..NR%.|
0000e030  20 50 52 4f 43 65 72 72  6f 72 28 22 53 6f 72 72  | PROCerror("Sorr|
0000e040  79 2c 20 54 4f 44 4f 2e  22 2b 43 48 52 24 30 29  |y, TODO."+CHR$0)|
0000e050  0d 4e 5c 05 e1 0d 4e 66  04 0d 4e 70 39 f4 20 2a  |.N\...Nf..Np9. *|
0000e060  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000e090  2a 2a 0d 4e 7a 04 0d 4e  84 19 dd f2 54 6f 67 67  |**.Nz..N....Togg|
0000e0a0  6c 65 41 64 76 61 6e 63  65 64 4d 65 6e 75 73 0d  |leAdvancedMenus.|
0000e0b0  4e 8e 0b ea 20 66 6c 61  67 25 0d 4e 98 39 47 6c  |N... flag%.N.9Gl|
0000e0c0  6f 62 61 6c 53 68 6f 77  42 6f 6f 74 4d 65 6e 75  |obalShowBootMenu|
0000e0d0  46 6c 61 67 25 20 3d 20  47 6c 6f 62 61 6c 53 68  |Flag% = GlobalSh|
0000e0e0  6f 77 42 6f 6f 74 4d 65  6e 75 46 6c 61 67 25 20  |owBootMenuFlag% |
0000e0f0  82 20 31 0d 4e a2 22 66  6c 61 67 73 25 3d 21 28  |. 1.N."flags%=!(|
0000e100  6d 61 69 6e 5f 6d 65 6e  75 25 2b 32 38 2b 28 34  |main_menu%+28+(4|
0000e110  2a 32 34 29 29 0d 4e ac  31 66 6c 61 67 73 25 20  |*24)).N.1flags% |
0000e120  3d 20 66 6c 61 67 25 20  82 20 28 47 6c 6f 62 61  |= flag% . (Globa|
0000e130  6c 53 68 6f 77 42 6f 6f  74 4d 65 6e 75 46 6c 61  |lShowBootMenuFla|
0000e140  67 25 3c 3c 30 29 0d 4e  b6 2f f4 20 50 52 4f 43  |g%<<0).N./. PROC|
0000e150  65 72 72 6f 72 28 22 46  6c 61 67 73 20 3d 20 22  |error("Flags = "|
0000e160  2b 53 54 52 24 7e 28 66  6c 61 67 73 25 29 2b 43  |+STR$~(flags%)+C|
0000e170  48 52 24 30 29 0d 4e c0  22 21 28 6d 61 69 6e 5f  |HR$0).N."!(main_|
0000e180  6d 65 6e 75 25 2b 32 38  2b 28 34 2a 32 34 29 29  |menu%+28+(4*24))|
0000e190  3d 66 6c 61 67 73 25 0d  4e ca 05 e1 0d 4e d4 04  |=flags%.N....N..|
0000e1a0  0d 4e de 39 f4 20 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |.N.9. **********|
0000e1b0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000e1d0  2a 2a 2a 2a 2a 2a 2a 2a  2a 0d 4e e8 04 0d 4e f2  |*********.N...N.|
0000e1e0  04 0d 4e fc 29 f4 20 54  65 6c 6c 20 57 49 4d 50  |..N.). Tell WIMP|
0000e1f0  20 74 6f 20 69 6e 69 74  69 61 6c 69 73 65 20 61  | to initialise a|
0000e200  20 6e 65 77 20 6d 65 6e  75 2e 0d 4f 06 3f f4 20  | new menu..O.?. |
0000e210  54 68 69 73 20 73 68 6f  75 6c 64 20 72 65 61 6c  |This should real|
0000e220  6c 79 20 62 65 20 64 6f  6e 65 20 62 79 20 6c 6f  |ly be done by lo|
0000e230  61 64 69 6e 67 20 69 6e  20 61 20 4d 45 4e 55 20  |ading in a MENU |
0000e240  74 65 6d 70 6c 61 74 65  2e 0d 4f 10 16 dd f2 73  |template..O....s|
0000e250  65 74 75 70 6d 65 6e 75  28 6d 65 6e 75 25 29 0d  |etupmenu(menu%).|
0000e260  4f 1a 1f f3 20 74 69 74  6c 65 24 2c 6e 75 6d 25  |O... title$,num%|
0000e270  3a 24 6d 65 6e 75 25 3d  74 69 74 6c 65 24 0d 4f  |:$menu%=title$.O|
0000e280  24 1b 77 69 64 74 68 25  3d 28 a9 28 74 69 74 6c  |$.width%=(.(titl|
0000e290  65 24 29 2d 32 29 2a 31  36 0d 4f 2e 2d 6d 65 6e  |e$)-2)*16.O.-men|
0000e2a0  75 25 21 31 32 3d 26 30  30 30 37 30 32 30 37 3a  |u%!12=&00070207:|
0000e2b0  6d 65 6e 75 25 21 32 30  3d 34 34 3a 6d 65 6e 75  |menu%!20=44:menu|
0000e2c0  25 21 32 34 3d 30 0d 4f  38 1d 70 74 72 25 3d 6d  |%!24=0.O8.ptr%=m|
0000e2d0  65 6e 75 25 2b 32 38 3a  e3 20 69 25 3d 31 b8 6e  |enu%+28:. i%=1.n|
0000e2e0  75 6d 25 0d 4f 42 1b f3  20 6d 66 6c 61 67 73 25  |um%.OB.. mflags%|
0000e2f0  2c 73 75 62 70 74 72 25  2c 69 74 65 6d 24 0d 4f  |,subptr%,item$.O|
0000e300  4c 20 21 70 74 72 25 3d  6d 66 6c 61 67 73 25 3a  |L !ptr%=mflags%:|
0000e310  70 74 72 25 21 34 3d 73  75 62 70 74 72 25 0d 4f  |ptr%!4=subptr%.O|
0000e320  56 24 70 74 72 25 21 38  3d 26 37 30 30 30 30 32  |V$ptr%!8=&700002|
0000e330  31 3a 24 28 70 74 72 25  2b 31 32 29 3d 69 74 65  |1:$(ptr%+12)=ite|
0000e340  6d 24 0d 4f 60 16 61 25  3d 28 a9 28 69 74 65 6d  |m$.O`.a%=(.(item|
0000e350  24 29 2b 31 29 2a 31 36  0d 4f 6a 19 e7 20 61 25  |$)+1)*16.Oj.. a%|
0000e360  3e 77 69 64 74 68 25 20  77 69 64 74 68 25 3d 61  |>width% width%=a|
0000e370  25 0d 4f 74 0e 70 74 72  25 2b 3d 32 34 3a ed 0d  |%.Ot.ptr%+=24:..|
0000e380  4f 7e 13 6d 65 6e 75 25  21 31 36 3d 77 69 64 74  |O~.menu%!16=widt|
0000e390  68 25 0d 4f 88 05 e1 0d  4f 92 04 0d 4f 9c 39 f4  |h%.O....O...O.9.|
0000e3a0  20 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  | ***************|
0000e3b0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000e3d0  2a 2a 2a 2a 0d 4f a6 04  0d 4f b0 0a dd f2 69 6e  |****.O...O....in|
0000e3e0  69 74 0d 4f ba 3d f4 20  44 6f 20 7e 7e 4f 70 65  |it.O.=. Do ~~Ope|
0000e3f0  6e 20 61 6e 64 20 7e 7e  43 6c 6f 73 65 20 66 69  |n and ~~Close fi|
0000e400  6c 65 73 20 65 78 69 73  74 3f 20 49 66 20 6e 6f  |les exist? If no|
0000e410  74 2c 20 63 72 65 61 74  65 20 65 6d 70 74 79 0d  |t, create empty.|
0000e420  4f c4 30 f4 20 63 6f 70  69 65 73 20 6f 66 20 74  |O.0. copies of t|
0000e430  68 65 6d 20 74 6f 20 70  72 65 76 65 6e 74 20 21  |hem to prevent !|
0000e440  53 74 61 72 74 20 63 72  61 73 68 69 6e 67 2e 0d  |Start crashing..|
0000e450  4f ce 04 0d 4f d8 21 f2  65 6e 73 75 72 65 64 69  |O...O.!.ensuredi|
0000e460  72 28 41 70 70 50 61 74  68 24 2b 22 2e 55 73 65  |r(AppPath$+".Use|
0000e470  72 73 22 29 0d 4f e2 28  f2 65 6e 73 75 72 65 64  |rs").O.(.ensured|
0000e480  69 72 28 41 70 70 50 61  74 68 24 2b 22 2e 55 73  |ir(AppPath$+".Us|
0000e490  65 72 73 2e 22 2b 55 73  65 72 24 29 0d 4f ec 31  |ers."+User$).O.1|
0000e4a0  f2 65 6e 73 75 72 65 64  69 72 28 41 70 70 50 61  |.ensuredir(AppPa|
0000e4b0  74 68 24 2b 22 2e 55 73  65 72 73 2e 22 2b 55 73  |th$+".Users."+Us|
0000e4c0  65 72 24 2b 22 2e 4c 69  6e 6b 73 22 29 0d 4f f6  |er$+".Links").O.|
0000e4d0  31 f2 65 6e 73 75 72 65  64 69 72 28 41 70 70 50  |1.ensuredir(AppP|
0000e4e0  61 74 68 24 2b 22 2e 55  73 65 72 73 2e 22 2b 55  |ath$+".Users."+U|
0000e4f0  73 65 72 24 2b 22 2e 4c  69 6e 6b 73 22 29 0d 50  |ser$+".Links").P|
0000e500  00 38 f2 65 6e 73 75 72  65 64 69 72 28 41 70 70  |.8.ensuredir(App|
0000e510  50 61 74 68 24 2b 22 2e  55 73 65 72 73 2e 22 2b  |Path$+".Users."+|
0000e520  55 73 65 72 24 2b 22 2e  4c 69 6e 6b 73 2e 7e 7e  |User$+".Links.~~|
0000e530  42 6f 6f 74 22 29 0d 50  0a 37 f2 65 6e 73 75 72  |Boot").P.7.ensur|
0000e540  65 64 69 72 28 41 70 70  50 61 74 68 24 2b 22 2e  |edir(AppPath$+".|
0000e550  55 73 65 72 73 2e 22 2b  55 73 65 72 24 2b 22 2e  |Users."+User$+".|
0000e560  4c 69 6e 6b 73 2e 7e 7e  52 75 6e 22 29 0d 50 14  |Links.~~Run").P.|
0000e570  3b f2 65 6e 73 75 72 65  64 69 72 28 41 70 70 50  |;.ensuredir(AppP|
0000e580  61 74 68 24 2b 22 2e 55  73 65 72 73 2e 22 2b 55  |ath$+".Users."+U|
0000e590  73 65 72 24 2b 22 2e 4c  69 6e 6b 73 2e 7e 7e 52  |ser$+".Links.~~R|
0000e5a0  75 6e 51 75 69 74 22 29  0d 50 1e 04 0d 50 28 2f  |unQuit").P...P(/|
0000e5b0  24 73 74 72 69 6e 67 25  3d 41 70 70 50 61 74 68  |$string%=AppPath|
0000e5c0  24 2b 22 2e 55 73 65 72  73 2e 22 2b 55 73 65 72  |$+".Users."+User|
0000e5d0  24 2b 22 2e 7e 7e 4f 70  65 6e 22 0d 50 32 24 c8  |$+".~~Open".P2$.|
0000e5e0  99 22 4f 53 5f 46 69 6c  65 22 2c 31 37 2c 73 74  |."OS_File",17,st|
0000e5f0  72 69 6e 67 25 20 b8 20  72 65 73 75 6c 74 25 0d  |ring% . result%.|
0000e600  50 3c 41 e7 20 28 72 65  73 75 6c 74 25 3d 30 29  |P<A. (result%=0)|
0000e610  20 8c 20 58 25 3d ae 28  41 70 70 50 61 74 68 24  | . X%=.(AppPath$|
0000e620  2b 22 2e 55 73 65 72 73  2e 22 2b 55 73 65 72 24  |+".Users."+User$|
0000e630  2b 22 2e 7e 7e 4f 70 65  6e 22 29 3a d9 23 58 25  |+".~~Open"):.#X%|
0000e640  0d 50 46 30 24 73 74 72  69 6e 67 25 3d 41 70 70  |.PF0$string%=App|
0000e650  50 61 74 68 24 2b 22 2e  55 73 65 72 73 2e 22 2b  |Path$+".Users."+|
0000e660  55 73 65 72 24 2b 22 2e  7e 7e 43 6c 6f 73 65 22  |User$+".~~Close"|
0000e670  0d 50 50 24 c8 99 22 4f  53 5f 46 69 6c 65 22 2c  |.PP$.."OS_File",|
0000e680  31 37 2c 73 74 72 69 6e  67 25 20 b8 20 72 65 73  |17,string% . res|
0000e690  75 6c 74 25 0d 50 5a 42  e7 20 28 72 65 73 75 6c  |ult%.PZB. (resul|
0000e6a0  74 25 3d 30 29 20 8c 20  58 25 3d ae 28 41 70 70  |t%=0) . X%=.(App|
0000e6b0  50 61 74 68 24 2b 22 2e  55 73 65 72 73 2e 22 2b  |Path$+".Users."+|
0000e6c0  55 73 65 72 24 2b 22 2e  7e 7e 43 6c 6f 73 65 22  |User$+".~~Close"|
0000e6d0  29 3a d9 23 58 25 0d 50  64 04 0d 50 6e 50 c8 99  |):.#X%.Pd..PnP..|
0000e6e0  20 22 57 69 6d 70 5f 49  6e 69 74 69 61 6c 69 73  | "Wimp_Initialis|
0000e6f0  65 22 2c 32 30 30 2c 26  34 42 35 33 34 31 35 34  |e",200,&4B534154|
0000e700  2c 61 70 70 24 20 b8 20  63 75 72 72 65 6e 74 5f  |,app$ . current_|
0000e710  77 69 6d 70 5f 76 65 72  73 69 6f 6e 25 2c 74 61  |wimp_version%,ta|
0000e720  73 6b 5f 68 61 6e 64 6c  65 25 0d 50 78 04 0d 50  |sk_handle%.Px..P|
0000e730  82 18 f4 20 43 72 65 61  74 65 20 49 4e 46 4f 20  |... Create INFO |
0000e740  77 69 6e 64 6f 77 0d 50  8c 23 21 69 6e 66 6f 64  |window.P.#!infod|
0000e750  61 74 61 25 20 3d 20 30  3a 20 69 6e 66 6f 64 61  |ata% = 0: infoda|
0000e760  74 61 25 21 34 20 3d 20  30 0d 50 96 29 69 6e 66  |ta%!4 = 0.P.)inf|
0000e770  6f 64 61 74 61 25 21 38  20 3d 20 36 34 32 3a 20  |odata%!8 = 642: |
0000e780  69 6e 66 6f 64 61 74 61  25 21 31 32 20 3d 20 32  |infodata%!12 = 2|
0000e790  31 32 0d 50 a0 26 69 6e  66 6f 64 61 74 61 25 21  |12.P.&infodata%!|
0000e7a0  31 36 20 3d 20 30 3a 20  69 6e 66 6f 64 61 74 61  |16 = 0: infodata|
0000e7b0  25 21 32 30 20 3d 20 30  0d 50 aa 1b 69 6e 66 6f  |%!20 = 0.P..info|
0000e7c0  64 61 74 61 25 21 32 34  20 3d 20 2d 31 3a f4 20  |data%!24 = -1:. |
0000e7d0  54 6f 70 0d 50 b4 1c 69  6e 66 6f 64 61 74 61 25  |Top.P..infodata%|
0000e7e0  21 32 38 20 3d 20 31 2b  32 2b 31 36 2b 36 34 0d  |!28 = 1+2+16+64.|
0000e7f0  50 be 1c 69 6e 66 6f 64  61 74 61 25 21 33 32 20  |P..infodata%!32 |
0000e800  3d 20 26 30 31 30 39 30  32 30 37 0d 50 c8 1c 69  |= &01090207.P..i|
0000e810  6e 66 6f 64 61 74 61 25  21 33 36 20 3d 20 26 30  |nfodata%!36 = &0|
0000e820  30 30 43 30 31 30 33 0d  50 d2 26 69 6e 66 6f 64  |00C0103.P.&infod|
0000e830  61 74 61 25 21 34 30 20  3d 20 30 3a 20 69 6e 66  |ata%!40 = 0: inf|
0000e840  6f 64 61 74 61 25 21 34  34 20 3d 20 30 0d 50 dc  |odata%!44 = 0.P.|
0000e850  2a 69 6e 66 6f 64 61 74  61 25 21 34 38 20 3d 20  |*infodata%!48 = |
0000e860  36 34 32 3a 20 69 6e 66  6f 64 61 74 61 25 21 35  |642: infodata%!5|
0000e870  32 20 3d 20 32 31 32 0d  50 e6 2f 69 6e 66 6f 64  |2 = 212.P./infod|
0000e880  61 74 61 25 21 35 36 20  3d 20 25 31 31 31 30 30  |ata%!56 = %11100|
0000e890  30 30 30 30 30 30 30 30  30 30 30 30 30 30 30 30  |0000000000000000|
0000e8a0  30 31 31 30 30 31 0d 50  f0 14 69 6e 66 6f 64 61  |011001.P..infoda|
0000e8b0  74 61 25 21 36 30 20 3d  20 30 0d 50 fa 14 69 6e  |ta%!60 = 0.P..in|
0000e8c0  66 6f 64 61 74 61 25 21  36 34 20 3d 20 31 0d 51  |fodata%!64 = 1.Q|
0000e8d0  04 14 69 6e 66 6f 64 61  74 61 25 21 36 38 20 3d  |..infodata%!68 =|
0000e8e0  20 30 0d 51 0e 1c 24 28  69 6e 66 6f 64 61 74 61  | 0.Q..$(infodata|
0000e8f0  25 2b 37 32 29 20 3d 20  22 49 6e 66 6f 22 0d 51  |%+72) = "Info".Q|
0000e900  18 25 69 6e 66 6f 64 61  74 61 25 21 38 34 3d 30  |.%infodata%!84=0|
0000e910  3a f4 20 4e 6f 20 69 63  6f 6e 73 20 79 65 74 20  |:. No icons yet |
0000e920  2e 2e 2e 0d 51 22 20 f4  20 43 72 65 61 74 65 20  |....Q" . Create |
0000e930  49 4e 46 4f 20 69 63 6f  6e 20 62 6c 6f 63 6b 20  |INFO icon block |
0000e940  2e 2e 2e 0d 51 2c 16 74  70 74 72 25 3d 69 6e 66  |....Q,.tptr%=inf|
0000e950  6f 64 61 74 61 25 2b 38  38 0d 51 36 44 74 70 74  |odata%+88.Q6Dtpt|
0000e960  72 25 20 3d 20 a4 41 64  64 49 63 6f 6e 28 38 2c  |r% = .AddIcon(8,|
0000e970  31 36 34 2c 20 36 34 32  2d 31 35 36 2c 34 30 2c  |164, 642-156,40,|
0000e980  20 22 58 75 65 6e 22 2c  74 70 74 72 25 2c 69 6e  | "Xuen",tptr%,in|
0000e990  66 6f 64 61 74 61 25 2b  38 34 2c 30 29 0d 51 40  |fodata%+84,0).Q@|
0000e9a0  4d 74 70 74 72 25 20 3d  20 a4 41 64 64 49 63 6f  |Mtptr% = .AddIco|
0000e9b0  6e 28 38 2c 31 31 32 2c  20 36 34 32 2d 31 35 36  |n(8,112, 642-156|
0000e9c0  2c 34 30 2c 20 22 44 65  73 6b 74 6f 70 20 54 6f  |,40, "Desktop To|
0000e9d0  6f 6c 22 2c 74 70 74 72  25 2c 69 6e 66 6f 64 61  |ol",tptr%,infoda|
0000e9e0  74 61 25 2b 38 34 2c 20  30 29 0d 51 4a 4d 74 70  |ta%+84, 0).QJMtp|
0000e9f0  74 72 25 20 3d 20 a4 41  64 64 49 63 6f 6e 28 38  |tr% = .AddIcon(8|
0000ea00  2c 36 30 2c 20 36 34 32  2d 31 35 36 2c 34 30 2c  |,60, 642-156,40,|
0000ea10  20 22 42 61 72 6e 79 20  53 68 6f 72 74 22 2c 20  | "Barny Short", |
0000ea20  74 70 74 72 25 2c 20 69  6e 66 6f 64 61 74 61 25  |tptr%, infodata%|
0000ea30  2b 38 34 2c 20 30 29 0d  51 54 54 74 70 74 72 25  |+84, 0).QTTtptr%|
0000ea40  20 3d 20 a4 41 64 64 49  63 6f 6e 28 38 2c 38 2c  | = .AddIcon(8,8,|
0000ea50  20 36 34 32 2d 31 35 36  2c 34 30 2c 20 61 70 70  | 642-156,40, app|
0000ea60  76 65 72 73 69 6f 6e 24  2b 22 20 4d 61 79 2d 39  |version$+" May-9|
0000ea70  38 22 2c 20 74 70 74 72  25 2c 20 69 6e 66 6f 64  |8", tptr%, infod|
0000ea80  61 74 61 25 2b 38 34 2c  20 30 29 0d 51 5e 48 74  |ata%+84, 0).Q^Ht|
0000ea90  70 74 72 25 20 3d 20 a4  41 64 64 49 63 6f 6e 28  |ptr% = .AddIcon(|
0000eaa0  36 34 32 2d 31 33 36 2c  38 2c 20 31 32 38 2c 32  |642-136,8, 128,2|
0000eab0  31 32 2d 31 36 2c 22 21  78 75 65 6e 22 2c 74 70  |12-16,"!xuen",tp|
0000eac0  74 72 25 2c 69 6e 66 6f  64 61 74 61 25 2b 38 34  |tr%,infodata%+84|
0000ead0  2c 31 29 0d 51 68 34 c8  99 22 57 69 6d 70 5f 43  |,1).Qh4.."Wimp_C|
0000eae0  72 65 61 74 65 57 69 6e  64 6f 77 22 2c 2c 69 6e  |reateWindow",,in|
0000eaf0  66 6f 64 61 74 61 25 20  b8 20 77 68 61 6e 64 6c  |fodata% . whandl|
0000eb00  65 5f 69 6e 66 6f 25 0d  51 72 04 0d 51 7c 04 0d  |e_info%.Qr..Q|..|
0000eb10  51 86 18 f4 20 43 72 65  61 74 65 20 54 52 45 45  |Q... Create TREE|
0000eb20  20 77 69 6e 64 6f 77 0d  51 90 23 21 69 6e 66 6f  | window.Q.#!info|
0000eb30  64 61 74 61 25 20 3d 20  30 3a 20 69 6e 66 6f 64  |data% = 0: infod|
0000eb40  61 74 61 25 21 34 20 3d  20 30 0d 51 9a 39 69 6e  |ata%!4 = 0.Q.9in|
0000eb50  66 6f 64 61 74 61 25 21  38 20 3d 20 46 69 6c 65  |fodata%!8 = File|
0000eb60  72 56 69 65 77 57 25 3a  20 69 6e 66 6f 64 61 74  |rViewW%: infodat|
0000eb70  61 25 21 31 32 20 3d 20  46 69 6c 65 72 56 69 65  |a%!12 = FilerVie|
0000eb80  77 48 25 0d 51 a4 26 69  6e 66 6f 64 61 74 61 25  |wH%.Q.&infodata%|
0000eb90  21 31 36 20 3d 20 30 3a  20 69 6e 66 6f 64 61 74  |!16 = 0: infodat|
0000eba0  61 25 21 32 30 20 3d 20  30 0d 51 ae 1b 69 6e 66  |a%!20 = 0.Q..inf|
0000ebb0  6f 64 61 74 61 25 21 32  34 20 3d 20 2d 31 3a f4  |odata%!24 = -1:.|
0000ebc0  20 54 6f 70 0d 51 b8 2a  69 6e 66 6f 64 61 74 61  | Top.Q.*infodata|
0000ebd0  25 21 32 38 20 3d 20 31  2b 32 2b 31 36 2b 36 34  |%!28 = 1+2+16+64|
0000ebe0  2b 28 31 3c 3c 32 29 2b  28 31 3c 3c 33 29 0d 51  |+(1<<2)+(1<<3).Q|
0000ebf0  c2 1c 69 6e 66 6f 64 61  74 61 25 21 33 32 20 3d  |..infodata%!32 =|
0000ec00  20 26 30 31 30 39 30 32  30 37 0d 51 cc 1c 69 6e  | &01090207.Q..in|
0000ec10  66 6f 64 61 74 61 25 21  33 36 20 3d 20 26 30 30  |fodata%!36 = &00|
0000ec20  30 43 30 31 30 33 0d 51  d6 26 69 6e 66 6f 64 61  |0C0103.Q.&infoda|
0000ec30  74 61 25 21 34 30 20 3d  20 30 3a 20 69 6e 66 6f  |ta%!40 = 0: info|
0000ec40  64 61 74 61 25 21 34 34  20 3d 20 30 0d 51 e0 3a  |data%!44 = 0.Q.:|
0000ec50  69 6e 66 6f 64 61 74 61  25 21 34 38 20 3d 20 46  |infodata%!48 = F|
0000ec60  69 6c 65 72 56 69 65 77  57 25 3a 20 69 6e 66 6f  |ilerViewW%: info|
0000ec70  64 61 74 61 25 21 35 32  20 3d 20 46 69 6c 65 72  |data%!52 = Filer|
0000ec80  56 69 65 77 48 25 0d 51  ea 2f 69 6e 66 6f 64 61  |ViewH%.Q./infoda|
0000ec90  74 61 25 21 35 36 20 3d  20 25 31 31 31 30 30 30  |ta%!56 = %111000|
0000eca0  30 30 30 30 30 30 30 30  30 30 30 30 30 30 30 30  |0000000000000000|
0000ecb0  31 31 30 30 31 0d 51 f4  14 69 6e 66 6f 64 61 74  |11001.Q..infodat|
0000ecc0  61 25 21 36 30 20 3d 20  30 0d 51 fe 14 69 6e 66  |a%!60 = 0.Q..inf|
0000ecd0  6f 64 61 74 61 25 21 36  34 20 3d 20 31 0d 52 08  |odata%!64 = 1.R.|
0000ece0  14 69 6e 66 6f 64 61 74  61 25 21 36 38 20 3d 20  |.infodata%!68 = |
0000ecf0  30 0d 52 12 22 24 28 69  6e 66 6f 64 61 74 61 25  |0.R."$(infodata%|
0000ed00  2b 37 32 29 20 3d 20 22  46 69 6c 65 72 20 54 72  |+72) = "Filer Tr|
0000ed10  65 65 22 0d 52 1c 25 69  6e 66 6f 64 61 74 61 25  |ee".R.%infodata%|
0000ed20  21 38 34 3d 30 3a f4 20  4e 6f 20 69 63 6f 6e 73  |!84=0:. No icons|
0000ed30  20 79 65 74 20 2e 2e 2e  0d 52 26 20 f4 20 43 72  | yet ....R& . Cr|
0000ed40  65 61 74 65 20 49 4e 46  4f 20 69 63 6f 6e 20 62  |eate INFO icon b|
0000ed50  6c 6f 63 6b 20 2e 2e 2e  0d 52 30 16 74 70 74 72  |lock ....R0.tptr|
0000ed60  25 3d 69 6e 66 6f 64 61  74 61 25 2b 38 38 0d 52  |%=infodata%+88.R|
0000ed70  3a 51 74 70 74 72 25 20  3d 20 a4 41 64 64 49 63  |:Qtptr% = .AddIc|
0000ed80  6f 6e 28 31 34 34 2c 28  46 69 6c 65 72 56 69 65  |on(144,(FilerVie|
0000ed90  77 48 25 2f 34 29 2a 33  2c 20 36 34 32 2d 31 35  |wH%/4)*3, 642-15|
0000eda0  36 2c 34 30 2c 20 22 41  22 2c 74 70 74 72 25 2c  |6,40, "A",tptr%,|
0000edb0  69 6e 66 6f 64 61 74 61  25 2b 38 34 2c 30 29 0d  |infodata%+84,0).|
0000edc0  52 44 52 74 70 74 72 25  20 3d 20 a4 41 64 64 49  |RDRtptr% = .AddI|
0000edd0  63 6f 6e 28 31 34 34 2c  28 46 69 6c 65 72 56 69  |con(144,(FilerVi|
0000ede0  65 77 48 25 2f 34 29 2a  32 2c 20 36 34 32 2d 31  |ewH%/4)*2, 642-1|
0000edf0  35 36 2c 34 30 2c 20 22  42 22 2c 74 70 74 72 25  |56,40, "B",tptr%|
0000ee00  2c 69 6e 66 6f 64 61 74  61 25 2b 38 34 2c 20 30  |,infodata%+84, 0|
0000ee10  29 0d 52 4e 50 74 70 74  72 25 20 3d 20 a4 41 64  |).RNPtptr% = .Ad|
0000ee20  64 49 63 6f 6e 28 31 34  34 2c 46 69 6c 65 72 56  |dIcon(144,FilerV|
0000ee30  69 65 77 48 25 2f 34 2c  20 36 34 32 2d 31 35 36  |iewH%/4, 642-156|
0000ee40  2c 34 30 2c 20 22 43 22  2c 20 74 70 74 72 25 2c  |,40, "C", tptr%,|
0000ee50  20 69 6e 66 6f 64 61 74  61 25 2b 38 34 2c 20 30  | infodata%+84, 0|
0000ee60  29 0d 52 58 44 74 70 74  72 25 20 3d 20 a4 41 64  |).RXDtptr% = .Ad|
0000ee70  64 49 63 6f 6e 28 31 34  34 2c 38 2c 20 36 34 32  |dIcon(144,8, 642|
0000ee80  2d 31 35 36 2c 34 30 2c  20 22 44 22 2c 20 74 70  |-156,40, "D", tp|
0000ee90  74 72 25 2c 20 69 6e 66  6f 64 61 74 61 25 2b 38  |tr%, infodata%+8|
0000eea0  34 2c 20 30 29 0d 52 62  42 74 70 74 72 25 20 3d  |4, 0).RbBtptr% =|
0000eeb0  20 a4 41 64 64 49 63 6f  6e 28 38 2c 38 2c 20 31  | .AddIcon(8,8, 1|
0000eec0  32 38 2c 32 31 32 2d 31  36 2c 22 21 78 75 65 6e  |28,212-16,"!xuen|
0000eed0  22 2c 74 70 74 72 25 2c  69 6e 66 6f 64 61 74 61  |",tptr%,infodata|
0000eee0  25 2b 38 34 2c 31 29 0d  52 6c 34 c8 99 22 57 69  |%+84,1).Rl4.."Wi|
0000eef0  6d 70 5f 43 72 65 61 74  65 57 69 6e 64 6f 77 22  |mp_CreateWindow"|
0000ef00  2c 2c 69 6e 66 6f 64 61  74 61 25 20 b8 20 77 68  |,,infodata% . wh|
0000ef10  61 6e 64 6c 65 5f 74 72  65 65 25 0d 52 76 04 0d  |andle_tree%.Rv..|
0000ef20  52 80 04 0d 52 8a 04 0d  52 94 19 f4 20 43 72 65  |R...R...R... Cre|
0000ef30  61 74 65 20 74 6f 6f 6c  62 6f 78 20 6d 65 6e 75  |ate toolbox menu|
0000ef40  0d 52 9e 0a f7 20 8d 40  70 53 0d 52 a8 1a f2 73  |.R... .@pS.R...s|
0000ef50  65 74 75 70 6d 65 6e 75  28 74 6f 6f 6c 5f 6d 65  |etupmenu(tool_me|
0000ef60  6e 75 25 29 0d 52 b2 16  f4 20 43 72 65 61 74 65  |nu%).R... Create|
0000ef70  20 6d 61 69 6e 20 6d 65  6e 75 0d 52 bc 0a f7 20  | main menu.R... |
0000ef80  8d 50 4c 53 0d 52 c6 1a  f2 73 65 74 75 70 6d 65  |.PLS.R...setupme|
0000ef90  6e 75 28 6d 61 69 6e 5f  6d 65 6e 75 25 29 0d 52  |nu(main_menu%).R|
0000efa0  d0 3d f4 20 49 6e 73 74  61 6c 6c 20 61 6e 20 69  |.=. Install an i|
0000efb0  63 6f 6e 20 6f 6e 20 74  68 65 20 69 63 6f 6e 20  |con on the icon |
0000efc0  62 61 72 20 75 73 69 6e  67 20 74 68 65 20 73 68  |bar using the sh|
0000efd0  6f 72 74 63 75 74 20 69  63 6f 6e 0d 52 da 60 69  |ortcut icon.R.`i|
0000efe0  63 6f 6e 62 61 72 68 61  6e 64 6c 65 25 3d a4 63  |conbarhandle%=.c|
0000eff0  72 65 61 74 65 5f 69 63  6f 6e 28 2d 32 2c 30 2c  |reate_icon(-2,0,|
0000f000  2d 31 36 2c 38 34 2c 31  30 36 2c 26 31 37 30 30  |-16,84,106,&1700|
0000f010  33 31 30 42 2c 22 21 78  75 65 6e 22 2c 69 63 6f  |310B,"!xuen",ico|
0000f020  6e 62 61 72 6c 61 62 65  6c 25 2c 69 63 6f 6e 62  |nbarlabel%,iconb|
0000f030  61 72 64 61 74 61 25 2c  33 32 29 0d 52 e4 05 e1  |ardata%,32).R...|
0000f040  0d 52 ee 04 0d 52 f8 39  f4 20 2a 2a 2a 2a 2a 2a  |.R...R.9. ******|
0000f050  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000f070  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 0d 53 02  |*************.S.|
0000f080  04 0d 53 0c 0e dc 20 22  58 75 65 6e 22 2c 38 0d  |..S... "Xuen",8.|
0000f090  53 16 1c dc 20 30 2c 77  68 61 6e 64 6c 65 5f 69  |S... 0,whandle_i|
0000f0a0  6e 66 6f 25 2c 22 49 6e  66 6f 22 0d 53 20 1c dc  |nfo%,"Info".S ..|
0000f0b0  20 30 2c 74 6f 6f 6c 5f  6d 65 6e 75 25 2c 22 54  | 0,tool_menu%,"T|
0000f0c0  6f 6f 6c 62 6f 78 22 0d  53 2a 11 dc 20 30 2c 2d  |oolbox".S*.. 0,-|
0000f0d0  31 2c 22 55 73 65 72 22  0d 53 34 11 dc 20 30 2c  |1,"User".S4.. 0,|
0000f0e0  2d 31 2c 22 48 65 6c 70  22 0d 53 3e 15 dc 20 30  |-1,"Help".S>.. 0|
0000f0f0  2c 2d 31 2c 22 41 64 76  61 6e 63 65 64 22 0d 53  |,-1,"Advanced".S|
0000f100  48 14 dc 20 30 2c 2d 31  2c 22 43 61 73 63 61 64  |H.. 0,-1,"Cascad|
0000f110  65 22 0d 53 52 11 dc 20  32 2c 2d 31 2c 22 54 72  |e".SR.. 2,-1,"Tr|
0000f120  65 65 22 0d 53 5c 13 dc  20 26 38 30 2c 2d 31 2c  |ee".S\.. &80,-1,|
0000f130  22 51 75 69 74 22 0d 53  66 04 0d 53 70 11 dc 20  |"Quit".Sf..Sp.. |
0000f140  22 54 6f 6f 6c 62 6f 78  22 2c 34 0d 53 7a 12 dc  |"Toolbox",4.Sz..|
0000f150  20 30 2c 2d 31 2c 22 43  6c 65 61 6e 22 0d 53 84  | 0,-1,"Clean".S.|
0000f160  18 dc 20 30 2c 2d 31 2c  22 53 6d 61 73 68 6e 43  |.. 0,-1,"SmashnC|
0000f170  6c 6f 73 65 22 0d 53 8e  17 dc 20 30 2c 2d 31 2c  |lose".S... 0,-1,|
0000f180  22 45 64 69 74 20 4c 69  6e 6b 73 22 0d 53 98 1a  |"Edit Links".S..|
0000f190  dc 20 26 38 30 2c 2d 31  2c 22 53 61 76 65 53 70  |. &80,-1,"SaveSp|
0000f1a0  72 69 74 65 73 22 0d 53  a2 04 0d 53 ac 3e f4 20  |rites".S...S.>. |
0000f1b0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
0000f1e0  2a 2a 2a 2a 2a 2a 2a 2a  0d 53 b6 06 20 20 0d ff  |********.S..  ..|
0000f1f0