Home » Archimedes archive » Archimedes World » AW-1995-02-Disc1.adf » Disk1Feb95 » !AWFeb95/Goodies/BasicComp/!BC/Examples/Wimp/Wimp

!AWFeb95/Goodies/BasicComp/!BC/Examples/Wimp/Wimp

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 » Archimedes World » AW-1995-02-Disc1.adf » Disk1Feb95
Filename: !AWFeb95/Goodies/BasicComp/!BC/Examples/Wimp/Wimp
Read OK:
File size: 19BE bytes
Load address: 0000
Exec address: 0000
File contents
   10REM  >Wimp
   20 Typical wimp library routine examples for BasCompress
   30 Note that use FNeval() rather than EVAL.  This is a simple routine
   40 that, depending on a debugging variable, traps any errors.
   50 :
   60:
   70: REM  Query ONLY brought up by PROC_Stop_Action, this routine called when
   80: REM  main wimp poll detected a mouse click inside the Query window.
   90:
  100DEF PROC_Mouse_Click_Query(x%, y%, b%, icon%)
  110LOCAL ERROR
  120ON ERROR LOCAL RESTORE ERROR  :  PROC_e("%.Wimp: Mouse_Click_Query")
  130  PROC_Cancel_Stop
  140  x% = FNeval("FN_Stop_Action_"+ query_action$+ "("+ STR$(icon%=0)+ ")")
  150ENDPROC
  160:
  170DEF FN_Stop_Action_(pressed_YES%)
  180  PROC_Wimp_Error(Wimp_Error_Fatal%, "Illegal click in unclaimed query window")
  190= FALSE
  200:
  210:
  220DEF FN_Load_Template_Extra(id$, rove%, sprite_pointer%, routine$)
  230LOCAL result%, r0%, C%
  240  $template_name% = id$+ "*"+ CHR$(0)
  250  SYS "XWimp_LoadTemplate",, template_file%, rove%, inddata_end%, -1, template_name%, 0 TO r0%,, indrove%; C%
  260  IF FN_PSR_V_Set(C%) THEN
  270    PROC_Wimp_Error_Block(r0%)
  280    PROC_Wimp_CloseDown
  290  ENDIF
  300  IF FNgetname(template_name%)<>id$ THEN
  310    PROC_Set_Message_String("Reason", id$)
  320    PROC_Wimp_Error(Wimp_Error_Fatal%, FNLEMsg(3))
  330    PROC_Wimp_CloseDown
  340  ENDIF
  350  template_file%!64 = sprite_pointer%
  360  IF routine$<>"" THEN IF FNeval("FN"+ routine$)
  370  SYS "Wimp_CreateWindow",, template_file% TO result%
  380= result%
  390:
  400: REM  Called from main wimp poll loop
  410: REM  Allow multiple routines
  420:
  430DEF PROC_Null_Reason_Code
  440LOCAL n%, r$
  450LOCAL ERROR
  460ON ERROR LOCAL RESTORE ERROR : PROC_e("%.Wimp: Null_Reason_Code")
  470  n% = n_null%
  480  WHILE n%>0
  490    n% -= 1
  500    r$ = null_q$(n%)
  510    IF r$<>Null$ THEN
  520      IF FNeval("FN_Null_Reason_"+ r$) THEN
  530        IF null_q$(n%)<>Null$ THEN
  540          n_null% -= 1
  550        ENDIF
  560      ENDIF
  570    ENDIF
  580  ENDWHILE
  590ENDPROC
  600:
  610:
  620DEF PROC_User_Drag_Box
  630LOCAL x%
  640LOCAL ERROR
  650ON ERROR LOCAL RESTORE ERROR : PROC_e("%.Wimp: User_Drag")
  660  x% = FNeval("FN_Dragged_"+ dragged$)
  670  IF dragged_button%<>(1*16) THEN
  680    PROC_Close_All_Menus
  690  ENDIF
  700  SYS "Wimp_DragBox",, -1 : dragged$ = ""
  710ENDPROC
  720:
  730REM *********************************************************************
  740REM This can be used to drag anything
  750REM When the pointer leaves the window the window's scrolled in the
  760REM opposite direction
  770:
  780REM w%                  window
  790REM b%                  current mouse buttons
  800REM type%               type of drag to perform (5, 6, or 7)
  810REM xmin...ymax%        box to drag (screen)
  820REM Xmin...Ymax%        parent box (screen)
  830REM Wxmin..Wxmax%       windows' work area extent, (0=>find out)
  840REM routine$            call FN_Dragged_<routine$> at end
  850:
  860DEF PROC_DragBoxScrollWindow(w%, b%, type%, xmin%, ymin%, xmax%, ymax%, Xmin%, Ymin%, Xmax%, Ymax%, Wxmin%, Wymin%, Wxmax%, Wymax%, routine$)
  870LOCAL P%, l%
  880  l% = 64
  890  P% = FN_Claim_Stack(l%)
  900  P%!00 = type%
  910  P%!04 = xmin%
  920  P%!08 = ymin%
  930  P%!12 = xmax%
  940  P%!16 = ymax%
  950  P%!20 = Xmin%
  960  P%!24 = Ymin%
  970  P%!28 = Xmax%
  980  P%!32 = Ymax%
  990  P%!36 = Wxmin%
 1000  P%!40 = Wymin%
 1010  P%!44 = Wxmax%
 1020  P%!48 = Wymax%
 1030  SYS "CAssembler_Window", Window_DragBoxScroll, w%, P%
 1040  dragged_BoxScrollWindow$ = routine$
 1050  dragged$                 = "BoxScrollWindow"
 1060  dragged_button%          = b%
 1070  PROC_Release_Stack(P%, l%)
 1080ENDPROC
 1090:
 1100DEF FN_Dragged_BoxScrollWindow
 1110= FNeval("FN_Dragged_"+ dragged_BoxScrollWindow$)
 1120:
 1130REM *********************************************************************
 1140REM This can be used to drag a window about, usually dragging "background"
 1150REM It will scroll in the direction the mouse moves in
 1160:
 1170REM w%                  window
 1180REM b%                  current mouse buttons
 1190REM x%, y%              current mouse x, y
 1200REM xmin..ymax%         windows' work area extent, (0=>find out)
 1210REM routine$            call FN_Dragged_<routine$> at end
 1220:
 1230DEF PROC_DragScrollWindow(w%,b%, x%,y%, xmin%,ymin%,xmax%,ymax%, routine$)
 1240SYS "CAssembler_Window",Window_DragScroll,w%,x%,y%,xmin%,ymin%,xmax%,ymax%
 1250  dragged_ScrollWindow$  = routine$
 1260  dragged$               = "ScrollWindow"
 1270  dragged_button%        = b%
 1280ENDPROC
 1290:
 1300DEF FN_Dragged_ScrollWindow
 1310  IF dragged_ScrollWindow$<>"" THEN
 1320    IF FNeval("FN_Dragged_"+ dragged_ScrollWindow$)
 1330  ENDIF
 1340= 0
 1350:
 1360:
 1370DEF PROC_Message_RAM_Transmit
 1380LOCAL ERROR
 1390ON ERROR LOCAL RESTORE ERROR : PROC_e("Message_RAM_Transmit: ")
 1400 IF W%!12<>RAM_Load_Ref% THEN
 1410   PROC_Wimp_Error(Wimp_Error%, "Unexpected RAM_Transmit message")
 1420 ELSE
 1430   RAM_Load_Size% += W%!24                      :REM #bytes transfered
 1440   IF (W%!24)=RAM_Load_Buffer_Length% THEN
 1450     PROC_RAM_Load                              :REM Ask for more
 1460   ELSE
 1470     :
 1480     : REM  Buffer not full, so all loaded - end communications
 1490     :
 1500     IF FNeval("FN_RAM_Load_Completed_"+ RAM_Load_Routine$+ "("+STR$(RAM_Load_Size%)+")") THEN
 1510       PROC_Wimp_LError(6)
 1520     ENDIF
 1530   ENDIF
 1540 ENDIF
 1550ENDPROC
 1560:
 1570: REM  Called to request that the application reserve some memory for more
 1580: REM  of a file to be loaded via the RAM transfer protocol
 1590:
 1600DEF PROC_RAM_Load
 1610LOCAL RAM_start%
 1620  IF FNeval("FN_RAM_Load_"+ RAM_Load_Routine$+ "("+STR$(RAM_Load_Size%)+", "+STR$(RAM_Load_Buffer_Length%)+", RAM_start%)") THEN
 1630    IF RAM_Load_Size%<>0 THEN
 1640      PROC_Wimp_LError(7)
 1650    ELSE
 1660      IF FNeval("FN_RAM_Load_Failed_"+ RAM_Load_Routine$)
 1670      PROC_RAM_WimpScrap_Load                   :REM Try this way
 1680    ENDIF
 1690  ELSE
 1700    W%!12 = W%!8
 1710    W%!16 = 6                                   :REM Send RAM_Fetch
 1720    W%!20 = RAM_start%
 1730    W%!24 = RAM_Load_Buffer_Length%
 1740    SYS "Wimp_SendMessage", 18, W%, W%!4        :REM Send recorded
 1750    RAM_Load_Ref% = W%!8
 1760  ENDIF
 1770ENDPROC
 1780:
 1790:
 1800DEF PROC_Message_RAM_Fetch
 1810LOCAL x, RAM_start%, RAM_length%
 1820LOCAL ERROR
 1830ON ERROR LOCAL RESTORE ERROR : PROC_e("Message_RAM_Fetch: ")
 1840 IF W%!12<>save_ref% THEN
 1850   PROC_Wimp_LError(9)
 1860 ELSE
 1870   IF RAM_Save_Routine$="" THEN
 1880     :
 1890     : REM  Application won't handle RAM transfer - the external task will
 1900     : REM  notice this when don't reply here - and initiate the normal
 1910     : REM  <Wimp$Scrap> protocol
 1920     :
 1930   ELSE
 1940     IF FNeval("FN_RAM_Save_"+ RAM_Save_Routine$+ "("+STR$(RAM_Save_Offset%)+", "+STR$(W%!24)+", RAM_start%, RAM_length%)") THEN
 1950       REM  If no response, then other program will report error
 1960     ELSE
 1970       RAM_Save_Offset% += RAM_length%
 1980       SYS "Wimp_TransferBlock", Task_Handle%, RAM_start%, W%!4, W%!20, RAM_length%
 1990       W%!12 = W%!8
 2000       W%!16 = 7                        :REM Send RAM_Transmit
 2010       W%!24 = RAM_length%
 2020       SYS "Wimp_SendMessage", 17 - (RAM_length%=(W%!24)), W%, W%!4
 2030       save_ref% = W%!8                 :REM Multi-messages
 2040     ENDIF
 2050   ENDIF
 2060 ENDIF
 2070ENDPROC
 2080:

�  >Wimp
: Typical wimp library routine examples for BasCompress
C Note that use �eval() rather than �.  This is a simple routine
(? that, depending on a debugging variable, traps any errors.
2 :
<:
FL: �  Query ONLY brought up by PROC_Stop_Action, this routine called when
PG: �  main wimp poll detected a mouse click inside the Query window.
Z:
d,� �_Mouse_Click_Query(x%, y%, b%, icon%)
n� �
x2� � � � �  :  �_e("%.Wimp: Mouse_Click_Query")
�  �_Cancel_Stop
�H  x% = �eval("FN_Stop_Action_"+ query_action$+ "("+ �(icon%=0)+ ")")
��
�:
�"� �_Stop_Action_(pressed_YES%)
�P  �_Wimp_Error(Wimp_Error_Fatal%, "Illegal click in unclaimed query window")
�= �
�:
�:
�B� �_Load_Template_Extra(id$, rove%, sprite_pointer%, routine$)
�� result%, r0%, C%
�&  $template_name% = id$+ "*"+ �(0)
�o  ș "XWimp_LoadTemplate",, template_file%, rove%, inddata_end%, -1, template_name%, 0 � r0%,, indrove%; C%
  � �_PSR_V_Set(C%) �
    �_Wimp_Error_Block(r0%)
    �_Wimp_CloseDown
"  �
,'  � �getname(template_name%)<>id$ �
6+    �_Set_Message_String("Reason", id$)
@2    �_Wimp_Error(Wimp_Error_Fatal%, �LEMsg(3))
J    �_Wimp_CloseDown
T  �
^)  template_file%!64 = sprite_pointer%
h.  � routine$<>"" � � �eval("FN"+ routine$)
r7  ș "Wimp_CreateWindow",, template_file% � result%
|
= result%
�:
�(: �  Called from main wimp poll loop
� : �  Allow multiple routines
�:
�� �_Null_Reason_Code
�� n%, r$
�� �
�/� � � � � : �_e("%.Wimp: Null_Reason_Code")
�  n% = n_null%
�
  ȕ n%>0
�    n% -= 1
�    r$ = null_q$(n%)
�    � r$<>Null$ �
*      � �eval("FN_Null_Reason_"+ r$) �
"        � null_q$(n%)<>Null$ �
          n_null% -= 1
&
        �
0      �
:	    �
D  �
N�
X:
b:
l� �_User_Drag_Box
v� x%
�� �
�(� � � � � : �_e("%.Wimp: User_Drag")
�)  x% = �eval("FN_Dragged_"+ dragged$)
�!  � dragged_button%<>(1*16) �
�    �_Close_All_Menus
�  �
�,  ș "Wimp_DragBox",, -1 : dragged$ = ""
��
�:
�K� *********************************************************************
�'� This can be used to drag anything
�E� When the pointer leaves the window the window's scrolled in the
�� opposite direction
:
 � w%                  window
/� b%                  current mouse buttons
 >� type%               type of drag to perform (5, 6, or 7)
*.� xmin...ymax%        box to drag (screen)
4-� Xmin...Ymax%        parent box (screen)
>B� Wxmin..Wxmax%       windows' work area extent, (0=>find out)
H;� routine$            call FN_Dragged_<routine$> at end
R:
\�� �_DragBoxScrollWindow(w%, b%, type%, xmin%, ymin%, xmax%, ymax%, Xmin%, Ymin%, Xmax%, Ymax%, Wxmin%, Wymin%, Wxmax%, Wymax%, routine$)
f� P%, l%
p
  l% = 64
z  P% = �_Claim_Stack(l%)
�  P%!00 = type%
�  P%!04 = xmin%
�  P%!08 = ymin%
�  P%!12 = xmax%
�  P%!16 = ymax%
�  P%!20 = Xmin%
�  P%!24 = Ymin%
�  P%!28 = Xmax%
�  P%!32 = Ymax%
�  P%!36 = Wxmin%
�  P%!40 = Wymin%
�  P%!44 = Wxmax%
�  P%!48 = Wymax%
:  ș "CAssembler_Window", Window_DragBoxScroll, w%, P%
)  dragged_BoxScrollWindow$ = routine$
2  dragged$                 = "BoxScrollWindow"
$#  dragged_button%          = b%
.  �_Release_Stack(P%, l%)
8�
B:
L� �_Dragged_BoxScrollWindow
V4= �eval("FN_Dragged_"+ dragged_BoxScrollWindow$)
`:
jK� *********************************************************************
tL� This can be used to drag a window about, usually dragging "background"
~8� It will scroll in the direction the mouse moves in
�:
� � w%                  window
�/� b%                  current mouse buttons
�,� x%, y%              current mouse x, y
�B� xmin..ymax%         windows' work area extent, (0=>find out)
�;� routine$            call FN_Dragged_<routine$> at end
�:
�I� �_DragScrollWindow(w%,b%, x%,y%, xmin%,ymin%,xmax%,ymax%, routine$)
�Mș "CAssembler_Window",Window_DragScroll,w%,x%,y%,xmin%,ymin%,xmax%,ymax%
�'  dragged_ScrollWindow$  = routine$
�-  dragged$               = "ScrollWindow"
�!  dragged_button%        = b%
�

:
� �_Dragged_ScrollWindow
#  � dragged_ScrollWindow$<>"" �
(5    � �eval("FN_Dragged_"+ dragged_ScrollWindow$)
2  �
<= 0
F:
P:
Z� �_Message_RAM_Transmit
d� �
n-� � � � � : �_e("Message_RAM_Transmit: ")
x � W%!12<>RAM_Load_Ref% �
�C   �_Wimp_Error(Wimp_Error%, "Unexpected RAM_Transmit message")
� �
�H   RAM_Load_Size% += W%!24                      :� #bytes transfered
�*   � (W%!24)=RAM_Load_Buffer_Length% �
�@     �_RAM_Load                              :� Ask for more
�   �
�
     :
�A     : �  Buffer not full, so all loaded - end communications
�
     :
�Z     � �eval("FN_RAM_Load_Completed_"+ RAM_Load_Routine$+ "("+�(RAM_Load_Size%)+")") �
�       �_Wimp_LError(6)
�
     �
�   �
 �
�
:
"L: �  Called to request that the application reserve some memory for more
,=: �  of a file to be loaded via the RAM transfer protocol
6:
@� �_RAM_Load
J� RAM_start%
Ty  � �eval("FN_RAM_Load_"+ RAM_Load_Routine$+ "("+�(RAM_Load_Size%)+", "+�(RAM_Load_Buffer_Length%)+", RAM_start%)") �
^    � RAM_Load_Size%<>0 �
h      �_Wimp_LError(7)
r	    �
|;      � �eval("FN_RAM_Load_Failed_"+ RAM_Load_Routine$)
�@      �_RAM_WimpScrap_Load                   :� Try this way
�	    �
�  �
�    W%!12 = W%!8
�E    W%!16 = 6                                   :� Send RAM_Fetch
�    W%!20 = RAM_start%
�'    W%!24 = RAM_Load_Buffer_Length%
�C    ș "Wimp_SendMessage", 18, W%, W%!4        :� Send recorded
�    RAM_Load_Ref% = W%!8
�  �
��
�:
�:
� �_Message_RAM_Fetch
 � x, RAM_start%, RAM_length%
� �
&*� � � � � : �_e("Message_RAM_Fetch: ")
0 � W%!12<>save_ref% �
:   �_Wimp_LError(9)
D �
N   � RAM_Save_Routine$="" �
X
     :
bL     : �  Application won't handle RAM transfer - the external task will
lI     : �  notice this when don't reply here - and initiate the normal
v#     : �  <Wimp$Scrap> protocol
�
     :
�   �
�y     � �eval("FN_RAM_Save_"+ RAM_Save_Routine$+ "("+�(RAM_Save_Offset%)+", "+�(W%!24)+", RAM_start%, RAM_length%)") �
�B       �  If no response, then other program will report error
�
     �
�*       RAM_Save_Offset% += RAM_length%
�V       ș "Wimp_TransferBlock", Task_Handle%, RAM_start%, W%!4, W%!20, RAM_length%
�       W%!12 = W%!8
�@       W%!16 = 7                        :� Send RAM_Transmit
�       W%!24 = RAM_length%
�F       ș "Wimp_SendMessage", 17 - (RAM_length%=(W%!24)), W%, W%!4
�=       save_ref% = W%!8                 :� Multi-messages
�
     �
   �
 �
�
 :
�
00000000  0d 00 0a 0c f4 20 20 3e  57 69 6d 70 0d 00 14 3a  |.....  >Wimp...:|
00000010  20 54 79 70 69 63 61 6c  20 77 69 6d 70 20 6c 69  | Typical wimp li|
00000020  62 72 61 72 79 20 72 6f  75 74 69 6e 65 20 65 78  |brary routine ex|
00000030  61 6d 70 6c 65 73 20 66  6f 72 20 42 61 73 43 6f  |amples for BasCo|
00000040  6d 70 72 65 73 73 0d 00  1e 43 20 4e 6f 74 65 20  |mpress...C Note |
00000050  74 68 61 74 20 75 73 65  20 a4 65 76 61 6c 28 29  |that use .eval()|
00000060  20 72 61 74 68 65 72 20  74 68 61 6e 20 a0 2e 20  | rather than .. |
00000070  20 54 68 69 73 20 69 73  20 61 20 73 69 6d 70 6c  | This is a simpl|
00000080  65 20 72 6f 75 74 69 6e  65 0d 00 28 3f 20 74 68  |e routine..(? th|
00000090  61 74 2c 20 64 65 70 65  6e 64 69 6e 67 20 6f 6e  |at, depending on|
000000a0  20 61 20 64 65 62 75 67  67 69 6e 67 20 76 61 72  | a debugging var|
000000b0  69 61 62 6c 65 2c 20 74  72 61 70 73 20 61 6e 79  |iable, traps any|
000000c0  20 65 72 72 6f 72 73 2e  0d 00 32 06 20 3a 0d 00  | errors...2. :..|
000000d0  3c 05 3a 0d 00 46 4c 3a  20 f4 20 20 51 75 65 72  |<.:..FL: .  Quer|
000000e0  79 20 4f 4e 4c 59 20 62  72 6f 75 67 68 74 20 75  |y ONLY brought u|
000000f0  70 20 62 79 20 50 52 4f  43 5f 53 74 6f 70 5f 41  |p by PROC_Stop_A|
00000100  63 74 69 6f 6e 2c 20 74  68 69 73 20 72 6f 75 74  |ction, this rout|
00000110  69 6e 65 20 63 61 6c 6c  65 64 20 77 68 65 6e 0d  |ine called when.|
00000120  00 50 47 3a 20 f4 20 20  6d 61 69 6e 20 77 69 6d  |.PG: .  main wim|
00000130  70 20 70 6f 6c 6c 20 64  65 74 65 63 74 65 64 20  |p poll detected |
00000140  61 20 6d 6f 75 73 65 20  63 6c 69 63 6b 20 69 6e  |a mouse click in|
00000150  73 69 64 65 20 74 68 65  20 51 75 65 72 79 20 77  |side the Query w|
00000160  69 6e 64 6f 77 2e 0d 00  5a 05 3a 0d 00 64 2c dd  |indow...Z.:..d,.|
00000170  20 f2 5f 4d 6f 75 73 65  5f 43 6c 69 63 6b 5f 51  | ._Mouse_Click_Q|
00000180  75 65 72 79 28 78 25 2c  20 79 25 2c 20 62 25 2c  |uery(x%, y%, b%,|
00000190  20 69 63 6f 6e 25 29 0d  00 6e 07 ea 20 85 0d 00  | icon%)..n.. ...|
000001a0  78 32 ee 20 85 20 ea 20  f7 20 85 20 20 3a 20 20  |x2. . . . .  :  |
000001b0  f2 5f 65 28 22 25 2e 57  69 6d 70 3a 20 4d 6f 75  |._e("%.Wimp: Mou|
000001c0  73 65 5f 43 6c 69 63 6b  5f 51 75 65 72 79 22 29  |se_Click_Query")|
000001d0  0d 00 82 13 20 20 f2 5f  43 61 6e 63 65 6c 5f 53  |....  ._Cancel_S|
000001e0  74 6f 70 0d 00 8c 48 20  20 78 25 20 3d 20 a4 65  |top...H  x% = .e|
000001f0  76 61 6c 28 22 46 4e 5f  53 74 6f 70 5f 41 63 74  |val("FN_Stop_Act|
00000200  69 6f 6e 5f 22 2b 20 71  75 65 72 79 5f 61 63 74  |ion_"+ query_act|
00000210  69 6f 6e 24 2b 20 22 28  22 2b 20 c3 28 69 63 6f  |ion$+ "("+ .(ico|
00000220  6e 25 3d 30 29 2b 20 22  29 22 29 0d 00 96 05 e1  |n%=0)+ ")").....|
00000230  0d 00 a0 05 3a 0d 00 aa  22 dd 20 a4 5f 53 74 6f  |....:...". ._Sto|
00000240  70 5f 41 63 74 69 6f 6e  5f 28 70 72 65 73 73 65  |p_Action_(presse|
00000250  64 5f 59 45 53 25 29 0d  00 b4 50 20 20 f2 5f 57  |d_YES%)...P  ._W|
00000260  69 6d 70 5f 45 72 72 6f  72 28 57 69 6d 70 5f 45  |imp_Error(Wimp_E|
00000270  72 72 6f 72 5f 46 61 74  61 6c 25 2c 20 22 49 6c  |rror_Fatal%, "Il|
00000280  6c 65 67 61 6c 20 63 6c  69 63 6b 20 69 6e 20 75  |legal click in u|
00000290  6e 63 6c 61 69 6d 65 64  20 71 75 65 72 79 20 77  |nclaimed query w|
000002a0  69 6e 64 6f 77 22 29 0d  00 be 07 3d 20 a3 0d 00  |indow")....= ...|
000002b0  c8 05 3a 0d 00 d2 05 3a  0d 00 dc 42 dd 20 a4 5f  |..:....:...B. ._|
000002c0  4c 6f 61 64 5f 54 65 6d  70 6c 61 74 65 5f 45 78  |Load_Template_Ex|
000002d0  74 72 61 28 69 64 24 2c  20 72 6f 76 65 25 2c 20  |tra(id$, rove%, |
000002e0  73 70 72 69 74 65 5f 70  6f 69 6e 74 65 72 25 2c  |sprite_pointer%,|
000002f0  20 72 6f 75 74 69 6e 65  24 29 0d 00 e6 16 ea 20  | routine$)..... |
00000300  72 65 73 75 6c 74 25 2c  20 72 30 25 2c 20 43 25  |result%, r0%, C%|
00000310  0d 00 f0 26 20 20 24 74  65 6d 70 6c 61 74 65 5f  |...&  $template_|
00000320  6e 61 6d 65 25 20 3d 20  69 64 24 2b 20 22 2a 22  |name% = id$+ "*"|
00000330  2b 20 bd 28 30 29 0d 00  fa 6f 20 20 c8 99 20 22  |+ .(0)...o  .. "|
00000340  58 57 69 6d 70 5f 4c 6f  61 64 54 65 6d 70 6c 61  |XWimp_LoadTempla|
00000350  74 65 22 2c 2c 20 74 65  6d 70 6c 61 74 65 5f 66  |te",, template_f|
00000360  69 6c 65 25 2c 20 72 6f  76 65 25 2c 20 69 6e 64  |ile%, rove%, ind|
00000370  64 61 74 61 5f 65 6e 64  25 2c 20 2d 31 2c 20 74  |data_end%, -1, t|
00000380  65 6d 70 6c 61 74 65 5f  6e 61 6d 65 25 2c 20 30  |emplate_name%, 0|
00000390  20 b8 20 72 30 25 2c 2c  20 69 6e 64 72 6f 76 65  | . r0%,, indrove|
000003a0  25 3b 20 43 25 0d 01 04  19 20 20 e7 20 a4 5f 50  |%; C%....  . ._P|
000003b0  53 52 5f 56 5f 53 65 74  28 43 25 29 20 8c 0d 01  |SR_V_Set(C%) ...|
000003c0  0e 1f 20 20 20 20 f2 5f  57 69 6d 70 5f 45 72 72  |..    ._Wimp_Err|
000003d0  6f 72 5f 42 6c 6f 63 6b  28 72 30 25 29 0d 01 18  |or_Block(r0%)...|
000003e0  18 20 20 20 20 f2 5f 57  69 6d 70 5f 43 6c 6f 73  |.    ._Wimp_Clos|
000003f0  65 44 6f 77 6e 0d 01 22  07 20 20 cd 0d 01 2c 27  |eDown..".  ...,'|
00000400  20 20 e7 20 a4 67 65 74  6e 61 6d 65 28 74 65 6d  |  . .getname(tem|
00000410  70 6c 61 74 65 5f 6e 61  6d 65 25 29 3c 3e 69 64  |plate_name%)<>id|
00000420  24 20 8c 0d 01 36 2b 20  20 20 20 f2 5f 53 65 74  |$ ...6+    ._Set|
00000430  5f 4d 65 73 73 61 67 65  5f 53 74 72 69 6e 67 28  |_Message_String(|
00000440  22 52 65 61 73 6f 6e 22  2c 20 69 64 24 29 0d 01  |"Reason", id$)..|
00000450  40 32 20 20 20 20 f2 5f  57 69 6d 70 5f 45 72 72  |@2    ._Wimp_Err|
00000460  6f 72 28 57 69 6d 70 5f  45 72 72 6f 72 5f 46 61  |or(Wimp_Error_Fa|
00000470  74 61 6c 25 2c 20 a4 4c  45 4d 73 67 28 33 29 29  |tal%, .LEMsg(3))|
00000480  0d 01 4a 18 20 20 20 20  f2 5f 57 69 6d 70 5f 43  |..J.    ._Wimp_C|
00000490  6c 6f 73 65 44 6f 77 6e  0d 01 54 07 20 20 cd 0d  |loseDown..T.  ..|
000004a0  01 5e 29 20 20 74 65 6d  70 6c 61 74 65 5f 66 69  |.^)  template_fi|
000004b0  6c 65 25 21 36 34 20 3d  20 73 70 72 69 74 65 5f  |le%!64 = sprite_|
000004c0  70 6f 69 6e 74 65 72 25  0d 01 68 2e 20 20 e7 20  |pointer%..h.  . |
000004d0  72 6f 75 74 69 6e 65 24  3c 3e 22 22 20 8c 20 e7  |routine$<>"" . .|
000004e0  20 a4 65 76 61 6c 28 22  46 4e 22 2b 20 72 6f 75  | .eval("FN"+ rou|
000004f0  74 69 6e 65 24 29 0d 01  72 37 20 20 c8 99 20 22  |tine$)..r7  .. "|
00000500  57 69 6d 70 5f 43 72 65  61 74 65 57 69 6e 64 6f  |Wimp_CreateWindo|
00000510  77 22 2c 2c 20 74 65 6d  70 6c 61 74 65 5f 66 69  |w",, template_fi|
00000520  6c 65 25 20 b8 20 72 65  73 75 6c 74 25 0d 01 7c  |le% . result%..||
00000530  0d 3d 20 72 65 73 75 6c  74 25 0d 01 86 05 3a 0d  |.= result%....:.|
00000540  01 90 28 3a 20 f4 20 20  43 61 6c 6c 65 64 20 66  |..(: .  Called f|
00000550  72 6f 6d 20 6d 61 69 6e  20 77 69 6d 70 20 70 6f  |rom main wimp po|
00000560  6c 6c 20 6c 6f 6f 70 0d  01 9a 20 3a 20 f4 20 20  |ll loop... : .  |
00000570  41 6c 6c 6f 77 20 6d 75  6c 74 69 70 6c 65 20 72  |Allow multiple r|
00000580  6f 75 74 69 6e 65 73 0d  01 a4 05 3a 0d 01 ae 18  |outines....:....|
00000590  dd 20 f2 5f 4e 75 6c 6c  5f 52 65 61 73 6f 6e 5f  |. ._Null_Reason_|
000005a0  43 6f 64 65 0d 01 b8 0c  ea 20 6e 25 2c 20 72 24  |Code..... n%, r$|
000005b0  0d 01 c2 07 ea 20 85 0d  01 cc 2f ee 20 85 20 ea  |..... ..../. . .|
000005c0  20 f7 20 85 20 3a 20 f2  5f 65 28 22 25 2e 57 69  | . . : ._e("%.Wi|
000005d0  6d 70 3a 20 4e 75 6c 6c  5f 52 65 61 73 6f 6e 5f  |mp: Null_Reason_|
000005e0  43 6f 64 65 22 29 0d 01  d6 12 20 20 6e 25 20 3d  |Code")....  n% =|
000005f0  20 6e 5f 6e 75 6c 6c 25  0d 01 e0 0d 20 20 c8 95  | n_null%....  ..|
00000600  20 6e 25 3e 30 0d 01 ea  0f 20 20 20 20 6e 25 20  | n%>0....    n% |
00000610  2d 3d 20 31 0d 01 f4 18  20 20 20 20 72 24 20 3d  |-= 1....    r$ =|
00000620  20 6e 75 6c 6c 5f 71 24  28 6e 25 29 0d 01 fe 15  | null_q$(n%)....|
00000630  20 20 20 20 e7 20 72 24  3c 3e 4e 75 6c 6c 24 20  |    . r$<>Null$ |
00000640  8c 0d 02 08 2a 20 20 20  20 20 20 e7 20 a4 65 76  |....*      . .ev|
00000650  61 6c 28 22 46 4e 5f 4e  75 6c 6c 5f 52 65 61 73  |al("FN_Null_Reas|
00000660  6f 6e 5f 22 2b 20 72 24  29 20 8c 0d 02 12 22 20  |on_"+ r$) ...." |
00000670  20 20 20 20 20 20 20 e7  20 6e 75 6c 6c 5f 71 24  |       . null_q$|
00000680  28 6e 25 29 3c 3e 4e 75  6c 6c 24 20 8c 0d 02 1c  |(n%)<>Null$ ....|
00000690  1a 20 20 20 20 20 20 20  20 20 20 6e 5f 6e 75 6c  |.          n_nul|
000006a0  6c 25 20 2d 3d 20 31 0d  02 26 0d 20 20 20 20 20  |l% -= 1..&.     |
000006b0  20 20 20 cd 0d 02 30 0b  20 20 20 20 20 20 cd 0d  |   ...0.      ..|
000006c0  02 3a 09 20 20 20 20 cd  0d 02 44 07 20 20 ce 0d  |.:.    ...D.  ..|
000006d0  02 4e 05 e1 0d 02 58 05  3a 0d 02 62 05 3a 0d 02  |.N....X.:..b.:..|
000006e0  6c 15 dd 20 f2 5f 55 73  65 72 5f 44 72 61 67 5f  |l.. ._User_Drag_|
000006f0  42 6f 78 0d 02 76 08 ea  20 78 25 0d 02 80 07 ea  |Box..v.. x%.....|
00000700  20 85 0d 02 8a 28 ee 20  85 20 ea 20 f7 20 85 20  | ....(. . . . . |
00000710  3a 20 f2 5f 65 28 22 25  2e 57 69 6d 70 3a 20 55  |: ._e("%.Wimp: U|
00000720  73 65 72 5f 44 72 61 67  22 29 0d 02 94 29 20 20  |ser_Drag")...)  |
00000730  78 25 20 3d 20 a4 65 76  61 6c 28 22 46 4e 5f 44  |x% = .eval("FN_D|
00000740  72 61 67 67 65 64 5f 22  2b 20 64 72 61 67 67 65  |ragged_"+ dragge|
00000750  64 24 29 0d 02 9e 21 20  20 e7 20 64 72 61 67 67  |d$)...!  . dragg|
00000760  65 64 5f 62 75 74 74 6f  6e 25 3c 3e 28 31 2a 31  |ed_button%<>(1*1|
00000770  36 29 20 8c 0d 02 a8 19  20 20 20 20 f2 5f 43 6c  |6) .....    ._Cl|
00000780  6f 73 65 5f 41 6c 6c 5f  4d 65 6e 75 73 0d 02 b2  |ose_All_Menus...|
00000790  07 20 20 cd 0d 02 bc 2c  20 20 c8 99 20 22 57 69  |.  ....,  .. "Wi|
000007a0  6d 70 5f 44 72 61 67 42  6f 78 22 2c 2c 20 2d 31  |mp_DragBox",, -1|
000007b0  20 3a 20 64 72 61 67 67  65 64 24 20 3d 20 22 22  | : dragged$ = ""|
000007c0  0d 02 c6 05 e1 0d 02 d0  05 3a 0d 02 da 4b f4 20  |.........:...K. |
000007d0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000810  2a 2a 2a 2a 2a 0d 02 e4  27 f4 20 54 68 69 73 20  |*****...'. This |
00000820  63 61 6e 20 62 65 20 75  73 65 64 20 74 6f 20 64  |can be used to d|
00000830  72 61 67 20 61 6e 79 74  68 69 6e 67 0d 02 ee 45  |rag anything...E|
00000840  f4 20 57 68 65 6e 20 74  68 65 20 70 6f 69 6e 74  |. When the point|
00000850  65 72 20 6c 65 61 76 65  73 20 74 68 65 20 77 69  |er leaves the wi|
00000860  6e 64 6f 77 20 74 68 65  20 77 69 6e 64 6f 77 27  |ndow the window'|
00000870  73 20 73 63 72 6f 6c 6c  65 64 20 69 6e 20 74 68  |s scrolled in th|
00000880  65 0d 02 f8 18 f4 20 6f  70 70 6f 73 69 74 65 20  |e..... opposite |
00000890  64 69 72 65 63 74 69 6f  6e 0d 03 02 05 3a 0d 03  |direction....:..|
000008a0  0c 20 f4 20 77 25 20 20  20 20 20 20 20 20 20 20  |. . w%          |
000008b0  20 20 20 20 20 20 20 20  77 69 6e 64 6f 77 0d 03  |        window..|
000008c0  16 2f f4 20 62 25 20 20  20 20 20 20 20 20 20 20  |./. b%          |
000008d0  20 20 20 20 20 20 20 20  63 75 72 72 65 6e 74 20  |        current |
000008e0  6d 6f 75 73 65 20 62 75  74 74 6f 6e 73 0d 03 20  |mouse buttons.. |
000008f0  3e f4 20 74 79 70 65 25  20 20 20 20 20 20 20 20  |>. type%        |
00000900  20 20 20 20 20 20 20 74  79 70 65 20 6f 66 20 64  |       type of d|
00000910  72 61 67 20 74 6f 20 70  65 72 66 6f 72 6d 20 28  |rag to perform (|
00000920  35 2c 20 36 2c 20 6f 72  20 37 29 0d 03 2a 2e f4  |5, 6, or 7)..*..|
00000930  20 78 6d 69 6e 2e 2e 2e  79 6d 61 78 25 20 20 20  | xmin...ymax%   |
00000940  20 20 20 20 20 62 6f 78  20 74 6f 20 64 72 61 67  |     box to drag|
00000950  20 28 73 63 72 65 65 6e  29 0d 03 34 2d f4 20 58  | (screen)..4-. X|
00000960  6d 69 6e 2e 2e 2e 59 6d  61 78 25 20 20 20 20 20  |min...Ymax%     |
00000970  20 20 20 70 61 72 65 6e  74 20 62 6f 78 20 28 73  |   parent box (s|
00000980  63 72 65 65 6e 29 0d 03  3e 42 f4 20 57 78 6d 69  |creen)..>B. Wxmi|
00000990  6e 2e 2e 57 78 6d 61 78  25 20 20 20 20 20 20 20  |n..Wxmax%       |
000009a0  77 69 6e 64 6f 77 73 27  20 77 6f 72 6b 20 61 72  |windows' work ar|
000009b0  65 61 20 65 78 74 65 6e  74 2c 20 28 30 3d 3e 66  |ea extent, (0=>f|
000009c0  69 6e 64 20 6f 75 74 29  0d 03 48 3b f4 20 72 6f  |ind out)..H;. ro|
000009d0  75 74 69 6e 65 24 20 20  20 20 20 20 20 20 20 20  |utine$          |
000009e0  20 20 63 61 6c 6c 20 46  4e 5f 44 72 61 67 67 65  |  call FN_Dragge|
000009f0  64 5f 3c 72 6f 75 74 69  6e 65 24 3e 20 61 74 20  |d_<routine$> at |
00000a00  65 6e 64 0d 03 52 05 3a  0d 03 5c 8c dd 20 f2 5f  |end..R.:..\.. ._|
00000a10  44 72 61 67 42 6f 78 53  63 72 6f 6c 6c 57 69 6e  |DragBoxScrollWin|
00000a20  64 6f 77 28 77 25 2c 20  62 25 2c 20 74 79 70 65  |dow(w%, b%, type|
00000a30  25 2c 20 78 6d 69 6e 25  2c 20 79 6d 69 6e 25 2c  |%, xmin%, ymin%,|
00000a40  20 78 6d 61 78 25 2c 20  79 6d 61 78 25 2c 20 58  | xmax%, ymax%, X|
00000a50  6d 69 6e 25 2c 20 59 6d  69 6e 25 2c 20 58 6d 61  |min%, Ymin%, Xma|
00000a60  78 25 2c 20 59 6d 61 78  25 2c 20 57 78 6d 69 6e  |x%, Ymax%, Wxmin|
00000a70  25 2c 20 57 79 6d 69 6e  25 2c 20 57 78 6d 61 78  |%, Wymin%, Wxmax|
00000a80  25 2c 20 57 79 6d 61 78  25 2c 20 72 6f 75 74 69  |%, Wymax%, routi|
00000a90  6e 65 24 29 0d 03 66 0c  ea 20 50 25 2c 20 6c 25  |ne$)..f.. P%, l%|
00000aa0  0d 03 70 0d 20 20 6c 25  20 3d 20 36 34 0d 03 7a  |..p.  l% = 64..z|
00000ab0  1c 20 20 50 25 20 3d 20  a4 5f 43 6c 61 69 6d 5f  |.  P% = ._Claim_|
00000ac0  53 74 61 63 6b 28 6c 25  29 0d 03 84 13 20 20 50  |Stack(l%)....  P|
00000ad0  25 21 30 30 20 3d 20 74  79 70 65 25 0d 03 8e 13  |%!00 = type%....|
00000ae0  20 20 50 25 21 30 34 20  3d 20 78 6d 69 6e 25 0d  |  P%!04 = xmin%.|
00000af0  03 98 13 20 20 50 25 21  30 38 20 3d 20 79 6d 69  |...  P%!08 = ymi|
00000b00  6e 25 0d 03 a2 13 20 20  50 25 21 31 32 20 3d 20  |n%....  P%!12 = |
00000b10  78 6d 61 78 25 0d 03 ac  13 20 20 50 25 21 31 36  |xmax%....  P%!16|
00000b20  20 3d 20 79 6d 61 78 25  0d 03 b6 13 20 20 50 25  | = ymax%....  P%|
00000b30  21 32 30 20 3d 20 58 6d  69 6e 25 0d 03 c0 13 20  |!20 = Xmin%.... |
00000b40  20 50 25 21 32 34 20 3d  20 59 6d 69 6e 25 0d 03  | P%!24 = Ymin%..|
00000b50  ca 13 20 20 50 25 21 32  38 20 3d 20 58 6d 61 78  |..  P%!28 = Xmax|
00000b60  25 0d 03 d4 13 20 20 50  25 21 33 32 20 3d 20 59  |%....  P%!32 = Y|
00000b70  6d 61 78 25 0d 03 de 14  20 20 50 25 21 33 36 20  |max%....  P%!36 |
00000b80  3d 20 57 78 6d 69 6e 25  0d 03 e8 14 20 20 50 25  |= Wxmin%....  P%|
00000b90  21 34 30 20 3d 20 57 79  6d 69 6e 25 0d 03 f2 14  |!40 = Wymin%....|
00000ba0  20 20 50 25 21 34 34 20  3d 20 57 78 6d 61 78 25  |  P%!44 = Wxmax%|
00000bb0  0d 03 fc 14 20 20 50 25  21 34 38 20 3d 20 57 79  |....  P%!48 = Wy|
00000bc0  6d 61 78 25 0d 04 06 3a  20 20 c8 99 20 22 43 41  |max%...:  .. "CA|
00000bd0  73 73 65 6d 62 6c 65 72  5f 57 69 6e 64 6f 77 22  |ssembler_Window"|
00000be0  2c 20 57 69 6e 64 6f 77  5f 44 72 61 67 42 6f 78  |, Window_DragBox|
00000bf0  53 63 72 6f 6c 6c 2c 20  77 25 2c 20 50 25 0d 04  |Scroll, w%, P%..|
00000c00  10 29 20 20 64 72 61 67  67 65 64 5f 42 6f 78 53  |.)  dragged_BoxS|
00000c10  63 72 6f 6c 6c 57 69 6e  64 6f 77 24 20 3d 20 72  |crollWindow$ = r|
00000c20  6f 75 74 69 6e 65 24 0d  04 1a 32 20 20 64 72 61  |outine$...2  dra|
00000c30  67 67 65 64 24 20 20 20  20 20 20 20 20 20 20 20  |gged$           |
00000c40  20 20 20 20 20 20 3d 20  22 42 6f 78 53 63 72 6f  |      = "BoxScro|
00000c50  6c 6c 57 69 6e 64 6f 77  22 0d 04 24 23 20 20 64  |llWindow"..$#  d|
00000c60  72 61 67 67 65 64 5f 62  75 74 74 6f 6e 25 20 20  |ragged_button%  |
00000c70  20 20 20 20 20 20 20 20  3d 20 62 25 0d 04 2e 1d  |        = b%....|
00000c80  20 20 f2 5f 52 65 6c 65  61 73 65 5f 53 74 61 63  |  ._Release_Stac|
00000c90  6b 28 50 25 2c 20 6c 25  29 0d 04 38 05 e1 0d 04  |k(P%, l%)..8....|
00000ca0  42 05 3a 0d 04 4c 1f dd  20 a4 5f 44 72 61 67 67  |B.:..L.. ._Dragg|
00000cb0  65 64 5f 42 6f 78 53 63  72 6f 6c 6c 57 69 6e 64  |ed_BoxScrollWind|
00000cc0  6f 77 0d 04 56 34 3d 20  a4 65 76 61 6c 28 22 46  |ow..V4= .eval("F|
00000cd0  4e 5f 44 72 61 67 67 65  64 5f 22 2b 20 64 72 61  |N_Dragged_"+ dra|
00000ce0  67 67 65 64 5f 42 6f 78  53 63 72 6f 6c 6c 57 69  |gged_BoxScrollWi|
00000cf0  6e 64 6f 77 24 29 0d 04  60 05 3a 0d 04 6a 4b f4  |ndow$)..`.:..jK.|
00000d00  20 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  | ***************|
00000d10  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000d40  2a 2a 2a 2a 2a 2a 0d 04  74 4c f4 20 54 68 69 73  |******..tL. This|
00000d50  20 63 61 6e 20 62 65 20  75 73 65 64 20 74 6f 20  | can be used to |
00000d60  64 72 61 67 20 61 20 77  69 6e 64 6f 77 20 61 62  |drag a window ab|
00000d70  6f 75 74 2c 20 75 73 75  61 6c 6c 79 20 64 72 61  |out, usually dra|
00000d80  67 67 69 6e 67 20 22 62  61 63 6b 67 72 6f 75 6e  |gging "backgroun|
00000d90  64 22 0d 04 7e 38 f4 20  49 74 20 77 69 6c 6c 20  |d"..~8. It will |
00000da0  73 63 72 6f 6c 6c 20 69  6e 20 74 68 65 20 64 69  |scroll in the di|
00000db0  72 65 63 74 69 6f 6e 20  74 68 65 20 6d 6f 75 73  |rection the mous|
00000dc0  65 20 6d 6f 76 65 73 20  69 6e 0d 04 88 05 3a 0d  |e moves in....:.|
00000dd0  04 92 20 f4 20 77 25 20  20 20 20 20 20 20 20 20  |.. . w%         |
00000de0  20 20 20 20 20 20 20 20  20 77 69 6e 64 6f 77 0d  |         window.|
00000df0  04 9c 2f f4 20 62 25 20  20 20 20 20 20 20 20 20  |../. b%         |
00000e00  20 20 20 20 20 20 20 20  20 63 75 72 72 65 6e 74  |         current|
00000e10  20 6d 6f 75 73 65 20 62  75 74 74 6f 6e 73 0d 04  | mouse buttons..|
00000e20  a6 2c f4 20 78 25 2c 20  79 25 20 20 20 20 20 20  |.,. x%, y%      |
00000e30  20 20 20 20 20 20 20 20  63 75 72 72 65 6e 74 20  |        current |
00000e40  6d 6f 75 73 65 20 78 2c  20 79 0d 04 b0 42 f4 20  |mouse x, y...B. |
00000e50  78 6d 69 6e 2e 2e 79 6d  61 78 25 20 20 20 20 20  |xmin..ymax%     |
00000e60  20 20 20 20 77 69 6e 64  6f 77 73 27 20 77 6f 72  |    windows' wor|
00000e70  6b 20 61 72 65 61 20 65  78 74 65 6e 74 2c 20 28  |k area extent, (|
00000e80  30 3d 3e 66 69 6e 64 20  6f 75 74 29 0d 04 ba 3b  |0=>find out)...;|
00000e90  f4 20 72 6f 75 74 69 6e  65 24 20 20 20 20 20 20  |. routine$      |
00000ea0  20 20 20 20 20 20 63 61  6c 6c 20 46 4e 5f 44 72  |      call FN_Dr|
00000eb0  61 67 67 65 64 5f 3c 72  6f 75 74 69 6e 65 24 3e  |agged_<routine$>|
00000ec0  20 61 74 20 65 6e 64 0d  04 c4 05 3a 0d 04 ce 49  | at end....:...I|
00000ed0  dd 20 f2 5f 44 72 61 67  53 63 72 6f 6c 6c 57 69  |. ._DragScrollWi|
00000ee0  6e 64 6f 77 28 77 25 2c  62 25 2c 20 78 25 2c 79  |ndow(w%,b%, x%,y|
00000ef0  25 2c 20 78 6d 69 6e 25  2c 79 6d 69 6e 25 2c 78  |%, xmin%,ymin%,x|
00000f00  6d 61 78 25 2c 79 6d 61  78 25 2c 20 72 6f 75 74  |max%,ymax%, rout|
00000f10  69 6e 65 24 29 0d 04 d8  4d c8 99 20 22 43 41 73  |ine$)...M.. "CAs|
00000f20  73 65 6d 62 6c 65 72 5f  57 69 6e 64 6f 77 22 2c  |sembler_Window",|
00000f30  57 69 6e 64 6f 77 5f 44  72 61 67 53 63 72 6f 6c  |Window_DragScrol|
00000f40  6c 2c 77 25 2c 78 25 2c  79 25 2c 78 6d 69 6e 25  |l,w%,x%,y%,xmin%|
00000f50  2c 79 6d 69 6e 25 2c 78  6d 61 78 25 2c 79 6d 61  |,ymin%,xmax%,yma|
00000f60  78 25 0d 04 e2 27 20 20  64 72 61 67 67 65 64 5f  |x%...'  dragged_|
00000f70  53 63 72 6f 6c 6c 57 69  6e 64 6f 77 24 20 20 3d  |ScrollWindow$  =|
00000f80  20 72 6f 75 74 69 6e 65  24 0d 04 ec 2d 20 20 64  | routine$...-  d|
00000f90  72 61 67 67 65 64 24 20  20 20 20 20 20 20 20 20  |ragged$         |
00000fa0  20 20 20 20 20 20 3d 20  22 53 63 72 6f 6c 6c 57  |      = "ScrollW|
00000fb0  69 6e 64 6f 77 22 0d 04  f6 21 20 20 64 72 61 67  |indow"...!  drag|
00000fc0  67 65 64 5f 62 75 74 74  6f 6e 25 20 20 20 20 20  |ged_button%     |
00000fd0  20 20 20 3d 20 62 25 0d  05 00 05 e1 0d 05 0a 05  |   = b%.........|
00000fe0  3a 0d 05 14 1c dd 20 a4  5f 44 72 61 67 67 65 64  |:..... ._Dragged|
00000ff0  5f 53 63 72 6f 6c 6c 57  69 6e 64 6f 77 0d 05 1e  |_ScrollWindow...|
00001000  23 20 20 e7 20 64 72 61  67 67 65 64 5f 53 63 72  |#  . dragged_Scr|
00001010  6f 6c 6c 57 69 6e 64 6f  77 24 3c 3e 22 22 20 8c  |ollWindow$<>"" .|
00001020  0d 05 28 35 20 20 20 20  e7 20 a4 65 76 61 6c 28  |..(5    . .eval(|
00001030  22 46 4e 5f 44 72 61 67  67 65 64 5f 22 2b 20 64  |"FN_Dragged_"+ d|
00001040  72 61 67 67 65 64 5f 53  63 72 6f 6c 6c 57 69 6e  |ragged_ScrollWin|
00001050  64 6f 77 24 29 0d 05 32  07 20 20 cd 0d 05 3c 07  |dow$)..2.  ...<.|
00001060  3d 20 30 0d 05 46 05 3a  0d 05 50 05 3a 0d 05 5a  |= 0..F.:..P.:..Z|
00001070  1c dd 20 f2 5f 4d 65 73  73 61 67 65 5f 52 41 4d  |.. ._Message_RAM|
00001080  5f 54 72 61 6e 73 6d 69  74 0d 05 64 07 ea 20 85  |_Transmit..d.. .|
00001090  0d 05 6e 2d ee 20 85 20  ea 20 f7 20 85 20 3a 20  |..n-. . . . . : |
000010a0  f2 5f 65 28 22 4d 65 73  73 61 67 65 5f 52 41 4d  |._e("Message_RAM|
000010b0  5f 54 72 61 6e 73 6d 69  74 3a 20 22 29 0d 05 78  |_Transmit: ")..x|
000010c0  1d 20 e7 20 57 25 21 31  32 3c 3e 52 41 4d 5f 4c  |. . W%!12<>RAM_L|
000010d0  6f 61 64 5f 52 65 66 25  20 8c 0d 05 82 43 20 20  |oad_Ref% ....C  |
000010e0  20 f2 5f 57 69 6d 70 5f  45 72 72 6f 72 28 57 69  | ._Wimp_Error(Wi|
000010f0  6d 70 5f 45 72 72 6f 72  25 2c 20 22 55 6e 65 78  |mp_Error%, "Unex|
00001100  70 65 63 74 65 64 20 52  41 4d 5f 54 72 61 6e 73  |pected RAM_Trans|
00001110  6d 69 74 20 6d 65 73 73  61 67 65 22 29 0d 05 8c  |mit message")...|
00001120  06 20 cc 0d 05 96 48 20  20 20 52 41 4d 5f 4c 6f  |. ....H   RAM_Lo|
00001130  61 64 5f 53 69 7a 65 25  20 2b 3d 20 57 25 21 32  |ad_Size% += W%!2|
00001140  34 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |4               |
00001150  20 20 20 20 20 20 20 3a  f4 20 23 62 79 74 65 73  |       :. #bytes|
00001160  20 74 72 61 6e 73 66 65  72 65 64 0d 05 a0 2a 20  | transfered...* |
00001170  20 20 e7 20 28 57 25 21  32 34 29 3d 52 41 4d 5f  |  . (W%!24)=RAM_|
00001180  4c 6f 61 64 5f 42 75 66  66 65 72 5f 4c 65 6e 67  |Load_Buffer_Leng|
00001190  74 68 25 20 8c 0d 05 aa  40 20 20 20 20 20 f2 5f  |th% ....@     ._|
000011a0  52 41 4d 5f 4c 6f 61 64  20 20 20 20 20 20 20 20  |RAM_Load        |
000011b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000011c0  20 20 20 20 20 20 3a f4  20 41 73 6b 20 66 6f 72  |      :. Ask for|
000011d0  20 6d 6f 72 65 0d 05 b4  08 20 20 20 cc 0d 05 be  | more....   ....|
000011e0  0a 20 20 20 20 20 3a 0d  05 c8 41 20 20 20 20 20  |.     :...A     |
000011f0  3a 20 f4 20 20 42 75 66  66 65 72 20 6e 6f 74 20  |: .  Buffer not |
00001200  66 75 6c 6c 2c 20 73 6f  20 61 6c 6c 20 6c 6f 61  |full, so all loa|
00001210  64 65 64 20 2d 20 65 6e  64 20 63 6f 6d 6d 75 6e  |ded - end commun|
00001220  69 63 61 74 69 6f 6e 73  0d 05 d2 0a 20 20 20 20  |ications....    |
00001230  20 3a 0d 05 dc 5a 20 20  20 20 20 e7 20 a4 65 76  | :...Z     . .ev|
00001240  61 6c 28 22 46 4e 5f 52  41 4d 5f 4c 6f 61 64 5f  |al("FN_RAM_Load_|
00001250  43 6f 6d 70 6c 65 74 65  64 5f 22 2b 20 52 41 4d  |Completed_"+ RAM|
00001260  5f 4c 6f 61 64 5f 52 6f  75 74 69 6e 65 24 2b 20  |_Load_Routine$+ |
00001270  22 28 22 2b c3 28 52 41  4d 5f 4c 6f 61 64 5f 53  |"("+.(RAM_Load_S|
00001280  69 7a 65 25 29 2b 22 29  22 29 20 8c 0d 05 e6 1b  |ize%)+")") .....|
00001290  20 20 20 20 20 20 20 f2  5f 57 69 6d 70 5f 4c 45  |       ._Wimp_LE|
000012a0  72 72 6f 72 28 36 29 0d  05 f0 0a 20 20 20 20 20  |rror(6)....     |
000012b0  cd 0d 05 fa 08 20 20 20  cd 0d 06 04 06 20 cd 0d  |.....   ..... ..|
000012c0  06 0e 05 e1 0d 06 18 05  3a 0d 06 22 4c 3a 20 f4  |........:.."L: .|
000012d0  20 20 43 61 6c 6c 65 64  20 74 6f 20 72 65 71 75  |  Called to requ|
000012e0  65 73 74 20 74 68 61 74  20 74 68 65 20 61 70 70  |est that the app|
000012f0  6c 69 63 61 74 69 6f 6e  20 72 65 73 65 72 76 65  |lication reserve|
00001300  20 73 6f 6d 65 20 6d 65  6d 6f 72 79 20 66 6f 72  | some memory for|
00001310  20 6d 6f 72 65 0d 06 2c  3d 3a 20 f4 20 20 6f 66  | more..,=: .  of|
00001320  20 61 20 66 69 6c 65 20  74 6f 20 62 65 20 6c 6f  | a file to be lo|
00001330  61 64 65 64 20 76 69 61  20 74 68 65 20 52 41 4d  |aded via the RAM|
00001340  20 74 72 61 6e 73 66 65  72 20 70 72 6f 74 6f 63  | transfer protoc|
00001350  6f 6c 0d 06 36 05 3a 0d  06 40 10 dd 20 f2 5f 52  |ol..6.:..@.. ._R|
00001360  41 4d 5f 4c 6f 61 64 0d  06 4a 10 ea 20 52 41 4d  |AM_Load..J.. RAM|
00001370  5f 73 74 61 72 74 25 0d  06 54 79 20 20 e7 20 a4  |_start%..Ty  . .|
00001380  65 76 61 6c 28 22 46 4e  5f 52 41 4d 5f 4c 6f 61  |eval("FN_RAM_Loa|
00001390  64 5f 22 2b 20 52 41 4d  5f 4c 6f 61 64 5f 52 6f  |d_"+ RAM_Load_Ro|
000013a0  75 74 69 6e 65 24 2b 20  22 28 22 2b c3 28 52 41  |utine$+ "("+.(RA|
000013b0  4d 5f 4c 6f 61 64 5f 53  69 7a 65 25 29 2b 22 2c  |M_Load_Size%)+",|
000013c0  20 22 2b c3 28 52 41 4d  5f 4c 6f 61 64 5f 42 75  | "+.(RAM_Load_Bu|
000013d0  66 66 65 72 5f 4c 65 6e  67 74 68 25 29 2b 22 2c  |ffer_Length%)+",|
000013e0  20 52 41 4d 5f 73 74 61  72 74 25 29 22 29 20 8c  | RAM_start%)") .|
000013f0  0d 06 5e 1d 20 20 20 20  e7 20 52 41 4d 5f 4c 6f  |..^.    . RAM_Lo|
00001400  61 64 5f 53 69 7a 65 25  3c 3e 30 20 8c 0d 06 68  |ad_Size%<>0 ...h|
00001410  1a 20 20 20 20 20 20 f2  5f 57 69 6d 70 5f 4c 45  |.      ._Wimp_LE|
00001420  72 72 6f 72 28 37 29 0d  06 72 09 20 20 20 20 cc  |rror(7)..r.    .|
00001430  0d 06 7c 3b 20 20 20 20  20 20 e7 20 a4 65 76 61  |..|;      . .eva|
00001440  6c 28 22 46 4e 5f 52 41  4d 5f 4c 6f 61 64 5f 46  |l("FN_RAM_Load_F|
00001450  61 69 6c 65 64 5f 22 2b  20 52 41 4d 5f 4c 6f 61  |ailed_"+ RAM_Loa|
00001460  64 5f 52 6f 75 74 69 6e  65 24 29 0d 06 86 40 20  |d_Routine$)...@ |
00001470  20 20 20 20 20 f2 5f 52  41 4d 5f 57 69 6d 70 53  |     ._RAM_WimpS|
00001480  63 72 61 70 5f 4c 6f 61  64 20 20 20 20 20 20 20  |crap_Load       |
00001490  20 20 20 20 20 20 20 20  20 20 20 20 3a f4 20 54  |            :. T|
000014a0  72 79 20 74 68 69 73 20  77 61 79 0d 06 90 09 20  |ry this way.... |
000014b0  20 20 20 cd 0d 06 9a 07  20 20 cc 0d 06 a4 14 20  |   .....  ..... |
000014c0  20 20 20 57 25 21 31 32  20 3d 20 57 25 21 38 0d  |   W%!12 = W%!8.|
000014d0  06 ae 45 20 20 20 20 57  25 21 31 36 20 3d 20 36  |..E    W%!16 = 6|
000014e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00001500  20 20 20 3a f4 20 53 65  6e 64 20 52 41 4d 5f 46  |   :. Send RAM_F|
00001510  65 74 63 68 0d 06 b8 1a  20 20 20 20 57 25 21 32  |etch....    W%!2|
00001520  30 20 3d 20 52 41 4d 5f  73 74 61 72 74 25 0d 06  |0 = RAM_start%..|
00001530  c2 27 20 20 20 20 57 25  21 32 34 20 3d 20 52 41  |.'    W%!24 = RA|
00001540  4d 5f 4c 6f 61 64 5f 42  75 66 66 65 72 5f 4c 65  |M_Load_Buffer_Le|
00001550  6e 67 74 68 25 0d 06 cc  43 20 20 20 20 c8 99 20  |ngth%...C    .. |
00001560  22 57 69 6d 70 5f 53 65  6e 64 4d 65 73 73 61 67  |"Wimp_SendMessag|
00001570  65 22 2c 20 31 38 2c 20  57 25 2c 20 57 25 21 34  |e", 18, W%, W%!4|
00001580  20 20 20 20 20 20 20 20  3a f4 20 53 65 6e 64 20  |        :. Send |
00001590  72 65 63 6f 72 64 65 64  0d 06 d6 1c 20 20 20 20  |recorded....    |
000015a0  52 41 4d 5f 4c 6f 61 64  5f 52 65 66 25 20 3d 20  |RAM_Load_Ref% = |
000015b0  57 25 21 38 0d 06 e0 07  20 20 cd 0d 06 ea 05 e1  |W%!8....  ......|
000015c0  0d 06 f4 05 3a 0d 06 fe  05 3a 0d 07 08 19 dd 20  |....:....:..... |
000015d0  f2 5f 4d 65 73 73 61 67  65 5f 52 41 4d 5f 46 65  |._Message_RAM_Fe|
000015e0  74 63 68 0d 07 12 20 ea  20 78 2c 20 52 41 4d 5f  |tch... . x, RAM_|
000015f0  73 74 61 72 74 25 2c 20  52 41 4d 5f 6c 65 6e 67  |start%, RAM_leng|
00001600  74 68 25 0d 07 1c 07 ea  20 85 0d 07 26 2a ee 20  |th%..... ...&*. |
00001610  85 20 ea 20 f7 20 85 20  3a 20 f2 5f 65 28 22 4d  |. . . . : ._e("M|
00001620  65 73 73 61 67 65 5f 52  41 4d 5f 46 65 74 63 68  |essage_RAM_Fetch|
00001630  3a 20 22 29 0d 07 30 19  20 e7 20 57 25 21 31 32  |: ")..0. . W%!12|
00001640  3c 3e 73 61 76 65 5f 72  65 66 25 20 8c 0d 07 3a  |<>save_ref% ...:|
00001650  17 20 20 20 f2 5f 57 69  6d 70 5f 4c 45 72 72 6f  |.   ._Wimp_LErro|
00001660  72 28 39 29 0d 07 44 06  20 cc 0d 07 4e 1f 20 20  |r(9)..D. ...N.  |
00001670  20 e7 20 52 41 4d 5f 53  61 76 65 5f 52 6f 75 74  | . RAM_Save_Rout|
00001680  69 6e 65 24 3d 22 22 20  8c 0d 07 58 0a 20 20 20  |ine$="" ...X.   |
00001690  20 20 3a 0d 07 62 4c 20  20 20 20 20 3a 20 f4 20  |  :..bL     : . |
000016a0  20 41 70 70 6c 69 63 61  74 69 6f 6e 20 77 6f 6e  | Application won|
000016b0  27 74 20 68 61 6e 64 6c  65 20 52 41 4d 20 74 72  |'t handle RAM tr|
000016c0  61 6e 73 66 65 72 20 2d  20 74 68 65 20 65 78 74  |ansfer - the ext|
000016d0  65 72 6e 61 6c 20 74 61  73 6b 20 77 69 6c 6c 0d  |ernal task will.|
000016e0  07 6c 49 20 20 20 20 20  3a 20 f4 20 20 6e 6f 74  |.lI     : .  not|
000016f0  69 63 65 20 74 68 69 73  20 77 68 65 6e 20 64 6f  |ice this when do|
00001700  6e 27 74 20 72 65 70 6c  79 20 68 65 72 65 20 2d  |n't reply here -|
00001710  20 61 6e 64 20 69 6e 69  74 69 61 74 65 20 74 68  | and initiate th|
00001720  65 20 6e 6f 72 6d 61 6c  0d 07 76 23 20 20 20 20  |e normal..v#    |
00001730  20 3a 20 f4 20 20 3c 57  69 6d 70 24 53 63 72 61  | : .  <Wimp$Scra|
00001740  70 3e 20 70 72 6f 74 6f  63 6f 6c 0d 07 80 0a 20  |p> protocol.... |
00001750  20 20 20 20 3a 0d 07 8a  08 20 20 20 cc 0d 07 94  |    :....   ....|
00001760  79 20 20 20 20 20 e7 20  a4 65 76 61 6c 28 22 46  |y     . .eval("F|
00001770  4e 5f 52 41 4d 5f 53 61  76 65 5f 22 2b 20 52 41  |N_RAM_Save_"+ RA|
00001780  4d 5f 53 61 76 65 5f 52  6f 75 74 69 6e 65 24 2b  |M_Save_Routine$+|
00001790  20 22 28 22 2b c3 28 52  41 4d 5f 53 61 76 65 5f  | "("+.(RAM_Save_|
000017a0  4f 66 66 73 65 74 25 29  2b 22 2c 20 22 2b c3 28  |Offset%)+", "+.(|
000017b0  57 25 21 32 34 29 2b 22  2c 20 52 41 4d 5f 73 74  |W%!24)+", RAM_st|
000017c0  61 72 74 25 2c 20 52 41  4d 5f 6c 65 6e 67 74 68  |art%, RAM_length|
000017d0  25 29 22 29 20 8c 0d 07  9e 42 20 20 20 20 20 20  |%)") ....B      |
000017e0  20 f4 20 20 49 66 20 6e  6f 20 72 65 73 70 6f 6e  | .  If no respon|
000017f0  73 65 2c 20 74 68 65 6e  20 6f 74 68 65 72 20 70  |se, then other p|
00001800  72 6f 67 72 61 6d 20 77  69 6c 6c 20 72 65 70 6f  |rogram will repo|
00001810  72 74 20 65 72 72 6f 72  0d 07 a8 0a 20 20 20 20  |rt error....    |
00001820  20 cc 0d 07 b2 2a 20 20  20 20 20 20 20 52 41 4d  | ....*       RAM|
00001830  5f 53 61 76 65 5f 4f 66  66 73 65 74 25 20 2b 3d  |_Save_Offset% +=|
00001840  20 52 41 4d 5f 6c 65 6e  67 74 68 25 0d 07 bc 56  | RAM_length%...V|
00001850  20 20 20 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |       .. "Wimp_|
00001860  54 72 61 6e 73 66 65 72  42 6c 6f 63 6b 22 2c 20  |TransferBlock", |
00001870  54 61 73 6b 5f 48 61 6e  64 6c 65 25 2c 20 52 41  |Task_Handle%, RA|
00001880  4d 5f 73 74 61 72 74 25  2c 20 57 25 21 34 2c 20  |M_start%, W%!4, |
00001890  57 25 21 32 30 2c 20 52  41 4d 5f 6c 65 6e 67 74  |W%!20, RAM_lengt|
000018a0  68 25 0d 07 c6 17 20 20  20 20 20 20 20 57 25 21  |h%....       W%!|
000018b0  31 32 20 3d 20 57 25 21  38 0d 07 d0 40 20 20 20  |12 = W%!8...@   |
000018c0  20 20 20 20 57 25 21 31  36 20 3d 20 37 20 20 20  |    W%!16 = 7   |
000018d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000018e0  20 20 20 20 20 3a f4 20  53 65 6e 64 20 52 41 4d  |     :. Send RAM|
000018f0  5f 54 72 61 6e 73 6d 69  74 0d 07 da 1e 20 20 20  |_Transmit....   |
00001900  20 20 20 20 57 25 21 32  34 20 3d 20 52 41 4d 5f  |    W%!24 = RAM_|
00001910  6c 65 6e 67 74 68 25 0d  07 e4 46 20 20 20 20 20  |length%...F     |
00001920  20 20 c8 99 20 22 57 69  6d 70 5f 53 65 6e 64 4d  |  .. "Wimp_SendM|
00001930  65 73 73 61 67 65 22 2c  20 31 37 20 2d 20 28 52  |essage", 17 - (R|
00001940  41 4d 5f 6c 65 6e 67 74  68 25 3d 28 57 25 21 32  |AM_length%=(W%!2|
00001950  34 29 29 2c 20 57 25 2c  20 57 25 21 34 0d 07 ee  |4)), W%, W%!4...|
00001960  3d 20 20 20 20 20 20 20  73 61 76 65 5f 72 65 66  |=       save_ref|
00001970  25 20 3d 20 57 25 21 38  20 20 20 20 20 20 20 20  |% = W%!8        |
00001980  20 20 20 20 20 20 20 20  20 3a f4 20 4d 75 6c 74  |         :. Mult|
00001990  69 2d 6d 65 73 73 61 67  65 73 0d 07 f8 0a 20 20  |i-messages....  |
000019a0  20 20 20 cd 0d 08 02 08  20 20 20 cd 0d 08 0c 06  |   .....   .....|
000019b0  20 cd 0d 08 16 05 e1 0d  08 20 05 3a 0d ff        | ........ .:..|
000019be