Home » Archimedes archive » Acorn User » AU 1994-07.adf » !StarInfo_StarInfo » King/!Fighter/Library/wimplib

King/!Fighter/Library/wimplib

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

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

Tape/disk: Home » Archimedes archive » Acorn User » AU 1994-07.adf » !StarInfo_StarInfo
Filename: King/!Fighter/Library/wimplib
Read OK:
File size: 720B bytes
Load address: 0000
Exec address: 0000
File contents
   10REM WimpLib Library
   20REM
   30REM
   40REM                         PROCEDURE  LIBRARY
   50REM                       Version 1.19  (31/3/93)
   60REM                        (C) Alan Senior 1992
   70REM                 Dabs Press : Basic Wimp Programming
   80REM
   90DEFFNfile_size(file$)
  100LOCAL size%,found%
  110SYS"OS_File",17,file$ TO found%,,,,size%
  120IF found%<>1 THEN ERROR 203,"File '"+FNleaf(file$)+"' not found!"
  130=size%
  140DEFFNfile_type(file$)
  150LOCAL temp%,found%
  160SYS"OS_File",17,file$ TO found%,,temp%
  170IF found%<>1 THEN ERROR 203,"File "+FNleaf(file$)+", not found!"
  180IF(temp%>>>20)=&FFFTHEN=(temp%>>>8)AND&FFF ELSE=0
  190DEFPROCinitiate_save(window%,icon%,x%,y%,file$,start%,size%,type%)
  200mem_area_start%=start%
  210mem_data_size%=size%
  220mem_data_ptr%=start%
  230blk%!0=256
  240blk%!12=0:
  250blk%!16=1:
  260blk%!20=window%
  270blk%!24=icon%
  280blk%!28=x%
  290blk%!32=y%
  300blk%!36=size%
  310blk%!40=type%
  320$(blk%+44)=file$+CHR$0
  330SYS "Wimp_SendMessage",17,blk%,window%,icon% TO destination_task%
  340ENDPROC
  350DEFFNload_data(file_path$,start%,max_size%)
  360LOCAL real_size%
  370real_size%=FNfile_size(file_path$)
  380IF real_size%>max_size% THEN
  390PROCreport_error("File to load is too large!","Data loading error")
  400=0
  410ENDIF
  420SYS"OS_File",16,file_path$,start%
  430=real_size%
  440DEF PROCmessage_file_save
  450ram_transfer%=FALSE
  460IF FNsystem_variable("Wimp$Scrap")<>"" THEN
  470blk%!36=-1
  480$(blk%+44)="<Wimp$Scrap>"+CHR$0
  490blk%!0=64
  500blk%!12=blk%!8:blk%!16=2:SYS "Wimp_SendMessage",17,blk%,blk%!4
  510ELSE
  520PROCreport_error("Wimp$Scrap not found. Run !System or !Scrap","Error")
  530ENDIF
  540ENDPROC
  550DEFFNmessage_load(start%,max_size%)
  560LOCAL file_to_load$,file_size%
  570file_to_load$=FNget_string(blk%+44,255)
  580file_size%=FNload_data(file_to_load$,start%,max_size%)
  590IF file_to_load$="<Wimp$Scrap>" THEN *DELETE "<Wimp$Scrap>"
  600blk%!12=blk%!8:blk%!16=4:SYS "Wimp_SendMessage",17,blk%,blk%!4
  610=file_size%
  620DEF PROCmessage_save_ok(my_address%,max_size%)
  630ram_transfer%=TRUE
  640ram_transmit%=FALSE
  650mem_area_start%=my_address%
  660mem_area_size%=max_size%
  670mem_data_size%=0
  680blk%!20=mem_area_start%
  690blk%!24=ram_block_size%
  700blk%!12=blk%!8
  710blk%!16=6
  720SYS"Wimp_SendMessage",17,blk%,blk%!4
  730ENDPROC
  740DEFPROCmessage_save_reply
  750blk%!12=blk%!8:blk%!16=3:SYS "Wimp_SendMessage",17,blk%,blk%!4
  760ENDPROC
  770DEFPROCram_transfer_reply
  780LOCAL buf_size%,data_size%
  790buf_size%=blk%!24
  800SYS"Wimp_TransferBlock",this_task%,mem_data_ptr%,blk%!4,blk%!20,buf_size%
  810data_size%=mem_area_start%+mem_data_size%-mem_data_ptr%
  820IF data_size%>buf_size% THEN data_size%=buf_size% ELSE PROCmenu_close
  830mem_data_ptr%+=data_size%
  840blk%!12=blk%!8:blk%!16=7:blk%!24=data_size%
  850SYS "Wimp_SendMessage",17,blk%,blk%!4
  860ENDPROC
  870DEFPROCram_transmit
  880ram_transmit%=TRUE
  890mem_data_size%+=blk%!24
  900IF blk%!24=ram_block_size% THEN
  910IF mem_data_size%+ram_block_size%>mem_area_size% THEN
  920PROCreport_error("Insufficient room for data!","RAM transfer error")
  930mem_data_size%=0
  940ELSE
  950blk%!20+=ram_block_size%
  960blk%!12=blk%!8:blk%!16=6
  970SYS "Wimp_SendMessage",18,blk%,blk%!4
  980ENDIF
  990ELSE
 1000ENDIF
 1010ENDPROC
 1020DEFPROCsave_data(file_name$,file_type%,start%,length%)
 1030SYS"OS_File",10,file_name$,file_type%,,start%,start%+length%
 1040ENDPROC
 1050DEFFNadd_icon(type$,text$,window%,x%,y%,sl%,esg_sp%,border%)
 1060LOCAL icon%,text_space%,name_space%,val_space%,w%,h%,mode%,xs%,ys%,sel%
 1070sel%=sl%:
 1080IF sl%<LENtext$ sl%=LENtext$
 1090IF sl%<LENtype$ sl%=LENtype$
 1100DIM text_space% sl%
 1110temp_blk%!0=window%
 1120temp_blk%!4=x%
 1130temp_blk%!8=y%-48
 1140temp_blk%!12=x%+16+16*LENtext$
 1150temp_blk%!16=y%
 1160$text_space%=text$
 1170temp_blk%!20=&17000139
 1180temp_blk%!24=text_space%
 1190temp_blk%!28=-1
 1200temp_blk%!32=LENtext$
 1210CASE LEFT$(type$,5) OF
 1220WHEN "file_"
 1230SYS"Wimp_SpriteOp",&28,,type$+CHR$(0) TO ,,,w%,h%,,mode%
 1240SYS"OS_ReadModeVariable",mode%,4 TO ,,xs%
 1250SYS"OS_ReadModeVariable",mode%,5 TO ,,ys%
 1260h%=h%<<ys%
 1270w%=w%<<xs%
 1280IF text$="" THEN
 1290temp_blk%!8=y%-h%
 1300temp_blk%!12=x%+w%
 1310temp_blk%!20=&1700613A
 1320temp_blk%!28=1
 1330temp_blk%!32=LENtype$
 1340$text_space%=type$
 1350ELSE
 1360temp_blk%!8=y%-h%-(10<<ys%)
 1370sl%=(8<<xs%)*LENtext$
 1380IF sl%>w% w%=sl%
 1390temp_blk%!12=x%+w%
 1400temp_blk%!20=&1700612B
 1410DIM name_space% (2+LENtype$)
 1420$name_space%="s"+type$
 1430temp_blk%!28=name_space%
 1440ENDIF
 1450WHEN "sprit"
 1460SYS"OS_SpriteOp",&128,esg_sp%,text$+CHR$(0) TO ,,,w%,h%,,mode%
 1470SYS"OS_ReadModeVariable",mode%,4 TO ,,xs%
 1480SYS"OS_ReadModeVariable",mode%,5 TO ,,ys%
 1490h%=h%<<ys%
 1500w%=w%<<xs%
 1510temp_blk%!8=y%-h%
 1520temp_blk%!12=x%+w%
 1530temp_blk%!20=&1700313A
 1540temp_blk%!28=esg_sp%
 1550temp_blk%!32=LENtext$
 1560$text_space%=text$
 1570WHEN "label"
 1580WHEN "actio"
 1590temp_blk%!20=&C71F913D:
 1600WHEN "repor"
 1610temp_blk%!20=&0700313D:
 1620WHEN "optio"
 1630temp_blk%!8=y%-52
 1640temp_blk%!12=x%+40+16+16*LENtext$
 1650temp_blk%!20=&1700B133
 1660IF sel% temp_blk%!20=&17303133:
 1670DIM val_space% (2+LEN"soptoff,opton"):
 1680$val_space%="soptoff,opton"
 1690temp_blk%!28=val_space%
 1700WHEN "radio"
 1710temp_blk%!8=y%-52
 1720temp_blk%!12=x%+40+16+16*LENtext$
 1730IF (esg_sp%<1) OR (esg_sp%>31) THEN esg_sp%=1
 1740temp_blk%!20=&1700B133 OR (esg_sp%*&10000)
 1750IF sel% temp_blk%!20=&1720B133 OR (esg_sp%*&10000):
 1760DIM text_space% (2+LEN"sradiooff,radioon"):
 1770$text_space%="sradiooff,radioon"
 1780temp_blk%!28=text_space%
 1790WHEN "write"
 1800temp_blk%!12=x%+16+16*LENtext$
 1810temp_blk%!20=&0700F135
 1820DIM val_space% 16:
 1830$val_space%=""
 1840temp_blk%!28=val_space%
 1850IF sel%<(LENtext$) sel%=LENtext$
 1860temp_blk%!32=sel%+1
 1870ENDCASE
 1880SYS "Wimp_CreateIcon",,temp_blk% TO icon%
 1890IF border%>0 PROCborder_icon(window%,icon%)
 1900=icon%
 1910DEFFNadd_icon_block(window_handle%,minx%,miny%,maxx%,maxy%,colour%)
 1920LOCAL icon%
 1930temp_blk%!0=window_handle%
 1940IF minx%>maxx% SWAP minx%,maxx%
 1950IF miny%>maxy% SWAP miny%,maxy%
 1960IF minx%=maxx% maxx%+=1
 1970IF miny%=maxy% maxy%+=1
 1980temp_blk%!4=minx%
 1990temp_blk%!8=miny%
 2000temp_blk%!12=maxx%
 2010temp_blk%!16=maxy%
 2020temp_blk%!20=32+(colour%<<28)
 2030SYS "Wimp_CreateIcon",,temp_blk% TO icon%
 2040=icon%
 2050DEFPROCborder_icon(window_handle%,icon_handle%)
 2060LOCAL icon%,minx%,miny%,maxx%,maxy%,flag%,tl%,br%
 2070temp_blk%!0=window_handle%
 2080temp_blk%!4=icon_handle%
 2090SYS"Wimp_GetIconState",,temp_blk%
 2100minx%=temp_blk%!8
 2110miny%=temp_blk%!12
 2120maxx%=temp_blk%!16
 2130maxy%=temp_blk%!20
 2140flag%=temp_blk%!24
 2150tl%=0:
 2160br%=4:
 2170IF (flag% AND 4)=4 minx%-=4:maxx%+=4:miny%-=4:maxy%+=4:tl%=4:br%=0
 2180icon%=FNadd_icon_block(window_handle%,maxx%,miny%-4,maxx%+4,maxy%+4,br%)
 2190icon%=FNadd_icon_block(window_handle%,minx%-4,maxy%,maxx%+2,maxy%+4,tl%)
 2200icon%=FNadd_icon_block(window_handle%,minx%-4,miny%-4,minx%,maxy%,tl%)
 2210icon%=FNadd_icon_block(window_handle%,minx%-2,miny%-4,maxx%+2,miny%,br%)
 2220ENDPROC
 2230DEFPROCdelete_icon(window_handle%,icon_handle%)
 2240LOCAL minx%,miny%,maxx%,maxy%
 2250temp_blk%!0=window_handle%
 2260temp_blk%!4=icon_handle%
 2270SYS"Wimp_GetIconState",,temp_blk%
 2280minx%=temp_blk%!8
 2290miny%=temp_blk%!12
 2300maxx%=temp_blk%!16
 2310maxy%=temp_blk%!20
 2320SYS"Wimp_DeleteIcon",,temp_blk%
 2330SYS"Wimp_ForceRedraw",window_handle%,minx%,miny%,maxx%,maxy%
 2340ENDPROC
 2350DEFPROCdrag_box(window_handle%,icon_handle%)
 2360LOCAL x%,y%
 2370temp_blk%!0=window_handle%
 2380SYS"Wimp_GetWindowState",,temp_blk%
 2390x%=temp_blk%!4-temp_blk%!20
 2400y%=temp_blk%!16-temp_blk%!24
 2410temp_blk%!4=icon_handle%
 2420SYS"Wimp_GetIconState",,temp_blk%
 2430IF (temp_blk%!24 AND &B000)=&B000 ENDPROC
 2440IF (temp_blk%!24 AND &800000)=&800000 ENDPROC
 2450temp_blk%!4=5
 2460temp_blk%!8+=x%
 2470temp_blk%!12+=y%
 2480temp_blk%!16+=x%
 2490temp_blk%!20+=y%
 2500temp_blk%!24=-1
 2510temp_blk%!28=-1
 2520temp_blk%!32=&7FFFFFFF
 2530temp_blk%!36=&7FFFFFFF
 2540SYS"Wimp_DragBox",,temp_blk%
 2550ENDPROC
 2560DEFFNget_icon_text(window_handle%,icon_handle%)
 2570temp_blk%!0=window_handle%
 2580temp_blk%!4=icon_handle%
 2590SYS"Wimp_GetIconState",,temp_blk%
 2600IF (temp_blk%!24 AND &101)<>&101 THEN
 2610ERROR 202,"Icon "+STR$icon%+" not indirected!"
 2620=""
 2630ENDIF
 2640=$temp_blk%!28
 2650DEFPROCicon_bg_colour(window_handle%,icon_handle%,colour%)
 2660IF colour%<0 OR colour%>15 ENDPROC
 2670temp_blk%!0=window_handle%
 2680temp_blk%!4=icon_handle%
 2690SYS"Wimp_GetIconState",,temp_blk%
 2700IF (temp_blk%!24 AND 1<<6) THEN ENDPROC:
 2710temp_blk%!12=&F0000000:
 2720temp_blk%!8=colour%<<28:SYS"Wimp_SetIconState",,temp_blk%
 2730ENDPROC
 2740DEFPROCicon_fg_colour(window_handle%,icon_handle%,colour%)
 2750IF colour%<0 OR colour%>15 ENDPROC
 2760temp_blk%!0=window_handle%
 2770temp_blk%!4=icon_handle%
 2780SYS"Wimp_GetIconState",,temp_blk%
 2790IF (temp_blk%!24 AND 1<<6) THEN ENDPROC:
 2800temp_blk%!12=&F000000:
 2810temp_blk%!8=colour%<<24:SYS"Wimp_SetIconState",,temp_blk%
 2820ENDPROC
 2830DEFFNicon_selected(window_handle%,icon_handle%)
 2840temp_blk%!0=window_handle%
 2850temp_blk%!4=icon_handle%
 2860SYS"Wimp_GetIconState",,temp_blk%
 2870IF (temp_blk%!24 AND 1<<21) THEN =TRUE ELSE =FALSE
 2880DEFPROCicon_validation(window_handle%,icon_handle%,type$)
 2890temp_blk%!0=window_handle%
 2900temp_blk%!4=icon_handle%
 2910SYS"Wimp_GetIconState",,temp_blk%
 2920IF (temp_blk%!24 AND &E101)<>&E101 THEN
 2930ERROR 202,"Icon "+STR$icon_handle%+" not writable and not indirected!"
 2940ENDPROC
 2950ENDIF
 2960CASE type$ OF
 2970WHEN "number"
 2980$temp_blk%!32="A0-9."
 2990WHEN "file"
 3000$temp_blk%!32="A~ $&@\\^:.#*|"+CHR$34
 3010ENDCASE
 3020ENDPROC
 3030DEFPROCplace_caret(window_handle%,icon_handle%,position%)
 3040temp_blk%!0=window_handle%
 3050temp_blk%!4=icon_handle%
 3060SYS"Wimp_GetIconState",,temp_blk%
 3070IF (temp_blk%!24 AND &E101)<>&E101 THEN
 3080ERROR 202,"Icon "+STR$icon_handle%+" not writable and not indirected!"
 3090ENDPROC
 3100ENDIF
 3110text$=$temp_blk%!28
 3120IF position%>LENtext$ position%=LENtext$
 3130SYS"Wimp_SetCaretPosition",window_handle%,icon_handle%,0,0,-1,position%
 3140ENDPROC
 3150DEFPROCput_icon_sprite(window_handle%,icon_handle%,text$)
 3160temp_blk%!0=window_handle%
 3170temp_blk%!4=icon_handle%
 3180SYS"Wimp_GetIconState",,temp_blk%
 3190CASE (temp_blk%!24 AND &103) OF
 3200WHEN &002,&003
 3210$temp_blk%!28=text$
 3220WHEN &102
 3230IF temp_blk%!36>0 $temp_blk%!28=text$:$temp_blk%!36=LENtext$
 3240WHEN &103
 3250$temp_blk%!32="S"+text$
 3260OTHERWISE ERROR 202,"No sprite name in icon "+STR$icon_handle%:ENDPROC
 3270ENDCASE
 3280temp_blk%!8=0
 3290temp_blk%!12=0
 3300SYS"Wimp_SetIconState",,temp_blk%
 3310ENDPROC
 3320DEFPROCput_icon_text(window_handle%,icon_handle%,text$)
 3330temp_blk%!0=window_handle%
 3340temp_blk%!4=icon_handle%
 3350SYS"Wimp_GetIconState",,temp_blk%
 3360IF (temp_blk%!24 AND &101)<>&101 THEN
 3370ERROR 202,"Icon "+STR$icon_handle%+" not indirected!"
 3380ENDPROC
 3390ENDIF
 3400text$=LEFT$(text$,temp_blk%!36-1)
 3410$temp_blk%!28=text$
 3420temp_blk%!8=0
 3430temp_blk%!12=0
 3440SYS"Wimp_SetIconState",,temp_blk%
 3450ENDPROC
 3460DEFPROCselect_icon(window_handle%,icon_handle%,select%)
 3470temp_blk%!0=window_handle%
 3480temp_blk%!4=icon_handle%
 3490temp_blk%!12=1<<21:
 3500IF select% temp_blk%!8=1<<21 ELSE temp_blk%!8=0:
 3510SYS"Wimp_SetIconState",,temp_blk%
 3520ENDPROC
 3530DEFPROCshade_icon(window_handle%,icon_handle%,shade%)
 3540temp_blk%!0=window_handle%
 3550temp_blk%!4=icon_handle%
 3560temp_blk%!12=1<<22:
 3570IF shade% temp_blk%!8=1<<22 ELSE temp_blk%!8=0:
 3580SYS"Wimp_SetIconState",,temp_blk%
 3590ENDPROC
 3600DEFPROCupdate_icon(window_handle%,icon_handle%)
 3610temp_blk%!0=window_handle%
 3620temp_blk%!4=icon_handle%
 3630temp_blk%!8=0
 3640temp_blk%!12=0
 3650SYS"Wimp_SetIconState",,temp_blk%
 3660ENDPROC
 3670DEFFNput_icon_on_bar(sprite_name$,side$)
 3680LOCAL handle%
 3690IF side$="RIGHT" !temp_blk%=-1 ELSE !temp_blk%=-2
 3700temp_blk%!4=0
 3710temp_blk%!8=0
 3720temp_blk%!12=68
 3730temp_blk%!16=68
 3740temp_blk%!20=&1700202A
 3750$(temp_blk%+24)=sprite_name$
 3760SYS "Wimp_CreateIcon",,temp_blk% TO handle%
 3770=handle%
 3780DEFPROCput_info_text(window_handle%,name$,purpose$,author$,version$)
 3790PROCput_icon_text(window_handle%,1,name$)
 3800PROCput_icon_text(window_handle%,2,purpose$)
 3810PROCput_icon_text(window_handle%,3,author$)
 3820PROCput_icon_text(window_handle%,4,version$)
 3830ENDPROC
 3840DEFFNput_sprite_text_on_bar(sprite_name$,side$,text$)
 3850LOCAL handle%,length%,sprite_name%,text_space%
 3860DIM sprite_name% (LEN(sprite_name$)+3)
 3870DIM text_space% (LEN(text$)+2)
 3880$sprite_name%="S"+sprite_name$
 3890$text_space%=text$
 3900IF side$="RIGHT" !temp_blk%=-1 ELSE !temp_blk%=-2
 3910temp_blk%!4=0
 3920temp_blk%!8=-16
 3930width%=16*LENtext$:IF width%<68 width%=68
 3940temp_blk%!12=width%
 3950temp_blk%!16=88
 3960temp_blk%!20=&1700212B
 3970temp_blk%!24=text_space%
 3980temp_blk%!28=sprite_name%
 3990temp_blk%!32=LEN(text$)
 4000SYS "Wimp_CreateIcon",,temp_blk% TO handle%
 4010=handle%
 4020DEF FNtask_initialise(title$)
 4030LOCAL version%
 4040version%=200
 4050SYS "Wimp_Initialise",version%,&4B534154,title$ TO version%,this_task%
 4060=this_task%
 4070DEFPROCadd_menu_item(line$)
 4080LOCAL menuflag%,iconflag%,param$,sub%,itemtext$,writable%,maxlength%
 4090iconflag%=&7000021:sub%=-1:writable%=FALSE
 4100itemtext$=FNmenu_item_text(line$):maxlength%=LENitemtext$
 4110REPEAT
 4120param$=FNmenu_item_param(line$)
 4130CASE LEFT$(param$,4) OF
 4140WHEN"tick":menuflag%=menuflag%OR1
 4150WHEN"line":menuflag%=menuflag%OR2
 4160WHEN"shad":iconflag%=iconflag%OR&400000
 4170WHEN"subm":sub%=FNmenu_submenu(FNmenuvar(param$))
 4180WHEN"wind":sub%=FNmenu_window(FNmenuvar(param$))
 4190WHEN"icon":iconflag%=FNmenu_iconflag(FNmenuvar(param$))
 4200WHEN"writ":PROCmenu_writable(FNmenuvar(param$))
 4210ENDCASE
 4220UNTIL param$=""
 4230pointer%!0=menuflag%
 4240pointer%!4=sub%
 4250IF LEN(itemtext$)>12 OR writable% THEN
 4260pointer%!8=iconflag% OR &100:
 4270PROCindirected_item(pointer%,writable%,maxlength%)
 4280ELSE
 4290pointer%!8=iconflag%
 4300$(pointer%+12)=LEFT$(itemtext$+CHR$(0),12)
 4310ENDIF
 4320pointer%+=24
 4330ENDPROC
 4340DEFFNbeginmenu(line$)
 4350IF LEFT$(line$,9)="beginmenu" =TRUE
 4360=FALSE
 4370DEFFNdecode_menu(menustart%,listptr%)
 4380LOCAL text_path$
 4390SYS"Wimp_DecodeMenu",,menustart%,listptr%,blk%+256 TO ,,,text_path$
 4400=text_path$
 4410DEFPROCdim_menu_arrays(menucount%,itemcount%,writecount%,windowcount%)
 4420DIM menustart% (menucount%*28)+(itemcount%*24)
 4430DIM menuwidth%(menucount%)
 4440DIM menu%(menucount%)
 4450DIM writable_item%(writecount%)
 4460DIM writable_len%(writecount%)
 4470ENDPROC
 4480DEFFNget_writem(writem%)
 4490LOCAL temp$
 4500IF writem%<1 OR writem%>DIM(writable_item%(),1) THEN
 4510ERROR 201,"writable menu item "+STR$(writem%)+" does not exist!"
 4520ENDIF
 4530writem%=writable_item%(writem%)
 4540temp$="": WHILE ?writem%>31:temp$+=CHR$?writem%:writem%+=1:ENDWHILE
 4550=temp$
 4560DEFPROCgoto_beginmenu
 4570LOCAL temp%,line$
 4580PTR#menufile%=0
 4590REPEAT
 4600temp%=PTR#menufile%
 4610line$=GET$#menufile%
 4620UNTIL FNbeginmenu(line$) OR EOF#menufile%
 4630IFEOF#menufile% ERROR 200,"No 'beginmenu' found in menu file"
 4640PTR#menufile%=temp%
 4650ENDPROC
 4660DEFPROCindirected_item(menu_ptr%,writable%,length%)
 4670LOCAL indir_ptr%
 4680IF writable% THEN
 4690DIM indir_ptr% length%+1
 4700ELSE
 4710DIM indir_ptr% 1+LENitemtext$
 4720ENDIF
 4730menu_ptr%!12=indir_ptr%:
 4740$indir_ptr%=itemtext$+CHR$(0)
 4750IF writable% THEN
 4760writable_item%(writable%)=indir_ptr%
 4770writable_len%(writable%)=length%
 4780indir_ptr%+=length%+1
 4790menu_ptr%!20=length%+1
 4800ELSE
 4810indir_ptr%+=1+LENitemtext$
 4820menu_ptr%!20=1+LENitemtext$:
 4830ENDIF
 4840?indir_ptr%=0
 4850menu_ptr%!16=indir_ptr%:
 4860ENDPROC
 4870DEFFNitem_count(menu_ptr%)
 4880LOCAL count%
 4890count%=1
 4900menu_ptr%+=28
 4910WHILE (!menu_ptr% AND &80)=0:menu_ptr%+=24:count%+=1:ENDWHILE
 4920=count%
 4930DEFPROCload_menus(menufile$)
 4940LOCAL menucount%,header%,line$,pointer%,menustart%
 4950PROCsize_menu_arrays(menufile$)
 4960menufile%=OPENINmenufile$
 4970PROCset_menu_arrays
 4980PROCgoto_beginmenu
 4990menucount%=0:header%=FALSE
 5000REPEAT
 5010line$=GET$#menufile%
 5020IF FNbeginmenu(line$) THEN
 5030IFheader% ERROR 200,"Bad menu file, no items in menu "+STR$(menucount%)
 5040IFmenucount% PROCmark_menu_end(pointer%)
 5050menucount%+=1
 5060line$=GET$#menufile%
 5070PROCmake_menu_header(pointer%,line$,menuwidth%(menucount%)):header%=TRUE
 5080ELSE
 5090PROCadd_menu_item(line$):header%=FALSE
 5100ENDIF
 5110UNTIL EOF#menufile%
 5120PROCmark_menu_end(pointer%)
 5130SYS"XOS_Find",0,menufile%:menufile%=0
 5140IFheader% ERROR 200,"Bad menu file, no items in menu "+STR$(menucount%)
 5150ENDPROC
 5160DEFPROCmake_menu_header(RETURN pointer%,title$,width%)
 5170$pointer%=LEFT$(title$,12)+CHR$(0):
 5180pointer%?12=7:
 5190pointer%?13=2:
 5200pointer%?14=7:
 5210pointer%?15=0:
 5220pointer%!16=width%:
 5230pointer%!20=44:
 5240pointer%!24=0:
 5250pointer%+=28:
 5260ENDPROC
 5270DEFPROCmark_menu_end(pointer%)
 5280!(pointer%-24)=!(pointer%-24) OR &80:
 5290ENDPROC
 5300DEFPROCmenu_close
 5310SYS"Wimp_CreateMenu",,-1
 5320ENDPROC
 5330DEFFNmenu_height(menu_ptr%)
 5340LOCAL itemcount%,linecount%,height%
 5350itemcount%=1
 5360height%=menu_ptr%!20+menu_ptr%!24:
 5370menu_ptr%+=28
 5380WHILE (!menu_ptr% AND &80)=0
 5390itemcount%+=1
 5400IF (!menu_ptr% AND &2) linecount%+=1
 5410menu_ptr%+=24
 5420ENDWHILE
 5430IF (!menu_ptr% AND &2) linecount%+=1:
 5440=itemcount%*height%+linecount%*24
 5450DEFFNmenu_iconflag(var$)
 5460IFvar$="" ERROR 200,"Menu icon flag value missing!"
 5470=EVAL(var$)
 5480DEF FNmenu_info_quit(window_handle%,title$)
 5490LOCAL menu%
 5500DIM menu% 76
 5510$menu%=title$+CHR$13
 5520menu%?12=7:menu%?13=2:menu%?14=7
 5530menu%?15=0:menu%!16=108:menu%!20=44
 5540menu%!24=0
 5550menu%!28=&00:menu%!32=window_handle%
 5560menu%!36=&07000021:$(menu%+40)="Info"+CHR$13
 5570menu%!52=&80:menu%!56=-1
 5580menu%!60=&07000021:$(menu%+64)="Quit"+CHR$13
 5590=menu%
 5600DEFFNmenu_item_param(RETURN item$)
 5610LOCAL param$
 5620IF INSTR(item$,",") THEN
 5630item$=MID$(item$,INSTR(item$,",")+1)
 5640param$=LEFT$(item$,INSTR(item$,",")-1)
 5650ELSE
 5660param$=""
 5670ENDIF
 5680=param$
 5690DEFFNmenu_item_text(item$)
 5700IF INSTR(item$,",") item$=LEFT$(item$,INSTR(item$,",")-1)
 5710=item$
 5720DEFFNmenu_path(ptr%)
 5730LOCAL path$
 5740path$=STR$(!ptr%)
 5750ptr%+=4
 5760WHILE !ptr%<>-1
 5770path$+="."+STR$(!ptr%)
 5780ptr%+=4
 5790ENDWHILE
 5800=path$
 5810DEFFNmenu_quit(title$)
 5820LOCAL menu%
 5830DIM menu% 52
 5840$menu%=title$+CHR$13
 5850menu%?12=7:menu%?13=2:menu%?14=7
 5860menu%?15=0:menu%!16=108:menu%!20=44
 5870menu%!24=0:menu%!28=&80:menu%!32=-1
 5880menu%!36=&07000021:$(menu%+40)="Quit"+CHR$13
 5890=menu%
 5900DEFFNmenu_submenu(var$)
 5910IF VAL(var$)<1 OR VAL(var$)>DIM(menu%(),1) THEN
 5920ERROR 200,"Can't find menu "+var$+", as referred to in:- "+param$
 5930ENDIF
 5940IF VAL(var$)=menucount% THEN
 5950ERROR 200,"An item in menu "+var$+" cannot have menu "+var$+" as a submenu!"
 5960ENDIF
 5970=menu%(VAL(var$))
 5980DEFFNmenuvar(var$)
 5990var$=MID$(var$,INSTR(var$,"(")+1)
 6000var$=LEFT$(var$,INSTR(var$,")")-1)
 6010=var$
 6020DEFFNmenu_window(var$)
 6030LOCAL handle%
 6040LOCAL ERROR
 6050ONERROR ERROR EXT 0,"Menu file error. Window variable "+var$+" not found."
 6060handle%=EVAL(var$)
 6070IF handle%<1 THEN
 6080SYS"XOS_Find",0,menufile%
 6090ERROR:
 6100ENDIF
 6110=handle%
 6120DEFPROCmenu_writable(var$)
 6130maxlength%=0
 6140IF INSTR(var$,":") THEN
 6150maxlength%=VAL(MID$(var$,INSTR(var$,":")+1))
 6160IFLEN(itemtext$)>maxlength% maxlength%=LENitemtext$
 6170ELSE
 6180maxlength%=LENitemtext$
 6190ENDIF
 6200menuflag%=menuflag%OR4:writable%=VAL(var$)
 6210ENDPROC
 6220DEFPROCput_writem(writem%,text$)
 6230IF writem%<1 OR writem%>DIM(writable_item%(),1) THEN
 6240ERROR 201,"writable menu item "+STR$(writem%)+" does not exist!"
 6250ENDIF
 6260IF LENtext$>writable_len%(writem%) THEN
 6270IF LENtext$>100 text$=LEFT$(text$,100)+"......"
 6280ERROR 201,"Text '"+text$+"' too long for writable item "+STR$writem%+"!"
 6290ENDIF
 6300$writable_item%(writem%)=text$
 6310ENDPROC
 6320DEFPROCset_menu_arrays
 6330LOCAL itemcount%,line$,width%
 6340menucount%=0:pointer%=menustart%
 6350PROCgoto_beginmenu
 6360REPEAT
 6370line$=GET$#menufile%
 6380IF FNbeginmenu(line$) THEN
 6390menu%(menucount%+1)=menustart%+(menucount%*28)+(itemcount%*24)
 6400line$=GET$#menufile%:
 6410menucount%+=1
 6420line$=LEFT$(line$,12)
 6430menuwidth%(menucount%)=12+16*LENline$
 6440ELSE
 6450itemcount%+=1
 6460IF INSTR(line$,",") THEN
 6470width%=12+16*LEN(LEFT$(line$,INSTR(line$,",")-1))
 6480ELSE
 6490width%=12+16*LENline$
 6500ENDIF
 6510IF width%>menuwidth%(menucount%) menuwidth%(menucount%)=width%
 6520ENDIF
 6530UNTIL EOF#menufile%
 6540ENDPROC
 6550DEFPROCshade(menu%,item%,shade%)
 6560LOCAL flagaddress%
 6570IFmenu%<1 OR menu%>DIM(menu%(),1) THEN
 6580ERROR 201,"Item shade error. Out of range menu number!"
 6590ENDIF
 6600IF item%<0 OR item%>FNitem_count(menu%(menu%)) THEN
 6610ERROR 201,"Item shade error. Out of range menu item number!"
 6620ENDIF
 6630flagaddress%=menu%(menu%)+28+(24*item%)+8
 6640IF shade%=TRUE shade%=&400000 ELSE shade%=0
 6650!flagaddress%=(!flagaddress% AND &FFBFFFFF) OR shade%
 6660ENDPROC
 6670DEFPROCsize_menu_arrays(menufile$)
 6680LOCAL menucount%,itemcount%,writecount%,windowcount%,line$
 6690menufile%=OPENINmenufile$
 6700REPEAT
 6710line$=GET$#menufile%
 6720IF FNbeginmenu(line$) THEN
 6730menucount%+=1:line$=GET$#menufile%:
 6740ELSE
 6750IF INSTR(line$,",writ") writecount%+=1
 6760IF INSTR(line$,",wind") windowcount%+=1
 6770itemcount%+=1
 6780ENDIF
 6790UNTIL EOF#menufile%
 6800SYS"XOS_Find",0,menufile%:menufile%=0
 6810PROCdim_menu_arrays(menucount%,itemcount%,writecount%,windowcount%)
 6820ENDPROC
 6830DEFPROCtick(menu%,item%,tick%)
 6840LOCAL flagaddress%
 6850IFmenu%<1 OR menu%>DIM(menu%(),1) THEN
 6860ERROR 201,"Item tick error. Out of range menu number!"
 6870ENDIF
 6880IF item%<0 OR item%>FNitem_count(menu%(menu%)) THEN
 6890ERROR 201,"Item tick error. Out of range item number!"
 6900ENDIF
 6910flagaddress%=menu%(menu%)+28+(24*item%)
 6920IF tick%=TRUE tick%=1 ELSE tick%=0
 6930!flagaddress%=(!flagaddress% AND &FFFFFFFE) OR tick%
 6940ENDPROC
 6950DEFFNget_string(pointer%,length%)
 6960LOCAL temp$
 6970IF length%=0 length%=255
 6980FOR pointer%=pointer% TO pointer%+length%-1
 6990IF ?pointer%<32 THEN
 7000=temp$
 7010ELSE
 7020temp$+=CHR$(?pointer%)
 7030ENDIF
 7040NEXT
 7050=temp$
 7060DEFFNhex(number%)
 7070LOCAL hex$
 7080SYS"OS_ConvertHex8",number%,"0000000000",10 TO hex$
 7090WHILE LEFT$(hex$,1)="0":hex$=MID$(hex$,2):ENDWHILE
 7100IF hex$="" hex$="0"
 7110=hex$
 7120DEFFNleaf(path$)
 7130WHILE INSTR(path$,"."):path$=MID$(path$,INSTR(path$,".")+1):ENDWHILE
 7140=path$
 7150DEFFNreason(event%)
 7160LOCAL reason$
 7170CASE event% OF
 7180WHEN 0:reason$="Null reason code"
 7190WHEN 1:reason$="Redraw window request"
 7200WHEN 2:reason$="Open window request"
 7210WHEN 3:reason$="Close window request"
 7220WHEN 4:reason$="Pointer leaving window"
 7230WHEN 5:reason$="Pointer entering window"
 7240WHEN 6:reason$="Mouse button pressed"
 7250WHEN 7:reason$="Drag has been completed"
 7260WHEN 8:reason$="Key pressed"
 7270WHEN 9:reason$="Menu selection"
 7280WHEN10:reason$="Scroll request"
 7290WHEN11:reason$="Loose caret"
 7300WHEN12:reason$="Gain caret"
 7310WHEN17:reason$="User message"
 7320WHEN18:reason$="Message recorded"
 7330WHEN19:reason$="User message acknowledge"
 7340ENDCASE
 7350=reason$
 7360DEFPROCreport_error(message$,title$)
 7370message$=CHR$0+CHR$0+CHR$0+CHR$0+message$+CHR$0
 7380SYS "Wimp_ReportError",message$,18,title$
 7390ENDPROC
 7400DEFPROCshow_value(line%,variable$)
 7410line%=line%MOD4
 7420IF INSTR(variable$,"$") THEN
 7430variable$+="="+EVAL(variable$)
 7440ELSE
 7450IF INSTR(variable$," ") THEN
 7460ELSE
 7470variable$+="="+STR$(EVAL(variable$))
 7480ENDIF
 7490ENDIF
 7500PROCput_icon_text(show_value%,line%,LEFT$(variable$,35))
 7510PROCopen_window(show_value%)
 7520ENDPROC
 7530DEFFNsystem_variable(sys_var$)
 7540LOCAL length%
 7550SYS"XOS_ReadVarVal",sys_var$+CHR$(0),temp_blk%,-1 TO ,,length%
 7560IF length%=0 ERROR EXT 0,"System variable '"+sys_var$+"' not found!"
 7570SYS"XOS_ReadVarVal",sys_var$+CHR$(0),temp_blk%,255,,3 TO ,,length%
 7580?(temp_blk%+length%)=13
 7590=$temp_blk%
 7600DEFPROCchange_pointer(sprites%,sprite_name$,x%,y%)
 7610SYS"OS_SpriteOp",&124,sprites%,sprite_name$,2,x%,y%
 7620temp_blk%?0=1
 7630temp_blk%?1=25
 7640temp_blk%?2=&FF
 7650temp_blk%?3=&BB
 7660temp_blk%?4=&BB
 7670SYS"OS_Word",12,temp_blk%
 7680temp_blk%?0=2
 7690temp_blk%?2=&55
 7700temp_blk%?3=&55
 7710temp_blk%?4=&55
 7720SYS"OS_Word",12,temp_blk%
 7730*POINTER 2
 7740ENDPROC
 7750DEFPROCrestore_pointer
 7760*POINTER 1
 7770ENDPROC
 7780DEFFNget_sprite_name(window_handle%,icon_handle%)
 7790LOCAL temp$
 7800temp_blk%!0=window_handle%
 7810temp_blk%!4=icon_handle%
 7820SYS"Wimp_GetIconState",,temp_blk%
 7830CASE (temp_blk%!24 AND &103) OF
 7840WHEN &002,&003
 7850=FNget_string(temp_blk%!28,256)
 7860WHEN &102
 7870IF temp_blk%!36>0 THEN
 7880=FNget_string(temp_blk%!28,temp_blk%!36)
 7890ELSE
 7900ERROR 202,"No sprite name in icon "+STR$icon_handle%
 7910=""
 7920ENDIF
 7930WHEN &103
 7940=MID$(FNget_string(temp_blk%!32,temp_blk%!36),2)
 7950OTHERWISE
 7960ERROR 202,"No sprite name in icon "+STR$icon_handle%
 7970=""
 7980ENDCASE
 7990=temp$
 8000DEFFNicon_sprite_type(window_handle%,icon_handle%)
 8010=EVAL("&"+RIGHT$(FNget_sprite_name(window_handle%,icon_handle%),3))
 8020DEFFNload_sprites(file$)
 8030LOCAL sprites%,size%
 8040size%=FNfile_size(file$)+16
 8050DIM sprites% size%
 8060sprites%!0=size%
 8070sprites%!8=16
 8080SYS"OS_SpriteOp",&10A,sprites%,file$:
 8090=sprites%
 8100DEFFNnew_template(template_file$,window_name$,RETURN memfree%,memend%)
 8110LOCAL window_handle%
 8120SYS"Wimp_OpenTemplate",,template_file$
 8130window_handle%=FNtemplate(window_name$,memfree%,memend%)
 8140SYS "Wimp_CloseTemplate"
 8150=window_handle%
 8160DEFFNtemplate(window_name$,RETURN ptr%,end%)
 8170LOCAL found%,window_handle%
 8180SYS"Wimp_LoadTemplate",,blk%,ptr%,end%,-1,window_name$,0 TO ,,ptr%,,,,found%
 8190IF found% THEN
 8200SYS "Wimp_CreateWindow",,blk% TO window_handle%
 8210ELSE
 8220ERROR EXT 0,"Window "+window_name$+" not found in template file!"
 8230window_handle%=0
 8240ENDIF
 8250=window_handle%
 8260DEFFNadd_icon(type$,text$,window_handle%,x%,y%,sl%,esg_sp%,border%)
 8270DEFPROCchange_extent(window_handle%,x%,y%)
 8280LOCAL min_x%,min_y%,max_x%,max_y%,max_vis_x%,min_vis_y%
 8290!temp_blk%=window_handle%
 8300SYS "Wimp_GetWindowInfo",,temp_blk%
 8310min_x%=temp_blk%!44
 8320min_y%=y%-y%MOD4
 8330max_x%=x%-x%MOD2
 8340max_y%=temp_blk%!56
 8350max_vis_x%=temp_blk%!20+temp_blk%!12-temp_blk%!4
 8360min_vis_y%=temp_blk%!24-temp_blk%!16+temp_blk%!8
 8370IF min_y%>min_vis_y% min_y%=min_vis_y%
 8380IF max_vis_x%>max_x% max_x%=max_vis_x%
 8390temp_blk%!0=min_x%
 8400temp_blk%!4=min_y%
 8410temp_blk%!8=max_x%
 8420temp_blk%!12=max_y%
 8430SYS"Wimp_SetExtent",window_handle%,temp_blk%
 8440ENDPROC
 8450DEFPROCclear_print_window
 8460LOCAL min_x%,min_y%,max_x%,max_y%,more%
 8470print_line$()=""
 8480!temp_blk%=print_window%
 8490SYS "Wimp_GetWindowInfo",,temp_blk%
 8500min_x%=temp_blk%!44
 8510min_y%=temp_blk%!48
 8520max_x%=temp_blk%!52
 8530max_y%=temp_blk%!56
 8540temp_blk%!4=min_x%
 8550temp_blk%!8=min_y%
 8560temp_blk%!12=max_x%
 8570temp_blk%!16=max_y%
 8580SYS"Wimp_UpdateWindow",,temp_blk% TO more%
 8590WHILE more%
 8600CLS
 8610SYS"Wimp_GetRectangle",,temp_blk% TO more%
 8620ENDWHILE
 8630ENDPROC
 8640DEF PROCclose_window(window_handle%)
 8650!temp_blk%=window_handle%
 8660SYS "Wimp_CloseWindow",,temp_blk%
 8670ENDPROC
 8680DEFFNcreate_info_window
 8690LOCAL icon%
 8700info%=FNcreate_window("About this program",&84000012,660,212,0,660,999,999)
 8710icon%=  FNadd_icon("label","   Name:",info%,8,-4,0,0,0)
 8720icon%=  FNadd_icon("report",STRING$(30," "),info%,156,-4,0,0,0)
 8730icon%=  FNadd_icon("report",STRING$(30," "),info%,156,-56,0,0,0)
 8740icon%=  FNadd_icon("report",STRING$(30," "),info%,156,-108,0,0,0)
 8750icon%=  FNadd_icon("report",STRING$(30," "),info%,156,-160,0,0,0)
 8760icon%=  FNadd_icon("label","Purpose:",info%,8,-56,0,0,0)
 8770icon%=  FNadd_icon("label"," Author:",info%,8,-108,0,0,0)
 8780icon%=  FNadd_icon("label","Version:",info%,8,-160,0,0,0)
 8790=info%
 8800DEFFNcreate_print_window(title$,w%,h%)
 8810DIM print_line$(h%-1)
 8820print_top%=0
 8830print_width%=w%
 8840w%=w%*16+8
 8850h%=h%*32
 8860print_window%=FNcreate_window(title$,&FF000002,w%,h%,100,w%,200,h%)
 8870=print_window%
 8880DEFPROCcreate_show_value
 8890LOCAL icon%
 8900show_value%=FNcreate_window("Show Variable",0,608,212,300,999,350,999)
 8910icon%=  FNadd_icon("report",STRING$(36," "),show_value%,8,-4,0,0,0)
 8920icon%=  FNadd_icon("report",STRING$(36," "),show_value%,8,-56,0,0,0)
 8930icon%=  FNadd_icon("report",STRING$(36," "),show_value%,8,-108,0,0,0)
 8940icon%=  FNadd_icon("report",STRING$(36," "),show_value%,8,-160,0,0,0)
 8950ENDPROC
 8960DEFFNcreate_window(title$,wf%,x_size%,y_size%,left%,width%,bottom%,height%)
 8970LOCAL title_space%,handle%
 8980DIM title_space% (1+LENtitle$)
 8990temp_blk%!0=left%
 9000temp_blk%!4=bottom%
 9010temp_blk%!8=left%+width%
 9020temp_blk%!12=bottom%+height%
 9030temp_blk%!16=0:
 9040temp_blk%!20=0:
 9050temp_blk%!24=-1:
 9060IF wf%=0 wf%=&FF000012:
 9070temp_blk%!28=wf%
 9080temp_blk%?32=7:
 9090temp_blk%?33=2:
 9100temp_blk%?34=7:
 9110temp_blk%?35=1:
 9120temp_blk%?36=3:
 9130temp_blk%?37=1:
 9140temp_blk%?38=12:
 9150temp_blk%?39=0:
 9160temp_blk%!40=0:
 9170temp_blk%!44=-y_size%:
 9180temp_blk%!48=x_size%:
 9190temp_blk%!52=0:
 9200temp_blk%!56=&119:
 9210temp_blk%!60=&6000:
 9220temp_blk%!64=1:
 9230temp_blk%?68=0:
 9240temp_blk%?69=0:
 9250temp_blk%?70=0:
 9260temp_blk%?71=0:
 9270$title_space%=title$
 9280temp_blk%!72=title_space%:
 9290temp_blk%!76=-1:
 9300temp_blk%!80=LEN(title$)+1:
 9310temp_blk%!84=0:
 9320SYS"Wimp_CreateWindow",,temp_blk% TO handle%
 9330=handle%
 9340DEF PROCdelete_window(window_handle%)
 9350!temp_blk%=window_handle%
 9360SYS "Wimp_DeleteWindow",,temp_blk%
 9370ENDPROC
 9380DEF PROCopen_window(window_handle%)
 9390!temp_blk%=window_handle%
 9400SYS "Wimp_GetWindowState",,temp_blk%
 9410SYS "Wimp_OpenWindow",,temp_blk%
 9420ENDPROC
 9430DEFPROCprint_line(line%,text$)
 9440LOCAL max_lines%,min_x%,min_y%,max_x%,max_y%,line_top%,line_bot%,x%,y%,more%
 9450max_lines%=DIM(print_line$(),1)
 9460IF line%>max_lines% THEN
 9470ERROR 204,"Out of range line number in 'PROCprint_line'!"
 9480ENDPROC
 9490ENDIF
 9500!temp_blk%=print_window%
 9510SYS "Wimp_GetWindowInfo",,temp_blk%
 9520min_x%=temp_blk%!44
 9530min_y%=temp_blk%!48
 9540max_x%=temp_blk%!52
 9550max_y%=temp_blk%!56
 9560line_top%=max_y%-line%*32
 9570line_bot%=line_top%-32
 9580line%=(line%+print_top%)MOD(max_lines%+1)
 9590print_line$(line%)=LEFT$(text$,print_width%)
 9600x%=temp_blk%!4-temp_blk%!20+4
 9610y%=temp_blk%!16-temp_blk%!24+line_top%-4
 9620temp_blk%!0=print_window%
 9630temp_blk%!4=min_x%
 9640temp_blk%!8=line_bot%
 9650temp_blk%!12=max_x%
 9660temp_blk%!16=line_top%
 9670SYS"Wimp_UpdateWindow",,temp_blk% TO more%
 9680WHILE more%
 9690GCOL 7:CLS
 9700MOVE x%,y%
 9710PRINT;print_line$(line%);
 9720SYS"Wimp_GetRectangle",,temp_blk% TO more%
 9730ENDWHILE
 9740ENDPROC
 9750DEFPROCprint_scroll(text$)
 9760LOCAL max_lines%,min_x%,min_y%,max_x%,max_y%,line_top%,line_bot%,x%,y%,more%
 9770max_lines%=DIM(print_line$(),1)
 9780print_line$(print_top%)=LEFT$(text$,print_width%)
 9790min_x%=0
 9800min_y%=-(1+max_lines%)*32
 9810max_x%=print_width%*16+8
 9820max_y%=0
 9830SYS"Wimp_BlockCopy",print_window%,min_x%,min_y%,max_x%,max_y%,min_x%,min_y%+32
 9840line_top%=min_y%+32
 9850line_bot%=min_y%
 9860!temp_blk%=print_window%
 9870SYS "Wimp_GetWindowInfo",,temp_blk%
 9880x%=temp_blk%!4-temp_blk%!20+4
 9890y%=temp_blk%!16-temp_blk%!24+line_top%-4
 9900temp_blk%!0=print_window%
 9910temp_blk%!4=min_x%
 9920temp_blk%!8=line_bot%
 9930temp_blk%!12=max_x%
 9940temp_blk%!16=line_top%
 9950SYS"Wimp_UpdateWindow",,temp_blk% TO more%
 9960WHILE more%
 9970GCOL 7:CLS
 9980MOVE x%,y%
 9990PRINT;print_line$(print_top%);
10000SYS"Wimp_GetRectangle",,temp_blk% TO more%
10010ENDWHILE
10020print_top%=(print_top%+1)MOD(1+max_lines%)
10030ENDPROC
10040DEFPROCredraw_print_window(blk%)
10050LOCAL max_lines%,topline%,botline%,x%,y%
10060max_lines%=DIM(print_line$(),1)
10070topline%=-(blk%!24+4-blk%!16+blk%!40)DIV32
10080botline%=-(blk%!24+4-blk%!16+blk%!32)DIV32
10090IF botline%>max_lines% botline%=max_lines%
10100IF topline%<=max_lines% THEN
10110x%=blk%!4-blk%!20+4
10120y%=blk%!40-(blk%!24+4-blk%!16+blk%!40)MOD32
10130FOR line%=topline% TO botline%
10140MOVEx%,y%:y%-=32
10150PRINT;print_line$((line%+print_top%)MOD(max_lines%+1))
10160NEXT
10170ENDIF
10180ENDPROC
10190DEFFNwindow_rectangle(window_handle%)
10200LOCAL more%
10210temp_blk%!0=window_handle%:SYS"Wimp_GetRectangle",,temp_blk% TO more%
10220=more%
10230DEFFNwindow_update(window_handle%)
10240LOCAL more%
10250temp_blk%!0=window_handle%
10260temp_blk%!4=&80000000:
10270temp_blk%!8=&80000000:
10280temp_blk%!12=&6FFFFFFF:
10290temp_blk%!16=&6FFFFFFF:
10300SYS"Wimp_UpdateWindow",,temp_blk% TO more%
10310=more%
10320DEFFNwindow_x_origin(window_handle%)
10330temp_blk%!0=window_handle%
10340SYS"Wimp_GetWindowState",,temp_blk%
10350=temp_blk%!4-temp_blk%!20
10360DEFFNwindow_y_origin(window_handle%)
10370temp_blk%!0=window_handle%
10380SYS"Wimp_GetWindowState",,temp_blk%
10390=temp_blk%!16-temp_blk%!24

� WimpLib Library
�
�
(0�                         PROCEDURE  LIBRARY
23�                       Version 1.19  (31/3/93)
<1�                        (C) Alan Senior 1992
F9�                 Dabs Press : Basic Wimp Programming
P�
Zݤfile_size(file$)
d� size%,found%
n*ș"OS_File",17,file$ � found%,,,,size%
x<� found%<>1 � � 203,"File '"+�leaf(file$)+"' not found!"
�
=size%
�ݤfile_type(file$)
�� temp%,found%
�(ș"OS_File",17,file$ � found%,,temp%
�;� found%<>1 � � 203,"File "+�leaf(file$)+", not found!"
�,�(temp%>>>20)=&FFF�=(temp%>>>8)�&FFF �=0
�A��initiate_save(window%,icon%,x%,y%,file$,start%,size%,type%)
�mem_area_start%=start%
�mem_data_size%=size%
�mem_data_ptr%=start%
�blk%!0=256
�blk%!12=0:
�blk%!16=1:
blk%!20=window%
blk%!24=icon%
blk%!28=x%
"blk%!32=y%
,blk%!36=size%
6blk%!40=type%
@$(blk%+44)=file$+�0
JCș "Wimp_SendMessage",17,blk%,window%,icon% � destination_task%
T�
^,ݤload_data(file_path$,start%,max_size%)
h� real_size%
r%real_size%=�file_size(file_path$)
|� real_size%>max_size% �
�D�report_error("File to load is too large!","Data loading error")
�=0
��
�$ș"OS_File",16,file_path$,start%
�=real_size%
�� �message_file_save
�ram_transfer%=�
�*� �system_variable("Wimp$Scrap")<>"" �
�blk%!36=-1
� $(blk%+44)="<Wimp$Scrap>"+�0
�
blk%!0=64
�Ablk%!12=blk%!8:blk%!16=2:ș "Wimp_SendMessage",17,blk%,blk%!4
��
H�report_error("Wimp$Scrap not found. Run !System or !Scrap","Error")
�
�
&$ݤmessage_load(start%,max_size%)
0� file_to_load$,file_size%
:*file_to_load$=�get_string(blk%+44,255)
D9file_size%=�load_data(file_to_load$,start%,max_size%)
N;� file_to_load$="<Wimp$Scrap>" � *DELETE "<Wimp$Scrap>"
XAblk%!12=blk%!8:blk%!16=4:ș "Wimp_SendMessage",17,blk%,blk%!4
b=file_size%
l-� �message_save_ok(my_address%,max_size%)
vram_transfer%=�
�ram_transmit%=�
�mem_area_start%=my_address%
�mem_area_size%=max_size%
�mem_data_size%=0
�blk%!20=mem_area_start%
�blk%!24=ram_block_size%
�blk%!12=blk%!8
�
blk%!16=6
�'ș"Wimp_SendMessage",17,blk%,blk%!4
��
���message_save_reply
�Ablk%!12=blk%!8:blk%!16=3:ș "Wimp_SendMessage",17,blk%,blk%!4
��
��ram_transfer_reply
� buf_size%,data_size%
buf_size%=blk%!24
 Lș"Wimp_TransferBlock",this_task%,mem_data_ptr%,blk%!4,blk%!20,buf_size%
*;data_size%=mem_area_start%+mem_data_size%-mem_data_ptr%
4?� data_size%>buf_size% � data_size%=buf_size% � �menu_close
>mem_data_ptr%+=data_size%
H/blk%!12=blk%!8:blk%!16=7:blk%!24=data_size%
R(ș "Wimp_SendMessage",17,blk%,blk%!4
\�
f��ram_transmit
pram_transmit%=�
zmem_data_size%+=blk%!24
�� blk%!24=ram_block_size% �
�5� mem_data_size%+ram_block_size%>mem_area_size% �
�E�report_error("Insufficient room for data!","RAM transfer error")
�mem_data_size%=0
��
�blk%!20+=ram_block_size%
�blk%!12=blk%!8:blk%!16=6
�(ș "Wimp_SendMessage",18,blk%,blk%!4
��
��
��
��
�5��save_data(file_name$,file_type%,start%,length%)
?ș"OS_File",10,file_name$,file_type%,,start%,start%+length%
�
=ݤadd_icon(type$,text$,window%,x%,y%,sl%,esg_sp%,border%)
$G� icon%,text_space%,name_space%,val_space%,w%,h%,mode%,xs%,ys%,sel%
.
sel%=sl%:
8� sl%<�text$ sl%=�text$
B� sl%<�type$ sl%=�type$
L� text_space% sl%
Vtemp_blk%!0=window%
`temp_blk%!4=x%
jtemp_blk%!8=y%-48
t temp_blk%!12=x%+16+16*�text$
~temp_blk%!16=y%
�$text_space%=text$
�temp_blk%!20=&17000139
�temp_blk%!24=text_space%
�temp_blk%!28=-1
�temp_blk%!32=�text$
�Ȏ �type$,5) �
�
� "file_"
�7ș"Wimp_SpriteOp",&28,,type$+�(0) � ,,,w%,h%,,mode%
�+ș"OS_ReadModeVariable",mode%,4 � ,,xs%
�+ș"OS_ReadModeVariable",mode%,5 � ,,ys%
�h%=h%<<ys%
�w%=w%<<xs%
� text$="" �

temp_blk%!8=y%-h%
temp_blk%!12=x%+w%
temp_blk%!20=&1700613A
(temp_blk%!28=1
2temp_blk%!32=�type$
<$text_space%=type$
F�
Ptemp_blk%!8=y%-h%-(10<<ys%)
Zsl%=(8<<xs%)*�text$
d� sl%>w% w%=sl%
ntemp_blk%!12=x%+w%
xtemp_blk%!20=&1700612B
�� name_space% (2+�type$)
�$name_space%="s"+type$
�temp_blk%!28=name_space%
��
�
� "sprit"
�=ș"OS_SpriteOp",&128,esg_sp%,text$+�(0) � ,,,w%,h%,,mode%
�+ș"OS_ReadModeVariable",mode%,4 � ,,xs%
�+ș"OS_ReadModeVariable",mode%,5 � ,,ys%
�h%=h%<<ys%
�w%=w%<<xs%
�temp_blk%!8=y%-h%
�temp_blk%!12=x%+w%
�temp_blk%!20=&1700313A
temp_blk%!28=esg_sp%
temp_blk%!32=�text$
$text_space%=text$
"
� "label"
,
� "actio"
6temp_blk%!20=&C71F913D:
@
� "repor"
Jtemp_blk%!20=&0700313D:
T
� "optio"
^temp_blk%!8=y%-52
h#temp_blk%!12=x%+40+16+16*�text$
rtemp_blk%!20=&1700B133
|"� sel% temp_blk%!20=&17303133:
�&� val_space% (2+�"soptoff,opton"):
�$val_space%="soptoff,opton"
�temp_blk%!28=val_space%
�
� "radio"
�temp_blk%!8=y%-52
�#temp_blk%!12=x%+40+16+16*�text$
�,� (esg_sp%<1) � (esg_sp%>31) � esg_sp%=1
�-temp_blk%!20=&1700B133 � (esg_sp%*&10000)
�5� sel% temp_blk%!20=&1720B133 � (esg_sp%*&10000):
�+� text_space% (2+�"sradiooff,radioon"):
�$$text_space%="sradiooff,radioon"
�temp_blk%!28=text_space%
�
� "write"
 temp_blk%!12=x%+16+16*�text$
temp_blk%!20=&0700F135
� val_space% 16:
&$val_space%=""
0temp_blk%!28=val_space%
:� sel%<(�text$) sel%=�text$
Dtemp_blk%!32=sel%+1
N�
X+ș "Wimp_CreateIcon",,temp_blk% � icon%
b+� border%>0 �border_icon(window%,icon%)
l
=icon%
vDݤadd_icon_block(window_handle%,minx%,miny%,maxx%,maxy%,colour%)
�� icon%
�temp_blk%!0=window_handle%
� � minx%>maxx% Ȕ minx%,maxx%
� � miny%>maxy% Ȕ miny%,maxy%
�� minx%=maxx% maxx%+=1
�� miny%=maxy% maxy%+=1
�temp_blk%!4=minx%
�temp_blk%!8=miny%
�temp_blk%!12=maxx%
�temp_blk%!16=maxy%
�!temp_blk%!20=32+(colour%<<28)
�+ș "Wimp_CreateIcon",,temp_blk% � icon%
�
=icon%
.��border_icon(window_handle%,icon_handle%)
1� icon%,minx%,miny%,maxx%,maxy%,flag%,tl%,br%
temp_blk%!0=window_handle%
 temp_blk%!4=icon_handle%
*$ș"Wimp_GetIconState",,temp_blk%
4minx%=temp_blk%!8
>miny%=temp_blk%!12
Hmaxx%=temp_blk%!16
Rmaxy%=temp_blk%!20
\flag%=temp_blk%!24
f
tl%=0:
p
br%=4:
zC� (flag% � 4)=4 minx%-=4:maxx%+=4:miny%-=4:maxy%+=4:tl%=4:br%=0
�Kicon%=�add_icon_block(window_handle%,maxx%,miny%-4,maxx%+4,maxy%+4,br%)
�Kicon%=�add_icon_block(window_handle%,minx%-4,maxy%,maxx%+2,maxy%+4,tl%)
�Iicon%=�add_icon_block(window_handle%,minx%-4,miny%-4,minx%,maxy%,tl%)
�Kicon%=�add_icon_block(window_handle%,minx%-2,miny%-4,maxx%+2,miny%,br%)
��
�.��delete_icon(window_handle%,icon_handle%)
�� minx%,miny%,maxx%,maxy%
�temp_blk%!0=window_handle%
�temp_blk%!4=icon_handle%
�$ș"Wimp_GetIconState",,temp_blk%
�minx%=temp_blk%!8
�miny%=temp_blk%!12
�maxx%=temp_blk%!16
	maxy%=temp_blk%!20
	"ș"Wimp_DeleteIcon",,temp_blk%
	?ș"Wimp_ForceRedraw",window_handle%,minx%,miny%,maxx%,maxy%
	$�
	.+��drag_box(window_handle%,icon_handle%)
	8� x%,y%
	Btemp_blk%!0=window_handle%
	L&ș"Wimp_GetWindowState",,temp_blk%
	Vx%=temp_blk%!4-temp_blk%!20
	` y%=temp_blk%!16-temp_blk%!24
	jtemp_blk%!4=icon_handle%
	t$ș"Wimp_GetIconState",,temp_blk%
	~$� (temp_blk%!24 � &B000)=&B000 �
	�(� (temp_blk%!24 � &800000)=&800000 �
	�temp_blk%!4=5
	�temp_blk%!8+=x%
	�temp_blk%!12+=y%
	�temp_blk%!16+=x%
	�temp_blk%!20+=y%
	�temp_blk%!24=-1
	�temp_blk%!28=-1
	�temp_blk%!32=&7FFFFFFF
	�temp_blk%!36=&7FFFFFFF
	�ș"Wimp_DragBox",,temp_blk%
	��
0ݤget_icon_text(window_handle%,icon_handle%)

temp_blk%!0=window_handle%
temp_blk%!4=icon_handle%
$ș"Wimp_GetIconState",,temp_blk%
(#� (temp_blk%!24 � &101)<>&101 �
2+� 202,"Icon "+�icon%+" not indirected!"
<=""
F�
P=$temp_blk%!28
Z9��icon_bg_colour(window_handle%,icon_handle%,colour%)
d� colour%<0 � colour%>15 �
ntemp_blk%!0=window_handle%
xtemp_blk%!4=icon_handle%
�$ș"Wimp_GetIconState",,temp_blk%
� � (temp_blk%!24 � 1<<6) � �:
�temp_blk%!12=&F0000000:
�<temp_blk%!8=colour%<<28:ș"Wimp_SetIconState",,temp_blk%
��
�9��icon_fg_colour(window_handle%,icon_handle%,colour%)
�� colour%<0 � colour%>15 �
�temp_blk%!0=window_handle%
�temp_blk%!4=icon_handle%
�$ș"Wimp_GetIconState",,temp_blk%
� � (temp_blk%!24 � 1<<6) � �:
�temp_blk%!12=&F000000:
�<temp_blk%!8=colour%<<24:ș"Wimp_SetIconState",,temp_blk%
�
0ݤicon_selected(window_handle%,icon_handle%)
temp_blk%!0=window_handle%
"temp_blk%!4=icon_handle%
,$ș"Wimp_GetIconState",,temp_blk%
6&� (temp_blk%!24 � 1<<21) � =� � =�
@8��icon_validation(window_handle%,icon_handle%,type$)
Jtemp_blk%!0=window_handle%
Ttemp_blk%!4=icon_handle%
^$ș"Wimp_GetIconState",,temp_blk%
h%� (temp_blk%!24 � &E101)<>&E101 �
rC� 202,"Icon "+�icon_handle%+" not writable and not indirected!"
|�
��
�Ȏ type$ �
�� "number"
�$temp_blk%!32="A0-9."
�� "file"
�&$temp_blk%!32="A~ $&@\\^:.#*|"+�34
��
��
�8��place_caret(window_handle%,icon_handle%,position%)
�temp_blk%!0=window_handle%
�temp_blk%!4=icon_handle%
�$ș"Wimp_GetIconState",,temp_blk%
�%� (temp_blk%!24 � &E101)<>&E101 �
C� 202,"Icon "+�icon_handle%+" not writable and not indirected!"
�
�
&text$=$temp_blk%!28
0'� position%>�text$ position%=�text$
:Jș"Wimp_SetCaretPosition",window_handle%,icon_handle%,0,0,-1,position%
D�
N8��put_icon_sprite(window_handle%,icon_handle%,text$)
Xtemp_blk%!0=window_handle%
btemp_blk%!4=icon_handle%
l$ș"Wimp_GetIconState",,temp_blk%
vȎ (temp_blk%!24 � &103) �
�� &002,&003
�$temp_blk%!28=text$
�
� &102
�=� temp_blk%!36>0 $temp_blk%!28=text$:$temp_blk%!36=�text$
�
� &103
�$temp_blk%!32="S"+text$
�5 � 202,"No sprite name in icon "+�icon_handle%:�
��
�temp_blk%!8=0
�temp_blk%!12=0
�$ș"Wimp_SetIconState",,temp_blk%
��
�6��put_icon_text(window_handle%,icon_handle%,text$)

temp_blk%!0=window_handle%

temp_blk%!4=icon_handle%

$ș"Wimp_GetIconState",,temp_blk%

 #� (temp_blk%!24 � &101)<>&101 �

*2� 202,"Icon "+�icon_handle%+" not indirected!"

4�

>�

H text$=�text$,temp_blk%!36-1)

R$temp_blk%!28=text$

\temp_blk%!8=0

ftemp_blk%!12=0

p$ș"Wimp_SetIconState",,temp_blk%

z�

�6��select_icon(window_handle%,icon_handle%,select%)

�temp_blk%!0=window_handle%

�temp_blk%!4=icon_handle%

�temp_blk%!12=1<<21:

�0� select% temp_blk%!8=1<<21 � temp_blk%!8=0:

�$ș"Wimp_SetIconState",,temp_blk%

��

�4��shade_icon(window_handle%,icon_handle%,shade%)

�temp_blk%!0=window_handle%

�temp_blk%!4=icon_handle%

�temp_blk%!12=1<<22:

�/� shade% temp_blk%!8=1<<22 � temp_blk%!8=0:

�$ș"Wimp_SetIconState",,temp_blk%
�
.��update_icon(window_handle%,icon_handle%)
temp_blk%!0=window_handle%
$temp_blk%!4=icon_handle%
.temp_blk%!8=0
8temp_blk%!12=0
B$ș"Wimp_SetIconState",,temp_blk%
L�
V)ݤput_icon_on_bar(sprite_name$,side$)
`
� handle%
j1� side$="RIGHT" !temp_blk%=-1 � !temp_blk%=-2
ttemp_blk%!4=0
~temp_blk%!8=0
�temp_blk%!12=68
�temp_blk%!16=68
�temp_blk%!20=&1700202A
� $(temp_blk%+24)=sprite_name$
�-ș "Wimp_CreateIcon",,temp_blk% � handle%
�=handle%
�C��put_info_text(window_handle%,name$,purpose$,author$,version$)
�*�put_icon_text(window_handle%,1,name$)
�-�put_icon_text(window_handle%,2,purpose$)
�,�put_icon_text(window_handle%,3,author$)
�-�put_icon_text(window_handle%,4,version$)
��
6ݤput_sprite_text_on_bar(sprite_name$,side$,text$)

.� handle%,length%,sprite_name%,text_space%
&� sprite_name% (�(sprite_name$)+3)
� text_space% (�(text$)+2)
("$sprite_name%="S"+sprite_name$
2$text_space%=text$
<1� side$="RIGHT" !temp_blk%=-1 � !temp_blk%=-2
Ftemp_blk%!4=0
Ptemp_blk%!8=-16
Z*width%=16*�text$:� width%<68 width%=68
dtemp_blk%!12=width%
ntemp_blk%!16=88
xtemp_blk%!20=&1700212B
�temp_blk%!24=text_space%
�temp_blk%!28=sprite_name%
�temp_blk%!32=�(text$)
�-ș "Wimp_CreateIcon",,temp_blk% � handle%
�=handle%
�� �task_initialise(title$)
�� version%
�version%=200
�Hș "Wimp_Initialise",version%,&4B534154,title$ � version%,this_task%
�=this_task%
���add_menu_item(line$)
�D� menuflag%,iconflag%,param$,sub%,itemtext$,writable%,maxlength%
�*iconflag%=&7000021:sub%=-1:writable%=�
:itemtext$=�menu_item_text(line$):maxlength%=�itemtext$
�
"param$=�menu_item_param(line$)
"Ȏ �param$,4) �
,!�"tick":menuflag%=menuflag%�1
6!�"line":menuflag%=menuflag%�2
@'�"shad":iconflag%=iconflag%�&400000
J0�"subm":sub%=�menu_submenu(�menuvar(param$))
T/�"wind":sub%=�menu_window(�menuvar(param$))
^6�"icon":iconflag%=�menu_iconflag(�menuvar(param$))
h,�"writ":�menu_writable(�menuvar(param$))
r�
|� param$=""
�pointer%!0=menuflag%
�pointer%!4=sub%
�#� �(itemtext$)>12 � writable% �
� pointer%!8=iconflag% � &100:
�3�indirected_item(pointer%,writable%,maxlength%)
��
�pointer%!8=iconflag%
�&$(pointer%+12)=�itemtext$+�(0),12)
��
�pointer%+=24
��
�ݤbeginmenu(line$)
�� �line$,9)="beginmenu" =�
=�
&ݤdecode_menu(menustart%,listptr%)
� text_path$
&Eș"Wimp_DecodeMenu",,menustart%,listptr%,blk%+256 � ,,,text_path$
0=text_path$
:E��dim_menu_arrays(menucount%,itemcount%,writecount%,windowcount%)
D0� menustart% (menucount%*28)+(itemcount%*24)
N� menuwidth%(menucount%)
X� menu%(menucount%)
b!� writable_item%(writecount%)
l � writable_len%(writecount%)
v�
�ݤget_writem(writem%)
�� temp$
�1� writem%<1 � writem%>�(writable_item%(),1) �
�=� 201,"writable menu item "+�(writem%)+" does not exist!"
��
�#writem%=writable_item%(writem%)
�:temp$="": ȕ ?writem%>31:temp$+=�?writem%:writem%+=1:�
�
=temp$
���goto_beginmenu
�� temp%,line$
��#menufile%=0
��
�temp%=�#menufile%
line$=�#menufile%
%� �beginmenu(line$) � �#menufile%
:��#menufile% � 200,"No 'beginmenu' found in menu file"
 �#menufile%=temp%
*�
42��indirected_item(menu_ptr%,writable%,length%)
>� indir_ptr%
H� writable% �
R� indir_ptr% length%+1
\�
f� indir_ptr% 1+�itemtext$
p�
zmenu_ptr%!12=indir_ptr%:
�$indir_ptr%=itemtext$+�(0)
�� writable% �
�(writable_item%(writable%)=indir_ptr%
�$writable_len%(writable%)=length%
�indir_ptr%+=length%+1
�menu_ptr%!20=length%+1
��
�indir_ptr%+=1+�itemtext$
�menu_ptr%!20=1+�itemtext$:
��
�?indir_ptr%=0
�menu_ptr%!16=indir_ptr%:
��
ݤitem_count(menu_ptr%)
� count%
count%=1
$menu_ptr%+=28
.5ȕ (!menu_ptr% � &80)=0:menu_ptr%+=24:count%+=1:�
8=count%
B��load_menus(menufile$)
L2� menucount%,header%,line$,pointer%,menustart%
V �size_menu_arrays(menufile$)
`menufile%=�menufile$
j�set_menu_arrays
t�goto_beginmenu
~menucount%=0:header%=�
��
�line$=�#menufile%
�� �beginmenu(line$) �
�C�header% � 200,"Bad menu file, no items in menu "+�(menucount%)
�(�menucount% �mark_menu_end(pointer%)
�menucount%+=1
�line$=�#menufile%
�F�make_menu_header(pointer%,line$,menuwidth%(menucount%)):header%=�
��
�#�add_menu_item(line$):header%=�
��
�� �#menufile%
�mark_menu_end(pointer%)

(ș"XOS_Find",0,menufile%:menufile%=0
C�header% � 200,"Bad menu file, no items in menu "+�(menucount%)
�
(0��make_menu_header(� pointer%,title$,width%)
2$pointer%=�title$,12)+�(0):
<pointer%?12=7:
Fpointer%?13=2:
Ppointer%?14=7:
Zpointer%?15=0:
dpointer%!16=width%:
npointer%!20=44:
xpointer%!24=0:
�pointer%+=28:
��
���mark_menu_end(pointer%)
�(!(pointer%-24)=!(pointer%-24) � &80:
��
���menu_close
�ș"Wimp_CreateMenu",,-1
��
�ݤmenu_height(menu_ptr%)
�#� itemcount%,linecount%,height%
�itemcount%=1
�&height%=menu_ptr%!20+menu_ptr%!24:
�menu_ptr%+=28
ȕ (!menu_ptr% � &80)=0
itemcount%+=1
%� (!menu_ptr% � &2) linecount%+=1
"menu_ptr%+=24
,�
6&� (!menu_ptr% � &2) linecount%+=1:
@%=itemcount%*height%+linecount%*24
Jݤmenu_iconflag(var$)
T2�var$="" � 200,"Menu icon flag value missing!"
^=�(var$)
h,� �menu_info_quit(window_handle%,title$)
r� menu%
|� menu% 76
�$menu%=title$+�13
�$menu%?12=7:menu%?13=2:menu%?14=7
�'menu%?15=0:menu%!16=108:menu%!20=44
�menu%!24=0
�(menu%!28=&00:menu%!32=window_handle%
�-menu%!36=&07000021:$(menu%+40)="Info"+�13
�menu%!52=&80:menu%!56=-1
�-menu%!60=&07000021:$(menu%+64)="Quit"+�13
�
=menu%
�ݤmenu_item_param(� item$)
�� param$
�� �item$,",") �
�item$=�item$,�item$,",")+1)
 param$=�item$,�item$,",")-1)
�

param$=""
&�
0=param$
:ݤmenu_item_text(item$)
D-� �item$,",") item$=�item$,�item$,",")-1)
N
=item$
Xݤmenu_path(ptr%)
b� path$
lpath$=�(!ptr%)
vptr%+=4
�ȕ !ptr%<>-1
�path$+="."+�(!ptr%)
�ptr%+=4
��
�
=path$
�ݤmenu_quit(title$)
�� menu%
�� menu% 52
�$menu%=title$+�13
�$menu%?12=7:menu%?13=2:menu%?14=7
�'menu%?15=0:menu%!16=108:menu%!20=44
�'menu%!24=0:menu%!28=&80:menu%!32=-1
�-menu%!36=&07000021:$(menu%+40)="Quit"+�13

=menu%
ݤmenu_submenu(var$)
(� �(var$)<1 � �(var$)>�(menu%(),1) �
 A� 200,"Can't find menu "+var$+", as referred to in:- "+param$
*�
4� �(var$)=menucount% �
>L� 200,"An item in menu "+var$+" cannot have menu "+var$+" as a submenu!"
H�
R=menu%(�(var$))
\ݤmenuvar(var$)
fvar$=�var$,�var$,"(")+1)
pvar$=�var$,�var$,")")-1)
z	=var$
�ݤmenu_window(var$)
�
� handle%
�� �
�C� � � 0,"Menu file error. Window variable "+var$+" not found."
�handle%=�(var$)
�� handle%<1 �
�ș"XOS_Find",0,menufile%
��:
��
�=handle%
���menu_writable(var$)
�maxlength%=0
�� �var$,":") �
%maxlength%=�(�var$,�var$,":")+1))
2�(itemtext$)>maxlength% maxlength%=�itemtext$
�
$maxlength%=�itemtext$
.�
8+menuflag%=menuflag%�4:writable%=�(var$)
B�
L��put_writem(writem%,text$)
V1� writem%<1 � writem%>�(writable_item%(),1) �
`=� 201,"writable menu item "+�(writem%)+" does not exist!"
j�
t%� �text$>writable_len%(writem%) �
~+� �text$>100 text$=�text$,100)+"......"
�E� 201,"Text '"+text$+"' too long for writable item "+�writem%+"!"
��
�"$writable_item%(writem%)=text$
��
���set_menu_arrays
�� itemcount%,line$,width%
�$menucount%=0:pointer%=menustart%
��goto_beginmenu
��
�line$=�#menufile%
�� �beginmenu(line$) �
�Bmenu%(menucount%+1)=menustart%+(menucount%*28)+(itemcount%*24)
line$=�#menufile%:

menucount%+=1
line$=�line$,12)
'menuwidth%(menucount%)=12+16*�line$
(�
2itemcount%+=1
<� �line$,",") �
F)width%=12+16*�(�line$,�line$,",")-1))
P�
Zwidth%=12+16*�line$
d�
nA� width%>menuwidth%(menucount%) menuwidth%(menucount%)=width%
x�
�� �#menufile%
��
���shade(menu%,item%,shade%)
�� flagaddress%
�#�menu%<1 � menu%>�(menu%(),1) �
�7� 201,"Item shade error. Out of range menu number!"
��
�1� item%<0 � item%>�item_count(menu%(menu%)) �
�<� 201,"Item shade error. Out of range menu item number!"
��
�-flagaddress%=menu%(menu%)+28+(24*item%)+8
�(� shade%=� shade%=&400000 � shade%=0
�6!flagaddress%=(!flagaddress% � &FFBFFFFF) � shade%
�
!��size_menu_arrays(menufile$)
:� menucount%,itemcount%,writecount%,windowcount%,line$
"menufile%=�menufile$
,�
6line$=�#menufile%
@� �beginmenu(line$) �
J$menucount%+=1:line$=�#menufile%:
T�
^$� �line$,",writ") writecount%+=1
h%� �line$,",wind") windowcount%+=1
ritemcount%+=1
|�
�� �#menufile%
�(ș"XOS_Find",0,menufile%:menufile%=0
�D�dim_menu_arrays(menucount%,itemcount%,writecount%,windowcount%)
��
���tick(menu%,item%,tick%)
�� flagaddress%
�#�menu%<1 � menu%>�(menu%(),1) �
�6� 201,"Item tick error. Out of range menu number!"
��
�1� item%<0 � item%>�item_count(menu%(menu%)) �
�6� 201,"Item tick error. Out of range item number!"
��
�+flagaddress%=menu%(menu%)+28+(24*item%)
� tick%=� tick%=1 � tick%=0
5!flagaddress%=(!flagaddress% � &FFFFFFFE) � tick%
�
&"ݤget_string(pointer%,length%)
0� temp$
:� length%=0 length%=255
D,� pointer%=pointer% � pointer%+length%-1
N� ?pointer%<32 �
X
=temp$
b�
ltemp$+=�(?pointer%)
v�
��
�
=temp$
�ݤhex(number%)
�
� hex$
�5ș"OS_ConvertHex8",number%,"0000000000",10 � hex$
�#ȕ �hex$,1)="0":hex$=�hex$,2):�
�� hex$="" hex$="0"
�	=hex$
�ݤleaf(path$)
�0ȕ �path$,"."):path$=�path$,�path$,".")+1):�
�
=path$
�ݤreason(event%)
�
� reason$
Ȏ event% �
"� 0:reason$="Null reason code"
'� 1:reason$="Redraw window request"
 %� 2:reason$="Open window request"
*&� 3:reason$="Close window request"
4(� 4:reason$="Pointer leaving window"
>)� 5:reason$="Pointer entering window"
H&� 6:reason$="Mouse button pressed"
R)� 7:reason$="Drag has been completed"
\� 8:reason$="Key pressed"
f � 9:reason$="Menu selection"
p �10:reason$="Scroll request"
z�11:reason$="Loose caret"
��12:reason$="Gain caret"
��17:reason$="User message"
�"�18:reason$="Message recorded"
�*�19:reason$="User message acknowledge"
��
�=reason$
�#��report_error(message$,title$)
�$message$=�0+�0+�0+�0+message$+�0
�,ș "Wimp_ReportError",message$,18,title$
��
�!��show_value(line%,variable$)
�line%=line%�4
�� �variable$,"$") �
variable$+="="+�(variable$)
�
� �variable$," ") �
$�
."variable$+="="+�(�(variable$))
8�
B�
L4�put_icon_text(show_value%,line%,�variable$,35))
V�open_window(show_value%)
`�
jݤsystem_variable(sys_var$)
t
� length%
~=ș"XOS_ReadVarVal",sys_var$+�(0),temp_blk%,-1 � ,,length%
�A� length%=0 � � 0,"System variable '"+sys_var$+"' not found!"
�Aș"XOS_ReadVarVal",sys_var$+�(0),temp_blk%,255,,3 � ,,length%
�?(temp_blk%+length%)=13
�=$temp_blk%
�1��change_pointer(sprites%,sprite_name$,x%,y%)
�6ș"OS_SpriteOp",&124,sprites%,sprite_name$,2,x%,y%
�temp_blk%?0=1
�temp_blk%?1=25
�temp_blk%?2=&FF
�temp_blk%?3=&BB
�temp_blk%?4=&BB
�ș"OS_Word",12,temp_blk%
temp_blk%?0=2

temp_blk%?2=&55
temp_blk%?3=&55
temp_blk%?4=&55
(ș"OS_Word",12,temp_blk%
2*POINTER 2
<�
F��restore_pointer
P*POINTER 1
Z�
d2ݤget_sprite_name(window_handle%,icon_handle%)
n� temp$
xtemp_blk%!0=window_handle%
�temp_blk%!4=icon_handle%
�$ș"Wimp_GetIconState",,temp_blk%
�Ȏ (temp_blk%!24 � &103) �
�� &002,&003
�"=�get_string(temp_blk%!28,256)
�
� &102
�� temp_blk%!36>0 �
�+=�get_string(temp_blk%!28,temp_blk%!36)
��
�1� 202,"No sprite name in icon "+�icon_handle%
�=""
��
�
� &103
/=��get_string(temp_blk%!32,temp_blk%!36),2)

1� 202,"No sprite name in icon "+�icon_handle%
"=""
,�
6
=temp$
@3ݤicon_sprite_type(window_handle%,icon_handle%)
J==�("&"+¤get_sprite_name(window_handle%,icon_handle%),3))
Tݤload_sprites(file$)
^� sprites%,size%
hsize%=�file_size(file$)+16
r� sprites% size%
|sprites%!0=size%
�sprites%!8=16
�(ș"OS_SpriteOp",&10A,sprites%,file$:
�
=sprites%
�Bݤnew_template(template_file$,window_name$,� memfree%,memend%)
�� window_handle%
�)ș"Wimp_OpenTemplate",,template_file$
�;window_handle%=�template(window_name$,memfree%,memend%)
�ș "Wimp_CloseTemplate"
�=window_handle%
�(ݤtemplate(window_name$,� ptr%,end%)
�� found%,window_handle%
�Nș"Wimp_LoadTemplate",,blk%,ptr%,end%,-1,window_name$,0 � ,,ptr%,,,,found%
�� found% �
 1ș "Wimp_CreateWindow",,blk% � window_handle%
 �
 ?� � 0,"Window "+window_name$+" not found in template file!"
 &window_handle%=0
 0�
 :=window_handle%
 DDݤadd_icon(type$,text$,window_handle%,x%,y%,sl%,esg_sp%,border%)
 N)��change_extent(window_handle%,x%,y%)
 X7� min_x%,min_y%,max_x%,max_y%,max_vis_x%,min_vis_y%
 b!temp_blk%=window_handle%
 l&ș "Wimp_GetWindowInfo",,temp_blk%
 vmin_x%=temp_blk%!44
 �min_y%=y%-y%�4
 �max_x%=x%-x%�2
 �max_y%=temp_blk%!56
 �4max_vis_x%=temp_blk%!20+temp_blk%!12-temp_blk%!4
 �4min_vis_y%=temp_blk%!24-temp_blk%!16+temp_blk%!8
 �)� min_y%>min_vis_y% min_y%=min_vis_y%
 �)� max_vis_x%>max_x% max_x%=max_vis_x%
 �temp_blk%!0=min_x%
 �temp_blk%!4=min_y%
 �temp_blk%!8=max_x%
 �temp_blk%!12=max_y%
 �/ș"Wimp_SetExtent",window_handle%,temp_blk%
 ��
!��clear_print_window
!'� min_x%,min_y%,max_x%,max_y%,more%
!print_line$()=""
! !temp_blk%=print_window%
!*&ș "Wimp_GetWindowInfo",,temp_blk%
!4min_x%=temp_blk%!44
!>min_y%=temp_blk%!48
!Hmax_x%=temp_blk%!52
!Rmax_y%=temp_blk%!56
!\temp_blk%!4=min_x%
!ftemp_blk%!8=min_y%
!ptemp_blk%!12=max_x%
!ztemp_blk%!16=max_y%
!�,ș"Wimp_UpdateWindow",,temp_blk% � more%
!�ȕ more%
!��
!�,ș"Wimp_GetRectangle",,temp_blk% � more%
!��
!��
!�#� �close_window(window_handle%)
!�!temp_blk%=window_handle%
!�$ș "Wimp_CloseWindow",,temp_blk%
!��
!�ݤcreate_info_window
!�� icon%
!�Ninfo%=�create_window("About this program",&84000012,660,212,0,660,999,999)
":icon%=  �add_icon("label","   Name:",info%,8,-4,0,0,0)
";icon%=  �add_icon("report",�30," "),info%,156,-4,0,0,0)
"<icon%=  �add_icon("report",�30," "),info%,156,-56,0,0,0)
"$=icon%=  �add_icon("report",�30," "),info%,156,-108,0,0,0)
".=icon%=  �add_icon("report",�30," "),info%,156,-160,0,0,0)
"8;icon%=  �add_icon("label","Purpose:",info%,8,-56,0,0,0)
"B<icon%=  �add_icon("label"," Author:",info%,8,-108,0,0,0)
"L<icon%=  �add_icon("label","Version:",info%,8,-160,0,0,0)
"V
=info%
"`'ݤcreate_print_window(title$,w%,h%)
"j� print_line$(h%-1)
"tprint_top%=0
"~print_width%=w%
"�w%=w%*16+8
"�h%=h%*32
"�Fprint_window%=�create_window(title$,&FF000002,w%,h%,100,w%,200,h%)
"�=print_window%
"���create_show_value
"�� icon%
"�Ishow_value%=�create_window("Show Variable",0,608,212,300,999,350,999)
"�?icon%=  �add_icon("report",�36," "),show_value%,8,-4,0,0,0)
"�@icon%=  �add_icon("report",�36," "),show_value%,8,-56,0,0,0)
"�Aicon%=  �add_icon("report",�36," "),show_value%,8,-108,0,0,0)
"�Aicon%=  �add_icon("report",�36," "),show_value%,8,-160,0,0,0)
"��
#Lݤcreate_window(title$,wf%,x_size%,y_size%,left%,width%,bottom%,height%)
#
� title_space%,handle%
#� title_space% (1+�title$)
#temp_blk%!0=left%
#(temp_blk%!4=bottom%
#2temp_blk%!8=left%+width%
#< temp_blk%!12=bottom%+height%
#Ftemp_blk%!16=0:
#Ptemp_blk%!20=0:
#Ztemp_blk%!24=-1:
#d� wf%=0 wf%=&FF000012:
#ntemp_blk%!28=wf%
#xtemp_blk%?32=7:
#�temp_blk%?33=2:
#�temp_blk%?34=7:
#�temp_blk%?35=1:
#�temp_blk%?36=3:
#�temp_blk%?37=1:
#�temp_blk%?38=12:
#�temp_blk%?39=0:
#�temp_blk%!40=0:
#�temp_blk%!44=-y_size%:
#�temp_blk%!48=x_size%:
#�temp_blk%!52=0:
#�temp_blk%!56=&119:
#�temp_blk%!60=&6000:
$temp_blk%!64=1:
$temp_blk%?68=0:
$temp_blk%?69=0:
$"temp_blk%?70=0:
$,temp_blk%?71=0:
$6$title_space%=title$
$@temp_blk%!72=title_space%:
$Jtemp_blk%!76=-1:
$Ttemp_blk%!80=�(title$)+1:
$^temp_blk%!84=0:
$h.ș"Wimp_CreateWindow",,temp_blk% � handle%
$r=handle%
$|$� �delete_window(window_handle%)
$�!temp_blk%=window_handle%
$�%ș "Wimp_DeleteWindow",,temp_blk%
$��
$�"� �open_window(window_handle%)
$�!temp_blk%=window_handle%
$�'ș "Wimp_GetWindowState",,temp_blk%
$�#ș "Wimp_OpenWindow",,temp_blk%
$��
$���print_line(line%,text$)
$�L� max_lines%,min_x%,min_y%,max_x%,max_y%,line_top%,line_bot%,x%,y%,more%
$�!max_lines%=�(print_line$(),1)
$�� line%>max_lines% �
$�9� 204,"Out of range line number in 'PROCprint_line'!"
%�
%�
%!temp_blk%=print_window%
%&&ș "Wimp_GetWindowInfo",,temp_blk%
%0min_x%=temp_blk%!44
%:min_y%=temp_blk%!48
%Dmax_x%=temp_blk%!52
%Nmax_y%=temp_blk%!56
%Xline_top%=max_y%-line%*32
%bline_bot%=line_top%-32
%l+line%=(line%+print_top%)�(max_lines%+1)
%v+print_line$(line%)=�text$,print_width%)
%�!x%=temp_blk%!4-temp_blk%!20+4
%�,y%=temp_blk%!16-temp_blk%!24+line_top%-4
%�temp_blk%!0=print_window%
%�temp_blk%!4=min_x%
%�temp_blk%!8=line_bot%
%�temp_blk%!12=max_x%
%�temp_blk%!16=line_top%
%�,ș"Wimp_UpdateWindow",,temp_blk% � more%
%�ȕ more%
%�	� 7:�
%�� x%,y%
%��;print_line$(line%);
%�,ș"Wimp_GetRectangle",,temp_blk% � more%
&�
&�
&��print_scroll(text$)
& L� max_lines%,min_x%,min_y%,max_x%,max_y%,line_top%,line_bot%,x%,y%,more%
&*!max_lines%=�(print_line$(),1)
&40print_line$(print_top%)=�text$,print_width%)
&>min_x%=0
&Hmin_y%=-(1+max_lines%)*32
&Rmax_x%=print_width%*16+8
&\max_y%=0
&fQș"Wimp_BlockCopy",print_window%,min_x%,min_y%,max_x%,max_y%,min_x%,min_y%+32
&pline_top%=min_y%+32
&zline_bot%=min_y%
&�!temp_blk%=print_window%
&�&ș "Wimp_GetWindowInfo",,temp_blk%
&�!x%=temp_blk%!4-temp_blk%!20+4
&�,y%=temp_blk%!16-temp_blk%!24+line_top%-4
&�temp_blk%!0=print_window%
&�temp_blk%!4=min_x%
&�temp_blk%!8=line_bot%
&�temp_blk%!12=max_x%
&�temp_blk%!16=line_top%
&�,ș"Wimp_UpdateWindow",,temp_blk% � more%
&�ȕ more%
&�	� 7:�
&�� x%,y%
'�;print_line$(print_top%);
',ș"Wimp_GetRectangle",,temp_blk% � more%
'�
'$,print_top%=(print_top%+1)�(1+max_lines%)
'.�
'8��redraw_print_window(blk%)
'B(� max_lines%,topline%,botline%,x%,y%
'L!max_lines%=�(print_line$(),1)
'V,topline%=-(blk%!24+4-blk%!16+blk%!40)�32
'`,botline%=-(blk%!24+4-blk%!16+blk%!32)�32
'j-� botline%>max_lines% botline%=max_lines%
't� topline%<=max_lines% �
'~x%=blk%!4-blk%!20+4
'�-y%=blk%!40-(blk%!24+4-blk%!16+blk%!40)�32
'�� line%=topline% � botline%
'��x%,y%:y%-=32
'�4�;print_line$((line%+print_top%)�(max_lines%+1))
'��
'��
'��
'�&ݤwindow_rectangle(window_handle%)
'�� more%
'�Gtemp_blk%!0=window_handle%:ș"Wimp_GetRectangle",,temp_blk% � more%
'�
=more%
'�#ݤwindow_update(window_handle%)
(� more%
(
temp_blk%!0=window_handle%
(temp_blk%!4=&80000000:
(temp_blk%!8=&80000000:
((temp_blk%!12=&6FFFFFFF:
(2temp_blk%!16=&6FFFFFFF:
(<,ș"Wimp_UpdateWindow",,temp_blk% � more%
(F
=more%
(P%ݤwindow_x_origin(window_handle%)
(Ztemp_blk%!0=window_handle%
(d&ș"Wimp_GetWindowState",,temp_blk%
(n=temp_blk%!4-temp_blk%!20
(x%ݤwindow_y_origin(window_handle%)
(�temp_blk%!0=window_handle%
(�&ș"Wimp_GetWindowState",,temp_blk%
(�=temp_blk%!16-temp_blk%!24
�
00000000  0d 00 0a 15 f4 20 57 69  6d 70 4c 69 62 20 4c 69  |..... WimpLib Li|
00000010  62 72 61 72 79 0d 00 14  05 f4 0d 00 1e 05 f4 0d  |brary...........|
00000020  00 28 30 f4 20 20 20 20  20 20 20 20 20 20 20 20  |.(0.            |
00000030  20 20 20 20 20 20 20 20  20 20 20 20 20 50 52 4f  |             PRO|
00000040  43 45 44 55 52 45 20 20  4c 49 42 52 41 52 59 0d  |CEDURE  LIBRARY.|
00000050  00 32 33 f4 20 20 20 20  20 20 20 20 20 20 20 20  |.23.            |
00000060  20 20 20 20 20 20 20 20  20 20 20 56 65 72 73 69  |           Versi|
00000070  6f 6e 20 31 2e 31 39 20  20 28 33 31 2f 33 2f 39  |on 1.19  (31/3/9|
00000080  33 29 0d 00 3c 31 f4 20  20 20 20 20 20 20 20 20  |3)..<1.         |
00000090  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 28  |               (|
000000a0  43 29 20 41 6c 61 6e 20  53 65 6e 69 6f 72 20 31  |C) Alan Senior 1|
000000b0  39 39 32 0d 00 46 39 f4  20 20 20 20 20 20 20 20  |992..F9.        |
000000c0  20 20 20 20 20 20 20 20  20 44 61 62 73 20 50 72  |         Dabs Pr|
000000d0  65 73 73 20 3a 20 42 61  73 69 63 20 57 69 6d 70  |ess : Basic Wimp|
000000e0  20 50 72 6f 67 72 61 6d  6d 69 6e 67 0d 00 50 05  | Programming..P.|
000000f0  f4 0d 00 5a 16 dd a4 66  69 6c 65 5f 73 69 7a 65  |...Z...file_size|
00000100  28 66 69 6c 65 24 29 0d  00 64 12 ea 20 73 69 7a  |(file$)..d.. siz|
00000110  65 25 2c 66 6f 75 6e 64  25 0d 00 6e 2a c8 99 22  |e%,found%..n*.."|
00000120  4f 53 5f 46 69 6c 65 22  2c 31 37 2c 66 69 6c 65  |OS_File",17,file|
00000130  24 20 b8 20 66 6f 75 6e  64 25 2c 2c 2c 2c 73 69  |$ . found%,,,,si|
00000140  7a 65 25 0d 00 78 3c e7  20 66 6f 75 6e 64 25 3c  |ze%..x<. found%<|
00000150  3e 31 20 8c 20 85 20 32  30 33 2c 22 46 69 6c 65  |>1 . . 203,"File|
00000160  20 27 22 2b a4 6c 65 61  66 28 66 69 6c 65 24 29  | '"+.leaf(file$)|
00000170  2b 22 27 20 6e 6f 74 20  66 6f 75 6e 64 21 22 0d  |+"' not found!".|
00000180  00 82 0a 3d 73 69 7a 65  25 0d 00 8c 16 dd a4 66  |...=size%......f|
00000190  69 6c 65 5f 74 79 70 65  28 66 69 6c 65 24 29 0d  |ile_type(file$).|
000001a0  00 96 12 ea 20 74 65 6d  70 25 2c 66 6f 75 6e 64  |.... temp%,found|
000001b0  25 0d 00 a0 28 c8 99 22  4f 53 5f 46 69 6c 65 22  |%...(.."OS_File"|
000001c0  2c 31 37 2c 66 69 6c 65  24 20 b8 20 66 6f 75 6e  |,17,file$ . foun|
000001d0  64 25 2c 2c 74 65 6d 70  25 0d 00 aa 3b e7 20 66  |d%,,temp%...;. f|
000001e0  6f 75 6e 64 25 3c 3e 31  20 8c 20 85 20 32 30 33  |ound%<>1 . . 203|
000001f0  2c 22 46 69 6c 65 20 22  2b a4 6c 65 61 66 28 66  |,"File "+.leaf(f|
00000200  69 6c 65 24 29 2b 22 2c  20 6e 6f 74 20 66 6f 75  |ile$)+", not fou|
00000210  6e 64 21 22 0d 00 b4 2c  e7 28 74 65 6d 70 25 3e  |nd!"...,.(temp%>|
00000220  3e 3e 32 30 29 3d 26 46  46 46 8c 3d 28 74 65 6d  |>>20)=&FFF.=(tem|
00000230  70 25 3e 3e 3e 38 29 80  26 46 46 46 20 8b 3d 30  |p%>>>8).&FFF .=0|
00000240  0d 00 be 41 dd f2 69 6e  69 74 69 61 74 65 5f 73  |...A..initiate_s|
00000250  61 76 65 28 77 69 6e 64  6f 77 25 2c 69 63 6f 6e  |ave(window%,icon|
00000260  25 2c 78 25 2c 79 25 2c  66 69 6c 65 24 2c 73 74  |%,x%,y%,file$,st|
00000270  61 72 74 25 2c 73 69 7a  65 25 2c 74 79 70 65 25  |art%,size%,type%|
00000280  29 0d 00 c8 1a 6d 65 6d  5f 61 72 65 61 5f 73 74  |)....mem_area_st|
00000290  61 72 74 25 3d 73 74 61  72 74 25 0d 00 d2 18 6d  |art%=start%....m|
000002a0  65 6d 5f 64 61 74 61 5f  73 69 7a 65 25 3d 73 69  |em_data_size%=si|
000002b0  7a 65 25 0d 00 dc 18 6d  65 6d 5f 64 61 74 61 5f  |ze%....mem_data_|
000002c0  70 74 72 25 3d 73 74 61  72 74 25 0d 00 e6 0e 62  |ptr%=start%....b|
000002d0  6c 6b 25 21 30 3d 32 35  36 0d 00 f0 0e 62 6c 6b  |lk%!0=256....blk|
000002e0  25 21 31 32 3d 30 3a 0d  00 fa 0e 62 6c 6b 25 21  |%!12=0:....blk%!|
000002f0  31 36 3d 31 3a 0d 01 04  13 62 6c 6b 25 21 32 30  |16=1:....blk%!20|
00000300  3d 77 69 6e 64 6f 77 25  0d 01 0e 11 62 6c 6b 25  |=window%....blk%|
00000310  21 32 34 3d 69 63 6f 6e  25 0d 01 18 0e 62 6c 6b  |!24=icon%....blk|
00000320  25 21 32 38 3d 78 25 0d  01 22 0e 62 6c 6b 25 21  |%!28=x%..".blk%!|
00000330  33 32 3d 79 25 0d 01 2c  11 62 6c 6b 25 21 33 36  |32=y%..,.blk%!36|
00000340  3d 73 69 7a 65 25 0d 01  36 11 62 6c 6b 25 21 34  |=size%..6.blk%!4|
00000350  30 3d 74 79 70 65 25 0d  01 40 17 24 28 62 6c 6b  |0=type%..@.$(blk|
00000360  25 2b 34 34 29 3d 66 69  6c 65 24 2b bd 30 0d 01  |%+44)=file$+.0..|
00000370  4a 43 c8 99 20 22 57 69  6d 70 5f 53 65 6e 64 4d  |JC.. "Wimp_SendM|
00000380  65 73 73 61 67 65 22 2c  31 37 2c 62 6c 6b 25 2c  |essage",17,blk%,|
00000390  77 69 6e 64 6f 77 25 2c  69 63 6f 6e 25 20 b8 20  |window%,icon% . |
000003a0  64 65 73 74 69 6e 61 74  69 6f 6e 5f 74 61 73 6b  |destination_task|
000003b0  25 0d 01 54 05 e1 0d 01  5e 2c dd a4 6c 6f 61 64  |%..T....^,..load|
000003c0  5f 64 61 74 61 28 66 69  6c 65 5f 70 61 74 68 24  |_data(file_path$|
000003d0  2c 73 74 61 72 74 25 2c  6d 61 78 5f 73 69 7a 65  |,start%,max_size|
000003e0  25 29 0d 01 68 10 ea 20  72 65 61 6c 5f 73 69 7a  |%)..h.. real_siz|
000003f0  65 25 0d 01 72 25 72 65  61 6c 5f 73 69 7a 65 25  |e%..r%real_size%|
00000400  3d a4 66 69 6c 65 5f 73  69 7a 65 28 66 69 6c 65  |=.file_size(file|
00000410  5f 70 61 74 68 24 29 0d  01 7c 1c e7 20 72 65 61  |_path$)..|.. rea|
00000420  6c 5f 73 69 7a 65 25 3e  6d 61 78 5f 73 69 7a 65  |l_size%>max_size|
00000430  25 20 8c 0d 01 86 44 f2  72 65 70 6f 72 74 5f 65  |% ....D.report_e|
00000440  72 72 6f 72 28 22 46 69  6c 65 20 74 6f 20 6c 6f  |rror("File to lo|
00000450  61 64 20 69 73 20 74 6f  6f 20 6c 61 72 67 65 21  |ad is too large!|
00000460  22 2c 22 44 61 74 61 20  6c 6f 61 64 69 6e 67 20  |","Data loading |
00000470  65 72 72 6f 72 22 29 0d  01 90 06 3d 30 0d 01 9a  |error")....=0...|
00000480  05 cd 0d 01 a4 24 c8 99  22 4f 53 5f 46 69 6c 65  |.....$.."OS_File|
00000490  22 2c 31 36 2c 66 69 6c  65 5f 70 61 74 68 24 2c  |",16,file_path$,|
000004a0  73 74 61 72 74 25 0d 01  ae 0f 3d 72 65 61 6c 5f  |start%....=real_|
000004b0  73 69 7a 65 25 0d 01 b8  18 dd 20 f2 6d 65 73 73  |size%..... .mess|
000004c0  61 67 65 5f 66 69 6c 65  5f 73 61 76 65 0d 01 c2  |age_file_save...|
000004d0  13 72 61 6d 5f 74 72 61  6e 73 66 65 72 25 3d a3  |.ram_transfer%=.|
000004e0  0d 01 cc 2a e7 20 a4 73  79 73 74 65 6d 5f 76 61  |...*. .system_va|
000004f0  72 69 61 62 6c 65 28 22  57 69 6d 70 24 53 63 72  |riable("Wimp$Scr|
00000500  61 70 22 29 3c 3e 22 22  20 8c 0d 01 d6 0e 62 6c  |ap")<>"" .....bl|
00000510  6b 25 21 33 36 3d 2d 31  0d 01 e0 20 24 28 62 6c  |k%!36=-1... $(bl|
00000520  6b 25 2b 34 34 29 3d 22  3c 57 69 6d 70 24 53 63  |k%+44)="<Wimp$Sc|
00000530  72 61 70 3e 22 2b bd 30  0d 01 ea 0d 62 6c 6b 25  |rap>"+.0....blk%|
00000540  21 30 3d 36 34 0d 01 f4  41 62 6c 6b 25 21 31 32  |!0=64...Ablk%!12|
00000550  3d 62 6c 6b 25 21 38 3a  62 6c 6b 25 21 31 36 3d  |=blk%!8:blk%!16=|
00000560  32 3a c8 99 20 22 57 69  6d 70 5f 53 65 6e 64 4d  |2:.. "Wimp_SendM|
00000570  65 73 73 61 67 65 22 2c  31 37 2c 62 6c 6b 25 2c  |essage",17,blk%,|
00000580  62 6c 6b 25 21 34 0d 01  fe 05 cc 0d 02 08 48 f2  |blk%!4........H.|
00000590  72 65 70 6f 72 74 5f 65  72 72 6f 72 28 22 57 69  |report_error("Wi|
000005a0  6d 70 24 53 63 72 61 70  20 6e 6f 74 20 66 6f 75  |mp$Scrap not fou|
000005b0  6e 64 2e 20 52 75 6e 20  21 53 79 73 74 65 6d 20  |nd. Run !System |
000005c0  6f 72 20 21 53 63 72 61  70 22 2c 22 45 72 72 6f  |or !Scrap","Erro|
000005d0  72 22 29 0d 02 12 05 cd  0d 02 1c 05 e1 0d 02 26  |r")............&|
000005e0  24 dd a4 6d 65 73 73 61  67 65 5f 6c 6f 61 64 28  |$..message_load(|
000005f0  73 74 61 72 74 25 2c 6d  61 78 5f 73 69 7a 65 25  |start%,max_size%|
00000600  29 0d 02 30 1e ea 20 66  69 6c 65 5f 74 6f 5f 6c  |)..0.. file_to_l|
00000610  6f 61 64 24 2c 66 69 6c  65 5f 73 69 7a 65 25 0d  |oad$,file_size%.|
00000620  02 3a 2a 66 69 6c 65 5f  74 6f 5f 6c 6f 61 64 24  |.:*file_to_load$|
00000630  3d a4 67 65 74 5f 73 74  72 69 6e 67 28 62 6c 6b  |=.get_string(blk|
00000640  25 2b 34 34 2c 32 35 35  29 0d 02 44 39 66 69 6c  |%+44,255)..D9fil|
00000650  65 5f 73 69 7a 65 25 3d  a4 6c 6f 61 64 5f 64 61  |e_size%=.load_da|
00000660  74 61 28 66 69 6c 65 5f  74 6f 5f 6c 6f 61 64 24  |ta(file_to_load$|
00000670  2c 73 74 61 72 74 25 2c  6d 61 78 5f 73 69 7a 65  |,start%,max_size|
00000680  25 29 0d 02 4e 3b e7 20  66 69 6c 65 5f 74 6f 5f  |%)..N;. file_to_|
00000690  6c 6f 61 64 24 3d 22 3c  57 69 6d 70 24 53 63 72  |load$="<Wimp$Scr|
000006a0  61 70 3e 22 20 8c 20 2a  44 45 4c 45 54 45 20 22  |ap>" . *DELETE "|
000006b0  3c 57 69 6d 70 24 53 63  72 61 70 3e 22 0d 02 58  |<Wimp$Scrap>"..X|
000006c0  41 62 6c 6b 25 21 31 32  3d 62 6c 6b 25 21 38 3a  |Ablk%!12=blk%!8:|
000006d0  62 6c 6b 25 21 31 36 3d  34 3a c8 99 20 22 57 69  |blk%!16=4:.. "Wi|
000006e0  6d 70 5f 53 65 6e 64 4d  65 73 73 61 67 65 22 2c  |mp_SendMessage",|
000006f0  31 37 2c 62 6c 6b 25 2c  62 6c 6b 25 21 34 0d 02  |17,blk%,blk%!4..|
00000700  62 0f 3d 66 69 6c 65 5f  73 69 7a 65 25 0d 02 6c  |b.=file_size%..l|
00000710  2d dd 20 f2 6d 65 73 73  61 67 65 5f 73 61 76 65  |-. .message_save|
00000720  5f 6f 6b 28 6d 79 5f 61  64 64 72 65 73 73 25 2c  |_ok(my_address%,|
00000730  6d 61 78 5f 73 69 7a 65  25 29 0d 02 76 13 72 61  |max_size%)..v.ra|
00000740  6d 5f 74 72 61 6e 73 66  65 72 25 3d b9 0d 02 80  |m_transfer%=....|
00000750  13 72 61 6d 5f 74 72 61  6e 73 6d 69 74 25 3d a3  |.ram_transmit%=.|
00000760  0d 02 8a 1f 6d 65 6d 5f  61 72 65 61 5f 73 74 61  |....mem_area_sta|
00000770  72 74 25 3d 6d 79 5f 61  64 64 72 65 73 73 25 0d  |rt%=my_address%.|
00000780  02 94 1c 6d 65 6d 5f 61  72 65 61 5f 73 69 7a 65  |...mem_area_size|
00000790  25 3d 6d 61 78 5f 73 69  7a 65 25 0d 02 9e 14 6d  |%=max_size%....m|
000007a0  65 6d 5f 64 61 74 61 5f  73 69 7a 65 25 3d 30 0d  |em_data_size%=0.|
000007b0  02 a8 1b 62 6c 6b 25 21  32 30 3d 6d 65 6d 5f 61  |...blk%!20=mem_a|
000007c0  72 65 61 5f 73 74 61 72  74 25 0d 02 b2 1b 62 6c  |rea_start%....bl|
000007d0  6b 25 21 32 34 3d 72 61  6d 5f 62 6c 6f 63 6b 5f  |k%!24=ram_block_|
000007e0  73 69 7a 65 25 0d 02 bc  12 62 6c 6b 25 21 31 32  |size%....blk%!12|
000007f0  3d 62 6c 6b 25 21 38 0d  02 c6 0d 62 6c 6b 25 21  |=blk%!8....blk%!|
00000800  31 36 3d 36 0d 02 d0 27  c8 99 22 57 69 6d 70 5f  |16=6...'.."Wimp_|
00000810  53 65 6e 64 4d 65 73 73  61 67 65 22 2c 31 37 2c  |SendMessage",17,|
00000820  62 6c 6b 25 2c 62 6c 6b  25 21 34 0d 02 da 05 e1  |blk%,blk%!4.....|
00000830  0d 02 e4 18 dd f2 6d 65  73 73 61 67 65 5f 73 61  |......message_sa|
00000840  76 65 5f 72 65 70 6c 79  0d 02 ee 41 62 6c 6b 25  |ve_reply...Ablk%|
00000850  21 31 32 3d 62 6c 6b 25  21 38 3a 62 6c 6b 25 21  |!12=blk%!8:blk%!|
00000860  31 36 3d 33 3a c8 99 20  22 57 69 6d 70 5f 53 65  |16=3:.. "Wimp_Se|
00000870  6e 64 4d 65 73 73 61 67  65 22 2c 31 37 2c 62 6c  |ndMessage",17,bl|
00000880  6b 25 2c 62 6c 6b 25 21  34 0d 02 f8 05 e1 0d 03  |k%,blk%!4.......|
00000890  02 18 dd f2 72 61 6d 5f  74 72 61 6e 73 66 65 72  |....ram_transfer|
000008a0  5f 72 65 70 6c 79 0d 03  0c 1a ea 20 62 75 66 5f  |_reply..... buf_|
000008b0  73 69 7a 65 25 2c 64 61  74 61 5f 73 69 7a 65 25  |size%,data_size%|
000008c0  0d 03 16 15 62 75 66 5f  73 69 7a 65 25 3d 62 6c  |....buf_size%=bl|
000008d0  6b 25 21 32 34 0d 03 20  4c c8 99 22 57 69 6d 70  |k%!24.. L.."Wimp|
000008e0  5f 54 72 61 6e 73 66 65  72 42 6c 6f 63 6b 22 2c  |_TransferBlock",|
000008f0  74 68 69 73 5f 74 61 73  6b 25 2c 6d 65 6d 5f 64  |this_task%,mem_d|
00000900  61 74 61 5f 70 74 72 25  2c 62 6c 6b 25 21 34 2c  |ata_ptr%,blk%!4,|
00000910  62 6c 6b 25 21 32 30 2c  62 75 66 5f 73 69 7a 65  |blk%!20,buf_size|
00000920  25 0d 03 2a 3b 64 61 74  61 5f 73 69 7a 65 25 3d  |%..*;data_size%=|
00000930  6d 65 6d 5f 61 72 65 61  5f 73 74 61 72 74 25 2b  |mem_area_start%+|
00000940  6d 65 6d 5f 64 61 74 61  5f 73 69 7a 65 25 2d 6d  |mem_data_size%-m|
00000950  65 6d 5f 64 61 74 61 5f  70 74 72 25 0d 03 34 3f  |em_data_ptr%..4?|
00000960  e7 20 64 61 74 61 5f 73  69 7a 65 25 3e 62 75 66  |. data_size%>buf|
00000970  5f 73 69 7a 65 25 20 8c  20 64 61 74 61 5f 73 69  |_size% . data_si|
00000980  7a 65 25 3d 62 75 66 5f  73 69 7a 65 25 20 8b 20  |ze%=buf_size% . |
00000990  f2 6d 65 6e 75 5f 63 6c  6f 73 65 0d 03 3e 1d 6d  |.menu_close..>.m|
000009a0  65 6d 5f 64 61 74 61 5f  70 74 72 25 2b 3d 64 61  |em_data_ptr%+=da|
000009b0  74 61 5f 73 69 7a 65 25  0d 03 48 2f 62 6c 6b 25  |ta_size%..H/blk%|
000009c0  21 31 32 3d 62 6c 6b 25  21 38 3a 62 6c 6b 25 21  |!12=blk%!8:blk%!|
000009d0  31 36 3d 37 3a 62 6c 6b  25 21 32 34 3d 64 61 74  |16=7:blk%!24=dat|
000009e0  61 5f 73 69 7a 65 25 0d  03 52 28 c8 99 20 22 57  |a_size%..R(.. "W|
000009f0  69 6d 70 5f 53 65 6e 64  4d 65 73 73 61 67 65 22  |imp_SendMessage"|
00000a00  2c 31 37 2c 62 6c 6b 25  2c 62 6c 6b 25 21 34 0d  |,17,blk%,blk%!4.|
00000a10  03 5c 05 e1 0d 03 66 12  dd f2 72 61 6d 5f 74 72  |.\....f...ram_tr|
00000a20  61 6e 73 6d 69 74 0d 03  70 13 72 61 6d 5f 74 72  |ansmit..p.ram_tr|
00000a30  61 6e 73 6d 69 74 25 3d  b9 0d 03 7a 1b 6d 65 6d  |ansmit%=...z.mem|
00000a40  5f 64 61 74 61 5f 73 69  7a 65 25 2b 3d 62 6c 6b  |_data_size%+=blk|
00000a50  25 21 32 34 0d 03 84 1f  e7 20 62 6c 6b 25 21 32  |%!24..... blk%!2|
00000a60  34 3d 72 61 6d 5f 62 6c  6f 63 6b 5f 73 69 7a 65  |4=ram_block_size|
00000a70  25 20 8c 0d 03 8e 35 e7  20 6d 65 6d 5f 64 61 74  |% ....5. mem_dat|
00000a80  61 5f 73 69 7a 65 25 2b  72 61 6d 5f 62 6c 6f 63  |a_size%+ram_bloc|
00000a90  6b 5f 73 69 7a 65 25 3e  6d 65 6d 5f 61 72 65 61  |k_size%>mem_area|
00000aa0  5f 73 69 7a 65 25 20 8c  0d 03 98 45 f2 72 65 70  |_size% ....E.rep|
00000ab0  6f 72 74 5f 65 72 72 6f  72 28 22 49 6e 73 75 66  |ort_error("Insuf|
00000ac0  66 69 63 69 65 6e 74 20  72 6f 6f 6d 20 66 6f 72  |ficient room for|
00000ad0  20 64 61 74 61 21 22 2c  22 52 41 4d 20 74 72 61  | data!","RAM tra|
00000ae0  6e 73 66 65 72 20 65 72  72 6f 72 22 29 0d 03 a2  |nsfer error")...|
00000af0  14 6d 65 6d 5f 64 61 74  61 5f 73 69 7a 65 25 3d  |.mem_data_size%=|
00000b00  30 0d 03 ac 05 cc 0d 03  b6 1c 62 6c 6b 25 21 32  |0.........blk%!2|
00000b10  30 2b 3d 72 61 6d 5f 62  6c 6f 63 6b 5f 73 69 7a  |0+=ram_block_siz|
00000b20  65 25 0d 03 c0 1c 62 6c  6b 25 21 31 32 3d 62 6c  |e%....blk%!12=bl|
00000b30  6b 25 21 38 3a 62 6c 6b  25 21 31 36 3d 36 0d 03  |k%!8:blk%!16=6..|
00000b40  ca 28 c8 99 20 22 57 69  6d 70 5f 53 65 6e 64 4d  |.(.. "Wimp_SendM|
00000b50  65 73 73 61 67 65 22 2c  31 38 2c 62 6c 6b 25 2c  |essage",18,blk%,|
00000b60  62 6c 6b 25 21 34 0d 03  d4 05 cd 0d 03 de 05 cc  |blk%!4..........|
00000b70  0d 03 e8 05 cd 0d 03 f2  05 e1 0d 03 fc 35 dd f2  |.............5..|
00000b80  73 61 76 65 5f 64 61 74  61 28 66 69 6c 65 5f 6e  |save_data(file_n|
00000b90  61 6d 65 24 2c 66 69 6c  65 5f 74 79 70 65 25 2c  |ame$,file_type%,|
00000ba0  73 74 61 72 74 25 2c 6c  65 6e 67 74 68 25 29 0d  |start%,length%).|
00000bb0  04 06 3f c8 99 22 4f 53  5f 46 69 6c 65 22 2c 31  |..?.."OS_File",1|
00000bc0  30 2c 66 69 6c 65 5f 6e  61 6d 65 24 2c 66 69 6c  |0,file_name$,fil|
00000bd0  65 5f 74 79 70 65 25 2c  2c 73 74 61 72 74 25 2c  |e_type%,,start%,|
00000be0  73 74 61 72 74 25 2b 6c  65 6e 67 74 68 25 0d 04  |start%+length%..|
00000bf0  10 05 e1 0d 04 1a 3d dd  a4 61 64 64 5f 69 63 6f  |......=..add_ico|
00000c00  6e 28 74 79 70 65 24 2c  74 65 78 74 24 2c 77 69  |n(type$,text$,wi|
00000c10  6e 64 6f 77 25 2c 78 25  2c 79 25 2c 73 6c 25 2c  |ndow%,x%,y%,sl%,|
00000c20  65 73 67 5f 73 70 25 2c  62 6f 72 64 65 72 25 29  |esg_sp%,border%)|
00000c30  0d 04 24 47 ea 20 69 63  6f 6e 25 2c 74 65 78 74  |..$G. icon%,text|
00000c40  5f 73 70 61 63 65 25 2c  6e 61 6d 65 5f 73 70 61  |_space%,name_spa|
00000c50  63 65 25 2c 76 61 6c 5f  73 70 61 63 65 25 2c 77  |ce%,val_space%,w|
00000c60  25 2c 68 25 2c 6d 6f 64  65 25 2c 78 73 25 2c 79  |%,h%,mode%,xs%,y|
00000c70  73 25 2c 73 65 6c 25 0d  04 2e 0d 73 65 6c 25 3d  |s%,sel%....sel%=|
00000c80  73 6c 25 3a 0d 04 38 1b  e7 20 73 6c 25 3c a9 74  |sl%:..8.. sl%<.t|
00000c90  65 78 74 24 20 73 6c 25  3d a9 74 65 78 74 24 0d  |ext$ sl%=.text$.|
00000ca0  04 42 1b e7 20 73 6c 25  3c a9 74 79 70 65 24 20  |.B.. sl%<.type$ |
00000cb0  73 6c 25 3d a9 74 79 70  65 24 0d 04 4c 15 de 20  |sl%=.type$..L.. |
00000cc0  74 65 78 74 5f 73 70 61  63 65 25 20 73 6c 25 0d  |text_space% sl%.|
00000cd0  04 56 17 74 65 6d 70 5f  62 6c 6b 25 21 30 3d 77  |.V.temp_blk%!0=w|
00000ce0  69 6e 64 6f 77 25 0d 04  60 12 74 65 6d 70 5f 62  |indow%..`.temp_b|
00000cf0  6c 6b 25 21 34 3d 78 25  0d 04 6a 15 74 65 6d 70  |lk%!4=x%..j.temp|
00000d00  5f 62 6c 6b 25 21 38 3d  79 25 2d 34 38 0d 04 74  |_blk%!8=y%-48..t|
00000d10  20 74 65 6d 70 5f 62 6c  6b 25 21 31 32 3d 78 25  | temp_blk%!12=x%|
00000d20  2b 31 36 2b 31 36 2a a9  74 65 78 74 24 0d 04 7e  |+16+16*.text$..~|
00000d30  13 74 65 6d 70 5f 62 6c  6b 25 21 31 36 3d 79 25  |.temp_blk%!16=y%|
00000d40  0d 04 88 16 24 74 65 78  74 5f 73 70 61 63 65 25  |....$text_space%|
00000d50  3d 74 65 78 74 24 0d 04  92 1a 74 65 6d 70 5f 62  |=text$....temp_b|
00000d60  6c 6b 25 21 32 30 3d 26  31 37 30 30 30 31 33 39  |lk%!20=&17000139|
00000d70  0d 04 9c 1c 74 65 6d 70  5f 62 6c 6b 25 21 32 34  |....temp_blk%!24|
00000d80  3d 74 65 78 74 5f 73 70  61 63 65 25 0d 04 a6 13  |=text_space%....|
00000d90  74 65 6d 70 5f 62 6c 6b  25 21 32 38 3d 2d 31 0d  |temp_blk%!28=-1.|
00000da0  04 b0 17 74 65 6d 70 5f  62 6c 6b 25 21 33 32 3d  |...temp_blk%!32=|
00000db0  a9 74 65 78 74 24 0d 04  ba 12 c8 8e 20 c0 74 79  |.text$...... .ty|
00000dc0  70 65 24 2c 35 29 20 ca  0d 04 c4 0d c9 20 22 66  |pe$,5) ...... "f|
00000dd0  69 6c 65 5f 22 0d 04 ce  37 c8 99 22 57 69 6d 70  |ile_"...7.."Wimp|
00000de0  5f 53 70 72 69 74 65 4f  70 22 2c 26 32 38 2c 2c  |_SpriteOp",&28,,|
00000df0  74 79 70 65 24 2b bd 28  30 29 20 b8 20 2c 2c 2c  |type$+.(0) . ,,,|
00000e00  77 25 2c 68 25 2c 2c 6d  6f 64 65 25 0d 04 d8 2b  |w%,h%,,mode%...+|
00000e10  c8 99 22 4f 53 5f 52 65  61 64 4d 6f 64 65 56 61  |.."OS_ReadModeVa|
00000e20  72 69 61 62 6c 65 22 2c  6d 6f 64 65 25 2c 34 20  |riable",mode%,4 |
00000e30  b8 20 2c 2c 78 73 25 0d  04 e2 2b c8 99 22 4f 53  |. ,,xs%...+.."OS|
00000e40  5f 52 65 61 64 4d 6f 64  65 56 61 72 69 61 62 6c  |_ReadModeVariabl|
00000e50  65 22 2c 6d 6f 64 65 25  2c 35 20 b8 20 2c 2c 79  |e",mode%,5 . ,,y|
00000e60  73 25 0d 04 ec 0e 68 25  3d 68 25 3c 3c 79 73 25  |s%....h%=h%<<ys%|
00000e70  0d 04 f6 0e 77 25 3d 77  25 3c 3c 78 73 25 0d 05  |....w%=w%<<xs%..|
00000e80  00 10 e7 20 74 65 78 74  24 3d 22 22 20 8c 0d 05  |... text$="" ...|
00000e90  0a 15 74 65 6d 70 5f 62  6c 6b 25 21 38 3d 79 25  |..temp_blk%!8=y%|
00000ea0  2d 68 25 0d 05 14 16 74  65 6d 70 5f 62 6c 6b 25  |-h%....temp_blk%|
00000eb0  21 31 32 3d 78 25 2b 77  25 0d 05 1e 1a 74 65 6d  |!12=x%+w%....tem|
00000ec0  70 5f 62 6c 6b 25 21 32  30 3d 26 31 37 30 30 36  |p_blk%!20=&17006|
00000ed0  31 33 41 0d 05 28 12 74  65 6d 70 5f 62 6c 6b 25  |13A..(.temp_blk%|
00000ee0  21 32 38 3d 31 0d 05 32  17 74 65 6d 70 5f 62 6c  |!28=1..2.temp_bl|
00000ef0  6b 25 21 33 32 3d a9 74  79 70 65 24 0d 05 3c 16  |k%!32=.type$..<.|
00000f00  24 74 65 78 74 5f 73 70  61 63 65 25 3d 74 79 70  |$text_space%=typ|
00000f10  65 24 0d 05 46 05 cc 0d  05 50 1f 74 65 6d 70 5f  |e$..F....P.temp_|
00000f20  62 6c 6b 25 21 38 3d 79  25 2d 68 25 2d 28 31 30  |blk%!8=y%-h%-(10|
00000f30  3c 3c 79 73 25 29 0d 05  5a 17 73 6c 25 3d 28 38  |<<ys%)..Z.sl%=(8|
00000f40  3c 3c 78 73 25 29 2a a9  74 65 78 74 24 0d 05 64  |<<xs%)*.text$..d|
00000f50  13 e7 20 73 6c 25 3e 77  25 20 77 25 3d 73 6c 25  |.. sl%>w% w%=sl%|
00000f60  0d 05 6e 16 74 65 6d 70  5f 62 6c 6b 25 21 31 32  |..n.temp_blk%!12|
00000f70  3d 78 25 2b 77 25 0d 05  78 1a 74 65 6d 70 5f 62  |=x%+w%..x.temp_b|
00000f80  6c 6b 25 21 32 30 3d 26  31 37 30 30 36 31 32 42  |lk%!20=&1700612B|
00000f90  0d 05 82 1c de 20 6e 61  6d 65 5f 73 70 61 63 65  |..... name_space|
00000fa0  25 20 28 32 2b a9 74 79  70 65 24 29 0d 05 8c 1a  |% (2+.type$)....|
00000fb0  24 6e 61 6d 65 5f 73 70  61 63 65 25 3d 22 73 22  |$name_space%="s"|
00000fc0  2b 74 79 70 65 24 0d 05  96 1c 74 65 6d 70 5f 62  |+type$....temp_b|
00000fd0  6c 6b 25 21 32 38 3d 6e  61 6d 65 5f 73 70 61 63  |lk%!28=name_spac|
00000fe0  65 25 0d 05 a0 05 cd 0d  05 aa 0d c9 20 22 73 70  |e%.......... "sp|
00000ff0  72 69 74 22 0d 05 b4 3d  c8 99 22 4f 53 5f 53 70  |rit"...=.."OS_Sp|
00001000  72 69 74 65 4f 70 22 2c  26 31 32 38 2c 65 73 67  |riteOp",&128,esg|
00001010  5f 73 70 25 2c 74 65 78  74 24 2b bd 28 30 29 20  |_sp%,text$+.(0) |
00001020  b8 20 2c 2c 2c 77 25 2c  68 25 2c 2c 6d 6f 64 65  |. ,,,w%,h%,,mode|
00001030  25 0d 05 be 2b c8 99 22  4f 53 5f 52 65 61 64 4d  |%...+.."OS_ReadM|
00001040  6f 64 65 56 61 72 69 61  62 6c 65 22 2c 6d 6f 64  |odeVariable",mod|
00001050  65 25 2c 34 20 b8 20 2c  2c 78 73 25 0d 05 c8 2b  |e%,4 . ,,xs%...+|
00001060  c8 99 22 4f 53 5f 52 65  61 64 4d 6f 64 65 56 61  |.."OS_ReadModeVa|
00001070  72 69 61 62 6c 65 22 2c  6d 6f 64 65 25 2c 35 20  |riable",mode%,5 |
00001080  b8 20 2c 2c 79 73 25 0d  05 d2 0e 68 25 3d 68 25  |. ,,ys%....h%=h%|
00001090  3c 3c 79 73 25 0d 05 dc  0e 77 25 3d 77 25 3c 3c  |<<ys%....w%=w%<<|
000010a0  78 73 25 0d 05 e6 15 74  65 6d 70 5f 62 6c 6b 25  |xs%....temp_blk%|
000010b0  21 38 3d 79 25 2d 68 25  0d 05 f0 16 74 65 6d 70  |!8=y%-h%....temp|
000010c0  5f 62 6c 6b 25 21 31 32  3d 78 25 2b 77 25 0d 05  |_blk%!12=x%+w%..|
000010d0  fa 1a 74 65 6d 70 5f 62  6c 6b 25 21 32 30 3d 26  |..temp_blk%!20=&|
000010e0  31 37 30 30 33 31 33 41  0d 06 04 18 74 65 6d 70  |1700313A....temp|
000010f0  5f 62 6c 6b 25 21 32 38  3d 65 73 67 5f 73 70 25  |_blk%!28=esg_sp%|
00001100  0d 06 0e 17 74 65 6d 70  5f 62 6c 6b 25 21 33 32  |....temp_blk%!32|
00001110  3d a9 74 65 78 74 24 0d  06 18 16 24 74 65 78 74  |=.text$....$text|
00001120  5f 73 70 61 63 65 25 3d  74 65 78 74 24 0d 06 22  |_space%=text$.."|
00001130  0d c9 20 22 6c 61 62 65  6c 22 0d 06 2c 0d c9 20  |.. "label"..,.. |
00001140  22 61 63 74 69 6f 22 0d  06 36 1b 74 65 6d 70 5f  |"actio"..6.temp_|
00001150  62 6c 6b 25 21 32 30 3d  26 43 37 31 46 39 31 33  |blk%!20=&C71F913|
00001160  44 3a 0d 06 40 0d c9 20  22 72 65 70 6f 72 22 0d  |D:..@.. "repor".|
00001170  06 4a 1b 74 65 6d 70 5f  62 6c 6b 25 21 32 30 3d  |.J.temp_blk%!20=|
00001180  26 30 37 30 30 33 31 33  44 3a 0d 06 54 0d c9 20  |&0700313D:..T.. |
00001190  22 6f 70 74 69 6f 22 0d  06 5e 15 74 65 6d 70 5f  |"optio"..^.temp_|
000011a0  62 6c 6b 25 21 38 3d 79  25 2d 35 32 0d 06 68 23  |blk%!8=y%-52..h#|
000011b0  74 65 6d 70 5f 62 6c 6b  25 21 31 32 3d 78 25 2b  |temp_blk%!12=x%+|
000011c0  34 30 2b 31 36 2b 31 36  2a a9 74 65 78 74 24 0d  |40+16+16*.text$.|
000011d0  06 72 1a 74 65 6d 70 5f  62 6c 6b 25 21 32 30 3d  |.r.temp_blk%!20=|
000011e0  26 31 37 30 30 42 31 33  33 0d 06 7c 22 e7 20 73  |&1700B133..|". s|
000011f0  65 6c 25 20 74 65 6d 70  5f 62 6c 6b 25 21 32 30  |el% temp_blk%!20|
00001200  3d 26 31 37 33 30 33 31  33 33 3a 0d 06 86 26 de  |=&17303133:...&.|
00001210  20 76 61 6c 5f 73 70 61  63 65 25 20 28 32 2b a9  | val_space% (2+.|
00001220  22 73 6f 70 74 6f 66 66  2c 6f 70 74 6f 6e 22 29  |"soptoff,opton")|
00001230  3a 0d 06 90 1f 24 76 61  6c 5f 73 70 61 63 65 25  |:....$val_space%|
00001240  3d 22 73 6f 70 74 6f 66  66 2c 6f 70 74 6f 6e 22  |="soptoff,opton"|
00001250  0d 06 9a 1b 74 65 6d 70  5f 62 6c 6b 25 21 32 38  |....temp_blk%!28|
00001260  3d 76 61 6c 5f 73 70 61  63 65 25 0d 06 a4 0d c9  |=val_space%.....|
00001270  20 22 72 61 64 69 6f 22  0d 06 ae 15 74 65 6d 70  | "radio"....temp|
00001280  5f 62 6c 6b 25 21 38 3d  79 25 2d 35 32 0d 06 b8  |_blk%!8=y%-52...|
00001290  23 74 65 6d 70 5f 62 6c  6b 25 21 31 32 3d 78 25  |#temp_blk%!12=x%|
000012a0  2b 34 30 2b 31 36 2b 31  36 2a a9 74 65 78 74 24  |+40+16+16*.text$|
000012b0  0d 06 c2 2c e7 20 28 65  73 67 5f 73 70 25 3c 31  |...,. (esg_sp%<1|
000012c0  29 20 84 20 28 65 73 67  5f 73 70 25 3e 33 31 29  |) . (esg_sp%>31)|
000012d0  20 8c 20 65 73 67 5f 73  70 25 3d 31 0d 06 cc 2d  | . esg_sp%=1...-|
000012e0  74 65 6d 70 5f 62 6c 6b  25 21 32 30 3d 26 31 37  |temp_blk%!20=&17|
000012f0  30 30 42 31 33 33 20 84  20 28 65 73 67 5f 73 70  |00B133 . (esg_sp|
00001300  25 2a 26 31 30 30 30 30  29 0d 06 d6 35 e7 20 73  |%*&10000)...5. s|
00001310  65 6c 25 20 74 65 6d 70  5f 62 6c 6b 25 21 32 30  |el% temp_blk%!20|
00001320  3d 26 31 37 32 30 42 31  33 33 20 84 20 28 65 73  |=&1720B133 . (es|
00001330  67 5f 73 70 25 2a 26 31  30 30 30 30 29 3a 0d 06  |g_sp%*&10000):..|
00001340  e0 2b de 20 74 65 78 74  5f 73 70 61 63 65 25 20  |.+. text_space% |
00001350  28 32 2b a9 22 73 72 61  64 69 6f 6f 66 66 2c 72  |(2+."sradiooff,r|
00001360  61 64 69 6f 6f 6e 22 29  3a 0d 06 ea 24 24 74 65  |adioon"):...$$te|
00001370  78 74 5f 73 70 61 63 65  25 3d 22 73 72 61 64 69  |xt_space%="sradi|
00001380  6f 6f 66 66 2c 72 61 64  69 6f 6f 6e 22 0d 06 f4  |ooff,radioon"...|
00001390  1c 74 65 6d 70 5f 62 6c  6b 25 21 32 38 3d 74 65  |.temp_blk%!28=te|
000013a0  78 74 5f 73 70 61 63 65  25 0d 06 fe 0d c9 20 22  |xt_space%..... "|
000013b0  77 72 69 74 65 22 0d 07  08 20 74 65 6d 70 5f 62  |write"... temp_b|
000013c0  6c 6b 25 21 31 32 3d 78  25 2b 31 36 2b 31 36 2a  |lk%!12=x%+16+16*|
000013d0  a9 74 65 78 74 24 0d 07  12 1a 74 65 6d 70 5f 62  |.text$....temp_b|
000013e0  6c 6b 25 21 32 30 3d 26  30 37 30 30 46 31 33 35  |lk%!20=&0700F135|
000013f0  0d 07 1c 14 de 20 76 61  6c 5f 73 70 61 63 65 25  |..... val_space%|
00001400  20 31 36 3a 0d 07 26 12  24 76 61 6c 5f 73 70 61  | 16:..&.$val_spa|
00001410  63 65 25 3d 22 22 0d 07  30 1b 74 65 6d 70 5f 62  |ce%=""..0.temp_b|
00001420  6c 6b 25 21 32 38 3d 76  61 6c 5f 73 70 61 63 65  |lk%!28=val_space|
00001430  25 0d 07 3a 1f e7 20 73  65 6c 25 3c 28 a9 74 65  |%..:.. sel%<(.te|
00001440  78 74 24 29 20 73 65 6c  25 3d a9 74 65 78 74 24  |xt$) sel%=.text$|
00001450  0d 07 44 17 74 65 6d 70  5f 62 6c 6b 25 21 33 32  |..D.temp_blk%!32|
00001460  3d 73 65 6c 25 2b 31 0d  07 4e 05 cb 0d 07 58 2b  |=sel%+1..N....X+|
00001470  c8 99 20 22 57 69 6d 70  5f 43 72 65 61 74 65 49  |.. "Wimp_CreateI|
00001480  63 6f 6e 22 2c 2c 74 65  6d 70 5f 62 6c 6b 25 20  |con",,temp_blk% |
00001490  b8 20 69 63 6f 6e 25 0d  07 62 2b e7 20 62 6f 72  |. icon%..b+. bor|
000014a0  64 65 72 25 3e 30 20 f2  62 6f 72 64 65 72 5f 69  |der%>0 .border_i|
000014b0  63 6f 6e 28 77 69 6e 64  6f 77 25 2c 69 63 6f 6e  |con(window%,icon|
000014c0  25 29 0d 07 6c 0a 3d 69  63 6f 6e 25 0d 07 76 44  |%)..l.=icon%..vD|
000014d0  dd a4 61 64 64 5f 69 63  6f 6e 5f 62 6c 6f 63 6b  |..add_icon_block|
000014e0  28 77 69 6e 64 6f 77 5f  68 61 6e 64 6c 65 25 2c  |(window_handle%,|
000014f0  6d 69 6e 78 25 2c 6d 69  6e 79 25 2c 6d 61 78 78  |minx%,miny%,maxx|
00001500  25 2c 6d 61 78 79 25 2c  63 6f 6c 6f 75 72 25 29  |%,maxy%,colour%)|
00001510  0d 07 80 0b ea 20 69 63  6f 6e 25 0d 07 8a 1e 74  |..... icon%....t|
00001520  65 6d 70 5f 62 6c 6b 25  21 30 3d 77 69 6e 64 6f  |emp_blk%!0=windo|
00001530  77 5f 68 61 6e 64 6c 65  25 0d 07 94 20 e7 20 6d  |w_handle%... . m|
00001540  69 6e 78 25 3e 6d 61 78  78 25 20 c8 94 20 6d 69  |inx%>maxx% .. mi|
00001550  6e 78 25 2c 6d 61 78 78  25 0d 07 9e 20 e7 20 6d  |nx%,maxx%... . m|
00001560  69 6e 79 25 3e 6d 61 78  79 25 20 c8 94 20 6d 69  |iny%>maxy% .. mi|
00001570  6e 79 25 2c 6d 61 78 79  25 0d 07 a8 1a e7 20 6d  |ny%,maxy%..... m|
00001580  69 6e 78 25 3d 6d 61 78  78 25 20 6d 61 78 78 25  |inx%=maxx% maxx%|
00001590  2b 3d 31 0d 07 b2 1a e7  20 6d 69 6e 79 25 3d 6d  |+=1..... miny%=m|
000015a0  61 78 79 25 20 6d 61 78  79 25 2b 3d 31 0d 07 bc  |axy% maxy%+=1...|
000015b0  15 74 65 6d 70 5f 62 6c  6b 25 21 34 3d 6d 69 6e  |.temp_blk%!4=min|
000015c0  78 25 0d 07 c6 15 74 65  6d 70 5f 62 6c 6b 25 21  |x%....temp_blk%!|
000015d0  38 3d 6d 69 6e 79 25 0d  07 d0 16 74 65 6d 70 5f  |8=miny%....temp_|
000015e0  62 6c 6b 25 21 31 32 3d  6d 61 78 78 25 0d 07 da  |blk%!12=maxx%...|
000015f0  16 74 65 6d 70 5f 62 6c  6b 25 21 31 36 3d 6d 61  |.temp_blk%!16=ma|
00001600  78 79 25 0d 07 e4 21 74  65 6d 70 5f 62 6c 6b 25  |xy%...!temp_blk%|
00001610  21 32 30 3d 33 32 2b 28  63 6f 6c 6f 75 72 25 3c  |!20=32+(colour%<|
00001620  3c 32 38 29 0d 07 ee 2b  c8 99 20 22 57 69 6d 70  |<28)...+.. "Wimp|
00001630  5f 43 72 65 61 74 65 49  63 6f 6e 22 2c 2c 74 65  |_CreateIcon",,te|
00001640  6d 70 5f 62 6c 6b 25 20  b8 20 69 63 6f 6e 25 0d  |mp_blk% . icon%.|
00001650  07 f8 0a 3d 69 63 6f 6e  25 0d 08 02 2e dd f2 62  |...=icon%......b|
00001660  6f 72 64 65 72 5f 69 63  6f 6e 28 77 69 6e 64 6f  |order_icon(windo|
00001670  77 5f 68 61 6e 64 6c 65  25 2c 69 63 6f 6e 5f 68  |w_handle%,icon_h|
00001680  61 6e 64 6c 65 25 29 0d  08 0c 31 ea 20 69 63 6f  |andle%)...1. ico|
00001690  6e 25 2c 6d 69 6e 78 25  2c 6d 69 6e 79 25 2c 6d  |n%,minx%,miny%,m|
000016a0  61 78 78 25 2c 6d 61 78  79 25 2c 66 6c 61 67 25  |axx%,maxy%,flag%|
000016b0  2c 74 6c 25 2c 62 72 25  0d 08 16 1e 74 65 6d 70  |,tl%,br%....temp|
000016c0  5f 62 6c 6b 25 21 30 3d  77 69 6e 64 6f 77 5f 68  |_blk%!0=window_h|
000016d0  61 6e 64 6c 65 25 0d 08  20 1c 74 65 6d 70 5f 62  |andle%.. .temp_b|
000016e0  6c 6b 25 21 34 3d 69 63  6f 6e 5f 68 61 6e 64 6c  |lk%!4=icon_handl|
000016f0  65 25 0d 08 2a 24 c8 99  22 57 69 6d 70 5f 47 65  |e%..*$.."Wimp_Ge|
00001700  74 49 63 6f 6e 53 74 61  74 65 22 2c 2c 74 65 6d  |tIconState",,tem|
00001710  70 5f 62 6c 6b 25 0d 08  34 15 6d 69 6e 78 25 3d  |p_blk%..4.minx%=|
00001720  74 65 6d 70 5f 62 6c 6b  25 21 38 0d 08 3e 16 6d  |temp_blk%!8..>.m|
00001730  69 6e 79 25 3d 74 65 6d  70 5f 62 6c 6b 25 21 31  |iny%=temp_blk%!1|
00001740  32 0d 08 48 16 6d 61 78  78 25 3d 74 65 6d 70 5f  |2..H.maxx%=temp_|
00001750  62 6c 6b 25 21 31 36 0d  08 52 16 6d 61 78 79 25  |blk%!16..R.maxy%|
00001760  3d 74 65 6d 70 5f 62 6c  6b 25 21 32 30 0d 08 5c  |=temp_blk%!20..\|
00001770  16 66 6c 61 67 25 3d 74  65 6d 70 5f 62 6c 6b 25  |.flag%=temp_blk%|
00001780  21 32 34 0d 08 66 0a 74  6c 25 3d 30 3a 0d 08 70  |!24..f.tl%=0:..p|
00001790  0a 62 72 25 3d 34 3a 0d  08 7a 43 e7 20 28 66 6c  |.br%=4:..zC. (fl|
000017a0  61 67 25 20 80 20 34 29  3d 34 20 6d 69 6e 78 25  |ag% . 4)=4 minx%|
000017b0  2d 3d 34 3a 6d 61 78 78  25 2b 3d 34 3a 6d 69 6e  |-=4:maxx%+=4:min|
000017c0  79 25 2d 3d 34 3a 6d 61  78 79 25 2b 3d 34 3a 74  |y%-=4:maxy%+=4:t|
000017d0  6c 25 3d 34 3a 62 72 25  3d 30 0d 08 84 4b 69 63  |l%=4:br%=0...Kic|
000017e0  6f 6e 25 3d a4 61 64 64  5f 69 63 6f 6e 5f 62 6c  |on%=.add_icon_bl|
000017f0  6f 63 6b 28 77 69 6e 64  6f 77 5f 68 61 6e 64 6c  |ock(window_handl|
00001800  65 25 2c 6d 61 78 78 25  2c 6d 69 6e 79 25 2d 34  |e%,maxx%,miny%-4|
00001810  2c 6d 61 78 78 25 2b 34  2c 6d 61 78 79 25 2b 34  |,maxx%+4,maxy%+4|
00001820  2c 62 72 25 29 0d 08 8e  4b 69 63 6f 6e 25 3d a4  |,br%)...Kicon%=.|
00001830  61 64 64 5f 69 63 6f 6e  5f 62 6c 6f 63 6b 28 77  |add_icon_block(w|
00001840  69 6e 64 6f 77 5f 68 61  6e 64 6c 65 25 2c 6d 69  |indow_handle%,mi|
00001850  6e 78 25 2d 34 2c 6d 61  78 79 25 2c 6d 61 78 78  |nx%-4,maxy%,maxx|
00001860  25 2b 32 2c 6d 61 78 79  25 2b 34 2c 74 6c 25 29  |%+2,maxy%+4,tl%)|
00001870  0d 08 98 49 69 63 6f 6e  25 3d a4 61 64 64 5f 69  |...Iicon%=.add_i|
00001880  63 6f 6e 5f 62 6c 6f 63  6b 28 77 69 6e 64 6f 77  |con_block(window|
00001890  5f 68 61 6e 64 6c 65 25  2c 6d 69 6e 78 25 2d 34  |_handle%,minx%-4|
000018a0  2c 6d 69 6e 79 25 2d 34  2c 6d 69 6e 78 25 2c 6d  |,miny%-4,minx%,m|
000018b0  61 78 79 25 2c 74 6c 25  29 0d 08 a2 4b 69 63 6f  |axy%,tl%)...Kico|
000018c0  6e 25 3d a4 61 64 64 5f  69 63 6f 6e 5f 62 6c 6f  |n%=.add_icon_blo|
000018d0  63 6b 28 77 69 6e 64 6f  77 5f 68 61 6e 64 6c 65  |ck(window_handle|
000018e0  25 2c 6d 69 6e 78 25 2d  32 2c 6d 69 6e 79 25 2d  |%,minx%-2,miny%-|
000018f0  34 2c 6d 61 78 78 25 2b  32 2c 6d 69 6e 79 25 2c  |4,maxx%+2,miny%,|
00001900  62 72 25 29 0d 08 ac 05  e1 0d 08 b6 2e dd f2 64  |br%)...........d|
00001910  65 6c 65 74 65 5f 69 63  6f 6e 28 77 69 6e 64 6f  |elete_icon(windo|
00001920  77 5f 68 61 6e 64 6c 65  25 2c 69 63 6f 6e 5f 68  |w_handle%,icon_h|
00001930  61 6e 64 6c 65 25 29 0d  08 c0 1d ea 20 6d 69 6e  |andle%)..... min|
00001940  78 25 2c 6d 69 6e 79 25  2c 6d 61 78 78 25 2c 6d  |x%,miny%,maxx%,m|
00001950  61 78 79 25 0d 08 ca 1e  74 65 6d 70 5f 62 6c 6b  |axy%....temp_blk|
00001960  25 21 30 3d 77 69 6e 64  6f 77 5f 68 61 6e 64 6c  |%!0=window_handl|
00001970  65 25 0d 08 d4 1c 74 65  6d 70 5f 62 6c 6b 25 21  |e%....temp_blk%!|
00001980  34 3d 69 63 6f 6e 5f 68  61 6e 64 6c 65 25 0d 08  |4=icon_handle%..|
00001990  de 24 c8 99 22 57 69 6d  70 5f 47 65 74 49 63 6f  |.$.."Wimp_GetIco|
000019a0  6e 53 74 61 74 65 22 2c  2c 74 65 6d 70 5f 62 6c  |nState",,temp_bl|
000019b0  6b 25 0d 08 e8 15 6d 69  6e 78 25 3d 74 65 6d 70  |k%....minx%=temp|
000019c0  5f 62 6c 6b 25 21 38 0d  08 f2 16 6d 69 6e 79 25  |_blk%!8....miny%|
000019d0  3d 74 65 6d 70 5f 62 6c  6b 25 21 31 32 0d 08 fc  |=temp_blk%!12...|
000019e0  16 6d 61 78 78 25 3d 74  65 6d 70 5f 62 6c 6b 25  |.maxx%=temp_blk%|
000019f0  21 31 36 0d 09 06 16 6d  61 78 79 25 3d 74 65 6d  |!16....maxy%=tem|
00001a00  70 5f 62 6c 6b 25 21 32  30 0d 09 10 22 c8 99 22  |p_blk%!20...".."|
00001a10  57 69 6d 70 5f 44 65 6c  65 74 65 49 63 6f 6e 22  |Wimp_DeleteIcon"|
00001a20  2c 2c 74 65 6d 70 5f 62  6c 6b 25 0d 09 1a 3f c8  |,,temp_blk%...?.|
00001a30  99 22 57 69 6d 70 5f 46  6f 72 63 65 52 65 64 72  |."Wimp_ForceRedr|
00001a40  61 77 22 2c 77 69 6e 64  6f 77 5f 68 61 6e 64 6c  |aw",window_handl|
00001a50  65 25 2c 6d 69 6e 78 25  2c 6d 69 6e 79 25 2c 6d  |e%,minx%,miny%,m|
00001a60  61 78 78 25 2c 6d 61 78  79 25 0d 09 24 05 e1 0d  |axx%,maxy%..$...|
00001a70  09 2e 2b dd f2 64 72 61  67 5f 62 6f 78 28 77 69  |..+..drag_box(wi|
00001a80  6e 64 6f 77 5f 68 61 6e  64 6c 65 25 2c 69 63 6f  |ndow_handle%,ico|
00001a90  6e 5f 68 61 6e 64 6c 65  25 29 0d 09 38 0b ea 20  |n_handle%)..8.. |
00001aa0  78 25 2c 79 25 0d 09 42  1e 74 65 6d 70 5f 62 6c  |x%,y%..B.temp_bl|
00001ab0  6b 25 21 30 3d 77 69 6e  64 6f 77 5f 68 61 6e 64  |k%!0=window_hand|
00001ac0  6c 65 25 0d 09 4c 26 c8  99 22 57 69 6d 70 5f 47  |le%..L&.."Wimp_G|
00001ad0  65 74 57 69 6e 64 6f 77  53 74 61 74 65 22 2c 2c  |etWindowState",,|
00001ae0  74 65 6d 70 5f 62 6c 6b  25 0d 09 56 1f 78 25 3d  |temp_blk%..V.x%=|
00001af0  74 65 6d 70 5f 62 6c 6b  25 21 34 2d 74 65 6d 70  |temp_blk%!4-temp|
00001b00  5f 62 6c 6b 25 21 32 30  0d 09 60 20 79 25 3d 74  |_blk%!20..` y%=t|
00001b10  65 6d 70 5f 62 6c 6b 25  21 31 36 2d 74 65 6d 70  |emp_blk%!16-temp|
00001b20  5f 62 6c 6b 25 21 32 34  0d 09 6a 1c 74 65 6d 70  |_blk%!24..j.temp|
00001b30  5f 62 6c 6b 25 21 34 3d  69 63 6f 6e 5f 68 61 6e  |_blk%!4=icon_han|
00001b40  64 6c 65 25 0d 09 74 24  c8 99 22 57 69 6d 70 5f  |dle%..t$.."Wimp_|
00001b50  47 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 74  |GetIconState",,t|
00001b60  65 6d 70 5f 62 6c 6b 25  0d 09 7e 24 e7 20 28 74  |emp_blk%..~$. (t|
00001b70  65 6d 70 5f 62 6c 6b 25  21 32 34 20 80 20 26 42  |emp_blk%!24 . &B|
00001b80  30 30 30 29 3d 26 42 30  30 30 20 e1 0d 09 88 28  |000)=&B000 ....(|
00001b90  e7 20 28 74 65 6d 70 5f  62 6c 6b 25 21 32 34 20  |. (temp_blk%!24 |
00001ba0  80 20 26 38 30 30 30 30  30 29 3d 26 38 30 30 30  |. &800000)=&8000|
00001bb0  30 30 20 e1 0d 09 92 11  74 65 6d 70 5f 62 6c 6b  |00 .....temp_blk|
00001bc0  25 21 34 3d 35 0d 09 9c  13 74 65 6d 70 5f 62 6c  |%!4=5....temp_bl|
00001bd0  6b 25 21 38 2b 3d 78 25  0d 09 a6 14 74 65 6d 70  |k%!8+=x%....temp|
00001be0  5f 62 6c 6b 25 21 31 32  2b 3d 79 25 0d 09 b0 14  |_blk%!12+=y%....|
00001bf0  74 65 6d 70 5f 62 6c 6b  25 21 31 36 2b 3d 78 25  |temp_blk%!16+=x%|
00001c00  0d 09 ba 14 74 65 6d 70  5f 62 6c 6b 25 21 32 30  |....temp_blk%!20|
00001c10  2b 3d 79 25 0d 09 c4 13  74 65 6d 70 5f 62 6c 6b  |+=y%....temp_blk|
00001c20  25 21 32 34 3d 2d 31 0d  09 ce 13 74 65 6d 70 5f  |%!24=-1....temp_|
00001c30  62 6c 6b 25 21 32 38 3d  2d 31 0d 09 d8 1a 74 65  |blk%!28=-1....te|
00001c40  6d 70 5f 62 6c 6b 25 21  33 32 3d 26 37 46 46 46  |mp_blk%!32=&7FFF|
00001c50  46 46 46 46 0d 09 e2 1a  74 65 6d 70 5f 62 6c 6b  |FFFF....temp_blk|
00001c60  25 21 33 36 3d 26 37 46  46 46 46 46 46 46 0d 09  |%!36=&7FFFFFFF..|
00001c70  ec 1f c8 99 22 57 69 6d  70 5f 44 72 61 67 42 6f  |...."Wimp_DragBo|
00001c80  78 22 2c 2c 74 65 6d 70  5f 62 6c 6b 25 0d 09 f6  |x",,temp_blk%...|
00001c90  05 e1 0d 0a 00 30 dd a4  67 65 74 5f 69 63 6f 6e  |.....0..get_icon|
00001ca0  5f 74 65 78 74 28 77 69  6e 64 6f 77 5f 68 61 6e  |_text(window_han|
00001cb0  64 6c 65 25 2c 69 63 6f  6e 5f 68 61 6e 64 6c 65  |dle%,icon_handle|
00001cc0  25 29 0d 0a 0a 1e 74 65  6d 70 5f 62 6c 6b 25 21  |%)....temp_blk%!|
00001cd0  30 3d 77 69 6e 64 6f 77  5f 68 61 6e 64 6c 65 25  |0=window_handle%|
00001ce0  0d 0a 14 1c 74 65 6d 70  5f 62 6c 6b 25 21 34 3d  |....temp_blk%!4=|
00001cf0  69 63 6f 6e 5f 68 61 6e  64 6c 65 25 0d 0a 1e 24  |icon_handle%...$|
00001d00  c8 99 22 57 69 6d 70 5f  47 65 74 49 63 6f 6e 53  |.."Wimp_GetIconS|
00001d10  74 61 74 65 22 2c 2c 74  65 6d 70 5f 62 6c 6b 25  |tate",,temp_blk%|
00001d20  0d 0a 28 23 e7 20 28 74  65 6d 70 5f 62 6c 6b 25  |..(#. (temp_blk%|
00001d30  21 32 34 20 80 20 26 31  30 31 29 3c 3e 26 31 30  |!24 . &101)<>&10|
00001d40  31 20 8c 0d 0a 32 2b 85  20 32 30 32 2c 22 49 63  |1 ...2+. 202,"Ic|
00001d50  6f 6e 20 22 2b c3 69 63  6f 6e 25 2b 22 20 6e 6f  |on "+.icon%+" no|
00001d60  74 20 69 6e 64 69 72 65  63 74 65 64 21 22 0d 0a  |t indirected!"..|
00001d70  3c 07 3d 22 22 0d 0a 46  05 cd 0d 0a 50 12 3d 24  |<.=""..F....P.=$|
00001d80  74 65 6d 70 5f 62 6c 6b  25 21 32 38 0d 0a 5a 39  |temp_blk%!28..Z9|
00001d90  dd f2 69 63 6f 6e 5f 62  67 5f 63 6f 6c 6f 75 72  |..icon_bg_colour|
00001da0  28 77 69 6e 64 6f 77 5f  68 61 6e 64 6c 65 25 2c  |(window_handle%,|
00001db0  69 63 6f 6e 5f 68 61 6e  64 6c 65 25 2c 63 6f 6c  |icon_handle%,col|
00001dc0  6f 75 72 25 29 0d 0a 64  1e e7 20 63 6f 6c 6f 75  |our%)..d.. colou|
00001dd0  72 25 3c 30 20 84 20 63  6f 6c 6f 75 72 25 3e 31  |r%<0 . colour%>1|
00001de0  35 20 e1 0d 0a 6e 1e 74  65 6d 70 5f 62 6c 6b 25  |5 ...n.temp_blk%|
00001df0  21 30 3d 77 69 6e 64 6f  77 5f 68 61 6e 64 6c 65  |!0=window_handle|
00001e00  25 0d 0a 78 1c 74 65 6d  70 5f 62 6c 6b 25 21 34  |%..x.temp_blk%!4|
00001e10  3d 69 63 6f 6e 5f 68 61  6e 64 6c 65 25 0d 0a 82  |=icon_handle%...|
00001e20  24 c8 99 22 57 69 6d 70  5f 47 65 74 49 63 6f 6e  |$.."Wimp_GetIcon|
00001e30  53 74 61 74 65 22 2c 2c  74 65 6d 70 5f 62 6c 6b  |State",,temp_blk|
00001e40  25 0d 0a 8c 20 e7 20 28  74 65 6d 70 5f 62 6c 6b  |%... . (temp_blk|
00001e50  25 21 32 34 20 80 20 31  3c 3c 36 29 20 8c 20 e1  |%!24 . 1<<6) . .|
00001e60  3a 0d 0a 96 1b 74 65 6d  70 5f 62 6c 6b 25 21 31  |:....temp_blk%!1|
00001e70  32 3d 26 46 30 30 30 30  30 30 30 3a 0d 0a a0 3c  |2=&F0000000:...<|
00001e80  74 65 6d 70 5f 62 6c 6b  25 21 38 3d 63 6f 6c 6f  |temp_blk%!8=colo|
00001e90  75 72 25 3c 3c 32 38 3a  c8 99 22 57 69 6d 70 5f  |ur%<<28:.."Wimp_|
00001ea0  53 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 74  |SetIconState",,t|
00001eb0  65 6d 70 5f 62 6c 6b 25  0d 0a aa 05 e1 0d 0a b4  |emp_blk%........|
00001ec0  39 dd f2 69 63 6f 6e 5f  66 67 5f 63 6f 6c 6f 75  |9..icon_fg_colou|
00001ed0  72 28 77 69 6e 64 6f 77  5f 68 61 6e 64 6c 65 25  |r(window_handle%|
00001ee0  2c 69 63 6f 6e 5f 68 61  6e 64 6c 65 25 2c 63 6f  |,icon_handle%,co|
00001ef0  6c 6f 75 72 25 29 0d 0a  be 1e e7 20 63 6f 6c 6f  |lour%)..... colo|
00001f00  75 72 25 3c 30 20 84 20  63 6f 6c 6f 75 72 25 3e  |ur%<0 . colour%>|
00001f10  31 35 20 e1 0d 0a c8 1e  74 65 6d 70 5f 62 6c 6b  |15 .....temp_blk|
00001f20  25 21 30 3d 77 69 6e 64  6f 77 5f 68 61 6e 64 6c  |%!0=window_handl|
00001f30  65 25 0d 0a d2 1c 74 65  6d 70 5f 62 6c 6b 25 21  |e%....temp_blk%!|
00001f40  34 3d 69 63 6f 6e 5f 68  61 6e 64 6c 65 25 0d 0a  |4=icon_handle%..|
00001f50  dc 24 c8 99 22 57 69 6d  70 5f 47 65 74 49 63 6f  |.$.."Wimp_GetIco|
00001f60  6e 53 74 61 74 65 22 2c  2c 74 65 6d 70 5f 62 6c  |nState",,temp_bl|
00001f70  6b 25 0d 0a e6 20 e7 20  28 74 65 6d 70 5f 62 6c  |k%... . (temp_bl|
00001f80  6b 25 21 32 34 20 80 20  31 3c 3c 36 29 20 8c 20  |k%!24 . 1<<6) . |
00001f90  e1 3a 0d 0a f0 1a 74 65  6d 70 5f 62 6c 6b 25 21  |.:....temp_blk%!|
00001fa0  31 32 3d 26 46 30 30 30  30 30 30 3a 0d 0a fa 3c  |12=&F000000:...<|
00001fb0  74 65 6d 70 5f 62 6c 6b  25 21 38 3d 63 6f 6c 6f  |temp_blk%!8=colo|
00001fc0  75 72 25 3c 3c 32 34 3a  c8 99 22 57 69 6d 70 5f  |ur%<<24:.."Wimp_|
00001fd0  53 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 74  |SetIconState",,t|
00001fe0  65 6d 70 5f 62 6c 6b 25  0d 0b 04 05 e1 0d 0b 0e  |emp_blk%........|
00001ff0  30 dd a4 69 63 6f 6e 5f  73 65 6c 65 63 74 65 64  |0..icon_selected|
00002000  28 77 69 6e 64 6f 77 5f  68 61 6e 64 6c 65 25 2c  |(window_handle%,|
00002010  69 63 6f 6e 5f 68 61 6e  64 6c 65 25 29 0d 0b 18  |icon_handle%)...|
00002020  1e 74 65 6d 70 5f 62 6c  6b 25 21 30 3d 77 69 6e  |.temp_blk%!0=win|
00002030  64 6f 77 5f 68 61 6e 64  6c 65 25 0d 0b 22 1c 74  |dow_handle%..".t|
00002040  65 6d 70 5f 62 6c 6b 25  21 34 3d 69 63 6f 6e 5f  |emp_blk%!4=icon_|
00002050  68 61 6e 64 6c 65 25 0d  0b 2c 24 c8 99 22 57 69  |handle%..,$.."Wi|
00002060  6d 70 5f 47 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_GetIconState"|
00002070  2c 2c 74 65 6d 70 5f 62  6c 6b 25 0d 0b 36 26 e7  |,,temp_blk%..6&.|
00002080  20 28 74 65 6d 70 5f 62  6c 6b 25 21 32 34 20 80  | (temp_blk%!24 .|
00002090  20 31 3c 3c 32 31 29 20  8c 20 3d b9 20 8b 20 3d  | 1<<21) . =. . =|
000020a0  a3 0d 0b 40 38 dd f2 69  63 6f 6e 5f 76 61 6c 69  |...@8..icon_vali|
000020b0  64 61 74 69 6f 6e 28 77  69 6e 64 6f 77 5f 68 61  |dation(window_ha|
000020c0  6e 64 6c 65 25 2c 69 63  6f 6e 5f 68 61 6e 64 6c  |ndle%,icon_handl|
000020d0  65 25 2c 74 79 70 65 24  29 0d 0b 4a 1e 74 65 6d  |e%,type$)..J.tem|
000020e0  70 5f 62 6c 6b 25 21 30  3d 77 69 6e 64 6f 77 5f  |p_blk%!0=window_|
000020f0  68 61 6e 64 6c 65 25 0d  0b 54 1c 74 65 6d 70 5f  |handle%..T.temp_|
00002100  62 6c 6b 25 21 34 3d 69  63 6f 6e 5f 68 61 6e 64  |blk%!4=icon_hand|
00002110  6c 65 25 0d 0b 5e 24 c8  99 22 57 69 6d 70 5f 47  |le%..^$.."Wimp_G|
00002120  65 74 49 63 6f 6e 53 74  61 74 65 22 2c 2c 74 65  |etIconState",,te|
00002130  6d 70 5f 62 6c 6b 25 0d  0b 68 25 e7 20 28 74 65  |mp_blk%..h%. (te|
00002140  6d 70 5f 62 6c 6b 25 21  32 34 20 80 20 26 45 31  |mp_blk%!24 . &E1|
00002150  30 31 29 3c 3e 26 45 31  30 31 20 8c 0d 0b 72 43  |01)<>&E101 ...rC|
00002160  85 20 32 30 32 2c 22 49  63 6f 6e 20 22 2b c3 69  |. 202,"Icon "+.i|
00002170  63 6f 6e 5f 68 61 6e 64  6c 65 25 2b 22 20 6e 6f  |con_handle%+" no|
00002180  74 20 77 72 69 74 61 62  6c 65 20 61 6e 64 20 6e  |t writable and n|
00002190  6f 74 20 69 6e 64 69 72  65 63 74 65 64 21 22 0d  |ot indirected!".|
000021a0  0b 7c 05 e1 0d 0b 86 05  cd 0d 0b 90 0e c8 8e 20  |.|............. |
000021b0  74 79 70 65 24 20 ca 0d  0b 9a 0e c9 20 22 6e 75  |type$ ...... "nu|
000021c0  6d 62 65 72 22 0d 0b a4  19 24 74 65 6d 70 5f 62  |mber"....$temp_b|
000021d0  6c 6b 25 21 33 32 3d 22  41 30 2d 39 2e 22 0d 0b  |lk%!32="A0-9."..|
000021e0  ae 0c c9 20 22 66 69 6c  65 22 0d 0b b8 26 24 74  |... "file"...&$t|
000021f0  65 6d 70 5f 62 6c 6b 25  21 33 32 3d 22 41 7e 20  |emp_blk%!32="A~ |
00002200  24 26 40 5c 5c 5e 3a 2e  23 2a 7c 22 2b bd 33 34  |$&@\\^:.#*|"+.34|
00002210  0d 0b c2 05 cb 0d 0b cc  05 e1 0d 0b d6 38 dd f2  |.............8..|
00002220  70 6c 61 63 65 5f 63 61  72 65 74 28 77 69 6e 64  |place_caret(wind|
00002230  6f 77 5f 68 61 6e 64 6c  65 25 2c 69 63 6f 6e 5f  |ow_handle%,icon_|
00002240  68 61 6e 64 6c 65 25 2c  70 6f 73 69 74 69 6f 6e  |handle%,position|
00002250  25 29 0d 0b e0 1e 74 65  6d 70 5f 62 6c 6b 25 21  |%)....temp_blk%!|
00002260  30 3d 77 69 6e 64 6f 77  5f 68 61 6e 64 6c 65 25  |0=window_handle%|
00002270  0d 0b ea 1c 74 65 6d 70  5f 62 6c 6b 25 21 34 3d  |....temp_blk%!4=|
00002280  69 63 6f 6e 5f 68 61 6e  64 6c 65 25 0d 0b f4 24  |icon_handle%...$|
00002290  c8 99 22 57 69 6d 70 5f  47 65 74 49 63 6f 6e 53  |.."Wimp_GetIconS|
000022a0  74 61 74 65 22 2c 2c 74  65 6d 70 5f 62 6c 6b 25  |tate",,temp_blk%|
000022b0  0d 0b fe 25 e7 20 28 74  65 6d 70 5f 62 6c 6b 25  |...%. (temp_blk%|
000022c0  21 32 34 20 80 20 26 45  31 30 31 29 3c 3e 26 45  |!24 . &E101)<>&E|
000022d0  31 30 31 20 8c 0d 0c 08  43 85 20 32 30 32 2c 22  |101 ....C. 202,"|
000022e0  49 63 6f 6e 20 22 2b c3  69 63 6f 6e 5f 68 61 6e  |Icon "+.icon_han|
000022f0  64 6c 65 25 2b 22 20 6e  6f 74 20 77 72 69 74 61  |dle%+" not writa|
00002300  62 6c 65 20 61 6e 64 20  6e 6f 74 20 69 6e 64 69  |ble and not indi|
00002310  72 65 63 74 65 64 21 22  0d 0c 12 05 e1 0d 0c 1c  |rected!"........|
00002320  05 cd 0d 0c 26 17 74 65  78 74 24 3d 24 74 65 6d  |....&.text$=$tem|
00002330  70 5f 62 6c 6b 25 21 32  38 0d 0c 30 27 e7 20 70  |p_blk%!28..0'. p|
00002340  6f 73 69 74 69 6f 6e 25  3e a9 74 65 78 74 24 20  |osition%>.text$ |
00002350  70 6f 73 69 74 69 6f 6e  25 3d a9 74 65 78 74 24  |position%=.text$|
00002360  0d 0c 3a 4a c8 99 22 57  69 6d 70 5f 53 65 74 43  |..:J.."Wimp_SetC|
00002370  61 72 65 74 50 6f 73 69  74 69 6f 6e 22 2c 77 69  |aretPosition",wi|
00002380  6e 64 6f 77 5f 68 61 6e  64 6c 65 25 2c 69 63 6f  |ndow_handle%,ico|
00002390  6e 5f 68 61 6e 64 6c 65  25 2c 30 2c 30 2c 2d 31  |n_handle%,0,0,-1|
000023a0  2c 70 6f 73 69 74 69 6f  6e 25 0d 0c 44 05 e1 0d  |,position%..D...|
000023b0  0c 4e 38 dd f2 70 75 74  5f 69 63 6f 6e 5f 73 70  |.N8..put_icon_sp|
000023c0  72 69 74 65 28 77 69 6e  64 6f 77 5f 68 61 6e 64  |rite(window_hand|
000023d0  6c 65 25 2c 69 63 6f 6e  5f 68 61 6e 64 6c 65 25  |le%,icon_handle%|
000023e0  2c 74 65 78 74 24 29 0d  0c 58 1e 74 65 6d 70 5f  |,text$)..X.temp_|
000023f0  62 6c 6b 25 21 30 3d 77  69 6e 64 6f 77 5f 68 61  |blk%!0=window_ha|
00002400  6e 64 6c 65 25 0d 0c 62  1c 74 65 6d 70 5f 62 6c  |ndle%..b.temp_bl|
00002410  6b 25 21 34 3d 69 63 6f  6e 5f 68 61 6e 64 6c 65  |k%!4=icon_handle|
00002420  25 0d 0c 6c 24 c8 99 22  57 69 6d 70 5f 47 65 74  |%..l$.."Wimp_Get|
00002430  49 63 6f 6e 53 74 61 74  65 22 2c 2c 74 65 6d 70  |IconState",,temp|
00002440  5f 62 6c 6b 25 0d 0c 76  1e c8 8e 20 28 74 65 6d  |_blk%..v... (tem|
00002450  70 5f 62 6c 6b 25 21 32  34 20 80 20 26 31 30 33  |p_blk%!24 . &103|
00002460  29 20 ca 0d 0c 80 0f c9  20 26 30 30 32 2c 26 30  |) ...... &002,&0|
00002470  30 33 0d 0c 8a 17 24 74  65 6d 70 5f 62 6c 6b 25  |03....$temp_blk%|
00002480  21 32 38 3d 74 65 78 74  24 0d 0c 94 0a c9 20 26  |!28=text$..... &|
00002490  31 30 32 0d 0c 9e 3d e7  20 74 65 6d 70 5f 62 6c  |102...=. temp_bl|
000024a0  6b 25 21 33 36 3e 30 20  24 74 65 6d 70 5f 62 6c  |k%!36>0 $temp_bl|
000024b0  6b 25 21 32 38 3d 74 65  78 74 24 3a 24 74 65 6d  |k%!28=text$:$tem|
000024c0  70 5f 62 6c 6b 25 21 33  36 3d a9 74 65 78 74 24  |p_blk%!36=.text$|
000024d0  0d 0c a8 0a c9 20 26 31  30 33 0d 0c b2 1b 24 74  |..... &103....$t|
000024e0  65 6d 70 5f 62 6c 6b 25  21 33 32 3d 22 53 22 2b  |emp_blk%!32="S"+|
000024f0  74 65 78 74 24 0d 0c bc  35 7f 20 85 20 32 30 32  |text$...5. . 202|
00002500  2c 22 4e 6f 20 73 70 72  69 74 65 20 6e 61 6d 65  |,"No sprite name|
00002510  20 69 6e 20 69 63 6f 6e  20 22 2b c3 69 63 6f 6e  | in icon "+.icon|
00002520  5f 68 61 6e 64 6c 65 25  3a e1 0d 0c c6 05 cb 0d  |_handle%:.......|
00002530  0c d0 11 74 65 6d 70 5f  62 6c 6b 25 21 38 3d 30  |...temp_blk%!8=0|
00002540  0d 0c da 12 74 65 6d 70  5f 62 6c 6b 25 21 31 32  |....temp_blk%!12|
00002550  3d 30 0d 0c e4 24 c8 99  22 57 69 6d 70 5f 53 65  |=0...$.."Wimp_Se|
00002560  74 49 63 6f 6e 53 74 61  74 65 22 2c 2c 74 65 6d  |tIconState",,tem|
00002570  70 5f 62 6c 6b 25 0d 0c  ee 05 e1 0d 0c f8 36 dd  |p_blk%........6.|
00002580  f2 70 75 74 5f 69 63 6f  6e 5f 74 65 78 74 28 77  |.put_icon_text(w|
00002590  69 6e 64 6f 77 5f 68 61  6e 64 6c 65 25 2c 69 63  |indow_handle%,ic|
000025a0  6f 6e 5f 68 61 6e 64 6c  65 25 2c 74 65 78 74 24  |on_handle%,text$|
000025b0  29 0d 0d 02 1e 74 65 6d  70 5f 62 6c 6b 25 21 30  |)....temp_blk%!0|
000025c0  3d 77 69 6e 64 6f 77 5f  68 61 6e 64 6c 65 25 0d  |=window_handle%.|
000025d0  0d 0c 1c 74 65 6d 70 5f  62 6c 6b 25 21 34 3d 69  |...temp_blk%!4=i|
000025e0  63 6f 6e 5f 68 61 6e 64  6c 65 25 0d 0d 16 24 c8  |con_handle%...$.|
000025f0  99 22 57 69 6d 70 5f 47  65 74 49 63 6f 6e 53 74  |."Wimp_GetIconSt|
00002600  61 74 65 22 2c 2c 74 65  6d 70 5f 62 6c 6b 25 0d  |ate",,temp_blk%.|
00002610  0d 20 23 e7 20 28 74 65  6d 70 5f 62 6c 6b 25 21  |. #. (temp_blk%!|
00002620  32 34 20 80 20 26 31 30  31 29 3c 3e 26 31 30 31  |24 . &101)<>&101|
00002630  20 8c 0d 0d 2a 32 85 20  32 30 32 2c 22 49 63 6f  | ...*2. 202,"Ico|
00002640  6e 20 22 2b c3 69 63 6f  6e 5f 68 61 6e 64 6c 65  |n "+.icon_handle|
00002650  25 2b 22 20 6e 6f 74 20  69 6e 64 69 72 65 63 74  |%+" not indirect|
00002660  65 64 21 22 0d 0d 34 05  e1 0d 0d 3e 05 cd 0d 0d  |ed!"..4....>....|
00002670  48 20 74 65 78 74 24 3d  c0 74 65 78 74 24 2c 74  |H text$=.text$,t|
00002680  65 6d 70 5f 62 6c 6b 25  21 33 36 2d 31 29 0d 0d  |emp_blk%!36-1)..|
00002690  52 17 24 74 65 6d 70 5f  62 6c 6b 25 21 32 38 3d  |R.$temp_blk%!28=|
000026a0  74 65 78 74 24 0d 0d 5c  11 74 65 6d 70 5f 62 6c  |text$..\.temp_bl|
000026b0  6b 25 21 38 3d 30 0d 0d  66 12 74 65 6d 70 5f 62  |k%!8=0..f.temp_b|
000026c0  6c 6b 25 21 31 32 3d 30  0d 0d 70 24 c8 99 22 57  |lk%!12=0..p$.."W|
000026d0  69 6d 70 5f 53 65 74 49  63 6f 6e 53 74 61 74 65  |imp_SetIconState|
000026e0  22 2c 2c 74 65 6d 70 5f  62 6c 6b 25 0d 0d 7a 05  |",,temp_blk%..z.|
000026f0  e1 0d 0d 84 36 dd f2 73  65 6c 65 63 74 5f 69 63  |....6..select_ic|
00002700  6f 6e 28 77 69 6e 64 6f  77 5f 68 61 6e 64 6c 65  |on(window_handle|
00002710  25 2c 69 63 6f 6e 5f 68  61 6e 64 6c 65 25 2c 73  |%,icon_handle%,s|
00002720  65 6c 65 63 74 25 29 0d  0d 8e 1e 74 65 6d 70 5f  |elect%)....temp_|
00002730  62 6c 6b 25 21 30 3d 77  69 6e 64 6f 77 5f 68 61  |blk%!0=window_ha|
00002740  6e 64 6c 65 25 0d 0d 98  1c 74 65 6d 70 5f 62 6c  |ndle%....temp_bl|
00002750  6b 25 21 34 3d 69 63 6f  6e 5f 68 61 6e 64 6c 65  |k%!4=icon_handle|
00002760  25 0d 0d a2 17 74 65 6d  70 5f 62 6c 6b 25 21 31  |%....temp_blk%!1|
00002770  32 3d 31 3c 3c 32 31 3a  0d 0d ac 30 e7 20 73 65  |2=1<<21:...0. se|
00002780  6c 65 63 74 25 20 74 65  6d 70 5f 62 6c 6b 25 21  |lect% temp_blk%!|
00002790  38 3d 31 3c 3c 32 31 20  8b 20 74 65 6d 70 5f 62  |8=1<<21 . temp_b|
000027a0  6c 6b 25 21 38 3d 30 3a  0d 0d b6 24 c8 99 22 57  |lk%!8=0:...$.."W|
000027b0  69 6d 70 5f 53 65 74 49  63 6f 6e 53 74 61 74 65  |imp_SetIconState|
000027c0  22 2c 2c 74 65 6d 70 5f  62 6c 6b 25 0d 0d c0 05  |",,temp_blk%....|
000027d0  e1 0d 0d ca 34 dd f2 73  68 61 64 65 5f 69 63 6f  |....4..shade_ico|
000027e0  6e 28 77 69 6e 64 6f 77  5f 68 61 6e 64 6c 65 25  |n(window_handle%|
000027f0  2c 69 63 6f 6e 5f 68 61  6e 64 6c 65 25 2c 73 68  |,icon_handle%,sh|
00002800  61 64 65 25 29 0d 0d d4  1e 74 65 6d 70 5f 62 6c  |ade%)....temp_bl|
00002810  6b 25 21 30 3d 77 69 6e  64 6f 77 5f 68 61 6e 64  |k%!0=window_hand|
00002820  6c 65 25 0d 0d de 1c 74  65 6d 70 5f 62 6c 6b 25  |le%....temp_blk%|
00002830  21 34 3d 69 63 6f 6e 5f  68 61 6e 64 6c 65 25 0d  |!4=icon_handle%.|
00002840  0d e8 17 74 65 6d 70 5f  62 6c 6b 25 21 31 32 3d  |...temp_blk%!12=|
00002850  31 3c 3c 32 32 3a 0d 0d  f2 2f e7 20 73 68 61 64  |1<<22:.../. shad|
00002860  65 25 20 74 65 6d 70 5f  62 6c 6b 25 21 38 3d 31  |e% temp_blk%!8=1|
00002870  3c 3c 32 32 20 8b 20 74  65 6d 70 5f 62 6c 6b 25  |<<22 . temp_blk%|
00002880  21 38 3d 30 3a 0d 0d fc  24 c8 99 22 57 69 6d 70  |!8=0:...$.."Wimp|
00002890  5f 53 65 74 49 63 6f 6e  53 74 61 74 65 22 2c 2c  |_SetIconState",,|
000028a0  74 65 6d 70 5f 62 6c 6b  25 0d 0e 06 05 e1 0d 0e  |temp_blk%.......|
000028b0  10 2e dd f2 75 70 64 61  74 65 5f 69 63 6f 6e 28  |....update_icon(|
000028c0  77 69 6e 64 6f 77 5f 68  61 6e 64 6c 65 25 2c 69  |window_handle%,i|
000028d0  63 6f 6e 5f 68 61 6e 64  6c 65 25 29 0d 0e 1a 1e  |con_handle%)....|
000028e0  74 65 6d 70 5f 62 6c 6b  25 21 30 3d 77 69 6e 64  |temp_blk%!0=wind|
000028f0  6f 77 5f 68 61 6e 64 6c  65 25 0d 0e 24 1c 74 65  |ow_handle%..$.te|
00002900  6d 70 5f 62 6c 6b 25 21  34 3d 69 63 6f 6e 5f 68  |mp_blk%!4=icon_h|
00002910  61 6e 64 6c 65 25 0d 0e  2e 11 74 65 6d 70 5f 62  |andle%....temp_b|
00002920  6c 6b 25 21 38 3d 30 0d  0e 38 12 74 65 6d 70 5f  |lk%!8=0..8.temp_|
00002930  62 6c 6b 25 21 31 32 3d  30 0d 0e 42 24 c8 99 22  |blk%!12=0..B$.."|
00002940  57 69 6d 70 5f 53 65 74  49 63 6f 6e 53 74 61 74  |Wimp_SetIconStat|
00002950  65 22 2c 2c 74 65 6d 70  5f 62 6c 6b 25 0d 0e 4c  |e",,temp_blk%..L|
00002960  05 e1 0d 0e 56 29 dd a4  70 75 74 5f 69 63 6f 6e  |....V)..put_icon|
00002970  5f 6f 6e 5f 62 61 72 28  73 70 72 69 74 65 5f 6e  |_on_bar(sprite_n|
00002980  61 6d 65 24 2c 73 69 64  65 24 29 0d 0e 60 0d ea  |ame$,side$)..`..|
00002990  20 68 61 6e 64 6c 65 25  0d 0e 6a 31 e7 20 73 69  | handle%..j1. si|
000029a0  64 65 24 3d 22 52 49 47  48 54 22 20 21 74 65 6d  |de$="RIGHT" !tem|
000029b0  70 5f 62 6c 6b 25 3d 2d  31 20 8b 20 21 74 65 6d  |p_blk%=-1 . !tem|
000029c0  70 5f 62 6c 6b 25 3d 2d  32 0d 0e 74 11 74 65 6d  |p_blk%=-2..t.tem|
000029d0  70 5f 62 6c 6b 25 21 34  3d 30 0d 0e 7e 11 74 65  |p_blk%!4=0..~.te|
000029e0  6d 70 5f 62 6c 6b 25 21  38 3d 30 0d 0e 88 13 74  |mp_blk%!8=0....t|
000029f0  65 6d 70 5f 62 6c 6b 25  21 31 32 3d 36 38 0d 0e  |emp_blk%!12=68..|
00002a00  92 13 74 65 6d 70 5f 62  6c 6b 25 21 31 36 3d 36  |..temp_blk%!16=6|
00002a10  38 0d 0e 9c 1a 74 65 6d  70 5f 62 6c 6b 25 21 32  |8....temp_blk%!2|
00002a20  30 3d 26 31 37 30 30 32  30 32 41 0d 0e a6 20 24  |0=&1700202A... $|
00002a30  28 74 65 6d 70 5f 62 6c  6b 25 2b 32 34 29 3d 73  |(temp_blk%+24)=s|
00002a40  70 72 69 74 65 5f 6e 61  6d 65 24 0d 0e b0 2d c8  |prite_name$...-.|
00002a50  99 20 22 57 69 6d 70 5f  43 72 65 61 74 65 49 63  |. "Wimp_CreateIc|
00002a60  6f 6e 22 2c 2c 74 65 6d  70 5f 62 6c 6b 25 20 b8  |on",,temp_blk% .|
00002a70  20 68 61 6e 64 6c 65 25  0d 0e ba 0c 3d 68 61 6e  | handle%....=han|
00002a80  64 6c 65 25 0d 0e c4 43  dd f2 70 75 74 5f 69 6e  |dle%...C..put_in|
00002a90  66 6f 5f 74 65 78 74 28  77 69 6e 64 6f 77 5f 68  |fo_text(window_h|
00002aa0  61 6e 64 6c 65 25 2c 6e  61 6d 65 24 2c 70 75 72  |andle%,name$,pur|
00002ab0  70 6f 73 65 24 2c 61 75  74 68 6f 72 24 2c 76 65  |pose$,author$,ve|
00002ac0  72 73 69 6f 6e 24 29 0d  0e ce 2a f2 70 75 74 5f  |rsion$)...*.put_|
00002ad0  69 63 6f 6e 5f 74 65 78  74 28 77 69 6e 64 6f 77  |icon_text(window|
00002ae0  5f 68 61 6e 64 6c 65 25  2c 31 2c 6e 61 6d 65 24  |_handle%,1,name$|
00002af0  29 0d 0e d8 2d f2 70 75  74 5f 69 63 6f 6e 5f 74  |)...-.put_icon_t|
00002b00  65 78 74 28 77 69 6e 64  6f 77 5f 68 61 6e 64 6c  |ext(window_handl|
00002b10  65 25 2c 32 2c 70 75 72  70 6f 73 65 24 29 0d 0e  |e%,2,purpose$)..|
00002b20  e2 2c f2 70 75 74 5f 69  63 6f 6e 5f 74 65 78 74  |.,.put_icon_text|
00002b30  28 77 69 6e 64 6f 77 5f  68 61 6e 64 6c 65 25 2c  |(window_handle%,|
00002b40  33 2c 61 75 74 68 6f 72  24 29 0d 0e ec 2d f2 70  |3,author$)...-.p|
00002b50  75 74 5f 69 63 6f 6e 5f  74 65 78 74 28 77 69 6e  |ut_icon_text(win|
00002b60  64 6f 77 5f 68 61 6e 64  6c 65 25 2c 34 2c 76 65  |dow_handle%,4,ve|
00002b70  72 73 69 6f 6e 24 29 0d  0e f6 05 e1 0d 0f 00 36  |rsion$)........6|
00002b80  dd a4 70 75 74 5f 73 70  72 69 74 65 5f 74 65 78  |..put_sprite_tex|
00002b90  74 5f 6f 6e 5f 62 61 72  28 73 70 72 69 74 65 5f  |t_on_bar(sprite_|
00002ba0  6e 61 6d 65 24 2c 73 69  64 65 24 2c 74 65 78 74  |name$,side$,text|
00002bb0  24 29 0d 0f 0a 2e ea 20  68 61 6e 64 6c 65 25 2c  |$)..... handle%,|
00002bc0  6c 65 6e 67 74 68 25 2c  73 70 72 69 74 65 5f 6e  |length%,sprite_n|
00002bd0  61 6d 65 25 2c 74 65 78  74 5f 73 70 61 63 65 25  |ame%,text_space%|
00002be0  0d 0f 14 26 de 20 73 70  72 69 74 65 5f 6e 61 6d  |...&. sprite_nam|
00002bf0  65 25 20 28 a9 28 73 70  72 69 74 65 5f 6e 61 6d  |e% (.(sprite_nam|
00002c00  65 24 29 2b 33 29 0d 0f  1e 1e de 20 74 65 78 74  |e$)+3)..... text|
00002c10  5f 73 70 61 63 65 25 20  28 a9 28 74 65 78 74 24  |_space% (.(text$|
00002c20  29 2b 32 29 0d 0f 28 22  24 73 70 72 69 74 65 5f  |)+2)..("$sprite_|
00002c30  6e 61 6d 65 25 3d 22 53  22 2b 73 70 72 69 74 65  |name%="S"+sprite|
00002c40  5f 6e 61 6d 65 24 0d 0f  32 16 24 74 65 78 74 5f  |_name$..2.$text_|
00002c50  73 70 61 63 65 25 3d 74  65 78 74 24 0d 0f 3c 31  |space%=text$..<1|
00002c60  e7 20 73 69 64 65 24 3d  22 52 49 47 48 54 22 20  |. side$="RIGHT" |
00002c70  21 74 65 6d 70 5f 62 6c  6b 25 3d 2d 31 20 8b 20  |!temp_blk%=-1 . |
00002c80  21 74 65 6d 70 5f 62 6c  6b 25 3d 2d 32 0d 0f 46  |!temp_blk%=-2..F|
00002c90  11 74 65 6d 70 5f 62 6c  6b 25 21 34 3d 30 0d 0f  |.temp_blk%!4=0..|
00002ca0  50 13 74 65 6d 70 5f 62  6c 6b 25 21 38 3d 2d 31  |P.temp_blk%!8=-1|
00002cb0  36 0d 0f 5a 2a 77 69 64  74 68 25 3d 31 36 2a a9  |6..Z*width%=16*.|
00002cc0  74 65 78 74 24 3a e7 20  77 69 64 74 68 25 3c 36  |text$:. width%<6|
00002cd0  38 20 77 69 64 74 68 25  3d 36 38 0d 0f 64 17 74  |8 width%=68..d.t|
00002ce0  65 6d 70 5f 62 6c 6b 25  21 31 32 3d 77 69 64 74  |emp_blk%!12=widt|
00002cf0  68 25 0d 0f 6e 13 74 65  6d 70 5f 62 6c 6b 25 21  |h%..n.temp_blk%!|
00002d00  31 36 3d 38 38 0d 0f 78  1a 74 65 6d 70 5f 62 6c  |16=88..x.temp_bl|
00002d10  6b 25 21 32 30 3d 26 31  37 30 30 32 31 32 42 0d  |k%!20=&1700212B.|
00002d20  0f 82 1c 74 65 6d 70 5f  62 6c 6b 25 21 32 34 3d  |...temp_blk%!24=|
00002d30  74 65 78 74 5f 73 70 61  63 65 25 0d 0f 8c 1d 74  |text_space%....t|
00002d40  65 6d 70 5f 62 6c 6b 25  21 32 38 3d 73 70 72 69  |emp_blk%!28=spri|
00002d50  74 65 5f 6e 61 6d 65 25  0d 0f 96 19 74 65 6d 70  |te_name%....temp|
00002d60  5f 62 6c 6b 25 21 33 32  3d a9 28 74 65 78 74 24  |_blk%!32=.(text$|
00002d70  29 0d 0f a0 2d c8 99 20  22 57 69 6d 70 5f 43 72  |)...-.. "Wimp_Cr|
00002d80  65 61 74 65 49 63 6f 6e  22 2c 2c 74 65 6d 70 5f  |eateIcon",,temp_|
00002d90  62 6c 6b 25 20 b8 20 68  61 6e 64 6c 65 25 0d 0f  |blk% . handle%..|
00002da0  aa 0c 3d 68 61 6e 64 6c  65 25 0d 0f b4 1e dd 20  |..=handle%..... |
00002db0  a4 74 61 73 6b 5f 69 6e  69 74 69 61 6c 69 73 65  |.task_initialise|
00002dc0  28 74 69 74 6c 65 24 29  0d 0f be 0e ea 20 76 65  |(title$)..... ve|
00002dd0  72 73 69 6f 6e 25 0d 0f  c8 10 76 65 72 73 69 6f  |rsion%....versio|
00002de0  6e 25 3d 32 30 30 0d 0f  d2 48 c8 99 20 22 57 69  |n%=200...H.. "Wi|
00002df0  6d 70 5f 49 6e 69 74 69  61 6c 69 73 65 22 2c 76  |mp_Initialise",v|
00002e00  65 72 73 69 6f 6e 25 2c  26 34 42 35 33 34 31 35  |ersion%,&4B53415|
00002e10  34 2c 74 69 74 6c 65 24  20 b8 20 76 65 72 73 69  |4,title$ . versi|
00002e20  6f 6e 25 2c 74 68 69 73  5f 74 61 73 6b 25 0d 0f  |on%,this_task%..|
00002e30  dc 0f 3d 74 68 69 73 5f  74 61 73 6b 25 0d 0f e6  |..=this_task%...|
00002e40  1a dd f2 61 64 64 5f 6d  65 6e 75 5f 69 74 65 6d  |...add_menu_item|
00002e50  28 6c 69 6e 65 24 29 0d  0f f0 44 ea 20 6d 65 6e  |(line$)...D. men|
00002e60  75 66 6c 61 67 25 2c 69  63 6f 6e 66 6c 61 67 25  |uflag%,iconflag%|
00002e70  2c 70 61 72 61 6d 24 2c  73 75 62 25 2c 69 74 65  |,param$,sub%,ite|
00002e80  6d 74 65 78 74 24 2c 77  72 69 74 61 62 6c 65 25  |mtext$,writable%|
00002e90  2c 6d 61 78 6c 65 6e 67  74 68 25 0d 0f fa 2a 69  |,maxlength%...*i|
00002ea0  63 6f 6e 66 6c 61 67 25  3d 26 37 30 30 30 30 32  |conflag%=&700002|
00002eb0  31 3a 73 75 62 25 3d 2d  31 3a 77 72 69 74 61 62  |1:sub%=-1:writab|
00002ec0  6c 65 25 3d a3 0d 10 04  3a 69 74 65 6d 74 65 78  |le%=....:itemtex|
00002ed0  74 24 3d a4 6d 65 6e 75  5f 69 74 65 6d 5f 74 65  |t$=.menu_item_te|
00002ee0  78 74 28 6c 69 6e 65 24  29 3a 6d 61 78 6c 65 6e  |xt(line$):maxlen|
00002ef0  67 74 68 25 3d a9 69 74  65 6d 74 65 78 74 24 0d  |gth%=.itemtext$.|
00002f00  10 0e 05 f5 0d 10 18 22  70 61 72 61 6d 24 3d a4  |......."param$=.|
00002f10  6d 65 6e 75 5f 69 74 65  6d 5f 70 61 72 61 6d 28  |menu_item_param(|
00002f20  6c 69 6e 65 24 29 0d 10  22 13 c8 8e 20 c0 70 61  |line$).."... .pa|
00002f30  72 61 6d 24 2c 34 29 20  ca 0d 10 2c 21 c9 22 74  |ram$,4) ...,!."t|
00002f40  69 63 6b 22 3a 6d 65 6e  75 66 6c 61 67 25 3d 6d  |ick":menuflag%=m|
00002f50  65 6e 75 66 6c 61 67 25  84 31 0d 10 36 21 c9 22  |enuflag%.1..6!."|
00002f60  6c 69 6e 65 22 3a 6d 65  6e 75 66 6c 61 67 25 3d  |line":menuflag%=|
00002f70  6d 65 6e 75 66 6c 61 67  25 84 32 0d 10 40 27 c9  |menuflag%.2..@'.|
00002f80  22 73 68 61 64 22 3a 69  63 6f 6e 66 6c 61 67 25  |"shad":iconflag%|
00002f90  3d 69 63 6f 6e 66 6c 61  67 25 84 26 34 30 30 30  |=iconflag%.&4000|
00002fa0  30 30 0d 10 4a 30 c9 22  73 75 62 6d 22 3a 73 75  |00..J0."subm":su|
00002fb0  62 25 3d a4 6d 65 6e 75  5f 73 75 62 6d 65 6e 75  |b%=.menu_submenu|
00002fc0  28 a4 6d 65 6e 75 76 61  72 28 70 61 72 61 6d 24  |(.menuvar(param$|
00002fd0  29 29 0d 10 54 2f c9 22  77 69 6e 64 22 3a 73 75  |))..T/."wind":su|
00002fe0  62 25 3d a4 6d 65 6e 75  5f 77 69 6e 64 6f 77 28  |b%=.menu_window(|
00002ff0  a4 6d 65 6e 75 76 61 72  28 70 61 72 61 6d 24 29  |.menuvar(param$)|
00003000  29 0d 10 5e 36 c9 22 69  63 6f 6e 22 3a 69 63 6f  |)..^6."icon":ico|
00003010  6e 66 6c 61 67 25 3d a4  6d 65 6e 75 5f 69 63 6f  |nflag%=.menu_ico|
00003020  6e 66 6c 61 67 28 a4 6d  65 6e 75 76 61 72 28 70  |nflag(.menuvar(p|
00003030  61 72 61 6d 24 29 29 0d  10 68 2c c9 22 77 72 69  |aram$))..h,."wri|
00003040  74 22 3a f2 6d 65 6e 75  5f 77 72 69 74 61 62 6c  |t":.menu_writabl|
00003050  65 28 a4 6d 65 6e 75 76  61 72 28 70 61 72 61 6d  |e(.menuvar(param|
00003060  24 29 29 0d 10 72 05 cb  0d 10 7c 0f fd 20 70 61  |$))..r....|.. pa|
00003070  72 61 6d 24 3d 22 22 0d  10 86 18 70 6f 69 6e 74  |ram$=""....point|
00003080  65 72 25 21 30 3d 6d 65  6e 75 66 6c 61 67 25 0d  |er%!0=menuflag%.|
00003090  10 90 13 70 6f 69 6e 74  65 72 25 21 34 3d 73 75  |...pointer%!4=su|
000030a0  62 25 0d 10 9a 23 e7 20  a9 28 69 74 65 6d 74 65  |b%...#. .(itemte|
000030b0  78 74 24 29 3e 31 32 20  84 20 77 72 69 74 61 62  |xt$)>12 . writab|
000030c0  6c 65 25 20 8c 0d 10 a4  20 70 6f 69 6e 74 65 72  |le% .... pointer|
000030d0  25 21 38 3d 69 63 6f 6e  66 6c 61 67 25 20 84 20  |%!8=iconflag% . |
000030e0  26 31 30 30 3a 0d 10 ae  33 f2 69 6e 64 69 72 65  |&100:...3.indire|
000030f0  63 74 65 64 5f 69 74 65  6d 28 70 6f 69 6e 74 65  |cted_item(pointe|
00003100  72 25 2c 77 72 69 74 61  62 6c 65 25 2c 6d 61 78  |r%,writable%,max|
00003110  6c 65 6e 67 74 68 25 29  0d 10 b8 05 cc 0d 10 c2  |length%)........|
00003120  18 70 6f 69 6e 74 65 72  25 21 38 3d 69 63 6f 6e  |.pointer%!8=icon|
00003130  66 6c 61 67 25 0d 10 cc  26 24 28 70 6f 69 6e 74  |flag%...&$(point|
00003140  65 72 25 2b 31 32 29 3d  c0 69 74 65 6d 74 65 78  |er%+12)=.itemtex|
00003150  74 24 2b bd 28 30 29 2c  31 32 29 0d 10 d6 05 cd  |t$+.(0),12).....|
00003160  0d 10 e0 10 70 6f 69 6e  74 65 72 25 2b 3d 32 34  |....pointer%+=24|
00003170  0d 10 ea 05 e1 0d 10 f4  16 dd a4 62 65 67 69 6e  |...........begin|
00003180  6d 65 6e 75 28 6c 69 6e  65 24 29 0d 10 fe 1e e7  |menu(line$).....|
00003190  20 c0 6c 69 6e 65 24 2c  39 29 3d 22 62 65 67 69  | .line$,9)="begi|
000031a0  6e 6d 65 6e 75 22 20 3d  b9 0d 11 08 06 3d a3 0d  |nmenu" =.....=..|
000031b0  11 12 26 dd a4 64 65 63  6f 64 65 5f 6d 65 6e 75  |..&..decode_menu|
000031c0  28 6d 65 6e 75 73 74 61  72 74 25 2c 6c 69 73 74  |(menustart%,list|
000031d0  70 74 72 25 29 0d 11 1c  10 ea 20 74 65 78 74 5f  |ptr%)..... text_|
000031e0  70 61 74 68 24 0d 11 26  45 c8 99 22 57 69 6d 70  |path$..&E.."Wimp|
000031f0  5f 44 65 63 6f 64 65 4d  65 6e 75 22 2c 2c 6d 65  |_DecodeMenu",,me|
00003200  6e 75 73 74 61 72 74 25  2c 6c 69 73 74 70 74 72  |nustart%,listptr|
00003210  25 2c 62 6c 6b 25 2b 32  35 36 20 b8 20 2c 2c 2c  |%,blk%+256 . ,,,|
00003220  74 65 78 74 5f 70 61 74  68 24 0d 11 30 0f 3d 74  |text_path$..0.=t|
00003230  65 78 74 5f 70 61 74 68  24 0d 11 3a 45 dd f2 64  |ext_path$..:E..d|
00003240  69 6d 5f 6d 65 6e 75 5f  61 72 72 61 79 73 28 6d  |im_menu_arrays(m|
00003250  65 6e 75 63 6f 75 6e 74  25 2c 69 74 65 6d 63 6f  |enucount%,itemco|
00003260  75 6e 74 25 2c 77 72 69  74 65 63 6f 75 6e 74 25  |unt%,writecount%|
00003270  2c 77 69 6e 64 6f 77 63  6f 75 6e 74 25 29 0d 11  |,windowcount%)..|
00003280  44 30 de 20 6d 65 6e 75  73 74 61 72 74 25 20 28  |D0. menustart% (|
00003290  6d 65 6e 75 63 6f 75 6e  74 25 2a 32 38 29 2b 28  |menucount%*28)+(|
000032a0  69 74 65 6d 63 6f 75 6e  74 25 2a 32 34 29 0d 11  |itemcount%*24)..|
000032b0  4e 1c de 20 6d 65 6e 75  77 69 64 74 68 25 28 6d  |N.. menuwidth%(m|
000032c0  65 6e 75 63 6f 75 6e 74  25 29 0d 11 58 17 de 20  |enucount%)..X.. |
000032d0  6d 65 6e 75 25 28 6d 65  6e 75 63 6f 75 6e 74 25  |menu%(menucount%|
000032e0  29 0d 11 62 21 de 20 77  72 69 74 61 62 6c 65 5f  |)..b!. writable_|
000032f0  69 74 65 6d 25 28 77 72  69 74 65 63 6f 75 6e 74  |item%(writecount|
00003300  25 29 0d 11 6c 20 de 20  77 72 69 74 61 62 6c 65  |%)..l . writable|
00003310  5f 6c 65 6e 25 28 77 72  69 74 65 63 6f 75 6e 74  |_len%(writecount|
00003320  25 29 0d 11 76 05 e1 0d  11 80 19 dd a4 67 65 74  |%)..v........get|
00003330  5f 77 72 69 74 65 6d 28  77 72 69 74 65 6d 25 29  |_writem(writem%)|
00003340  0d 11 8a 0b ea 20 74 65  6d 70 24 0d 11 94 31 e7  |..... temp$...1.|
00003350  20 77 72 69 74 65 6d 25  3c 31 20 84 20 77 72 69  | writem%<1 . wri|
00003360  74 65 6d 25 3e de 28 77  72 69 74 61 62 6c 65 5f  |tem%>.(writable_|
00003370  69 74 65 6d 25 28 29 2c  31 29 20 8c 0d 11 9e 3d  |item%(),1) ....=|
00003380  85 20 32 30 31 2c 22 77  72 69 74 61 62 6c 65 20  |. 201,"writable |
00003390  6d 65 6e 75 20 69 74 65  6d 20 22 2b c3 28 77 72  |menu item "+.(wr|
000033a0  69 74 65 6d 25 29 2b 22  20 64 6f 65 73 20 6e 6f  |item%)+" does no|
000033b0  74 20 65 78 69 73 74 21  22 0d 11 a8 05 cd 0d 11  |t exist!".......|
000033c0  b2 23 77 72 69 74 65 6d  25 3d 77 72 69 74 61 62  |.#writem%=writab|
000033d0  6c 65 5f 69 74 65 6d 25  28 77 72 69 74 65 6d 25  |le_item%(writem%|
000033e0  29 0d 11 bc 3a 74 65 6d  70 24 3d 22 22 3a 20 c8  |)...:temp$="": .|
000033f0  95 20 3f 77 72 69 74 65  6d 25 3e 33 31 3a 74 65  |. ?writem%>31:te|
00003400  6d 70 24 2b 3d bd 3f 77  72 69 74 65 6d 25 3a 77  |mp$+=.?writem%:w|
00003410  72 69 74 65 6d 25 2b 3d  31 3a ce 0d 11 c6 0a 3d  |ritem%+=1:.....=|
00003420  74 65 6d 70 24 0d 11 d0  14 dd f2 67 6f 74 6f 5f  |temp$......goto_|
00003430  62 65 67 69 6e 6d 65 6e  75 0d 11 da 11 ea 20 74  |beginmenu..... t|
00003440  65 6d 70 25 2c 6c 69 6e  65 24 0d 11 e4 11 cf 23  |emp%,line$.....#|
00003450  6d 65 6e 75 66 69 6c 65  25 3d 30 0d 11 ee 05 f5  |menufile%=0.....|
00003460  0d 11 f8 15 74 65 6d 70  25 3d 8f 23 6d 65 6e 75  |....temp%=.#menu|
00003470  66 69 6c 65 25 0d 12 02  15 6c 69 6e 65 24 3d be  |file%....line$=.|
00003480  23 6d 65 6e 75 66 69 6c  65 25 0d 12 0c 25 fd 20  |#menufile%...%. |
00003490  a4 62 65 67 69 6e 6d 65  6e 75 28 6c 69 6e 65 24  |.beginmenu(line$|
000034a0  29 20 84 20 c5 23 6d 65  6e 75 66 69 6c 65 25 0d  |) . .#menufile%.|
000034b0  12 16 3a e7 c5 23 6d 65  6e 75 66 69 6c 65 25 20  |..:..#menufile% |
000034c0  85 20 32 30 30 2c 22 4e  6f 20 27 62 65 67 69 6e  |. 200,"No 'begin|
000034d0  6d 65 6e 75 27 20 66 6f  75 6e 64 20 69 6e 20 6d  |menu' found in m|
000034e0  65 6e 75 20 66 69 6c 65  22 0d 12 20 15 cf 23 6d  |enu file".. ..#m|
000034f0  65 6e 75 66 69 6c 65 25  3d 74 65 6d 70 25 0d 12  |enufile%=temp%..|
00003500  2a 05 e1 0d 12 34 32 dd  f2 69 6e 64 69 72 65 63  |*....42..indirec|
00003510  74 65 64 5f 69 74 65 6d  28 6d 65 6e 75 5f 70 74  |ted_item(menu_pt|
00003520  72 25 2c 77 72 69 74 61  62 6c 65 25 2c 6c 65 6e  |r%,writable%,len|
00003530  67 74 68 25 29 0d 12 3e  10 ea 20 69 6e 64 69 72  |gth%)..>.. indir|
00003540  5f 70 74 72 25 0d 12 48  11 e7 20 77 72 69 74 61  |_ptr%..H.. writa|
00003550  62 6c 65 25 20 8c 0d 12  52 1a de 20 69 6e 64 69  |ble% ...R.. indi|
00003560  72 5f 70 74 72 25 20 6c  65 6e 67 74 68 25 2b 31  |r_ptr% length%+1|
00003570  0d 12 5c 05 cc 0d 12 66  1d de 20 69 6e 64 69 72  |..\....f.. indir|
00003580  5f 70 74 72 25 20 31 2b  a9 69 74 65 6d 74 65 78  |_ptr% 1+.itemtex|
00003590  74 24 0d 12 70 05 cd 0d  12 7a 1c 6d 65 6e 75 5f  |t$..p....z.menu_|
000035a0  70 74 72 25 21 31 32 3d  69 6e 64 69 72 5f 70 74  |ptr%!12=indir_pt|
000035b0  72 25 3a 0d 12 84 1e 24  69 6e 64 69 72 5f 70 74  |r%:....$indir_pt|
000035c0  72 25 3d 69 74 65 6d 74  65 78 74 24 2b bd 28 30  |r%=itemtext$+.(0|
000035d0  29 0d 12 8e 11 e7 20 77  72 69 74 61 62 6c 65 25  |)..... writable%|
000035e0  20 8c 0d 12 98 28 77 72  69 74 61 62 6c 65 5f 69  | ....(writable_i|
000035f0  74 65 6d 25 28 77 72 69  74 61 62 6c 65 25 29 3d  |tem%(writable%)=|
00003600  69 6e 64 69 72 5f 70 74  72 25 0d 12 a2 24 77 72  |indir_ptr%...$wr|
00003610  69 74 61 62 6c 65 5f 6c  65 6e 25 28 77 72 69 74  |itable_len%(writ|
00003620  61 62 6c 65 25 29 3d 6c  65 6e 67 74 68 25 0d 12  |able%)=length%..|
00003630  ac 19 69 6e 64 69 72 5f  70 74 72 25 2b 3d 6c 65  |..indir_ptr%+=le|
00003640  6e 67 74 68 25 2b 31 0d  12 b6 1a 6d 65 6e 75 5f  |ngth%+1....menu_|
00003650  70 74 72 25 21 32 30 3d  6c 65 6e 67 74 68 25 2b  |ptr%!20=length%+|
00003660  31 0d 12 c0 05 cc 0d 12  ca 1c 69 6e 64 69 72 5f  |1.........indir_|
00003670  70 74 72 25 2b 3d 31 2b  a9 69 74 65 6d 74 65 78  |ptr%+=1+.itemtex|
00003680  74 24 0d 12 d4 1e 6d 65  6e 75 5f 70 74 72 25 21  |t$....menu_ptr%!|
00003690  32 30 3d 31 2b a9 69 74  65 6d 74 65 78 74 24 3a  |20=1+.itemtext$:|
000036a0  0d 12 de 05 cd 0d 12 e8  11 3f 69 6e 64 69 72 5f  |.........?indir_|
000036b0  70 74 72 25 3d 30 0d 12  f2 1c 6d 65 6e 75 5f 70  |ptr%=0....menu_p|
000036c0  74 72 25 21 31 36 3d 69  6e 64 69 72 5f 70 74 72  |tr%!16=indir_ptr|
000036d0  25 3a 0d 12 fc 05 e1 0d  13 06 1b dd a4 69 74 65  |%:...........ite|
000036e0  6d 5f 63 6f 75 6e 74 28  6d 65 6e 75 5f 70 74 72  |m_count(menu_ptr|
000036f0  25 29 0d 13 10 0c ea 20  63 6f 75 6e 74 25 0d 13  |%)..... count%..|
00003700  1a 0c 63 6f 75 6e 74 25  3d 31 0d 13 24 11 6d 65  |..count%=1..$.me|
00003710  6e 75 5f 70 74 72 25 2b  3d 32 38 0d 13 2e 35 c8  |nu_ptr%+=28...5.|
00003720  95 20 28 21 6d 65 6e 75  5f 70 74 72 25 20 80 20  |. (!menu_ptr% . |
00003730  26 38 30 29 3d 30 3a 6d  65 6e 75 5f 70 74 72 25  |&80)=0:menu_ptr%|
00003740  2b 3d 32 34 3a 63 6f 75  6e 74 25 2b 3d 31 3a ce  |+=24:count%+=1:.|
00003750  0d 13 38 0b 3d 63 6f 75  6e 74 25 0d 13 42 1b dd  |..8.=count%..B..|
00003760  f2 6c 6f 61 64 5f 6d 65  6e 75 73 28 6d 65 6e 75  |.load_menus(menu|
00003770  66 69 6c 65 24 29 0d 13  4c 32 ea 20 6d 65 6e 75  |file$)..L2. menu|
00003780  63 6f 75 6e 74 25 2c 68  65 61 64 65 72 25 2c 6c  |count%,header%,l|
00003790  69 6e 65 24 2c 70 6f 69  6e 74 65 72 25 2c 6d 65  |ine$,pointer%,me|
000037a0  6e 75 73 74 61 72 74 25  0d 13 56 20 f2 73 69 7a  |nustart%..V .siz|
000037b0  65 5f 6d 65 6e 75 5f 61  72 72 61 79 73 28 6d 65  |e_menu_arrays(me|
000037c0  6e 75 66 69 6c 65 24 29  0d 13 60 18 6d 65 6e 75  |nufile$)..`.menu|
000037d0  66 69 6c 65 25 3d 8e 6d  65 6e 75 66 69 6c 65 24  |file%=.menufile$|
000037e0  0d 13 6a 14 f2 73 65 74  5f 6d 65 6e 75 5f 61 72  |..j..set_menu_ar|
000037f0  72 61 79 73 0d 13 74 13  f2 67 6f 74 6f 5f 62 65  |rays..t..goto_be|
00003800  67 69 6e 6d 65 6e 75 0d  13 7e 1a 6d 65 6e 75 63  |ginmenu..~.menuc|
00003810  6f 75 6e 74 25 3d 30 3a  68 65 61 64 65 72 25 3d  |ount%=0:header%=|
00003820  a3 0d 13 88 05 f5 0d 13  92 15 6c 69 6e 65 24 3d  |..........line$=|
00003830  be 23 6d 65 6e 75 66 69  6c 65 25 0d 13 9c 19 e7  |.#menufile%.....|
00003840  20 a4 62 65 67 69 6e 6d  65 6e 75 28 6c 69 6e 65  | .beginmenu(line|
00003850  24 29 20 8c 0d 13 a6 43  e7 68 65 61 64 65 72 25  |$) ....C.header%|
00003860  20 85 20 32 30 30 2c 22  42 61 64 20 6d 65 6e 75  | . 200,"Bad menu|
00003870  20 66 69 6c 65 2c 20 6e  6f 20 69 74 65 6d 73 20  | file, no items |
00003880  69 6e 20 6d 65 6e 75 20  22 2b c3 28 6d 65 6e 75  |in menu "+.(menu|
00003890  63 6f 75 6e 74 25 29 0d  13 b0 28 e7 6d 65 6e 75  |count%)...(.menu|
000038a0  63 6f 75 6e 74 25 20 f2  6d 61 72 6b 5f 6d 65 6e  |count% .mark_men|
000038b0  75 5f 65 6e 64 28 70 6f  69 6e 74 65 72 25 29 0d  |u_end(pointer%).|
000038c0  13 ba 11 6d 65 6e 75 63  6f 75 6e 74 25 2b 3d 31  |...menucount%+=1|
000038d0  0d 13 c4 15 6c 69 6e 65  24 3d be 23 6d 65 6e 75  |....line$=.#menu|
000038e0  66 69 6c 65 25 0d 13 ce  46 f2 6d 61 6b 65 5f 6d  |file%...F.make_m|
000038f0  65 6e 75 5f 68 65 61 64  65 72 28 70 6f 69 6e 74  |enu_header(point|
00003900  65 72 25 2c 6c 69 6e 65  24 2c 6d 65 6e 75 77 69  |er%,line$,menuwi|
00003910  64 74 68 25 28 6d 65 6e  75 63 6f 75 6e 74 25 29  |dth%(menucount%)|
00003920  29 3a 68 65 61 64 65 72  25 3d b9 0d 13 d8 05 cc  |):header%=......|
00003930  0d 13 e2 23 f2 61 64 64  5f 6d 65 6e 75 5f 69 74  |...#.add_menu_it|
00003940  65 6d 28 6c 69 6e 65 24  29 3a 68 65 61 64 65 72  |em(line$):header|
00003950  25 3d a3 0d 13 ec 05 cd  0d 13 f6 11 fd 20 c5 23  |%=........... .#|
00003960  6d 65 6e 75 66 69 6c 65  25 0d 14 00 1c f2 6d 61  |menufile%.....ma|
00003970  72 6b 5f 6d 65 6e 75 5f  65 6e 64 28 70 6f 69 6e  |rk_menu_end(poin|
00003980  74 65 72 25 29 0d 14 0a  28 c8 99 22 58 4f 53 5f  |ter%)...(.."XOS_|
00003990  46 69 6e 64 22 2c 30 2c  6d 65 6e 75 66 69 6c 65  |Find",0,menufile|
000039a0  25 3a 6d 65 6e 75 66 69  6c 65 25 3d 30 0d 14 14  |%:menufile%=0...|
000039b0  43 e7 68 65 61 64 65 72  25 20 85 20 32 30 30 2c  |C.header% . 200,|
000039c0  22 42 61 64 20 6d 65 6e  75 20 66 69 6c 65 2c 20  |"Bad menu file, |
000039d0  6e 6f 20 69 74 65 6d 73  20 69 6e 20 6d 65 6e 75  |no items in menu|
000039e0  20 22 2b c3 28 6d 65 6e  75 63 6f 75 6e 74 25 29  | "+.(menucount%)|
000039f0  0d 14 1e 05 e1 0d 14 28  30 dd f2 6d 61 6b 65 5f  |.......(0..make_|
00003a00  6d 65 6e 75 5f 68 65 61  64 65 72 28 f8 20 70 6f  |menu_header(. po|
00003a10  69 6e 74 65 72 25 2c 74  69 74 6c 65 24 2c 77 69  |inter%,title$,wi|
00003a20  64 74 68 25 29 0d 14 32  1f 24 70 6f 69 6e 74 65  |dth%)..2.$pointe|
00003a30  72 25 3d c0 74 69 74 6c  65 24 2c 31 32 29 2b bd  |r%=.title$,12)+.|
00003a40  28 30 29 3a 0d 14 3c 12  70 6f 69 6e 74 65 72 25  |(0):..<.pointer%|
00003a50  3f 31 32 3d 37 3a 0d 14  46 12 70 6f 69 6e 74 65  |?12=7:..F.pointe|
00003a60  72 25 3f 31 33 3d 32 3a  0d 14 50 12 70 6f 69 6e  |r%?13=2:..P.poin|
00003a70  74 65 72 25 3f 31 34 3d  37 3a 0d 14 5a 12 70 6f  |ter%?14=7:..Z.po|
00003a80  69 6e 74 65 72 25 3f 31  35 3d 30 3a 0d 14 64 17  |inter%?15=0:..d.|
00003a90  70 6f 69 6e 74 65 72 25  21 31 36 3d 77 69 64 74  |pointer%!16=widt|
00003aa0  68 25 3a 0d 14 6e 13 70  6f 69 6e 74 65 72 25 21  |h%:..n.pointer%!|
00003ab0  32 30 3d 34 34 3a 0d 14  78 12 70 6f 69 6e 74 65  |20=44:..x.pointe|
00003ac0  72 25 21 32 34 3d 30 3a  0d 14 82 11 70 6f 69 6e  |r%!24=0:....poin|
00003ad0  74 65 72 25 2b 3d 32 38  3a 0d 14 8c 05 e1 0d 14  |ter%+=28:.......|
00003ae0  96 1d dd f2 6d 61 72 6b  5f 6d 65 6e 75 5f 65 6e  |....mark_menu_en|
00003af0  64 28 70 6f 69 6e 74 65  72 25 29 0d 14 a0 28 21  |d(pointer%)...(!|
00003b00  28 70 6f 69 6e 74 65 72  25 2d 32 34 29 3d 21 28  |(pointer%-24)=!(|
00003b10  70 6f 69 6e 74 65 72 25  2d 32 34 29 20 84 20 26  |pointer%-24) . &|
00003b20  38 30 3a 0d 14 aa 05 e1  0d 14 b4 10 dd f2 6d 65  |80:...........me|
00003b30  6e 75 5f 63 6c 6f 73 65  0d 14 be 1b c8 99 22 57  |nu_close......"W|
00003b40  69 6d 70 5f 43 72 65 61  74 65 4d 65 6e 75 22 2c  |imp_CreateMenu",|
00003b50  2c 2d 31 0d 14 c8 05 e1  0d 14 d2 1c dd a4 6d 65  |,-1...........me|
00003b60  6e 75 5f 68 65 69 67 68  74 28 6d 65 6e 75 5f 70  |nu_height(menu_p|
00003b70  74 72 25 29 0d 14 dc 23  ea 20 69 74 65 6d 63 6f  |tr%)...#. itemco|
00003b80  75 6e 74 25 2c 6c 69 6e  65 63 6f 75 6e 74 25 2c  |unt%,linecount%,|
00003b90  68 65 69 67 68 74 25 0d  14 e6 10 69 74 65 6d 63  |height%....itemc|
00003ba0  6f 75 6e 74 25 3d 31 0d  14 f0 26 68 65 69 67 68  |ount%=1...&heigh|
00003bb0  74 25 3d 6d 65 6e 75 5f  70 74 72 25 21 32 30 2b  |t%=menu_ptr%!20+|
00003bc0  6d 65 6e 75 5f 70 74 72  25 21 32 34 3a 0d 14 fa  |menu_ptr%!24:...|
00003bd0  11 6d 65 6e 75 5f 70 74  72 25 2b 3d 32 38 0d 15  |.menu_ptr%+=28..|
00003be0  04 1b c8 95 20 28 21 6d  65 6e 75 5f 70 74 72 25  |.... (!menu_ptr%|
00003bf0  20 80 20 26 38 30 29 3d  30 0d 15 0e 11 69 74 65  | . &80)=0....ite|
00003c00  6d 63 6f 75 6e 74 25 2b  3d 31 0d 15 18 25 e7 20  |mcount%+=1...%. |
00003c10  28 21 6d 65 6e 75 5f 70  74 72 25 20 80 20 26 32  |(!menu_ptr% . &2|
00003c20  29 20 6c 69 6e 65 63 6f  75 6e 74 25 2b 3d 31 0d  |) linecount%+=1.|
00003c30  15 22 11 6d 65 6e 75 5f  70 74 72 25 2b 3d 32 34  |.".menu_ptr%+=24|
00003c40  0d 15 2c 05 ce 0d 15 36  26 e7 20 28 21 6d 65 6e  |..,....6&. (!men|
00003c50  75 5f 70 74 72 25 20 80  20 26 32 29 20 6c 69 6e  |u_ptr% . &2) lin|
00003c60  65 63 6f 75 6e 74 25 2b  3d 31 3a 0d 15 40 25 3d  |ecount%+=1:..@%=|
00003c70  69 74 65 6d 63 6f 75 6e  74 25 2a 68 65 69 67 68  |itemcount%*heigh|
00003c80  74 25 2b 6c 69 6e 65 63  6f 75 6e 74 25 2a 32 34  |t%+linecount%*24|
00003c90  0d 15 4a 19 dd a4 6d 65  6e 75 5f 69 63 6f 6e 66  |..J...menu_iconf|
00003ca0  6c 61 67 28 76 61 72 24  29 0d 15 54 32 e7 76 61  |lag(var$)..T2.va|
00003cb0  72 24 3d 22 22 20 85 20  32 30 30 2c 22 4d 65 6e  |r$="" . 200,"Men|
00003cc0  75 20 69 63 6f 6e 20 66  6c 61 67 20 76 61 6c 75  |u icon flag valu|
00003cd0  65 20 6d 69 73 73 69 6e  67 21 22 0d 15 5e 0c 3d  |e missing!"..^.=|
00003ce0  a0 28 76 61 72 24 29 0d  15 68 2c dd 20 a4 6d 65  |.(var$)..h,. .me|
00003cf0  6e 75 5f 69 6e 66 6f 5f  71 75 69 74 28 77 69 6e  |nu_info_quit(win|
00003d00  64 6f 77 5f 68 61 6e 64  6c 65 25 2c 74 69 74 6c  |dow_handle%,titl|
00003d10  65 24 29 0d 15 72 0b ea  20 6d 65 6e 75 25 0d 15  |e$)..r.. menu%..|
00003d20  7c 0e de 20 6d 65 6e 75  25 20 37 36 0d 15 86 15  ||.. menu% 76....|
00003d30  24 6d 65 6e 75 25 3d 74  69 74 6c 65 24 2b bd 31  |$menu%=title$+.1|
00003d40  33 0d 15 90 24 6d 65 6e  75 25 3f 31 32 3d 37 3a  |3...$menu%?12=7:|
00003d50  6d 65 6e 75 25 3f 31 33  3d 32 3a 6d 65 6e 75 25  |menu%?13=2:menu%|
00003d60  3f 31 34 3d 37 0d 15 9a  27 6d 65 6e 75 25 3f 31  |?14=7...'menu%?1|
00003d70  35 3d 30 3a 6d 65 6e 75  25 21 31 36 3d 31 30 38  |5=0:menu%!16=108|
00003d80  3a 6d 65 6e 75 25 21 32  30 3d 34 34 0d 15 a4 0e  |:menu%!20=44....|
00003d90  6d 65 6e 75 25 21 32 34  3d 30 0d 15 ae 28 6d 65  |menu%!24=0...(me|
00003da0  6e 75 25 21 32 38 3d 26  30 30 3a 6d 65 6e 75 25  |nu%!28=&00:menu%|
00003db0  21 33 32 3d 77 69 6e 64  6f 77 5f 68 61 6e 64 6c  |!32=window_handl|
00003dc0  65 25 0d 15 b8 2d 6d 65  6e 75 25 21 33 36 3d 26  |e%...-menu%!36=&|
00003dd0  30 37 30 30 30 30 32 31  3a 24 28 6d 65 6e 75 25  |07000021:$(menu%|
00003de0  2b 34 30 29 3d 22 49 6e  66 6f 22 2b bd 31 33 0d  |+40)="Info"+.13.|
00003df0  15 c2 1c 6d 65 6e 75 25  21 35 32 3d 26 38 30 3a  |...menu%!52=&80:|
00003e00  6d 65 6e 75 25 21 35 36  3d 2d 31 0d 15 cc 2d 6d  |menu%!56=-1...-m|
00003e10  65 6e 75 25 21 36 30 3d  26 30 37 30 30 30 30 32  |enu%!60=&0700002|
00003e20  31 3a 24 28 6d 65 6e 75  25 2b 36 34 29 3d 22 51  |1:$(menu%+64)="Q|
00003e30  75 69 74 22 2b bd 31 33  0d 15 d6 0a 3d 6d 65 6e  |uit"+.13....=men|
00003e40  75 25 0d 15 e0 1e dd a4  6d 65 6e 75 5f 69 74 65  |u%......menu_ite|
00003e50  6d 5f 70 61 72 61 6d 28  f8 20 69 74 65 6d 24 29  |m_param(. item$)|
00003e60  0d 15 ea 0c ea 20 70 61  72 61 6d 24 0d 15 f4 13  |..... param$....|
00003e70  e7 20 a7 69 74 65 6d 24  2c 22 2c 22 29 20 8c 0d  |. .item$,",") ..|
00003e80  15 fe 1f 69 74 65 6d 24  3d c1 69 74 65 6d 24 2c  |...item$=.item$,|
00003e90  a7 69 74 65 6d 24 2c 22  2c 22 29 2b 31 29 0d 16  |.item$,",")+1)..|
00003ea0  08 20 70 61 72 61 6d 24  3d c0 69 74 65 6d 24 2c  |. param$=.item$,|
00003eb0  a7 69 74 65 6d 24 2c 22  2c 22 29 2d 31 29 0d 16  |.item$,",")-1)..|
00003ec0  12 05 cc 0d 16 1c 0d 70  61 72 61 6d 24 3d 22 22  |.......param$=""|
00003ed0  0d 16 26 05 cd 0d 16 30  0b 3d 70 61 72 61 6d 24  |..&....0.=param$|
00003ee0  0d 16 3a 1b dd a4 6d 65  6e 75 5f 69 74 65 6d 5f  |..:...menu_item_|
00003ef0  74 65 78 74 28 69 74 65  6d 24 29 0d 16 44 2d e7  |text(item$)..D-.|
00003f00  20 a7 69 74 65 6d 24 2c  22 2c 22 29 20 69 74 65  | .item$,",") ite|
00003f10  6d 24 3d c0 69 74 65 6d  24 2c a7 69 74 65 6d 24  |m$=.item$,.item$|
00003f20  2c 22 2c 22 29 2d 31 29  0d 16 4e 0a 3d 69 74 65  |,",")-1)..N.=ite|
00003f30  6d 24 0d 16 58 15 dd a4  6d 65 6e 75 5f 70 61 74  |m$..X...menu_pat|
00003f40  68 28 70 74 72 25 29 0d  16 62 0b ea 20 70 61 74  |h(ptr%)..b.. pat|
00003f50  68 24 0d 16 6c 12 70 61  74 68 24 3d c3 28 21 70  |h$..l.path$=.(!p|
00003f60  74 72 25 29 0d 16 76 0b  70 74 72 25 2b 3d 34 0d  |tr%)..v.ptr%+=4.|
00003f70  16 80 10 c8 95 20 21 70  74 72 25 3c 3e 2d 31 0d  |..... !ptr%<>-1.|
00003f80  16 8a 17 70 61 74 68 24  2b 3d 22 2e 22 2b c3 28  |...path$+="."+.(|
00003f90  21 70 74 72 25 29 0d 16  94 0b 70 74 72 25 2b 3d  |!ptr%)....ptr%+=|
00003fa0  34 0d 16 9e 05 ce 0d 16  a8 0a 3d 70 61 74 68 24  |4.........=path$|
00003fb0  0d 16 b2 17 dd a4 6d 65  6e 75 5f 71 75 69 74 28  |......menu_quit(|
00003fc0  74 69 74 6c 65 24 29 0d  16 bc 0b ea 20 6d 65 6e  |title$)..... men|
00003fd0  75 25 0d 16 c6 0e de 20  6d 65 6e 75 25 20 35 32  |u%..... menu% 52|
00003fe0  0d 16 d0 15 24 6d 65 6e  75 25 3d 74 69 74 6c 65  |....$menu%=title|
00003ff0  24 2b bd 31 33 0d 16 da  24 6d 65 6e 75 25 3f 31  |$+.13...$menu%?1|
00004000  32 3d 37 3a 6d 65 6e 75  25 3f 31 33 3d 32 3a 6d  |2=7:menu%?13=2:m|
00004010  65 6e 75 25 3f 31 34 3d  37 0d 16 e4 27 6d 65 6e  |enu%?14=7...'men|
00004020  75 25 3f 31 35 3d 30 3a  6d 65 6e 75 25 21 31 36  |u%?15=0:menu%!16|
00004030  3d 31 30 38 3a 6d 65 6e  75 25 21 32 30 3d 34 34  |=108:menu%!20=44|
00004040  0d 16 ee 27 6d 65 6e 75  25 21 32 34 3d 30 3a 6d  |...'menu%!24=0:m|
00004050  65 6e 75 25 21 32 38 3d  26 38 30 3a 6d 65 6e 75  |enu%!28=&80:menu|
00004060  25 21 33 32 3d 2d 31 0d  16 f8 2d 6d 65 6e 75 25  |%!32=-1...-menu%|
00004070  21 33 36 3d 26 30 37 30  30 30 30 32 31 3a 24 28  |!36=&07000021:$(|
00004080  6d 65 6e 75 25 2b 34 30  29 3d 22 51 75 69 74 22  |menu%+40)="Quit"|
00004090  2b bd 31 33 0d 17 02 0a  3d 6d 65 6e 75 25 0d 17  |+.13....=menu%..|
000040a0  0c 18 dd a4 6d 65 6e 75  5f 73 75 62 6d 65 6e 75  |....menu_submenu|
000040b0  28 76 61 72 24 29 0d 17  16 28 e7 20 bb 28 76 61  |(var$)...(. .(va|
000040c0  72 24 29 3c 31 20 84 20  bb 28 76 61 72 24 29 3e  |r$)<1 . .(var$)>|
000040d0  de 28 6d 65 6e 75 25 28  29 2c 31 29 20 8c 0d 17  |.(menu%(),1) ...|
000040e0  20 41 85 20 32 30 30 2c  22 43 61 6e 27 74 20 66  | A. 200,"Can't f|
000040f0  69 6e 64 20 6d 65 6e 75  20 22 2b 76 61 72 24 2b  |ind menu "+var$+|
00004100  22 2c 20 61 73 20 72 65  66 65 72 72 65 64 20 74  |", as referred t|
00004110  6f 20 69 6e 3a 2d 20 22  2b 70 61 72 61 6d 24 0d  |o in:- "+param$.|
00004120  17 2a 05 cd 0d 17 34 1a  e7 20 bb 28 76 61 72 24  |.*....4.. .(var$|
00004130  29 3d 6d 65 6e 75 63 6f  75 6e 74 25 20 8c 0d 17  |)=menucount% ...|
00004140  3e 4c 85 20 32 30 30 2c  22 41 6e 20 69 74 65 6d  |>L. 200,"An item|
00004150  20 69 6e 20 6d 65 6e 75  20 22 2b 76 61 72 24 2b  | in menu "+var$+|
00004160  22 20 63 61 6e 6e 6f 74  20 68 61 76 65 20 6d 65  |" cannot have me|
00004170  6e 75 20 22 2b 76 61 72  24 2b 22 20 61 73 20 61  |nu "+var$+" as a|
00004180  20 73 75 62 6d 65 6e 75  21 22 0d 17 48 05 cd 0d  | submenu!"..H...|
00004190  17 52 13 3d 6d 65 6e 75  25 28 bb 28 76 61 72 24  |.R.=menu%(.(var$|
000041a0  29 29 0d 17 5c 13 dd a4  6d 65 6e 75 76 61 72 28  |))..\...menuvar(|
000041b0  76 61 72 24 29 0d 17 66  1c 76 61 72 24 3d c1 76  |var$)..f.var$=.v|
000041c0  61 72 24 2c a7 76 61 72  24 2c 22 28 22 29 2b 31  |ar$,.var$,"(")+1|
000041d0  29 0d 17 70 1c 76 61 72  24 3d c0 76 61 72 24 2c  |)..p.var$=.var$,|
000041e0  a7 76 61 72 24 2c 22 29  22 29 2d 31 29 0d 17 7a  |.var$,")")-1)..z|
000041f0  09 3d 76 61 72 24 0d 17  84 17 dd a4 6d 65 6e 75  |.=var$......menu|
00004200  5f 77 69 6e 64 6f 77 28  76 61 72 24 29 0d 17 8e  |_window(var$)...|
00004210  0d ea 20 68 61 6e 64 6c  65 25 0d 17 98 07 ea 20  |.. handle%..... |
00004220  85 0d 17 a2 43 ee 85 20  85 20 a2 20 30 2c 22 4d  |....C.. . . 0,"M|
00004230  65 6e 75 20 66 69 6c 65  20 65 72 72 6f 72 2e 20  |enu file error. |
00004240  57 69 6e 64 6f 77 20 76  61 72 69 61 62 6c 65 20  |Window variable |
00004250  22 2b 76 61 72 24 2b 22  20 6e 6f 74 20 66 6f 75  |"+var$+" not fou|
00004260  6e 64 2e 22 0d 17 ac 13  68 61 6e 64 6c 65 25 3d  |nd."....handle%=|
00004270  a0 28 76 61 72 24 29 0d  17 b6 11 e7 20 68 61 6e  |.(var$)..... han|
00004280  64 6c 65 25 3c 31 20 8c  0d 17 c0 1c c8 99 22 58  |dle%<1 ......."X|
00004290  4f 53 5f 46 69 6e 64 22  2c 30 2c 6d 65 6e 75 66  |OS_Find",0,menuf|
000042a0  69 6c 65 25 0d 17 ca 06  85 3a 0d 17 d4 05 cd 0d  |ile%.....:......|
000042b0  17 de 0c 3d 68 61 6e 64  6c 65 25 0d 17 e8 19 dd  |...=handle%.....|
000042c0  f2 6d 65 6e 75 5f 77 72  69 74 61 62 6c 65 28 76  |.menu_writable(v|
000042d0  61 72 24 29 0d 17 f2 10  6d 61 78 6c 65 6e 67 74  |ar$)....maxlengt|
000042e0  68 25 3d 30 0d 17 fc 12  e7 20 a7 76 61 72 24 2c  |h%=0..... .var$,|
000042f0  22 3a 22 29 20 8c 0d 18  06 25 6d 61 78 6c 65 6e  |":") ....%maxlen|
00004300  67 74 68 25 3d bb 28 c1  76 61 72 24 2c a7 76 61  |gth%=.(.var$,.va|
00004310  72 24 2c 22 3a 22 29 2b  31 29 29 0d 18 10 32 e7  |r$,":")+1))...2.|
00004320  a9 28 69 74 65 6d 74 65  78 74 24 29 3e 6d 61 78  |.(itemtext$)>max|
00004330  6c 65 6e 67 74 68 25 20  6d 61 78 6c 65 6e 67 74  |length% maxlengt|
00004340  68 25 3d a9 69 74 65 6d  74 65 78 74 24 0d 18 1a  |h%=.itemtext$...|
00004350  05 cc 0d 18 24 19 6d 61  78 6c 65 6e 67 74 68 25  |....$.maxlength%|
00004360  3d a9 69 74 65 6d 74 65  78 74 24 0d 18 2e 05 cd  |=.itemtext$.....|
00004370  0d 18 38 2b 6d 65 6e 75  66 6c 61 67 25 3d 6d 65  |..8+menuflag%=me|
00004380  6e 75 66 6c 61 67 25 84  34 3a 77 72 69 74 61 62  |nuflag%.4:writab|
00004390  6c 65 25 3d bb 28 76 61  72 24 29 0d 18 42 05 e1  |le%=.(var$)..B..|
000043a0  0d 18 4c 1f dd f2 70 75  74 5f 77 72 69 74 65 6d  |..L...put_writem|
000043b0  28 77 72 69 74 65 6d 25  2c 74 65 78 74 24 29 0d  |(writem%,text$).|
000043c0  18 56 31 e7 20 77 72 69  74 65 6d 25 3c 31 20 84  |.V1. writem%<1 .|
000043d0  20 77 72 69 74 65 6d 25  3e de 28 77 72 69 74 61  | writem%>.(writa|
000043e0  62 6c 65 5f 69 74 65 6d  25 28 29 2c 31 29 20 8c  |ble_item%(),1) .|
000043f0  0d 18 60 3d 85 20 32 30  31 2c 22 77 72 69 74 61  |..`=. 201,"writa|
00004400  62 6c 65 20 6d 65 6e 75  20 69 74 65 6d 20 22 2b  |ble menu item "+|
00004410  c3 28 77 72 69 74 65 6d  25 29 2b 22 20 64 6f 65  |.(writem%)+" doe|
00004420  73 20 6e 6f 74 20 65 78  69 73 74 21 22 0d 18 6a  |s not exist!"..j|
00004430  05 cd 0d 18 74 25 e7 20  a9 74 65 78 74 24 3e 77  |....t%. .text$>w|
00004440  72 69 74 61 62 6c 65 5f  6c 65 6e 25 28 77 72 69  |ritable_len%(wri|
00004450  74 65 6d 25 29 20 8c 0d  18 7e 2b e7 20 a9 74 65  |tem%) ...~+. .te|
00004460  78 74 24 3e 31 30 30 20  74 65 78 74 24 3d c0 74  |xt$>100 text$=.t|
00004470  65 78 74 24 2c 31 30 30  29 2b 22 2e 2e 2e 2e 2e  |ext$,100)+".....|
00004480  2e 22 0d 18 88 45 85 20  32 30 31 2c 22 54 65 78  |."...E. 201,"Tex|
00004490  74 20 27 22 2b 74 65 78  74 24 2b 22 27 20 74 6f  |t '"+text$+"' to|
000044a0  6f 20 6c 6f 6e 67 20 66  6f 72 20 77 72 69 74 61  |o long for writa|
000044b0  62 6c 65 20 69 74 65 6d  20 22 2b c3 77 72 69 74  |ble item "+.writ|
000044c0  65 6d 25 2b 22 21 22 0d  18 92 05 cd 0d 18 9c 22  |em%+"!"........"|
000044d0  24 77 72 69 74 61 62 6c  65 5f 69 74 65 6d 25 28  |$writable_item%(|
000044e0  77 72 69 74 65 6d 25 29  3d 74 65 78 74 24 0d 18  |writem%)=text$..|
000044f0  a6 05 e1 0d 18 b0 15 dd  f2 73 65 74 5f 6d 65 6e  |.........set_men|
00004500  75 5f 61 72 72 61 79 73  0d 18 ba 1d ea 20 69 74  |u_arrays..... it|
00004510  65 6d 63 6f 75 6e 74 25  2c 6c 69 6e 65 24 2c 77  |emcount%,line$,w|
00004520  69 64 74 68 25 0d 18 c4  24 6d 65 6e 75 63 6f 75  |idth%...$menucou|
00004530  6e 74 25 3d 30 3a 70 6f  69 6e 74 65 72 25 3d 6d  |nt%=0:pointer%=m|
00004540  65 6e 75 73 74 61 72 74  25 0d 18 ce 13 f2 67 6f  |enustart%.....go|
00004550  74 6f 5f 62 65 67 69 6e  6d 65 6e 75 0d 18 d8 05  |to_beginmenu....|
00004560  f5 0d 18 e2 15 6c 69 6e  65 24 3d be 23 6d 65 6e  |.....line$=.#men|
00004570  75 66 69 6c 65 25 0d 18  ec 19 e7 20 a4 62 65 67  |ufile%..... .beg|
00004580  69 6e 6d 65 6e 75 28 6c  69 6e 65 24 29 20 8c 0d  |inmenu(line$) ..|
00004590  18 f6 42 6d 65 6e 75 25  28 6d 65 6e 75 63 6f 75  |..Bmenu%(menucou|
000045a0  6e 74 25 2b 31 29 3d 6d  65 6e 75 73 74 61 72 74  |nt%+1)=menustart|
000045b0  25 2b 28 6d 65 6e 75 63  6f 75 6e 74 25 2a 32 38  |%+(menucount%*28|
000045c0  29 2b 28 69 74 65 6d 63  6f 75 6e 74 25 2a 32 34  |)+(itemcount%*24|
000045d0  29 0d 19 00 16 6c 69 6e  65 24 3d be 23 6d 65 6e  |)....line$=.#men|
000045e0  75 66 69 6c 65 25 3a 0d  19 0a 11 6d 65 6e 75 63  |ufile%:....menuc|
000045f0  6f 75 6e 74 25 2b 3d 31  0d 19 14 14 6c 69 6e 65  |ount%+=1....line|
00004600  24 3d c0 6c 69 6e 65 24  2c 31 32 29 0d 19 1e 27  |$=.line$,12)...'|
00004610  6d 65 6e 75 77 69 64 74  68 25 28 6d 65 6e 75 63  |menuwidth%(menuc|
00004620  6f 75 6e 74 25 29 3d 31  32 2b 31 36 2a a9 6c 69  |ount%)=12+16*.li|
00004630  6e 65 24 0d 19 28 05 cc  0d 19 32 11 69 74 65 6d  |ne$..(....2.item|
00004640  63 6f 75 6e 74 25 2b 3d  31 0d 19 3c 13 e7 20 a7  |count%+=1..<.. .|
00004650  6c 69 6e 65 24 2c 22 2c  22 29 20 8c 0d 19 46 29  |line$,",") ...F)|
00004660  77 69 64 74 68 25 3d 31  32 2b 31 36 2a a9 28 c0  |width%=12+16*.(.|
00004670  6c 69 6e 65 24 2c a7 6c  69 6e 65 24 2c 22 2c 22  |line$,.line$,","|
00004680  29 2d 31 29 29 0d 19 50  05 cc 0d 19 5a 17 77 69  |)-1))..P....Z.wi|
00004690  64 74 68 25 3d 31 32 2b  31 36 2a a9 6c 69 6e 65  |dth%=12+16*.line|
000046a0  24 0d 19 64 05 cd 0d 19  6e 41 e7 20 77 69 64 74  |$..d....nA. widt|
000046b0  68 25 3e 6d 65 6e 75 77  69 64 74 68 25 28 6d 65  |h%>menuwidth%(me|
000046c0  6e 75 63 6f 75 6e 74 25  29 20 6d 65 6e 75 77 69  |nucount%) menuwi|
000046d0  64 74 68 25 28 6d 65 6e  75 63 6f 75 6e 74 25 29  |dth%(menucount%)|
000046e0  3d 77 69 64 74 68 25 0d  19 78 05 cd 0d 19 82 11  |=width%..x......|
000046f0  fd 20 c5 23 6d 65 6e 75  66 69 6c 65 25 0d 19 8c  |. .#menufile%...|
00004700  05 e1 0d 19 96 1f dd f2  73 68 61 64 65 28 6d 65  |........shade(me|
00004710  6e 75 25 2c 69 74 65 6d  25 2c 73 68 61 64 65 25  |nu%,item%,shade%|
00004720  29 0d 19 a0 12 ea 20 66  6c 61 67 61 64 64 72 65  |)..... flagaddre|
00004730  73 73 25 0d 19 aa 23 e7  6d 65 6e 75 25 3c 31 20  |ss%...#.menu%<1 |
00004740  84 20 6d 65 6e 75 25 3e  de 28 6d 65 6e 75 25 28  |. menu%>.(menu%(|
00004750  29 2c 31 29 20 8c 0d 19  b4 37 85 20 32 30 31 2c  |),1) ....7. 201,|
00004760  22 49 74 65 6d 20 73 68  61 64 65 20 65 72 72 6f  |"Item shade erro|
00004770  72 2e 20 4f 75 74 20 6f  66 20 72 61 6e 67 65 20  |r. Out of range |
00004780  6d 65 6e 75 20 6e 75 6d  62 65 72 21 22 0d 19 be  |menu number!"...|
00004790  05 cd 0d 19 c8 31 e7 20  69 74 65 6d 25 3c 30 20  |.....1. item%<0 |
000047a0  84 20 69 74 65 6d 25 3e  a4 69 74 65 6d 5f 63 6f  |. item%>.item_co|
000047b0  75 6e 74 28 6d 65 6e 75  25 28 6d 65 6e 75 25 29  |unt(menu%(menu%)|
000047c0  29 20 8c 0d 19 d2 3c 85  20 32 30 31 2c 22 49 74  |) ....<. 201,"It|
000047d0  65 6d 20 73 68 61 64 65  20 65 72 72 6f 72 2e 20  |em shade error. |
000047e0  4f 75 74 20 6f 66 20 72  61 6e 67 65 20 6d 65 6e  |Out of range men|
000047f0  75 20 69 74 65 6d 20 6e  75 6d 62 65 72 21 22 0d  |u item number!".|
00004800  19 dc 05 cd 0d 19 e6 2d  66 6c 61 67 61 64 64 72  |.......-flagaddr|
00004810  65 73 73 25 3d 6d 65 6e  75 25 28 6d 65 6e 75 25  |ess%=menu%(menu%|
00004820  29 2b 32 38 2b 28 32 34  2a 69 74 65 6d 25 29 2b  |)+28+(24*item%)+|
00004830  38 0d 19 f0 28 e7 20 73  68 61 64 65 25 3d b9 20  |8...(. shade%=. |
00004840  73 68 61 64 65 25 3d 26  34 30 30 30 30 30 20 8b  |shade%=&400000 .|
00004850  20 73 68 61 64 65 25 3d  30 0d 19 fa 36 21 66 6c  | shade%=0...6!fl|
00004860  61 67 61 64 64 72 65 73  73 25 3d 28 21 66 6c 61  |agaddress%=(!fla|
00004870  67 61 64 64 72 65 73 73  25 20 80 20 26 46 46 42  |gaddress% . &FFB|
00004880  46 46 46 46 46 29 20 84  20 73 68 61 64 65 25 0d  |FFFFF) . shade%.|
00004890  1a 04 05 e1 0d 1a 0e 21  dd f2 73 69 7a 65 5f 6d  |.......!..size_m|
000048a0  65 6e 75 5f 61 72 72 61  79 73 28 6d 65 6e 75 66  |enu_arrays(menuf|
000048b0  69 6c 65 24 29 0d 1a 18  3a ea 20 6d 65 6e 75 63  |ile$)...:. menuc|
000048c0  6f 75 6e 74 25 2c 69 74  65 6d 63 6f 75 6e 74 25  |ount%,itemcount%|
000048d0  2c 77 72 69 74 65 63 6f  75 6e 74 25 2c 77 69 6e  |,writecount%,win|
000048e0  64 6f 77 63 6f 75 6e 74  25 2c 6c 69 6e 65 24 0d  |dowcount%,line$.|
000048f0  1a 22 18 6d 65 6e 75 66  69 6c 65 25 3d 8e 6d 65  |.".menufile%=.me|
00004900  6e 75 66 69 6c 65 24 0d  1a 2c 05 f5 0d 1a 36 15  |nufile$..,....6.|
00004910  6c 69 6e 65 24 3d be 23  6d 65 6e 75 66 69 6c 65  |line$=.#menufile|
00004920  25 0d 1a 40 19 e7 20 a4  62 65 67 69 6e 6d 65 6e  |%..@.. .beginmen|
00004930  75 28 6c 69 6e 65 24 29  20 8c 0d 1a 4a 24 6d 65  |u(line$) ...J$me|
00004940  6e 75 63 6f 75 6e 74 25  2b 3d 31 3a 6c 69 6e 65  |nucount%+=1:line|
00004950  24 3d be 23 6d 65 6e 75  66 69 6c 65 25 3a 0d 1a  |$=.#menufile%:..|
00004960  54 05 cc 0d 1a 5e 24 e7  20 a7 6c 69 6e 65 24 2c  |T....^$. .line$,|
00004970  22 2c 77 72 69 74 22 29  20 77 72 69 74 65 63 6f  |",writ") writeco|
00004980  75 6e 74 25 2b 3d 31 0d  1a 68 25 e7 20 a7 6c 69  |unt%+=1..h%. .li|
00004990  6e 65 24 2c 22 2c 77 69  6e 64 22 29 20 77 69 6e  |ne$,",wind") win|
000049a0  64 6f 77 63 6f 75 6e 74  25 2b 3d 31 0d 1a 72 11  |dowcount%+=1..r.|
000049b0  69 74 65 6d 63 6f 75 6e  74 25 2b 3d 31 0d 1a 7c  |itemcount%+=1..||
000049c0  05 cd 0d 1a 86 11 fd 20  c5 23 6d 65 6e 75 66 69  |....... .#menufi|
000049d0  6c 65 25 0d 1a 90 28 c8  99 22 58 4f 53 5f 46 69  |le%...(.."XOS_Fi|
000049e0  6e 64 22 2c 30 2c 6d 65  6e 75 66 69 6c 65 25 3a  |nd",0,menufile%:|
000049f0  6d 65 6e 75 66 69 6c 65  25 3d 30 0d 1a 9a 44 f2  |menufile%=0...D.|
00004a00  64 69 6d 5f 6d 65 6e 75  5f 61 72 72 61 79 73 28  |dim_menu_arrays(|
00004a10  6d 65 6e 75 63 6f 75 6e  74 25 2c 69 74 65 6d 63  |menucount%,itemc|
00004a20  6f 75 6e 74 25 2c 77 72  69 74 65 63 6f 75 6e 74  |ount%,writecount|
00004a30  25 2c 77 69 6e 64 6f 77  63 6f 75 6e 74 25 29 0d  |%,windowcount%).|
00004a40  1a a4 05 e1 0d 1a ae 1d  dd f2 74 69 63 6b 28 6d  |..........tick(m|
00004a50  65 6e 75 25 2c 69 74 65  6d 25 2c 74 69 63 6b 25  |enu%,item%,tick%|
00004a60  29 0d 1a b8 12 ea 20 66  6c 61 67 61 64 64 72 65  |)..... flagaddre|
00004a70  73 73 25 0d 1a c2 23 e7  6d 65 6e 75 25 3c 31 20  |ss%...#.menu%<1 |
00004a80  84 20 6d 65 6e 75 25 3e  de 28 6d 65 6e 75 25 28  |. menu%>.(menu%(|
00004a90  29 2c 31 29 20 8c 0d 1a  cc 36 85 20 32 30 31 2c  |),1) ....6. 201,|
00004aa0  22 49 74 65 6d 20 74 69  63 6b 20 65 72 72 6f 72  |"Item tick error|
00004ab0  2e 20 4f 75 74 20 6f 66  20 72 61 6e 67 65 20 6d  |. Out of range m|
00004ac0  65 6e 75 20 6e 75 6d 62  65 72 21 22 0d 1a d6 05  |enu number!"....|
00004ad0  cd 0d 1a e0 31 e7 20 69  74 65 6d 25 3c 30 20 84  |....1. item%<0 .|
00004ae0  20 69 74 65 6d 25 3e a4  69 74 65 6d 5f 63 6f 75  | item%>.item_cou|
00004af0  6e 74 28 6d 65 6e 75 25  28 6d 65 6e 75 25 29 29  |nt(menu%(menu%))|
00004b00  20 8c 0d 1a ea 36 85 20  32 30 31 2c 22 49 74 65  | ....6. 201,"Ite|
00004b10  6d 20 74 69 63 6b 20 65  72 72 6f 72 2e 20 4f 75  |m tick error. Ou|
00004b20  74 20 6f 66 20 72 61 6e  67 65 20 69 74 65 6d 20  |t of range item |
00004b30  6e 75 6d 62 65 72 21 22  0d 1a f4 05 cd 0d 1a fe  |number!"........|
00004b40  2b 66 6c 61 67 61 64 64  72 65 73 73 25 3d 6d 65  |+flagaddress%=me|
00004b50  6e 75 25 28 6d 65 6e 75  25 29 2b 32 38 2b 28 32  |nu%(menu%)+28+(2|
00004b60  34 2a 69 74 65 6d 25 29  0d 1b 08 1f e7 20 74 69  |4*item%)..... ti|
00004b70  63 6b 25 3d b9 20 74 69  63 6b 25 3d 31 20 8b 20  |ck%=. tick%=1 . |
00004b80  74 69 63 6b 25 3d 30 0d  1b 12 35 21 66 6c 61 67  |tick%=0...5!flag|
00004b90  61 64 64 72 65 73 73 25  3d 28 21 66 6c 61 67 61  |address%=(!flaga|
00004ba0  64 64 72 65 73 73 25 20  80 20 26 46 46 46 46 46  |ddress% . &FFFFF|
00004bb0  46 46 45 29 20 84 20 74  69 63 6b 25 0d 1b 1c 05  |FFE) . tick%....|
00004bc0  e1 0d 1b 26 22 dd a4 67  65 74 5f 73 74 72 69 6e  |...&"..get_strin|
00004bd0  67 28 70 6f 69 6e 74 65  72 25 2c 6c 65 6e 67 74  |g(pointer%,lengt|
00004be0  68 25 29 0d 1b 30 0b ea  20 74 65 6d 70 24 0d 1b  |h%)..0.. temp$..|
00004bf0  3a 1b e7 20 6c 65 6e 67  74 68 25 3d 30 20 6c 65  |:.. length%=0 le|
00004c00  6e 67 74 68 25 3d 32 35  35 0d 1b 44 2c e3 20 70  |ngth%=255..D,. p|
00004c10  6f 69 6e 74 65 72 25 3d  70 6f 69 6e 74 65 72 25  |ointer%=pointer%|
00004c20  20 b8 20 70 6f 69 6e 74  65 72 25 2b 6c 65 6e 67  | . pointer%+leng|
00004c30  74 68 25 2d 31 0d 1b 4e  14 e7 20 3f 70 6f 69 6e  |th%-1..N.. ?poin|
00004c40  74 65 72 25 3c 33 32 20  8c 0d 1b 58 0a 3d 74 65  |ter%<32 ...X.=te|
00004c50  6d 70 24 0d 1b 62 05 cc  0d 1b 6c 17 74 65 6d 70  |mp$..b....l.temp|
00004c60  24 2b 3d bd 28 3f 70 6f  69 6e 74 65 72 25 29 0d  |$+=.(?pointer%).|
00004c70  1b 76 05 cd 0d 1b 80 05  ed 0d 1b 8a 0a 3d 74 65  |.v...........=te|
00004c80  6d 70 24 0d 1b 94 12 dd  a4 68 65 78 28 6e 75 6d  |mp$......hex(num|
00004c90  62 65 72 25 29 0d 1b 9e  0a ea 20 68 65 78 24 0d  |ber%)..... hex$.|
00004ca0  1b a8 35 c8 99 22 4f 53  5f 43 6f 6e 76 65 72 74  |..5.."OS_Convert|
00004cb0  48 65 78 38 22 2c 6e 75  6d 62 65 72 25 2c 22 30  |Hex8",number%,"0|
00004cc0  30 30 30 30 30 30 30 30  30 22 2c 31 30 20 b8 20  |000000000",10 . |
00004cd0  68 65 78 24 0d 1b b2 23  c8 95 20 c0 68 65 78 24  |hex$...#.. .hex$|
00004ce0  2c 31 29 3d 22 30 22 3a  68 65 78 24 3d c1 68 65  |,1)="0":hex$=.he|
00004cf0  78 24 2c 32 29 3a ce 0d  1b bc 16 e7 20 68 65 78  |x$,2):...... hex|
00004d00  24 3d 22 22 20 68 65 78  24 3d 22 30 22 0d 1b c6  |$="" hex$="0"...|
00004d10  09 3d 68 65 78 24 0d 1b  d0 11 dd a4 6c 65 61 66  |.=hex$......leaf|
00004d20  28 70 61 74 68 24 29 0d  1b da 30 c8 95 20 a7 70  |(path$)...0.. .p|
00004d30  61 74 68 24 2c 22 2e 22  29 3a 70 61 74 68 24 3d  |ath$,"."):path$=|
00004d40  c1 70 61 74 68 24 2c a7  70 61 74 68 24 2c 22 2e  |.path$,.path$,".|
00004d50  22 29 2b 31 29 3a ce 0d  1b e4 0a 3d 70 61 74 68  |")+1):.....=path|
00004d60  24 0d 1b ee 14 dd a4 72  65 61 73 6f 6e 28 65 76  |$......reason(ev|
00004d70  65 6e 74 25 29 0d 1b f8  0d ea 20 72 65 61 73 6f  |ent%)..... reaso|
00004d80  6e 24 0d 1c 02 0f c8 8e  20 65 76 65 6e 74 25 20  |n$...... event% |
00004d90  ca 0d 1c 0c 22 c9 20 30  3a 72 65 61 73 6f 6e 24  |....". 0:reason$|
00004da0  3d 22 4e 75 6c 6c 20 72  65 61 73 6f 6e 20 63 6f  |="Null reason co|
00004db0  64 65 22 0d 1c 16 27 c9  20 31 3a 72 65 61 73 6f  |de"...'. 1:reaso|
00004dc0  6e 24 3d 22 52 65 64 72  61 77 20 77 69 6e 64 6f  |n$="Redraw windo|
00004dd0  77 20 72 65 71 75 65 73  74 22 0d 1c 20 25 c9 20  |w request".. %. |
00004de0  32 3a 72 65 61 73 6f 6e  24 3d 22 4f 70 65 6e 20  |2:reason$="Open |
00004df0  77 69 6e 64 6f 77 20 72  65 71 75 65 73 74 22 0d  |window request".|
00004e00  1c 2a 26 c9 20 33 3a 72  65 61 73 6f 6e 24 3d 22  |.*&. 3:reason$="|
00004e10  43 6c 6f 73 65 20 77 69  6e 64 6f 77 20 72 65 71  |Close window req|
00004e20  75 65 73 74 22 0d 1c 34  28 c9 20 34 3a 72 65 61  |uest"..4(. 4:rea|
00004e30  73 6f 6e 24 3d 22 50 6f  69 6e 74 65 72 20 6c 65  |son$="Pointer le|
00004e40  61 76 69 6e 67 20 77 69  6e 64 6f 77 22 0d 1c 3e  |aving window"..>|
00004e50  29 c9 20 35 3a 72 65 61  73 6f 6e 24 3d 22 50 6f  |). 5:reason$="Po|
00004e60  69 6e 74 65 72 20 65 6e  74 65 72 69 6e 67 20 77  |inter entering w|
00004e70  69 6e 64 6f 77 22 0d 1c  48 26 c9 20 36 3a 72 65  |indow"..H&. 6:re|
00004e80  61 73 6f 6e 24 3d 22 4d  6f 75 73 65 20 62 75 74  |ason$="Mouse but|
00004e90  74 6f 6e 20 70 72 65 73  73 65 64 22 0d 1c 52 29  |ton pressed"..R)|
00004ea0  c9 20 37 3a 72 65 61 73  6f 6e 24 3d 22 44 72 61  |. 7:reason$="Dra|
00004eb0  67 20 68 61 73 20 62 65  65 6e 20 63 6f 6d 70 6c  |g has been compl|
00004ec0  65 74 65 64 22 0d 1c 5c  1d c9 20 38 3a 72 65 61  |eted"..\.. 8:rea|
00004ed0  73 6f 6e 24 3d 22 4b 65  79 20 70 72 65 73 73 65  |son$="Key presse|
00004ee0  64 22 0d 1c 66 20 c9 20  39 3a 72 65 61 73 6f 6e  |d"..f . 9:reason|
00004ef0  24 3d 22 4d 65 6e 75 20  73 65 6c 65 63 74 69 6f  |$="Menu selectio|
00004f00  6e 22 0d 1c 70 20 c9 31  30 3a 72 65 61 73 6f 6e  |n"..p .10:reason|
00004f10  24 3d 22 53 63 72 6f 6c  6c 20 72 65 71 75 65 73  |$="Scroll reques|
00004f20  74 22 0d 1c 7a 1d c9 31  31 3a 72 65 61 73 6f 6e  |t"..z..11:reason|
00004f30  24 3d 22 4c 6f 6f 73 65  20 63 61 72 65 74 22 0d  |$="Loose caret".|
00004f40  1c 84 1c c9 31 32 3a 72  65 61 73 6f 6e 24 3d 22  |....12:reason$="|
00004f50  47 61 69 6e 20 63 61 72  65 74 22 0d 1c 8e 1e c9  |Gain caret".....|
00004f60  31 37 3a 72 65 61 73 6f  6e 24 3d 22 55 73 65 72  |17:reason$="User|
00004f70  20 6d 65 73 73 61 67 65  22 0d 1c 98 22 c9 31 38  | message"...".18|
00004f80  3a 72 65 61 73 6f 6e 24  3d 22 4d 65 73 73 61 67  |:reason$="Messag|
00004f90  65 20 72 65 63 6f 72 64  65 64 22 0d 1c a2 2a c9  |e recorded"...*.|
00004fa0  31 39 3a 72 65 61 73 6f  6e 24 3d 22 55 73 65 72  |19:reason$="User|
00004fb0  20 6d 65 73 73 61 67 65  20 61 63 6b 6e 6f 77 6c  | message acknowl|
00004fc0  65 64 67 65 22 0d 1c ac  05 cb 0d 1c b6 0c 3d 72  |edge".........=r|
00004fd0  65 61 73 6f 6e 24 0d 1c  c0 23 dd f2 72 65 70 6f  |eason$...#..repo|
00004fe0  72 74 5f 65 72 72 6f 72  28 6d 65 73 73 61 67 65  |rt_error(message|
00004ff0  24 2c 74 69 74 6c 65 24  29 0d 1c ca 24 6d 65 73  |$,title$)...$mes|
00005000  73 61 67 65 24 3d bd 30  2b bd 30 2b bd 30 2b bd  |sage$=.0+.0+.0+.|
00005010  30 2b 6d 65 73 73 61 67  65 24 2b bd 30 0d 1c d4  |0+message$+.0...|
00005020  2c c8 99 20 22 57 69 6d  70 5f 52 65 70 6f 72 74  |,.. "Wimp_Report|
00005030  45 72 72 6f 72 22 2c 6d  65 73 73 61 67 65 24 2c  |Error",message$,|
00005040  31 38 2c 74 69 74 6c 65  24 0d 1c de 05 e1 0d 1c  |18,title$.......|
00005050  e8 21 dd f2 73 68 6f 77  5f 76 61 6c 75 65 28 6c  |.!..show_value(l|
00005060  69 6e 65 25 2c 76 61 72  69 61 62 6c 65 24 29 0d  |ine%,variable$).|
00005070  1c f2 11 6c 69 6e 65 25  3d 6c 69 6e 65 25 83 34  |...line%=line%.4|
00005080  0d 1c fc 17 e7 20 a7 76  61 72 69 61 62 6c 65 24  |..... .variable$|
00005090  2c 22 24 22 29 20 8c 0d  1d 06 1f 76 61 72 69 61  |,"$") .....varia|
000050a0  62 6c 65 24 2b 3d 22 3d  22 2b a0 28 76 61 72 69  |ble$+="="+.(vari|
000050b0  61 62 6c 65 24 29 0d 1d  10 05 cc 0d 1d 1a 17 e7  |able$)..........|
000050c0  20 a7 76 61 72 69 61 62  6c 65 24 2c 22 20 22 29  | .variable$," ")|
000050d0  20 8c 0d 1d 24 05 cc 0d  1d 2e 22 76 61 72 69 61  | ...$....."varia|
000050e0  62 6c 65 24 2b 3d 22 3d  22 2b c3 28 a0 28 76 61  |ble$+="="+.(.(va|
000050f0  72 69 61 62 6c 65 24 29  29 0d 1d 38 05 cd 0d 1d  |riable$))..8....|
00005100  42 05 cd 0d 1d 4c 34 f2  70 75 74 5f 69 63 6f 6e  |B....L4.put_icon|
00005110  5f 74 65 78 74 28 73 68  6f 77 5f 76 61 6c 75 65  |_text(show_value|
00005120  25 2c 6c 69 6e 65 25 2c  c0 76 61 72 69 61 62 6c  |%,line%,.variabl|
00005130  65 24 2c 33 35 29 29 0d  1d 56 1d f2 6f 70 65 6e  |e$,35))..V..open|
00005140  5f 77 69 6e 64 6f 77 28  73 68 6f 77 5f 76 61 6c  |_window(show_val|
00005150  75 65 25 29 0d 1d 60 05  e1 0d 1d 6a 1f dd a4 73  |ue%)..`....j...s|
00005160  79 73 74 65 6d 5f 76 61  72 69 61 62 6c 65 28 73  |ystem_variable(s|
00005170  79 73 5f 76 61 72 24 29  0d 1d 74 0d ea 20 6c 65  |ys_var$)..t.. le|
00005180  6e 67 74 68 25 0d 1d 7e  3d c8 99 22 58 4f 53 5f  |ngth%..~=.."XOS_|
00005190  52 65 61 64 56 61 72 56  61 6c 22 2c 73 79 73 5f  |ReadVarVal",sys_|
000051a0  76 61 72 24 2b bd 28 30  29 2c 74 65 6d 70 5f 62  |var$+.(0),temp_b|
000051b0  6c 6b 25 2c 2d 31 20 b8  20 2c 2c 6c 65 6e 67 74  |lk%,-1 . ,,lengt|
000051c0  68 25 0d 1d 88 41 e7 20  6c 65 6e 67 74 68 25 3d  |h%...A. length%=|
000051d0  30 20 85 20 a2 20 30 2c  22 53 79 73 74 65 6d 20  |0 . . 0,"System |
000051e0  76 61 72 69 61 62 6c 65  20 27 22 2b 73 79 73 5f  |variable '"+sys_|
000051f0  76 61 72 24 2b 22 27 20  6e 6f 74 20 66 6f 75 6e  |var$+"' not foun|
00005200  64 21 22 0d 1d 92 41 c8  99 22 58 4f 53 5f 52 65  |d!"...A.."XOS_Re|
00005210  61 64 56 61 72 56 61 6c  22 2c 73 79 73 5f 76 61  |adVarVal",sys_va|
00005220  72 24 2b bd 28 30 29 2c  74 65 6d 70 5f 62 6c 6b  |r$+.(0),temp_blk|
00005230  25 2c 32 35 35 2c 2c 33  20 b8 20 2c 2c 6c 65 6e  |%,255,,3 . ,,len|
00005240  67 74 68 25 0d 1d 9c 1b  3f 28 74 65 6d 70 5f 62  |gth%....?(temp_b|
00005250  6c 6b 25 2b 6c 65 6e 67  74 68 25 29 3d 31 33 0d  |lk%+length%)=13.|
00005260  1d a6 0f 3d 24 74 65 6d  70 5f 62 6c 6b 25 0d 1d  |...=$temp_blk%..|
00005270  b0 31 dd f2 63 68 61 6e  67 65 5f 70 6f 69 6e 74  |.1..change_point|
00005280  65 72 28 73 70 72 69 74  65 73 25 2c 73 70 72 69  |er(sprites%,spri|
00005290  74 65 5f 6e 61 6d 65 24  2c 78 25 2c 79 25 29 0d  |te_name$,x%,y%).|
000052a0  1d ba 36 c8 99 22 4f 53  5f 53 70 72 69 74 65 4f  |..6.."OS_SpriteO|
000052b0  70 22 2c 26 31 32 34 2c  73 70 72 69 74 65 73 25  |p",&124,sprites%|
000052c0  2c 73 70 72 69 74 65 5f  6e 61 6d 65 24 2c 32 2c  |,sprite_name$,2,|
000052d0  78 25 2c 79 25 0d 1d c4  11 74 65 6d 70 5f 62 6c  |x%,y%....temp_bl|
000052e0  6b 25 3f 30 3d 31 0d 1d  ce 12 74 65 6d 70 5f 62  |k%?0=1....temp_b|
000052f0  6c 6b 25 3f 31 3d 32 35  0d 1d d8 13 74 65 6d 70  |lk%?1=25....temp|
00005300  5f 62 6c 6b 25 3f 32 3d  26 46 46 0d 1d e2 13 74  |_blk%?2=&FF....t|
00005310  65 6d 70 5f 62 6c 6b 25  3f 33 3d 26 42 42 0d 1d  |emp_blk%?3=&BB..|
00005320  ec 13 74 65 6d 70 5f 62  6c 6b 25 3f 34 3d 26 42  |..temp_blk%?4=&B|
00005330  42 0d 1d f6 1c c8 99 22  4f 53 5f 57 6f 72 64 22  |B......"OS_Word"|
00005340  2c 31 32 2c 74 65 6d 70  5f 62 6c 6b 25 0d 1e 00  |,12,temp_blk%...|
00005350  11 74 65 6d 70 5f 62 6c  6b 25 3f 30 3d 32 0d 1e  |.temp_blk%?0=2..|
00005360  0a 13 74 65 6d 70 5f 62  6c 6b 25 3f 32 3d 26 35  |..temp_blk%?2=&5|
00005370  35 0d 1e 14 13 74 65 6d  70 5f 62 6c 6b 25 3f 33  |5....temp_blk%?3|
00005380  3d 26 35 35 0d 1e 1e 13  74 65 6d 70 5f 62 6c 6b  |=&55....temp_blk|
00005390  25 3f 34 3d 26 35 35 0d  1e 28 1c c8 99 22 4f 53  |%?4=&55..(..."OS|
000053a0  5f 57 6f 72 64 22 2c 31  32 2c 74 65 6d 70 5f 62  |_Word",12,temp_b|
000053b0  6c 6b 25 0d 1e 32 0e 2a  50 4f 49 4e 54 45 52 20  |lk%..2.*POINTER |
000053c0  32 0d 1e 3c 05 e1 0d 1e  46 15 dd f2 72 65 73 74  |2..<....F...rest|
000053d0  6f 72 65 5f 70 6f 69 6e  74 65 72 0d 1e 50 0e 2a  |ore_pointer..P.*|
000053e0  50 4f 49 4e 54 45 52 20  31 0d 1e 5a 05 e1 0d 1e  |POINTER 1..Z....|
000053f0  64 32 dd a4 67 65 74 5f  73 70 72 69 74 65 5f 6e  |d2..get_sprite_n|
00005400  61 6d 65 28 77 69 6e 64  6f 77 5f 68 61 6e 64 6c  |ame(window_handl|
00005410  65 25 2c 69 63 6f 6e 5f  68 61 6e 64 6c 65 25 29  |e%,icon_handle%)|
00005420  0d 1e 6e 0b ea 20 74 65  6d 70 24 0d 1e 78 1e 74  |..n.. temp$..x.t|
00005430  65 6d 70 5f 62 6c 6b 25  21 30 3d 77 69 6e 64 6f  |emp_blk%!0=windo|
00005440  77 5f 68 61 6e 64 6c 65  25 0d 1e 82 1c 74 65 6d  |w_handle%....tem|
00005450  70 5f 62 6c 6b 25 21 34  3d 69 63 6f 6e 5f 68 61  |p_blk%!4=icon_ha|
00005460  6e 64 6c 65 25 0d 1e 8c  24 c8 99 22 57 69 6d 70  |ndle%...$.."Wimp|
00005470  5f 47 65 74 49 63 6f 6e  53 74 61 74 65 22 2c 2c  |_GetIconState",,|
00005480  74 65 6d 70 5f 62 6c 6b  25 0d 1e 96 1e c8 8e 20  |temp_blk%...... |
00005490  28 74 65 6d 70 5f 62 6c  6b 25 21 32 34 20 80 20  |(temp_blk%!24 . |
000054a0  26 31 30 33 29 20 ca 0d  1e a0 0f c9 20 26 30 30  |&103) ...... &00|
000054b0  32 2c 26 30 30 33 0d 1e  aa 22 3d a4 67 65 74 5f  |2,&003..."=.get_|
000054c0  73 74 72 69 6e 67 28 74  65 6d 70 5f 62 6c 6b 25  |string(temp_blk%|
000054d0  21 32 38 2c 32 35 36 29  0d 1e b4 0a c9 20 26 31  |!28,256)..... &1|
000054e0  30 32 0d 1e be 16 e7 20  74 65 6d 70 5f 62 6c 6b  |02..... temp_blk|
000054f0  25 21 33 36 3e 30 20 8c  0d 1e c8 2b 3d a4 67 65  |%!36>0 ....+=.ge|
00005500  74 5f 73 74 72 69 6e 67  28 74 65 6d 70 5f 62 6c  |t_string(temp_bl|
00005510  6b 25 21 32 38 2c 74 65  6d 70 5f 62 6c 6b 25 21  |k%!28,temp_blk%!|
00005520  33 36 29 0d 1e d2 05 cc  0d 1e dc 31 85 20 32 30  |36)........1. 20|
00005530  32 2c 22 4e 6f 20 73 70  72 69 74 65 20 6e 61 6d  |2,"No sprite nam|
00005540  65 20 69 6e 20 69 63 6f  6e 20 22 2b c3 69 63 6f  |e in icon "+.ico|
00005550  6e 5f 68 61 6e 64 6c 65  25 0d 1e e6 07 3d 22 22  |n_handle%....=""|
00005560  0d 1e f0 05 cd 0d 1e fa  0a c9 20 26 31 30 33 0d  |.......... &103.|
00005570  1f 04 2f 3d c1 a4 67 65  74 5f 73 74 72 69 6e 67  |../=..get_string|
00005580  28 74 65 6d 70 5f 62 6c  6b 25 21 33 32 2c 74 65  |(temp_blk%!32,te|
00005590  6d 70 5f 62 6c 6b 25 21  33 36 29 2c 32 29 0d 1f  |mp_blk%!36),2)..|
000055a0  0e 05 7f 0d 1f 18 31 85  20 32 30 32 2c 22 4e 6f  |......1. 202,"No|
000055b0  20 73 70 72 69 74 65 20  6e 61 6d 65 20 69 6e 20  | sprite name in |
000055c0  69 63 6f 6e 20 22 2b c3  69 63 6f 6e 5f 68 61 6e  |icon "+.icon_han|
000055d0  64 6c 65 25 0d 1f 22 07  3d 22 22 0d 1f 2c 05 cb  |dle%..".=""..,..|
000055e0  0d 1f 36 0a 3d 74 65 6d  70 24 0d 1f 40 33 dd a4  |..6.=temp$..@3..|
000055f0  69 63 6f 6e 5f 73 70 72  69 74 65 5f 74 79 70 65  |icon_sprite_type|
00005600  28 77 69 6e 64 6f 77 5f  68 61 6e 64 6c 65 25 2c  |(window_handle%,|
00005610  69 63 6f 6e 5f 68 61 6e  64 6c 65 25 29 0d 1f 4a  |icon_handle%)..J|
00005620  3d 3d a0 28 22 26 22 2b  c2 a4 67 65 74 5f 73 70  |==.("&"+..get_sp|
00005630  72 69 74 65 5f 6e 61 6d  65 28 77 69 6e 64 6f 77  |rite_name(window|
00005640  5f 68 61 6e 64 6c 65 25  2c 69 63 6f 6e 5f 68 61  |_handle%,icon_ha|
00005650  6e 64 6c 65 25 29 2c 33  29 29 0d 1f 54 19 dd a4  |ndle%),3))..T...|
00005660  6c 6f 61 64 5f 73 70 72  69 74 65 73 28 66 69 6c  |load_sprites(fil|
00005670  65 24 29 0d 1f 5e 14 ea  20 73 70 72 69 74 65 73  |e$)..^.. sprites|
00005680  25 2c 73 69 7a 65 25 0d  1f 68 1e 73 69 7a 65 25  |%,size%..h.size%|
00005690  3d a4 66 69 6c 65 5f 73  69 7a 65 28 66 69 6c 65  |=.file_size(file|
000056a0  24 29 2b 31 36 0d 1f 72  14 de 20 73 70 72 69 74  |$)+16..r.. sprit|
000056b0  65 73 25 20 73 69 7a 65  25 0d 1f 7c 14 73 70 72  |es% size%..|.spr|
000056c0  69 74 65 73 25 21 30 3d  73 69 7a 65 25 0d 1f 86  |ites%!0=size%...|
000056d0  11 73 70 72 69 74 65 73  25 21 38 3d 31 36 0d 1f  |.sprites%!8=16..|
000056e0  90 28 c8 99 22 4f 53 5f  53 70 72 69 74 65 4f 70  |.(.."OS_SpriteOp|
000056f0  22 2c 26 31 30 41 2c 73  70 72 69 74 65 73 25 2c  |",&10A,sprites%,|
00005700  66 69 6c 65 24 3a 0d 1f  9a 0d 3d 73 70 72 69 74  |file$:....=sprit|
00005710  65 73 25 0d 1f a4 42 dd  a4 6e 65 77 5f 74 65 6d  |es%...B..new_tem|
00005720  70 6c 61 74 65 28 74 65  6d 70 6c 61 74 65 5f 66  |plate(template_f|
00005730  69 6c 65 24 2c 77 69 6e  64 6f 77 5f 6e 61 6d 65  |ile$,window_name|
00005740  24 2c f8 20 6d 65 6d 66  72 65 65 25 2c 6d 65 6d  |$,. memfree%,mem|
00005750  65 6e 64 25 29 0d 1f ae  14 ea 20 77 69 6e 64 6f  |end%)..... windo|
00005760  77 5f 68 61 6e 64 6c 65  25 0d 1f b8 29 c8 99 22  |w_handle%...).."|
00005770  57 69 6d 70 5f 4f 70 65  6e 54 65 6d 70 6c 61 74  |Wimp_OpenTemplat|
00005780  65 22 2c 2c 74 65 6d 70  6c 61 74 65 5f 66 69 6c  |e",,template_fil|
00005790  65 24 0d 1f c2 3b 77 69  6e 64 6f 77 5f 68 61 6e  |e$...;window_han|
000057a0  64 6c 65 25 3d a4 74 65  6d 70 6c 61 74 65 28 77  |dle%=.template(w|
000057b0  69 6e 64 6f 77 5f 6e 61  6d 65 24 2c 6d 65 6d 66  |indow_name$,memf|
000057c0  72 65 65 25 2c 6d 65 6d  65 6e 64 25 29 0d 1f cc  |ree%,memend%)...|
000057d0  1b c8 99 20 22 57 69 6d  70 5f 43 6c 6f 73 65 54  |... "Wimp_CloseT|
000057e0  65 6d 70 6c 61 74 65 22  0d 1f d6 13 3d 77 69 6e  |emplate"....=win|
000057f0  64 6f 77 5f 68 61 6e 64  6c 65 25 0d 1f e0 28 dd  |dow_handle%...(.|
00005800  a4 74 65 6d 70 6c 61 74  65 28 77 69 6e 64 6f 77  |.template(window|
00005810  5f 6e 61 6d 65 24 2c f8  20 70 74 72 25 2c 65 6e  |_name$,. ptr%,en|
00005820  64 25 29 0d 1f ea 1b ea  20 66 6f 75 6e 64 25 2c  |d%)..... found%,|
00005830  77 69 6e 64 6f 77 5f 68  61 6e 64 6c 65 25 0d 1f  |window_handle%..|
00005840  f4 4e c8 99 22 57 69 6d  70 5f 4c 6f 61 64 54 65  |.N.."Wimp_LoadTe|
00005850  6d 70 6c 61 74 65 22 2c  2c 62 6c 6b 25 2c 70 74  |mplate",,blk%,pt|
00005860  72 25 2c 65 6e 64 25 2c  2d 31 2c 77 69 6e 64 6f  |r%,end%,-1,windo|
00005870  77 5f 6e 61 6d 65 24 2c  30 20 b8 20 2c 2c 70 74  |w_name$,0 . ,,pt|
00005880  72 25 2c 2c 2c 2c 66 6f  75 6e 64 25 0d 1f fe 0e  |r%,,,,found%....|
00005890  e7 20 66 6f 75 6e 64 25  20 8c 0d 20 08 31 c8 99  |. found% .. .1..|
000058a0  20 22 57 69 6d 70 5f 43  72 65 61 74 65 57 69 6e  | "Wimp_CreateWin|
000058b0  64 6f 77 22 2c 2c 62 6c  6b 25 20 b8 20 77 69 6e  |dow",,blk% . win|
000058c0  64 6f 77 5f 68 61 6e 64  6c 65 25 0d 20 12 05 cc  |dow_handle%. ...|
000058d0  0d 20 1c 3f 85 20 a2 20  30 2c 22 57 69 6e 64 6f  |. .?. . 0,"Windo|
000058e0  77 20 22 2b 77 69 6e 64  6f 77 5f 6e 61 6d 65 24  |w "+window_name$|
000058f0  2b 22 20 6e 6f 74 20 66  6f 75 6e 64 20 69 6e 20  |+" not found in |
00005900  74 65 6d 70 6c 61 74 65  20 66 69 6c 65 21 22 0d  |template file!".|
00005910  20 26 14 77 69 6e 64 6f  77 5f 68 61 6e 64 6c 65  | &.window_handle|
00005920  25 3d 30 0d 20 30 05 cd  0d 20 3a 13 3d 77 69 6e  |%=0. 0... :.=win|
00005930  64 6f 77 5f 68 61 6e 64  6c 65 25 0d 20 44 44 dd  |dow_handle%. DD.|
00005940  a4 61 64 64 5f 69 63 6f  6e 28 74 79 70 65 24 2c  |.add_icon(type$,|
00005950  74 65 78 74 24 2c 77 69  6e 64 6f 77 5f 68 61 6e  |text$,window_han|
00005960  64 6c 65 25 2c 78 25 2c  79 25 2c 73 6c 25 2c 65  |dle%,x%,y%,sl%,e|
00005970  73 67 5f 73 70 25 2c 62  6f 72 64 65 72 25 29 0d  |sg_sp%,border%).|
00005980  20 4e 29 dd f2 63 68 61  6e 67 65 5f 65 78 74 65  | N)..change_exte|
00005990  6e 74 28 77 69 6e 64 6f  77 5f 68 61 6e 64 6c 65  |nt(window_handle|
000059a0  25 2c 78 25 2c 79 25 29  0d 20 58 37 ea 20 6d 69  |%,x%,y%). X7. mi|
000059b0  6e 5f 78 25 2c 6d 69 6e  5f 79 25 2c 6d 61 78 5f  |n_x%,min_y%,max_|
000059c0  78 25 2c 6d 61 78 5f 79  25 2c 6d 61 78 5f 76 69  |x%,max_y%,max_vi|
000059d0  73 5f 78 25 2c 6d 69 6e  5f 76 69 73 5f 79 25 0d  |s_x%,min_vis_y%.|
000059e0  20 62 1d 21 74 65 6d 70  5f 62 6c 6b 25 3d 77 69  | b.!temp_blk%=wi|
000059f0  6e 64 6f 77 5f 68 61 6e  64 6c 65 25 0d 20 6c 26  |ndow_handle%. l&|
00005a00  c8 99 20 22 57 69 6d 70  5f 47 65 74 57 69 6e 64  |.. "Wimp_GetWind|
00005a10  6f 77 49 6e 66 6f 22 2c  2c 74 65 6d 70 5f 62 6c  |owInfo",,temp_bl|
00005a20  6b 25 0d 20 76 17 6d 69  6e 5f 78 25 3d 74 65 6d  |k%. v.min_x%=tem|
00005a30  70 5f 62 6c 6b 25 21 34  34 0d 20 80 12 6d 69 6e  |p_blk%!44. ..min|
00005a40  5f 79 25 3d 79 25 2d 79  25 83 34 0d 20 8a 12 6d  |_y%=y%-y%.4. ..m|
00005a50  61 78 5f 78 25 3d 78 25  2d 78 25 83 32 0d 20 94  |ax_x%=x%-x%.2. .|
00005a60  17 6d 61 78 5f 79 25 3d  74 65 6d 70 5f 62 6c 6b  |.max_y%=temp_blk|
00005a70  25 21 35 36 0d 20 9e 34  6d 61 78 5f 76 69 73 5f  |%!56. .4max_vis_|
00005a80  78 25 3d 74 65 6d 70 5f  62 6c 6b 25 21 32 30 2b  |x%=temp_blk%!20+|
00005a90  74 65 6d 70 5f 62 6c 6b  25 21 31 32 2d 74 65 6d  |temp_blk%!12-tem|
00005aa0  70 5f 62 6c 6b 25 21 34  0d 20 a8 34 6d 69 6e 5f  |p_blk%!4. .4min_|
00005ab0  76 69 73 5f 79 25 3d 74  65 6d 70 5f 62 6c 6b 25  |vis_y%=temp_blk%|
00005ac0  21 32 34 2d 74 65 6d 70  5f 62 6c 6b 25 21 31 36  |!24-temp_blk%!16|
00005ad0  2b 74 65 6d 70 5f 62 6c  6b 25 21 38 0d 20 b2 29  |+temp_blk%!8. .)|
00005ae0  e7 20 6d 69 6e 5f 79 25  3e 6d 69 6e 5f 76 69 73  |. min_y%>min_vis|
00005af0  5f 79 25 20 6d 69 6e 5f  79 25 3d 6d 69 6e 5f 76  |_y% min_y%=min_v|
00005b00  69 73 5f 79 25 0d 20 bc  29 e7 20 6d 61 78 5f 76  |is_y%. .). max_v|
00005b10  69 73 5f 78 25 3e 6d 61  78 5f 78 25 20 6d 61 78  |is_x%>max_x% max|
00005b20  5f 78 25 3d 6d 61 78 5f  76 69 73 5f 78 25 0d 20  |_x%=max_vis_x%. |
00005b30  c6 16 74 65 6d 70 5f 62  6c 6b 25 21 30 3d 6d 69  |..temp_blk%!0=mi|
00005b40  6e 5f 78 25 0d 20 d0 16  74 65 6d 70 5f 62 6c 6b  |n_x%. ..temp_blk|
00005b50  25 21 34 3d 6d 69 6e 5f  79 25 0d 20 da 16 74 65  |%!4=min_y%. ..te|
00005b60  6d 70 5f 62 6c 6b 25 21  38 3d 6d 61 78 5f 78 25  |mp_blk%!8=max_x%|
00005b70  0d 20 e4 17 74 65 6d 70  5f 62 6c 6b 25 21 31 32  |. ..temp_blk%!12|
00005b80  3d 6d 61 78 5f 79 25 0d  20 ee 2f c8 99 22 57 69  |=max_y%. ./.."Wi|
00005b90  6d 70 5f 53 65 74 45 78  74 65 6e 74 22 2c 77 69  |mp_SetExtent",wi|
00005ba0  6e 64 6f 77 5f 68 61 6e  64 6c 65 25 2c 74 65 6d  |ndow_handle%,tem|
00005bb0  70 5f 62 6c 6b 25 0d 20  f8 05 e1 0d 21 02 18 dd  |p_blk%. ....!...|
00005bc0  f2 63 6c 65 61 72 5f 70  72 69 6e 74 5f 77 69 6e  |.clear_print_win|
00005bd0  64 6f 77 0d 21 0c 27 ea  20 6d 69 6e 5f 78 25 2c  |dow.!.'. min_x%,|
00005be0  6d 69 6e 5f 79 25 2c 6d  61 78 5f 78 25 2c 6d 61  |min_y%,max_x%,ma|
00005bf0  78 5f 79 25 2c 6d 6f 72  65 25 0d 21 16 14 70 72  |x_y%,more%.!..pr|
00005c00  69 6e 74 5f 6c 69 6e 65  24 28 29 3d 22 22 0d 21  |int_line$()="".!|
00005c10  20 1c 21 74 65 6d 70 5f  62 6c 6b 25 3d 70 72 69  | .!temp_blk%=pri|
00005c20  6e 74 5f 77 69 6e 64 6f  77 25 0d 21 2a 26 c8 99  |nt_window%.!*&..|
00005c30  20 22 57 69 6d 70 5f 47  65 74 57 69 6e 64 6f 77  | "Wimp_GetWindow|
00005c40  49 6e 66 6f 22 2c 2c 74  65 6d 70 5f 62 6c 6b 25  |Info",,temp_blk%|
00005c50  0d 21 34 17 6d 69 6e 5f  78 25 3d 74 65 6d 70 5f  |.!4.min_x%=temp_|
00005c60  62 6c 6b 25 21 34 34 0d  21 3e 17 6d 69 6e 5f 79  |blk%!44.!>.min_y|
00005c70  25 3d 74 65 6d 70 5f 62  6c 6b 25 21 34 38 0d 21  |%=temp_blk%!48.!|
00005c80  48 17 6d 61 78 5f 78 25  3d 74 65 6d 70 5f 62 6c  |H.max_x%=temp_bl|
00005c90  6b 25 21 35 32 0d 21 52  17 6d 61 78 5f 79 25 3d  |k%!52.!R.max_y%=|
00005ca0  74 65 6d 70 5f 62 6c 6b  25 21 35 36 0d 21 5c 16  |temp_blk%!56.!\.|
00005cb0  74 65 6d 70 5f 62 6c 6b  25 21 34 3d 6d 69 6e 5f  |temp_blk%!4=min_|
00005cc0  78 25 0d 21 66 16 74 65  6d 70 5f 62 6c 6b 25 21  |x%.!f.temp_blk%!|
00005cd0  38 3d 6d 69 6e 5f 79 25  0d 21 70 17 74 65 6d 70  |8=min_y%.!p.temp|
00005ce0  5f 62 6c 6b 25 21 31 32  3d 6d 61 78 5f 78 25 0d  |_blk%!12=max_x%.|
00005cf0  21 7a 17 74 65 6d 70 5f  62 6c 6b 25 21 31 36 3d  |!z.temp_blk%!16=|
00005d00  6d 61 78 5f 79 25 0d 21  84 2c c8 99 22 57 69 6d  |max_y%.!.,.."Wim|
00005d10  70 5f 55 70 64 61 74 65  57 69 6e 64 6f 77 22 2c  |p_UpdateWindow",|
00005d20  2c 74 65 6d 70 5f 62 6c  6b 25 20 b8 20 6d 6f 72  |,temp_blk% . mor|
00005d30  65 25 0d 21 8e 0c c8 95  20 6d 6f 72 65 25 0d 21  |e%.!.... more%.!|
00005d40  98 05 db 0d 21 a2 2c c8  99 22 57 69 6d 70 5f 47  |....!.,.."Wimp_G|
00005d50  65 74 52 65 63 74 61 6e  67 6c 65 22 2c 2c 74 65  |etRectangle",,te|
00005d60  6d 70 5f 62 6c 6b 25 20  b8 20 6d 6f 72 65 25 0d  |mp_blk% . more%.|
00005d70  21 ac 05 ce 0d 21 b6 05  e1 0d 21 c0 23 dd 20 f2  |!....!....!.#. .|
00005d80  63 6c 6f 73 65 5f 77 69  6e 64 6f 77 28 77 69 6e  |close_window(win|
00005d90  64 6f 77 5f 68 61 6e 64  6c 65 25 29 0d 21 ca 1d  |dow_handle%).!..|
00005da0  21 74 65 6d 70 5f 62 6c  6b 25 3d 77 69 6e 64 6f  |!temp_blk%=windo|
00005db0  77 5f 68 61 6e 64 6c 65  25 0d 21 d4 24 c8 99 20  |w_handle%.!.$.. |
00005dc0  22 57 69 6d 70 5f 43 6c  6f 73 65 57 69 6e 64 6f  |"Wimp_CloseWindo|
00005dd0  77 22 2c 2c 74 65 6d 70  5f 62 6c 6b 25 0d 21 de  |w",,temp_blk%.!.|
00005de0  05 e1 0d 21 e8 18 dd a4  63 72 65 61 74 65 5f 69  |...!....create_i|
00005df0  6e 66 6f 5f 77 69 6e 64  6f 77 0d 21 f2 0b ea 20  |nfo_window.!... |
00005e00  69 63 6f 6e 25 0d 21 fc  4e 69 6e 66 6f 25 3d a4  |icon%.!.Ninfo%=.|
00005e10  63 72 65 61 74 65 5f 77  69 6e 64 6f 77 28 22 41  |create_window("A|
00005e20  62 6f 75 74 20 74 68 69  73 20 70 72 6f 67 72 61  |bout this progra|
00005e30  6d 22 2c 26 38 34 30 30  30 30 31 32 2c 36 36 30  |m",&84000012,660|
00005e40  2c 32 31 32 2c 30 2c 36  36 30 2c 39 39 39 2c 39  |,212,0,660,999,9|
00005e50  39 39 29 0d 22 06 3a 69  63 6f 6e 25 3d 20 20 a4  |99).".:icon%=  .|
00005e60  61 64 64 5f 69 63 6f 6e  28 22 6c 61 62 65 6c 22  |add_icon("label"|
00005e70  2c 22 20 20 20 4e 61 6d  65 3a 22 2c 69 6e 66 6f  |,"   Name:",info|
00005e80  25 2c 38 2c 2d 34 2c 30  2c 30 2c 30 29 0d 22 10  |%,8,-4,0,0,0).".|
00005e90  3b 69 63 6f 6e 25 3d 20  20 a4 61 64 64 5f 69 63  |;icon%=  .add_ic|
00005ea0  6f 6e 28 22 72 65 70 6f  72 74 22 2c c4 33 30 2c  |on("report",.30,|
00005eb0  22 20 22 29 2c 69 6e 66  6f 25 2c 31 35 36 2c 2d  |" "),info%,156,-|
00005ec0  34 2c 30 2c 30 2c 30 29  0d 22 1a 3c 69 63 6f 6e  |4,0,0,0).".<icon|
00005ed0  25 3d 20 20 a4 61 64 64  5f 69 63 6f 6e 28 22 72  |%=  .add_icon("r|
00005ee0  65 70 6f 72 74 22 2c c4  33 30 2c 22 20 22 29 2c  |eport",.30," "),|
00005ef0  69 6e 66 6f 25 2c 31 35  36 2c 2d 35 36 2c 30 2c  |info%,156,-56,0,|
00005f00  30 2c 30 29 0d 22 24 3d  69 63 6f 6e 25 3d 20 20  |0,0)."$=icon%=  |
00005f10  a4 61 64 64 5f 69 63 6f  6e 28 22 72 65 70 6f 72  |.add_icon("repor|
00005f20  74 22 2c c4 33 30 2c 22  20 22 29 2c 69 6e 66 6f  |t",.30," "),info|
00005f30  25 2c 31 35 36 2c 2d 31  30 38 2c 30 2c 30 2c 30  |%,156,-108,0,0,0|
00005f40  29 0d 22 2e 3d 69 63 6f  6e 25 3d 20 20 a4 61 64  |).".=icon%=  .ad|
00005f50  64 5f 69 63 6f 6e 28 22  72 65 70 6f 72 74 22 2c  |d_icon("report",|
00005f60  c4 33 30 2c 22 20 22 29  2c 69 6e 66 6f 25 2c 31  |.30," "),info%,1|
00005f70  35 36 2c 2d 31 36 30 2c  30 2c 30 2c 30 29 0d 22  |56,-160,0,0,0)."|
00005f80  38 3b 69 63 6f 6e 25 3d  20 20 a4 61 64 64 5f 69  |8;icon%=  .add_i|
00005f90  63 6f 6e 28 22 6c 61 62  65 6c 22 2c 22 50 75 72  |con("label","Pur|
00005fa0  70 6f 73 65 3a 22 2c 69  6e 66 6f 25 2c 38 2c 2d  |pose:",info%,8,-|
00005fb0  35 36 2c 30 2c 30 2c 30  29 0d 22 42 3c 69 63 6f  |56,0,0,0)."B<ico|
00005fc0  6e 25 3d 20 20 a4 61 64  64 5f 69 63 6f 6e 28 22  |n%=  .add_icon("|
00005fd0  6c 61 62 65 6c 22 2c 22  20 41 75 74 68 6f 72 3a  |label"," Author:|
00005fe0  22 2c 69 6e 66 6f 25 2c  38 2c 2d 31 30 38 2c 30  |",info%,8,-108,0|
00005ff0  2c 30 2c 30 29 0d 22 4c  3c 69 63 6f 6e 25 3d 20  |,0,0)."L<icon%= |
00006000  20 a4 61 64 64 5f 69 63  6f 6e 28 22 6c 61 62 65  | .add_icon("labe|
00006010  6c 22 2c 22 56 65 72 73  69 6f 6e 3a 22 2c 69 6e  |l","Version:",in|
00006020  66 6f 25 2c 38 2c 2d 31  36 30 2c 30 2c 30 2c 30  |fo%,8,-160,0,0,0|
00006030  29 0d 22 56 0a 3d 69 6e  66 6f 25 0d 22 60 27 dd  |)."V.=info%."`'.|
00006040  a4 63 72 65 61 74 65 5f  70 72 69 6e 74 5f 77 69  |.create_print_wi|
00006050  6e 64 6f 77 28 74 69 74  6c 65 24 2c 77 25 2c 68  |ndow(title$,w%,h|
00006060  25 29 0d 22 6a 17 de 20  70 72 69 6e 74 5f 6c 69  |%)."j.. print_li|
00006070  6e 65 24 28 68 25 2d 31  29 0d 22 74 10 70 72 69  |ne$(h%-1)."t.pri|
00006080  6e 74 5f 74 6f 70 25 3d  30 0d 22 7e 13 70 72 69  |nt_top%=0."~.pri|
00006090  6e 74 5f 77 69 64 74 68  25 3d 77 25 0d 22 88 0e  |nt_width%=w%."..|
000060a0  77 25 3d 77 25 2a 31 36  2b 38 0d 22 92 0c 68 25  |w%=w%*16+8."..h%|
000060b0  3d 68 25 2a 33 32 0d 22  9c 46 70 72 69 6e 74 5f  |=h%*32.".Fprint_|
000060c0  77 69 6e 64 6f 77 25 3d  a4 63 72 65 61 74 65 5f  |window%=.create_|
000060d0  77 69 6e 64 6f 77 28 74  69 74 6c 65 24 2c 26 46  |window(title$,&F|
000060e0  46 30 30 30 30 30 32 2c  77 25 2c 68 25 2c 31 30  |F000002,w%,h%,10|
000060f0  30 2c 77 25 2c 32 30 30  2c 68 25 29 0d 22 a6 12  |0,w%,200,h%)."..|
00006100  3d 70 72 69 6e 74 5f 77  69 6e 64 6f 77 25 0d 22  |=print_window%."|
00006110  b0 17 dd f2 63 72 65 61  74 65 5f 73 68 6f 77 5f  |....create_show_|
00006120  76 61 6c 75 65 0d 22 ba  0b ea 20 69 63 6f 6e 25  |value."... icon%|
00006130  0d 22 c4 49 73 68 6f 77  5f 76 61 6c 75 65 25 3d  |.".Ishow_value%=|
00006140  a4 63 72 65 61 74 65 5f  77 69 6e 64 6f 77 28 22  |.create_window("|
00006150  53 68 6f 77 20 56 61 72  69 61 62 6c 65 22 2c 30  |Show Variable",0|
00006160  2c 36 30 38 2c 32 31 32  2c 33 30 30 2c 39 39 39  |,608,212,300,999|
00006170  2c 33 35 30 2c 39 39 39  29 0d 22 ce 3f 69 63 6f  |,350,999).".?ico|
00006180  6e 25 3d 20 20 a4 61 64  64 5f 69 63 6f 6e 28 22  |n%=  .add_icon("|
00006190  72 65 70 6f 72 74 22 2c  c4 33 36 2c 22 20 22 29  |report",.36," ")|
000061a0  2c 73 68 6f 77 5f 76 61  6c 75 65 25 2c 38 2c 2d  |,show_value%,8,-|
000061b0  34 2c 30 2c 30 2c 30 29  0d 22 d8 40 69 63 6f 6e  |4,0,0,0).".@icon|
000061c0  25 3d 20 20 a4 61 64 64  5f 69 63 6f 6e 28 22 72  |%=  .add_icon("r|
000061d0  65 70 6f 72 74 22 2c c4  33 36 2c 22 20 22 29 2c  |eport",.36," "),|
000061e0  73 68 6f 77 5f 76 61 6c  75 65 25 2c 38 2c 2d 35  |show_value%,8,-5|
000061f0  36 2c 30 2c 30 2c 30 29  0d 22 e2 41 69 63 6f 6e  |6,0,0,0).".Aicon|
00006200  25 3d 20 20 a4 61 64 64  5f 69 63 6f 6e 28 22 72  |%=  .add_icon("r|
00006210  65 70 6f 72 74 22 2c c4  33 36 2c 22 20 22 29 2c  |eport",.36," "),|
00006220  73 68 6f 77 5f 76 61 6c  75 65 25 2c 38 2c 2d 31  |show_value%,8,-1|
00006230  30 38 2c 30 2c 30 2c 30  29 0d 22 ec 41 69 63 6f  |08,0,0,0).".Aico|
00006240  6e 25 3d 20 20 a4 61 64  64 5f 69 63 6f 6e 28 22  |n%=  .add_icon("|
00006250  72 65 70 6f 72 74 22 2c  c4 33 36 2c 22 20 22 29  |report",.36," ")|
00006260  2c 73 68 6f 77 5f 76 61  6c 75 65 25 2c 38 2c 2d  |,show_value%,8,-|
00006270  31 36 30 2c 30 2c 30 2c  30 29 0d 22 f6 05 e1 0d  |160,0,0,0)."....|
00006280  23 00 4c dd a4 63 72 65  61 74 65 5f 77 69 6e 64  |#.L..create_wind|
00006290  6f 77 28 74 69 74 6c 65  24 2c 77 66 25 2c 78 5f  |ow(title$,wf%,x_|
000062a0  73 69 7a 65 25 2c 79 5f  73 69 7a 65 25 2c 6c 65  |size%,y_size%,le|
000062b0  66 74 25 2c 77 69 64 74  68 25 2c 62 6f 74 74 6f  |ft%,width%,botto|
000062c0  6d 25 2c 68 65 69 67 68  74 25 29 0d 23 0a 1a ea  |m%,height%).#...|
000062d0  20 74 69 74 6c 65 5f 73  70 61 63 65 25 2c 68 61  | title_space%,ha|
000062e0  6e 64 6c 65 25 0d 23 14  1e de 20 74 69 74 6c 65  |ndle%.#... title|
000062f0  5f 73 70 61 63 65 25 20  28 31 2b a9 74 69 74 6c  |_space% (1+.titl|
00006300  65 24 29 0d 23 1e 15 74  65 6d 70 5f 62 6c 6b 25  |e$).#..temp_blk%|
00006310  21 30 3d 6c 65 66 74 25  0d 23 28 17 74 65 6d 70  |!0=left%.#(.temp|
00006320  5f 62 6c 6b 25 21 34 3d  62 6f 74 74 6f 6d 25 0d  |_blk%!4=bottom%.|
00006330  23 32 1c 74 65 6d 70 5f  62 6c 6b 25 21 38 3d 6c  |#2.temp_blk%!8=l|
00006340  65 66 74 25 2b 77 69 64  74 68 25 0d 23 3c 20 74  |eft%+width%.#< t|
00006350  65 6d 70 5f 62 6c 6b 25  21 31 32 3d 62 6f 74 74  |emp_blk%!12=bott|
00006360  6f 6d 25 2b 68 65 69 67  68 74 25 0d 23 46 13 74  |om%+height%.#F.t|
00006370  65 6d 70 5f 62 6c 6b 25  21 31 36 3d 30 3a 0d 23  |emp_blk%!16=0:.#|
00006380  50 13 74 65 6d 70 5f 62  6c 6b 25 21 32 30 3d 30  |P.temp_blk%!20=0|
00006390  3a 0d 23 5a 14 74 65 6d  70 5f 62 6c 6b 25 21 32  |:.#Z.temp_blk%!2|
000063a0  34 3d 2d 31 3a 0d 23 64  1a e7 20 77 66 25 3d 30  |4=-1:.#d.. wf%=0|
000063b0  20 77 66 25 3d 26 46 46  30 30 30 30 31 32 3a 0d  | wf%=&FF000012:.|
000063c0  23 6e 14 74 65 6d 70 5f  62 6c 6b 25 21 32 38 3d  |#n.temp_blk%!28=|
000063d0  77 66 25 0d 23 78 13 74  65 6d 70 5f 62 6c 6b 25  |wf%.#x.temp_blk%|
000063e0  3f 33 32 3d 37 3a 0d 23  82 13 74 65 6d 70 5f 62  |?32=7:.#..temp_b|
000063f0  6c 6b 25 3f 33 33 3d 32  3a 0d 23 8c 13 74 65 6d  |lk%?33=2:.#..tem|
00006400  70 5f 62 6c 6b 25 3f 33  34 3d 37 3a 0d 23 96 13  |p_blk%?34=7:.#..|
00006410  74 65 6d 70 5f 62 6c 6b  25 3f 33 35 3d 31 3a 0d  |temp_blk%?35=1:.|
00006420  23 a0 13 74 65 6d 70 5f  62 6c 6b 25 3f 33 36 3d  |#..temp_blk%?36=|
00006430  33 3a 0d 23 aa 13 74 65  6d 70 5f 62 6c 6b 25 3f  |3:.#..temp_blk%?|
00006440  33 37 3d 31 3a 0d 23 b4  14 74 65 6d 70 5f 62 6c  |37=1:.#..temp_bl|
00006450  6b 25 3f 33 38 3d 31 32  3a 0d 23 be 13 74 65 6d  |k%?38=12:.#..tem|
00006460  70 5f 62 6c 6b 25 3f 33  39 3d 30 3a 0d 23 c8 13  |p_blk%?39=0:.#..|
00006470  74 65 6d 70 5f 62 6c 6b  25 21 34 30 3d 30 3a 0d  |temp_blk%!40=0:.|
00006480  23 d2 1a 74 65 6d 70 5f  62 6c 6b 25 21 34 34 3d  |#..temp_blk%!44=|
00006490  2d 79 5f 73 69 7a 65 25  3a 0d 23 dc 19 74 65 6d  |-y_size%:.#..tem|
000064a0  70 5f 62 6c 6b 25 21 34  38 3d 78 5f 73 69 7a 65  |p_blk%!48=x_size|
000064b0  25 3a 0d 23 e6 13 74 65  6d 70 5f 62 6c 6b 25 21  |%:.#..temp_blk%!|
000064c0  35 32 3d 30 3a 0d 23 f0  16 74 65 6d 70 5f 62 6c  |52=0:.#..temp_bl|
000064d0  6b 25 21 35 36 3d 26 31  31 39 3a 0d 23 fa 17 74  |k%!56=&119:.#..t|
000064e0  65 6d 70 5f 62 6c 6b 25  21 36 30 3d 26 36 30 30  |emp_blk%!60=&600|
000064f0  30 3a 0d 24 04 13 74 65  6d 70 5f 62 6c 6b 25 21  |0:.$..temp_blk%!|
00006500  36 34 3d 31 3a 0d 24 0e  13 74 65 6d 70 5f 62 6c  |64=1:.$..temp_bl|
00006510  6b 25 3f 36 38 3d 30 3a  0d 24 18 13 74 65 6d 70  |k%?68=0:.$..temp|
00006520  5f 62 6c 6b 25 3f 36 39  3d 30 3a 0d 24 22 13 74  |_blk%?69=0:.$".t|
00006530  65 6d 70 5f 62 6c 6b 25  3f 37 30 3d 30 3a 0d 24  |emp_blk%?70=0:.$|
00006540  2c 13 74 65 6d 70 5f 62  6c 6b 25 3f 37 31 3d 30  |,.temp_blk%?71=0|
00006550  3a 0d 24 36 18 24 74 69  74 6c 65 5f 73 70 61 63  |:.$6.$title_spac|
00006560  65 25 3d 74 69 74 6c 65  24 0d 24 40 1e 74 65 6d  |e%=title$.$@.tem|
00006570  70 5f 62 6c 6b 25 21 37  32 3d 74 69 74 6c 65 5f  |p_blk%!72=title_|
00006580  73 70 61 63 65 25 3a 0d  24 4a 14 74 65 6d 70 5f  |space%:.$J.temp_|
00006590  62 6c 6b 25 21 37 36 3d  2d 31 3a 0d 24 54 1d 74  |blk%!76=-1:.$T.t|
000065a0  65 6d 70 5f 62 6c 6b 25  21 38 30 3d a9 28 74 69  |emp_blk%!80=.(ti|
000065b0  74 6c 65 24 29 2b 31 3a  0d 24 5e 13 74 65 6d 70  |tle$)+1:.$^.temp|
000065c0  5f 62 6c 6b 25 21 38 34  3d 30 3a 0d 24 68 2e c8  |_blk%!84=0:.$h..|
000065d0  99 22 57 69 6d 70 5f 43  72 65 61 74 65 57 69 6e  |."Wimp_CreateWin|
000065e0  64 6f 77 22 2c 2c 74 65  6d 70 5f 62 6c 6b 25 20  |dow",,temp_blk% |
000065f0  b8 20 68 61 6e 64 6c 65  25 0d 24 72 0c 3d 68 61  |. handle%.$r.=ha|
00006600  6e 64 6c 65 25 0d 24 7c  24 dd 20 f2 64 65 6c 65  |ndle%.$|$. .dele|
00006610  74 65 5f 77 69 6e 64 6f  77 28 77 69 6e 64 6f 77  |te_window(window|
00006620  5f 68 61 6e 64 6c 65 25  29 0d 24 86 1d 21 74 65  |_handle%).$..!te|
00006630  6d 70 5f 62 6c 6b 25 3d  77 69 6e 64 6f 77 5f 68  |mp_blk%=window_h|
00006640  61 6e 64 6c 65 25 0d 24  90 25 c8 99 20 22 57 69  |andle%.$.%.. "Wi|
00006650  6d 70 5f 44 65 6c 65 74  65 57 69 6e 64 6f 77 22  |mp_DeleteWindow"|
00006660  2c 2c 74 65 6d 70 5f 62  6c 6b 25 0d 24 9a 05 e1  |,,temp_blk%.$...|
00006670  0d 24 a4 22 dd 20 f2 6f  70 65 6e 5f 77 69 6e 64  |.$.". .open_wind|
00006680  6f 77 28 77 69 6e 64 6f  77 5f 68 61 6e 64 6c 65  |ow(window_handle|
00006690  25 29 0d 24 ae 1d 21 74  65 6d 70 5f 62 6c 6b 25  |%).$..!temp_blk%|
000066a0  3d 77 69 6e 64 6f 77 5f  68 61 6e 64 6c 65 25 0d  |=window_handle%.|
000066b0  24 b8 27 c8 99 20 22 57  69 6d 70 5f 47 65 74 57  |$.'.. "Wimp_GetW|
000066c0  69 6e 64 6f 77 53 74 61  74 65 22 2c 2c 74 65 6d  |indowState",,tem|
000066d0  70 5f 62 6c 6b 25 0d 24  c2 23 c8 99 20 22 57 69  |p_blk%.$.#.. "Wi|
000066e0  6d 70 5f 4f 70 65 6e 57  69 6e 64 6f 77 22 2c 2c  |mp_OpenWindow",,|
000066f0  74 65 6d 70 5f 62 6c 6b  25 0d 24 cc 05 e1 0d 24  |temp_blk%.$....$|
00006700  d6 1d dd f2 70 72 69 6e  74 5f 6c 69 6e 65 28 6c  |....print_line(l|
00006710  69 6e 65 25 2c 74 65 78  74 24 29 0d 24 e0 4c ea  |ine%,text$).$.L.|
00006720  20 6d 61 78 5f 6c 69 6e  65 73 25 2c 6d 69 6e 5f  | max_lines%,min_|
00006730  78 25 2c 6d 69 6e 5f 79  25 2c 6d 61 78 5f 78 25  |x%,min_y%,max_x%|
00006740  2c 6d 61 78 5f 79 25 2c  6c 69 6e 65 5f 74 6f 70  |,max_y%,line_top|
00006750  25 2c 6c 69 6e 65 5f 62  6f 74 25 2c 78 25 2c 79  |%,line_bot%,x%,y|
00006760  25 2c 6d 6f 72 65 25 0d  24 ea 21 6d 61 78 5f 6c  |%,more%.$.!max_l|
00006770  69 6e 65 73 25 3d de 28  70 72 69 6e 74 5f 6c 69  |ines%=.(print_li|
00006780  6e 65 24 28 29 2c 31 29  0d 24 f4 18 e7 20 6c 69  |ne$(),1).$... li|
00006790  6e 65 25 3e 6d 61 78 5f  6c 69 6e 65 73 25 20 8c  |ne%>max_lines% .|
000067a0  0d 24 fe 39 85 20 32 30  34 2c 22 4f 75 74 20 6f  |.$.9. 204,"Out o|
000067b0  66 20 72 61 6e 67 65 20  6c 69 6e 65 20 6e 75 6d  |f range line num|
000067c0  62 65 72 20 69 6e 20 27  50 52 4f 43 70 72 69 6e  |ber in 'PROCprin|
000067d0  74 5f 6c 69 6e 65 27 21  22 0d 25 08 05 e1 0d 25  |t_line'!".%....%|
000067e0  12 05 cd 0d 25 1c 1c 21  74 65 6d 70 5f 62 6c 6b  |....%..!temp_blk|
000067f0  25 3d 70 72 69 6e 74 5f  77 69 6e 64 6f 77 25 0d  |%=print_window%.|
00006800  25 26 26 c8 99 20 22 57  69 6d 70 5f 47 65 74 57  |%&&.. "Wimp_GetW|
00006810  69 6e 64 6f 77 49 6e 66  6f 22 2c 2c 74 65 6d 70  |indowInfo",,temp|
00006820  5f 62 6c 6b 25 0d 25 30  17 6d 69 6e 5f 78 25 3d  |_blk%.%0.min_x%=|
00006830  74 65 6d 70 5f 62 6c 6b  25 21 34 34 0d 25 3a 17  |temp_blk%!44.%:.|
00006840  6d 69 6e 5f 79 25 3d 74  65 6d 70 5f 62 6c 6b 25  |min_y%=temp_blk%|
00006850  21 34 38 0d 25 44 17 6d  61 78 5f 78 25 3d 74 65  |!48.%D.max_x%=te|
00006860  6d 70 5f 62 6c 6b 25 21  35 32 0d 25 4e 17 6d 61  |mp_blk%!52.%N.ma|
00006870  78 5f 79 25 3d 74 65 6d  70 5f 62 6c 6b 25 21 35  |x_y%=temp_blk%!5|
00006880  36 0d 25 58 1d 6c 69 6e  65 5f 74 6f 70 25 3d 6d  |6.%X.line_top%=m|
00006890  61 78 5f 79 25 2d 6c 69  6e 65 25 2a 33 32 0d 25  |ax_y%-line%*32.%|
000068a0  62 1a 6c 69 6e 65 5f 62  6f 74 25 3d 6c 69 6e 65  |b.line_bot%=line|
000068b0  5f 74 6f 70 25 2d 33 32  0d 25 6c 2b 6c 69 6e 65  |_top%-32.%l+line|
000068c0  25 3d 28 6c 69 6e 65 25  2b 70 72 69 6e 74 5f 74  |%=(line%+print_t|
000068d0  6f 70 25 29 83 28 6d 61  78 5f 6c 69 6e 65 73 25  |op%).(max_lines%|
000068e0  2b 31 29 0d 25 76 2b 70  72 69 6e 74 5f 6c 69 6e  |+1).%v+print_lin|
000068f0  65 24 28 6c 69 6e 65 25  29 3d c0 74 65 78 74 24  |e$(line%)=.text$|
00006900  2c 70 72 69 6e 74 5f 77  69 64 74 68 25 29 0d 25  |,print_width%).%|
00006910  80 21 78 25 3d 74 65 6d  70 5f 62 6c 6b 25 21 34  |.!x%=temp_blk%!4|
00006920  2d 74 65 6d 70 5f 62 6c  6b 25 21 32 30 2b 34 0d  |-temp_blk%!20+4.|
00006930  25 8a 2c 79 25 3d 74 65  6d 70 5f 62 6c 6b 25 21  |%.,y%=temp_blk%!|
00006940  31 36 2d 74 65 6d 70 5f  62 6c 6b 25 21 32 34 2b  |16-temp_blk%!24+|
00006950  6c 69 6e 65 5f 74 6f 70  25 2d 34 0d 25 94 1d 74  |line_top%-4.%..t|
00006960  65 6d 70 5f 62 6c 6b 25  21 30 3d 70 72 69 6e 74  |emp_blk%!0=print|
00006970  5f 77 69 6e 64 6f 77 25  0d 25 9e 16 74 65 6d 70  |_window%.%..temp|
00006980  5f 62 6c 6b 25 21 34 3d  6d 69 6e 5f 78 25 0d 25  |_blk%!4=min_x%.%|
00006990  a8 19 74 65 6d 70 5f 62  6c 6b 25 21 38 3d 6c 69  |..temp_blk%!8=li|
000069a0  6e 65 5f 62 6f 74 25 0d  25 b2 17 74 65 6d 70 5f  |ne_bot%.%..temp_|
000069b0  62 6c 6b 25 21 31 32 3d  6d 61 78 5f 78 25 0d 25  |blk%!12=max_x%.%|
000069c0  bc 1a 74 65 6d 70 5f 62  6c 6b 25 21 31 36 3d 6c  |..temp_blk%!16=l|
000069d0  69 6e 65 5f 74 6f 70 25  0d 25 c6 2c c8 99 22 57  |ine_top%.%.,.."W|
000069e0  69 6d 70 5f 55 70 64 61  74 65 57 69 6e 64 6f 77  |imp_UpdateWindow|
000069f0  22 2c 2c 74 65 6d 70 5f  62 6c 6b 25 20 b8 20 6d  |",,temp_blk% . m|
00006a00  6f 72 65 25 0d 25 d0 0c  c8 95 20 6d 6f 72 65 25  |ore%.%.... more%|
00006a10  0d 25 da 09 e6 20 37 3a  db 0d 25 e4 0b ec 20 78  |.%... 7:..%... x|
00006a20  25 2c 79 25 0d 25 ee 19  f1 3b 70 72 69 6e 74 5f  |%,y%.%...;print_|
00006a30  6c 69 6e 65 24 28 6c 69  6e 65 25 29 3b 0d 25 f8  |line$(line%);.%.|
00006a40  2c c8 99 22 57 69 6d 70  5f 47 65 74 52 65 63 74  |,.."Wimp_GetRect|
00006a50  61 6e 67 6c 65 22 2c 2c  74 65 6d 70 5f 62 6c 6b  |angle",,temp_blk|
00006a60  25 20 b8 20 6d 6f 72 65  25 0d 26 02 05 ce 0d 26  |% . more%.&....&|
00006a70  0c 05 e1 0d 26 16 19 dd  f2 70 72 69 6e 74 5f 73  |....&....print_s|
00006a80  63 72 6f 6c 6c 28 74 65  78 74 24 29 0d 26 20 4c  |croll(text$).& L|
00006a90  ea 20 6d 61 78 5f 6c 69  6e 65 73 25 2c 6d 69 6e  |. max_lines%,min|
00006aa0  5f 78 25 2c 6d 69 6e 5f  79 25 2c 6d 61 78 5f 78  |_x%,min_y%,max_x|
00006ab0  25 2c 6d 61 78 5f 79 25  2c 6c 69 6e 65 5f 74 6f  |%,max_y%,line_to|
00006ac0  70 25 2c 6c 69 6e 65 5f  62 6f 74 25 2c 78 25 2c  |p%,line_bot%,x%,|
00006ad0  79 25 2c 6d 6f 72 65 25  0d 26 2a 21 6d 61 78 5f  |y%,more%.&*!max_|
00006ae0  6c 69 6e 65 73 25 3d de  28 70 72 69 6e 74 5f 6c  |lines%=.(print_l|
00006af0  69 6e 65 24 28 29 2c 31  29 0d 26 34 30 70 72 69  |ine$(),1).&40pri|
00006b00  6e 74 5f 6c 69 6e 65 24  28 70 72 69 6e 74 5f 74  |nt_line$(print_t|
00006b10  6f 70 25 29 3d c0 74 65  78 74 24 2c 70 72 69 6e  |op%)=.text$,prin|
00006b20  74 5f 77 69 64 74 68 25  29 0d 26 3e 0c 6d 69 6e  |t_width%).&>.min|
00006b30  5f 78 25 3d 30 0d 26 48  1d 6d 69 6e 5f 79 25 3d  |_x%=0.&H.min_y%=|
00006b40  2d 28 31 2b 6d 61 78 5f  6c 69 6e 65 73 25 29 2a  |-(1+max_lines%)*|
00006b50  33 32 0d 26 52 1c 6d 61  78 5f 78 25 3d 70 72 69  |32.&R.max_x%=pri|
00006b60  6e 74 5f 77 69 64 74 68  25 2a 31 36 2b 38 0d 26  |nt_width%*16+8.&|
00006b70  5c 0c 6d 61 78 5f 79 25  3d 30 0d 26 66 51 c8 99  |\.max_y%=0.&fQ..|
00006b80  22 57 69 6d 70 5f 42 6c  6f 63 6b 43 6f 70 79 22  |"Wimp_BlockCopy"|
00006b90  2c 70 72 69 6e 74 5f 77  69 6e 64 6f 77 25 2c 6d  |,print_window%,m|
00006ba0  69 6e 5f 78 25 2c 6d 69  6e 5f 79 25 2c 6d 61 78  |in_x%,min_y%,max|
00006bb0  5f 78 25 2c 6d 61 78 5f  79 25 2c 6d 69 6e 5f 78  |_x%,max_y%,min_x|
00006bc0  25 2c 6d 69 6e 5f 79 25  2b 33 32 0d 26 70 17 6c  |%,min_y%+32.&p.l|
00006bd0  69 6e 65 5f 74 6f 70 25  3d 6d 69 6e 5f 79 25 2b  |ine_top%=min_y%+|
00006be0  33 32 0d 26 7a 14 6c 69  6e 65 5f 62 6f 74 25 3d  |32.&z.line_bot%=|
00006bf0  6d 69 6e 5f 79 25 0d 26  84 1c 21 74 65 6d 70 5f  |min_y%.&..!temp_|
00006c00  62 6c 6b 25 3d 70 72 69  6e 74 5f 77 69 6e 64 6f  |blk%=print_windo|
00006c10  77 25 0d 26 8e 26 c8 99  20 22 57 69 6d 70 5f 47  |w%.&.&.. "Wimp_G|
00006c20  65 74 57 69 6e 64 6f 77  49 6e 66 6f 22 2c 2c 74  |etWindowInfo",,t|
00006c30  65 6d 70 5f 62 6c 6b 25  0d 26 98 21 78 25 3d 74  |emp_blk%.&.!x%=t|
00006c40  65 6d 70 5f 62 6c 6b 25  21 34 2d 74 65 6d 70 5f  |emp_blk%!4-temp_|
00006c50  62 6c 6b 25 21 32 30 2b  34 0d 26 a2 2c 79 25 3d  |blk%!20+4.&.,y%=|
00006c60  74 65 6d 70 5f 62 6c 6b  25 21 31 36 2d 74 65 6d  |temp_blk%!16-tem|
00006c70  70 5f 62 6c 6b 25 21 32  34 2b 6c 69 6e 65 5f 74  |p_blk%!24+line_t|
00006c80  6f 70 25 2d 34 0d 26 ac  1d 74 65 6d 70 5f 62 6c  |op%-4.&..temp_bl|
00006c90  6b 25 21 30 3d 70 72 69  6e 74 5f 77 69 6e 64 6f  |k%!0=print_windo|
00006ca0  77 25 0d 26 b6 16 74 65  6d 70 5f 62 6c 6b 25 21  |w%.&..temp_blk%!|
00006cb0  34 3d 6d 69 6e 5f 78 25  0d 26 c0 19 74 65 6d 70  |4=min_x%.&..temp|
00006cc0  5f 62 6c 6b 25 21 38 3d  6c 69 6e 65 5f 62 6f 74  |_blk%!8=line_bot|
00006cd0  25 0d 26 ca 17 74 65 6d  70 5f 62 6c 6b 25 21 31  |%.&..temp_blk%!1|
00006ce0  32 3d 6d 61 78 5f 78 25  0d 26 d4 1a 74 65 6d 70  |2=max_x%.&..temp|
00006cf0  5f 62 6c 6b 25 21 31 36  3d 6c 69 6e 65 5f 74 6f  |_blk%!16=line_to|
00006d00  70 25 0d 26 de 2c c8 99  22 57 69 6d 70 5f 55 70  |p%.&.,.."Wimp_Up|
00006d10  64 61 74 65 57 69 6e 64  6f 77 22 2c 2c 74 65 6d  |dateWindow",,tem|
00006d20  70 5f 62 6c 6b 25 20 b8  20 6d 6f 72 65 25 0d 26  |p_blk% . more%.&|
00006d30  e8 0c c8 95 20 6d 6f 72  65 25 0d 26 f2 09 e6 20  |.... more%.&... |
00006d40  37 3a db 0d 26 fc 0b ec  20 78 25 2c 79 25 0d 27  |7:..&... x%,y%.'|
00006d50  06 1e f1 3b 70 72 69 6e  74 5f 6c 69 6e 65 24 28  |...;print_line$(|
00006d60  70 72 69 6e 74 5f 74 6f  70 25 29 3b 0d 27 10 2c  |print_top%);.'.,|
00006d70  c8 99 22 57 69 6d 70 5f  47 65 74 52 65 63 74 61  |.."Wimp_GetRecta|
00006d80  6e 67 6c 65 22 2c 2c 74  65 6d 70 5f 62 6c 6b 25  |ngle",,temp_blk%|
00006d90  20 b8 20 6d 6f 72 65 25  0d 27 1a 05 ce 0d 27 24  | . more%.'....'$|
00006da0  2c 70 72 69 6e 74 5f 74  6f 70 25 3d 28 70 72 69  |,print_top%=(pri|
00006db0  6e 74 5f 74 6f 70 25 2b  31 29 83 28 31 2b 6d 61  |nt_top%+1).(1+ma|
00006dc0  78 5f 6c 69 6e 65 73 25  29 0d 27 2e 05 e1 0d 27  |x_lines%).'....'|
00006dd0  38 1f dd f2 72 65 64 72  61 77 5f 70 72 69 6e 74  |8...redraw_print|
00006de0  5f 77 69 6e 64 6f 77 28  62 6c 6b 25 29 0d 27 42  |_window(blk%).'B|
00006df0  28 ea 20 6d 61 78 5f 6c  69 6e 65 73 25 2c 74 6f  |(. max_lines%,to|
00006e00  70 6c 69 6e 65 25 2c 62  6f 74 6c 69 6e 65 25 2c  |pline%,botline%,|
00006e10  78 25 2c 79 25 0d 27 4c  21 6d 61 78 5f 6c 69 6e  |x%,y%.'L!max_lin|
00006e20  65 73 25 3d de 28 70 72  69 6e 74 5f 6c 69 6e 65  |es%=.(print_line|
00006e30  24 28 29 2c 31 29 0d 27  56 2c 74 6f 70 6c 69 6e  |$(),1).'V,toplin|
00006e40  65 25 3d 2d 28 62 6c 6b  25 21 32 34 2b 34 2d 62  |e%=-(blk%!24+4-b|
00006e50  6c 6b 25 21 31 36 2b 62  6c 6b 25 21 34 30 29 81  |lk%!16+blk%!40).|
00006e60  33 32 0d 27 60 2c 62 6f  74 6c 69 6e 65 25 3d 2d  |32.'`,botline%=-|
00006e70  28 62 6c 6b 25 21 32 34  2b 34 2d 62 6c 6b 25 21  |(blk%!24+4-blk%!|
00006e80  31 36 2b 62 6c 6b 25 21  33 32 29 81 33 32 0d 27  |16+blk%!32).32.'|
00006e90  6a 2d e7 20 62 6f 74 6c  69 6e 65 25 3e 6d 61 78  |j-. botline%>max|
00006ea0  5f 6c 69 6e 65 73 25 20  62 6f 74 6c 69 6e 65 25  |_lines% botline%|
00006eb0  3d 6d 61 78 5f 6c 69 6e  65 73 25 0d 27 74 1c e7  |=max_lines%.'t..|
00006ec0  20 74 6f 70 6c 69 6e 65  25 3c 3d 6d 61 78 5f 6c  | topline%<=max_l|
00006ed0  69 6e 65 73 25 20 8c 0d  27 7e 17 78 25 3d 62 6c  |ines% ..'~.x%=bl|
00006ee0  6b 25 21 34 2d 62 6c 6b  25 21 32 30 2b 34 0d 27  |k%!4-blk%!20+4.'|
00006ef0  88 2d 79 25 3d 62 6c 6b  25 21 34 30 2d 28 62 6c  |.-y%=blk%!40-(bl|
00006f00  6b 25 21 32 34 2b 34 2d  62 6c 6b 25 21 31 36 2b  |k%!24+4-blk%!16+|
00006f10  62 6c 6b 25 21 34 30 29  83 33 32 0d 27 92 1f e3  |blk%!40).32.'...|
00006f20  20 6c 69 6e 65 25 3d 74  6f 70 6c 69 6e 65 25 20  | line%=topline% |
00006f30  b8 20 62 6f 74 6c 69 6e  65 25 0d 27 9c 11 ec 78  |. botline%.'...x|
00006f40  25 2c 79 25 3a 79 25 2d  3d 33 32 0d 27 a6 34 f1  |%,y%:y%-=32.'.4.|
00006f50  3b 70 72 69 6e 74 5f 6c  69 6e 65 24 28 28 6c 69  |;print_line$((li|
00006f60  6e 65 25 2b 70 72 69 6e  74 5f 74 6f 70 25 29 83  |ne%+print_top%).|
00006f70  28 6d 61 78 5f 6c 69 6e  65 73 25 2b 31 29 29 0d  |(max_lines%+1)).|
00006f80  27 b0 05 ed 0d 27 ba 05  cd 0d 27 c4 05 e1 0d 27  |'....'....'....'|
00006f90  ce 26 dd a4 77 69 6e 64  6f 77 5f 72 65 63 74 61  |.&..window_recta|
00006fa0  6e 67 6c 65 28 77 69 6e  64 6f 77 5f 68 61 6e 64  |ngle(window_hand|
00006fb0  6c 65 25 29 0d 27 d8 0b  ea 20 6d 6f 72 65 25 0d  |le%).'... more%.|
00006fc0  27 e2 47 74 65 6d 70 5f  62 6c 6b 25 21 30 3d 77  |'.Gtemp_blk%!0=w|
00006fd0  69 6e 64 6f 77 5f 68 61  6e 64 6c 65 25 3a c8 99  |indow_handle%:..|
00006fe0  22 57 69 6d 70 5f 47 65  74 52 65 63 74 61 6e 67  |"Wimp_GetRectang|
00006ff0  6c 65 22 2c 2c 74 65 6d  70 5f 62 6c 6b 25 20 b8  |le",,temp_blk% .|
00007000  20 6d 6f 72 65 25 0d 27  ec 0a 3d 6d 6f 72 65 25  | more%.'..=more%|
00007010  0d 27 f6 23 dd a4 77 69  6e 64 6f 77 5f 75 70 64  |.'.#..window_upd|
00007020  61 74 65 28 77 69 6e 64  6f 77 5f 68 61 6e 64 6c  |ate(window_handl|
00007030  65 25 29 0d 28 00 0b ea  20 6d 6f 72 65 25 0d 28  |e%).(... more%.(|
00007040  0a 1e 74 65 6d 70 5f 62  6c 6b 25 21 30 3d 77 69  |..temp_blk%!0=wi|
00007050  6e 64 6f 77 5f 68 61 6e  64 6c 65 25 0d 28 14 1a  |ndow_handle%.(..|
00007060  74 65 6d 70 5f 62 6c 6b  25 21 34 3d 26 38 30 30  |temp_blk%!4=&800|
00007070  30 30 30 30 30 3a 0d 28  1e 1a 74 65 6d 70 5f 62  |00000:.(..temp_b|
00007080  6c 6b 25 21 38 3d 26 38  30 30 30 30 30 30 30 3a  |lk%!8=&80000000:|
00007090  0d 28 28 1b 74 65 6d 70  5f 62 6c 6b 25 21 31 32  |.((.temp_blk%!12|
000070a0  3d 26 36 46 46 46 46 46  46 46 3a 0d 28 32 1b 74  |=&6FFFFFFF:.(2.t|
000070b0  65 6d 70 5f 62 6c 6b 25  21 31 36 3d 26 36 46 46  |emp_blk%!16=&6FF|
000070c0  46 46 46 46 46 3a 0d 28  3c 2c c8 99 22 57 69 6d  |FFFFF:.(<,.."Wim|
000070d0  70 5f 55 70 64 61 74 65  57 69 6e 64 6f 77 22 2c  |p_UpdateWindow",|
000070e0  2c 74 65 6d 70 5f 62 6c  6b 25 20 b8 20 6d 6f 72  |,temp_blk% . mor|
000070f0  65 25 0d 28 46 0a 3d 6d  6f 72 65 25 0d 28 50 25  |e%.(F.=more%.(P%|
00007100  dd a4 77 69 6e 64 6f 77  5f 78 5f 6f 72 69 67 69  |..window_x_origi|
00007110  6e 28 77 69 6e 64 6f 77  5f 68 61 6e 64 6c 65 25  |n(window_handle%|
00007120  29 0d 28 5a 1e 74 65 6d  70 5f 62 6c 6b 25 21 30  |).(Z.temp_blk%!0|
00007130  3d 77 69 6e 64 6f 77 5f  68 61 6e 64 6c 65 25 0d  |=window_handle%.|
00007140  28 64 26 c8 99 22 57 69  6d 70 5f 47 65 74 57 69  |(d&.."Wimp_GetWi|
00007150  6e 64 6f 77 53 74 61 74  65 22 2c 2c 74 65 6d 70  |ndowState",,temp|
00007160  5f 62 6c 6b 25 0d 28 6e  1d 3d 74 65 6d 70 5f 62  |_blk%.(n.=temp_b|
00007170  6c 6b 25 21 34 2d 74 65  6d 70 5f 62 6c 6b 25 21  |lk%!4-temp_blk%!|
00007180  32 30 0d 28 78 25 dd a4  77 69 6e 64 6f 77 5f 79  |20.(x%..window_y|
00007190  5f 6f 72 69 67 69 6e 28  77 69 6e 64 6f 77 5f 68  |_origin(window_h|
000071a0  61 6e 64 6c 65 25 29 0d  28 82 1e 74 65 6d 70 5f  |andle%).(..temp_|
000071b0  62 6c 6b 25 21 30 3d 77  69 6e 64 6f 77 5f 68 61  |blk%!0=window_ha|
000071c0  6e 64 6c 65 25 0d 28 8c  26 c8 99 22 57 69 6d 70  |ndle%.(.&.."Wimp|
000071d0  5f 47 65 74 57 69 6e 64  6f 77 53 74 61 74 65 22  |_GetWindowState"|
000071e0  2c 2c 74 65 6d 70 5f 62  6c 6b 25 0d 28 96 1e 3d  |,,temp_blk%.(..=|
000071f0  74 65 6d 70 5f 62 6c 6b  25 21 31 36 2d 74 65 6d  |temp_blk%!16-tem|
00007200  70 5f 62 6c 6b 25 21 32  34 0d ff                 |p_blk%!24..|
0000720b