Home » Archimedes archive » Acorn User » AU 1993-06.adf » !Render_Render » !Compile/WimpLib

!Compile/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 1993-06.adf » !Render_Render
Filename: !Compile/WimpLib
Read OK:
File size: 2938 bytes
Load address: 0000
Exec address: 0000
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
   10REM >WimpLib - Wimp Library Functions
   20REM by Mark Moxon
   30:
   40:
   50DEF FNload_sprites(file$)
   60REM ---------------------------------------------------------------------
   70REM file$   - name of sprite file
   80REM ---------------------------------------------------------------------
   90REM Creates a sprite block into which the sprite file is read. The
  100REM function returns the location of the sprite block created.
  110REM ---------------------------------------------------------------------
  120LOCAL file%,size%,sprite%
  130file%=OPENIN file$
  140size%=EXT#file%+16
  150CLOSE#file%
  160DIM sprite% size%
  170!sprite%=size%
  180sprite%!8=16
  190SYS "OS_SpriteOp",&109,sprite%
  200SYS "OS_SpriteOp",&10A,sprite%,file$
  210=sprite%
  220:
  230:
  240DEF FNwimperror(block%,errno%,err$,task_name$,ok%,cancel%)
  250REM ---------------------------------------------------------------------
  260REM block%     - block for Wimp call
  270REM errno%     - error number
  280REM err$       - error message
  290REM task_name$ - name of task from which error originates
  300REM ok%        - true means error box has an OK icon
  310REM cancel%    - true means error box has a Cancel icon
  320REM ---------------------------------------------------------------------
  330REM Displays an error box for the described error. The function returns:
  340REM   1 if OK selected
  350REM   2 if Cancel selected
  360REM ---------------------------------------------------------------------
  370LOCAL flag%,response%
  380!block%=errno%
  390$(block%+4)=err$+CHR$(0)
  400flag%=ok%+(cancel%<<1)
  410SYS "Wimp_ReportError",block%,flag%,task_name$ TO ,response%
  420=response%
  430:
  440:
  450DEF FNicon_bar(block%,name$)
  460REM ---------------------------------------------------------------------
  470REM block% - block for Wimp call
  480REM name$  - name of sprite in the Wimp sprite area
  490REM ---------------------------------------------------------------------
  500REM Puts an unchangeable icon on the icon bar, returning the icon handle.
  510REM ---------------------------------------------------------------------
  520=FNcreate_icon(block%,-1,0,0,68,68,&3002,0,0,0,name$)
  530:
  540:
  550DEF FNicon_bar_changeable(block%,spname%,sprite%)
  560REM ---------------------------------------------------------------------
  570REM block%  - block for Wimp call
  580REM spname% - points to sprite name (which is in sprite area at sprite%)
  590REM sprite% - points to sprite area
  600REM ---------------------------------------------------------------------
  610REM Puts a changeable icon on the icon bar, returning the icon handle.
  620REM ---------------------------------------------------------------------
  630=FNcreate_icon(block%,-1,0,0,68,68,&3102,spname%,sprite%,LEN($spname%)+1,"")
  640:
  650:
  660DEF FNcreate_icon(block%,whandle%,x%,y%,width%,height%,flags%,icon1%,icon2%,icon3%,name$)
  670REM ---------------------------------------------------------------------
  680REM block%   - block for Wimp call
  690REM whandle% - window handle to create icon in
  700REM x%       - x-coordinate of bottom left-hand corner of icon
  710REM y%       - y-coordinate of bottom left-hand corner of icon
  720REM width%   - width of icon
  730REM height%  - height of icon
  740REM flags%   - icon flags
  750REM icon1%   - 1st word of icon data
  760REM icon2%   - 2nd word of icon data
  770REM icon3%   - 3rd word of icon data
  780REM name$    - name of icon sprite
  790REM ---------------------------------------------------------------------
  800REM Creates an icon, returning the icon handle. The icon flags determine
  810REM the meaning of the icon data words and icon sprite name - see p.1180.
  820REM ---------------------------------------------------------------------
  830LOCAL handle%
  840!block%  =whandle%         : REM window handle
  850block%!4 =x%               : REM x-coordinate of bottom left-hand corner
  860block%!8 =y%               : REM y-coordinate of bottom left-hand corner
  870block%!12=x%+width%        : REM x-coordinate of top right-hand corner
  880block%!16=y%+height%       : REM y-coordinate of top right-hand corner
  890block%!20=flags%           : REM icon flags
  900IF name$="" THEN
  910block%!24=icon1%           : REM 1st byte of icon data
  920block%!28=icon2%           : REM 2nd byte of icon data
  930block%!32=icon3%           : REM 3rd byte of icon data
  940ELSE
  950$(block%+24)=name$         : REM name of icon sprite
  960ENDIF
  970SYS "Wimp_CreateIcon",,block% TO handle%
  980=handle%
  990:
 1000:
 1010DEF PROCchange_icon(block%,whandle%,ihandle%,new$,sprite%)
 1020REM ---------------------------------------------------------------------
 1030REM block%   - block for Wimp call
 1040REM whandle% - handle of window containing icon
 1050REM ihandle% - handle of icon
 1060REM new$     - name of sprite to change icon to
 1070REM sprite%  - sprite block containing sprite new$
 1080REM ---------------------------------------------------------------------
 1090REM This procedure changes the sprite icon ihandle% to the sprite new$
 1100REM in sprite block sprite%, and redisplays it.
 1130REM ---------------------------------------------------------------------
 1140!block%=whandle%
 1142block%!4=ihandle%
 1144SYS "Wimp_GetIconState",,block%
 1146$(block%!28)=new$
 1150!block%=whandle%
 1160block%!4=ihandle%
 1170block%!8=0
 1180block%!12=0
 1190SYS "Wimp_SetIconState",,block%
 1250ENDPROC
 1260:
 1270:
 1280DEF PROCcreate_menu(menu%,RETURN width%,RETURN end%,title$)
 1290REM ---------------------------------------------------------------------
 1300REM menu%  - pointer to block to put menu structure in
 1310REM width% - returns current width of menu
 1320REM end%   - returns end of initislised menu data
 1330REM title$ - title of menu
 1340REM ---------------------------------------------------------------------
 1350REM Initialises a menu block.
 1360REM ---------------------------------------------------------------------
 1370width%=LEN(title$)
 1380$menu%=title$
 1390menu%?12=7                 : REM Title foreground & frame colour
 1400menu%?13=2                 : REM Title background colour
 1410menu%?14=7                 : REM Work area foreground colour
 1420menu%?15=0                 : REM Work area background colour
 1430menu%!16=(width%+1)*16     : REM Width of menu items
 1440menu%!20=44                : REM Height of menu items
 1450menu%!24=0                 : REM Vertical gap between menu items
 1460end%=menu%+28
 1470ENDPROC
 1480:
 1490:
 1500DEF PROCmenu_item(menu%,RETURN width%,RETURN end%,text$,tick%,dot%,write%,mess%,last%,link%)
 1510REM ---------------------------------------------------------------------
 1520REM menu%  - pointer to menu block
 1530REM width% - current menu width (altered to reflect new width)
 1540REM end%   - pointer to end of menu structure (altered to new end)
 1550REM text$  - text of menu item to be added
 1560REM tick%  - if set item is tickable
 1570REM dot%   - if set item has a dotted line after it
 1580REM write% - if set item is a writeable text entry
 1590REM mess%  - if set generate message when moving to submenu
 1600REM last%  - if set this is the last entry in the menu
 1610REM link%  - pointer to submenu/dialogue box, or -1 for no submenu
 1620REM ---------------------------------------------------------------------
 1630REM Adds a text item to a menu block initialised by PROCcreate_menu.
 1640REM ---------------------------------------------------------------------
 1650!end% =(tick%+(dot%<<1)+(write%<<2)+(mess%<<3)+(last%<<7))AND255
 1660end%!4=link%
 1670end%!8=&07003021  : REM text,filled,button type 3,foreground colour 7,
 1680$(end%+12)=text$  : REM background colour 0. Text is text$.
 1690end%+=24
 1700IF LEN(text$)>width% THEN width%=LEN(text$)
 1710menu%!16=(width%+1)*16
 1720ENDPROC
 1730:
 1740:
 1750DEF PROCdisplay_bar_menu(menu%,length%,x%)
 1760REM ---------------------------------------------------------------------
 1770REM menu%   - pointer to menu block
 1780REM length% - length of menu
 1790REM x%      - x-coordinate to display menu at
 1800REM ---------------------------------------------------------------------
 1810REM Displays a menu, given its length, on the icon bar when menu is
 1820REM clicked at x-coordinate x%.
 1830REM ---------------------------------------------------------------------
 1840SYS "Wimp_CreateMenu",,menu%,x%-64,96+(length%*44)
 1850ENDPROC
 1860:
 1870:
 1880DEF PROCdisplay_menu(menu%,x%,y%)
 1890REM ---------------------------------------------------------------------
 1900REM menu% - pointer to menu block
 1910REM x%    - x-coordinate to display menu at
 1920REM y%    - y-coordinate to display menu at
 1930REM ---------------------------------------------------------------------
 1940REM Displays a menu when pointer is at x%,y%.
 1950REM ---------------------------------------------------------------------
 1960SYS "Wimp_CreateMenu",,menu%,x%-64,y%
 1970ENDPROC
 1980:
 1990:
 2000DEF FNleaf(file$)
 2010REM ---------------------------------------------------------------------
 2020REM file$ - filename
 2030REM ---------------------------------------------------------------------
 2040REM Returns the leafname from the string file$.
 2050REM ---------------------------------------------------------------------
 2060LOCAL pos%,temp%
 2070temp%=0
 2080REPEAT
 2090pos%=temp%+1
 2100temp%=INSTR(file$,".",pos%)
 2110UNTIL temp%=0
 2120=MID$(file$,pos%)
 2130:
 2140:
 2150DEF FNbranch(file$)
 2160REM ---------------------------------------------------------------------
 2170REM file$ - filename
 2180REM ---------------------------------------------------------------------
 2190REM Returns the branchname from the string file$.
 2200REM ---------------------------------------------------------------------
 2210LOCAL pos%,br$,temp%
 2220IF INSTR(file$,".")=0 THEN
 2230 br$=""
 2240ELSE
 2250 temp%=0
 2260 REPEAT
 2270 pos%=temp%
 2280 temp%=INSTR(file$,".",pos%+1)
 2290 UNTIL temp%=0
 2300 br$=LEFT$(file$,pos%-1)
 2310ENDIF
 2320=br$
 2330:
 2340:
 2350DEF FNfirst(menu$)
 2360REM ---------------------------------------------------------------------
 2370REM menu$ - menu selection string
 2380REM ---------------------------------------------------------------------
 2390REM Returns the first choice from the menu selection string.
 2400REM ---------------------------------------------------------------------
 2410LOCAL ch$
 2420IF INSTR(menu$,".")=0 THEN
 2430 ch$=menu$
 2440ELSE
 2450 ch$=LEFT$(menu$,INSTR(menu$,".")-1)
 2460ENDIF
 2470=ch$
 2480:
 2490:
 2500DEF FNrest(menu$)
 2510REM ---------------------------------------------------------------------
 2520REM menu$ - menu selection string
 2530REM ---------------------------------------------------------------------
 2540REM Returns the rest of the menu selection string.
 2550REM ---------------------------------------------------------------------
 2560LOCAL ch$
 2570IF INSTR(menu$,".")=0 THEN
 2580 ch$=""
 2590ELSE
 2600 ch$=RIGHT$(menu$,LEN(menu$)-INSTR(menu$,"."))
 2610ENDIF
 2620=ch$
 2630:
 2640:
 2650DEF FNzero_string(point%)
 2660REM ---------------------------------------------------------------------
 2670REM point% - Pointer to zero-terminated string.
 2680REM ---------------------------------------------------------------------
 2690REM Returns the string in string$.
 2700REM ---------------------------------------------------------------------
 2710LOCAL string$
 2720string$=""
 2730WHILE ?point%
 2740 string$+=CHR$?point%
 2750 point%+=1
 2760ENDWHILE
 2770=string$

'� >WimpLib - Wimp Library Functions
� by Mark Moxon
:
(:
2� �load_sprites(file$)
<K� ---------------------------------------------------------------------
F#� file$   - name of sprite file
PK� ---------------------------------------------------------------------
ZD� Creates a sprite block into which the sprite file is read. The
d@� function returns the location of the sprite block created.
nK� ---------------------------------------------------------------------
x� file%,size%,sprite%
�file%=� file$
�size%=�#file%+16
��#file%
�� sprite% size%
�!sprite%=size%
�sprite%!8=16
�!ș "OS_SpriteOp",&109,sprite%
�'ș "OS_SpriteOp",&10A,sprite%,file$
�=sprite%
�:
�:
�;� �wimperror(block%,errno%,err$,task_name$,ok%,cancel%)
�K� ---------------------------------------------------------------------
&� block%     - block for Wimp call
� errno%     - error number
 � err$       - error message
";� task_name$ - name of task from which error originates
,6� ok%        - true means error box has an OK icon
69� cancel%    - true means error box has a Cancel icon
@K� ---------------------------------------------------------------------
JJ� Displays an error box for the described error. The function returns:
T�   1 if OK selected
^�   2 if Cancel selected
hK� ---------------------------------------------------------------------
r� flag%,response%
|!block%=errno%
�$(block%+4)=err$+�(0)
�flag%=ok%+(cancel%<<1)
�>ș "Wimp_ReportError",block%,flag%,task_name$ � ,response%
�=response%
�:
�:
�� �icon_bar(block%,name$)
�K� ---------------------------------------------------------------------
�"� block% - block for Wimp call
�5� name$  - name of sprite in the Wimp sprite area
�K� ---------------------------------------------------------------------
�K� Puts an unchangeable icon on the icon bar, returning the icon handle.
�K� ---------------------------------------------------------------------
8=�create_icon(block%,-1,0,0,68,68,&3002,0,0,0,name$)
:
:
&2� �icon_bar_changeable(block%,spname%,sprite%)
0K� ---------------------------------------------------------------------
:#� block%  - block for Wimp call
DJ� spname% - points to sprite name (which is in sprite area at sprite%)
N%� sprite% - points to sprite area
XK� ---------------------------------------------------------------------
bH� Puts a changeable icon on the icon bar, returning the icon handle.
lK� ---------------------------------------------------------------------
vM=�create_icon(block%,-1,0,0,68,68,&3102,spname%,sprite%,�($spname%)+1,"")
�:
�:
�Z� �create_icon(block%,whandle%,x%,y%,width%,height%,flags%,icon1%,icon2%,icon3%,name$)
�K� ---------------------------------------------------------------------
�$� block%   - block for Wimp call
�0� whandle% - window handle to create icon in
�@� x%       - x-coordinate of bottom left-hand corner of icon
�@� y%       - y-coordinate of bottom left-hand corner of icon
�� width%   - width of icon
�� height%  - height of icon
�� flags%   - icon flags
�&� icon1%   - 1st word of icon data
�&� icon2%   - 2nd word of icon data
&� icon3%   - 3rd word of icon data
$� name$    - name of icon sprite
K� ---------------------------------------------------------------------
 J� Creates an icon, returning the icon handle. The icon flags determine
*K� the meaning of the icon data words and icon sprite name - see p.1180.
4K� ---------------------------------------------------------------------
>
� handle%
H0!block%  =whandle%         : � window handle
RJblock%!4 =x%               : � x-coordinate of bottom left-hand corner
\Jblock%!8 =y%               : � y-coordinate of bottom left-hand corner
fHblock%!12=x%+width%        : � x-coordinate of top right-hand corner
pHblock%!16=y%+height%       : � y-coordinate of top right-hand corner
z-block%!20=flags%           : � icon flags
�� name$="" �
�8block%!24=icon1%           : � 1st byte of icon data
�8block%!28=icon2%           : � 2nd byte of icon data
�8block%!32=icon3%           : � 3rd byte of icon data
��
�6$(block%+24)=name$         : � name of icon sprite
��
�*ș "Wimp_CreateIcon",,block% � handle%
�=handle%
�:
�:
�9� �change_icon(block%,whandle%,ihandle%,new$,sprite%)
�K� ---------------------------------------------------------------------
$� block%   - block for Wimp call
1� whandle% - handle of window containing icon
� ihandle% - handle of icon
$1� new$     - name of sprite to change icon to
.4� sprite%  - sprite block containing sprite new$
8K� ---------------------------------------------------------------------
BH� This procedure changes the sprite icon ihandle% to the sprite new$
L1� in sprite block sprite%, and redisplays it.
jK� ---------------------------------------------------------------------
t!block%=whandle%
vblock%!4=ihandle%
x"ș "Wimp_GetIconState",,block%
z$(block%!28)=new$
~!block%=whandle%
�block%!4=ihandle%
�block%!8=0
�block%!12=0
�"ș "Wimp_SetIconState",,block%
��
�:
�:
0� �create_menu(menu%,� width%,� end%,title$)

K� ---------------------------------------------------------------------
8� menu%  - pointer to block to put menu structure in
,� width% - returns current width of menu
(3� end%   - returns end of initislised menu data
2� title$ - title of menu
<K� ---------------------------------------------------------------------
F� Initialises a menu block.
PK� ---------------------------------------------------------------------
Zwidth%=�(title$)
d$menu%=title$
nBmenu%?12=7                 : � Title foreground & frame colour
x:menu%?13=2                 : � Title background colour
�>menu%?14=7                 : � Work area foreground colour
�>menu%?15=0                 : � Work area background colour
�6menu%!16=(width%+1)*16     : � Width of menu items
�7menu%!20=44                : � Height of menu items
�Bmenu%!24=0                 : � Vertical gap between menu items
�end%=menu%+28
��
�:
�:
�Q� �menu_item(menu%,� width%,� end%,text$,tick%,dot%,write%,mess%,last%,link%)
�K� ---------------------------------------------------------------------
�$� menu%  - pointer to menu block
�@� width% - current menu width (altered to reflect new width)
D� end%   - pointer to end of menu structure (altered to new end)
,� text$  - text of menu item to be added
&� tick%  - if set item is tickable
"5� dot%   - if set item has a dotted line after it
,4� write% - if set item is a writeable text entry
6=� mess%  - if set generate message when moving to submenu
@8� last%  - if set this is the last entry in the menu
JD� link%  - pointer to submenu/dialogue box, or -1 for no submenu
TK� ---------------------------------------------------------------------
^F� Adds a text item to a menu block initialised by PROCcreate_menu.
hK� ---------------------------------------------------------------------
rB!end% =(tick%+(dot%<<1)+(write%<<2)+(mess%<<3)+(last%<<7))�255
|end%!4=link%
�Hend%!8=&07003021  : � text,filled,button type 3,foreground colour 7,
�=$(end%+12)=text$  : � background colour 0. Text is text$.
�end%+=24
�'� �(text$)>width% � width%=�(text$)
�menu%!16=(width%+1)*16
��
�:
�:
�)� �display_bar_menu(menu%,length%,x%)
�K� ---------------------------------------------------------------------
�%� menu%   - pointer to menu block
�� length% - length of menu
�/� x%      - x-coordinate to display menu at
K� ---------------------------------------------------------------------
E� Displays a menu, given its length, on the icon bar when menu is
!� clicked at x-coordinate x%.
&K� ---------------------------------------------------------------------
05ș "Wimp_CreateMenu",,menu%,x%-64,96+(length%*44)
:�
D:
N:
X � �display_menu(menu%,x%,y%)
bK� ---------------------------------------------------------------------
l#� menu% - pointer to menu block
v-� x%    - x-coordinate to display menu at
�-� y%    - y-coordinate to display menu at
�K� ---------------------------------------------------------------------
�/� Displays a menu when pointer is at x%,y%.
�K� ---------------------------------------------------------------------
�(ș "Wimp_CreateMenu",,menu%,x%-64,y%
��
�:
�:
�� �leaf(file$)
�K� ---------------------------------------------------------------------
�� file$ - filename
�K� ---------------------------------------------------------------------
�1� Returns the leafname from the string file$.
K� ---------------------------------------------------------------------
� pos%,temp%
temp%=0
 �
*pos%=temp%+1
4temp%=�file$,".",pos%)
>
� temp%=0
H=�file$,pos%)
R:
\:
f� �branch(file$)
pK� ---------------------------------------------------------------------
z� file$ - filename
�K� ---------------------------------------------------------------------
�3� Returns the branchname from the string file$.
�K� ---------------------------------------------------------------------
�� pos%,br$,temp%
�� �file$,".")=0 �
� br$=""
��
� temp%=0
� �
� pos%=temp%
� temp%=�file$,".",pos%+1)
� � temp%=0
� br$=�file$,pos%-1)
	�
	=br$
	:
	$:
	.� �first(menu$)
	8K� ---------------------------------------------------------------------
	B#� menu$ - menu selection string
	LK� ---------------------------------------------------------------------
	V>� Returns the first choice from the menu selection string.
	`K� ---------------------------------------------------------------------
	j	� ch$
	t� �menu$,".")=0 �
	~ ch$=menu$
	��
	� ch$=�menu$,�menu$,".")-1)
	��
	�=ch$
	�:
	�:
	�� �rest(menu$)
	�K� ---------------------------------------------------------------------
	�#� menu$ - menu selection string
	�K� ---------------------------------------------------------------------
	�4� Returns the rest of the menu selection string.
	�K� ---------------------------------------------------------------------
	� ch$

� �menu$,".")=0 �
 ch$=""
�
(% ch$=�menu$,�(menu$)-�menu$,"."))
2�
<=ch$
F:
P:
Z� �zero_string(point%)
dK� ---------------------------------------------------------------------
n1� point% - Pointer to zero-terminated string.
xK� ---------------------------------------------------------------------
�$� Returns the string in string$.
�K� ---------------------------------------------------------------------
�
� string$
�string$=""
�ȕ ?point%
� string$+=�?point%
� point%+=1
��
�=string$
�
00000000  0d 00 0a 27 f4 20 3e 57  69 6d 70 4c 69 62 20 2d  |...'. >WimpLib -|
00000010  20 57 69 6d 70 20 4c 69  62 72 61 72 79 20 46 75  | Wimp Library Fu|
00000020  6e 63 74 69 6f 6e 73 0d  00 14 13 f4 20 62 79 20  |nctions..... by |
00000030  4d 61 72 6b 20 4d 6f 78  6f 6e 0d 00 1e 05 3a 0d  |Mark Moxon....:.|
00000040  00 28 05 3a 0d 00 32 1a  dd 20 a4 6c 6f 61 64 5f  |.(.:..2.. .load_|
00000050  73 70 72 69 74 65 73 28  66 69 6c 65 24 29 0d 00  |sprites(file$)..|
00000060  3c 4b f4 20 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |<K. ------------|
00000070  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000000a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 00 46 23 f4 20 66  |---------..F#. f|
000000b0  69 6c 65 24 20 20 20 2d  20 6e 61 6d 65 20 6f 66  |ile$   - name of|
000000c0  20 73 70 72 69 74 65 20  66 69 6c 65 0d 00 50 4b  | sprite file..PK|
000000d0  f4 20 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |. --------------|
000000e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000110  2d 2d 2d 2d 2d 2d 2d 0d  00 5a 44 f4 20 43 72 65  |-------..ZD. Cre|
00000120  61 74 65 73 20 61 20 73  70 72 69 74 65 20 62 6c  |ates a sprite bl|
00000130  6f 63 6b 20 69 6e 74 6f  20 77 68 69 63 68 20 74  |ock into which t|
00000140  68 65 20 73 70 72 69 74  65 20 66 69 6c 65 20 69  |he sprite file i|
00000150  73 20 72 65 61 64 2e 20  54 68 65 0d 00 64 40 f4  |s read. The..d@.|
00000160  20 66 75 6e 63 74 69 6f  6e 20 72 65 74 75 72 6e  | function return|
00000170  73 20 74 68 65 20 6c 6f  63 61 74 69 6f 6e 20 6f  |s the location o|
00000180  66 20 74 68 65 20 73 70  72 69 74 65 20 62 6c 6f  |f the sprite blo|
00000190  63 6b 20 63 72 65 61 74  65 64 2e 0d 00 6e 4b f4  |ck created...nK.|
000001a0  20 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  | ---------------|
000001b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000001e0  2d 2d 2d 2d 2d 2d 0d 00  78 19 ea 20 66 69 6c 65  |------..x.. file|
000001f0  25 2c 73 69 7a 65 25 2c  73 70 72 69 74 65 25 0d  |%,size%,sprite%.|
00000200  00 82 11 66 69 6c 65 25  3d 8e 20 66 69 6c 65 24  |...file%=. file$|
00000210  0d 00 8c 14 73 69 7a 65  25 3d a2 23 66 69 6c 65  |....size%=.#file|
00000220  25 2b 31 36 0d 00 96 0b  d9 23 66 69 6c 65 25 0d  |%+16.....#file%.|
00000230  00 a0 13 de 20 73 70 72  69 74 65 25 20 73 69 7a  |.... sprite% siz|
00000240  65 25 0d 00 aa 12 21 73  70 72 69 74 65 25 3d 73  |e%....!sprite%=s|
00000250  69 7a 65 25 0d 00 b4 10  73 70 72 69 74 65 25 21  |ize%....sprite%!|
00000260  38 3d 31 36 0d 00 be 21  c8 99 20 22 4f 53 5f 53  |8=16...!.. "OS_S|
00000270  70 72 69 74 65 4f 70 22  2c 26 31 30 39 2c 73 70  |priteOp",&109,sp|
00000280  72 69 74 65 25 0d 00 c8  27 c8 99 20 22 4f 53 5f  |rite%...'.. "OS_|
00000290  53 70 72 69 74 65 4f 70  22 2c 26 31 30 41 2c 73  |SpriteOp",&10A,s|
000002a0  70 72 69 74 65 25 2c 66  69 6c 65 24 0d 00 d2 0c  |prite%,file$....|
000002b0  3d 73 70 72 69 74 65 25  0d 00 dc 05 3a 0d 00 e6  |=sprite%....:...|
000002c0  05 3a 0d 00 f0 3b dd 20  a4 77 69 6d 70 65 72 72  |.:...;. .wimperr|
000002d0  6f 72 28 62 6c 6f 63 6b  25 2c 65 72 72 6e 6f 25  |or(block%,errno%|
000002e0  2c 65 72 72 24 2c 74 61  73 6b 5f 6e 61 6d 65 24  |,err$,task_name$|
000002f0  2c 6f 6b 25 2c 63 61 6e  63 65 6c 25 29 0d 00 fa  |,ok%,cancel%)...|
00000300  4b f4 20 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |K. -------------|
00000310  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000340  2d 2d 2d 2d 2d 2d 2d 2d  0d 01 04 26 f4 20 62 6c  |--------...&. bl|
00000350  6f 63 6b 25 20 20 20 20  20 2d 20 62 6c 6f 63 6b  |ock%     - block|
00000360  20 66 6f 72 20 57 69 6d  70 20 63 61 6c 6c 0d 01  | for Wimp call..|
00000370  0e 1f f4 20 65 72 72 6e  6f 25 20 20 20 20 20 2d  |... errno%     -|
00000380  20 65 72 72 6f 72 20 6e  75 6d 62 65 72 0d 01 18  | error number...|
00000390  20 f4 20 65 72 72 24 20  20 20 20 20 20 20 2d 20  | . err$       - |
000003a0  65 72 72 6f 72 20 6d 65  73 73 61 67 65 0d 01 22  |error message.."|
000003b0  3b f4 20 74 61 73 6b 5f  6e 61 6d 65 24 20 2d 20  |;. task_name$ - |
000003c0  6e 61 6d 65 20 6f 66 20  74 61 73 6b 20 66 72 6f  |name of task fro|
000003d0  6d 20 77 68 69 63 68 20  65 72 72 6f 72 20 6f 72  |m which error or|
000003e0  69 67 69 6e 61 74 65 73  0d 01 2c 36 f4 20 6f 6b  |iginates..,6. ok|
000003f0  25 20 20 20 20 20 20 20  20 2d 20 74 72 75 65 20  |%        - true |
00000400  6d 65 61 6e 73 20 65 72  72 6f 72 20 62 6f 78 20  |means error box |
00000410  68 61 73 20 61 6e 20 4f  4b 20 69 63 6f 6e 0d 01  |has an OK icon..|
00000420  36 39 f4 20 63 61 6e 63  65 6c 25 20 20 20 20 2d  |69. cancel%    -|
00000430  20 74 72 75 65 20 6d 65  61 6e 73 20 65 72 72 6f  | true means erro|
00000440  72 20 62 6f 78 20 68 61  73 20 61 20 43 61 6e 63  |r box has a Canc|
00000450  65 6c 20 69 63 6f 6e 0d  01 40 4b f4 20 2d 2d 2d  |el icon..@K. ---|
00000460  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000004a0  2d 2d 0d 01 4a 4a f4 20  44 69 73 70 6c 61 79 73  |--..JJ. Displays|
000004b0  20 61 6e 20 65 72 72 6f  72 20 62 6f 78 20 66 6f  | an error box fo|
000004c0  72 20 74 68 65 20 64 65  73 63 72 69 62 65 64 20  |r the described |
000004d0  65 72 72 6f 72 2e 20 54  68 65 20 66 75 6e 63 74  |error. The funct|
000004e0  69 6f 6e 20 72 65 74 75  72 6e 73 3a 0d 01 54 18  |ion returns:..T.|
000004f0  f4 20 20 20 31 20 69 66  20 4f 4b 20 73 65 6c 65  |.   1 if OK sele|
00000500  63 74 65 64 0d 01 5e 1c  f4 20 20 20 32 20 69 66  |cted..^..   2 if|
00000510  20 43 61 6e 63 65 6c 20  73 65 6c 65 63 74 65 64  | Cancel selected|
00000520  0d 01 68 4b f4 20 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |..hK. ----------|
00000530  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000560  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 01 72 15 ea  |-----------..r..|
00000570  20 66 6c 61 67 25 2c 72  65 73 70 6f 6e 73 65 25  | flag%,response%|
00000580  0d 01 7c 12 21 62 6c 6f  63 6b 25 3d 65 72 72 6e  |..|.!block%=errn|
00000590  6f 25 0d 01 86 19 24 28  62 6c 6f 63 6b 25 2b 34  |o%....$(block%+4|
000005a0  29 3d 65 72 72 24 2b bd  28 30 29 0d 01 90 1a 66  |)=err$+.(0)....f|
000005b0  6c 61 67 25 3d 6f 6b 25  2b 28 63 61 6e 63 65 6c  |lag%=ok%+(cancel|
000005c0  25 3c 3c 31 29 0d 01 9a  3e c8 99 20 22 57 69 6d  |%<<1)...>.. "Wim|
000005d0  70 5f 52 65 70 6f 72 74  45 72 72 6f 72 22 2c 62  |p_ReportError",b|
000005e0  6c 6f 63 6b 25 2c 66 6c  61 67 25 2c 74 61 73 6b  |lock%,flag%,task|
000005f0  5f 6e 61 6d 65 24 20 b8  20 2c 72 65 73 70 6f 6e  |_name$ . ,respon|
00000600  73 65 25 0d 01 a4 0e 3d  72 65 73 70 6f 6e 73 65  |se%....=response|
00000610  25 0d 01 ae 05 3a 0d 01  b8 05 3a 0d 01 c2 1d dd  |%....:....:.....|
00000620  20 a4 69 63 6f 6e 5f 62  61 72 28 62 6c 6f 63 6b  | .icon_bar(block|
00000630  25 2c 6e 61 6d 65 24 29  0d 01 cc 4b f4 20 2d 2d  |%,name$)...K. --|
00000640  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000680  2d 2d 2d 0d 01 d6 22 f4  20 62 6c 6f 63 6b 25 20  |---...". block% |
00000690  2d 20 62 6c 6f 63 6b 20  66 6f 72 20 57 69 6d 70  |- block for Wimp|
000006a0  20 63 61 6c 6c 0d 01 e0  35 f4 20 6e 61 6d 65 24  | call...5. name$|
000006b0  20 20 2d 20 6e 61 6d 65  20 6f 66 20 73 70 72 69  |  - name of spri|
000006c0  74 65 20 69 6e 20 74 68  65 20 57 69 6d 70 20 73  |te in the Wimp s|
000006d0  70 72 69 74 65 20 61 72  65 61 0d 01 ea 4b f4 20  |prite area...K. |
000006e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000720  2d 2d 2d 2d 2d 0d 01 f4  4b f4 20 50 75 74 73 20  |-----...K. Puts |
00000730  61 6e 20 75 6e 63 68 61  6e 67 65 61 62 6c 65 20  |an unchangeable |
00000740  69 63 6f 6e 20 6f 6e 20  74 68 65 20 69 63 6f 6e  |icon on the icon|
00000750  20 62 61 72 2c 20 72 65  74 75 72 6e 69 6e 67 20  | bar, returning |
00000760  74 68 65 20 69 63 6f 6e  20 68 61 6e 64 6c 65 2e  |the icon handle.|
00000770  0d 01 fe 4b f4 20 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...K. ----------|
00000780  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000007b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 02 08 38 3d  |-----------...8=|
000007c0  a4 63 72 65 61 74 65 5f  69 63 6f 6e 28 62 6c 6f  |.create_icon(blo|
000007d0  63 6b 25 2c 2d 31 2c 30  2c 30 2c 36 38 2c 36 38  |ck%,-1,0,0,68,68|
000007e0  2c 26 33 30 30 32 2c 30  2c 30 2c 30 2c 6e 61 6d  |,&3002,0,0,0,nam|
000007f0  65 24 29 0d 02 12 05 3a  0d 02 1c 05 3a 0d 02 26  |e$)....:....:..&|
00000800  32 dd 20 a4 69 63 6f 6e  5f 62 61 72 5f 63 68 61  |2. .icon_bar_cha|
00000810  6e 67 65 61 62 6c 65 28  62 6c 6f 63 6b 25 2c 73  |ngeable(block%,s|
00000820  70 6e 61 6d 65 25 2c 73  70 72 69 74 65 25 29 0d  |pname%,sprite%).|
00000830  02 30 4b f4 20 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.0K. -----------|
00000840  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000870  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0d 02 3a 23 f4 20  |----------..:#. |
00000880  62 6c 6f 63 6b 25 20 20  2d 20 62 6c 6f 63 6b 20  |block%  - block |
00000890  66 6f 72 20 57 69 6d 70  20 63 61 6c 6c 0d 02 44  |for Wimp call..D|
000008a0  4a f4 20 73 70 6e 61 6d  65 25 20 2d 20 70 6f 69  |J. spname% - poi|
000008b0  6e 74 73 20 74 6f 20 73  70 72 69 74 65 20 6e 61  |nts to sprite na|
000008c0  6d 65 20 28 77 68 69 63  68 20 69 73 20 69 6e 20  |me (which is in |
000008d0  73 70 72 69 74 65 20 61  72 65 61 20 61 74 20 73  |sprite area at s|
000008e0  70 72 69 74 65 25 29 0d  02 4e 25 f4 20 73 70 72  |prite%)..N%. spr|
000008f0  69 74 65 25 20 2d 20 70  6f 69 6e 74 73 20 74 6f  |ite% - points to|
00000900  20 73 70 72 69 74 65 20  61 72 65 61 0d 02 58 4b  | sprite area..XK|
00000910  f4 20 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |. --------------|
00000920  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000950  2d 2d 2d 2d 2d 2d 2d 0d  02 62 48 f4 20 50 75 74  |-------..bH. Put|
00000960  73 20 61 20 63 68 61 6e  67 65 61 62 6c 65 20 69  |s a changeable i|
00000970  63 6f 6e 20 6f 6e 20 74  68 65 20 69 63 6f 6e 20  |con on the icon |
00000980  62 61 72 2c 20 72 65 74  75 72 6e 69 6e 67 20 74  |bar, returning t|
00000990  68 65 20 69 63 6f 6e 20  68 61 6e 64 6c 65 2e 0d  |he icon handle..|
000009a0  02 6c 4b f4 20 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.lK. -----------|
000009b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000009e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0d 02 76 4d 3d a4  |----------..vM=.|
000009f0  63 72 65 61 74 65 5f 69  63 6f 6e 28 62 6c 6f 63  |create_icon(bloc|
00000a00  6b 25 2c 2d 31 2c 30 2c  30 2c 36 38 2c 36 38 2c  |k%,-1,0,0,68,68,|
00000a10  26 33 31 30 32 2c 73 70  6e 61 6d 65 25 2c 73 70  |&3102,spname%,sp|
00000a20  72 69 74 65 25 2c a9 28  24 73 70 6e 61 6d 65 25  |rite%,.($spname%|
00000a30  29 2b 31 2c 22 22 29 0d  02 80 05 3a 0d 02 8a 05  |)+1,"")....:....|
00000a40  3a 0d 02 94 5a dd 20 a4  63 72 65 61 74 65 5f 69  |:...Z. .create_i|
00000a50  63 6f 6e 28 62 6c 6f 63  6b 25 2c 77 68 61 6e 64  |con(block%,whand|
00000a60  6c 65 25 2c 78 25 2c 79  25 2c 77 69 64 74 68 25  |le%,x%,y%,width%|
00000a70  2c 68 65 69 67 68 74 25  2c 66 6c 61 67 73 25 2c  |,height%,flags%,|
00000a80  69 63 6f 6e 31 25 2c 69  63 6f 6e 32 25 2c 69 63  |icon1%,icon2%,ic|
00000a90  6f 6e 33 25 2c 6e 61 6d  65 24 29 0d 02 9e 4b f4  |on3%,name$)...K.|
00000aa0  20 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  | ---------------|
00000ab0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000ae0  2d 2d 2d 2d 2d 2d 0d 02  a8 24 f4 20 62 6c 6f 63  |------...$. bloc|
00000af0  6b 25 20 20 20 2d 20 62  6c 6f 63 6b 20 66 6f 72  |k%   - block for|
00000b00  20 57 69 6d 70 20 63 61  6c 6c 0d 02 b2 30 f4 20  | Wimp call...0. |
00000b10  77 68 61 6e 64 6c 65 25  20 2d 20 77 69 6e 64 6f  |whandle% - windo|
00000b20  77 20 68 61 6e 64 6c 65  20 74 6f 20 63 72 65 61  |w handle to crea|
00000b30  74 65 20 69 63 6f 6e 20  69 6e 0d 02 bc 40 f4 20  |te icon in...@. |
00000b40  78 25 20 20 20 20 20 20  20 2d 20 78 2d 63 6f 6f  |x%       - x-coo|
00000b50  72 64 69 6e 61 74 65 20  6f 66 20 62 6f 74 74 6f  |rdinate of botto|
00000b60  6d 20 6c 65 66 74 2d 68  61 6e 64 20 63 6f 72 6e  |m left-hand corn|
00000b70  65 72 20 6f 66 20 69 63  6f 6e 0d 02 c6 40 f4 20  |er of icon...@. |
00000b80  79 25 20 20 20 20 20 20  20 2d 20 79 2d 63 6f 6f  |y%       - y-coo|
00000b90  72 64 69 6e 61 74 65 20  6f 66 20 62 6f 74 74 6f  |rdinate of botto|
00000ba0  6d 20 6c 65 66 74 2d 68  61 6e 64 20 63 6f 72 6e  |m left-hand corn|
00000bb0  65 72 20 6f 66 20 69 63  6f 6e 0d 02 d0 1e f4 20  |er of icon..... |
00000bc0  77 69 64 74 68 25 20 20  20 2d 20 77 69 64 74 68  |width%   - width|
00000bd0  20 6f 66 20 69 63 6f 6e  0d 02 da 1f f4 20 68 65  | of icon..... he|
00000be0  69 67 68 74 25 20 20 2d  20 68 65 69 67 68 74 20  |ight%  - height |
00000bf0  6f 66 20 69 63 6f 6e 0d  02 e4 1b f4 20 66 6c 61  |of icon..... fla|
00000c00  67 73 25 20 20 20 2d 20  69 63 6f 6e 20 66 6c 61  |gs%   - icon fla|
00000c10  67 73 0d 02 ee 26 f4 20  69 63 6f 6e 31 25 20 20  |gs...&. icon1%  |
00000c20  20 2d 20 31 73 74 20 77  6f 72 64 20 6f 66 20 69  | - 1st word of i|
00000c30  63 6f 6e 20 64 61 74 61  0d 02 f8 26 f4 20 69 63  |con data...&. ic|
00000c40  6f 6e 32 25 20 20 20 2d  20 32 6e 64 20 77 6f 72  |on2%   - 2nd wor|
00000c50  64 20 6f 66 20 69 63 6f  6e 20 64 61 74 61 0d 03  |d of icon data..|
00000c60  02 26 f4 20 69 63 6f 6e  33 25 20 20 20 2d 20 33  |.&. icon3%   - 3|
00000c70  72 64 20 77 6f 72 64 20  6f 66 20 69 63 6f 6e 20  |rd word of icon |
00000c80  64 61 74 61 0d 03 0c 24  f4 20 6e 61 6d 65 24 20  |data...$. name$ |
00000c90  20 20 20 2d 20 6e 61 6d  65 20 6f 66 20 69 63 6f  |   - name of ico|
00000ca0  6e 20 73 70 72 69 74 65  0d 03 16 4b f4 20 2d 2d  |n sprite...K. --|
00000cb0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000cf0  2d 2d 2d 0d 03 20 4a f4  20 43 72 65 61 74 65 73  |---.. J. Creates|
00000d00  20 61 6e 20 69 63 6f 6e  2c 20 72 65 74 75 72 6e  | an icon, return|
00000d10  69 6e 67 20 74 68 65 20  69 63 6f 6e 20 68 61 6e  |ing the icon han|
00000d20  64 6c 65 2e 20 54 68 65  20 69 63 6f 6e 20 66 6c  |dle. The icon fl|
00000d30  61 67 73 20 64 65 74 65  72 6d 69 6e 65 0d 03 2a  |ags determine..*|
00000d40  4b f4 20 74 68 65 20 6d  65 61 6e 69 6e 67 20 6f  |K. the meaning o|
00000d50  66 20 74 68 65 20 69 63  6f 6e 20 64 61 74 61 20  |f the icon data |
00000d60  77 6f 72 64 73 20 61 6e  64 20 69 63 6f 6e 20 73  |words and icon s|
00000d70  70 72 69 74 65 20 6e 61  6d 65 20 2d 20 73 65 65  |prite name - see|
00000d80  20 70 2e 31 31 38 30 2e  0d 03 34 4b f4 20 2d 2d  | p.1180...4K. --|
00000d90  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000dd0  2d 2d 2d 0d 03 3e 0d ea  20 68 61 6e 64 6c 65 25  |---..>.. handle%|
00000de0  0d 03 48 30 21 62 6c 6f  63 6b 25 20 20 3d 77 68  |..H0!block%  =wh|
00000df0  61 6e 64 6c 65 25 20 20  20 20 20 20 20 20 20 3a  |andle%         :|
00000e00  20 f4 20 77 69 6e 64 6f  77 20 68 61 6e 64 6c 65  | . window handle|
00000e10  0d 03 52 4a 62 6c 6f 63  6b 25 21 34 20 3d 78 25  |..RJblock%!4 =x%|
00000e20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3a  |               :|
00000e30  20 f4 20 78 2d 63 6f 6f  72 64 69 6e 61 74 65 20  | . x-coordinate |
00000e40  6f 66 20 62 6f 74 74 6f  6d 20 6c 65 66 74 2d 68  |of bottom left-h|
00000e50  61 6e 64 20 63 6f 72 6e  65 72 0d 03 5c 4a 62 6c  |and corner..\Jbl|
00000e60  6f 63 6b 25 21 38 20 3d  79 25 20 20 20 20 20 20  |ock%!8 =y%      |
00000e70  20 20 20 20 20 20 20 20  20 3a 20 f4 20 79 2d 63  |         : . y-c|
00000e80  6f 6f 72 64 69 6e 61 74  65 20 6f 66 20 62 6f 74  |oordinate of bot|
00000e90  74 6f 6d 20 6c 65 66 74  2d 68 61 6e 64 20 63 6f  |tom left-hand co|
00000ea0  72 6e 65 72 0d 03 66 48  62 6c 6f 63 6b 25 21 31  |rner..fHblock%!1|
00000eb0  32 3d 78 25 2b 77 69 64  74 68 25 20 20 20 20 20  |2=x%+width%     |
00000ec0  20 20 20 3a 20 f4 20 78  2d 63 6f 6f 72 64 69 6e  |   : . x-coordin|
00000ed0  61 74 65 20 6f 66 20 74  6f 70 20 72 69 67 68 74  |ate of top right|
00000ee0  2d 68 61 6e 64 20 63 6f  72 6e 65 72 0d 03 70 48  |-hand corner..pH|
00000ef0  62 6c 6f 63 6b 25 21 31  36 3d 79 25 2b 68 65 69  |block%!16=y%+hei|
00000f00  67 68 74 25 20 20 20 20  20 20 20 3a 20 f4 20 79  |ght%       : . y|
00000f10  2d 63 6f 6f 72 64 69 6e  61 74 65 20 6f 66 20 74  |-coordinate of t|
00000f20  6f 70 20 72 69 67 68 74  2d 68 61 6e 64 20 63 6f  |op right-hand co|
00000f30  72 6e 65 72 0d 03 7a 2d  62 6c 6f 63 6b 25 21 32  |rner..z-block%!2|
00000f40  30 3d 66 6c 61 67 73 25  20 20 20 20 20 20 20 20  |0=flags%        |
00000f50  20 20 20 3a 20 f4 20 69  63 6f 6e 20 66 6c 61 67  |   : . icon flag|
00000f60  73 0d 03 84 10 e7 20 6e  61 6d 65 24 3d 22 22 20  |s..... name$="" |
00000f70  8c 0d 03 8e 38 62 6c 6f  63 6b 25 21 32 34 3d 69  |....8block%!24=i|
00000f80  63 6f 6e 31 25 20 20 20  20 20 20 20 20 20 20 20  |con1%           |
00000f90  3a 20 f4 20 31 73 74 20  62 79 74 65 20 6f 66 20  |: . 1st byte of |
00000fa0  69 63 6f 6e 20 64 61 74  61 0d 03 98 38 62 6c 6f  |icon data...8blo|
00000fb0  63 6b 25 21 32 38 3d 69  63 6f 6e 32 25 20 20 20  |ck%!28=icon2%   |
00000fc0  20 20 20 20 20 20 20 20  3a 20 f4 20 32 6e 64 20  |        : . 2nd |
00000fd0  62 79 74 65 20 6f 66 20  69 63 6f 6e 20 64 61 74  |byte of icon dat|
00000fe0  61 0d 03 a2 38 62 6c 6f  63 6b 25 21 33 32 3d 69  |a...8block%!32=i|
00000ff0  63 6f 6e 33 25 20 20 20  20 20 20 20 20 20 20 20  |con3%           |
00001000  3a 20 f4 20 33 72 64 20  62 79 74 65 20 6f 66 20  |: . 3rd byte of |
00001010  69 63 6f 6e 20 64 61 74  61 0d 03 ac 05 cc 0d 03  |icon data.......|
00001020  b6 36 24 28 62 6c 6f 63  6b 25 2b 32 34 29 3d 6e  |.6$(block%+24)=n|
00001030  61 6d 65 24 20 20 20 20  20 20 20 20 20 3a 20 f4  |ame$         : .|
00001040  20 6e 61 6d 65 20 6f 66  20 69 63 6f 6e 20 73 70  | name of icon sp|
00001050  72 69 74 65 0d 03 c0 05  cd 0d 03 ca 2a c8 99 20  |rite........*.. |
00001060  22 57 69 6d 70 5f 43 72  65 61 74 65 49 63 6f 6e  |"Wimp_CreateIcon|
00001070  22 2c 2c 62 6c 6f 63 6b  25 20 b8 20 68 61 6e 64  |",,block% . hand|
00001080  6c 65 25 0d 03 d4 0c 3d  68 61 6e 64 6c 65 25 0d  |le%....=handle%.|
00001090  03 de 05 3a 0d 03 e8 05  3a 0d 03 f2 39 dd 20 f2  |...:....:...9. .|
000010a0  63 68 61 6e 67 65 5f 69  63 6f 6e 28 62 6c 6f 63  |change_icon(bloc|
000010b0  6b 25 2c 77 68 61 6e 64  6c 65 25 2c 69 68 61 6e  |k%,whandle%,ihan|
000010c0  64 6c 65 25 2c 6e 65 77  24 2c 73 70 72 69 74 65  |dle%,new$,sprite|
000010d0  25 29 0d 03 fc 4b f4 20  2d 2d 2d 2d 2d 2d 2d 2d  |%)...K. --------|
000010e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001110  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0d 04 06  |-------------...|
00001120  24 f4 20 62 6c 6f 63 6b  25 20 20 20 2d 20 62 6c  |$. block%   - bl|
00001130  6f 63 6b 20 66 6f 72 20  57 69 6d 70 20 63 61 6c  |ock for Wimp cal|
00001140  6c 0d 04 10 31 f4 20 77  68 61 6e 64 6c 65 25 20  |l...1. whandle% |
00001150  2d 20 68 61 6e 64 6c 65  20 6f 66 20 77 69 6e 64  |- handle of wind|
00001160  6f 77 20 63 6f 6e 74 61  69 6e 69 6e 67 20 69 63  |ow containing ic|
00001170  6f 6e 0d 04 1a 1f f4 20  69 68 61 6e 64 6c 65 25  |on..... ihandle%|
00001180  20 2d 20 68 61 6e 64 6c  65 20 6f 66 20 69 63 6f  | - handle of ico|
00001190  6e 0d 04 24 31 f4 20 6e  65 77 24 20 20 20 20 20  |n..$1. new$     |
000011a0  2d 20 6e 61 6d 65 20 6f  66 20 73 70 72 69 74 65  |- name of sprite|
000011b0  20 74 6f 20 63 68 61 6e  67 65 20 69 63 6f 6e 20  | to change icon |
000011c0  74 6f 0d 04 2e 34 f4 20  73 70 72 69 74 65 25 20  |to...4. sprite% |
000011d0  20 2d 20 73 70 72 69 74  65 20 62 6c 6f 63 6b 20  | - sprite block |
000011e0  63 6f 6e 74 61 69 6e 69  6e 67 20 73 70 72 69 74  |containing sprit|
000011f0  65 20 6e 65 77 24 0d 04  38 4b f4 20 2d 2d 2d 2d  |e new$..8K. ----|
00001200  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001240  2d 0d 04 42 48 f4 20 54  68 69 73 20 70 72 6f 63  |-..BH. This proc|
00001250  65 64 75 72 65 20 63 68  61 6e 67 65 73 20 74 68  |edure changes th|
00001260  65 20 73 70 72 69 74 65  20 69 63 6f 6e 20 69 68  |e sprite icon ih|
00001270  61 6e 64 6c 65 25 20 74  6f 20 74 68 65 20 73 70  |andle% to the sp|
00001280  72 69 74 65 20 6e 65 77  24 0d 04 4c 31 f4 20 69  |rite new$..L1. i|
00001290  6e 20 73 70 72 69 74 65  20 62 6c 6f 63 6b 20 73  |n sprite block s|
000012a0  70 72 69 74 65 25 2c 20  61 6e 64 20 72 65 64 69  |prite%, and redi|
000012b0  73 70 6c 61 79 73 20 69  74 2e 0d 04 6a 4b f4 20  |splays it...jK. |
000012c0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001300  2d 2d 2d 2d 2d 0d 04 74  14 21 62 6c 6f 63 6b 25  |-----..t.!block%|
00001310  3d 77 68 61 6e 64 6c 65  25 0d 04 76 15 62 6c 6f  |=whandle%..v.blo|
00001320  63 6b 25 21 34 3d 69 68  61 6e 64 6c 65 25 0d 04  |ck%!4=ihandle%..|
00001330  78 22 c8 99 20 22 57 69  6d 70 5f 47 65 74 49 63  |x".. "Wimp_GetIc|
00001340  6f 6e 53 74 61 74 65 22  2c 2c 62 6c 6f 63 6b 25  |onState",,block%|
00001350  0d 04 7a 15 24 28 62 6c  6f 63 6b 25 21 32 38 29  |..z.$(block%!28)|
00001360  3d 6e 65 77 24 0d 04 7e  14 21 62 6c 6f 63 6b 25  |=new$..~.!block%|
00001370  3d 77 68 61 6e 64 6c 65  25 0d 04 88 15 62 6c 6f  |=whandle%....blo|
00001380  63 6b 25 21 34 3d 69 68  61 6e 64 6c 65 25 0d 04  |ck%!4=ihandle%..|
00001390  92 0e 62 6c 6f 63 6b 25  21 38 3d 30 0d 04 9c 0f  |..block%!8=0....|
000013a0  62 6c 6f 63 6b 25 21 31  32 3d 30 0d 04 a6 22 c8  |block%!12=0...".|
000013b0  99 20 22 57 69 6d 70 5f  53 65 74 49 63 6f 6e 53  |. "Wimp_SetIconS|
000013c0  74 61 74 65 22 2c 2c 62  6c 6f 63 6b 25 0d 04 e2  |tate",,block%...|
000013d0  05 e1 0d 04 ec 05 3a 0d  04 f6 05 3a 0d 05 00 30  |......:....:...0|
000013e0  dd 20 f2 63 72 65 61 74  65 5f 6d 65 6e 75 28 6d  |. .create_menu(m|
000013f0  65 6e 75 25 2c f8 20 77  69 64 74 68 25 2c f8 20  |enu%,. width%,. |
00001400  65 6e 64 25 2c 74 69 74  6c 65 24 29 0d 05 0a 4b  |end%,title$)...K|
00001410  f4 20 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |. --------------|
00001420  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001450  2d 2d 2d 2d 2d 2d 2d 0d  05 14 38 f4 20 6d 65 6e  |-------...8. men|
00001460  75 25 20 20 2d 20 70 6f  69 6e 74 65 72 20 74 6f  |u%  - pointer to|
00001470  20 62 6c 6f 63 6b 20 74  6f 20 70 75 74 20 6d 65  | block to put me|
00001480  6e 75 20 73 74 72 75 63  74 75 72 65 20 69 6e 0d  |nu structure in.|
00001490  05 1e 2c f4 20 77 69 64  74 68 25 20 2d 20 72 65  |..,. width% - re|
000014a0  74 75 72 6e 73 20 63 75  72 72 65 6e 74 20 77 69  |turns current wi|
000014b0  64 74 68 20 6f 66 20 6d  65 6e 75 0d 05 28 33 f4  |dth of menu..(3.|
000014c0  20 65 6e 64 25 20 20 20  2d 20 72 65 74 75 72 6e  | end%   - return|
000014d0  73 20 65 6e 64 20 6f 66  20 69 6e 69 74 69 73 6c  |s end of initisl|
000014e0  69 73 65 64 20 6d 65 6e  75 20 64 61 74 61 0d 05  |ised menu data..|
000014f0  32 1c f4 20 74 69 74 6c  65 24 20 2d 20 74 69 74  |2.. title$ - tit|
00001500  6c 65 20 6f 66 20 6d 65  6e 75 0d 05 3c 4b f4 20  |le of menu..<K. |
00001510  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001550  2d 2d 2d 2d 2d 0d 05 46  1f f4 20 49 6e 69 74 69  |-----..F.. Initi|
00001560  61 6c 69 73 65 73 20 61  20 6d 65 6e 75 20 62 6c  |alises a menu bl|
00001570  6f 63 6b 2e 0d 05 50 4b  f4 20 2d 2d 2d 2d 2d 2d  |ock...PK. ------|
00001580  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000015b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
000015c0  05 5a 14 77 69 64 74 68  25 3d a9 28 74 69 74 6c  |.Z.width%=.(titl|
000015d0  65 24 29 0d 05 64 11 24  6d 65 6e 75 25 3d 74 69  |e$)..d.$menu%=ti|
000015e0  74 6c 65 24 0d 05 6e 42  6d 65 6e 75 25 3f 31 32  |tle$..nBmenu%?12|
000015f0  3d 37 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |=7              |
00001600  20 20 20 3a 20 f4 20 54  69 74 6c 65 20 66 6f 72  |   : . Title for|
00001610  65 67 72 6f 75 6e 64 20  26 20 66 72 61 6d 65 20  |eground & frame |
00001620  63 6f 6c 6f 75 72 0d 05  78 3a 6d 65 6e 75 25 3f  |colour..x:menu%?|
00001630  31 33 3d 32 20 20 20 20  20 20 20 20 20 20 20 20  |13=2            |
00001640  20 20 20 20 20 3a 20 f4  20 54 69 74 6c 65 20 62  |     : . Title b|
00001650  61 63 6b 67 72 6f 75 6e  64 20 63 6f 6c 6f 75 72  |ackground colour|
00001660  0d 05 82 3e 6d 65 6e 75  25 3f 31 34 3d 37 20 20  |...>menu%?14=7  |
00001670  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 3a  |               :|
00001680  20 f4 20 57 6f 72 6b 20  61 72 65 61 20 66 6f 72  | . Work area for|
00001690  65 67 72 6f 75 6e 64 20  63 6f 6c 6f 75 72 0d 05  |eground colour..|
000016a0  8c 3e 6d 65 6e 75 25 3f  31 35 3d 30 20 20 20 20  |.>menu%?15=0    |
000016b0  20 20 20 20 20 20 20 20  20 20 20 20 20 3a 20 f4  |             : .|
000016c0  20 57 6f 72 6b 20 61 72  65 61 20 62 61 63 6b 67  | Work area backg|
000016d0  72 6f 75 6e 64 20 63 6f  6c 6f 75 72 0d 05 96 36  |round colour...6|
000016e0  6d 65 6e 75 25 21 31 36  3d 28 77 69 64 74 68 25  |menu%!16=(width%|
000016f0  2b 31 29 2a 31 36 20 20  20 20 20 3a 20 f4 20 57  |+1)*16     : . W|
00001700  69 64 74 68 20 6f 66 20  6d 65 6e 75 20 69 74 65  |idth of menu ite|
00001710  6d 73 0d 05 a0 37 6d 65  6e 75 25 21 32 30 3d 34  |ms...7menu%!20=4|
00001720  34 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4               |
00001730  20 3a 20 f4 20 48 65 69  67 68 74 20 6f 66 20 6d  | : . Height of m|
00001740  65 6e 75 20 69 74 65 6d  73 0d 05 aa 42 6d 65 6e  |enu items...Bmen|
00001750  75 25 21 32 34 3d 30 20  20 20 20 20 20 20 20 20  |u%!24=0         |
00001760  20 20 20 20 20 20 20 20  3a 20 f4 20 56 65 72 74  |        : . Vert|
00001770  69 63 61 6c 20 67 61 70  20 62 65 74 77 65 65 6e  |ical gap between|
00001780  20 6d 65 6e 75 20 69 74  65 6d 73 0d 05 b4 11 65  | menu items....e|
00001790  6e 64 25 3d 6d 65 6e 75  25 2b 32 38 0d 05 be 05  |nd%=menu%+28....|
000017a0  e1 0d 05 c8 05 3a 0d 05  d2 05 3a 0d 05 dc 51 dd  |.....:....:...Q.|
000017b0  20 f2 6d 65 6e 75 5f 69  74 65 6d 28 6d 65 6e 75  | .menu_item(menu|
000017c0  25 2c f8 20 77 69 64 74  68 25 2c f8 20 65 6e 64  |%,. width%,. end|
000017d0  25 2c 74 65 78 74 24 2c  74 69 63 6b 25 2c 64 6f  |%,text$,tick%,do|
000017e0  74 25 2c 77 72 69 74 65  25 2c 6d 65 73 73 25 2c  |t%,write%,mess%,|
000017f0  6c 61 73 74 25 2c 6c 69  6e 6b 25 29 0d 05 e6 4b  |last%,link%)...K|
00001800  f4 20 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |. --------------|
00001810  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001840  2d 2d 2d 2d 2d 2d 2d 0d  05 f0 24 f4 20 6d 65 6e  |-------...$. men|
00001850  75 25 20 20 2d 20 70 6f  69 6e 74 65 72 20 74 6f  |u%  - pointer to|
00001860  20 6d 65 6e 75 20 62 6c  6f 63 6b 0d 05 fa 40 f4  | menu block...@.|
00001870  20 77 69 64 74 68 25 20  2d 20 63 75 72 72 65 6e  | width% - curren|
00001880  74 20 6d 65 6e 75 20 77  69 64 74 68 20 28 61 6c  |t menu width (al|
00001890  74 65 72 65 64 20 74 6f  20 72 65 66 6c 65 63 74  |tered to reflect|
000018a0  20 6e 65 77 20 77 69 64  74 68 29 0d 06 04 44 f4  | new width)...D.|
000018b0  20 65 6e 64 25 20 20 20  2d 20 70 6f 69 6e 74 65  | end%   - pointe|
000018c0  72 20 74 6f 20 65 6e 64  20 6f 66 20 6d 65 6e 75  |r to end of menu|
000018d0  20 73 74 72 75 63 74 75  72 65 20 28 61 6c 74 65  | structure (alte|
000018e0  72 65 64 20 74 6f 20 6e  65 77 20 65 6e 64 29 0d  |red to new end).|
000018f0  06 0e 2c f4 20 74 65 78  74 24 20 20 2d 20 74 65  |..,. text$  - te|
00001900  78 74 20 6f 66 20 6d 65  6e 75 20 69 74 65 6d 20  |xt of menu item |
00001910  74 6f 20 62 65 20 61 64  64 65 64 0d 06 18 26 f4  |to be added...&.|
00001920  20 74 69 63 6b 25 20 20  2d 20 69 66 20 73 65 74  | tick%  - if set|
00001930  20 69 74 65 6d 20 69 73  20 74 69 63 6b 61 62 6c  | item is tickabl|
00001940  65 0d 06 22 35 f4 20 64  6f 74 25 20 20 20 2d 20  |e.."5. dot%   - |
00001950  69 66 20 73 65 74 20 69  74 65 6d 20 68 61 73 20  |if set item has |
00001960  61 20 64 6f 74 74 65 64  20 6c 69 6e 65 20 61 66  |a dotted line af|
00001970  74 65 72 20 69 74 0d 06  2c 34 f4 20 77 72 69 74  |ter it..,4. writ|
00001980  65 25 20 2d 20 69 66 20  73 65 74 20 69 74 65 6d  |e% - if set item|
00001990  20 69 73 20 61 20 77 72  69 74 65 61 62 6c 65 20  | is a writeable |
000019a0  74 65 78 74 20 65 6e 74  72 79 0d 06 36 3d f4 20  |text entry..6=. |
000019b0  6d 65 73 73 25 20 20 2d  20 69 66 20 73 65 74 20  |mess%  - if set |
000019c0  67 65 6e 65 72 61 74 65  20 6d 65 73 73 61 67 65  |generate message|
000019d0  20 77 68 65 6e 20 6d 6f  76 69 6e 67 20 74 6f 20  | when moving to |
000019e0  73 75 62 6d 65 6e 75 0d  06 40 38 f4 20 6c 61 73  |submenu..@8. las|
000019f0  74 25 20 20 2d 20 69 66  20 73 65 74 20 74 68 69  |t%  - if set thi|
00001a00  73 20 69 73 20 74 68 65  20 6c 61 73 74 20 65 6e  |s is the last en|
00001a10  74 72 79 20 69 6e 20 74  68 65 20 6d 65 6e 75 0d  |try in the menu.|
00001a20  06 4a 44 f4 20 6c 69 6e  6b 25 20 20 2d 20 70 6f  |.JD. link%  - po|
00001a30  69 6e 74 65 72 20 74 6f  20 73 75 62 6d 65 6e 75  |inter to submenu|
00001a40  2f 64 69 61 6c 6f 67 75  65 20 62 6f 78 2c 20 6f  |/dialogue box, o|
00001a50  72 20 2d 31 20 66 6f 72  20 6e 6f 20 73 75 62 6d  |r -1 for no subm|
00001a60  65 6e 75 0d 06 54 4b f4  20 2d 2d 2d 2d 2d 2d 2d  |enu..TK. -------|
00001a70  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001aa0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d 06  |--------------..|
00001ab0  5e 46 f4 20 41 64 64 73  20 61 20 74 65 78 74 20  |^F. Adds a text |
00001ac0  69 74 65 6d 20 74 6f 20  61 20 6d 65 6e 75 20 62  |item to a menu b|
00001ad0  6c 6f 63 6b 20 69 6e 69  74 69 61 6c 69 73 65 64  |lock initialised|
00001ae0  20 62 79 20 50 52 4f 43  63 72 65 61 74 65 5f 6d  | by PROCcreate_m|
00001af0  65 6e 75 2e 0d 06 68 4b  f4 20 2d 2d 2d 2d 2d 2d  |enu...hK. ------|
00001b00  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001b30  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
00001b40  06 72 42 21 65 6e 64 25  20 3d 28 74 69 63 6b 25  |.rB!end% =(tick%|
00001b50  2b 28 64 6f 74 25 3c 3c  31 29 2b 28 77 72 69 74  |+(dot%<<1)+(writ|
00001b60  65 25 3c 3c 32 29 2b 28  6d 65 73 73 25 3c 3c 33  |e%<<2)+(mess%<<3|
00001b70  29 2b 28 6c 61 73 74 25  3c 3c 37 29 29 80 32 35  |)+(last%<<7)).25|
00001b80  35 0d 06 7c 10 65 6e 64  25 21 34 3d 6c 69 6e 6b  |5..|.end%!4=link|
00001b90  25 0d 06 86 48 65 6e 64  25 21 38 3d 26 30 37 30  |%...Hend%!8=&070|
00001ba0  30 33 30 32 31 20 20 3a  20 f4 20 74 65 78 74 2c  |03021  : . text,|
00001bb0  66 69 6c 6c 65 64 2c 62  75 74 74 6f 6e 20 74 79  |filled,button ty|
00001bc0  70 65 20 33 2c 66 6f 72  65 67 72 6f 75 6e 64 20  |pe 3,foreground |
00001bd0  63 6f 6c 6f 75 72 20 37  2c 0d 06 90 3d 24 28 65  |colour 7,...=$(e|
00001be0  6e 64 25 2b 31 32 29 3d  74 65 78 74 24 20 20 3a  |nd%+12)=text$  :|
00001bf0  20 f4 20 62 61 63 6b 67  72 6f 75 6e 64 20 63 6f  | . background co|
00001c00  6c 6f 75 72 20 30 2e 20  54 65 78 74 20 69 73 20  |lour 0. Text is |
00001c10  74 65 78 74 24 2e 0d 06  9a 0c 65 6e 64 25 2b 3d  |text$.....end%+=|
00001c20  32 34 0d 06 a4 27 e7 20  a9 28 74 65 78 74 24 29  |24...'. .(text$)|
00001c30  3e 77 69 64 74 68 25 20  8c 20 77 69 64 74 68 25  |>width% . width%|
00001c40  3d a9 28 74 65 78 74 24  29 0d 06 ae 1a 6d 65 6e  |=.(text$)....men|
00001c50  75 25 21 31 36 3d 28 77  69 64 74 68 25 2b 31 29  |u%!16=(width%+1)|
00001c60  2a 31 36 0d 06 b8 05 e1  0d 06 c2 05 3a 0d 06 cc  |*16.........:...|
00001c70  05 3a 0d 06 d6 29 dd 20  f2 64 69 73 70 6c 61 79  |.:...). .display|
00001c80  5f 62 61 72 5f 6d 65 6e  75 28 6d 65 6e 75 25 2c  |_bar_menu(menu%,|
00001c90  6c 65 6e 67 74 68 25 2c  78 25 29 0d 06 e0 4b f4  |length%,x%)...K.|
00001ca0  20 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  | ---------------|
00001cb0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001ce0  2d 2d 2d 2d 2d 2d 0d 06  ea 25 f4 20 6d 65 6e 75  |------...%. menu|
00001cf0  25 20 20 20 2d 20 70 6f  69 6e 74 65 72 20 74 6f  |%   - pointer to|
00001d00  20 6d 65 6e 75 20 62 6c  6f 63 6b 0d 06 f4 1e f4  | menu block.....|
00001d10  20 6c 65 6e 67 74 68 25  20 2d 20 6c 65 6e 67 74  | length% - lengt|
00001d20  68 20 6f 66 20 6d 65 6e  75 0d 06 fe 2f f4 20 78  |h of menu.../. x|
00001d30  25 20 20 20 20 20 20 2d  20 78 2d 63 6f 6f 72 64  |%      - x-coord|
00001d40  69 6e 61 74 65 20 74 6f  20 64 69 73 70 6c 61 79  |inate to display|
00001d50  20 6d 65 6e 75 20 61 74  0d 07 08 4b f4 20 2d 2d  | menu at...K. --|
00001d60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001da0  2d 2d 2d 0d 07 12 45 f4  20 44 69 73 70 6c 61 79  |---...E. Display|
00001db0  73 20 61 20 6d 65 6e 75  2c 20 67 69 76 65 6e 20  |s a menu, given |
00001dc0  69 74 73 20 6c 65 6e 67  74 68 2c 20 6f 6e 20 74  |its length, on t|
00001dd0  68 65 20 69 63 6f 6e 20  62 61 72 20 77 68 65 6e  |he icon bar when|
00001de0  20 6d 65 6e 75 20 69 73  0d 07 1c 21 f4 20 63 6c  | menu is...!. cl|
00001df0  69 63 6b 65 64 20 61 74  20 78 2d 63 6f 6f 72 64  |icked at x-coord|
00001e00  69 6e 61 74 65 20 78 25  2e 0d 07 26 4b f4 20 2d  |inate x%...&K. -|
00001e10  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001e50  2d 2d 2d 2d 0d 07 30 35  c8 99 20 22 57 69 6d 70  |----..05.. "Wimp|
00001e60  5f 43 72 65 61 74 65 4d  65 6e 75 22 2c 2c 6d 65  |_CreateMenu",,me|
00001e70  6e 75 25 2c 78 25 2d 36  34 2c 39 36 2b 28 6c 65  |nu%,x%-64,96+(le|
00001e80  6e 67 74 68 25 2a 34 34  29 0d 07 3a 05 e1 0d 07  |ngth%*44)..:....|
00001e90  44 05 3a 0d 07 4e 05 3a  0d 07 58 20 dd 20 f2 64  |D.:..N.:..X . .d|
00001ea0  69 73 70 6c 61 79 5f 6d  65 6e 75 28 6d 65 6e 75  |isplay_menu(menu|
00001eb0  25 2c 78 25 2c 79 25 29  0d 07 62 4b f4 20 2d 2d  |%,x%,y%)..bK. --|
00001ec0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001f00  2d 2d 2d 0d 07 6c 23 f4  20 6d 65 6e 75 25 20 2d  |---..l#. menu% -|
00001f10  20 70 6f 69 6e 74 65 72  20 74 6f 20 6d 65 6e 75  | pointer to menu|
00001f20  20 62 6c 6f 63 6b 0d 07  76 2d f4 20 78 25 20 20  | block..v-. x%  |
00001f30  20 20 2d 20 78 2d 63 6f  6f 72 64 69 6e 61 74 65  |  - x-coordinate|
00001f40  20 74 6f 20 64 69 73 70  6c 61 79 20 6d 65 6e 75  | to display menu|
00001f50  20 61 74 0d 07 80 2d f4  20 79 25 20 20 20 20 2d  | at...-. y%    -|
00001f60  20 79 2d 63 6f 6f 72 64  69 6e 61 74 65 20 74 6f  | y-coordinate to|
00001f70  20 64 69 73 70 6c 61 79  20 6d 65 6e 75 20 61 74  | display menu at|
00001f80  0d 07 8a 4b f4 20 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...K. ----------|
00001f90  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001fc0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 07 94 2f f4  |-----------.../.|
00001fd0  20 44 69 73 70 6c 61 79  73 20 61 20 6d 65 6e 75  | Displays a menu|
00001fe0  20 77 68 65 6e 20 70 6f  69 6e 74 65 72 20 69 73  | when pointer is|
00001ff0  20 61 74 20 78 25 2c 79  25 2e 0d 07 9e 4b f4 20  | at x%,y%....K. |
00002000  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002040  2d 2d 2d 2d 2d 0d 07 a8  28 c8 99 20 22 57 69 6d  |-----...(.. "Wim|
00002050  70 5f 43 72 65 61 74 65  4d 65 6e 75 22 2c 2c 6d  |p_CreateMenu",,m|
00002060  65 6e 75 25 2c 78 25 2d  36 34 2c 79 25 0d 07 b2  |enu%,x%-64,y%...|
00002070  05 e1 0d 07 bc 05 3a 0d  07 c6 05 3a 0d 07 d0 12  |......:....:....|
00002080  dd 20 a4 6c 65 61 66 28  66 69 6c 65 24 29 0d 07  |. .leaf(file$)..|
00002090  da 4b f4 20 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.K. ------------|
000020a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000020d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 07 e4 16 f4 20 66  |---------..... f|
000020e0  69 6c 65 24 20 2d 20 66  69 6c 65 6e 61 6d 65 0d  |ile$ - filename.|
000020f0  07 ee 4b f4 20 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |..K. -----------|
00002100  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002130  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0d 07 f8 31 f4 20  |----------...1. |
00002140  52 65 74 75 72 6e 73 20  74 68 65 20 6c 65 61 66  |Returns the leaf|
00002150  6e 61 6d 65 20 66 72 6f  6d 20 74 68 65 20 73 74  |name from the st|
00002160  72 69 6e 67 20 66 69 6c  65 24 2e 0d 08 02 4b f4  |ring file$....K.|
00002170  20 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  | ---------------|
00002180  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000021b0  2d 2d 2d 2d 2d 2d 0d 08  0c 10 ea 20 70 6f 73 25  |------..... pos%|
000021c0  2c 74 65 6d 70 25 0d 08  16 0b 74 65 6d 70 25 3d  |,temp%....temp%=|
000021d0  30 0d 08 20 05 f5 0d 08  2a 10 70 6f 73 25 3d 74  |0.. ....*.pos%=t|
000021e0  65 6d 70 25 2b 31 0d 08  34 1a 74 65 6d 70 25 3d  |emp%+1..4.temp%=|
000021f0  a7 66 69 6c 65 24 2c 22  2e 22 2c 70 6f 73 25 29  |.file$,".",pos%)|
00002200  0d 08 3e 0d fd 20 74 65  6d 70 25 3d 30 0d 08 48  |..>.. temp%=0..H|
00002210  11 3d c1 66 69 6c 65 24  2c 70 6f 73 25 29 0d 08  |.=.file$,pos%)..|
00002220  52 05 3a 0d 08 5c 05 3a  0d 08 66 14 dd 20 a4 62  |R.:..\.:..f.. .b|
00002230  72 61 6e 63 68 28 66 69  6c 65 24 29 0d 08 70 4b  |ranch(file$)..pK|
00002240  f4 20 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |. --------------|
00002250  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002280  2d 2d 2d 2d 2d 2d 2d 0d  08 7a 16 f4 20 66 69 6c  |-------..z.. fil|
00002290  65 24 20 2d 20 66 69 6c  65 6e 61 6d 65 0d 08 84  |e$ - filename...|
000022a0  4b f4 20 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |K. -------------|
000022b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000022e0  2d 2d 2d 2d 2d 2d 2d 2d  0d 08 8e 33 f4 20 52 65  |--------...3. Re|
000022f0  74 75 72 6e 73 20 74 68  65 20 62 72 61 6e 63 68  |turns the branch|
00002300  6e 61 6d 65 20 66 72 6f  6d 20 74 68 65 20 73 74  |name from the st|
00002310  72 69 6e 67 20 66 69 6c  65 24 2e 0d 08 98 4b f4  |ring file$....K.|
00002320  20 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  | ---------------|
00002330  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002360  2d 2d 2d 2d 2d 2d 0d 08  a2 14 ea 20 70 6f 73 25  |------..... pos%|
00002370  2c 62 72 24 2c 74 65 6d  70 25 0d 08 ac 15 e7 20  |,br$,temp%..... |
00002380  a7 66 69 6c 65 24 2c 22  2e 22 29 3d 30 20 8c 0d  |.file$,".")=0 ..|
00002390  08 b6 0b 20 62 72 24 3d  22 22 0d 08 c0 05 cc 0d  |... br$=""......|
000023a0  08 ca 0c 20 74 65 6d 70  25 3d 30 0d 08 d4 06 20  |... temp%=0.... |
000023b0  f5 0d 08 de 0f 20 70 6f  73 25 3d 74 65 6d 70 25  |..... pos%=temp%|
000023c0  0d 08 e8 1d 20 74 65 6d  70 25 3d a7 66 69 6c 65  |.... temp%=.file|
000023d0  24 2c 22 2e 22 2c 70 6f  73 25 2b 31 29 0d 08 f2  |$,".",pos%+1)...|
000023e0  0e 20 fd 20 74 65 6d 70  25 3d 30 0d 08 fc 17 20  |. . temp%=0.... |
000023f0  62 72 24 3d c0 66 69 6c  65 24 2c 70 6f 73 25 2d  |br$=.file$,pos%-|
00002400  31 29 0d 09 06 05 cd 0d  09 10 08 3d 62 72 24 0d  |1).........=br$.|
00002410  09 1a 05 3a 0d 09 24 05  3a 0d 09 2e 13 dd 20 a4  |...:..$.:..... .|
00002420  66 69 72 73 74 28 6d 65  6e 75 24 29 0d 09 38 4b  |first(menu$)..8K|
00002430  f4 20 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |. --------------|
00002440  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002470  2d 2d 2d 2d 2d 2d 2d 0d  09 42 23 f4 20 6d 65 6e  |-------..B#. men|
00002480  75 24 20 2d 20 6d 65 6e  75 20 73 65 6c 65 63 74  |u$ - menu select|
00002490  69 6f 6e 20 73 74 72 69  6e 67 0d 09 4c 4b f4 20  |ion string..LK. |
000024a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000024e0  2d 2d 2d 2d 2d 0d 09 56  3e f4 20 52 65 74 75 72  |-----..V>. Retur|
000024f0  6e 73 20 74 68 65 20 66  69 72 73 74 20 63 68 6f  |ns the first cho|
00002500  69 63 65 20 66 72 6f 6d  20 74 68 65 20 6d 65 6e  |ice from the men|
00002510  75 20 73 65 6c 65 63 74  69 6f 6e 20 73 74 72 69  |u selection stri|
00002520  6e 67 2e 0d 09 60 4b f4  20 2d 2d 2d 2d 2d 2d 2d  |ng...`K. -------|
00002530  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002560  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d 09  |--------------..|
00002570  6a 09 ea 20 63 68 24 0d  09 74 15 e7 20 a7 6d 65  |j.. ch$..t.. .me|
00002580  6e 75 24 2c 22 2e 22 29  3d 30 20 8c 0d 09 7e 0e  |nu$,".")=0 ...~.|
00002590  20 63 68 24 3d 6d 65 6e  75 24 0d 09 88 05 cc 0d  | ch$=menu$......|
000025a0  09 92 1e 20 63 68 24 3d  c0 6d 65 6e 75 24 2c a7  |... ch$=.menu$,.|
000025b0  6d 65 6e 75 24 2c 22 2e  22 29 2d 31 29 0d 09 9c  |menu$,".")-1)...|
000025c0  05 cd 0d 09 a6 08 3d 63  68 24 0d 09 b0 05 3a 0d  |......=ch$....:.|
000025d0  09 ba 05 3a 0d 09 c4 12  dd 20 a4 72 65 73 74 28  |...:..... .rest(|
000025e0  6d 65 6e 75 24 29 0d 09  ce 4b f4 20 2d 2d 2d 2d  |menu$)...K. ----|
000025f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002630  2d 0d 09 d8 23 f4 20 6d  65 6e 75 24 20 2d 20 6d  |-...#. menu$ - m|
00002640  65 6e 75 20 73 65 6c 65  63 74 69 6f 6e 20 73 74  |enu selection st|
00002650  72 69 6e 67 0d 09 e2 4b  f4 20 2d 2d 2d 2d 2d 2d  |ring...K. ------|
00002660  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002690  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
000026a0  09 ec 34 f4 20 52 65 74  75 72 6e 73 20 74 68 65  |..4. Returns the|
000026b0  20 72 65 73 74 20 6f 66  20 74 68 65 20 6d 65 6e  | rest of the men|
000026c0  75 20 73 65 6c 65 63 74  69 6f 6e 20 73 74 72 69  |u selection stri|
000026d0  6e 67 2e 0d 09 f6 4b f4  20 2d 2d 2d 2d 2d 2d 2d  |ng....K. -------|
000026e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002710  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d 0a  |--------------..|
00002720  00 09 ea 20 63 68 24 0d  0a 0a 15 e7 20 a7 6d 65  |... ch$..... .me|
00002730  6e 75 24 2c 22 2e 22 29  3d 30 20 8c 0d 0a 14 0b  |nu$,".")=0 .....|
00002740  20 63 68 24 3d 22 22 0d  0a 1e 05 cc 0d 0a 28 25  | ch$="".......(%|
00002750  20 63 68 24 3d c2 6d 65  6e 75 24 2c a9 28 6d 65  | ch$=.menu$,.(me|
00002760  6e 75 24 29 2d a7 6d 65  6e 75 24 2c 22 2e 22 29  |nu$)-.menu$,".")|
00002770  29 0d 0a 32 05 cd 0d 0a  3c 08 3d 63 68 24 0d 0a  |)..2....<.=ch$..|
00002780  46 05 3a 0d 0a 50 05 3a  0d 0a 5a 1a dd 20 a4 7a  |F.:..P.:..Z.. .z|
00002790  65 72 6f 5f 73 74 72 69  6e 67 28 70 6f 69 6e 74  |ero_string(point|
000027a0  25 29 0d 0a 64 4b f4 20  2d 2d 2d 2d 2d 2d 2d 2d  |%)..dK. --------|
000027b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000027e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0d 0a 6e  |-------------..n|
000027f0  31 f4 20 70 6f 69 6e 74  25 20 2d 20 50 6f 69 6e  |1. point% - Poin|
00002800  74 65 72 20 74 6f 20 7a  65 72 6f 2d 74 65 72 6d  |ter to zero-term|
00002810  69 6e 61 74 65 64 20 73  74 72 69 6e 67 2e 0d 0a  |inated string...|
00002820  78 4b f4 20 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |xK. ------------|
00002830  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002860  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 0a 82 24 f4 20 52  |---------...$. R|
00002870  65 74 75 72 6e 73 20 74  68 65 20 73 74 72 69 6e  |eturns the strin|
00002880  67 20 69 6e 20 73 74 72  69 6e 67 24 2e 0d 0a 8c  |g in string$....|
00002890  4b f4 20 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |K. -------------|
000028a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000028d0  2d 2d 2d 2d 2d 2d 2d 2d  0d 0a 96 0d ea 20 73 74  |--------..... st|
000028e0  72 69 6e 67 24 0d 0a a0  0e 73 74 72 69 6e 67 24  |ring$....string$|
000028f0  3d 22 22 0d 0a aa 0e c8  95 20 3f 70 6f 69 6e 74  |=""...... ?point|
00002900  25 0d 0a b4 16 20 73 74  72 69 6e 67 24 2b 3d bd  |%.... string$+=.|
00002910  3f 70 6f 69 6e 74 25 0d  0a be 0e 20 70 6f 69 6e  |?point%.... poin|
00002920  74 25 2b 3d 31 0d 0a c8  05 ce 0d 0a d2 0c 3d 73  |t%+=1.........=s|
00002930  74 72 69 6e 67 24 0d ff                           |tring$..|
00002938