Home » Personal collection » Acorn hard disk » unzip_tools » !Infozip » Source/!RunImage

Source/!RunImage

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Acorn hard disk » unzip_tools » !Infozip
Filename: Source/!RunImage
Read OK:
File size: 104DA bytes
Load address: 0000
Exec address: 0000
File contents
    1REM>Infozip source
    2ver$="3�07 (24th July 2012)"
    3LIBRARY "<Infozip$Dir>.SHeap.SHeap"
    4PROCstartup:PROCpoll
    5
    6END
    7:
    8REM ---Initialisation functions-------------------------------------------------
    9DEF PROCstartup
   10LOCAL n%,messfile$,tempfile$,env$,size%,w%,maxw%,ptr%
   11p$="Infozip"
   12PROCinitheaps(128,128)
   13mainind%=FNcreate_anchor("templates")
   14arrows%=FNcreate_anchor("arrows")
   15message%=FNcreate_anchor("messages")
   16pathicon%=FNcreate_anchor("pathicon")
   17REM These blocks MUST not slide!
   18icon_names%=FNcreate_anchor("icon names")
   19icon_index%=FNcreate_anchor("icon index")
   20arrayscan%=FNcreate_anchor("machine code")
   21icon_widths%=FNcreate_anchor("icon widths")
   22DIM block% 256,temp% 1300,preserve% 256
   23REM first 256b of temp% is scratch space, next 64b reserved for PROCopenwindow, rest semi-permanent for high level PROCs
   24param1$="":REM for message substitution
   25param2$=""
   26PROCcreate_named_sliding_block(mainind%,1460)
   27indptr%=!mainind%
   28lastmenuopened%=-1
   29DIM initbl% 48
   30initbl%!0=&400C3
   31initbl%!4=&502
   32initbl%!8=&400C0
   33initbl%!12=10
   34initbl%!16=1
   35initbl%!20=3
   36initbl%!24=2
   37initbl%!28=4
   38initbl%!32=5
   39initbl%!36=&400CF
   40initbl%!40=&400C1
   41initbl%!44=0
   42SYS "Wimp_Initialise",300,&4B534154,p$,initbl% TO notfont%
   43notfont%=(notfont%<350)
   44in%=0:REM global variable required by PROCquit
   45ON ERROR PROCreport(REPORT$+" at line "+STR$ ERL,%10):PROCquit:END
   46messfile$=p$+"Res:Messages"
   47SYS"MessageTrans_FileInfo",,messfile$ TO ,,n%
   48PROCcreate_named_sliding_block(message%,n%)
   49DIM mdata% 16
   50SYS"MessageTrans_OpenFile",mdata%,messfile$,!message%
   51
   52PROCcreate_named_sliding_block(arrows%,512)
   53REM we are going to resize and reuse this later
   54ptr%=!arrows%
   55SYS "OS_GetEnv" TO env$
   56SYS"OS_ReadArgs","BASIC,quit/k,zip,debug/s",env$,ptr%,512
   57IF ptr%!8 THEN env$=FNs(ptr%!8) ELSE env$=""
   58REM name of zipfile which launched program (if any)
   59IF FNok_to_load_new_copy(env$)=FALSE THEN END
   60
   61debug%=ptr%!12:REM do we dump debug info?
   62
   63REM Loading windows from template file
   64tempfile$="<"+p$+"$Dir>.Resources.Sprites"
   65SYS"OS_ReadModeVariable",-1,5 TO ,,size%
   66IF size%=1 THEN tempfile$+="22"
   67REM load sprites of appropriate resolution
   68SYS"OS_File",23,tempfile$ TO ,,,,size%:REM get length in size%
   69PROCextend_named_sliding_block(arrows%,size%+4)
   70!(!arrows%)=size%+4:!(!arrows%+8)=16
   71SYS"OS_SpriteOp",&10A,!arrows%,tempfile$:REM load sprites
   72
   73tempfile$=p$+"Res:Templates"
   74SYS"Wimp_OpenTemplate",,tempfile$
   75info%=FNloadwindow("info")
   76save%=FNloadwindow("nicesave")
   77fakefiler%=FNloadwindow("directory")
   78panepath%=FNloadwindow("panepath")
   79alertbox%=FNloadwindow("alertbox")
   80file%=FNloadwindow("file")
   81configure%=FNloadwindow("configure")
   82SYS"Wimp_CloseTemplate"
   83
   84REM configure dialogue icons
   85ic_opticons%=14:REM 14 to 19
   86ic_timedisp%=3:ic_bumpup%=5:ic_bumpdown%=6:ic_timelabel%=2
   87ic_beep%=4:ic_open%=7:ic_unix%=10:ic_show%=20
   88ic_save%=9:ic_cancel%=11:ic_OK%=8
   89
   90REM save dialogue icons
   91save_ok%=4:save_cancel%=3:save_path%=1:save_draggable%=2
   92REM create iconbar icon
   93DIM sprtext% 4:$sprtext%=FNmessage_lookup("N")
   94DIM sprsprite% 12:$sprsprite%="S!"+p$
   95maxw%=FNibar_width(FNmessage_lookup("Y"))
   96w%=FNibar_width(FNmessage_lookup("N")):IF w%>maxw% THEN maxw%=w%
   97ibar%=FNtempl_icon(-1,0,-16,maxw%,88,&1700310B,"",sprtext%,sprsprite%,12)
   98bar%=-2
   99
  100PROCseticontext(info%,0,p$)
  101PROCseticontext(info%,1,"Zip/Unzip files for free")
  102PROCseticontext(info%,2,"� Harriet Bazley 1998")
  103PROCseticontext(info%,4,ver$)
  104
  105REM load machine code
  106PROCcreate_named_sliding_block(arrayscan%,480)
  107OSCLI"Load <"+p$+"$Dir>.Resources.code "+STR$~(!arrayscan%)
  108
  109PROCmenus_init
  110DIM spritename% 11
  111$spritename%="file_xxx"
  112!block%=file%
  113block%!4=22
  114block%!8=-160
  115block%!12=90
  116block%!16=-92
  117block%!20=&C7000112
  118block%!24=spritename%
  119block%!28=1
  120block%!32=11
  121SYS"Wimp_CreateIcon",,block%:REM create an updateable filetype icon in file%
  122REM we do it this way so that we know the address of spritename%
  123
  124PROCcreate_named_sliding_block(pathicon%,256)
  125DIM R2% 3
  126$R2%="R2":$(!pathicon%)="/"
  127paneicon%=FNtempl_icon(panepath%,64,-64,2012,-12,&17000135,"",!pathicon%,R2%,255)
  128
  129REM global variables
  130last_opened%=0
  131no_of_files%=0:levels%=0:savedlevels%=-1
  132zipfile$="":notzipped$="":commonpath$="*"
  133store$=""
  134menuicon%=-1:REM records which icon we clicked MENU over
  135action$="":child%=0
  136all%=FALSE
  137dontbroadcast%=TRUE:REM records whether SHIFT was held down when file was double-clicked
  138options$="ajLquI"
  139delete_later$=""
  140REM stores name of file dragged in (which we may want to move not copy)
  141pollmask%=%1110000110001
  142local_hon%=FALSE
  143timeup%=0
  144old_across%=0:REM used to avoid unnecessary forced redraws on Window_Open events
  145clipwidth%=272:REM column width to which fakefiler icons are clipped
  146
  147saveicon$="file_ddc"
  148IF FNsprite_exists("file_a91") THEN saveicon$="file_a91":PROCseticontext(save%,save_draggable%,saveicon$)
  149
  150
  151REM space reserved for holding names of sprites in fake filer window
  152DIM dirsprite% 11:$dirsprite%="Sdirectory"
  153DIM appsprite% 13:$appsprite%="Sapplication"
  154DIM datasprite% 11:$datasprite%="Sfile_xxx"
  155
  156REM ---- configuration ----
  157DIM options%(6)
  158IF FNifthere(FNconfigloadfilename) THEN
  159  PROCloadconfig
  160ELSE
  161  options%()=0
  162  options%(5)=1:REM Only extract newer set by default (dangerous)
  163  options%(6)=1:REM Images as files set by default
  164  disptime%=3
  165  beepflag%=0:openflag%=0:unixflag%=0:showpane%=1
  166ENDIF
  167PROCtick(dispmenu%,2,1):REM default to old sort order
  168
  169IF FNifthere("<Wimp$ScrapDir>.Infozip") THEN OSCLI"%Wipe <Wimp$ScrapDir>.Infozip R ~C ~V F":REM in case we crashed last time
  170OSCLI"CDir <Wimp$ScrapDir>.Infozip"
  171OSCLI"Set InfoScrap$Path <Wimp$ScrapDir>.Infozip."
  172IF LEN(env$) THEN dum%=FNdragged_in(bar%,&DDC,env$)
  173ENDPROC
  174:
  175DEF FNibar_width(text$)
  176LOCAL width%
  177width%=FNstringlength(text$)
  178IF width%<64 THEN width%=64
  179=width%
  180:
  181DEF FNok_to_load_new_copy(env$)
  182LOCAL n%,end%,ptr%
  183SYS"TaskManager_EnumerateTasks",0,temp%,1300 TO ,end%
  184REM Instruct the Task Manager to dump a list of all currently active tasks
  185REM into our buffer - 16 bytes to each task
  186ptr%=temp%
  187REM point to start of task list
  188WHILE ptr%<end%
  189  IF FNs(ptr%!4)=p$ THEN ptr%=end%+100
  190  REM jump out of loop when we find the task we want
  191  REM the first four bytes of sixteen are the task handle
  192  REM the second four are a pointer to the task name
  193  ptr%+=16
  194  REM examine next task - next 16 bytes
  195ENDWHILE
  196
  197IF ptr%>end%+100 THEN param1$=p$:param2$="":PROCreport(FNmessage_looksub("two"),%10):=FALSE
  198REM Quit program now if a copy is already running
  199=TRUE
  200REM if we didn't jump out of loop, then our task is not already running
  201
  202
  203DEF FNloadwindow(name$)
  204LOCAL n%,ptr%
  205SYS"Wimp_LoadTemplate",,temp%,indptr%,!mainind%+1450,-1,name$ TO ,,indptr%
  206REM 1400 is size of total indirected data
  207IF name$="panepath" THEN temp%!64=!arrows%
  208REM hack - this pane uses a user sprite area
  209SYS"Wimp_CreateWindow",,temp% TO n%
  210=n%
  211:
  212DEF FNtempl_icon(whandle%,leftx%,bottomy%,rightx%,topy%,flags%,text$,ptr1%,ptr2%,ptr3%)
  213LOCAL handle%
  214!block%=whandle%
  215block%!4=leftx%
  216block%!8=bottomy%
  217block%!12=rightx%
  218block%!16=topy%
  219block%!20=flags%
  220IF ptr1%=0 THEN
  221$(block%+24)=text$
  222ELSE
  223block%!24=ptr1%
  224block%!28=ptr2%
  225block%!32=ptr3%
  226ENDIF
  227SYS"Wimp_CreateIcon",,block% TO handle%
  228=handle%
  229
  230REM --------menu handling-------------------------------------------------------
  231
  232DEF PROCmenus_init
  233LOCAL ptr%
  234param1$=p$
  235baritems%=5:REM global variable used to calculate menu height for iconbar click
  236barmenu%=FNmakemenu(FNmessage_looksub("bar"),baritems%):REM make main menu
  237fakefilermenu%=FNmakemenu(FNmessage_looksub("ff"),8)
  238filemenu%=FNmakemenu(FNmessage_lookup("file"),2)
  239optsmenu%=FNmakemenu(FNmessage_lookup("opt"),6)
  240newmenu%=FNmakemenu(FNmessage_lookup("new"),1)
  241dispmenu%=FNmakemenu(FNmessage_lookup("disp"),2)
  242ptr%=newmenu%+28
  243!ptr%=%10000100:REM menu flags: writable, last item
  244PROCupdatemenutext(newmenu%,1,"")
  245!(FNsubmenuhandle(barmenu%,1)+4)=info%
  246!(FNsubmenuhandle(fakefilermenu%,5)+4)=optsmenu%
  247ptr%=FNsubmenuhandle(fakefilermenu%,5)
  248ptr%!4=optsmenu%:!ptr%=!ptr% OR %1000:REM submenu warning
  249
  250ptr%=FNsubmenuhandle(barmenu%,4)
  251ptr%!4=save%:!ptr%=!ptr% OR %1000:REM submenu warning
  252!(FNsubmenuhandle(fakefilermenu%,6)+4)=newmenu%
  253!(FNsubmenuhandle(fakefilermenu%,1)+4)=dispmenu%
  254!(FNsubmenuhandle(fakefilermenu%,2)+4)=filemenu%
  255ptr%=FNsubmenuhandle(filemenu%,1)
  256ptr%!4=file%:!ptr%=!ptr% OR %1000:REM submenu warning
  257REM poke in submenu handles
  258
  259ENDPROC
  260:
  261DEF FNmakemenu(text$,num%)
  262LOCAL n%,m%,menu%,a%,b$,max%,ptr%,x%
  263DIM menu% 28+num%*24
  264n%=INSTR(text$,"|"):$menu%=LEFT$(text$,n%-1)
  265menu%?12=7:menu%?13=2
  266menu%?14=7:menu%?15=0
  267menu%!20=44:menu%!24=0
  268ptr%=menu%+4
  269FOR x%=1 TO num%
  270  ptr%+=24:!ptr%=0:ptr%!4=-1
  271  n%+=1
  272  m%=INSTR(text$,"|",n%)
  273  b$=MID$(text$,n%,m%-n%)
  274  IF (m%-n%)>max% THEN max%=m%-n%
  275  IF m%-n%>11 THEN
  276    DIM a% (m%-n%+1)
  277    $a%=b$
  278    ptr%!8=&7000121
  279    ptr%!12=a%
  280    ptr%!16=0
  281    ptr%!20=m%-n%
  282    REM like indirected text icon
  283  ELSE
  284    ptr%!8=&7000021
  285    $(ptr%+12)=b$
  286  ENDIF
  287  n%=m%
  288NEXT x%
  289!ptr%=1<<7:REM this should point to last item
  290menu%!16=(max%*16)+16
  291=menu%
  292:
  293DEF FNsubmenuhandle(menu%,num%):REM returns start of item in menu block
  294=menu%+28+(num%-1)*24
  295
  296DEF PROCtick(menu%,num%,type%)
  297REM type: 2=toggle,1=on,0=off
  298LOCAL ptr%
  299ptr%=FNsubmenuhandle(menu%,num%)
  300CASE type% OF
  301 WHEN 2:!ptr%=(!ptr% EOR 1)
  302 WHEN 1:!ptr%=(!ptr% OR 1)
  303 WHEN 0:!ptr%=(!ptr% AND NOT 1)
  304ENDCASE
  305ENDPROC
  306:
  307DEF FNticked(menu%,item%)
  308LOCAL A%
  309A%=(menu%+28)+(24*(item%-1))
  310=!A%AND 1
  311:
  312DEF PROCshademenu(menu%,num%,state%)
  313LOCAL ptr%
  314ptr%=FNsubmenuhandle(menu%,num%)+8
  315!ptr%=!ptr% AND NOT (1<<22)
  316REM force bit 22 (greyed out) to 0
  317IF state% THEN !ptr%=!ptr% OR (1<<22)
  318REM now force it to 1 if required
  319ENDPROC
  320
  321DEF PROCupdatemenutext(menu%,num%,text$)
  322LOCAL ptr%,n%,x$,max%
  323n%=1
  324x$=FNs(menu%):REM menu title
  325max%=LEN(x$)
  326REPEAT
  327  ptr%=FNsubmenuhandle(menu%,n%)
  328  IF (ptr%!8 AND (1<<8))=FALSE THEN
  329    IF n%=num% THEN $(ptr%+12)=text$
  330    x$=$(ptr%+12)
  331  ELSE
  332    IF n%=num% THEN
  333      IF ptr%!20<LEN(text$) THEN ERROR 255,"Text too long for menu item" ELSE $(ptr%!12)=text$
  334    ENDIF
  335    x$=$(ptr%!12)
  336  ENDIF
  337  IF max%<LEN(x$) THEN max%=LEN(x$)
  338  n%+=1
  339UNTIL (!ptr% AND 1<<7)
  340menu%!16=max%*16+16
  341ENDPROC
  342:
  343DEF PROCmenuwarning(submenu%,x%,y%)
  344CASE submenu% OF
  345  WHEN optsmenu%
  346    PROCsetupoptsmenu
  347    SYS"Wimp_CreateSubMenu",,submenu%,x%,y%
  348  WHEN file%
  349    PROCfileinfo
  350    SYS"Wimp_CreateSubMenu",,submenu%,x%,y%
  351  WHEN save%
  352    SYS"Wimp_CreateSubMenu",,submenu%,x%,y%
  353    PROCcreatenew(FALSE)
  354ENDCASE
  355
  356
  357ENDPROC
  358:
  359DEF PROCupdatefilermenu(file$,icon$)
  360  LOCAL a$,b$,n%,m%
  361  CASE levels% OF
  362    WHEN 0:PROCshademenu(fakefilermenu%,7,1):PROCshademenu(fakefilermenu%,8,1)
  363    OTHERWISE:PROCshademenu(fakefilermenu%,7,0):PROCshademenu(fakefilermenu%,8,0)
  364    REM 'Open parent'/'Top directory' not valid on top level
  365  ENDCASE
  366  IF file$<>"" THEN
  367    PROCshademenu(fakefilermenu%,2,0)
  368    $spritename%=icon$:REM update icon
  369    REM IF RIGHT$(file$)="/" THEN file$=LEFT$(file$):REM clip directory names
  370 ELSE
  371    PROCshademenu(fakefilermenu%,2,1)
  372  ENDIF
  373
  374  b$=LEFT$(commonpath$)+file$
  375  IF LEN(b$)>35 THEN b$=RIGHT$(b$,35):REM size of icon indirected data
  376  PROCIconState(file%,4,3,FNstringlength(b$)<436):REM width of icon in OS units
  377  REM centre-align (flag bit 3) short text, right-align long text
  378  PROCseticontext(file%,4,b$)
  379
  380REM ** make data fit window **
  381
  382  REM don't get filesize, date etc yet - search is too slow
  383  n%=3:m%=4
  384  IF all% THEN
  385    PROCupdatemenutext(fakefilermenu%,2,FNmessage_lookup("fakeS"))
  386    PROCshademenu(fakefilermenu%,2,1)
  387    SWAP n%,m%
  388  ELSE
  389    a$=FNmessage_lookup("fake"+LEFT$(icon$,1))+"'"+file$+"'"
  390    REM use 'File', 'Dir', etc. as required
  391    IF LEN(a$)>28 THEN a$=LEFT$(a$,24)+FNdots(notfont%)+"'"
  392    REM This menu was originally dimensioned to allow for a 28-char entry
  393    PROCupdatemenutext(fakefilermenu%,2,a$)
  394  ENDIF
  395  REM swap greyed-out entries over
  396  PROCshademenu(fakefilermenu%,n%,0)
  397  PROCshademenu(fakefilermenu%,m%,1)
  398ENDPROC
  399:
  400DEF PROCMENUclick(window%)
  401LOCAL y%,x%,a%,icon%
  402y%=(block%!4)+16:x%=!block%-156
  403CASE window% OF
  404  WHEN bar%:y%=96+baritems%*44:x%=!block%-64:a%=barmenu%
  405  WHEN fakefiler%:a%=fakefilermenu%
  406    icon%=FNwhichfakeicon(block%!0,block%!4)
  407    IF icon%>-1 THEN
  408      PROCupdatefilermenu(FNgetfakeleafname(icon%,TRUE),FNwhichfakesprite(icon%))
  409      wsavew%=window%:wsavedrag%=icon%
  410    ELSE
  411      PROCupdatefilermenu("","")
  412    ENDIF
  413    menuicon%=icon%
  414ENDCASE
  415IF a%=0 THEN ENDPROC:REM no menu to open in this context
  416SYS"Wimp_CreateMenu",,a%,x%,y%
  417lastmenuopened%=a%
  418ENDPROC
  419
  420DEF PROCmenuselection
  421LOCAL n%,menusel%,a$,menu%,item%
  422menusel%=temp%+256+64:REM above scratch space and openwindow buffer
  423menusel%!4=lastmenuopened%
  424WHILE(block%!n%<>-1)
  425  item%=block%!n%
  426  menusel%=FNsubmenuhandle(menusel%!4,item%+1)
  427  REM each menu item holds submenu (or -1) at offset +4
  428  REM FNsubmenuhandle counts top item as 1, WIMP counts it as 0
  429  n%+=4
  430ENDWHILE
  431menu%=menusel%-28-24*item%:REM reverse last FNsubmenuhandle
  432item%+=1
  433
  434CASE menu% OF
  435  WHEN newmenu%:PROCnewdir(FNnewdirname)
  436  WHEN barmenu%:CASE item% OF
  437      WHEN 3:PROCopenconfig
  438      WHEN 2:OSCLI"Filer_Run <Infozip$Dir>.!Help"
  439      WHEN 5:PROCquit
  440    ENDCASE
  441  WHEN dispmenu%:
  442       PROCtick(menu%,item%,1)
  443       PROCtick(menu%,FNlooped(item%+1,2),0):REM untick other item
  444       PROCfakefilerwindow(TRUE,FALSE)
  445       PROCforceredraw(fakefiler%):REM redraw byt don't reopen
  446  WHEN fakefilermenu%:CASE item% OF
  447      WHEN 3:PROCtoggleselect(1):REM all% must be 1 not TRUE
  448      WHEN 4:PROCtoggleselect(FALSE)
  449      WHEN 7:levels%=FNuplevel(levels%)
  450      WHEN 8:levels%=FNuplevel(1)
  451    ENDCASE
  452    WHEN filemenu%:IF item%=2 THEN
  453           IF child%=0 THEN
  454             action$="zip"
  455             IF all% THEN a$="all" ELSE a$=FNwhichfakesprite(wsavedrag%)
  456             wait$="delete"
  457             notzipped$=LEFT$(commonpath$)+FNsavetext(wsavew%,wsavedrag%)
  458             child%=FNchildtask(FNcommandline("zip",a$))
  459          ELSE
  460            PROCbusy
  461          ENDIF
  462      ENDIF
  463    WHEN optsmenu%
  464      PROCtick(menu%,item%,2):REM toggle tick
  465      options%(item%)=FNticked(optsmenu%,item%):REM update configuration
  466ENDCASE
  467SYS"Wimp_GetPointerInfo",,block%
  468IF block%!8 AND 1 THEN
  469  IF menu%=fakefilermenu% THEN PROCupdatefilermenu("","")
  470  SYS"Wimp_CreateMenu",,lastmenuopened%,!block%-64,block%!4+20
  471ENDIF
  472ENDPROC
  473
  474DEF FNnewdirname
  475LOCAL ptr%
  476ptr%=newmenu%+28
  477=$(ptr%!12)
  478REM indirected text of first entry in newmenu%
  479:
  480DEF FNdots(flag%):REM only system font can be guaranteed to have THEN character
  481IF flag% THEN ="�"
  482="..."
  483:
  484REM --------Error boxes---------------------------------------------------------
  485
  486DEF PROCreport(text$,flags%)
  487!block%=255
  488$(block%+4)=text$+CHR$0
  489SYS "Wimp_ReportError",block%,flags%,p$ TO ,errclick%
  490ENDPROC
  491
  492DEF PROCquit
  493OSCLI "Unset InfoScrap$Path"
  494IF in% SYS"XOS_Find",0,in%
  495IF FNifthere("<Wimp$ScrapDir>.Infozip") THEN SYS"XOS_CLI","Wipe <Wimp$ScrapDir>.Infozip R ~V ~C F"
  496REM tidy up before closedown
  497SYS"Wimp_CloseDown"
  498END
  499ENDPROC
  500
  501DEF PROCalertbox(text$)
  502LOCAL n%
  503IF disptime%=0 THEN ENDPROC
  504REM treat setting of zero as 'suppress alertbox altogether'
  505PROCseticontext(alertbox%,0,text$)
  506PROCcentrewindow(alertbox%)
  507VDU (7*beepflag%)
  508SYS"OS_ReadMonotonicTime" TO n%:timeup%=n%+100*disptime%:REM set global variable to required delay
  509pollmask% = pollmask% AND (NOT %1):REM no longer mask out null-polls
  510ENDPROC
  511:
  512REM ------------General useful functions----------------------------------------
  513DEF FNReadSysVar(name$):REM corrupts block%
  514LOCAL a%,err%
  515SYS"XOS_ReadVarVal",name$,block%,256,0TO,,a%;err%
  516IF err% AND 1 THEN=""
  517block%?a%=13
  518=$block%
  519:
  520DEF FNscreenwidth:REM width of current mode in OS units
  521LOCAL xeig%,x%
  522SYS"OS_ReadModeVariable",-1,4 TO ,,xeig%
  523SYS"OS_ReadModeVariable",-1,11 TO ,,x%
  524=(1+x% << xeig%)-(21 << xeig%)
  525REM size goes from 0 to width-1 - scrollbars are 21 pixels wide
  526:
  527DEF PROCtoggleselect(state%)
  528LOCAL n%,m%
  529IF state% THEN menuicon%=-1
  530IF all%<>state% THEN all%=state%:PROCforceredraw(fakefiler%)
  531ENDPROC
  532:
  533DEF FNleafname(string$)
  534LOCAL n%,out$
  535n%=INSTR(string$,".")
  536out$=MID$(string$,n%+1)
  537IF n% THEN out$=FNleafname(out$)
  538=out$
  539:
  540DEF FNs(a%):REM Read control-terminated strings
  541LOCAL a$
  542WHILE ?a%>31
  543a$=a$+CHR$(?a%)
  544a%=a%+1
  545ENDWHILE
  546=a$
  547
  548
  549DEF PROCDir(path$)
  550REM IF LEN(store$) THEN PROCreport("Old store$ "+store$+": New store$ "+path$,1)
  551store$=FN_CSD
  552OSCLI"Dir "+path$
  553ENDPROC
  554
  555DEF FN_CSD:REM Returns current value of CSD - corrupts block%
  556LOCAL a$
  557SYS"OS_FSControl",37,"@",block%,0,0,255 TO ,,a$
  558REM OS_FSControl 37 = "Canonicalise path", i.e. remove all
  559REM wildcards and system variables.   @ is a reserved character
  560REM in RISC OS filenames denoting the CSD.
  561=a$
  562
  563DEF FNifthere(path$)
  564LOCAL A%
  565SYS"OS_File",17,path$ TO A%
  566=A%
  567:
  568DEF FNlower(string$):REM returns string in lower case
  569LOCAL x%,n%
  570FOR n%=1 TO LEN(string$)
  571x%=ASC(MID$(string$,n%))
  572IF (x%>64 AND x%<91) THEN MID$(string$,n%)=CHR$(x% OR 32)
  573NEXT n%
  574=string$
  575:
  576DEF FNstringlength(text$):REM returns width of string in OS units
  577LOCAL width%,xeig%
  578IF notfont% THEN
  579  SYS "OS_ReadModeVariable",-1,4 TO ,,xeig%
  580  width%=(8*LEN(text$)) << xeig%
  581ELSE
  582  SYS "Wimp_TextOp",1,text$,0 TO width%
  583ENDIF
  584=width%
  585:
  586DEF FNlooped(n%,max%)  :REM transforms n% to a no. between 1 and max%
  587=(max%+n%-1) MOD max% +1
  588:
  589DEF FNpathname(path$)
  590LOCAL n%
  591SYS"OS_FSControl",37,path$,block%,0,0,255
  592path$=FNs(block%)
  593n%=LEN(path$)
  594WHILE n%>1
  595  IF RIGHT$(path$)="." THEN n%=1
  596  path$=LEFT$(path$)
  597ENDWHILE
  598=path$
  599:
  600DEF FNsub(file$,a$,b$)
  601LOCAL n%
  602REPEAT
  603  n%=INSTR(file$,a$)
  604  IF n% THEN MID$(file$,n%,1)=b$
  605UNTIL n%=0
  606=file$
  607:
  608DEF FNunDOSify(path$)
  609LOCAL a%
  610a%=INSTR(path$,"."):REM detect DOS-type suffix
  611path$=FNsub(path$,"/","."):REM substitute valid directory separators
  612IF a% THEN MID$(path$,a%)="/":REM reinsert file extension if require
  613=path$
  614:
  615DEF FNgstrans(text$) :REM corrupts block%
  616LOCAL n%
  617SYS"OS_GSTrans",text$,block%,255 TO ,,n%
  618!(block%+n%)=13
  619=$block%
  620
  621DEF FNsprite_exists(spr$)
  622REM Tell whether a sprite is in the Wimp pool
  623LOCAL flags%
  624SYS "XWimp_SpriteOp",24,,spr$ TO ;flags%
  625=(flags% AND 1)=0
  626
  627REM Simulates a shift-doubleclick on a file
  628REM (loads a non-text file into a text editor, preserving filetype)
  629DEF PROCbroadcastfile(path$)
  630block%!0=256
  631block%!16=5
  632block%!28=160
  633 block%!32=320 :REM all lies...
  634 block%!36=0
  635 block%!40=&FFF
  636 REM Pretend it's a text file even if it isn't
  637 $(block%+44)=path$
  638 SYS"Wimp_SendMessage",17,block%,0
  639ENDPROC
  640:
  641DEF PROCbusy:REM this message gets issued in several places
  642param1$=p$:param2$="":PROCalertbox(FNmessage_looksub("busy"))
  643ENDPROC
  644
  645REM ---message file look-up-----------------------------------------------------
  646DEF FNmessage_lookup(token$)
  647LOCAL text$
  648SYS"MessageTrans_Lookup",mdata%,token$,0 TO ,,text$
  649=text$
  650:
  651DEF FNmessage_looksub(token$)
  652REM set global variables param1/2$ before calling
  653LOCAL n%,text$
  654SYS"MessageTrans_Lookup",mdata%,token$,temp%,255,param1$,param2$,0,0 TO ,,text$
  655=text$
  656
  657REM --------icon handling------------------------------------------------
  658DEF PROCseticontext(window%,icon%,text$)
  659!block%=window%:block%!4=icon%
  660SYS"Wimp_GetIconState",,block%
  661$(block%!28)=text$
  662block%!8=0:block%!12=0
  663SYS"Wimp_SetIconState",,block%
  664ENDPROC
  665
  666DEF FNgeticontext(win%,icon%)
  667!block%=win%:block%!4=icon%
  668SYS"Wimp_GetIconState",,block%
  669=$(block%!28)
  670
  671DEF PROCrecalciconbar:REM resize icon
  672
  673  LOCAL text_minx%,text_maxx%,text_miny%,text_maxy%,midx%,w%,maxw%
  674  IF notfont% THEN ENDPROC
  675  REM Wimp_ResizeIcon not supported (or needed here!) under RISC OS 3TAN1
  676
  677  !block%=-2:block%!4=ibar%
  678  SYS"Wimp_GetIconState",,block%
  679  text_minx%=block%!8:text_maxx%=block%!16
  680  text_miny%=block%!12:text_maxy%=block%!20
  681  midx%=text_minx%+(text_maxx%-text_minx%)/2
  682  w%=FNibar_width(FNmessage_lookup("Y"))
  683  w%=FNibar_width(FNmessage_lookup("N")):IF w%>maxw% THEN maxw%=w%
  684  SYS "Wimp_ResizeIcon",-1,ibar%,midx%-(maxw%/2),text_miny%,midx%+(maxw%/2),text_maxy%
  685ENDPROC
  686
  687DEF PROCredrawiconbar(token$)
  688  PROCseticontext(-2,ibar%,FNmessage_lookup(token$))
  689ENDPROC
  690:
  691DEF PROCputcaretinicon(win%,icon%)
  692SYS"Wimp_SetCaretPosition",win%,icon%,257,0,-1,-1
  693REM force caret to end of pathname
  694ENDPROC
  695:
  696
  697DEF FNiconselected(win%,icon%)
  698block%!0=win%
  699block%!4=icon%
  700SYS"Wimp_GetIconState",,block%
  701=(block%!24 AND (1<<21)) >>21
  702:
  703DEF PROCIconState(win%,icon%,bit%,flag%):REM switch specified flag bit on/off
  704!block%=win%:block%!4=icon%
  705block%!12=1<<bit%
  706IF flag% THEN block%!8=1<<bit% ELSE block%!8=0
  707SYS"Wimp_SetIconState",,block%
  708ENDPROC
  709:
  710DEF FNwhichfakeicon(x%,y%):REM translate fakefiler background co-ordinates to an icon number equivalent
  711LOCAL max_len%,index_ptr%,width%,cols%,icon_num%,err%,ptr%
  712LOCAL paneoffset%
  713IF showpane% THEN paneoffset%=96 ELSE paneoffset%=20
  714index_ptr%=!icon_index%
  715
  716max_len%=FNstringlength($(index_ptr%!4))
  717REM length of longest icon text - max width of column
  718IF max_len%<200 max_len%=200
  719IF max_len%>clipwidth% THEN max_len%=clipwidth%
  720ptr%=block%+128
  721ptr%!0=fakefiler%
  722SYS"Wimp_GetWindowInfo",,ptr% OR %1
  723x%=x%+ptr%!20-ptr%!4
  724y%=y%+ptr%!24-ptr%!16+paneoffset%
  725REM get relative (work area) co-ordinates
  726err%=x% MOD max_len%:IF err%<24 OR err%>(max_len%-24) THEN =-1
  727err%=-y% MOD 124:IF err%<24 OR err%>(124) THEN =-1
  728width%=ptr%!12-ptr%!4
  729cols%=(width%/max_len%):REM number of columns in window
  730IF cols%<1 THEN cols%=1
  731IF x%>(cols%*max_len%) THEN =-1
  732REM we may have a large blank space at right of window
  733
  734x%=(x%/max_len%):REM number of icons across
  735y%=(y%/-124):REM number of icons down
  736REM height is negative - use double negative to get positive answer
  737icon_num%=y%*cols%+x%
  738IF icon_num%+1>index_ptr%!0 THEN =-1
  739REM Note that icon numbers start from zero!
  740=icon_num%
  741:
  742DEF FNgetfakeleafname(icon%,clip%):REM get file name given offset in block
  743LOCAL ptr%,a$
  744LOCAL ERROR
  745ON ERROR LOCAL RESTORE ERROR:param1$=STR$(icon%):param2$="":PROCreport(FNmessage_looksub("addr"),2):=""
  746ptr%=(!icon_index%)+8
  747a$=$(ptr%!(icon%*4))
  748IF RIGHT$(a$)="/" AND clip%=TRUE THEN a$=LEFT$(a$)
  749=a$
  750:
  751DEF FNwhichfakesprite(icon%):REM which file sprite do we use for drags?
  752LOCAL a$,sprite$
  753a$=FNgetfakeleafname(icon%,FALSE):REM file name
  754sprite$="file_xxx"
  755IF RIGHT$(a$)="/" THEN
  756  IF LEFT$(a$,1)="!" THEN sprite$="application" ELSE sprite$="directory"
  757ENDIF
  758=sprite$
  759:
  760REM --------window handling-----------------------------------------------------
  761DEF PROCclose(window%)
  762block%!0=window%
  763SYS"Wimp_CloseWindow",,block%
  764IF window%=fakefiler% AND showpane%=1 THEN !block%=panepath%:SYS"Wimp_CloseWindow",,block%
  765REM close pane as well
  766ENDPROC
  767
  768DEF PROCchangetitle(win%,text$)
  769!block%=win%
  770SYS"Wimp_GetWindowInfo",,block% OR 1
  771$(block%!76)=text$
  772REM change window title
  773SYS"Wimp_ForceRedraw",-1,block%!4,block%!16,block%!12,block%!16+44
  774ENDPROC
  775:
  776DEF PROCfileinfo:REM sets up file info window
  777LOCAL a$,x$,m%,n%
  778x$=LEFT$(commonpath$)+FNgetfakeleafname(menuicon%,FALSE):m%=LEN(x$)
  779REM Name and icon were set up earlier when we clicked MENU
  780LOCAL ERROR
  781ON ERROR LOCAL IF FNfferror(ERR):ENDPROC
  782PTR#in%=0
  783RESTORE ERROR
  784REM This is getting very silly!
  785LOCAL ERROR
  786 ON ERROR LOCAL RESTORE ERROR:SYS"Hourglass_Off":IF ERR=223 THEN PROCnotfound:ENDPROC:ELSE ERROR ERR,REPORT$:ENDPROC
  787SYS"Hourglass_Start",50
  788a$=GET$#in%:n%=BGET#in%
  789REM skip first line (filename may be same as archive name)
  790REPEAT
  791  a$=GET$#in%:n%=BGET#in%
  792UNTIL RIGHT$(a$,m%)=x$
  793n%=VAL(a$):
  794SYS"OS_ConvertFileSize",n%,block%,255 TO ,n%:?n%=13
  795PROCseticontext(file%,6,$block%)
  796n%=INSTR(a$,"-"):PROCseticontext(file%,1,MID$(a$,n%-2,8))
  797n%=INSTR(a$,":"):PROCseticontext(file%,3,MID$(a$,n%-2,5))
  798SYS"Hourglass_Off"
  799ENDPROC
  800
  801DEF PROCnotfound
  802PROCseticontext(file%,1,"--/--/--")
  803PROCseticontext(file%,3,"--:--")
  804PROCseticontext(file%,6,"Unknown")
  805ENDPROC
  806
  807DEF PROCcentrewindow(win%)
  808LOCAL yeig%,y%,height%,xeig%,x%,width%
  809block%!128=win%
  810SYS"Wimp_GetWindowState",,block%+128
  811SYS "OS_ReadModeVariable",-1,5 TO ,,yeig%
  812SYS "OS_ReadModeVariable",-1,12 TO ,,y%
  813SYS "OS_ReadModeVariable",-1,4 TO ,,xeig%
  814SYS "OS_ReadModeVariable",-1,11 TO ,,x%
  815y%=1+y% <<yeig%
  816height%=block%!144-block%!136
  817x%=1+x% <<xeig%
  818width%=block%!140-block%!132
  819y%=(y%-height%)/2:REM top edge
  820x%=(x%-width%)/2:REM left edge
  821block%!136=y%:block%!144=y%+height%
  822block%!132=x%:block%!140=x%+width%
  823block%!156=-1
  824SYS"Wimp_OpenWindow",,block%+128
  825ENDPROC
  826:
  827DEF PROCcreatenew(popup%)
  828LOCAL text$
  829REM Offer to create new zipfile
  830IF popup% THEN PROCpopupsavewindow
  831action$="create"
  832PROCchangetitle(save%,FNmessage_lookup("S2"))
  833text$=FNmessage_lookup("Sname")
  834IF unixflag% text$+="/zip"
  835PROCseticontext(save%,1,text$)
  836PROCputcaretinicon(save%,1)
  837ENDPROC
  838:
  839DEF PROCopenconfig
  840PROCsetupconfig
  841PROCcentrewindow(configure%)
  842PROCputcaretinicon(configure%,-1)
  843ENDPROC
  844:
  845DEF PROCresize(width%,height%,textw%)
  846LOCAL max%,ptr%,no_of_files%,pathlen%
  847ptr%=!icon_index%
  848no_of_files%=!ptr%
  849IF no_of_files%*textw%<FNscreenwidth THEN max%=no_of_files%*textw%
  850REM work area needed to display all icons in one row (if possible)
  851max% = no_of_files%*textw%
  852pathlen% = FNstringlength(zipfile$)+140
  853IF pathlen%>max% THEN max%=pathlen%
  854IF max%<width% THEN max%=width%:REM cope with empty directories
  855IF max%>FNscreenwidth THEN max%=FNscreenwidth
  856!block%=0:block%!4=-height%:block%!8=max%:block%!12=0
  857SYS"Wimp_SetExtent",fakefiler%,block%
  858!block%=0:block%!4=-76:block%!8=max%:block%!12=0
  859SYS"Wimp_SetExtent",panepath%,block%
  860REM set work areas to widest possible for number of icons in window
  861
  862!block%=fakefiler%
  863SYS"Wimp_GetWindowState",,block%
  864
  865block%!8=block%!16-height%
  866block%!12=block%!4+width%
  867block%!20=0:block%!24=0
  868REM set up to reopen window at new size if desired
  869ENDPROC
  870:
  871DEF PROCtrapadjustclose(window%)
  872SYS"Wimp_GetPointerInfo",,block%+128
  873IF (block%!136 = 1) THEN
  874  REM ADJUST-click on fakefiler% (the only window with a close icon!)
  875  IF showpane%=1 OR levels%=0 THEN
  876    OSCLI"Filer_OpenDir "+FNpathname(zipfile$)
  877    IF NOT INKEY(-1) THEN PROCclose(fakefiler%)
  878  REM keep window open on SHIFT-ADJUST
  879  ELSE
  880    levels%=FNuplevel(levels%)
  881  ENDIF
  882ELSE
  883  PROCclose(!block%)
  884ENDIF
  885ENDPROC
  886:
  887DEF PROCpopupsavewindow
  888LOCAL x%,y%,width%,height%
  889SYS"Wimp_GetPointerInfo",,block%
  890x%=!block%
  891y%=block%!4
  892!block%=save%
  893SYS"Wimp_GetWindowState",,block%
  894width%=block%!12-block%!4
  895height%=block%!16-block%!8
  896block%!4=x%-(width%/2):block%!12=x%+(width%/2)
  897REM block%!8=y%-(height%/2):block%!16=y%+(height%/2)
  898block%!8=88:block%!16=88+height%
  899SYS"Wimp_OpenWindow",,block%
  900ENDPROC
  901:
  902
  903DEF PROCopenwindow(ptr%)
  904LOCAL stack%,width%,n%,leaf$
  905LOCAL index_ptr%,maxlenptr%,textw%,across%,height%,no_of_files%
  906LOCAL stringlen%,xeig%,paneoffset%,openrequest%
  907
  908IF !ptr%<>fakefiler% THEN SYS"Wimp_OpenWindow",,ptr%:ENDPROC
  909REM no panes or reformatting to worry about
  910
  911openrequest%=temp%+256:REM above scratch space (have 64b below other PROCs)
  912FOR n%=0 TO 28 STEP 4
  913  openrequest%!n% = ptr%!n%
  914NEXT n%
  915REM block% contents may now be freely corrupted
  916
  917IF showpane% THEN paneoffset%=96 ELSE paneoffset%=20
  918index_ptr%=!icon_index%
  919no_of_files%=!index_ptr%
  920REM *Report no_of_files%
  921width%=(openrequest%!12-openrequest%!4)
  922
  923IF no_of_files%>0 THEN
  924  maxlenptr%=index_ptr%!4
  925  textw%=FNstringlength($maxlenptr%)
  926  IF textw%<200 THEN textw%=200
  927  IF textw%>clipwidth% THEN textw%=clipwidth%:
  928  across%=width%/textw%
  929  IF across%<1 THEN across%=1
  930
  931  IF across%<>old_across% THEN
  932    height%=126*(( (no_of_files%)+across%-1) DIV across%)+paneoffset%
  933    PROCdrawwindow(across%,no_of_files%,textw%,FALSE)
  934    PROCforceredraw(fakefiler%):old_across%=across%
  935    REM try to avoid flicker - only redraw when no. of columns changes
  936  ENDIF
  937ENDIF
  938
  939IF showpane% THEN
  940  IF openrequest%!28 > 0 THEN
  941    !block%=!openrequest%
  942    SYS"Wimp_GetWindowState",,block%
  943    REM value at openrequest%!28 is not guaranteed to be handle of window in front -
  944    REM may legitimately be handle of window itself
  945    stack%=block%!28
  946  ELSE
  947    stack%=openrequest%!28
  948  ENDIF
  949  REM preserve stack position requested
  950  REM *Report ~stack% ~panepath% ~fakefiler%
  951  openrequest%!28=panepath%
  952  SYS"Wimp_OpenWindow",,openrequest%
  953  REM open window *under* pane (to avoid flicker) so that later call
  954  REM to Wimp_GetWindowState will find it in correct size/posn
  955
  956  !openrequest%=panepath%
  957  openrequest%!28=stack%
  958  SYS"Wimp_OpenWindow",,openrequest%
  959  REM open pane using same width and position (note that maximum height of the
  960  REM pane will undoubtedly be less than requested height!)
  961
  962  !openrequest%=fakefiler%
  963  SYS"Wimp_GetWindowState",,openrequest%:REM get back correct size for main window
  964  openrequest%!28=panepath%
  965  SYS"Wimp_OpenWindow",,openrequest%
  966  REM reopen it under pane (now in correct position in stack)
  967
  968  !block%=panepath%:block%!4=paneicon%:REM path display icon
  969  SYS"Wimp_GetIconState",,block%
  970  IF ptr%!16<>width%-8 THEN
  971    REM if size of icon needs to change
  972    IF notfont% THEN
  973      SYS"Wimp_DeleteIcon",,block%
  974
  975      paneicon%=FNtempl_icon(panepath%,64,-64,width%-8,-12,&17000135,"",!pathicon%,R2%,255)
  976      REM recreate icon to (almost) width of window
  977      REM in other words resize it (no Wimp_ResizeIcon under RISC OS 3TAN1)
  978    ELSE
  979      SYS "Wimp_ResizeIcon",panepath%,paneicon%,64,-64,width%-8,-12
  980    ENDIF
  981    PROCIconState(panepath%,paneicon%,9,FNstringlength("/"+LEFT$(commonpath$))>(width%-8-64-24)):REM width of icon
  982    REM Note 24-OS unit 'border allowance'
  983    REM left-align short text, right-align (flag bit 8) long text
  984    PROCforceredraw(panepath%)
  985    REM force redraw of icon
  986  ENDIF
  987ELSE
  988 REM if showpane%=0
  989  SYS"Wimp_OpenWindow",,openrequest%
  990ENDIF
  991ENDPROC
  992:
  993REM -----redraw handling--------------------------------------------------------
  994DEF PROCredrawrequest
  995LOCAL across%,name$,n%,width%,ptr%,a$,no_of_files%,flag%
  996LOCAL index_ptr%,maxlenptr%,textw%
  997IF !block%<>fakefiler% THEN ERROR 255,"Wrong window handle"
  998index_ptr%=!icon_index%
  999no_of_files%=!index_ptr%
 1000IF no_of_files%>0 THEN
 1001  maxlenptr%=index_ptr%!4
 1002  textw%=FNstringlength($maxlenptr%)
 1003ENDIF
 1004
 1005IF textw%<200 THEN textw%=200
 1006REM if no files found then local variable textw% is still 0
 1007IF textw%>clipwidth% THEN textw%=clipwidth%
 1008
 1009SYS"Wimp_RedrawWindow",,block% TO flag%
 1010across%=block%!12-block%!4
 1011WHILE flag%
 1012  PROCredraw(across%/textw%,no_of_files%-1,textw%,index_ptr%+8)
 1013  !block%=fakefiler%
 1014  SYS"Wimp_GetRectangle",,block% TO flag%
 1015ENDWHILE
 1016
 1017ENDPROC
 1018
 1019REM each icon is 116 OS units high
 1020REM lines of icons are at 126 OS unit spacing
 1021REM each icon is textw% OS units wide
 1022DEF PROCredraw(cols%,lasticon%,width%,ptr%)
 1023LOCAL icon_num%,xmin%,ymin%,stringptr%
 1024LOCAL d_xptr%,d_yptr%,worktop%,d_left%,d_top%,d_bottom%,d_right%
 1025LOCAL paneoffset%
 1026IF showpane% THEN paneoffset%=96 ELSE paneoffset%=20
 1027IF cols%<1 THEN cols%=1
 1028
 1029d_left%=(block%!28-block%!4)/width%
 1030d_right%=(block%!36-block%!4)/width%
 1031IF d_right%>cols%-1 THEN d_right%=cols%-1
 1032REM we may have quite large blank areas on the right
 1033REM Note there are no x scroll offsets
 1034worktop%=block%!16-block%!24-paneoffset%
 1035REM height of pane is 76 plus 20 extra space
 1036d_top%= (worktop%-block%!40)/126
 1037d_bottom%=(worktop%-block%!32)/126
 1038REM *Report \r d_top% d_bottom% d_left% d_right%
 1039IF d_left%>d_right% THEN ENDPROC:REM redrawing a blank area
 1040stringptr%=!icon_widths%
 1041
 1042FOR d_yptr%=d_top% TO d_bottom%
 1043  ymin%=-paneoffset% -126*(d_yptr%+1)
 1044  icon_num%=d_yptr%*cols%+d_left%
 1045  FOR d_xptr%=d_left% TO d_right%
 1046      xmin%=d_xptr%*width%
 1047      IF icon_num%<=lasticon% THEN
 1048        PROCploticon(xmin%,ymin%+4,width%,!(ptr%+icon_num%*4),stringptr%+icon_num%*4)
 1049        icon_num%+=1
 1050      ELSE
 1051        d_xptr%=d_right%:d_yptr%=d_bottom%
 1052      ENDIF
 1053  NEXT
 1054NEXT
 1055ENDPROC
 1056:
 1057DEF PROCploticon(x%,y%,width%,textptr%,stringlen%)
 1058LOCAL spriteptr%
 1059leaf$=$textptr%
 1060spriteptr%=datasprite%
 1061IF RIGHT$(leaf$)="/" THEN spriteptr%=dirsprite%:leaf$=LEFT$(leaf$)
 1062IF ASC(leaf$)=ASC("!") AND spriteptr%=dirsprite% THEN spriteptr%=appsprite%
 1063IF width%=clipwidth% AND !stringlen%>0 THEN leaf$=LEFT$(leaf$,!stringlen%)+FNdots(notfont%)
 1064$(block%+128)=leaf$
 1065block%!0=x%
 1066block%!4=y%
 1067block%!8=x%+width%
 1068block%!12=y%+116
 1069block%!16=&1700A10B
 1070IF all% THEN block%!16=&1720A10B
 1071block%!20=block%+128
 1072block%!24=spriteptr%
 1073block%!28=LEN(leaf$)
 1074SYS"Wimp_PlotIcon",,block%
 1075ENDPROC
 1076:
 1077DEF PROCsetclipwidths
 1078LOCAL fixed%,ptr%,count%,names%,old$,clip_to%
 1079ptr%=!icon_widths%:REM address to write to
 1080names%=!icon_index%:REM  pointers to leafnames
 1081count%=!(names%):REM no of files is stored at start of pointers block
 1082clip_to%=clipwidth%-16
 1083IF notfont% THEN
 1084 SYS "OS_ReadModeVariable",-1,4 TO ,,xeig%
 1085 fixed%=(clip_to%-(8<<xeig%)) /(8<<xeig%)
 1086 REM 8<<xeig% is width of one system font character
 1087ENDIF
 1088FOR n%=1 TO count%
 1089 leaf$=$(names%!(4+4*n%))
 1090 REM icon numbers go from 0 to count%-1
 1091 REM but block of pointers starts at names%!8
 1092 REM so we balance out by adding offset of 4
 1093 !ptr%=0
 1094 IF notfont%=TRUE THEN
 1095  IF FNstringlength(leaf$)>clip_to% THEN !ptr%=fixed%
 1096 ELSE
 1097   old$=leaf$
 1098   WHILE FNstringlength(leaf$)>clip_to%
 1099     leaf$=LEFT$(leaf$,LEN(leaf$)-4)+"..."
 1100   ENDWHILE
 1101   IF old$<>leaf$ THEN !ptr%=LEN(leaf$)-2
 1102   REM should be -3 but looks better this way!
 1103ENDIF
 1104 ptr%+=4
 1105NEXT n%
 1106REM set up a block indicating length of string
 1107
 1108ENDPROC
 1109:
 1110DEF PROCforceredraw(window%)
 1111REM call this when you need to change something in fakefiler%
 1112!block%=window%
 1113SYS"Wimp_GetWindowState",,block%
 1114IF window%=panepath% THEN block%!4=block%!12-200
 1115REM only redraw end of icon
 1116SYS"Wimp_ForceRedraw",-1,block%!4,block%!8,block%!12,block%!16
 1117REM now a redraw request will come via Wimp_Poll
 1118ENDPROC
 1119:
 1120REM ---functions called when objects are dragged in/out of Infozip-------------
 1121:
 1122DEF PROCdragged_out(path$)
 1123LOCAL a$,i%
 1124LOCAL ERROR
 1125ON ERROR LOCAL RESTORE ERROR:PROCreport(REPORT$+" at line "+STR$ ERL,1):PROCredrawiconbar("N"):ENDPROC
 1126IF wsavew%=fakefiler% THEN action$="unzip"
 1127REM in case you have opened the 'create' menu since unzipping this zipfile
 1128wait$=action$
 1129    CASE action$ OF
 1130      WHEN "zip":
 1131        IF child%=0 THEN
 1132          IF block%!36=-1 THEN OSCLI"Remove <Wimp$Scrap>":path$="<Wimp$Scrap>"
 1133          zipfile$=path$
 1134          PROCDir(FNpathname(notzipped$))
 1135          child%=FNchildtask(FNcommandline("zip",""))
 1136        ELSE
 1137          PROCbusy
 1138        ENDIF
 1139        PROCclose(save%):SYS"Wimp_CreateMenu",-1
 1140      WHEN "unzip":IF path$="<Wimp$Scrap>" THEN
 1141                      param1$=FNmessage_lookup("savXapp"):param2$=""
 1142
 1143                      PROCreport(FNmessage_looksub("savX"),1)
 1144                   ELSE
 1145                     IF wsavew%=fakefiler% AND child%=0 THEN
 1146                        notzipped$=path$
 1147                        IF all% THEN a$="all" ELSE a$=FNwhichfakesprite(wsavedrag%)
 1148                        child%=FNchildtask(FNcommandline("unzip",a$))
 1149                     ENDIF
 1150                   ENDIF
 1151      WHEN "create":OSCLI"Create "+path$+" 16":REM size is in HEX!
 1152                    i%=OPENUP path$
 1153                    BPUT#i%,"PK"+CHR$5+CHR$6+STRING$(18,CHR$(0));
 1154                    CLOSE#i%
 1155                    OSCLI"SetType "+path$+" "+RIGHT$(saveicon$,3)
 1156                    REM close new archive dialogue and menu tree
 1157                    SYS "Wimp_CreateMenu",-1:PROCclose(save%)
 1158                    i%=FNdragged_in(bar%,&DDC,path$)
 1159    ENDCASE
 1160ENDPROC
 1161
 1162DEF PROCpreserve
 1163LOCAL x%
 1164FOR x%=0 TO block%!0 STEP 4
 1165  preserve%!x%=block%!x%
 1166NEXT
 1167ENDPROC
 1168
 1169DEF PROCgotDataLoad(name$)
 1170LOCAL dataload%,n%
 1171dataload%=temp%+256+64:REM above scratch space and openwindow buffer
 1172FOR n%=0 TO 40 STEP 4
 1173  dataload%!n%=block%!n%
 1174NEXT
 1175IF block%!16=5 n%=0 ELSE n%=block%!20
 1176IF FNdragged_in(n%,block%!40,name$)=0 THEN ENDPROC
 1177FOR n%=0 TO 40 STEP 4
 1178  block%!n%=dataload%!n%
 1179NEXT
 1180block%!16=4:REM DataLoadAck
 1181block%!12=dataload%!8:REM sender's ref
 1182$(block%+44)=name$
 1183SYS"Wimp_SendMessage",17,block%,dataload%!4
 1184ENDPROC
 1185
 1186DEF FNdragged_in(window%,ftype%,path$)
 1187LOCAL RISCOS$,slash%,load%,a$
 1188LOCAL ERROR
 1189ON ERROR LOCAL RESTORE ERROR:param1$=path$:param2$="":PROCreport(FNmessage_looksub("loaX"),1):PROCredrawiconbar("N"):=0
 1190IF child%<>0 AND window%<>0 THEN PROCbusy:=0
 1191REM If window%=0 then this file was double-clicked on and may not be
 1192REM intended for Infozip - so don't throw away current setup yet!
 1193CASE window%OF
 1194  WHEN 0:IF FNchecktype(path$)=&DDC THEN PROCclearsetup:PROCunzipit:load%=1:ELSE load%=0
 1195  WHEN bar%:
 1196    PROCclearsetup
 1197    CASE FNchecktype(path$)OF
 1198      WHEN&DDC:IF INKEY(-2) THEN PROCselfextracting(path$) ELSE PROCunzipit
 1199              load%=1
 1200      WHEN-1:PROCalertbox(FNmessage_lookup("spk")):load%=0
 1201      WHEN&FCA:PROCalertbox(FNmessage_lookup("sqsh")):load%=0
 1202      OTHERWISE
 1203        RISCOS$=FNleafname(path$):IF LEFT$(RISCOS$,1)="!"THEN RISCOS$=MID$(RISCOS$,2)
 1204        notzipped$=path$
 1205        slash%=INSTR(RISCOS$,"/")
 1206        IF slash%THEN RISCOS$=LEFT$(RISCOS$,slash%-1)
 1207        IF unixflag% RISCOS$=FNlower(RISCOS$)+"/zip"
 1208        PROCseticontext(save%,1,RISCOS$):PROCchangetitle(save%,FNmessage_lookup("S1"))
 1209        PROCclose(fakefiler%)
 1210        PROCpopupsavewindow
 1211        last_opened%=save%
 1212        PROCputcaretinicon(save%,1)
 1213        action$="zip"
 1214        load%=1
 1215    ENDCASE
 1216  WHEN fakefiler%, panepath%
 1217    load%=1
 1218    slash%=FNchecktype(path$):REM slash% is just a handy variable
 1219    CASE slash% OF
 1220      WHEN -1,&FCA,&DDC:PROCreport(FNmessage_lookup("zipYN"),%11):slash%=(errclick%=1)
 1221      WHEN 0:slash%=&FFD:REM allow archiving of untyped (load/exec) files
 1222    ENDCASE
 1223    IF slash% THEN
 1224      action$="zip"
 1225      notzipped$=path$:delete_later$=path$
 1226      IF commonpath$<>"*" THEN
 1227  REM copy object into !Scrap and then compress it from there
 1228  REM so that we can fake the right path to create it in the current level
 1229  REM of the zipfile
 1230        a$=FN_CDirs(LEFT$(commonpath$,LEN(commonpath$)-2))+"."+FNleafname(notzipped$)
 1231        OSCLI"Copy "+notzipped$+a$+" ~C ~V R"
 1232        PROCDir("InfoScrap:add")
 1233        notzipped$=a$
 1234      ELSE PROCDir(FNpathname(notzipped$))
 1235      ENDIF
 1236      IF child%=0 THEN wait$="ad":child%=FNchildtask(FNcommandline("zip",""))
 1237      action$="unzip":REM restore 'inside file' default action
 1238    ELSE load%=0
 1239    ENDIF
 1240ENDCASE
 1241=load%
 1242:
 1243DEF PROCclearsetup
 1244LOCAL ptr%
 1245 commonpath$="*":levels%=0
 1246 IF in% SYS"XOS_Find",0,in%:in%=0
 1247REM PROCextend_named_sliding_block(icon_names%,16)
 1248PROCextend_named_sliding_block(icon_index%,16)
 1249ptr%=!icon_index%
 1250!ptr%=0:ptr%!4=0
 1251ENDPROC
 1252
 1253DEF FNchecktype(path$)
 1254LOCAL a$,A%,ftype%
 1255SYS"OS_File",23,path$ TO A%,,,,,,ftype%
 1256IF (A% AND 1)=0 THEN =ftype%
 1257a$=RIGHT$("00"+STR$~(ftype%),3):REM pad out with leading zeroes
 1258IF INSTR(FNgstrans("<Infozip$DontCompress>"),a$) THEN =&FCA
 1259REM Call all compressed filetypes "Squash"
 1260A%=OPENIN path$
 1261IF EXT#A%>22 THEN PTR#A%=EXT#A%-22
 1262a$=GET$#A%
 1263IF LEFT$(a$,2)="PK" THEN a$="zip" ELSE a$="not"
 1264CLOSE#A%
 1265CASE ftype% OF
 1266  WHEN &DDC,&A91:IF a$<>"zip" THEN ftype%=-1 ELSE ftype%=&DDC
 1267  OTHERWISE:IF a$="zip" AND window%=bar% THEN ftype%=&DDC
 1268  REM we don't want double-clicked non-archive files to be checked,
 1269  REM only those dragged to the iconbar
 1270ENDCASE
 1271=ftype%
 1272:
 1273DEF PROCunzipit
 1274SYS"Hourglass_Start",50
 1275SYS"Hourglass_LEDs",%01,%11
 1276IF child% THEN SYS"Hourglass_Off":PROCbusy:ENDPROC
 1277zipfile$=path$
 1278action$="unzip"
 1279
 1280wait$="list":child%=FNchildtask("unzip -l "+zipfile$+"  { > InfoScrap:CAT }")
 1281IF child%=0THEN PROCtaskended
 1282SYS"Hourglass_Off"
 1283ENDPROC
 1284:
 1285DEF FN_CDirs(path$)
 1286LOCAL n%,m%
 1287path$=FNunDOSify(path$)
 1288OSCLI"CDir InfoScrap:add"
 1289WHILE m%<>1
 1290  n%=INSTR(path$,".",m%)
 1291  IF n% THEN OSCLI "CDir InfoScrap:add."+LEFT$(path$,n%-1)
 1292  m%=n%+1
 1293ENDWHILE
 1294path$=" InfoScrap:add."+path$
 1295OSCLI"CDir"+path$
 1296=path$
 1297:
 1298DEF PROCnewdir(text$)
 1299LOCAL a$,ptr%
 1300IF child% THEN PROCbusy:ENDPROC
 1301IF text$="" THEN PROCreport(FNmessage_lookup("nodir"),1):ENDPROC
 1302text$=FNsub(text$," ","_"):REM don't do something silly....
 1303IF commonpath$<>"*" THEN text$=LEFT$(commonpath$,LEN(commonpath$)-2)+"/"+text$
 1304REM fake up DOS-style path for FNCDirs
 1305a$=FN_CDirs(text$)
 1306PROCupdatemenutext(newmenu%,1,""):REM clear writable icon for next time
 1307PROCDir("InfoScrap:add")
 1308notzipped$=a$
 1309REM now we just add it and then !Scrap gets wiped as normal
 1310wait$="ad":child%=FNchildtask(FNcommandline("zip",""))
 1311ENDPROC
 1312:
 1313DEF PROCselfextracting(file$)
 1314LOCAL A%,a$,b$,out$
 1315LOCAL ERROR
 1316ON ERROR LOCAL RESTORE ERROR:PROCreport(REPORT$+" at line "+STR$ ERL,1):ENDPROC
 1317b$=FNmessage_lookup("SEA")
 1318A%=OPENIN file$
 1319a$=GET$#A%
 1320CLOSE#A%
 1321IF LEFT$(a$,2)="PK" THEN a$="conv"ELSE  a$="rest"
 1322param1$=file$:param2$=b$:PROCreport(FNmessage_looksub(a$),%11)
 1323IF errclick%=2 THEN ENDPROC
 1324PROCclose(fakefiler%):last_opened%=0:REM in case we also have this archive open
 1325out$=file$
 1326IF FNlower(RIGHT$(file$,4))="/zip" THEN out$=LEFT$(file$,LEN(file$)-4)
 1327REM remove /zip suffix if we are converting file to self-extracting
 1328CASE a$ OF
 1329  WHEN "conv":wait$="temp"
 1330             child%=FNchildtask("sfx "+FNpathname(file$)+" "+FNleafname(file$)+" "+FNpathname(out$))
 1331  WHEN"rest":child%=FNchildtask("zip -J "+file$)
 1332ENDCASE
 1333ENDPROC
 1334
 1335DEF FNsavetext(window%,icon%)
 1336REM used to find correct name to give file dragged out of Infozip
 1337LOCAL a$
 1338CASE window% OF
 1339  WHEN fakefiler%:REM a$=FNgeticontext(window%,icon%)
 1340                  a$=FNgetfakeleafname(icon%,TRUE)
 1341  WHEN save%:a$=FNgeticontext(save%,1)
 1342ENDCASE
 1343=a$
 1344
 1345REM ---------Interactive help---------------------------------------------------
 1346DEF PROCdohelp
 1347LOCAL hlp$,keep%
 1348keep%=block%!8
 1349CASE block%!32 OF
 1350   WHEN bar%,fakefiler%,info%,file%,configure%,panepath%,save%: hlp$=FNwindowhelp(block%!32,block%!36)
 1351   OTHERWISE hlp$=FNmenuhelp
 1352ENDCASE
 1353block%!12=keep%
 1354block%!16=&503
 1355!block%=(25+LEN hlp$)ANDNOT3
 1356$(block%+20)=hlp$+CHR$0
 1357IF hlp$<>"" SYS "Wimp_SendMessage",17,block%
 1358ENDPROC
 1359
 1360DEF FNwindowhelp(window%,icon%)
 1361LOCAL a$
 1362param2$=""
 1363CASE window% OF
 1364  WHEN bar%:param1$=p$:a$=FNmessage_looksub("barH")
 1365  WHEN fakefiler%:param1$=FNleafname(zipfile$):a$=FNmessage_looksub("ffH")
 1366  WHEN save%:a$=FNmessage_lookup("savH")
 1367  WHEN info%:param1$=ver$:param2$=p$:a$=FNmessage_looksub("infH")
 1368  WHEN file%:a$=FNmessage_lookup("filH")
 1369             IF INSTR(FNgeticontext(file%,3),"--") THEN param1$=p$:a$+=FNmessage_looksub("noH")
 1370  WHEN panepath%:IF icon%>-1 THEN a$=FNmessage_lookup("paH"+STR$(icon%))
 1371  WHEN configure%:a$=FNmessage_lookup("conH")
 1372    CASE icon% OF
 1373      WHEN -1,12,13,1,0:a$=LEFT$(a$,LEN(a$)-3)
 1374      WHEN 14,15,16,17,18,19:a$=FNmessage_lookup("selH")+FNmessage_lookup("icH"+STR$(icon%))
 1375      OTHERWISE:a$=FNmessage_lookup("icH"+STR$(icon%))
 1376    ENDCASE
 1377ENDCASE
 1378=a$
 1379:
 1380DEF FNmenuhelp
 1381LOCAL a$,b$,menustate%
 1382menustate%=temp%+256+64:REM above scratch space and openwindow buffer
 1383SYS"Wimp_GetMenuState",0,menustate%
 1384IF !menustate%=-1 THEN=""
 1385REM Not sure what's causing this....
 1386b$=STR$(!menustate%)
 1387CASE lastmenuopened% OF
 1388  WHEN barmenu%:a$=FNmessage_lookup("bH"+b$)
 1389                IF menustate%!4>-1 THEN a$=FNmessage_lookup("selH")+FNmessage_lookup("oH"+STR$(menustate%!4))
 1390  WHEN fakefilermenu%:a$=FNmessage_lookup("fH"+b$)
 1391  CASE !menustate% OF
 1392    WHEN 0:IF menustate%!4>-1 a$=FNmessage_lookup("di"+STR$(menustate%!4))
 1393    WHEN 1:CASE menustate%!4 OF
 1394             WHEN -1:IF (menuicon%>-1 AND all%=0) THEN param1$=FNgetfakeleafname(menuicon%,TRUE):a$=FNmessage_looksub("fH1a")
 1395             WHEN 0: a$=FNmessage_lookup("fiH0")
 1396             WHEN 1: param1$=FNgetfakeleafname(menuicon%,TRUE):a$=FNmessage_looksub("fiH1")
 1397           ENDCASE
 1398    WHEN 2,3:IF all% THEN a$=FNmessage_lookup("fH"+b$+"a")
 1399    WHEN 4:IF menustate%!4>-1 THEN a$=FNmessage_lookup("selH")+FNmessage_lookup("oH"+STR$(menustate%!4))
 1400    WHEN 5: IF menustate%!4>-1 THEN a$=FNmessage_lookup("ndH0")
 1401    WHEN 6,7:IF levels%=0 THEN a$=FNmessage_lookup("fH6a")
 1402  ENDCASE
 1403  WHEN optsmenu%:a$=FNmessage_lookup("selH")+FNmessage_lookup("oH"+b$)
 1404ENDCASE
 1405=a$
 1406:
 1407REM -------------Wimp_Poll functions--------------------------------------------
 1408:
 1409DEF PROCpoll
 1410LOCAL reason%,n%
 1411finished%=FALSE
 1412 REPEAT
 1413   SYS"Wimp_Poll",pollmask%,block% TO reason%,block%
 1414   REM *ReportPoll (reason%)
 1415   CASE reason% OF
 1416     WHEN 0 : SYS"OS_ReadMonotonicTime" TO n%:IF n%>timeup% THEN PROCclose(alertbox%):pollmask% = pollmask% OR %1:REM mask out null-polls
 1417     WHEN 1 : PROCredrawrequest
 1418     WHEN 2 : PROCopenwindow(block%)
 1419     WHEN 3 : PROCtrapadjustclose(!block%)
 1420     WHEN 4 : SYS "Hourglass_Off":local_hon%=FALSE
 1421     WHEN 5 : SYS "Hourglass_Start",1:local_hon%=TRUE
 1422     WHEN 6 : PROCclick
 1423     WHEN 7 : PROCdrag_end
 1424     WHEN 8 : PROCkeypress(block%!0,block%!24)
 1425     WHEN 9 : PROCmenuselection
 1426     WHEN 17,18 : PROCmessage
 1427     WHEN 19: PROCbounce
 1428   ENDCASE
 1429 UNTIL finished%
 1430PROCquit
 1431ENDPROC
 1432:
 1433DEF PROCkeypress(win%,key%)
 1434LOCAL a$
 1435IF key%=&181 THEN
 1436  OSCLI("Filer_Run <Infozip$Dir>.!Help") :REM F1
 1437ELSE
 1438  CASE win% OF
 1439    WHEN configure%:
 1440      CASE key% OF
 1441        WHEN 13:REM Enter
 1442          PROCIconState(configure%,ic_OK%,21,1)
 1443          PROCreadconfig
 1444          PROCclose(configure%)
 1445          PROCIconState(configure%,ic_OK%,21,0)
 1446          key%=0
 1447        WHEN &1B:REM Escape
 1448          PROCIconState(configure%,ic_cancel%,21,1)
 1449          PROCsetupconfig
 1450          PROCclose(configure%)
 1451          PROCIconState(configure%,ic_cancel%,21,0)
 1452          key%=0
 1453      ENDCASE
 1454    WHEN save%:
 1455      CASE key% OF
 1456        WHEN 13:REM Enter
 1457          a$=FNgeticontext(save%,save_path%)
 1458          IF INSTR(a$,".")=0 AND INSTR(a$,":")=0 THEN PROCreport(FNmessage_lookup("tosave"),1) ELSE block%!36=0:wsavew%=save%:preserve%!0=0:PROCdragged_out(a$)
 1459          key%=0
 1460        WHEN &1B:REM Escape
 1461          PROCclose(save%):SYS"Wimp_CreateMenu",-1
 1462          key%=0
 1463      ENDCASE
 1464  ENDCASE
 1465ENDIF
 1466IF key% THEN SYS"Wimp_ProcessKey",key%
 1467ENDPROC
 1468:
 1469DEF PROCclick
 1470LOCAL x%,y%,icon%,window%,a$,buttons%,arrowsvalue%
 1471buttons%=block%!8:window%=block%!12:icon%=block%!16
 1472CASE buttons% OF
 1473  WHEN 2:REM menu
 1474         PROCMENUclick(window%)
 1475  WHEN 256,1024: REM click on fakefiler%
 1476          IF FNwhichfakeicon(block%!0,block%!4)=-1 THEN PROCtoggleselect(FALSE)
 1477  WHEN 64:REM Select-drag
 1478    IF child%<>0 THEN
 1479      PROCbusy
 1480    ELSE
 1481      wsavew%=window%
 1482      CASE window% OF
 1483        WHEN save%:PROCtoggleselect(FALSE):REM sets all% to FALSE
 1484                   wsavedrag%=icon%:PROCdragsprite(wsavedrag%,wsavew%)
 1485        WHEN fakefiler%:icon%=FNwhichfakeicon(block%!0,block%!4)
 1486          IF (icon%>-1 AND all%=FALSE) THEN wsavedrag%=icon%:PROCdragsprite(wsavedrag%,wsavew%)
 1487          REM normal save of selected icon
 1488          savedlevels%=levels%:REM in case the user changes level while
 1489          REM taskwindow is still running
 1490          IF all% THEN
 1491            wsavedrag%=0
 1492            REM this is the only icon of whose existence we can be sure
 1493            REM so pretend that we're saving this file
 1494            REM so that FNuser_savedata gets called, then InfoZIP routines
 1495            REM will save the _real_ files!
 1496            IF notfont% THEN PROCrotatingdashbox ELSE PROCdragsprite(-1,wsavew%)
 1497          ENDIF
 1498      ENDCASE
 1499    ENDIF
 1500  WHEN 1,4:
 1501       CASE window% OF
 1502         WHEN save%:
 1503           IF icon%=save_ok% THEN
 1504             a$=FNgeticontext(save%,save_path%)
 1505             IF INSTR(a$,".")=0 AND INSTR(a$,":")=0 THEN
 1506               PROCreport(FNmessage_lookup("tosave"),1)
 1507             ELSE
 1508               block%!36=0
 1509               wsavew%=save%
 1510               preserve%!0=0
 1511               PROCdragged_out(a$)
 1512             ENDIF
 1513           ENDIF
 1514           IF icon%=save_cancel% THEN PROCclose(save%):SYS"Wimp_CreateMenu",-1
 1515       WHEN bar%:
 1516           CASE buttons% OF
 1517             WHEN 4:REM SELECT
 1518              IF INKEY(-1) THEN
 1519                 PROCopenconfig
 1520               ELSE
 1521                 REM reopen last window opened
 1522                 IF last_opened% THEN !block%=last_opened%:SYS"Wimp_GetWindowState",,block%:block%!28=-1:PROCopenwindow(block%)
 1523               ENDIF
 1524             WHEN 1:REM ADJUST
 1525                 PROCcreatenew(TRUE)
 1526           ENDCASE
 1527       WHEN fakefiler%:REM double-click on icon
 1528            icon%=FNwhichfakeicon(block%!0,block%!4)
 1529            a$=FNwhichfakesprite(icon%)
 1530            CASE a$ OF
 1531              WHEN "file_xxx":
 1532                 IF INKEY(-1) THEN dontbroadcast%=FALSE:REM Shift held down
 1533                 IF child%=0 THEN notzipped$="<Wimp$ScrapDir>."+FNunDOSify(FNgetfakeleafname(icon%,TRUE)):wait$="unzip":child%=FNchildtask(FNcommandline("unzip",a$))ELSE PROCbusy
 1534                  savedlevels%=levels%:REM in case the user changes level while taskwindow is still running
 1535
 1536              OTHERWISE:PROCnextlevel(icon%)
 1537            ENDCASE
 1538       WHEN panepath%:levels%=FNuplevel(levels%)
 1539       WHEN configure%:
 1540         REM gain input focus
 1541         PROCputcaretinicon(configure%,-1)
 1542         CASE icon% OF
 1543           WHEN ic_bumpup%,ic_bumpdown%
 1544           arrowsvalue%=1+VAL(FNgeticontext(configure%,ic_timedisp%))+(icon%=ic_bumpdown%)-(icon%=ic_bumpup%)
 1545           REM If bumpup%, subtract -1; if bumpdown% add -1
 1546           PROCseticontext(configure%,ic_timedisp%,STR$(FNlooped(arrowsvalue%,10)-1))
 1547         REM FNlooped goes from 1 to max, we want 0 to max, so first we added 1
 1548         REM now set max limit one greater than required, then subtract one from result
 1549           WHEN ic_OK%
 1550             PROCreadconfig
 1551             IF (buttons% AND %001)=0 THEN PROCclose(configure%)
 1552           WHEN ic_save%
 1553             PROCreadconfig
 1554             PROCsaveoptions
 1555             IF (buttons% AND %001)=0 THEN PROCclose(configure%)
 1556           WHEN ic_cancel%
 1557             PROCsetupconfig
 1558             IF (buttons% AND %001)=0 THEN PROCclose(configure%)
 1559
 1560         ENDCASE
 1561       WHEN alertbox%:
 1562         PROCclose(alertbox%)
 1563         pollmask% = pollmask% OR %1:REM mask out null-polls
 1564       ENDCASE
 1565ENDCASE
 1566ENDPROC
 1567:
 1568DEF PROCrotatingdashbox
 1569!block%=fakefiler%:SYS"Wimp_GetWindowOutline",,block%
 1570block%!20=block%!16-50:block%!16=block%!12-60:block%!12=block%!8+4:block%!8=block%!4
 1571block%!4=5:REM dashed drag box
 1572block%!24=0:block%!28=0:block%!32=&7FFFFFFF:block%!36=&7FFFFFFF
 1573SYS"Wimp_DragBox",,block%
 1574ENDPROC
 1575:
 1576DEF PROCdragsprite(icon%,whandle%)
 1577LOCAL x%,y%,name$
 1578!block%=whandle%
 1579IF icon%>=0 THEN
 1580 CASE whandle% OF
 1581   WHEN fakefiler%: name$=FNwhichfakesprite(icon%)
 1582   WHEN save%: name$=saveicon$
 1583 ENDCASE
 1584ELSE
 1585REM we use icon%=-1 to force 'package' sprite to appear below pointer
 1586  name$="package":REM RISC-OS 3TAN5 and greater have this in Wimp pool
 1587ENDIF
 1588SYS"Wimp_GetPointerInfo",,block%
 1589block%!8=block%!0+12
 1590block%!12=block%!4+12:REM random value for 'drag box' which seems to work :-(
 1591SYS"DragASprite_Start",&C5,1,name$,block%
 1592ENDPROC
 1593:
 1594DEF PROCdrag_end
 1595LOCAL win%,icon%,x%,y%,n%,a$, datasave%
 1596datasave%=temp%+256+64:REM above scratch space and openwindow buffer
 1597SYS"DragASprite_Stop"
 1598SYS"Wimp_GetPointerInfo",,block%
 1599win%=block%!12
 1600IF win%=fakefiler% OR win%=save% OR win%=panepath% THEN ENDPROC
 1601icon%=block%!16
 1602x%=!block%
 1603y%=block%!4
 1604IF wsavew%=fakefiler% THEN a$=FNwhichfakesprite(wsavedrag%) ELSE a$=saveicon$
 1605CASE LEFT$(a$,5) OF
 1606  WHEN "file_":
 1607    IF RIGHT$(a$,3)="xxx" THEN
 1608      datasave%!40 = &ffd :REM pretend type is 'Data'
 1609    ELSE
 1610      SYS"OS_ReadUnsigned",10,"&"+RIGHT$(a$,3) TO ,,datasave%!40
 1611    ENDIF
 1612  WHEN "direc":datasave%!40 = 1000
 1613  WHEN "appli":datasave%!40 = 2000
 1614ENDCASE
 1615datasave%!12=0
 1616datasave%!16=1:REM DataSave
 1617a$=FNsavetext(wsavew%,wsavedrag%):IF INSTR(a$,".") THEN a$=FNunDOSify(a$)
 1618$(datasave%+44)=a$+CHR$0
 1619!datasave%=(44+LEN(a$)+1 +3) AND NOT 3:REM word-align length of block
 1620datasave%!20=win%
 1621datasave%!24=icon%
 1622datasave%!28=x%
 1623datasave%!32=y%
 1624datasave%!36=1024
 1625SYS"Wimp_SendMessage",18,datasave%,win%,icon%
 1626ENDPROC
 1627:
 1628DEF PROCmessage
 1629CASE block%!16 OF
 1630WHEN 0      : finished%=TRUE
 1631WHEN 1      : param1$=p$:param2$="":PROCreport(FNmessage_looksub("savX"),1)
 1632WHEN 2      : PROCpreserve:PROCdragged_out(FNs(block%+44))
 1633WHEN 3,5    : PROCgotDataLoad(FNs(block%+44))
 1634WHEN 10     : PROCsavedesktopbootfile(block%!20)
 1635WHEN &502   : PROCdohelp
 1636WHEN &400C0 : PROCmenuwarning(block%!20,block%!24,block%!28)
 1637WHEN &400C1,&400CF : REM mode/font changed
 1638  PROCrecalciconbar
 1639  block%!0=fakefiler%
 1640  SYS"Wimp_GetWindowInfo",,block%
 1641  IF (block%!32)AND2^16 THEN PROCfakefilerwindow(TRUE,FALSE):REM resize window
 1642  REM only redraw if window is currently supposed to be open
 1643WHEN &400C3 : IF child%=block%!4 THEN PROCtaskended
 1644REM if child task has finished then activate PROCtaskended
 1645ENDCASE
 1646ENDPROC
 1647:
 1648DEF PROCbounce
 1649CASE block%!16 OF
 1650  WHEN 3 : OSCLI"Remove "+FNs(preserve%+44):PROCreport(FNmessage_lookup("boun"),1)
 1651ENDCASE
 1652ENDPROC
 1653DEF PROCsavedesktopbootfile(file%)
 1654LOCAL string$
 1655 string$="Run "+FNReadSysVar("Infozip$Dir")+CHR$10
 1656 SYS "XOS_GBPB",2,file%,string$,LEN(string$)
 1657ENDPROC
 1658:
 1659REM ----functions to launch an external task and then clean up after it---------
 1660:
 1661DEF FNchildtask(cmd$)
 1662LOCAL handle%
 1663REM this routine should be called just before the end of a procedure so that
 1664REM if it does not return 0 (i.e. task is not yet complete) any actions
 1665REM dependent on the result of the task can be invoked from PROCtaskended
 1666REM which will be called by PROCmessage as soon as the task does finish.
 1667REM If it does return 0 you can call PROCtaskended explicitly yourself!
 1668SYS"Wimp_StartTask",cmd$ TO handle%
 1669IF handle% THEN
 1670  PROCredrawiconbar("Y"):
 1671  pollmask% = pollmask% AND (NOT %110000):REM don't mask out pointer enter/leave anymore
 1672ENDIF
 1673=handle%
 1674:
 1675DEF PROCtaskended
 1676LOCAL n%
 1677LOCAL ERROR
 1678ON ERROR LOCAL RESTORE ERROR:PROCreport(REPORT$+" at line "+STR$(ERL),1):PROCredrawiconbar("N"):ENDPROC
 1679pollmask% = pollmask% OR %110000:REM mask out pointer enter/leave
 1680IF local_hon% THEN SYS"Hourglass_Off"
 1681child%=0
 1682CASE wait$ OF
 1683  WHEN "list":in%=OPENIN"InfoScrap:CAT":PROCfakefilerwindow(TRUE,TRUE)
 1684  WHEN "zip":
 1685     IF preserve%!0 THEN
 1686     REM we zero this word to signal that we saved direct to Filer
 1687     REM (filename typed into savebox) and do not need WIMP message dialogue
 1688       FOR n%=0 TO preserve%!0
 1689         block%!n%=preserve%!n%
 1690       NEXT
 1691       block%!12=preserve%!8
 1692       block%!16=3:REM DataLoad - please load the zipfile I created
 1693       $(block%+44)=zipfile$+CHR$(0)
 1694       block%!0=(44+LEN(zipfile$)+1 +3) AND NOT 3:REM word-align length of block
 1695       SYS"Wimp_SendMessage",18,block%,preserve%!4
 1696       IF preserve%!36<>-1 THEN dum%=FNdragged_in(bar%,&DDC,zipfile$)
 1697  REM fool it into updating catalogue (pretend new file dragged to iconbar)
 1698  REM unless this was a scrap file saved into an application
 1699     ENDIF
 1700     IF openflag% AND preserve%!36<>-1 THEN OSCLI"Filer_OpenDir "+FNpathname(zipfile$)
 1701  WHEN"ad","delete":IF in% THEN CLOSE#in%
 1702              SYS"Hourglass_Start",50
 1703              SYS"Hourglass_LEDs",%01,%11
 1704
 1705              n%=FNchildtask("unzip -l "+zipfile$+" { > InfoScrap:CAT }")
 1706               in%=OPENIN"InfoScrap:CAT":PROCfakefilerwindow(TRUE,TRUE)
 1707               SYS"Hourglass_Off"
 1708               IF FNifthere("InfoScrap:add") THEN OSCLI"Wipe InfoScrap:add R ~V ~C F":REM clean up
 1709               IF LEN(delete_later$) THEN
 1710                IF FNifthere(delete_later$) THEN OSCLI"Wipe "+delete_later$+" R ~V ~C F ~N":delete_later$=""
 1711               ENDIF
 1712 REM Unless we were copying into root of zipfile, odds are that
 1713 REM the temporary file inside !Scrap was deleted, not the real original
 1714
 1715  WHEN "unzip":PROCclose(save%):SYS"Wimp_CreateMenu",-1
 1716               n%=TRUE:IF savedlevels%>0 THEN n%=FNmovefromscrap
 1717               REM we dumped it in !Scrap to hide directory structure
 1718               IF LEFT$(notzipped$,15)="<Wimp$ScrapDir>" AND n% THEN
 1719               REM file double-clicked on
 1720                OSCLI"Remove <Wimp$Scrap>":REM delete if present
 1721                OSCLI"Rename "+notzipped$+" <Wimp$Scrap>"
 1722                IF dontbroadcast% THEN OSCLI"Filer_Run <Wimp$Scrap>" ELSE PROCbroadcastfile("<Wimp$Scrap>")
 1723REM the point of all this is to avoid having more than one temporary file hanging around...
 1724              dontbroadcast%=TRUE
 1725              ENDIF
 1726
 1727ENDCASE
 1728IF wait$="" THEN wait$="zip"
 1729
 1730IF wait$="delete" THEN wait$="deleting" ELSE wait$+=RIGHT$(wait$)+"ing"
 1731IF wait$<>"listting" AND wait$<>"tempping" AND INSTR(FNoptions(0),"q") THEN PROCalertbox("Finished "+wait$)
 1732wait$="":opts$=""
 1733IF LEN(store$) OSCLI"Dir "+store$:store$="":REM restore CSD
 1734PROCredrawiconbar("N"):REM restore iconbar text
 1735ENDPROC
 1736:
 1737DEF FNmovefromscrap
 1738LOCAL a$,b$,n%
 1739LOCAL ERROR
 1740ON ERROR LOCAL RESTORE ERROR:param1$=FNpathname(notzipped$):param2$=REPORT$+" at "+STR$(ERL):PROCreport(FNmessage_looksub("wriX"),1):=FALSE
 1741n%=TRUE
 1742IF savedlevels%<1 THEN savedlevels%=levels%
 1743a$="InfoScrap:temp"+STRING$(savedlevels%,".*")+"."+FNleafname(notzipped$)
 1744REM name of file/dir with correct number of wildcards
 1745 b$=notzipped$
 1746REM name of file/dir in its destination
 1747IF all% THEN a$=FNpathname(a$)+".*"
 1748IF options%(2) THEN a$="InfoScrap:temp.*"
 1749REM level% is irrelevant if 'Ignore directory structure' set
 1750IF RIGHT$(a$)="*" THEN b$=FNpathname(b$)+".*"
 1751REM wildcards on *both* sides needed for *Copy
 1752IF FNifthere(a$) THEN
 1753  b$+=" R D F ~V ~C ~N"
 1754  IF options%(5) THEN RIGHT$(b$,2)="N "
 1755  REM If 'Extract newer' set then force Filer only to overwrite if archived file is newer
 1756  OSCLI "Copy "+a$+" "+b$
 1757  OSCLI"Wipe InfoScrap:temp R F ~V ~C"
 1758REM make sure there is only one object in 'temp' so kludges above work!
 1759ELSE
 1760  param1$=a$:param2$="":PROCreport(FNmessage_looksub("movX"),%11)
 1761  n%=(errclick%=1):IF n% THEN OSCLI"Filer_OpenDir InfoScrap:temp"
 1762ENDIF
 1763savedlevels%=-1
 1764=n%
 1765:
 1766REM -------functions to redraw the window for the level above/below-------------
 1767:
 1768DEF FNuplevel(x%)
 1769LOCAL m%,keep%
 1770IF x%=0 THEN:=0:REM already at top level
 1771keep%=x%
 1772WHILE x%>1
 1773    m%=INSTR(commonpath$,"/",m%+1)
 1774    x%-=1
 1775ENDWHILE
 1776IF m%=0 commonpath$="*" ELSE commonpath$=LEFT$(commonpath$,m%)+"*"
 1777PROCfakefilerwindow(FALSE,TRUE)
 1778PROCtoggleselect(FALSE)
 1779=keep%-1
 1780:
 1781DEF PROCnextlevel(clicked%)
 1782commonpath$=LEFT$(commonpath$)+FNgetfakeleafname(clicked%,FALSE)+"*"
 1783levels%+=1
 1784PROCfakefilerwindow(FALSE,TRUE)
 1785PROCtoggleselect(FALSE)
 1786ENDPROC
 1787:
 1788REM -----read/save options to Config file---------------------------------------
 1789:
 1790DEF FNconfigloadfilename
 1791LOCAL n$
 1792n$=FNReadSysVar("Choices$Path")
 1793IF n$="" THEN n$="<"+p$+"$Dir>.Resources" ELSE n$="Choices:"+p$
 1794=n$+".Config"
 1795:
 1796DEF FNconfigsavefilename
 1797LOCAL n$
 1798n$=FNReadSysVar("Choices$Write")
 1799IF n$="" THEN n$="<"+p$+"$Dir>.Resources" ELSE n$+="."+p$
 1800=n$+".Config"
 1801:
 1802DEF PROCloadconfig
 1803LOCAL A%,n%,ver%,dummy%,olddisp$
 1804LOCAL ERROR
 1805ON ERROR LOCAL RESTORE ERROR:PROCreport(REPORT$+" at line "+STR$(ERL),1):CLOSE#A%:ENDPROC
 1806A%=OPENIN FNconfigloadfilename
 1807INPUT#A%,ver%
 1808IF ver%<241 THEN PTR#A%=0:REM old versions don't have a version number
 1809FOR n%=1 TO 5:REM optsmenu%
 1810  INPUT#A%,options%(n%)
 1811NEXT
 1812IF ver%<243 THEN options%(5)=1-options%(5)
 1813REM New option 5 is more or less opposite of old
 1814IF ver%<241 THEN INPUT#A%,dummy%
 1815IF ver%>243 THEN INPUT#A%,options%(6)
 1816REM old and latest versions have extra option
 1817IF ver%<260 THEN INPUT#A%,olddisp$:disptime%=VAL(olddisp$) ELSE INPUT#A%,disptime%
 1818REM previously disptime was stored as a string
 1819INPUT#A%,beepflag%
 1820INPUT#A%,openflag%
 1821INPUT#A%,unixflag%
 1822IF ver%>300 THEN INPUT#A%,showpane% ELSE showpane%=1
 1823REM allow pane to be configured off
 1824CLOSE#A%
 1825ENDPROC
 1826:
 1827DEF PROCsetupoptsmenu
 1828LOCAL n%
 1829FOR n%=1 TO 6:REM optsmenu%
 1830  PROCtick(optsmenu%,n%,options%(n%))
 1831NEXT
 1832ENDPROC
 1833:
 1834DEF PROCsetupconfig
 1835LOCAL n%
 1836FOR n%=1 TO 6
 1837  PROCIconState(configure%,ic_opticons%+n%-1,21,options%(n%))
 1838NEXT
 1839PROCseticontext(configure%,ic_timedisp%,STR$(disptime%))
 1840PROCIconState(configure%,ic_beep%,21,beepflag%)
 1841PROCIconState(configure%,ic_open%,21,openflag%)
 1842PROCIconState(configure%,ic_unix%,21,unixflag%)
 1843PROCIconState(configure%,ic_show%,21,showpane%)
 1844ENDPROC
 1845:
 1846DEF PROCreadconfig
 1847LOCAL n%
 1848FOR n%=1 TO 6:REM optsmenu%
 1849  options%(n%)=FNiconselected(configure%,ic_opticons%+n%-1)
 1850NEXT
 1851disptime%=VAL(FNgeticontext(configure%,ic_timedisp%))
 1852beepflag%=FNiconselected(configure%,ic_beep%)
 1853openflag%=FNiconselected(configure%,ic_open%)
 1854unixflag%=FNiconselected(configure%,ic_unix%)
 1855n%=showpane%
 1856showpane%=FNiconselected(configure%,ic_show%)
 1857IF showpane%=n% THEN ENDPROC
 1858
 1859!block%=panepath%
 1860SYS"Wimp_GetWindowState",,block%
 1861IF (block%!32 AND (1<<16)) >0  AND showpane%=0 THEN PROCclose(panepath%)
 1862REM remove pane if it is open
 1863
 1864PROCfakefilerwindow(FALSE,TRUE):REM redraw & resize
 1865ENDPROC
 1866:
 1867DEF PROCsaveoptions
 1868LOCAL A%,n%
 1869LOCAL ERROR
 1870ON ERROR LOCAL RESTORE ERROR:PROCreport(REPORT$+" at line "+STR$(ERL),1):CLOSE#A%:ENDPROC
 1871SYS"XOS_CLI","CDir <Choices$Write>."+p$ TO ;n%
 1872REM CDir creates a directory if it does not already exist
 1873
 1874A%=OPENOUT FNconfigsavefilename
 1875PRINT#A%,301:REM version number
 1876REM update this if we change Config file format
 1877FOR n%=1 TO 6:REM size of optsmenu%
 1878  PRINT#A%,options%(n%)
 1879NEXT
 1880PRINT#A%,disptime%
 1881PRINT#A%,beepflag%
 1882PRINT#A%,openflag%
 1883PRINT#A%,unixflag%
 1884PRINT#A%,showpane%
 1885CLOSE#A%
 1886ENDPROC
 1887:
 1888REM --the functions which convert the catalogue file into a graphical display--
 1889DEF PROCfakefilerwindow(err%,reopen%)
 1890LOCAL H%,B%,G%,F%
 1891LOCAL a$,x%,y%,name_ptr%,index_ptr%,maxlenptr%
 1892LOCAL code_ptr%,max_icon_width%
 1893LOCAL ERROR
 1894ON ERROR LOCAL RESTORE ERROR:IF FNfferror(ERR):ENDPROC
 1895PROCclose(save%)
 1896IF reopen% THEN PROCclose(fakefiler%)
 1897all%=FALSE
 1898menuicon%=-1:REM no file 'selected'
 1899
 1900IF showpane% THEN PROCIconState(panepath%,0,22,commonpath$="*")
 1901
 1902SYS"XOS_File",17,zipfile$ TO ,,,,F%;x%:REM file length
 1903IF x% AND 1 THEN ENDPROC
 1904REM file not found - probably mode change when no file loaded
 1905PROCchangetitle(fakefiler%,zipfile$)
 1906
 1907IF F%=22 THEN PROCdrawwindow(0,0,400,reopen%):ENDPROC:REM an empty zipfile
 1908
 1909SYS"Hourglass_Start",50
 1910SYS"Hourglass_LEDs",%11,%11
 1911REM Slightly greater delay than that given by Hourglass_On
 1912no_of_files%=0
 1913PTR#in%=0
 1914a$=GET$#in%
 1915IF a$="" THEN a$=wait$+FNmessage_lookup("fail")
 1916IF LEFT$(a$,8)<>"Archive:" THEN ERROR 255,a$:REM text of a$ will be error message here
 1917x%=BGET#in%
 1918REM remember redirected output is CR+LF - get extra LF in x%
 1919x%=TRUE
 1920REPEAT
 1921  a$=GET$#in%:n%=BGET#in%
 1922  IF LEFT$(a$,7)="warning" AND err% THEN PROCreport(a$+FNmessage_lookup("warn"),%11):x%=(errclick%=1)
 1923UNTIL INSTR(a$,"----") OR x%=FALSE
 1924
 1925IF x%=FALSE THEN ERROR 255,""
 1926
 1927PROCextend_named_sliding_block(icon_names%,EXT#in%)
 1928REM claim enough icon_names% space to hold the *whole file* - guaranteed to be enough
 1929PROCextend_named_sliding_block(icon_index%,4*(EXT#in%/29))
 1930REM claim icon_index% space by calculating no. of lines, at 29 bytes per line
 1931REM (this is minimum possible length of line up to start of name)
 1932REM allocate one word for pointer per line
 1933REM (i.e. max possible icons if all in root)
 1934code_ptr%=!arrayscan%
 1935name_ptr%=!icon_names%
 1936maxlenptr%=!icon_index%
 1937maxlenptr%!4=0
 1938REM store no_of_files at maxlenptr% and pointer to longest name at maxlenptr%!4
 1939index_ptr%=maxlenptr%+8
 1940
 1941H%=index_ptr%:REM set R7 to point to index block
 1942G%=block%:REM set R6 to point to temporary buffer
 1943B%=in%:REM set R1 to file handle
 1944F%=EXT#in%/100:REM  set R5 to file size (DIV 100)
 1945$temp%=commonpath$:REM so we don't have to look it up again at every CALL
 1946
 1947code_ptr%!4=0:REM reset flag words
 1948code_ptr%!8=0
 1949CALL code_ptr%,name_ptr%,temp%,index_ptr%
 1950REM pass parameters:
 1951REM 1st - start of block in which to store pointers to names found
 1952REM 2nd - start of block holding "common path" string
 1953REM 3rd - start of output block into which to write names found
 1954REM R1,R5,R6 and R7 are also initialised with frequently-used values
 1955IF FNticked(dispmenu%,1) THEN SYS"OS_HeapSort",code_ptr%!4,index_ptr%,4
 1956maxlenptr%!0=code_ptr%!4
 1957REM so we can access no_of_files globally
 1958PROCextend_named_sliding_block(icon_widths%,4*!maxlenptr%)
 1959REM resize block to hold necessary string widths (for clipping)
 1960REM we set these later, at window-opening time
 1961
 1962maxlenptr%=!icon_index%
 1963
 1964REM machine code has already written address of longest name into maxlenptr%!4
 1965IF maxlenptr%!4>0 THEN
 1966 max_icon_width%=FNstringlength($(maxlenptr%!4))
 1967across%=4+(maxlenptr%!0 DIV 10)
 1968PROCsetclipwidths
 1969ELSE
 1970 across%=1
 1971ENDIF
 1972REM no.of icons in each row
 1973IF max_icon_width%<200 THEN max_icon_width%=200
 1974IF max_icon_width%>clipwidth% THEN max_icon_width%=clipwidth%
 1975x%=(FNscreenwidth/max_icon_width%)
 1976REM maximum number of files that will fit across screen
 1977IF x%<across% THEN across%=x%
 1978
 1979PROCdrawwindow(across%,maxlenptr%!0,max_icon_width%,reopen%)
 1980SYS"Hourglass_Off"
 1981ENDPROC
 1982
 1983DEF FNfferror(num%)
 1984LOCAL n%
 1985IF num%=222 THEN in%=OPENIN"InfoScrap:CAT":n%=FALSE:ELSE PROCreport(REPORT$,1):n%=TRUE
 1986REM try to recover from illegal/closed file error
 1987REM Return TRUE to abort PROCfakefilerwindow
 1988=n%
 1989
 1990DEF PROCdrawwindow(across%,no_of_files%,max_len%,reopen%)
 1991LOCAL name$,n%,width%,y%,ptr%,a$,commonlen%
 1992LOCAL paneoffset%
 1993IF showpane%=1 THEN paneoffset%=96 ELSE paneoffset%=20
 1994REM across% is number of columns in which files are displayed
 1995IF max_len%<200 THEN max_len%=200
 1996commonlen%=FNstringlength("/"+LEFT$(commonpath$))+64+8+24
 1997REM 64 OS units from left-hand side of pane and 8 OS units to right edge of pane
 1998REM plus 24-OS unit 'border allowance' to allow for the padding inserted by
 1999REM the WIMP at start of icon
 2000IF no_of_files%=0 THEN
 2001  REM empty directory
 2002 width%=commonlen%
 2003 across%=1
 2004ELSE
 2005 IF no_of_files%<across% THEN width%=max_len%*FNlooped(no_of_files%,across%) ELSE width%=max_len%*across%
 2006 IF width%<commonlen% THEN width%=commonlen%
 2007ENDIF
 2008REM width% is now required width of window (in OS units)
 2009y%=126*((no_of_files%+across%-1) DIV across%)+paneoffset%
 2010IF y%<(126+paneoffset%) THEN y%=126+paneoffset%
 2011IF showpane% THEN PROCseticontext(panepath%,1,"/"+LEFT$(commonpath$))
 2012PROCresize(width%,y%,max_len%)
 2013IF reopen% THEN
 2014  PROCopenwindow(block%):last_opened%=fakefiler%
 2015  REM reopen to (new) maximum size
 2016  IF child%=0 THEN PROCredrawiconbar("N") ELSE PROCredrawiconbar("Y")
 2017ENDIF
 2018ENDPROC
 2019:
 2020REM --------Command-line function-----------------------------------------------
 2021
 2022REM this function uses its parameters and the values of the global variables
 2023REM zipfile$, commonpath$ and notzipped$ to construct the actual command line
 2024REM which is the whole purpose of the program's existence!
 2025DEF FNcommandline(action$,type$)
 2026LOCAL args$,opts$,a$,file%
 2027CASE action$ OF
 2028  WHEN "unzip":
 2029               args$=" -d "
 2030               IF commonpath$="*" THEN
 2031                args$+=FNpathname(notzipped$)
 2032               ELSE
 2033                args$+="InfoScrap:temp"
 2034                 IF FNifthere("InfoScrap:temp") THEN OSCLI"Wipe InfoScrap:temp R ~V ~C F"
 2035               ENDIF
 2036               args$+=" "+CHR$(&22)+CHR$(&22)+LEFT$(commonpath$)
 2037               REM escape quotes
 2038               opts$=FNoptions(1)+"C "
 2039               CASE type$ OF
 2040                WHEN "application","directory":args$+=FNunDOSify(FNleafname(notzipped$))+"*"
 2041                WHEN "file_xxx":args$+=FNunDOSify(FNleafname(notzipped$))
 2042                WHEN "all":args$+="*"
 2043               ENDCASE
 2044               a$="unzipping":args$+=CHR$(&22)+CHR$(&22)
 2045  WHEN "zip":opts$=" -r -b <Wimp$ScrapDir> "
 2046             IF INKEY(-1) THEN opts$=" -m"+opts$ ELSE delete_later$=""
 2047             REM move/copy
 2048             IF LEFT$(notzipped$,15)=" InfoScrap:add." THEN args$=MID$(notzipped$,16) ELSE args$=FNleafname(notzipped$)
 2049             a$="zipping"
 2050             IF wait$="delete" THEN opts$=" -d -b <Wimp$ScrapDir> ":args$=FNunDOSify(notzipped$):a$="deleting"
 2051             opts$=FNoptions(0)+opts$
 2052             CASE type$ OF
 2053               WHEN "application","directory":args$+="*"
 2054             ENDCASE
 2055ENDCASE
 2056IF debug% THEN PROCdebug(action$+opts$+zipfile$+" "+args$)
 2057REM *Report \b (action$+opts$+zipfile$+" "+args$)
 2058="TaskWindow "+CHR$34+action$+opts$+zipfile$+" "+args$+CHR$34+" -name "+CHR$34+"Infozip ("+a$+")"+CHR$34+" -quit"
 2059:
 2060DEF FNoptions(type%)
 2061LOCAL n%,a$
 2062REM type% 0 =zip-applicable options only, type% 1 = all options
 2063a$=" -"
 2064FOR n%=1 TO 5
 2065  IF n%=2 OR n%=4 OR type%=1 THEN
 2066    IF options%(n%) THEN a$+=MID$(options$,n%,1)
 2067  ENDIF
 2068NEXT
 2069IF type%<>1 AND options%(n%) THEN a$+=MID$(options$,n%,1):REM n%=6
 2070IF a$=" -" THEN
 2071  IF type%=0 THEN a$=""
 2072ENDIF
 2073=a$
 2074:
 2075DEF PROCdebug(text$)
 2076LOCAL file$,handle%
 2077LOCAL ERROR
 2078ON ERROR LOCAL RESTORE ERROR:ENDPROC
 2079REM ON ERROR LOCAL RESTORE ERROR:OSCLI"ReportError":ENDPROC
 2080REM only likely error is 'can't write to file', i.e. don't worry about closing file on error
 2081file$=FNReadSysVar("Infozip$debugfile")
 2082IF FNifthere(file$) THEN file$=">> "+file$ ELSE file$="> "+file$
 2083REM handle%=OPENUP(file$)
 2084REM ELSE
 2085REM handle%=OPENOUT(file$)
 2086REM ENDIF
 2087REM PTR#handle%=EXT#handle%
 2088REM BPUT#handle%,text$
 2089REM CLOSE#handle%
 2090OSCLI "Echo "+text$+" { "+file$+" }"
 2091ENDPROC
 2092:
�>Infozip source
 ver$="3�07 (24th July 2012)"
"ț "<Infozip$Dir>.SHeap.SHeap"
�startup:�poll

�
:
R� ---Initialisation functions-------------------------------------------------
	� �startup

5� n%,messfile$,tempfile$,env$,size%,w%,maxw%,ptr%
p$="Infozip"
�initheaps(128,128)

(mainind%=�create_anchor("templates")
$arrows%=�create_anchor("arrows")
'message%=�create_anchor("messages")
(pathicon%=�create_anchor("pathicon")
"� These blocks MUST not slide!
,icon_names%=�create_anchor("icon names")
,icon_index%=�create_anchor("icon index")
-arrayscan%=�create_anchor("machine code")
.icon_widths%=�create_anchor("icon widths")
)� block% 256,temp% 1300,preserve% 256
z� first 256b of temp% is scratch space, next 64b reserved for PROCopenwindow, rest semi-permanent for high level PROCs
)param1$="":� for message substitution
param2$=""
.�create_named_sliding_block(mainind%,1460)
indptr%=!mainind%
lastmenuopened%=-1
� initbl% 48
initbl%!0=&400C3
initbl%!4=&502
 initbl%!8=&400C0
!initbl%!12=10
"initbl%!16=1
#initbl%!20=3
$initbl%!24=2
%initbl%!28=4
&initbl%!32=5
'initbl%!36=&400CF
(initbl%!40=&400C1
)initbl%!44=0
*<ș "Wimp_Initialise",300,&4B534154,p$,initbl% � notfont%
+notfont%=(notfont%<350)
,0in%=0:� global variable required by PROCquit
-/� � �report(�$+" at line "+� �,%10):�quit:�
.messfile$=p$+"Res:Messages"
//ș"MessageTrans_FileInfo",,messfile$ � ,,n%
0,�create_named_sliding_block(message%,n%)
1� mdata% 16
28ș"MessageTrans_OpenFile",mdata%,messfile$,!message%
3
4,�create_named_sliding_block(arrows%,512)
51� we are going to resize and reuse this later
6ptr%=!arrows%
7ș "OS_GetEnv" � env$
8<ș"OS_ReadArgs","BASIC,quit/k,zip,debug/s",env$,ptr%,512
9(� ptr%!8 � env$=�s(ptr%!8) � env$=""
:5� name of zipfile which launched program (if any)
;&� �ok_to_load_new_copy(env$)=� � �
<
=+debug%=ptr%!12:� do we dump debug info?
>
?(� Loading windows from template file
@.tempfile$="<"+p$+"$Dir>.Resources.Sprites"
A*ș"OS_ReadModeVariable",-1,5 � ,,size%
B� size%=1 � tempfile$+="22"
C,� load sprites of appropriate resolution
D>ș"OS_File",23,tempfile$ � ,,,,size%:� get length in size%
E0�extend_named_sliding_block(arrows%,size%+4)
F(!(!arrows%)=size%+4:!(!arrows%+8)=16
G:ș"OS_SpriteOp",&10A,!arrows%,tempfile$:� load sprites
H
I tempfile$=p$+"Res:Templates"
J$ș"Wimp_OpenTemplate",,tempfile$
Kinfo%=�loadwindow("info")
L!save%=�loadwindow("nicesave")
M'fakefiler%=�loadwindow("directory")
N%panepath%=�loadwindow("panepath")
O%alertbox%=�loadwindow("alertbox")
Pfile%=�loadwindow("file")
Q'configure%=�loadwindow("configure")
Rș"Wimp_CloseTemplate"
S
T� configure dialogue icons
Uic_opticons%=14:� 14 to 19
V>ic_timedisp%=3:ic_bumpup%=5:ic_bumpdown%=6:ic_timelabel%=2
W1ic_beep%=4:ic_open%=7:ic_unix%=10:ic_show%=20
X%ic_save%=9:ic_cancel%=11:ic_OK%=8
Y
Z� save dialogue icons
[<save_ok%=4:save_cancel%=3:save_path%=1:save_draggable%=2
\� create iconbar icon
]/� sprtext% 4:$sprtext%=�message_lookup("N")
^'� sprsprite% 12:$sprsprite%="S!"+p$
_+maxw%=�ibar_width(�message_lookup("Y"))
`>w%=�ibar_width(�message_lookup("N")):� w%>maxw% � maxw%=w%
aLibar%=�templ_icon(-1,0,-16,maxw%,88,&1700310B,"",sprtext%,sprsprite%,12)
bbar%=-2
c
d�seticontext(info%,0,p$)
e4�seticontext(info%,1,"Zip/Unzip files for free")
f1�seticontext(info%,2,"� Harriet Bazley 1998")
g�seticontext(info%,4,ver$)
h
i� load machine code
j/�create_named_sliding_block(arrayscan%,480)
k8�"Load <"+p$+"$Dir>.Resources.code "+�~(!arrayscan%)
l
m�menus_init
n� spritename% 11
o$spritename%="file_xxx"
p!block%=file%
qblock%!4=22
rblock%!8=-160
sblock%!12=90
tblock%!16=-92
ublock%!20=&C7000112
vblock%!24=spritename%
wblock%!28=1
xblock%!32=11
yMș"Wimp_CreateIcon",,block%:� create an updateable filetype icon in file%
zB� we do it this way so that we know the address of spritename%
{
|.�create_named_sliding_block(pathicon%,256)
}� R2% 3
~$R2%="R2":$(!pathicon%)="/"
Tpaneicon%=�templ_icon(panepath%,64,-64,2012,-12,&17000135,"",!pathicon%,R2%,255)
�
�� global variables
�last_opened%=0
�,no_of_files%=0:levels%=0:savedlevels%=-1
�-zipfile$="":notzipped$="":commonpath$="*"
�
store$=""
�:menuicon%=-1:� records which icon we clicked MENU over
�action$="":child%=0
�
all%=�
�Wdontbroadcast%=�:� records whether SHIFT was held down when file was double-clicked
�options$="ajLquI"
�delete_later$=""
�I� stores name of file dragged in (which we may want to move not copy)
�pollmask%=%1110000110001
�local_hon%=�
�
timeup%=0
�Rold_across%=0:� used to avoid unnecessary forced redraws on Window_Open events
�Fclipwidth%=272:� column width to which fakefiler icons are clipped
�
�saveicon$="file_ddc"
�e� �sprite_exists("file_a91") � saveicon$="file_a91":�seticontext(save%,save_draggable%,saveicon$)
�
�
�F� space reserved for holding names of sprites in fake filer window
�,� dirsprite% 11:$dirsprite%="Sdirectory"
�.� appsprite% 13:$appsprite%="Sapplication"
�-� datasprite% 11:$datasprite%="Sfile_xxx"
�
�� ---- configuration ----
�� options%(6)
�%� �ifthere(�configloadfilename) �
�  �loadconfig
��
�  options%()=0
�C  options%(5)=1:� Only extract newer set by default (dangerous)
�4  options%(6)=1:� Images as files set by default
�  disptime%=3
�5  beepflag%=0:openflag%=0:unixflag%=0:showpane%=1
��
�4�tick(dispmenu%,2,1):� default to old sort order
�
�u� �ifthere("<Wimp$ScrapDir>.Infozip") � �"%Wipe <Wimp$ScrapDir>.Infozip R ~C ~V F":� in case we crashed last time
�#�"CDir <Wimp$ScrapDir>.Infozip"
�2�"Set InfoScrap$Path <Wimp$ScrapDir>.Infozip."
�0� �(env$) � dum%=�dragged_in(bar%,&DDC,env$)
��
�:
�� �ibar_width(text$)
�� width%
�width%=�stringlength(text$)
�� width%<64 � width%=64
�=width%
�:
� � �ok_to_load_new_copy(env$)
�� n%,end%,ptr%
�7ș"TaskManager_EnumerateTasks",0,temp%,1300 � ,end%
�L� Instruct the Task Manager to dump a list of all currently active tasks
�-� into our buffer - 16 bytes to each task
�ptr%=temp%
�!� point to start of task list
�ȕ ptr%<end%
�%  � �s(ptr%!4)=p$ � ptr%=end%+100
�6  � jump out of loop when we find the task we want
�;  � the first four bytes of sixteen are the task handle
�6  � the second four are a pointer to the task name
�  ptr%+=16
�)  � examine next task - next 16 bytes
��
�
�S� ptr%>end%+100 � param1$=p$:param2$="":�report(�message_looksub("two"),%10):=�
�3� Quit program now if a copy is already running
�=�
�I� if we didn't jump out of loop, then our task is not already running
�
�
�� �loadwindow(name$)
�
� n%,ptr%
�Lș"Wimp_LoadTemplate",,temp%,indptr%,!mainind%+1450,-1,name$ � ,,indptr%
�+� 1400 is size of total indirected data
�*� name$="panepath" � temp%!64=!arrows%
�.� hack - this pane uses a user sprite area
�%ș"Wimp_CreateWindow",,temp% � n%
�=n%
�:
�X� �templ_icon(whandle%,leftx%,bottomy%,rightx%,topy%,flags%,text$,ptr1%,ptr2%,ptr3%)
�
� handle%
�!block%=whandle%
�block%!4=leftx%
�block%!8=bottomy%
�block%!12=rightx%
�block%!16=topy%
�block%!20=flags%
�� ptr1%=0 �
�$(block%+24)=text$
��
�block%!24=ptr1%
�block%!28=ptr2%
�block%!32=ptr3%
��
�)ș"Wimp_CreateIcon",,block% � handle%
�=handle%
�
�R� --------menu handling-------------------------------------------------------
�
�� �menus_init
�
� ptr%
�param1$=p$
�Qbaritems%=5:� global variable used to calculate menu height for iconbar click
�Jbarmenu%=�makemenu(�message_looksub("bar"),baritems%):� make main menu
�6fakefilermenu%=�makemenu(�message_looksub("ff"),8)
�2filemenu%=�makemenu(�message_lookup("file"),2)
�1optsmenu%=�makemenu(�message_lookup("opt"),6)
�0newmenu%=�makemenu(�message_lookup("new"),1)
�2dispmenu%=�makemenu(�message_lookup("disp"),2)
�ptr%=newmenu%+28
�5!ptr%=%10000100:� menu flags: writable, last item
�"�updatemenutext(newmenu%,1,"")
�)!(�submenuhandle(barmenu%,1)+4)=info%
�3!(�submenuhandle(fakefilermenu%,5)+4)=optsmenu%
�)ptr%=�submenuhandle(fakefilermenu%,5)
�:ptr%!4=optsmenu%:!ptr%=!ptr% � %1000:� submenu warning
�
�#ptr%=�submenuhandle(barmenu%,4)
�6ptr%!4=save%:!ptr%=!ptr% � %1000:� submenu warning
�2!(�submenuhandle(fakefilermenu%,6)+4)=newmenu%
�3!(�submenuhandle(fakefilermenu%,1)+4)=dispmenu%
�3!(�submenuhandle(fakefilermenu%,2)+4)=filemenu%
�$ptr%=�submenuhandle(filemenu%,1)
6ptr%!4=file%:!ptr%=!ptr% � %1000:� submenu warning
� poke in submenu handles

�
:
� �makemenu(text$,num%)
$� n%,m%,menu%,a%,b$,max%,ptr%,x%
� menu% 28+num%*24
&n%=�text$,"|"):$menu%=�text$,n%-1)
	menu%?12=7:menu%?13=2

menu%?14=7:menu%?15=0
menu%!20=44:menu%!24=0
ptr%=menu%+4

� x%=1 � num%
   ptr%+=24:!ptr%=0:ptr%!4=-1
  n%+=1
  m%=�text$,"|",n%)
  b$=�text$,n%,m%-n%)
!  � (m%-n%)>max% � max%=m%-n%
  � m%-n%>11 �
    � a% (m%-n%+1)
    $a%=b$
    ptr%!8=&7000121
    ptr%!12=a%
    ptr%!16=0
    ptr%!20=m%-n%
#    � like indirected text icon
  �
    ptr%!8=&7000021
    $(ptr%+12)=b$
  �
  n%=m%
 � x%
!/!ptr%=1<<7:� this should point to last item
"menu%!16=(max%*16)+16
#
=menu%
$:
%F� �submenuhandle(menu%,num%):� returns start of item in menu block
&=menu%+28+(num%-1)*24
'
(� �tick(menu%,num%,type%)
)� type: 2=toggle,1=on,0=off
*
� ptr%
+#ptr%=�submenuhandle(menu%,num%)
,Ȏ type% �
- � 2:!ptr%=(!ptr% � 1)
. � 1:!ptr%=(!ptr% � 1)
/ � 0:!ptr%=(!ptr% � � 1)
0�
1�
2:
3� �ticked(menu%,item%)
4� A%
5 A%=(menu%+28)+(24*(item%-1))
6=!A%� 1
7:
8#� �shademenu(menu%,num%,state%)
9
� ptr%
:%ptr%=�submenuhandle(menu%,num%)+8
;!ptr%=!ptr% � � (1<<22)
<$� force bit 22 (greyed out) to 0
=$� state% � !ptr%=!ptr% � (1<<22)
>#� now force it to 1 if required
?�
@
A'� �updatemenutext(menu%,num%,text$)
B� ptr%,n%,x$,max%
Cn%=1
Dx$=�s(menu%):� menu title
Emax%=�(x$)
F�
G#  ptr%=�submenuhandle(menu%,n%)
H  � (ptr%!8 � (1<<8))=� �
I$    � n%=num% � $(ptr%+12)=text$
J    x$=$(ptr%+12)
K  �
L    � n%=num% �
MU      � ptr%!20<�(text$) � � 255,"Text too long for menu item" � $(ptr%!12)=text$
N	    �
O    x$=$(ptr%!12)
P  �
Q  � max%<�(x$) � max%=�(x$)
R  n%+=1
S� (!ptr% � 1<<7)
Tmenu%!16=max%*16+16
U�
V:
W"� �menuwarning(submenu%,x%,y%)
XȎ submenu% �
Y  � optsmenu%
Z    �setupoptsmenu
[.    ș"Wimp_CreateSubMenu",,submenu%,x%,y%
\
  � file%
]    �fileinfo
^.    ș"Wimp_CreateSubMenu",,submenu%,x%,y%
_
  � save%
`.    ș"Wimp_CreateSubMenu",,submenu%,x%,y%
a    �createnew(�)
b�
c
d
e�
f:
g#� �updatefilermenu(file$,icon$)
h  � a$,b$,n%,m%
i  Ȏ levels% �
jI    � 0:�shademenu(fakefilermenu%,7,1):�shademenu(fakefilermenu%,8,1)
kG    :�shademenu(fakefilermenu%,7,0):�shademenu(fakefilermenu%,8,0)
l>    � 'Open parent'/'Top directory' not valid on top level
m  �
n  � file$<>"" �
o&    �shademenu(fakefilermenu%,2,0)
p(    $spritename%=icon$:� update icon
qO    � IF RIGHT$(file$)="/" THEN file$=LEFT$(file$):REM clip directory names
r �
s&    �shademenu(fakefilermenu%,2,1)
t  �
u
v  b$=�commonpath$)+file$
w<  � �(b$)>35 � b$=�b$,35):� size of icon indirected data
xM  �IconState(file%,4,3,�stringlength(b$)<436):� width of icon in OS units
yC  � centre-align (flag bit 3) short text, right-align long text
z  �seticontext(file%,4,b$)
{
| � ** make data fit window **
}
~=  � don't get filesize, date etc yet - search is too slow
  n%=3:m%=4
�  � all% �
�B    �updatemenutext(fakefilermenu%,2,�message_lookup("fakeS"))
�&    �shademenu(fakefilermenu%,2,1)
�    Ȕ n%,m%
�  �
�:    a$=�message_lookup("fake"+�icon$,1))+"'"+file$+"'"
�-    � use 'File', 'Dir', etc. as required
�3    � �(a$)>28 � a$=�a$,24)+�dots(notfont%)+"'"
�K    � This menu was originally dimensioned to allow for a 28-char entry
�,    �updatemenutext(fakefilermenu%,2,a$)
�  �
�$  � swap greyed-out entries over
�%  �shademenu(fakefilermenu%,n%,0)
�%  �shademenu(fakefilermenu%,m%,1)
��
�:
�� �MENUclick(window%)
�� y%,x%,a%,icon%
�#y%=(block%!4)+16:x%=!block%-156
�Ȏ window% �
�9  � bar%:y%=96+baritems%*44:x%=!block%-64:a%=barmenu%
�$  � fakefiler%:a%=fakefilermenu%
�/    icon%=�whichfakeicon(block%!0,block%!4)
�    � icon%>-1 �
�M      �updatefilermenu(�getfakeleafname(icon%,�),�whichfakesprite(icon%))
�*      wsavew%=window%:wsavedrag%=icon%
�	    �
�!      �updatefilermenu("","")
�	    �
�    menuicon%=icon%
��
�0� a%=0 � �:� no menu to open in this context
�!ș"Wimp_CreateMenu",,a%,x%,y%
�lastmenuopened%=a%
��
�
�� �menuselection
� � n%,menusel%,a$,menu%,item%
�Emenusel%=temp%+256+64:� above scratch space and openwindow buffer
�menusel%!4=lastmenuopened%
�ȕ(block%!n%<>-1)
�  item%=block%!n%
�1  menusel%=�submenuhandle(menusel%!4,item%+1)
�9  � each menu item holds submenu (or -1) at offset +4
�A  � FNsubmenuhandle counts top item as 1, WIMP counts it as 0
�  n%+=4
��
�=menu%=menusel%-28-24*item%:� reverse last FNsubmenuhandle
�item%+=1
�
�Ȏ menu% �
�%  � newmenu%:�newdir(�newdirname)
�  � barmenu%:Ȏ item% �
�      � 3:�openconfig
�.      � 2:�"Filer_Run <Infozip$Dir>.!Help"
�      � 5:�quit
�	    �
�  � dispmenu%:
�       �tick(menu%,item%,1)
�@       �tick(menu%,�looped(item%+1,2),0):� untick other item
�        �fakefilerwindow(�,�)
�=       �forceredraw(fakefiler%):� redraw byt don't reopen
�!  � fakefilermenu%:Ȏ item% �
�8      � 3:�toggleselect(1):� all% must be 1 not TRUE
�      � 4:�toggleselect(�)
�'      � 7:levels%=�uplevel(levels%)
�!      � 8:levels%=�uplevel(1)
�	    �
�    � filemenu%:� item%=2 �
�           � child%=0 �
�             action$="zip"
�D             � all% � a$="all" � a$=�whichfakesprite(wsavedrag%)
�             wait$="delete"
�G             notzipped$=�commonpath$)+�savetext(wsavew%,wsavedrag%)
�:             child%=�childtask(�commandline("zip",a$))
�          �
�            �busy
�          �
�      �
�    � optsmenu%
�,      �tick(menu%,item%,2):� toggle tick
�I      options%(item%)=�ticked(optsmenu%,item%):� update configuration
��
�#ș"Wimp_GetPointerInfo",,block%
�� block%!8 � 1 �
�6  � menu%=fakefilermenu% � �updatefilermenu("","")
�A  ș"Wimp_CreateMenu",,lastmenuopened%,!block%-64,block%!4+20
��
��
�
�� �newdirname
�
� ptr%
�ptr%=newmenu%+28
�=$(ptr%!12)
�0� indirected text of first entry in newmenu%
�:
�K� �dots(flag%):� only system font can be guaranteed to have � character
�� flag% � ="�"
�
="..."
�:
�R� --------Error boxes---------------------------------------------------------
�
�� �report(text$,flags%)
�!block%=255
�$(block%+4)=text$+�0
�7ș "Wimp_ReportError",block%,flags%,p$ � ,errclick%
��
�
�� �quit
�� "Unset InfoScrap$Path"
�� in% ș"XOS_Find",0,in%
�`� �ifthere("<Wimp$ScrapDir>.Infozip") � ș"XOS_CLI","Wipe <Wimp$ScrapDir>.Infozip R ~V ~C F"
�� tidy up before closedown
�ș"Wimp_CloseDown"
��
��
�
�� �alertbox(text$)
�� n%
�� disptime%=0 � �
�=� treat setting of zero as 'suppress alertbox altogether'
�#�seticontext(alertbox%,0,text$)
��centrewindow(alertbox%)
�� (7*beepflag%)
�bș"OS_ReadMonotonicTime" � n%:timeup%=n%+100*disptime%:� set global variable to required delay
�Bpollmask% = pollmask% � (� %1):� no longer mask out null-polls
��
�:
R� ------------General useful functions----------------------------------------
*� �ReadSysVar(name$):� corrupts block%

� a%,err%
3ș"XOS_ReadVarVal",name$,block%,256,0�,,a%;err%
� err% � 1 �=""
block%?a%=13
=$block%
:
6� �screenwidth:� width of current mode in OS units
	� xeig%,x%

*ș"OS_ReadModeVariable",-1,4 � ,,xeig%
(ș"OS_ReadModeVariable",-1,11 � ,,x%
"=(1+x% << xeig%)-(21 << xeig%)

A� size goes from 0 to width-1 - scrollbars are 21 pixels wide
:
� �toggleselect(state%)
� n%,m%
� state% � menuicon%=-1
9� all%<>state% � all%=state%:�forceredraw(fakefiler%)
�
:
� �leafname(string$)

� n%,out$
n%=�string$,".")
out$=�string$,n%+1)
� n% � out$=�leafname(out$)
	=out$
:
.� �s(a%):� Read control-terminated strings
� a$

ȕ ?a%>31
a$=a$+�(?a%)
 a%=a%+1
!�
"=a$
#
$
%� �Dir(path$)
&R� IF LEN(store$) THEN PROCreport("Old store$ "+store$+": New store$ "+path$,1)
'store$=�_CSD
(�"Dir "+path$
)�
*
+<� �_CSD:� Returns current value of CSD - corrupts block%
,� a$
-1ș"OS_FSControl",37,"@",block%,0,0,255 � ,,a$
.<� OS_FSControl 37 = "Canonicalise path", i.e. remove all
/A� wildcards and system variables.   @ is a reserved character
0,� in RISC OS filenames denoting the CSD.
1=a$
2
3� �ifthere(path$)
4� A%
5ș"OS_File",17,path$ � A%
6=A%
7:
84� �lower(string$):� returns string in lower case
9� x%,n%
:� n%=1 � �(string$)
;x%=�(�string$,n%))
</� (x%>64 � x%<91) � �string$,n%)=�(x% � 32)
=� n%
>=string$
?:
@@� �stringlength(text$):� returns width of string in OS units
A� width%,xeig%
B� notfont% �
C-  ș "OS_ReadModeVariable",-1,4 � ,,xeig%
D"  width%=(8*�(text$)) << xeig%
E�
F)  ș "Wimp_TextOp",1,text$,0 � width%
G�
H=width%
I:
JD� �looped(n%,max%)  :� transforms n% to a no. between 1 and max%
K=(max%+n%-1) � max% +1
L:
M� �pathname(path$)
N� n%
O,ș"OS_FSControl",37,path$,block%,0,0,255
Ppath$=�s(block%)
Qn%=�(path$)
Rȕ n%>1
S  � �path$)="." � n%=1
T  path$=�path$)
U�
V
=path$
W:
X� �sub(file$,a$,b$)
Y� n%
Z�
[  n%=�file$,a$)
\  � n% � �file$,n%,1)=b$
]
� n%=0
^
=file$
_:
`� �unDOSify(path$)
a� a%
b+a%=�path$,"."):� detect DOS-type suffix
cEpath$=�sub(path$,"/","."):� substitute valid directory separators
d>� a% � �path$,a%)="/":� reinsert file extension if require
e
=path$
f:
g(� �gstrans(text$) :� corrupts block%
h� n%
i*ș"OS_GSTrans",text$,block%,255 � ,,n%
j!(block%+n%)=13
k=$block%
l
m� �sprite_exists(spr$)
n/� Tell whether a sprite is in the Wimp pool
o� flags%
p*ș "XWimp_SpriteOp",24,,spr$ � ;flags%
q=(flags% � 1)=0
r
s-� Simulates a shift-doubleclick on a file
tE� (loads a non-text file into a text editor, preserving filetype)
u� �broadcastfile(path$)
vblock%!0=256
wblock%!16=5
xblock%!28=160
y! block%!32=320 :� all lies...
z block%!36=0
{ block%!40=&FFF
|0 � Pretend it's a text file even if it isn't
} $(block%+44)=path$
~% ș"Wimp_SendMessage",17,block%,0
�
�:
�8� �busy:� this message gets issued in several places
�=param1$=p$:param2$="":�alertbox(�message_looksub("busy"))
��
�
�R� ---message file look-up-----------------------------------------------------
�� �message_lookup(token$)
�� text$
�5ș"MessageTrans_Lookup",mdata%,token$,0 � ,,text$
�
=text$
�:
�� �message_looksub(token$)
�3� set global variables param1/2$ before calling
�� n%,text$
�Qș"MessageTrans_Lookup",mdata%,token$,temp%,255,param1$,param2$,0,0 � ,,text$
�
=text$
�
�K� --------icon handling------------------------------------------------
�'� �seticontext(window%,icon%,text$)
�"!block%=window%:block%!4=icon%
�!ș"Wimp_GetIconState",,block%
�$(block%!28)=text$
�block%!8=0:block%!12=0
�!ș"Wimp_SetIconState",,block%
��
�
�� �geticontext(win%,icon%)
�!block%=win%:block%!4=icon%
�!ș"Wimp_GetIconState",,block%
�=$(block%!28)
�
�"� �recalciconbar:� resize icon
�
�B  � text_minx%,text_maxx%,text_miny%,text_maxy%,midx%,w%,maxw%
�  � notfont% � �
�I  � Wimp_ResizeIcon not supported (or needed here!) under RISC OS 3�1
�
�  !block%=-2:block%!4=ibar%
�#  ș"Wimp_GetIconState",,block%
�.  text_minx%=block%!8:text_maxx%=block%!16
�/  text_miny%=block%!12:text_maxy%=block%!20
�0  midx%=text_minx%+(text_maxx%-text_minx%)/2
�*  w%=�ibar_width(�message_lookup("Y"))
�@  w%=�ibar_width(�message_lookup("N")):� w%>maxw% � maxw%=w%
�Y  ș "Wimp_ResizeIcon",-1,ibar%,midx%-(maxw%/2),text_miny%,midx%+(maxw%/2),text_maxy%
��
�
�� �redrawiconbar(token$)
�4  �seticontext(-2,ibar%,�message_lookup(token$))
��
�:
�!� �putcaretinicon(win%,icon%)
�4ș"Wimp_SetCaretPosition",win%,icon%,257,0,-1,-1
�$� force caret to end of pathname
��
�:
�
�� �iconselected(win%,icon%)
�block%!0=win%
�block%!4=icon%
�!ș"Wimp_GetIconState",,block%
�=(block%!24 � (1<<21)) >>21
�:
�J� �IconState(win%,icon%,bit%,flag%):� switch specified flag bit on/off
�!block%=win%:block%!4=icon%
�block%!12=1<<bit%
�+� flag% � block%!8=1<<bit% � block%!8=0
�!ș"Wimp_SetIconState",,block%
��
�:
�f� �whichfakeicon(x%,y%):� translate fakefiler background co-ordinates to an icon number equivalent
�:� max_len%,index_ptr%,width%,cols%,icon_num%,err%,ptr%
�� paneoffset%
�1� showpane% � paneoffset%=96 � paneoffset%=20
�index_ptr%=!icon_index%
�
�+max_len%=�stringlength($(index_ptr%!4))
�7� length of longest icon text - max width of column
�� max_len%<200 max_len%=200
�/� max_len%>clipwidth% � max_len%=clipwidth%
�ptr%=block%+128
�ptr%!0=fakefiler%
�%ș"Wimp_GetWindowInfo",,ptr% � %1
�x%=x%+ptr%!20-ptr%!4
�%y%=y%+ptr%!24-ptr%!16+paneoffset%
�+� get relative (work area) co-ordinates
�;err%=x% � max_len%:� err%<24 � err%>(max_len%-24) � =-1
�/err%=-y% � 124:� err%<24 � err%>(124) � =-1
�width%=ptr%!12-ptr%!4
�9cols%=(width%/max_len%):� number of columns in window
�� cols%<1 � cols%=1
�� x%>(cols%*max_len%) � =-1
�8� we may have a large blank space at right of window
�
�-x%=(x%/max_len%):� number of icons across
�'y%=(y%/-124):� number of icons down
�E� height is negative - use double negative to get positive answer
�icon_num%=y%*cols%+x%
�$� icon_num%+1>index_ptr%!0 � =-1
�-� Note that icon numbers start from zero!
�=icon_num%
�:
�I� �getfakeleafname(icon%,clip%):� get file name given offset in block
�
� ptr%,a$
�� �
�Q� � � � �:param1$=�(icon%):param2$="":�report(�message_looksub("addr"),2):=""
�ptr%=(!icon_index%)+8
�a$=$(ptr%!(icon%*4))
�"� �a$)="/" � clip%=� � a$=�a$)
�=a$
�:
�F� �whichfakesprite(icon%):� which file sprite do we use for drags?
�� a$,sprite$
�,a$=�getfakeleafname(icon%,�):� file name
�sprite$="file_xxx"
�� �a$)="/" �
�@  � �a$,1)="!" � sprite$="application" � sprite$="directory"
��
�=sprite$
�:
�R� --------window handling-----------------------------------------------------
�� �close(window%)
�block%!0=window%
� ș"Wimp_CloseWindow",,block%
�W� window%=fakefiler% � showpane%=1 � !block%=panepath%:ș"Wimp_CloseWindow",,block%
�� close pane as well
��
�
� �changetitle(win%,text$)
!block%=win%
&ș"Wimp_GetWindowInfo",,block% � 1
$(block%!76)=text$
� change window title
Eș"Wimp_ForceRedraw",-1,block%!4,block%!16,block%!12,block%!16+44
�
:
*� �fileinfo:� sets up file info window
	� a$,x$,m%,n%

;x$=�commonpath$)+�getfakeleafname(menuicon%,�):m%=�(x$)
<� Name and icon were set up earlier when we clicked MENU
� �

� � � � �fferror(�):�
�#in%=0
� �
!� This is getting very silly!
� �
A � � � � �:ș"Hourglass_Off":� �=223 � �notfound:�:� � �,�$:�
ș"Hourglass_Start",50
a$=�#in%:n%=�#in%
<� skip first line (filename may be same as archive name)
�
  a$=�#in%:n%=�#in%
� �a$,m%)=x$

n%=�(a$):
5ș"OS_ConvertFileSize",n%,block%,255 � ,n%:?n%=13
!�seticontext(file%,6,$block%)
1n%=�a$,"-"):�seticontext(file%,1,�a$,n%-2,8))
1n%=�a$,":"):�seticontext(file%,3,�a$,n%-2,5))
ș"Hourglass_Off"
�
 
!� �notfound
"$�seticontext(file%,1,"--/--/--")
#!�seticontext(file%,3,"--:--")
$#�seticontext(file%,6,"Unknown")
%�
&
'� �centrewindow(win%)
(&� yeig%,y%,height%,xeig%,x%,width%
)block%!128=win%
*'ș"Wimp_GetWindowState",,block%+128
++ș "OS_ReadModeVariable",-1,5 � ,,yeig%
,)ș "OS_ReadModeVariable",-1,12 � ,,y%
-+ș "OS_ReadModeVariable",-1,4 � ,,xeig%
.)ș "OS_ReadModeVariable",-1,11 � ,,x%
/y%=1+y% <<yeig%
0!height%=block%!144-block%!136
1x%=1+x% <<xeig%
2 width%=block%!140-block%!132
3 y%=(y%-height%)/2:� top edge
4 x%=(x%-width%)/2:� left edge
5'block%!136=y%:block%!144=y%+height%
6&block%!132=x%:block%!140=x%+width%
7block%!156=-1
8#ș"Wimp_OpenWindow",,block%+128
9�
::
;� �createnew(popup%)
<� text$
=!� Offer to create new zipfile
>� popup% � �popupsavewindow
?action$="create"
@-�changetitle(save%,�message_lookup("S2"))
A"text$=�message_lookup("Sname")
B� unixflag% text$+="/zip"
C�seticontext(save%,1,text$)
D�putcaretinicon(save%,1)
E�
F:
G� �openconfig
H�setupconfig
I�centrewindow(configure%)
J"�putcaretinicon(configure%,-1)
K�
L:
M$� �resize(width%,height%,textw%)
N%� max%,ptr%,no_of_files%,pathlen%
Optr%=!icon_index%
Pno_of_files%=!ptr%
QA� no_of_files%*textw%<�screenwidth � max%=no_of_files%*textw%
RD� work area needed to display all icons in one row (if possible)
Smax% = no_of_files%*textw%
T*pathlen% = �stringlength(zipfile$)+140
U#� pathlen%>max% � max%=pathlen%
V=� max%<width% � max%=width%:� cope with empty directories
W+� max%>�screenwidth � max%=�screenwidth
X9!block%=0:block%!4=-height%:block%!8=max%:block%!12=0
Y(ș"Wimp_SetExtent",fakefiler%,block%
Z4!block%=0:block%!4=-76:block%!8=max%:block%!12=0
['ș"Wimp_SetExtent",panepath%,block%
\E� set work areas to widest possible for number of icons in window
]
^!block%=fakefiler%
_#ș"Wimp_GetWindowState",,block%
`
ablock%!8=block%!16-height%
bblock%!12=block%!4+width%
cblock%!20=0:block%!24=0
d4� set up to reopen window at new size if desired
e�
f:
g� �trapadjustclose(window%)
h'ș"Wimp_GetPointerInfo",,block%+128
i� (block%!136 = 1) �
jG  � ADJUST-click on fakefiler% (the only window with a close icon!)
k!  � showpane%=1 � levels%=0 �
l-    �"Filer_OpenDir "+�pathname(zipfile$)
m&    � � �(-1) � �close(fakefiler%)
n(  � keep window open on SHIFT-ADJUST
o  �
p!    levels%=�uplevel(levels%)
q  �
r�
s  �close(!block%)
t�
u�
v:
w� �popupsavewindow
x� x%,y%,width%,height%
y#ș"Wimp_GetPointerInfo",,block%
zx%=!block%
{y%=block%!4
|!block%=save%
}#ș"Wimp_GetWindowState",,block%
~width%=block%!12-block%!4
height%=block%!16-block%!8
�2block%!4=x%-(width%/2):block%!12=x%+(width%/2)
�6� block%!8=y%-(height%/2):block%!16=y%+(height%/2)
�$block%!8=88:block%!16=88+height%
�ș"Wimp_OpenWindow",,block%
��
�:
�
�� �openwindow(ptr%)
�� stack%,width%,n%,leaf$
�?� index_ptr%,maxlenptr%,textw%,across%,height%,no_of_files%
�/� stringlen%,xeig%,paneoffset%,openrequest%
�
�5� !ptr%<>fakefiler% � ș"Wimp_OpenWindow",,ptr%:�
�-� no panes or reformatting to worry about
�
�Mopenrequest%=temp%+256:� above scratch space (have 64b below other PROCs)
�� n%=0 � 28 � 4
�  openrequest%!n% = ptr%!n%
�� n%
�1� block% contents may now be freely corrupted
�
�1� showpane% � paneoffset%=96 � paneoffset%=20
�index_ptr%=!icon_index%
�no_of_files%=!index_ptr%
�� *Report no_of_files%
�+width%=(openrequest%!12-openrequest%!4)
�
�� no_of_files%>0 �
�  maxlenptr%=index_ptr%!4
�'  textw%=�stringlength($maxlenptr%)
�  � textw%<200 � textw%=200
�.  � textw%>clipwidth% � textw%=clipwidth%:
�  across%=width%/textw%
�  � across%<1 � across%=1
�
�  � across%<>old_across% �
�G    height%=126*(( (no_of_files%)+across%-1) � across%)+paneoffset%
�2    �drawwindow(across%,no_of_files%,textw%,�)
�4    �forceredraw(fakefiler%):old_across%=across%
�H    � try to avoid flicker - only redraw when no. of columns changes
�  �
��
�
�� showpane% �
�  � openrequest%!28 > 0 �
�    !block%=!openrequest%
�'    ș"Wimp_GetWindowState",,block%
�V    � value at openrequest%!28 is not guaranteed to be handle of window in front -
�5    � may legitimately be handle of window itself
�    stack%=block%!28
�  �
�    stack%=openrequest%!28
�  �
�)  � preserve stack position requested
�.  � *Report ~stack% ~panepath% ~fakefiler%
�  openrequest%!28=panepath%
�'  ș"Wimp_OpenWindow",,openrequest%
�F  � open window *under* pane (to avoid flicker) so that later call
�@  � to Wimp_GetWindowState will find it in correct size/posn
�
�  !openrequest%=panepath%
�  openrequest%!28=stack%
�'  ș"Wimp_OpenWindow",,openrequest%
�P  � open pane using same width and position (note that maximum height of the
�=  � pane will undoubtedly be less than requested height!)
�
�  !openrequest%=fakefiler%
�S  ș"Wimp_GetWindowState",,openrequest%:� get back correct size for main window
�  openrequest%!28=panepath%
�'  ș"Wimp_OpenWindow",,openrequest%
�?  � reopen it under pane (now in correct position in stack)
�
�>  !block%=panepath%:block%!4=paneicon%:� path display icon
�#  ș"Wimp_GetIconState",,block%
�  � ptr%!16<>width%-8 �
�)    � if size of icon needs to change
�    � notfont% �
�%      ș"Wimp_DeleteIcon",,block%
�
�^      paneicon%=�templ_icon(panepath%,64,-64,width%-8,-12,&17000135,"",!pathicon%,R2%,255)
�5      � recreate icon to (almost) width of window
�K      � in other words resize it (no Wimp_ResizeIcon under RISC OS 3�1)
�	    �
�F      ș "Wimp_ResizeIcon",panepath%,paneicon%,64,-64,width%-8,-12
�	    �
�k    �IconState(panepath%,paneicon%,9,�stringlength("/"+�commonpath$))>(width%-8-64-24)):� width of icon
�,    � Note 24-OS unit 'border allowance'
�C    � left-align short text, right-align (flag bit 8) long text
�    �forceredraw(panepath%)
�    � force redraw of icon
�  �
��
� � if showpane%=0
�'  ș"Wimp_OpenWindow",,openrequest%
��
��
�:
�R� -----redraw handling--------------------------------------------------------
�� �redrawrequest
�8� across%,name$,n%,width%,ptr%,a$,no_of_files%,flag%
�"� index_ptr%,maxlenptr%,textw%
�7� !block%<>fakefiler% � � 255,"Wrong window handle"
�index_ptr%=!icon_index%
�no_of_files%=!index_ptr%
�� no_of_files%>0 �
�  maxlenptr%=index_ptr%!4
�'  textw%=�stringlength($maxlenptr%)
��
�
�� textw%<200 � textw%=200
�=� if no files found then local variable textw% is still 0
�+� textw%>clipwidth% � textw%=clipwidth%
�
�)ș"Wimp_RedrawWindow",,block% � flag%
�across%=block%!12-block%!4
�ȕ flag%
�@  �redraw(across%/textw%,no_of_files%-1,textw%,index_ptr%+8)
�  !block%=fakefiler%
�+  ș"Wimp_GetRectangle",,block% � flag%
��
�
��
�
�$� each icon is 116 OS units high
�/� lines of icons are at 126 OS unit spacing
�'� each icon is textw% OS units wide
�*� �redraw(cols%,lasticon%,width%,ptr%)
�&� icon_num%,xmin%,ymin%,stringptr%
@� d_xptr%,d_yptr%,worktop%,d_left%,d_top%,d_bottom%,d_right%
� paneoffset%
1� showpane% � paneoffset%=96 � paneoffset%=20
� cols%<1 � cols%=1

'd_left%=(block%!28-block%!4)/width%
(d_right%=(block%!36-block%!4)/width%
)� d_right%>cols%-1 � d_right%=cols%-1
6� we may have quite large blank areas on the right
	(� Note there are no x scroll offsets

,worktop%=block%!16-block%!24-paneoffset%
.� height of pane is 76 plus 20 extra space
$d_top%= (worktop%-block%!40)/126

&d_bottom%=(worktop%-block%!32)/126
2� *Report \r d_top% d_bottom% d_left% d_right%
3� d_left%>d_right% � �:� redrawing a blank area
stringptr%=!icon_widths%

 � d_yptr%=d_top% � d_bottom%
)  ymin%=-paneoffset% -126*(d_yptr%+1)
%  icon_num%=d_yptr%*cols%+d_left%
"  � d_xptr%=d_left% � d_right%
      xmin%=d_xptr%*width%
"      � icon_num%<=lasticon% �
V        �ploticon(xmin%,ymin%+4,width%,!(ptr%+icon_num%*4),stringptr%+icon_num%*4)
        icon_num%+=1
      �
.        d_xptr%=d_right%:d_yptr%=d_bottom%
      �
  �
�
�
 :
!1� �ploticon(x%,y%,width%,textptr%,stringlen%)
"� spriteptr%
#leaf$=$textptr%
$spriteptr%=datasprite%
%7� �leaf$)="/" � spriteptr%=dirsprite%:leaf$=�leaf$)
&E� �(leaf$)=�("!") � spriteptr%=dirsprite% � spriteptr%=appsprite%
'S� width%=clipwidth% � !stringlen%>0 � leaf$=�leaf$,!stringlen%)+�dots(notfont%)
($(block%+128)=leaf$
)block%!0=x%
*block%!4=y%
+block%!8=x%+width%
,block%!12=y%+116
-block%!16=&1700A10B
. � all% � block%!16=&1720A10B
/block%!20=block%+128
0block%!24=spriteptr%
1block%!28=�(leaf$)
2ș"Wimp_PlotIcon",,block%
3�
4:
5� �setclipwidths
6-� fixed%,ptr%,count%,names%,old$,clip_to%
7,ptr%=!icon_widths%:� address to write to
80names%=!icon_index%:�  pointers to leafnames
9Gcount%=!(names%):� no of files is stored at start of pointers block
:clip_to%=clipwidth%-16
;� notfont% �
<, ș "OS_ReadModeVariable",-1,4 � ,,xeig%
=- fixed%=(clip_to%-(8<<xeig%)) /(8<<xeig%)
>5 � 8<<xeig% is width of one system font character
?�
@� n%=1 � count%
A leaf$=$(names%!(4+4*n%))
B) � icon numbers go from 0 to count%-1
C/ � but block of pointers starts at names%!8
D. � so we balance out by adding offset of 4
E !ptr%=0
F � notfont%=� �
G4  � �stringlength(leaf$)>clip_to% � !ptr%=fixed%
H �
I   old$=leaf$
J'   ȕ �stringlength(leaf$)>clip_to%
K'     leaf$=�leaf$,�(leaf$)-4)+"..."
L   �
M'   � old$<>leaf$ � !ptr%=�(leaf$)-2
N0   � should be -3 but looks better this way!
O�
P ptr%+=4
Q� n%
R0� set up a block indicating length of string
S
T�
U:
V� �forceredraw(window%)
W?� call this when you need to change something in fakefiler%
X!block%=window%
Y#ș"Wimp_GetWindowState",,block%
Z0� window%=panepath% � block%!4=block%!12-200
[� only redraw end of icon
\Aș"Wimp_ForceRedraw",-1,block%!4,block%!8,block%!12,block%!16
]2� now a redraw request will come via Wimp_Poll
^�
_:
`Q� ---functions called when objects are dragged in/out of Infozip-------------
a:
b� �dragged_out(path$)
c� a$,i%
d� �
eA� � � � �:�report(�$+" at line "+� �,1):�redrawiconbar("N"):�
f*� wsavew%=fakefiler% � action$="unzip"
gL� in case you have opened the 'create' menu since unzipping this zipfile
hwait$=action$
i    Ȏ action$ �
j      � "zip":
k        � child%=0 �
lJ          � block%!36=-1 � �"Remove <Wimp$Scrap>":path$="<Wimp$Scrap>"
m          zipfile$=path$
n)          �Dir(�pathname(notzipped$))
o7          child%=�childtask(�commandline("zip",""))
p
        �
q          �busy
r
        �
s0        �close(save%):ș"Wimp_CreateMenu",-1
t,      � "unzip":� path$="<Wimp$Scrap>" �
uG                      param1$=�message_lookup("savXapp"):param2$=""
v
w=                      �report(�message_looksub("savX"),1)
x                   �
y:                     � wsavew%=fakefiler% � child%=0 �
z,                        notzipped$=path$
{O                        � all% � a$="all" � a$=�whichfakesprite(wsavedrag%)
|G                        child%=�childtask(�commandline("unzip",a$))
}                     �
~                   �
=      � "create":�"Create "+path$+" 16":� size is in HEX!
�"                    i%=� path$
�2                    �#i%,"PK"+�5+�6+�18,�(0));
�                    �#i%
�;                    �"SetType "+path$+" "+�saveicon$,3)
�B                    � close new archive dialogue and menu tree
�=                    ș "Wimp_CreateMenu",-1:�close(save%)
�7                    i%=�dragged_in(bar%,&DDC,path$)
�	    �
��
�
�� �preserve
�� x%
�� x%=0 � block%!0 � 4
�  preserve%!x%=block%!x%
��
��
�
�� �gotDataLoad(name$)
�� dataload%,n%
�Fdataload%=temp%+256+64:� above scratch space and openwindow buffer
�� n%=0 � 40 � 4
�  dataload%!n%=block%!n%
��
�%� block%!16=5 n%=0 � n%=block%!20
�+� �dragged_in(n%,block%!40,name$)=0 � �
�� n%=0 � 40 � 4
�  block%!n%=dataload%!n%
��
�block%!16=4:� DataLoadAck
�(block%!12=dataload%!8:� sender's ref
�$(block%+44)=name$
�.ș"Wimp_SendMessage",17,block%,dataload%!4
��
�
�'� �dragged_in(window%,ftype%,path$)
�� RISCOS$,slash%,load%,a$
�� �
�a� � � � �:param1$=path$:param2$="":�report(�message_looksub("loaX"),1):�redrawiconbar("N"):=0
�'� child%<>0 � window%<>0 � �busy:=0
�F� If window%=0 then this file was double-clicked on and may not be
�C� intended for Infozip - so don't throw away current setup yet!
�Ȏ window%�
�K  � 0:� �checktype(path$)=&DDC � �clearsetup:�unzipit:load%=1:� load%=0
�
  � bar%:
�    �clearsetup
�    Ȏ �checktype(path$)�
�;      �&DDC:� �(-2) � �selfextracting(path$) � �unzipit
�              load%=1
�7      �-1:�alertbox(�message_lookup("spk")):load%=0
�:      �&FCA:�alertbox(�message_lookup("sqsh")):load%=0
�      
�K        RISCOS$=�leafname(path$):� �RISCOS$,1)="!"� RISCOS$=�RISCOS$,2)
�        notzipped$=path$
�         slash%=�RISCOS$,"/")
�0        � slash%� RISCOS$=�RISCOS$,slash%-1)
�6        � unixflag% RISCOS$=�lower(RISCOS$)+"/zip"
�S        �seticontext(save%,1,RISCOS$):�changetitle(save%,�message_lookup("S1"))
�        �close(fakefiler%)
�        �popupsavewindow
�        last_opened%=save%
�$        �putcaretinicon(save%,1)
�        action$="zip"
�        load%=1
�	    �
�  � fakefiler%, panepath%
�    load%=1
�B    slash%=�checktype(path$):� slash% is just a handy variable
�    Ȏ slash% �
�S      � -1,&FCA,&DDC:�report(�message_lookup("zipYN"),%11):slash%=(errclick%=1)
�H      � 0:slash%=&FFD:� allow archiving of untyped (load/exec) files
�	    �
�    � slash% �
�      action$="zip"
�.      notzipped$=path$:delete_later$=path$
�      � commonpath$<>"*" �
�?  � copy object into !Scrap and then compress it from there
�L  � so that we can fake the right path to create it in the current level
�  � of the zipfile
�P        a$=�_CDirs(�commonpath$,�(commonpath$)-2))+"."+�leafname(notzipped$)
�-        �"Copy "+notzipped$+a$+" ~C ~V R"
�!        �Dir("InfoScrap:add")
�        notzipped$=a$
�'      � �Dir(�pathname(notzipped$))
�      �
�K      � child%=0 � wait$="ad":child%=�childtask(�commandline("zip",""))
�@      action$="unzip":� restore 'inside file' default action
�    � load%=0
�	    �
��
�
=load%
�:
�� �clearsetup
�
� ptr%
� commonpath$="*":levels%=0
�# � in% ș"XOS_Find",0,in%:in%=0
�4� PROCextend_named_sliding_block(icon_names%,16)
�/�extend_named_sliding_block(icon_index%,16)
�ptr%=!icon_index%
�!ptr%=0:ptr%!4=0
��
�
�� �checktype(path$)
�� a$,A%,ftype%
�)ș"OS_File",23,path$ � A%,,,,,,ftype%
�� (A% � 1)=0 � =ftype%
�8a$=�"00"+�~(ftype%),3):� pad out with leading zeroes
�5� ��gstrans("<Infozip$DontCompress>"),a$) � =&FCA
�,� Call all compressed filetypes "Squash"
�A%=� path$
�� �#A%>22 � �#A%=�#A%-22
�a$=�#A%
�'� �a$,2)="PK" � a$="zip" � a$="not"
��#A%
�Ȏ ftype% �
�7  � &DDC,&A91:� a$<>"zip" � ftype%=-1 � ftype%=&DDC
�/  :� a$="zip" � window%=bar% � ftype%=&DDC
�E  � we don't want double-clicked non-archive files to be checked,
�)  � only those dragged to the iconbar
��
�=ftype%
�:
�� �unzipit
�ș"Hourglass_Start",50
�ș"Hourglass_LEDs",%01,%11
�(� child% � ș"Hourglass_Off":�busy:�
�zipfile$=path$
�action$="unzip"
�
Pwait$="list":child%=�childtask("unzip -l "+zipfile$+"  { > InfoScrap:CAT }")
� child%=0� �taskended
ș"Hourglass_Off"
�
:
� �_CDirs(path$)
� n%,m%
path$=�unDOSify(path$)
�"CDir InfoScrap:add"
	ȕ m%<>1

  n%=�path$,".",m%)
1  � n% � � "CDir InfoScrap:add."+�path$,n%-1)

  m%=n%+1

�
!path$=" InfoScrap:add."+path$
�"CDir"+path$

=path$
:
� �newdir(text$)

� a$,ptr%
� child% � �busy:�
6� text$="" � �report(�message_lookup("nodir"),1):�
<text$=�sub(text$," ","_"):� don't do something silly....
G� commonpath$<>"*" � text$=�commonpath$,�(commonpath$)-2)+"/"+text$
(� fake up DOS-style path for FNCDirs
a$=�_CDirs(text$)
F�updatemenutext(newmenu%,1,""):� clear writable icon for next time
�Dir("InfoScrap:add")
notzipped$=a$
=� now we just add it and then !Scrap gets wiped as normal
8wait$="ad":child%=�childtask(�commandline("zip",""))
�
 :
!� �selfextracting(file$)
"� A%,a$,b$,out$
#� �
$-� � � � �:�report(�$+" at line "+� �,1):�
%b$=�message_lookup("SEA")
&A%=� file$
'a$=�#A%
(�#A%
))� �a$,2)="PK" � a$="conv"�  a$="rest"
*>param1$=file$:param2$=b$:�report(�message_looksub(a$),%11)
+� errclick%=2 � �
,N�close(fakefiler%):last_opened%=0:� in case we also have this archive open
-out$=file$
.8� �lower(�file$,4))="/zip" � out$=�file$,�(file$)-4)
/E� remove /zip suffix if we are converting file to self-extracting
0Ȏ a$ �
1  � "conv":wait$="temp"
2d             child%=�childtask("sfx "+�pathname(file$)+" "+�leafname(file$)+" "+�pathname(out$))
30  �"rest":child%=�childtask("zip -J "+file$)
4�
5�
6
7� �savetext(window%,icon%)
8C� used to find correct name to give file dragged out of Infozip
9� a$
:Ȏ window% �
;4  � fakefiler%:� a$=FNgeticontext(window%,icon%)
<2                  a$=�getfakeleafname(icon%,�)
=&  � save%:a$=�geticontext(save%,1)
>�
?=a$
@
AR� ---------Interactive help---------------------------------------------------
B
� �dohelp
C� hlp$,keep%
Dkeep%=block%!8
EȎ block%!32 �
Ff   � bar%,fakefiler%,info%,file%,configure%,panepath%,save%: hlp$=�windowhelp(block%!32,block%!36)
G    hlp$=�menuhelp
H�
Iblock%!12=keep%
Jblock%!16=&503
K!block%=(25+� hlp$)��3
L$(block%+20)=hlp$+�0
M.� hlp$<>"" ș "Wimp_SendMessage",17,block%
N�
O
P � �windowhelp(window%,icon%)
Q� a$
Rparam2$=""
SȎ window% �
T3  � bar%:param1$=p$:a$=�message_looksub("barH")
UI  � fakefiler%:param1$=�leafname(zipfile$):a$=�message_looksub("ffH")
V(  � save%:a$=�message_lookup("savH")
WA  � info%:param1$=ver$:param2$=p$:a$=�message_looksub("infH")
X(  � file%:a$=�message_lookup("filH")
YX             � ��geticontext(file%,3),"--") � param1$=p$:a$+=�message_looksub("noH")
ZA  � panepath%:� icon%>-1 � a$=�message_lookup("paH"+�(icon%))
[-  � configure%:a$=�message_lookup("conH")
\    Ȏ icon% �
](      � -1,12,13,1,0:a$=�a$,�(a$)-3)
^X      � 14,15,16,17,18,19:a$=�message_lookup("selH")+�message_lookup("icH"+�(icon%))
_.      :a$=�message_lookup("icH"+�(icon%))
`	    �
a�
b=a$
c:
d� �menuhelp
e� a$,b$,menustate%
fGmenustate%=temp%+256+64:� above scratch space and openwindow buffer
g&ș"Wimp_GetMenuState",0,menustate%
h� !menustate%=-1 �=""
i&� Not sure what's causing this....
jb$=�(!menustate%)
kȎ lastmenuopened% �
l,  � barmenu%:a$=�message_lookup("bH"+b$)
mh                � menustate%!4>-1 � a$=�message_lookup("selH")+�message_lookup("oH"+�(menustate%!4))
n2  � fakefilermenu%:a$=�message_lookup("fH"+b$)
o  Ȏ !menustate% �
pF    � 0:� menustate%!4>-1 a$=�message_lookup("di"+�(menustate%!4))
q    � 1:Ȏ menustate%!4 �
rs             � -1:� (menuicon%>-1 � all%=0) � param1$=�getfakeleafname(menuicon%,�):a$=�message_looksub("fH1a")
s0             � 0: a$=�message_lookup("fiH0")
tW             � 1: param1$=�getfakeleafname(menuicon%,�):a$=�message_looksub("fiH1")
u           �
v6    � 2,3:� all% � a$=�message_lookup("fH"+b$+"a")
w`    � 4:� menustate%!4>-1 � a$=�message_lookup("selH")+�message_lookup("oH"+�(menustate%!4))
x;    � 5: � menustate%!4>-1 � a$=�message_lookup("ndH0")
y6    � 6,7:� levels%=0 � a$=�message_lookup("fH6a")
z  �
{E  � optsmenu%:a$=�message_lookup("selH")+�message_lookup("oH"+b$)
|�
}=a$
~:
R� -------------Wimp_Poll functions--------------------------------------------
�:
�� �poll
�� reason%,n%
�finished%=�
� �
�6   ș"Wimp_Poll",pollmask%,block% � reason%,block%
�   � *ReportPoll (reason%)
�   Ȏ reason% �
�~     � 0 : ș"OS_ReadMonotonicTime" � n%:� n%>timeup% � �close(alertbox%):pollmask% = pollmask% � %1:� mask out null-polls
�     � 1 : �redrawrequest
�"     � 2 : �openwindow(block%)
�(     � 3 : �trapadjustclose(!block%)
�.     � 4 : ș "Hourglass_Off":local_hon%=�
�2     � 5 : ș "Hourglass_Start",1:local_hon%=�
�     � 6 : �click
�     � 7 : �drag_end
�,     � 8 : �keypress(block%!0,block%!24)
�     � 9 : �menuselection
�     � 17,18 : �message
�     � 19: �bounce
�   �
� � finished%
�	�quit
��
�:
�� �keypress(win%,key%)
�� a$
�� key%=&181 �
�.  �("Filer_Run <Infozip$Dir>.!Help") :� F1
��
�  Ȏ win% �
�    � configure%:
�      Ȏ key% �
�        � 13:� Enter
�0          �IconState(configure%,ic_OK%,21,1)
�          �readconfig
�           �close(configure%)
�0          �IconState(configure%,ic_OK%,21,0)
�          key%=0
�        � &1B:� Escape
�4          �IconState(configure%,ic_cancel%,21,1)
�          �setupconfig
�           �close(configure%)
�4          �IconState(configure%,ic_cancel%,21,0)
�          key%=0
�      �
�    � save%:
�      Ȏ key% �
�        � 13:� Enter
�/          a$=�geticontext(save%,save_path%)
��          � �a$,".")=0 � �a$,":")=0 � �report(�message_lookup("tosave"),1) � block%!36=0:wsavew%=save%:preserve%!0=0:�dragged_out(a$)
�          key%=0
�        � &1B:� Escape
�2          �close(save%):ș"Wimp_CreateMenu",-1
�          key%=0
�      �
�  �
��
�%� key% � ș"Wimp_ProcessKey",key%
��
�:
�� �click
�2� x%,y%,icon%,window%,a$,buttons%,arrowsvalue%
�7buttons%=block%!8:window%=block%!12:icon%=block%!16
�Ȏ buttons% �
�  � 2:� menu
�          �MENUclick(window%)
�'  � 256,1024: � click on fakefiler%
�G          � �whichfakeicon(block%!0,block%!4)=-1 � �toggleselect(�)
�  � 64:� Select-drag
�    � child%<>0 �
�      �busy
�	    �
�      wsavew%=window%
�      Ȏ window% �
�9        � save%:�toggleselect(�):� sets all% to FALSE
�G                   wsavedrag%=icon%:�dragsprite(wsavedrag%,wsavew%)
�@        � fakefiler%:icon%=�whichfakeicon(block%!0,block%!4)
�V          � (icon%>-1 � all%=�) � wsavedrag%=icon%:�dragsprite(wsavedrag%,wsavew%)
�,          � normal save of selected icon
�I          savedlevels%=levels%:� in case the user changes level while
�+          � taskwindow is still running
�          � all% �
�            wsavedrag%=0
�I            � this is the only icon of whose existence we can be sure
�8            � so pretend that we're saving this file
�L            � so that FNuser_savedata gets called, then InfoZIP routines
�-            � will save the _real_ files!
�G            � notfont% � �rotatingdashbox � �dragsprite(-1,wsavew%)
�          �
�      �
�	    �
�  � 1,4:
�       Ȏ window% �
�         � save%:
�!           � icon%=save_ok% �
�2             a$=�geticontext(save%,save_path%)
�,             � �a$,".")=0 � �a$,":")=0 �
�7               �report(�message_lookup("tosave"),1)
�             �
�               block%!36=0
�                wsavew%=save%
�                preserve%!0=0
�#               �dragged_out(a$)
�             �
�           �
�J           � icon%=save_cancel% � �close(save%):ș"Wimp_CreateMenu",-1
�       � bar%:
�           Ȏ buttons% �
�             � 4:� SELECT
�              � �(-1) �
�                  �openconfig
�               �
�0                 � reopen last window opened
�{                 � last_opened% � !block%=last_opened%:ș"Wimp_GetWindowState",,block%:block%!28=-1:�openwindow(block%)
�               �
�             � 1:� ADJUST
�"                 �createnew(�)
�           �
�.       � fakefiler%:� double-click on icon
�7            icon%=�whichfakeicon(block%!0,block%!4)
�*            a$=�whichfakesprite(icon%)
�            Ȏ a$ �
�              � "file_xxx":
�A                 � �(-1) � dontbroadcast%=�:� Shift held down
��                 � child%=0 � notzipped$="<Wimp$ScrapDir>."+�unDOSify(�getfakeleafname(icon%,�)):wait$="unzip":child%=�childtask(�commandline("unzip",a$))� �busy
�m                  savedlevels%=levels%:� in case the user changes level while taskwindow is still running
�
%              :�nextlevel(icon%)
            �
0       � panepath%:levels%=�uplevel(levels%)
       � configure%:
         � gain input focus
+         �putcaretinicon(configure%,-1)
         Ȏ icon% �
(           � ic_bumpup%,ic_bumpdown%
n           arrowsvalue%=1+�(�geticontext(configure%,ic_timedisp%))+(icon%=ic_bumpdown%)-(icon%=ic_bumpup%)
	=           � If bumpup%, subtract -1; if bumpdown% add -1

R           �seticontext(configure%,ic_timedisp%,�(�looped(arrowsvalue%,10)-1))
Q         � FNlooped goes from 1 to max, we want 0 to max, so first we added 1
Y         � now set max limit one greater than required, then subtract one from result

           � ic_OK%
             �readconfig
;             � (buttons% � %001)=0 � �close(configure%)
           � ic_save%
             �readconfig
             �saveoptions
;             � (buttons% � %001)=0 � �close(configure%)
           � ic_cancel%
             �setupconfig
;             � (buttons% � %001)=0 � �close(configure%)

         �
       � alertbox%:
         �close(alertbox%)
=         pollmask% = pollmask% � %1:� mask out null-polls
       �
�
�
:
 � �rotatingdashbox
!8!block%=fakefiler%:ș"Wimp_GetWindowOutline",,block%
"Xblock%!20=block%!16-50:block%!16=block%!12-60:block%!12=block%!8+4:block%!8=block%!4
# block%!4=5:� dashed drag box
$Cblock%!24=0:block%!28=0:block%!32=&7FFFFFFF:block%!36=&7FFFFFFF
%ș"Wimp_DragBox",,block%
&�
':
(!� �dragsprite(icon%,whandle%)
)� x%,y%,name$
*!block%=whandle%
+� icon%>=0 �
, Ȏ whandle% �
-2   � fakefiler%: name$=�whichfakesprite(icon%)
.   � save%: name$=saveicon$
/ �
0�
1G� we use icon%=-1 to force 'package' sprite to appear below pointer
2F  name$="package":� RISC-OS 3�5 and greater have this in Wimp pool
3�
4#ș"Wimp_GetPointerInfo",,block%
5block%!8=block%!0+12
6Oblock%!12=block%!4+12:� random value for 'drag box' which seems to work :-(
7,ș"DragASprite_Start",&C5,1,name$,block%
8�
9:
:� �drag_end
;'� win%,icon%,x%,y%,n%,a$, datasave%
<Fdatasave%=temp%+256+64:� above scratch space and openwindow buffer
=ș"DragASprite_Stop"
>#ș"Wimp_GetPointerInfo",,block%
?win%=block%!12
@7� win%=fakefiler% � win%=save% � win%=panepath% � �
Aicon%=block%!16
Bx%=!block%
Cy%=block%!4
DI� wsavew%=fakefiler% � a$=�whichfakesprite(wsavedrag%) � a$=saveicon$
EȎ �a$,5) �
F  � "file_":
G    � �a$,3)="xxx" �
H7      datasave%!40 = &ffd :� pretend type is 'Data'
I	    �
J<      ș"OS_ReadUnsigned",10,"&"+�a$,3) � ,,datasave%!40
K	    �
L#  � "direc":datasave%!40 = 1000
M#  � "appli":datasave%!40 = 2000
N�
Odatasave%!12=0
Pdatasave%!16=1:� DataSave
QBa$=�savetext(wsavew%,wsavedrag%):� �a$,".") � a$=�unDOSify(a$)
R$(datasave%+44)=a$+�0
SA!datasave%=(44+�(a$)+1 +3) � � 3:� word-align length of block
Tdatasave%!20=win%
Udatasave%!24=icon%
Vdatasave%!28=x%
Wdatasave%!32=y%
Xdatasave%!36=1024
Y0ș"Wimp_SendMessage",18,datasave%,win%,icon%
Z�
[:
\� �message
]Ȏ block%!16 �
^� 0      : finished%=�
_H� 1      : param1$=p$:param2$="":�report(�message_looksub("savX"),1)
`4� 2      : �preserve:�dragged_out(�s(block%+44))
a*� 3,5    : �gotDataLoad(�s(block%+44))
b.� 10     : �savedesktopbootfile(block%!20)
c� &502   : �dohelp
d:� &400C0 : �menuwarning(block%!20,block%!24,block%!28)
e)� &400C1,&400CF : � mode/font changed
f  �recalciconbar
g  block%!0=fakefiler%
h$  ș"Wimp_GetWindowInfo",,block%
i@  � (block%!32)�2^16 � �fakefilerwindow(�,�):� resize window
j>  � only redraw if window is currently supposed to be open
k-� &400C3 : � child%=block%!4 � �taskended
l<� if child task has finished then activate PROCtaskended
m�
n�
o:
p
� �bounce
qȎ block%!16 �
rJ  � 3 : �"Remove "+�s(preserve%+44):�report(�message_lookup("boun"),1)
s�
t�
u!� �savedesktopbootfile(file%)
v
� string$
w2 string$="Run "+�ReadSysVar("Infozip$Dir")+�10
x- ș "XOS_GBPB",2,file%,string$,�(string$)
y�
z:
{R� ----functions to launch an external task and then clean up after it---------
|:
}� �childtask(cmd$)
~
� handle%
N� this routine should be called just before the end of a procedure so that
�I� if it does not return 0 (i.e. task is not yet complete) any actions
�K� dependent on the result of the task can be invoked from PROCtaskended
�J� which will be called by PROCmessage as soon as the task does finish.
�I� If it does return 0 you can call PROCtaskended explicitly yourself!
�%ș"Wimp_StartTask",cmd$ � handle%
�� handle% �
�  �redrawiconbar("Y"):
�V  pollmask% = pollmask% � (� %110000):� don't mask out pointer enter/leave anymore
��
�=handle%
�:
�� �taskended
�� n%
�� �
�B� � � � �:�report(�$+" at line "+�(�),1):�redrawiconbar("N"):�
�Bpollmask% = pollmask% � %110000:� mask out pointer enter/leave
�$� local_hon% � ș"Hourglass_Off"
�child%=0
�Ȏ wait$ �
�9  � "list":in%=�"InfoScrap:CAT":�fakefilerwindow(�,�)
�  � "zip":
�     � preserve%!0 �
�D     � we zero this word to signal that we saved direct to Filer
�N     � (filename typed into savebox) and do not need WIMP message dialogue
�       � n%=0 � preserve%!0
�#         block%!n%=preserve%!n%
�       �
�        block%!12=preserve%!8
�E       block%!16=3:� DataLoad - please load the zipfile I created
�%       $(block%+44)=zipfile$+�(0)
�L       block%!0=(44+�(zipfile$)+1 +3) � � 3:� word-align length of block
�5       ș"Wimp_SendMessage",18,block%,preserve%!4
�D       � preserve%!36<>-1 � dum%=�dragged_in(bar%,&DDC,zipfile$)
�M  � fool it into updating catalogue (pretend new file dragged to iconbar)
�>  � unless this was a scrap file saved into an application
�
     �
�O     � openflag% � preserve%!36<>-1 � �"Filer_OpenDir "+�pathname(zipfile$)
�"  �"ad","delete":� in% � �#in%
�(              ș"Hourglass_Start",50
�,              ș"Hourglass_LEDs",%01,%11
�
�L              n%=�childtask("unzip -l "+zipfile$+" { > InfoScrap:CAT }")
�=               in%=�"InfoScrap:CAT":�fakefilerwindow(�,�)
�$               ș"Hourglass_Off"
�[               � �ifthere("InfoScrap:add") � �"Wipe InfoScrap:add R ~V ~C F":� clean up
�'               � �(delete_later$) �
�g                � �ifthere(delete_later$) � �"Wipe "+delete_later$+" R ~V ~C F ~N":delete_later$=""
�               �
�A � Unless we were copying into root of zipfile, odds are that
�J � the temporary file inside !Scrap was deleted, not the real original
�
�4  � "unzip":�close(save%):ș"Wimp_CreateMenu",-1
�<               n%=�:� savedlevels%>0 � n%=�movefromscrap
�G               � we dumped it in !Scrap to hide directory structure
�=               � �notzipped$,15)="<Wimp$ScrapDir>" � n% �
�+               � file double-clicked on
�>                �"Remove <Wimp$Scrap>":� delete if present
�9                �"Rename "+notzipped$+" <Wimp$Scrap>"
�a                � dontbroadcast% � �"Filer_Run <Wimp$Scrap>" � �broadcastfile("<Wimp$Scrap>")
�]� the point of all this is to avoid having more than one temporary file hanging around...
�"              dontbroadcast%=�
�              �
�
��
�� wait$="" � wait$="zip"
�
�>� wait$="delete" � wait$="deleting" � wait$+=�wait$)+"ing"
�^� wait$<>"listting" � wait$<>"tempping" � ��options(0),"q") � �alertbox("Finished "+wait$)
�wait$="":opts$=""
�6� �(store$) �"Dir "+store$:store$="":� restore CSD
�.�redrawiconbar("N"):� restore iconbar text
��
�:
�� �movefromscrap
�� a$,b$,n%
�� �
�i� � � � �:param1$=�pathname(notzipped$):param2$=�$+" at "+�(�):�report(�message_looksub("wriX"),1):=�
�n%=�
�+� savedlevels%<1 � savedlevels%=levels%
�Ea$="InfoScrap:temp"+�savedlevels%,".*")+"."+�leafname(notzipped$)
�7� name of file/dir with correct number of wildcards
� b$=notzipped$
�)� name of file/dir in its destination
�"� all% � a$=�pathname(a$)+".*"
�)� options%(2) � a$="InfoScrap:temp.*"
�>� level% is irrelevant if 'Ignore directory structure' set
�&� �a$)="*" � b$=�pathname(b$)+".*"
�0� wildcards on *both* sides needed for *Copy
�� �ifthere(a$) �
�  b$+=" R D F ~V ~C ~N"
�!  � options%(5) � �b$,2)="N "
�[  � If 'Extract newer' set then force Filer only to overwrite if archived file is newer
�  � "Copy "+a$+" "+b$
�&  �"Wipe InfoScrap:temp R F ~V ~C"
�I� make sure there is only one object in 'temp' so kludges above work!
��
�A  param1$=a$:param2$="":�report(�message_looksub("movX"),%11)
�=  n%=(errclick%=1):� n% � �"Filer_OpenDir InfoScrap:temp"
��
�savedlevels%=-1
�=n%
�:
�R� -------functions to redraw the window for the level above/below-------------
�:
�� �uplevel(x%)
�� m%,keep%
�&� x%=0 �:=0:� already at top level
�keep%=x%
�ȕ x%>1
�!    m%=�commonpath$,"/",m%+1)
�
    x%-=1
��
�=� m%=0 commonpath$="*" � commonpath$=�commonpath$,m%)+"*"
��fakefilerwindow(�,�)
��toggleselect(�)
�=keep%-1
�:
�� �nextlevel(clicked%)
�>commonpath$=�commonpath$)+�getfakeleafname(clicked%,�)+"*"
�levels%+=1
��fakefilerwindow(�,�)
��toggleselect(�)
��
�:
�R� -----read/save options to Config file---------------------------------------
�:
�� �configloadfilename
�� n$
"n$=�ReadSysVar("Choices$Path")
<� n$="" � n$="<"+p$+"$Dir>.Resources" � n$="Choices:"+p$
=n$+".Config"
:
� �configsavefilename
� n$
#n$=�ReadSysVar("Choices$Write")
6� n$="" � n$="<"+p$+"$Dir>.Resources" � n$+="."+p$
=n$+".Config"
	:

� �loadconfig
 � A%,n%,ver%,dummy%,olddisp$
� �

3� � � � �:�report(�$+" at line "+�(�),1):�#A%:�
A%=� �configloadfilename

�#A%,ver%
B� ver%<241 � �#A%=0:� old versions don't have a version number
� n%=1 � 5:� optsmenu%
  �#A%,options%(n%)
�
*� ver%<243 � options%(5)=1-options%(5)
2� New option 5 is more or less opposite of old
� ver%<241 � �#A%,dummy%
!� ver%>243 � �#A%,options%(6)
/� old and latest versions have extra option
E� ver%<260 � �#A%,olddisp$:disptime%=�(olddisp$) � �#A%,disptime%
0� previously disptime was stored as a string
�#A%,beepflag%
�#A%,openflag%
�#A%,unixflag%
-� ver%>300 � �#A%,showpane% � showpane%=1
%� allow pane to be configured off
 �#A%
!�
":
#� �setupoptsmenu
$� n%
%� n%=1 � 6:� optsmenu%
&&  �tick(optsmenu%,n%,options%(n%))
'�
(�
):
*� �setupconfig
+� n%
,� n%=1 � 6
->  �IconState(configure%,ic_opticons%+n%-1,21,options%(n%))
.�
/6�seticontext(configure%,ic_timedisp%,�(disptime%))
00�IconState(configure%,ic_beep%,21,beepflag%)
10�IconState(configure%,ic_open%,21,openflag%)
20�IconState(configure%,ic_unix%,21,unixflag%)
30�IconState(configure%,ic_show%,21,showpane%)
4�
5:
6� �readconfig
7� n%
8� n%=1 � 6:� optsmenu%
9>  options%(n%)=�iconselected(configure%,ic_opticons%+n%-1)
:�
;6disptime%=�(�geticontext(configure%,ic_timedisp%))
<0beepflag%=�iconselected(configure%,ic_beep%)
=0openflag%=�iconselected(configure%,ic_open%)
>0unixflag%=�iconselected(configure%,ic_unix%)
?n%=showpane%
@0showpane%=�iconselected(configure%,ic_show%)
A� showpane%=n% � �
B
C!block%=panepath%
D#ș"Wimp_GetWindowState",,block%
EA� (block%!32 � (1<<16)) >0  � showpane%=0 � �close(panepath%)
F� remove pane if it is open
G
H+�fakefilerwindow(�,�):� redraw & resize
I�
J:
K� �saveoptions
L� A%,n%
M� �
N3� � � � �:�report(�$+" at line "+�(�),1):�#A%:�
O0ș"XOS_CLI","CDir <Choices$Write>."+p$ � ;n%
P;� CDir creates a directory if it does not already exist
Q
RA%=� �configsavefilename
S�#A%,301:� version number
T1� update this if we change Config file format
U"� n%=1 � 6:� size of optsmenu%
V  �#A%,options%(n%)
W�
X�#A%,disptime%
Y�#A%,beepflag%
Z�#A%,openflag%
[�#A%,unixflag%
\�#A%,showpane%
]�#A%
^�
_:
`Q� --the functions which convert the catalogue file into a graphical display--
a$� �fakefilerwindow(err%,reopen%)
b� H%,B%,G%,F%
c.� a$,x%,y%,name_ptr%,index_ptr%,maxlenptr%
d� code_ptr%,max_icon_width%
e� �
f� � � � �:� �fferror(�):�
g�close(save%)
h"� reopen% � �close(fakefiler%)
i
all%=�
j%menuicon%=-1:� no file 'selected'
k
l<� showpane% � �IconState(panepath%,0,22,commonpath$="*")
m
n6ș"XOS_File",17,zipfile$ � ,,,,F%;x%:� file length
o� x% � 1 � �
p?� file not found - probably mode change when no file loaded
q%�changetitle(fakefiler%,zipfile$)
r
s?� F%=22 � �drawwindow(0,0,400,reopen%):�:� an empty zipfile
t
uș"Hourglass_Start",50
vș"Hourglass_LEDs",%11,%11
w<� Slightly greater delay than that given by Hourglass_On
xno_of_files%=0
y�#in%=0
za$=�#in%
{.� a$="" � a$=wait$+�message_lookup("fail")
|K� �a$,8)<>"Archive:" � � 255,a$:� text of a$ will be error message here
}x%=�#in%
~>� remember redirected output is CR+LF - get extra LF in x%
x%=�
��
�  a$=�#in%:n%=�#in%
�Z  � �a$,7)="warning" � err% � �report(a$+�message_lookup("warn"),%11):x%=(errclick%=1)
�� �a$,"----") � x%=�
�
�� x%=� � � 255,""
�
�2�extend_named_sliding_block(icon_names%,�#in%)
�W� claim enough icon_names% space to hold the *whole file* - guaranteed to be enough
�9�extend_named_sliding_block(icon_index%,4*(�#in%/29))
�O� claim icon_index% space by calculating no. of lines, at 29 bytes per line
�C� (this is minimum possible length of line up to start of name)
�,� allocate one word for pointer per line
�.� (i.e. max possible icons if all in root)
�code_ptr%=!arrayscan%
�name_ptr%=!icon_names%
�maxlenptr%=!icon_index%
�maxlenptr%!4=0
�Q� store no_of_files at maxlenptr% and pointer to longest name at maxlenptr%!4
�index_ptr%=maxlenptr%+8
�
�2H%=index_ptr%:� set R7 to point to index block
�3G%=block%:� set R6 to point to temporary buffer
�"B%=in%:� set R1 to file handle
�1F%=�#in%/100:�  set R5 to file size (DIV 100)
�K$temp%=commonpath$:� so we don't have to look it up again at every CALL
�
�$code_ptr%!4=0:� reset flag words
�code_ptr%!8=0
�*� code_ptr%,name_ptr%,temp%,index_ptr%
�� pass parameters:
�D� 1st - start of block in which to store pointers to names found
�7� 2nd - start of block holding "common path" string
�A� 3rd - start of output block into which to write names found
�F� R1,R5,R6 and R7 are also initialised with frequently-used values
�E� �ticked(dispmenu%,1) � ș"OS_HeapSort",code_ptr%!4,index_ptr%,4
�maxlenptr%!0=code_ptr%!4
�+� so we can access no_of_files globally
�;�extend_named_sliding_block(icon_widths%,4*!maxlenptr%)
�A� resize block to hold necessary string widths (for clipping)
�0� we set these later, at window-opening time
�
�maxlenptr%=!icon_index%
�
�P� machine code has already written address of longest name into maxlenptr%!4
�� maxlenptr%!4>0 �
�3 max_icon_width%=�stringlength($(maxlenptr%!4))
�!across%=4+(maxlenptr%!0 � 10)
��setclipwidths
��
� across%=1
��
�� no.of icons in each row
�/� max_icon_width%<200 � max_icon_width%=200
�=� max_icon_width%>clipwidth% � max_icon_width%=clipwidth%
�%x%=(�screenwidth/max_icon_width%)
�9� maximum number of files that will fit across screen
�� x%<across% � across%=x%
�
�=�drawwindow(across%,maxlenptr%!0,max_icon_width%,reopen%)
�ș"Hourglass_Off"
��
�
�� �fferror(num%)
�� n%
�?� num%=222 � in%=�"InfoScrap:CAT":n%=�:� �report(�$,1):n%=�
�3� try to recover from illegal/closed file error
�.� Return TRUE to abort PROCfakefilerwindow
�=n%
�
�8� �drawwindow(across%,no_of_files%,max_len%,reopen%)
�+� name$,n%,width%,y%,ptr%,a$,commonlen%
�� paneoffset%
�3� showpane%=1 � paneoffset%=96 � paneoffset%=20
�?� across% is number of columns in which files are displayed
�!� max_len%<200 � max_len%=200
�7commonlen%=�stringlength("/"+�commonpath$))+64+8+24
�R� 64 OS units from left-hand side of pane and 8 OS units to right edge of pane
�M� plus 24-OS unit 'border allowance' to allow for the padding inserted by
�� the WIMP at start of icon
�� no_of_files%=0 �
�  � empty directory
� width%=commonlen%
� across%=1
��
�e � no_of_files%<across% � width%=max_len%*�looped(no_of_files%,across%) � width%=max_len%*across%
�, � width%<commonlen% � width%=commonlen%
��
�:� width% is now required width of window (in OS units)
�;y%=126*((no_of_files%+across%-1) � across%)+paneoffset%
�/� y%<(126+paneoffset%) � y%=126+paneoffset%
�=� showpane% � �seticontext(panepath%,1,"/"+�commonpath$))
��resize(width%,y%,max_len%)
�� reopen% �
�1  �openwindow(block%):last_opened%=fakefiler%
�$  � reopen to (new) maximum size
�<  � child%=0 � �redrawiconbar("N") � �redrawiconbar("Y")
��
��
�:
�R� --------Command-line function-----------------------------------------------
�
�N� this function uses its parameters and the values of the global variables
�O� zipfile$, commonpath$ and notzipped$ to construct the actual command line
�<� which is the whole purpose of the program's existence!
�!� �commandline(action$,type$)
�� args$,opts$,a$,file%
�Ȏ action$ �
�  � "unzip":
�               args$=" -d "
�&               � commonpath$="*" �
�0                args$+=�pathname(notzipped$)
�               �
�+                args$+="InfoScrap:temp"
�T                 � �ifthere("InfoScrap:temp") � �"Wipe InfoScrap:temp R ~V ~C F"
�               �
�9               args$+=" "+�(&22)+�(&22)+�commonpath$)
�"               � escape quotes
�)               opts$=�options(1)+"C "
�               Ȏ type$ �
�[                � "application","directory":args$+=�unDOSify(�leafname(notzipped$))+"*"
�H                � "file_xxx":args$+=�unDOSify(�leafname(notzipped$))
�&                � "all":args$+="*"
�               �
�6               a$="unzipping":args$+=�(&22)+�(&22)
�-  � "zip":opts$=" -r -b <Wimp$ScrapDir> "
�?             � �(-1) � opts$=" -m"+opts$ � delete_later$=""
�             � move/copy
j             � �notzipped$,15)=" InfoScrap:add." � args$=�notzipped$,16) � args$=�leafname(notzipped$)
             a$="zipping"
m             � wait$="delete" � opts$=" -d -b <Wimp$ScrapDir> ":args$=�unDOSify(notzipped$):a$="deleting"
(             opts$=�options(0)+opts$
             Ȏ type$ �
9               � "application","directory":args$+="*"
             �
�
7� debug% � �debug(action$+opts$+zipfile$+" "+args$)
	3� *Report \b (action$+opts$+zipfile$+" "+args$)

i="TaskWindow "+�34+action$+opts$+zipfile$+" "+args$+�34+" -name "+�34+"Infozip ("+a$+")"+�34+" -quit"
:
� �options(type%)

� n%,a$
A� type% 0 =zip-applicable options only, type% 1 = all options
a$=" -"
� n%=1 � 5
  � n%=2 � n%=4 � type%=1 �
,    � options%(n%) � a$+=�options$,n%,1)
  �
�
:� type%<>1 � options%(n%) � a$+=�options$,n%,1):� n%=6
� a$=" -" �
  � type%=0 � a$=""
�
=a$
:
� �debug(text$)
� file$,handle%
� �
� � � � �:�
=� ON ERROR LOCAL RESTORE ERROR:OSCLI"ReportError":ENDPROC
 ^� only likely error is 'can't write to file', i.e. don't worry about closing file on error
!*file$=�ReadSysVar("Infozip$debugfile")
"<� �ifthere(file$) � file$=">> "+file$ � file$="> "+file$
#� handle%=OPENUP(file$)
$
� ELSE
%� handle%=OPENOUT(file$)
&� ENDIF
'� PTR#handle%=EXT#handle%
(� BPUT#handle%,text$
)� CLOSE#handle%
*$� "Echo "+text$+" { "+file$+" }"
+�
,:
�
00000000  0d 00 01 14 f4 3e 49 6e  66 6f 7a 69 70 20 73 6f  |.....>Infozip so|
00000010  75 72 63 65 0d 00 02 20  76 65 72 24 3d 22 33 b7  |urce... ver$="3.|
00000020  30 37 20 28 32 34 74 68  20 4a 75 6c 79 20 32 30  |07 (24th July 20|
00000030  31 32 29 22 0d 00 03 22  c8 9b 20 22 3c 49 6e 66  |12)"...".. "<Inf|
00000040  6f 7a 69 70 24 44 69 72  3e 2e 53 48 65 61 70 2e  |ozip$Dir>.SHeap.|
00000050  53 48 65 61 70 22 0d 00  04 12 f2 73 74 61 72 74  |SHeap".....start|
00000060  75 70 3a f2 70 6f 6c 6c  0d 00 05 04 0d 00 06 05  |up:.poll........|
00000070  e0 0d 00 07 05 3a 0d 00  08 52 f4 20 2d 2d 2d 49  |.....:...R. ---I|
00000080  6e 69 74 69 61 6c 69 73  61 74 69 6f 6e 20 66 75  |nitialisation fu|
00000090  6e 63 74 69 6f 6e 73 2d  2d 2d 2d 2d 2d 2d 2d 2d  |nctions---------|
000000a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000000c0  2d 2d 2d 2d 2d 2d 2d 2d  0d 00 09 0e dd 20 f2 73  |--------..... .s|
000000d0  74 61 72 74 75 70 0d 00  0a 35 ea 20 6e 25 2c 6d  |tartup...5. n%,m|
000000e0  65 73 73 66 69 6c 65 24  2c 74 65 6d 70 66 69 6c  |essfile$,tempfil|
000000f0  65 24 2c 65 6e 76 24 2c  73 69 7a 65 25 2c 77 25  |e$,env$,size%,w%|
00000100  2c 6d 61 78 77 25 2c 70  74 72 25 0d 00 0b 10 70  |,maxw%,ptr%....p|
00000110  24 3d 22 49 6e 66 6f 7a  69 70 22 0d 00 0c 17 f2  |$="Infozip".....|
00000120  69 6e 69 74 68 65 61 70  73 28 31 32 38 2c 31 32  |initheaps(128,12|
00000130  38 29 0d 00 0d 28 6d 61  69 6e 69 6e 64 25 3d a4  |8)...(mainind%=.|
00000140  63 72 65 61 74 65 5f 61  6e 63 68 6f 72 28 22 74  |create_anchor("t|
00000150  65 6d 70 6c 61 74 65 73  22 29 0d 00 0e 24 61 72  |emplates")...$ar|
00000160  72 6f 77 73 25 3d a4 63  72 65 61 74 65 5f 61 6e  |rows%=.create_an|
00000170  63 68 6f 72 28 22 61 72  72 6f 77 73 22 29 0d 00  |chor("arrows")..|
00000180  0f 27 6d 65 73 73 61 67  65 25 3d a4 63 72 65 61  |.'message%=.crea|
00000190  74 65 5f 61 6e 63 68 6f  72 28 22 6d 65 73 73 61  |te_anchor("messa|
000001a0  67 65 73 22 29 0d 00 10  28 70 61 74 68 69 63 6f  |ges")...(pathico|
000001b0  6e 25 3d a4 63 72 65 61  74 65 5f 61 6e 63 68 6f  |n%=.create_ancho|
000001c0  72 28 22 70 61 74 68 69  63 6f 6e 22 29 0d 00 11  |r("pathicon")...|
000001d0  22 f4 20 54 68 65 73 65  20 62 6c 6f 63 6b 73 20  |". These blocks |
000001e0  4d 55 53 54 20 6e 6f 74  20 73 6c 69 64 65 21 0d  |MUST not slide!.|
000001f0  00 12 2c 69 63 6f 6e 5f  6e 61 6d 65 73 25 3d a4  |..,icon_names%=.|
00000200  63 72 65 61 74 65 5f 61  6e 63 68 6f 72 28 22 69  |create_anchor("i|
00000210  63 6f 6e 20 6e 61 6d 65  73 22 29 0d 00 13 2c 69  |con names")...,i|
00000220  63 6f 6e 5f 69 6e 64 65  78 25 3d a4 63 72 65 61  |con_index%=.crea|
00000230  74 65 5f 61 6e 63 68 6f  72 28 22 69 63 6f 6e 20  |te_anchor("icon |
00000240  69 6e 64 65 78 22 29 0d  00 14 2d 61 72 72 61 79  |index")...-array|
00000250  73 63 61 6e 25 3d a4 63  72 65 61 74 65 5f 61 6e  |scan%=.create_an|
00000260  63 68 6f 72 28 22 6d 61  63 68 69 6e 65 20 63 6f  |chor("machine co|
00000270  64 65 22 29 0d 00 15 2e  69 63 6f 6e 5f 77 69 64  |de")....icon_wid|
00000280  74 68 73 25 3d a4 63 72  65 61 74 65 5f 61 6e 63  |ths%=.create_anc|
00000290  68 6f 72 28 22 69 63 6f  6e 20 77 69 64 74 68 73  |hor("icon widths|
000002a0  22 29 0d 00 16 29 de 20  62 6c 6f 63 6b 25 20 32  |")...). block% 2|
000002b0  35 36 2c 74 65 6d 70 25  20 31 33 30 30 2c 70 72  |56,temp% 1300,pr|
000002c0  65 73 65 72 76 65 25 20  32 35 36 0d 00 17 7a f4  |eserve% 256...z.|
000002d0  20 66 69 72 73 74 20 32  35 36 62 20 6f 66 20 74  | first 256b of t|
000002e0  65 6d 70 25 20 69 73 20  73 63 72 61 74 63 68 20  |emp% is scratch |
000002f0  73 70 61 63 65 2c 20 6e  65 78 74 20 36 34 62 20  |space, next 64b |
00000300  72 65 73 65 72 76 65 64  20 66 6f 72 20 50 52 4f  |reserved for PRO|
00000310  43 6f 70 65 6e 77 69 6e  64 6f 77 2c 20 72 65 73  |Copenwindow, res|
00000320  74 20 73 65 6d 69 2d 70  65 72 6d 61 6e 65 6e 74  |t semi-permanent|
00000330  20 66 6f 72 20 68 69 67  68 20 6c 65 76 65 6c 20  | for high level |
00000340  50 52 4f 43 73 0d 00 18  29 70 61 72 61 6d 31 24  |PROCs...)param1$|
00000350  3d 22 22 3a f4 20 66 6f  72 20 6d 65 73 73 61 67  |="":. for messag|
00000360  65 20 73 75 62 73 74 69  74 75 74 69 6f 6e 0d 00  |e substitution..|
00000370  19 0e 70 61 72 61 6d 32  24 3d 22 22 0d 00 1a 2e  |..param2$=""....|
00000380  f2 63 72 65 61 74 65 5f  6e 61 6d 65 64 5f 73 6c  |.create_named_sl|
00000390  69 64 69 6e 67 5f 62 6c  6f 63 6b 28 6d 61 69 6e  |iding_block(main|
000003a0  69 6e 64 25 2c 31 34 36  30 29 0d 00 1b 15 69 6e  |ind%,1460)....in|
000003b0  64 70 74 72 25 3d 21 6d  61 69 6e 69 6e 64 25 0d  |dptr%=!mainind%.|
000003c0  00 1c 16 6c 61 73 74 6d  65 6e 75 6f 70 65 6e 65  |...lastmenuopene|
000003d0  64 25 3d 2d 31 0d 00 1d  10 de 20 69 6e 69 74 62  |d%=-1..... initb|
000003e0  6c 25 20 34 38 0d 00 1e  14 69 6e 69 74 62 6c 25  |l% 48....initbl%|
000003f0  21 30 3d 26 34 30 30 43  33 0d 00 1f 12 69 6e 69  |!0=&400C3....ini|
00000400  74 62 6c 25 21 34 3d 26  35 30 32 0d 00 20 14 69  |tbl%!4=&502.. .i|
00000410  6e 69 74 62 6c 25 21 38  3d 26 34 30 30 43 30 0d  |nitbl%!8=&400C0.|
00000420  00 21 11 69 6e 69 74 62  6c 25 21 31 32 3d 31 30  |.!.initbl%!12=10|
00000430  0d 00 22 10 69 6e 69 74  62 6c 25 21 31 36 3d 31  |..".initbl%!16=1|
00000440  0d 00 23 10 69 6e 69 74  62 6c 25 21 32 30 3d 33  |..#.initbl%!20=3|
00000450  0d 00 24 10 69 6e 69 74  62 6c 25 21 32 34 3d 32  |..$.initbl%!24=2|
00000460  0d 00 25 10 69 6e 69 74  62 6c 25 21 32 38 3d 34  |..%.initbl%!28=4|
00000470  0d 00 26 10 69 6e 69 74  62 6c 25 21 33 32 3d 35  |..&.initbl%!32=5|
00000480  0d 00 27 15 69 6e 69 74  62 6c 25 21 33 36 3d 26  |..'.initbl%!36=&|
00000490  34 30 30 43 46 0d 00 28  15 69 6e 69 74 62 6c 25  |400CF..(.initbl%|
000004a0  21 34 30 3d 26 34 30 30  43 31 0d 00 29 10 69 6e  |!40=&400C1..).in|
000004b0  69 74 62 6c 25 21 34 34  3d 30 0d 00 2a 3c c8 99  |itbl%!44=0..*<..|
000004c0  20 22 57 69 6d 70 5f 49  6e 69 74 69 61 6c 69 73  | "Wimp_Initialis|
000004d0  65 22 2c 33 30 30 2c 26  34 42 35 33 34 31 35 34  |e",300,&4B534154|
000004e0  2c 70 24 2c 69 6e 69 74  62 6c 25 20 b8 20 6e 6f  |,p$,initbl% . no|
000004f0  74 66 6f 6e 74 25 0d 00  2b 1b 6e 6f 74 66 6f 6e  |tfont%..+.notfon|
00000500  74 25 3d 28 6e 6f 74 66  6f 6e 74 25 3c 33 35 30  |t%=(notfont%<350|
00000510  29 0d 00 2c 30 69 6e 25  3d 30 3a f4 20 67 6c 6f  |)..,0in%=0:. glo|
00000520  62 61 6c 20 76 61 72 69  61 62 6c 65 20 72 65 71  |bal variable req|
00000530  75 69 72 65 64 20 62 79  20 50 52 4f 43 71 75 69  |uired by PROCqui|
00000540  74 0d 00 2d 2f ee 20 85  20 f2 72 65 70 6f 72 74  |t..-/. . .report|
00000550  28 f6 24 2b 22 20 61 74  20 6c 69 6e 65 20 22 2b  |(.$+" at line "+|
00000560  c3 20 9e 2c 25 31 30 29  3a f2 71 75 69 74 3a e0  |. .,%10):.quit:.|
00000570  0d 00 2e 1f 6d 65 73 73  66 69 6c 65 24 3d 70 24  |....messfile$=p$|
00000580  2b 22 52 65 73 3a 4d 65  73 73 61 67 65 73 22 0d  |+"Res:Messages".|
00000590  00 2f 2f c8 99 22 4d 65  73 73 61 67 65 54 72 61  |.//.."MessageTra|
000005a0  6e 73 5f 46 69 6c 65 49  6e 66 6f 22 2c 2c 6d 65  |ns_FileInfo",,me|
000005b0  73 73 66 69 6c 65 24 20  b8 20 2c 2c 6e 25 0d 00  |ssfile$ . ,,n%..|
000005c0  30 2c f2 63 72 65 61 74  65 5f 6e 61 6d 65 64 5f  |0,.create_named_|
000005d0  73 6c 69 64 69 6e 67 5f  62 6c 6f 63 6b 28 6d 65  |sliding_block(me|
000005e0  73 73 61 67 65 25 2c 6e  25 29 0d 00 31 0f de 20  |ssage%,n%)..1.. |
000005f0  6d 64 61 74 61 25 20 31  36 0d 00 32 38 c8 99 22  |mdata% 16..28.."|
00000600  4d 65 73 73 61 67 65 54  72 61 6e 73 5f 4f 70 65  |MessageTrans_Ope|
00000610  6e 46 69 6c 65 22 2c 6d  64 61 74 61 25 2c 6d 65  |nFile",mdata%,me|
00000620  73 73 66 69 6c 65 24 2c  21 6d 65 73 73 61 67 65  |ssfile$,!message|
00000630  25 0d 00 33 04 0d 00 34  2c f2 63 72 65 61 74 65  |%..3...4,.create|
00000640  5f 6e 61 6d 65 64 5f 73  6c 69 64 69 6e 67 5f 62  |_named_sliding_b|
00000650  6c 6f 63 6b 28 61 72 72  6f 77 73 25 2c 35 31 32  |lock(arrows%,512|
00000660  29 0d 00 35 31 f4 20 77  65 20 61 72 65 20 67 6f  |)..51. we are go|
00000670  69 6e 67 20 74 6f 20 72  65 73 69 7a 65 20 61 6e  |ing to resize an|
00000680  64 20 72 65 75 73 65 20  74 68 69 73 20 6c 61 74  |d reuse this lat|
00000690  65 72 0d 00 36 11 70 74  72 25 3d 21 61 72 72 6f  |er..6.ptr%=!arro|
000006a0  77 73 25 0d 00 37 19 c8  99 20 22 4f 53 5f 47 65  |ws%..7... "OS_Ge|
000006b0  74 45 6e 76 22 20 b8 20  65 6e 76 24 0d 00 38 3c  |tEnv" . env$..8<|
000006c0  c8 99 22 4f 53 5f 52 65  61 64 41 72 67 73 22 2c  |.."OS_ReadArgs",|
000006d0  22 42 41 53 49 43 2c 71  75 69 74 2f 6b 2c 7a 69  |"BASIC,quit/k,zi|
000006e0  70 2c 64 65 62 75 67 2f  73 22 2c 65 6e 76 24 2c  |p,debug/s",env$,|
000006f0  70 74 72 25 2c 35 31 32  0d 00 39 28 e7 20 70 74  |ptr%,512..9(. pt|
00000700  72 25 21 38 20 8c 20 65  6e 76 24 3d a4 73 28 70  |r%!8 . env$=.s(p|
00000710  74 72 25 21 38 29 20 8b  20 65 6e 76 24 3d 22 22  |tr%!8) . env$=""|
00000720  0d 00 3a 35 f4 20 6e 61  6d 65 20 6f 66 20 7a 69  |..:5. name of zi|
00000730  70 66 69 6c 65 20 77 68  69 63 68 20 6c 61 75 6e  |pfile which laun|
00000740  63 68 65 64 20 70 72 6f  67 72 61 6d 20 28 69 66  |ched program (if|
00000750  20 61 6e 79 29 0d 00 3b  26 e7 20 a4 6f 6b 5f 74  | any)..;&. .ok_t|
00000760  6f 5f 6c 6f 61 64 5f 6e  65 77 5f 63 6f 70 79 28  |o_load_new_copy(|
00000770  65 6e 76 24 29 3d a3 20  8c 20 e0 0d 00 3c 04 0d  |env$)=. . ...<..|
00000780  00 3d 2b 64 65 62 75 67  25 3d 70 74 72 25 21 31  |.=+debug%=ptr%!1|
00000790  32 3a f4 20 64 6f 20 77  65 20 64 75 6d 70 20 64  |2:. do we dump d|
000007a0  65 62 75 67 20 69 6e 66  6f 3f 0d 00 3e 04 0d 00  |ebug info?..>...|
000007b0  3f 28 f4 20 4c 6f 61 64  69 6e 67 20 77 69 6e 64  |?(. Loading wind|
000007c0  6f 77 73 20 66 72 6f 6d  20 74 65 6d 70 6c 61 74  |ows from templat|
000007d0  65 20 66 69 6c 65 0d 00  40 2e 74 65 6d 70 66 69  |e file..@.tempfi|
000007e0  6c 65 24 3d 22 3c 22 2b  70 24 2b 22 24 44 69 72  |le$="<"+p$+"$Dir|
000007f0  3e 2e 52 65 73 6f 75 72  63 65 73 2e 53 70 72 69  |>.Resources.Spri|
00000800  74 65 73 22 0d 00 41 2a  c8 99 22 4f 53 5f 52 65  |tes"..A*.."OS_Re|
00000810  61 64 4d 6f 64 65 56 61  72 69 61 62 6c 65 22 2c  |adModeVariable",|
00000820  2d 31 2c 35 20 b8 20 2c  2c 73 69 7a 65 25 0d 00  |-1,5 . ,,size%..|
00000830  42 1f e7 20 73 69 7a 65  25 3d 31 20 8c 20 74 65  |B.. size%=1 . te|
00000840  6d 70 66 69 6c 65 24 2b  3d 22 32 32 22 0d 00 43  |mpfile$+="22"..C|
00000850  2c f4 20 6c 6f 61 64 20  73 70 72 69 74 65 73 20  |,. load sprites |
00000860  6f 66 20 61 70 70 72 6f  70 72 69 61 74 65 20 72  |of appropriate r|
00000870  65 73 6f 6c 75 74 69 6f  6e 0d 00 44 3e c8 99 22  |esolution..D>.."|
00000880  4f 53 5f 46 69 6c 65 22  2c 32 33 2c 74 65 6d 70  |OS_File",23,temp|
00000890  66 69 6c 65 24 20 b8 20  2c 2c 2c 2c 73 69 7a 65  |file$ . ,,,,size|
000008a0  25 3a f4 20 67 65 74 20  6c 65 6e 67 74 68 20 69  |%:. get length i|
000008b0  6e 20 73 69 7a 65 25 0d  00 45 30 f2 65 78 74 65  |n size%..E0.exte|
000008c0  6e 64 5f 6e 61 6d 65 64  5f 73 6c 69 64 69 6e 67  |nd_named_sliding|
000008d0  5f 62 6c 6f 63 6b 28 61  72 72 6f 77 73 25 2c 73  |_block(arrows%,s|
000008e0  69 7a 65 25 2b 34 29 0d  00 46 28 21 28 21 61 72  |ize%+4)..F(!(!ar|
000008f0  72 6f 77 73 25 29 3d 73  69 7a 65 25 2b 34 3a 21  |rows%)=size%+4:!|
00000900  28 21 61 72 72 6f 77 73  25 2b 38 29 3d 31 36 0d  |(!arrows%+8)=16.|
00000910  00 47 3a c8 99 22 4f 53  5f 53 70 72 69 74 65 4f  |.G:.."OS_SpriteO|
00000920  70 22 2c 26 31 30 41 2c  21 61 72 72 6f 77 73 25  |p",&10A,!arrows%|
00000930  2c 74 65 6d 70 66 69 6c  65 24 3a f4 20 6c 6f 61  |,tempfile$:. loa|
00000940  64 20 73 70 72 69 74 65  73 0d 00 48 04 0d 00 49  |d sprites..H...I|
00000950  20 74 65 6d 70 66 69 6c  65 24 3d 70 24 2b 22 52  | tempfile$=p$+"R|
00000960  65 73 3a 54 65 6d 70 6c  61 74 65 73 22 0d 00 4a  |es:Templates"..J|
00000970  24 c8 99 22 57 69 6d 70  5f 4f 70 65 6e 54 65 6d  |$.."Wimp_OpenTem|
00000980  70 6c 61 74 65 22 2c 2c  74 65 6d 70 66 69 6c 65  |plate",,tempfile|
00000990  24 0d 00 4b 1d 69 6e 66  6f 25 3d a4 6c 6f 61 64  |$..K.info%=.load|
000009a0  77 69 6e 64 6f 77 28 22  69 6e 66 6f 22 29 0d 00  |window("info")..|
000009b0  4c 21 73 61 76 65 25 3d  a4 6c 6f 61 64 77 69 6e  |L!save%=.loadwin|
000009c0  64 6f 77 28 22 6e 69 63  65 73 61 76 65 22 29 0d  |dow("nicesave").|
000009d0  00 4d 27 66 61 6b 65 66  69 6c 65 72 25 3d a4 6c  |.M'fakefiler%=.l|
000009e0  6f 61 64 77 69 6e 64 6f  77 28 22 64 69 72 65 63  |oadwindow("direc|
000009f0  74 6f 72 79 22 29 0d 00  4e 25 70 61 6e 65 70 61  |tory")..N%panepa|
00000a00  74 68 25 3d a4 6c 6f 61  64 77 69 6e 64 6f 77 28  |th%=.loadwindow(|
00000a10  22 70 61 6e 65 70 61 74  68 22 29 0d 00 4f 25 61  |"panepath")..O%a|
00000a20  6c 65 72 74 62 6f 78 25  3d a4 6c 6f 61 64 77 69  |lertbox%=.loadwi|
00000a30  6e 64 6f 77 28 22 61 6c  65 72 74 62 6f 78 22 29  |ndow("alertbox")|
00000a40  0d 00 50 1d 66 69 6c 65  25 3d a4 6c 6f 61 64 77  |..P.file%=.loadw|
00000a50  69 6e 64 6f 77 28 22 66  69 6c 65 22 29 0d 00 51  |indow("file")..Q|
00000a60  27 63 6f 6e 66 69 67 75  72 65 25 3d a4 6c 6f 61  |'configure%=.loa|
00000a70  64 77 69 6e 64 6f 77 28  22 63 6f 6e 66 69 67 75  |dwindow("configu|
00000a80  72 65 22 29 0d 00 52 1a  c8 99 22 57 69 6d 70 5f  |re")..R..."Wimp_|
00000a90  43 6c 6f 73 65 54 65 6d  70 6c 61 74 65 22 0d 00  |CloseTemplate"..|
00000aa0  53 04 0d 00 54 1e f4 20  63 6f 6e 66 69 67 75 72  |S...T.. configur|
00000ab0  65 20 64 69 61 6c 6f 67  75 65 20 69 63 6f 6e 73  |e dialogue icons|
00000ac0  0d 00 55 1e 69 63 5f 6f  70 74 69 63 6f 6e 73 25  |..U.ic_opticons%|
00000ad0  3d 31 34 3a f4 20 31 34  20 74 6f 20 31 39 0d 00  |=14:. 14 to 19..|
00000ae0  56 3e 69 63 5f 74 69 6d  65 64 69 73 70 25 3d 33  |V>ic_timedisp%=3|
00000af0  3a 69 63 5f 62 75 6d 70  75 70 25 3d 35 3a 69 63  |:ic_bumpup%=5:ic|
00000b00  5f 62 75 6d 70 64 6f 77  6e 25 3d 36 3a 69 63 5f  |_bumpdown%=6:ic_|
00000b10  74 69 6d 65 6c 61 62 65  6c 25 3d 32 0d 00 57 31  |timelabel%=2..W1|
00000b20  69 63 5f 62 65 65 70 25  3d 34 3a 69 63 5f 6f 70  |ic_beep%=4:ic_op|
00000b30  65 6e 25 3d 37 3a 69 63  5f 75 6e 69 78 25 3d 31  |en%=7:ic_unix%=1|
00000b40  30 3a 69 63 5f 73 68 6f  77 25 3d 32 30 0d 00 58  |0:ic_show%=20..X|
00000b50  25 69 63 5f 73 61 76 65  25 3d 39 3a 69 63 5f 63  |%ic_save%=9:ic_c|
00000b60  61 6e 63 65 6c 25 3d 31  31 3a 69 63 5f 4f 4b 25  |ancel%=11:ic_OK%|
00000b70  3d 38 0d 00 59 04 0d 00  5a 19 f4 20 73 61 76 65  |=8..Y...Z.. save|
00000b80  20 64 69 61 6c 6f 67 75  65 20 69 63 6f 6e 73 0d  | dialogue icons.|
00000b90  00 5b 3c 73 61 76 65 5f  6f 6b 25 3d 34 3a 73 61  |.[<save_ok%=4:sa|
00000ba0  76 65 5f 63 61 6e 63 65  6c 25 3d 33 3a 73 61 76  |ve_cancel%=3:sav|
00000bb0  65 5f 70 61 74 68 25 3d  31 3a 73 61 76 65 5f 64  |e_path%=1:save_d|
00000bc0  72 61 67 67 61 62 6c 65  25 3d 32 0d 00 5c 19 f4  |raggable%=2..\..|
00000bd0  20 63 72 65 61 74 65 20  69 63 6f 6e 62 61 72 20  | create iconbar |
00000be0  69 63 6f 6e 0d 00 5d 2f  de 20 73 70 72 74 65 78  |icon..]/. sprtex|
00000bf0  74 25 20 34 3a 24 73 70  72 74 65 78 74 25 3d a4  |t% 4:$sprtext%=.|
00000c00  6d 65 73 73 61 67 65 5f  6c 6f 6f 6b 75 70 28 22  |message_lookup("|
00000c10  4e 22 29 0d 00 5e 27 de  20 73 70 72 73 70 72 69  |N")..^'. sprspri|
00000c20  74 65 25 20 31 32 3a 24  73 70 72 73 70 72 69 74  |te% 12:$sprsprit|
00000c30  65 25 3d 22 53 21 22 2b  70 24 0d 00 5f 2b 6d 61  |e%="S!"+p$.._+ma|
00000c40  78 77 25 3d a4 69 62 61  72 5f 77 69 64 74 68 28  |xw%=.ibar_width(|
00000c50  a4 6d 65 73 73 61 67 65  5f 6c 6f 6f 6b 75 70 28  |.message_lookup(|
00000c60  22 59 22 29 29 0d 00 60  3e 77 25 3d a4 69 62 61  |"Y"))..`>w%=.iba|
00000c70  72 5f 77 69 64 74 68 28  a4 6d 65 73 73 61 67 65  |r_width(.message|
00000c80  5f 6c 6f 6f 6b 75 70 28  22 4e 22 29 29 3a e7 20  |_lookup("N")):. |
00000c90  77 25 3e 6d 61 78 77 25  20 8c 20 6d 61 78 77 25  |w%>maxw% . maxw%|
00000ca0  3d 77 25 0d 00 61 4c 69  62 61 72 25 3d a4 74 65  |=w%..aLibar%=.te|
00000cb0  6d 70 6c 5f 69 63 6f 6e  28 2d 31 2c 30 2c 2d 31  |mpl_icon(-1,0,-1|
00000cc0  36 2c 6d 61 78 77 25 2c  38 38 2c 26 31 37 30 30  |6,maxw%,88,&1700|
00000cd0  33 31 30 42 2c 22 22 2c  73 70 72 74 65 78 74 25  |310B,"",sprtext%|
00000ce0  2c 73 70 72 73 70 72 69  74 65 25 2c 31 32 29 0d  |,sprsprite%,12).|
00000cf0  00 62 0b 62 61 72 25 3d  2d 32 0d 00 63 04 0d 00  |.b.bar%=-2..c...|
00000d00  64 1c f2 73 65 74 69 63  6f 6e 74 65 78 74 28 69  |d..seticontext(i|
00000d10  6e 66 6f 25 2c 30 2c 70  24 29 0d 00 65 34 f2 73  |nfo%,0,p$)..e4.s|
00000d20  65 74 69 63 6f 6e 74 65  78 74 28 69 6e 66 6f 25  |eticontext(info%|
00000d30  2c 31 2c 22 5a 69 70 2f  55 6e 7a 69 70 20 66 69  |,1,"Zip/Unzip fi|
00000d40  6c 65 73 20 66 6f 72 20  66 72 65 65 22 29 0d 00  |les for free")..|
00000d50  66 31 f2 73 65 74 69 63  6f 6e 74 65 78 74 28 69  |f1.seticontext(i|
00000d60  6e 66 6f 25 2c 32 2c 22  a9 20 48 61 72 72 69 65  |nfo%,2,". Harrie|
00000d70  74 20 42 61 7a 6c 65 79  20 31 39 39 38 22 29 0d  |t Bazley 1998").|
00000d80  00 67 1e f2 73 65 74 69  63 6f 6e 74 65 78 74 28  |.g..seticontext(|
00000d90  69 6e 66 6f 25 2c 34 2c  76 65 72 24 29 0d 00 68  |info%,4,ver$)..h|
00000da0  04 0d 00 69 17 f4 20 6c  6f 61 64 20 6d 61 63 68  |...i.. load mach|
00000db0  69 6e 65 20 63 6f 64 65  0d 00 6a 2f f2 63 72 65  |ine code..j/.cre|
00000dc0  61 74 65 5f 6e 61 6d 65  64 5f 73 6c 69 64 69 6e  |ate_named_slidin|
00000dd0  67 5f 62 6c 6f 63 6b 28  61 72 72 61 79 73 63 61  |g_block(arraysca|
00000de0  6e 25 2c 34 38 30 29 0d  00 6b 38 ff 22 4c 6f 61  |n%,480)..k8."Loa|
00000df0  64 20 3c 22 2b 70 24 2b  22 24 44 69 72 3e 2e 52  |d <"+p$+"$Dir>.R|
00000e00  65 73 6f 75 72 63 65 73  2e 63 6f 64 65 20 22 2b  |esources.code "+|
00000e10  c3 7e 28 21 61 72 72 61  79 73 63 61 6e 25 29 0d  |.~(!arrayscan%).|
00000e20  00 6c 04 0d 00 6d 0f f2  6d 65 6e 75 73 5f 69 6e  |.l...m..menus_in|
00000e30  69 74 0d 00 6e 14 de 20  73 70 72 69 74 65 6e 61  |it..n.. spritena|
00000e40  6d 65 25 20 31 31 0d 00  6f 1b 24 73 70 72 69 74  |me% 11..o.$sprit|
00000e50  65 6e 61 6d 65 25 3d 22  66 69 6c 65 5f 78 78 78  |ename%="file_xxx|
00000e60  22 0d 00 70 11 21 62 6c  6f 63 6b 25 3d 66 69 6c  |"..p.!block%=fil|
00000e70  65 25 0d 00 71 0f 62 6c  6f 63 6b 25 21 34 3d 32  |e%..q.block%!4=2|
00000e80  32 0d 00 72 11 62 6c 6f  63 6b 25 21 38 3d 2d 31  |2..r.block%!8=-1|
00000e90  36 30 0d 00 73 10 62 6c  6f 63 6b 25 21 31 32 3d  |60..s.block%!12=|
00000ea0  39 30 0d 00 74 11 62 6c  6f 63 6b 25 21 31 36 3d  |90..t.block%!16=|
00000eb0  2d 39 32 0d 00 75 17 62  6c 6f 63 6b 25 21 32 30  |-92..u.block%!20|
00000ec0  3d 26 43 37 30 30 30 31  31 32 0d 00 76 19 62 6c  |=&C7000112..v.bl|
00000ed0  6f 63 6b 25 21 32 34 3d  73 70 72 69 74 65 6e 61  |ock%!24=spritena|
00000ee0  6d 65 25 0d 00 77 0f 62  6c 6f 63 6b 25 21 32 38  |me%..w.block%!28|
00000ef0  3d 31 0d 00 78 10 62 6c  6f 63 6b 25 21 33 32 3d  |=1..x.block%!32=|
00000f00  31 31 0d 00 79 4d c8 99  22 57 69 6d 70 5f 43 72  |11..yM.."Wimp_Cr|
00000f10  65 61 74 65 49 63 6f 6e  22 2c 2c 62 6c 6f 63 6b  |eateIcon",,block|
00000f20  25 3a f4 20 63 72 65 61  74 65 20 61 6e 20 75 70  |%:. create an up|
00000f30  64 61 74 65 61 62 6c 65  20 66 69 6c 65 74 79 70  |dateable filetyp|
00000f40  65 20 69 63 6f 6e 20 69  6e 20 66 69 6c 65 25 0d  |e icon in file%.|
00000f50  00 7a 42 f4 20 77 65 20  64 6f 20 69 74 20 74 68  |.zB. we do it th|
00000f60  69 73 20 77 61 79 20 73  6f 20 74 68 61 74 20 77  |is way so that w|
00000f70  65 20 6b 6e 6f 77 20 74  68 65 20 61 64 64 72 65  |e know the addre|
00000f80  73 73 20 6f 66 20 73 70  72 69 74 65 6e 61 6d 65  |ss of spritename|
00000f90  25 0d 00 7b 04 0d 00 7c  2e f2 63 72 65 61 74 65  |%..{...|..create|
00000fa0  5f 6e 61 6d 65 64 5f 73  6c 69 64 69 6e 67 5f 62  |_named_sliding_b|
00000fb0  6c 6f 63 6b 28 70 61 74  68 69 63 6f 6e 25 2c 32  |lock(pathicon%,2|
00000fc0  35 36 29 0d 00 7d 0b de  20 52 32 25 20 33 0d 00  |56)..}.. R2% 3..|
00000fd0  7e 1f 24 52 32 25 3d 22  52 32 22 3a 24 28 21 70  |~.$R2%="R2":$(!p|
00000fe0  61 74 68 69 63 6f 6e 25  29 3d 22 2f 22 0d 00 7f  |athicon%)="/"...|
00000ff0  54 70 61 6e 65 69 63 6f  6e 25 3d a4 74 65 6d 70  |Tpaneicon%=.temp|
00001000  6c 5f 69 63 6f 6e 28 70  61 6e 65 70 61 74 68 25  |l_icon(panepath%|
00001010  2c 36 34 2c 2d 36 34 2c  32 30 31 32 2c 2d 31 32  |,64,-64,2012,-12|
00001020  2c 26 31 37 30 30 30 31  33 35 2c 22 22 2c 21 70  |,&17000135,"",!p|
00001030  61 74 68 69 63 6f 6e 25  2c 52 32 25 2c 32 35 35  |athicon%,R2%,255|
00001040  29 0d 00 80 04 0d 00 81  16 f4 20 67 6c 6f 62 61  |)......... globa|
00001050  6c 20 76 61 72 69 61 62  6c 65 73 0d 00 82 12 6c  |l variables....l|
00001060  61 73 74 5f 6f 70 65 6e  65 64 25 3d 30 0d 00 83  |ast_opened%=0...|
00001070  2c 6e 6f 5f 6f 66 5f 66  69 6c 65 73 25 3d 30 3a  |,no_of_files%=0:|
00001080  6c 65 76 65 6c 73 25 3d  30 3a 73 61 76 65 64 6c  |levels%=0:savedl|
00001090  65 76 65 6c 73 25 3d 2d  31 0d 00 84 2d 7a 69 70  |evels%=-1...-zip|
000010a0  66 69 6c 65 24 3d 22 22  3a 6e 6f 74 7a 69 70 70  |file$="":notzipp|
000010b0  65 64 24 3d 22 22 3a 63  6f 6d 6d 6f 6e 70 61 74  |ed$="":commonpat|
000010c0  68 24 3d 22 2a 22 0d 00  85 0d 73 74 6f 72 65 24  |h$="*"....store$|
000010d0  3d 22 22 0d 00 86 3a 6d  65 6e 75 69 63 6f 6e 25  |=""...:menuicon%|
000010e0  3d 2d 31 3a f4 20 72 65  63 6f 72 64 73 20 77 68  |=-1:. records wh|
000010f0  69 63 68 20 69 63 6f 6e  20 77 65 20 63 6c 69 63  |ich icon we clic|
00001100  6b 65 64 20 4d 45 4e 55  20 6f 76 65 72 0d 00 87  |ked MENU over...|
00001110  17 61 63 74 69 6f 6e 24  3d 22 22 3a 63 68 69 6c  |.action$="":chil|
00001120  64 25 3d 30 0d 00 88 0a  61 6c 6c 25 3d a3 0d 00  |d%=0....all%=...|
00001130  89 57 64 6f 6e 74 62 72  6f 61 64 63 61 73 74 25  |.Wdontbroadcast%|
00001140  3d b9 3a f4 20 72 65 63  6f 72 64 73 20 77 68 65  |=.:. records whe|
00001150  74 68 65 72 20 53 48 49  46 54 20 77 61 73 20 68  |ther SHIFT was h|
00001160  65 6c 64 20 64 6f 77 6e  20 77 68 65 6e 20 66 69  |eld down when fi|
00001170  6c 65 20 77 61 73 20 64  6f 75 62 6c 65 2d 63 6c  |le was double-cl|
00001180  69 63 6b 65 64 0d 00 8a  15 6f 70 74 69 6f 6e 73  |icked....options|
00001190  24 3d 22 61 6a 4c 71 75  49 22 0d 00 8b 14 64 65  |$="ajLquI"....de|
000011a0  6c 65 74 65 5f 6c 61 74  65 72 24 3d 22 22 0d 00  |lete_later$=""..|
000011b0  8c 49 f4 20 73 74 6f 72  65 73 20 6e 61 6d 65 20  |.I. stores name |
000011c0  6f 66 20 66 69 6c 65 20  64 72 61 67 67 65 64 20  |of file dragged |
000011d0  69 6e 20 28 77 68 69 63  68 20 77 65 20 6d 61 79  |in (which we may|
000011e0  20 77 61 6e 74 20 74 6f  20 6d 6f 76 65 20 6e 6f  | want to move no|
000011f0  74 20 63 6f 70 79 29 0d  00 8d 1c 70 6f 6c 6c 6d  |t copy)....pollm|
00001200  61 73 6b 25 3d 25 31 31  31 30 30 30 30 31 31 30  |ask%=%1110000110|
00001210  30 30 31 0d 00 8e 10 6c  6f 63 61 6c 5f 68 6f 6e  |001....local_hon|
00001220  25 3d a3 0d 00 8f 0d 74  69 6d 65 75 70 25 3d 30  |%=.....timeup%=0|
00001230  0d 00 90 52 6f 6c 64 5f  61 63 72 6f 73 73 25 3d  |...Rold_across%=|
00001240  30 3a f4 20 75 73 65 64  20 74 6f 20 61 76 6f 69  |0:. used to avoi|
00001250  64 20 75 6e 6e 65 63 65  73 73 61 72 79 20 66 6f  |d unnecessary fo|
00001260  72 63 65 64 20 72 65 64  72 61 77 73 20 6f 6e 20  |rced redraws on |
00001270  57 69 6e 64 6f 77 5f 4f  70 65 6e 20 65 76 65 6e  |Window_Open even|
00001280  74 73 0d 00 91 46 63 6c  69 70 77 69 64 74 68 25  |ts...Fclipwidth%|
00001290  3d 32 37 32 3a f4 20 63  6f 6c 75 6d 6e 20 77 69  |=272:. column wi|
000012a0  64 74 68 20 74 6f 20 77  68 69 63 68 20 66 61 6b  |dth to which fak|
000012b0  65 66 69 6c 65 72 20 69  63 6f 6e 73 20 61 72 65  |efiler icons are|
000012c0  20 63 6c 69 70 70 65 64  0d 00 92 04 0d 00 93 18  | clipped........|
000012d0  73 61 76 65 69 63 6f 6e  24 3d 22 66 69 6c 65 5f  |saveicon$="file_|
000012e0  64 64 63 22 0d 00 94 65  e7 20 a4 73 70 72 69 74  |ddc"...e. .sprit|
000012f0  65 5f 65 78 69 73 74 73  28 22 66 69 6c 65 5f 61  |e_exists("file_a|
00001300  39 31 22 29 20 8c 20 73  61 76 65 69 63 6f 6e 24  |91") . saveicon$|
00001310  3d 22 66 69 6c 65 5f 61  39 31 22 3a f2 73 65 74  |="file_a91":.set|
00001320  69 63 6f 6e 74 65 78 74  28 73 61 76 65 25 2c 73  |icontext(save%,s|
00001330  61 76 65 5f 64 72 61 67  67 61 62 6c 65 25 2c 73  |ave_draggable%,s|
00001340  61 76 65 69 63 6f 6e 24  29 0d 00 95 04 0d 00 96  |aveicon$).......|
00001350  04 0d 00 97 46 f4 20 73  70 61 63 65 20 72 65 73  |....F. space res|
00001360  65 72 76 65 64 20 66 6f  72 20 68 6f 6c 64 69 6e  |erved for holdin|
00001370  67 20 6e 61 6d 65 73 20  6f 66 20 73 70 72 69 74  |g names of sprit|
00001380  65 73 20 69 6e 20 66 61  6b 65 20 66 69 6c 65 72  |es in fake filer|
00001390  20 77 69 6e 64 6f 77 0d  00 98 2c de 20 64 69 72  | window...,. dir|
000013a0  73 70 72 69 74 65 25 20  31 31 3a 24 64 69 72 73  |sprite% 11:$dirs|
000013b0  70 72 69 74 65 25 3d 22  53 64 69 72 65 63 74 6f  |prite%="Sdirecto|
000013c0  72 79 22 0d 00 99 2e de  20 61 70 70 73 70 72 69  |ry"..... appspri|
000013d0  74 65 25 20 31 33 3a 24  61 70 70 73 70 72 69 74  |te% 13:$appsprit|
000013e0  65 25 3d 22 53 61 70 70  6c 69 63 61 74 69 6f 6e  |e%="Sapplication|
000013f0  22 0d 00 9a 2d de 20 64  61 74 61 73 70 72 69 74  |"...-. datasprit|
00001400  65 25 20 31 31 3a 24 64  61 74 61 73 70 72 69 74  |e% 11:$datasprit|
00001410  65 25 3d 22 53 66 69 6c  65 5f 78 78 78 22 0d 00  |e%="Sfile_xxx"..|
00001420  9b 04 0d 00 9c 1d f4 20  2d 2d 2d 2d 20 63 6f 6e  |....... ---- con|
00001430  66 69 67 75 72 61 74 69  6f 6e 20 2d 2d 2d 2d 0d  |figuration ----.|
00001440  00 9d 11 de 20 6f 70 74  69 6f 6e 73 25 28 36 29  |.... options%(6)|
00001450  0d 00 9e 25 e7 20 a4 69  66 74 68 65 72 65 28 a4  |...%. .ifthere(.|
00001460  63 6f 6e 66 69 67 6c 6f  61 64 66 69 6c 65 6e 61  |configloadfilena|
00001470  6d 65 29 20 8c 0d 00 9f  11 20 20 f2 6c 6f 61 64  |me) .....  .load|
00001480  63 6f 6e 66 69 67 0d 00  a0 05 cc 0d 00 a1 12 20  |config......... |
00001490  20 6f 70 74 69 6f 6e 73  25 28 29 3d 30 0d 00 a2  | options%()=0...|
000014a0  43 20 20 6f 70 74 69 6f  6e 73 25 28 35 29 3d 31  |C  options%(5)=1|
000014b0  3a f4 20 4f 6e 6c 79 20  65 78 74 72 61 63 74 20  |:. Only extract |
000014c0  6e 65 77 65 72 20 73 65  74 20 62 79 20 64 65 66  |newer set by def|
000014d0  61 75 6c 74 20 28 64 61  6e 67 65 72 6f 75 73 29  |ault (dangerous)|
000014e0  0d 00 a3 34 20 20 6f 70  74 69 6f 6e 73 25 28 36  |...4  options%(6|
000014f0  29 3d 31 3a f4 20 49 6d  61 67 65 73 20 61 73 20  |)=1:. Images as |
00001500  66 69 6c 65 73 20 73 65  74 20 62 79 20 64 65 66  |files set by def|
00001510  61 75 6c 74 0d 00 a4 11  20 20 64 69 73 70 74 69  |ault....  dispti|
00001520  6d 65 25 3d 33 0d 00 a5  35 20 20 62 65 65 70 66  |me%=3...5  beepf|
00001530  6c 61 67 25 3d 30 3a 6f  70 65 6e 66 6c 61 67 25  |lag%=0:openflag%|
00001540  3d 30 3a 75 6e 69 78 66  6c 61 67 25 3d 30 3a 73  |=0:unixflag%=0:s|
00001550  68 6f 77 70 61 6e 65 25  3d 31 0d 00 a6 05 cd 0d  |howpane%=1......|
00001560  00 a7 34 f2 74 69 63 6b  28 64 69 73 70 6d 65 6e  |..4.tick(dispmen|
00001570  75 25 2c 32 2c 31 29 3a  f4 20 64 65 66 61 75 6c  |u%,2,1):. defaul|
00001580  74 20 74 6f 20 6f 6c 64  20 73 6f 72 74 20 6f 72  |t to old sort or|
00001590  64 65 72 0d 00 a8 04 0d  00 a9 75 e7 20 a4 69 66  |der.......u. .if|
000015a0  74 68 65 72 65 28 22 3c  57 69 6d 70 24 53 63 72  |there("<Wimp$Scr|
000015b0  61 70 44 69 72 3e 2e 49  6e 66 6f 7a 69 70 22 29  |apDir>.Infozip")|
000015c0  20 8c 20 ff 22 25 57 69  70 65 20 3c 57 69 6d 70  | . ."%Wipe <Wimp|
000015d0  24 53 63 72 61 70 44 69  72 3e 2e 49 6e 66 6f 7a  |$ScrapDir>.Infoz|
000015e0  69 70 20 52 20 7e 43 20  7e 56 20 46 22 3a f4 20  |ip R ~C ~V F":. |
000015f0  69 6e 20 63 61 73 65 20  77 65 20 63 72 61 73 68  |in case we crash|
00001600  65 64 20 6c 61 73 74 20  74 69 6d 65 0d 00 aa 23  |ed last time...#|
00001610  ff 22 43 44 69 72 20 3c  57 69 6d 70 24 53 63 72  |."CDir <Wimp$Scr|
00001620  61 70 44 69 72 3e 2e 49  6e 66 6f 7a 69 70 22 0d  |apDir>.Infozip".|
00001630  00 ab 32 ff 22 53 65 74  20 49 6e 66 6f 53 63 72  |..2."Set InfoScr|
00001640  61 70 24 50 61 74 68 20  3c 57 69 6d 70 24 53 63  |ap$Path <Wimp$Sc|
00001650  72 61 70 44 69 72 3e 2e  49 6e 66 6f 7a 69 70 2e  |rapDir>.Infozip.|
00001660  22 0d 00 ac 30 e7 20 a9  28 65 6e 76 24 29 20 8c  |"...0. .(env$) .|
00001670  20 64 75 6d 25 3d a4 64  72 61 67 67 65 64 5f 69  | dum%=.dragged_i|
00001680  6e 28 62 61 72 25 2c 26  44 44 43 2c 65 6e 76 24  |n(bar%,&DDC,env$|
00001690  29 0d 00 ad 05 e1 0d 00  ae 05 3a 0d 00 af 18 dd  |).........:.....|
000016a0  20 a4 69 62 61 72 5f 77  69 64 74 68 28 74 65 78  | .ibar_width(tex|
000016b0  74 24 29 0d 00 b0 0c ea  20 77 69 64 74 68 25 0d  |t$)..... width%.|
000016c0  00 b1 1f 77 69 64 74 68  25 3d a4 73 74 72 69 6e  |...width%=.strin|
000016d0  67 6c 65 6e 67 74 68 28  74 65 78 74 24 29 0d 00  |glength(text$)..|
000016e0  b2 1b e7 20 77 69 64 74  68 25 3c 36 34 20 8c 20  |... width%<64 . |
000016f0  77 69 64 74 68 25 3d 36  34 0d 00 b3 0b 3d 77 69  |width%=64....=wi|
00001700  64 74 68 25 0d 00 b4 05  3a 0d 00 b5 20 dd 20 a4  |dth%....:... . .|
00001710  6f 6b 5f 74 6f 5f 6c 6f  61 64 5f 6e 65 77 5f 63  |ok_to_load_new_c|
00001720  6f 70 79 28 65 6e 76 24  29 0d 00 b6 12 ea 20 6e  |opy(env$)..... n|
00001730  25 2c 65 6e 64 25 2c 70  74 72 25 0d 00 b7 37 c8  |%,end%,ptr%...7.|
00001740  99 22 54 61 73 6b 4d 61  6e 61 67 65 72 5f 45 6e  |."TaskManager_En|
00001750  75 6d 65 72 61 74 65 54  61 73 6b 73 22 2c 30 2c  |umerateTasks",0,|
00001760  74 65 6d 70 25 2c 31 33  30 30 20 b8 20 2c 65 6e  |temp%,1300 . ,en|
00001770  64 25 0d 00 b8 4c f4 20  49 6e 73 74 72 75 63 74  |d%...L. Instruct|
00001780  20 74 68 65 20 54 61 73  6b 20 4d 61 6e 61 67 65  | the Task Manage|
00001790  72 20 74 6f 20 64 75 6d  70 20 61 20 6c 69 73 74  |r to dump a list|
000017a0  20 6f 66 20 61 6c 6c 20  63 75 72 72 65 6e 74 6c  | of all currentl|
000017b0  79 20 61 63 74 69 76 65  20 74 61 73 6b 73 0d 00  |y active tasks..|
000017c0  b9 2d f4 20 69 6e 74 6f  20 6f 75 72 20 62 75 66  |.-. into our buf|
000017d0  66 65 72 20 2d 20 31 36  20 62 79 74 65 73 20 74  |fer - 16 bytes t|
000017e0  6f 20 65 61 63 68 20 74  61 73 6b 0d 00 ba 0e 70  |o each task....p|
000017f0  74 72 25 3d 74 65 6d 70  25 0d 00 bb 21 f4 20 70  |tr%=temp%...!. p|
00001800  6f 69 6e 74 20 74 6f 20  73 74 61 72 74 20 6f 66  |oint to start of|
00001810  20 74 61 73 6b 20 6c 69  73 74 0d 00 bc 10 c8 95  | task list......|
00001820  20 70 74 72 25 3c 65 6e  64 25 0d 00 bd 25 20 20  | ptr%<end%...%  |
00001830  e7 20 a4 73 28 70 74 72  25 21 34 29 3d 70 24 20  |. .s(ptr%!4)=p$ |
00001840  8c 20 70 74 72 25 3d 65  6e 64 25 2b 31 30 30 0d  |. ptr%=end%+100.|
00001850  00 be 36 20 20 f4 20 6a  75 6d 70 20 6f 75 74 20  |..6  . jump out |
00001860  6f 66 20 6c 6f 6f 70 20  77 68 65 6e 20 77 65 20  |of loop when we |
00001870  66 69 6e 64 20 74 68 65  20 74 61 73 6b 20 77 65  |find the task we|
00001880  20 77 61 6e 74 0d 00 bf  3b 20 20 f4 20 74 68 65  | want...;  . the|
00001890  20 66 69 72 73 74 20 66  6f 75 72 20 62 79 74 65  | first four byte|
000018a0  73 20 6f 66 20 73 69 78  74 65 65 6e 20 61 72 65  |s of sixteen are|
000018b0  20 74 68 65 20 74 61 73  6b 20 68 61 6e 64 6c 65  | the task handle|
000018c0  0d 00 c0 36 20 20 f4 20  74 68 65 20 73 65 63 6f  |...6  . the seco|
000018d0  6e 64 20 66 6f 75 72 20  61 72 65 20 61 20 70 6f  |nd four are a po|
000018e0  69 6e 74 65 72 20 74 6f  20 74 68 65 20 74 61 73  |inter to the tas|
000018f0  6b 20 6e 61 6d 65 0d 00  c1 0e 20 20 70 74 72 25  |k name....  ptr%|
00001900  2b 3d 31 36 0d 00 c2 29  20 20 f4 20 65 78 61 6d  |+=16...)  . exam|
00001910  69 6e 65 20 6e 65 78 74  20 74 61 73 6b 20 2d 20  |ine next task - |
00001920  6e 65 78 74 20 31 36 20  62 79 74 65 73 0d 00 c3  |next 16 bytes...|
00001930  05 ce 0d 00 c4 04 0d 00  c5 53 e7 20 70 74 72 25  |.........S. ptr%|
00001940  3e 65 6e 64 25 2b 31 30  30 20 8c 20 70 61 72 61  |>end%+100 . para|
00001950  6d 31 24 3d 70 24 3a 70  61 72 61 6d 32 24 3d 22  |m1$=p$:param2$="|
00001960  22 3a f2 72 65 70 6f 72  74 28 a4 6d 65 73 73 61  |":.report(.messa|
00001970  67 65 5f 6c 6f 6f 6b 73  75 62 28 22 74 77 6f 22  |ge_looksub("two"|
00001980  29 2c 25 31 30 29 3a 3d  a3 0d 00 c6 33 f4 20 51  |),%10):=....3. Q|
00001990  75 69 74 20 70 72 6f 67  72 61 6d 20 6e 6f 77 20  |uit program now |
000019a0  69 66 20 61 20 63 6f 70  79 20 69 73 20 61 6c 72  |if a copy is alr|
000019b0  65 61 64 79 20 72 75 6e  6e 69 6e 67 0d 00 c7 06  |eady running....|
000019c0  3d b9 0d 00 c8 49 f4 20  69 66 20 77 65 20 64 69  |=....I. if we di|
000019d0  64 6e 27 74 20 6a 75 6d  70 20 6f 75 74 20 6f 66  |dn't jump out of|
000019e0  20 6c 6f 6f 70 2c 20 74  68 65 6e 20 6f 75 72 20  | loop, then our |
000019f0  74 61 73 6b 20 69 73 20  6e 6f 74 20 61 6c 72 65  |task is not alre|
00001a00  61 64 79 20 72 75 6e 6e  69 6e 67 0d 00 c9 04 0d  |ady running.....|
00001a10  00 ca 04 0d 00 cb 18 dd  20 a4 6c 6f 61 64 77 69  |........ .loadwi|
00001a20  6e 64 6f 77 28 6e 61 6d  65 24 29 0d 00 cc 0d ea  |ndow(name$).....|
00001a30  20 6e 25 2c 70 74 72 25  0d 00 cd 4c c8 99 22 57  | n%,ptr%...L.."W|
00001a40  69 6d 70 5f 4c 6f 61 64  54 65 6d 70 6c 61 74 65  |imp_LoadTemplate|
00001a50  22 2c 2c 74 65 6d 70 25  2c 69 6e 64 70 74 72 25  |",,temp%,indptr%|
00001a60  2c 21 6d 61 69 6e 69 6e  64 25 2b 31 34 35 30 2c  |,!mainind%+1450,|
00001a70  2d 31 2c 6e 61 6d 65 24  20 b8 20 2c 2c 69 6e 64  |-1,name$ . ,,ind|
00001a80  70 74 72 25 0d 00 ce 2b  f4 20 31 34 30 30 20 69  |ptr%...+. 1400 i|
00001a90  73 20 73 69 7a 65 20 6f  66 20 74 6f 74 61 6c 20  |s size of total |
00001aa0  69 6e 64 69 72 65 63 74  65 64 20 64 61 74 61 0d  |indirected data.|
00001ab0  00 cf 2a e7 20 6e 61 6d  65 24 3d 22 70 61 6e 65  |..*. name$="pane|
00001ac0  70 61 74 68 22 20 8c 20  74 65 6d 70 25 21 36 34  |path" . temp%!64|
00001ad0  3d 21 61 72 72 6f 77 73  25 0d 00 d0 2e f4 20 68  |=!arrows%..... h|
00001ae0  61 63 6b 20 2d 20 74 68  69 73 20 70 61 6e 65 20  |ack - this pane |
00001af0  75 73 65 73 20 61 20 75  73 65 72 20 73 70 72 69  |uses a user spri|
00001b00  74 65 20 61 72 65 61 0d  00 d1 25 c8 99 22 57 69  |te area...%.."Wi|
00001b10  6d 70 5f 43 72 65 61 74  65 57 69 6e 64 6f 77 22  |mp_CreateWindow"|
00001b20  2c 2c 74 65 6d 70 25 20  b8 20 6e 25 0d 00 d2 07  |,,temp% . n%....|
00001b30  3d 6e 25 0d 00 d3 05 3a  0d 00 d4 58 dd 20 a4 74  |=n%....:...X. .t|
00001b40  65 6d 70 6c 5f 69 63 6f  6e 28 77 68 61 6e 64 6c  |empl_icon(whandl|
00001b50  65 25 2c 6c 65 66 74 78  25 2c 62 6f 74 74 6f 6d  |e%,leftx%,bottom|
00001b60  79 25 2c 72 69 67 68 74  78 25 2c 74 6f 70 79 25  |y%,rightx%,topy%|
00001b70  2c 66 6c 61 67 73 25 2c  74 65 78 74 24 2c 70 74  |,flags%,text$,pt|
00001b80  72 31 25 2c 70 74 72 32  25 2c 70 74 72 33 25 29  |r1%,ptr2%,ptr3%)|
00001b90  0d 00 d5 0d ea 20 68 61  6e 64 6c 65 25 0d 00 d6  |..... handle%...|
00001ba0  14 21 62 6c 6f 63 6b 25  3d 77 68 61 6e 64 6c 65  |.!block%=whandle|
00001bb0  25 0d 00 d7 13 62 6c 6f  63 6b 25 21 34 3d 6c 65  |%....block%!4=le|
00001bc0  66 74 78 25 0d 00 d8 15  62 6c 6f 63 6b 25 21 38  |ftx%....block%!8|
00001bd0  3d 62 6f 74 74 6f 6d 79  25 0d 00 d9 15 62 6c 6f  |=bottomy%....blo|
00001be0  63 6b 25 21 31 32 3d 72  69 67 68 74 78 25 0d 00  |ck%!12=rightx%..|
00001bf0  da 13 62 6c 6f 63 6b 25  21 31 36 3d 74 6f 70 79  |..block%!16=topy|
00001c00  25 0d 00 db 14 62 6c 6f  63 6b 25 21 32 30 3d 66  |%....block%!20=f|
00001c10  6c 61 67 73 25 0d 00 dc  0f e7 20 70 74 72 31 25  |lags%..... ptr1%|
00001c20  3d 30 20 8c 0d 00 dd 16  24 28 62 6c 6f 63 6b 25  |=0 .....$(block%|
00001c30  2b 32 34 29 3d 74 65 78  74 24 0d 00 de 05 cc 0d  |+24)=text$......|
00001c40  00 df 13 62 6c 6f 63 6b  25 21 32 34 3d 70 74 72  |...block%!24=ptr|
00001c50  31 25 0d 00 e0 13 62 6c  6f 63 6b 25 21 32 38 3d  |1%....block%!28=|
00001c60  70 74 72 32 25 0d 00 e1  13 62 6c 6f 63 6b 25 21  |ptr2%....block%!|
00001c70  33 32 3d 70 74 72 33 25  0d 00 e2 05 cd 0d 00 e3  |32=ptr3%........|
00001c80  29 c8 99 22 57 69 6d 70  5f 43 72 65 61 74 65 49  |).."Wimp_CreateI|
00001c90  63 6f 6e 22 2c 2c 62 6c  6f 63 6b 25 20 b8 20 68  |con",,block% . h|
00001ca0  61 6e 64 6c 65 25 0d 00  e4 0c 3d 68 61 6e 64 6c  |andle%....=handl|
00001cb0  65 25 0d 00 e5 04 0d 00  e6 52 f4 20 2d 2d 2d 2d  |e%.......R. ----|
00001cc0  2d 2d 2d 2d 6d 65 6e 75  20 68 61 6e 64 6c 69 6e  |----menu handlin|
00001cd0  67 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |g---------------|
00001ce0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001d00  2d 2d 2d 2d 2d 2d 2d 2d  0d 00 e7 04 0d 00 e8 11  |--------........|
00001d10  dd 20 f2 6d 65 6e 75 73  5f 69 6e 69 74 0d 00 e9  |. .menus_init...|
00001d20  0a ea 20 70 74 72 25 0d  00 ea 0e 70 61 72 61 6d  |.. ptr%....param|
00001d30  31 24 3d 70 24 0d 00 eb  51 62 61 72 69 74 65 6d  |1$=p$...Qbaritem|
00001d40  73 25 3d 35 3a f4 20 67  6c 6f 62 61 6c 20 76 61  |s%=5:. global va|
00001d50  72 69 61 62 6c 65 20 75  73 65 64 20 74 6f 20 63  |riable used to c|
00001d60  61 6c 63 75 6c 61 74 65  20 6d 65 6e 75 20 68 65  |alculate menu he|
00001d70  69 67 68 74 20 66 6f 72  20 69 63 6f 6e 62 61 72  |ight for iconbar|
00001d80  20 63 6c 69 63 6b 0d 00  ec 4a 62 61 72 6d 65 6e  | click...Jbarmen|
00001d90  75 25 3d a4 6d 61 6b 65  6d 65 6e 75 28 a4 6d 65  |u%=.makemenu(.me|
00001da0  73 73 61 67 65 5f 6c 6f  6f 6b 73 75 62 28 22 62  |ssage_looksub("b|
00001db0  61 72 22 29 2c 62 61 72  69 74 65 6d 73 25 29 3a  |ar"),baritems%):|
00001dc0  f4 20 6d 61 6b 65 20 6d  61 69 6e 20 6d 65 6e 75  |. make main menu|
00001dd0  0d 00 ed 36 66 61 6b 65  66 69 6c 65 72 6d 65 6e  |...6fakefilermen|
00001de0  75 25 3d a4 6d 61 6b 65  6d 65 6e 75 28 a4 6d 65  |u%=.makemenu(.me|
00001df0  73 73 61 67 65 5f 6c 6f  6f 6b 73 75 62 28 22 66  |ssage_looksub("f|
00001e00  66 22 29 2c 38 29 0d 00  ee 32 66 69 6c 65 6d 65  |f"),8)...2fileme|
00001e10  6e 75 25 3d a4 6d 61 6b  65 6d 65 6e 75 28 a4 6d  |nu%=.makemenu(.m|
00001e20  65 73 73 61 67 65 5f 6c  6f 6f 6b 75 70 28 22 66  |essage_lookup("f|
00001e30  69 6c 65 22 29 2c 32 29  0d 00 ef 31 6f 70 74 73  |ile"),2)...1opts|
00001e40  6d 65 6e 75 25 3d a4 6d  61 6b 65 6d 65 6e 75 28  |menu%=.makemenu(|
00001e50  a4 6d 65 73 73 61 67 65  5f 6c 6f 6f 6b 75 70 28  |.message_lookup(|
00001e60  22 6f 70 74 22 29 2c 36  29 0d 00 f0 30 6e 65 77  |"opt"),6)...0new|
00001e70  6d 65 6e 75 25 3d a4 6d  61 6b 65 6d 65 6e 75 28  |menu%=.makemenu(|
00001e80  a4 6d 65 73 73 61 67 65  5f 6c 6f 6f 6b 75 70 28  |.message_lookup(|
00001e90  22 6e 65 77 22 29 2c 31  29 0d 00 f1 32 64 69 73  |"new"),1)...2dis|
00001ea0  70 6d 65 6e 75 25 3d a4  6d 61 6b 65 6d 65 6e 75  |pmenu%=.makemenu|
00001eb0  28 a4 6d 65 73 73 61 67  65 5f 6c 6f 6f 6b 75 70  |(.message_lookup|
00001ec0  28 22 64 69 73 70 22 29  2c 32 29 0d 00 f2 14 70  |("disp"),2)....p|
00001ed0  74 72 25 3d 6e 65 77 6d  65 6e 75 25 2b 32 38 0d  |tr%=newmenu%+28.|
00001ee0  00 f3 35 21 70 74 72 25  3d 25 31 30 30 30 30 31  |..5!ptr%=%100001|
00001ef0  30 30 3a f4 20 6d 65 6e  75 20 66 6c 61 67 73 3a  |00:. menu flags:|
00001f00  20 77 72 69 74 61 62 6c  65 2c 20 6c 61 73 74 20  | writable, last |
00001f10  69 74 65 6d 0d 00 f4 22  f2 75 70 64 61 74 65 6d  |item...".updatem|
00001f20  65 6e 75 74 65 78 74 28  6e 65 77 6d 65 6e 75 25  |enutext(newmenu%|
00001f30  2c 31 2c 22 22 29 0d 00  f5 29 21 28 a4 73 75 62  |,1,"")...)!(.sub|
00001f40  6d 65 6e 75 68 61 6e 64  6c 65 28 62 61 72 6d 65  |menuhandle(barme|
00001f50  6e 75 25 2c 31 29 2b 34  29 3d 69 6e 66 6f 25 0d  |nu%,1)+4)=info%.|
00001f60  00 f6 33 21 28 a4 73 75  62 6d 65 6e 75 68 61 6e  |..3!(.submenuhan|
00001f70  64 6c 65 28 66 61 6b 65  66 69 6c 65 72 6d 65 6e  |dle(fakefilermen|
00001f80  75 25 2c 35 29 2b 34 29  3d 6f 70 74 73 6d 65 6e  |u%,5)+4)=optsmen|
00001f90  75 25 0d 00 f7 29 70 74  72 25 3d a4 73 75 62 6d  |u%...)ptr%=.subm|
00001fa0  65 6e 75 68 61 6e 64 6c  65 28 66 61 6b 65 66 69  |enuhandle(fakefi|
00001fb0  6c 65 72 6d 65 6e 75 25  2c 35 29 0d 00 f8 3a 70  |lermenu%,5)...:p|
00001fc0  74 72 25 21 34 3d 6f 70  74 73 6d 65 6e 75 25 3a  |tr%!4=optsmenu%:|
00001fd0  21 70 74 72 25 3d 21 70  74 72 25 20 84 20 25 31  |!ptr%=!ptr% . %1|
00001fe0  30 30 30 3a f4 20 73 75  62 6d 65 6e 75 20 77 61  |000:. submenu wa|
00001ff0  72 6e 69 6e 67 0d 00 f9  04 0d 00 fa 23 70 74 72  |rning.......#ptr|
00002000  25 3d a4 73 75 62 6d 65  6e 75 68 61 6e 64 6c 65  |%=.submenuhandle|
00002010  28 62 61 72 6d 65 6e 75  25 2c 34 29 0d 00 fb 36  |(barmenu%,4)...6|
00002020  70 74 72 25 21 34 3d 73  61 76 65 25 3a 21 70 74  |ptr%!4=save%:!pt|
00002030  72 25 3d 21 70 74 72 25  20 84 20 25 31 30 30 30  |r%=!ptr% . %1000|
00002040  3a f4 20 73 75 62 6d 65  6e 75 20 77 61 72 6e 69  |:. submenu warni|
00002050  6e 67 0d 00 fc 32 21 28  a4 73 75 62 6d 65 6e 75  |ng...2!(.submenu|
00002060  68 61 6e 64 6c 65 28 66  61 6b 65 66 69 6c 65 72  |handle(fakefiler|
00002070  6d 65 6e 75 25 2c 36 29  2b 34 29 3d 6e 65 77 6d  |menu%,6)+4)=newm|
00002080  65 6e 75 25 0d 00 fd 33  21 28 a4 73 75 62 6d 65  |enu%...3!(.subme|
00002090  6e 75 68 61 6e 64 6c 65  28 66 61 6b 65 66 69 6c  |nuhandle(fakefil|
000020a0  65 72 6d 65 6e 75 25 2c  31 29 2b 34 29 3d 64 69  |ermenu%,1)+4)=di|
000020b0  73 70 6d 65 6e 75 25 0d  00 fe 33 21 28 a4 73 75  |spmenu%...3!(.su|
000020c0  62 6d 65 6e 75 68 61 6e  64 6c 65 28 66 61 6b 65  |bmenuhandle(fake|
000020d0  66 69 6c 65 72 6d 65 6e  75 25 2c 32 29 2b 34 29  |filermenu%,2)+4)|
000020e0  3d 66 69 6c 65 6d 65 6e  75 25 0d 00 ff 24 70 74  |=filemenu%...$pt|
000020f0  72 25 3d a4 73 75 62 6d  65 6e 75 68 61 6e 64 6c  |r%=.submenuhandl|
00002100  65 28 66 69 6c 65 6d 65  6e 75 25 2c 31 29 0d 01  |e(filemenu%,1)..|
00002110  00 36 70 74 72 25 21 34  3d 66 69 6c 65 25 3a 21  |.6ptr%!4=file%:!|
00002120  70 74 72 25 3d 21 70 74  72 25 20 84 20 25 31 30  |ptr%=!ptr% . %10|
00002130  30 30 3a f4 20 73 75 62  6d 65 6e 75 20 77 61 72  |00:. submenu war|
00002140  6e 69 6e 67 0d 01 01 1d  f4 20 70 6f 6b 65 20 69  |ning..... poke i|
00002150  6e 20 73 75 62 6d 65 6e  75 20 68 61 6e 64 6c 65  |n submenu handle|
00002160  73 0d 01 02 04 0d 01 03  05 e1 0d 01 04 05 3a 0d  |s.............:.|
00002170  01 05 1b dd 20 a4 6d 61  6b 65 6d 65 6e 75 28 74  |.... .makemenu(t|
00002180  65 78 74 24 2c 6e 75 6d  25 29 0d 01 06 24 ea 20  |ext$,num%)...$. |
00002190  6e 25 2c 6d 25 2c 6d 65  6e 75 25 2c 61 25 2c 62  |n%,m%,menu%,a%,b|
000021a0  24 2c 6d 61 78 25 2c 70  74 72 25 2c 78 25 0d 01  |$,max%,ptr%,x%..|
000021b0  07 16 de 20 6d 65 6e 75  25 20 32 38 2b 6e 75 6d  |... menu% 28+num|
000021c0  25 2a 32 34 0d 01 08 26  6e 25 3d a7 74 65 78 74  |%*24...&n%=.text|
000021d0  24 2c 22 7c 22 29 3a 24  6d 65 6e 75 25 3d c0 74  |$,"|"):$menu%=.t|
000021e0  65 78 74 24 2c 6e 25 2d  31 29 0d 01 09 19 6d 65  |ext$,n%-1)....me|
000021f0  6e 75 25 3f 31 32 3d 37  3a 6d 65 6e 75 25 3f 31  |nu%?12=7:menu%?1|
00002200  33 3d 32 0d 01 0a 19 6d  65 6e 75 25 3f 31 34 3d  |3=2....menu%?14=|
00002210  37 3a 6d 65 6e 75 25 3f  31 35 3d 30 0d 01 0b 1a  |7:menu%?15=0....|
00002220  6d 65 6e 75 25 21 32 30  3d 34 34 3a 6d 65 6e 75  |menu%!20=44:menu|
00002230  25 21 32 34 3d 30 0d 01  0c 10 70 74 72 25 3d 6d  |%!24=0....ptr%=m|
00002240  65 6e 75 25 2b 34 0d 01  0d 11 e3 20 78 25 3d 31  |enu%+4..... x%=1|
00002250  20 b8 20 6e 75 6d 25 0d  01 0e 20 20 20 70 74 72  | . num%...   ptr|
00002260  25 2b 3d 32 34 3a 21 70  74 72 25 3d 30 3a 70 74  |%+=24:!ptr%=0:pt|
00002270  72 25 21 34 3d 2d 31 0d  01 0f 0b 20 20 6e 25 2b  |r%!4=-1....  n%+|
00002280  3d 31 0d 01 10 17 20 20  6d 25 3d a7 74 65 78 74  |=1....  m%=.text|
00002290  24 2c 22 7c 22 2c 6e 25  29 0d 01 11 19 20 20 62  |$,"|",n%)....  b|
000022a0  24 3d c1 74 65 78 74 24  2c 6e 25 2c 6d 25 2d 6e  |$=.text$,n%,m%-n|
000022b0  25 29 0d 01 12 21 20 20  e7 20 28 6d 25 2d 6e 25  |%)...!  . (m%-n%|
000022c0  29 3e 6d 61 78 25 20 8c  20 6d 61 78 25 3d 6d 25  |)>max% . max%=m%|
000022d0  2d 6e 25 0d 01 13 12 20  20 e7 20 6d 25 2d 6e 25  |-n%....  . m%-n%|
000022e0  3e 31 31 20 8c 0d 01 14  16 20 20 20 20 de 20 61  |>11 .....    . a|
000022f0  25 20 28 6d 25 2d 6e 25  2b 31 29 0d 01 15 0e 20  |% (m%-n%+1).... |
00002300  20 20 20 24 61 25 3d 62  24 0d 01 16 17 20 20 20  |   $a%=b$....   |
00002310  20 70 74 72 25 21 38 3d  26 37 30 30 30 31 32 31  | ptr%!8=&7000121|
00002320  0d 01 17 12 20 20 20 20  70 74 72 25 21 31 32 3d  |....    ptr%!12=|
00002330  61 25 0d 01 18 11 20 20  20 20 70 74 72 25 21 31  |a%....    ptr%!1|
00002340  36 3d 30 0d 01 19 15 20  20 20 20 70 74 72 25 21  |6=0....    ptr%!|
00002350  32 30 3d 6d 25 2d 6e 25  0d 01 1a 23 20 20 20 20  |20=m%-n%...#    |
00002360  f4 20 6c 69 6b 65 20 69  6e 64 69 72 65 63 74 65  |. like indirecte|
00002370  64 20 74 65 78 74 20 69  63 6f 6e 0d 01 1b 07 20  |d text icon.... |
00002380  20 cc 0d 01 1c 17 20 20  20 20 70 74 72 25 21 38  | .....    ptr%!8|
00002390  3d 26 37 30 30 30 30 32  31 0d 01 1d 15 20 20 20  |=&7000021....   |
000023a0  20 24 28 70 74 72 25 2b  31 32 29 3d 62 24 0d 01  | $(ptr%+12)=b$..|
000023b0  1e 07 20 20 cd 0d 01 1f  0b 20 20 6e 25 3d 6d 25  |..  .....  n%=m%|
000023c0  0d 01 20 08 ed 20 78 25  0d 01 21 2f 21 70 74 72  |.. .. x%..!/!ptr|
000023d0  25 3d 31 3c 3c 37 3a f4  20 74 68 69 73 20 73 68  |%=1<<7:. this sh|
000023e0  6f 75 6c 64 20 70 6f 69  6e 74 20 74 6f 20 6c 61  |ould point to la|
000023f0  73 74 20 69 74 65 6d 0d  01 22 19 6d 65 6e 75 25  |st item..".menu%|
00002400  21 31 36 3d 28 6d 61 78  25 2a 31 36 29 2b 31 36  |!16=(max%*16)+16|
00002410  0d 01 23 0a 3d 6d 65 6e  75 25 0d 01 24 05 3a 0d  |..#.=menu%..$.:.|
00002420  01 25 46 dd 20 a4 73 75  62 6d 65 6e 75 68 61 6e  |.%F. .submenuhan|
00002430  64 6c 65 28 6d 65 6e 75  25 2c 6e 75 6d 25 29 3a  |dle(menu%,num%):|
00002440  f4 20 72 65 74 75 72 6e  73 20 73 74 61 72 74 20  |. returns start |
00002450  6f 66 20 69 74 65 6d 20  69 6e 20 6d 65 6e 75 20  |of item in menu |
00002460  62 6c 6f 63 6b 0d 01 26  19 3d 6d 65 6e 75 25 2b  |block..&.=menu%+|
00002470  32 38 2b 28 6e 75 6d 25  2d 31 29 2a 32 34 0d 01  |28+(num%-1)*24..|
00002480  27 04 0d 01 28 1d dd 20  f2 74 69 63 6b 28 6d 65  |'...(.. .tick(me|
00002490  6e 75 25 2c 6e 75 6d 25  2c 74 79 70 65 25 29 0d  |nu%,num%,type%).|
000024a0  01 29 1f f4 20 74 79 70  65 3a 20 32 3d 74 6f 67  |.).. type: 2=tog|
000024b0  67 6c 65 2c 31 3d 6f 6e  2c 30 3d 6f 66 66 0d 01  |gle,1=on,0=off..|
000024c0  2a 0a ea 20 70 74 72 25  0d 01 2b 23 70 74 72 25  |*.. ptr%..+#ptr%|
000024d0  3d a4 73 75 62 6d 65 6e  75 68 61 6e 64 6c 65 28  |=.submenuhandle(|
000024e0  6d 65 6e 75 25 2c 6e 75  6d 25 29 0d 01 2c 0e c8  |menu%,num%)..,..|
000024f0  8e 20 74 79 70 65 25 20  ca 0d 01 2d 1a 20 c9 20  |. type% ...-. . |
00002500  32 3a 21 70 74 72 25 3d  28 21 70 74 72 25 20 82  |2:!ptr%=(!ptr% .|
00002510  20 31 29 0d 01 2e 1a 20  c9 20 31 3a 21 70 74 72  | 1).... . 1:!ptr|
00002520  25 3d 28 21 70 74 72 25  20 84 20 31 29 0d 01 2f  |%=(!ptr% . 1)../|
00002530  1c 20 c9 20 30 3a 21 70  74 72 25 3d 28 21 70 74  |. . 0:!ptr%=(!pt|
00002540  72 25 20 80 20 ac 20 31  29 0d 01 30 05 cb 0d 01  |r% . . 1)..0....|
00002550  31 05 e1 0d 01 32 05 3a  0d 01 33 1a dd 20 a4 74  |1....2.:..3.. .t|
00002560  69 63 6b 65 64 28 6d 65  6e 75 25 2c 69 74 65 6d  |icked(menu%,item|
00002570  25 29 0d 01 34 08 ea 20  41 25 0d 01 35 20 41 25  |%)..4.. A%..5 A%|
00002580  3d 28 6d 65 6e 75 25 2b  32 38 29 2b 28 32 34 2a  |=(menu%+28)+(24*|
00002590  28 69 74 65 6d 25 2d 31  29 29 0d 01 36 0b 3d 21  |(item%-1))..6.=!|
000025a0  41 25 80 20 31 0d 01 37  05 3a 0d 01 38 23 dd 20  |A%. 1..7.:..8#. |
000025b0  f2 73 68 61 64 65 6d 65  6e 75 28 6d 65 6e 75 25  |.shademenu(menu%|
000025c0  2c 6e 75 6d 25 2c 73 74  61 74 65 25 29 0d 01 39  |,num%,state%)..9|
000025d0  0a ea 20 70 74 72 25 0d  01 3a 25 70 74 72 25 3d  |.. ptr%..:%ptr%=|
000025e0  a4 73 75 62 6d 65 6e 75  68 61 6e 64 6c 65 28 6d  |.submenuhandle(m|
000025f0  65 6e 75 25 2c 6e 75 6d  25 29 2b 38 0d 01 3b 1b  |enu%,num%)+8..;.|
00002600  21 70 74 72 25 3d 21 70  74 72 25 20 80 20 ac 20  |!ptr%=!ptr% . . |
00002610  28 31 3c 3c 32 32 29 0d  01 3c 24 f4 20 66 6f 72  |(1<<22)..<$. for|
00002620  63 65 20 62 69 74 20 32  32 20 28 67 72 65 79 65  |ce bit 22 (greye|
00002630  64 20 6f 75 74 29 20 74  6f 20 30 0d 01 3d 24 e7  |d out) to 0..=$.|
00002640  20 73 74 61 74 65 25 20  8c 20 21 70 74 72 25 3d  | state% . !ptr%=|
00002650  21 70 74 72 25 20 84 20  28 31 3c 3c 32 32 29 0d  |!ptr% . (1<<22).|
00002660  01 3e 23 f4 20 6e 6f 77  20 66 6f 72 63 65 20 69  |.>#. now force i|
00002670  74 20 74 6f 20 31 20 69  66 20 72 65 71 75 69 72  |t to 1 if requir|
00002680  65 64 0d 01 3f 05 e1 0d  01 40 04 0d 01 41 27 dd  |ed..?....@...A'.|
00002690  20 f2 75 70 64 61 74 65  6d 65 6e 75 74 65 78 74  | .updatemenutext|
000026a0  28 6d 65 6e 75 25 2c 6e  75 6d 25 2c 74 65 78 74  |(menu%,num%,text|
000026b0  24 29 0d 01 42 15 ea 20  70 74 72 25 2c 6e 25 2c  |$)..B.. ptr%,n%,|
000026c0  78 24 2c 6d 61 78 25 0d  01 43 08 6e 25 3d 31 0d  |x$,max%..C.n%=1.|
000026d0  01 44 1d 78 24 3d a4 73  28 6d 65 6e 75 25 29 3a  |.D.x$=.s(menu%):|
000026e0  f4 20 6d 65 6e 75 20 74  69 74 6c 65 0d 01 45 0e  |. menu title..E.|
000026f0  6d 61 78 25 3d a9 28 78  24 29 0d 01 46 05 f5 0d  |max%=.(x$)..F...|
00002700  01 47 23 20 20 70 74 72  25 3d a4 73 75 62 6d 65  |.G#  ptr%=.subme|
00002710  6e 75 68 61 6e 64 6c 65  28 6d 65 6e 75 25 2c 6e  |nuhandle(menu%,n|
00002720  25 29 0d 01 48 1d 20 20  e7 20 28 70 74 72 25 21  |%)..H.  . (ptr%!|
00002730  38 20 80 20 28 31 3c 3c  38 29 29 3d a3 20 8c 0d  |8 . (1<<8))=. ..|
00002740  01 49 24 20 20 20 20 e7  20 6e 25 3d 6e 75 6d 25  |.I$    . n%=num%|
00002750  20 8c 20 24 28 70 74 72  25 2b 31 32 29 3d 74 65  | . $(ptr%+12)=te|
00002760  78 74 24 0d 01 4a 15 20  20 20 20 78 24 3d 24 28  |xt$..J.    x$=$(|
00002770  70 74 72 25 2b 31 32 29  0d 01 4b 07 20 20 cc 0d  |ptr%+12)..K.  ..|
00002780  01 4c 13 20 20 20 20 e7  20 6e 25 3d 6e 75 6d 25  |.L.    . n%=num%|
00002790  20 8c 0d 01 4d 55 20 20  20 20 20 20 e7 20 70 74  | ...MU      . pt|
000027a0  72 25 21 32 30 3c a9 28  74 65 78 74 24 29 20 8c  |r%!20<.(text$) .|
000027b0  20 85 20 32 35 35 2c 22  54 65 78 74 20 74 6f 6f  | . 255,"Text too|
000027c0  20 6c 6f 6e 67 20 66 6f  72 20 6d 65 6e 75 20 69  | long for menu i|
000027d0  74 65 6d 22 20 8b 20 24  28 70 74 72 25 21 31 32  |tem" . $(ptr%!12|
000027e0  29 3d 74 65 78 74 24 0d  01 4e 09 20 20 20 20 cd  |)=text$..N.    .|
000027f0  0d 01 4f 15 20 20 20 20  78 24 3d 24 28 70 74 72  |..O.    x$=$(ptr|
00002800  25 21 31 32 29 0d 01 50  07 20 20 cd 0d 01 51 1f  |%!12)..P.  ...Q.|
00002810  20 20 e7 20 6d 61 78 25  3c a9 28 78 24 29 20 8c  |  . max%<.(x$) .|
00002820  20 6d 61 78 25 3d a9 28  78 24 29 0d 01 52 0b 20  | max%=.(x$)..R. |
00002830  20 6e 25 2b 3d 31 0d 01  53 14 fd 20 28 21 70 74  | n%+=1..S.. (!pt|
00002840  72 25 20 80 20 31 3c 3c  37 29 0d 01 54 17 6d 65  |r% . 1<<7)..T.me|
00002850  6e 75 25 21 31 36 3d 6d  61 78 25 2a 31 36 2b 31  |nu%!16=max%*16+1|
00002860  36 0d 01 55 05 e1 0d 01  56 05 3a 0d 01 57 22 dd  |6..U....V.:..W".|
00002870  20 f2 6d 65 6e 75 77 61  72 6e 69 6e 67 28 73 75  | .menuwarning(su|
00002880  62 6d 65 6e 75 25 2c 78  25 2c 79 25 29 0d 01 58  |bmenu%,x%,y%)..X|
00002890  11 c8 8e 20 73 75 62 6d  65 6e 75 25 20 ca 0d 01  |... submenu% ...|
000028a0  59 11 20 20 c9 20 6f 70  74 73 6d 65 6e 75 25 0d  |Y.  . optsmenu%.|
000028b0  01 5a 16 20 20 20 20 f2  73 65 74 75 70 6f 70 74  |.Z.    .setupopt|
000028c0  73 6d 65 6e 75 0d 01 5b  2e 20 20 20 20 c8 99 22  |smenu..[.    .."|
000028d0  57 69 6d 70 5f 43 72 65  61 74 65 53 75 62 4d 65  |Wimp_CreateSubMe|
000028e0  6e 75 22 2c 2c 73 75 62  6d 65 6e 75 25 2c 78 25  |nu",,submenu%,x%|
000028f0  2c 79 25 0d 01 5c 0d 20  20 c9 20 66 69 6c 65 25  |,y%..\.  . file%|
00002900  0d 01 5d 11 20 20 20 20  f2 66 69 6c 65 69 6e 66  |..].    .fileinf|
00002910  6f 0d 01 5e 2e 20 20 20  20 c8 99 22 57 69 6d 70  |o..^.    .."Wimp|
00002920  5f 43 72 65 61 74 65 53  75 62 4d 65 6e 75 22 2c  |_CreateSubMenu",|
00002930  2c 73 75 62 6d 65 6e 75  25 2c 78 25 2c 79 25 0d  |,submenu%,x%,y%.|
00002940  01 5f 0d 20 20 c9 20 73  61 76 65 25 0d 01 60 2e  |._.  . save%..`.|
00002950  20 20 20 20 c8 99 22 57  69 6d 70 5f 43 72 65 61  |    .."Wimp_Crea|
00002960  74 65 53 75 62 4d 65 6e  75 22 2c 2c 73 75 62 6d  |teSubMenu",,subm|
00002970  65 6e 75 25 2c 78 25 2c  79 25 0d 01 61 15 20 20  |enu%,x%,y%..a.  |
00002980  20 20 f2 63 72 65 61 74  65 6e 65 77 28 a3 29 0d  |  .createnew(.).|
00002990  01 62 05 cb 0d 01 63 04  0d 01 64 04 0d 01 65 05  |.b....c...d...e.|
000029a0  e1 0d 01 66 05 3a 0d 01  67 23 dd 20 f2 75 70 64  |...f.:..g#. .upd|
000029b0  61 74 65 66 69 6c 65 72  6d 65 6e 75 28 66 69 6c  |atefilermenu(fil|
000029c0  65 24 2c 69 63 6f 6e 24  29 0d 01 68 13 20 20 ea  |e$,icon$)..h.  .|
000029d0  20 61 24 2c 62 24 2c 6e  25 2c 6d 25 0d 01 69 12  | a$,b$,n%,m%..i.|
000029e0  20 20 c8 8e 20 6c 65 76  65 6c 73 25 20 ca 0d 01  |  .. levels% ...|
000029f0  6a 49 20 20 20 20 c9 20  30 3a f2 73 68 61 64 65  |jI    . 0:.shade|
00002a00  6d 65 6e 75 28 66 61 6b  65 66 69 6c 65 72 6d 65  |menu(fakefilerme|
00002a10  6e 75 25 2c 37 2c 31 29  3a f2 73 68 61 64 65 6d  |nu%,7,1):.shadem|
00002a20  65 6e 75 28 66 61 6b 65  66 69 6c 65 72 6d 65 6e  |enu(fakefilermen|
00002a30  75 25 2c 38 2c 31 29 0d  01 6b 47 20 20 20 20 7f  |u%,8,1)..kG    .|
00002a40  3a f2 73 68 61 64 65 6d  65 6e 75 28 66 61 6b 65  |:.shademenu(fake|
00002a50  66 69 6c 65 72 6d 65 6e  75 25 2c 37 2c 30 29 3a  |filermenu%,7,0):|
00002a60  f2 73 68 61 64 65 6d 65  6e 75 28 66 61 6b 65 66  |.shademenu(fakef|
00002a70  69 6c 65 72 6d 65 6e 75  25 2c 38 2c 30 29 0d 01  |ilermenu%,8,0)..|
00002a80  6c 3e 20 20 20 20 f4 20  27 4f 70 65 6e 20 70 61  |l>    . 'Open pa|
00002a90  72 65 6e 74 27 2f 27 54  6f 70 20 64 69 72 65 63  |rent'/'Top direc|
00002aa0  74 6f 72 79 27 20 6e 6f  74 20 76 61 6c 69 64 20  |tory' not valid |
00002ab0  6f 6e 20 74 6f 70 20 6c  65 76 65 6c 0d 01 6d 07  |on top level..m.|
00002ac0  20 20 cb 0d 01 6e 13 20  20 e7 20 66 69 6c 65 24  |  ...n.  . file$|
00002ad0  3c 3e 22 22 20 8c 0d 01  6f 26 20 20 20 20 f2 73  |<>"" ...o&    .s|
00002ae0  68 61 64 65 6d 65 6e 75  28 66 61 6b 65 66 69 6c  |hademenu(fakefil|
00002af0  65 72 6d 65 6e 75 25 2c  32 2c 30 29 0d 01 70 28  |ermenu%,2,0)..p(|
00002b00  20 20 20 20 24 73 70 72  69 74 65 6e 61 6d 65 25  |    $spritename%|
00002b10  3d 69 63 6f 6e 24 3a f4  20 75 70 64 61 74 65 20  |=icon$:. update |
00002b20  69 63 6f 6e 0d 01 71 4f  20 20 20 20 f4 20 49 46  |icon..qO    . IF|
00002b30  20 52 49 47 48 54 24 28  66 69 6c 65 24 29 3d 22  | RIGHT$(file$)="|
00002b40  2f 22 20 54 48 45 4e 20  66 69 6c 65 24 3d 4c 45  |/" THEN file$=LE|
00002b50  46 54 24 28 66 69 6c 65  24 29 3a 52 45 4d 20 63  |FT$(file$):REM c|
00002b60  6c 69 70 20 64 69 72 65  63 74 6f 72 79 20 6e 61  |lip directory na|
00002b70  6d 65 73 0d 01 72 06 20  cc 0d 01 73 26 20 20 20  |mes..r. ...s&   |
00002b80  20 f2 73 68 61 64 65 6d  65 6e 75 28 66 61 6b 65  | .shademenu(fake|
00002b90  66 69 6c 65 72 6d 65 6e  75 25 2c 32 2c 31 29 0d  |filermenu%,2,1).|
00002ba0  01 74 07 20 20 cd 0d 01  75 04 0d 01 76 1c 20 20  |.t.  ...u...v.  |
00002bb0  62 24 3d c0 63 6f 6d 6d  6f 6e 70 61 74 68 24 29  |b$=.commonpath$)|
00002bc0  2b 66 69 6c 65 24 0d 01  77 3c 20 20 e7 20 a9 28  |+file$..w<  . .(|
00002bd0  62 24 29 3e 33 35 20 8c  20 62 24 3d c2 62 24 2c  |b$)>35 . b$=.b$,|
00002be0  33 35 29 3a f4 20 73 69  7a 65 20 6f 66 20 69 63  |35):. size of ic|
00002bf0  6f 6e 20 69 6e 64 69 72  65 63 74 65 64 20 64 61  |on indirected da|
00002c00  74 61 0d 01 78 4d 20 20  f2 49 63 6f 6e 53 74 61  |ta..xM  .IconSta|
00002c10  74 65 28 66 69 6c 65 25  2c 34 2c 33 2c a4 73 74  |te(file%,4,3,.st|
00002c20  72 69 6e 67 6c 65 6e 67  74 68 28 62 24 29 3c 34  |ringlength(b$)<4|
00002c30  33 36 29 3a f4 20 77 69  64 74 68 20 6f 66 20 69  |36):. width of i|
00002c40  63 6f 6e 20 69 6e 20 4f  53 20 75 6e 69 74 73 0d  |con in OS units.|
00002c50  01 79 43 20 20 f4 20 63  65 6e 74 72 65 2d 61 6c  |.yC  . centre-al|
00002c60  69 67 6e 20 28 66 6c 61  67 20 62 69 74 20 33 29  |ign (flag bit 3)|
00002c70  20 73 68 6f 72 74 20 74  65 78 74 2c 20 72 69 67  | short text, rig|
00002c80  68 74 2d 61 6c 69 67 6e  20 6c 6f 6e 67 20 74 65  |ht-align long te|
00002c90  78 74 0d 01 7a 1e 20 20  f2 73 65 74 69 63 6f 6e  |xt..z.  .seticon|
00002ca0  74 65 78 74 28 66 69 6c  65 25 2c 34 2c 62 24 29  |text(file%,4,b$)|
00002cb0  0d 01 7b 04 0d 01 7c 20  f4 20 2a 2a 20 6d 61 6b  |..{...| . ** mak|
00002cc0  65 20 64 61 74 61 20 66  69 74 20 77 69 6e 64 6f  |e data fit windo|
00002cd0  77 20 2a 2a 0d 01 7d 04  0d 01 7e 3d 20 20 f4 20  |w **..}...~=  . |
00002ce0  64 6f 6e 27 74 20 67 65  74 20 66 69 6c 65 73 69  |don't get filesi|
00002cf0  7a 65 2c 20 64 61 74 65  20 65 74 63 20 79 65 74  |ze, date etc yet|
00002d00  20 2d 20 73 65 61 72 63  68 20 69 73 20 74 6f 6f  | - search is too|
00002d10  20 73 6c 6f 77 0d 01 7f  0f 20 20 6e 25 3d 33 3a  | slow....  n%=3:|
00002d20  6d 25 3d 34 0d 01 80 0e  20 20 e7 20 61 6c 6c 25  |m%=4....  . all%|
00002d30  20 8c 0d 01 81 42 20 20  20 20 f2 75 70 64 61 74  | ....B    .updat|
00002d40  65 6d 65 6e 75 74 65 78  74 28 66 61 6b 65 66 69  |emenutext(fakefi|
00002d50  6c 65 72 6d 65 6e 75 25  2c 32 2c a4 6d 65 73 73  |lermenu%,2,.mess|
00002d60  61 67 65 5f 6c 6f 6f 6b  75 70 28 22 66 61 6b 65  |age_lookup("fake|
00002d70  53 22 29 29 0d 01 82 26  20 20 20 20 f2 73 68 61  |S"))...&    .sha|
00002d80  64 65 6d 65 6e 75 28 66  61 6b 65 66 69 6c 65 72  |demenu(fakefiler|
00002d90  6d 65 6e 75 25 2c 32 2c  31 29 0d 01 83 10 20 20  |menu%,2,1)....  |
00002da0  20 20 c8 94 20 6e 25 2c  6d 25 0d 01 84 07 20 20  |  .. n%,m%....  |
00002db0  cc 0d 01 85 3a 20 20 20  20 61 24 3d a4 6d 65 73  |....:    a$=.mes|
00002dc0  73 61 67 65 5f 6c 6f 6f  6b 75 70 28 22 66 61 6b  |sage_lookup("fak|
00002dd0  65 22 2b c0 69 63 6f 6e  24 2c 31 29 29 2b 22 27  |e"+.icon$,1))+"'|
00002de0  22 2b 66 69 6c 65 24 2b  22 27 22 0d 01 86 2d 20  |"+file$+"'"...- |
00002df0  20 20 20 f4 20 75 73 65  20 27 46 69 6c 65 27 2c  |   . use 'File',|
00002e00  20 27 44 69 72 27 2c 20  65 74 63 2e 20 61 73 20  | 'Dir', etc. as |
00002e10  72 65 71 75 69 72 65 64  0d 01 87 33 20 20 20 20  |required...3    |
00002e20  e7 20 a9 28 61 24 29 3e  32 38 20 8c 20 61 24 3d  |. .(a$)>28 . a$=|
00002e30  c0 61 24 2c 32 34 29 2b  a4 64 6f 74 73 28 6e 6f  |.a$,24)+.dots(no|
00002e40  74 66 6f 6e 74 25 29 2b  22 27 22 0d 01 88 4b 20  |tfont%)+"'"...K |
00002e50  20 20 20 f4 20 54 68 69  73 20 6d 65 6e 75 20 77  |   . This menu w|
00002e60  61 73 20 6f 72 69 67 69  6e 61 6c 6c 79 20 64 69  |as originally di|
00002e70  6d 65 6e 73 69 6f 6e 65  64 20 74 6f 20 61 6c 6c  |mensioned to all|
00002e80  6f 77 20 66 6f 72 20 61  20 32 38 2d 63 68 61 72  |ow for a 28-char|
00002e90  20 65 6e 74 72 79 0d 01  89 2c 20 20 20 20 f2 75  | entry...,    .u|
00002ea0  70 64 61 74 65 6d 65 6e  75 74 65 78 74 28 66 61  |pdatemenutext(fa|
00002eb0  6b 65 66 69 6c 65 72 6d  65 6e 75 25 2c 32 2c 61  |kefilermenu%,2,a|
00002ec0  24 29 0d 01 8a 07 20 20  cd 0d 01 8b 24 20 20 f4  |$)....  ....$  .|
00002ed0  20 73 77 61 70 20 67 72  65 79 65 64 2d 6f 75 74  | swap greyed-out|
00002ee0  20 65 6e 74 72 69 65 73  20 6f 76 65 72 0d 01 8c  | entries over...|
00002ef0  25 20 20 f2 73 68 61 64  65 6d 65 6e 75 28 66 61  |%  .shademenu(fa|
00002f00  6b 65 66 69 6c 65 72 6d  65 6e 75 25 2c 6e 25 2c  |kefilermenu%,n%,|
00002f10  30 29 0d 01 8d 25 20 20  f2 73 68 61 64 65 6d 65  |0)...%  .shademe|
00002f20  6e 75 28 66 61 6b 65 66  69 6c 65 72 6d 65 6e 75  |nu(fakefilermenu|
00002f30  25 2c 6d 25 2c 31 29 0d  01 8e 05 e1 0d 01 8f 05  |%,m%,1).........|
00002f40  3a 0d 01 90 19 dd 20 f2  4d 45 4e 55 63 6c 69 63  |:..... .MENUclic|
00002f50  6b 28 77 69 6e 64 6f 77  25 29 0d 01 91 14 ea 20  |k(window%)..... |
00002f60  79 25 2c 78 25 2c 61 25  2c 69 63 6f 6e 25 0d 01  |y%,x%,a%,icon%..|
00002f70  92 23 79 25 3d 28 62 6c  6f 63 6b 25 21 34 29 2b  |.#y%=(block%!4)+|
00002f80  31 36 3a 78 25 3d 21 62  6c 6f 63 6b 25 2d 31 35  |16:x%=!block%-15|
00002f90  36 0d 01 93 10 c8 8e 20  77 69 6e 64 6f 77 25 20  |6...... window% |
00002fa0  ca 0d 01 94 39 20 20 c9  20 62 61 72 25 3a 79 25  |....9  . bar%:y%|
00002fb0  3d 39 36 2b 62 61 72 69  74 65 6d 73 25 2a 34 34  |=96+baritems%*44|
00002fc0  3a 78 25 3d 21 62 6c 6f  63 6b 25 2d 36 34 3a 61  |:x%=!block%-64:a|
00002fd0  25 3d 62 61 72 6d 65 6e  75 25 0d 01 95 24 20 20  |%=barmenu%...$  |
00002fe0  c9 20 66 61 6b 65 66 69  6c 65 72 25 3a 61 25 3d  |. fakefiler%:a%=|
00002ff0  66 61 6b 65 66 69 6c 65  72 6d 65 6e 75 25 0d 01  |fakefilermenu%..|
00003000  96 2f 20 20 20 20 69 63  6f 6e 25 3d a4 77 68 69  |./    icon%=.whi|
00003010  63 68 66 61 6b 65 69 63  6f 6e 28 62 6c 6f 63 6b  |chfakeicon(block|
00003020  25 21 30 2c 62 6c 6f 63  6b 25 21 34 29 0d 01 97  |%!0,block%!4)...|
00003030  14 20 20 20 20 e7 20 69  63 6f 6e 25 3e 2d 31 20  |.    . icon%>-1 |
00003040  8c 0d 01 98 4d 20 20 20  20 20 20 f2 75 70 64 61  |....M      .upda|
00003050  74 65 66 69 6c 65 72 6d  65 6e 75 28 a4 67 65 74  |tefilermenu(.get|
00003060  66 61 6b 65 6c 65 61 66  6e 61 6d 65 28 69 63 6f  |fakeleafname(ico|
00003070  6e 25 2c b9 29 2c a4 77  68 69 63 68 66 61 6b 65  |n%,.),.whichfake|
00003080  73 70 72 69 74 65 28 69  63 6f 6e 25 29 29 0d 01  |sprite(icon%))..|
00003090  99 2a 20 20 20 20 20 20  77 73 61 76 65 77 25 3d  |.*      wsavew%=|
000030a0  77 69 6e 64 6f 77 25 3a  77 73 61 76 65 64 72 61  |window%:wsavedra|
000030b0  67 25 3d 69 63 6f 6e 25  0d 01 9a 09 20 20 20 20  |g%=icon%....    |
000030c0  cc 0d 01 9b 21 20 20 20  20 20 20 f2 75 70 64 61  |....!      .upda|
000030d0  74 65 66 69 6c 65 72 6d  65 6e 75 28 22 22 2c 22  |tefilermenu("","|
000030e0  22 29 0d 01 9c 09 20 20  20 20 cd 0d 01 9d 17 20  |")....    ..... |
000030f0  20 20 20 6d 65 6e 75 69  63 6f 6e 25 3d 69 63 6f  |   menuicon%=ico|
00003100  6e 25 0d 01 9e 05 cb 0d  01 9f 30 e7 20 61 25 3d  |n%........0. a%=|
00003110  30 20 8c 20 e1 3a f4 20  6e 6f 20 6d 65 6e 75 20  |0 . .:. no menu |
00003120  74 6f 20 6f 70 65 6e 20  69 6e 20 74 68 69 73 20  |to open in this |
00003130  63 6f 6e 74 65 78 74 0d  01 a0 21 c8 99 22 57 69  |context...!.."Wi|
00003140  6d 70 5f 43 72 65 61 74  65 4d 65 6e 75 22 2c 2c  |mp_CreateMenu",,|
00003150  61 25 2c 78 25 2c 79 25  0d 01 a1 16 6c 61 73 74  |a%,x%,y%....last|
00003160  6d 65 6e 75 6f 70 65 6e  65 64 25 3d 61 25 0d 01  |menuopened%=a%..|
00003170  a2 05 e1 0d 01 a3 04 0d  01 a4 14 dd 20 f2 6d 65  |............ .me|
00003180  6e 75 73 65 6c 65 63 74  69 6f 6e 0d 01 a5 20 ea  |nuselection... .|
00003190  20 6e 25 2c 6d 65 6e 75  73 65 6c 25 2c 61 24 2c  | n%,menusel%,a$,|
000031a0  6d 65 6e 75 25 2c 69 74  65 6d 25 0d 01 a6 45 6d  |menu%,item%...Em|
000031b0  65 6e 75 73 65 6c 25 3d  74 65 6d 70 25 2b 32 35  |enusel%=temp%+25|
000031c0  36 2b 36 34 3a f4 20 61  62 6f 76 65 20 73 63 72  |6+64:. above scr|
000031d0  61 74 63 68 20 73 70 61  63 65 20 61 6e 64 20 6f  |atch space and o|
000031e0  70 65 6e 77 69 6e 64 6f  77 20 62 75 66 66 65 72  |penwindow buffer|
000031f0  0d 01 a7 1e 6d 65 6e 75  73 65 6c 25 21 34 3d 6c  |....menusel%!4=l|
00003200  61 73 74 6d 65 6e 75 6f  70 65 6e 65 64 25 0d 01  |astmenuopened%..|
00003210  a8 15 c8 95 28 62 6c 6f  63 6b 25 21 6e 25 3c 3e  |....(block%!n%<>|
00003220  2d 31 29 0d 01 a9 15 20  20 69 74 65 6d 25 3d 62  |-1)....  item%=b|
00003230  6c 6f 63 6b 25 21 6e 25  0d 01 aa 31 20 20 6d 65  |lock%!n%...1  me|
00003240  6e 75 73 65 6c 25 3d a4  73 75 62 6d 65 6e 75 68  |nusel%=.submenuh|
00003250  61 6e 64 6c 65 28 6d 65  6e 75 73 65 6c 25 21 34  |andle(menusel%!4|
00003260  2c 69 74 65 6d 25 2b 31  29 0d 01 ab 39 20 20 f4  |,item%+1)...9  .|
00003270  20 65 61 63 68 20 6d 65  6e 75 20 69 74 65 6d 20  | each menu item |
00003280  68 6f 6c 64 73 20 73 75  62 6d 65 6e 75 20 28 6f  |holds submenu (o|
00003290  72 20 2d 31 29 20 61 74  20 6f 66 66 73 65 74 20  |r -1) at offset |
000032a0  2b 34 0d 01 ac 41 20 20  f4 20 46 4e 73 75 62 6d  |+4...A  . FNsubm|
000032b0  65 6e 75 68 61 6e 64 6c  65 20 63 6f 75 6e 74 73  |enuhandle counts|
000032c0  20 74 6f 70 20 69 74 65  6d 20 61 73 20 31 2c 20  | top item as 1, |
000032d0  57 49 4d 50 20 63 6f 75  6e 74 73 20 69 74 20 61  |WIMP counts it a|
000032e0  73 20 30 0d 01 ad 0b 20  20 6e 25 2b 3d 34 0d 01  |s 0....  n%+=4..|
000032f0  ae 05 ce 0d 01 af 3d 6d  65 6e 75 25 3d 6d 65 6e  |......=menu%=men|
00003300  75 73 65 6c 25 2d 32 38  2d 32 34 2a 69 74 65 6d  |usel%-28-24*item|
00003310  25 3a f4 20 72 65 76 65  72 73 65 20 6c 61 73 74  |%:. reverse last|
00003320  20 46 4e 73 75 62 6d 65  6e 75 68 61 6e 64 6c 65  | FNsubmenuhandle|
00003330  0d 01 b0 0c 69 74 65 6d  25 2b 3d 31 0d 01 b1 04  |....item%+=1....|
00003340  0d 01 b2 0e c8 8e 20 6d  65 6e 75 25 20 ca 0d 01  |...... menu% ...|
00003350  b3 25 20 20 c9 20 6e 65  77 6d 65 6e 75 25 3a f2  |.%  . newmenu%:.|
00003360  6e 65 77 64 69 72 28 a4  6e 65 77 64 69 72 6e 61  |newdir(.newdirna|
00003370  6d 65 29 0d 01 b4 1b 20  20 c9 20 62 61 72 6d 65  |me)....  . barme|
00003380  6e 75 25 3a c8 8e 20 69  74 65 6d 25 20 ca 0d 01  |nu%:.. item% ...|
00003390  b5 19 20 20 20 20 20 20  c9 20 33 3a f2 6f 70 65  |..      . 3:.ope|
000033a0  6e 63 6f 6e 66 69 67 0d  01 b6 2e 20 20 20 20 20  |nconfig....     |
000033b0  20 c9 20 32 3a ff 22 46  69 6c 65 72 5f 52 75 6e  | . 2:."Filer_Run|
000033c0  20 3c 49 6e 66 6f 7a 69  70 24 44 69 72 3e 2e 21  | <Infozip$Dir>.!|
000033d0  48 65 6c 70 22 0d 01 b7  13 20 20 20 20 20 20 c9  |Help"....      .|
000033e0  20 35 3a f2 71 75 69 74  0d 01 b8 09 20 20 20 20  | 5:.quit....    |
000033f0  cb 0d 01 b9 12 20 20 c9  20 64 69 73 70 6d 65 6e  |.....  . dispmen|
00003400  75 25 3a 0d 01 ba 1f 20  20 20 20 20 20 20 f2 74  |u%:....       .t|
00003410  69 63 6b 28 6d 65 6e 75  25 2c 69 74 65 6d 25 2c  |ick(menu%,item%,|
00003420  31 29 0d 01 bb 40 20 20  20 20 20 20 20 f2 74 69  |1)...@       .ti|
00003430  63 6b 28 6d 65 6e 75 25  2c a4 6c 6f 6f 70 65 64  |ck(menu%,.looped|
00003440  28 69 74 65 6d 25 2b 31  2c 32 29 2c 30 29 3a f4  |(item%+1,2),0):.|
00003450  20 75 6e 74 69 63 6b 20  6f 74 68 65 72 20 69 74  | untick other it|
00003460  65 6d 0d 01 bc 20 20 20  20 20 20 20 20 f2 66 61  |em...        .fa|
00003470  6b 65 66 69 6c 65 72 77  69 6e 64 6f 77 28 b9 2c  |kefilerwindow(.,|
00003480  a3 29 0d 01 bd 3d 20 20  20 20 20 20 20 f2 66 6f  |.)...=       .fo|
00003490  72 63 65 72 65 64 72 61  77 28 66 61 6b 65 66 69  |rceredraw(fakefi|
000034a0  6c 65 72 25 29 3a f4 20  72 65 64 72 61 77 20 62  |ler%):. redraw b|
000034b0  79 74 20 64 6f 6e 27 74  20 72 65 6f 70 65 6e 0d  |yt don't reopen.|
000034c0  01 be 21 20 20 c9 20 66  61 6b 65 66 69 6c 65 72  |..!  . fakefiler|
000034d0  6d 65 6e 75 25 3a c8 8e  20 69 74 65 6d 25 20 ca  |menu%:.. item% .|
000034e0  0d 01 bf 38 20 20 20 20  20 20 c9 20 33 3a f2 74  |...8      . 3:.t|
000034f0  6f 67 67 6c 65 73 65 6c  65 63 74 28 31 29 3a f4  |oggleselect(1):.|
00003500  20 61 6c 6c 25 20 6d 75  73 74 20 62 65 20 31 20  | all% must be 1 |
00003510  6e 6f 74 20 54 52 55 45  0d 01 c0 1e 20 20 20 20  |not TRUE....    |
00003520  20 20 c9 20 34 3a f2 74  6f 67 67 6c 65 73 65 6c  |  . 4:.togglesel|
00003530  65 63 74 28 a3 29 0d 01  c1 27 20 20 20 20 20 20  |ect(.)...'      |
00003540  c9 20 37 3a 6c 65 76 65  6c 73 25 3d a4 75 70 6c  |. 7:levels%=.upl|
00003550  65 76 65 6c 28 6c 65 76  65 6c 73 25 29 0d 01 c2  |evel(levels%)...|
00003560  21 20 20 20 20 20 20 c9  20 38 3a 6c 65 76 65 6c  |!      . 8:level|
00003570  73 25 3d a4 75 70 6c 65  76 65 6c 28 31 29 0d 01  |s%=.uplevel(1)..|
00003580  c3 09 20 20 20 20 cb 0d  01 c4 1f 20 20 20 20 c9  |..    .....    .|
00003590  20 66 69 6c 65 6d 65 6e  75 25 3a e7 20 69 74 65  | filemenu%:. ite|
000035a0  6d 25 3d 32 20 8c 0d 01  c5 1b 20 20 20 20 20 20  |m%=2 .....      |
000035b0  20 20 20 20 20 e7 20 63  68 69 6c 64 25 3d 30 20  |     . child%=0 |
000035c0  8c 0d 01 c6 1e 20 20 20  20 20 20 20 20 20 20 20  |.....           |
000035d0  20 20 61 63 74 69 6f 6e  24 3d 22 7a 69 70 22 0d  |  action$="zip".|
000035e0  01 c7 44 20 20 20 20 20  20 20 20 20 20 20 20 20  |..D             |
000035f0  e7 20 61 6c 6c 25 20 8c  20 61 24 3d 22 61 6c 6c  |. all% . a$="all|
00003600  22 20 8b 20 61 24 3d a4  77 68 69 63 68 66 61 6b  |" . a$=.whichfak|
00003610  65 73 70 72 69 74 65 28  77 73 61 76 65 64 72 61  |esprite(wsavedra|
00003620  67 25 29 0d 01 c8 1f 20  20 20 20 20 20 20 20 20  |g%)....         |
00003630  20 20 20 20 77 61 69 74  24 3d 22 64 65 6c 65 74  |    wait$="delet|
00003640  65 22 0d 01 c9 47 20 20  20 20 20 20 20 20 20 20  |e"...G          |
00003650  20 20 20 6e 6f 74 7a 69  70 70 65 64 24 3d c0 63  |   notzipped$=.c|
00003660  6f 6d 6d 6f 6e 70 61 74  68 24 29 2b a4 73 61 76  |ommonpath$)+.sav|
00003670  65 74 65 78 74 28 77 73  61 76 65 77 25 2c 77 73  |etext(wsavew%,ws|
00003680  61 76 65 64 72 61 67 25  29 0d 01 ca 3a 20 20 20  |avedrag%)...:   |
00003690  20 20 20 20 20 20 20 20  20 20 63 68 69 6c 64 25  |          child%|
000036a0  3d a4 63 68 69 6c 64 74  61 73 6b 28 a4 63 6f 6d  |=.childtask(.com|
000036b0  6d 61 6e 64 6c 69 6e 65  28 22 7a 69 70 22 2c 61  |mandline("zip",a|
000036c0  24 29 29 0d 01 cb 0f 20  20 20 20 20 20 20 20 20  |$))....         |
000036d0  20 cc 0d 01 cc 15 20 20  20 20 20 20 20 20 20 20  | .....          |
000036e0  20 20 f2 62 75 73 79 0d  01 cd 0f 20 20 20 20 20  |  .busy....     |
000036f0  20 20 20 20 20 cd 0d 01  ce 0b 20 20 20 20 20 20  |     .....      |
00003700  cd 0d 01 cf 13 20 20 20  20 c9 20 6f 70 74 73 6d  |.....    . optsm|
00003710  65 6e 75 25 0d 01 d0 2c  20 20 20 20 20 20 f2 74  |enu%...,      .t|
00003720  69 63 6b 28 6d 65 6e 75  25 2c 69 74 65 6d 25 2c  |ick(menu%,item%,|
00003730  32 29 3a f4 20 74 6f 67  67 6c 65 20 74 69 63 6b  |2):. toggle tick|
00003740  0d 01 d1 49 20 20 20 20  20 20 6f 70 74 69 6f 6e  |...I      option|
00003750  73 25 28 69 74 65 6d 25  29 3d a4 74 69 63 6b 65  |s%(item%)=.ticke|
00003760  64 28 6f 70 74 73 6d 65  6e 75 25 2c 69 74 65 6d  |d(optsmenu%,item|
00003770  25 29 3a f4 20 75 70 64  61 74 65 20 63 6f 6e 66  |%):. update conf|
00003780  69 67 75 72 61 74 69 6f  6e 0d 01 d2 05 cb 0d 01  |iguration.......|
00003790  d3 23 c8 99 22 57 69 6d  70 5f 47 65 74 50 6f 69  |.#.."Wimp_GetPoi|
000037a0  6e 74 65 72 49 6e 66 6f  22 2c 2c 62 6c 6f 63 6b  |nterInfo",,block|
000037b0  25 0d 01 d4 14 e7 20 62  6c 6f 63 6b 25 21 38 20  |%..... block%!8 |
000037c0  80 20 31 20 8c 0d 01 d5  36 20 20 e7 20 6d 65 6e  |. 1 ....6  . men|
000037d0  75 25 3d 66 61 6b 65 66  69 6c 65 72 6d 65 6e 75  |u%=fakefilermenu|
000037e0  25 20 8c 20 f2 75 70 64  61 74 65 66 69 6c 65 72  |% . .updatefiler|
000037f0  6d 65 6e 75 28 22 22 2c  22 22 29 0d 01 d6 41 20  |menu("","")...A |
00003800  20 c8 99 22 57 69 6d 70  5f 43 72 65 61 74 65 4d  | .."Wimp_CreateM|
00003810  65 6e 75 22 2c 2c 6c 61  73 74 6d 65 6e 75 6f 70  |enu",,lastmenuop|
00003820  65 6e 65 64 25 2c 21 62  6c 6f 63 6b 25 2d 36 34  |ened%,!block%-64|
00003830  2c 62 6c 6f 63 6b 25 21  34 2b 32 30 0d 01 d7 05  |,block%!4+20....|
00003840  cd 0d 01 d8 05 e1 0d 01  d9 04 0d 01 da 11 dd 20  |............... |
00003850  a4 6e 65 77 64 69 72 6e  61 6d 65 0d 01 db 0a ea  |.newdirname.....|
00003860  20 70 74 72 25 0d 01 dc  14 70 74 72 25 3d 6e 65  | ptr%....ptr%=ne|
00003870  77 6d 65 6e 75 25 2b 32  38 0d 01 dd 0f 3d 24 28  |wmenu%+28....=$(|
00003880  70 74 72 25 21 31 32 29  0d 01 de 30 f4 20 69 6e  |ptr%!12)...0. in|
00003890  64 69 72 65 63 74 65 64  20 74 65 78 74 20 6f 66  |directed text of|
000038a0  20 66 69 72 73 74 20 65  6e 74 72 79 20 69 6e 20  | first entry in |
000038b0  6e 65 77 6d 65 6e 75 25  0d 01 df 05 3a 0d 01 e0  |newmenu%....:...|
000038c0  4b dd 20 a4 64 6f 74 73  28 66 6c 61 67 25 29 3a  |K. .dots(flag%):|
000038d0  f4 20 6f 6e 6c 79 20 73  79 73 74 65 6d 20 66 6f  |. only system fo|
000038e0  6e 74 20 63 61 6e 20 62  65 20 67 75 61 72 61 6e  |nt can be guaran|
000038f0  74 65 65 64 20 74 6f 20  68 61 76 65 20 8c 20 63  |teed to have . c|
00003900  68 61 72 61 63 74 65 72  0d 01 e1 12 e7 20 66 6c  |haracter..... fl|
00003910  61 67 25 20 8c 20 3d 22  8c 22 0d 01 e2 0a 3d 22  |ag% . ="."....="|
00003920  2e 2e 2e 22 0d 01 e3 05  3a 0d 01 e4 52 f4 20 2d  |..."....:...R. -|
00003930  2d 2d 2d 2d 2d 2d 2d 45  72 72 6f 72 20 62 6f 78  |-------Error box|
00003940  65 73 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |es--------------|
00003950  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003970  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 01 e5 04 0d  |-----------.....|
00003980  01 e6 1b dd 20 f2 72 65  70 6f 72 74 28 74 65 78  |.... .report(tex|
00003990  74 24 2c 66 6c 61 67 73  25 29 0d 01 e7 0f 21 62  |t$,flags%)....!b|
000039a0  6c 6f 63 6b 25 3d 32 35  35 0d 01 e8 18 24 28 62  |lock%=255....$(b|
000039b0  6c 6f 63 6b 25 2b 34 29  3d 74 65 78 74 24 2b bd  |lock%+4)=text$+.|
000039c0  30 0d 01 e9 37 c8 99 20  22 57 69 6d 70 5f 52 65  |0...7.. "Wimp_Re|
000039d0  70 6f 72 74 45 72 72 6f  72 22 2c 62 6c 6f 63 6b  |portError",block|
000039e0  25 2c 66 6c 61 67 73 25  2c 70 24 20 b8 20 2c 65  |%,flags%,p$ . ,e|
000039f0  72 72 63 6c 69 63 6b 25  0d 01 ea 05 e1 0d 01 eb  |rrclick%........|
00003a00  04 0d 01 ec 0b dd 20 f2  71 75 69 74 0d 01 ed 1c  |...... .quit....|
00003a10  ff 20 22 55 6e 73 65 74  20 49 6e 66 6f 53 63 72  |. "Unset InfoScr|
00003a20  61 70 24 50 61 74 68 22  0d 01 ee 1c e7 20 69 6e  |ap$Path"..... in|
00003a30  25 20 c8 99 22 58 4f 53  5f 46 69 6e 64 22 2c 30  |% .."XOS_Find",0|
00003a40  2c 69 6e 25 0d 01 ef 60  e7 20 a4 69 66 74 68 65  |,in%...`. .ifthe|
00003a50  72 65 28 22 3c 57 69 6d  70 24 53 63 72 61 70 44  |re("<Wimp$ScrapD|
00003a60  69 72 3e 2e 49 6e 66 6f  7a 69 70 22 29 20 8c 20  |ir>.Infozip") . |
00003a70  c8 99 22 58 4f 53 5f 43  4c 49 22 2c 22 57 69 70  |.."XOS_CLI","Wip|
00003a80  65 20 3c 57 69 6d 70 24  53 63 72 61 70 44 69 72  |e <Wimp$ScrapDir|
00003a90  3e 2e 49 6e 66 6f 7a 69  70 20 52 20 7e 56 20 7e  |>.Infozip R ~V ~|
00003aa0  43 20 46 22 0d 01 f0 1e  f4 20 74 69 64 79 20 75  |C F"..... tidy u|
00003ab0  70 20 62 65 66 6f 72 65  20 63 6c 6f 73 65 64 6f  |p before closedo|
00003ac0  77 6e 0d 01 f1 16 c8 99  22 57 69 6d 70 5f 43 6c  |wn......"Wimp_Cl|
00003ad0  6f 73 65 44 6f 77 6e 22  0d 01 f2 05 e0 0d 01 f3  |oseDown"........|
00003ae0  05 e1 0d 01 f4 04 0d 01  f5 16 dd 20 f2 61 6c 65  |........... .ale|
00003af0  72 74 62 6f 78 28 74 65  78 74 24 29 0d 01 f6 08  |rtbox(text$)....|
00003b00  ea 20 6e 25 0d 01 f7 15  e7 20 64 69 73 70 74 69  |. n%..... dispti|
00003b10  6d 65 25 3d 30 20 8c 20  e1 0d 01 f8 3d f4 20 74  |me%=0 . ....=. t|
00003b20  72 65 61 74 20 73 65 74  74 69 6e 67 20 6f 66 20  |reat setting of |
00003b30  7a 65 72 6f 20 61 73 20  27 73 75 70 70 72 65 73  |zero as 'suppres|
00003b40  73 20 61 6c 65 72 74 62  6f 78 20 61 6c 74 6f 67  |s alertbox altog|
00003b50  65 74 68 65 72 27 0d 01  f9 23 f2 73 65 74 69 63  |ether'...#.setic|
00003b60  6f 6e 74 65 78 74 28 61  6c 65 72 74 62 6f 78 25  |ontext(alertbox%|
00003b70  2c 30 2c 74 65 78 74 24  29 0d 01 fa 1c f2 63 65  |,0,text$).....ce|
00003b80  6e 74 72 65 77 69 6e 64  6f 77 28 61 6c 65 72 74  |ntrewindow(alert|
00003b90  62 6f 78 25 29 0d 01 fb  13 ef 20 28 37 2a 62 65  |box%)..... (7*be|
00003ba0  65 70 66 6c 61 67 25 29  0d 01 fc 62 c8 99 22 4f  |epflag%)...b.."O|
00003bb0  53 5f 52 65 61 64 4d 6f  6e 6f 74 6f 6e 69 63 54  |S_ReadMonotonicT|
00003bc0  69 6d 65 22 20 b8 20 6e  25 3a 74 69 6d 65 75 70  |ime" . n%:timeup|
00003bd0  25 3d 6e 25 2b 31 30 30  2a 64 69 73 70 74 69 6d  |%=n%+100*disptim|
00003be0  65 25 3a f4 20 73 65 74  20 67 6c 6f 62 61 6c 20  |e%:. set global |
00003bf0  76 61 72 69 61 62 6c 65  20 74 6f 20 72 65 71 75  |variable to requ|
00003c00  69 72 65 64 20 64 65 6c  61 79 0d 01 fd 42 70 6f  |ired delay...Bpo|
00003c10  6c 6c 6d 61 73 6b 25 20  3d 20 70 6f 6c 6c 6d 61  |llmask% = pollma|
00003c20  73 6b 25 20 80 20 28 ac  20 25 31 29 3a f4 20 6e  |sk% . (. %1):. n|
00003c30  6f 20 6c 6f 6e 67 65 72  20 6d 61 73 6b 20 6f 75  |o longer mask ou|
00003c40  74 20 6e 75 6c 6c 2d 70  6f 6c 6c 73 0d 01 fe 05  |t null-polls....|
00003c50  e1 0d 01 ff 05 3a 0d 02  00 52 f4 20 2d 2d 2d 2d  |.....:...R. ----|
00003c60  2d 2d 2d 2d 2d 2d 2d 2d  47 65 6e 65 72 61 6c 20  |--------General |
00003c70  75 73 65 66 75 6c 20 66  75 6e 63 74 69 6f 6e 73  |useful functions|
00003c80  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003ca0  2d 2d 2d 2d 2d 2d 2d 2d  0d 02 01 2a dd 20 a4 52  |--------...*. .R|
00003cb0  65 61 64 53 79 73 56 61  72 28 6e 61 6d 65 24 29  |eadSysVar(name$)|
00003cc0  3a f4 20 63 6f 72 72 75  70 74 73 20 62 6c 6f 63  |:. corrupts bloc|
00003cd0  6b 25 0d 02 02 0d ea 20  61 25 2c 65 72 72 25 0d  |k%..... a%,err%.|
00003ce0  02 03 33 c8 99 22 58 4f  53 5f 52 65 61 64 56 61  |..3.."XOS_ReadVa|
00003cf0  72 56 61 6c 22 2c 6e 61  6d 65 24 2c 62 6c 6f 63  |rVal",name$,bloc|
00003d00  6b 25 2c 32 35 36 2c 30  b8 2c 2c 61 25 3b 65 72  |k%,256,0.,,a%;er|
00003d10  72 25 0d 02 04 13 e7 20  65 72 72 25 20 80 20 31  |r%..... err% . 1|
00003d20  20 8c 3d 22 22 0d 02 05  10 62 6c 6f 63 6b 25 3f  | .=""....block%?|
00003d30  61 25 3d 31 33 0d 02 06  0c 3d 24 62 6c 6f 63 6b  |a%=13....=$block|
00003d40  25 0d 02 07 05 3a 0d 02  08 36 dd 20 a4 73 63 72  |%....:...6. .scr|
00003d50  65 65 6e 77 69 64 74 68  3a f4 20 77 69 64 74 68  |eenwidth:. width|
00003d60  20 6f 66 20 63 75 72 72  65 6e 74 20 6d 6f 64 65  | of current mode|
00003d70  20 69 6e 20 4f 53 20 75  6e 69 74 73 0d 02 09 0e  | in OS units....|
00003d80  ea 20 78 65 69 67 25 2c  78 25 0d 02 0a 2a c8 99  |. xeig%,x%...*..|
00003d90  22 4f 53 5f 52 65 61 64  4d 6f 64 65 56 61 72 69  |"OS_ReadModeVari|
00003da0  61 62 6c 65 22 2c 2d 31  2c 34 20 b8 20 2c 2c 78  |able",-1,4 . ,,x|
00003db0  65 69 67 25 0d 02 0b 28  c8 99 22 4f 53 5f 52 65  |eig%...(.."OS_Re|
00003dc0  61 64 4d 6f 64 65 56 61  72 69 61 62 6c 65 22 2c  |adModeVariable",|
00003dd0  2d 31 2c 31 31 20 b8 20  2c 2c 78 25 0d 02 0c 22  |-1,11 . ,,x%..."|
00003de0  3d 28 31 2b 78 25 20 3c  3c 20 78 65 69 67 25 29  |=(1+x% << xeig%)|
00003df0  2d 28 32 31 20 3c 3c 20  78 65 69 67 25 29 0d 02  |-(21 << xeig%)..|
00003e00  0d 41 f4 20 73 69 7a 65  20 67 6f 65 73 20 66 72  |.A. size goes fr|
00003e10  6f 6d 20 30 20 74 6f 20  77 69 64 74 68 2d 31 20  |om 0 to width-1 |
00003e20  2d 20 73 63 72 6f 6c 6c  62 61 72 73 20 61 72 65  |- scrollbars are|
00003e30  20 32 31 20 70 69 78 65  6c 73 20 77 69 64 65 0d  | 21 pixels wide.|
00003e40  02 0e 05 3a 0d 02 0f 1b  dd 20 f2 74 6f 67 67 6c  |...:..... .toggl|
00003e50  65 73 65 6c 65 63 74 28  73 74 61 74 65 25 29 0d  |eselect(state%).|
00003e60  02 10 0b ea 20 6e 25 2c  6d 25 0d 02 11 1b e7 20  |.... n%,m%..... |
00003e70  73 74 61 74 65 25 20 8c  20 6d 65 6e 75 69 63 6f  |state% . menuico|
00003e80  6e 25 3d 2d 31 0d 02 12  39 e7 20 61 6c 6c 25 3c  |n%=-1...9. all%<|
00003e90  3e 73 74 61 74 65 25 20  8c 20 61 6c 6c 25 3d 73  |>state% . all%=s|
00003ea0  74 61 74 65 25 3a f2 66  6f 72 63 65 72 65 64 72  |tate%:.forceredr|
00003eb0  61 77 28 66 61 6b 65 66  69 6c 65 72 25 29 0d 02  |aw(fakefiler%)..|
00003ec0  13 05 e1 0d 02 14 05 3a  0d 02 15 18 dd 20 a4 6c  |.......:..... .l|
00003ed0  65 61 66 6e 61 6d 65 28  73 74 72 69 6e 67 24 29  |eafname(string$)|
00003ee0  0d 02 16 0d ea 20 6e 25  2c 6f 75 74 24 0d 02 17  |..... n%,out$...|
00003ef0  14 6e 25 3d a7 73 74 72  69 6e 67 24 2c 22 2e 22  |.n%=.string$,"."|
00003f00  29 0d 02 18 17 6f 75 74  24 3d c1 73 74 72 69 6e  |)....out$=.strin|
00003f10  67 24 2c 6e 25 2b 31 29  0d 02 19 1f e7 20 6e 25  |g$,n%+1)..... n%|
00003f20  20 8c 20 6f 75 74 24 3d  a4 6c 65 61 66 6e 61 6d  | . out$=.leafnam|
00003f30  65 28 6f 75 74 24 29 0d  02 1a 09 3d 6f 75 74 24  |e(out$)....=out$|
00003f40  0d 02 1b 05 3a 0d 02 1c  2e dd 20 a4 73 28 61 25  |....:..... .s(a%|
00003f50  29 3a f4 20 52 65 61 64  20 63 6f 6e 74 72 6f 6c  |):. Read control|
00003f60  2d 74 65 72 6d 69 6e 61  74 65 64 20 73 74 72 69  |-terminated stri|
00003f70  6e 67 73 0d 02 1d 08 ea  20 61 24 0d 02 1e 0d c8  |ngs..... a$.....|
00003f80  95 20 3f 61 25 3e 33 31  0d 02 1f 10 61 24 3d 61  |. ?a%>31....a$=a|
00003f90  24 2b bd 28 3f 61 25 29  0d 02 20 0b 61 25 3d 61  |$+.(?a%).. .a%=a|
00003fa0  25 2b 31 0d 02 21 05 ce  0d 02 22 07 3d 61 24 0d  |%+1..!....".=a$.|
00003fb0  02 23 04 0d 02 24 04 0d  02 25 11 dd 20 f2 44 69  |.#...$...%.. .Di|
00003fc0  72 28 70 61 74 68 24 29  0d 02 26 52 f4 20 49 46  |r(path$)..&R. IF|
00003fd0  20 4c 45 4e 28 73 74 6f  72 65 24 29 20 54 48 45  | LEN(store$) THE|
00003fe0  4e 20 50 52 4f 43 72 65  70 6f 72 74 28 22 4f 6c  |N PROCreport("Ol|
00003ff0  64 20 73 74 6f 72 65 24  20 22 2b 73 74 6f 72 65  |d store$ "+store|
00004000  24 2b 22 3a 20 4e 65 77  20 73 74 6f 72 65 24 20  |$+": New store$ |
00004010  22 2b 70 61 74 68 24 2c  31 29 0d 02 27 10 73 74  |"+path$,1)..'.st|
00004020  6f 72 65 24 3d a4 5f 43  53 44 0d 02 28 11 ff 22  |ore$=._CSD..(.."|
00004030  44 69 72 20 22 2b 70 61  74 68 24 0d 02 29 05 e1  |Dir "+path$..)..|
00004040  0d 02 2a 04 0d 02 2b 3c  dd 20 a4 5f 43 53 44 3a  |..*...+<. ._CSD:|
00004050  f4 20 52 65 74 75 72 6e  73 20 63 75 72 72 65 6e  |. Returns curren|
00004060  74 20 76 61 6c 75 65 20  6f 66 20 43 53 44 20 2d  |t value of CSD -|
00004070  20 63 6f 72 72 75 70 74  73 20 62 6c 6f 63 6b 25  | corrupts block%|
00004080  0d 02 2c 08 ea 20 61 24  0d 02 2d 31 c8 99 22 4f  |..,.. a$..-1.."O|
00004090  53 5f 46 53 43 6f 6e 74  72 6f 6c 22 2c 33 37 2c  |S_FSControl",37,|
000040a0  22 40 22 2c 62 6c 6f 63  6b 25 2c 30 2c 30 2c 32  |"@",block%,0,0,2|
000040b0  35 35 20 b8 20 2c 2c 61  24 0d 02 2e 3c f4 20 4f  |55 . ,,a$...<. O|
000040c0  53 5f 46 53 43 6f 6e 74  72 6f 6c 20 33 37 20 3d  |S_FSControl 37 =|
000040d0  20 22 43 61 6e 6f 6e 69  63 61 6c 69 73 65 20 70  | "Canonicalise p|
000040e0  61 74 68 22 2c 20 69 2e  65 2e 20 72 65 6d 6f 76  |ath", i.e. remov|
000040f0  65 20 61 6c 6c 0d 02 2f  41 f4 20 77 69 6c 64 63  |e all../A. wildc|
00004100  61 72 64 73 20 61 6e 64  20 73 79 73 74 65 6d 20  |ards and system |
00004110  76 61 72 69 61 62 6c 65  73 2e 20 20 20 40 20 69  |variables.   @ i|
00004120  73 20 61 20 72 65 73 65  72 76 65 64 20 63 68 61  |s a reserved cha|
00004130  72 61 63 74 65 72 0d 02  30 2c f4 20 69 6e 20 52  |racter..0,. in R|
00004140  49 53 43 20 4f 53 20 66  69 6c 65 6e 61 6d 65 73  |ISC OS filenames|
00004150  20 64 65 6e 6f 74 69 6e  67 20 74 68 65 20 43 53  | denoting the CS|
00004160  44 2e 0d 02 31 07 3d 61  24 0d 02 32 04 0d 02 33  |D...1.=a$..2...3|
00004170  15 dd 20 a4 69 66 74 68  65 72 65 28 70 61 74 68  |.. .ifthere(path|
00004180  24 29 0d 02 34 08 ea 20  41 25 0d 02 35 1d c8 99  |$)..4.. A%..5...|
00004190  22 4f 53 5f 46 69 6c 65  22 2c 31 37 2c 70 61 74  |"OS_File",17,pat|
000041a0  68 24 20 b8 20 41 25 0d  02 36 07 3d 41 25 0d 02  |h$ . A%..6.=A%..|
000041b0  37 05 3a 0d 02 38 34 dd  20 a4 6c 6f 77 65 72 28  |7.:..84. .lower(|
000041c0  73 74 72 69 6e 67 24 29  3a f4 20 72 65 74 75 72  |string$):. retur|
000041d0  6e 73 20 73 74 72 69 6e  67 20 69 6e 20 6c 6f 77  |ns string in low|
000041e0  65 72 20 63 61 73 65 0d  02 39 0b ea 20 78 25 2c  |er case..9.. x%,|
000041f0  6e 25 0d 02 3a 17 e3 20  6e 25 3d 31 20 b8 20 a9  |n%..:.. n%=1 . .|
00004200  28 73 74 72 69 6e 67 24  29 0d 02 3b 16 78 25 3d  |(string$)..;.x%=|
00004210  97 28 c1 73 74 72 69 6e  67 24 2c 6e 25 29 29 0d  |.(.string$,n%)).|
00004220  02 3c 2f e7 20 28 78 25  3e 36 34 20 80 20 78 25  |.</. (x%>64 . x%|
00004230  3c 39 31 29 20 8c 20 c1  73 74 72 69 6e 67 24 2c  |<91) . .string$,|
00004240  6e 25 29 3d bd 28 78 25  20 84 20 33 32 29 0d 02  |n%)=.(x% . 32)..|
00004250  3d 08 ed 20 6e 25 0d 02  3e 0c 3d 73 74 72 69 6e  |=.. n%..>.=strin|
00004260  67 24 0d 02 3f 05 3a 0d  02 40 40 dd 20 a4 73 74  |g$..?.:..@@. .st|
00004270  72 69 6e 67 6c 65 6e 67  74 68 28 74 65 78 74 24  |ringlength(text$|
00004280  29 3a f4 20 72 65 74 75  72 6e 73 20 77 69 64 74  |):. returns widt|
00004290  68 20 6f 66 20 73 74 72  69 6e 67 20 69 6e 20 4f  |h of string in O|
000042a0  53 20 75 6e 69 74 73 0d  02 41 12 ea 20 77 69 64  |S units..A.. wid|
000042b0  74 68 25 2c 78 65 69 67  25 0d 02 42 10 e7 20 6e  |th%,xeig%..B.. n|
000042c0  6f 74 66 6f 6e 74 25 20  8c 0d 02 43 2d 20 20 c8  |otfont% ...C-  .|
000042d0  99 20 22 4f 53 5f 52 65  61 64 4d 6f 64 65 56 61  |. "OS_ReadModeVa|
000042e0  72 69 61 62 6c 65 22 2c  2d 31 2c 34 20 b8 20 2c  |riable",-1,4 . ,|
000042f0  2c 78 65 69 67 25 0d 02  44 22 20 20 77 69 64 74  |,xeig%..D"  widt|
00004300  68 25 3d 28 38 2a a9 28  74 65 78 74 24 29 29 20  |h%=(8*.(text$)) |
00004310  3c 3c 20 78 65 69 67 25  0d 02 45 05 cc 0d 02 46  |<< xeig%..E....F|
00004320  29 20 20 c8 99 20 22 57  69 6d 70 5f 54 65 78 74  |)  .. "Wimp_Text|
00004330  4f 70 22 2c 31 2c 74 65  78 74 24 2c 30 20 b8 20  |Op",1,text$,0 . |
00004340  77 69 64 74 68 25 0d 02  47 05 cd 0d 02 48 0b 3d  |width%..G....H.=|
00004350  77 69 64 74 68 25 0d 02  49 05 3a 0d 02 4a 44 dd  |width%..I.:..JD.|
00004360  20 a4 6c 6f 6f 70 65 64  28 6e 25 2c 6d 61 78 25  | .looped(n%,max%|
00004370  29 20 20 3a f4 20 74 72  61 6e 73 66 6f 72 6d 73  |)  :. transforms|
00004380  20 6e 25 20 74 6f 20 61  20 6e 6f 2e 20 62 65 74  | n% to a no. bet|
00004390  77 65 65 6e 20 31 20 61  6e 64 20 6d 61 78 25 0d  |ween 1 and max%.|
000043a0  02 4b 1a 3d 28 6d 61 78  25 2b 6e 25 2d 31 29 20  |.K.=(max%+n%-1) |
000043b0  83 20 6d 61 78 25 20 2b  31 0d 02 4c 05 3a 0d 02  |. max% +1..L.:..|
000043c0  4d 16 dd 20 a4 70 61 74  68 6e 61 6d 65 28 70 61  |M.. .pathname(pa|
000043d0  74 68 24 29 0d 02 4e 08  ea 20 6e 25 0d 02 4f 2c  |th$)..N.. n%..O,|
000043e0  c8 99 22 4f 53 5f 46 53  43 6f 6e 74 72 6f 6c 22  |.."OS_FSControl"|
000043f0  2c 33 37 2c 70 61 74 68  24 2c 62 6c 6f 63 6b 25  |,37,path$,block%|
00004400  2c 30 2c 30 2c 32 35 35  0d 02 50 14 70 61 74 68  |,0,0,255..P.path|
00004410  24 3d a4 73 28 62 6c 6f  63 6b 25 29 0d 02 51 0f  |$=.s(block%)..Q.|
00004420  6e 25 3d a9 28 70 61 74  68 24 29 0d 02 52 0b c8  |n%=.(path$)..R..|
00004430  95 20 6e 25 3e 31 0d 02  53 1a 20 20 e7 20 c2 70  |. n%>1..S.  . .p|
00004440  61 74 68 24 29 3d 22 2e  22 20 8c 20 6e 25 3d 31  |ath$)="." . n%=1|
00004450  0d 02 54 13 20 20 70 61  74 68 24 3d c0 70 61 74  |..T.  path$=.pat|
00004460  68 24 29 0d 02 55 05 ce  0d 02 56 0a 3d 70 61 74  |h$)..U....V.=pat|
00004470  68 24 0d 02 57 05 3a 0d  02 58 17 dd 20 a4 73 75  |h$..W.:..X.. .su|
00004480  62 28 66 69 6c 65 24 2c  61 24 2c 62 24 29 0d 02  |b(file$,a$,b$)..|
00004490  59 08 ea 20 6e 25 0d 02  5a 05 f5 0d 02 5b 13 20  |Y.. n%..Z....[. |
000044a0  20 6e 25 3d a7 66 69 6c  65 24 2c 61 24 29 0d 02  | n%=.file$,a$)..|
000044b0  5c 1c 20 20 e7 20 6e 25  20 8c 20 c1 66 69 6c 65  |\.  . n% . .file|
000044c0  24 2c 6e 25 2c 31 29 3d  62 24 0d 02 5d 0a fd 20  |$,n%,1)=b$..].. |
000044d0  6e 25 3d 30 0d 02 5e 0a  3d 66 69 6c 65 24 0d 02  |n%=0..^.=file$..|
000044e0  5f 05 3a 0d 02 60 16 dd  20 a4 75 6e 44 4f 53 69  |_.:..`.. .unDOSi|
000044f0  66 79 28 70 61 74 68 24  29 0d 02 61 08 ea 20 61  |fy(path$)..a.. a|
00004500  25 0d 02 62 2b 61 25 3d  a7 70 61 74 68 24 2c 22  |%..b+a%=.path$,"|
00004510  2e 22 29 3a f4 20 64 65  74 65 63 74 20 44 4f 53  |."):. detect DOS|
00004520  2d 74 79 70 65 20 73 75  66 66 69 78 0d 02 63 45  |-type suffix..cE|
00004530  70 61 74 68 24 3d a4 73  75 62 28 70 61 74 68 24  |path$=.sub(path$|
00004540  2c 22 2f 22 2c 22 2e 22  29 3a f4 20 73 75 62 73  |,"/","."):. subs|
00004550  74 69 74 75 74 65 20 76  61 6c 69 64 20 64 69 72  |titute valid dir|
00004560  65 63 74 6f 72 79 20 73  65 70 61 72 61 74 6f 72  |ectory separator|
00004570  73 0d 02 64 3e e7 20 61  25 20 8c 20 c1 70 61 74  |s..d>. a% . .pat|
00004580  68 24 2c 61 25 29 3d 22  2f 22 3a f4 20 72 65 69  |h$,a%)="/":. rei|
00004590  6e 73 65 72 74 20 66 69  6c 65 20 65 78 74 65 6e  |nsert file exten|
000045a0  73 69 6f 6e 20 69 66 20  72 65 71 75 69 72 65 0d  |sion if require.|
000045b0  02 65 0a 3d 70 61 74 68  24 0d 02 66 05 3a 0d 02  |.e.=path$..f.:..|
000045c0  67 28 dd 20 a4 67 73 74  72 61 6e 73 28 74 65 78  |g(. .gstrans(tex|
000045d0  74 24 29 20 3a f4 20 63  6f 72 72 75 70 74 73 20  |t$) :. corrupts |
000045e0  62 6c 6f 63 6b 25 0d 02  68 08 ea 20 6e 25 0d 02  |block%..h.. n%..|
000045f0  69 2a c8 99 22 4f 53 5f  47 53 54 72 61 6e 73 22  |i*.."OS_GSTrans"|
00004600  2c 74 65 78 74 24 2c 62  6c 6f 63 6b 25 2c 32 35  |,text$,block%,25|
00004610  35 20 b8 20 2c 2c 6e 25  0d 02 6a 13 21 28 62 6c  |5 . ,,n%..j.!(bl|
00004620  6f 63 6b 25 2b 6e 25 29  3d 31 33 0d 02 6b 0c 3d  |ock%+n%)=13..k.=|
00004630  24 62 6c 6f 63 6b 25 0d  02 6c 04 0d 02 6d 1a dd  |$block%..l...m..|
00004640  20 a4 73 70 72 69 74 65  5f 65 78 69 73 74 73 28  | .sprite_exists(|
00004650  73 70 72 24 29 0d 02 6e  2f f4 20 54 65 6c 6c 20  |spr$)..n/. Tell |
00004660  77 68 65 74 68 65 72 20  61 20 73 70 72 69 74 65  |whether a sprite|
00004670  20 69 73 20 69 6e 20 74  68 65 20 57 69 6d 70 20  | is in the Wimp |
00004680  70 6f 6f 6c 0d 02 6f 0c  ea 20 66 6c 61 67 73 25  |pool..o.. flags%|
00004690  0d 02 70 2a c8 99 20 22  58 57 69 6d 70 5f 53 70  |..p*.. "XWimp_Sp|
000046a0  72 69 74 65 4f 70 22 2c  32 34 2c 2c 73 70 72 24  |riteOp",24,,spr$|
000046b0  20 b8 20 3b 66 6c 61 67  73 25 0d 02 71 13 3d 28  | . ;flags%..q.=(|
000046c0  66 6c 61 67 73 25 20 80  20 31 29 3d 30 0d 02 72  |flags% . 1)=0..r|
000046d0  04 0d 02 73 2d f4 20 53  69 6d 75 6c 61 74 65 73  |...s-. Simulates|
000046e0  20 61 20 73 68 69 66 74  2d 64 6f 75 62 6c 65 63  | a shift-doublec|
000046f0  6c 69 63 6b 20 6f 6e 20  61 20 66 69 6c 65 0d 02  |lick on a file..|
00004700  74 45 f4 20 28 6c 6f 61  64 73 20 61 20 6e 6f 6e  |tE. (loads a non|
00004710  2d 74 65 78 74 20 66 69  6c 65 20 69 6e 74 6f 20  |-text file into |
00004720  61 20 74 65 78 74 20 65  64 69 74 6f 72 2c 20 70  |a text editor, p|
00004730  72 65 73 65 72 76 69 6e  67 20 66 69 6c 65 74 79  |reserving filety|
00004740  70 65 29 0d 02 75 1b dd  20 f2 62 72 6f 61 64 63  |pe)..u.. .broadc|
00004750  61 73 74 66 69 6c 65 28  70 61 74 68 24 29 0d 02  |astfile(path$)..|
00004760  76 10 62 6c 6f 63 6b 25  21 30 3d 32 35 36 0d 02  |v.block%!0=256..|
00004770  77 0f 62 6c 6f 63 6b 25  21 31 36 3d 35 0d 02 78  |w.block%!16=5..x|
00004780  11 62 6c 6f 63 6b 25 21  32 38 3d 31 36 30 0d 02  |.block%!28=160..|
00004790  79 21 20 62 6c 6f 63 6b  25 21 33 32 3d 33 32 30  |y! block%!32=320|
000047a0  20 3a f4 20 61 6c 6c 20  6c 69 65 73 2e 2e 2e 0d  | :. all lies....|
000047b0  02 7a 10 20 62 6c 6f 63  6b 25 21 33 36 3d 30 0d  |.z. block%!36=0.|
000047c0  02 7b 13 20 62 6c 6f 63  6b 25 21 34 30 3d 26 46  |.{. block%!40=&F|
000047d0  46 46 0d 02 7c 30 20 f4  20 50 72 65 74 65 6e 64  |FF..|0 . Pretend|
000047e0  20 69 74 27 73 20 61 20  74 65 78 74 20 66 69 6c  | it's a text fil|
000047f0  65 20 65 76 65 6e 20 69  66 20 69 74 20 69 73 6e  |e even if it isn|
00004800  27 74 0d 02 7d 17 20 24  28 62 6c 6f 63 6b 25 2b  |'t..}. $(block%+|
00004810  34 34 29 3d 70 61 74 68  24 0d 02 7e 25 20 c8 99  |44)=path$..~% ..|
00004820  22 57 69 6d 70 5f 53 65  6e 64 4d 65 73 73 61 67  |"Wimp_SendMessag|
00004830  65 22 2c 31 37 2c 62 6c  6f 63 6b 25 2c 30 0d 02  |e",17,block%,0..|
00004840  7f 05 e1 0d 02 80 05 3a  0d 02 81 38 dd 20 f2 62  |.......:...8. .b|
00004850  75 73 79 3a f4 20 74 68  69 73 20 6d 65 73 73 61  |usy:. this messa|
00004860  67 65 20 67 65 74 73 20  69 73 73 75 65 64 20 69  |ge gets issued i|
00004870  6e 20 73 65 76 65 72 61  6c 20 70 6c 61 63 65 73  |n several places|
00004880  0d 02 82 3d 70 61 72 61  6d 31 24 3d 70 24 3a 70  |...=param1$=p$:p|
00004890  61 72 61 6d 32 24 3d 22  22 3a f2 61 6c 65 72 74  |aram2$="":.alert|
000048a0  62 6f 78 28 a4 6d 65 73  73 61 67 65 5f 6c 6f 6f  |box(.message_loo|
000048b0  6b 73 75 62 28 22 62 75  73 79 22 29 29 0d 02 83  |ksub("busy"))...|
000048c0  05 e1 0d 02 84 04 0d 02  85 52 f4 20 2d 2d 2d 6d  |.........R. ---m|
000048d0  65 73 73 61 67 65 20 66  69 6c 65 20 6c 6f 6f 6b  |essage file look|
000048e0  2d 75 70 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |-up-------------|
000048f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00004910  2d 2d 2d 2d 2d 2d 2d 2d  0d 02 86 1d dd 20 a4 6d  |--------..... .m|
00004920  65 73 73 61 67 65 5f 6c  6f 6f 6b 75 70 28 74 6f  |essage_lookup(to|
00004930  6b 65 6e 24 29 0d 02 87  0b ea 20 74 65 78 74 24  |ken$)..... text$|
00004940  0d 02 88 35 c8 99 22 4d  65 73 73 61 67 65 54 72  |...5.."MessageTr|
00004950  61 6e 73 5f 4c 6f 6f 6b  75 70 22 2c 6d 64 61 74  |ans_Lookup",mdat|
00004960  61 25 2c 74 6f 6b 65 6e  24 2c 30 20 b8 20 2c 2c  |a%,token$,0 . ,,|
00004970  74 65 78 74 24 0d 02 89  0a 3d 74 65 78 74 24 0d  |text$....=text$.|
00004980  02 8a 05 3a 0d 02 8b 1e  dd 20 a4 6d 65 73 73 61  |...:..... .messa|
00004990  67 65 5f 6c 6f 6f 6b 73  75 62 28 74 6f 6b 65 6e  |ge_looksub(token|
000049a0  24 29 0d 02 8c 33 f4 20  73 65 74 20 67 6c 6f 62  |$)...3. set glob|
000049b0  61 6c 20 76 61 72 69 61  62 6c 65 73 20 70 61 72  |al variables par|
000049c0  61 6d 31 2f 32 24 20 62  65 66 6f 72 65 20 63 61  |am1/2$ before ca|
000049d0  6c 6c 69 6e 67 0d 02 8d  0e ea 20 6e 25 2c 74 65  |lling..... n%,te|
000049e0  78 74 24 0d 02 8e 51 c8  99 22 4d 65 73 73 61 67  |xt$...Q.."Messag|
000049f0  65 54 72 61 6e 73 5f 4c  6f 6f 6b 75 70 22 2c 6d  |eTrans_Lookup",m|
00004a00  64 61 74 61 25 2c 74 6f  6b 65 6e 24 2c 74 65 6d  |data%,token$,tem|
00004a10  70 25 2c 32 35 35 2c 70  61 72 61 6d 31 24 2c 70  |p%,255,param1$,p|
00004a20  61 72 61 6d 32 24 2c 30  2c 30 20 b8 20 2c 2c 74  |aram2$,0,0 . ,,t|
00004a30  65 78 74 24 0d 02 8f 0a  3d 74 65 78 74 24 0d 02  |ext$....=text$..|
00004a40  90 04 0d 02 91 4b f4 20  2d 2d 2d 2d 2d 2d 2d 2d  |.....K. --------|
00004a50  69 63 6f 6e 20 68 61 6e  64 6c 69 6e 67 2d 2d 2d  |icon handling---|
00004a60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00004a80  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0d 02 92  |-------------...|
00004a90  27 dd 20 f2 73 65 74 69  63 6f 6e 74 65 78 74 28  |'. .seticontext(|
00004aa0  77 69 6e 64 6f 77 25 2c  69 63 6f 6e 25 2c 74 65  |window%,icon%,te|
00004ab0  78 74 24 29 0d 02 93 22  21 62 6c 6f 63 6b 25 3d  |xt$)..."!block%=|
00004ac0  77 69 6e 64 6f 77 25 3a  62 6c 6f 63 6b 25 21 34  |window%:block%!4|
00004ad0  3d 69 63 6f 6e 25 0d 02  94 21 c8 99 22 57 69 6d  |=icon%...!.."Wim|
00004ae0  70 5f 47 65 74 49 63 6f  6e 53 74 61 74 65 22 2c  |p_GetIconState",|
00004af0  2c 62 6c 6f 63 6b 25 0d  02 95 16 24 28 62 6c 6f  |,block%....$(blo|
00004b00  63 6b 25 21 32 38 29 3d  74 65 78 74 24 0d 02 96  |ck%!28)=text$...|
00004b10  1a 62 6c 6f 63 6b 25 21  38 3d 30 3a 62 6c 6f 63  |.block%!8=0:bloc|
00004b20  6b 25 21 31 32 3d 30 0d  02 97 21 c8 99 22 57 69  |k%!12=0...!.."Wi|
00004b30  6d 70 5f 53 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_SetIconState"|
00004b40  2c 2c 62 6c 6f 63 6b 25  0d 02 98 05 e1 0d 02 99  |,,block%........|
00004b50  04 0d 02 9a 1e dd 20 a4  67 65 74 69 63 6f 6e 74  |...... .geticont|
00004b60  65 78 74 28 77 69 6e 25  2c 69 63 6f 6e 25 29 0d  |ext(win%,icon%).|
00004b70  02 9b 1f 21 62 6c 6f 63  6b 25 3d 77 69 6e 25 3a  |...!block%=win%:|
00004b80  62 6c 6f 63 6b 25 21 34  3d 69 63 6f 6e 25 0d 02  |block%!4=icon%..|
00004b90  9c 21 c8 99 22 57 69 6d  70 5f 47 65 74 49 63 6f  |.!.."Wimp_GetIco|
00004ba0  6e 53 74 61 74 65 22 2c  2c 62 6c 6f 63 6b 25 0d  |nState",,block%.|
00004bb0  02 9d 11 3d 24 28 62 6c  6f 63 6b 25 21 32 38 29  |...=$(block%!28)|
00004bc0  0d 02 9e 04 0d 02 9f 22  dd 20 f2 72 65 63 61 6c  |.......". .recal|
00004bd0  63 69 63 6f 6e 62 61 72  3a f4 20 72 65 73 69 7a  |ciconbar:. resiz|
00004be0  65 20 69 63 6f 6e 0d 02  a0 04 0d 02 a1 42 20 20  |e icon.......B  |
00004bf0  ea 20 74 65 78 74 5f 6d  69 6e 78 25 2c 74 65 78  |. text_minx%,tex|
00004c00  74 5f 6d 61 78 78 25 2c  74 65 78 74 5f 6d 69 6e  |t_maxx%,text_min|
00004c10  79 25 2c 74 65 78 74 5f  6d 61 78 79 25 2c 6d 69  |y%,text_maxy%,mi|
00004c20  64 78 25 2c 77 25 2c 6d  61 78 77 25 0d 02 a2 14  |dx%,w%,maxw%....|
00004c30  20 20 e7 20 6e 6f 74 66  6f 6e 74 25 20 8c 20 e1  |  . notfont% . .|
00004c40  0d 02 a3 49 20 20 f4 20  57 69 6d 70 5f 52 65 73  |...I  . Wimp_Res|
00004c50  69 7a 65 49 63 6f 6e 20  6e 6f 74 20 73 75 70 70  |izeIcon not supp|
00004c60  6f 72 74 65 64 20 28 6f  72 20 6e 65 65 64 65 64  |orted (or needed|
00004c70  20 68 65 72 65 21 29 20  75 6e 64 65 72 20 52 49  | here!) under RI|
00004c80  53 43 20 4f 53 20 33 b7  31 0d 02 a4 04 0d 02 a5  |SC OS 3.1.......|
00004c90  1f 20 20 21 62 6c 6f 63  6b 25 3d 2d 32 3a 62 6c  |.  !block%=-2:bl|
00004ca0  6f 63 6b 25 21 34 3d 69  62 61 72 25 0d 02 a6 23  |ock%!4=ibar%...#|
00004cb0  20 20 c8 99 22 57 69 6d  70 5f 47 65 74 49 63 6f  |  .."Wimp_GetIco|
00004cc0  6e 53 74 61 74 65 22 2c  2c 62 6c 6f 63 6b 25 0d  |nState",,block%.|
00004cd0  02 a7 2e 20 20 74 65 78  74 5f 6d 69 6e 78 25 3d  |...  text_minx%=|
00004ce0  62 6c 6f 63 6b 25 21 38  3a 74 65 78 74 5f 6d 61  |block%!8:text_ma|
00004cf0  78 78 25 3d 62 6c 6f 63  6b 25 21 31 36 0d 02 a8  |xx%=block%!16...|
00004d00  2f 20 20 74 65 78 74 5f  6d 69 6e 79 25 3d 62 6c  |/  text_miny%=bl|
00004d10  6f 63 6b 25 21 31 32 3a  74 65 78 74 5f 6d 61 78  |ock%!12:text_max|
00004d20  79 25 3d 62 6c 6f 63 6b  25 21 32 30 0d 02 a9 30  |y%=block%!20...0|
00004d30  20 20 6d 69 64 78 25 3d  74 65 78 74 5f 6d 69 6e  |  midx%=text_min|
00004d40  78 25 2b 28 74 65 78 74  5f 6d 61 78 78 25 2d 74  |x%+(text_maxx%-t|
00004d50  65 78 74 5f 6d 69 6e 78  25 29 2f 32 0d 02 aa 2a  |ext_minx%)/2...*|
00004d60  20 20 77 25 3d a4 69 62  61 72 5f 77 69 64 74 68  |  w%=.ibar_width|
00004d70  28 a4 6d 65 73 73 61 67  65 5f 6c 6f 6f 6b 75 70  |(.message_lookup|
00004d80  28 22 59 22 29 29 0d 02  ab 40 20 20 77 25 3d a4  |("Y"))...@  w%=.|
00004d90  69 62 61 72 5f 77 69 64  74 68 28 a4 6d 65 73 73  |ibar_width(.mess|
00004da0  61 67 65 5f 6c 6f 6f 6b  75 70 28 22 4e 22 29 29  |age_lookup("N"))|
00004db0  3a e7 20 77 25 3e 6d 61  78 77 25 20 8c 20 6d 61  |:. w%>maxw% . ma|
00004dc0  78 77 25 3d 77 25 0d 02  ac 59 20 20 c8 99 20 22  |xw%=w%...Y  .. "|
00004dd0  57 69 6d 70 5f 52 65 73  69 7a 65 49 63 6f 6e 22  |Wimp_ResizeIcon"|
00004de0  2c 2d 31 2c 69 62 61 72  25 2c 6d 69 64 78 25 2d  |,-1,ibar%,midx%-|
00004df0  28 6d 61 78 77 25 2f 32  29 2c 74 65 78 74 5f 6d  |(maxw%/2),text_m|
00004e00  69 6e 79 25 2c 6d 69 64  78 25 2b 28 6d 61 78 77  |iny%,midx%+(maxw|
00004e10  25 2f 32 29 2c 74 65 78  74 5f 6d 61 78 79 25 0d  |%/2),text_maxy%.|
00004e20  02 ad 05 e1 0d 02 ae 04  0d 02 af 1c dd 20 f2 72  |............. .r|
00004e30  65 64 72 61 77 69 63 6f  6e 62 61 72 28 74 6f 6b  |edrawiconbar(tok|
00004e40  65 6e 24 29 0d 02 b0 34  20 20 f2 73 65 74 69 63  |en$)...4  .setic|
00004e50  6f 6e 74 65 78 74 28 2d  32 2c 69 62 61 72 25 2c  |ontext(-2,ibar%,|
00004e60  a4 6d 65 73 73 61 67 65  5f 6c 6f 6f 6b 75 70 28  |.message_lookup(|
00004e70  74 6f 6b 65 6e 24 29 29  0d 02 b1 05 e1 0d 02 b2  |token$))........|
00004e80  05 3a 0d 02 b3 21 dd 20  f2 70 75 74 63 61 72 65  |.:...!. .putcare|
00004e90  74 69 6e 69 63 6f 6e 28  77 69 6e 25 2c 69 63 6f  |tinicon(win%,ico|
00004ea0  6e 25 29 0d 02 b4 34 c8  99 22 57 69 6d 70 5f 53  |n%)...4.."Wimp_S|
00004eb0  65 74 43 61 72 65 74 50  6f 73 69 74 69 6f 6e 22  |etCaretPosition"|
00004ec0  2c 77 69 6e 25 2c 69 63  6f 6e 25 2c 32 35 37 2c  |,win%,icon%,257,|
00004ed0  30 2c 2d 31 2c 2d 31 0d  02 b5 24 f4 20 66 6f 72  |0,-1,-1...$. for|
00004ee0  63 65 20 63 61 72 65 74  20 74 6f 20 65 6e 64 20  |ce caret to end |
00004ef0  6f 66 20 70 61 74 68 6e  61 6d 65 0d 02 b6 05 e1  |of pathname.....|
00004f00  0d 02 b7 05 3a 0d 02 b8  04 0d 02 b9 1f dd 20 a4  |....:......... .|
00004f10  69 63 6f 6e 73 65 6c 65  63 74 65 64 28 77 69 6e  |iconselected(win|
00004f20  25 2c 69 63 6f 6e 25 29  0d 02 ba 11 62 6c 6f 63  |%,icon%)....bloc|
00004f30  6b 25 21 30 3d 77 69 6e  25 0d 02 bb 12 62 6c 6f  |k%!0=win%....blo|
00004f40  63 6b 25 21 34 3d 69 63  6f 6e 25 0d 02 bc 21 c8  |ck%!4=icon%...!.|
00004f50  99 22 57 69 6d 70 5f 47  65 74 49 63 6f 6e 53 74  |."Wimp_GetIconSt|
00004f60  61 74 65 22 2c 2c 62 6c  6f 63 6b 25 0d 02 bd 1f  |ate",,block%....|
00004f70  3d 28 62 6c 6f 63 6b 25  21 32 34 20 80 20 28 31  |=(block%!24 . (1|
00004f80  3c 3c 32 31 29 29 20 3e  3e 32 31 0d 02 be 05 3a  |<<21)) >>21....:|
00004f90  0d 02 bf 4a dd 20 f2 49  63 6f 6e 53 74 61 74 65  |...J. .IconState|
00004fa0  28 77 69 6e 25 2c 69 63  6f 6e 25 2c 62 69 74 25  |(win%,icon%,bit%|
00004fb0  2c 66 6c 61 67 25 29 3a  f4 20 73 77 69 74 63 68  |,flag%):. switch|
00004fc0  20 73 70 65 63 69 66 69  65 64 20 66 6c 61 67 20  | specified flag |
00004fd0  62 69 74 20 6f 6e 2f 6f  66 66 0d 02 c0 1f 21 62  |bit on/off....!b|
00004fe0  6c 6f 63 6b 25 3d 77 69  6e 25 3a 62 6c 6f 63 6b  |lock%=win%:block|
00004ff0  25 21 34 3d 69 63 6f 6e  25 0d 02 c1 15 62 6c 6f  |%!4=icon%....blo|
00005000  63 6b 25 21 31 32 3d 31  3c 3c 62 69 74 25 0d 02  |ck%!12=1<<bit%..|
00005010  c2 2b e7 20 66 6c 61 67  25 20 8c 20 62 6c 6f 63  |.+. flag% . bloc|
00005020  6b 25 21 38 3d 31 3c 3c  62 69 74 25 20 8b 20 62  |k%!8=1<<bit% . b|
00005030  6c 6f 63 6b 25 21 38 3d  30 0d 02 c3 21 c8 99 22  |lock%!8=0...!.."|
00005040  57 69 6d 70 5f 53 65 74  49 63 6f 6e 53 74 61 74  |Wimp_SetIconStat|
00005050  65 22 2c 2c 62 6c 6f 63  6b 25 0d 02 c4 05 e1 0d  |e",,block%......|
00005060  02 c5 05 3a 0d 02 c6 66  dd 20 a4 77 68 69 63 68  |...:...f. .which|
00005070  66 61 6b 65 69 63 6f 6e  28 78 25 2c 79 25 29 3a  |fakeicon(x%,y%):|
00005080  f4 20 74 72 61 6e 73 6c  61 74 65 20 66 61 6b 65  |. translate fake|
00005090  66 69 6c 65 72 20 62 61  63 6b 67 72 6f 75 6e 64  |filer background|
000050a0  20 63 6f 2d 6f 72 64 69  6e 61 74 65 73 20 74 6f  | co-ordinates to|
000050b0  20 61 6e 20 69 63 6f 6e  20 6e 75 6d 62 65 72 20  | an icon number |
000050c0  65 71 75 69 76 61 6c 65  6e 74 0d 02 c7 3a ea 20  |equivalent...:. |
000050d0  6d 61 78 5f 6c 65 6e 25  2c 69 6e 64 65 78 5f 70  |max_len%,index_p|
000050e0  74 72 25 2c 77 69 64 74  68 25 2c 63 6f 6c 73 25  |tr%,width%,cols%|
000050f0  2c 69 63 6f 6e 5f 6e 75  6d 25 2c 65 72 72 25 2c  |,icon_num%,err%,|
00005100  70 74 72 25 0d 02 c8 11  ea 20 70 61 6e 65 6f 66  |ptr%..... paneof|
00005110  66 73 65 74 25 0d 02 c9  31 e7 20 73 68 6f 77 70  |fset%...1. showp|
00005120  61 6e 65 25 20 8c 20 70  61 6e 65 6f 66 66 73 65  |ane% . paneoffse|
00005130  74 25 3d 39 36 20 8b 20  70 61 6e 65 6f 66 66 73  |t%=96 . paneoffs|
00005140  65 74 25 3d 32 30 0d 02  ca 1b 69 6e 64 65 78 5f  |et%=20....index_|
00005150  70 74 72 25 3d 21 69 63  6f 6e 5f 69 6e 64 65 78  |ptr%=!icon_index|
00005160  25 0d 02 cb 04 0d 02 cc  2b 6d 61 78 5f 6c 65 6e  |%.......+max_len|
00005170  25 3d a4 73 74 72 69 6e  67 6c 65 6e 67 74 68 28  |%=.stringlength(|
00005180  24 28 69 6e 64 65 78 5f  70 74 72 25 21 34 29 29  |$(index_ptr%!4))|
00005190  0d 02 cd 37 f4 20 6c 65  6e 67 74 68 20 6f 66 20  |...7. length of |
000051a0  6c 6f 6e 67 65 73 74 20  69 63 6f 6e 20 74 65 78  |longest icon tex|
000051b0  74 20 2d 20 6d 61 78 20  77 69 64 74 68 20 6f 66  |t - max width of|
000051c0  20 63 6f 6c 75 6d 6e 0d  02 ce 1f e7 20 6d 61 78  | column..... max|
000051d0  5f 6c 65 6e 25 3c 32 30  30 20 6d 61 78 5f 6c 65  |_len%<200 max_le|
000051e0  6e 25 3d 32 30 30 0d 02  cf 2f e7 20 6d 61 78 5f  |n%=200.../. max_|
000051f0  6c 65 6e 25 3e 63 6c 69  70 77 69 64 74 68 25 20  |len%>clipwidth% |
00005200  8c 20 6d 61 78 5f 6c 65  6e 25 3d 63 6c 69 70 77  |. max_len%=clipw|
00005210  69 64 74 68 25 0d 02 d0  13 70 74 72 25 3d 62 6c  |idth%....ptr%=bl|
00005220  6f 63 6b 25 2b 31 32 38  0d 02 d1 15 70 74 72 25  |ock%+128....ptr%|
00005230  21 30 3d 66 61 6b 65 66  69 6c 65 72 25 0d 02 d2  |!0=fakefiler%...|
00005240  25 c8 99 22 57 69 6d 70  5f 47 65 74 57 69 6e 64  |%.."Wimp_GetWind|
00005250  6f 77 49 6e 66 6f 22 2c  2c 70 74 72 25 20 84 20  |owInfo",,ptr% . |
00005260  25 31 0d 02 d3 18 78 25  3d 78 25 2b 70 74 72 25  |%1....x%=x%+ptr%|
00005270  21 32 30 2d 70 74 72 25  21 34 0d 02 d4 25 79 25  |!20-ptr%!4...%y%|
00005280  3d 79 25 2b 70 74 72 25  21 32 34 2d 70 74 72 25  |=y%+ptr%!24-ptr%|
00005290  21 31 36 2b 70 61 6e 65  6f 66 66 73 65 74 25 0d  |!16+paneoffset%.|
000052a0  02 d5 2b f4 20 67 65 74  20 72 65 6c 61 74 69 76  |..+. get relativ|
000052b0  65 20 28 77 6f 72 6b 20  61 72 65 61 29 20 63 6f  |e (work area) co|
000052c0  2d 6f 72 64 69 6e 61 74  65 73 0d 02 d6 3b 65 72  |-ordinates...;er|
000052d0  72 25 3d 78 25 20 83 20  6d 61 78 5f 6c 65 6e 25  |r%=x% . max_len%|
000052e0  3a e7 20 65 72 72 25 3c  32 34 20 84 20 65 72 72  |:. err%<24 . err|
000052f0  25 3e 28 6d 61 78 5f 6c  65 6e 25 2d 32 34 29 20  |%>(max_len%-24) |
00005300  8c 20 3d 2d 31 0d 02 d7  2f 65 72 72 25 3d 2d 79  |. =-1.../err%=-y|
00005310  25 20 83 20 31 32 34 3a  e7 20 65 72 72 25 3c 32  |% . 124:. err%<2|
00005320  34 20 84 20 65 72 72 25  3e 28 31 32 34 29 20 8c  |4 . err%>(124) .|
00005330  20 3d 2d 31 0d 02 d8 19  77 69 64 74 68 25 3d 70  | =-1....width%=p|
00005340  74 72 25 21 31 32 2d 70  74 72 25 21 34 0d 02 d9  |tr%!12-ptr%!4...|
00005350  39 63 6f 6c 73 25 3d 28  77 69 64 74 68 25 2f 6d  |9cols%=(width%/m|
00005360  61 78 5f 6c 65 6e 25 29  3a f4 20 6e 75 6d 62 65  |ax_len%):. numbe|
00005370  72 20 6f 66 20 63 6f 6c  75 6d 6e 73 20 69 6e 20  |r of columns in |
00005380  77 69 6e 64 6f 77 0d 02  da 17 e7 20 63 6f 6c 73  |window..... cols|
00005390  25 3c 31 20 8c 20 63 6f  6c 73 25 3d 31 0d 02 db  |%<1 . cols%=1...|
000053a0  1f e7 20 78 25 3e 28 63  6f 6c 73 25 2a 6d 61 78  |.. x%>(cols%*max|
000053b0  5f 6c 65 6e 25 29 20 8c  20 3d 2d 31 0d 02 dc 38  |_len%) . =-1...8|
000053c0  f4 20 77 65 20 6d 61 79  20 68 61 76 65 20 61 20  |. we may have a |
000053d0  6c 61 72 67 65 20 62 6c  61 6e 6b 20 73 70 61 63  |large blank spac|
000053e0  65 20 61 74 20 72 69 67  68 74 20 6f 66 20 77 69  |e at right of wi|
000053f0  6e 64 6f 77 0d 02 dd 04  0d 02 de 2d 78 25 3d 28  |ndow.......-x%=(|
00005400  78 25 2f 6d 61 78 5f 6c  65 6e 25 29 3a f4 20 6e  |x%/max_len%):. n|
00005410  75 6d 62 65 72 20 6f 66  20 69 63 6f 6e 73 20 61  |umber of icons a|
00005420  63 72 6f 73 73 0d 02 df  27 79 25 3d 28 79 25 2f  |cross...'y%=(y%/|
00005430  2d 31 32 34 29 3a f4 20  6e 75 6d 62 65 72 20 6f  |-124):. number o|
00005440  66 20 69 63 6f 6e 73 20  64 6f 77 6e 0d 02 e0 45  |f icons down...E|
00005450  f4 20 68 65 69 67 68 74  20 69 73 20 6e 65 67 61  |. height is nega|
00005460  74 69 76 65 20 2d 20 75  73 65 20 64 6f 75 62 6c  |tive - use doubl|
00005470  65 20 6e 65 67 61 74 69  76 65 20 74 6f 20 67 65  |e negative to ge|
00005480  74 20 70 6f 73 69 74 69  76 65 20 61 6e 73 77 65  |t positive answe|
00005490  72 0d 02 e1 19 69 63 6f  6e 5f 6e 75 6d 25 3d 79  |r....icon_num%=y|
000054a0  25 2a 63 6f 6c 73 25 2b  78 25 0d 02 e2 24 e7 20  |%*cols%+x%...$. |
000054b0  69 63 6f 6e 5f 6e 75 6d  25 2b 31 3e 69 6e 64 65  |icon_num%+1>inde|
000054c0  78 5f 70 74 72 25 21 30  20 8c 20 3d 2d 31 0d 02  |x_ptr%!0 . =-1..|
000054d0  e3 2d f4 20 4e 6f 74 65  20 74 68 61 74 20 69 63  |.-. Note that ic|
000054e0  6f 6e 20 6e 75 6d 62 65  72 73 20 73 74 61 72 74  |on numbers start|
000054f0  20 66 72 6f 6d 20 7a 65  72 6f 21 0d 02 e4 0e 3d  | from zero!....=|
00005500  69 63 6f 6e 5f 6e 75 6d  25 0d 02 e5 05 3a 0d 02  |icon_num%....:..|
00005510  e6 49 dd 20 a4 67 65 74  66 61 6b 65 6c 65 61 66  |.I. .getfakeleaf|
00005520  6e 61 6d 65 28 69 63 6f  6e 25 2c 63 6c 69 70 25  |name(icon%,clip%|
00005530  29 3a f4 20 67 65 74 20  66 69 6c 65 20 6e 61 6d  |):. get file nam|
00005540  65 20 67 69 76 65 6e 20  6f 66 66 73 65 74 20 69  |e given offset i|
00005550  6e 20 62 6c 6f 63 6b 0d  02 e7 0d ea 20 70 74 72  |n block..... ptr|
00005560  25 2c 61 24 0d 02 e8 07  ea 20 85 0d 02 e9 51 ee  |%,a$..... ....Q.|
00005570  20 85 20 ea 20 f7 20 85  3a 70 61 72 61 6d 31 24  | . . . .:param1$|
00005580  3d c3 28 69 63 6f 6e 25  29 3a 70 61 72 61 6d 32  |=.(icon%):param2|
00005590  24 3d 22 22 3a f2 72 65  70 6f 72 74 28 a4 6d 65  |$="":.report(.me|
000055a0  73 73 61 67 65 5f 6c 6f  6f 6b 73 75 62 28 22 61  |ssage_looksub("a|
000055b0  64 64 72 22 29 2c 32 29  3a 3d 22 22 0d 02 ea 19  |ddr"),2):=""....|
000055c0  70 74 72 25 3d 28 21 69  63 6f 6e 5f 69 6e 64 65  |ptr%=(!icon_inde|
000055d0  78 25 29 2b 38 0d 02 eb  18 61 24 3d 24 28 70 74  |x%)+8....a$=$(pt|
000055e0  72 25 21 28 69 63 6f 6e  25 2a 34 29 29 0d 02 ec  |r%!(icon%*4))...|
000055f0  22 e7 20 c2 61 24 29 3d  22 2f 22 20 80 20 63 6c  |". .a$)="/" . cl|
00005600  69 70 25 3d b9 20 8c 20  61 24 3d c0 61 24 29 0d  |ip%=. . a$=.a$).|
00005610  02 ed 07 3d 61 24 0d 02  ee 05 3a 0d 02 ef 46 dd  |...=a$....:...F.|
00005620  20 a4 77 68 69 63 68 66  61 6b 65 73 70 72 69 74  | .whichfakesprit|
00005630  65 28 69 63 6f 6e 25 29  3a f4 20 77 68 69 63 68  |e(icon%):. which|
00005640  20 66 69 6c 65 20 73 70  72 69 74 65 20 64 6f 20  | file sprite do |
00005650  77 65 20 75 73 65 20 66  6f 72 20 64 72 61 67 73  |we use for drags|
00005660  3f 0d 02 f0 10 ea 20 61  24 2c 73 70 72 69 74 65  |?..... a$,sprite|
00005670  24 0d 02 f1 2c 61 24 3d  a4 67 65 74 66 61 6b 65  |$...,a$=.getfake|
00005680  6c 65 61 66 6e 61 6d 65  28 69 63 6f 6e 25 2c a3  |leafname(icon%,.|
00005690  29 3a f4 20 66 69 6c 65  20 6e 61 6d 65 0d 02 f2  |):. file name...|
000056a0  16 73 70 72 69 74 65 24  3d 22 66 69 6c 65 5f 78  |.sprite$="file_x|
000056b0  78 78 22 0d 02 f3 10 e7  20 c2 61 24 29 3d 22 2f  |xx"..... .a$)="/|
000056c0  22 20 8c 0d 02 f4 40 20  20 e7 20 c0 61 24 2c 31  |" ....@  . .a$,1|
000056d0  29 3d 22 21 22 20 8c 20  73 70 72 69 74 65 24 3d  |)="!" . sprite$=|
000056e0  22 61 70 70 6c 69 63 61  74 69 6f 6e 22 20 8b 20  |"application" . |
000056f0  73 70 72 69 74 65 24 3d  22 64 69 72 65 63 74 6f  |sprite$="directo|
00005700  72 79 22 0d 02 f5 05 cd  0d 02 f6 0c 3d 73 70 72  |ry".........=spr|
00005710  69 74 65 24 0d 02 f7 05  3a 0d 02 f8 52 f4 20 2d  |ite$....:...R. -|
00005720  2d 2d 2d 2d 2d 2d 2d 77  69 6e 64 6f 77 20 68 61  |-------window ha|
00005730  6e 64 6c 69 6e 67 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |ndling----------|
00005740  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00005760  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 02 f9 15 dd  |-----------.....|
00005770  20 f2 63 6c 6f 73 65 28  77 69 6e 64 6f 77 25 29  | .close(window%)|
00005780  0d 02 fa 14 62 6c 6f 63  6b 25 21 30 3d 77 69 6e  |....block%!0=win|
00005790  64 6f 77 25 0d 02 fb 20  c8 99 22 57 69 6d 70 5f  |dow%... .."Wimp_|
000057a0  43 6c 6f 73 65 57 69 6e  64 6f 77 22 2c 2c 62 6c  |CloseWindow",,bl|
000057b0  6f 63 6b 25 0d 02 fc 57  e7 20 77 69 6e 64 6f 77  |ock%...W. window|
000057c0  25 3d 66 61 6b 65 66 69  6c 65 72 25 20 80 20 73  |%=fakefiler% . s|
000057d0  68 6f 77 70 61 6e 65 25  3d 31 20 8c 20 21 62 6c  |howpane%=1 . !bl|
000057e0  6f 63 6b 25 3d 70 61 6e  65 70 61 74 68 25 3a c8  |ock%=panepath%:.|
000057f0  99 22 57 69 6d 70 5f 43  6c 6f 73 65 57 69 6e 64  |."Wimp_CloseWind|
00005800  6f 77 22 2c 2c 62 6c 6f  63 6b 25 0d 02 fd 18 f4  |ow",,block%.....|
00005810  20 63 6c 6f 73 65 20 70  61 6e 65 20 61 73 20 77  | close pane as w|
00005820  65 6c 6c 0d 02 fe 05 e1  0d 02 ff 04 0d 03 00 1e  |ell.............|
00005830  dd 20 f2 63 68 61 6e 67  65 74 69 74 6c 65 28 77  |. .changetitle(w|
00005840  69 6e 25 2c 74 65 78 74  24 29 0d 03 01 10 21 62  |in%,text$)....!b|
00005850  6c 6f 63 6b 25 3d 77 69  6e 25 0d 03 02 26 c8 99  |lock%=win%...&..|
00005860  22 57 69 6d 70 5f 47 65  74 57 69 6e 64 6f 77 49  |"Wimp_GetWindowI|
00005870  6e 66 6f 22 2c 2c 62 6c  6f 63 6b 25 20 84 20 31  |nfo",,block% . 1|
00005880  0d 03 03 16 24 28 62 6c  6f 63 6b 25 21 37 36 29  |....$(block%!76)|
00005890  3d 74 65 78 74 24 0d 03  04 19 f4 20 63 68 61 6e  |=text$..... chan|
000058a0  67 65 20 77 69 6e 64 6f  77 20 74 69 74 6c 65 0d  |ge window title.|
000058b0  03 05 45 c8 99 22 57 69  6d 70 5f 46 6f 72 63 65  |..E.."Wimp_Force|
000058c0  52 65 64 72 61 77 22 2c  2d 31 2c 62 6c 6f 63 6b  |Redraw",-1,block|
000058d0  25 21 34 2c 62 6c 6f 63  6b 25 21 31 36 2c 62 6c  |%!4,block%!16,bl|
000058e0  6f 63 6b 25 21 31 32 2c  62 6c 6f 63 6b 25 21 31  |ock%!12,block%!1|
000058f0  36 2b 34 34 0d 03 06 05  e1 0d 03 07 05 3a 0d 03  |6+44.........:..|
00005900  08 2a dd 20 f2 66 69 6c  65 69 6e 66 6f 3a f4 20  |.*. .fileinfo:. |
00005910  73 65 74 73 20 75 70 20  66 69 6c 65 20 69 6e 66  |sets up file inf|
00005920  6f 20 77 69 6e 64 6f 77  0d 03 09 11 ea 20 61 24  |o window..... a$|
00005930  2c 78 24 2c 6d 25 2c 6e  25 0d 03 0a 3b 78 24 3d  |,x$,m%,n%...;x$=|
00005940  c0 63 6f 6d 6d 6f 6e 70  61 74 68 24 29 2b a4 67  |.commonpath$)+.g|
00005950  65 74 66 61 6b 65 6c 65  61 66 6e 61 6d 65 28 6d  |etfakeleafname(m|
00005960  65 6e 75 69 63 6f 6e 25  2c a3 29 3a 6d 25 3d a9  |enuicon%,.):m%=.|
00005970  28 78 24 29 0d 03 0b 3c  f4 20 4e 61 6d 65 20 61  |(x$)...<. Name a|
00005980  6e 64 20 69 63 6f 6e 20  77 65 72 65 20 73 65 74  |nd icon were set|
00005990  20 75 70 20 65 61 72 6c  69 65 72 20 77 68 65 6e  | up earlier when|
000059a0  20 77 65 20 63 6c 69 63  6b 65 64 20 4d 45 4e 55  | we clicked MENU|
000059b0  0d 03 0c 07 ea 20 85 0d  03 0d 19 ee 20 85 20 ea  |..... ...... . .|
000059c0  20 e7 20 a4 66 66 65 72  72 6f 72 28 9f 29 3a e1  | . .fferror(.):.|
000059d0  0d 03 0e 0b cf 23 69 6e  25 3d 30 0d 03 0f 07 f7  |.....#in%=0.....|
000059e0  20 85 0d 03 10 21 f4 20  54 68 69 73 20 69 73 20  | ....!. This is |
000059f0  67 65 74 74 69 6e 67 20  76 65 72 79 20 73 69 6c  |getting very sil|
00005a00  6c 79 21 0d 03 11 07 ea  20 85 0d 03 12 41 20 ee  |ly!..... ....A .|
00005a10  20 85 20 ea 20 f7 20 85  3a c8 99 22 48 6f 75 72  | . . . .:.."Hour|
00005a20  67 6c 61 73 73 5f 4f 66  66 22 3a e7 20 9f 3d 32  |glass_Off":. .=2|
00005a30  32 33 20 8c 20 f2 6e 6f  74 66 6f 75 6e 64 3a e1  |23 . .notfound:.|
00005a40  3a 8b 20 85 20 9f 2c f6  24 3a e1 0d 03 13 1a c8  |:. . .,.$:......|
00005a50  99 22 48 6f 75 72 67 6c  61 73 73 5f 53 74 61 72  |."Hourglass_Star|
00005a60  74 22 2c 35 30 0d 03 14  15 61 24 3d be 23 69 6e  |t",50....a$=.#in|
00005a70  25 3a 6e 25 3d 9a 23 69  6e 25 0d 03 15 3c f4 20  |%:n%=.#in%...<. |
00005a80  73 6b 69 70 20 66 69 72  73 74 20 6c 69 6e 65 20  |skip first line |
00005a90  28 66 69 6c 65 6e 61 6d  65 20 6d 61 79 20 62 65  |(filename may be|
00005aa0  20 73 61 6d 65 20 61 73  20 61 72 63 68 69 76 65  | same as archive|
00005ab0  20 6e 61 6d 65 29 0d 03  16 05 f5 0d 03 17 17 20  | name)......... |
00005ac0  20 61 24 3d be 23 69 6e  25 3a 6e 25 3d 9a 23 69  | a$=.#in%:n%=.#i|
00005ad0  6e 25 0d 03 18 10 fd 20  c2 61 24 2c 6d 25 29 3d  |n%..... .a$,m%)=|
00005ae0  78 24 0d 03 19 0d 6e 25  3d bb 28 61 24 29 3a 0d  |x$....n%=.(a$):.|
00005af0  03 1a 35 c8 99 22 4f 53  5f 43 6f 6e 76 65 72 74  |..5.."OS_Convert|
00005b00  46 69 6c 65 53 69 7a 65  22 2c 6e 25 2c 62 6c 6f  |FileSize",n%,blo|
00005b10  63 6b 25 2c 32 35 35 20  b8 20 2c 6e 25 3a 3f 6e  |ck%,255 . ,n%:?n|
00005b20  25 3d 31 33 0d 03 1b 21  f2 73 65 74 69 63 6f 6e  |%=13...!.seticon|
00005b30  74 65 78 74 28 66 69 6c  65 25 2c 36 2c 24 62 6c  |text(file%,6,$bl|
00005b40  6f 63 6b 25 29 0d 03 1c  31 6e 25 3d a7 61 24 2c  |ock%)...1n%=.a$,|
00005b50  22 2d 22 29 3a f2 73 65  74 69 63 6f 6e 74 65 78  |"-"):.seticontex|
00005b60  74 28 66 69 6c 65 25 2c  31 2c c1 61 24 2c 6e 25  |t(file%,1,.a$,n%|
00005b70  2d 32 2c 38 29 29 0d 03  1d 31 6e 25 3d a7 61 24  |-2,8))...1n%=.a$|
00005b80  2c 22 3a 22 29 3a f2 73  65 74 69 63 6f 6e 74 65  |,":"):.seticonte|
00005b90  78 74 28 66 69 6c 65 25  2c 33 2c c1 61 24 2c 6e  |xt(file%,3,.a$,n|
00005ba0  25 2d 32 2c 35 29 29 0d  03 1e 15 c8 99 22 48 6f  |%-2,5))......"Ho|
00005bb0  75 72 67 6c 61 73 73 5f  4f 66 66 22 0d 03 1f 05  |urglass_Off"....|
00005bc0  e1 0d 03 20 04 0d 03 21  0f dd 20 f2 6e 6f 74 66  |... ...!.. .notf|
00005bd0  6f 75 6e 64 0d 03 22 24  f2 73 65 74 69 63 6f 6e  |ound.."$.seticon|
00005be0  74 65 78 74 28 66 69 6c  65 25 2c 31 2c 22 2d 2d  |text(file%,1,"--|
00005bf0  2f 2d 2d 2f 2d 2d 22 29  0d 03 23 21 f2 73 65 74  |/--/--")..#!.set|
00005c00  69 63 6f 6e 74 65 78 74  28 66 69 6c 65 25 2c 33  |icontext(file%,3|
00005c10  2c 22 2d 2d 3a 2d 2d 22  29 0d 03 24 23 f2 73 65  |,"--:--")..$#.se|
00005c20  74 69 63 6f 6e 74 65 78  74 28 66 69 6c 65 25 2c  |ticontext(file%,|
00005c30  36 2c 22 55 6e 6b 6e 6f  77 6e 22 29 0d 03 25 05  |6,"Unknown")..%.|
00005c40  e1 0d 03 26 04 0d 03 27  19 dd 20 f2 63 65 6e 74  |...&...'.. .cent|
00005c50  72 65 77 69 6e 64 6f 77  28 77 69 6e 25 29 0d 03  |rewindow(win%)..|
00005c60  28 26 ea 20 79 65 69 67  25 2c 79 25 2c 68 65 69  |(&. yeig%,y%,hei|
00005c70  67 68 74 25 2c 78 65 69  67 25 2c 78 25 2c 77 69  |ght%,xeig%,x%,wi|
00005c80  64 74 68 25 0d 03 29 13  62 6c 6f 63 6b 25 21 31  |dth%..).block%!1|
00005c90  32 38 3d 77 69 6e 25 0d  03 2a 27 c8 99 22 57 69  |28=win%..*'.."Wi|
00005ca0  6d 70 5f 47 65 74 57 69  6e 64 6f 77 53 74 61 74  |mp_GetWindowStat|
00005cb0  65 22 2c 2c 62 6c 6f 63  6b 25 2b 31 32 38 0d 03  |e",,block%+128..|
00005cc0  2b 2b c8 99 20 22 4f 53  5f 52 65 61 64 4d 6f 64  |++.. "OS_ReadMod|
00005cd0  65 56 61 72 69 61 62 6c  65 22 2c 2d 31 2c 35 20  |eVariable",-1,5 |
00005ce0  b8 20 2c 2c 79 65 69 67  25 0d 03 2c 29 c8 99 20  |. ,,yeig%..,).. |
00005cf0  22 4f 53 5f 52 65 61 64  4d 6f 64 65 56 61 72 69  |"OS_ReadModeVari|
00005d00  61 62 6c 65 22 2c 2d 31  2c 31 32 20 b8 20 2c 2c  |able",-1,12 . ,,|
00005d10  79 25 0d 03 2d 2b c8 99  20 22 4f 53 5f 52 65 61  |y%..-+.. "OS_Rea|
00005d20  64 4d 6f 64 65 56 61 72  69 61 62 6c 65 22 2c 2d  |dModeVariable",-|
00005d30  31 2c 34 20 b8 20 2c 2c  78 65 69 67 25 0d 03 2e  |1,4 . ,,xeig%...|
00005d40  29 c8 99 20 22 4f 53 5f  52 65 61 64 4d 6f 64 65  |).. "OS_ReadMode|
00005d50  56 61 72 69 61 62 6c 65  22 2c 2d 31 2c 31 31 20  |Variable",-1,11 |
00005d60  b8 20 2c 2c 78 25 0d 03  2f 13 79 25 3d 31 2b 79  |. ,,x%../.y%=1+y|
00005d70  25 20 3c 3c 79 65 69 67  25 0d 03 30 21 68 65 69  |% <<yeig%..0!hei|
00005d80  67 68 74 25 3d 62 6c 6f  63 6b 25 21 31 34 34 2d  |ght%=block%!144-|
00005d90  62 6c 6f 63 6b 25 21 31  33 36 0d 03 31 13 78 25  |block%!136..1.x%|
00005da0  3d 31 2b 78 25 20 3c 3c  78 65 69 67 25 0d 03 32  |=1+x% <<xeig%..2|
00005db0  20 77 69 64 74 68 25 3d  62 6c 6f 63 6b 25 21 31  | width%=block%!1|
00005dc0  34 30 2d 62 6c 6f 63 6b  25 21 31 33 32 0d 03 33  |40-block%!132..3|
00005dd0  20 79 25 3d 28 79 25 2d  68 65 69 67 68 74 25 29  | y%=(y%-height%)|
00005de0  2f 32 3a f4 20 74 6f 70  20 65 64 67 65 0d 03 34  |/2:. top edge..4|
00005df0  20 78 25 3d 28 78 25 2d  77 69 64 74 68 25 29 2f  | x%=(x%-width%)/|
00005e00  32 3a f4 20 6c 65 66 74  20 65 64 67 65 0d 03 35  |2:. left edge..5|
00005e10  27 62 6c 6f 63 6b 25 21  31 33 36 3d 79 25 3a 62  |'block%!136=y%:b|
00005e20  6c 6f 63 6b 25 21 31 34  34 3d 79 25 2b 68 65 69  |lock%!144=y%+hei|
00005e30  67 68 74 25 0d 03 36 26  62 6c 6f 63 6b 25 21 31  |ght%..6&block%!1|
00005e40  33 32 3d 78 25 3a 62 6c  6f 63 6b 25 21 31 34 30  |32=x%:block%!140|
00005e50  3d 78 25 2b 77 69 64 74  68 25 0d 03 37 11 62 6c  |=x%+width%..7.bl|
00005e60  6f 63 6b 25 21 31 35 36  3d 2d 31 0d 03 38 23 c8  |ock%!156=-1..8#.|
00005e70  99 22 57 69 6d 70 5f 4f  70 65 6e 57 69 6e 64 6f  |."Wimp_OpenWindo|
00005e80  77 22 2c 2c 62 6c 6f 63  6b 25 2b 31 32 38 0d 03  |w",,block%+128..|
00005e90  39 05 e1 0d 03 3a 05 3a  0d 03 3b 18 dd 20 f2 63  |9....:.:..;.. .c|
00005ea0  72 65 61 74 65 6e 65 77  28 70 6f 70 75 70 25 29  |reatenew(popup%)|
00005eb0  0d 03 3c 0b ea 20 74 65  78 74 24 0d 03 3d 21 f4  |..<.. text$..=!.|
00005ec0  20 4f 66 66 65 72 20 74  6f 20 63 72 65 61 74 65  | Offer to create|
00005ed0  20 6e 65 77 20 7a 69 70  66 69 6c 65 0d 03 3e 1f  | new zipfile..>.|
00005ee0  e7 20 70 6f 70 75 70 25  20 8c 20 f2 70 6f 70 75  |. popup% . .popu|
00005ef0  70 73 61 76 65 77 69 6e  64 6f 77 0d 03 3f 14 61  |psavewindow..?.a|
00005f00  63 74 69 6f 6e 24 3d 22  63 72 65 61 74 65 22 0d  |ction$="create".|
00005f10  03 40 2d f2 63 68 61 6e  67 65 74 69 74 6c 65 28  |.@-.changetitle(|
00005f20  73 61 76 65 25 2c a4 6d  65 73 73 61 67 65 5f 6c  |save%,.message_l|
00005f30  6f 6f 6b 75 70 28 22 53  32 22 29 29 0d 03 41 22  |ookup("S2"))..A"|
00005f40  74 65 78 74 24 3d a4 6d  65 73 73 61 67 65 5f 6c  |text$=.message_l|
00005f50  6f 6f 6b 75 70 28 22 53  6e 61 6d 65 22 29 0d 03  |ookup("Sname")..|
00005f60  42 1d e7 20 75 6e 69 78  66 6c 61 67 25 20 74 65  |B.. unixflag% te|
00005f70  78 74 24 2b 3d 22 2f 7a  69 70 22 0d 03 43 1f f2  |xt$+="/zip"..C..|
00005f80  73 65 74 69 63 6f 6e 74  65 78 74 28 73 61 76 65  |seticontext(save|
00005f90  25 2c 31 2c 74 65 78 74  24 29 0d 03 44 1c f2 70  |%,1,text$)..D..p|
00005fa0  75 74 63 61 72 65 74 69  6e 69 63 6f 6e 28 73 61  |utcaretinicon(sa|
00005fb0  76 65 25 2c 31 29 0d 03  45 05 e1 0d 03 46 05 3a  |ve%,1)..E....F.:|
00005fc0  0d 03 47 11 dd 20 f2 6f  70 65 6e 63 6f 6e 66 69  |..G.. .openconfi|
00005fd0  67 0d 03 48 10 f2 73 65  74 75 70 63 6f 6e 66 69  |g..H..setupconfi|
00005fe0  67 0d 03 49 1d f2 63 65  6e 74 72 65 77 69 6e 64  |g..I..centrewind|
00005ff0  6f 77 28 63 6f 6e 66 69  67 75 72 65 25 29 0d 03  |ow(configure%)..|
00006000  4a 22 f2 70 75 74 63 61  72 65 74 69 6e 69 63 6f  |J".putcaretinico|
00006010  6e 28 63 6f 6e 66 69 67  75 72 65 25 2c 2d 31 29  |n(configure%,-1)|
00006020  0d 03 4b 05 e1 0d 03 4c  05 3a 0d 03 4d 24 dd 20  |..K....L.:..M$. |
00006030  f2 72 65 73 69 7a 65 28  77 69 64 74 68 25 2c 68  |.resize(width%,h|
00006040  65 69 67 68 74 25 2c 74  65 78 74 77 25 29 0d 03  |eight%,textw%)..|
00006050  4e 25 ea 20 6d 61 78 25  2c 70 74 72 25 2c 6e 6f  |N%. max%,ptr%,no|
00006060  5f 6f 66 5f 66 69 6c 65  73 25 2c 70 61 74 68 6c  |_of_files%,pathl|
00006070  65 6e 25 0d 03 4f 15 70  74 72 25 3d 21 69 63 6f  |en%..O.ptr%=!ico|
00006080  6e 5f 69 6e 64 65 78 25  0d 03 50 16 6e 6f 5f 6f  |n_index%..P.no_o|
00006090  66 5f 66 69 6c 65 73 25  3d 21 70 74 72 25 0d 03  |f_files%=!ptr%..|
000060a0  51 41 e7 20 6e 6f 5f 6f  66 5f 66 69 6c 65 73 25  |QA. no_of_files%|
000060b0  2a 74 65 78 74 77 25 3c  a4 73 63 72 65 65 6e 77  |*textw%<.screenw|
000060c0  69 64 74 68 20 8c 20 6d  61 78 25 3d 6e 6f 5f 6f  |idth . max%=no_o|
000060d0  66 5f 66 69 6c 65 73 25  2a 74 65 78 74 77 25 0d  |f_files%*textw%.|
000060e0  03 52 44 f4 20 77 6f 72  6b 20 61 72 65 61 20 6e  |.RD. work area n|
000060f0  65 65 64 65 64 20 74 6f  20 64 69 73 70 6c 61 79  |eeded to display|
00006100  20 61 6c 6c 20 69 63 6f  6e 73 20 69 6e 20 6f 6e  | all icons in on|
00006110  65 20 72 6f 77 20 28 69  66 20 70 6f 73 73 69 62  |e row (if possib|
00006120  6c 65 29 0d 03 53 1e 6d  61 78 25 20 3d 20 6e 6f  |le)..S.max% = no|
00006130  5f 6f 66 5f 66 69 6c 65  73 25 2a 74 65 78 74 77  |_of_files%*textw|
00006140  25 0d 03 54 2a 70 61 74  68 6c 65 6e 25 20 3d 20  |%..T*pathlen% = |
00006150  a4 73 74 72 69 6e 67 6c  65 6e 67 74 68 28 7a 69  |.stringlength(zi|
00006160  70 66 69 6c 65 24 29 2b  31 34 30 0d 03 55 23 e7  |pfile$)+140..U#.|
00006170  20 70 61 74 68 6c 65 6e  25 3e 6d 61 78 25 20 8c  | pathlen%>max% .|
00006180  20 6d 61 78 25 3d 70 61  74 68 6c 65 6e 25 0d 03  | max%=pathlen%..|
00006190  56 3d e7 20 6d 61 78 25  3c 77 69 64 74 68 25 20  |V=. max%<width% |
000061a0  8c 20 6d 61 78 25 3d 77  69 64 74 68 25 3a f4 20  |. max%=width%:. |
000061b0  63 6f 70 65 20 77 69 74  68 20 65 6d 70 74 79 20  |cope with empty |
000061c0  64 69 72 65 63 74 6f 72  69 65 73 0d 03 57 2b e7  |directories..W+.|
000061d0  20 6d 61 78 25 3e a4 73  63 72 65 65 6e 77 69 64  | max%>.screenwid|
000061e0  74 68 20 8c 20 6d 61 78  25 3d a4 73 63 72 65 65  |th . max%=.scree|
000061f0  6e 77 69 64 74 68 0d 03  58 39 21 62 6c 6f 63 6b  |nwidth..X9!block|
00006200  25 3d 30 3a 62 6c 6f 63  6b 25 21 34 3d 2d 68 65  |%=0:block%!4=-he|
00006210  69 67 68 74 25 3a 62 6c  6f 63 6b 25 21 38 3d 6d  |ight%:block%!8=m|
00006220  61 78 25 3a 62 6c 6f 63  6b 25 21 31 32 3d 30 0d  |ax%:block%!12=0.|
00006230  03 59 28 c8 99 22 57 69  6d 70 5f 53 65 74 45 78  |.Y(.."Wimp_SetEx|
00006240  74 65 6e 74 22 2c 66 61  6b 65 66 69 6c 65 72 25  |tent",fakefiler%|
00006250  2c 62 6c 6f 63 6b 25 0d  03 5a 34 21 62 6c 6f 63  |,block%..Z4!bloc|
00006260  6b 25 3d 30 3a 62 6c 6f  63 6b 25 21 34 3d 2d 37  |k%=0:block%!4=-7|
00006270  36 3a 62 6c 6f 63 6b 25  21 38 3d 6d 61 78 25 3a  |6:block%!8=max%:|
00006280  62 6c 6f 63 6b 25 21 31  32 3d 30 0d 03 5b 27 c8  |block%!12=0..['.|
00006290  99 22 57 69 6d 70 5f 53  65 74 45 78 74 65 6e 74  |."Wimp_SetExtent|
000062a0  22 2c 70 61 6e 65 70 61  74 68 25 2c 62 6c 6f 63  |",panepath%,bloc|
000062b0  6b 25 0d 03 5c 45 f4 20  73 65 74 20 77 6f 72 6b  |k%..\E. set work|
000062c0  20 61 72 65 61 73 20 74  6f 20 77 69 64 65 73 74  | areas to widest|
000062d0  20 70 6f 73 73 69 62 6c  65 20 66 6f 72 20 6e 75  | possible for nu|
000062e0  6d 62 65 72 20 6f 66 20  69 63 6f 6e 73 20 69 6e  |mber of icons in|
000062f0  20 77 69 6e 64 6f 77 0d  03 5d 04 0d 03 5e 16 21  | window..]...^.!|
00006300  62 6c 6f 63 6b 25 3d 66  61 6b 65 66 69 6c 65 72  |block%=fakefiler|
00006310  25 0d 03 5f 23 c8 99 22  57 69 6d 70 5f 47 65 74  |%.._#.."Wimp_Get|
00006320  57 69 6e 64 6f 77 53 74  61 74 65 22 2c 2c 62 6c  |WindowState",,bl|
00006330  6f 63 6b 25 0d 03 60 04  0d 03 61 1e 62 6c 6f 63  |ock%..`...a.bloc|
00006340  6b 25 21 38 3d 62 6c 6f  63 6b 25 21 31 36 2d 68  |k%!8=block%!16-h|
00006350  65 69 67 68 74 25 0d 03  62 1d 62 6c 6f 63 6b 25  |eight%..b.block%|
00006360  21 31 32 3d 62 6c 6f 63  6b 25 21 34 2b 77 69 64  |!12=block%!4+wid|
00006370  74 68 25 0d 03 63 1b 62  6c 6f 63 6b 25 21 32 30  |th%..c.block%!20|
00006380  3d 30 3a 62 6c 6f 63 6b  25 21 32 34 3d 30 0d 03  |=0:block%!24=0..|
00006390  64 34 f4 20 73 65 74 20  75 70 20 74 6f 20 72 65  |d4. set up to re|
000063a0  6f 70 65 6e 20 77 69 6e  64 6f 77 20 61 74 20 6e  |open window at n|
000063b0  65 77 20 73 69 7a 65 20  69 66 20 64 65 73 69 72  |ew size if desir|
000063c0  65 64 0d 03 65 05 e1 0d  03 66 05 3a 0d 03 67 1f  |ed..e....f.:..g.|
000063d0  dd 20 f2 74 72 61 70 61  64 6a 75 73 74 63 6c 6f  |. .trapadjustclo|
000063e0  73 65 28 77 69 6e 64 6f  77 25 29 0d 03 68 27 c8  |se(window%)..h'.|
000063f0  99 22 57 69 6d 70 5f 47  65 74 50 6f 69 6e 74 65  |."Wimp_GetPointe|
00006400  72 49 6e 66 6f 22 2c 2c  62 6c 6f 63 6b 25 2b 31  |rInfo",,block%+1|
00006410  32 38 0d 03 69 18 e7 20  28 62 6c 6f 63 6b 25 21  |28..i.. (block%!|
00006420  31 33 36 20 3d 20 31 29  20 8c 0d 03 6a 47 20 20  |136 = 1) ...jG  |
00006430  f4 20 41 44 4a 55 53 54  2d 63 6c 69 63 6b 20 6f  |. ADJUST-click o|
00006440  6e 20 66 61 6b 65 66 69  6c 65 72 25 20 28 74 68  |n fakefiler% (th|
00006450  65 20 6f 6e 6c 79 20 77  69 6e 64 6f 77 20 77 69  |e only window wi|
00006460  74 68 20 61 20 63 6c 6f  73 65 20 69 63 6f 6e 21  |th a close icon!|
00006470  29 0d 03 6b 21 20 20 e7  20 73 68 6f 77 70 61 6e  |)..k!  . showpan|
00006480  65 25 3d 31 20 84 20 6c  65 76 65 6c 73 25 3d 30  |e%=1 . levels%=0|
00006490  20 8c 0d 03 6c 2d 20 20  20 20 ff 22 46 69 6c 65  | ...l-    ."File|
000064a0  72 5f 4f 70 65 6e 44 69  72 20 22 2b a4 70 61 74  |r_OpenDir "+.pat|
000064b0  68 6e 61 6d 65 28 7a 69  70 66 69 6c 65 24 29 0d  |hname(zipfile$).|
000064c0  03 6d 26 20 20 20 20 e7  20 ac 20 a6 28 2d 31 29  |.m&    . . .(-1)|
000064d0  20 8c 20 f2 63 6c 6f 73  65 28 66 61 6b 65 66 69  | . .close(fakefi|
000064e0  6c 65 72 25 29 0d 03 6e  28 20 20 f4 20 6b 65 65  |ler%)..n(  . kee|
000064f0  70 20 77 69 6e 64 6f 77  20 6f 70 65 6e 20 6f 6e  |p window open on|
00006500  20 53 48 49 46 54 2d 41  44 4a 55 53 54 0d 03 6f  | SHIFT-ADJUST..o|
00006510  07 20 20 cc 0d 03 70 21  20 20 20 20 6c 65 76 65  |.  ...p!    leve|
00006520  6c 73 25 3d a4 75 70 6c  65 76 65 6c 28 6c 65 76  |ls%=.uplevel(lev|
00006530  65 6c 73 25 29 0d 03 71  07 20 20 cd 0d 03 72 05  |els%)..q.  ...r.|
00006540  cc 0d 03 73 15 20 20 f2  63 6c 6f 73 65 28 21 62  |...s.  .close(!b|
00006550  6c 6f 63 6b 25 29 0d 03  74 05 cd 0d 03 75 05 e1  |lock%)..t....u..|
00006560  0d 03 76 05 3a 0d 03 77  16 dd 20 f2 70 6f 70 75  |..v.:..w.. .popu|
00006570  70 73 61 76 65 77 69 6e  64 6f 77 0d 03 78 1a ea  |psavewindow..x..|
00006580  20 78 25 2c 79 25 2c 77  69 64 74 68 25 2c 68 65  | x%,y%,width%,he|
00006590  69 67 68 74 25 0d 03 79  23 c8 99 22 57 69 6d 70  |ight%..y#.."Wimp|
000065a0  5f 47 65 74 50 6f 69 6e  74 65 72 49 6e 66 6f 22  |_GetPointerInfo"|
000065b0  2c 2c 62 6c 6f 63 6b 25  0d 03 7a 0e 78 25 3d 21  |,,block%..z.x%=!|
000065c0  62 6c 6f 63 6b 25 0d 03  7b 0f 79 25 3d 62 6c 6f  |block%..{.y%=blo|
000065d0  63 6b 25 21 34 0d 03 7c  11 21 62 6c 6f 63 6b 25  |ck%!4..|.!block%|
000065e0  3d 73 61 76 65 25 0d 03  7d 23 c8 99 22 57 69 6d  |=save%..}#.."Wim|
000065f0  70 5f 47 65 74 57 69 6e  64 6f 77 53 74 61 74 65  |p_GetWindowState|
00006600  22 2c 2c 62 6c 6f 63 6b  25 0d 03 7e 1d 77 69 64  |",,block%..~.wid|
00006610  74 68 25 3d 62 6c 6f 63  6b 25 21 31 32 2d 62 6c  |th%=block%!12-bl|
00006620  6f 63 6b 25 21 34 0d 03  7f 1e 68 65 69 67 68 74  |ock%!4....height|
00006630  25 3d 62 6c 6f 63 6b 25  21 31 36 2d 62 6c 6f 63  |%=block%!16-bloc|
00006640  6b 25 21 38 0d 03 80 32  62 6c 6f 63 6b 25 21 34  |k%!8...2block%!4|
00006650  3d 78 25 2d 28 77 69 64  74 68 25 2f 32 29 3a 62  |=x%-(width%/2):b|
00006660  6c 6f 63 6b 25 21 31 32  3d 78 25 2b 28 77 69 64  |lock%!12=x%+(wid|
00006670  74 68 25 2f 32 29 0d 03  81 36 f4 20 62 6c 6f 63  |th%/2)...6. bloc|
00006680  6b 25 21 38 3d 79 25 2d  28 68 65 69 67 68 74 25  |k%!8=y%-(height%|
00006690  2f 32 29 3a 62 6c 6f 63  6b 25 21 31 36 3d 79 25  |/2):block%!16=y%|
000066a0  2b 28 68 65 69 67 68 74  25 2f 32 29 0d 03 82 24  |+(height%/2)...$|
000066b0  62 6c 6f 63 6b 25 21 38  3d 38 38 3a 62 6c 6f 63  |block%!8=88:bloc|
000066c0  6b 25 21 31 36 3d 38 38  2b 68 65 69 67 68 74 25  |k%!16=88+height%|
000066d0  0d 03 83 1f c8 99 22 57  69 6d 70 5f 4f 70 65 6e  |......"Wimp_Open|
000066e0  57 69 6e 64 6f 77 22 2c  2c 62 6c 6f 63 6b 25 0d  |Window",,block%.|
000066f0  03 84 05 e1 0d 03 85 05  3a 0d 03 86 04 0d 03 87  |........:.......|
00006700  17 dd 20 f2 6f 70 65 6e  77 69 6e 64 6f 77 28 70  |.. .openwindow(p|
00006710  74 72 25 29 0d 03 88 1c  ea 20 73 74 61 63 6b 25  |tr%)..... stack%|
00006720  2c 77 69 64 74 68 25 2c  6e 25 2c 6c 65 61 66 24  |,width%,n%,leaf$|
00006730  0d 03 89 3f ea 20 69 6e  64 65 78 5f 70 74 72 25  |...?. index_ptr%|
00006740  2c 6d 61 78 6c 65 6e 70  74 72 25 2c 74 65 78 74  |,maxlenptr%,text|
00006750  77 25 2c 61 63 72 6f 73  73 25 2c 68 65 69 67 68  |w%,across%,heigh|
00006760  74 25 2c 6e 6f 5f 6f 66  5f 66 69 6c 65 73 25 0d  |t%,no_of_files%.|
00006770  03 8a 2f ea 20 73 74 72  69 6e 67 6c 65 6e 25 2c  |../. stringlen%,|
00006780  78 65 69 67 25 2c 70 61  6e 65 6f 66 66 73 65 74  |xeig%,paneoffset|
00006790  25 2c 6f 70 65 6e 72 65  71 75 65 73 74 25 0d 03  |%,openrequest%..|
000067a0  8b 04 0d 03 8c 35 e7 20  21 70 74 72 25 3c 3e 66  |.....5. !ptr%<>f|
000067b0  61 6b 65 66 69 6c 65 72  25 20 8c 20 c8 99 22 57  |akefiler% . .."W|
000067c0  69 6d 70 5f 4f 70 65 6e  57 69 6e 64 6f 77 22 2c  |imp_OpenWindow",|
000067d0  2c 70 74 72 25 3a e1 0d  03 8d 2d f4 20 6e 6f 20  |,ptr%:....-. no |
000067e0  70 61 6e 65 73 20 6f 72  20 72 65 66 6f 72 6d 61  |panes or reforma|
000067f0  74 74 69 6e 67 20 74 6f  20 77 6f 72 72 79 20 61  |tting to worry a|
00006800  62 6f 75 74 0d 03 8e 04  0d 03 8f 4d 6f 70 65 6e  |bout.......Mopen|
00006810  72 65 71 75 65 73 74 25  3d 74 65 6d 70 25 2b 32  |request%=temp%+2|
00006820  35 36 3a f4 20 61 62 6f  76 65 20 73 63 72 61 74  |56:. above scrat|
00006830  63 68 20 73 70 61 63 65  20 28 68 61 76 65 20 36  |ch space (have 6|
00006840  34 62 20 62 65 6c 6f 77  20 6f 74 68 65 72 20 50  |4b below other P|
00006850  52 4f 43 73 29 0d 03 90  13 e3 20 6e 25 3d 30 20  |ROCs)..... n%=0 |
00006860  b8 20 32 38 20 88 20 34  0d 03 91 1f 20 20 6f 70  |. 28 . 4....  op|
00006870  65 6e 72 65 71 75 65 73  74 25 21 6e 25 20 3d 20  |enrequest%!n% = |
00006880  70 74 72 25 21 6e 25 0d  03 92 08 ed 20 6e 25 0d  |ptr%!n%..... n%.|
00006890  03 93 31 f4 20 62 6c 6f  63 6b 25 20 63 6f 6e 74  |..1. block% cont|
000068a0  65 6e 74 73 20 6d 61 79  20 6e 6f 77 20 62 65 20  |ents may now be |
000068b0  66 72 65 65 6c 79 20 63  6f 72 72 75 70 74 65 64  |freely corrupted|
000068c0  0d 03 94 04 0d 03 95 31  e7 20 73 68 6f 77 70 61  |.......1. showpa|
000068d0  6e 65 25 20 8c 20 70 61  6e 65 6f 66 66 73 65 74  |ne% . paneoffset|
000068e0  25 3d 39 36 20 8b 20 70  61 6e 65 6f 66 66 73 65  |%=96 . paneoffse|
000068f0  74 25 3d 32 30 0d 03 96  1b 69 6e 64 65 78 5f 70  |t%=20....index_p|
00006900  74 72 25 3d 21 69 63 6f  6e 5f 69 6e 64 65 78 25  |tr%=!icon_index%|
00006910  0d 03 97 1c 6e 6f 5f 6f  66 5f 66 69 6c 65 73 25  |....no_of_files%|
00006920  3d 21 69 6e 64 65 78 5f  70 74 72 25 0d 03 98 1a  |=!index_ptr%....|
00006930  f4 20 2a 52 65 70 6f 72  74 20 6e 6f 5f 6f 66 5f  |. *Report no_of_|
00006940  66 69 6c 65 73 25 0d 03  99 2b 77 69 64 74 68 25  |files%...+width%|
00006950  3d 28 6f 70 65 6e 72 65  71 75 65 73 74 25 21 31  |=(openrequest%!1|
00006960  32 2d 6f 70 65 6e 72 65  71 75 65 73 74 25 21 34  |2-openrequest%!4|
00006970  29 0d 03 9a 04 0d 03 9b  16 e7 20 6e 6f 5f 6f 66  |)......... no_of|
00006980  5f 66 69 6c 65 73 25 3e  30 20 8c 0d 03 9c 1d 20  |_files%>0 ..... |
00006990  20 6d 61 78 6c 65 6e 70  74 72 25 3d 69 6e 64 65  | maxlenptr%=inde|
000069a0  78 5f 70 74 72 25 21 34  0d 03 9d 27 20 20 74 65  |x_ptr%!4...'  te|
000069b0  78 74 77 25 3d a4 73 74  72 69 6e 67 6c 65 6e 67  |xtw%=.stringleng|
000069c0  74 68 28 24 6d 61 78 6c  65 6e 70 74 72 25 29 0d  |th($maxlenptr%).|
000069d0  03 9e 1f 20 20 e7 20 74  65 78 74 77 25 3c 32 30  |...  . textw%<20|
000069e0  30 20 8c 20 74 65 78 74  77 25 3d 32 30 30 0d 03  |0 . textw%=200..|
000069f0  9f 2e 20 20 e7 20 74 65  78 74 77 25 3e 63 6c 69  |..  . textw%>cli|
00006a00  70 77 69 64 74 68 25 20  8c 20 74 65 78 74 77 25  |pwidth% . textw%|
00006a10  3d 63 6c 69 70 77 69 64  74 68 25 3a 0d 03 a0 1b  |=clipwidth%:....|
00006a20  20 20 61 63 72 6f 73 73  25 3d 77 69 64 74 68 25  |  across%=width%|
00006a30  2f 74 65 78 74 77 25 0d  03 a1 1d 20 20 e7 20 61  |/textw%....  . a|
00006a40  63 72 6f 73 73 25 3c 31  20 8c 20 61 63 72 6f 73  |cross%<1 . acros|
00006a50  73 25 3d 31 0d 03 a2 04  0d 03 a3 1e 20 20 e7 20  |s%=1........  . |
00006a60  61 63 72 6f 73 73 25 3c  3e 6f 6c 64 5f 61 63 72  |across%<>old_acr|
00006a70  6f 73 73 25 20 8c 0d 03  a4 47 20 20 20 20 68 65  |oss% ....G    he|
00006a80  69 67 68 74 25 3d 31 32  36 2a 28 28 20 28 6e 6f  |ight%=126*(( (no|
00006a90  5f 6f 66 5f 66 69 6c 65  73 25 29 2b 61 63 72 6f  |_of_files%)+acro|
00006aa0  73 73 25 2d 31 29 20 81  20 61 63 72 6f 73 73 25  |ss%-1) . across%|
00006ab0  29 2b 70 61 6e 65 6f 66  66 73 65 74 25 0d 03 a5  |)+paneoffset%...|
00006ac0  32 20 20 20 20 f2 64 72  61 77 77 69 6e 64 6f 77  |2    .drawwindow|
00006ad0  28 61 63 72 6f 73 73 25  2c 6e 6f 5f 6f 66 5f 66  |(across%,no_of_f|
00006ae0  69 6c 65 73 25 2c 74 65  78 74 77 25 2c a3 29 0d  |iles%,textw%,.).|
00006af0  03 a6 34 20 20 20 20 f2  66 6f 72 63 65 72 65 64  |..4    .forcered|
00006b00  72 61 77 28 66 61 6b 65  66 69 6c 65 72 25 29 3a  |raw(fakefiler%):|
00006b10  6f 6c 64 5f 61 63 72 6f  73 73 25 3d 61 63 72 6f  |old_across%=acro|
00006b20  73 73 25 0d 03 a7 48 20  20 20 20 f4 20 74 72 79  |ss%...H    . try|
00006b30  20 74 6f 20 61 76 6f 69  64 20 66 6c 69 63 6b 65  | to avoid flicke|
00006b40  72 20 2d 20 6f 6e 6c 79  20 72 65 64 72 61 77 20  |r - only redraw |
00006b50  77 68 65 6e 20 6e 6f 2e  20 6f 66 20 63 6f 6c 75  |when no. of colu|
00006b60  6d 6e 73 20 63 68 61 6e  67 65 73 0d 03 a8 07 20  |mns changes.... |
00006b70  20 cd 0d 03 a9 05 cd 0d  03 aa 04 0d 03 ab 11 e7  | ...............|
00006b80  20 73 68 6f 77 70 61 6e  65 25 20 8c 0d 03 ac 1d  | showpane% .....|
00006b90  20 20 e7 20 6f 70 65 6e  72 65 71 75 65 73 74 25  |  . openrequest%|
00006ba0  21 32 38 20 3e 20 30 20  8c 0d 03 ad 1d 20 20 20  |!28 > 0 .....   |
00006bb0  20 21 62 6c 6f 63 6b 25  3d 21 6f 70 65 6e 72 65  | !block%=!openre|
00006bc0  71 75 65 73 74 25 0d 03  ae 27 20 20 20 20 c8 99  |quest%...'    ..|
00006bd0  22 57 69 6d 70 5f 47 65  74 57 69 6e 64 6f 77 53  |"Wimp_GetWindowS|
00006be0  74 61 74 65 22 2c 2c 62  6c 6f 63 6b 25 0d 03 af  |tate",,block%...|
00006bf0  56 20 20 20 20 f4 20 76  61 6c 75 65 20 61 74 20  |V    . value at |
00006c00  6f 70 65 6e 72 65 71 75  65 73 74 25 21 32 38 20  |openrequest%!28 |
00006c10  69 73 20 6e 6f 74 20 67  75 61 72 61 6e 74 65 65  |is not guarantee|
00006c20  64 20 74 6f 20 62 65 20  68 61 6e 64 6c 65 20 6f  |d to be handle o|
00006c30  66 20 77 69 6e 64 6f 77  20 69 6e 20 66 72 6f 6e  |f window in fron|
00006c40  74 20 2d 0d 03 b0 35 20  20 20 20 f4 20 6d 61 79  |t -...5    . may|
00006c50  20 6c 65 67 69 74 69 6d  61 74 65 6c 79 20 62 65  | legitimately be|
00006c60  20 68 61 6e 64 6c 65 20  6f 66 20 77 69 6e 64 6f  | handle of windo|
00006c70  77 20 69 74 73 65 6c 66  0d 03 b1 18 20 20 20 20  |w itself....    |
00006c80  73 74 61 63 6b 25 3d 62  6c 6f 63 6b 25 21 32 38  |stack%=block%!28|
00006c90  0d 03 b2 07 20 20 cc 0d  03 b3 1e 20 20 20 20 73  |....  .....    s|
00006ca0  74 61 63 6b 25 3d 6f 70  65 6e 72 65 71 75 65 73  |tack%=openreques|
00006cb0  74 25 21 32 38 0d 03 b4  07 20 20 cd 0d 03 b5 29  |t%!28....  ....)|
00006cc0  20 20 f4 20 70 72 65 73  65 72 76 65 20 73 74 61  |  . preserve sta|
00006cd0  63 6b 20 70 6f 73 69 74  69 6f 6e 20 72 65 71 75  |ck position requ|
00006ce0  65 73 74 65 64 0d 03 b6  2e 20 20 f4 20 2a 52 65  |ested....  . *Re|
00006cf0  70 6f 72 74 20 7e 73 74  61 63 6b 25 20 7e 70 61  |port ~stack% ~pa|
00006d00  6e 65 70 61 74 68 25 20  7e 66 61 6b 65 66 69 6c  |nepath% ~fakefil|
00006d10  65 72 25 0d 03 b7 1f 20  20 6f 70 65 6e 72 65 71  |er%....  openreq|
00006d20  75 65 73 74 25 21 32 38  3d 70 61 6e 65 70 61 74  |uest%!28=panepat|
00006d30  68 25 0d 03 b8 27 20 20  c8 99 22 57 69 6d 70 5f  |h%...'  .."Wimp_|
00006d40  4f 70 65 6e 57 69 6e 64  6f 77 22 2c 2c 6f 70 65  |OpenWindow",,ope|
00006d50  6e 72 65 71 75 65 73 74  25 0d 03 b9 46 20 20 f4  |nrequest%...F  .|
00006d60  20 6f 70 65 6e 20 77 69  6e 64 6f 77 20 2a 75 6e  | open window *un|
00006d70  64 65 72 2a 20 70 61 6e  65 20 28 74 6f 20 61 76  |der* pane (to av|
00006d80  6f 69 64 20 66 6c 69 63  6b 65 72 29 20 73 6f 20  |oid flicker) so |
00006d90  74 68 61 74 20 6c 61 74  65 72 20 63 61 6c 6c 0d  |that later call.|
00006da0  03 ba 40 20 20 f4 20 74  6f 20 57 69 6d 70 5f 47  |..@  . to Wimp_G|
00006db0  65 74 57 69 6e 64 6f 77  53 74 61 74 65 20 77 69  |etWindowState wi|
00006dc0  6c 6c 20 66 69 6e 64 20  69 74 20 69 6e 20 63 6f  |ll find it in co|
00006dd0  72 72 65 63 74 20 73 69  7a 65 2f 70 6f 73 6e 0d  |rrect size/posn.|
00006de0  03 bb 04 0d 03 bc 1d 20  20 21 6f 70 65 6e 72 65  |.......  !openre|
00006df0  71 75 65 73 74 25 3d 70  61 6e 65 70 61 74 68 25  |quest%=panepath%|
00006e00  0d 03 bd 1c 20 20 6f 70  65 6e 72 65 71 75 65 73  |....  openreques|
00006e10  74 25 21 32 38 3d 73 74  61 63 6b 25 0d 03 be 27  |t%!28=stack%...'|
00006e20  20 20 c8 99 22 57 69 6d  70 5f 4f 70 65 6e 57 69  |  .."Wimp_OpenWi|
00006e30  6e 64 6f 77 22 2c 2c 6f  70 65 6e 72 65 71 75 65  |ndow",,openreque|
00006e40  73 74 25 0d 03 bf 50 20  20 f4 20 6f 70 65 6e 20  |st%...P  . open |
00006e50  70 61 6e 65 20 75 73 69  6e 67 20 73 61 6d 65 20  |pane using same |
00006e60  77 69 64 74 68 20 61 6e  64 20 70 6f 73 69 74 69  |width and positi|
00006e70  6f 6e 20 28 6e 6f 74 65  20 74 68 61 74 20 6d 61  |on (note that ma|
00006e80  78 69 6d 75 6d 20 68 65  69 67 68 74 20 6f 66 20  |ximum height of |
00006e90  74 68 65 0d 03 c0 3d 20  20 f4 20 70 61 6e 65 20  |the...=  . pane |
00006ea0  77 69 6c 6c 20 75 6e 64  6f 75 62 74 65 64 6c 79  |will undoubtedly|
00006eb0  20 62 65 20 6c 65 73 73  20 74 68 61 6e 20 72 65  | be less than re|
00006ec0  71 75 65 73 74 65 64 20  68 65 69 67 68 74 21 29  |quested height!)|
00006ed0  0d 03 c1 04 0d 03 c2 1e  20 20 21 6f 70 65 6e 72  |........  !openr|
00006ee0  65 71 75 65 73 74 25 3d  66 61 6b 65 66 69 6c 65  |equest%=fakefile|
00006ef0  72 25 0d 03 c3 53 20 20  c8 99 22 57 69 6d 70 5f  |r%...S  .."Wimp_|
00006f00  47 65 74 57 69 6e 64 6f  77 53 74 61 74 65 22 2c  |GetWindowState",|
00006f10  2c 6f 70 65 6e 72 65 71  75 65 73 74 25 3a f4 20  |,openrequest%:. |
00006f20  67 65 74 20 62 61 63 6b  20 63 6f 72 72 65 63 74  |get back correct|
00006f30  20 73 69 7a 65 20 66 6f  72 20 6d 61 69 6e 20 77  | size for main w|
00006f40  69 6e 64 6f 77 0d 03 c4  1f 20 20 6f 70 65 6e 72  |indow....  openr|
00006f50  65 71 75 65 73 74 25 21  32 38 3d 70 61 6e 65 70  |equest%!28=panep|
00006f60  61 74 68 25 0d 03 c5 27  20 20 c8 99 22 57 69 6d  |ath%...'  .."Wim|
00006f70  70 5f 4f 70 65 6e 57 69  6e 64 6f 77 22 2c 2c 6f  |p_OpenWindow",,o|
00006f80  70 65 6e 72 65 71 75 65  73 74 25 0d 03 c6 3f 20  |penrequest%...? |
00006f90  20 f4 20 72 65 6f 70 65  6e 20 69 74 20 75 6e 64  | . reopen it und|
00006fa0  65 72 20 70 61 6e 65 20  28 6e 6f 77 20 69 6e 20  |er pane (now in |
00006fb0  63 6f 72 72 65 63 74 20  70 6f 73 69 74 69 6f 6e  |correct position|
00006fc0  20 69 6e 20 73 74 61 63  6b 29 0d 03 c7 04 0d 03  | in stack)......|
00006fd0  c8 3e 20 20 21 62 6c 6f  63 6b 25 3d 70 61 6e 65  |.>  !block%=pane|
00006fe0  70 61 74 68 25 3a 62 6c  6f 63 6b 25 21 34 3d 70  |path%:block%!4=p|
00006ff0  61 6e 65 69 63 6f 6e 25  3a f4 20 70 61 74 68 20  |aneicon%:. path |
00007000  64 69 73 70 6c 61 79 20  69 63 6f 6e 0d 03 c9 23  |display icon...#|
00007010  20 20 c8 99 22 57 69 6d  70 5f 47 65 74 49 63 6f  |  .."Wimp_GetIco|
00007020  6e 53 74 61 74 65 22 2c  2c 62 6c 6f 63 6b 25 0d  |nState",,block%.|
00007030  03 ca 1b 20 20 e7 20 70  74 72 25 21 31 36 3c 3e  |...  . ptr%!16<>|
00007040  77 69 64 74 68 25 2d 38  20 8c 0d 03 cb 29 20 20  |width%-8 ....)  |
00007050  20 20 f4 20 69 66 20 73  69 7a 65 20 6f 66 20 69  |  . if size of i|
00007060  63 6f 6e 20 6e 65 65 64  73 20 74 6f 20 63 68 61  |con needs to cha|
00007070  6e 67 65 0d 03 cc 14 20  20 20 20 e7 20 6e 6f 74  |nge....    . not|
00007080  66 6f 6e 74 25 20 8c 0d  03 cd 25 20 20 20 20 20  |font% ....%     |
00007090  20 c8 99 22 57 69 6d 70  5f 44 65 6c 65 74 65 49  | .."Wimp_DeleteI|
000070a0  63 6f 6e 22 2c 2c 62 6c  6f 63 6b 25 0d 03 ce 04  |con",,block%....|
000070b0  0d 03 cf 5e 20 20 20 20  20 20 70 61 6e 65 69 63  |...^      paneic|
000070c0  6f 6e 25 3d a4 74 65 6d  70 6c 5f 69 63 6f 6e 28  |on%=.templ_icon(|
000070d0  70 61 6e 65 70 61 74 68  25 2c 36 34 2c 2d 36 34  |panepath%,64,-64|
000070e0  2c 77 69 64 74 68 25 2d  38 2c 2d 31 32 2c 26 31  |,width%-8,-12,&1|
000070f0  37 30 30 30 31 33 35 2c  22 22 2c 21 70 61 74 68  |7000135,"",!path|
00007100  69 63 6f 6e 25 2c 52 32  25 2c 32 35 35 29 0d 03  |icon%,R2%,255)..|
00007110  d0 35 20 20 20 20 20 20  f4 20 72 65 63 72 65 61  |.5      . recrea|
00007120  74 65 20 69 63 6f 6e 20  74 6f 20 28 61 6c 6d 6f  |te icon to (almo|
00007130  73 74 29 20 77 69 64 74  68 20 6f 66 20 77 69 6e  |st) width of win|
00007140  64 6f 77 0d 03 d1 4b 20  20 20 20 20 20 f4 20 69  |dow...K      . i|
00007150  6e 20 6f 74 68 65 72 20  77 6f 72 64 73 20 72 65  |n other words re|
00007160  73 69 7a 65 20 69 74 20  28 6e 6f 20 57 69 6d 70  |size it (no Wimp|
00007170  5f 52 65 73 69 7a 65 49  63 6f 6e 20 75 6e 64 65  |_ResizeIcon unde|
00007180  72 20 52 49 53 43 20 4f  53 20 33 b7 31 29 0d 03  |r RISC OS 3.1)..|
00007190  d2 09 20 20 20 20 cc 0d  03 d3 46 20 20 20 20 20  |..    ....F     |
000071a0  20 c8 99 20 22 57 69 6d  70 5f 52 65 73 69 7a 65  | .. "Wimp_Resize|
000071b0  49 63 6f 6e 22 2c 70 61  6e 65 70 61 74 68 25 2c  |Icon",panepath%,|
000071c0  70 61 6e 65 69 63 6f 6e  25 2c 36 34 2c 2d 36 34  |paneicon%,64,-64|
000071d0  2c 77 69 64 74 68 25 2d  38 2c 2d 31 32 0d 03 d4  |,width%-8,-12...|
000071e0  09 20 20 20 20 cd 0d 03  d5 6b 20 20 20 20 f2 49  |.    ....k    .I|
000071f0  63 6f 6e 53 74 61 74 65  28 70 61 6e 65 70 61 74  |conState(panepat|
00007200  68 25 2c 70 61 6e 65 69  63 6f 6e 25 2c 39 2c a4  |h%,paneicon%,9,.|
00007210  73 74 72 69 6e 67 6c 65  6e 67 74 68 28 22 2f 22  |stringlength("/"|
00007220  2b c0 63 6f 6d 6d 6f 6e  70 61 74 68 24 29 29 3e  |+.commonpath$))>|
00007230  28 77 69 64 74 68 25 2d  38 2d 36 34 2d 32 34 29  |(width%-8-64-24)|
00007240  29 3a f4 20 77 69 64 74  68 20 6f 66 20 69 63 6f  |):. width of ico|
00007250  6e 0d 03 d6 2c 20 20 20  20 f4 20 4e 6f 74 65 20  |n...,    . Note |
00007260  32 34 2d 4f 53 20 75 6e  69 74 20 27 62 6f 72 64  |24-OS unit 'bord|
00007270  65 72 20 61 6c 6c 6f 77  61 6e 63 65 27 0d 03 d7  |er allowance'...|
00007280  43 20 20 20 20 f4 20 6c  65 66 74 2d 61 6c 69 67  |C    . left-alig|
00007290  6e 20 73 68 6f 72 74 20  74 65 78 74 2c 20 72 69  |n short text, ri|
000072a0  67 68 74 2d 61 6c 69 67  6e 20 28 66 6c 61 67 20  |ght-align (flag |
000072b0  62 69 74 20 38 29 20 6c  6f 6e 67 20 74 65 78 74  |bit 8) long text|
000072c0  0d 03 d8 1f 20 20 20 20  f2 66 6f 72 63 65 72 65  |....    .forcere|
000072d0  64 72 61 77 28 70 61 6e  65 70 61 74 68 25 29 0d  |draw(panepath%).|
000072e0  03 d9 1e 20 20 20 20 f4  20 66 6f 72 63 65 20 72  |...    . force r|
000072f0  65 64 72 61 77 20 6f 66  20 69 63 6f 6e 0d 03 da  |edraw of icon...|
00007300  07 20 20 cd 0d 03 db 05  cc 0d 03 dc 15 20 f4 20  |.  .......... . |
00007310  69 66 20 73 68 6f 77 70  61 6e 65 25 3d 30 0d 03  |if showpane%=0..|
00007320  dd 27 20 20 c8 99 22 57  69 6d 70 5f 4f 70 65 6e  |.'  .."Wimp_Open|
00007330  57 69 6e 64 6f 77 22 2c  2c 6f 70 65 6e 72 65 71  |Window",,openreq|
00007340  75 65 73 74 25 0d 03 de  05 cd 0d 03 df 05 e1 0d  |uest%...........|
00007350  03 e0 05 3a 0d 03 e1 52  f4 20 2d 2d 2d 2d 2d 72  |...:...R. -----r|
00007360  65 64 72 61 77 20 68 61  6e 64 6c 69 6e 67 2d 2d  |edraw handling--|
00007370  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000073a0  2d 2d 2d 2d 2d 2d 0d 03  e2 14 dd 20 f2 72 65 64  |------..... .red|
000073b0  72 61 77 72 65 71 75 65  73 74 0d 03 e3 38 ea 20  |rawrequest...8. |
000073c0  61 63 72 6f 73 73 25 2c  6e 61 6d 65 24 2c 6e 25  |across%,name$,n%|
000073d0  2c 77 69 64 74 68 25 2c  70 74 72 25 2c 61 24 2c  |,width%,ptr%,a$,|
000073e0  6e 6f 5f 6f 66 5f 66 69  6c 65 73 25 2c 66 6c 61  |no_of_files%,fla|
000073f0  67 25 0d 03 e4 22 ea 20  69 6e 64 65 78 5f 70 74  |g%...". index_pt|
00007400  72 25 2c 6d 61 78 6c 65  6e 70 74 72 25 2c 74 65  |r%,maxlenptr%,te|
00007410  78 74 77 25 0d 03 e5 37  e7 20 21 62 6c 6f 63 6b  |xtw%...7. !block|
00007420  25 3c 3e 66 61 6b 65 66  69 6c 65 72 25 20 8c 20  |%<>fakefiler% . |
00007430  85 20 32 35 35 2c 22 57  72 6f 6e 67 20 77 69 6e  |. 255,"Wrong win|
00007440  64 6f 77 20 68 61 6e 64  6c 65 22 0d 03 e6 1b 69  |dow handle"....i|
00007450  6e 64 65 78 5f 70 74 72  25 3d 21 69 63 6f 6e 5f  |ndex_ptr%=!icon_|
00007460  69 6e 64 65 78 25 0d 03  e7 1c 6e 6f 5f 6f 66 5f  |index%....no_of_|
00007470  66 69 6c 65 73 25 3d 21  69 6e 64 65 78 5f 70 74  |files%=!index_pt|
00007480  72 25 0d 03 e8 16 e7 20  6e 6f 5f 6f 66 5f 66 69  |r%..... no_of_fi|
00007490  6c 65 73 25 3e 30 20 8c  0d 03 e9 1d 20 20 6d 61  |les%>0 .....  ma|
000074a0  78 6c 65 6e 70 74 72 25  3d 69 6e 64 65 78 5f 70  |xlenptr%=index_p|
000074b0  74 72 25 21 34 0d 03 ea  27 20 20 74 65 78 74 77  |tr%!4...'  textw|
000074c0  25 3d a4 73 74 72 69 6e  67 6c 65 6e 67 74 68 28  |%=.stringlength(|
000074d0  24 6d 61 78 6c 65 6e 70  74 72 25 29 0d 03 eb 05  |$maxlenptr%)....|
000074e0  cd 0d 03 ec 04 0d 03 ed  1d e7 20 74 65 78 74 77  |.......... textw|
000074f0  25 3c 32 30 30 20 8c 20  74 65 78 74 77 25 3d 32  |%<200 . textw%=2|
00007500  30 30 0d 03 ee 3d f4 20  69 66 20 6e 6f 20 66 69  |00...=. if no fi|
00007510  6c 65 73 20 66 6f 75 6e  64 20 74 68 65 6e 20 6c  |les found then l|
00007520  6f 63 61 6c 20 76 61 72  69 61 62 6c 65 20 74 65  |ocal variable te|
00007530  78 74 77 25 20 69 73 20  73 74 69 6c 6c 20 30 0d  |xtw% is still 0.|
00007540  03 ef 2b e7 20 74 65 78  74 77 25 3e 63 6c 69 70  |..+. textw%>clip|
00007550  77 69 64 74 68 25 20 8c  20 74 65 78 74 77 25 3d  |width% . textw%=|
00007560  63 6c 69 70 77 69 64 74  68 25 0d 03 f0 04 0d 03  |clipwidth%......|
00007570  f1 29 c8 99 22 57 69 6d  70 5f 52 65 64 72 61 77  |.).."Wimp_Redraw|
00007580  57 69 6e 64 6f 77 22 2c  2c 62 6c 6f 63 6b 25 20  |Window",,block% |
00007590  b8 20 66 6c 61 67 25 0d  03 f2 1e 61 63 72 6f 73  |. flag%....acros|
000075a0  73 25 3d 62 6c 6f 63 6b  25 21 31 32 2d 62 6c 6f  |s%=block%!12-blo|
000075b0  63 6b 25 21 34 0d 03 f3  0c c8 95 20 66 6c 61 67  |ck%!4...... flag|
000075c0  25 0d 03 f4 40 20 20 f2  72 65 64 72 61 77 28 61  |%...@  .redraw(a|
000075d0  63 72 6f 73 73 25 2f 74  65 78 74 77 25 2c 6e 6f  |cross%/textw%,no|
000075e0  5f 6f 66 5f 66 69 6c 65  73 25 2d 31 2c 74 65 78  |_of_files%-1,tex|
000075f0  74 77 25 2c 69 6e 64 65  78 5f 70 74 72 25 2b 38  |tw%,index_ptr%+8|
00007600  29 0d 03 f5 18 20 20 21  62 6c 6f 63 6b 25 3d 66  |)....  !block%=f|
00007610  61 6b 65 66 69 6c 65 72  25 0d 03 f6 2b 20 20 c8  |akefiler%...+  .|
00007620  99 22 57 69 6d 70 5f 47  65 74 52 65 63 74 61 6e  |."Wimp_GetRectan|
00007630  67 6c 65 22 2c 2c 62 6c  6f 63 6b 25 20 b8 20 66  |gle",,block% . f|
00007640  6c 61 67 25 0d 03 f7 05  ce 0d 03 f8 04 0d 03 f9  |lag%............|
00007650  05 e1 0d 03 fa 04 0d 03  fb 24 f4 20 65 61 63 68  |.........$. each|
00007660  20 69 63 6f 6e 20 69 73  20 31 31 36 20 4f 53 20  | icon is 116 OS |
00007670  75 6e 69 74 73 20 68 69  67 68 0d 03 fc 2f f4 20  |units high.../. |
00007680  6c 69 6e 65 73 20 6f 66  20 69 63 6f 6e 73 20 61  |lines of icons a|
00007690  72 65 20 61 74 20 31 32  36 20 4f 53 20 75 6e 69  |re at 126 OS uni|
000076a0  74 20 73 70 61 63 69 6e  67 0d 03 fd 27 f4 20 65  |t spacing...'. e|
000076b0  61 63 68 20 69 63 6f 6e  20 69 73 20 74 65 78 74  |ach icon is text|
000076c0  77 25 20 4f 53 20 75 6e  69 74 73 20 77 69 64 65  |w% OS units wide|
000076d0  0d 03 fe 2a dd 20 f2 72  65 64 72 61 77 28 63 6f  |...*. .redraw(co|
000076e0  6c 73 25 2c 6c 61 73 74  69 63 6f 6e 25 2c 77 69  |ls%,lasticon%,wi|
000076f0  64 74 68 25 2c 70 74 72  25 29 0d 03 ff 26 ea 20  |dth%,ptr%)...&. |
00007700  69 63 6f 6e 5f 6e 75 6d  25 2c 78 6d 69 6e 25 2c  |icon_num%,xmin%,|
00007710  79 6d 69 6e 25 2c 73 74  72 69 6e 67 70 74 72 25  |ymin%,stringptr%|
00007720  0d 04 00 40 ea 20 64 5f  78 70 74 72 25 2c 64 5f  |...@. d_xptr%,d_|
00007730  79 70 74 72 25 2c 77 6f  72 6b 74 6f 70 25 2c 64  |yptr%,worktop%,d|
00007740  5f 6c 65 66 74 25 2c 64  5f 74 6f 70 25 2c 64 5f  |_left%,d_top%,d_|
00007750  62 6f 74 74 6f 6d 25 2c  64 5f 72 69 67 68 74 25  |bottom%,d_right%|
00007760  0d 04 01 11 ea 20 70 61  6e 65 6f 66 66 73 65 74  |..... paneoffset|
00007770  25 0d 04 02 31 e7 20 73  68 6f 77 70 61 6e 65 25  |%...1. showpane%|
00007780  20 8c 20 70 61 6e 65 6f  66 66 73 65 74 25 3d 39  | . paneoffset%=9|
00007790  36 20 8b 20 70 61 6e 65  6f 66 66 73 65 74 25 3d  |6 . paneoffset%=|
000077a0  32 30 0d 04 03 17 e7 20  63 6f 6c 73 25 3c 31 20  |20..... cols%<1 |
000077b0  8c 20 63 6f 6c 73 25 3d  31 0d 04 04 04 0d 04 05  |. cols%=1.......|
000077c0  27 64 5f 6c 65 66 74 25  3d 28 62 6c 6f 63 6b 25  |'d_left%=(block%|
000077d0  21 32 38 2d 62 6c 6f 63  6b 25 21 34 29 2f 77 69  |!28-block%!4)/wi|
000077e0  64 74 68 25 0d 04 06 28  64 5f 72 69 67 68 74 25  |dth%...(d_right%|
000077f0  3d 28 62 6c 6f 63 6b 25  21 33 36 2d 62 6c 6f 63  |=(block%!36-bloc|
00007800  6b 25 21 34 29 2f 77 69  64 74 68 25 0d 04 07 29  |k%!4)/width%...)|
00007810  e7 20 64 5f 72 69 67 68  74 25 3e 63 6f 6c 73 25  |. d_right%>cols%|
00007820  2d 31 20 8c 20 64 5f 72  69 67 68 74 25 3d 63 6f  |-1 . d_right%=co|
00007830  6c 73 25 2d 31 0d 04 08  36 f4 20 77 65 20 6d 61  |ls%-1...6. we ma|
00007840  79 20 68 61 76 65 20 71  75 69 74 65 20 6c 61 72  |y have quite lar|
00007850  67 65 20 62 6c 61 6e 6b  20 61 72 65 61 73 20 6f  |ge blank areas o|
00007860  6e 20 74 68 65 20 72 69  67 68 74 0d 04 09 28 f4  |n the right...(.|
00007870  20 4e 6f 74 65 20 74 68  65 72 65 20 61 72 65 20  | Note there are |
00007880  6e 6f 20 78 20 73 63 72  6f 6c 6c 20 6f 66 66 73  |no x scroll offs|
00007890  65 74 73 0d 04 0a 2c 77  6f 72 6b 74 6f 70 25 3d  |ets...,worktop%=|
000078a0  62 6c 6f 63 6b 25 21 31  36 2d 62 6c 6f 63 6b 25  |block%!16-block%|
000078b0  21 32 34 2d 70 61 6e 65  6f 66 66 73 65 74 25 0d  |!24-paneoffset%.|
000078c0  04 0b 2e f4 20 68 65 69  67 68 74 20 6f 66 20 70  |.... height of p|
000078d0  61 6e 65 20 69 73 20 37  36 20 70 6c 75 73 20 32  |ane is 76 plus 2|
000078e0  30 20 65 78 74 72 61 20  73 70 61 63 65 0d 04 0c  |0 extra space...|
000078f0  24 64 5f 74 6f 70 25 3d  20 28 77 6f 72 6b 74 6f  |$d_top%= (workto|
00007900  70 25 2d 62 6c 6f 63 6b  25 21 34 30 29 2f 31 32  |p%-block%!40)/12|
00007910  36 0d 04 0d 26 64 5f 62  6f 74 74 6f 6d 25 3d 28  |6...&d_bottom%=(|
00007920  77 6f 72 6b 74 6f 70 25  2d 62 6c 6f 63 6b 25 21  |worktop%-block%!|
00007930  33 32 29 2f 31 32 36 0d  04 0e 32 f4 20 2a 52 65  |32)/126...2. *Re|
00007940  70 6f 72 74 20 5c 72 20  64 5f 74 6f 70 25 20 64  |port \r d_top% d|
00007950  5f 62 6f 74 74 6f 6d 25  20 64 5f 6c 65 66 74 25  |_bottom% d_left%|
00007960  20 64 5f 72 69 67 68 74  25 0d 04 0f 33 e7 20 64  | d_right%...3. d|
00007970  5f 6c 65 66 74 25 3e 64  5f 72 69 67 68 74 25 20  |_left%>d_right% |
00007980  8c 20 e1 3a f4 20 72 65  64 72 61 77 69 6e 67 20  |. .:. redrawing |
00007990  61 20 62 6c 61 6e 6b 20  61 72 65 61 0d 04 10 1c  |a blank area....|
000079a0  73 74 72 69 6e 67 70 74  72 25 3d 21 69 63 6f 6e  |stringptr%=!icon|
000079b0  5f 77 69 64 74 68 73 25  0d 04 11 04 0d 04 12 20  |_widths%....... |
000079c0  e3 20 64 5f 79 70 74 72  25 3d 64 5f 74 6f 70 25  |. d_yptr%=d_top%|
000079d0  20 b8 20 64 5f 62 6f 74  74 6f 6d 25 0d 04 13 29  | . d_bottom%...)|
000079e0  20 20 79 6d 69 6e 25 3d  2d 70 61 6e 65 6f 66 66  |  ymin%=-paneoff|
000079f0  73 65 74 25 20 2d 31 32  36 2a 28 64 5f 79 70 74  |set% -126*(d_ypt|
00007a00  72 25 2b 31 29 0d 04 14  25 20 20 69 63 6f 6e 5f  |r%+1)...%  icon_|
00007a10  6e 75 6d 25 3d 64 5f 79  70 74 72 25 2a 63 6f 6c  |num%=d_yptr%*col|
00007a20  73 25 2b 64 5f 6c 65 66  74 25 0d 04 15 22 20 20  |s%+d_left%..."  |
00007a30  e3 20 64 5f 78 70 74 72  25 3d 64 5f 6c 65 66 74  |. d_xptr%=d_left|
00007a40  25 20 b8 20 64 5f 72 69  67 68 74 25 0d 04 16 1e  |% . d_right%....|
00007a50  20 20 20 20 20 20 78 6d  69 6e 25 3d 64 5f 78 70  |      xmin%=d_xp|
00007a60  74 72 25 2a 77 69 64 74  68 25 0d 04 17 22 20 20  |tr%*width%..."  |
00007a70  20 20 20 20 e7 20 69 63  6f 6e 5f 6e 75 6d 25 3c  |    . icon_num%<|
00007a80  3d 6c 61 73 74 69 63 6f  6e 25 20 8c 0d 04 18 56  |=lasticon% ....V|
00007a90  20 20 20 20 20 20 20 20  f2 70 6c 6f 74 69 63 6f  |        .plotico|
00007aa0  6e 28 78 6d 69 6e 25 2c  79 6d 69 6e 25 2b 34 2c  |n(xmin%,ymin%+4,|
00007ab0  77 69 64 74 68 25 2c 21  28 70 74 72 25 2b 69 63  |width%,!(ptr%+ic|
00007ac0  6f 6e 5f 6e 75 6d 25 2a  34 29 2c 73 74 72 69 6e  |on_num%*4),strin|
00007ad0  67 70 74 72 25 2b 69 63  6f 6e 5f 6e 75 6d 25 2a  |gptr%+icon_num%*|
00007ae0  34 29 0d 04 19 18 20 20  20 20 20 20 20 20 69 63  |4)....        ic|
00007af0  6f 6e 5f 6e 75 6d 25 2b  3d 31 0d 04 1a 0b 20 20  |on_num%+=1....  |
00007b00  20 20 20 20 cc 0d 04 1b  2e 20 20 20 20 20 20 20  |    .....       |
00007b10  20 64 5f 78 70 74 72 25  3d 64 5f 72 69 67 68 74  | d_xptr%=d_right|
00007b20  25 3a 64 5f 79 70 74 72  25 3d 64 5f 62 6f 74 74  |%:d_yptr%=d_bott|
00007b30  6f 6d 25 0d 04 1c 0b 20  20 20 20 20 20 cd 0d 04  |om%....      ...|
00007b40  1d 07 20 20 ed 0d 04 1e  05 ed 0d 04 1f 05 e1 0d  |..  ............|
00007b50  04 20 05 3a 0d 04 21 31  dd 20 f2 70 6c 6f 74 69  |. .:..!1. .ploti|
00007b60  63 6f 6e 28 78 25 2c 79  25 2c 77 69 64 74 68 25  |con(x%,y%,width%|
00007b70  2c 74 65 78 74 70 74 72  25 2c 73 74 72 69 6e 67  |,textptr%,string|
00007b80  6c 65 6e 25 29 0d 04 22  10 ea 20 73 70 72 69 74  |len%)..".. sprit|
00007b90  65 70 74 72 25 0d 04 23  13 6c 65 61 66 24 3d 24  |eptr%..#.leaf$=$|
00007ba0  74 65 78 74 70 74 72 25  0d 04 24 1a 73 70 72 69  |textptr%..$.spri|
00007bb0  74 65 70 74 72 25 3d 64  61 74 61 73 70 72 69 74  |teptr%=datasprit|
00007bc0  65 25 0d 04 25 37 e7 20  c2 6c 65 61 66 24 29 3d  |e%..%7. .leaf$)=|
00007bd0  22 2f 22 20 8c 20 73 70  72 69 74 65 70 74 72 25  |"/" . spriteptr%|
00007be0  3d 64 69 72 73 70 72 69  74 65 25 3a 6c 65 61 66  |=dirsprite%:leaf|
00007bf0  24 3d c0 6c 65 61 66 24  29 0d 04 26 45 e7 20 97  |$=.leaf$)..&E. .|
00007c00  28 6c 65 61 66 24 29 3d  97 28 22 21 22 29 20 80  |(leaf$)=.("!") .|
00007c10  20 73 70 72 69 74 65 70  74 72 25 3d 64 69 72 73  | spriteptr%=dirs|
00007c20  70 72 69 74 65 25 20 8c  20 73 70 72 69 74 65 70  |prite% . spritep|
00007c30  74 72 25 3d 61 70 70 73  70 72 69 74 65 25 0d 04  |tr%=appsprite%..|
00007c40  27 53 e7 20 77 69 64 74  68 25 3d 63 6c 69 70 77  |'S. width%=clipw|
00007c50  69 64 74 68 25 20 80 20  21 73 74 72 69 6e 67 6c  |idth% . !stringl|
00007c60  65 6e 25 3e 30 20 8c 20  6c 65 61 66 24 3d c0 6c  |en%>0 . leaf$=.l|
00007c70  65 61 66 24 2c 21 73 74  72 69 6e 67 6c 65 6e 25  |eaf$,!stringlen%|
00007c80  29 2b a4 64 6f 74 73 28  6e 6f 74 66 6f 6e 74 25  |)+.dots(notfont%|
00007c90  29 0d 04 28 17 24 28 62  6c 6f 63 6b 25 2b 31 32  |)..(.$(block%+12|
00007ca0  38 29 3d 6c 65 61 66 24  0d 04 29 0f 62 6c 6f 63  |8)=leaf$..).bloc|
00007cb0  6b 25 21 30 3d 78 25 0d  04 2a 0f 62 6c 6f 63 6b  |k%!0=x%..*.block|
00007cc0  25 21 34 3d 79 25 0d 04  2b 16 62 6c 6f 63 6b 25  |%!4=y%..+.block%|
00007cd0  21 38 3d 78 25 2b 77 69  64 74 68 25 0d 04 2c 14  |!8=x%+width%..,.|
00007ce0  62 6c 6f 63 6b 25 21 31  32 3d 79 25 2b 31 31 36  |block%!12=y%+116|
00007cf0  0d 04 2d 17 62 6c 6f 63  6b 25 21 31 36 3d 26 31  |..-.block%!16=&1|
00007d00  37 30 30 41 31 30 42 0d  04 2e 20 e7 20 61 6c 6c  |700A10B... . all|
00007d10  25 20 8c 20 62 6c 6f 63  6b 25 21 31 36 3d 26 31  |% . block%!16=&1|
00007d20  37 32 30 41 31 30 42 0d  04 2f 18 62 6c 6f 63 6b  |720A10B../.block|
00007d30  25 21 32 30 3d 62 6c 6f  63 6b 25 2b 31 32 38 0d  |%!20=block%+128.|
00007d40  04 30 18 62 6c 6f 63 6b  25 21 32 34 3d 73 70 72  |.0.block%!24=spr|
00007d50  69 74 65 70 74 72 25 0d  04 31 16 62 6c 6f 63 6b  |iteptr%..1.block|
00007d60  25 21 32 38 3d a9 28 6c  65 61 66 24 29 0d 04 32  |%!28=.(leaf$)..2|
00007d70  1d c8 99 22 57 69 6d 70  5f 50 6c 6f 74 49 63 6f  |..."Wimp_PlotIco|
00007d80  6e 22 2c 2c 62 6c 6f 63  6b 25 0d 04 33 05 e1 0d  |n",,block%..3...|
00007d90  04 34 05 3a 0d 04 35 14  dd 20 f2 73 65 74 63 6c  |.4.:..5.. .setcl|
00007da0  69 70 77 69 64 74 68 73  0d 04 36 2d ea 20 66 69  |ipwidths..6-. fi|
00007db0  78 65 64 25 2c 70 74 72  25 2c 63 6f 75 6e 74 25  |xed%,ptr%,count%|
00007dc0  2c 6e 61 6d 65 73 25 2c  6f 6c 64 24 2c 63 6c 69  |,names%,old$,cli|
00007dd0  70 5f 74 6f 25 0d 04 37  2c 70 74 72 25 3d 21 69  |p_to%..7,ptr%=!i|
00007de0  63 6f 6e 5f 77 69 64 74  68 73 25 3a f4 20 61 64  |con_widths%:. ad|
00007df0  64 72 65 73 73 20 74 6f  20 77 72 69 74 65 20 74  |dress to write t|
00007e00  6f 0d 04 38 30 6e 61 6d  65 73 25 3d 21 69 63 6f  |o..80names%=!ico|
00007e10  6e 5f 69 6e 64 65 78 25  3a f4 20 20 70 6f 69 6e  |n_index%:.  poin|
00007e20  74 65 72 73 20 74 6f 20  6c 65 61 66 6e 61 6d 65  |ters to leafname|
00007e30  73 0d 04 39 47 63 6f 75  6e 74 25 3d 21 28 6e 61  |s..9Gcount%=!(na|
00007e40  6d 65 73 25 29 3a f4 20  6e 6f 20 6f 66 20 66 69  |mes%):. no of fi|
00007e50  6c 65 73 20 69 73 20 73  74 6f 72 65 64 20 61 74  |les is stored at|
00007e60  20 73 74 61 72 74 20 6f  66 20 70 6f 69 6e 74 65  | start of pointe|
00007e70  72 73 20 62 6c 6f 63 6b  0d 04 3a 1a 63 6c 69 70  |rs block..:.clip|
00007e80  5f 74 6f 25 3d 63 6c 69  70 77 69 64 74 68 25 2d  |_to%=clipwidth%-|
00007e90  31 36 0d 04 3b 10 e7 20  6e 6f 74 66 6f 6e 74 25  |16..;.. notfont%|
00007ea0  20 8c 0d 04 3c 2c 20 c8  99 20 22 4f 53 5f 52 65  | ...<, .. "OS_Re|
00007eb0  61 64 4d 6f 64 65 56 61  72 69 61 62 6c 65 22 2c  |adModeVariable",|
00007ec0  2d 31 2c 34 20 b8 20 2c  2c 78 65 69 67 25 0d 04  |-1,4 . ,,xeig%..|
00007ed0  3d 2d 20 66 69 78 65 64  25 3d 28 63 6c 69 70 5f  |=- fixed%=(clip_|
00007ee0  74 6f 25 2d 28 38 3c 3c  78 65 69 67 25 29 29 20  |to%-(8<<xeig%)) |
00007ef0  2f 28 38 3c 3c 78 65 69  67 25 29 0d 04 3e 35 20  |/(8<<xeig%)..>5 |
00007f00  f4 20 38 3c 3c 78 65 69  67 25 20 69 73 20 77 69  |. 8<<xeig% is wi|
00007f10  64 74 68 20 6f 66 20 6f  6e 65 20 73 79 73 74 65  |dth of one syste|
00007f20  6d 20 66 6f 6e 74 20 63  68 61 72 61 63 74 65 72  |m font character|
00007f30  0d 04 3f 05 cd 0d 04 40  13 e3 20 6e 25 3d 31 20  |..?....@.. n%=1 |
00007f40  b8 20 63 6f 75 6e 74 25  0d 04 41 1d 20 6c 65 61  |. count%..A. lea|
00007f50  66 24 3d 24 28 6e 61 6d  65 73 25 21 28 34 2b 34  |f$=$(names%!(4+4|
00007f60  2a 6e 25 29 29 0d 04 42  29 20 f4 20 69 63 6f 6e  |*n%))..B) . icon|
00007f70  20 6e 75 6d 62 65 72 73  20 67 6f 20 66 72 6f 6d  | numbers go from|
00007f80  20 30 20 74 6f 20 63 6f  75 6e 74 25 2d 31 0d 04  | 0 to count%-1..|
00007f90  43 2f 20 f4 20 62 75 74  20 62 6c 6f 63 6b 20 6f  |C/ . but block o|
00007fa0  66 20 70 6f 69 6e 74 65  72 73 20 73 74 61 72 74  |f pointers start|
00007fb0  73 20 61 74 20 6e 61 6d  65 73 25 21 38 0d 04 44  |s at names%!8..D|
00007fc0  2e 20 f4 20 73 6f 20 77  65 20 62 61 6c 61 6e 63  |. . so we balanc|
00007fd0  65 20 6f 75 74 20 62 79  20 61 64 64 69 6e 67 20  |e out by adding |
00007fe0  6f 66 66 73 65 74 20 6f  66 20 34 0d 04 45 0c 20  |offset of 4..E. |
00007ff0  21 70 74 72 25 3d 30 0d  04 46 13 20 e7 20 6e 6f  |!ptr%=0..F. . no|
00008000  74 66 6f 6e 74 25 3d b9  20 8c 0d 04 47 34 20 20  |tfont%=. ...G4  |
00008010  e7 20 a4 73 74 72 69 6e  67 6c 65 6e 67 74 68 28  |. .stringlength(|
00008020  6c 65 61 66 24 29 3e 63  6c 69 70 5f 74 6f 25 20  |leaf$)>clip_to% |
00008030  8c 20 21 70 74 72 25 3d  66 69 78 65 64 25 0d 04  |. !ptr%=fixed%..|
00008040  48 06 20 cc 0d 04 49 11  20 20 20 6f 6c 64 24 3d  |H. ...I.   old$=|
00008050  6c 65 61 66 24 0d 04 4a  27 20 20 20 c8 95 20 a4  |leaf$..J'   .. .|
00008060  73 74 72 69 6e 67 6c 65  6e 67 74 68 28 6c 65 61  |stringlength(lea|
00008070  66 24 29 3e 63 6c 69 70  5f 74 6f 25 0d 04 4b 27  |f$)>clip_to%..K'|
00008080  20 20 20 20 20 6c 65 61  66 24 3d c0 6c 65 61 66  |     leaf$=.leaf|
00008090  24 2c a9 28 6c 65 61 66  24 29 2d 34 29 2b 22 2e  |$,.(leaf$)-4)+".|
000080a0  2e 2e 22 0d 04 4c 08 20  20 20 ce 0d 04 4d 27 20  |.."..L.   ...M' |
000080b0  20 20 e7 20 6f 6c 64 24  3c 3e 6c 65 61 66 24 20  |  . old$<>leaf$ |
000080c0  8c 20 21 70 74 72 25 3d  a9 28 6c 65 61 66 24 29  |. !ptr%=.(leaf$)|
000080d0  2d 32 0d 04 4e 30 20 20  20 f4 20 73 68 6f 75 6c  |-2..N0   . shoul|
000080e0  64 20 62 65 20 2d 33 20  62 75 74 20 6c 6f 6f 6b  |d be -3 but look|
000080f0  73 20 62 65 74 74 65 72  20 74 68 69 73 20 77 61  |s better this wa|
00008100  79 21 0d 04 4f 05 cd 0d  04 50 0c 20 70 74 72 25  |y!..O....P. ptr%|
00008110  2b 3d 34 0d 04 51 08 ed  20 6e 25 0d 04 52 30 f4  |+=4..Q.. n%..R0.|
00008120  20 73 65 74 20 75 70 20  61 20 62 6c 6f 63 6b 20  | set up a block |
00008130  69 6e 64 69 63 61 74 69  6e 67 20 6c 65 6e 67 74  |indicating lengt|
00008140  68 20 6f 66 20 73 74 72  69 6e 67 0d 04 53 04 0d  |h of string..S..|
00008150  04 54 05 e1 0d 04 55 05  3a 0d 04 56 1b dd 20 f2  |.T....U.:..V.. .|
00008160  66 6f 72 63 65 72 65 64  72 61 77 28 77 69 6e 64  |forceredraw(wind|
00008170  6f 77 25 29 0d 04 57 3f  f4 20 63 61 6c 6c 20 74  |ow%)..W?. call t|
00008180  68 69 73 20 77 68 65 6e  20 79 6f 75 20 6e 65 65  |his when you nee|
00008190  64 20 74 6f 20 63 68 61  6e 67 65 20 73 6f 6d 65  |d to change some|
000081a0  74 68 69 6e 67 20 69 6e  20 66 61 6b 65 66 69 6c  |thing in fakefil|
000081b0  65 72 25 0d 04 58 13 21  62 6c 6f 63 6b 25 3d 77  |er%..X.!block%=w|
000081c0  69 6e 64 6f 77 25 0d 04  59 23 c8 99 22 57 69 6d  |indow%..Y#.."Wim|
000081d0  70 5f 47 65 74 57 69 6e  64 6f 77 53 74 61 74 65  |p_GetWindowState|
000081e0  22 2c 2c 62 6c 6f 63 6b  25 0d 04 5a 30 e7 20 77  |",,block%..Z0. w|
000081f0  69 6e 64 6f 77 25 3d 70  61 6e 65 70 61 74 68 25  |indow%=panepath%|
00008200  20 8c 20 62 6c 6f 63 6b  25 21 34 3d 62 6c 6f 63  | . block%!4=bloc|
00008210  6b 25 21 31 32 2d 32 30  30 0d 04 5b 1d f4 20 6f  |k%!12-200..[.. o|
00008220  6e 6c 79 20 72 65 64 72  61 77 20 65 6e 64 20 6f  |nly redraw end o|
00008230  66 20 69 63 6f 6e 0d 04  5c 41 c8 99 22 57 69 6d  |f icon..\A.."Wim|
00008240  70 5f 46 6f 72 63 65 52  65 64 72 61 77 22 2c 2d  |p_ForceRedraw",-|
00008250  31 2c 62 6c 6f 63 6b 25  21 34 2c 62 6c 6f 63 6b  |1,block%!4,block|
00008260  25 21 38 2c 62 6c 6f 63  6b 25 21 31 32 2c 62 6c  |%!8,block%!12,bl|
00008270  6f 63 6b 25 21 31 36 0d  04 5d 32 f4 20 6e 6f 77  |ock%!16..]2. now|
00008280  20 61 20 72 65 64 72 61  77 20 72 65 71 75 65 73  | a redraw reques|
00008290  74 20 77 69 6c 6c 20 63  6f 6d 65 20 76 69 61 20  |t will come via |
000082a0  57 69 6d 70 5f 50 6f 6c  6c 0d 04 5e 05 e1 0d 04  |Wimp_Poll..^....|
000082b0  5f 05 3a 0d 04 60 51 f4  20 2d 2d 2d 66 75 6e 63  |_.:..`Q. ---func|
000082c0  74 69 6f 6e 73 20 63 61  6c 6c 65 64 20 77 68 65  |tions called whe|
000082d0  6e 20 6f 62 6a 65 63 74  73 20 61 72 65 20 64 72  |n objects are dr|
000082e0  61 67 67 65 64 20 69 6e  2f 6f 75 74 20 6f 66 20  |agged in/out of |
000082f0  49 6e 66 6f 7a 69 70 2d  2d 2d 2d 2d 2d 2d 2d 2d  |Infozip---------|
00008300  2d 2d 2d 2d 0d 04 61 05  3a 0d 04 62 19 dd 20 f2  |----..a.:..b.. .|
00008310  64 72 61 67 67 65 64 5f  6f 75 74 28 70 61 74 68  |dragged_out(path|
00008320  24 29 0d 04 63 0b ea 20  61 24 2c 69 25 0d 04 64  |$)..c.. a$,i%..d|
00008330  07 ea 20 85 0d 04 65 41  ee 20 85 20 ea 20 f7 20  |.. ...eA. . . . |
00008340  85 3a f2 72 65 70 6f 72  74 28 f6 24 2b 22 20 61  |.:.report(.$+" a|
00008350  74 20 6c 69 6e 65 20 22  2b c3 20 9e 2c 31 29 3a  |t line "+. .,1):|
00008360  f2 72 65 64 72 61 77 69  63 6f 6e 62 61 72 28 22  |.redrawiconbar("|
00008370  4e 22 29 3a e1 0d 04 66  2a e7 20 77 73 61 76 65  |N"):...f*. wsave|
00008380  77 25 3d 66 61 6b 65 66  69 6c 65 72 25 20 8c 20  |w%=fakefiler% . |
00008390  61 63 74 69 6f 6e 24 3d  22 75 6e 7a 69 70 22 0d  |action$="unzip".|
000083a0  04 67 4c f4 20 69 6e 20  63 61 73 65 20 79 6f 75  |.gL. in case you|
000083b0  20 68 61 76 65 20 6f 70  65 6e 65 64 20 74 68 65  | have opened the|
000083c0  20 27 63 72 65 61 74 65  27 20 6d 65 6e 75 20 73  | 'create' menu s|
000083d0  69 6e 63 65 20 75 6e 7a  69 70 70 69 6e 67 20 74  |ince unzipping t|
000083e0  68 69 73 20 7a 69 70 66  69 6c 65 0d 04 68 11 77  |his zipfile..h.w|
000083f0  61 69 74 24 3d 61 63 74  69 6f 6e 24 0d 04 69 14  |ait$=action$..i.|
00008400  20 20 20 20 c8 8e 20 61  63 74 69 6f 6e 24 20 ca  |    .. action$ .|
00008410  0d 04 6a 12 20 20 20 20  20 20 c9 20 22 7a 69 70  |..j.      . "zip|
00008420  22 3a 0d 04 6b 18 20 20  20 20 20 20 20 20 e7 20  |":..k.        . |
00008430  63 68 69 6c 64 25 3d 30  20 8c 0d 04 6c 4a 20 20  |child%=0 ...lJ  |
00008440  20 20 20 20 20 20 20 20  e7 20 62 6c 6f 63 6b 25  |        . block%|
00008450  21 33 36 3d 2d 31 20 8c  20 ff 22 52 65 6d 6f 76  |!36=-1 . ."Remov|
00008460  65 20 3c 57 69 6d 70 24  53 63 72 61 70 3e 22 3a  |e <Wimp$Scrap>":|
00008470  70 61 74 68 24 3d 22 3c  57 69 6d 70 24 53 63 72  |path$="<Wimp$Scr|
00008480  61 70 3e 22 0d 04 6d 1c  20 20 20 20 20 20 20 20  |ap>"..m.        |
00008490  20 20 7a 69 70 66 69 6c  65 24 3d 70 61 74 68 24  |  zipfile$=path$|
000084a0  0d 04 6e 29 20 20 20 20  20 20 20 20 20 20 f2 44  |..n)          .D|
000084b0  69 72 28 a4 70 61 74 68  6e 61 6d 65 28 6e 6f 74  |ir(.pathname(not|
000084c0  7a 69 70 70 65 64 24 29  29 0d 04 6f 37 20 20 20  |zipped$))..o7   |
000084d0  20 20 20 20 20 20 20 63  68 69 6c 64 25 3d a4 63  |       child%=.c|
000084e0  68 69 6c 64 74 61 73 6b  28 a4 63 6f 6d 6d 61 6e  |hildtask(.comman|
000084f0  64 6c 69 6e 65 28 22 7a  69 70 22 2c 22 22 29 29  |dline("zip",""))|
00008500  0d 04 70 0d 20 20 20 20  20 20 20 20 cc 0d 04 71  |..p.        ...q|
00008510  13 20 20 20 20 20 20 20  20 20 20 f2 62 75 73 79  |.          .busy|
00008520  0d 04 72 0d 20 20 20 20  20 20 20 20 cd 0d 04 73  |..r.        ...s|
00008530  30 20 20 20 20 20 20 20  20 f2 63 6c 6f 73 65 28  |0        .close(|
00008540  73 61 76 65 25 29 3a c8  99 22 57 69 6d 70 5f 43  |save%):.."Wimp_C|
00008550  72 65 61 74 65 4d 65 6e  75 22 2c 2d 31 0d 04 74  |reateMenu",-1..t|
00008560  2c 20 20 20 20 20 20 c9  20 22 75 6e 7a 69 70 22  |,      . "unzip"|
00008570  3a e7 20 70 61 74 68 24  3d 22 3c 57 69 6d 70 24  |:. path$="<Wimp$|
00008580  53 63 72 61 70 3e 22 20  8c 0d 04 75 47 20 20 20  |Scrap>" ...uG   |
00008590  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000085a0  20 20 20 70 61 72 61 6d  31 24 3d a4 6d 65 73 73  |   param1$=.mess|
000085b0  61 67 65 5f 6c 6f 6f 6b  75 70 28 22 73 61 76 58  |age_lookup("savX|
000085c0  61 70 70 22 29 3a 70 61  72 61 6d 32 24 3d 22 22  |app"):param2$=""|
000085d0  0d 04 76 04 0d 04 77 3d  20 20 20 20 20 20 20 20  |..v...w=        |
000085e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 f2 72  |              .r|
000085f0  65 70 6f 72 74 28 a4 6d  65 73 73 61 67 65 5f 6c  |eport(.message_l|
00008600  6f 6f 6b 73 75 62 28 22  73 61 76 58 22 29 2c 31  |ooksub("savX"),1|
00008610  29 0d 04 78 18 20 20 20  20 20 20 20 20 20 20 20  |)..x.           |
00008620  20 20 20 20 20 20 20 20  cc 0d 04 79 3a 20 20 20  |        ...y:   |
00008630  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008640  20 20 e7 20 77 73 61 76  65 77 25 3d 66 61 6b 65  |  . wsavew%=fake|
00008650  66 69 6c 65 72 25 20 80  20 63 68 69 6c 64 25 3d  |filer% . child%=|
00008660  30 20 8c 0d 04 7a 2c 20  20 20 20 20 20 20 20 20  |0 ...z,         |
00008670  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 6e  |               n|
00008680  6f 74 7a 69 70 70 65 64  24 3d 70 61 74 68 24 0d  |otzipped$=path$.|
00008690  04 7b 4f 20 20 20 20 20  20 20 20 20 20 20 20 20  |.{O             |
000086a0  20 20 20 20 20 20 20 20  20 20 20 e7 20 61 6c 6c  |           . all|
000086b0  25 20 8c 20 61 24 3d 22  61 6c 6c 22 20 8b 20 61  |% . a$="all" . a|
000086c0  24 3d a4 77 68 69 63 68  66 61 6b 65 73 70 72 69  |$=.whichfakespri|
000086d0  74 65 28 77 73 61 76 65  64 72 61 67 25 29 0d 04  |te(wsavedrag%)..|
000086e0  7c 47 20 20 20 20 20 20  20 20 20 20 20 20 20 20  ||G              |
000086f0  20 20 20 20 20 20 20 20  20 20 63 68 69 6c 64 25  |          child%|
00008700  3d a4 63 68 69 6c 64 74  61 73 6b 28 a4 63 6f 6d  |=.childtask(.com|
00008710  6d 61 6e 64 6c 69 6e 65  28 22 75 6e 7a 69 70 22  |mandline("unzip"|
00008720  2c 61 24 29 29 0d 04 7d  1a 20 20 20 20 20 20 20  |,a$))..}.       |
00008730  20 20 20 20 20 20 20 20  20 20 20 20 20 20 cd 0d  |              ..|
00008740  04 7e 18 20 20 20 20 20  20 20 20 20 20 20 20 20  |.~.             |
00008750  20 20 20 20 20 20 cd 0d  04 7f 3d 20 20 20 20 20  |      ....=     |
00008760  20 c9 20 22 63 72 65 61  74 65 22 3a ff 22 43 72  | . "create":."Cr|
00008770  65 61 74 65 20 22 2b 70  61 74 68 24 2b 22 20 31  |eate "+path$+" 1|
00008780  36 22 3a f4 20 73 69 7a  65 20 69 73 20 69 6e 20  |6":. size is in |
00008790  48 45 58 21 0d 04 80 22  20 20 20 20 20 20 20 20  |HEX!..."        |
000087a0  20 20 20 20 20 20 20 20  20 20 20 20 69 25 3d ad  |            i%=.|
000087b0  20 70 61 74 68 24 0d 04  81 32 20 20 20 20 20 20  | path$...2      |
000087c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 d5 23  |              .#|
000087d0  69 25 2c 22 50 4b 22 2b  bd 35 2b bd 36 2b c4 31  |i%,"PK"+.5+.6+.1|
000087e0  38 2c bd 28 30 29 29 3b  0d 04 82 1c 20 20 20 20  |8,.(0));....    |
000087f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00008800  d9 23 69 25 0d 04 83 3b  20 20 20 20 20 20 20 20  |.#i%...;        |
00008810  20 20 20 20 20 20 20 20  20 20 20 20 ff 22 53 65  |            ."Se|
00008820  74 54 79 70 65 20 22 2b  70 61 74 68 24 2b 22 20  |tType "+path$+" |
00008830  22 2b c2 73 61 76 65 69  63 6f 6e 24 2c 33 29 0d  |"+.saveicon$,3).|
00008840  04 84 42 20 20 20 20 20  20 20 20 20 20 20 20 20  |..B             |
00008850  20 20 20 20 20 20 20 f4  20 63 6c 6f 73 65 20 6e  |       . close n|
00008860  65 77 20 61 72 63 68 69  76 65 20 64 69 61 6c 6f  |ew archive dialo|
00008870  67 75 65 20 61 6e 64 20  6d 65 6e 75 20 74 72 65  |gue and menu tre|
00008880  65 0d 04 85 3d 20 20 20  20 20 20 20 20 20 20 20  |e...=           |
00008890  20 20 20 20 20 20 20 20  20 c8 99 20 22 57 69 6d  |         .. "Wim|
000088a0  70 5f 43 72 65 61 74 65  4d 65 6e 75 22 2c 2d 31  |p_CreateMenu",-1|
000088b0  3a f2 63 6c 6f 73 65 28  73 61 76 65 25 29 0d 04  |:.close(save%)..|
000088c0  86 37 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.7              |
000088d0  20 20 20 20 20 20 69 25  3d a4 64 72 61 67 67 65  |      i%=.dragge|
000088e0  64 5f 69 6e 28 62 61 72  25 2c 26 44 44 43 2c 70  |d_in(bar%,&DDC,p|
000088f0  61 74 68 24 29 0d 04 87  09 20 20 20 20 cb 0d 04  |ath$)....    ...|
00008900  88 05 e1 0d 04 89 04 0d  04 8a 0f dd 20 f2 70 72  |............ .pr|
00008910  65 73 65 72 76 65 0d 04  8b 08 ea 20 78 25 0d 04  |eserve..... x%..|
00008920  8c 19 e3 20 78 25 3d 30  20 b8 20 62 6c 6f 63 6b  |... x%=0 . block|
00008930  25 21 30 20 88 20 34 0d  04 8d 1c 20 20 70 72 65  |%!0 . 4....  pre|
00008940  73 65 72 76 65 25 21 78  25 3d 62 6c 6f 63 6b 25  |serve%!x%=block%|
00008950  21 78 25 0d 04 8e 05 ed  0d 04 8f 05 e1 0d 04 90  |!x%.............|
00008960  04 0d 04 91 19 dd 20 f2  67 6f 74 44 61 74 61 4c  |...... .gotDataL|
00008970  6f 61 64 28 6e 61 6d 65  24 29 0d 04 92 12 ea 20  |oad(name$)..... |
00008980  64 61 74 61 6c 6f 61 64  25 2c 6e 25 0d 04 93 46  |dataload%,n%...F|
00008990  64 61 74 61 6c 6f 61 64  25 3d 74 65 6d 70 25 2b  |dataload%=temp%+|
000089a0  32 35 36 2b 36 34 3a f4  20 61 62 6f 76 65 20 73  |256+64:. above s|
000089b0  63 72 61 74 63 68 20 73  70 61 63 65 20 61 6e 64  |cratch space and|
000089c0  20 6f 70 65 6e 77 69 6e  64 6f 77 20 62 75 66 66  | openwindow buff|
000089d0  65 72 0d 04 94 13 e3 20  6e 25 3d 30 20 b8 20 34  |er..... n%=0 . 4|
000089e0  30 20 88 20 34 0d 04 95  1c 20 20 64 61 74 61 6c  |0 . 4....  datal|
000089f0  6f 61 64 25 21 6e 25 3d  62 6c 6f 63 6b 25 21 6e  |oad%!n%=block%!n|
00008a00  25 0d 04 96 05 ed 0d 04  97 25 e7 20 62 6c 6f 63  |%........%. bloc|
00008a10  6b 25 21 31 36 3d 35 20  6e 25 3d 30 20 8b 20 6e  |k%!16=5 n%=0 . n|
00008a20  25 3d 62 6c 6f 63 6b 25  21 32 30 0d 04 98 2b e7  |%=block%!20...+.|
00008a30  20 a4 64 72 61 67 67 65  64 5f 69 6e 28 6e 25 2c  | .dragged_in(n%,|
00008a40  62 6c 6f 63 6b 25 21 34  30 2c 6e 61 6d 65 24 29  |block%!40,name$)|
00008a50  3d 30 20 8c 20 e1 0d 04  99 13 e3 20 6e 25 3d 30  |=0 . ...... n%=0|
00008a60  20 b8 20 34 30 20 88 20  34 0d 04 9a 1c 20 20 62  | . 40 . 4....  b|
00008a70  6c 6f 63 6b 25 21 6e 25  3d 64 61 74 61 6c 6f 61  |lock%!n%=dataloa|
00008a80  64 25 21 6e 25 0d 04 9b  05 ed 0d 04 9c 1d 62 6c  |d%!n%.........bl|
00008a90  6f 63 6b 25 21 31 36 3d  34 3a f4 20 44 61 74 61  |ock%!16=4:. Data|
00008aa0  4c 6f 61 64 41 63 6b 0d  04 9d 28 62 6c 6f 63 6b  |LoadAck...(block|
00008ab0  25 21 31 32 3d 64 61 74  61 6c 6f 61 64 25 21 38  |%!12=dataload%!8|
00008ac0  3a f4 20 73 65 6e 64 65  72 27 73 20 72 65 66 0d  |:. sender's ref.|
00008ad0  04 9e 16 24 28 62 6c 6f  63 6b 25 2b 34 34 29 3d  |...$(block%+44)=|
00008ae0  6e 61 6d 65 24 0d 04 9f  2e c8 99 22 57 69 6d 70  |name$......"Wimp|
00008af0  5f 53 65 6e 64 4d 65 73  73 61 67 65 22 2c 31 37  |_SendMessage",17|
00008b00  2c 62 6c 6f 63 6b 25 2c  64 61 74 61 6c 6f 61 64  |,block%,dataload|
00008b10  25 21 34 0d 04 a0 05 e1  0d 04 a1 04 0d 04 a2 27  |%!4............'|
00008b20  dd 20 a4 64 72 61 67 67  65 64 5f 69 6e 28 77 69  |. .dragged_in(wi|
00008b30  6e 64 6f 77 25 2c 66 74  79 70 65 25 2c 70 61 74  |ndow%,ftype%,pat|
00008b40  68 24 29 0d 04 a3 1d ea  20 52 49 53 43 4f 53 24  |h$)..... RISCOS$|
00008b50  2c 73 6c 61 73 68 25 2c  6c 6f 61 64 25 2c 61 24  |,slash%,load%,a$|
00008b60  0d 04 a4 07 ea 20 85 0d  04 a5 61 ee 20 85 20 ea  |..... ....a. . .|
00008b70  20 f7 20 85 3a 70 61 72  61 6d 31 24 3d 70 61 74  | . .:param1$=pat|
00008b80  68 24 3a 70 61 72 61 6d  32 24 3d 22 22 3a f2 72  |h$:param2$="":.r|
00008b90  65 70 6f 72 74 28 a4 6d  65 73 73 61 67 65 5f 6c  |eport(.message_l|
00008ba0  6f 6f 6b 73 75 62 28 22  6c 6f 61 58 22 29 2c 31  |ooksub("loaX"),1|
00008bb0  29 3a f2 72 65 64 72 61  77 69 63 6f 6e 62 61 72  |):.redrawiconbar|
00008bc0  28 22 4e 22 29 3a 3d 30  0d 04 a6 27 e7 20 63 68  |("N"):=0...'. ch|
00008bd0  69 6c 64 25 3c 3e 30 20  80 20 77 69 6e 64 6f 77  |ild%<>0 . window|
00008be0  25 3c 3e 30 20 8c 20 f2  62 75 73 79 3a 3d 30 0d  |%<>0 . .busy:=0.|
00008bf0  04 a7 46 f4 20 49 66 20  77 69 6e 64 6f 77 25 3d  |..F. If window%=|
00008c00  30 20 74 68 65 6e 20 74  68 69 73 20 66 69 6c 65  |0 then this file|
00008c10  20 77 61 73 20 64 6f 75  62 6c 65 2d 63 6c 69 63  | was double-clic|
00008c20  6b 65 64 20 6f 6e 20 61  6e 64 20 6d 61 79 20 6e  |ked on and may n|
00008c30  6f 74 20 62 65 0d 04 a8  43 f4 20 69 6e 74 65 6e  |ot be...C. inten|
00008c40  64 65 64 20 66 6f 72 20  49 6e 66 6f 7a 69 70 20  |ded for Infozip |
00008c50  2d 20 73 6f 20 64 6f 6e  27 74 20 74 68 72 6f 77  |- so don't throw|
00008c60  20 61 77 61 79 20 63 75  72 72 65 6e 74 20 73 65  | away current se|
00008c70  74 75 70 20 79 65 74 21  0d 04 a9 0f c8 8e 20 77  |tup yet!...... w|
00008c80  69 6e 64 6f 77 25 ca 0d  04 aa 4b 20 20 c9 20 30  |indow%....K  . 0|
00008c90  3a e7 20 a4 63 68 65 63  6b 74 79 70 65 28 70 61  |:. .checktype(pa|
00008ca0  74 68 24 29 3d 26 44 44  43 20 8c 20 f2 63 6c 65  |th$)=&DDC . .cle|
00008cb0  61 72 73 65 74 75 70 3a  f2 75 6e 7a 69 70 69 74  |arsetup:.unzipit|
00008cc0  3a 6c 6f 61 64 25 3d 31  3a 8b 20 6c 6f 61 64 25  |:load%=1:. load%|
00008cd0  3d 30 0d 04 ab 0d 20 20  c9 20 62 61 72 25 3a 0d  |=0....  . bar%:.|
00008ce0  04 ac 13 20 20 20 20 f2  63 6c 65 61 72 73 65 74  |...    .clearset|
00008cf0  75 70 0d 04 ad 1d 20 20  20 20 c8 8e 20 a4 63 68  |up....    .. .ch|
00008d00  65 63 6b 74 79 70 65 28  70 61 74 68 24 29 ca 0d  |ecktype(path$)..|
00008d10  04 ae 3b 20 20 20 20 20  20 c9 26 44 44 43 3a e7  |..;      .&DDC:.|
00008d20  20 a6 28 2d 32 29 20 8c  20 f2 73 65 6c 66 65 78  | .(-2) . .selfex|
00008d30  74 72 61 63 74 69 6e 67  28 70 61 74 68 24 29 20  |tracting(path$) |
00008d40  8b 20 f2 75 6e 7a 69 70  69 74 0d 04 af 19 20 20  |. .unzipit....  |
00008d50  20 20 20 20 20 20 20 20  20 20 20 20 6c 6f 61 64  |            load|
00008d60  25 3d 31 0d 04 b0 37 20  20 20 20 20 20 c9 2d 31  |%=1...7      .-1|
00008d70  3a f2 61 6c 65 72 74 62  6f 78 28 a4 6d 65 73 73  |:.alertbox(.mess|
00008d80  61 67 65 5f 6c 6f 6f 6b  75 70 28 22 73 70 6b 22  |age_lookup("spk"|
00008d90  29 29 3a 6c 6f 61 64 25  3d 30 0d 04 b1 3a 20 20  |)):load%=0...:  |
00008da0  20 20 20 20 c9 26 46 43  41 3a f2 61 6c 65 72 74  |    .&FCA:.alert|
00008db0  62 6f 78 28 a4 6d 65 73  73 61 67 65 5f 6c 6f 6f  |box(.message_loo|
00008dc0  6b 75 70 28 22 73 71 73  68 22 29 29 3a 6c 6f 61  |kup("sqsh")):loa|
00008dd0  64 25 3d 30 0d 04 b2 0b  20 20 20 20 20 20 7f 0d  |d%=0....      ..|
00008de0  04 b3 4b 20 20 20 20 20  20 20 20 52 49 53 43 4f  |..K        RISCO|
00008df0  53 24 3d a4 6c 65 61 66  6e 61 6d 65 28 70 61 74  |S$=.leafname(pat|
00008e00  68 24 29 3a e7 20 c0 52  49 53 43 4f 53 24 2c 31  |h$):. .RISCOS$,1|
00008e10  29 3d 22 21 22 8c 20 52  49 53 43 4f 53 24 3d c1  |)="!". RISCOS$=.|
00008e20  52 49 53 43 4f 53 24 2c  32 29 0d 04 b4 1c 20 20  |RISCOS$,2)....  |
00008e30  20 20 20 20 20 20 6e 6f  74 7a 69 70 70 65 64 24  |      notzipped$|
00008e40  3d 70 61 74 68 24 0d 04  b5 20 20 20 20 20 20 20  |=path$...       |
00008e50  20 20 73 6c 61 73 68 25  3d a7 52 49 53 43 4f 53  |  slash%=.RISCOS|
00008e60  24 2c 22 2f 22 29 0d 04  b6 30 20 20 20 20 20 20  |$,"/")...0      |
00008e70  20 20 e7 20 73 6c 61 73  68 25 8c 20 52 49 53 43  |  . slash%. RISC|
00008e80  4f 53 24 3d c0 52 49 53  43 4f 53 24 2c 73 6c 61  |OS$=.RISCOS$,sla|
00008e90  73 68 25 2d 31 29 0d 04  b7 36 20 20 20 20 20 20  |sh%-1)...6      |
00008ea0  20 20 e7 20 75 6e 69 78  66 6c 61 67 25 20 52 49  |  . unixflag% RI|
00008eb0  53 43 4f 53 24 3d a4 6c  6f 77 65 72 28 52 49 53  |SCOS$=.lower(RIS|
00008ec0  43 4f 53 24 29 2b 22 2f  7a 69 70 22 0d 04 b8 53  |COS$)+"/zip"...S|
00008ed0  20 20 20 20 20 20 20 20  f2 73 65 74 69 63 6f 6e  |        .seticon|
00008ee0  74 65 78 74 28 73 61 76  65 25 2c 31 2c 52 49 53  |text(save%,1,RIS|
00008ef0  43 4f 53 24 29 3a f2 63  68 61 6e 67 65 74 69 74  |COS$):.changetit|
00008f00  6c 65 28 73 61 76 65 25  2c a4 6d 65 73 73 61 67  |le(save%,.messag|
00008f10  65 5f 6c 6f 6f 6b 75 70  28 22 53 31 22 29 29 0d  |e_lookup("S1")).|
00008f20  04 b9 1e 20 20 20 20 20  20 20 20 f2 63 6c 6f 73  |...        .clos|
00008f30  65 28 66 61 6b 65 66 69  6c 65 72 25 29 0d 04 ba  |e(fakefiler%)...|
00008f40  1c 20 20 20 20 20 20 20  20 f2 70 6f 70 75 70 73  |.        .popups|
00008f50  61 76 65 77 69 6e 64 6f  77 0d 04 bb 1e 20 20 20  |avewindow....   |
00008f60  20 20 20 20 20 6c 61 73  74 5f 6f 70 65 6e 65 64  |     last_opened|
00008f70  25 3d 73 61 76 65 25 0d  04 bc 24 20 20 20 20 20  |%=save%...$     |
00008f80  20 20 20 f2 70 75 74 63  61 72 65 74 69 6e 69 63  |   .putcaretinic|
00008f90  6f 6e 28 73 61 76 65 25  2c 31 29 0d 04 bd 19 20  |on(save%,1).... |
00008fa0  20 20 20 20 20 20 20 61  63 74 69 6f 6e 24 3d 22  |       action$="|
00008fb0  7a 69 70 22 0d 04 be 13  20 20 20 20 20 20 20 20  |zip"....        |
00008fc0  6c 6f 61 64 25 3d 31 0d  04 bf 09 20 20 20 20 cb  |load%=1....    .|
00008fd0  0d 04 c0 1d 20 20 c9 20  66 61 6b 65 66 69 6c 65  |....  . fakefile|
00008fe0  72 25 2c 20 70 61 6e 65  70 61 74 68 25 0d 04 c1  |r%, panepath%...|
00008ff0  0f 20 20 20 20 6c 6f 61  64 25 3d 31 0d 04 c2 42  |.    load%=1...B|
00009000  20 20 20 20 73 6c 61 73  68 25 3d a4 63 68 65 63  |    slash%=.chec|
00009010  6b 74 79 70 65 28 70 61  74 68 24 29 3a f4 20 73  |ktype(path$):. s|
00009020  6c 61 73 68 25 20 69 73  20 6a 75 73 74 20 61 20  |lash% is just a |
00009030  68 61 6e 64 79 20 76 61  72 69 61 62 6c 65 0d 04  |handy variable..|
00009040  c3 13 20 20 20 20 c8 8e  20 73 6c 61 73 68 25 20  |..    .. slash% |
00009050  ca 0d 04 c4 53 20 20 20  20 20 20 c9 20 2d 31 2c  |....S      . -1,|
00009060  26 46 43 41 2c 26 44 44  43 3a f2 72 65 70 6f 72  |&FCA,&DDC:.repor|
00009070  74 28 a4 6d 65 73 73 61  67 65 5f 6c 6f 6f 6b 75  |t(.message_looku|
00009080  70 28 22 7a 69 70 59 4e  22 29 2c 25 31 31 29 3a  |p("zipYN"),%11):|
00009090  73 6c 61 73 68 25 3d 28  65 72 72 63 6c 69 63 6b  |slash%=(errclick|
000090a0  25 3d 31 29 0d 04 c5 48  20 20 20 20 20 20 c9 20  |%=1)...H      . |
000090b0  30 3a 73 6c 61 73 68 25  3d 26 46 46 44 3a f4 20  |0:slash%=&FFD:. |
000090c0  61 6c 6c 6f 77 20 61 72  63 68 69 76 69 6e 67 20  |allow archiving |
000090d0  6f 66 20 75 6e 74 79 70  65 64 20 28 6c 6f 61 64  |of untyped (load|
000090e0  2f 65 78 65 63 29 20 66  69 6c 65 73 0d 04 c6 09  |/exec) files....|
000090f0  20 20 20 20 cb 0d 04 c7  12 20 20 20 20 e7 20 73  |    .....    . s|
00009100  6c 61 73 68 25 20 8c 0d  04 c8 17 20 20 20 20 20  |lash% .....     |
00009110  20 61 63 74 69 6f 6e 24  3d 22 7a 69 70 22 0d 04  | action$="zip"..|
00009120  c9 2e 20 20 20 20 20 20  6e 6f 74 7a 69 70 70 65  |..      notzippe|
00009130  64 24 3d 70 61 74 68 24  3a 64 65 6c 65 74 65 5f  |d$=path$:delete_|
00009140  6c 61 74 65 72 24 3d 70  61 74 68 24 0d 04 ca 1e  |later$=path$....|
00009150  20 20 20 20 20 20 e7 20  63 6f 6d 6d 6f 6e 70 61  |      . commonpa|
00009160  74 68 24 3c 3e 22 2a 22  20 8c 0d 04 cb 3f 20 20  |th$<>"*" ....?  |
00009170  f4 20 63 6f 70 79 20 6f  62 6a 65 63 74 20 69 6e  |. copy object in|
00009180  74 6f 20 21 53 63 72 61  70 20 61 6e 64 20 74 68  |to !Scrap and th|
00009190  65 6e 20 63 6f 6d 70 72  65 73 73 20 69 74 20 66  |en compress it f|
000091a0  72 6f 6d 20 74 68 65 72  65 0d 04 cc 4c 20 20 f4  |rom there...L  .|
000091b0  20 73 6f 20 74 68 61 74  20 77 65 20 63 61 6e 20  | so that we can |
000091c0  66 61 6b 65 20 74 68 65  20 72 69 67 68 74 20 70  |fake the right p|
000091d0  61 74 68 20 74 6f 20 63  72 65 61 74 65 20 69 74  |ath to create it|
000091e0  20 69 6e 20 74 68 65 20  63 75 72 72 65 6e 74 20  | in the current |
000091f0  6c 65 76 65 6c 0d 04 cd  16 20 20 f4 20 6f 66 20  |level....  . of |
00009200  74 68 65 20 7a 69 70 66  69 6c 65 0d 04 ce 50 20  |the zipfile...P |
00009210  20 20 20 20 20 20 20 61  24 3d a4 5f 43 44 69 72  |       a$=._CDir|
00009220  73 28 c0 63 6f 6d 6d 6f  6e 70 61 74 68 24 2c a9  |s(.commonpath$,.|
00009230  28 63 6f 6d 6d 6f 6e 70  61 74 68 24 29 2d 32 29  |(commonpath$)-2)|
00009240  29 2b 22 2e 22 2b a4 6c  65 61 66 6e 61 6d 65 28  |)+"."+.leafname(|
00009250  6e 6f 74 7a 69 70 70 65  64 24 29 0d 04 cf 2d 20  |notzipped$)...- |
00009260  20 20 20 20 20 20 20 ff  22 43 6f 70 79 20 22 2b  |       ."Copy "+|
00009270  6e 6f 74 7a 69 70 70 65  64 24 2b 61 24 2b 22 20  |notzipped$+a$+" |
00009280  7e 43 20 7e 56 20 52 22  0d 04 d0 21 20 20 20 20  |~C ~V R"...!    |
00009290  20 20 20 20 f2 44 69 72  28 22 49 6e 66 6f 53 63  |    .Dir("InfoSc|
000092a0  72 61 70 3a 61 64 64 22  29 0d 04 d1 19 20 20 20  |rap:add")....   |
000092b0  20 20 20 20 20 6e 6f 74  7a 69 70 70 65 64 24 3d  |     notzipped$=|
000092c0  61 24 0d 04 d2 27 20 20  20 20 20 20 cc 20 f2 44  |a$...'      . .D|
000092d0  69 72 28 a4 70 61 74 68  6e 61 6d 65 28 6e 6f 74  |ir(.pathname(not|
000092e0  7a 69 70 70 65 64 24 29  29 0d 04 d3 0b 20 20 20  |zipped$))....   |
000092f0  20 20 20 cd 0d 04 d4 4b  20 20 20 20 20 20 e7 20  |   ....K      . |
00009300  63 68 69 6c 64 25 3d 30  20 8c 20 77 61 69 74 24  |child%=0 . wait$|
00009310  3d 22 61 64 22 3a 63 68  69 6c 64 25 3d a4 63 68  |="ad":child%=.ch|
00009320  69 6c 64 74 61 73 6b 28  a4 63 6f 6d 6d 61 6e 64  |ildtask(.command|
00009330  6c 69 6e 65 28 22 7a 69  70 22 2c 22 22 29 29 0d  |line("zip","")).|
00009340  04 d5 40 20 20 20 20 20  20 61 63 74 69 6f 6e 24  |..@      action$|
00009350  3d 22 75 6e 7a 69 70 22  3a f4 20 72 65 73 74 6f  |="unzip":. resto|
00009360  72 65 20 27 69 6e 73 69  64 65 20 66 69 6c 65 27  |re 'inside file'|
00009370  20 64 65 66 61 75 6c 74  20 61 63 74 69 6f 6e 0d  | default action.|
00009380  04 d6 11 20 20 20 20 cc  20 6c 6f 61 64 25 3d 30  |...    . load%=0|
00009390  0d 04 d7 09 20 20 20 20  cd 0d 04 d8 05 cb 0d 04  |....    ........|
000093a0  d9 0a 3d 6c 6f 61 64 25  0d 04 da 05 3a 0d 04 db  |..=load%....:...|
000093b0  11 dd 20 f2 63 6c 65 61  72 73 65 74 75 70 0d 04  |.. .clearsetup..|
000093c0  dc 0a ea 20 70 74 72 25  0d 04 dd 1e 20 63 6f 6d  |... ptr%.... com|
000093d0  6d 6f 6e 70 61 74 68 24  3d 22 2a 22 3a 6c 65 76  |monpath$="*":lev|
000093e0  65 6c 73 25 3d 30 0d 04  de 23 20 e7 20 69 6e 25  |els%=0...# . in%|
000093f0  20 c8 99 22 58 4f 53 5f  46 69 6e 64 22 2c 30 2c  | .."XOS_Find",0,|
00009400  69 6e 25 3a 69 6e 25 3d  30 0d 04 df 34 f4 20 50  |in%:in%=0...4. P|
00009410  52 4f 43 65 78 74 65 6e  64 5f 6e 61 6d 65 64 5f  |ROCextend_named_|
00009420  73 6c 69 64 69 6e 67 5f  62 6c 6f 63 6b 28 69 63  |sliding_block(ic|
00009430  6f 6e 5f 6e 61 6d 65 73  25 2c 31 36 29 0d 04 e0  |on_names%,16)...|
00009440  2f f2 65 78 74 65 6e 64  5f 6e 61 6d 65 64 5f 73  |/.extend_named_s|
00009450  6c 69 64 69 6e 67 5f 62  6c 6f 63 6b 28 69 63 6f  |liding_block(ico|
00009460  6e 5f 69 6e 64 65 78 25  2c 31 36 29 0d 04 e1 15  |n_index%,16)....|
00009470  70 74 72 25 3d 21 69 63  6f 6e 5f 69 6e 64 65 78  |ptr%=!icon_index|
00009480  25 0d 04 e2 14 21 70 74  72 25 3d 30 3a 70 74 72  |%....!ptr%=0:ptr|
00009490  25 21 34 3d 30 0d 04 e3  05 e1 0d 04 e4 04 0d 04  |%!4=0...........|
000094a0  e5 17 dd 20 a4 63 68 65  63 6b 74 79 70 65 28 70  |... .checktype(p|
000094b0  61 74 68 24 29 0d 04 e6  12 ea 20 61 24 2c 41 25  |ath$)..... a$,A%|
000094c0  2c 66 74 79 70 65 25 0d  04 e7 29 c8 99 22 4f 53  |,ftype%...).."OS|
000094d0  5f 46 69 6c 65 22 2c 32  33 2c 70 61 74 68 24 20  |_File",23,path$ |
000094e0  b8 20 41 25 2c 2c 2c 2c  2c 2c 66 74 79 70 65 25  |. A%,,,,,,ftype%|
000094f0  0d 04 e8 1a e7 20 28 41  25 20 80 20 31 29 3d 30  |..... (A% . 1)=0|
00009500  20 8c 20 3d 66 74 79 70  65 25 0d 04 e9 38 61 24  | . =ftype%...8a$|
00009510  3d c2 22 30 30 22 2b c3  7e 28 66 74 79 70 65 25  |=."00"+.~(ftype%|
00009520  29 2c 33 29 3a f4 20 70  61 64 20 6f 75 74 20 77  |),3):. pad out w|
00009530  69 74 68 20 6c 65 61 64  69 6e 67 20 7a 65 72 6f  |ith leading zero|
00009540  65 73 0d 04 ea 35 e7 20  a7 a4 67 73 74 72 61 6e  |es...5. ..gstran|
00009550  73 28 22 3c 49 6e 66 6f  7a 69 70 24 44 6f 6e 74  |s("<Infozip$Dont|
00009560  43 6f 6d 70 72 65 73 73  3e 22 29 2c 61 24 29 20  |Compress>"),a$) |
00009570  8c 20 3d 26 46 43 41 0d  04 eb 2c f4 20 43 61 6c  |. =&FCA...,. Cal|
00009580  6c 20 61 6c 6c 20 63 6f  6d 70 72 65 73 73 65 64  |l all compressed|
00009590  20 66 69 6c 65 74 79 70  65 73 20 22 53 71 75 61  | filetypes "Squa|
000095a0  73 68 22 0d 04 ec 0e 41  25 3d 8e 20 70 61 74 68  |sh"....A%=. path|
000095b0  24 0d 04 ed 1c e7 20 a2  23 41 25 3e 32 32 20 8c  |$..... .#A%>22 .|
000095c0  20 cf 23 41 25 3d a2 23  41 25 2d 32 32 0d 04 ee  | .#A%=.#A%-22...|
000095d0  0b 61 24 3d be 23 41 25  0d 04 ef 27 e7 20 c0 61  |.a$=.#A%...'. .a|
000095e0  24 2c 32 29 3d 22 50 4b  22 20 8c 20 61 24 3d 22  |$,2)="PK" . a$="|
000095f0  7a 69 70 22 20 8b 20 61  24 3d 22 6e 6f 74 22 0d  |zip" . a$="not".|
00009600  04 f0 08 d9 23 41 25 0d  04 f1 0f c8 8e 20 66 74  |....#A%...... ft|
00009610  79 70 65 25 20 ca 0d 04  f2 37 20 20 c9 20 26 44  |ype% ....7  . &D|
00009620  44 43 2c 26 41 39 31 3a  e7 20 61 24 3c 3e 22 7a  |DC,&A91:. a$<>"z|
00009630  69 70 22 20 8c 20 66 74  79 70 65 25 3d 2d 31 20  |ip" . ftype%=-1 |
00009640  8b 20 66 74 79 70 65 25  3d 26 44 44 43 0d 04 f3  |. ftype%=&DDC...|
00009650  2f 20 20 7f 3a e7 20 61  24 3d 22 7a 69 70 22 20  |/  .:. a$="zip" |
00009660  80 20 77 69 6e 64 6f 77  25 3d 62 61 72 25 20 8c  |. window%=bar% .|
00009670  20 66 74 79 70 65 25 3d  26 44 44 43 0d 04 f4 45  | ftype%=&DDC...E|
00009680  20 20 f4 20 77 65 20 64  6f 6e 27 74 20 77 61 6e  |  . we don't wan|
00009690  74 20 64 6f 75 62 6c 65  2d 63 6c 69 63 6b 65 64  |t double-clicked|
000096a0  20 6e 6f 6e 2d 61 72 63  68 69 76 65 20 66 69 6c  | non-archive fil|
000096b0  65 73 20 74 6f 20 62 65  20 63 68 65 63 6b 65 64  |es to be checked|
000096c0  2c 0d 04 f5 29 20 20 f4  20 6f 6e 6c 79 20 74 68  |,...)  . only th|
000096d0  6f 73 65 20 64 72 61 67  67 65 64 20 74 6f 20 74  |ose dragged to t|
000096e0  68 65 20 69 63 6f 6e 62  61 72 0d 04 f6 05 cb 0d  |he iconbar......|
000096f0  04 f7 0b 3d 66 74 79 70  65 25 0d 04 f8 05 3a 0d  |...=ftype%....:.|
00009700  04 f9 0e dd 20 f2 75 6e  7a 69 70 69 74 0d 04 fa  |.... .unzipit...|
00009710  1a c8 99 22 48 6f 75 72  67 6c 61 73 73 5f 53 74  |..."Hourglass_St|
00009720  61 72 74 22 2c 35 30 0d  04 fb 1e c8 99 22 48 6f  |art",50......"Ho|
00009730  75 72 67 6c 61 73 73 5f  4c 45 44 73 22 2c 25 30  |urglass_LEDs",%0|
00009740  31 2c 25 31 31 0d 04 fc  28 e7 20 63 68 69 6c 64  |1,%11...(. child|
00009750  25 20 8c 20 c8 99 22 48  6f 75 72 67 6c 61 73 73  |% . .."Hourglass|
00009760  5f 4f 66 66 22 3a f2 62  75 73 79 3a e1 0d 04 fd  |_Off":.busy:....|
00009770  12 7a 69 70 66 69 6c 65  24 3d 70 61 74 68 24 0d  |.zipfile$=path$.|
00009780  04 fe 13 61 63 74 69 6f  6e 24 3d 22 75 6e 7a 69  |...action$="unzi|
00009790  70 22 0d 04 ff 04 0d 05  00 50 77 61 69 74 24 3d  |p".......Pwait$=|
000097a0  22 6c 69 73 74 22 3a 63  68 69 6c 64 25 3d a4 63  |"list":child%=.c|
000097b0  68 69 6c 64 74 61 73 6b  28 22 75 6e 7a 69 70 20  |hildtask("unzip |
000097c0  2d 6c 20 22 2b 7a 69 70  66 69 6c 65 24 2b 22 20  |-l "+zipfile$+" |
000097d0  20 7b 20 3e 20 49 6e 66  6f 53 63 72 61 70 3a 43  | { > InfoScrap:C|
000097e0  41 54 20 7d 22 29 0d 05  01 1a e7 20 63 68 69 6c  |AT }")..... chil|
000097f0  64 25 3d 30 8c 20 f2 74  61 73 6b 65 6e 64 65 64  |d%=0. .taskended|
00009800  0d 05 02 15 c8 99 22 48  6f 75 72 67 6c 61 73 73  |......"Hourglass|
00009810  5f 4f 66 66 22 0d 05 03  05 e1 0d 05 04 05 3a 0d  |_Off".........:.|
00009820  05 05 14 dd 20 a4 5f 43  44 69 72 73 28 70 61 74  |.... ._CDirs(pat|
00009830  68 24 29 0d 05 06 0b ea  20 6e 25 2c 6d 25 0d 05  |h$)..... n%,m%..|
00009840  07 1a 70 61 74 68 24 3d  a4 75 6e 44 4f 53 69 66  |..path$=.unDOSif|
00009850  79 28 70 61 74 68 24 29  0d 05 08 19 ff 22 43 44  |y(path$)....."CD|
00009860  69 72 20 49 6e 66 6f 53  63 72 61 70 3a 61 64 64  |ir InfoScrap:add|
00009870  22 0d 05 09 0c c8 95 20  6d 25 3c 3e 31 0d 05 0a  |"...... m%<>1...|
00009880  17 20 20 6e 25 3d a7 70  61 74 68 24 2c 22 2e 22  |.  n%=.path$,"."|
00009890  2c 6d 25 29 0d 05 0b 31  20 20 e7 20 6e 25 20 8c  |,m%)...1  . n% .|
000098a0  20 ff 20 22 43 44 69 72  20 49 6e 66 6f 53 63 72  | . "CDir InfoScr|
000098b0  61 70 3a 61 64 64 2e 22  2b c0 70 61 74 68 24 2c  |ap:add."+.path$,|
000098c0  6e 25 2d 31 29 0d 05 0c  0d 20 20 6d 25 3d 6e 25  |n%-1)....  m%=n%|
000098d0  2b 31 0d 05 0d 05 ce 0d  05 0e 21 70 61 74 68 24  |+1........!path$|
000098e0  3d 22 20 49 6e 66 6f 53  63 72 61 70 3a 61 64 64  |=" InfoScrap:add|
000098f0  2e 22 2b 70 61 74 68 24  0d 05 0f 11 ff 22 43 44  |."+path$....."CD|
00009900  69 72 22 2b 70 61 74 68  24 0d 05 10 0a 3d 70 61  |ir"+path$....=pa|
00009910  74 68 24 0d 05 11 05 3a  0d 05 12 14 dd 20 f2 6e  |th$....:..... .n|
00009920  65 77 64 69 72 28 74 65  78 74 24 29 0d 05 13 0d  |ewdir(text$)....|
00009930  ea 20 61 24 2c 70 74 72  25 0d 05 14 16 e7 20 63  |. a$,ptr%..... c|
00009940  68 69 6c 64 25 20 8c 20  f2 62 75 73 79 3a e1 0d  |hild% . .busy:..|
00009950  05 15 36 e7 20 74 65 78  74 24 3d 22 22 20 8c 20  |..6. text$="" . |
00009960  f2 72 65 70 6f 72 74 28  a4 6d 65 73 73 61 67 65  |.report(.message|
00009970  5f 6c 6f 6f 6b 75 70 28  22 6e 6f 64 69 72 22 29  |_lookup("nodir")|
00009980  2c 31 29 3a e1 0d 05 16  3c 74 65 78 74 24 3d a4  |,1):....<text$=.|
00009990  73 75 62 28 74 65 78 74  24 2c 22 20 22 2c 22 5f  |sub(text$," ","_|
000099a0  22 29 3a f4 20 64 6f 6e  27 74 20 64 6f 20 73 6f  |"):. don't do so|
000099b0  6d 65 74 68 69 6e 67 20  73 69 6c 6c 79 2e 2e 2e  |mething silly...|
000099c0  2e 0d 05 17 47 e7 20 63  6f 6d 6d 6f 6e 70 61 74  |....G. commonpat|
000099d0  68 24 3c 3e 22 2a 22 20  8c 20 74 65 78 74 24 3d  |h$<>"*" . text$=|
000099e0  c0 63 6f 6d 6d 6f 6e 70  61 74 68 24 2c a9 28 63  |.commonpath$,.(c|
000099f0  6f 6d 6d 6f 6e 70 61 74  68 24 29 2d 32 29 2b 22  |ommonpath$)-2)+"|
00009a00  2f 22 2b 74 65 78 74 24  0d 05 18 28 f4 20 66 61  |/"+text$...(. fa|
00009a10  6b 65 20 75 70 20 44 4f  53 2d 73 74 79 6c 65 20  |ke up DOS-style |
00009a20  70 61 74 68 20 66 6f 72  20 46 4e 43 44 69 72 73  |path for FNCDirs|
00009a30  0d 05 19 15 61 24 3d a4  5f 43 44 69 72 73 28 74  |....a$=._CDirs(t|
00009a40  65 78 74 24 29 0d 05 1a  46 f2 75 70 64 61 74 65  |ext$)...F.update|
00009a50  6d 65 6e 75 74 65 78 74  28 6e 65 77 6d 65 6e 75  |menutext(newmenu|
00009a60  25 2c 31 2c 22 22 29 3a  f4 20 63 6c 65 61 72 20  |%,1,""):. clear |
00009a70  77 72 69 74 61 62 6c 65  20 69 63 6f 6e 20 66 6f  |writable icon fo|
00009a80  72 20 6e 65 78 74 20 74  69 6d 65 0d 05 1b 19 f2  |r next time.....|
00009a90  44 69 72 28 22 49 6e 66  6f 53 63 72 61 70 3a 61  |Dir("InfoScrap:a|
00009aa0  64 64 22 29 0d 05 1c 11  6e 6f 74 7a 69 70 70 65  |dd")....notzippe|
00009ab0  64 24 3d 61 24 0d 05 1d  3d f4 20 6e 6f 77 20 77  |d$=a$...=. now w|
00009ac0  65 20 6a 75 73 74 20 61  64 64 20 69 74 20 61 6e  |e just add it an|
00009ad0  64 20 74 68 65 6e 20 21  53 63 72 61 70 20 67 65  |d then !Scrap ge|
00009ae0  74 73 20 77 69 70 65 64  20 61 73 20 6e 6f 72 6d  |ts wiped as norm|
00009af0  61 6c 0d 05 1e 38 77 61  69 74 24 3d 22 61 64 22  |al...8wait$="ad"|
00009b00  3a 63 68 69 6c 64 25 3d  a4 63 68 69 6c 64 74 61  |:child%=.childta|
00009b10  73 6b 28 a4 63 6f 6d 6d  61 6e 64 6c 69 6e 65 28  |sk(.commandline(|
00009b20  22 7a 69 70 22 2c 22 22  29 29 0d 05 1f 05 e1 0d  |"zip",""))......|
00009b30  05 20 05 3a 0d 05 21 1c  dd 20 f2 73 65 6c 66 65  |. .:..!.. .selfe|
00009b40  78 74 72 61 63 74 69 6e  67 28 66 69 6c 65 24 29  |xtracting(file$)|
00009b50  0d 05 22 13 ea 20 41 25  2c 61 24 2c 62 24 2c 6f  |..".. A%,a$,b$,o|
00009b60  75 74 24 0d 05 23 07 ea  20 85 0d 05 24 2d ee 20  |ut$..#.. ...$-. |
00009b70  85 20 ea 20 f7 20 85 3a  f2 72 65 70 6f 72 74 28  |. . . .:.report(|
00009b80  f6 24 2b 22 20 61 74 20  6c 69 6e 65 20 22 2b c3  |.$+" at line "+.|
00009b90  20 9e 2c 31 29 3a e1 0d  05 25 1d 62 24 3d a4 6d  | .,1):...%.b$=.m|
00009ba0  65 73 73 61 67 65 5f 6c  6f 6f 6b 75 70 28 22 53  |essage_lookup("S|
00009bb0  45 41 22 29 0d 05 26 0e  41 25 3d 8e 20 66 69 6c  |EA")..&.A%=. fil|
00009bc0  65 24 0d 05 27 0b 61 24  3d be 23 41 25 0d 05 28  |e$..'.a$=.#A%..(|
00009bd0  08 d9 23 41 25 0d 05 29  29 e7 20 c0 61 24 2c 32  |..#A%..)). .a$,2|
00009be0  29 3d 22 50 4b 22 20 8c  20 61 24 3d 22 63 6f 6e  |)="PK" . a$="con|
00009bf0  76 22 8b 20 20 61 24 3d  22 72 65 73 74 22 0d 05  |v".  a$="rest"..|
00009c00  2a 3e 70 61 72 61 6d 31  24 3d 66 69 6c 65 24 3a  |*>param1$=file$:|
00009c10  70 61 72 61 6d 32 24 3d  62 24 3a f2 72 65 70 6f  |param2$=b$:.repo|
00009c20  72 74 28 a4 6d 65 73 73  61 67 65 5f 6c 6f 6f 6b  |rt(.message_look|
00009c30  73 75 62 28 61 24 29 2c  25 31 31 29 0d 05 2b 15  |sub(a$),%11)..+.|
00009c40  e7 20 65 72 72 63 6c 69  63 6b 25 3d 32 20 8c 20  |. errclick%=2 . |
00009c50  e1 0d 05 2c 4e f2 63 6c  6f 73 65 28 66 61 6b 65  |...,N.close(fake|
00009c60  66 69 6c 65 72 25 29 3a  6c 61 73 74 5f 6f 70 65  |filer%):last_ope|
00009c70  6e 65 64 25 3d 30 3a f4  20 69 6e 20 63 61 73 65  |ned%=0:. in case|
00009c80  20 77 65 20 61 6c 73 6f  20 68 61 76 65 20 74 68  | we also have th|
00009c90  69 73 20 61 72 63 68 69  76 65 20 6f 70 65 6e 0d  |is archive open.|
00009ca0  05 2d 0e 6f 75 74 24 3d  66 69 6c 65 24 0d 05 2e  |.-.out$=file$...|
00009cb0  38 e7 20 a4 6c 6f 77 65  72 28 c2 66 69 6c 65 24  |8. .lower(.file$|
00009cc0  2c 34 29 29 3d 22 2f 7a  69 70 22 20 8c 20 6f 75  |,4))="/zip" . ou|
00009cd0  74 24 3d c0 66 69 6c 65  24 2c a9 28 66 69 6c 65  |t$=.file$,.(file|
00009ce0  24 29 2d 34 29 0d 05 2f  45 f4 20 72 65 6d 6f 76  |$)-4)../E. remov|
00009cf0  65 20 2f 7a 69 70 20 73  75 66 66 69 78 20 69 66  |e /zip suffix if|
00009d00  20 77 65 20 61 72 65 20  63 6f 6e 76 65 72 74 69  | we are converti|
00009d10  6e 67 20 66 69 6c 65 20  74 6f 20 73 65 6c 66 2d  |ng file to self-|
00009d20  65 78 74 72 61 63 74 69  6e 67 0d 05 30 0b c8 8e  |extracting..0...|
00009d30  20 61 24 20 ca 0d 05 31  1b 20 20 c9 20 22 63 6f  | a$ ...1.  . "co|
00009d40  6e 76 22 3a 77 61 69 74  24 3d 22 74 65 6d 70 22  |nv":wait$="temp"|
00009d50  0d 05 32 64 20 20 20 20  20 20 20 20 20 20 20 20  |..2d            |
00009d60  20 63 68 69 6c 64 25 3d  a4 63 68 69 6c 64 74 61  | child%=.childta|
00009d70  73 6b 28 22 73 66 78 20  22 2b a4 70 61 74 68 6e  |sk("sfx "+.pathn|
00009d80  61 6d 65 28 66 69 6c 65  24 29 2b 22 20 22 2b a4  |ame(file$)+" "+.|
00009d90  6c 65 61 66 6e 61 6d 65  28 66 69 6c 65 24 29 2b  |leafname(file$)+|
00009da0  22 20 22 2b a4 70 61 74  68 6e 61 6d 65 28 6f 75  |" "+.pathname(ou|
00009db0  74 24 29 29 0d 05 33 30  20 20 c9 22 72 65 73 74  |t$))..30  ."rest|
00009dc0  22 3a 63 68 69 6c 64 25  3d a4 63 68 69 6c 64 74  |":child%=.childt|
00009dd0  61 73 6b 28 22 7a 69 70  20 2d 4a 20 22 2b 66 69  |ask("zip -J "+fi|
00009de0  6c 65 24 29 0d 05 34 05  cb 0d 05 35 05 e1 0d 05  |le$)..4....5....|
00009df0  36 04 0d 05 37 1e dd 20  a4 73 61 76 65 74 65 78  |6...7.. .savetex|
00009e00  74 28 77 69 6e 64 6f 77  25 2c 69 63 6f 6e 25 29  |t(window%,icon%)|
00009e10  0d 05 38 43 f4 20 75 73  65 64 20 74 6f 20 66 69  |..8C. used to fi|
00009e20  6e 64 20 63 6f 72 72 65  63 74 20 6e 61 6d 65 20  |nd correct name |
00009e30  74 6f 20 67 69 76 65 20  66 69 6c 65 20 64 72 61  |to give file dra|
00009e40  67 67 65 64 20 6f 75 74  20 6f 66 20 49 6e 66 6f  |gged out of Info|
00009e50  7a 69 70 0d 05 39 08 ea  20 61 24 0d 05 3a 10 c8  |zip..9.. a$..:..|
00009e60  8e 20 77 69 6e 64 6f 77  25 20 ca 0d 05 3b 34 20  |. window% ...;4 |
00009e70  20 c9 20 66 61 6b 65 66  69 6c 65 72 25 3a f4 20  | . fakefiler%:. |
00009e80  61 24 3d 46 4e 67 65 74  69 63 6f 6e 74 65 78 74  |a$=FNgeticontext|
00009e90  28 77 69 6e 64 6f 77 25  2c 69 63 6f 6e 25 29 0d  |(window%,icon%).|
00009ea0  05 3c 32 20 20 20 20 20  20 20 20 20 20 20 20 20  |.<2             |
00009eb0  20 20 20 20 20 61 24 3d  a4 67 65 74 66 61 6b 65  |     a$=.getfake|
00009ec0  6c 65 61 66 6e 61 6d 65  28 69 63 6f 6e 25 2c b9  |leafname(icon%,.|
00009ed0  29 0d 05 3d 26 20 20 c9  20 73 61 76 65 25 3a 61  |)..=&  . save%:a|
00009ee0  24 3d a4 67 65 74 69 63  6f 6e 74 65 78 74 28 73  |$=.geticontext(s|
00009ef0  61 76 65 25 2c 31 29 0d  05 3e 05 cb 0d 05 3f 07  |ave%,1)..>....?.|
00009f00  3d 61 24 0d 05 40 04 0d  05 41 52 f4 20 2d 2d 2d  |=a$..@...AR. ---|
00009f10  2d 2d 2d 2d 2d 2d 49 6e  74 65 72 61 63 74 69 76  |------Interactiv|
00009f20  65 20 68 65 6c 70 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |e help----------|
00009f30  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00009f50  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 05 42 0d dd 20 f2  |---------..B.. .|
00009f60  64 6f 68 65 6c 70 0d 05  43 10 ea 20 68 6c 70 24  |dohelp..C.. hlp$|
00009f70  2c 6b 65 65 70 25 0d 05  44 12 6b 65 65 70 25 3d  |,keep%..D.keep%=|
00009f80  62 6c 6f 63 6b 25 21 38  0d 05 45 12 c8 8e 20 62  |block%!8..E... b|
00009f90  6c 6f 63 6b 25 21 33 32  20 ca 0d 05 46 66 20 20  |lock%!32 ...Ff  |
00009fa0  20 c9 20 62 61 72 25 2c  66 61 6b 65 66 69 6c 65  | . bar%,fakefile|
00009fb0  72 25 2c 69 6e 66 6f 25  2c 66 69 6c 65 25 2c 63  |r%,info%,file%,c|
00009fc0  6f 6e 66 69 67 75 72 65  25 2c 70 61 6e 65 70 61  |onfigure%,panepa|
00009fd0  74 68 25 2c 73 61 76 65  25 3a 20 68 6c 70 24 3d  |th%,save%: hlp$=|
00009fe0  a4 77 69 6e 64 6f 77 68  65 6c 70 28 62 6c 6f 63  |.windowhelp(bloc|
00009ff0  6b 25 21 33 32 2c 62 6c  6f 63 6b 25 21 33 36 29  |k%!32,block%!36)|
0000a000  0d 05 47 17 20 20 20 7f  20 68 6c 70 24 3d a4 6d  |..G.   . hlp$=.m|
0000a010  65 6e 75 68 65 6c 70 0d  05 48 05 cb 0d 05 49 13  |enuhelp..H....I.|
0000a020  62 6c 6f 63 6b 25 21 31  32 3d 6b 65 65 70 25 0d  |block%!12=keep%.|
0000a030  05 4a 12 62 6c 6f 63 6b  25 21 31 36 3d 26 35 30  |.J.block%!16=&50|
0000a040  33 0d 05 4b 1a 21 62 6c  6f 63 6b 25 3d 28 32 35  |3..K.!block%=(25|
0000a050  2b a9 20 68 6c 70 24 29  80 ac 33 0d 05 4c 18 24  |+. hlp$)..3..L.$|
0000a060  28 62 6c 6f 63 6b 25 2b  32 30 29 3d 68 6c 70 24  |(block%+20)=hlp$|
0000a070  2b bd 30 0d 05 4d 2e e7  20 68 6c 70 24 3c 3e 22  |+.0..M.. hlp$<>"|
0000a080  22 20 c8 99 20 22 57 69  6d 70 5f 53 65 6e 64 4d  |" .. "Wimp_SendM|
0000a090  65 73 73 61 67 65 22 2c  31 37 2c 62 6c 6f 63 6b  |essage",17,block|
0000a0a0  25 0d 05 4e 05 e1 0d 05  4f 04 0d 05 50 20 dd 20  |%..N....O...P . |
0000a0b0  a4 77 69 6e 64 6f 77 68  65 6c 70 28 77 69 6e 64  |.windowhelp(wind|
0000a0c0  6f 77 25 2c 69 63 6f 6e  25 29 0d 05 51 08 ea 20  |ow%,icon%)..Q.. |
0000a0d0  61 24 0d 05 52 0e 70 61  72 61 6d 32 24 3d 22 22  |a$..R.param2$=""|
0000a0e0  0d 05 53 10 c8 8e 20 77  69 6e 64 6f 77 25 20 ca  |..S... window% .|
0000a0f0  0d 05 54 33 20 20 c9 20  62 61 72 25 3a 70 61 72  |..T3  . bar%:par|
0000a100  61 6d 31 24 3d 70 24 3a  61 24 3d a4 6d 65 73 73  |am1$=p$:a$=.mess|
0000a110  61 67 65 5f 6c 6f 6f 6b  73 75 62 28 22 62 61 72  |age_looksub("bar|
0000a120  48 22 29 0d 05 55 49 20  20 c9 20 66 61 6b 65 66  |H")..UI  . fakef|
0000a130  69 6c 65 72 25 3a 70 61  72 61 6d 31 24 3d a4 6c  |iler%:param1$=.l|
0000a140  65 61 66 6e 61 6d 65 28  7a 69 70 66 69 6c 65 24  |eafname(zipfile$|
0000a150  29 3a 61 24 3d a4 6d 65  73 73 61 67 65 5f 6c 6f  |):a$=.message_lo|
0000a160  6f 6b 73 75 62 28 22 66  66 48 22 29 0d 05 56 28  |oksub("ffH")..V(|
0000a170  20 20 c9 20 73 61 76 65  25 3a 61 24 3d a4 6d 65  |  . save%:a$=.me|
0000a180  73 73 61 67 65 5f 6c 6f  6f 6b 75 70 28 22 73 61  |ssage_lookup("sa|
0000a190  76 48 22 29 0d 05 57 41  20 20 c9 20 69 6e 66 6f  |vH")..WA  . info|
0000a1a0  25 3a 70 61 72 61 6d 31  24 3d 76 65 72 24 3a 70  |%:param1$=ver$:p|
0000a1b0  61 72 61 6d 32 24 3d 70  24 3a 61 24 3d a4 6d 65  |aram2$=p$:a$=.me|
0000a1c0  73 73 61 67 65 5f 6c 6f  6f 6b 73 75 62 28 22 69  |ssage_looksub("i|
0000a1d0  6e 66 48 22 29 0d 05 58  28 20 20 c9 20 66 69 6c  |nfH")..X(  . fil|
0000a1e0  65 25 3a 61 24 3d a4 6d  65 73 73 61 67 65 5f 6c  |e%:a$=.message_l|
0000a1f0  6f 6f 6b 75 70 28 22 66  69 6c 48 22 29 0d 05 59  |ookup("filH")..Y|
0000a200  58 20 20 20 20 20 20 20  20 20 20 20 20 20 e7 20  |X             . |
0000a210  a7 a4 67 65 74 69 63 6f  6e 74 65 78 74 28 66 69  |..geticontext(fi|
0000a220  6c 65 25 2c 33 29 2c 22  2d 2d 22 29 20 8c 20 70  |le%,3),"--") . p|
0000a230  61 72 61 6d 31 24 3d 70  24 3a 61 24 2b 3d a4 6d  |aram1$=p$:a$+=.m|
0000a240  65 73 73 61 67 65 5f 6c  6f 6f 6b 73 75 62 28 22  |essage_looksub("|
0000a250  6e 6f 48 22 29 0d 05 5a  41 20 20 c9 20 70 61 6e  |noH")..ZA  . pan|
0000a260  65 70 61 74 68 25 3a e7  20 69 63 6f 6e 25 3e 2d  |epath%:. icon%>-|
0000a270  31 20 8c 20 61 24 3d a4  6d 65 73 73 61 67 65 5f  |1 . a$=.message_|
0000a280  6c 6f 6f 6b 75 70 28 22  70 61 48 22 2b c3 28 69  |lookup("paH"+.(i|
0000a290  63 6f 6e 25 29 29 0d 05  5b 2d 20 20 c9 20 63 6f  |con%))..[-  . co|
0000a2a0  6e 66 69 67 75 72 65 25  3a 61 24 3d a4 6d 65 73  |nfigure%:a$=.mes|
0000a2b0  73 61 67 65 5f 6c 6f 6f  6b 75 70 28 22 63 6f 6e  |sage_lookup("con|
0000a2c0  48 22 29 0d 05 5c 12 20  20 20 20 c8 8e 20 69 63  |H")..\.    .. ic|
0000a2d0  6f 6e 25 20 ca 0d 05 5d  28 20 20 20 20 20 20 c9  |on% ...](      .|
0000a2e0  20 2d 31 2c 31 32 2c 31  33 2c 31 2c 30 3a 61 24  | -1,12,13,1,0:a$|
0000a2f0  3d c0 61 24 2c a9 28 61  24 29 2d 33 29 0d 05 5e  |=.a$,.(a$)-3)..^|
0000a300  58 20 20 20 20 20 20 c9  20 31 34 2c 31 35 2c 31  |X      . 14,15,1|
0000a310  36 2c 31 37 2c 31 38 2c  31 39 3a 61 24 3d a4 6d  |6,17,18,19:a$=.m|
0000a320  65 73 73 61 67 65 5f 6c  6f 6f 6b 75 70 28 22 73  |essage_lookup("s|
0000a330  65 6c 48 22 29 2b a4 6d  65 73 73 61 67 65 5f 6c  |elH")+.message_l|
0000a340  6f 6f 6b 75 70 28 22 69  63 48 22 2b c3 28 69 63  |ookup("icH"+.(ic|
0000a350  6f 6e 25 29 29 0d 05 5f  2e 20 20 20 20 20 20 7f  |on%)).._.      .|
0000a360  3a 61 24 3d a4 6d 65 73  73 61 67 65 5f 6c 6f 6f  |:a$=.message_loo|
0000a370  6b 75 70 28 22 69 63 48  22 2b c3 28 69 63 6f 6e  |kup("icH"+.(icon|
0000a380  25 29 29 0d 05 60 09 20  20 20 20 cb 0d 05 61 05  |%))..`.    ...a.|
0000a390  cb 0d 05 62 07 3d 61 24  0d 05 63 05 3a 0d 05 64  |...b.=a$..c.:..d|
0000a3a0  0f dd 20 a4 6d 65 6e 75  68 65 6c 70 0d 05 65 16  |.. .menuhelp..e.|
0000a3b0  ea 20 61 24 2c 62 24 2c  6d 65 6e 75 73 74 61 74  |. a$,b$,menustat|
0000a3c0  65 25 0d 05 66 47 6d 65  6e 75 73 74 61 74 65 25  |e%..fGmenustate%|
0000a3d0  3d 74 65 6d 70 25 2b 32  35 36 2b 36 34 3a f4 20  |=temp%+256+64:. |
0000a3e0  61 62 6f 76 65 20 73 63  72 61 74 63 68 20 73 70  |above scratch sp|
0000a3f0  61 63 65 20 61 6e 64 20  6f 70 65 6e 77 69 6e 64  |ace and openwind|
0000a400  6f 77 20 62 75 66 66 65  72 0d 05 67 26 c8 99 22  |ow buffer..g&.."|
0000a410  57 69 6d 70 5f 47 65 74  4d 65 6e 75 53 74 61 74  |Wimp_GetMenuStat|
0000a420  65 22 2c 30 2c 6d 65 6e  75 73 74 61 74 65 25 0d  |e",0,menustate%.|
0000a430  05 68 19 e7 20 21 6d 65  6e 75 73 74 61 74 65 25  |.h.. !menustate%|
0000a440  3d 2d 31 20 8c 3d 22 22  0d 05 69 26 f4 20 4e 6f  |=-1 .=""..i&. No|
0000a450  74 20 73 75 72 65 20 77  68 61 74 27 73 20 63 61  |t sure what's ca|
0000a460  75 73 69 6e 67 20 74 68  69 73 2e 2e 2e 2e 0d 05  |using this......|
0000a470  6a 15 62 24 3d c3 28 21  6d 65 6e 75 73 74 61 74  |j.b$=.(!menustat|
0000a480  65 25 29 0d 05 6b 18 c8  8e 20 6c 61 73 74 6d 65  |e%)..k... lastme|
0000a490  6e 75 6f 70 65 6e 65 64  25 20 ca 0d 05 6c 2c 20  |nuopened% ...l, |
0000a4a0  20 c9 20 62 61 72 6d 65  6e 75 25 3a 61 24 3d a4  | . barmenu%:a$=.|
0000a4b0  6d 65 73 73 61 67 65 5f  6c 6f 6f 6b 75 70 28 22  |message_lookup("|
0000a4c0  62 48 22 2b 62 24 29 0d  05 6d 68 20 20 20 20 20  |bH"+b$)..mh     |
0000a4d0  20 20 20 20 20 20 20 20  20 20 20 e7 20 6d 65 6e  |           . men|
0000a4e0  75 73 74 61 74 65 25 21  34 3e 2d 31 20 8c 20 61  |ustate%!4>-1 . a|
0000a4f0  24 3d a4 6d 65 73 73 61  67 65 5f 6c 6f 6f 6b 75  |$=.message_looku|
0000a500  70 28 22 73 65 6c 48 22  29 2b a4 6d 65 73 73 61  |p("selH")+.messa|
0000a510  67 65 5f 6c 6f 6f 6b 75  70 28 22 6f 48 22 2b c3  |ge_lookup("oH"+.|
0000a520  28 6d 65 6e 75 73 74 61  74 65 25 21 34 29 29 0d  |(menustate%!4)).|
0000a530  05 6e 32 20 20 c9 20 66  61 6b 65 66 69 6c 65 72  |.n2  . fakefiler|
0000a540  6d 65 6e 75 25 3a 61 24  3d a4 6d 65 73 73 61 67  |menu%:a$=.messag|
0000a550  65 5f 6c 6f 6f 6b 75 70  28 22 66 48 22 2b 62 24  |e_lookup("fH"+b$|
0000a560  29 0d 05 6f 16 20 20 c8  8e 20 21 6d 65 6e 75 73  |)..o.  .. !menus|
0000a570  74 61 74 65 25 20 ca 0d  05 70 46 20 20 20 20 c9  |tate% ...pF    .|
0000a580  20 30 3a e7 20 6d 65 6e  75 73 74 61 74 65 25 21  | 0:. menustate%!|
0000a590  34 3e 2d 31 20 61 24 3d  a4 6d 65 73 73 61 67 65  |4>-1 a$=.message|
0000a5a0  5f 6c 6f 6f 6b 75 70 28  22 64 69 22 2b c3 28 6d  |_lookup("di"+.(m|
0000a5b0  65 6e 75 73 74 61 74 65  25 21 34 29 29 0d 05 71  |enustate%!4))..q|
0000a5c0  1d 20 20 20 20 c9 20 31  3a c8 8e 20 6d 65 6e 75  |.    . 1:.. menu|
0000a5d0  73 74 61 74 65 25 21 34  20 ca 0d 05 72 73 20 20  |state%!4 ...rs  |
0000a5e0  20 20 20 20 20 20 20 20  20 20 20 c9 20 2d 31 3a  |           . -1:|
0000a5f0  e7 20 28 6d 65 6e 75 69  63 6f 6e 25 3e 2d 31 20  |. (menuicon%>-1 |
0000a600  80 20 61 6c 6c 25 3d 30  29 20 8c 20 70 61 72 61  |. all%=0) . para|
0000a610  6d 31 24 3d a4 67 65 74  66 61 6b 65 6c 65 61 66  |m1$=.getfakeleaf|
0000a620  6e 61 6d 65 28 6d 65 6e  75 69 63 6f 6e 25 2c b9  |name(menuicon%,.|
0000a630  29 3a 61 24 3d a4 6d 65  73 73 61 67 65 5f 6c 6f  |):a$=.message_lo|
0000a640  6f 6b 73 75 62 28 22 66  48 31 61 22 29 0d 05 73  |oksub("fH1a")..s|
0000a650  30 20 20 20 20 20 20 20  20 20 20 20 20 20 c9 20  |0             . |
0000a660  30 3a 20 61 24 3d a4 6d  65 73 73 61 67 65 5f 6c  |0: a$=.message_l|
0000a670  6f 6f 6b 75 70 28 22 66  69 48 30 22 29 0d 05 74  |ookup("fiH0")..t|
0000a680  57 20 20 20 20 20 20 20  20 20 20 20 20 20 c9 20  |W             . |
0000a690  31 3a 20 70 61 72 61 6d  31 24 3d a4 67 65 74 66  |1: param1$=.getf|
0000a6a0  61 6b 65 6c 65 61 66 6e  61 6d 65 28 6d 65 6e 75  |akeleafname(menu|
0000a6b0  69 63 6f 6e 25 2c b9 29  3a 61 24 3d a4 6d 65 73  |icon%,.):a$=.mes|
0000a6c0  73 61 67 65 5f 6c 6f 6f  6b 73 75 62 28 22 66 69  |sage_looksub("fi|
0000a6d0  48 31 22 29 0d 05 75 10  20 20 20 20 20 20 20 20  |H1")..u.        |
0000a6e0  20 20 20 cb 0d 05 76 36  20 20 20 20 c9 20 32 2c  |   ...v6    . 2,|
0000a6f0  33 3a e7 20 61 6c 6c 25  20 8c 20 61 24 3d a4 6d  |3:. all% . a$=.m|
0000a700  65 73 73 61 67 65 5f 6c  6f 6f 6b 75 70 28 22 66  |essage_lookup("f|
0000a710  48 22 2b 62 24 2b 22 61  22 29 0d 05 77 60 20 20  |H"+b$+"a")..w`  |
0000a720  20 20 c9 20 34 3a e7 20  6d 65 6e 75 73 74 61 74  |  . 4:. menustat|
0000a730  65 25 21 34 3e 2d 31 20  8c 20 61 24 3d a4 6d 65  |e%!4>-1 . a$=.me|
0000a740  73 73 61 67 65 5f 6c 6f  6f 6b 75 70 28 22 73 65  |ssage_lookup("se|
0000a750  6c 48 22 29 2b a4 6d 65  73 73 61 67 65 5f 6c 6f  |lH")+.message_lo|
0000a760  6f 6b 75 70 28 22 6f 48  22 2b c3 28 6d 65 6e 75  |okup("oH"+.(menu|
0000a770  73 74 61 74 65 25 21 34  29 29 0d 05 78 3b 20 20  |state%!4))..x;  |
0000a780  20 20 c9 20 35 3a 20 e7  20 6d 65 6e 75 73 74 61  |  . 5: . menusta|
0000a790  74 65 25 21 34 3e 2d 31  20 8c 20 61 24 3d a4 6d  |te%!4>-1 . a$=.m|
0000a7a0  65 73 73 61 67 65 5f 6c  6f 6f 6b 75 70 28 22 6e  |essage_lookup("n|
0000a7b0  64 48 30 22 29 0d 05 79  36 20 20 20 20 c9 20 36  |dH0")..y6    . 6|
0000a7c0  2c 37 3a e7 20 6c 65 76  65 6c 73 25 3d 30 20 8c  |,7:. levels%=0 .|
0000a7d0  20 61 24 3d a4 6d 65 73  73 61 67 65 5f 6c 6f 6f  | a$=.message_loo|
0000a7e0  6b 75 70 28 22 66 48 36  61 22 29 0d 05 7a 07 20  |kup("fH6a")..z. |
0000a7f0  20 cb 0d 05 7b 45 20 20  c9 20 6f 70 74 73 6d 65  | ...{E  . optsme|
0000a800  6e 75 25 3a 61 24 3d a4  6d 65 73 73 61 67 65 5f  |nu%:a$=.message_|
0000a810  6c 6f 6f 6b 75 70 28 22  73 65 6c 48 22 29 2b a4  |lookup("selH")+.|
0000a820  6d 65 73 73 61 67 65 5f  6c 6f 6f 6b 75 70 28 22  |message_lookup("|
0000a830  6f 48 22 2b 62 24 29 0d  05 7c 05 cb 0d 05 7d 07  |oH"+b$)..|....}.|
0000a840  3d 61 24 0d 05 7e 05 3a  0d 05 7f 52 f4 20 2d 2d  |=a$..~.:...R. --|
0000a850  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 57 69 6d 70 5f  |-----------Wimp_|
0000a860  50 6f 6c 6c 20 66 75 6e  63 74 69 6f 6e 73 2d 2d  |Poll functions--|
0000a870  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000a890  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0d 05 80 05 3a 0d  |----------....:.|
0000a8a0  05 81 0b dd 20 f2 70 6f  6c 6c 0d 05 82 10 ea 20  |.... .poll..... |
0000a8b0  72 65 61 73 6f 6e 25 2c  6e 25 0d 05 83 0f 66 69  |reason%,n%....fi|
0000a8c0  6e 69 73 68 65 64 25 3d  a3 0d 05 84 06 20 f5 0d  |nished%=..... ..|
0000a8d0  05 85 36 20 20 20 c8 99  22 57 69 6d 70 5f 50 6f  |..6   .."Wimp_Po|
0000a8e0  6c 6c 22 2c 70 6f 6c 6c  6d 61 73 6b 25 2c 62 6c  |ll",pollmask%,bl|
0000a8f0  6f 63 6b 25 20 b8 20 72  65 61 73 6f 6e 25 2c 62  |ock% . reason%,b|
0000a900  6c 6f 63 6b 25 0d 05 86  1e 20 20 20 f4 20 2a 52  |lock%....   . *R|
0000a910  65 70 6f 72 74 50 6f 6c  6c 20 28 72 65 61 73 6f  |eportPoll (reaso|
0000a920  6e 25 29 0d 05 87 13 20  20 20 c8 8e 20 72 65 61  |n%)....   .. rea|
0000a930  73 6f 6e 25 20 ca 0d 05  88 7e 20 20 20 20 20 c9  |son% ....~     .|
0000a940  20 30 20 3a 20 c8 99 22  4f 53 5f 52 65 61 64 4d  | 0 : .."OS_ReadM|
0000a950  6f 6e 6f 74 6f 6e 69 63  54 69 6d 65 22 20 b8 20  |onotonicTime" . |
0000a960  6e 25 3a e7 20 6e 25 3e  74 69 6d 65 75 70 25 20  |n%:. n%>timeup% |
0000a970  8c 20 f2 63 6c 6f 73 65  28 61 6c 65 72 74 62 6f  |. .close(alertbo|
0000a980  78 25 29 3a 70 6f 6c 6c  6d 61 73 6b 25 20 3d 20  |x%):pollmask% = |
0000a990  70 6f 6c 6c 6d 61 73 6b  25 20 84 20 25 31 3a f4  |pollmask% . %1:.|
0000a9a0  20 6d 61 73 6b 20 6f 75  74 20 6e 75 6c 6c 2d 70  | mask out null-p|
0000a9b0  6f 6c 6c 73 0d 05 89 1d  20 20 20 20 20 c9 20 31  |olls....     . 1|
0000a9c0  20 3a 20 f2 72 65 64 72  61 77 72 65 71 75 65 73  | : .redrawreques|
0000a9d0  74 0d 05 8a 22 20 20 20  20 20 c9 20 32 20 3a 20  |t..."     . 2 : |
0000a9e0  f2 6f 70 65 6e 77 69 6e  64 6f 77 28 62 6c 6f 63  |.openwindow(bloc|
0000a9f0  6b 25 29 0d 05 8b 28 20  20 20 20 20 c9 20 33 20  |k%)...(     . 3 |
0000aa00  3a 20 f2 74 72 61 70 61  64 6a 75 73 74 63 6c 6f  |: .trapadjustclo|
0000aa10  73 65 28 21 62 6c 6f 63  6b 25 29 0d 05 8c 2e 20  |se(!block%).... |
0000aa20  20 20 20 20 c9 20 34 20  3a 20 c8 99 20 22 48 6f  |    . 4 : .. "Ho|
0000aa30  75 72 67 6c 61 73 73 5f  4f 66 66 22 3a 6c 6f 63  |urglass_Off":loc|
0000aa40  61 6c 5f 68 6f 6e 25 3d  a3 0d 05 8d 32 20 20 20  |al_hon%=....2   |
0000aa50  20 20 c9 20 35 20 3a 20  c8 99 20 22 48 6f 75 72  |  . 5 : .. "Hour|
0000aa60  67 6c 61 73 73 5f 53 74  61 72 74 22 2c 31 3a 6c  |glass_Start",1:l|
0000aa70  6f 63 61 6c 5f 68 6f 6e  25 3d b9 0d 05 8e 15 20  |ocal_hon%=..... |
0000aa80  20 20 20 20 c9 20 36 20  3a 20 f2 63 6c 69 63 6b  |    . 6 : .click|
0000aa90  0d 05 8f 18 20 20 20 20  20 c9 20 37 20 3a 20 f2  |....     . 7 : .|
0000aaa0  64 72 61 67 5f 65 6e 64  0d 05 90 2c 20 20 20 20  |drag_end...,    |
0000aab0  20 c9 20 38 20 3a 20 f2  6b 65 79 70 72 65 73 73  | . 8 : .keypress|
0000aac0  28 62 6c 6f 63 6b 25 21  30 2c 62 6c 6f 63 6b 25  |(block%!0,block%|
0000aad0  21 32 34 29 0d 05 91 1d  20 20 20 20 20 c9 20 39  |!24)....     . 9|
0000aae0  20 3a 20 f2 6d 65 6e 75  73 65 6c 65 63 74 69 6f  | : .menuselectio|
0000aaf0  6e 0d 05 92 1b 20 20 20  20 20 c9 20 31 37 2c 31  |n....     . 17,1|
0000ab00  38 20 3a 20 f2 6d 65 73  73 61 67 65 0d 05 93 16  |8 : .message....|
0000ab10  20 20 20 20 20 c9 20 31  39 3a 20 f2 62 6f 75 6e  |     . 19: .boun|
0000ab20  63 65 0d 05 94 08 20 20  20 cb 0d 05 95 10 20 fd  |ce....   ..... .|
0000ab30  20 66 69 6e 69 73 68 65  64 25 0d 05 96 09 f2 71  | finished%.....q|
0000ab40  75 69 74 0d 05 97 05 e1  0d 05 98 05 3a 0d 05 99  |uit.........:...|
0000ab50  1a dd 20 f2 6b 65 79 70  72 65 73 73 28 77 69 6e  |.. .keypress(win|
0000ab60  25 2c 6b 65 79 25 29 0d  05 9a 08 ea 20 61 24 0d  |%,key%)..... a$.|
0000ab70  05 9b 11 e7 20 6b 65 79  25 3d 26 31 38 31 20 8c  |.... key%=&181 .|
0000ab80  0d 05 9c 2e 20 20 ff 28  22 46 69 6c 65 72 5f 52  |....  .("Filer_R|
0000ab90  75 6e 20 3c 49 6e 66 6f  7a 69 70 24 44 69 72 3e  |un <Infozip$Dir>|
0000aba0  2e 21 48 65 6c 70 22 29  20 3a f4 20 46 31 0d 05  |.!Help") :. F1..|
0000abb0  9d 05 cc 0d 05 9e 0f 20  20 c8 8e 20 77 69 6e 25  |.......  .. win%|
0000abc0  20 ca 0d 05 9f 15 20 20  20 20 c9 20 63 6f 6e 66  | .....    . conf|
0000abd0  69 67 75 72 65 25 3a 0d  05 a0 13 20 20 20 20 20  |igure%:....     |
0000abe0  20 c8 8e 20 6b 65 79 25  20 ca 0d 05 a1 18 20 20  | .. key% .....  |
0000abf0  20 20 20 20 20 20 c9 20  31 33 3a f4 20 45 6e 74  |      . 13:. Ent|
0000ac00  65 72 0d 05 a2 30 20 20  20 20 20 20 20 20 20 20  |er...0          |
0000ac10  f2 49 63 6f 6e 53 74 61  74 65 28 63 6f 6e 66 69  |.IconState(confi|
0000ac20  67 75 72 65 25 2c 69 63  5f 4f 4b 25 2c 32 31 2c  |gure%,ic_OK%,21,|
0000ac30  31 29 0d 05 a3 19 20 20  20 20 20 20 20 20 20 20  |1)....          |
0000ac40  f2 72 65 61 64 63 6f 6e  66 69 67 0d 05 a4 20 20  |.readconfig...  |
0000ac50  20 20 20 20 20 20 20 20  20 f2 63 6c 6f 73 65 28  |         .close(|
0000ac60  63 6f 6e 66 69 67 75 72  65 25 29 0d 05 a5 30 20  |configure%)...0 |
0000ac70  20 20 20 20 20 20 20 20  20 f2 49 63 6f 6e 53 74  |         .IconSt|
0000ac80  61 74 65 28 63 6f 6e 66  69 67 75 72 65 25 2c 69  |ate(configure%,i|
0000ac90  63 5f 4f 4b 25 2c 32 31  2c 30 29 0d 05 a6 14 20  |c_OK%,21,0).... |
0000aca0  20 20 20 20 20 20 20 20  20 6b 65 79 25 3d 30 0d  |         key%=0.|
0000acb0  05 a7 1a 20 20 20 20 20  20 20 20 c9 20 26 31 42  |...        . &1B|
0000acc0  3a f4 20 45 73 63 61 70  65 0d 05 a8 34 20 20 20  |:. Escape...4   |
0000acd0  20 20 20 20 20 20 20 f2  49 63 6f 6e 53 74 61 74  |       .IconStat|
0000ace0  65 28 63 6f 6e 66 69 67  75 72 65 25 2c 69 63 5f  |e(configure%,ic_|
0000acf0  63 61 6e 63 65 6c 25 2c  32 31 2c 31 29 0d 05 a9  |cancel%,21,1)...|
0000ad00  1a 20 20 20 20 20 20 20  20 20 20 f2 73 65 74 75  |.          .setu|
0000ad10  70 63 6f 6e 66 69 67 0d  05 aa 20 20 20 20 20 20  |pconfig...      |
0000ad20  20 20 20 20 20 f2 63 6c  6f 73 65 28 63 6f 6e 66  |     .close(conf|
0000ad30  69 67 75 72 65 25 29 0d  05 ab 34 20 20 20 20 20  |igure%)...4     |
0000ad40  20 20 20 20 20 f2 49 63  6f 6e 53 74 61 74 65 28  |     .IconState(|
0000ad50  63 6f 6e 66 69 67 75 72  65 25 2c 69 63 5f 63 61  |configure%,ic_ca|
0000ad60  6e 63 65 6c 25 2c 32 31  2c 30 29 0d 05 ac 14 20  |ncel%,21,0).... |
0000ad70  20 20 20 20 20 20 20 20  20 6b 65 79 25 3d 30 0d  |         key%=0.|
0000ad80  05 ad 0b 20 20 20 20 20  20 cb 0d 05 ae 10 20 20  |...      .....  |
0000ad90  20 20 c9 20 73 61 76 65  25 3a 0d 05 af 13 20 20  |  . save%:....  |
0000ada0  20 20 20 20 c8 8e 20 6b  65 79 25 20 ca 0d 05 b0  |    .. key% ....|
0000adb0  18 20 20 20 20 20 20 20  20 c9 20 31 33 3a f4 20  |.        . 13:. |
0000adc0  45 6e 74 65 72 0d 05 b1  2f 20 20 20 20 20 20 20  |Enter.../       |
0000add0  20 20 20 61 24 3d a4 67  65 74 69 63 6f 6e 74 65  |   a$=.geticonte|
0000ade0  78 74 28 73 61 76 65 25  2c 73 61 76 65 5f 70 61  |xt(save%,save_pa|
0000adf0  74 68 25 29 0d 05 b2 89  20 20 20 20 20 20 20 20  |th%)....        |
0000ae00  20 20 e7 20 a7 61 24 2c  22 2e 22 29 3d 30 20 80  |  . .a$,".")=0 .|
0000ae10  20 a7 61 24 2c 22 3a 22  29 3d 30 20 8c 20 f2 72  | .a$,":")=0 . .r|
0000ae20  65 70 6f 72 74 28 a4 6d  65 73 73 61 67 65 5f 6c  |eport(.message_l|
0000ae30  6f 6f 6b 75 70 28 22 74  6f 73 61 76 65 22 29 2c  |ookup("tosave"),|
0000ae40  31 29 20 8b 20 62 6c 6f  63 6b 25 21 33 36 3d 30  |1) . block%!36=0|
0000ae50  3a 77 73 61 76 65 77 25  3d 73 61 76 65 25 3a 70  |:wsavew%=save%:p|
0000ae60  72 65 73 65 72 76 65 25  21 30 3d 30 3a f2 64 72  |reserve%!0=0:.dr|
0000ae70  61 67 67 65 64 5f 6f 75  74 28 61 24 29 0d 05 b3  |agged_out(a$)...|
0000ae80  14 20 20 20 20 20 20 20  20 20 20 6b 65 79 25 3d  |.          key%=|
0000ae90  30 0d 05 b4 1a 20 20 20  20 20 20 20 20 c9 20 26  |0....        . &|
0000aea0  31 42 3a f4 20 45 73 63  61 70 65 0d 05 b5 32 20  |1B:. Escape...2 |
0000aeb0  20 20 20 20 20 20 20 20  20 f2 63 6c 6f 73 65 28  |         .close(|
0000aec0  73 61 76 65 25 29 3a c8  99 22 57 69 6d 70 5f 43  |save%):.."Wimp_C|
0000aed0  72 65 61 74 65 4d 65 6e  75 22 2c 2d 31 0d 05 b6  |reateMenu",-1...|
0000aee0  14 20 20 20 20 20 20 20  20 20 20 6b 65 79 25 3d  |.          key%=|
0000aef0  30 0d 05 b7 0b 20 20 20  20 20 20 cb 0d 05 b8 07  |0....      .....|
0000af00  20 20 cb 0d 05 b9 05 cd  0d 05 ba 25 e7 20 6b 65  |  .........%. ke|
0000af10  79 25 20 8c 20 c8 99 22  57 69 6d 70 5f 50 72 6f  |y% . .."Wimp_Pro|
0000af20  63 65 73 73 4b 65 79 22  2c 6b 65 79 25 0d 05 bb  |cessKey",key%...|
0000af30  05 e1 0d 05 bc 05 3a 0d  05 bd 0c dd 20 f2 63 6c  |......:..... .cl|
0000af40  69 63 6b 0d 05 be 32 ea  20 78 25 2c 79 25 2c 69  |ick...2. x%,y%,i|
0000af50  63 6f 6e 25 2c 77 69 6e  64 6f 77 25 2c 61 24 2c  |con%,window%,a$,|
0000af60  62 75 74 74 6f 6e 73 25  2c 61 72 72 6f 77 73 76  |buttons%,arrowsv|
0000af70  61 6c 75 65 25 0d 05 bf  37 62 75 74 74 6f 6e 73  |alue%...7buttons|
0000af80  25 3d 62 6c 6f 63 6b 25  21 38 3a 77 69 6e 64 6f  |%=block%!8:windo|
0000af90  77 25 3d 62 6c 6f 63 6b  25 21 31 32 3a 69 63 6f  |w%=block%!12:ico|
0000afa0  6e 25 3d 62 6c 6f 63 6b  25 21 31 36 0d 05 c0 11  |n%=block%!16....|
0000afb0  c8 8e 20 62 75 74 74 6f  6e 73 25 20 ca 0d 05 c1  |.. buttons% ....|
0000afc0  10 20 20 c9 20 32 3a f4  20 6d 65 6e 75 0d 05 c2  |.  . 2:. menu...|
0000afd0  20 20 20 20 20 20 20 20  20 20 f2 4d 45 4e 55 63  |          .MENUc|
0000afe0  6c 69 63 6b 28 77 69 6e  64 6f 77 25 29 0d 05 c3  |lick(window%)...|
0000aff0  27 20 20 c9 20 32 35 36  2c 31 30 32 34 3a 20 f4  |'  . 256,1024: .|
0000b000  20 63 6c 69 63 6b 20 6f  6e 20 66 61 6b 65 66 69  | click on fakefi|
0000b010  6c 65 72 25 0d 05 c4 47  20 20 20 20 20 20 20 20  |ler%...G        |
0000b020  20 20 e7 20 a4 77 68 69  63 68 66 61 6b 65 69 63  |  . .whichfakeic|
0000b030  6f 6e 28 62 6c 6f 63 6b  25 21 30 2c 62 6c 6f 63  |on(block%!0,bloc|
0000b040  6b 25 21 34 29 3d 2d 31  20 8c 20 f2 74 6f 67 67  |k%!4)=-1 . .togg|
0000b050  6c 65 73 65 6c 65 63 74  28 a3 29 0d 05 c5 18 20  |leselect(.).... |
0000b060  20 c9 20 36 34 3a f4 20  53 65 6c 65 63 74 2d 64  | . 64:. Select-d|
0000b070  72 61 67 0d 05 c6 15 20  20 20 20 e7 20 63 68 69  |rag....    . chi|
0000b080  6c 64 25 3c 3e 30 20 8c  0d 05 c7 0f 20 20 20 20  |ld%<>0 .....    |
0000b090  20 20 f2 62 75 73 79 0d  05 c8 09 20 20 20 20 cc  |  .busy....    .|
0000b0a0  0d 05 c9 19 20 20 20 20  20 20 77 73 61 76 65 77  |....      wsavew|
0000b0b0  25 3d 77 69 6e 64 6f 77  25 0d 05 ca 16 20 20 20  |%=window%....   |
0000b0c0  20 20 20 c8 8e 20 77 69  6e 64 6f 77 25 20 ca 0d  |   .. window% ..|
0000b0d0  05 cb 39 20 20 20 20 20  20 20 20 c9 20 73 61 76  |..9        . sav|
0000b0e0  65 25 3a f2 74 6f 67 67  6c 65 73 65 6c 65 63 74  |e%:.toggleselect|
0000b0f0  28 a3 29 3a f4 20 73 65  74 73 20 61 6c 6c 25 20  |(.):. sets all% |
0000b100  74 6f 20 46 41 4c 53 45  0d 05 cc 47 20 20 20 20  |to FALSE...G    |
0000b110  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 77  |               w|
0000b120  73 61 76 65 64 72 61 67  25 3d 69 63 6f 6e 25 3a  |savedrag%=icon%:|
0000b130  f2 64 72 61 67 73 70 72  69 74 65 28 77 73 61 76  |.dragsprite(wsav|
0000b140  65 64 72 61 67 25 2c 77  73 61 76 65 77 25 29 0d  |edrag%,wsavew%).|
0000b150  05 cd 40 20 20 20 20 20  20 20 20 c9 20 66 61 6b  |..@        . fak|
0000b160  65 66 69 6c 65 72 25 3a  69 63 6f 6e 25 3d a4 77  |efiler%:icon%=.w|
0000b170  68 69 63 68 66 61 6b 65  69 63 6f 6e 28 62 6c 6f  |hichfakeicon(blo|
0000b180  63 6b 25 21 30 2c 62 6c  6f 63 6b 25 21 34 29 0d  |ck%!0,block%!4).|
0000b190  05 ce 56 20 20 20 20 20  20 20 20 20 20 e7 20 28  |..V          . (|
0000b1a0  69 63 6f 6e 25 3e 2d 31  20 80 20 61 6c 6c 25 3d  |icon%>-1 . all%=|
0000b1b0  a3 29 20 8c 20 77 73 61  76 65 64 72 61 67 25 3d  |.) . wsavedrag%=|
0000b1c0  69 63 6f 6e 25 3a f2 64  72 61 67 73 70 72 69 74  |icon%:.dragsprit|
0000b1d0  65 28 77 73 61 76 65 64  72 61 67 25 2c 77 73 61  |e(wsavedrag%,wsa|
0000b1e0  76 65 77 25 29 0d 05 cf  2c 20 20 20 20 20 20 20  |vew%)...,       |
0000b1f0  20 20 20 f4 20 6e 6f 72  6d 61 6c 20 73 61 76 65  |   . normal save|
0000b200  20 6f 66 20 73 65 6c 65  63 74 65 64 20 69 63 6f  | of selected ico|
0000b210  6e 0d 05 d0 49 20 20 20  20 20 20 20 20 20 20 73  |n...I          s|
0000b220  61 76 65 64 6c 65 76 65  6c 73 25 3d 6c 65 76 65  |avedlevels%=leve|
0000b230  6c 73 25 3a f4 20 69 6e  20 63 61 73 65 20 74 68  |ls%:. in case th|
0000b240  65 20 75 73 65 72 20 63  68 61 6e 67 65 73 20 6c  |e user changes l|
0000b250  65 76 65 6c 20 77 68 69  6c 65 0d 05 d1 2b 20 20  |evel while...+  |
0000b260  20 20 20 20 20 20 20 20  f4 20 74 61 73 6b 77 69  |        . taskwi|
0000b270  6e 64 6f 77 20 69 73 20  73 74 69 6c 6c 20 72 75  |ndow is still ru|
0000b280  6e 6e 69 6e 67 0d 05 d2  16 20 20 20 20 20 20 20  |nning....       |
0000b290  20 20 20 e7 20 61 6c 6c  25 20 8c 0d 05 d3 1c 20  |   . all% ..... |
0000b2a0  20 20 20 20 20 20 20 20  20 20 20 77 73 61 76 65  |           wsave|
0000b2b0  64 72 61 67 25 3d 30 0d  05 d4 49 20 20 20 20 20  |drag%=0...I     |
0000b2c0  20 20 20 20 20 20 20 f4  20 74 68 69 73 20 69 73  |       . this is|
0000b2d0  20 74 68 65 20 6f 6e 6c  79 20 69 63 6f 6e 20 6f  | the only icon o|
0000b2e0  66 20 77 68 6f 73 65 20  65 78 69 73 74 65 6e 63  |f whose existenc|
0000b2f0  65 20 77 65 20 63 61 6e  20 62 65 20 73 75 72 65  |e we can be sure|
0000b300  0d 05 d5 38 20 20 20 20  20 20 20 20 20 20 20 20  |...8            |
0000b310  f4 20 73 6f 20 70 72 65  74 65 6e 64 20 74 68 61  |. so pretend tha|
0000b320  74 20 77 65 27 72 65 20  73 61 76 69 6e 67 20 74  |t we're saving t|
0000b330  68 69 73 20 66 69 6c 65  0d 05 d6 4c 20 20 20 20  |his file...L    |
0000b340  20 20 20 20 20 20 20 20  f4 20 73 6f 20 74 68 61  |        . so tha|
0000b350  74 20 46 4e 75 73 65 72  5f 73 61 76 65 64 61 74  |t FNuser_savedat|
0000b360  61 20 67 65 74 73 20 63  61 6c 6c 65 64 2c 20 74  |a gets called, t|
0000b370  68 65 6e 20 49 6e 66 6f  5a 49 50 20 72 6f 75 74  |hen InfoZIP rout|
0000b380  69 6e 65 73 0d 05 d7 2d  20 20 20 20 20 20 20 20  |ines...-        |
0000b390  20 20 20 20 f4 20 77 69  6c 6c 20 73 61 76 65 20  |    . will save |
0000b3a0  74 68 65 20 5f 72 65 61  6c 5f 20 66 69 6c 65 73  |the _real_ files|
0000b3b0  21 0d 05 d8 47 20 20 20  20 20 20 20 20 20 20 20  |!...G           |
0000b3c0  20 e7 20 6e 6f 74 66 6f  6e 74 25 20 8c 20 f2 72  | . notfont% . .r|
0000b3d0  6f 74 61 74 69 6e 67 64  61 73 68 62 6f 78 20 8b  |otatingdashbox .|
0000b3e0  20 f2 64 72 61 67 73 70  72 69 74 65 28 2d 31 2c  | .dragsprite(-1,|
0000b3f0  77 73 61 76 65 77 25 29  0d 05 d9 0f 20 20 20 20  |wsavew%)....    |
0000b400  20 20 20 20 20 20 cd 0d  05 da 0b 20 20 20 20 20  |      .....     |
0000b410  20 cb 0d 05 db 09 20 20  20 20 cd 0d 05 dc 0c 20  | .....    ..... |
0000b420  20 c9 20 31 2c 34 3a 0d  05 dd 17 20 20 20 20 20  | . 1,4:....     |
0000b430  20 20 c8 8e 20 77 69 6e  64 6f 77 25 20 ca 0d 05  |  .. window% ...|
0000b440  de 15 20 20 20 20 20 20  20 20 20 c9 20 73 61 76  |..         . sav|
0000b450  65 25 3a 0d 05 df 21 20  20 20 20 20 20 20 20 20  |e%:...!         |
0000b460  20 20 e7 20 69 63 6f 6e  25 3d 73 61 76 65 5f 6f  |  . icon%=save_o|
0000b470  6b 25 20 8c 0d 05 e0 32  20 20 20 20 20 20 20 20  |k% ....2        |
0000b480  20 20 20 20 20 61 24 3d  a4 67 65 74 69 63 6f 6e  |     a$=.geticon|
0000b490  74 65 78 74 28 73 61 76  65 25 2c 73 61 76 65 5f  |text(save%,save_|
0000b4a0  70 61 74 68 25 29 0d 05  e1 2c 20 20 20 20 20 20  |path%)...,      |
0000b4b0  20 20 20 20 20 20 20 e7  20 a7 61 24 2c 22 2e 22  |       . .a$,"."|
0000b4c0  29 3d 30 20 80 20 a7 61  24 2c 22 3a 22 29 3d 30  |)=0 . .a$,":")=0|
0000b4d0  20 8c 0d 05 e2 37 20 20  20 20 20 20 20 20 20 20  | ....7          |
0000b4e0  20 20 20 20 20 f2 72 65  70 6f 72 74 28 a4 6d 65  |     .report(.me|
0000b4f0  73 73 61 67 65 5f 6c 6f  6f 6b 75 70 28 22 74 6f  |ssage_lookup("to|
0000b500  73 61 76 65 22 29 2c 31  29 0d 05 e3 12 20 20 20  |save"),1)....   |
0000b510  20 20 20 20 20 20 20 20  20 20 cc 0d 05 e4 1e 20  |          ..... |
0000b520  20 20 20 20 20 20 20 20  20 20 20 20 20 20 62 6c  |              bl|
0000b530  6f 63 6b 25 21 33 36 3d  30 0d 05 e5 20 20 20 20  |ock%!36=0...    |
0000b540  20 20 20 20 20 20 20 20  20 20 20 20 77 73 61 76  |            wsav|
0000b550  65 77 25 3d 73 61 76 65  25 0d 05 e6 20 20 20 20  |ew%=save%...    |
0000b560  20 20 20 20 20 20 20 20  20 20 20 20 70 72 65 73  |            pres|
0000b570  65 72 76 65 25 21 30 3d  30 0d 05 e7 23 20 20 20  |erve%!0=0...#   |
0000b580  20 20 20 20 20 20 20 20  20 20 20 20 f2 64 72 61  |            .dra|
0000b590  67 67 65 64 5f 6f 75 74  28 61 24 29 0d 05 e8 12  |gged_out(a$)....|
0000b5a0  20 20 20 20 20 20 20 20  20 20 20 20 20 cd 0d 05  |             ...|
0000b5b0  e9 10 20 20 20 20 20 20  20 20 20 20 20 cd 0d 05  |..           ...|
0000b5c0  ea 4a 20 20 20 20 20 20  20 20 20 20 20 e7 20 69  |.J           . i|
0000b5d0  63 6f 6e 25 3d 73 61 76  65 5f 63 61 6e 63 65 6c  |con%=save_cancel|
0000b5e0  25 20 8c 20 f2 63 6c 6f  73 65 28 73 61 76 65 25  |% . .close(save%|
0000b5f0  29 3a c8 99 22 57 69 6d  70 5f 43 72 65 61 74 65  |):.."Wimp_Create|
0000b600  4d 65 6e 75 22 2c 2d 31  0d 05 eb 12 20 20 20 20  |Menu",-1....    |
0000b610  20 20 20 c9 20 62 61 72  25 3a 0d 05 ec 1c 20 20  |   . bar%:....  |
0000b620  20 20 20 20 20 20 20 20  20 c8 8e 20 62 75 74 74  |         .. butt|
0000b630  6f 6e 73 25 20 ca 0d 05  ed 1d 20 20 20 20 20 20  |ons% .....      |
0000b640  20 20 20 20 20 20 20 c9  20 34 3a f4 20 53 45 4c  |       . 4:. SEL|
0000b650  45 43 54 0d 05 ee 1b 20  20 20 20 20 20 20 20 20  |ECT....         |
0000b660  20 20 20 20 20 e7 20 a6  28 2d 31 29 20 8c 0d 05  |     . .(-1) ...|
0000b670  ef 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
0000b680  20 20 20 f2 6f 70 65 6e  63 6f 6e 66 69 67 0d 05  |   .openconfig..|
0000b690  f0 14 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |..              |
0000b6a0  20 cc 0d 05 f1 30 20 20  20 20 20 20 20 20 20 20  | ....0          |
0000b6b0  20 20 20 20 20 20 20 f4  20 72 65 6f 70 65 6e 20  |       . reopen |
0000b6c0  6c 61 73 74 20 77 69 6e  64 6f 77 20 6f 70 65 6e  |last window open|
0000b6d0  65 64 0d 05 f2 7b 20 20  20 20 20 20 20 20 20 20  |ed...{          |
0000b6e0  20 20 20 20 20 20 20 e7  20 6c 61 73 74 5f 6f 70  |       . last_op|
0000b6f0  65 6e 65 64 25 20 8c 20  21 62 6c 6f 63 6b 25 3d  |ened% . !block%=|
0000b700  6c 61 73 74 5f 6f 70 65  6e 65 64 25 3a c8 99 22  |last_opened%:.."|
0000b710  57 69 6d 70 5f 47 65 74  57 69 6e 64 6f 77 53 74  |Wimp_GetWindowSt|
0000b720  61 74 65 22 2c 2c 62 6c  6f 63 6b 25 3a 62 6c 6f  |ate",,block%:blo|
0000b730  63 6b 25 21 32 38 3d 2d  31 3a f2 6f 70 65 6e 77  |ck%!28=-1:.openw|
0000b740  69 6e 64 6f 77 28 62 6c  6f 63 6b 25 29 0d 05 f3  |indow(block%)...|
0000b750  14 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
0000b760  cd 0d 05 f4 1d 20 20 20  20 20 20 20 20 20 20 20  |.....           |
0000b770  20 20 c9 20 31 3a f4 20  41 44 4a 55 53 54 0d 05  |  . 1:. ADJUST..|
0000b780  f5 22 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |."              |
0000b790  20 20 20 f2 63 72 65 61  74 65 6e 65 77 28 b9 29  |   .createnew(.)|
0000b7a0  0d 05 f6 10 20 20 20 20  20 20 20 20 20 20 20 cb  |....           .|
0000b7b0  0d 05 f7 2e 20 20 20 20  20 20 20 c9 20 66 61 6b  |....       . fak|
0000b7c0  65 66 69 6c 65 72 25 3a  f4 20 64 6f 75 62 6c 65  |efiler%:. double|
0000b7d0  2d 63 6c 69 63 6b 20 6f  6e 20 69 63 6f 6e 0d 05  |-click on icon..|
0000b7e0  f8 37 20 20 20 20 20 20  20 20 20 20 20 20 69 63  |.7            ic|
0000b7f0  6f 6e 25 3d a4 77 68 69  63 68 66 61 6b 65 69 63  |on%=.whichfakeic|
0000b800  6f 6e 28 62 6c 6f 63 6b  25 21 30 2c 62 6c 6f 63  |on(block%!0,bloc|
0000b810  6b 25 21 34 29 0d 05 f9  2a 20 20 20 20 20 20 20  |k%!4)...*       |
0000b820  20 20 20 20 20 61 24 3d  a4 77 68 69 63 68 66 61  |     a$=.whichfa|
0000b830  6b 65 73 70 72 69 74 65  28 69 63 6f 6e 25 29 0d  |kesprite(icon%).|
0000b840  05 fa 17 20 20 20 20 20  20 20 20 20 20 20 20 c8  |...            .|
0000b850  8e 20 61 24 20 ca 0d 05  fb 1f 20 20 20 20 20 20  |. a$ .....      |
0000b860  20 20 20 20 20 20 20 20  c9 20 22 66 69 6c 65 5f  |        . "file_|
0000b870  78 78 78 22 3a 0d 05 fc  41 20 20 20 20 20 20 20  |xxx":...A       |
0000b880  20 20 20 20 20 20 20 20  20 20 e7 20 a6 28 2d 31  |          . .(-1|
0000b890  29 20 8c 20 64 6f 6e 74  62 72 6f 61 64 63 61 73  |) . dontbroadcas|
0000b8a0  74 25 3d a3 3a f4 20 53  68 69 66 74 20 68 65 6c  |t%=.:. Shift hel|
0000b8b0  64 20 64 6f 77 6e 0d 05  fd a5 20 20 20 20 20 20  |d down....      |
0000b8c0  20 20 20 20 20 20 20 20  20 20 20 e7 20 63 68 69  |           . chi|
0000b8d0  6c 64 25 3d 30 20 8c 20  6e 6f 74 7a 69 70 70 65  |ld%=0 . notzippe|
0000b8e0  64 24 3d 22 3c 57 69 6d  70 24 53 63 72 61 70 44  |d$="<Wimp$ScrapD|
0000b8f0  69 72 3e 2e 22 2b a4 75  6e 44 4f 53 69 66 79 28  |ir>."+.unDOSify(|
0000b900  a4 67 65 74 66 61 6b 65  6c 65 61 66 6e 61 6d 65  |.getfakeleafname|
0000b910  28 69 63 6f 6e 25 2c b9  29 29 3a 77 61 69 74 24  |(icon%,.)):wait$|
0000b920  3d 22 75 6e 7a 69 70 22  3a 63 68 69 6c 64 25 3d  |="unzip":child%=|
0000b930  a4 63 68 69 6c 64 74 61  73 6b 28 a4 63 6f 6d 6d  |.childtask(.comm|
0000b940  61 6e 64 6c 69 6e 65 28  22 75 6e 7a 69 70 22 2c  |andline("unzip",|
0000b950  61 24 29 29 8b 20 f2 62  75 73 79 0d 05 fe 6d 20  |a$)). .busy...m |
0000b960  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
0000b970  20 73 61 76 65 64 6c 65  76 65 6c 73 25 3d 6c 65  | savedlevels%=le|
0000b980  76 65 6c 73 25 3a f4 20  69 6e 20 63 61 73 65 20  |vels%:. in case |
0000b990  74 68 65 20 75 73 65 72  20 63 68 61 6e 67 65 73  |the user changes|
0000b9a0  20 6c 65 76 65 6c 20 77  68 69 6c 65 20 74 61 73  | level while tas|
0000b9b0  6b 77 69 6e 64 6f 77 20  69 73 20 73 74 69 6c 6c  |kwindow is still|
0000b9c0  20 72 75 6e 6e 69 6e 67  0d 05 ff 04 0d 06 00 25  | running.......%|
0000b9d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 7f 3a  |              .:|
0000b9e0  f2 6e 65 78 74 6c 65 76  65 6c 28 69 63 6f 6e 25  |.nextlevel(icon%|
0000b9f0  29 0d 06 01 11 20 20 20  20 20 20 20 20 20 20 20  |)....           |
0000ba00  20 cb 0d 06 02 30 20 20  20 20 20 20 20 c9 20 70  | ....0       . p|
0000ba10  61 6e 65 70 61 74 68 25  3a 6c 65 76 65 6c 73 25  |anepath%:levels%|
0000ba20  3d a4 75 70 6c 65 76 65  6c 28 6c 65 76 65 6c 73  |=.uplevel(levels|
0000ba30  25 29 0d 06 03 18 20 20  20 20 20 20 20 c9 20 63  |%)....       . c|
0000ba40  6f 6e 66 69 67 75 72 65  25 3a 0d 06 04 1f 20 20  |onfigure%:....  |
0000ba50  20 20 20 20 20 20 20 f4  20 67 61 69 6e 20 69 6e  |       . gain in|
0000ba60  70 75 74 20 66 6f 63 75  73 0d 06 05 2b 20 20 20  |put focus...+   |
0000ba70  20 20 20 20 20 20 f2 70  75 74 63 61 72 65 74 69  |      .putcareti|
0000ba80  6e 69 63 6f 6e 28 63 6f  6e 66 69 67 75 72 65 25  |nicon(configure%|
0000ba90  2c 2d 31 29 0d 06 06 17  20 20 20 20 20 20 20 20  |,-1)....        |
0000baa0  20 c8 8e 20 69 63 6f 6e  25 20 ca 0d 06 07 28 20  | .. icon% ....( |
0000bab0  20 20 20 20 20 20 20 20  20 20 c9 20 69 63 5f 62  |          . ic_b|
0000bac0  75 6d 70 75 70 25 2c 69  63 5f 62 75 6d 70 64 6f  |umpup%,ic_bumpdo|
0000bad0  77 6e 25 0d 06 08 6e 20  20 20 20 20 20 20 20 20  |wn%...n         |
0000bae0  20 20 61 72 72 6f 77 73  76 61 6c 75 65 25 3d 31  |  arrowsvalue%=1|
0000baf0  2b bb 28 a4 67 65 74 69  63 6f 6e 74 65 78 74 28  |+.(.geticontext(|
0000bb00  63 6f 6e 66 69 67 75 72  65 25 2c 69 63 5f 74 69  |configure%,ic_ti|
0000bb10  6d 65 64 69 73 70 25 29  29 2b 28 69 63 6f 6e 25  |medisp%))+(icon%|
0000bb20  3d 69 63 5f 62 75 6d 70  64 6f 77 6e 25 29 2d 28  |=ic_bumpdown%)-(|
0000bb30  69 63 6f 6e 25 3d 69 63  5f 62 75 6d 70 75 70 25  |icon%=ic_bumpup%|
0000bb40  29 0d 06 09 3d 20 20 20  20 20 20 20 20 20 20 20  |)...=           |
0000bb50  f4 20 49 66 20 62 75 6d  70 75 70 25 2c 20 73 75  |. If bumpup%, su|
0000bb60  62 74 72 61 63 74 20 2d  31 3b 20 69 66 20 62 75  |btract -1; if bu|
0000bb70  6d 70 64 6f 77 6e 25 20  61 64 64 20 2d 31 0d 06  |mpdown% add -1..|
0000bb80  0a 52 20 20 20 20 20 20  20 20 20 20 20 f2 73 65  |.R           .se|
0000bb90  74 69 63 6f 6e 74 65 78  74 28 63 6f 6e 66 69 67  |ticontext(config|
0000bba0  75 72 65 25 2c 69 63 5f  74 69 6d 65 64 69 73 70  |ure%,ic_timedisp|
0000bbb0  25 2c c3 28 a4 6c 6f 6f  70 65 64 28 61 72 72 6f  |%,.(.looped(arro|
0000bbc0  77 73 76 61 6c 75 65 25  2c 31 30 29 2d 31 29 29  |wsvalue%,10)-1))|
0000bbd0  0d 06 0b 51 20 20 20 20  20 20 20 20 20 f4 20 46  |...Q         . F|
0000bbe0  4e 6c 6f 6f 70 65 64 20  67 6f 65 73 20 66 72 6f  |Nlooped goes fro|
0000bbf0  6d 20 31 20 74 6f 20 6d  61 78 2c 20 77 65 20 77  |m 1 to max, we w|
0000bc00  61 6e 74 20 30 20 74 6f  20 6d 61 78 2c 20 73 6f  |ant 0 to max, so|
0000bc10  20 66 69 72 73 74 20 77  65 20 61 64 64 65 64 20  | first we added |
0000bc20  31 0d 06 0c 59 20 20 20  20 20 20 20 20 20 f4 20  |1...Y         . |
0000bc30  6e 6f 77 20 73 65 74 20  6d 61 78 20 6c 69 6d 69  |now set max limi|
0000bc40  74 20 6f 6e 65 20 67 72  65 61 74 65 72 20 74 68  |t one greater th|
0000bc50  61 6e 20 72 65 71 75 69  72 65 64 2c 20 74 68 65  |an required, the|
0000bc60  6e 20 73 75 62 74 72 61  63 74 20 6f 6e 65 20 66  |n subtract one f|
0000bc70  72 6f 6d 20 72 65 73 75  6c 74 0d 06 0d 17 20 20  |rom result....  |
0000bc80  20 20 20 20 20 20 20 20  20 c9 20 69 63 5f 4f 4b  |         . ic_OK|
0000bc90  25 0d 06 0e 1c 20 20 20  20 20 20 20 20 20 20 20  |%....           |
0000bca0  20 20 f2 72 65 61 64 63  6f 6e 66 69 67 0d 06 0f  |  .readconfig...|
0000bcb0  3b 20 20 20 20 20 20 20  20 20 20 20 20 20 e7 20  |;             . |
0000bcc0  28 62 75 74 74 6f 6e 73  25 20 80 20 25 30 30 31  |(buttons% . %001|
0000bcd0  29 3d 30 20 8c 20 f2 63  6c 6f 73 65 28 63 6f 6e  |)=0 . .close(con|
0000bce0  66 69 67 75 72 65 25 29  0d 06 10 19 20 20 20 20  |figure%)....    |
0000bcf0  20 20 20 20 20 20 20 c9  20 69 63 5f 73 61 76 65  |       . ic_save|
0000bd00  25 0d 06 11 1c 20 20 20  20 20 20 20 20 20 20 20  |%....           |
0000bd10  20 20 f2 72 65 61 64 63  6f 6e 66 69 67 0d 06 12  |  .readconfig...|
0000bd20  1d 20 20 20 20 20 20 20  20 20 20 20 20 20 f2 73  |.             .s|
0000bd30  61 76 65 6f 70 74 69 6f  6e 73 0d 06 13 3b 20 20  |aveoptions...;  |
0000bd40  20 20 20 20 20 20 20 20  20 20 20 e7 20 28 62 75  |           . (bu|
0000bd50  74 74 6f 6e 73 25 20 80  20 25 30 30 31 29 3d 30  |ttons% . %001)=0|
0000bd60  20 8c 20 f2 63 6c 6f 73  65 28 63 6f 6e 66 69 67  | . .close(config|
0000bd70  75 72 65 25 29 0d 06 14  1b 20 20 20 20 20 20 20  |ure%)....       |
0000bd80  20 20 20 20 c9 20 69 63  5f 63 61 6e 63 65 6c 25  |    . ic_cancel%|
0000bd90  0d 06 15 1d 20 20 20 20  20 20 20 20 20 20 20 20  |....            |
0000bda0  20 f2 73 65 74 75 70 63  6f 6e 66 69 67 0d 06 16  | .setupconfig...|
0000bdb0  3b 20 20 20 20 20 20 20  20 20 20 20 20 20 e7 20  |;             . |
0000bdc0  28 62 75 74 74 6f 6e 73  25 20 80 20 25 30 30 31  |(buttons% . %001|
0000bdd0  29 3d 30 20 8c 20 f2 63  6c 6f 73 65 28 63 6f 6e  |)=0 . .close(con|
0000bde0  66 69 67 75 72 65 25 29  0d 06 17 04 0d 06 18 0e  |figure%)........|
0000bdf0  20 20 20 20 20 20 20 20  20 cb 0d 06 19 17 20 20  |         .....  |
0000be00  20 20 20 20 20 c9 20 61  6c 65 72 74 62 6f 78 25  |     . alertbox%|
0000be10  3a 0d 06 1a 1e 20 20 20  20 20 20 20 20 20 f2 63  |:....         .c|
0000be20  6c 6f 73 65 28 61 6c 65  72 74 62 6f 78 25 29 0d  |lose(alertbox%).|
0000be30  06 1b 3d 20 20 20 20 20  20 20 20 20 70 6f 6c 6c  |..=         poll|
0000be40  6d 61 73 6b 25 20 3d 20  70 6f 6c 6c 6d 61 73 6b  |mask% = pollmask|
0000be50  25 20 84 20 25 31 3a f4  20 6d 61 73 6b 20 6f 75  |% . %1:. mask ou|
0000be60  74 20 6e 75 6c 6c 2d 70  6f 6c 6c 73 0d 06 1c 0c  |t null-polls....|
0000be70  20 20 20 20 20 20 20 cb  0d 06 1d 05 cb 0d 06 1e  |       .........|
0000be80  05 e1 0d 06 1f 05 3a 0d  06 20 16 dd 20 f2 72 6f  |......:.. .. .ro|
0000be90  74 61 74 69 6e 67 64 61  73 68 62 6f 78 0d 06 21  |tatingdashbox..!|
0000bea0  38 21 62 6c 6f 63 6b 25  3d 66 61 6b 65 66 69 6c  |8!block%=fakefil|
0000beb0  65 72 25 3a c8 99 22 57  69 6d 70 5f 47 65 74 57  |er%:.."Wimp_GetW|
0000bec0  69 6e 64 6f 77 4f 75 74  6c 69 6e 65 22 2c 2c 62  |indowOutline",,b|
0000bed0  6c 6f 63 6b 25 0d 06 22  58 62 6c 6f 63 6b 25 21  |lock%.."Xblock%!|
0000bee0  32 30 3d 62 6c 6f 63 6b  25 21 31 36 2d 35 30 3a  |20=block%!16-50:|
0000bef0  62 6c 6f 63 6b 25 21 31  36 3d 62 6c 6f 63 6b 25  |block%!16=block%|
0000bf00  21 31 32 2d 36 30 3a 62  6c 6f 63 6b 25 21 31 32  |!12-60:block%!12|
0000bf10  3d 62 6c 6f 63 6b 25 21  38 2b 34 3a 62 6c 6f 63  |=block%!8+4:bloc|
0000bf20  6b 25 21 38 3d 62 6c 6f  63 6b 25 21 34 0d 06 23  |k%!8=block%!4..#|
0000bf30  20 62 6c 6f 63 6b 25 21  34 3d 35 3a f4 20 64 61  | block%!4=5:. da|
0000bf40  73 68 65 64 20 64 72 61  67 20 62 6f 78 0d 06 24  |shed drag box..$|
0000bf50  43 62 6c 6f 63 6b 25 21  32 34 3d 30 3a 62 6c 6f  |Cblock%!24=0:blo|
0000bf60  63 6b 25 21 32 38 3d 30  3a 62 6c 6f 63 6b 25 21  |ck%!28=0:block%!|
0000bf70  33 32 3d 26 37 46 46 46  46 46 46 46 3a 62 6c 6f  |32=&7FFFFFFF:blo|
0000bf80  63 6b 25 21 33 36 3d 26  37 46 46 46 46 46 46 46  |ck%!36=&7FFFFFFF|
0000bf90  0d 06 25 1c c8 99 22 57  69 6d 70 5f 44 72 61 67  |..%..."Wimp_Drag|
0000bfa0  42 6f 78 22 2c 2c 62 6c  6f 63 6b 25 0d 06 26 05  |Box",,block%..&.|
0000bfb0  e1 0d 06 27 05 3a 0d 06  28 21 dd 20 f2 64 72 61  |...'.:..(!. .dra|
0000bfc0  67 73 70 72 69 74 65 28  69 63 6f 6e 25 2c 77 68  |gsprite(icon%,wh|
0000bfd0  61 6e 64 6c 65 25 29 0d  06 29 11 ea 20 78 25 2c  |andle%)..).. x%,|
0000bfe0  79 25 2c 6e 61 6d 65 24  0d 06 2a 14 21 62 6c 6f  |y%,name$..*.!blo|
0000bff0  63 6b 25 3d 77 68 61 6e  64 6c 65 25 0d 06 2b 10  |ck%=whandle%..+.|
0000c000  e7 20 69 63 6f 6e 25 3e  3d 30 20 8c 0d 06 2c 12  |. icon%>=0 ...,.|
0000c010  20 c8 8e 20 77 68 61 6e  64 6c 65 25 20 ca 0d 06  | .. whandle% ...|
0000c020  2d 32 20 20 20 c9 20 66  61 6b 65 66 69 6c 65 72  |-2   . fakefiler|
0000c030  25 3a 20 6e 61 6d 65 24  3d a4 77 68 69 63 68 66  |%: name$=.whichf|
0000c040  61 6b 65 73 70 72 69 74  65 28 69 63 6f 6e 25 29  |akesprite(icon%)|
0000c050  0d 06 2e 1f 20 20 20 c9  20 73 61 76 65 25 3a 20  |....   . save%: |
0000c060  6e 61 6d 65 24 3d 73 61  76 65 69 63 6f 6e 24 0d  |name$=saveicon$.|
0000c070  06 2f 06 20 cb 0d 06 30  05 cc 0d 06 31 47 f4 20  |./. ...0....1G. |
0000c080  77 65 20 75 73 65 20 69  63 6f 6e 25 3d 2d 31 20  |we use icon%=-1 |
0000c090  74 6f 20 66 6f 72 63 65  20 27 70 61 63 6b 61 67  |to force 'packag|
0000c0a0  65 27 20 73 70 72 69 74  65 20 74 6f 20 61 70 70  |e' sprite to app|
0000c0b0  65 61 72 20 62 65 6c 6f  77 20 70 6f 69 6e 74 65  |ear below pointe|
0000c0c0  72 0d 06 32 46 20 20 6e  61 6d 65 24 3d 22 70 61  |r..2F  name$="pa|
0000c0d0  63 6b 61 67 65 22 3a f4  20 52 49 53 43 2d 4f 53  |ckage":. RISC-OS|
0000c0e0  20 33 b7 35 20 61 6e 64  20 67 72 65 61 74 65 72  | 3.5 and greater|
0000c0f0  20 68 61 76 65 20 74 68  69 73 20 69 6e 20 57 69  | have this in Wi|
0000c100  6d 70 20 70 6f 6f 6c 0d  06 33 05 cd 0d 06 34 23  |mp pool..3....4#|
0000c110  c8 99 22 57 69 6d 70 5f  47 65 74 50 6f 69 6e 74  |.."Wimp_GetPoint|
0000c120  65 72 49 6e 66 6f 22 2c  2c 62 6c 6f 63 6b 25 0d  |erInfo",,block%.|
0000c130  06 35 18 62 6c 6f 63 6b  25 21 38 3d 62 6c 6f 63  |.5.block%!8=bloc|
0000c140  6b 25 21 30 2b 31 32 0d  06 36 4f 62 6c 6f 63 6b  |k%!0+12..6Oblock|
0000c150  25 21 31 32 3d 62 6c 6f  63 6b 25 21 34 2b 31 32  |%!12=block%!4+12|
0000c160  3a f4 20 72 61 6e 64 6f  6d 20 76 61 6c 75 65 20  |:. random value |
0000c170  66 6f 72 20 27 64 72 61  67 20 62 6f 78 27 20 77  |for 'drag box' w|
0000c180  68 69 63 68 20 73 65 65  6d 73 20 74 6f 20 77 6f  |hich seems to wo|
0000c190  72 6b 20 3a 2d 28 0d 06  37 2c c8 99 22 44 72 61  |rk :-(..7,.."Dra|
0000c1a0  67 41 53 70 72 69 74 65  5f 53 74 61 72 74 22 2c  |gASprite_Start",|
0000c1b0  26 43 35 2c 31 2c 6e 61  6d 65 24 2c 62 6c 6f 63  |&C5,1,name$,bloc|
0000c1c0  6b 25 0d 06 38 05 e1 0d  06 39 05 3a 0d 06 3a 0f  |k%..8....9.:..:.|
0000c1d0  dd 20 f2 64 72 61 67 5f  65 6e 64 0d 06 3b 27 ea  |. .drag_end..;'.|
0000c1e0  20 77 69 6e 25 2c 69 63  6f 6e 25 2c 78 25 2c 79  | win%,icon%,x%,y|
0000c1f0  25 2c 6e 25 2c 61 24 2c  20 64 61 74 61 73 61 76  |%,n%,a$, datasav|
0000c200  65 25 0d 06 3c 46 64 61  74 61 73 61 76 65 25 3d  |e%..<Fdatasave%=|
0000c210  74 65 6d 70 25 2b 32 35  36 2b 36 34 3a f4 20 61  |temp%+256+64:. a|
0000c220  62 6f 76 65 20 73 63 72  61 74 63 68 20 73 70 61  |bove scratch spa|
0000c230  63 65 20 61 6e 64 20 6f  70 65 6e 77 69 6e 64 6f  |ce and openwindo|
0000c240  77 20 62 75 66 66 65 72  0d 06 3d 18 c8 99 22 44  |w buffer..=..."D|
0000c250  72 61 67 41 53 70 72 69  74 65 5f 53 74 6f 70 22  |ragASprite_Stop"|
0000c260  0d 06 3e 23 c8 99 22 57  69 6d 70 5f 47 65 74 50  |..>#.."Wimp_GetP|
0000c270  6f 69 6e 74 65 72 49 6e  66 6f 22 2c 2c 62 6c 6f  |ointerInfo",,blo|
0000c280  63 6b 25 0d 06 3f 12 77  69 6e 25 3d 62 6c 6f 63  |ck%..?.win%=bloc|
0000c290  6b 25 21 31 32 0d 06 40  37 e7 20 77 69 6e 25 3d  |k%!12..@7. win%=|
0000c2a0  66 61 6b 65 66 69 6c 65  72 25 20 84 20 77 69 6e  |fakefiler% . win|
0000c2b0  25 3d 73 61 76 65 25 20  84 20 77 69 6e 25 3d 70  |%=save% . win%=p|
0000c2c0  61 6e 65 70 61 74 68 25  20 8c 20 e1 0d 06 41 13  |anepath% . ...A.|
0000c2d0  69 63 6f 6e 25 3d 62 6c  6f 63 6b 25 21 31 36 0d  |icon%=block%!16.|
0000c2e0  06 42 0e 78 25 3d 21 62  6c 6f 63 6b 25 0d 06 43  |.B.x%=!block%..C|
0000c2f0  0f 79 25 3d 62 6c 6f 63  6b 25 21 34 0d 06 44 49  |.y%=block%!4..DI|
0000c300  e7 20 77 73 61 76 65 77  25 3d 66 61 6b 65 66 69  |. wsavew%=fakefi|
0000c310  6c 65 72 25 20 8c 20 61  24 3d a4 77 68 69 63 68  |ler% . a$=.which|
0000c320  66 61 6b 65 73 70 72 69  74 65 28 77 73 61 76 65  |fakesprite(wsave|
0000c330  64 72 61 67 25 29 20 8b  20 61 24 3d 73 61 76 65  |drag%) . a$=save|
0000c340  69 63 6f 6e 24 0d 06 45  0f c8 8e 20 c0 61 24 2c  |icon$..E... .a$,|
0000c350  35 29 20 ca 0d 06 46 10  20 20 c9 20 22 66 69 6c  |5) ...F.  . "fil|
0000c360  65 5f 22 3a 0d 06 47 18  20 20 20 20 e7 20 c2 61  |e_":..G.    . .a|
0000c370  24 2c 33 29 3d 22 78 78  78 22 20 8c 0d 06 48 37  |$,3)="xxx" ...H7|
0000c380  20 20 20 20 20 20 64 61  74 61 73 61 76 65 25 21  |      datasave%!|
0000c390  34 30 20 3d 20 26 66 66  64 20 3a f4 20 70 72 65  |40 = &ffd :. pre|
0000c3a0  74 65 6e 64 20 74 79 70  65 20 69 73 20 27 44 61  |tend type is 'Da|
0000c3b0  74 61 27 0d 06 49 09 20  20 20 20 cc 0d 06 4a 3c  |ta'..I.    ...J<|
0000c3c0  20 20 20 20 20 20 c8 99  22 4f 53 5f 52 65 61 64  |      .."OS_Read|
0000c3d0  55 6e 73 69 67 6e 65 64  22 2c 31 30 2c 22 26 22  |Unsigned",10,"&"|
0000c3e0  2b c2 61 24 2c 33 29 20  b8 20 2c 2c 64 61 74 61  |+.a$,3) . ,,data|
0000c3f0  73 61 76 65 25 21 34 30  0d 06 4b 09 20 20 20 20  |save%!40..K.    |
0000c400  cd 0d 06 4c 23 20 20 c9  20 22 64 69 72 65 63 22  |...L#  . "direc"|
0000c410  3a 64 61 74 61 73 61 76  65 25 21 34 30 20 3d 20  |:datasave%!40 = |
0000c420  31 30 30 30 0d 06 4d 23  20 20 c9 20 22 61 70 70  |1000..M#  . "app|
0000c430  6c 69 22 3a 64 61 74 61  73 61 76 65 25 21 34 30  |li":datasave%!40|
0000c440  20 3d 20 32 30 30 30 0d  06 4e 05 cb 0d 06 4f 12  | = 2000..N....O.|
0000c450  64 61 74 61 73 61 76 65  25 21 31 32 3d 30 0d 06  |datasave%!12=0..|
0000c460  50 1d 64 61 74 61 73 61  76 65 25 21 31 36 3d 31  |P.datasave%!16=1|
0000c470  3a f4 20 44 61 74 61 53  61 76 65 0d 06 51 42 61  |:. DataSave..QBa|
0000c480  24 3d a4 73 61 76 65 74  65 78 74 28 77 73 61 76  |$=.savetext(wsav|
0000c490  65 77 25 2c 77 73 61 76  65 64 72 61 67 25 29 3a  |ew%,wsavedrag%):|
0000c4a0  e7 20 a7 61 24 2c 22 2e  22 29 20 8c 20 61 24 3d  |. .a$,".") . a$=|
0000c4b0  a4 75 6e 44 4f 53 69 66  79 28 61 24 29 0d 06 52  |.unDOSify(a$)..R|
0000c4c0  19 24 28 64 61 74 61 73  61 76 65 25 2b 34 34 29  |.$(datasave%+44)|
0000c4d0  3d 61 24 2b bd 30 0d 06  53 41 21 64 61 74 61 73  |=a$+.0..SA!datas|
0000c4e0  61 76 65 25 3d 28 34 34  2b a9 28 61 24 29 2b 31  |ave%=(44+.(a$)+1|
0000c4f0  20 2b 33 29 20 80 20 ac  20 33 3a f4 20 77 6f 72  | +3) . . 3:. wor|
0000c500  64 2d 61 6c 69 67 6e 20  6c 65 6e 67 74 68 20 6f  |d-align length o|
0000c510  66 20 62 6c 6f 63 6b 0d  06 54 15 64 61 74 61 73  |f block..T.datas|
0000c520  61 76 65 25 21 32 30 3d  77 69 6e 25 0d 06 55 16  |ave%!20=win%..U.|
0000c530  64 61 74 61 73 61 76 65  25 21 32 34 3d 69 63 6f  |datasave%!24=ico|
0000c540  6e 25 0d 06 56 13 64 61  74 61 73 61 76 65 25 21  |n%..V.datasave%!|
0000c550  32 38 3d 78 25 0d 06 57  13 64 61 74 61 73 61 76  |28=x%..W.datasav|
0000c560  65 25 21 33 32 3d 79 25  0d 06 58 15 64 61 74 61  |e%!32=y%..X.data|
0000c570  73 61 76 65 25 21 33 36  3d 31 30 32 34 0d 06 59  |save%!36=1024..Y|
0000c580  30 c8 99 22 57 69 6d 70  5f 53 65 6e 64 4d 65 73  |0.."Wimp_SendMes|
0000c590  73 61 67 65 22 2c 31 38  2c 64 61 74 61 73 61 76  |sage",18,datasav|
0000c5a0  65 25 2c 77 69 6e 25 2c  69 63 6f 6e 25 0d 06 5a  |e%,win%,icon%..Z|
0000c5b0  05 e1 0d 06 5b 05 3a 0d  06 5c 0e dd 20 f2 6d 65  |....[.:..\.. .me|
0000c5c0  73 73 61 67 65 0d 06 5d  12 c8 8e 20 62 6c 6f 63  |ssage..]... bloc|
0000c5d0  6b 25 21 31 36 20 ca 0d  06 5e 1a c9 20 30 20 20  |k%!16 ...^.. 0  |
0000c5e0  20 20 20 20 3a 20 66 69  6e 69 73 68 65 64 25 3d  |    : finished%=|
0000c5f0  b9 0d 06 5f 48 c9 20 31  20 20 20 20 20 20 3a 20  |..._H. 1      : |
0000c600  70 61 72 61 6d 31 24 3d  70 24 3a 70 61 72 61 6d  |param1$=p$:param|
0000c610  32 24 3d 22 22 3a f2 72  65 70 6f 72 74 28 a4 6d  |2$="":.report(.m|
0000c620  65 73 73 61 67 65 5f 6c  6f 6f 6b 73 75 62 28 22  |essage_looksub("|
0000c630  73 61 76 58 22 29 2c 31  29 0d 06 60 34 c9 20 32  |savX"),1)..`4. 2|
0000c640  20 20 20 20 20 20 3a 20  f2 70 72 65 73 65 72 76  |      : .preserv|
0000c650  65 3a f2 64 72 61 67 67  65 64 5f 6f 75 74 28 a4  |e:.dragged_out(.|
0000c660  73 28 62 6c 6f 63 6b 25  2b 34 34 29 29 0d 06 61  |s(block%+44))..a|
0000c670  2a c9 20 33 2c 35 20 20  20 20 3a 20 f2 67 6f 74  |*. 3,5    : .got|
0000c680  44 61 74 61 4c 6f 61 64  28 a4 73 28 62 6c 6f 63  |DataLoad(.s(bloc|
0000c690  6b 25 2b 34 34 29 29 0d  06 62 2e c9 20 31 30 20  |k%+44))..b.. 10 |
0000c6a0  20 20 20 20 3a 20 f2 73  61 76 65 64 65 73 6b 74  |    : .savedeskt|
0000c6b0  6f 70 62 6f 6f 74 66 69  6c 65 28 62 6c 6f 63 6b  |opbootfile(block|
0000c6c0  25 21 32 30 29 0d 06 63  16 c9 20 26 35 30 32 20  |%!20)..c.. &502 |
0000c6d0  20 20 3a 20 f2 64 6f 68  65 6c 70 0d 06 64 3a c9  |  : .dohelp..d:.|
0000c6e0  20 26 34 30 30 43 30 20  3a 20 f2 6d 65 6e 75 77  | &400C0 : .menuw|
0000c6f0  61 72 6e 69 6e 67 28 62  6c 6f 63 6b 25 21 32 30  |arning(block%!20|
0000c700  2c 62 6c 6f 63 6b 25 21  32 34 2c 62 6c 6f 63 6b  |,block%!24,block|
0000c710  25 21 32 38 29 0d 06 65  29 c9 20 26 34 30 30 43  |%!28)..e). &400C|
0000c720  31 2c 26 34 30 30 43 46  20 3a 20 f4 20 6d 6f 64  |1,&400CF : . mod|
0000c730  65 2f 66 6f 6e 74 20 63  68 61 6e 67 65 64 0d 06  |e/font changed..|
0000c740  66 14 20 20 f2 72 65 63  61 6c 63 69 63 6f 6e 62  |f.  .recalciconb|
0000c750  61 72 0d 06 67 19 20 20  62 6c 6f 63 6b 25 21 30  |ar..g.  block%!0|
0000c760  3d 66 61 6b 65 66 69 6c  65 72 25 0d 06 68 24 20  |=fakefiler%..h$ |
0000c770  20 c8 99 22 57 69 6d 70  5f 47 65 74 57 69 6e 64  | .."Wimp_GetWind|
0000c780  6f 77 49 6e 66 6f 22 2c  2c 62 6c 6f 63 6b 25 0d  |owInfo",,block%.|
0000c790  06 69 40 20 20 e7 20 28  62 6c 6f 63 6b 25 21 33  |.i@  . (block%!3|
0000c7a0  32 29 80 32 5e 31 36 20  8c 20 f2 66 61 6b 65 66  |2).2^16 . .fakef|
0000c7b0  69 6c 65 72 77 69 6e 64  6f 77 28 b9 2c a3 29 3a  |ilerwindow(.,.):|
0000c7c0  f4 20 72 65 73 69 7a 65  20 77 69 6e 64 6f 77 0d  |. resize window.|
0000c7d0  06 6a 3e 20 20 f4 20 6f  6e 6c 79 20 72 65 64 72  |.j>  . only redr|
0000c7e0  61 77 20 69 66 20 77 69  6e 64 6f 77 20 69 73 20  |aw if window is |
0000c7f0  63 75 72 72 65 6e 74 6c  79 20 73 75 70 70 6f 73  |currently suppos|
0000c800  65 64 20 74 6f 20 62 65  20 6f 70 65 6e 0d 06 6b  |ed to be open..k|
0000c810  2d c9 20 26 34 30 30 43  33 20 3a 20 e7 20 63 68  |-. &400C3 : . ch|
0000c820  69 6c 64 25 3d 62 6c 6f  63 6b 25 21 34 20 8c 20  |ild%=block%!4 . |
0000c830  f2 74 61 73 6b 65 6e 64  65 64 0d 06 6c 3c f4 20  |.taskended..l<. |
0000c840  69 66 20 63 68 69 6c 64  20 74 61 73 6b 20 68 61  |if child task ha|
0000c850  73 20 66 69 6e 69 73 68  65 64 20 74 68 65 6e 20  |s finished then |
0000c860  61 63 74 69 76 61 74 65  20 50 52 4f 43 74 61 73  |activate PROCtas|
0000c870  6b 65 6e 64 65 64 0d 06  6d 05 cb 0d 06 6e 05 e1  |kended..m....n..|
0000c880  0d 06 6f 05 3a 0d 06 70  0d dd 20 f2 62 6f 75 6e  |..o.:..p.. .boun|
0000c890  63 65 0d 06 71 12 c8 8e  20 62 6c 6f 63 6b 25 21  |ce..q... block%!|
0000c8a0  31 36 20 ca 0d 06 72 4a  20 20 c9 20 33 20 3a 20  |16 ...rJ  . 3 : |
0000c8b0  ff 22 52 65 6d 6f 76 65  20 22 2b a4 73 28 70 72  |."Remove "+.s(pr|
0000c8c0  65 73 65 72 76 65 25 2b  34 34 29 3a f2 72 65 70  |eserve%+44):.rep|
0000c8d0  6f 72 74 28 a4 6d 65 73  73 61 67 65 5f 6c 6f 6f  |ort(.message_loo|
0000c8e0  6b 75 70 28 22 62 6f 75  6e 22 29 2c 31 29 0d 06  |kup("boun"),1)..|
0000c8f0  73 05 cb 0d 06 74 05 e1  0d 06 75 21 dd 20 f2 73  |s....t....u!. .s|
0000c900  61 76 65 64 65 73 6b 74  6f 70 62 6f 6f 74 66 69  |avedesktopbootfi|
0000c910  6c 65 28 66 69 6c 65 25  29 0d 06 76 0d ea 20 73  |le(file%)..v.. s|
0000c920  74 72 69 6e 67 24 0d 06  77 32 20 73 74 72 69 6e  |tring$..w2 strin|
0000c930  67 24 3d 22 52 75 6e 20  22 2b a4 52 65 61 64 53  |g$="Run "+.ReadS|
0000c940  79 73 56 61 72 28 22 49  6e 66 6f 7a 69 70 24 44  |ysVar("Infozip$D|
0000c950  69 72 22 29 2b bd 31 30  0d 06 78 2d 20 c8 99 20  |ir")+.10..x- .. |
0000c960  22 58 4f 53 5f 47 42 50  42 22 2c 32 2c 66 69 6c  |"XOS_GBPB",2,fil|
0000c970  65 25 2c 73 74 72 69 6e  67 24 2c a9 28 73 74 72  |e%,string$,.(str|
0000c980  69 6e 67 24 29 0d 06 79  05 e1 0d 06 7a 05 3a 0d  |ing$)..y....z.:.|
0000c990  06 7b 52 f4 20 2d 2d 2d  2d 66 75 6e 63 74 69 6f  |.{R. ----functio|
0000c9a0  6e 73 20 74 6f 20 6c 61  75 6e 63 68 20 61 6e 20  |ns to launch an |
0000c9b0  65 78 74 65 72 6e 61 6c  20 74 61 73 6b 20 61 6e  |external task an|
0000c9c0  64 20 74 68 65 6e 20 63  6c 65 61 6e 20 75 70 20  |d then clean up |
0000c9d0  61 66 74 65 72 20 69 74  2d 2d 2d 2d 2d 2d 2d 2d  |after it--------|
0000c9e0  2d 0d 06 7c 05 3a 0d 06  7d 16 dd 20 a4 63 68 69  |-..|.:..}.. .chi|
0000c9f0  6c 64 74 61 73 6b 28 63  6d 64 24 29 0d 06 7e 0d  |ldtask(cmd$)..~.|
0000ca00  ea 20 68 61 6e 64 6c 65  25 0d 06 7f 4e f4 20 74  |. handle%...N. t|
0000ca10  68 69 73 20 72 6f 75 74  69 6e 65 20 73 68 6f 75  |his routine shou|
0000ca20  6c 64 20 62 65 20 63 61  6c 6c 65 64 20 6a 75 73  |ld be called jus|
0000ca30  74 20 62 65 66 6f 72 65  20 74 68 65 20 65 6e 64  |t before the end|
0000ca40  20 6f 66 20 61 20 70 72  6f 63 65 64 75 72 65 20  | of a procedure |
0000ca50  73 6f 20 74 68 61 74 0d  06 80 49 f4 20 69 66 20  |so that...I. if |
0000ca60  69 74 20 64 6f 65 73 20  6e 6f 74 20 72 65 74 75  |it does not retu|
0000ca70  72 6e 20 30 20 28 69 2e  65 2e 20 74 61 73 6b 20  |rn 0 (i.e. task |
0000ca80  69 73 20 6e 6f 74 20 79  65 74 20 63 6f 6d 70 6c  |is not yet compl|
0000ca90  65 74 65 29 20 61 6e 79  20 61 63 74 69 6f 6e 73  |ete) any actions|
0000caa0  0d 06 81 4b f4 20 64 65  70 65 6e 64 65 6e 74 20  |...K. dependent |
0000cab0  6f 6e 20 74 68 65 20 72  65 73 75 6c 74 20 6f 66  |on the result of|
0000cac0  20 74 68 65 20 74 61 73  6b 20 63 61 6e 20 62 65  | the task can be|
0000cad0  20 69 6e 76 6f 6b 65 64  20 66 72 6f 6d 20 50 52  | invoked from PR|
0000cae0  4f 43 74 61 73 6b 65 6e  64 65 64 0d 06 82 4a f4  |OCtaskended...J.|
0000caf0  20 77 68 69 63 68 20 77  69 6c 6c 20 62 65 20 63  | which will be c|
0000cb00  61 6c 6c 65 64 20 62 79  20 50 52 4f 43 6d 65 73  |alled by PROCmes|
0000cb10  73 61 67 65 20 61 73 20  73 6f 6f 6e 20 61 73 20  |sage as soon as |
0000cb20  74 68 65 20 74 61 73 6b  20 64 6f 65 73 20 66 69  |the task does fi|
0000cb30  6e 69 73 68 2e 0d 06 83  49 f4 20 49 66 20 69 74  |nish....I. If it|
0000cb40  20 64 6f 65 73 20 72 65  74 75 72 6e 20 30 20 79  | does return 0 y|
0000cb50  6f 75 20 63 61 6e 20 63  61 6c 6c 20 50 52 4f 43  |ou can call PROC|
0000cb60  74 61 73 6b 65 6e 64 65  64 20 65 78 70 6c 69 63  |taskended explic|
0000cb70  69 74 6c 79 20 79 6f 75  72 73 65 6c 66 21 0d 06  |itly yourself!..|
0000cb80  84 25 c8 99 22 57 69 6d  70 5f 53 74 61 72 74 54  |.%.."Wimp_StartT|
0000cb90  61 73 6b 22 2c 63 6d 64  24 20 b8 20 68 61 6e 64  |ask",cmd$ . hand|
0000cba0  6c 65 25 0d 06 85 0f e7  20 68 61 6e 64 6c 65 25  |le%..... handle%|
0000cbb0  20 8c 0d 06 86 1a 20 20  f2 72 65 64 72 61 77 69  | .....  .redrawi|
0000cbc0  63 6f 6e 62 61 72 28 22  59 22 29 3a 0d 06 87 56  |conbar("Y"):...V|
0000cbd0  20 20 70 6f 6c 6c 6d 61  73 6b 25 20 3d 20 70 6f  |  pollmask% = po|
0000cbe0  6c 6c 6d 61 73 6b 25 20  80 20 28 ac 20 25 31 31  |llmask% . (. %11|
0000cbf0  30 30 30 30 29 3a f4 20  64 6f 6e 27 74 20 6d 61  |0000):. don't ma|
0000cc00  73 6b 20 6f 75 74 20 70  6f 69 6e 74 65 72 20 65  |sk out pointer e|
0000cc10  6e 74 65 72 2f 6c 65 61  76 65 20 61 6e 79 6d 6f  |nter/leave anymo|
0000cc20  72 65 0d 06 88 05 cd 0d  06 89 0c 3d 68 61 6e 64  |re.........=hand|
0000cc30  6c 65 25 0d 06 8a 05 3a  0d 06 8b 10 dd 20 f2 74  |le%....:..... .t|
0000cc40  61 73 6b 65 6e 64 65 64  0d 06 8c 08 ea 20 6e 25  |askended..... n%|
0000cc50  0d 06 8d 07 ea 20 85 0d  06 8e 42 ee 20 85 20 ea  |..... ....B. . .|
0000cc60  20 f7 20 85 3a f2 72 65  70 6f 72 74 28 f6 24 2b  | . .:.report(.$+|
0000cc70  22 20 61 74 20 6c 69 6e  65 20 22 2b c3 28 9e 29  |" at line "+.(.)|
0000cc80  2c 31 29 3a f2 72 65 64  72 61 77 69 63 6f 6e 62  |,1):.redrawiconb|
0000cc90  61 72 28 22 4e 22 29 3a  e1 0d 06 8f 42 70 6f 6c  |ar("N"):....Bpol|
0000cca0  6c 6d 61 73 6b 25 20 3d  20 70 6f 6c 6c 6d 61 73  |lmask% = pollmas|
0000ccb0  6b 25 20 84 20 25 31 31  30 30 30 30 3a f4 20 6d  |k% . %110000:. m|
0000ccc0  61 73 6b 20 6f 75 74 20  70 6f 69 6e 74 65 72 20  |ask out pointer |
0000ccd0  65 6e 74 65 72 2f 6c 65  61 76 65 0d 06 90 24 e7  |enter/leave...$.|
0000cce0  20 6c 6f 63 61 6c 5f 68  6f 6e 25 20 8c 20 c8 99  | local_hon% . ..|
0000ccf0  22 48 6f 75 72 67 6c 61  73 73 5f 4f 66 66 22 0d  |"Hourglass_Off".|
0000cd00  06 91 0c 63 68 69 6c 64  25 3d 30 0d 06 92 0e c8  |...child%=0.....|
0000cd10  8e 20 77 61 69 74 24 20  ca 0d 06 93 39 20 20 c9  |. wait$ ....9  .|
0000cd20  20 22 6c 69 73 74 22 3a  69 6e 25 3d 8e 22 49 6e  | "list":in%=."In|
0000cd30  66 6f 53 63 72 61 70 3a  43 41 54 22 3a f2 66 61  |foScrap:CAT":.fa|
0000cd40  6b 65 66 69 6c 65 72 77  69 6e 64 6f 77 28 b9 2c  |kefilerwindow(.,|
0000cd50  b9 29 0d 06 94 0e 20 20  c9 20 22 7a 69 70 22 3a  |.)....  . "zip":|
0000cd60  0d 06 95 18 20 20 20 20  20 e7 20 70 72 65 73 65  |....     . prese|
0000cd70  72 76 65 25 21 30 20 8c  0d 06 96 44 20 20 20 20  |rve%!0 ....D    |
0000cd80  20 f4 20 77 65 20 7a 65  72 6f 20 74 68 69 73 20  | . we zero this |
0000cd90  77 6f 72 64 20 74 6f 20  73 69 67 6e 61 6c 20 74  |word to signal t|
0000cda0  68 61 74 20 77 65 20 73  61 76 65 64 20 64 69 72  |hat we saved dir|
0000cdb0  65 63 74 20 74 6f 20 46  69 6c 65 72 0d 06 97 4e  |ect to Filer...N|
0000cdc0  20 20 20 20 20 f4 20 28  66 69 6c 65 6e 61 6d 65  |     . (filename|
0000cdd0  20 74 79 70 65 64 20 69  6e 74 6f 20 73 61 76 65  | typed into save|
0000cde0  62 6f 78 29 20 61 6e 64  20 64 6f 20 6e 6f 74 20  |box) and do not |
0000cdf0  6e 65 65 64 20 57 49 4d  50 20 6d 65 73 73 61 67  |need WIMP messag|
0000ce00  65 20 64 69 61 6c 6f 67  75 65 0d 06 98 1f 20 20  |e dialogue....  |
0000ce10  20 20 20 20 20 e3 20 6e  25 3d 30 20 b8 20 70 72  |     . n%=0 . pr|
0000ce20  65 73 65 72 76 65 25 21  30 0d 06 99 23 20 20 20  |eserve%!0...#   |
0000ce30  20 20 20 20 20 20 62 6c  6f 63 6b 25 21 6e 25 3d  |      block%!n%=|
0000ce40  70 72 65 73 65 72 76 65  25 21 6e 25 0d 06 9a 0c  |preserve%!n%....|
0000ce50  20 20 20 20 20 20 20 ed  0d 06 9b 20 20 20 20 20  |       ....     |
0000ce60  20 20 20 62 6c 6f 63 6b  25 21 31 32 3d 70 72 65  |   block%!12=pre|
0000ce70  73 65 72 76 65 25 21 38  0d 06 9c 45 20 20 20 20  |serve%!8...E    |
0000ce80  20 20 20 62 6c 6f 63 6b  25 21 31 36 3d 33 3a f4  |   block%!16=3:.|
0000ce90  20 44 61 74 61 4c 6f 61  64 20 2d 20 70 6c 65 61  | DataLoad - plea|
0000cea0  73 65 20 6c 6f 61 64 20  74 68 65 20 7a 69 70 66  |se load the zipf|
0000ceb0  69 6c 65 20 49 20 63 72  65 61 74 65 64 0d 06 9d  |ile I created...|
0000cec0  25 20 20 20 20 20 20 20  24 28 62 6c 6f 63 6b 25  |%       $(block%|
0000ced0  2b 34 34 29 3d 7a 69 70  66 69 6c 65 24 2b bd 28  |+44)=zipfile$+.(|
0000cee0  30 29 0d 06 9e 4c 20 20  20 20 20 20 20 62 6c 6f  |0)...L       blo|
0000cef0  63 6b 25 21 30 3d 28 34  34 2b a9 28 7a 69 70 66  |ck%!0=(44+.(zipf|
0000cf00  69 6c 65 24 29 2b 31 20  2b 33 29 20 80 20 ac 20  |ile$)+1 +3) . . |
0000cf10  33 3a f4 20 77 6f 72 64  2d 61 6c 69 67 6e 20 6c  |3:. word-align l|
0000cf20  65 6e 67 74 68 20 6f 66  20 62 6c 6f 63 6b 0d 06  |ength of block..|
0000cf30  9f 35 20 20 20 20 20 20  20 c8 99 22 57 69 6d 70  |.5       .."Wimp|
0000cf40  5f 53 65 6e 64 4d 65 73  73 61 67 65 22 2c 31 38  |_SendMessage",18|
0000cf50  2c 62 6c 6f 63 6b 25 2c  70 72 65 73 65 72 76 65  |,block%,preserve|
0000cf60  25 21 34 0d 06 a0 44 20  20 20 20 20 20 20 e7 20  |%!4...D       . |
0000cf70  70 72 65 73 65 72 76 65  25 21 33 36 3c 3e 2d 31  |preserve%!36<>-1|
0000cf80  20 8c 20 64 75 6d 25 3d  a4 64 72 61 67 67 65 64  | . dum%=.dragged|
0000cf90  5f 69 6e 28 62 61 72 25  2c 26 44 44 43 2c 7a 69  |_in(bar%,&DDC,zi|
0000cfa0  70 66 69 6c 65 24 29 0d  06 a1 4d 20 20 f4 20 66  |pfile$)...M  . f|
0000cfb0  6f 6f 6c 20 69 74 20 69  6e 74 6f 20 75 70 64 61  |ool it into upda|
0000cfc0  74 69 6e 67 20 63 61 74  61 6c 6f 67 75 65 20 28  |ting catalogue (|
0000cfd0  70 72 65 74 65 6e 64 20  6e 65 77 20 66 69 6c 65  |pretend new file|
0000cfe0  20 64 72 61 67 67 65 64  20 74 6f 20 69 63 6f 6e  | dragged to icon|
0000cff0  62 61 72 29 0d 06 a2 3e  20 20 f4 20 75 6e 6c 65  |bar)...>  . unle|
0000d000  73 73 20 74 68 69 73 20  77 61 73 20 61 20 73 63  |ss this was a sc|
0000d010  72 61 70 20 66 69 6c 65  20 73 61 76 65 64 20 69  |rap file saved i|
0000d020  6e 74 6f 20 61 6e 20 61  70 70 6c 69 63 61 74 69  |nto an applicati|
0000d030  6f 6e 0d 06 a3 0a 20 20  20 20 20 cd 0d 06 a4 4f  |on....     ....O|
0000d040  20 20 20 20 20 e7 20 6f  70 65 6e 66 6c 61 67 25  |     . openflag%|
0000d050  20 80 20 70 72 65 73 65  72 76 65 25 21 33 36 3c  | . preserve%!36<|
0000d060  3e 2d 31 20 8c 20 ff 22  46 69 6c 65 72 5f 4f 70  |>-1 . ."Filer_Op|
0000d070  65 6e 44 69 72 20 22 2b  a4 70 61 74 68 6e 61 6d  |enDir "+.pathnam|
0000d080  65 28 7a 69 70 66 69 6c  65 24 29 0d 06 a5 22 20  |e(zipfile$)..." |
0000d090  20 c9 22 61 64 22 2c 22  64 65 6c 65 74 65 22 3a  | ."ad","delete":|
0000d0a0  e7 20 69 6e 25 20 8c 20  d9 23 69 6e 25 0d 06 a6  |. in% . .#in%...|
0000d0b0  28 20 20 20 20 20 20 20  20 20 20 20 20 20 20 c8  |(              .|
0000d0c0  99 22 48 6f 75 72 67 6c  61 73 73 5f 53 74 61 72  |."Hourglass_Star|
0000d0d0  74 22 2c 35 30 0d 06 a7  2c 20 20 20 20 20 20 20  |t",50...,       |
0000d0e0  20 20 20 20 20 20 20 c8  99 22 48 6f 75 72 67 6c  |       .."Hourgl|
0000d0f0  61 73 73 5f 4c 45 44 73  22 2c 25 30 31 2c 25 31  |ass_LEDs",%01,%1|
0000d100  31 0d 06 a8 04 0d 06 a9  4c 20 20 20 20 20 20 20  |1.......L       |
0000d110  20 20 20 20 20 20 20 6e  25 3d a4 63 68 69 6c 64  |       n%=.child|
0000d120  74 61 73 6b 28 22 75 6e  7a 69 70 20 2d 6c 20 22  |task("unzip -l "|
0000d130  2b 7a 69 70 66 69 6c 65  24 2b 22 20 7b 20 3e 20  |+zipfile$+" { > |
0000d140  49 6e 66 6f 53 63 72 61  70 3a 43 41 54 20 7d 22  |InfoScrap:CAT }"|
0000d150  29 0d 06 aa 3d 20 20 20  20 20 20 20 20 20 20 20  |)...=           |
0000d160  20 20 20 20 69 6e 25 3d  8e 22 49 6e 66 6f 53 63  |    in%=."InfoSc|
0000d170  72 61 70 3a 43 41 54 22  3a f2 66 61 6b 65 66 69  |rap:CAT":.fakefi|
0000d180  6c 65 72 77 69 6e 64 6f  77 28 b9 2c b9 29 0d 06  |lerwindow(.,.)..|
0000d190  ab 24 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.$              |
0000d1a0  20 c8 99 22 48 6f 75 72  67 6c 61 73 73 5f 4f 66  | .."Hourglass_Of|
0000d1b0  66 22 0d 06 ac 5b 20 20  20 20 20 20 20 20 20 20  |f"...[          |
0000d1c0  20 20 20 20 20 e7 20 a4  69 66 74 68 65 72 65 28  |     . .ifthere(|
0000d1d0  22 49 6e 66 6f 53 63 72  61 70 3a 61 64 64 22 29  |"InfoScrap:add")|
0000d1e0  20 8c 20 ff 22 57 69 70  65 20 49 6e 66 6f 53 63  | . ."Wipe InfoSc|
0000d1f0  72 61 70 3a 61 64 64 20  52 20 7e 56 20 7e 43 20  |rap:add R ~V ~C |
0000d200  46 22 3a f4 20 63 6c 65  61 6e 20 75 70 0d 06 ad  |F":. clean up...|
0000d210  27 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |'               |
0000d220  e7 20 a9 28 64 65 6c 65  74 65 5f 6c 61 74 65 72  |. .(delete_later|
0000d230  24 29 20 8c 0d 06 ae 67  20 20 20 20 20 20 20 20  |$) ....g        |
0000d240  20 20 20 20 20 20 20 20  e7 20 a4 69 66 74 68 65  |        . .ifthe|
0000d250  72 65 28 64 65 6c 65 74  65 5f 6c 61 74 65 72 24  |re(delete_later$|
0000d260  29 20 8c 20 ff 22 57 69  70 65 20 22 2b 64 65 6c  |) . ."Wipe "+del|
0000d270  65 74 65 5f 6c 61 74 65  72 24 2b 22 20 52 20 7e  |ete_later$+" R ~|
0000d280  56 20 7e 43 20 46 20 7e  4e 22 3a 64 65 6c 65 74  |V ~C F ~N":delet|
0000d290  65 5f 6c 61 74 65 72 24  3d 22 22 0d 06 af 14 20  |e_later$="".... |
0000d2a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 cd 0d  |              ..|
0000d2b0  06 b0 41 20 f4 20 55 6e  6c 65 73 73 20 77 65 20  |..A . Unless we |
0000d2c0  77 65 72 65 20 63 6f 70  79 69 6e 67 20 69 6e 74  |were copying int|
0000d2d0  6f 20 72 6f 6f 74 20 6f  66 20 7a 69 70 66 69 6c  |o root of zipfil|
0000d2e0  65 2c 20 6f 64 64 73 20  61 72 65 20 74 68 61 74  |e, odds are that|
0000d2f0  0d 06 b1 4a 20 f4 20 74  68 65 20 74 65 6d 70 6f  |...J . the tempo|
0000d300  72 61 72 79 20 66 69 6c  65 20 69 6e 73 69 64 65  |rary file inside|
0000d310  20 21 53 63 72 61 70 20  77 61 73 20 64 65 6c 65  | !Scrap was dele|
0000d320  74 65 64 2c 20 6e 6f 74  20 74 68 65 20 72 65 61  |ted, not the rea|
0000d330  6c 20 6f 72 69 67 69 6e  61 6c 0d 06 b2 04 0d 06  |l original......|
0000d340  b3 34 20 20 c9 20 22 75  6e 7a 69 70 22 3a f2 63  |.4  . "unzip":.c|
0000d350  6c 6f 73 65 28 73 61 76  65 25 29 3a c8 99 22 57  |lose(save%):.."W|
0000d360  69 6d 70 5f 43 72 65 61  74 65 4d 65 6e 75 22 2c  |imp_CreateMenu",|
0000d370  2d 31 0d 06 b4 3c 20 20  20 20 20 20 20 20 20 20  |-1...<          |
0000d380  20 20 20 20 20 6e 25 3d  b9 3a e7 20 73 61 76 65  |     n%=.:. save|
0000d390  64 6c 65 76 65 6c 73 25  3e 30 20 8c 20 6e 25 3d  |dlevels%>0 . n%=|
0000d3a0  a4 6d 6f 76 65 66 72 6f  6d 73 63 72 61 70 0d 06  |.movefromscrap..|
0000d3b0  b5 47 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.G              |
0000d3c0  20 f4 20 77 65 20 64 75  6d 70 65 64 20 69 74 20  | . we dumped it |
0000d3d0  69 6e 20 21 53 63 72 61  70 20 74 6f 20 68 69 64  |in !Scrap to hid|
0000d3e0  65 20 64 69 72 65 63 74  6f 72 79 20 73 74 72 75  |e directory stru|
0000d3f0  63 74 75 72 65 0d 06 b6  3d 20 20 20 20 20 20 20  |cture...=       |
0000d400  20 20 20 20 20 20 20 20  e7 20 c0 6e 6f 74 7a 69  |        . .notzi|
0000d410  70 70 65 64 24 2c 31 35  29 3d 22 3c 57 69 6d 70  |pped$,15)="<Wimp|
0000d420  24 53 63 72 61 70 44 69  72 3e 22 20 80 20 6e 25  |$ScrapDir>" . n%|
0000d430  20 8c 0d 06 b7 2b 20 20  20 20 20 20 20 20 20 20  | ....+          |
0000d440  20 20 20 20 20 f4 20 66  69 6c 65 20 64 6f 75 62  |     . file doub|
0000d450  6c 65 2d 63 6c 69 63 6b  65 64 20 6f 6e 0d 06 b8  |le-clicked on...|
0000d460  3e 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |>               |
0000d470  20 ff 22 52 65 6d 6f 76  65 20 3c 57 69 6d 70 24  | ."Remove <Wimp$|
0000d480  53 63 72 61 70 3e 22 3a  f4 20 64 65 6c 65 74 65  |Scrap>":. delete|
0000d490  20 69 66 20 70 72 65 73  65 6e 74 0d 06 b9 39 20  | if present...9 |
0000d4a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 ff  |               .|
0000d4b0  22 52 65 6e 61 6d 65 20  22 2b 6e 6f 74 7a 69 70  |"Rename "+notzip|
0000d4c0  70 65 64 24 2b 22 20 3c  57 69 6d 70 24 53 63 72  |ped$+" <Wimp$Scr|
0000d4d0  61 70 3e 22 0d 06 ba 61  20 20 20 20 20 20 20 20  |ap>"...a        |
0000d4e0  20 20 20 20 20 20 20 20  e7 20 64 6f 6e 74 62 72  |        . dontbr|
0000d4f0  6f 61 64 63 61 73 74 25  20 8c 20 ff 22 46 69 6c  |oadcast% . ."Fil|
0000d500  65 72 5f 52 75 6e 20 3c  57 69 6d 70 24 53 63 72  |er_Run <Wimp$Scr|
0000d510  61 70 3e 22 20 8b 20 f2  62 72 6f 61 64 63 61 73  |ap>" . .broadcas|
0000d520  74 66 69 6c 65 28 22 3c  57 69 6d 70 24 53 63 72  |tfile("<Wimp$Scr|
0000d530  61 70 3e 22 29 0d 06 bb  5d f4 20 74 68 65 20 70  |ap>")...]. the p|
0000d540  6f 69 6e 74 20 6f 66 20  61 6c 6c 20 74 68 69 73  |oint of all this|
0000d550  20 69 73 20 74 6f 20 61  76 6f 69 64 20 68 61 76  | is to avoid hav|
0000d560  69 6e 67 20 6d 6f 72 65  20 74 68 61 6e 20 6f 6e  |ing more than on|
0000d570  65 20 74 65 6d 70 6f 72  61 72 79 20 66 69 6c 65  |e temporary file|
0000d580  20 68 61 6e 67 69 6e 67  20 61 72 6f 75 6e 64 2e  | hanging around.|
0000d590  2e 2e 0d 06 bc 22 20 20  20 20 20 20 20 20 20 20  |....."          |
0000d5a0  20 20 20 20 64 6f 6e 74  62 72 6f 61 64 63 61 73  |    dontbroadcas|
0000d5b0  74 25 3d b9 0d 06 bd 13  20 20 20 20 20 20 20 20  |t%=.....        |
0000d5c0  20 20 20 20 20 20 cd 0d  06 be 04 0d 06 bf 05 cb  |      ..........|
0000d5d0  0d 06 c0 1c e7 20 77 61  69 74 24 3d 22 22 20 8c  |..... wait$="" .|
0000d5e0  20 77 61 69 74 24 3d 22  7a 69 70 22 0d 06 c1 04  | wait$="zip"....|
0000d5f0  0d 06 c2 3e e7 20 77 61  69 74 24 3d 22 64 65 6c  |...>. wait$="del|
0000d600  65 74 65 22 20 8c 20 77  61 69 74 24 3d 22 64 65  |ete" . wait$="de|
0000d610  6c 65 74 69 6e 67 22 20  8b 20 77 61 69 74 24 2b  |leting" . wait$+|
0000d620  3d c2 77 61 69 74 24 29  2b 22 69 6e 67 22 0d 06  |=.wait$)+"ing"..|
0000d630  c3 5e e7 20 77 61 69 74  24 3c 3e 22 6c 69 73 74  |.^. wait$<>"list|
0000d640  74 69 6e 67 22 20 80 20  77 61 69 74 24 3c 3e 22  |ting" . wait$<>"|
0000d650  74 65 6d 70 70 69 6e 67  22 20 80 20 a7 a4 6f 70  |tempping" . ..op|
0000d660  74 69 6f 6e 73 28 30 29  2c 22 71 22 29 20 8c 20  |tions(0),"q") . |
0000d670  f2 61 6c 65 72 74 62 6f  78 28 22 46 69 6e 69 73  |.alertbox("Finis|
0000d680  68 65 64 20 22 2b 77 61  69 74 24 29 0d 06 c4 15  |hed "+wait$)....|
0000d690  77 61 69 74 24 3d 22 22  3a 6f 70 74 73 24 3d 22  |wait$="":opts$="|
0000d6a0  22 0d 06 c5 36 e7 20 a9  28 73 74 6f 72 65 24 29  |"...6. .(store$)|
0000d6b0  20 ff 22 44 69 72 20 22  2b 73 74 6f 72 65 24 3a  | ."Dir "+store$:|
0000d6c0  73 74 6f 72 65 24 3d 22  22 3a f4 20 72 65 73 74  |store$="":. rest|
0000d6d0  6f 72 65 20 43 53 44 0d  06 c6 2e f2 72 65 64 72  |ore CSD.....redr|
0000d6e0  61 77 69 63 6f 6e 62 61  72 28 22 4e 22 29 3a f4  |awiconbar("N"):.|
0000d6f0  20 72 65 73 74 6f 72 65  20 69 63 6f 6e 62 61 72  | restore iconbar|
0000d700  20 74 65 78 74 0d 06 c7  05 e1 0d 06 c8 05 3a 0d  | text.........:.|
0000d710  06 c9 14 dd 20 a4 6d 6f  76 65 66 72 6f 6d 73 63  |.... .movefromsc|
0000d720  72 61 70 0d 06 ca 0e ea  20 61 24 2c 62 24 2c 6e  |rap..... a$,b$,n|
0000d730  25 0d 06 cb 07 ea 20 85  0d 06 cc 69 ee 20 85 20  |%..... ....i. . |
0000d740  ea 20 f7 20 85 3a 70 61  72 61 6d 31 24 3d a4 70  |. . .:param1$=.p|
0000d750  61 74 68 6e 61 6d 65 28  6e 6f 74 7a 69 70 70 65  |athname(notzippe|
0000d760  64 24 29 3a 70 61 72 61  6d 32 24 3d f6 24 2b 22  |d$):param2$=.$+"|
0000d770  20 61 74 20 22 2b c3 28  9e 29 3a f2 72 65 70 6f  | at "+.(.):.repo|
0000d780  72 74 28 a4 6d 65 73 73  61 67 65 5f 6c 6f 6f 6b  |rt(.message_look|
0000d790  73 75 62 28 22 77 72 69  58 22 29 2c 31 29 3a 3d  |sub("wriX"),1):=|
0000d7a0  a3 0d 06 cd 08 6e 25 3d  b9 0d 06 ce 2b e7 20 73  |.....n%=....+. s|
0000d7b0  61 76 65 64 6c 65 76 65  6c 73 25 3c 31 20 8c 20  |avedlevels%<1 . |
0000d7c0  73 61 76 65 64 6c 65 76  65 6c 73 25 3d 6c 65 76  |savedlevels%=lev|
0000d7d0  65 6c 73 25 0d 06 cf 45  61 24 3d 22 49 6e 66 6f  |els%...Ea$="Info|
0000d7e0  53 63 72 61 70 3a 74 65  6d 70 22 2b c4 73 61 76  |Scrap:temp"+.sav|
0000d7f0  65 64 6c 65 76 65 6c 73  25 2c 22 2e 2a 22 29 2b  |edlevels%,".*")+|
0000d800  22 2e 22 2b a4 6c 65 61  66 6e 61 6d 65 28 6e 6f  |"."+.leafname(no|
0000d810  74 7a 69 70 70 65 64 24  29 0d 06 d0 37 f4 20 6e  |tzipped$)...7. n|
0000d820  61 6d 65 20 6f 66 20 66  69 6c 65 2f 64 69 72 20  |ame of file/dir |
0000d830  77 69 74 68 20 63 6f 72  72 65 63 74 20 6e 75 6d  |with correct num|
0000d840  62 65 72 20 6f 66 20 77  69 6c 64 63 61 72 64 73  |ber of wildcards|
0000d850  0d 06 d1 12 20 62 24 3d  6e 6f 74 7a 69 70 70 65  |.... b$=notzippe|
0000d860  64 24 0d 06 d2 29 f4 20  6e 61 6d 65 20 6f 66 20  |d$...). name of |
0000d870  66 69 6c 65 2f 64 69 72  20 69 6e 20 69 74 73 20  |file/dir in its |
0000d880  64 65 73 74 69 6e 61 74  69 6f 6e 0d 06 d3 22 e7  |destination...".|
0000d890  20 61 6c 6c 25 20 8c 20  61 24 3d a4 70 61 74 68  | all% . a$=.path|
0000d8a0  6e 61 6d 65 28 61 24 29  2b 22 2e 2a 22 0d 06 d4  |name(a$)+".*"...|
0000d8b0  29 e7 20 6f 70 74 69 6f  6e 73 25 28 32 29 20 8c  |). options%(2) .|
0000d8c0  20 61 24 3d 22 49 6e 66  6f 53 63 72 61 70 3a 74  | a$="InfoScrap:t|
0000d8d0  65 6d 70 2e 2a 22 0d 06  d5 3e f4 20 6c 65 76 65  |emp.*"...>. leve|
0000d8e0  6c 25 20 69 73 20 69 72  72 65 6c 65 76 61 6e 74  |l% is irrelevant|
0000d8f0  20 69 66 20 27 49 67 6e  6f 72 65 20 64 69 72 65  | if 'Ignore dire|
0000d900  63 74 6f 72 79 20 73 74  72 75 63 74 75 72 65 27  |ctory structure'|
0000d910  20 73 65 74 0d 06 d6 26  e7 20 c2 61 24 29 3d 22  | set...&. .a$)="|
0000d920  2a 22 20 8c 20 62 24 3d  a4 70 61 74 68 6e 61 6d  |*" . b$=.pathnam|
0000d930  65 28 62 24 29 2b 22 2e  2a 22 0d 06 d7 30 f4 20  |e(b$)+".*"...0. |
0000d940  77 69 6c 64 63 61 72 64  73 20 6f 6e 20 2a 62 6f  |wildcards on *bo|
0000d950  74 68 2a 20 73 69 64 65  73 20 6e 65 65 64 65 64  |th* sides needed|
0000d960  20 66 6f 72 20 2a 43 6f  70 79 0d 06 d8 14 e7 20  | for *Copy..... |
0000d970  a4 69 66 74 68 65 72 65  28 61 24 29 20 8c 0d 06  |.ifthere(a$) ...|
0000d980  d9 1b 20 20 62 24 2b 3d  22 20 52 20 44 20 46 20  |..  b$+=" R D F |
0000d990  7e 56 20 7e 43 20 7e 4e  22 0d 06 da 21 20 20 e7  |~V ~C ~N"...!  .|
0000d9a0  20 6f 70 74 69 6f 6e 73  25 28 35 29 20 8c 20 c2  | options%(5) . .|
0000d9b0  62 24 2c 32 29 3d 22 4e  20 22 0d 06 db 5b 20 20  |b$,2)="N "...[  |
0000d9c0  f4 20 49 66 20 27 45 78  74 72 61 63 74 20 6e 65  |. If 'Extract ne|
0000d9d0  77 65 72 27 20 73 65 74  20 74 68 65 6e 20 66 6f  |wer' set then fo|
0000d9e0  72 63 65 20 46 69 6c 65  72 20 6f 6e 6c 79 20 74  |rce Filer only t|
0000d9f0  6f 20 6f 76 65 72 77 72  69 74 65 20 69 66 20 61  |o overwrite if a|
0000da00  72 63 68 69 76 65 64 20  66 69 6c 65 20 69 73 20  |rchived file is |
0000da10  6e 65 77 65 72 0d 06 dc  19 20 20 ff 20 22 43 6f  |newer....  . "Co|
0000da20  70 79 20 22 2b 61 24 2b  22 20 22 2b 62 24 0d 06  |py "+a$+" "+b$..|
0000da30  dd 26 20 20 ff 22 57 69  70 65 20 49 6e 66 6f 53  |.&  ."Wipe InfoS|
0000da40  63 72 61 70 3a 74 65 6d  70 20 52 20 46 20 7e 56  |crap:temp R F ~V|
0000da50  20 7e 43 22 0d 06 de 49  f4 20 6d 61 6b 65 20 73  | ~C"...I. make s|
0000da60  75 72 65 20 74 68 65 72  65 20 69 73 20 6f 6e 6c  |ure there is onl|
0000da70  79 20 6f 6e 65 20 6f 62  6a 65 63 74 20 69 6e 20  |y one object in |
0000da80  27 74 65 6d 70 27 20 73  6f 20 6b 6c 75 64 67 65  |'temp' so kludge|
0000da90  73 20 61 62 6f 76 65 20  77 6f 72 6b 21 0d 06 df  |s above work!...|
0000daa0  05 cc 0d 06 e0 41 20 20  70 61 72 61 6d 31 24 3d  |.....A  param1$=|
0000dab0  61 24 3a 70 61 72 61 6d  32 24 3d 22 22 3a f2 72  |a$:param2$="":.r|
0000dac0  65 70 6f 72 74 28 a4 6d  65 73 73 61 67 65 5f 6c  |eport(.message_l|
0000dad0  6f 6f 6b 73 75 62 28 22  6d 6f 76 58 22 29 2c 25  |ooksub("movX"),%|
0000dae0  31 31 29 0d 06 e1 3d 20  20 6e 25 3d 28 65 72 72  |11)...=  n%=(err|
0000daf0  63 6c 69 63 6b 25 3d 31  29 3a e7 20 6e 25 20 8c  |click%=1):. n% .|
0000db00  20 ff 22 46 69 6c 65 72  5f 4f 70 65 6e 44 69 72  | ."Filer_OpenDir|
0000db10  20 49 6e 66 6f 53 63 72  61 70 3a 74 65 6d 70 22  | InfoScrap:temp"|
0000db20  0d 06 e2 05 cd 0d 06 e3  13 73 61 76 65 64 6c 65  |.........savedle|
0000db30  76 65 6c 73 25 3d 2d 31  0d 06 e4 07 3d 6e 25 0d  |vels%=-1....=n%.|
0000db40  06 e5 05 3a 0d 06 e6 52  f4 20 2d 2d 2d 2d 2d 2d  |...:...R. ------|
0000db50  2d 66 75 6e 63 74 69 6f  6e 73 20 74 6f 20 72 65  |-functions to re|
0000db60  64 72 61 77 20 74 68 65  20 77 69 6e 64 6f 77 20  |draw the window |
0000db70  66 6f 72 20 74 68 65 20  6c 65 76 65 6c 20 61 62  |for the level ab|
0000db80  6f 76 65 2f 62 65 6c 6f  77 2d 2d 2d 2d 2d 2d 2d  |ove/below-------|
0000db90  2d 2d 2d 2d 2d 2d 0d 06  e7 05 3a 0d 06 e8 12 dd  |------....:.....|
0000dba0  20 a4 75 70 6c 65 76 65  6c 28 78 25 29 0d 06 e9  | .uplevel(x%)...|
0000dbb0  0e ea 20 6d 25 2c 6b 65  65 70 25 0d 06 ea 26 e7  |.. m%,keep%...&.|
0000dbc0  20 78 25 3d 30 20 8c 3a  3d 30 3a f4 20 61 6c 72  | x%=0 .:=0:. alr|
0000dbd0  65 61 64 79 20 61 74 20  74 6f 70 20 6c 65 76 65  |eady at top leve|
0000dbe0  6c 0d 06 eb 0c 6b 65 65  70 25 3d 78 25 0d 06 ec  |l....keep%=x%...|
0000dbf0  0b c8 95 20 78 25 3e 31  0d 06 ed 21 20 20 20 20  |... x%>1...!    |
0000dc00  6d 25 3d a7 63 6f 6d 6d  6f 6e 70 61 74 68 24 2c  |m%=.commonpath$,|
0000dc10  22 2f 22 2c 6d 25 2b 31  29 0d 06 ee 0d 20 20 20  |"/",m%+1)....   |
0000dc20  20 78 25 2d 3d 31 0d 06  ef 05 ce 0d 06 f0 3d e7  | x%-=1........=.|
0000dc30  20 6d 25 3d 30 20 63 6f  6d 6d 6f 6e 70 61 74 68  | m%=0 commonpath|
0000dc40  24 3d 22 2a 22 20 8b 20  63 6f 6d 6d 6f 6e 70 61  |$="*" . commonpa|
0000dc50  74 68 24 3d c0 63 6f 6d  6d 6f 6e 70 61 74 68 24  |th$=.commonpath$|
0000dc60  2c 6d 25 29 2b 22 2a 22  0d 06 f1 19 f2 66 61 6b  |,m%)+"*".....fak|
0000dc70  65 66 69 6c 65 72 77 69  6e 64 6f 77 28 a3 2c b9  |efilerwindow(.,.|
0000dc80  29 0d 06 f2 14 f2 74 6f  67 67 6c 65 73 65 6c 65  |).....togglesele|
0000dc90  63 74 28 a3 29 0d 06 f3  0c 3d 6b 65 65 70 25 2d  |ct(.)....=keep%-|
0000dca0  31 0d 06 f4 05 3a 0d 06  f5 1a dd 20 f2 6e 65 78  |1....:..... .nex|
0000dcb0  74 6c 65 76 65 6c 28 63  6c 69 63 6b 65 64 25 29  |tlevel(clicked%)|
0000dcc0  0d 06 f6 3e 63 6f 6d 6d  6f 6e 70 61 74 68 24 3d  |...>commonpath$=|
0000dcd0  c0 63 6f 6d 6d 6f 6e 70  61 74 68 24 29 2b a4 67  |.commonpath$)+.g|
0000dce0  65 74 66 61 6b 65 6c 65  61 66 6e 61 6d 65 28 63  |etfakeleafname(c|
0000dcf0  6c 69 63 6b 65 64 25 2c  a3 29 2b 22 2a 22 0d 06  |licked%,.)+"*"..|
0000dd00  f7 0e 6c 65 76 65 6c 73  25 2b 3d 31 0d 06 f8 19  |..levels%+=1....|
0000dd10  f2 66 61 6b 65 66 69 6c  65 72 77 69 6e 64 6f 77  |.fakefilerwindow|
0000dd20  28 a3 2c b9 29 0d 06 f9  14 f2 74 6f 67 67 6c 65  |(.,.).....toggle|
0000dd30  73 65 6c 65 63 74 28 a3  29 0d 06 fa 05 e1 0d 06  |select(.).......|
0000dd40  fb 05 3a 0d 06 fc 52 f4  20 2d 2d 2d 2d 2d 72 65  |..:...R. -----re|
0000dd50  61 64 2f 73 61 76 65 20  6f 70 74 69 6f 6e 73 20  |ad/save options |
0000dd60  74 6f 20 43 6f 6e 66 69  67 20 66 69 6c 65 2d 2d  |to Config file--|
0000dd70  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000dd90  2d 2d 2d 2d 2d 0d 06 fd  05 3a 0d 06 fe 19 dd 20  |-----....:..... |
0000dda0  a4 63 6f 6e 66 69 67 6c  6f 61 64 66 69 6c 65 6e  |.configloadfilen|
0000ddb0  61 6d 65 0d 06 ff 08 ea  20 6e 24 0d 07 00 22 6e  |ame..... n$..."n|
0000ddc0  24 3d a4 52 65 61 64 53  79 73 56 61 72 28 22 43  |$=.ReadSysVar("C|
0000ddd0  68 6f 69 63 65 73 24 50  61 74 68 22 29 0d 07 01  |hoices$Path")...|
0000dde0  3c e7 20 6e 24 3d 22 22  20 8c 20 6e 24 3d 22 3c  |<. n$="" . n$="<|
0000ddf0  22 2b 70 24 2b 22 24 44  69 72 3e 2e 52 65 73 6f  |"+p$+"$Dir>.Reso|
0000de00  75 72 63 65 73 22 20 8b  20 6e 24 3d 22 43 68 6f  |urces" . n$="Cho|
0000de10  69 63 65 73 3a 22 2b 70  24 0d 07 02 11 3d 6e 24  |ices:"+p$....=n$|
0000de20  2b 22 2e 43 6f 6e 66 69  67 22 0d 07 03 05 3a 0d  |+".Config"....:.|
0000de30  07 04 19 dd 20 a4 63 6f  6e 66 69 67 73 61 76 65  |.... .configsave|
0000de40  66 69 6c 65 6e 61 6d 65  0d 07 05 08 ea 20 6e 24  |filename..... n$|
0000de50  0d 07 06 23 6e 24 3d a4  52 65 61 64 53 79 73 56  |...#n$=.ReadSysV|
0000de60  61 72 28 22 43 68 6f 69  63 65 73 24 57 72 69 74  |ar("Choices$Writ|
0000de70  65 22 29 0d 07 07 36 e7  20 6e 24 3d 22 22 20 8c  |e")...6. n$="" .|
0000de80  20 6e 24 3d 22 3c 22 2b  70 24 2b 22 24 44 69 72  | n$="<"+p$+"$Dir|
0000de90  3e 2e 52 65 73 6f 75 72  63 65 73 22 20 8b 20 6e  |>.Resources" . n|
0000dea0  24 2b 3d 22 2e 22 2b 70  24 0d 07 08 11 3d 6e 24  |$+="."+p$....=n$|
0000deb0  2b 22 2e 43 6f 6e 66 69  67 22 0d 07 09 05 3a 0d  |+".Config"....:.|
0000dec0  07 0a 11 dd 20 f2 6c 6f  61 64 63 6f 6e 66 69 67  |.... .loadconfig|
0000ded0  0d 07 0b 20 ea 20 41 25  2c 6e 25 2c 76 65 72 25  |... . A%,n%,ver%|
0000dee0  2c 64 75 6d 6d 79 25 2c  6f 6c 64 64 69 73 70 24  |,dummy%,olddisp$|
0000def0  0d 07 0c 07 ea 20 85 0d  07 0d 33 ee 20 85 20 ea  |..... ....3. . .|
0000df00  20 f7 20 85 3a f2 72 65  70 6f 72 74 28 f6 24 2b  | . .:.report(.$+|
0000df10  22 20 61 74 20 6c 69 6e  65 20 22 2b c3 28 9e 29  |" at line "+.(.)|
0000df20  2c 31 29 3a d9 23 41 25  3a e1 0d 07 0e 1c 41 25  |,1):.#A%:.....A%|
0000df30  3d 8e 20 a4 63 6f 6e 66  69 67 6c 6f 61 64 66 69  |=. .configloadfi|
0000df40  6c 65 6e 61 6d 65 0d 07  0f 0d e8 23 41 25 2c 76  |lename.....#A%,v|
0000df50  65 72 25 0d 07 10 42 e7  20 76 65 72 25 3c 32 34  |er%...B. ver%<24|
0000df60  31 20 8c 20 cf 23 41 25  3d 30 3a f4 20 6f 6c 64  |1 . .#A%=0:. old|
0000df70  20 76 65 72 73 69 6f 6e  73 20 64 6f 6e 27 74 20  | versions don't |
0000df80  68 61 76 65 20 61 20 76  65 72 73 69 6f 6e 20 6e  |have a version n|
0000df90  75 6d 62 65 72 0d 07 11  1a e3 20 6e 25 3d 31 20  |umber..... n%=1 |
0000dfa0  b8 20 35 3a f4 20 6f 70  74 73 6d 65 6e 75 25 0d  |. 5:. optsmenu%.|
0000dfb0  07 12 17 20 20 e8 23 41  25 2c 6f 70 74 69 6f 6e  |...  .#A%,option|
0000dfc0  73 25 28 6e 25 29 0d 07  13 05 ed 0d 07 14 2a e7  |s%(n%)........*.|
0000dfd0  20 76 65 72 25 3c 32 34  33 20 8c 20 6f 70 74 69  | ver%<243 . opti|
0000dfe0  6f 6e 73 25 28 35 29 3d  31 2d 6f 70 74 69 6f 6e  |ons%(5)=1-option|
0000dff0  73 25 28 35 29 0d 07 15  32 f4 20 4e 65 77 20 6f  |s%(5)...2. New o|
0000e000  70 74 69 6f 6e 20 35 20  69 73 20 6d 6f 72 65 20  |ption 5 is more |
0000e010  6f 72 20 6c 65 73 73 20  6f 70 70 6f 73 69 74 65  |or less opposite|
0000e020  20 6f 66 20 6f 6c 64 0d  07 16 1c e7 20 76 65 72  | of old..... ver|
0000e030  25 3c 32 34 31 20 8c 20  e8 23 41 25 2c 64 75 6d  |%<241 . .#A%,dum|
0000e040  6d 79 25 0d 07 17 21 e7  20 76 65 72 25 3e 32 34  |my%...!. ver%>24|
0000e050  33 20 8c 20 e8 23 41 25  2c 6f 70 74 69 6f 6e 73  |3 . .#A%,options|
0000e060  25 28 36 29 0d 07 18 2f  f4 20 6f 6c 64 20 61 6e  |%(6).../. old an|
0000e070  64 20 6c 61 74 65 73 74  20 76 65 72 73 69 6f 6e  |d latest version|
0000e080  73 20 68 61 76 65 20 65  78 74 72 61 20 6f 70 74  |s have extra opt|
0000e090  69 6f 6e 0d 07 19 45 e7  20 76 65 72 25 3c 32 36  |ion...E. ver%<26|
0000e0a0  30 20 8c 20 e8 23 41 25  2c 6f 6c 64 64 69 73 70  |0 . .#A%,olddisp|
0000e0b0  24 3a 64 69 73 70 74 69  6d 65 25 3d bb 28 6f 6c  |$:disptime%=.(ol|
0000e0c0  64 64 69 73 70 24 29 20  8b 20 e8 23 41 25 2c 64  |ddisp$) . .#A%,d|
0000e0d0  69 73 70 74 69 6d 65 25  0d 07 1a 30 f4 20 70 72  |isptime%...0. pr|
0000e0e0  65 76 69 6f 75 73 6c 79  20 64 69 73 70 74 69 6d  |eviously disptim|
0000e0f0  65 20 77 61 73 20 73 74  6f 72 65 64 20 61 73 20  |e was stored as |
0000e100  61 20 73 74 72 69 6e 67  0d 07 1b 12 e8 23 41 25  |a string.....#A%|
0000e110  2c 62 65 65 70 66 6c 61  67 25 0d 07 1c 12 e8 23  |,beepflag%.....#|
0000e120  41 25 2c 6f 70 65 6e 66  6c 61 67 25 0d 07 1d 12  |A%,openflag%....|
0000e130  e8 23 41 25 2c 75 6e 69  78 66 6c 61 67 25 0d 07  |.#A%,unixflag%..|
0000e140  1e 2d e7 20 76 65 72 25  3e 33 30 30 20 8c 20 e8  |.-. ver%>300 . .|
0000e150  23 41 25 2c 73 68 6f 77  70 61 6e 65 25 20 8b 20  |#A%,showpane% . |
0000e160  73 68 6f 77 70 61 6e 65  25 3d 31 0d 07 1f 25 f4  |showpane%=1...%.|
0000e170  20 61 6c 6c 6f 77 20 70  61 6e 65 20 74 6f 20 62  | allow pane to b|
0000e180  65 20 63 6f 6e 66 69 67  75 72 65 64 20 6f 66 66  |e configured off|
0000e190  0d 07 20 08 d9 23 41 25  0d 07 21 05 e1 0d 07 22  |.. ..#A%..!...."|
0000e1a0  05 3a 0d 07 23 14 dd 20  f2 73 65 74 75 70 6f 70  |.:..#.. .setupop|
0000e1b0  74 73 6d 65 6e 75 0d 07  24 08 ea 20 6e 25 0d 07  |tsmenu..$.. n%..|
0000e1c0  25 1a e3 20 6e 25 3d 31  20 b8 20 36 3a f4 20 6f  |%.. n%=1 . 6:. o|
0000e1d0  70 74 73 6d 65 6e 75 25  0d 07 26 26 20 20 f2 74  |ptsmenu%..&&  .t|
0000e1e0  69 63 6b 28 6f 70 74 73  6d 65 6e 75 25 2c 6e 25  |ick(optsmenu%,n%|
0000e1f0  2c 6f 70 74 69 6f 6e 73  25 28 6e 25 29 29 0d 07  |,options%(n%))..|
0000e200  27 05 ed 0d 07 28 05 e1  0d 07 29 05 3a 0d 07 2a  |'....(....).:..*|
0000e210  12 dd 20 f2 73 65 74 75  70 63 6f 6e 66 69 67 0d  |.. .setupconfig.|
0000e220  07 2b 08 ea 20 6e 25 0d  07 2c 0e e3 20 6e 25 3d  |.+.. n%..,.. n%=|
0000e230  31 20 b8 20 36 0d 07 2d  3e 20 20 f2 49 63 6f 6e  |1 . 6..->  .Icon|
0000e240  53 74 61 74 65 28 63 6f  6e 66 69 67 75 72 65 25  |State(configure%|
0000e250  2c 69 63 5f 6f 70 74 69  63 6f 6e 73 25 2b 6e 25  |,ic_opticons%+n%|
0000e260  2d 31 2c 32 31 2c 6f 70  74 69 6f 6e 73 25 28 6e  |-1,21,options%(n|
0000e270  25 29 29 0d 07 2e 05 ed  0d 07 2f 36 f2 73 65 74  |%))......./6.set|
0000e280  69 63 6f 6e 74 65 78 74  28 63 6f 6e 66 69 67 75  |icontext(configu|
0000e290  72 65 25 2c 69 63 5f 74  69 6d 65 64 69 73 70 25  |re%,ic_timedisp%|
0000e2a0  2c c3 28 64 69 73 70 74  69 6d 65 25 29 29 0d 07  |,.(disptime%))..|
0000e2b0  30 30 f2 49 63 6f 6e 53  74 61 74 65 28 63 6f 6e  |00.IconState(con|
0000e2c0  66 69 67 75 72 65 25 2c  69 63 5f 62 65 65 70 25  |figure%,ic_beep%|
0000e2d0  2c 32 31 2c 62 65 65 70  66 6c 61 67 25 29 0d 07  |,21,beepflag%)..|
0000e2e0  31 30 f2 49 63 6f 6e 53  74 61 74 65 28 63 6f 6e  |10.IconState(con|
0000e2f0  66 69 67 75 72 65 25 2c  69 63 5f 6f 70 65 6e 25  |figure%,ic_open%|
0000e300  2c 32 31 2c 6f 70 65 6e  66 6c 61 67 25 29 0d 07  |,21,openflag%)..|
0000e310  32 30 f2 49 63 6f 6e 53  74 61 74 65 28 63 6f 6e  |20.IconState(con|
0000e320  66 69 67 75 72 65 25 2c  69 63 5f 75 6e 69 78 25  |figure%,ic_unix%|
0000e330  2c 32 31 2c 75 6e 69 78  66 6c 61 67 25 29 0d 07  |,21,unixflag%)..|
0000e340  33 30 f2 49 63 6f 6e 53  74 61 74 65 28 63 6f 6e  |30.IconState(con|
0000e350  66 69 67 75 72 65 25 2c  69 63 5f 73 68 6f 77 25  |figure%,ic_show%|
0000e360  2c 32 31 2c 73 68 6f 77  70 61 6e 65 25 29 0d 07  |,21,showpane%)..|
0000e370  34 05 e1 0d 07 35 05 3a  0d 07 36 11 dd 20 f2 72  |4....5.:..6.. .r|
0000e380  65 61 64 63 6f 6e 66 69  67 0d 07 37 08 ea 20 6e  |eadconfig..7.. n|
0000e390  25 0d 07 38 1a e3 20 6e  25 3d 31 20 b8 20 36 3a  |%..8.. n%=1 . 6:|
0000e3a0  f4 20 6f 70 74 73 6d 65  6e 75 25 0d 07 39 3e 20  |. optsmenu%..9> |
0000e3b0  20 6f 70 74 69 6f 6e 73  25 28 6e 25 29 3d a4 69  | options%(n%)=.i|
0000e3c0  63 6f 6e 73 65 6c 65 63  74 65 64 28 63 6f 6e 66  |conselected(conf|
0000e3d0  69 67 75 72 65 25 2c 69  63 5f 6f 70 74 69 63 6f  |igure%,ic_optico|
0000e3e0  6e 73 25 2b 6e 25 2d 31  29 0d 07 3a 05 ed 0d 07  |ns%+n%-1)..:....|
0000e3f0  3b 36 64 69 73 70 74 69  6d 65 25 3d bb 28 a4 67  |;6disptime%=.(.g|
0000e400  65 74 69 63 6f 6e 74 65  78 74 28 63 6f 6e 66 69  |eticontext(confi|
0000e410  67 75 72 65 25 2c 69 63  5f 74 69 6d 65 64 69 73  |gure%,ic_timedis|
0000e420  70 25 29 29 0d 07 3c 30  62 65 65 70 66 6c 61 67  |p%))..<0beepflag|
0000e430  25 3d a4 69 63 6f 6e 73  65 6c 65 63 74 65 64 28  |%=.iconselected(|
0000e440  63 6f 6e 66 69 67 75 72  65 25 2c 69 63 5f 62 65  |configure%,ic_be|
0000e450  65 70 25 29 0d 07 3d 30  6f 70 65 6e 66 6c 61 67  |ep%)..=0openflag|
0000e460  25 3d a4 69 63 6f 6e 73  65 6c 65 63 74 65 64 28  |%=.iconselected(|
0000e470  63 6f 6e 66 69 67 75 72  65 25 2c 69 63 5f 6f 70  |configure%,ic_op|
0000e480  65 6e 25 29 0d 07 3e 30  75 6e 69 78 66 6c 61 67  |en%)..>0unixflag|
0000e490  25 3d a4 69 63 6f 6e 73  65 6c 65 63 74 65 64 28  |%=.iconselected(|
0000e4a0  63 6f 6e 66 69 67 75 72  65 25 2c 69 63 5f 75 6e  |configure%,ic_un|
0000e4b0  69 78 25 29 0d 07 3f 10  6e 25 3d 73 68 6f 77 70  |ix%)..?.n%=showp|
0000e4c0  61 6e 65 25 0d 07 40 30  73 68 6f 77 70 61 6e 65  |ane%..@0showpane|
0000e4d0  25 3d a4 69 63 6f 6e 73  65 6c 65 63 74 65 64 28  |%=.iconselected(|
0000e4e0  63 6f 6e 66 69 67 75 72  65 25 2c 69 63 5f 73 68  |configure%,ic_sh|
0000e4f0  6f 77 25 29 0d 07 41 16  e7 20 73 68 6f 77 70 61  |ow%)..A.. showpa|
0000e500  6e 65 25 3d 6e 25 20 8c  20 e1 0d 07 42 04 0d 07  |ne%=n% . ...B...|
0000e510  43 15 21 62 6c 6f 63 6b  25 3d 70 61 6e 65 70 61  |C.!block%=panepa|
0000e520  74 68 25 0d 07 44 23 c8  99 22 57 69 6d 70 5f 47  |th%..D#.."Wimp_G|
0000e530  65 74 57 69 6e 64 6f 77  53 74 61 74 65 22 2c 2c  |etWindowState",,|
0000e540  62 6c 6f 63 6b 25 0d 07  45 41 e7 20 28 62 6c 6f  |block%..EA. (blo|
0000e550  63 6b 25 21 33 32 20 80  20 28 31 3c 3c 31 36 29  |ck%!32 . (1<<16)|
0000e560  29 20 3e 30 20 20 80 20  73 68 6f 77 70 61 6e 65  |) >0  . showpane|
0000e570  25 3d 30 20 8c 20 f2 63  6c 6f 73 65 28 70 61 6e  |%=0 . .close(pan|
0000e580  65 70 61 74 68 25 29 0d  07 46 1f f4 20 72 65 6d  |epath%)..F.. rem|
0000e590  6f 76 65 20 70 61 6e 65  20 69 66 20 69 74 20 69  |ove pane if it i|
0000e5a0  73 20 6f 70 65 6e 0d 07  47 04 0d 07 48 2b f2 66  |s open..G...H+.f|
0000e5b0  61 6b 65 66 69 6c 65 72  77 69 6e 64 6f 77 28 a3  |akefilerwindow(.|
0000e5c0  2c b9 29 3a f4 20 72 65  64 72 61 77 20 26 20 72  |,.):. redraw & r|
0000e5d0  65 73 69 7a 65 0d 07 49  05 e1 0d 07 4a 05 3a 0d  |esize..I....J.:.|
0000e5e0  07 4b 12 dd 20 f2 73 61  76 65 6f 70 74 69 6f 6e  |.K.. .saveoption|
0000e5f0  73 0d 07 4c 0b ea 20 41  25 2c 6e 25 0d 07 4d 07  |s..L.. A%,n%..M.|
0000e600  ea 20 85 0d 07 4e 33 ee  20 85 20 ea 20 f7 20 85  |. ...N3. . . . .|
0000e610  3a f2 72 65 70 6f 72 74  28 f6 24 2b 22 20 61 74  |:.report(.$+" at|
0000e620  20 6c 69 6e 65 20 22 2b  c3 28 9e 29 2c 31 29 3a  | line "+.(.),1):|
0000e630  d9 23 41 25 3a e1 0d 07  4f 30 c8 99 22 58 4f 53  |.#A%:...O0.."XOS|
0000e640  5f 43 4c 49 22 2c 22 43  44 69 72 20 3c 43 68 6f  |_CLI","CDir <Cho|
0000e650  69 63 65 73 24 57 72 69  74 65 3e 2e 22 2b 70 24  |ices$Write>."+p$|
0000e660  20 b8 20 3b 6e 25 0d 07  50 3b f4 20 43 44 69 72  | . ;n%..P;. CDir|
0000e670  20 63 72 65 61 74 65 73  20 61 20 64 69 72 65 63  | creates a direc|
0000e680  74 6f 72 79 20 69 66 20  69 74 20 64 6f 65 73 20  |tory if it does |
0000e690  6e 6f 74 20 61 6c 72 65  61 64 79 20 65 78 69 73  |not already exis|
0000e6a0  74 0d 07 51 04 0d 07 52  1c 41 25 3d ae 20 a4 63  |t..Q...R.A%=. .c|
0000e6b0  6f 6e 66 69 67 73 61 76  65 66 69 6c 65 6e 61 6d  |onfigsavefilenam|
0000e6c0  65 0d 07 53 1d f1 23 41  25 2c 33 30 31 3a f4 20  |e..S..#A%,301:. |
0000e6d0  76 65 72 73 69 6f 6e 20  6e 75 6d 62 65 72 0d 07  |version number..|
0000e6e0  54 31 f4 20 75 70 64 61  74 65 20 74 68 69 73 20  |T1. update this |
0000e6f0  69 66 20 77 65 20 63 68  61 6e 67 65 20 43 6f 6e  |if we change Con|
0000e700  66 69 67 20 66 69 6c 65  20 66 6f 72 6d 61 74 0d  |fig file format.|
0000e710  07 55 22 e3 20 6e 25 3d  31 20 b8 20 36 3a f4 20  |.U". n%=1 . 6:. |
0000e720  73 69 7a 65 20 6f 66 20  6f 70 74 73 6d 65 6e 75  |size of optsmenu|
0000e730  25 0d 07 56 17 20 20 f1  23 41 25 2c 6f 70 74 69  |%..V.  .#A%,opti|
0000e740  6f 6e 73 25 28 6e 25 29  0d 07 57 05 ed 0d 07 58  |ons%(n%)..W....X|
0000e750  12 f1 23 41 25 2c 64 69  73 70 74 69 6d 65 25 0d  |..#A%,disptime%.|
0000e760  07 59 12 f1 23 41 25 2c  62 65 65 70 66 6c 61 67  |.Y..#A%,beepflag|
0000e770  25 0d 07 5a 12 f1 23 41  25 2c 6f 70 65 6e 66 6c  |%..Z..#A%,openfl|
0000e780  61 67 25 0d 07 5b 12 f1  23 41 25 2c 75 6e 69 78  |ag%..[..#A%,unix|
0000e790  66 6c 61 67 25 0d 07 5c  12 f1 23 41 25 2c 73 68  |flag%..\..#A%,sh|
0000e7a0  6f 77 70 61 6e 65 25 0d  07 5d 08 d9 23 41 25 0d  |owpane%..]..#A%.|
0000e7b0  07 5e 05 e1 0d 07 5f 05  3a 0d 07 60 51 f4 20 2d  |.^...._.:..`Q. -|
0000e7c0  2d 74 68 65 20 66 75 6e  63 74 69 6f 6e 73 20 77  |-the functions w|
0000e7d0  68 69 63 68 20 63 6f 6e  76 65 72 74 20 74 68 65  |hich convert the|
0000e7e0  20 63 61 74 61 6c 6f 67  75 65 20 66 69 6c 65 20  | catalogue file |
0000e7f0  69 6e 74 6f 20 61 20 67  72 61 70 68 69 63 61 6c  |into a graphical|
0000e800  20 64 69 73 70 6c 61 79  2d 2d 0d 07 61 24 dd 20  | display--..a$. |
0000e810  f2 66 61 6b 65 66 69 6c  65 72 77 69 6e 64 6f 77  |.fakefilerwindow|
0000e820  28 65 72 72 25 2c 72 65  6f 70 65 6e 25 29 0d 07  |(err%,reopen%)..|
0000e830  62 11 ea 20 48 25 2c 42  25 2c 47 25 2c 46 25 0d  |b.. H%,B%,G%,F%.|
0000e840  07 63 2e ea 20 61 24 2c  78 25 2c 79 25 2c 6e 61  |.c.. a$,x%,y%,na|
0000e850  6d 65 5f 70 74 72 25 2c  69 6e 64 65 78 5f 70 74  |me_ptr%,index_pt|
0000e860  72 25 2c 6d 61 78 6c 65  6e 70 74 72 25 0d 07 64  |r%,maxlenptr%..d|
0000e870  1f ea 20 63 6f 64 65 5f  70 74 72 25 2c 6d 61 78  |.. code_ptr%,max|
0000e880  5f 69 63 6f 6e 5f 77 69  64 74 68 25 0d 07 65 07  |_icon_width%..e.|
0000e890  ea 20 85 0d 07 66 1d ee  20 85 20 ea 20 f7 20 85  |. ...f.. . . . .|
0000e8a0  3a e7 20 a4 66 66 65 72  72 6f 72 28 9f 29 3a e1  |:. .fferror(.):.|
0000e8b0  0d 07 67 11 f2 63 6c 6f  73 65 28 73 61 76 65 25  |..g..close(save%|
0000e8c0  29 0d 07 68 22 e7 20 72  65 6f 70 65 6e 25 20 8c  |)..h". reopen% .|
0000e8d0  20 f2 63 6c 6f 73 65 28  66 61 6b 65 66 69 6c 65  | .close(fakefile|
0000e8e0  72 25 29 0d 07 69 0a 61  6c 6c 25 3d a3 0d 07 6a  |r%)..i.all%=...j|
0000e8f0  25 6d 65 6e 75 69 63 6f  6e 25 3d 2d 31 3a f4 20  |%menuicon%=-1:. |
0000e900  6e 6f 20 66 69 6c 65 20  27 73 65 6c 65 63 74 65  |no file 'selecte|
0000e910  64 27 0d 07 6b 04 0d 07  6c 3c e7 20 73 68 6f 77  |d'..k...l<. show|
0000e920  70 61 6e 65 25 20 8c 20  f2 49 63 6f 6e 53 74 61  |pane% . .IconSta|
0000e930  74 65 28 70 61 6e 65 70  61 74 68 25 2c 30 2c 32  |te(panepath%,0,2|
0000e940  32 2c 63 6f 6d 6d 6f 6e  70 61 74 68 24 3d 22 2a  |2,commonpath$="*|
0000e950  22 29 0d 07 6d 04 0d 07  6e 36 c8 99 22 58 4f 53  |")..m...n6.."XOS|
0000e960  5f 46 69 6c 65 22 2c 31  37 2c 7a 69 70 66 69 6c  |_File",17,zipfil|
0000e970  65 24 20 b8 20 2c 2c 2c  2c 46 25 3b 78 25 3a f4  |e$ . ,,,,F%;x%:.|
0000e980  20 66 69 6c 65 20 6c 65  6e 67 74 68 0d 07 6f 10  | file length..o.|
0000e990  e7 20 78 25 20 80 20 31  20 8c 20 e1 0d 07 70 3f  |. x% . 1 . ...p?|
0000e9a0  f4 20 66 69 6c 65 20 6e  6f 74 20 66 6f 75 6e 64  |. file not found|
0000e9b0  20 2d 20 70 72 6f 62 61  62 6c 79 20 6d 6f 64 65  | - probably mode|
0000e9c0  20 63 68 61 6e 67 65 20  77 68 65 6e 20 6e 6f 20  | change when no |
0000e9d0  66 69 6c 65 20 6c 6f 61  64 65 64 0d 07 71 25 f2  |file loaded..q%.|
0000e9e0  63 68 61 6e 67 65 74 69  74 6c 65 28 66 61 6b 65  |changetitle(fake|
0000e9f0  66 69 6c 65 72 25 2c 7a  69 70 66 69 6c 65 24 29  |filer%,zipfile$)|
0000ea00  0d 07 72 04 0d 07 73 3f  e7 20 46 25 3d 32 32 20  |..r...s?. F%=22 |
0000ea10  8c 20 f2 64 72 61 77 77  69 6e 64 6f 77 28 30 2c  |. .drawwindow(0,|
0000ea20  30 2c 34 30 30 2c 72 65  6f 70 65 6e 25 29 3a e1  |0,400,reopen%):.|
0000ea30  3a f4 20 61 6e 20 65 6d  70 74 79 20 7a 69 70 66  |:. an empty zipf|
0000ea40  69 6c 65 0d 07 74 04 0d  07 75 1a c8 99 22 48 6f  |ile..t...u..."Ho|
0000ea50  75 72 67 6c 61 73 73 5f  53 74 61 72 74 22 2c 35  |urglass_Start",5|
0000ea60  30 0d 07 76 1e c8 99 22  48 6f 75 72 67 6c 61 73  |0..v..."Hourglas|
0000ea70  73 5f 4c 45 44 73 22 2c  25 31 31 2c 25 31 31 0d  |s_LEDs",%11,%11.|
0000ea80  07 77 3c f4 20 53 6c 69  67 68 74 6c 79 20 67 72  |.w<. Slightly gr|
0000ea90  65 61 74 65 72 20 64 65  6c 61 79 20 74 68 61 6e  |eater delay than|
0000eaa0  20 74 68 61 74 20 67 69  76 65 6e 20 62 79 20 48  | that given by H|
0000eab0  6f 75 72 67 6c 61 73 73  5f 4f 6e 0d 07 78 12 6e  |ourglass_On..x.n|
0000eac0  6f 5f 6f 66 5f 66 69 6c  65 73 25 3d 30 0d 07 79  |o_of_files%=0..y|
0000ead0  0b cf 23 69 6e 25 3d 30  0d 07 7a 0c 61 24 3d be  |..#in%=0..z.a$=.|
0000eae0  23 69 6e 25 0d 07 7b 2e  e7 20 61 24 3d 22 22 20  |#in%..{.. a$="" |
0000eaf0  8c 20 61 24 3d 77 61 69  74 24 2b a4 6d 65 73 73  |. a$=wait$+.mess|
0000eb00  61 67 65 5f 6c 6f 6f 6b  75 70 28 22 66 61 69 6c  |age_lookup("fail|
0000eb10  22 29 0d 07 7c 4b e7 20  c0 61 24 2c 38 29 3c 3e  |")..|K. .a$,8)<>|
0000eb20  22 41 72 63 68 69 76 65  3a 22 20 8c 20 85 20 32  |"Archive:" . . 2|
0000eb30  35 35 2c 61 24 3a f4 20  74 65 78 74 20 6f 66 20  |55,a$:. text of |
0000eb40  61 24 20 77 69 6c 6c 20  62 65 20 65 72 72 6f 72  |a$ will be error|
0000eb50  20 6d 65 73 73 61 67 65  20 68 65 72 65 0d 07 7d  | message here..}|
0000eb60  0c 78 25 3d 9a 23 69 6e  25 0d 07 7e 3e f4 20 72  |.x%=.#in%..~>. r|
0000eb70  65 6d 65 6d 62 65 72 20  72 65 64 69 72 65 63 74  |emember redirect|
0000eb80  65 64 20 6f 75 74 70 75  74 20 69 73 20 43 52 2b  |ed output is CR+|
0000eb90  4c 46 20 2d 20 67 65 74  20 65 78 74 72 61 20 4c  |LF - get extra L|
0000eba0  46 20 69 6e 20 78 25 0d  07 7f 08 78 25 3d b9 0d  |F in x%....x%=..|
0000ebb0  07 80 05 f5 0d 07 81 17  20 20 61 24 3d be 23 69  |........  a$=.#i|
0000ebc0  6e 25 3a 6e 25 3d 9a 23  69 6e 25 0d 07 82 5a 20  |n%:n%=.#in%...Z |
0000ebd0  20 e7 20 c0 61 24 2c 37  29 3d 22 77 61 72 6e 69  | . .a$,7)="warni|
0000ebe0  6e 67 22 20 80 20 65 72  72 25 20 8c 20 f2 72 65  |ng" . err% . .re|
0000ebf0  70 6f 72 74 28 61 24 2b  a4 6d 65 73 73 61 67 65  |port(a$+.message|
0000ec00  5f 6c 6f 6f 6b 75 70 28  22 77 61 72 6e 22 29 2c  |_lookup("warn"),|
0000ec10  25 31 31 29 3a 78 25 3d  28 65 72 72 63 6c 69 63  |%11):x%=(errclic|
0000ec20  6b 25 3d 31 29 0d 07 83  18 fd 20 a7 61 24 2c 22  |k%=1)..... .a$,"|
0000ec30  2d 2d 2d 2d 22 29 20 84  20 78 25 3d a3 0d 07 84  |----") . x%=....|
0000ec40  04 0d 07 85 15 e7 20 78  25 3d a3 20 8c 20 85 20  |...... x%=. . . |
0000ec50  32 35 35 2c 22 22 0d 07  86 04 0d 07 87 32 f2 65  |255,"".......2.e|
0000ec60  78 74 65 6e 64 5f 6e 61  6d 65 64 5f 73 6c 69 64  |xtend_named_slid|
0000ec70  69 6e 67 5f 62 6c 6f 63  6b 28 69 63 6f 6e 5f 6e  |ing_block(icon_n|
0000ec80  61 6d 65 73 25 2c a2 23  69 6e 25 29 0d 07 88 57  |ames%,.#in%)...W|
0000ec90  f4 20 63 6c 61 69 6d 20  65 6e 6f 75 67 68 20 69  |. claim enough i|
0000eca0  63 6f 6e 5f 6e 61 6d 65  73 25 20 73 70 61 63 65  |con_names% space|
0000ecb0  20 74 6f 20 68 6f 6c 64  20 74 68 65 20 2a 77 68  | to hold the *wh|
0000ecc0  6f 6c 65 20 66 69 6c 65  2a 20 2d 20 67 75 61 72  |ole file* - guar|
0000ecd0  61 6e 74 65 65 64 20 74  6f 20 62 65 20 65 6e 6f  |anteed to be eno|
0000ece0  75 67 68 0d 07 89 39 f2  65 78 74 65 6e 64 5f 6e  |ugh...9.extend_n|
0000ecf0  61 6d 65 64 5f 73 6c 69  64 69 6e 67 5f 62 6c 6f  |amed_sliding_blo|
0000ed00  63 6b 28 69 63 6f 6e 5f  69 6e 64 65 78 25 2c 34  |ck(icon_index%,4|
0000ed10  2a 28 a2 23 69 6e 25 2f  32 39 29 29 0d 07 8a 4f  |*(.#in%/29))...O|
0000ed20  f4 20 63 6c 61 69 6d 20  69 63 6f 6e 5f 69 6e 64  |. claim icon_ind|
0000ed30  65 78 25 20 73 70 61 63  65 20 62 79 20 63 61 6c  |ex% space by cal|
0000ed40  63 75 6c 61 74 69 6e 67  20 6e 6f 2e 20 6f 66 20  |culating no. of |
0000ed50  6c 69 6e 65 73 2c 20 61  74 20 32 39 20 62 79 74  |lines, at 29 byt|
0000ed60  65 73 20 70 65 72 20 6c  69 6e 65 0d 07 8b 43 f4  |es per line...C.|
0000ed70  20 28 74 68 69 73 20 69  73 20 6d 69 6e 69 6d 75  | (this is minimu|
0000ed80  6d 20 70 6f 73 73 69 62  6c 65 20 6c 65 6e 67 74  |m possible lengt|
0000ed90  68 20 6f 66 20 6c 69 6e  65 20 75 70 20 74 6f 20  |h of line up to |
0000eda0  73 74 61 72 74 20 6f 66  20 6e 61 6d 65 29 0d 07  |start of name)..|
0000edb0  8c 2c f4 20 61 6c 6c 6f  63 61 74 65 20 6f 6e 65  |.,. allocate one|
0000edc0  20 77 6f 72 64 20 66 6f  72 20 70 6f 69 6e 74 65  | word for pointe|
0000edd0  72 20 70 65 72 20 6c 69  6e 65 0d 07 8d 2e f4 20  |r per line..... |
0000ede0  28 69 2e 65 2e 20 6d 61  78 20 70 6f 73 73 69 62  |(i.e. max possib|
0000edf0  6c 65 20 69 63 6f 6e 73  20 69 66 20 61 6c 6c 20  |le icons if all |
0000ee00  69 6e 20 72 6f 6f 74 29  0d 07 8e 19 63 6f 64 65  |in root)....code|
0000ee10  5f 70 74 72 25 3d 21 61  72 72 61 79 73 63 61 6e  |_ptr%=!arrayscan|
0000ee20  25 0d 07 8f 1a 6e 61 6d  65 5f 70 74 72 25 3d 21  |%....name_ptr%=!|
0000ee30  69 63 6f 6e 5f 6e 61 6d  65 73 25 0d 07 90 1b 6d  |icon_names%....m|
0000ee40  61 78 6c 65 6e 70 74 72  25 3d 21 69 63 6f 6e 5f  |axlenptr%=!icon_|
0000ee50  69 6e 64 65 78 25 0d 07  91 12 6d 61 78 6c 65 6e  |index%....maxlen|
0000ee60  70 74 72 25 21 34 3d 30  0d 07 92 51 f4 20 73 74  |ptr%!4=0...Q. st|
0000ee70  6f 72 65 20 6e 6f 5f 6f  66 5f 66 69 6c 65 73 20  |ore no_of_files |
0000ee80  61 74 20 6d 61 78 6c 65  6e 70 74 72 25 20 61 6e  |at maxlenptr% an|
0000ee90  64 20 70 6f 69 6e 74 65  72 20 74 6f 20 6c 6f 6e  |d pointer to lon|
0000eea0  67 65 73 74 20 6e 61 6d  65 20 61 74 20 6d 61 78  |gest name at max|
0000eeb0  6c 65 6e 70 74 72 25 21  34 0d 07 93 1b 69 6e 64  |lenptr%!4....ind|
0000eec0  65 78 5f 70 74 72 25 3d  6d 61 78 6c 65 6e 70 74  |ex_ptr%=maxlenpt|
0000eed0  72 25 2b 38 0d 07 94 04  0d 07 95 32 48 25 3d 69  |r%+8.......2H%=i|
0000eee0  6e 64 65 78 5f 70 74 72  25 3a f4 20 73 65 74 20  |ndex_ptr%:. set |
0000eef0  52 37 20 74 6f 20 70 6f  69 6e 74 20 74 6f 20 69  |R7 to point to i|
0000ef00  6e 64 65 78 20 62 6c 6f  63 6b 0d 07 96 33 47 25  |ndex block...3G%|
0000ef10  3d 62 6c 6f 63 6b 25 3a  f4 20 73 65 74 20 52 36  |=block%:. set R6|
0000ef20  20 74 6f 20 70 6f 69 6e  74 20 74 6f 20 74 65 6d  | to point to tem|
0000ef30  70 6f 72 61 72 79 20 62  75 66 66 65 72 0d 07 97  |porary buffer...|
0000ef40  22 42 25 3d 69 6e 25 3a  f4 20 73 65 74 20 52 31  |"B%=in%:. set R1|
0000ef50  20 74 6f 20 66 69 6c 65  20 68 61 6e 64 6c 65 0d  | to file handle.|
0000ef60  07 98 31 46 25 3d a2 23  69 6e 25 2f 31 30 30 3a  |..1F%=.#in%/100:|
0000ef70  f4 20 20 73 65 74 20 52  35 20 74 6f 20 66 69 6c  |.  set R5 to fil|
0000ef80  65 20 73 69 7a 65 20 28  44 49 56 20 31 30 30 29  |e size (DIV 100)|
0000ef90  0d 07 99 4b 24 74 65 6d  70 25 3d 63 6f 6d 6d 6f  |...K$temp%=commo|
0000efa0  6e 70 61 74 68 24 3a f4  20 73 6f 20 77 65 20 64  |npath$:. so we d|
0000efb0  6f 6e 27 74 20 68 61 76  65 20 74 6f 20 6c 6f 6f  |on't have to loo|
0000efc0  6b 20 69 74 20 75 70 20  61 67 61 69 6e 20 61 74  |k it up again at|
0000efd0  20 65 76 65 72 79 20 43  41 4c 4c 0d 07 9a 04 0d  | every CALL.....|
0000efe0  07 9b 24 63 6f 64 65 5f  70 74 72 25 21 34 3d 30  |..$code_ptr%!4=0|
0000eff0  3a f4 20 72 65 73 65 74  20 66 6c 61 67 20 77 6f  |:. reset flag wo|
0000f000  72 64 73 0d 07 9c 11 63  6f 64 65 5f 70 74 72 25  |rds....code_ptr%|
0000f010  21 38 3d 30 0d 07 9d 2a  d6 20 63 6f 64 65 5f 70  |!8=0...*. code_p|
0000f020  74 72 25 2c 6e 61 6d 65  5f 70 74 72 25 2c 74 65  |tr%,name_ptr%,te|
0000f030  6d 70 25 2c 69 6e 64 65  78 5f 70 74 72 25 0d 07  |mp%,index_ptr%..|
0000f040  9e 16 f4 20 70 61 73 73  20 70 61 72 61 6d 65 74  |... pass paramet|
0000f050  65 72 73 3a 0d 07 9f 44  f4 20 31 73 74 20 2d 20  |ers:...D. 1st - |
0000f060  73 74 61 72 74 20 6f 66  20 62 6c 6f 63 6b 20 69  |start of block i|
0000f070  6e 20 77 68 69 63 68 20  74 6f 20 73 74 6f 72 65  |n which to store|
0000f080  20 70 6f 69 6e 74 65 72  73 20 74 6f 20 6e 61 6d  | pointers to nam|
0000f090  65 73 20 66 6f 75 6e 64  0d 07 a0 37 f4 20 32 6e  |es found...7. 2n|
0000f0a0  64 20 2d 20 73 74 61 72  74 20 6f 66 20 62 6c 6f  |d - start of blo|
0000f0b0  63 6b 20 68 6f 6c 64 69  6e 67 20 22 63 6f 6d 6d  |ck holding "comm|
0000f0c0  6f 6e 20 70 61 74 68 22  20 73 74 72 69 6e 67 0d  |on path" string.|
0000f0d0  07 a1 41 f4 20 33 72 64  20 2d 20 73 74 61 72 74  |..A. 3rd - start|
0000f0e0  20 6f 66 20 6f 75 74 70  75 74 20 62 6c 6f 63 6b  | of output block|
0000f0f0  20 69 6e 74 6f 20 77 68  69 63 68 20 74 6f 20 77  | into which to w|
0000f100  72 69 74 65 20 6e 61 6d  65 73 20 66 6f 75 6e 64  |rite names found|
0000f110  0d 07 a2 46 f4 20 52 31  2c 52 35 2c 52 36 20 61  |...F. R1,R5,R6 a|
0000f120  6e 64 20 52 37 20 61 72  65 20 61 6c 73 6f 20 69  |nd R7 are also i|
0000f130  6e 69 74 69 61 6c 69 73  65 64 20 77 69 74 68 20  |nitialised with |
0000f140  66 72 65 71 75 65 6e 74  6c 79 2d 75 73 65 64 20  |frequently-used |
0000f150  76 61 6c 75 65 73 0d 07  a3 45 e7 20 a4 74 69 63  |values...E. .tic|
0000f160  6b 65 64 28 64 69 73 70  6d 65 6e 75 25 2c 31 29  |ked(dispmenu%,1)|
0000f170  20 8c 20 c8 99 22 4f 53  5f 48 65 61 70 53 6f 72  | . .."OS_HeapSor|
0000f180  74 22 2c 63 6f 64 65 5f  70 74 72 25 21 34 2c 69  |t",code_ptr%!4,i|
0000f190  6e 64 65 78 5f 70 74 72  25 2c 34 0d 07 a4 1c 6d  |ndex_ptr%,4....m|
0000f1a0  61 78 6c 65 6e 70 74 72  25 21 30 3d 63 6f 64 65  |axlenptr%!0=code|
0000f1b0  5f 70 74 72 25 21 34 0d  07 a5 2b f4 20 73 6f 20  |_ptr%!4...+. so |
0000f1c0  77 65 20 63 61 6e 20 61  63 63 65 73 73 20 6e 6f  |we can access no|
0000f1d0  5f 6f 66 5f 66 69 6c 65  73 20 67 6c 6f 62 61 6c  |_of_files global|
0000f1e0  6c 79 0d 07 a6 3b f2 65  78 74 65 6e 64 5f 6e 61  |ly...;.extend_na|
0000f1f0  6d 65 64 5f 73 6c 69 64  69 6e 67 5f 62 6c 6f 63  |med_sliding_bloc|
0000f200  6b 28 69 63 6f 6e 5f 77  69 64 74 68 73 25 2c 34  |k(icon_widths%,4|
0000f210  2a 21 6d 61 78 6c 65 6e  70 74 72 25 29 0d 07 a7  |*!maxlenptr%)...|
0000f220  41 f4 20 72 65 73 69 7a  65 20 62 6c 6f 63 6b 20  |A. resize block |
0000f230  74 6f 20 68 6f 6c 64 20  6e 65 63 65 73 73 61 72  |to hold necessar|
0000f240  79 20 73 74 72 69 6e 67  20 77 69 64 74 68 73 20  |y string widths |
0000f250  28 66 6f 72 20 63 6c 69  70 70 69 6e 67 29 0d 07  |(for clipping)..|
0000f260  a8 30 f4 20 77 65 20 73  65 74 20 74 68 65 73 65  |.0. we set these|
0000f270  20 6c 61 74 65 72 2c 20  61 74 20 77 69 6e 64 6f  | later, at windo|
0000f280  77 2d 6f 70 65 6e 69 6e  67 20 74 69 6d 65 0d 07  |w-opening time..|
0000f290  a9 04 0d 07 aa 1b 6d 61  78 6c 65 6e 70 74 72 25  |......maxlenptr%|
0000f2a0  3d 21 69 63 6f 6e 5f 69  6e 64 65 78 25 0d 07 ab  |=!icon_index%...|
0000f2b0  04 0d 07 ac 50 f4 20 6d  61 63 68 69 6e 65 20 63  |....P. machine c|
0000f2c0  6f 64 65 20 68 61 73 20  61 6c 72 65 61 64 79 20  |ode has already |
0000f2d0  77 72 69 74 74 65 6e 20  61 64 64 72 65 73 73 20  |written address |
0000f2e0  6f 66 20 6c 6f 6e 67 65  73 74 20 6e 61 6d 65 20  |of longest name |
0000f2f0  69 6e 74 6f 20 6d 61 78  6c 65 6e 70 74 72 25 21  |into maxlenptr%!|
0000f300  34 0d 07 ad 16 e7 20 6d  61 78 6c 65 6e 70 74 72  |4..... maxlenptr|
0000f310  25 21 34 3e 30 20 8c 0d  07 ae 33 20 6d 61 78 5f  |%!4>0 ....3 max_|
0000f320  69 63 6f 6e 5f 77 69 64  74 68 25 3d a4 73 74 72  |icon_width%=.str|
0000f330  69 6e 67 6c 65 6e 67 74  68 28 24 28 6d 61 78 6c  |inglength($(maxl|
0000f340  65 6e 70 74 72 25 21 34  29 29 0d 07 af 21 61 63  |enptr%!4))...!ac|
0000f350  72 6f 73 73 25 3d 34 2b  28 6d 61 78 6c 65 6e 70  |ross%=4+(maxlenp|
0000f360  74 72 25 21 30 20 81 20  31 30 29 0d 07 b0 12 f2  |tr%!0 . 10).....|
0000f370  73 65 74 63 6c 69 70 77  69 64 74 68 73 0d 07 b1  |setclipwidths...|
0000f380  05 cc 0d 07 b2 0e 20 61  63 72 6f 73 73 25 3d 31  |...... across%=1|
0000f390  0d 07 b3 05 cd 0d 07 b4  1d f4 20 6e 6f 2e 6f 66  |.......... no.of|
0000f3a0  20 69 63 6f 6e 73 20 69  6e 20 65 61 63 68 20 72  | icons in each r|
0000f3b0  6f 77 0d 07 b5 2f e7 20  6d 61 78 5f 69 63 6f 6e  |ow.../. max_icon|
0000f3c0  5f 77 69 64 74 68 25 3c  32 30 30 20 8c 20 6d 61  |_width%<200 . ma|
0000f3d0  78 5f 69 63 6f 6e 5f 77  69 64 74 68 25 3d 32 30  |x_icon_width%=20|
0000f3e0  30 0d 07 b6 3d e7 20 6d  61 78 5f 69 63 6f 6e 5f  |0...=. max_icon_|
0000f3f0  77 69 64 74 68 25 3e 63  6c 69 70 77 69 64 74 68  |width%>clipwidth|
0000f400  25 20 8c 20 6d 61 78 5f  69 63 6f 6e 5f 77 69 64  |% . max_icon_wid|
0000f410  74 68 25 3d 63 6c 69 70  77 69 64 74 68 25 0d 07  |th%=clipwidth%..|
0000f420  b7 25 78 25 3d 28 a4 73  63 72 65 65 6e 77 69 64  |.%x%=(.screenwid|
0000f430  74 68 2f 6d 61 78 5f 69  63 6f 6e 5f 77 69 64 74  |th/max_icon_widt|
0000f440  68 25 29 0d 07 b8 39 f4  20 6d 61 78 69 6d 75 6d  |h%)...9. maximum|
0000f450  20 6e 75 6d 62 65 72 20  6f 66 20 66 69 6c 65 73  | number of files|
0000f460  20 74 68 61 74 20 77 69  6c 6c 20 66 69 74 20 61  | that will fit a|
0000f470  63 72 6f 73 73 20 73 63  72 65 65 6e 0d 07 b9 1d  |cross screen....|
0000f480  e7 20 78 25 3c 61 63 72  6f 73 73 25 20 8c 20 61  |. x%<across% . a|
0000f490  63 72 6f 73 73 25 3d 78  25 0d 07 ba 04 0d 07 bb  |cross%=x%.......|
0000f4a0  3d f2 64 72 61 77 77 69  6e 64 6f 77 28 61 63 72  |=.drawwindow(acr|
0000f4b0  6f 73 73 25 2c 6d 61 78  6c 65 6e 70 74 72 25 21  |oss%,maxlenptr%!|
0000f4c0  30 2c 6d 61 78 5f 69 63  6f 6e 5f 77 69 64 74 68  |0,max_icon_width|
0000f4d0  25 2c 72 65 6f 70 65 6e  25 29 0d 07 bc 15 c8 99  |%,reopen%)......|
0000f4e0  22 48 6f 75 72 67 6c 61  73 73 5f 4f 66 66 22 0d  |"Hourglass_Off".|
0000f4f0  07 bd 05 e1 0d 07 be 04  0d 07 bf 14 dd 20 a4 66  |............. .f|
0000f500  66 65 72 72 6f 72 28 6e  75 6d 25 29 0d 07 c0 08  |ferror(num%)....|
0000f510  ea 20 6e 25 0d 07 c1 3f  e7 20 6e 75 6d 25 3d 32  |. n%...?. num%=2|
0000f520  32 32 20 8c 20 69 6e 25  3d 8e 22 49 6e 66 6f 53  |22 . in%=."InfoS|
0000f530  63 72 61 70 3a 43 41 54  22 3a 6e 25 3d a3 3a 8b  |crap:CAT":n%=.:.|
0000f540  20 f2 72 65 70 6f 72 74  28 f6 24 2c 31 29 3a 6e  | .report(.$,1):n|
0000f550  25 3d b9 0d 07 c2 33 f4  20 74 72 79 20 74 6f 20  |%=....3. try to |
0000f560  72 65 63 6f 76 65 72 20  66 72 6f 6d 20 69 6c 6c  |recover from ill|
0000f570  65 67 61 6c 2f 63 6c 6f  73 65 64 20 66 69 6c 65  |egal/closed file|
0000f580  20 65 72 72 6f 72 0d 07  c3 2e f4 20 52 65 74 75  | error..... Retu|
0000f590  72 6e 20 54 52 55 45 20  74 6f 20 61 62 6f 72 74  |rn TRUE to abort|
0000f5a0  20 50 52 4f 43 66 61 6b  65 66 69 6c 65 72 77 69  | PROCfakefilerwi|
0000f5b0  6e 64 6f 77 0d 07 c4 07  3d 6e 25 0d 07 c5 04 0d  |ndow....=n%.....|
0000f5c0  07 c6 38 dd 20 f2 64 72  61 77 77 69 6e 64 6f 77  |..8. .drawwindow|
0000f5d0  28 61 63 72 6f 73 73 25  2c 6e 6f 5f 6f 66 5f 66  |(across%,no_of_f|
0000f5e0  69 6c 65 73 25 2c 6d 61  78 5f 6c 65 6e 25 2c 72  |iles%,max_len%,r|
0000f5f0  65 6f 70 65 6e 25 29 0d  07 c7 2b ea 20 6e 61 6d  |eopen%)...+. nam|
0000f600  65 24 2c 6e 25 2c 77 69  64 74 68 25 2c 79 25 2c  |e$,n%,width%,y%,|
0000f610  70 74 72 25 2c 61 24 2c  63 6f 6d 6d 6f 6e 6c 65  |ptr%,a$,commonle|
0000f620  6e 25 0d 07 c8 11 ea 20  70 61 6e 65 6f 66 66 73  |n%..... paneoffs|
0000f630  65 74 25 0d 07 c9 33 e7  20 73 68 6f 77 70 61 6e  |et%...3. showpan|
0000f640  65 25 3d 31 20 8c 20 70  61 6e 65 6f 66 66 73 65  |e%=1 . paneoffse|
0000f650  74 25 3d 39 36 20 8b 20  70 61 6e 65 6f 66 66 73  |t%=96 . paneoffs|
0000f660  65 74 25 3d 32 30 0d 07  ca 3f f4 20 61 63 72 6f  |et%=20...?. acro|
0000f670  73 73 25 20 69 73 20 6e  75 6d 62 65 72 20 6f 66  |ss% is number of|
0000f680  20 63 6f 6c 75 6d 6e 73  20 69 6e 20 77 68 69 63  | columns in whic|
0000f690  68 20 66 69 6c 65 73 20  61 72 65 20 64 69 73 70  |h files are disp|
0000f6a0  6c 61 79 65 64 0d 07 cb  21 e7 20 6d 61 78 5f 6c  |layed...!. max_l|
0000f6b0  65 6e 25 3c 32 30 30 20  8c 20 6d 61 78 5f 6c 65  |en%<200 . max_le|
0000f6c0  6e 25 3d 32 30 30 0d 07  cc 37 63 6f 6d 6d 6f 6e  |n%=200...7common|
0000f6d0  6c 65 6e 25 3d a4 73 74  72 69 6e 67 6c 65 6e 67  |len%=.stringleng|
0000f6e0  74 68 28 22 2f 22 2b c0  63 6f 6d 6d 6f 6e 70 61  |th("/"+.commonpa|
0000f6f0  74 68 24 29 29 2b 36 34  2b 38 2b 32 34 0d 07 cd  |th$))+64+8+24...|
0000f700  52 f4 20 36 34 20 4f 53  20 75 6e 69 74 73 20 66  |R. 64 OS units f|
0000f710  72 6f 6d 20 6c 65 66 74  2d 68 61 6e 64 20 73 69  |rom left-hand si|
0000f720  64 65 20 6f 66 20 70 61  6e 65 20 61 6e 64 20 38  |de of pane and 8|
0000f730  20 4f 53 20 75 6e 69 74  73 20 74 6f 20 72 69 67  | OS units to rig|
0000f740  68 74 20 65 64 67 65 20  6f 66 20 70 61 6e 65 0d  |ht edge of pane.|
0000f750  07 ce 4d f4 20 70 6c 75  73 20 32 34 2d 4f 53 20  |..M. plus 24-OS |
0000f760  75 6e 69 74 20 27 62 6f  72 64 65 72 20 61 6c 6c  |unit 'border all|
0000f770  6f 77 61 6e 63 65 27 20  74 6f 20 61 6c 6c 6f 77  |owance' to allow|
0000f780  20 66 6f 72 20 74 68 65  20 70 61 64 64 69 6e 67  | for the padding|
0000f790  20 69 6e 73 65 72 74 65  64 20 62 79 0d 07 cf 1f  | inserted by....|
0000f7a0  f4 20 74 68 65 20 57 49  4d 50 20 61 74 20 73 74  |. the WIMP at st|
0000f7b0  61 72 74 20 6f 66 20 69  63 6f 6e 0d 07 d0 16 e7  |art of icon.....|
0000f7c0  20 6e 6f 5f 6f 66 5f 66  69 6c 65 73 25 3d 30 20  | no_of_files%=0 |
0000f7d0  8c 0d 07 d1 17 20 20 f4  20 65 6d 70 74 79 20 64  |.....  . empty d|
0000f7e0  69 72 65 63 74 6f 72 79  0d 07 d2 16 20 77 69 64  |irectory.... wid|
0000f7f0  74 68 25 3d 63 6f 6d 6d  6f 6e 6c 65 6e 25 0d 07  |th%=commonlen%..|
0000f800  d3 0e 20 61 63 72 6f 73  73 25 3d 31 0d 07 d4 05  |.. across%=1....|
0000f810  cc 0d 07 d5 65 20 e7 20  6e 6f 5f 6f 66 5f 66 69  |....e . no_of_fi|
0000f820  6c 65 73 25 3c 61 63 72  6f 73 73 25 20 8c 20 77  |les%<across% . w|
0000f830  69 64 74 68 25 3d 6d 61  78 5f 6c 65 6e 25 2a a4  |idth%=max_len%*.|
0000f840  6c 6f 6f 70 65 64 28 6e  6f 5f 6f 66 5f 66 69 6c  |looped(no_of_fil|
0000f850  65 73 25 2c 61 63 72 6f  73 73 25 29 20 8b 20 77  |es%,across%) . w|
0000f860  69 64 74 68 25 3d 6d 61  78 5f 6c 65 6e 25 2a 61  |idth%=max_len%*a|
0000f870  63 72 6f 73 73 25 0d 07  d6 2c 20 e7 20 77 69 64  |cross%..., . wid|
0000f880  74 68 25 3c 63 6f 6d 6d  6f 6e 6c 65 6e 25 20 8c  |th%<commonlen% .|
0000f890  20 77 69 64 74 68 25 3d  63 6f 6d 6d 6f 6e 6c 65  | width%=commonle|
0000f8a0  6e 25 0d 07 d7 05 cd 0d  07 d8 3a f4 20 77 69 64  |n%........:. wid|
0000f8b0  74 68 25 20 69 73 20 6e  6f 77 20 72 65 71 75 69  |th% is now requi|
0000f8c0  72 65 64 20 77 69 64 74  68 20 6f 66 20 77 69 6e  |red width of win|
0000f8d0  64 6f 77 20 28 69 6e 20  4f 53 20 75 6e 69 74 73  |dow (in OS units|
0000f8e0  29 0d 07 d9 3b 79 25 3d  31 32 36 2a 28 28 6e 6f  |)...;y%=126*((no|
0000f8f0  5f 6f 66 5f 66 69 6c 65  73 25 2b 61 63 72 6f 73  |_of_files%+acros|
0000f900  73 25 2d 31 29 20 81 20  61 63 72 6f 73 73 25 29  |s%-1) . across%)|
0000f910  2b 70 61 6e 65 6f 66 66  73 65 74 25 0d 07 da 2f  |+paneoffset%.../|
0000f920  e7 20 79 25 3c 28 31 32  36 2b 70 61 6e 65 6f 66  |. y%<(126+paneof|
0000f930  66 73 65 74 25 29 20 8c  20 79 25 3d 31 32 36 2b  |fset%) . y%=126+|
0000f940  70 61 6e 65 6f 66 66 73  65 74 25 0d 07 db 3d e7  |paneoffset%...=.|
0000f950  20 73 68 6f 77 70 61 6e  65 25 20 8c 20 f2 73 65  | showpane% . .se|
0000f960  74 69 63 6f 6e 74 65 78  74 28 70 61 6e 65 70 61  |ticontext(panepa|
0000f970  74 68 25 2c 31 2c 22 2f  22 2b c0 63 6f 6d 6d 6f  |th%,1,"/"+.commo|
0000f980  6e 70 61 74 68 24 29 29  0d 07 dc 1f f2 72 65 73  |npath$)).....res|
0000f990  69 7a 65 28 77 69 64 74  68 25 2c 79 25 2c 6d 61  |ize(width%,y%,ma|
0000f9a0  78 5f 6c 65 6e 25 29 0d  07 dd 0f e7 20 72 65 6f  |x_len%)..... reo|
0000f9b0  70 65 6e 25 20 8c 0d 07  de 31 20 20 f2 6f 70 65  |pen% ....1  .ope|
0000f9c0  6e 77 69 6e 64 6f 77 28  62 6c 6f 63 6b 25 29 3a  |nwindow(block%):|
0000f9d0  6c 61 73 74 5f 6f 70 65  6e 65 64 25 3d 66 61 6b  |last_opened%=fak|
0000f9e0  65 66 69 6c 65 72 25 0d  07 df 24 20 20 f4 20 72  |efiler%...$  . r|
0000f9f0  65 6f 70 65 6e 20 74 6f  20 28 6e 65 77 29 20 6d  |eopen to (new) m|
0000fa00  61 78 69 6d 75 6d 20 73  69 7a 65 0d 07 e0 3c 20  |aximum size...< |
0000fa10  20 e7 20 63 68 69 6c 64  25 3d 30 20 8c 20 f2 72  | . child%=0 . .r|
0000fa20  65 64 72 61 77 69 63 6f  6e 62 61 72 28 22 4e 22  |edrawiconbar("N"|
0000fa30  29 20 8b 20 f2 72 65 64  72 61 77 69 63 6f 6e 62  |) . .redrawiconb|
0000fa40  61 72 28 22 59 22 29 0d  07 e1 05 cd 0d 07 e2 05  |ar("Y").........|
0000fa50  e1 0d 07 e3 05 3a 0d 07  e4 52 f4 20 2d 2d 2d 2d  |.....:...R. ----|
0000fa60  2d 2d 2d 2d 43 6f 6d 6d  61 6e 64 2d 6c 69 6e 65  |----Command-line|
0000fa70  20 66 75 6e 63 74 69 6f  6e 2d 2d 2d 2d 2d 2d 2d  | function-------|
0000fa80  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
0000faa0  2d 2d 2d 2d 2d 2d 2d 2d  0d 07 e5 04 0d 07 e6 4e  |--------.......N|
0000fab0  f4 20 74 68 69 73 20 66  75 6e 63 74 69 6f 6e 20  |. this function |
0000fac0  75 73 65 73 20 69 74 73  20 70 61 72 61 6d 65 74  |uses its paramet|
0000fad0  65 72 73 20 61 6e 64 20  74 68 65 20 76 61 6c 75  |ers and the valu|
0000fae0  65 73 20 6f 66 20 74 68  65 20 67 6c 6f 62 61 6c  |es of the global|
0000faf0  20 76 61 72 69 61 62 6c  65 73 0d 07 e7 4f f4 20  | variables...O. |
0000fb00  7a 69 70 66 69 6c 65 24  2c 20 63 6f 6d 6d 6f 6e  |zipfile$, common|
0000fb10  70 61 74 68 24 20 61 6e  64 20 6e 6f 74 7a 69 70  |path$ and notzip|
0000fb20  70 65 64 24 20 74 6f 20  63 6f 6e 73 74 72 75 63  |ped$ to construc|
0000fb30  74 20 74 68 65 20 61 63  74 75 61 6c 20 63 6f 6d  |t the actual com|
0000fb40  6d 61 6e 64 20 6c 69 6e  65 0d 07 e8 3c f4 20 77  |mand line...<. w|
0000fb50  68 69 63 68 20 69 73 20  74 68 65 20 77 68 6f 6c  |hich is the whol|
0000fb60  65 20 70 75 72 70 6f 73  65 20 6f 66 20 74 68 65  |e purpose of the|
0000fb70  20 70 72 6f 67 72 61 6d  27 73 20 65 78 69 73 74  | program's exist|
0000fb80  65 6e 63 65 21 0d 07 e9  21 dd 20 a4 63 6f 6d 6d  |ence!...!. .comm|
0000fb90  61 6e 64 6c 69 6e 65 28  61 63 74 69 6f 6e 24 2c  |andline(action$,|
0000fba0  74 79 70 65 24 29 0d 07  ea 1a ea 20 61 72 67 73  |type$)..... args|
0000fbb0  24 2c 6f 70 74 73 24 2c  61 24 2c 66 69 6c 65 25  |$,opts$,a$,file%|
0000fbc0  0d 07 eb 10 c8 8e 20 61  63 74 69 6f 6e 24 20 ca  |...... action$ .|
0000fbd0  0d 07 ec 10 20 20 c9 20  22 75 6e 7a 69 70 22 3a  |....  . "unzip":|
0000fbe0  0d 07 ed 1f 20 20 20 20  20 20 20 20 20 20 20 20  |....            |
0000fbf0  20 20 20 61 72 67 73 24  3d 22 20 2d 64 20 22 0d  |   args$=" -d ".|
0000fc00  07 ee 26 20 20 20 20 20  20 20 20 20 20 20 20 20  |..&             |
0000fc10  20 20 e7 20 63 6f 6d 6d  6f 6e 70 61 74 68 24 3d  |  . commonpath$=|
0000fc20  22 2a 22 20 8c 0d 07 ef  30 20 20 20 20 20 20 20  |"*" ....0       |
0000fc30  20 20 20 20 20 20 20 20  20 61 72 67 73 24 2b 3d  |         args$+=|
0000fc40  a4 70 61 74 68 6e 61 6d  65 28 6e 6f 74 7a 69 70  |.pathname(notzip|
0000fc50  70 65 64 24 29 0d 07 f0  14 20 20 20 20 20 20 20  |ped$)....       |
0000fc60  20 20 20 20 20 20 20 20  cc 0d 07 f1 2b 20 20 20  |        ....+   |
0000fc70  20 20 20 20 20 20 20 20  20 20 20 20 20 61 72 67  |             arg|
0000fc80  73 24 2b 3d 22 49 6e 66  6f 53 63 72 61 70 3a 74  |s$+="InfoScrap:t|
0000fc90  65 6d 70 22 0d 07 f2 54  20 20 20 20 20 20 20 20  |emp"...T        |
0000fca0  20 20 20 20 20 20 20 20  20 e7 20 a4 69 66 74 68  |         . .ifth|
0000fcb0  65 72 65 28 22 49 6e 66  6f 53 63 72 61 70 3a 74  |ere("InfoScrap:t|
0000fcc0  65 6d 70 22 29 20 8c 20  ff 22 57 69 70 65 20 49  |emp") . ."Wipe I|
0000fcd0  6e 66 6f 53 63 72 61 70  3a 74 65 6d 70 20 52 20  |nfoScrap:temp R |
0000fce0  7e 56 20 7e 43 20 46 22  0d 07 f3 14 20 20 20 20  |~V ~C F"....    |
0000fcf0  20 20 20 20 20 20 20 20  20 20 20 cd 0d 07 f4 39  |           ....9|
0000fd00  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 61  |               a|
0000fd10  72 67 73 24 2b 3d 22 20  22 2b bd 28 26 32 32 29  |rgs$+=" "+.(&22)|
0000fd20  2b bd 28 26 32 32 29 2b  c0 63 6f 6d 6d 6f 6e 70  |+.(&22)+.commonp|
0000fd30  61 74 68 24 29 0d 07 f5  22 20 20 20 20 20 20 20  |ath$)..."       |
0000fd40  20 20 20 20 20 20 20 20  f4 20 65 73 63 61 70 65  |        . escape|
0000fd50  20 71 75 6f 74 65 73 0d  07 f6 29 20 20 20 20 20  | quotes...)     |
0000fd60  20 20 20 20 20 20 20 20  20 20 6f 70 74 73 24 3d  |          opts$=|
0000fd70  a4 6f 70 74 69 6f 6e 73  28 31 29 2b 22 43 20 22  |.options(1)+"C "|
0000fd80  0d 07 f7 1d 20 20 20 20  20 20 20 20 20 20 20 20  |....            |
0000fd90  20 20 20 c8 8e 20 74 79  70 65 24 20 ca 0d 07 f8  |   .. type$ ....|
0000fda0  5b 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |[               |
0000fdb0  20 c9 20 22 61 70 70 6c  69 63 61 74 69 6f 6e 22  | . "application"|
0000fdc0  2c 22 64 69 72 65 63 74  6f 72 79 22 3a 61 72 67  |,"directory":arg|
0000fdd0  73 24 2b 3d a4 75 6e 44  4f 53 69 66 79 28 a4 6c  |s$+=.unDOSify(.l|
0000fde0  65 61 66 6e 61 6d 65 28  6e 6f 74 7a 69 70 70 65  |eafname(notzippe|
0000fdf0  64 24 29 29 2b 22 2a 22  0d 07 f9 48 20 20 20 20  |d$))+"*"...H    |
0000fe00  20 20 20 20 20 20 20 20  20 20 20 20 c9 20 22 66  |            . "f|
0000fe10  69 6c 65 5f 78 78 78 22  3a 61 72 67 73 24 2b 3d  |ile_xxx":args$+=|
0000fe20  a4 75 6e 44 4f 53 69 66  79 28 a4 6c 65 61 66 6e  |.unDOSify(.leafn|
0000fe30  61 6d 65 28 6e 6f 74 7a  69 70 70 65 64 24 29 29  |ame(notzipped$))|
0000fe40  0d 07 fa 26 20 20 20 20  20 20 20 20 20 20 20 20  |...&            |
0000fe50  20 20 20 20 c9 20 22 61  6c 6c 22 3a 61 72 67 73  |    . "all":args|
0000fe60  24 2b 3d 22 2a 22 0d 07  fb 14 20 20 20 20 20 20  |$+="*"....      |
0000fe70  20 20 20 20 20 20 20 20  20 cb 0d 07 fc 36 20 20  |         ....6  |
0000fe80  20 20 20 20 20 20 20 20  20 20 20 20 20 61 24 3d  |             a$=|
0000fe90  22 75 6e 7a 69 70 70 69  6e 67 22 3a 61 72 67 73  |"unzipping":args|
0000fea0  24 2b 3d bd 28 26 32 32  29 2b bd 28 26 32 32 29  |$+=.(&22)+.(&22)|
0000feb0  0d 07 fd 2d 20 20 c9 20  22 7a 69 70 22 3a 6f 70  |...-  . "zip":op|
0000fec0  74 73 24 3d 22 20 2d 72  20 2d 62 20 3c 57 69 6d  |ts$=" -r -b <Wim|
0000fed0  70 24 53 63 72 61 70 44  69 72 3e 20 22 0d 07 fe  |p$ScrapDir> "...|
0000fee0  3f 20 20 20 20 20 20 20  20 20 20 20 20 20 e7 20  |?             . |
0000fef0  a6 28 2d 31 29 20 8c 20  6f 70 74 73 24 3d 22 20  |.(-1) . opts$=" |
0000ff00  2d 6d 22 2b 6f 70 74 73  24 20 8b 20 64 65 6c 65  |-m"+opts$ . dele|
0000ff10  74 65 5f 6c 61 74 65 72  24 3d 22 22 0d 07 ff 1c  |te_later$=""....|
0000ff20  20 20 20 20 20 20 20 20  20 20 20 20 20 f4 20 6d  |             . m|
0000ff30  6f 76 65 2f 63 6f 70 79  0d 08 00 6a 20 20 20 20  |ove/copy...j    |
0000ff40  20 20 20 20 20 20 20 20  20 e7 20 c0 6e 6f 74 7a  |         . .notz|
0000ff50  69 70 70 65 64 24 2c 31  35 29 3d 22 20 49 6e 66  |ipped$,15)=" Inf|
0000ff60  6f 53 63 72 61 70 3a 61  64 64 2e 22 20 8c 20 61  |oScrap:add." . a|
0000ff70  72 67 73 24 3d c1 6e 6f  74 7a 69 70 70 65 64 24  |rgs$=.notzipped$|
0000ff80  2c 31 36 29 20 8b 20 61  72 67 73 24 3d a4 6c 65  |,16) . args$=.le|
0000ff90  61 66 6e 61 6d 65 28 6e  6f 74 7a 69 70 70 65 64  |afname(notzipped|
0000ffa0  24 29 0d 08 01 1d 20 20  20 20 20 20 20 20 20 20  |$)....          |
0000ffb0  20 20 20 61 24 3d 22 7a  69 70 70 69 6e 67 22 0d  |   a$="zipping".|
0000ffc0  08 02 6d 20 20 20 20 20  20 20 20 20 20 20 20 20  |..m             |
0000ffd0  e7 20 77 61 69 74 24 3d  22 64 65 6c 65 74 65 22  |. wait$="delete"|
0000ffe0  20 8c 20 6f 70 74 73 24  3d 22 20 2d 64 20 2d 62  | . opts$=" -d -b|
0000fff0  20 3c 57 69 6d 70 24 53  63 72 61 70 44 69 72 3e  | <Wimp$ScrapDir>|
00010000  20 22 3a 61 72 67 73 24  3d a4 75 6e 44 4f 53 69  | ":args$=.unDOSi|
00010010  66 79 28 6e 6f 74 7a 69  70 70 65 64 24 29 3a 61  |fy(notzipped$):a|
00010020  24 3d 22 64 65 6c 65 74  69 6e 67 22 0d 08 03 28  |$="deleting"...(|
00010030  20 20 20 20 20 20 20 20  20 20 20 20 20 6f 70 74  |             opt|
00010040  73 24 3d a4 6f 70 74 69  6f 6e 73 28 30 29 2b 6f  |s$=.options(0)+o|
00010050  70 74 73 24 0d 08 04 1b  20 20 20 20 20 20 20 20  |pts$....        |
00010060  20 20 20 20 20 c8 8e 20  74 79 70 65 24 20 ca 0d  |     .. type$ ..|
00010070  08 05 39 20 20 20 20 20  20 20 20 20 20 20 20 20  |..9             |
00010080  20 20 c9 20 22 61 70 70  6c 69 63 61 74 69 6f 6e  |  . "application|
00010090  22 2c 22 64 69 72 65 63  74 6f 72 79 22 3a 61 72  |","directory":ar|
000100a0  67 73 24 2b 3d 22 2a 22  0d 08 06 12 20 20 20 20  |gs$+="*"....    |
000100b0  20 20 20 20 20 20 20 20  20 cb 0d 08 07 05 cb 0d  |         .......|
000100c0  08 08 37 e7 20 64 65 62  75 67 25 20 8c 20 f2 64  |..7. debug% . .d|
000100d0  65 62 75 67 28 61 63 74  69 6f 6e 24 2b 6f 70 74  |ebug(action$+opt|
000100e0  73 24 2b 7a 69 70 66 69  6c 65 24 2b 22 20 22 2b  |s$+zipfile$+" "+|
000100f0  61 72 67 73 24 29 0d 08  09 33 f4 20 2a 52 65 70  |args$)...3. *Rep|
00010100  6f 72 74 20 5c 62 20 28  61 63 74 69 6f 6e 24 2b  |ort \b (action$+|
00010110  6f 70 74 73 24 2b 7a 69  70 66 69 6c 65 24 2b 22  |opts$+zipfile$+"|
00010120  20 22 2b 61 72 67 73 24  29 0d 08 0a 69 3d 22 54  | "+args$)...i="T|
00010130  61 73 6b 57 69 6e 64 6f  77 20 22 2b bd 33 34 2b  |askWindow "+.34+|
00010140  61 63 74 69 6f 6e 24 2b  6f 70 74 73 24 2b 7a 69  |action$+opts$+zi|
00010150  70 66 69 6c 65 24 2b 22  20 22 2b 61 72 67 73 24  |pfile$+" "+args$|
00010160  2b bd 33 34 2b 22 20 2d  6e 61 6d 65 20 22 2b bd  |+.34+" -name "+.|
00010170  33 34 2b 22 49 6e 66 6f  7a 69 70 20 28 22 2b 61  |34+"Infozip ("+a|
00010180  24 2b 22 29 22 2b bd 33  34 2b 22 20 2d 71 75 69  |$+")"+.34+" -qui|
00010190  74 22 0d 08 0b 05 3a 0d  08 0c 15 dd 20 a4 6f 70  |t"....:..... .op|
000101a0  74 69 6f 6e 73 28 74 79  70 65 25 29 0d 08 0d 0b  |tions(type%)....|
000101b0  ea 20 6e 25 2c 61 24 0d  08 0e 41 f4 20 74 79 70  |. n%,a$...A. typ|
000101c0  65 25 20 30 20 3d 7a 69  70 2d 61 70 70 6c 69 63  |e% 0 =zip-applic|
000101d0  61 62 6c 65 20 6f 70 74  69 6f 6e 73 20 6f 6e 6c  |able options onl|
000101e0  79 2c 20 74 79 70 65 25  20 31 20 3d 20 61 6c 6c  |y, type% 1 = all|
000101f0  20 6f 70 74 69 6f 6e 73  0d 08 0f 0b 61 24 3d 22  | options....a$="|
00010200  20 2d 22 0d 08 10 0e e3  20 6e 25 3d 31 20 b8 20  | -"..... n%=1 . |
00010210  35 0d 08 11 1f 20 20 e7  20 6e 25 3d 32 20 84 20  |5....  . n%=2 . |
00010220  6e 25 3d 34 20 84 20 74  79 70 65 25 3d 31 20 8c  |n%=4 . type%=1 .|
00010230  0d 08 12 2c 20 20 20 20  e7 20 6f 70 74 69 6f 6e  |...,    . option|
00010240  73 25 28 6e 25 29 20 8c  20 61 24 2b 3d c1 6f 70  |s%(n%) . a$+=.op|
00010250  74 69 6f 6e 73 24 2c 6e  25 2c 31 29 0d 08 13 07  |tions$,n%,1)....|
00010260  20 20 cd 0d 08 14 05 ed  0d 08 15 3a e7 20 74 79  |  .........:. ty|
00010270  70 65 25 3c 3e 31 20 80  20 6f 70 74 69 6f 6e 73  |pe%<>1 . options|
00010280  25 28 6e 25 29 20 8c 20  61 24 2b 3d c1 6f 70 74  |%(n%) . a$+=.opt|
00010290  69 6f 6e 73 24 2c 6e 25  2c 31 29 3a f4 20 6e 25  |ions$,n%,1):. n%|
000102a0  3d 36 0d 08 16 0f e7 20  61 24 3d 22 20 2d 22 20  |=6..... a$=" -" |
000102b0  8c 0d 08 17 17 20 20 e7  20 74 79 70 65 25 3d 30  |.....  . type%=0|
000102c0  20 8c 20 61 24 3d 22 22  0d 08 18 05 cd 0d 08 19  | . a$=""........|
000102d0  07 3d 61 24 0d 08 1a 05  3a 0d 08 1b 13 dd 20 f2  |.=a$....:..... .|
000102e0  64 65 62 75 67 28 74 65  78 74 24 29 0d 08 1c 13  |debug(text$)....|
000102f0  ea 20 66 69 6c 65 24 2c  68 61 6e 64 6c 65 25 0d  |. file$,handle%.|
00010300  08 1d 07 ea 20 85 0d 08  1e 0f ee 20 85 20 ea 20  |.... ...... . . |
00010310  f7 20 85 3a e1 0d 08 1f  3d f4 20 4f 4e 20 45 52  |. .:....=. ON ER|
00010320  52 4f 52 20 4c 4f 43 41  4c 20 52 45 53 54 4f 52  |ROR LOCAL RESTOR|
00010330  45 20 45 52 52 4f 52 3a  4f 53 43 4c 49 22 52 65  |E ERROR:OSCLI"Re|
00010340  70 6f 72 74 45 72 72 6f  72 22 3a 45 4e 44 50 52  |portError":ENDPR|
00010350  4f 43 0d 08 20 5e f4 20  6f 6e 6c 79 20 6c 69 6b  |OC.. ^. only lik|
00010360  65 6c 79 20 65 72 72 6f  72 20 69 73 20 27 63 61  |ely error is 'ca|
00010370  6e 27 74 20 77 72 69 74  65 20 74 6f 20 66 69 6c  |n't write to fil|
00010380  65 27 2c 20 69 2e 65 2e  20 64 6f 6e 27 74 20 77  |e', i.e. don't w|
00010390  6f 72 72 79 20 61 62 6f  75 74 20 63 6c 6f 73 69  |orry about closi|
000103a0  6e 67 20 66 69 6c 65 20  6f 6e 20 65 72 72 6f 72  |ng file on error|
000103b0  0d 08 21 2a 66 69 6c 65  24 3d a4 52 65 61 64 53  |..!*file$=.ReadS|
000103c0  79 73 56 61 72 28 22 49  6e 66 6f 7a 69 70 24 64  |ysVar("Infozip$d|
000103d0  65 62 75 67 66 69 6c 65  22 29 0d 08 22 3c e7 20  |ebugfile").."<. |
000103e0  a4 69 66 74 68 65 72 65  28 66 69 6c 65 24 29 20  |.ifthere(file$) |
000103f0  8c 20 66 69 6c 65 24 3d  22 3e 3e 20 22 2b 66 69  |. file$=">> "+fi|
00010400  6c 65 24 20 8b 20 66 69  6c 65 24 3d 22 3e 20 22  |le$ . file$="> "|
00010410  2b 66 69 6c 65 24 0d 08  23 1b f4 20 68 61 6e 64  |+file$..#.. hand|
00010420  6c 65 25 3d 4f 50 45 4e  55 50 28 66 69 6c 65 24  |le%=OPENUP(file$|
00010430  29 0d 08 24 0a f4 20 45  4c 53 45 0d 08 25 1c f4  |)..$.. ELSE..%..|
00010440  20 68 61 6e 64 6c 65 25  3d 4f 50 45 4e 4f 55 54  | handle%=OPENOUT|
00010450  28 66 69 6c 65 24 29 0d  08 26 0b f4 20 45 4e 44  |(file$)..&.. END|
00010460  49 46 0d 08 27 1d f4 20  50 54 52 23 68 61 6e 64  |IF..'.. PTR#hand|
00010470  6c 65 25 3d 45 58 54 23  68 61 6e 64 6c 65 25 0d  |le%=EXT#handle%.|
00010480  08 28 18 f4 20 42 50 55  54 23 68 61 6e 64 6c 65  |.(.. BPUT#handle|
00010490  25 2c 74 65 78 74 24 0d  08 29 13 f4 20 43 4c 4f  |%,text$..).. CLO|
000104a0  53 45 23 68 61 6e 64 6c  65 25 0d 08 2a 24 ff 20  |SE#handle%..*$. |
000104b0  22 45 63 68 6f 20 22 2b  74 65 78 74 24 2b 22 20  |"Echo "+text$+" |
000104c0  7b 20 22 2b 66 69 6c 65  24 2b 22 20 7d 22 0d 08  |{ "+file$+" }"..|
000104d0  2b 05 e1 0d 08 2c 05 3a  0d ff                    |+....,.:..|
000104da