Home » Archimedes archive » Archimedes World » AW-1992-08.adf » AWaug92 » !AWaug92/Goodies/WimpGloss/!WimpGloss/Wimp/Windows

!AWaug92/Goodies/WimpGloss/!WimpGloss/Wimp/Windows

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-1992-08.adf » AWaug92
Filename: !AWaug92/Goodies/WimpGloss/!WimpGloss/Wimp/Windows
Read OK:
File size: 0EAE bytes
Load address: 0000
Exec address: 0000
File contents
DEF PROCWimp_WindowAlert(title$,message$)
REM|Opens a window with an OK button and halts the
REM|program until this button has been pressed.
REM|The arguments of the function, title$ and message$
REM|are the title of the window and the message 
REM|displayed respectively.
PROCWimp_WindowAlertBox(title$,message$,0)
ENDPROC
:
DEF PROCWimp_WindowAlertBox(title$,message$,button%)
REM|As for PROCWimp_WindowAlert but more general.
REM|
REM|The values for button% are 1,2,3,4 or 5+.
REM|
REM|
LOCAL response%
$(wimp%+4)=message$
CASE button% OF
 WHEN 2    : response%=1     : REM|...Error Box
 WHEN 1    : response%=15    : REM|...OK and CANCEL butons
 WHEN 3    : response%=(1<<5)+16
 WHEN 4    : response%=(1<<6)+16
 OTHERWISE : response%=16    : REM|...OK button only
ENDCASE
SYS "Wimp_ReportError",wimp%,response%,title$ TO ,response%
ENDPROC
:
DEF FNWimp_WindowCancel(title$,message$)
REM|A call to this function produces a standard 
REM|"cancel" box on the screen.
REM|If "OK" is pressed the function takes the value
REM|TRUE, otherwise pressing "cancel" gives the value 
REM|FALSE .
$(wimp%+4)=message$
response%=23
SYS "Wimp_ReportError",wimp%,response%,title$ TO ,response%
=response%-2
:
DEF PROCWimp_WindowErrorBox(title$,message$)
REM|This produces a standard "error" box with an "OK"
REM|button.
REM|
REM|The string denoted by message$ is displayed. The 
REM|window has a title "Error from "+title$.
PROCWimp_WindowAlertBox(title$,message$,2)
ENDPROC
:
DEF FNWimp_WindowTitle(window%)
REM The value returned by this function is the string
REM containing the window's title. E.g. 
REM     "Wimp Procedure Library : Glossary"    
REM The argument, window%, is the handle of the window
REM whose title is desired.       
wimp%!0=window%
SYS "Wimp_GetWindInfo",,wimp%
IF ((wimp%!60)AND&100)=0 ERROR 1,"Title isn't indirected"
=$(wimp%!76)
:
DEF FNWimp_WindowLoad( window$)
REM The value returned by this function is the handle
REM of the window specified by the string, window$.
REM E.g. Info_Window%=FNWimp_WindowLoad("Info")
REM loads window "Info" from the templates file.
REM The window is loaded from <Obey$Dir>.Templates.
=FNWimp_WindowLoadFrom(window$,"<Obey$Dir>.Templates"
"
DEF FNWimp_WindowLoadFrom(window$,template$)
REM This has the same effect as the previous function.
REM It loads the window given by window$, but from the
REM templates file specified by pathname$. E.g. 
REM   x%=FNWimp_WindowLoadFrom("Info","$.Templates")
REM The value returned is the window's handle.
LOCAL c%,end%  : end%=icons%+icon_memory%
SYS "Wimp_OpenTemplate",,template$
SYS "Wimp_LoadTemplate",,wimp%,icons%,end%,-1,window$,0 TO ,,icons%
IF sprites%<>0 THEN wimp%!64=sprites%
SYS "Wimp_CreateWindow",,wimp% TO c%
SYS "Wimp_CloseTemplate"
=c%
:
DEF PROCWimp_WindowBringToTop(window%)
REM Instructs the task manager to display the window
REM given by the handle window%.
REM 
REM The window is drawn on top of all other windows
REM currently on screen.
!wimp%=window%
SYS "Wimp_GetWindowState",,wimp%
wimp%!28=-1
SYS "Wimp_OpenWindow",,wimp%
ENDPROC
:
DEF PROCWimp_WindowForceDraw(window%)
REM Instructs the task manager to organise a complete
REM redrawing of the window whose handle is given by
REM window%.
REM The redrawing procedure for this window is 
REM provided by the user via an Event_Draw routine.
CASE window% OF
 WHEN -1   : SYS "Wimp_ForceRedraw",-1,0,0,2*1280,2*1024
 OTHERWISE : SYS "Wimp_ForceRedraw",window%,0,-2*1024,2*1280,0
ENDCASE
ENDPROC
:
DEF PROCWimp_WindowOpen(window%)
REM Instructs the task manager to add the window whose
REM handle is given by window% to the list of those
REM active windows which are to be displayed.
REM 
REM 
!wimp%=window%
SYS "Wimp_GetWindowState",,wimp%
SYS "Wimp_OpenWindow",,wimp%
ENDPROC
              
00000000  44 45 46 20 50 52 4f 43  57 69 6d 70 5f 57 69 6e  |DEF PROCWimp_Win|
00000010  64 6f 77 41 6c 65 72 74  28 74 69 74 6c 65 24 2c  |dowAlert(title$,|
00000020  6d 65 73 73 61 67 65 24  29 0a 52 45 4d 7c 4f 70  |message$).REM|Op|
00000030  65 6e 73 20 61 20 77 69  6e 64 6f 77 20 77 69 74  |ens a window wit|
00000040  68 20 61 6e 20 4f 4b 20  62 75 74 74 6f 6e 20 61  |h an OK button a|
00000050  6e 64 20 68 61 6c 74 73  20 74 68 65 0a 52 45 4d  |nd halts the.REM|
00000060  7c 70 72 6f 67 72 61 6d  20 75 6e 74 69 6c 20 74  ||program until t|
00000070  68 69 73 20 62 75 74 74  6f 6e 20 68 61 73 20 62  |his button has b|
00000080  65 65 6e 20 70 72 65 73  73 65 64 2e 0a 52 45 4d  |een pressed..REM|
00000090  7c 54 68 65 20 61 72 67  75 6d 65 6e 74 73 20 6f  ||The arguments o|
000000a0  66 20 74 68 65 20 66 75  6e 63 74 69 6f 6e 2c 20  |f the function, |
000000b0  74 69 74 6c 65 24 20 61  6e 64 20 6d 65 73 73 61  |title$ and messa|
000000c0  67 65 24 0a 52 45 4d 7c  61 72 65 20 74 68 65 20  |ge$.REM|are the |
000000d0  74 69 74 6c 65 20 6f 66  20 74 68 65 20 77 69 6e  |title of the win|
000000e0  64 6f 77 20 61 6e 64 20  74 68 65 20 6d 65 73 73  |dow and the mess|
000000f0  61 67 65 20 0a 52 45 4d  7c 64 69 73 70 6c 61 79  |age .REM|display|
00000100  65 64 20 72 65 73 70 65  63 74 69 76 65 6c 79 2e  |ed respectively.|
00000110  0a 50 52 4f 43 57 69 6d  70 5f 57 69 6e 64 6f 77  |.PROCWimp_Window|
00000120  41 6c 65 72 74 42 6f 78  28 74 69 74 6c 65 24 2c  |AlertBox(title$,|
00000130  6d 65 73 73 61 67 65 24  2c 30 29 0a 45 4e 44 50  |message$,0).ENDP|
00000140  52 4f 43 0a 3a 0a 44 45  46 20 50 52 4f 43 57 69  |ROC.:.DEF PROCWi|
00000150  6d 70 5f 57 69 6e 64 6f  77 41 6c 65 72 74 42 6f  |mp_WindowAlertBo|
00000160  78 28 74 69 74 6c 65 24  2c 6d 65 73 73 61 67 65  |x(title$,message|
00000170  24 2c 62 75 74 74 6f 6e  25 29 0a 52 45 4d 7c 41  |$,button%).REM|A|
00000180  73 20 66 6f 72 20 50 52  4f 43 57 69 6d 70 5f 57  |s for PROCWimp_W|
00000190  69 6e 64 6f 77 41 6c 65  72 74 20 62 75 74 20 6d  |indowAlert but m|
000001a0  6f 72 65 20 67 65 6e 65  72 61 6c 2e 0a 52 45 4d  |ore general..REM|
000001b0  7c 0a 52 45 4d 7c 54 68  65 20 76 61 6c 75 65 73  ||.REM|The values|
000001c0  20 66 6f 72 20 62 75 74  74 6f 6e 25 20 61 72 65  | for button% are|
000001d0  20 31 2c 32 2c 33 2c 34  20 6f 72 20 35 2b 2e 0a  | 1,2,3,4 or 5+..|
000001e0  52 45 4d 7c 0a 52 45 4d  7c 0a 4c 4f 43 41 4c 20  |REM|.REM|.LOCAL |
000001f0  72 65 73 70 6f 6e 73 65  25 0a 24 28 77 69 6d 70  |response%.$(wimp|
00000200  25 2b 34 29 3d 6d 65 73  73 61 67 65 24 0a 43 41  |%+4)=message$.CA|
00000210  53 45 20 62 75 74 74 6f  6e 25 20 4f 46 0a 20 57  |SE button% OF. W|
00000220  48 45 4e 20 32 20 20 20  20 3a 20 72 65 73 70 6f  |HEN 2    : respo|
00000230  6e 73 65 25 3d 31 20 20  20 20 20 3a 20 52 45 4d  |nse%=1     : REM|
00000240  7c 2e 2e 2e 45 72 72 6f  72 20 42 6f 78 0a 20 57  ||...Error Box. W|
00000250  48 45 4e 20 31 20 20 20  20 3a 20 72 65 73 70 6f  |HEN 1    : respo|
00000260  6e 73 65 25 3d 31 35 20  20 20 20 3a 20 52 45 4d  |nse%=15    : REM|
00000270  7c 2e 2e 2e 4f 4b 20 61  6e 64 20 43 41 4e 43 45  ||...OK and CANCE|
00000280  4c 20 62 75 74 6f 6e 73  0a 20 57 48 45 4e 20 33  |L butons. WHEN 3|
00000290  20 20 20 20 3a 20 72 65  73 70 6f 6e 73 65 25 3d  |    : response%=|
000002a0  28 31 3c 3c 35 29 2b 31  36 0a 20 57 48 45 4e 20  |(1<<5)+16. WHEN |
000002b0  34 20 20 20 20 3a 20 72  65 73 70 6f 6e 73 65 25  |4    : response%|
000002c0  3d 28 31 3c 3c 36 29 2b  31 36 0a 20 4f 54 48 45  |=(1<<6)+16. OTHE|
000002d0  52 57 49 53 45 20 3a 20  72 65 73 70 6f 6e 73 65  |RWISE : response|
000002e0  25 3d 31 36 20 20 20 20  3a 20 52 45 4d 7c 2e 2e  |%=16    : REM|..|
000002f0  2e 4f 4b 20 62 75 74 74  6f 6e 20 6f 6e 6c 79 0a  |.OK button only.|
00000300  45 4e 44 43 41 53 45 0a  53 59 53 20 22 57 69 6d  |ENDCASE.SYS "Wim|
00000310  70 5f 52 65 70 6f 72 74  45 72 72 6f 72 22 2c 77  |p_ReportError",w|
00000320  69 6d 70 25 2c 72 65 73  70 6f 6e 73 65 25 2c 74  |imp%,response%,t|
00000330  69 74 6c 65 24 20 54 4f  20 2c 72 65 73 70 6f 6e  |itle$ TO ,respon|
00000340  73 65 25 0a 45 4e 44 50  52 4f 43 0a 3a 0a 44 45  |se%.ENDPROC.:.DE|
00000350  46 20 46 4e 57 69 6d 70  5f 57 69 6e 64 6f 77 43  |F FNWimp_WindowC|
00000360  61 6e 63 65 6c 28 74 69  74 6c 65 24 2c 6d 65 73  |ancel(title$,mes|
00000370  73 61 67 65 24 29 0a 52  45 4d 7c 41 20 63 61 6c  |sage$).REM|A cal|
00000380  6c 20 74 6f 20 74 68 69  73 20 66 75 6e 63 74 69  |l to this functi|
00000390  6f 6e 20 70 72 6f 64 75  63 65 73 20 61 20 73 74  |on produces a st|
000003a0  61 6e 64 61 72 64 20 0a  52 45 4d 7c 22 63 61 6e  |andard .REM|"can|
000003b0  63 65 6c 22 20 62 6f 78  20 6f 6e 20 74 68 65 20  |cel" box on the |
000003c0  73 63 72 65 65 6e 2e 0a  52 45 4d 7c 49 66 20 22  |screen..REM|If "|
000003d0  4f 4b 22 20 69 73 20 70  72 65 73 73 65 64 20 74  |OK" is pressed t|
000003e0  68 65 20 66 75 6e 63 74  69 6f 6e 20 74 61 6b 65  |he function take|
000003f0  73 20 74 68 65 20 76 61  6c 75 65 0a 52 45 4d 7c  |s the value.REM||
00000400  54 52 55 45 2c 20 6f 74  68 65 72 77 69 73 65 20  |TRUE, otherwise |
00000410  70 72 65 73 73 69 6e 67  20 22 63 61 6e 63 65 6c  |pressing "cancel|
00000420  22 20 67 69 76 65 73 20  74 68 65 20 76 61 6c 75  |" gives the valu|
00000430  65 20 0a 52 45 4d 7c 46  41 4c 53 45 20 2e 0a 24  |e .REM|FALSE ..$|
00000440  28 77 69 6d 70 25 2b 34  29 3d 6d 65 73 73 61 67  |(wimp%+4)=messag|
00000450  65 24 0a 72 65 73 70 6f  6e 73 65 25 3d 32 33 0a  |e$.response%=23.|
00000460  53 59 53 20 22 57 69 6d  70 5f 52 65 70 6f 72 74  |SYS "Wimp_Report|
00000470  45 72 72 6f 72 22 2c 77  69 6d 70 25 2c 72 65 73  |Error",wimp%,res|
00000480  70 6f 6e 73 65 25 2c 74  69 74 6c 65 24 20 54 4f  |ponse%,title$ TO|
00000490  20 2c 72 65 73 70 6f 6e  73 65 25 0a 3d 72 65 73  | ,response%.=res|
000004a0  70 6f 6e 73 65 25 2d 32  0a 3a 0a 44 45 46 20 50  |ponse%-2.:.DEF P|
000004b0  52 4f 43 57 69 6d 70 5f  57 69 6e 64 6f 77 45 72  |ROCWimp_WindowEr|
000004c0  72 6f 72 42 6f 78 28 74  69 74 6c 65 24 2c 6d 65  |rorBox(title$,me|
000004d0  73 73 61 67 65 24 29 0a  52 45 4d 7c 54 68 69 73  |ssage$).REM|This|
000004e0  20 70 72 6f 64 75 63 65  73 20 61 20 73 74 61 6e  | produces a stan|
000004f0  64 61 72 64 20 22 65 72  72 6f 72 22 20 62 6f 78  |dard "error" box|
00000500  20 77 69 74 68 20 61 6e  20 22 4f 4b 22 0a 52 45  | with an "OK".RE|
00000510  4d 7c 62 75 74 74 6f 6e  2e 0a 52 45 4d 7c 0a 52  |M|button..REM|.R|
00000520  45 4d 7c 54 68 65 20 73  74 72 69 6e 67 20 64 65  |EM|The string de|
00000530  6e 6f 74 65 64 20 62 79  20 6d 65 73 73 61 67 65  |noted by message|
00000540  24 20 69 73 20 64 69 73  70 6c 61 79 65 64 2e 20  |$ is displayed. |
00000550  54 68 65 20 0a 52 45 4d  7c 77 69 6e 64 6f 77 20  |The .REM|window |
00000560  68 61 73 20 61 20 74 69  74 6c 65 20 22 45 72 72  |has a title "Err|
00000570  6f 72 20 66 72 6f 6d 20  22 2b 74 69 74 6c 65 24  |or from "+title$|
00000580  2e 0a 50 52 4f 43 57 69  6d 70 5f 57 69 6e 64 6f  |..PROCWimp_Windo|
00000590  77 41 6c 65 72 74 42 6f  78 28 74 69 74 6c 65 24  |wAlertBox(title$|
000005a0  2c 6d 65 73 73 61 67 65  24 2c 32 29 0a 45 4e 44  |,message$,2).END|
000005b0  50 52 4f 43 0a 3a 0a 44  45 46 20 46 4e 57 69 6d  |PROC.:.DEF FNWim|
000005c0  70 5f 57 69 6e 64 6f 77  54 69 74 6c 65 28 77 69  |p_WindowTitle(wi|
000005d0  6e 64 6f 77 25 29 0a 52  45 4d 20 54 68 65 20 76  |ndow%).REM The v|
000005e0  61 6c 75 65 20 72 65 74  75 72 6e 65 64 20 62 79  |alue returned by|
000005f0  20 74 68 69 73 20 66 75  6e 63 74 69 6f 6e 20 69  | this function i|
00000600  73 20 74 68 65 20 73 74  72 69 6e 67 0a 52 45 4d  |s the string.REM|
00000610  20 63 6f 6e 74 61 69 6e  69 6e 67 20 74 68 65 20  | containing the |
00000620  77 69 6e 64 6f 77 27 73  20 74 69 74 6c 65 2e 20  |window's title. |
00000630  45 2e 67 2e 20 0a 52 45  4d 20 20 20 20 20 22 57  |E.g. .REM     "W|
00000640  69 6d 70 20 50 72 6f 63  65 64 75 72 65 20 4c 69  |imp Procedure Li|
00000650  62 72 61 72 79 20 3a 20  47 6c 6f 73 73 61 72 79  |brary : Glossary|
00000660  22 20 20 20 20 0a 52 45  4d 20 54 68 65 20 61 72  |"    .REM The ar|
00000670  67 75 6d 65 6e 74 2c 20  77 69 6e 64 6f 77 25 2c  |gument, window%,|
00000680  20 69 73 20 74 68 65 20  68 61 6e 64 6c 65 20 6f  | is the handle o|
00000690  66 20 74 68 65 20 77 69  6e 64 6f 77 0a 52 45 4d  |f the window.REM|
000006a0  20 77 68 6f 73 65 20 74  69 74 6c 65 20 69 73 20  | whose title is |
000006b0  64 65 73 69 72 65 64 2e  20 20 20 20 20 20 20 0a  |desired.       .|
000006c0  77 69 6d 70 25 21 30 3d  77 69 6e 64 6f 77 25 0a  |wimp%!0=window%.|
000006d0  53 59 53 20 22 57 69 6d  70 5f 47 65 74 57 69 6e  |SYS "Wimp_GetWin|
000006e0  64 49 6e 66 6f 22 2c 2c  77 69 6d 70 25 0a 49 46  |dInfo",,wimp%.IF|
000006f0  20 28 28 77 69 6d 70 25  21 36 30 29 41 4e 44 26  | ((wimp%!60)AND&|
00000700  31 30 30 29 3d 30 20 45  52 52 4f 52 20 31 2c 22  |100)=0 ERROR 1,"|
00000710  54 69 74 6c 65 20 69 73  6e 27 74 20 69 6e 64 69  |Title isn't indi|
00000720  72 65 63 74 65 64 22 0a  3d 24 28 77 69 6d 70 25  |rected".=$(wimp%|
00000730  21 37 36 29 0a 3a 0a 44  45 46 20 46 4e 57 69 6d  |!76).:.DEF FNWim|
00000740  70 5f 57 69 6e 64 6f 77  4c 6f 61 64 28 20 77 69  |p_WindowLoad( wi|
00000750  6e 64 6f 77 24 29 0a 52  45 4d 20 54 68 65 20 76  |ndow$).REM The v|
00000760  61 6c 75 65 20 72 65 74  75 72 6e 65 64 20 62 79  |alue returned by|
00000770  20 74 68 69 73 20 66 75  6e 63 74 69 6f 6e 20 69  | this function i|
00000780  73 20 74 68 65 20 68 61  6e 64 6c 65 0a 52 45 4d  |s the handle.REM|
00000790  20 6f 66 20 74 68 65 20  77 69 6e 64 6f 77 20 73  | of the window s|
000007a0  70 65 63 69 66 69 65 64  20 62 79 20 74 68 65 20  |pecified by the |
000007b0  73 74 72 69 6e 67 2c 20  77 69 6e 64 6f 77 24 2e  |string, window$.|
000007c0  0a 52 45 4d 20 45 2e 67  2e 20 49 6e 66 6f 5f 57  |.REM E.g. Info_W|
000007d0  69 6e 64 6f 77 25 3d 46  4e 57 69 6d 70 5f 57 69  |indow%=FNWimp_Wi|
000007e0  6e 64 6f 77 4c 6f 61 64  28 22 49 6e 66 6f 22 29  |ndowLoad("Info")|
000007f0  0a 52 45 4d 20 6c 6f 61  64 73 20 77 69 6e 64 6f  |.REM loads windo|
00000800  77 20 22 49 6e 66 6f 22  20 66 72 6f 6d 20 74 68  |w "Info" from th|
00000810  65 20 74 65 6d 70 6c 61  74 65 73 20 66 69 6c 65  |e templates file|
00000820  2e 0a 52 45 4d 20 54 68  65 20 77 69 6e 64 6f 77  |..REM The window|
00000830  20 69 73 20 6c 6f 61 64  65 64 20 66 72 6f 6d 20  | is loaded from |
00000840  3c 4f 62 65 79 24 44 69  72 3e 2e 54 65 6d 70 6c  |<Obey$Dir>.Templ|
00000850  61 74 65 73 2e 0a 3d 46  4e 57 69 6d 70 5f 57 69  |ates..=FNWimp_Wi|
00000860  6e 64 6f 77 4c 6f 61 64  46 72 6f 6d 28 77 69 6e  |ndowLoadFrom(win|
00000870  64 6f 77 24 2c 22 3c 4f  62 65 79 24 44 69 72 3e  |dow$,"<Obey$Dir>|
00000880  2e 54 65 6d 70 6c 61 74  65 73 22 0a 22 0a 44 45  |.Templates".".DE|
00000890  46 20 46 4e 57 69 6d 70  5f 57 69 6e 64 6f 77 4c  |F FNWimp_WindowL|
000008a0  6f 61 64 46 72 6f 6d 28  77 69 6e 64 6f 77 24 2c  |oadFrom(window$,|
000008b0  74 65 6d 70 6c 61 74 65  24 29 0a 52 45 4d 20 54  |template$).REM T|
000008c0  68 69 73 20 68 61 73 20  74 68 65 20 73 61 6d 65  |his has the same|
000008d0  20 65 66 66 65 63 74 20  61 73 20 74 68 65 20 70  | effect as the p|
000008e0  72 65 76 69 6f 75 73 20  66 75 6e 63 74 69 6f 6e  |revious function|
000008f0  2e 0a 52 45 4d 20 49 74  20 6c 6f 61 64 73 20 74  |..REM It loads t|
00000900  68 65 20 77 69 6e 64 6f  77 20 67 69 76 65 6e 20  |he window given |
00000910  62 79 20 77 69 6e 64 6f  77 24 2c 20 62 75 74 20  |by window$, but |
00000920  66 72 6f 6d 20 74 68 65  0a 52 45 4d 20 74 65 6d  |from the.REM tem|
00000930  70 6c 61 74 65 73 20 66  69 6c 65 20 73 70 65 63  |plates file spec|
00000940  69 66 69 65 64 20 62 79  20 70 61 74 68 6e 61 6d  |ified by pathnam|
00000950  65 24 2e 20 45 2e 67 2e  20 0a 52 45 4d 20 20 20  |e$. E.g. .REM   |
00000960  78 25 3d 46 4e 57 69 6d  70 5f 57 69 6e 64 6f 77  |x%=FNWimp_Window|
00000970  4c 6f 61 64 46 72 6f 6d  28 22 49 6e 66 6f 22 2c  |LoadFrom("Info",|
00000980  22 24 2e 54 65 6d 70 6c  61 74 65 73 22 29 0a 52  |"$.Templates").R|
00000990  45 4d 20 54 68 65 20 76  61 6c 75 65 20 72 65 74  |EM The value ret|
000009a0  75 72 6e 65 64 20 69 73  20 74 68 65 20 77 69 6e  |urned is the win|
000009b0  64 6f 77 27 73 20 68 61  6e 64 6c 65 2e 0a 4c 4f  |dow's handle..LO|
000009c0  43 41 4c 20 63 25 2c 65  6e 64 25 20 20 3a 20 65  |CAL c%,end%  : e|
000009d0  6e 64 25 3d 69 63 6f 6e  73 25 2b 69 63 6f 6e 5f  |nd%=icons%+icon_|
000009e0  6d 65 6d 6f 72 79 25 0a  53 59 53 20 22 57 69 6d  |memory%.SYS "Wim|
000009f0  70 5f 4f 70 65 6e 54 65  6d 70 6c 61 74 65 22 2c  |p_OpenTemplate",|
00000a00  2c 74 65 6d 70 6c 61 74  65 24 0a 53 59 53 20 22  |,template$.SYS "|
00000a10  57 69 6d 70 5f 4c 6f 61  64 54 65 6d 70 6c 61 74  |Wimp_LoadTemplat|
00000a20  65 22 2c 2c 77 69 6d 70  25 2c 69 63 6f 6e 73 25  |e",,wimp%,icons%|
00000a30  2c 65 6e 64 25 2c 2d 31  2c 77 69 6e 64 6f 77 24  |,end%,-1,window$|
00000a40  2c 30 20 54 4f 20 2c 2c  69 63 6f 6e 73 25 0a 49  |,0 TO ,,icons%.I|
00000a50  46 20 73 70 72 69 74 65  73 25 3c 3e 30 20 54 48  |F sprites%<>0 TH|
00000a60  45 4e 20 77 69 6d 70 25  21 36 34 3d 73 70 72 69  |EN wimp%!64=spri|
00000a70  74 65 73 25 0a 53 59 53  20 22 57 69 6d 70 5f 43  |tes%.SYS "Wimp_C|
00000a80  72 65 61 74 65 57 69 6e  64 6f 77 22 2c 2c 77 69  |reateWindow",,wi|
00000a90  6d 70 25 20 54 4f 20 63  25 0a 53 59 53 20 22 57  |mp% TO c%.SYS "W|
00000aa0  69 6d 70 5f 43 6c 6f 73  65 54 65 6d 70 6c 61 74  |imp_CloseTemplat|
00000ab0  65 22 0a 3d 63 25 0a 3a  0a 44 45 46 20 50 52 4f  |e".=c%.:.DEF PRO|
00000ac0  43 57 69 6d 70 5f 57 69  6e 64 6f 77 42 72 69 6e  |CWimp_WindowBrin|
00000ad0  67 54 6f 54 6f 70 28 77  69 6e 64 6f 77 25 29 0a  |gToTop(window%).|
00000ae0  52 45 4d 20 49 6e 73 74  72 75 63 74 73 20 74 68  |REM Instructs th|
00000af0  65 20 74 61 73 6b 20 6d  61 6e 61 67 65 72 20 74  |e task manager t|
00000b00  6f 20 64 69 73 70 6c 61  79 20 74 68 65 20 77 69  |o display the wi|
00000b10  6e 64 6f 77 0a 52 45 4d  20 67 69 76 65 6e 20 62  |ndow.REM given b|
00000b20  79 20 74 68 65 20 68 61  6e 64 6c 65 20 77 69 6e  |y the handle win|
00000b30  64 6f 77 25 2e 0a 52 45  4d 20 0a 52 45 4d 20 54  |dow%..REM .REM T|
00000b40  68 65 20 77 69 6e 64 6f  77 20 69 73 20 64 72 61  |he window is dra|
00000b50  77 6e 20 6f 6e 20 74 6f  70 20 6f 66 20 61 6c 6c  |wn on top of all|
00000b60  20 6f 74 68 65 72 20 77  69 6e 64 6f 77 73 0a 52  | other windows.R|
00000b70  45 4d 20 63 75 72 72 65  6e 74 6c 79 20 6f 6e 20  |EM currently on |
00000b80  73 63 72 65 65 6e 2e 0a  21 77 69 6d 70 25 3d 77  |screen..!wimp%=w|
00000b90  69 6e 64 6f 77 25 0a 53  59 53 20 22 57 69 6d 70  |indow%.SYS "Wimp|
00000ba0  5f 47 65 74 57 69 6e 64  6f 77 53 74 61 74 65 22  |_GetWindowState"|
00000bb0  2c 2c 77 69 6d 70 25 0a  77 69 6d 70 25 21 32 38  |,,wimp%.wimp%!28|
00000bc0  3d 2d 31 0a 53 59 53 20  22 57 69 6d 70 5f 4f 70  |=-1.SYS "Wimp_Op|
00000bd0  65 6e 57 69 6e 64 6f 77  22 2c 2c 77 69 6d 70 25  |enWindow",,wimp%|
00000be0  0a 45 4e 44 50 52 4f 43  0a 3a 0a 44 45 46 20 50  |.ENDPROC.:.DEF P|
00000bf0  52 4f 43 57 69 6d 70 5f  57 69 6e 64 6f 77 46 6f  |ROCWimp_WindowFo|
00000c00  72 63 65 44 72 61 77 28  77 69 6e 64 6f 77 25 29  |rceDraw(window%)|
00000c10  0a 52 45 4d 20 49 6e 73  74 72 75 63 74 73 20 74  |.REM Instructs t|
00000c20  68 65 20 74 61 73 6b 20  6d 61 6e 61 67 65 72 20  |he task manager |
00000c30  74 6f 20 6f 72 67 61 6e  69 73 65 20 61 20 63 6f  |to organise a co|
00000c40  6d 70 6c 65 74 65 0a 52  45 4d 20 72 65 64 72 61  |mplete.REM redra|
00000c50  77 69 6e 67 20 6f 66 20  74 68 65 20 77 69 6e 64  |wing of the wind|
00000c60  6f 77 20 77 68 6f 73 65  20 68 61 6e 64 6c 65 20  |ow whose handle |
00000c70  69 73 20 67 69 76 65 6e  20 62 79 0a 52 45 4d 20  |is given by.REM |
00000c80  77 69 6e 64 6f 77 25 2e  0a 52 45 4d 20 54 68 65  |window%..REM The|
00000c90  20 72 65 64 72 61 77 69  6e 67 20 70 72 6f 63 65  | redrawing proce|
00000ca0  64 75 72 65 20 66 6f 72  20 74 68 69 73 20 77 69  |dure for this wi|
00000cb0  6e 64 6f 77 20 69 73 20  0a 52 45 4d 20 70 72 6f  |ndow is .REM pro|
00000cc0  76 69 64 65 64 20 62 79  20 74 68 65 20 75 73 65  |vided by the use|
00000cd0  72 20 76 69 61 20 61 6e  20 45 76 65 6e 74 5f 44  |r via an Event_D|
00000ce0  72 61 77 20 72 6f 75 74  69 6e 65 2e 0a 43 41 53  |raw routine..CAS|
00000cf0  45 20 77 69 6e 64 6f 77  25 20 4f 46 0a 20 57 48  |E window% OF. WH|
00000d00  45 4e 20 2d 31 20 20 20  3a 20 53 59 53 20 22 57  |EN -1   : SYS "W|
00000d10  69 6d 70 5f 46 6f 72 63  65 52 65 64 72 61 77 22  |imp_ForceRedraw"|
00000d20  2c 2d 31 2c 30 2c 30 2c  32 2a 31 32 38 30 2c 32  |,-1,0,0,2*1280,2|
00000d30  2a 31 30 32 34 0a 20 4f  54 48 45 52 57 49 53 45  |*1024. OTHERWISE|
00000d40  20 3a 20 53 59 53 20 22  57 69 6d 70 5f 46 6f 72  | : SYS "Wimp_For|
00000d50  63 65 52 65 64 72 61 77  22 2c 77 69 6e 64 6f 77  |ceRedraw",window|
00000d60  25 2c 30 2c 2d 32 2a 31  30 32 34 2c 32 2a 31 32  |%,0,-2*1024,2*12|
00000d70  38 30 2c 30 0a 45 4e 44  43 41 53 45 0a 45 4e 44  |80,0.ENDCASE.END|
00000d80  50 52 4f 43 0a 3a 0a 44  45 46 20 50 52 4f 43 57  |PROC.:.DEF PROCW|
00000d90  69 6d 70 5f 57 69 6e 64  6f 77 4f 70 65 6e 28 77  |imp_WindowOpen(w|
00000da0  69 6e 64 6f 77 25 29 0a  52 45 4d 20 49 6e 73 74  |indow%).REM Inst|
00000db0  72 75 63 74 73 20 74 68  65 20 74 61 73 6b 20 6d  |ructs the task m|
00000dc0  61 6e 61 67 65 72 20 74  6f 20 61 64 64 20 74 68  |anager to add th|
00000dd0  65 20 77 69 6e 64 6f 77  20 77 68 6f 73 65 0a 52  |e window whose.R|
00000de0  45 4d 20 68 61 6e 64 6c  65 20 69 73 20 67 69 76  |EM handle is giv|
00000df0  65 6e 20 62 79 20 77 69  6e 64 6f 77 25 20 74 6f  |en by window% to|
00000e00  20 74 68 65 20 6c 69 73  74 20 6f 66 20 74 68 6f  | the list of tho|
00000e10  73 65 0a 52 45 4d 20 61  63 74 69 76 65 20 77 69  |se.REM active wi|
00000e20  6e 64 6f 77 73 20 77 68  69 63 68 20 61 72 65 20  |ndows which are |
00000e30  74 6f 20 62 65 20 64 69  73 70 6c 61 79 65 64 2e  |to be displayed.|
00000e40  0a 52 45 4d 20 0a 52 45  4d 20 0a 21 77 69 6d 70  |.REM .REM .!wimp|
00000e50  25 3d 77 69 6e 64 6f 77  25 0a 53 59 53 20 22 57  |%=window%.SYS "W|
00000e60  69 6d 70 5f 47 65 74 57  69 6e 64 6f 77 53 74 61  |imp_GetWindowSta|
00000e70  74 65 22 2c 2c 77 69 6d  70 25 0a 53 59 53 20 22  |te",,wimp%.SYS "|
00000e80  57 69 6d 70 5f 4f 70 65  6e 57 69 6e 64 6f 77 22  |Wimp_OpenWindow"|
00000e90  2c 2c 77 69 6d 70 25 0a  45 4e 44 50 52 4f 43 0a  |,,wimp%.ENDPROC.|
00000ea0  20 20 20 20 20 20 20 20  20 20 20 20 20 20        |              |
00000eae