Home » Archimedes archive » Acorn User » AU 1993-10.adf » !OmniDesk_OmniDesk » !OmniDesk/Utilities/!CloseView/!RunImage

!OmniDesk/Utilities/!CloseView/!RunImage

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

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

Tape/disk: Home » Archimedes archive » Acorn User » AU 1993-10.adf » !OmniDesk_OmniDesk
Filename: !OmniDesk/Utilities/!CloseView/!RunImage
Read OK:
File size: 8207 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >!RunImage for CloseView
   20:
   30VersionNumber$="1�04 (31 July 1993)":Taskname$="CloseView�Magnifier"
   40Exit=FALSE:Startup=FALSE:Done=FALSE
   50DoModeChange=FALSE
   60:
   70DIM Block 256,MenuHelp 16,Scale 16,Border 4
   80IndMenuMax=64:DIM IndirectMenuText IndMenuMax
   90DIM Templates 1632,InfoInd 202,MagnifierInd 20,ZoomInd 104,LocInd 592
  100DIM IBMenu 76,MainMenu 124
  110:
  120REM Messages used by the OmniDesk suite:
  130UtilDeclare=&825C0:UtilOpen=&825C1:UtilQuitting=&825C2:UtilReside=&825C3:UtilAckLoad=&825C4
  140REM These are official Acorn allocations.
  150:
  160ON ERROR Block!0=ERR:$(Block+4)=REPORT$+" (internal error code "+STR$(ERL)+")"+CHR$0:SYS "Wimp_ReportError",Block,1,Taskname$:END
  170:
  180OmniDesk=FNReadStartupString:REM Also assigns Exit and Startup
  190:
  200*Set CloseView$RISCOS 3
  210*RMEnsure UtilityModule 3.00 Set CloseView$RISCOS 2
  220SYS "XOS_ReadVarVal","CloseView$RISCOS",Block,256,0,0 TO ,,len:Block?len=13:wimp$=$Block
  230IF wimp$<>"3" THEN wimp$="2"
  240*Unset CloseView$RISCOS
  250SYS "XOS_ReadVarVal","Obey$Dir",Block,256,0,0 TO ,,len:Block?len=13:OurFileName$=$Block
  260N=-1:REPEAT:N+=1:UNTIL MID$(OurFileName$,LEN(OurFileName$)-N,1)="."
  270OurPathName$=LEFT$(OurFileName$,LEN(OurFileName$)-N):OurFileName$=RIGHT$(OurFileName$,N)
  280:
  290REM Read size of sprite file and load it. We need to DIM 16 bytes more than the file's size.
  300SYS "OS_FSControl",28,"<CloseView$Dir>.Sprites" TO ,,len
  310DIM Sprites len+16:!Sprites=len+16:Sprites!4=0:Sprites!8=16:Sprites!12=16:SYS "OS_SpriteOp",256+10,Sprites,"<CloseView$Dir>.Sprites"
  320:
  330IF wimp$="3" THEN
  340  DIM messagelist% 28
  350  messagelist%!0=&502:messagelist%!4=&400C1
  360  messagelist%!8=UtilOpen:messagelist%!12=UtilQuitting
  370  messagelist%!16=UtilReside:messagelist%!20=10:messagelist%!24=0
  380  SYS "Wimp_Initialise",300,&4B534154,Taskname$,messagelist% TO wimp,Task
  390ELSE
  400  SYS "Wimp_Initialise",200,&4B534154,Taskname$ TO wimp,Task
  410ENDIF
  420:
  430SYS "Interface_Initialise",Task
  440:
  450SYS "Wimp_OpenTemplate",,"<CloseView$Dir>.Templates"
  460SYS "Wimp_LoadTemplate",,Templates,InfoInd,InfoInd+202,-1,"Info",0
  470SYS "Wimp_CreateWindow",,Templates TO Info
  480SYS "Wimp_LoadTemplate",,Templates,MagnifierInd,MagnifierInd+20,-1,"Magnifier",0
  490SYS "Wimp_CreateWindow",,Templates TO Magnifier
  500SYS "Wimp_LoadTemplate",,Templates,LocInd,LocInd+592,-1,"WindowXY",0:Templates!64=Sprites
  510SYS "Wimp_CreateWindow",,Templates TO Loc
  520SYS "Wimp_LoadTemplate",,Templates,ZoomInd,ZoomInd+104,-1,"Zoom",0:Templates!64=Sprites
  530SYS "Wimp_CreateWindow",,Templates TO Zoom
  540SYS "Wimp_CloseTemplate"
  550:
  560PROCBuildMenus
  570MagError=FALSE
  580:
  590IF OmniDesk=0 THEN
  600  REM Put Icon on the icon-bar
  610  Block!0=-1
  620  Block!4=0:Block!8=0:Block!12=68:Block!16=68
  630  Block!20=&17003002:$(Block+24)="!CloseView"+CHR$13
  640  SYS "Wimp_CreateIcon",,Block TO IconBar
  650ENDIF
  660:
  670PROCInitialise
  680IF OmniDesk<>0 THEN PROCDeclareToOmniDesk
  690IF Startup THEN Done=TRUE:REM '-Startup' parameter means 'declare and die immediately'.
  700:
  710PROCUpdateIcon(Info,3,VersionNumber$)
  720PROCModeChange:REM To update icon-bar icon if necessary
  730PROCCleanUpLocWindow
  740:
  750ReadError=NOT(FNLoadSettings)
  760:
  770ON ERROR PROCError
  780IF ReadError THEN ReadError=FALSE:PROCDefaultSettings:ERROR 9999,"An error occurred whilst reading the settings file. Default settings will therefore be used."
  790:
  800REM Main program loop
  810REPEAT
  820  SYS "Wimp_Poll",%1100000110000,Block TO Reason
  830  SYS "Interface_Poll",Reason,,Task
  840  SYS "Interface_PreProcessKey",Reason,Block,Task
  850  CASE Reason OF
  860    WHEN 0 : IF FNOpenState(Magnifier) THEN PROCDoMag
  870             IF DoModeChange THEN IF FNOpenState(Magnifier) THEN PROCOpen(Magnifier,FALSE,XPosition,YPosition)
  880    WHEN 1 : PROCRedraw
  890    WHEN 2 : SYS "Wimp_OpenWindow",,Block
  900    WHEN 3 : SYS "Wimp_CloseWindow",,Block:IF Block!0=Magnifier THEN PROCMinimiseWimpSlot
  910             REM Forget the sprite and release the memory if we don't need it.
  920             IF Exit THEN Done=TRUE
  930    WHEN 6 : PROCMouseButton
  940    WHEN 8 : PROCKeyPressed
  950    WHEN 9 : PROCDecodeMenu
  960    WHEN 17,18,19 : PROCRecieveMessage
  970  ENDCASE
  980UNTIL Done
  990PROCSayGoodbye
 1000SYS "Interface_CloseDown",Task
 1010SYS "Wimp_CloseDown",Task,&4B534154
 1020END
 1030:
 1040DEF PROCError
 1050Click=0:Block!0=ERR:CASE ERR OF
 1060  WHEN 9999:REM Custom error
 1070    $(Block+4)=REPORT$+CHR$0
 1080    SYS "Wimp_ReportError",Block,17,"Notice from CloseView"
 1090  OTHERWISE
 1100    $(Block+4)=REPORT$+" (internal error code "+STR$ERL+"). Click on OK to continue, or Cancel to terminate the program."+CHR$0
 1110    SYS "Wimp_ReportError",Block,3,Taskname$ TO ,Click
 1120ENDCASE
 1130IF Click=2 THEN PROCSayGoodbye:SYS "Interface_CloseDown",Task:SYS "Wimp_CloseDown",Task,&4B534154:END
 1140ENDPROC
 1150:
 1160DEF PROCOpen(WindowHandle,TopOfStack,across,up)
 1170Block!0=WindowHandle
 1180SYS "Wimp_GetWindowState",,Block
 1190IF (across<>-1) AND (across<>-1) THEN PROCDecideWindowPosition(Block,across,up)
 1200IF TopOfStack THEN Block!28=-1
 1210SYS "Wimp_OpenWindow",,Block
 1220ENDPROC
 1230:
 1240DEF PROCClose(WindowHandle)
 1250Block!0=WindowHandle
 1260SYS "Wimp_GetWindowState",,Block
 1270SYS "Wimp_CloseWindow",,Block
 1280ENDPROC
 1290:
 1300DEF PROCDecideWindowPosition(Block,across,up)
 1310REM Use of this procedure lets you open windows on an invisible grid which
 1320REM automatically fits itself to the screen mode in use. There are five
 1330REM positions across (left, mid-left, centre, mid-right, right) and five
 1340REM positions up (bottom of screen, above icon-bar, centre of screen,
 1350REM centre top of screen, top of screen).
 1360  :
 1370Xpixels=FNModeInfo("XPixels",-1):Ypixels=FNModeInfo("YPixels",-1)
 1380XEigFactor=FNModeInfo("XEigFactor",-1):YEigFactor=FNModeInfo("YEigFactor",-1)
 1390  :
 1400top=Block!16:right=Block!12:bot=Block!8:left=Block!4
 1410SYS "Wimp_OpenWindow",,Block:SYS "Wimp_GetWindowOutline",,Block
 1420TB=((Block!16)-top)/(2^YEigFactor)
 1430VS=((Block!12)-right)/(2^XEigFactor)
 1440HS=(bot-(Block!8))/(2^YEigFactor)
 1450LP=(left-(Block!4))/(2^XEigFactor)
 1460REM LP is Left Pixel: normally present, but not if window is transparent.
 1470width=(right-left)/(2^XEigFactor)
 1480height=(top-bot)/(2^YEigFactor)
 1490CASE across OF
 1500  WHEN 0:x=LP
 1510  WHEN 1:x=LP+((Xpixels+1)-(width+LP+VS))/4
 1520  WHEN 2:x=LP+((Xpixels+1)-(width+LP+VS))/2
 1530  WHEN 3:x=LP+(3*(((Xpixels+1)-(width+LP+VS))/4))
 1540  WHEN 4:x=(Xpixels+1)-(width+VS)
 1550ENDCASE
 1560CASE up OF
 1570  WHEN 0:y=HS
 1580  WHEN 1:y=HS+(132/(2^YEigFactor))
 1590  WHEN 2:y=HS+((Ypixels+1)-(height+TB+HS))/2
 1600  WHEN 3:y=HS+(3*(((Ypixels+1)-(height+TB+HS))/4))
 1610  WHEN 4:y=(Ypixels+1)-(height+TB)
 1620ENDCASE
 1630REM Above coordinates position window.
 1640REM Now convert to screen coordinates:
 1650x=x*(2^XEigFactor):y=y*(2^YEigFactor)
 1660width=width*(2^XEigFactor):height=height*(2^YEigFactor)
 1670Block!12=x+width:Block!4=x
 1680Block!16=y+height:Block!8=y
 1690ENDPROC
 1700:
 1710REM -------------------------------------------------------------------------
 1720REM Wimp poll routines
 1730REM -------------------------------------------------------------------------
 1740:
 1750DEF PROCRedraw
 1760IF DoModeChange THEN
 1770  REM Re-opening windows need an extra wimp_poll to happen after the mode change in order to work:
 1780  IF FNOpenState(Magnifier) THEN PROCOpen(Magnifier,FALSE,XPosition,YPosition)
 1790  DoModeChange=FALSE
 1800ENDIF
 1810CASE Block!0 OF
 1820  WHEN Magnifier:
 1830    IF MagError THEN MagError=FALSE:PROCCreateMagSprite
 1840    XEigFactor=FNModeInfo("XEigFactor",-1):YEigFactor=FNModeInfo("YEigFactor",-1)
 1850    SYS "Wimp_RedrawWindow",,Block TO flag%
 1860    WHILE flag%
 1870      SYS "OS_SpriteOp",256+52,SlotEnd,"mag",Block!4-((200*Scale!0)/Scale!8)+202-((Scale!0/Scale!8)*2^XEigFactor)/2,Block!8-((200*Scale!4)/Scale!12)+202-((Scale!4/Scale!12)*2^YEigFactor)/2,0,Scale
 1880      SYS "Wimp_GetRectangle",,Block TO flag%
 1890    ENDWHILE
 1900  OTHERWISE
 1910    SYS "Wimp_RedrawWindow",,Block TO flag%
 1920    WHILE flag%
 1930      SYS "Wimp_BorderWindow",,Block
 1940      SYS "Wimp_GetRectangle",,Block TO flag%
 1950    ENDWHILE
 1960ENDCASE
 1970ENDPROC
 1980:
 1990DEF PROCRecieveMessage
 2000CASE Block!16 OF
 2010  WHEN 0 : Done=TRUE
 2020  WHEN 10: IF OmniDesk=0 THEN PROCSaveDesktop(Block!20)
 2030           REM Only save if we have not been started up by OmniDesk
 2040  WHEN &502 : PROCHelp
 2050  WHEN &400C1 : PROCModeChange
 2060  WHEN UtilOpen : IF $(Block+24)=Taskname$ THEN PROCOmniDeskCalling
 2070  WHEN UtilQuitting : IF OmniDesk<>0 THEN
 2080                        IF Block!20=OmniDesk THEN Done=TRUE
 2090                      ENDIF
 2100  WHEN UtilReside : Exit=FALSE
 2110ENDCASE
 2120ENDPROC
 2130:
 2140DEF PROCMouseButton
 2150MouseX=Block!0:MouseY=Block!4:Buttons=Block!8
 2160Window=Block!12:Icon=Block!16
 2170CASE Window OF
 2180  WHEN -2:REM Icon bar icon clicked
 2190    CASE Buttons OF
 2200      WHEN 1 : REM Adjust
 2210      WHEN 2 : REM Menu
 2220        M%=IBMenu:MenuX=MouseX:MenuY=MouseY:PROCMakeMenu
 2230      WHEN 4 : REM Select
 2240        IF NOT FNOpenState(Magnifier) THEN PROCCreateMagSprite
 2250        PROCOpen(Magnifier,TRUE,XPosition,YPosition)
 2260    ENDCASE
 2270  WHEN Zoom:PROCZoomClick
 2280  WHEN Magnifier
 2290    CASE Buttons OF
 2300      WHEN 1 : REM Adjust
 2310        BlankMag=NOT BlankMag:PROCUpdateSelectedFlag(Zoom,8,NOT BlankMag)
 2320      WHEN 2 : REM Menu
 2330        M%=MainMenu:MenuX=MouseX:MenuY=MouseY
 2340        IF wimp>=310 THEN
 2350          IF LEFT$($MainMenuTitle,1)="\" THEN $MainMenuTitle=RIGHT$($MainMenuTitle,LEN($MainMenuTitle)-1)+CHR$13
 2360          IF XPosition=4 THEN $MainMenuTitle="\"+$MainMenuTitle+CHR$13
 2370        ENDIF
 2380        PROCMakeMenu
 2390      WHEN 4 : REM Select
 2400        XHair=NOT XHair:PROCUpdateSelectedFlag(Zoom,7,XHair)
 2410    ENDCASE
 2420  WHEN Loc AND Buttons<8:REM Reposition main window
 2430    IF Icon>=6 THEN
 2440      XPosition=FNReadWindowLocation("X")
 2450      YPosition=FNReadWindowLocation("Y")
 2460      IF FNOpenState(Magnifier) THEN PROCOpen(Magnifier,FALSE,XPosition,YPosition)
 2470    ENDIF
 2480ENDCASE
 2490ENDPROC
 2500:
 2510DEF PROCZoomClick
 2520CASE Icon OF
 2530  WHEN 2 AND (Buttons=4),3 AND (Buttons=1):
 2540    A=FNReadIcon(Zoom,0)
 2550    IF A<999 THEN A+=1:PROCUpdateIcon(Zoom,0,STR$A)
 2560    B=FNReadIcon(Zoom,1)
 2570    IF A=0 THEN A=1:PROCUpdateIcon(Zoom,0,STR$A)
 2580    IF B=0 THEN B=1:PROCUpdateIcon(Zoom,1,STR$B)
 2590    IF A<B THEN B=A:PROCUpdateIcon(Zoom,1,STR$B)
 2600    Scale!0=A:Scale!4=A:Scale!8=B:Scale!12=B
 2610    SYS "Wimp_SetCaretPosition",Zoom,0,,,-1,LEN(STR$A)
 2620  WHEN 2 AND (Buttons=1),3 AND (Buttons=4):
 2630    A=FNReadIcon(Zoom,0)
 2640    IF A>1 THEN A-=1:PROCUpdateIcon(Zoom,0,STR$A)
 2650    B=FNReadIcon(Zoom,1)
 2660    IF A=0 THEN A=1:PROCUpdateIcon(Zoom,0,STR$A)
 2670    IF B=0 THEN B=1:PROCUpdateIcon(Zoom,1,STR$B)
 2680    IF A<B THEN B=A:PROCUpdateIcon(Zoom,1,STR$B)
 2690    Scale!0=A:Scale!4=A:Scale!8=B:Scale!12=B
 2700    SYS "Wimp_SetCaretPosition",Zoom,0,,,-1,LEN(STR$A)
 2710  WHEN 4 AND (Buttons=4),5 AND (Buttons=1):
 2720    B=FNReadIcon(Zoom,1)
 2730    IF B<999 THEN B+=1:PROCUpdateIcon(Zoom,1,STR$B)
 2740    A=FNReadIcon(Zoom,0)
 2750    IF A=0 THEN A=1:PROCUpdateIcon(Zoom,0,STR$A)
 2760    IF B=0 THEN B=1:PROCUpdateIcon(Zoom,1,STR$B)
 2770    IF A<B THEN A=B:PROCUpdateIcon(Zoom,0,STR$A)
 2780    Scale!0=A:Scale!4=A:Scale!8=B:Scale!12=B
 2790    SYS "Wimp_SetCaretPosition",Zoom,1,,,-1,LEN(STR$B)
 2800  WHEN 4 AND (Buttons=1),5 AND (Buttons=4):
 2810    B=FNReadIcon(Zoom,1)
 2820    IF B>1 THEN B-=1:PROCUpdateIcon(Zoom,1,STR$B)
 2830    A=FNReadIcon(Zoom,0)
 2840    IF A=0 THEN A=1:PROCUpdateIcon(Zoom,0,STR$A)
 2850    IF B=0 THEN B=1:PROCUpdateIcon(Zoom,1,STR$B)
 2860    IF A<B THEN A=B:PROCUpdateIcon(Zoom,0,STR$A)
 2870    Scale!0=A:Scale!4=A:Scale!8=B:Scale!12=B
 2880    SYS "Wimp_SetCaretPosition",Zoom,1,,,-1,LEN(STR$B)
 2890  WHEN 7:
 2900    XHair=FNSelectedState(Zoom,7)
 2910  WHEN 8:
 2920    BlankMag=NOT FNSelectedState(Zoom,8)
 2930ENDCASE
 2940ENDPROC
 2950:
 2960DEF PROCKeyPressed
 2970Window=Block!0:Icon=Block!4:Character=Block!24
 2980CASE Window OF
 2990  WHEN Zoom:
 3000    CASE Character OF
 3010      WHEN &181:REM <F1>
 3020        XHair=NOT XHair:PROCUpdateSelectedFlag(Zoom,7,XHair)
 3030      WHEN &182:REM <F2>
 3040        BlankMag=NOT BlankMag:PROCUpdateSelectedFlag(Zoom,8,NOT BlankMag)
 3050      WHEN &18E,&19E,&1AE,&1BE,&18F,&19F,&1AF,&1BF,13:REM Down,Up,Return
 3060        A=FNReadIcon(Zoom,0):B=FNReadIcon(Zoom,1)
 3070        IF A=0 THEN A=1:PROCUpdateIcon(Zoom,0,STR$A)
 3080        IF B=0 THEN B=1:PROCUpdateIcon(Zoom,1,STR$B)
 3090        IF A<B THEN B=A:PROCUpdateIcon(Zoom,1,STR$B)
 3100        Scale!0=A:Scale!4=A:Scale!8=B:Scale!12=B
 3110        IF Icon=0 THEN Icon=1 ELSE Icon=0
 3120        IF Icon=0 THEN SYS "Wimp_SetCaretPosition",Zoom,Icon,,,-1,LEN(STR$A) ELSE SYS "Wimp_SetCaretPosition",Zoom,Icon,,,-1,LEN(STR$B)
 3130        REM Sets caret to end of current icon
 3140        IF Character=13 AND Icon=0 THEN SYS "Wimp_CreateMenu",,-1
 3150        REM Close window if Return pressed on second icon
 3160      OTHERWISE
 3170        SYS "Wimp_ProcessKey",Character
 3180    ENDCASE
 3190  OTHERWISE
 3200    SYS "Wimp_ProcessKey",Character
 3210ENDCASE
 3220ENDPROC
 3230:
 3240DEF PROCDecodeMenu
 3250Sub0=Block!0:Sub1=Block!4:Sub2=Block!8
 3260CloseMenu=FALSE
 3270CASE M% OF
 3280  WHEN IBMenu:
 3290    CASE Sub0 OF
 3300      WHEN 0
 3310        SYS "Wimp_GetPointerInfo",,Block
 3320        SYS "Wimp_CreateMenu",,Info,Block!0-24,Block!4+24
 3330        CloseMenu=TRUE
 3340      WHEN 1
 3350        Done=TRUE
 3360    ENDCASE
 3370  WHEN MainMenu:
 3380    CASE Sub0 OF
 3390      WHEN 0
 3400        SYS "Wimp_GetPointerInfo",,Block
 3410        SYS "Wimp_CreateMenu",,Info,Block!0-24,Block!4+24
 3420        CloseMenu=TRUE
 3430      WHEN 1
 3440        SYS "Wimp_GetPointerInfo",,Block
 3450        SYS "Wimp_CreateMenu",,Zoom,Block!0-24,Block!4+24
 3460        CloseMenu=TRUE
 3470      WHEN 2
 3480        SYS "Wimp_GetPointerInfo",,Block
 3490        SYS "Wimp_CreateMenu",,Loc,Block!0-24,Block!4+24
 3500        CloseMenu=TRUE
 3510      WHEN 3
 3520        IF NOT FNSaveSettings THEN ERROR 9999,"An error occurred whilst writing the settings file."
 3530    ENDCASE
 3540ENDCASE
 3550SYS "Wimp_GetPointerInfo",,Block
 3560IF ((Block!8 AND 1)=1) AND (NOT CloseMenu) THEN PROCMakeMenu
 3570ENDPROC
 3580:
 3590REM -------------------------------------------------------------------------
 3600REM Menu routines
 3610REM -------------------------------------------------------------------------
 3620:
 3630DEF PROCBuildMenus
 3640REM This procedure should only be visited once, since it contains DIMs.
 3650  :
 3660REM In the menu title strings below, if a "|" character is present it will be
 3670REM replaced by a space under RISC OS 3.1 (or greater), or will terminate the
 3680REM string under earlier versions of the wimp. This allows the new indirected
 3690REM menu titles to be used (which were introduced with RISC OS 3.1).
 3700  :
 3710IndirectMenuTextOffsetPointer=0
 3720REM This points to a pool to be used by all menus for their indirected text.
 3730  :
 3740M%=IBMenu
 3750Title$="CloseView":DIM IBMenuTitle LEN(Title$)+1:$IBMenuTitle=Title$+CHR$13
 3760PROCMenuInit(IBMenuTitle)
 3770PROCMenuItem("Info",0,Info)
 3780PROCMenuItem("Quit",128,-1)
 3790  :
 3800M%=MainMenu
 3810Title$="CloseView|Magnifier":DIM MainMenuTitle LEN(Title$)+2:$MainMenuTitle=Title$+CHR$13
 3820PROCMenuInit(MainMenuTitle)
 3830PROCMenuItem("Info",2,Info)
 3840PROCMenuItem("Magnification etc.",0,Zoom)
 3850PROCMenuItem("Window position",2,Loc)
 3860PROCMenuItem("Save settings",128,-1)
 3870ENDPROC
 3880:
 3890DEF PROCMakeMenu
 3900IF MenuX<0 THEN MenuX=0
 3910IF MenuY<184 THEN MenuY=184:REM for icon bar
 3920SYS "Wimp_CreateMenu",,M%,MenuX-((36+M%!16)/2),MenuY
 3930ENDPROC
 3940:
 3950DEF PROCMenuInit(MenuTitle)
 3960IF wimp>=310 THEN
 3970  A=INSTR($MenuTitle,"|"):IF A<>0 THEN ?(MenuTitle+(A-1))=32
 3980  MenuMax=LEN($MenuTitle)
 3990  M%!0=MenuTitle
 4000ELSE
 4010  A=INSTR($MenuTitle,"|"):IF A<>0 THEN ?(MenuTitle+(A-1))=13
 4020  MenuMax=LEN(LEFT$($MenuTitle,12))
 4030  $M%=LEFT$($MenuTitle,12)
 4040ENDIF
 4050M%?12=7:M%?13=2:M%?14=11:M%?15=0
 4060M%!16=MenuMax*16
 4070M%!20=44:M%!24=0
 4080P%=M%+28
 4090ENDPROC
 4100:
 4110DEF PROCMenuItem(Text$,Flags,Link)
 4120REM Flags: 1-ticked, 2-dashed line, 4-writeable, 8-message, 128-last item
 4130REM Link: menu or window handle for sub-pointer
 4140P%!0=Flags:P%!4=Link
 4150IF LEN(Text$)<=12 THEN
 4160  P%!8=&07003021:REM Not indirected
 4170  $(P%+12)=Text$
 4180ELSE
 4190  P%!8=&07003121:REM Indirected
 4200  P%!12=IndirectMenuText+IndirectMenuTextOffsetPointer
 4210  P%!16=0:P%!20=0
 4220  $(IndirectMenuText+IndirectMenuTextOffsetPointer)=Text$+CHR$13
 4230  IndirectMenuTextOffsetPointer+=LEN(Text$)+1
 4240  IF IndirectMenuTextOffsetPointer>IndMenuMax THEN ERROR 0,"The indirect menu text buffer has overflowed. Please allocate more space."
 4250ENDIF
 4260P%+=24
 4270IF MenuMax<LEN(Text$) THEN MenuMax=LEN(Text$):M%!16=(MenuMax+1)*16
 4280IF (Flags=128) AND (wimp>=310) THEN M%!28=(((M%!28) AND NOT 256) EOR 256)
 4290  REM Indirected menu titles for RISC OS 3.1 upwards.
 4300ENDPROC
 4310:
 4320REM -------------------------------------------------------------------------
 4330REM Responses to incoming wimp messages
 4340REM -------------------------------------------------------------------------
 4350:
 4360DEF PROCSaveDesktop(File)
 4370LOCAL ERROR
 4380ON ERROR LOCAL Block!12=Block!8:SYS "Wimp_SendMessage",19,Block,Block!4:RESTORE ERROR:ENDPROC
 4390REM The above line acknowledges the message if an error occurs, thereby
 4400REM aborting the desktop save.
 4410BPUT#File,"Run "+OurPathName$+OurFileName$
 4420ENDPROC
 4430:
 4440DEF PROCHelp
 4450Block!12=Block!8:Block!16=&503:HelpInfo=Block+20
 4460  :
 4470REM Block!32 gives window, Block!36 gives icon
 4480  :
 4490CASE Block!32 OF
 4500  WHEN -2:PROCSend("This is the CloseView icon.")
 4510          PROCSend("Click MENU for information or to quit.")
 4520          PROCSend("Click SELECT to open the magnifier window.")
 4530  WHEN Magnifier:PROCSend("This is the CloseView Magnifier window.")
 4540                 PROCSend("Click MENU for the main menu.")
 4550                 PROCSend("Click SELECT to toggle the cross-hairs on and off.")
 4560                 PROCSend("Click ADJUST to toggle recursive magnification on and off.")
 4570  WHEN Info:PROCSend("This window displays information about CloseView.")
 4580            PROCSend("CloseView is a member of the OmniDesk Suite of desktop utilities.")
 4590  WHEN Zoom:
 4600   CASE Block!36 OF
 4610     WHEN 0,1:PROCSend("Enter the required magnification factor here.")
 4620              PROCSend("The UP and DOWN arrow keys and RETURN move the caret between fields: RETURN closes the window after the second field.")
 4630              PROCSend("You may not set a reduction factor: only magnification is allowed.")
 4640     WHEN 2,3,4,5:PROCSend("Click SELECT on the arrows to alter the magnification setting.")
 4650                  PROCSend("ADJUST makes the arrows work in the opposite direction.")
 4660                  PROCSend("You may not set a reduction factor: only magnification is allowed.")
 4670     WHEN 7:PROCSend("Click SELECT or ADJUST or press F1 to toggle the cross-hairs on and off.")
 4680     WHEN 8:PROCSend("Click SELECT or ADJUST or press F2 to toggle recursive magnification on and off.")
 4690     OTHERWISE PROCSend("This window lets you set the magnification factor and whether the magnifier window displays cross-hairs and recursive magnification.")
 4700               PROCSend("You may not set a reduction factor: only magnification is allowed.")
 4710   ENDCASE
 4720  WHEN Loc:
 4730   CASE TRUE OF
 4740     WHEN ((Block!36)<6):PROCSend("This window lets you snap the magnifier window to an invisble screen grid.")
 4750                         PROCSend("The second position up puts the window just above the icon-bar, and is therefore not evenly spaced with the other rows.")
 4760     OTHERWISE PROCSend("Click SELECT on the position you want the window to snap to, or ADJUST on the window icon to turn the snapping off.")
 4770               PROCSend("If snapping is on, the window will open at the appropriate position when you change mode.")
 4780   ENDCASE
 4790OTHERWISE
 4800  IF wimp>=217 THEN
 4810    MenuHelp!0=-1:MenuHelp!4=-1:MenuHelp!8=-1
 4820    SYS "Wimp_GetMenuState",1,MenuHelp,Block!32,Block!36
 4830    CASE M% OF
 4840      WHEN IBMenu:
 4850        IF MenuHelp!4=-1 THEN
 4860          CASE MenuHelp!0 OF
 4870            WHEN 0:PROCSend("Move the pointer right to see information about CloseView.")
 4880            WHEN 1:PROCSend("Click SELECT to quit CloseView.")
 4890            OTHERWISE PROCSend("This is the CloseView icon-bar menu.")
 4900          ENDCASE
 4910        ENDIF
 4920      WHEN MainMenu:
 4930        Direction$="right":IF wimp>=310 AND CHR$(MainMenuTitle?0)="\" THEN Direction$="left"
 4940        CASE MenuHelp!0 OF
 4950          WHEN 0:PROCSend("Move the pointer "+Direction$+" to see information about CloseView.")
 4960          WHEN 1:PROCSend("Move the pointer "+Direction$+" to set the magnification factor and to turn the cross-hairs and recursive magnification on and off.")
 4970          WHEN 2:PROCSend("Move the pointer "+Direction$+" to set the position of the magnifier window on the screen.")
 4980          WHEN 3:PROCSend("Click SELECT or ADJUST to save the magnification factor, window position and the cross-hair and recursion options.")
 4990          OTHERWISE PROCSend("This is the CloseView main menu.")
 5000        ENDCASE
 5010    ENDCASE
 5020  ENDIF
 5030ENDCASE
 5040  :
 5050?HelpInfo=0
 5060Block!0=(HelpInfo+4-Block) AND NOT 3
 5070SYS "Wimp_SendMessage",17,Block,Block!4
 5080ENDPROC
 5090:
 5100DEF FNOmniHelpMessage(A$)
 5110IF A$="CLICK" THEN =LEFT$("open the magnifier window.",76)+CHR$13
 5120IF A$="DRAG" THEN =LEFT$("",76)+CHR$13
 5130=""
 5140:
 5150DEF PROCSend(Text$)
 5160$HelpInfo=Text$+"|M"
 5170HelpInfo+=LEN(Text$)+2
 5180ENDPROC
 5190:
 5200DEF PROCOmniDeskCalling
 5210IF OmniDesk=0 THEN ENDPROC
 5220REM This first line is for if a broadcast message is received which was
 5230REM intended for a transient copy of the utility. A stand-alone
 5240REM instantiation of the utility should ignore such messages.
 5250CASE Block!20 OF
 5260  WHEN 4:IF NOT FNOpenState(Magnifier) THEN PROCCreateMagSprite
 5270         PROCOpen(Magnifier,TRUE,XPosition,YPosition)
 5280ENDCASE
 5290ENDPROC
 5300:
 5310DEF PROCModeChange
 5320MagError=TRUE
 5330REM This causes the window redraw routine to call PROCCreateMagSprite.
 5340REM It's needed so that a new sprite isn't created on a mode change;
 5350REM rather, it's created when needed (ie when the window is opened).
 5360DoModeChange=TRUE
 5370IF OmniDesk=0 THEN PROCUpdateIconForMode("!CloseView",-2,IconBar)
 5380ENDPROC
 5390:
 5400REM -------------------------------------------------------------------------
 5410REM General non-specific useful routines (mostly wimp)
 5420REM -------------------------------------------------------------------------
 5430:
 5440DEF PROCUpdateIcon(Wndw,Icn,Txt$)
 5450Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 5460IF LEN(Txt$)>(Block!36)-1 THEN
 5470  IF ((Block!24) AND (1<<9))=(1<<9) THEN
 5480    REM Right-justified
 5490    Txt$="�"+RIGHT$(Txt$,(Block!36)-2)
 5500  ELSE
 5510    REM Left-justified or centred
 5520    Txt$=LEFT$(Txt$,(Block!36)-1):RIGHT$(Txt$)="�"
 5530  ENDIF
 5540ENDIF
 5550REM ^ Ensures the text can't overflow the maximum space in the icon.
 5560IF $(Block!28)<>Txt$ THEN
 5570  $(Block!28)=Txt$:Block!8=0:Block!12=0
 5580  SYS "Wimp_SetIconState",,Block
 5590ENDIF
 5600SYS "Wimp_GetCaretPosition",,Block
 5610IF Block!0=Wndw AND Block!4=Icn THEN
 5620  REM If this icon owns the caret, then put it at the end.
 5630  SYS "Wimp_SetCaretPosition",Wndw,Icn,0,0,-1,LEN(Txt$)
 5640ENDIF
 5650ENDPROC
 5660:
 5670DEF PROCUpdateIconColour(Wndw,Icn,FCol,BCol)
 5680REM Change an icon's colours
 5690Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 5700IF (((Block?27)>>4)=BCol) AND (((Block?27) MOD 16)=FCol) THEN ENDPROC
 5710  REM ^ Same colour, so don't change.
 5720Block!12=(%11111111<<24):Block!8=(BCol<<28)+(FCol<<24)
 5730SYS "Wimp_SetIconState",,Block
 5740ENDPROC
 5750:
 5760DEF PROCUpdateSelectedFlag(Wndw,Icn,State)
 5770REM Use State=TRUE to make icon become selected
 5780Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 5790IF ((Block!24) AND (1<<21))=((-State)<<21) THEN ENDPROC
 5800Block!12=(1<<21):IF State THEN Block!8=(1<<21) ELSE Block!8=(0<<21)
 5810SYS "Wimp_SetIconState",,Block
 5820ENDPROC
 5830:
 5840DEF PROCUpdateShadedFlag(Wndw,Icn,State)
 5850REM Use State=TRUE to make icon become shaded
 5860Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 5870IF ((Block!24) AND (1<<22))=((-State)<<22) THEN ENDPROC
 5880Block!12=(1<<22):IF State THEN Block!8=(1<<22) ELSE Block!8=(0<<22)
 5890SYS "Wimp_SetIconState",,Block
 5900ENDPROC
 5910:
 5920DEF FNSelectedState(Wndw,Icn)
 5930Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 5940IF ((Block!24) AND (1<<21))=(1<<21) THEN =TRUE
 5950=FALSE
 5960:
 5970DEF FNShadedState(Wndw,Icn)
 5980Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 5990IF ((Block!24) AND (1<<22))=(1<<22) THEN =TRUE
 6000=FALSE
 6010:
 6020DEF FNOpenState(Wndw)
 6030REM Returns TRUE if window is open; false otherwise
 6040Block!0=Wndw:SYS "Wimp_GetWindowState",,Block
 6050IF ((Block!32) AND (1<<16))=(1<<16) THEN =TRUE
 6060=FALSE
 6070:
 6080DEF PROCShadeMenu(Menu,Item,State)
 6090!(Menu+28+(24*Item)+8)=(!(Menu+28+(24*Item)+8) AND NOT (1<<22)) EOR ((-State)<<22)
 6100ENDPROC
 6110:
 6120DEF PROCTickMenu(Menu,Item,State)
 6130!(Menu+28+(24*Item))=(!(Menu+28+(24*Item)) AND NOT 1) EOR (-State)
 6140ENDPROC
 6150:
 6160DEF FNMenuShaded(Menu,Item)
 6170IF (!(Menu+28+(24*Item)+8) AND (1<<22))=(1<<22) THEN =TRUE
 6180=FALSE
 6190:
 6200DEF FNMenuTicked(Menu,Item)
 6210IF (!(Menu+28+(24*Item)) AND 1)=1 THEN =TRUE
 6220=FALSE
 6230:
 6240DEF FNReadIcon(Wndw,Icn)
 6250REM Read numeric value of icon
 6260Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 6270=VAL($(Block!28))
 6280:
 6290DEF FNReadIconStr(Wndw,Icn)
 6300REM Read string value of icon
 6310Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 6320=$(Block!28)
 6330:
 6340DEF FNModeInfo(var$,mode)
 6350REM Use mode=-1 for current screen mode
 6360CASE var$ OF
 6370  WHEN "XPixels":SYS "OS_ReadModeVariable",mode,11 TO ,,var
 6380  WHEN "YPixels":SYS "OS_ReadModeVariable",mode,12 TO ,,var
 6390  WHEN "NCol":SYS "OS_ReadModeVariable",mode,3 TO ,,var
 6400  WHEN "XEigFactor":SYS "OS_ReadModeVariable",mode,4 TO ,,var
 6410  WHEN "YEigFactor":SYS "OS_ReadModeVariable",mode,5 TO ,,var
 6420  WHEN "BPP":SYS "OS_ReadModeVariable",mode,9 TO ,,var:var=2^var
 6430  OTHERWISE var=-1:REM Fall-through for a faulty input value
 6440ENDCASE
 6450=var
 6460:
 6470DEF PROCUpdateIconForMode(Appname$,Wndw,Icn)
 6480REM This procedure requires that ALL the icon sprites are defined in mode 20
 6490REM or mode 27 (which is equivalent) with a mask but no palette. They should
 6500REM still appear to have the expected resolutions and number of colours, i.e
 6510REM !Sprites23: two colours, high resolution, !Sprites (actually !Sprites24)
 6520REM at mode 12 resolution (double height pixels) in 16 colours, and normal
 6530REM mode 20 resolution, 16 colours for the !Sprites22 icon. If this is not
 6540REM adhered to, then memory shortage errors may occur on a mode change.
 6550Extension$="24"
 6560IF FNModeInfo("YEigFactor",-1)<2 THEN
 6570  IF FNModeInfo("NCol",-1)>2 THEN
 6580    Extension$="22"
 6590  ELSE
 6600    Extension$="23"
 6610  ENDIF
 6620ENDIF
 6630SYS "Wimp_BaseOfSprites" TO ,iconsprite%
 6640SYS "OS_SpriteOp",256+25,iconsprite%,Appname$:REM Delete icon sprite
 6650REM The following three lines assume a mask but no palette:
 6660SYS "OS_SpriteOp",256+40,Sprites,Appname$+Extension$ TO ,,,w,h,,mode:REM Get info about new sprite
 6670SYS "OS_SpriteOp",256+15,iconsprite%,Appname$,0,w,h,mode:REM Create replacement icon sprite
 6680SYS "XOS_SpriteOp",256+29,iconsprite%,Appname$:REM Create mask
 6690  :
 6700REM Paint sprite mask into iconsprite mask:
 6710SYS "OS_SpriteOp",256+61,iconsprite%,Appname$,0 TO r0,r1,r2,r3:REM Output to mask
 6720SYS "OS_SpriteOp",256+49,Sprites,Appname$+Extension$,0,0:REM Paint mask from Sprites
 6730GCOL 4,128:CLG:REM Invert to make mask the right way round
 6740SYS "OS_SpriteOp",r0,r1,r2,r3:REM Reset screen output
 6750  :
 6760REM Paint sprite into iconsprite:
 6770SYS "OS_SpriteOp",256+60,iconsprite%,Appname$,0 TO r0,r1,r2,r3:REM Output to new icon sprite
 6780SYS "OS_SpriteOp",256+34,Sprites,Appname$+Extension$,0,0,8:REM Paint copy from Sprites
 6790SYS "OS_SpriteOp",r0,r1,r2,r3:REM Reset screen output
 6800Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 6810Block!8=0:Block!12=0:SYS "Wimp_SetIconState",,Block:REM Re-plot icon
 6820ENDPROC
 6830:
 6840DEF FNCreateWindow(minX,minY,maxX,maxY,Xoffset,Yoffset,Handle,Flags,TitleCol,TitleBackCol,WorkCol,WorkBackCol,ScrollCol,SliderCol,InputCol,WminX,WminY,WmaxX,WmaxY,TitleFlags,Wbutton,SpritePoint,MinW,MinH,TitleData$)
 6850Block!0=minX:Block!4=minY:Block!8=maxX:Block!12=maxY:Block!16=Xoffset:Block!20=Yoffset
 6860Block!24=Handle:Block!28=Flags
 6870Block?32=TitleCol:Block?33=TitleBackCol:Block?34=WorkCol:Block?35=WorkBackCol
 6880Block?36=ScrollCol:Block?37=SliderCol:Block?38=InputCol:Block?39=0
 6890Block!40=WminX:Block!44=WminY:Block!48=WmaxX:Block!52=WmaxY
 6900Block!56=TitleFlags:Block!60=Wbutton:Block!64=SpritePoint
 6910Block!68=(MinH<<15)+MinW :::::::::::: REM 0,0 sets the minimum window with to the title width
 6920$(Block+72)=TitleData$:Block!84=0 ::: REM No icons initially
 6930SYS "Wimp_CreateWindow",,Block TO WindowHandle
 6940=WindowHandle
 6950:
 6960DEF PROCInitialise
 6970AppSize=HIMEM-&8000:MinSize=AppSize:SlotEnd=HIMEM
 6980ENDPROC
 6990:
 7000DEF FNAllocateMemory(Required)
 7010SlotSize=FNSlotSize(-1)
 7020IF SlotSize<Required THEN NewSize=FNSlotSize(Required):IF NewSize<Required THEN SlotSize=FNSlotSize(AppSize):=0:REM Returns, indicating memory not claimed
 7030IF SlotSize>Required THEN SlotSize=FNSlotSize(Required)
 7040=SlotSize:REM Returns with bytes claimed
 7050:
 7060DEF FNSlotSize(Bytes)
 7070SYS "Wimp_SlotSize",Bytes,-1 TO Bytes
 7080=Bytes
 7090:
 7100DEF PROCMinimiseWimpSlot
 7110dummy=FNAllocateMemory(MinSize)
 7120ENDPROC
 7130:
 7140DEF PROCCloseFileIfPoss(FileHandle)
 7150LOCAL ERROR
 7160ON ERROR LOCAL RESTORE ERROR:ENDPROC:REM Unable to close file
 7170CLOSE#FileHandle
 7180ENDPROC
 7190:
 7200DEF FNFindFileSize(FileName$)
 7210IF FileName$="<Wimp$Scrap>" THEN
 7220  SYS "OS_File",15,FileName$,,,FileName$ TO ,,,,FileSize
 7230ELSE
 7240  N=-1:REPEAT:N+=1:UNTIL MID$(FileName$,LEN(FileName$)-N,1)="."
 7250  PathName$=LEFT$(FileName$,LEN(FileName$)-N):LeafName$=RIGHT$(FileName$,N)
 7260  SYS "OS_File",13,LeafName$,,,PathName$ TO ,,,,FileSize
 7270ENDIF
 7280=FileSize
 7290:
 7300DEF FNNextEntry
 7310REM Gets next entry (created by BPUT#Data,A$) from a file as a string.
 7320REM Use as A$=FNNextEntry.
 7330LOCAL ERROR
 7340ON ERROR LOCAL RESTORE ERROR:="":REM Error reading file
 7350NE$=GET$#Data
 7360WHILE LEFT$(NE$,1)="|"
 7370  NE$=GET$#Data
 7380ENDWHILE
 7390=NE$
 7400:
 7410REM -------------------------------------------------------------------------
 7420REM Routines common to the OmniDesk utilities
 7430REM -------------------------------------------------------------------------
 7440:
 7450DEF PROCDeclareToOmniDesk
 7460Block!0=208:Block!12=0:Block!16=UtilDeclare
 7470Block!20=Task
 7480$(Block+24)=Taskname$
 7490$(Block+44)=OurFileName$
 7500$(Block+55)=FNOmniHelpMessage("CLICK")
 7510$(Block+132)=FNOmniHelpMessage("DRAG")
 7520SYS "Wimp_SendMessage",17,Block,OmniDesk
 7530ENDPROC
 7540:
 7550DEF PROCSayGoodbye
 7560IF OmniDesk=0 THEN ENDPROC
 7570Block!0=24:Block!12=0:Block!16=UtilQuitting
 7580Block!20=Task
 7590SYS "Wimp_SendMessage",17,Block,OmniDesk
 7600ENDPROC
 7610:
 7620DEF FNReadStartupString
 7630REM Returns task handle of OmniDesk (which is passed in the command string)
 7640REM or 0 if not started by OmniDesk.
 7650SYS "OS_GetEnv" TO Command$
 7660A=INSTR(Command$,"-Startup")
 7670IF A<>0 THEN Startup=TRUE
 7680A=INSTR(Command$,"-Exit")
 7690IF A<>0 THEN Exit=TRUE
 7700A=INSTR(Command$,"-OmniDesk")
 7710IF A=0 THEN =0
 7720=VAL(MID$(Command$,A+9))
 7730:
 7740DEF FNReadWindowLocation(Axis$)
 7750REM Reads which radio icon (if any) is selected in the Window Position
 7760REM selector window and returns the axis coordinate (two calls needed)
 7770REM or -1 for no position selected.
 7780Icon=5:REPEAT:Icon+=1:UNTIL (FNSelectedState(Loc,Icon)=TRUE) OR (Icon=31)
 7790IF Icon=31 THEN =-1:REM All icons deselected
 7800Location=-1:Icon-=6:REM Bring icon into range 0-14
 7810CASE Axis$ OF
 7820  WHEN "X","x":Location=Icon DIV 5
 7830  WHEN "Y","y":Location=4-(Icon MOD 5)
 7840ENDCASE
 7850=Location
 7860:
 7870DEF PROCCleanUpLocWindow
 7880REM Makes sure that none of the 'window' icons in the Loc window is selected.
 7890N=5:REPEAT
 7900N+=1:UNTIL N=30 OR FNSelectedState(Loc,N)
 7910PROCUpdateSelectedFlag(Loc,N,FALSE)
 7920ENDPROC
 7930:
 7940REM -------------------------------------------------------------------------
 7950REM Special routines for this program only
 7960REM -------------------------------------------------------------------------
 7970:
 7980DEF PROCDoMag
 7990XEigFactor=FNModeInfo("XEigFactor",-1):YEigFactor=FNModeInfo("YEigFactor",-1)
 8000SYS "Wimp_GetPointerInfo",,Block
 8010X=Block!0:Y=Block!4
 8020REM Set background to border colour:
 8030SYS "OS_ReadPalette",,24 TO ,,Border
 8040SYS "ColourTrans_SetGCOL",Border,,,128+256
 8050REM 256 sets dithering, if available
 8060SYS "OS_SpriteOp",256+16,SlotEnd,"mag",0,X-200,Y-200,X+198,Y+198
 8070SYS "OS_SpriteOp",256+60,SlotEnd,"mag",0 TO r0,r1,r2,r3
 8080IF BlankMag THEN
 8090  SYS "ColourTrans_SetGCOL",Border,,,256
 8100  REM Set blanking rectangle to be the same as the border colour
 8110  Block!0=Magnifier:SYS "Wimp_GetWindowState",,Block:XL=Block!4:YB=Block!8:XR=Block!12:YT=Block!16
 8120  RECTANGLE FILL XL-X+201,YB-Y+201,XR-XL-2,YT-YB-2
 8130ENDIF
 8140IF XHair THEN
 8150  SYS "Wimp_SetColour",(4<<4):REM Set GCOL action
 8160  MOVE 200,0:DRAW 200,400
 8170  MOVE 0,200:DRAW 400,200
 8180ENDIF
 8190SYS "OS_SpriteOp",r0,r1,r2,r3
 8200Block!0=Magnifier:Block!4=0:Block!8=-400:Block!12=400:Block!16=0
 8210SYS "Wimp_UpdateWindow",,Block TO flag%
 8220WHILE flag%
 8230  SYS "OS_SpriteOp",256+52,SlotEnd,"mag",Block!4-((200*Scale!0)/Scale!8)+202-((Scale!0/Scale!8)*2^XEigFactor)/2,Block!8-((200*Scale!4)/Scale!12)+202-((Scale!4/Scale!12)*2^YEigFactor)/2,0,Scale
 8240  SYS "Wimp_GetRectangle",,Block TO flag%
 8250ENDWHILE
 8260ENDPROC
 8270:
 8280DEF PROCCreateMagSprite
 8290PROCMinimiseWimpSlot
 8300  :
 8310XEigFactor=FNModeInfo("XEigFactor",-1):YEigFactor=FNModeInfo("YEigFactor",-1)
 8320XPixels=(2*2^XEigFactor)+(400/(2^XEigFactor)):YPixels=(2*2^YEigFactor)+(400/(2^YEigFactor)):Pixels=XPixels*YPixels
 8330SpriteBytes=(Pixels*(FNModeInfo("BPP",-1)/8))+(6*YPixels)+60
 8340REM = Pixels*(bits per pixel/8) + 6 bytes wastage per row + 60 for sprite control area block
 8350  :
 8360IF FNAllocateMemory(SpriteBytes+AppSize)=0 THEN MagError=TRUE:PROCClose(Magnifier):ERROR 9999,"There is not enough memory to make the magnifier sprite. Please free some more memory and try again."
 8370  :
 8380SlotEnd!0=SpriteBytes:SlotEnd!8=16:SYS "OS_SpriteOp",256+9,SlotEnd:REM Init sprite area
 8390SYS "OS_SpriteOp",256+15,SlotEnd,"mag",0,(2*2^XEigFactor)+(400/(2^XEigFactor)),(2*2^YEigFactor)+(400/(2^YEigFactor)),MODE
 8400REM Create initially empty sprite
 8410ENDPROC
 8420:
 8430DEF FNSaveSettings
 8440LOCAL ERROR
 8450ON ERROR LOCAL RESTORE ERROR:PROCCloseFileIfPoss(Data):=FALSE:REM Error writing file
 8460  :
 8470  Data=OPENOUT ("<CloseView$Dir>.Settings")
 8480  BPUT#Data,"| X and Y grid coordinates of Magnifier window:"
 8490  BPUT#Data,STR$(XPosition)
 8500  BPUT#Data,STR$(YPosition)
 8510  BPUT#Data,"| Magnification factors:"
 8520  BPUT#Data,FNReadIconStr(Zoom,0)
 8530  BPUT#Data,FNReadIconStr(Zoom,1)
 8540  BPUT#Data,"| Show cross-hairs (-1 for TRUE, 0 for FALSE):"
 8550  BPUT#Data,STR$(FNSelectedState(Zoom,7))
 8560  BPUT#Data,"| Recursive magnification (-1 for TRUE, 0 for FALSE):"
 8570  BPUT#Data,STR$(FNSelectedState(Zoom,8))
 8580  CLOSE#Data
 8590  OSCLI("Settype <CloseView$Dir>.Settings Text")
 8600  :
 8610=TRUE
 8620:
 8630DEF FNLoadSettings
 8640LOCAL ERROR
 8650ON ERROR LOCAL RESTORE ERROR:PROCCloseFileIfPoss(Data):=FALSE:REM 'Settings' file is damaged or missing
 8660  :
 8670  Data=OPENIN "<CloseView$Dir>.Settings"
 8680  XPosition=VAL(FNNextEntry)
 8690  YPosition=VAL(FNNextEntry)
 8700  PROCUpdateIcon(Zoom,0,FNNextEntry)
 8710  PROCUpdateIcon(Zoom,1,FNNextEntry)
 8720  PROCUpdateSelectedFlag(Zoom,7,VAL(FNNextEntry))
 8730  PROCUpdateSelectedFlag(Zoom,8,VAL(FNNextEntry))
 8740  CLOSE#Data
 8750  :
 8760  Scale!0=FNReadIcon(Zoom,0):Scale!4=Scale!0:Scale!8=FNReadIcon(Zoom,1):Scale!12=Scale!8
 8770  XHair=FNSelectedState(Zoom,7)
 8780  BlankMag=NOT(FNSelectedState(Zoom,7))
 8790  IF XPosition<>-1 AND YPosition<>-1 THEN PROCUpdateSelectedFlag(Loc,6+((5*XPosition)+(4-YPosition)),TRUE)
 8800  :
 8810=TRUE
 8820:
 8830DEF PROCDefaultSettings
 8840BlankMag=FALSE
 8850XHair=TRUE
 8860Scale!0=2:Scale!4=2:Scale!8=1:Scale!12=1
 8870XPosition=0:YPosition=4
 8880PROCUpdateIcon(Zoom,0,"2")
 8890PROCUpdateIcon(Zoom,1,"1")
 8900PROCUpdateSelectedFlag(Zoom,7,XHair)
 8910PROCUpdateSelectedFlag(Zoom,8,NOT BlankMag)
 8920PROCUpdateSelectedFlag(Loc,6+((5*XPosition)+(4-YPosition)),TRUE)
 8930ENDPROC

� >!RunImage for CloseView
:
HVersionNumber$="1�04 (31 July 1993)":Taskname$="CloseView�Magnifier"
(Exit=�:Startup=�:Done=�
2DoModeChange=�
<:
F-� Block 256,MenuHelp 16,Scale 16,Border 4
P/IndMenuMax=64:� IndirectMenuText IndMenuMax
ZG� Templates 1632,InfoInd 202,MagnifierInd 20,ZoomInd 104,LocInd 592
d� IBMenu 76,MainMenu 124
n:
x*� Messages used by the OmniDesk suite:
�_UtilDeclare=&825C0:UtilOpen=&825C1:UtilQuitting=&825C2:UtilReside=&825C3:UtilAckLoad=&825C4
�+� These are official Acorn allocations.
�:
�n� � Block!0=�:$(Block+4)=�$+" (internal error code "+�(�)+")"+�0:ș "Wimp_ReportError",Block,1,Taskname$:�
�:
�?OmniDesk=�ReadStartupString:� Also assigns Exit and Startup
�:
�*Set CloseView$RISCOS 3
�7*RMEnsure UtilityModule 3.00 Set CloseView$RISCOS 2
�Zș "XOS_ReadVarVal","CloseView$RISCOS",Block,256,0,0 � ,,len:Block?len=13:wimp$=$Block
�� wimp$<>"3" � wimp$="2"
�*Unset CloseView$RISCOS
�Yș "XOS_ReadVarVal","Obey$Dir",Block,256,0,0 � ,,len:Block?len=13:OurFileName$=$Block
8N=-1:�:N+=1:� �OurFileName$,�(OurFileName$)-N,1)="."
OOurPathName$=�OurFileName$,�(OurFileName$)-N):OurFileName$=�OurFileName$,N)
:
"^� Read size of sprite file and load it. We need to DIM 16 bytes more than the file's size.
,:ș "OS_FSControl",28,"<CloseView$Dir>.Sprites" � ,,len
6�� Sprites len+16:!Sprites=len+16:Sprites!4=0:Sprites!8=16:Sprites!12=16:ș "OS_SpriteOp",256+10,Sprites,"<CloseView$Dir>.Sprites"
@:
J� wimp$="3" �
T  � messagelist% 28
^/  messagelist%!0=&502:messagelist%!4=&400C1
h:  messagelist%!8=UtilOpen:messagelist%!12=UtilQuitting
rE  messagelist%!16=UtilReside:messagelist%!20=10:messagelist%!24=0
|K  ș "Wimp_Initialise",300,&4B534154,Taskname$,messagelist% � wimp,Task
��
�>  ș "Wimp_Initialise",200,&4B534154,Taskname$ � wimp,Task
��
�:
�"ș "Interface_Initialise",Task
�:
�7ș "Wimp_OpenTemplate",,"<CloseView$Dir>.Templates"
�Eș "Wimp_LoadTemplate",,Templates,InfoInd,InfoInd+202,-1,"Info",0
�,ș "Wimp_CreateWindow",,Templates � Info
�Sș "Wimp_LoadTemplate",,Templates,MagnifierInd,MagnifierInd+20,-1,"Magnifier",0
�1ș "Wimp_CreateWindow",,Templates � Magnifier
�\ș "Wimp_LoadTemplate",,Templates,LocInd,LocInd+592,-1,"WindowXY",0:Templates!64=Sprites
�+ș "Wimp_CreateWindow",,Templates � Loc
Zș "Wimp_LoadTemplate",,Templates,ZoomInd,ZoomInd+104,-1,"Zoom",0:Templates!64=Sprites
,ș "Wimp_CreateWindow",,Templates � Zoom
ș "Wimp_CloseTemplate"
&:
0�BuildMenus
:MagError=�
D:
N� OmniDesk=0 �
X   � Put Icon on the icon-bar
b  Block!0=-1
l1  Block!4=0:Block!8=0:Block!12=68:Block!16=68
v5  Block!20=&17003002:$(Block+24)="!CloseView"+�13
�+  ș "Wimp_CreateIcon",,Block � IconBar
��
�:
��Initialise
�&� OmniDesk<>0 � �DeclareToOmniDesk
�R� Startup � Done=�:� '-Startup' parameter means 'declare and die immediately'.
�:
�&�UpdateIcon(Info,3,VersionNumber$)
�6�ModeChange:� To update icon-bar icon if necessary
��CleanUpLocWindow
�:
�ReadError=�(�LoadSettings)
�:
� � �Error
�� ReadError � ReadError=�:�DefaultSettings:� 9999,"An error occurred whilst reading the settings file. Default settings will therefore be used."
:
 � Main program loop
*�
42  ș "Wimp_Poll",%1100000110000,Block � Reason
>&  ș "Interface_Poll",Reason,,Task
H4  ș "Interface_PreProcessKey",Reason,Block,Task
R  Ȏ Reason �
\.    � 0 : � �OpenState(Magnifier) � �DoMag
fb             � DoModeChange � � �OpenState(Magnifier) � �Open(Magnifier,�,XPosition,YPosition)
p    � 1 : �Redraw
z)    � 2 : ș "Wimp_OpenWindow",,Block
�R    � 3 : ș "Wimp_CloseWindow",,Block:� Block!0=Magnifier � �MinimiseWimpSlot
�P             � Forget the sprite and release the memory if we don't need it.
�              � Exit � Done=�
�    � 6 : �MouseButton
�    � 8 : �KeyPressed
�    � 9 : �DecodeMenu
�$    � 17,18,19 : �RecieveMessage
�  �
�
� Done
��SayGoodbye
�!ș "Interface_CloseDown",Task
�&ș "Wimp_CloseDown",Task,&4B534154
��
:
� �Error
Click=0:Block!0=�:Ȏ � �
$  � 9999:� Custom error
.    $(Block+4)=�$+�0
8>    ș "Wimp_ReportError",Block,17,"Notice from CloseView"
B  
Lv    $(Block+4)=�$+" (internal error code "+Þ+"). Click on OK to continue, or Cancel to terminate the program."+�0
V8    ș "Wimp_ReportError",Block,3,Taskname$ � ,Click
`�
j^� Click=2 � �SayGoodbye:ș "Interface_CloseDown",Task:ș "Wimp_CloseDown",Task,&4B534154:�
t�
~:
�.� �Open(WindowHandle,TopOfStack,across,up)
�Block!0=WindowHandle
�#ș "Wimp_GetWindowState",,Block
�J� (across<>-1) � (across<>-1) � �DecideWindowPosition(Block,across,up)
�� TopOfStack � Block!28=-1
�ș "Wimp_OpenWindow",,Block
��
�:
�� �Close(WindowHandle)
�Block!0=WindowHandle
�#ș "Wimp_GetWindowState",,Block
� ș "Wimp_CloseWindow",,Block
�

:
,� �DecideWindowPosition(Block,across,up)
L� Use of this procedure lets you open windows on an invisible grid which
(I� automatically fits itself to the screen mode in use. There are five
2J� positions across (left, mid-left, centre, mid-right, right) and five
<G� positions up (bottom of screen, above icon-bar, centre of screen,
F+� centre top of screen, top of screen).
P  :
ZCXpixels=�ModeInfo("XPixels",-1):Ypixels=�ModeInfo("YPixels",-1)
dOXEigFactor=�ModeInfo("XEigFactor",-1):YEigFactor=�ModeInfo("YEigFactor",-1)
n  :
x8top=Block!16:right=Block!12:bot=Block!8:left=Block!4
�Aș "Wimp_OpenWindow",,Block:ș "Wimp_GetWindowOutline",,Block
�&TB=((Block!16)-top)/(2^YEigFactor)
�(VS=((Block!12)-right)/(2^XEigFactor)
�%HS=(bot-(Block!8))/(2^YEigFactor)
�&LP=(left-(Block!4))/(2^XEigFactor)
�K� LP is Left Pixel: normally present, but not if window is transparent.
�%width=(right-left)/(2^XEigFactor)
�#height=(top-bot)/(2^YEigFactor)
�Ȏ across �
�  � 0:x=LP
�,  � 1:x=LP+((Xpixels+1)-(width+LP+VS))/4
�,  � 2:x=LP+((Xpixels+1)-(width+LP+VS))/2
�2  � 3:x=LP+(3*(((Xpixels+1)-(width+LP+VS))/4))
"  � 4:x=(Xpixels+1)-(width+VS)
�
Ȏ up �
"  � 0:y=HS
,#  � 1:y=HS+(132/(2^YEigFactor))
6-  � 2:y=HS+((Ypixels+1)-(height+TB+HS))/2
@3  � 3:y=HS+(3*(((Ypixels+1)-(height+TB+HS))/4))
J#  � 4:y=(Ypixels+1)-(height+TB)
T�
^(� Above coordinates position window.
h(� Now convert to screen coordinates:
r)x=x*(2^XEigFactor):y=y*(2^YEigFactor)
|;width=width*(2^XEigFactor):height=height*(2^YEigFactor)
�Block!12=x+width:Block!4=x
�Block!16=y+height:Block!8=y
��
�:
�O� -------------------------------------------------------------------------
�� Wimp poll routines
�O� -------------------------------------------------------------------------
�:
�
� �Redraw
�� DoModeChange �
�d  � Re-opening windows need an extra wimp_poll to happen after the mode change in order to work:
�F  � �OpenState(Magnifier) � �Open(Magnifier,�,XPosition,YPosition)
�  DoModeChange=�
�
Ȏ Block!0 �
  � Magnifier:
&0    � MagError � MagError=�:�CreateMagSprite
0S    XEigFactor=�ModeInfo("XEigFactor",-1):YEigFactor=�ModeInfo("YEigFactor",-1)
:-    ș "Wimp_RedrawWindow",,Block � flag%
D    ȕ flag%
N�      ș "OS_SpriteOp",256+52,SlotEnd,"mag",Block!4-((200*Scale!0)/Scale!8)+202-((Scale!0/Scale!8)*2^XEigFactor)/2,Block!8-((200*Scale!4)/Scale!12)+202-((Scale!4/Scale!12)*2^YEigFactor)/2,0,Scale
X/      ș "Wimp_GetRectangle",,Block � flag%
b	    �
l  
v-    ș "Wimp_RedrawWindow",,Block � flag%
�    ȕ flag%
�'      ș "Wimp_BorderWindow",,Block
�/      ș "Wimp_GetRectangle",,Block � flag%
�	    �
��
��
�:
�� �RecieveMessage
�Ȏ Block!16 �
�  � 0 : Done=�
�1  � 10: � OmniDesk=0 � �SaveDesktop(Block!20)
�E           � Only save if we have not been started up by OmniDesk
�  � &502 : �Help
  � &400C1 : �ModeChange
=  � UtilOpen : � $(Block+24)=Taskname$ � �OmniDeskCalling
&  � UtilQuitting : � OmniDesk<>0 �
 8                        � Block!20=OmniDesk � Done=�
*                      �
4  � UtilReside : Exit=�
>�
H�
R:
\� �MouseButton
f1MouseX=Block!0:MouseY=Block!4:Buttons=Block!8
p!Window=Block!12:Icon=Block!16
zȎ Window �
�"  � -2:� Icon bar icon clicked
�    Ȏ Buttons �
�      � 1 : � Adjust
�      � 2 : � Menu
�9        M%=IBMenu:MenuX=MouseX:MenuY=MouseY:�MakeMenu
�      � 4 : � Select
�8        � � �OpenState(Magnifier) � �CreateMagSprite
�2        �Open(Magnifier,�,XPosition,YPosition)
�	    �
�  � Zoom:�ZoomClick
�  � Magnifier
�    Ȏ Buttons �
�      � 1 : � Adjust
	F        BlankMag=� BlankMag:�UpdateSelectedFlag(Zoom,8,� BlankMag)
	      � 2 : � Menu
	1        M%=MainMenu:MenuX=MouseX:MenuY=MouseY
	$        � wimp>=310 �
	.`          � �$MainMenuTitle,1)="\" � $MainMenuTitle=�$MainMenuTitle,�($MainMenuTitle)-1)+�13
	8C          � XPosition=4 � $MainMenuTitle="\"+$MainMenuTitle+�13
	B
        �
	L        �MakeMenu
	V      � 4 : � Select
	`;        XHair=� XHair:�UpdateSelectedFlag(Zoom,7,XHair)
	j	    �
	t0  � Loc � Buttons<8:� Reposition main window
	~    � Icon>=6 �
	�,      XPosition=�ReadWindowLocation("X")
	�,      YPosition=�ReadWindowLocation("Y")
	�J      � �OpenState(Magnifier) � �Open(Magnifier,�,XPosition,YPosition)
	�	    �
	��
	��
	�:
	�� �ZoomClick
	�
Ȏ Icon �
	�(  � 2 � (Buttons=4),3 � (Buttons=1):
	�    A=�ReadIcon(Zoom,0)
	�-    � A<999 � A+=1:�UpdateIcon(Zoom,0,�A)
    B=�ReadIcon(Zoom,1)

*    � A=0 � A=1:�UpdateIcon(Zoom,0,�A)
*    � B=0 � B=1:�UpdateIcon(Zoom,1,�B)
*    � A<B � B=A:�UpdateIcon(Zoom,1,�B)
(0    Scale!0=A:Scale!4=A:Scale!8=B:Scale!12=B
24    ș "Wimp_SetCaretPosition",Zoom,0,,,-1,�(�A)
<(  � 2 � (Buttons=1),3 � (Buttons=4):
F    A=�ReadIcon(Zoom,0)
P+    � A>1 � A-=1:�UpdateIcon(Zoom,0,�A)
Z    B=�ReadIcon(Zoom,1)
d*    � A=0 � A=1:�UpdateIcon(Zoom,0,�A)
n*    � B=0 � B=1:�UpdateIcon(Zoom,1,�B)
x*    � A<B � B=A:�UpdateIcon(Zoom,1,�B)
�0    Scale!0=A:Scale!4=A:Scale!8=B:Scale!12=B
�4    ș "Wimp_SetCaretPosition",Zoom,0,,,-1,�(�A)
�(  � 4 � (Buttons=4),5 � (Buttons=1):
�    B=�ReadIcon(Zoom,1)
�-    � B<999 � B+=1:�UpdateIcon(Zoom,1,�B)
�    A=�ReadIcon(Zoom,0)
�*    � A=0 � A=1:�UpdateIcon(Zoom,0,�A)
�*    � B=0 � B=1:�UpdateIcon(Zoom,1,�B)
�*    � A<B � A=B:�UpdateIcon(Zoom,0,�A)
�0    Scale!0=A:Scale!4=A:Scale!8=B:Scale!12=B
�4    ș "Wimp_SetCaretPosition",Zoom,1,,,-1,�(�B)
�(  � 4 � (Buttons=1),5 � (Buttons=4):
�    B=�ReadIcon(Zoom,1)
+    � B>1 � B-=1:�UpdateIcon(Zoom,1,�B)
    A=�ReadIcon(Zoom,0)
*    � A=0 � A=1:�UpdateIcon(Zoom,0,�A)
"*    � B=0 � B=1:�UpdateIcon(Zoom,1,�B)
,*    � A<B � A=B:�UpdateIcon(Zoom,0,�A)
60    Scale!0=A:Scale!4=A:Scale!8=B:Scale!12=B
@4    ș "Wimp_SetCaretPosition",Zoom,1,,,-1,�(�B)
J
  � 7:
T$    XHair=�SelectedState(Zoom,7)
^
  � 8:
h)    BlankMag=� �SelectedState(Zoom,8)
r�
|�
�:
�� �KeyPressed
�2Window=Block!0:Icon=Block!4:Character=Block!24
�Ȏ Window �
�
  � Zoom:
�    Ȏ Character �
�      � &181:� <F1>
�;        XHair=� XHair:�UpdateSelectedFlag(Zoom,7,XHair)
�      � &182:� <F2>
�F        BlankMag=� BlankMag:�UpdateSelectedFlag(Zoom,8,� BlankMag)
�G      � &18E,&19E,&1AE,&1BE,&18F,&19F,&1AF,&1BF,13:� Down,Up,Return
�3        A=�ReadIcon(Zoom,0):B=�ReadIcon(Zoom,1)
�.        � A=0 � A=1:�UpdateIcon(Zoom,0,�A)
.        � B=0 � B=1:�UpdateIcon(Zoom,1,�B)
.        � A<B � B=A:�UpdateIcon(Zoom,1,�B)
4        Scale!0=A:Scale!4=A:Scale!8=B:Scale!12=B
&&        � Icon=0 � Icon=1 � Icon=0
0x        � Icon=0 � ș "Wimp_SetCaretPosition",Zoom,Icon,,,-1,�(�A) � ș "Wimp_SetCaretPosition",Zoom,Icon,,,-1,�(�B)
:/        � Sets caret to end of current icon
D>        � Character=13 � Icon=0 � ș "Wimp_CreateMenu",,-1
N;        � Close window if Return pressed on second icon
X      
b*        ș "Wimp_ProcessKey",Character
l	    �
v  
�&    ș "Wimp_ProcessKey",Character
��
��
�:
�� �DecodeMenu
�*Sub0=Block!0:Sub1=Block!4:Sub2=Block!8
�CloseMenu=�
�Ȏ M% �
�  � IBMenu:
�    Ȏ Sub0 �
�
      � 0
�+        ș "Wimp_GetPointerInfo",,Block
�<        ș "Wimp_CreateMenu",,Info,Block!0-24,Block!4+24

        CloseMenu=�


      � 1

        Done=�

 	    �

*  � MainMenu:

4    Ȏ Sub0 �

>
      � 0

H+        ș "Wimp_GetPointerInfo",,Block

R<        ș "Wimp_CreateMenu",,Info,Block!0-24,Block!4+24

\        CloseMenu=�

f
      � 1

p+        ș "Wimp_GetPointerInfo",,Block

z<        ș "Wimp_CreateMenu",,Zoom,Block!0-24,Block!4+24

�        CloseMenu=�

�
      � 2

�+        ș "Wimp_GetPointerInfo",,Block

�;        ș "Wimp_CreateMenu",,Loc,Block!0-24,Block!4+24

�        CloseMenu=�

�
      � 3

�\        � � �SaveSettings � � 9999,"An error occurred whilst writing the settings file."

�	    �

��

�#ș "Wimp_GetPointerInfo",,Block

�3� ((Block!8 � 1)=1) � (� CloseMenu) � �MakeMenu

��

�:
O� -------------------------------------------------------------------------
� Menu routines
O� -------------------------------------------------------------------------
$:
.� �BuildMenus
8I� This procedure should only be visited once, since it contains DIMs.
B  :
LO� In the menu title strings below, if a "|" character is present it will be
VO� replaced by a space under RISC OS 3.1 (or greater), or will terminate the
`O� string under earlier versions of the wimp. This allows the new indirected
jF� menu titles to be used (which were introduced with RISC OS 3.1).
t  :
~#IndirectMenuTextOffsetPointer=0
�N� This points to a pool to be used by all menus for their indirected text.
�  :
�
M%=IBMenu
�HTitle$="CloseView":� IBMenuTitle �(Title$)+1:$IBMenuTitle=Title$+�13
��MenuInit(IBMenuTitle)
��MenuItem("Info",0,Info)
��MenuItem("Quit",128,-1)
�  :
�M%=MainMenu
�VTitle$="CloseView|Magnifier":� MainMenuTitle �(Title$)+2:$MainMenuTitle=Title$+�13
��MenuInit(MainMenuTitle)
��MenuItem("Info",2,Info)
*�MenuItem("Magnification etc.",0,Zoom)

&�MenuItem("Window position",2,Loc)
%�MenuItem("Save settings",128,-1)
�
(:
2� �MakeMenu
<� MenuX<0 � MenuX=0
F*� MenuY<184 � MenuY=184:� for icon bar
P7ș "Wimp_CreateMenu",,M%,MenuX-((36+M%!16)/2),MenuY
Z�
d:
n� �MenuInit(MenuTitle)
x� wimp>=310 �
�7  A=�$MenuTitle,"|"):� A<>0 � ?(MenuTitle+(A-1))=32
�  MenuMax=�($MenuTitle)
�  M%!0=MenuTitle
��
�7  A=�$MenuTitle,"|"):� A<>0 � ?(MenuTitle+(A-1))=13
�   MenuMax=�(�$MenuTitle,12))
�  $M%=�$MenuTitle,12)
��
�$M%?12=7:M%?13=2:M%?14=11:M%?15=0
�M%!16=MenuMax*16
�M%!20=44:M%!24=0
�P%=M%+28
��
:
!� �MenuItem(Text$,Flags,Link)
K� Flags: 1-ticked, 2-dashed line, 4-writeable, 8-message, 128-last item
"1� Link: menu or window handle for sub-pointer
,P%!0=Flags:P%!4=Link
6� �(Text$)<=12 �
@%  P%!8=&07003021:� Not indirected
J  $(P%+12)=Text$
T�
^!  P%!8=&07003121:� Indirected
h:  P%!12=IndirectMenuText+IndirectMenuTextOffsetPointer
r  P%!16=0:P%!20=0
|A  $(IndirectMenuText+IndirectMenuTextOffsetPointer)=Text$+�13
�/  IndirectMenuTextOffsetPointer+=�(Text$)+1
��  � IndirectMenuTextOffsetPointer>IndMenuMax � � 0,"The indirect menu text buffer has overflowed. Please allocate more space."
��
�
P%+=24
�>� MenuMax<�(Text$) � MenuMax=�(Text$):M%!16=(MenuMax+1)*16
�A� (Flags=128) � (wimp>=310) � M%!28=(((M%!28) � � 256) � 256)
�7  � Indirected menu titles for RISC OS 3.1 upwards.
��
�:
�O� -------------------------------------------------------------------------
�)� Responses to incoming wimp messages
�O� -------------------------------------------------------------------------
�:
� �SaveDesktop(File)
� �
G� � � Block!12=Block!8:ș "Wimp_SendMessage",19,Block,Block!4:� �:�
&I� The above line acknowledges the message if an error occurs, thereby
0 � aborting the desktop save.
:+�#File,"Run "+OurPathName$+OurFileName$
D�
N:
X� �Help
b4Block!12=Block!8:Block!16=&503:HelpInfo=Block+20
l  :
v0� Block!32 gives window, Block!36 gives icon
�  :
�Ȏ Block!32 �
�/  � -2:�Send("This is the CloseView icon.")
�=          �Send("Click MENU for information or to quit.")
�A          �Send("Click SELECT to open the magnifier window.")
�B  � Magnifier:�Send("This is the CloseView Magnifier window.")
�;                 �Send("Click MENU for the main menu.")
�P                 �Send("Click SELECT to toggle the cross-hairs on and off.")
�X                 �Send("Click ADJUST to toggle recursive magnification on and off.")
�G  � Info:�Send("This window displays information about CloseView.")
�Z            �Send("CloseView is a member of the OmniDesk Suite of desktop utilities.")
�
  � Zoom:
�   Ȏ Block!36 �
E     � 0,1:�Send("Enter the required magnification factor here.")
�              �Send("The UP and DOWN arrow keys and RETURN move the caret between fields: RETURN closes the window after the second field.")
]              �Send("You may not set a reduction factor: only magnification is allowed.")
 Z     � 2,3,4,5:�Send("Click SELECT on the arrows to alter the magnification setting.")
*V                  �Send("ADJUST makes the arrows work in the opposite direction.")
4a                  �Send("You may not set a reduction factor: only magnification is allowed.")
>^     � 7:�Send("Click SELECT or ADJUST or press F1 to toggle the cross-hairs on and off.")
Hf     � 8:�Send("Click SELECT or ADJUST or press F2 to toggle recursive magnification on and off.")
R�      �Send("This window lets you set the magnification factor and whether the magnifier window displays cross-hairs and recursive magnification.")
\^               �Send("You may not set a reduction factor: only magnification is allowed.")
f   �
p  � Loc:
z
   Ȏ � �
�m     � ((Block!36)<6):�Send("This window lets you snap the magnifier window to an invisble screen grid.")
��                         �Send("The second position up puts the window just above the icon-bar, and is therefore not evenly spaced with the other rows.")
��      �Send("Click SELECT on the position you want the window to snap to, or ADJUST on the window icon to turn the snapping off.")
�u               �Send("If snapping is on, the window will open at the appropriate position when you change mode.")
�   �
�
�  � wimp>=217 �
�1    MenuHelp!0=-1:MenuHelp!4=-1:MenuHelp!8=-1
�;    ș "Wimp_GetMenuState",1,MenuHelp,Block!32,Block!36
�    Ȏ M% �
�      � IBMenu:
�        � MenuHelp!4=-1 �
�          Ȏ MenuHelp!0 �
W            � 0:�Send("Move the pointer right to see information about CloseView.")
<            � 1:�Send("Click SELECT to quit CloseView.")
?             �Send("This is the CloseView icon-bar menu.")
$          �
.
        �
8      � MainMenu:
BW        Direction$="right":� wimp>=310 � �(MainMenuTitle?0)="\" � Direction$="left"
L        Ȏ MenuHelp!0 �
V^          � 0:�Send("Move the pointer "+Direction$+" to see information about CloseView.")
`�          � 1:�Send("Move the pointer "+Direction$+" to set the magnification factor and to turn the cross-hairs and recursive magnification on and off.")
ju          � 2:�Send("Move the pointer "+Direction$+" to set the position of the magnifier window on the screen.")
t�          � 3:�Send("Click SELECT or ADJUST to save the magnification factor, window position and the cross-hair and recursion options.")
~9           �Send("This is the CloseView main menu.")
�
        �
�	    �
�  �
��
�  :
�?HelpInfo=0
�$Block!0=(HelpInfo+4-Block) � � 3
�*ș "Wimp_SendMessage",17,Block,Block!4
��
�:
�� �OmniHelpMessage(A$)
�9� A$="CLICK" � =�"open the magnifier window.",76)+�13
� A$="DRAG" � =�"",76)+�13

=""
:
� �Send(Text$)
($HelpInfo=Text$+"|M"
2HelpInfo+=�(Text$)+2
<�
F:
P� �OmniDeskCalling
Z� OmniDesk=0 � �
dI� This first line is for if a broadcast message is received which was
nA� intended for a transient copy of the utility. A stand-alone
x?� instantiation of the utility should ignore such messages.
�Ȏ Block!20 �
�6  � 4:� � �OpenState(Magnifier) � �CreateMagSprite
�3         �Open(Magnifier,�,XPosition,YPosition)
��
��
�:
�� �ModeChange
�MagError=�
�H� This causes the window redraw routine to call PROCCreateMagSprite.
�F� It's needed so that a new sprite isn't created on a mode change;
�F� rather, it's created when needed (ie when the window is opened).
�DoModeChange=�
�>� OmniDesk=0 � �UpdateIconForMode("!CloseView",-2,IconBar)
�
:
O� -------------------------------------------------------------------------
"8� General non-specific useful routines (mostly wimp)
,O� -------------------------------------------------------------------------
6:
@ � �UpdateIcon(Wndw,Icn,Txt$)
J:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
T� �(Txt$)>(Block!36)-1 �
^&  � ((Block!24) � (1<<9))=(1<<9) �
h    � Right-justified
r$    Txt$="�"+�Txt$,(Block!36)-2)
|  �
�#    � Left-justified or centred
�+    Txt$=�Txt$,(Block!36)-1):�Txt$)="�"
�  �
��
�F� ^ Ensures the text can't overflow the maximum space in the icon.
�� $(Block!28)<>Txt$ �
�+  $(Block!28)=Txt$:Block!8=0:Block!12=0
�#  ș "Wimp_SetIconState",,Block
��
�%ș "Wimp_GetCaretPosition",,Block
�"� Block!0=Wndw � Block!4=Icn �
�<  � If this icon owns the caret, then put it at the end.
�8  ș "Wimp_SetCaretPosition",Wndw,Icn,0,0,-1,�(Txt$)
�
�
:
&+� �UpdateIconColour(Wndw,Icn,FCol,BCol)
0� Change an icon's colours
::Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
D;� (((Block?27)>>4)=BCol) � (((Block?27) � 16)=FCol) � �
N'  � ^ Same colour, so don't change.
X:Block!12=(%11111111<<24):Block!8=(BCol<<28)+(FCol<<24)
b!ș "Wimp_SetIconState",,Block
l�
v:
�)� �UpdateSelectedFlag(Wndw,Icn,State)
�1� Use State=TRUE to make icon become selected
�:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
�/� ((Block!24) � (1<<21))=((-State)<<21) � �
�@Block!12=(1<<21):� State � Block!8=(1<<21) � Block!8=(0<<21)
�!ș "Wimp_SetIconState",,Block
��
�:
�'� �UpdateShadedFlag(Wndw,Icn,State)
�/� Use State=TRUE to make icon become shaded
�:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
�/� ((Block!24) � (1<<22))=((-State)<<22) � �
�@Block!12=(1<<22):� State � Block!8=(1<<22) � Block!8=(0<<22)
!ș "Wimp_SetIconState",,Block
�
:
 � �SelectedState(Wndw,Icn)
*:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
4)� ((Block!24) � (1<<21))=(1<<21) � =�
>=�
H:
R� �ShadedState(Wndw,Icn)
\:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
f)� ((Block!24) � (1<<22))=(1<<22) � =�
p=�
z:
�� �OpenState(Wndw)
�5� Returns TRUE if window is open; false otherwise
�0Block!0=Wndw:ș "Wimp_GetWindowState",,Block
�)� ((Block!32) � (1<<16))=(1<<16) � =�
�=�
�:
�!� �ShadeMenu(Menu,Item,State)
�P!(Menu+28+(24*Item)+8)=(!(Menu+28+(24*Item)+8) � � (1<<22)) � ((-State)<<22)
��
�:
� � �TickMenu(Menu,Item,State)
�@!(Menu+28+(24*Item))=(!(Menu+28+(24*Item)) � � 1) � (-State)
��
:
� �MenuShaded(Menu,Item)
5� (!(Menu+28+(24*Item)+8) � (1<<22))=(1<<22) � =�
$=�
.:
8� �MenuTicked(Menu,Item)
B'� (!(Menu+28+(24*Item)) � 1)=1 � =�
L=�
V:
`� �ReadIcon(Wndw,Icn)
j � Read numeric value of icon
t:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
~=�($(Block!28))
�:
�� �ReadIconStr(Wndw,Icn)
�� Read string value of icon
�:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
�=$(Block!28)
�:
�� �ModeInfo(var$,mode)
�)� Use mode=-1 for current screen mode
�
Ȏ var$ �
�:  � "XPixels":ș "OS_ReadModeVariable",mode,11 � ,,var
�:  � "YPixels":ș "OS_ReadModeVariable",mode,12 � ,,var
�6  � "NCol":ș "OS_ReadModeVariable",mode,3 � ,,var
<  � "XEigFactor":ș "OS_ReadModeVariable",mode,4 � ,,var

<  � "YEigFactor":ș "OS_ReadModeVariable",mode,5 � ,,var
?  � "BPP":ș "OS_ReadModeVariable",mode,9 � ,,var:var=2^var
6   var=-1:� Fall-through for a faulty input value
(�
2=var
<:
F+� �UpdateIconForMode(Appname$,Wndw,Icn)
PN� This procedure requires that ALL the icon sprites are defined in mode 20
ZN� or mode 27 (which is equivalent) with a mask but no palette. They should
dN� still appear to have the expected resolutions and number of colours, i.e
nN� !Sprites23: two colours, high resolution, !Sprites (actually !Sprites24)
xL� at mode 12 resolution (double height pixels) in 16 colours, and normal
�L� mode 20 resolution, 16 colours for the !Sprites22 icon. If this is not
�I� adhered to, then memory shortage errors may occur on a mode change.
�Extension$="24"
�$� �ModeInfo("YEigFactor",-1)<2 �
�   � �ModeInfo("NCol",-1)>2 �
�    Extension$="22"
�  �
�    Extension$="23"
�  �
��
�*ș "Wimp_BaseOfSprites" � ,iconsprite%
�Eș "OS_SpriteOp",256+25,iconsprite%,Appname$:� Delete icon sprite
�=� The following three lines assume a mask but no palette:
bș "OS_SpriteOp",256+40,Sprites,Appname$+Extension$ � ,,,w,h,,mode:� Get info about new sprite
\ș "OS_SpriteOp",256+15,iconsprite%,Appname$,0,w,h,mode:� Create replacement icon sprite
?ș "XOS_SpriteOp",256+29,iconsprite%,Appname$:� Create mask
"  :
,-� Paint sprite mask into iconsprite mask:
6Qș "OS_SpriteOp",256+61,iconsprite%,Appname$,0 � r0,r1,r2,r3:� Output to mask
@Uș "OS_SpriteOp",256+49,Sprites,Appname$+Extension$,0,0:� Paint mask from Sprites
J7� 4,128:�:� Invert to make mask the right way round
T6ș "OS_SpriteOp",r0,r1,r2,r3:� Reset screen output
^  :
h#� Paint sprite into iconsprite:
r\ș "OS_SpriteOp",256+60,iconsprite%,Appname$,0 � r0,r1,r2,r3:� Output to new icon sprite
|Wș "OS_SpriteOp",256+34,Sprites,Appname$+Extension$,0,0,8:� Paint copy from Sprites
�6ș "OS_SpriteOp",r0,r1,r2,r3:� Reset screen output
�:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
�EBlock!8=0:Block!12=0:ș "Wimp_SetIconState",,Block:� Re-plot icon
��
�:
��� �CreateWindow(minX,minY,maxX,maxY,Xoffset,Yoffset,Handle,Flags,TitleCol,TitleBackCol,WorkCol,WorkBackCol,ScrollCol,SliderCol,InputCol,WminX,WminY,WmaxX,WmaxY,TitleFlags,Wbutton,SpritePoint,MinW,MinH,TitleData$)
�ZBlock!0=minX:Block!4=minY:Block!8=maxX:Block!12=maxY:Block!16=Xoffset:Block!20=Yoffset
�"Block!24=Handle:Block!28=Flags
�QBlock?32=TitleCol:Block?33=TitleBackCol:Block?34=WorkCol:Block?35=WorkBackCol
�FBlock?36=ScrollCol:Block?37=SliderCol:Block?38=InputCol:Block?39=0
�?Block!40=WminX:Block!44=WminY:Block!48=WmaxX:Block!52=WmaxY
�=Block!56=TitleFlags:Block!60=Wbutton:Block!64=SpritePoint
�_Block!68=(MinH<<15)+MinW :::::::::::: � 0,0 sets the minimum window with to the title width
>$(Block+72)=TitleData$:Block!84=0 ::: � No icons initially
0ș "Wimp_CreateWindow",,Block � WindowHandle
=WindowHandle
&:
0� �Initialise
:-AppSize=�-&8000:MinSize=AppSize:SlotEnd=�
D�
N:
X� �AllocateMemory(Required)
bSlotSize=�SlotSize(-1)
l�� SlotSize<Required � NewSize=�SlotSize(Required):� NewSize<Required � SlotSize=�SlotSize(AppSize):=0:� Returns, indicating memory not claimed
v6� SlotSize>Required � SlotSize=�SlotSize(Required)
�*=SlotSize:� Returns with bytes claimed
�:
�� �SlotSize(Bytes)
�'ș "Wimp_SlotSize",Bytes,-1 � Bytes
�
=Bytes
�:
�� �MinimiseWimpSlot
�"dummy=�AllocateMemory(MinSize)
��
�:
�"� �CloseFileIfPoss(FileHandle)
�� �
�&� � � � �:�:� Unable to close file
�#FileHandle
�
:
 � �FindFileSize(FileName$)
* � FileName$="<Wimp$Scrap>" �
4:  ș "OS_File",15,FileName$,,,FileName$ � ,,,,FileSize
>�
H4  N=-1:�:N+=1:� �FileName$,�(FileName$)-N,1)="."
RB  PathName$=�FileName$,�(FileName$)-N):LeafName$=�FileName$,N)
\:  ș "OS_File",13,LeafName$,,,PathName$ � ,,,,FileSize
f�
p
=FileSize
z:
�� �NextEntry
�H� Gets next entry (created by BPUT#Data,A$) from a file as a string.
�� Use as A$=FNNextEntry.
�� �
�&� � � � �:="":� Error reading file
�NE$=�#Data
�ȕ �NE$,1)="|"
�  NE$=�#Data
��
�=NE$
�:
�O� -------------------------------------------------------------------------
�/� Routines common to the OmniDesk utilities
O� -------------------------------------------------------------------------
:
� �DeclareToOmniDesk
$/Block!0=208:Block!12=0:Block!16=UtilDeclare
.Block!20=Task
8$(Block+24)=Taskname$
B$(Block+44)=OurFileName$
L)$(Block+55)=�OmniHelpMessage("CLICK")
V)$(Block+132)=�OmniHelpMessage("DRAG")
`+ș "Wimp_SendMessage",17,Block,OmniDesk
j�
t:
~� �SayGoodbye
�� OmniDesk=0 � �
�/Block!0=24:Block!12=0:Block!16=UtilQuitting
�Block!20=Task
�+ș "Wimp_SendMessage",17,Block,OmniDesk
��
�:
�� �ReadStartupString
�M� Returns task handle of OmniDesk (which is passed in the command string)
�&� or 0 if not started by OmniDesk.
�ș "OS_GetEnv" � Command$
�A=�Command$,"-Startup")
�� A<>0 � Startup=�
A=�Command$,"-Exit")

� A<>0 � Exit=�
A=�Command$,"-OmniDesk")
� A=0 � =0
(=�(�Command$,A+9))
2:
< � �ReadWindowLocation(Axis$)
FH� Reads which radio icon (if any) is selected in the Window Position
PH� selector window and returns the axis coordinate (two calls needed)
Z%� or -1 for no position selected.
d?Icon=5:�:Icon+=1:� (�SelectedState(Loc,Icon)=�) � (Icon=31)
n*� Icon=31 � =-1:� All icons deselected
x4Location=-1:Icon-=6:� Bring icon into range 0-14
�Ȏ Axis$ �
�!  � "X","x":Location=Icon � 5
�%  � "Y","y":Location=4-(Icon � 5)
��
�
=Location
�:
�� �CleanUpLocWindow
�O� Makes sure that none of the 'window' icons in the Loc window is selected.
�	N=5:�
�'N+=1:� N=30 � �SelectedState(Loc,N)
� �UpdateSelectedFlag(Loc,N,�)
��
�:
O� -------------------------------------------------------------------------
,� Special routines for this program only
O� -------------------------------------------------------------------------
":
,� �DoMag
6OXEigFactor=�ModeInfo("XEigFactor",-1):YEigFactor=�ModeInfo("YEigFactor",-1)
@#ș "Wimp_GetPointerInfo",,Block
JX=Block!0:Y=Block!4
T&� Set background to border colour:
^&ș "OS_ReadPalette",,24 � ,,Border
h-ș "ColourTrans_SetGCOL",Border,,,128+256
r&� 256 sets dithering, if available
|Cș "OS_SpriteOp",256+16,SlotEnd,"mag",0,X-200,Y-200,X+198,Y+198
�9ș "OS_SpriteOp",256+60,SlotEnd,"mag",0 � r0,r1,r2,r3
�� BlankMag �
�+  ș "ColourTrans_SetGCOL",Border,,,256
�B  � Set blanking rectangle to be the same as the border colour
�e  Block!0=Magnifier:ș "Wimp_GetWindowState",,Block:XL=Block!4:YB=Block!8:XR=Block!12:YT=Block!16
�-  ȓ Ȑ XL-X+201,YB-Y+201,XR-XL-2,YT-YB-2
��
�
� XHair �
�2  ș "Wimp_SetColour",(4<<4):� Set GCOL action
�  � 200,0:� 200,400
�  � 0,200:� 400,200
��
� ș "OS_SpriteOp",r0,r1,r2,r3
 DBlock!0=Magnifier:Block!4=0:Block!8=-400:Block!12=400:Block!16=0
 )ș "Wimp_UpdateWindow",,Block � flag%
 ȕ flag%
 &�  ș "OS_SpriteOp",256+52,SlotEnd,"mag",Block!4-((200*Scale!0)/Scale!8)+202-((Scale!0/Scale!8)*2^XEigFactor)/2,Block!8-((200*Scale!4)/Scale!12)+202-((Scale!4/Scale!12)*2^YEigFactor)/2,0,Scale
 0+  ș "Wimp_GetRectangle",,Block � flag%
 :�
 D�
 N:
 X� �CreateMagSprite
 b�MinimiseWimpSlot
 l  :
 vOXEigFactor=�ModeInfo("XEigFactor",-1):YEigFactor=�ModeInfo("YEigFactor",-1)
 �vXPixels=(2*2^XEigFactor)+(400/(2^XEigFactor)):YPixels=(2*2^YEigFactor)+(400/(2^YEigFactor)):Pixels=XPixels*YPixels
 �?SpriteBytes=(Pixels*(�ModeInfo("BPP",-1)/8))+(6*YPixels)+60
 �^� = Pixels*(bits per pixel/8) + 6 bytes wastage per row + 60 for sprite control area block
 �  :
 ��� �AllocateMemory(SpriteBytes+AppSize)=0 � MagError=�:�Close(Magnifier):� 9999,"There is not enough memory to make the magnifier sprite. Please free some more memory and try again."
 �  :
 �XSlotEnd!0=SpriteBytes:SlotEnd!8=16:ș "OS_SpriteOp",256+9,SlotEnd:� Init sprite area
 �yș "OS_SpriteOp",256+15,SlotEnd,"mag",0,(2*2^XEigFactor)+(400/(2^XEigFactor)),(2*2^YEigFactor)+(400/(2^YEigFactor)),�
 �#� Create initially empty sprite
 ��
 �:
 �� �SaveSettings
 �� �
!<� � � � �:�CloseFileIfPoss(Data):=�:� Error writing file
!  :
!)  Data=� ("<CloseView$Dir>.Settings")
! >  �#Data,"| X and Y grid coordinates of Magnifier window:"
!*  �#Data,�(XPosition)
!4  �#Data,�(YPosition)
!>'  �#Data,"| Magnification factors:"
!H!  �#Data,�ReadIconStr(Zoom,0)
!R!  �#Data,�ReadIconStr(Zoom,1)
!\=  �#Data,"| Show cross-hairs (-1 for TRUE, 0 for FALSE):"
!f&  �#Data,�(�SelectedState(Zoom,7))
!pD  �#Data,"| Recursive magnification (-1 for TRUE, 0 for FALSE):"
!z&  �#Data,�(�SelectedState(Zoom,8))
!�  �#Data
!�0  �("Settype <CloseView$Dir>.Settings Text")
!�  :
!�=�
!�:
!�� �LoadSettings
!�� �
!�O� � � � �:�CloseFileIfPoss(Data):=�:� 'Settings' file is damaged or missing
!�  :
!�'  Data=� "<CloseView$Dir>.Settings"
!�  XPosition=�(�NextEntry)
!�  YPosition=�(�NextEntry)
!�$  �UpdateIcon(Zoom,0,�NextEntry)
"$  �UpdateIcon(Zoom,1,�NextEntry)
"/  �UpdateSelectedFlag(Zoom,7,�(�NextEntry))
"/  �UpdateSelectedFlag(Zoom,8,�(�NextEntry))
"$  �#Data
".  :
"8Z  Scale!0=�ReadIcon(Zoom,0):Scale!4=Scale!0:Scale!8=�ReadIcon(Zoom,1):Scale!12=Scale!8
"B"  XHair=�SelectedState(Zoom,7)
"L(  BlankMag=�(�SelectedState(Zoom,7))
"Vb  � XPosition<>-1 � YPosition<>-1 � �UpdateSelectedFlag(Loc,6+((5*XPosition)+(4-YPosition)),�)
"`  :
"j=�
"t:
"~� �DefaultSettings
"�BlankMag=�
"�XHair=�
"�,Scale!0=2:Scale!4=2:Scale!8=1:Scale!12=1
"�XPosition=0:YPosition=4
"��UpdateIcon(Zoom,0,"2")
"��UpdateIcon(Zoom,1,"1")
"�%�UpdateSelectedFlag(Zoom,7,XHair)
"�*�UpdateSelectedFlag(Zoom,8,� BlankMag)
"�>�UpdateSelectedFlag(Loc,6+((5*XPosition)+(4-YPosition)),�)
"��
�
00000000  0d 00 0a 1e f4 20 3e 21  52 75 6e 49 6d 61 67 65  |..... >!RunImage|
00000010  20 66 6f 72 20 43 6c 6f  73 65 56 69 65 77 0d 00  | for CloseView..|
00000020  14 05 3a 0d 00 1e 48 56  65 72 73 69 6f 6e 4e 75  |..:...HVersionNu|
00000030  6d 62 65 72 24 3d 22 31  b7 30 34 20 28 33 31 20  |mber$="1.04 (31 |
00000040  4a 75 6c 79 20 31 39 39  33 29 22 3a 54 61 73 6b  |July 1993)":Task|
00000050  6e 61 6d 65 24 3d 22 43  6c 6f 73 65 56 69 65 77  |name$="CloseView|
00000060  a0 4d 61 67 6e 69 66 69  65 72 22 0d 00 28 1b 45  |.Magnifier"..(.E|
00000070  78 69 74 3d a3 3a 53 74  61 72 74 75 70 3d a3 3a  |xit=.:Startup=.:|
00000080  44 6f 6e 65 3d a3 0d 00  32 12 44 6f 4d 6f 64 65  |Done=...2.DoMode|
00000090  43 68 61 6e 67 65 3d a3  0d 00 3c 05 3a 0d 00 46  |Change=...<.:..F|
000000a0  2d de 20 42 6c 6f 63 6b  20 32 35 36 2c 4d 65 6e  |-. Block 256,Men|
000000b0  75 48 65 6c 70 20 31 36  2c 53 63 61 6c 65 20 31  |uHelp 16,Scale 1|
000000c0  36 2c 42 6f 72 64 65 72  20 34 0d 00 50 2f 49 6e  |6,Border 4..P/In|
000000d0  64 4d 65 6e 75 4d 61 78  3d 36 34 3a de 20 49 6e  |dMenuMax=64:. In|
000000e0  64 69 72 65 63 74 4d 65  6e 75 54 65 78 74 20 49  |directMenuText I|
000000f0  6e 64 4d 65 6e 75 4d 61  78 0d 00 5a 47 de 20 54  |ndMenuMax..ZG. T|
00000100  65 6d 70 6c 61 74 65 73  20 31 36 33 32 2c 49 6e  |emplates 1632,In|
00000110  66 6f 49 6e 64 20 32 30  32 2c 4d 61 67 6e 69 66  |foInd 202,Magnif|
00000120  69 65 72 49 6e 64 20 32  30 2c 5a 6f 6f 6d 49 6e  |ierInd 20,ZoomIn|
00000130  64 20 31 30 34 2c 4c 6f  63 49 6e 64 20 35 39 32  |d 104,LocInd 592|
00000140  0d 00 64 1c de 20 49 42  4d 65 6e 75 20 37 36 2c  |..d.. IBMenu 76,|
00000150  4d 61 69 6e 4d 65 6e 75  20 31 32 34 0d 00 6e 05  |MainMenu 124..n.|
00000160  3a 0d 00 78 2a f4 20 4d  65 73 73 61 67 65 73 20  |:..x*. Messages |
00000170  75 73 65 64 20 62 79 20  74 68 65 20 4f 6d 6e 69  |used by the Omni|
00000180  44 65 73 6b 20 73 75 69  74 65 3a 0d 00 82 5f 55  |Desk suite:..._U|
00000190  74 69 6c 44 65 63 6c 61  72 65 3d 26 38 32 35 43  |tilDeclare=&825C|
000001a0  30 3a 55 74 69 6c 4f 70  65 6e 3d 26 38 32 35 43  |0:UtilOpen=&825C|
000001b0  31 3a 55 74 69 6c 51 75  69 74 74 69 6e 67 3d 26  |1:UtilQuitting=&|
000001c0  38 32 35 43 32 3a 55 74  69 6c 52 65 73 69 64 65  |825C2:UtilReside|
000001d0  3d 26 38 32 35 43 33 3a  55 74 69 6c 41 63 6b 4c  |=&825C3:UtilAckL|
000001e0  6f 61 64 3d 26 38 32 35  43 34 0d 00 8c 2b f4 20  |oad=&825C4...+. |
000001f0  54 68 65 73 65 20 61 72  65 20 6f 66 66 69 63 69  |These are offici|
00000200  61 6c 20 41 63 6f 72 6e  20 61 6c 6c 6f 63 61 74  |al Acorn allocat|
00000210  69 6f 6e 73 2e 0d 00 96  05 3a 0d 00 a0 6e ee 20  |ions.....:...n. |
00000220  85 20 42 6c 6f 63 6b 21  30 3d 9f 3a 24 28 42 6c  |. Block!0=.:$(Bl|
00000230  6f 63 6b 2b 34 29 3d f6  24 2b 22 20 28 69 6e 74  |ock+4)=.$+" (int|
00000240  65 72 6e 61 6c 20 65 72  72 6f 72 20 63 6f 64 65  |ernal error code|
00000250  20 22 2b c3 28 9e 29 2b  22 29 22 2b bd 30 3a c8  | "+.(.)+")"+.0:.|
00000260  99 20 22 57 69 6d 70 5f  52 65 70 6f 72 74 45 72  |. "Wimp_ReportEr|
00000270  72 6f 72 22 2c 42 6c 6f  63 6b 2c 31 2c 54 61 73  |ror",Block,1,Tas|
00000280  6b 6e 61 6d 65 24 3a e0  0d 00 aa 05 3a 0d 00 b4  |kname$:.....:...|
00000290  3f 4f 6d 6e 69 44 65 73  6b 3d a4 52 65 61 64 53  |?OmniDesk=.ReadS|
000002a0  74 61 72 74 75 70 53 74  72 69 6e 67 3a f4 20 41  |tartupString:. A|
000002b0  6c 73 6f 20 61 73 73 69  67 6e 73 20 45 78 69 74  |lso assigns Exit|
000002c0  20 61 6e 64 20 53 74 61  72 74 75 70 0d 00 be 05  | and Startup....|
000002d0  3a 0d 00 c8 1b 2a 53 65  74 20 43 6c 6f 73 65 56  |:....*Set CloseV|
000002e0  69 65 77 24 52 49 53 43  4f 53 20 33 0d 00 d2 37  |iew$RISCOS 3...7|
000002f0  2a 52 4d 45 6e 73 75 72  65 20 55 74 69 6c 69 74  |*RMEnsure Utilit|
00000300  79 4d 6f 64 75 6c 65 20  33 2e 30 30 20 53 65 74  |yModule 3.00 Set|
00000310  20 43 6c 6f 73 65 56 69  65 77 24 52 49 53 43 4f  | CloseView$RISCO|
00000320  53 20 32 0d 00 dc 5a c8  99 20 22 58 4f 53 5f 52  |S 2...Z.. "XOS_R|
00000330  65 61 64 56 61 72 56 61  6c 22 2c 22 43 6c 6f 73  |eadVarVal","Clos|
00000340  65 56 69 65 77 24 52 49  53 43 4f 53 22 2c 42 6c  |eView$RISCOS",Bl|
00000350  6f 63 6b 2c 32 35 36 2c  30 2c 30 20 b8 20 2c 2c  |ock,256,0,0 . ,,|
00000360  6c 65 6e 3a 42 6c 6f 63  6b 3f 6c 65 6e 3d 31 33  |len:Block?len=13|
00000370  3a 77 69 6d 70 24 3d 24  42 6c 6f 63 6b 0d 00 e6  |:wimp$=$Block...|
00000380  1c e7 20 77 69 6d 70 24  3c 3e 22 33 22 20 8c 20  |.. wimp$<>"3" . |
00000390  77 69 6d 70 24 3d 22 32  22 0d 00 f0 1b 2a 55 6e  |wimp$="2"....*Un|
000003a0  73 65 74 20 43 6c 6f 73  65 56 69 65 77 24 52 49  |set CloseView$RI|
000003b0  53 43 4f 53 0d 00 fa 59  c8 99 20 22 58 4f 53 5f  |SCOS...Y.. "XOS_|
000003c0  52 65 61 64 56 61 72 56  61 6c 22 2c 22 4f 62 65  |ReadVarVal","Obe|
000003d0  79 24 44 69 72 22 2c 42  6c 6f 63 6b 2c 32 35 36  |y$Dir",Block,256|
000003e0  2c 30 2c 30 20 b8 20 2c  2c 6c 65 6e 3a 42 6c 6f  |,0,0 . ,,len:Blo|
000003f0  63 6b 3f 6c 65 6e 3d 31  33 3a 4f 75 72 46 69 6c  |ck?len=13:OurFil|
00000400  65 4e 61 6d 65 24 3d 24  42 6c 6f 63 6b 0d 01 04  |eName$=$Block...|
00000410  38 4e 3d 2d 31 3a f5 3a  4e 2b 3d 31 3a fd 20 c1  |8N=-1:.:N+=1:. .|
00000420  4f 75 72 46 69 6c 65 4e  61 6d 65 24 2c a9 28 4f  |OurFileName$,.(O|
00000430  75 72 46 69 6c 65 4e 61  6d 65 24 29 2d 4e 2c 31  |urFileName$)-N,1|
00000440  29 3d 22 2e 22 0d 01 0e  4f 4f 75 72 50 61 74 68  |)="."...OOurPath|
00000450  4e 61 6d 65 24 3d c0 4f  75 72 46 69 6c 65 4e 61  |Name$=.OurFileNa|
00000460  6d 65 24 2c a9 28 4f 75  72 46 69 6c 65 4e 61 6d  |me$,.(OurFileNam|
00000470  65 24 29 2d 4e 29 3a 4f  75 72 46 69 6c 65 4e 61  |e$)-N):OurFileNa|
00000480  6d 65 24 3d c2 4f 75 72  46 69 6c 65 4e 61 6d 65  |me$=.OurFileName|
00000490  24 2c 4e 29 0d 01 18 05  3a 0d 01 22 5e f4 20 52  |$,N)....:.."^. R|
000004a0  65 61 64 20 73 69 7a 65  20 6f 66 20 73 70 72 69  |ead size of spri|
000004b0  74 65 20 66 69 6c 65 20  61 6e 64 20 6c 6f 61 64  |te file and load|
000004c0  20 69 74 2e 20 57 65 20  6e 65 65 64 20 74 6f 20  | it. We need to |
000004d0  44 49 4d 20 31 36 20 62  79 74 65 73 20 6d 6f 72  |DIM 16 bytes mor|
000004e0  65 20 74 68 61 6e 20 74  68 65 20 66 69 6c 65 27  |e than the file'|
000004f0  73 20 73 69 7a 65 2e 0d  01 2c 3a c8 99 20 22 4f  |s size...,:.. "O|
00000500  53 5f 46 53 43 6f 6e 74  72 6f 6c 22 2c 32 38 2c  |S_FSControl",28,|
00000510  22 3c 43 6c 6f 73 65 56  69 65 77 24 44 69 72 3e  |"<CloseView$Dir>|
00000520  2e 53 70 72 69 74 65 73  22 20 b8 20 2c 2c 6c 65  |.Sprites" . ,,le|
00000530  6e 0d 01 36 85 de 20 53  70 72 69 74 65 73 20 6c  |n..6.. Sprites l|
00000540  65 6e 2b 31 36 3a 21 53  70 72 69 74 65 73 3d 6c  |en+16:!Sprites=l|
00000550  65 6e 2b 31 36 3a 53 70  72 69 74 65 73 21 34 3d  |en+16:Sprites!4=|
00000560  30 3a 53 70 72 69 74 65  73 21 38 3d 31 36 3a 53  |0:Sprites!8=16:S|
00000570  70 72 69 74 65 73 21 31  32 3d 31 36 3a c8 99 20  |prites!12=16:.. |
00000580  22 4f 53 5f 53 70 72 69  74 65 4f 70 22 2c 32 35  |"OS_SpriteOp",25|
00000590  36 2b 31 30 2c 53 70 72  69 74 65 73 2c 22 3c 43  |6+10,Sprites,"<C|
000005a0  6c 6f 73 65 56 69 65 77  24 44 69 72 3e 2e 53 70  |loseView$Dir>.Sp|
000005b0  72 69 74 65 73 22 0d 01  40 05 3a 0d 01 4a 11 e7  |rites"..@.:..J..|
000005c0  20 77 69 6d 70 24 3d 22  33 22 20 8c 0d 01 54 17  | wimp$="3" ...T.|
000005d0  20 20 de 20 6d 65 73 73  61 67 65 6c 69 73 74 25  |  . messagelist%|
000005e0  20 32 38 0d 01 5e 2f 20  20 6d 65 73 73 61 67 65  | 28..^/  message|
000005f0  6c 69 73 74 25 21 30 3d  26 35 30 32 3a 6d 65 73  |list%!0=&502:mes|
00000600  73 61 67 65 6c 69 73 74  25 21 34 3d 26 34 30 30  |sagelist%!4=&400|
00000610  43 31 0d 01 68 3a 20 20  6d 65 73 73 61 67 65 6c  |C1..h:  messagel|
00000620  69 73 74 25 21 38 3d 55  74 69 6c 4f 70 65 6e 3a  |ist%!8=UtilOpen:|
00000630  6d 65 73 73 61 67 65 6c  69 73 74 25 21 31 32 3d  |messagelist%!12=|
00000640  55 74 69 6c 51 75 69 74  74 69 6e 67 0d 01 72 45  |UtilQuitting..rE|
00000650  20 20 6d 65 73 73 61 67  65 6c 69 73 74 25 21 31  |  messagelist%!1|
00000660  36 3d 55 74 69 6c 52 65  73 69 64 65 3a 6d 65 73  |6=UtilReside:mes|
00000670  73 61 67 65 6c 69 73 74  25 21 32 30 3d 31 30 3a  |sagelist%!20=10:|
00000680  6d 65 73 73 61 67 65 6c  69 73 74 25 21 32 34 3d  |messagelist%!24=|
00000690  30 0d 01 7c 4b 20 20 c8  99 20 22 57 69 6d 70 5f  |0..|K  .. "Wimp_|
000006a0  49 6e 69 74 69 61 6c 69  73 65 22 2c 33 30 30 2c  |Initialise",300,|
000006b0  26 34 42 35 33 34 31 35  34 2c 54 61 73 6b 6e 61  |&4B534154,Taskna|
000006c0  6d 65 24 2c 6d 65 73 73  61 67 65 6c 69 73 74 25  |me$,messagelist%|
000006d0  20 b8 20 77 69 6d 70 2c  54 61 73 6b 0d 01 86 05  | . wimp,Task....|
000006e0  cc 0d 01 90 3e 20 20 c8  99 20 22 57 69 6d 70 5f  |....>  .. "Wimp_|
000006f0  49 6e 69 74 69 61 6c 69  73 65 22 2c 32 30 30 2c  |Initialise",200,|
00000700  26 34 42 35 33 34 31 35  34 2c 54 61 73 6b 6e 61  |&4B534154,Taskna|
00000710  6d 65 24 20 b8 20 77 69  6d 70 2c 54 61 73 6b 0d  |me$ . wimp,Task.|
00000720  01 9a 05 cd 0d 01 a4 05  3a 0d 01 ae 22 c8 99 20  |........:...".. |
00000730  22 49 6e 74 65 72 66 61  63 65 5f 49 6e 69 74 69  |"Interface_Initi|
00000740  61 6c 69 73 65 22 2c 54  61 73 6b 0d 01 b8 05 3a  |alise",Task....:|
00000750  0d 01 c2 37 c8 99 20 22  57 69 6d 70 5f 4f 70 65  |...7.. "Wimp_Ope|
00000760  6e 54 65 6d 70 6c 61 74  65 22 2c 2c 22 3c 43 6c  |nTemplate",,"<Cl|
00000770  6f 73 65 56 69 65 77 24  44 69 72 3e 2e 54 65 6d  |oseView$Dir>.Tem|
00000780  70 6c 61 74 65 73 22 0d  01 cc 45 c8 99 20 22 57  |plates"...E.. "W|
00000790  69 6d 70 5f 4c 6f 61 64  54 65 6d 70 6c 61 74 65  |imp_LoadTemplate|
000007a0  22 2c 2c 54 65 6d 70 6c  61 74 65 73 2c 49 6e 66  |",,Templates,Inf|
000007b0  6f 49 6e 64 2c 49 6e 66  6f 49 6e 64 2b 32 30 32  |oInd,InfoInd+202|
000007c0  2c 2d 31 2c 22 49 6e 66  6f 22 2c 30 0d 01 d6 2c  |,-1,"Info",0...,|
000007d0  c8 99 20 22 57 69 6d 70  5f 43 72 65 61 74 65 57  |.. "Wimp_CreateW|
000007e0  69 6e 64 6f 77 22 2c 2c  54 65 6d 70 6c 61 74 65  |indow",,Template|
000007f0  73 20 b8 20 49 6e 66 6f  0d 01 e0 53 c8 99 20 22  |s . Info...S.. "|
00000800  57 69 6d 70 5f 4c 6f 61  64 54 65 6d 70 6c 61 74  |Wimp_LoadTemplat|
00000810  65 22 2c 2c 54 65 6d 70  6c 61 74 65 73 2c 4d 61  |e",,Templates,Ma|
00000820  67 6e 69 66 69 65 72 49  6e 64 2c 4d 61 67 6e 69  |gnifierInd,Magni|
00000830  66 69 65 72 49 6e 64 2b  32 30 2c 2d 31 2c 22 4d  |fierInd+20,-1,"M|
00000840  61 67 6e 69 66 69 65 72  22 2c 30 0d 01 ea 31 c8  |agnifier",0...1.|
00000850  99 20 22 57 69 6d 70 5f  43 72 65 61 74 65 57 69  |. "Wimp_CreateWi|
00000860  6e 64 6f 77 22 2c 2c 54  65 6d 70 6c 61 74 65 73  |ndow",,Templates|
00000870  20 b8 20 4d 61 67 6e 69  66 69 65 72 0d 01 f4 5c  | . Magnifier...\|
00000880  c8 99 20 22 57 69 6d 70  5f 4c 6f 61 64 54 65 6d  |.. "Wimp_LoadTem|
00000890  70 6c 61 74 65 22 2c 2c  54 65 6d 70 6c 61 74 65  |plate",,Template|
000008a0  73 2c 4c 6f 63 49 6e 64  2c 4c 6f 63 49 6e 64 2b  |s,LocInd,LocInd+|
000008b0  35 39 32 2c 2d 31 2c 22  57 69 6e 64 6f 77 58 59  |592,-1,"WindowXY|
000008c0  22 2c 30 3a 54 65 6d 70  6c 61 74 65 73 21 36 34  |",0:Templates!64|
000008d0  3d 53 70 72 69 74 65 73  0d 01 fe 2b c8 99 20 22  |=Sprites...+.. "|
000008e0  57 69 6d 70 5f 43 72 65  61 74 65 57 69 6e 64 6f  |Wimp_CreateWindo|
000008f0  77 22 2c 2c 54 65 6d 70  6c 61 74 65 73 20 b8 20  |w",,Templates . |
00000900  4c 6f 63 0d 02 08 5a c8  99 20 22 57 69 6d 70 5f  |Loc...Z.. "Wimp_|
00000910  4c 6f 61 64 54 65 6d 70  6c 61 74 65 22 2c 2c 54  |LoadTemplate",,T|
00000920  65 6d 70 6c 61 74 65 73  2c 5a 6f 6f 6d 49 6e 64  |emplates,ZoomInd|
00000930  2c 5a 6f 6f 6d 49 6e 64  2b 31 30 34 2c 2d 31 2c  |,ZoomInd+104,-1,|
00000940  22 5a 6f 6f 6d 22 2c 30  3a 54 65 6d 70 6c 61 74  |"Zoom",0:Templat|
00000950  65 73 21 36 34 3d 53 70  72 69 74 65 73 0d 02 12  |es!64=Sprites...|
00000960  2c c8 99 20 22 57 69 6d  70 5f 43 72 65 61 74 65  |,.. "Wimp_Create|
00000970  57 69 6e 64 6f 77 22 2c  2c 54 65 6d 70 6c 61 74  |Window",,Templat|
00000980  65 73 20 b8 20 5a 6f 6f  6d 0d 02 1c 1b c8 99 20  |es . Zoom...... |
00000990  22 57 69 6d 70 5f 43 6c  6f 73 65 54 65 6d 70 6c  |"Wimp_CloseTempl|
000009a0  61 74 65 22 0d 02 26 05  3a 0d 02 30 0f f2 42 75  |ate"..&.:..0..Bu|
000009b0  69 6c 64 4d 65 6e 75 73  0d 02 3a 0e 4d 61 67 45  |ildMenus..:.MagE|
000009c0  72 72 6f 72 3d a3 0d 02  44 05 3a 0d 02 4e 12 e7  |rror=...D.:..N..|
000009d0  20 4f 6d 6e 69 44 65 73  6b 3d 30 20 8c 0d 02 58  | OmniDesk=0 ...X|
000009e0  20 20 20 f4 20 50 75 74  20 49 63 6f 6e 20 6f 6e  |   . Put Icon on|
000009f0  20 74 68 65 20 69 63 6f  6e 2d 62 61 72 0d 02 62  | the icon-bar..b|
00000a00  10 20 20 42 6c 6f 63 6b  21 30 3d 2d 31 0d 02 6c  |.  Block!0=-1..l|
00000a10  31 20 20 42 6c 6f 63 6b  21 34 3d 30 3a 42 6c 6f  |1  Block!4=0:Blo|
00000a20  63 6b 21 38 3d 30 3a 42  6c 6f 63 6b 21 31 32 3d  |ck!8=0:Block!12=|
00000a30  36 38 3a 42 6c 6f 63 6b  21 31 36 3d 36 38 0d 02  |68:Block!16=68..|
00000a40  76 35 20 20 42 6c 6f 63  6b 21 32 30 3d 26 31 37  |v5  Block!20=&17|
00000a50  30 30 33 30 30 32 3a 24  28 42 6c 6f 63 6b 2b 32  |003002:$(Block+2|
00000a60  34 29 3d 22 21 43 6c 6f  73 65 56 69 65 77 22 2b  |4)="!CloseView"+|
00000a70  bd 31 33 0d 02 80 2b 20  20 c8 99 20 22 57 69 6d  |.13...+  .. "Wim|
00000a80  70 5f 43 72 65 61 74 65  49 63 6f 6e 22 2c 2c 42  |p_CreateIcon",,B|
00000a90  6c 6f 63 6b 20 b8 20 49  63 6f 6e 42 61 72 0d 02  |lock . IconBar..|
00000aa0  8a 05 cd 0d 02 94 05 3a  0d 02 9e 0f f2 49 6e 69  |.......:.....Ini|
00000ab0  74 69 61 6c 69 73 65 0d  02 a8 26 e7 20 4f 6d 6e  |tialise...&. Omn|
00000ac0  69 44 65 73 6b 3c 3e 30  20 8c 20 f2 44 65 63 6c  |iDesk<>0 . .Decl|
00000ad0  61 72 65 54 6f 4f 6d 6e  69 44 65 73 6b 0d 02 b2  |areToOmniDesk...|
00000ae0  52 e7 20 53 74 61 72 74  75 70 20 8c 20 44 6f 6e  |R. Startup . Don|
00000af0  65 3d b9 3a f4 20 27 2d  53 74 61 72 74 75 70 27  |e=.:. '-Startup'|
00000b00  20 70 61 72 61 6d 65 74  65 72 20 6d 65 61 6e 73  | parameter means|
00000b10  20 27 64 65 63 6c 61 72  65 20 61 6e 64 20 64 69  | 'declare and di|
00000b20  65 20 69 6d 6d 65 64 69  61 74 65 6c 79 27 2e 0d  |e immediately'..|
00000b30  02 bc 05 3a 0d 02 c6 26  f2 55 70 64 61 74 65 49  |...:...&.UpdateI|
00000b40  63 6f 6e 28 49 6e 66 6f  2c 33 2c 56 65 72 73 69  |con(Info,3,Versi|
00000b50  6f 6e 4e 75 6d 62 65 72  24 29 0d 02 d0 36 f2 4d  |onNumber$)...6.M|
00000b60  6f 64 65 43 68 61 6e 67  65 3a f4 20 54 6f 20 75  |odeChange:. To u|
00000b70  70 64 61 74 65 20 69 63  6f 6e 2d 62 61 72 20 69  |pdate icon-bar i|
00000b80  63 6f 6e 20 69 66 20 6e  65 63 65 73 73 61 72 79  |con if necessary|
00000b90  0d 02 da 15 f2 43 6c 65  61 6e 55 70 4c 6f 63 57  |.....CleanUpLocW|
00000ba0  69 6e 64 6f 77 0d 02 e4  05 3a 0d 02 ee 1e 52 65  |indow....:....Re|
00000bb0  61 64 45 72 72 6f 72 3d  ac 28 a4 4c 6f 61 64 53  |adError=.(.LoadS|
00000bc0  65 74 74 69 6e 67 73 29  0d 02 f8 05 3a 0d 03 02  |ettings)....:...|
00000bd0  0e ee 20 85 20 f2 45 72  72 6f 72 0d 03 0c 94 e7  |.. . .Error.....|
00000be0  20 52 65 61 64 45 72 72  6f 72 20 8c 20 52 65 61  | ReadError . Rea|
00000bf0  64 45 72 72 6f 72 3d a3  3a f2 44 65 66 61 75 6c  |dError=.:.Defaul|
00000c00  74 53 65 74 74 69 6e 67  73 3a 85 20 39 39 39 39  |tSettings:. 9999|
00000c10  2c 22 41 6e 20 65 72 72  6f 72 20 6f 63 63 75 72  |,"An error occur|
00000c20  72 65 64 20 77 68 69 6c  73 74 20 72 65 61 64 69  |red whilst readi|
00000c30  6e 67 20 74 68 65 20 73  65 74 74 69 6e 67 73 20  |ng the settings |
00000c40  66 69 6c 65 2e 20 44 65  66 61 75 6c 74 20 73 65  |file. Default se|
00000c50  74 74 69 6e 67 73 20 77  69 6c 6c 20 74 68 65 72  |ttings will ther|
00000c60  65 66 6f 72 65 20 62 65  20 75 73 65 64 2e 22 0d  |efore be used.".|
00000c70  03 16 05 3a 0d 03 20 17  f4 20 4d 61 69 6e 20 70  |...:.. .. Main p|
00000c80  72 6f 67 72 61 6d 20 6c  6f 6f 70 0d 03 2a 05 f5  |rogram loop..*..|
00000c90  0d 03 34 32 20 20 c8 99  20 22 57 69 6d 70 5f 50  |..42  .. "Wimp_P|
00000ca0  6f 6c 6c 22 2c 25 31 31  30 30 30 30 30 31 31 30  |oll",%1100000110|
00000cb0  30 30 30 2c 42 6c 6f 63  6b 20 b8 20 52 65 61 73  |000,Block . Reas|
00000cc0  6f 6e 0d 03 3e 26 20 20  c8 99 20 22 49 6e 74 65  |on..>&  .. "Inte|
00000cd0  72 66 61 63 65 5f 50 6f  6c 6c 22 2c 52 65 61 73  |rface_Poll",Reas|
00000ce0  6f 6e 2c 2c 54 61 73 6b  0d 03 48 34 20 20 c8 99  |on,,Task..H4  ..|
00000cf0  20 22 49 6e 74 65 72 66  61 63 65 5f 50 72 65 50  | "Interface_PreP|
00000d00  72 6f 63 65 73 73 4b 65  79 22 2c 52 65 61 73 6f  |rocessKey",Reaso|
00000d10  6e 2c 42 6c 6f 63 6b 2c  54 61 73 6b 0d 03 52 11  |n,Block,Task..R.|
00000d20  20 20 c8 8e 20 52 65 61  73 6f 6e 20 ca 0d 03 5c  |  .. Reason ...\|
00000d30  2e 20 20 20 20 c9 20 30  20 3a 20 e7 20 a4 4f 70  |.    . 0 : . .Op|
00000d40  65 6e 53 74 61 74 65 28  4d 61 67 6e 69 66 69 65  |enState(Magnifie|
00000d50  72 29 20 8c 20 f2 44 6f  4d 61 67 0d 03 66 62 20  |r) . .DoMag..fb |
00000d60  20 20 20 20 20 20 20 20  20 20 20 20 e7 20 44 6f  |            . Do|
00000d70  4d 6f 64 65 43 68 61 6e  67 65 20 8c 20 e7 20 a4  |ModeChange . . .|
00000d80  4f 70 65 6e 53 74 61 74  65 28 4d 61 67 6e 69 66  |OpenState(Magnif|
00000d90  69 65 72 29 20 8c 20 f2  4f 70 65 6e 28 4d 61 67  |ier) . .Open(Mag|
00000da0  6e 69 66 69 65 72 2c a3  2c 58 50 6f 73 69 74 69  |nifier,.,XPositi|
00000db0  6f 6e 2c 59 50 6f 73 69  74 69 6f 6e 29 0d 03 70  |on,YPosition)..p|
00000dc0  15 20 20 20 20 c9 20 31  20 3a 20 f2 52 65 64 72  |.    . 1 : .Redr|
00000dd0  61 77 0d 03 7a 29 20 20  20 20 c9 20 32 20 3a 20  |aw..z)    . 2 : |
00000de0  c8 99 20 22 57 69 6d 70  5f 4f 70 65 6e 57 69 6e  |.. "Wimp_OpenWin|
00000df0  64 6f 77 22 2c 2c 42 6c  6f 63 6b 0d 03 84 52 20  |dow",,Block...R |
00000e00  20 20 20 c9 20 33 20 3a  20 c8 99 20 22 57 69 6d  |   . 3 : .. "Wim|
00000e10  70 5f 43 6c 6f 73 65 57  69 6e 64 6f 77 22 2c 2c  |p_CloseWindow",,|
00000e20  42 6c 6f 63 6b 3a e7 20  42 6c 6f 63 6b 21 30 3d  |Block:. Block!0=|
00000e30  4d 61 67 6e 69 66 69 65  72 20 8c 20 f2 4d 69 6e  |Magnifier . .Min|
00000e40  69 6d 69 73 65 57 69 6d  70 53 6c 6f 74 0d 03 8e  |imiseWimpSlot...|
00000e50  50 20 20 20 20 20 20 20  20 20 20 20 20 20 f4 20  |P             . |
00000e60  46 6f 72 67 65 74 20 74  68 65 20 73 70 72 69 74  |Forget the sprit|
00000e70  65 20 61 6e 64 20 72 65  6c 65 61 73 65 20 74 68  |e and release th|
00000e80  65 20 6d 65 6d 6f 72 79  20 69 66 20 77 65 20 64  |e memory if we d|
00000e90  6f 6e 27 74 20 6e 65 65  64 20 69 74 2e 0d 03 98  |on't need it....|
00000ea0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 e7 20  |              . |
00000eb0  45 78 69 74 20 8c 20 44  6f 6e 65 3d b9 0d 03 a2  |Exit . Done=....|
00000ec0  1a 20 20 20 20 c9 20 36  20 3a 20 f2 4d 6f 75 73  |.    . 6 : .Mous|
00000ed0  65 42 75 74 74 6f 6e 0d  03 ac 19 20 20 20 20 c9  |eButton....    .|
00000ee0  20 38 20 3a 20 f2 4b 65  79 50 72 65 73 73 65 64  | 8 : .KeyPressed|
00000ef0  0d 03 b6 19 20 20 20 20  c9 20 39 20 3a 20 f2 44  |....    . 9 : .D|
00000f00  65 63 6f 64 65 4d 65 6e  75 0d 03 c0 24 20 20 20  |ecodeMenu...$   |
00000f10  20 c9 20 31 37 2c 31 38  2c 31 39 20 3a 20 f2 52  | . 17,18,19 : .R|
00000f20  65 63 69 65 76 65 4d 65  73 73 61 67 65 0d 03 ca  |ecieveMessage...|
00000f30  07 20 20 cb 0d 03 d4 0a  fd 20 44 6f 6e 65 0d 03  |.  ...... Done..|
00000f40  de 0f f2 53 61 79 47 6f  6f 64 62 79 65 0d 03 e8  |...SayGoodbye...|
00000f50  21 c8 99 20 22 49 6e 74  65 72 66 61 63 65 5f 43  |!.. "Interface_C|
00000f60  6c 6f 73 65 44 6f 77 6e  22 2c 54 61 73 6b 0d 03  |loseDown",Task..|
00000f70  f2 26 c8 99 20 22 57 69  6d 70 5f 43 6c 6f 73 65  |.&.. "Wimp_Close|
00000f80  44 6f 77 6e 22 2c 54 61  73 6b 2c 26 34 42 35 33  |Down",Task,&4B53|
00000f90  34 31 35 34 0d 03 fc 05  e0 0d 04 06 05 3a 0d 04  |4154.........:..|
00000fa0  10 0c dd 20 f2 45 72 72  6f 72 0d 04 1a 1c 43 6c  |... .Error....Cl|
00000fb0  69 63 6b 3d 30 3a 42 6c  6f 63 6b 21 30 3d 9f 3a  |ick=0:Block!0=.:|
00000fc0  c8 8e 20 9f 20 ca 0d 04  24 1b 20 20 c9 20 39 39  |.. . ...$.  . 99|
00000fd0  39 39 3a f4 20 43 75 73  74 6f 6d 20 65 72 72 6f  |99:. Custom erro|
00000fe0  72 0d 04 2e 18 20 20 20  20 24 28 42 6c 6f 63 6b  |r....    $(Block|
00000ff0  2b 34 29 3d f6 24 2b bd  30 0d 04 38 3e 20 20 20  |+4)=.$+.0..8>   |
00001000  20 c8 99 20 22 57 69 6d  70 5f 52 65 70 6f 72 74  | .. "Wimp_Report|
00001010  45 72 72 6f 72 22 2c 42  6c 6f 63 6b 2c 31 37 2c  |Error",Block,17,|
00001020  22 4e 6f 74 69 63 65 20  66 72 6f 6d 20 43 6c 6f  |"Notice from Clo|
00001030  73 65 56 69 65 77 22 0d  04 42 07 20 20 7f 0d 04  |seView"..B.  ...|
00001040  4c 76 20 20 20 20 24 28  42 6c 6f 63 6b 2b 34 29  |Lv    $(Block+4)|
00001050  3d f6 24 2b 22 20 28 69  6e 74 65 72 6e 61 6c 20  |=.$+" (internal |
00001060  65 72 72 6f 72 20 63 6f  64 65 20 22 2b c3 9e 2b  |error code "+..+|
00001070  22 29 2e 20 43 6c 69 63  6b 20 6f 6e 20 4f 4b 20  |"). Click on OK |
00001080  74 6f 20 63 6f 6e 74 69  6e 75 65 2c 20 6f 72 20  |to continue, or |
00001090  43 61 6e 63 65 6c 20 74  6f 20 74 65 72 6d 69 6e  |Cancel to termin|
000010a0  61 74 65 20 74 68 65 20  70 72 6f 67 72 61 6d 2e  |ate the program.|
000010b0  22 2b bd 30 0d 04 56 38  20 20 20 20 c8 99 20 22  |"+.0..V8    .. "|
000010c0  57 69 6d 70 5f 52 65 70  6f 72 74 45 72 72 6f 72  |Wimp_ReportError|
000010d0  22 2c 42 6c 6f 63 6b 2c  33 2c 54 61 73 6b 6e 61  |",Block,3,Taskna|
000010e0  6d 65 24 20 b8 20 2c 43  6c 69 63 6b 0d 04 60 05  |me$ . ,Click..`.|
000010f0  cb 0d 04 6a 5e e7 20 43  6c 69 63 6b 3d 32 20 8c  |...j^. Click=2 .|
00001100  20 f2 53 61 79 47 6f 6f  64 62 79 65 3a c8 99 20  | .SayGoodbye:.. |
00001110  22 49 6e 74 65 72 66 61  63 65 5f 43 6c 6f 73 65  |"Interface_Close|
00001120  44 6f 77 6e 22 2c 54 61  73 6b 3a c8 99 20 22 57  |Down",Task:.. "W|
00001130  69 6d 70 5f 43 6c 6f 73  65 44 6f 77 6e 22 2c 54  |imp_CloseDown",T|
00001140  61 73 6b 2c 26 34 42 35  33 34 31 35 34 3a e0 0d  |ask,&4B534154:..|
00001150  04 74 05 e1 0d 04 7e 05  3a 0d 04 88 2e dd 20 f2  |.t....~.:..... .|
00001160  4f 70 65 6e 28 57 69 6e  64 6f 77 48 61 6e 64 6c  |Open(WindowHandl|
00001170  65 2c 54 6f 70 4f 66 53  74 61 63 6b 2c 61 63 72  |e,TopOfStack,acr|
00001180  6f 73 73 2c 75 70 29 0d  04 92 18 42 6c 6f 63 6b  |oss,up)....Block|
00001190  21 30 3d 57 69 6e 64 6f  77 48 61 6e 64 6c 65 0d  |!0=WindowHandle.|
000011a0  04 9c 23 c8 99 20 22 57  69 6d 70 5f 47 65 74 57  |..#.. "Wimp_GetW|
000011b0  69 6e 64 6f 77 53 74 61  74 65 22 2c 2c 42 6c 6f  |indowState",,Blo|
000011c0  63 6b 0d 04 a6 4a e7 20  28 61 63 72 6f 73 73 3c  |ck...J. (across<|
000011d0  3e 2d 31 29 20 80 20 28  61 63 72 6f 73 73 3c 3e  |>-1) . (across<>|
000011e0  2d 31 29 20 8c 20 f2 44  65 63 69 64 65 57 69 6e  |-1) . .DecideWin|
000011f0  64 6f 77 50 6f 73 69 74  69 6f 6e 28 42 6c 6f 63  |dowPosition(Bloc|
00001200  6b 2c 61 63 72 6f 73 73  2c 75 70 29 0d 04 b0 1e  |k,across,up)....|
00001210  e7 20 54 6f 70 4f 66 53  74 61 63 6b 20 8c 20 42  |. TopOfStack . B|
00001220  6c 6f 63 6b 21 32 38 3d  2d 31 0d 04 ba 1f c8 99  |lock!28=-1......|
00001230  20 22 57 69 6d 70 5f 4f  70 65 6e 57 69 6e 64 6f  | "Wimp_OpenWindo|
00001240  77 22 2c 2c 42 6c 6f 63  6b 0d 04 c4 05 e1 0d 04  |w",,Block.......|
00001250  ce 05 3a 0d 04 d8 1a dd  20 f2 43 6c 6f 73 65 28  |..:..... .Close(|
00001260  57 69 6e 64 6f 77 48 61  6e 64 6c 65 29 0d 04 e2  |WindowHandle)...|
00001270  18 42 6c 6f 63 6b 21 30  3d 57 69 6e 64 6f 77 48  |.Block!0=WindowH|
00001280  61 6e 64 6c 65 0d 04 ec  23 c8 99 20 22 57 69 6d  |andle...#.. "Wim|
00001290  70 5f 47 65 74 57 69 6e  64 6f 77 53 74 61 74 65  |p_GetWindowState|
000012a0  22 2c 2c 42 6c 6f 63 6b  0d 04 f6 20 c8 99 20 22  |",,Block... .. "|
000012b0  57 69 6d 70 5f 43 6c 6f  73 65 57 69 6e 64 6f 77  |Wimp_CloseWindow|
000012c0  22 2c 2c 42 6c 6f 63 6b  0d 05 00 05 e1 0d 05 0a  |",,Block........|
000012d0  05 3a 0d 05 14 2c dd 20  f2 44 65 63 69 64 65 57  |.:...,. .DecideW|
000012e0  69 6e 64 6f 77 50 6f 73  69 74 69 6f 6e 28 42 6c  |indowPosition(Bl|
000012f0  6f 63 6b 2c 61 63 72 6f  73 73 2c 75 70 29 0d 05  |ock,across,up)..|
00001300  1e 4c f4 20 55 73 65 20  6f 66 20 74 68 69 73 20  |.L. Use of this |
00001310  70 72 6f 63 65 64 75 72  65 20 6c 65 74 73 20 79  |procedure lets y|
00001320  6f 75 20 6f 70 65 6e 20  77 69 6e 64 6f 77 73 20  |ou open windows |
00001330  6f 6e 20 61 6e 20 69 6e  76 69 73 69 62 6c 65 20  |on an invisible |
00001340  67 72 69 64 20 77 68 69  63 68 0d 05 28 49 f4 20  |grid which..(I. |
00001350  61 75 74 6f 6d 61 74 69  63 61 6c 6c 79 20 66 69  |automatically fi|
00001360  74 73 20 69 74 73 65 6c  66 20 74 6f 20 74 68 65  |ts itself to the|
00001370  20 73 63 72 65 65 6e 20  6d 6f 64 65 20 69 6e 20  | screen mode in |
00001380  75 73 65 2e 20 54 68 65  72 65 20 61 72 65 20 66  |use. There are f|
00001390  69 76 65 0d 05 32 4a f4  20 70 6f 73 69 74 69 6f  |ive..2J. positio|
000013a0  6e 73 20 61 63 72 6f 73  73 20 28 6c 65 66 74 2c  |ns across (left,|
000013b0  20 6d 69 64 2d 6c 65 66  74 2c 20 63 65 6e 74 72  | mid-left, centr|
000013c0  65 2c 20 6d 69 64 2d 72  69 67 68 74 2c 20 72 69  |e, mid-right, ri|
000013d0  67 68 74 29 20 61 6e 64  20 66 69 76 65 0d 05 3c  |ght) and five..<|
000013e0  47 f4 20 70 6f 73 69 74  69 6f 6e 73 20 75 70 20  |G. positions up |
000013f0  28 62 6f 74 74 6f 6d 20  6f 66 20 73 63 72 65 65  |(bottom of scree|
00001400  6e 2c 20 61 62 6f 76 65  20 69 63 6f 6e 2d 62 61  |n, above icon-ba|
00001410  72 2c 20 63 65 6e 74 72  65 20 6f 66 20 73 63 72  |r, centre of scr|
00001420  65 65 6e 2c 0d 05 46 2b  f4 20 63 65 6e 74 72 65  |een,..F+. centre|
00001430  20 74 6f 70 20 6f 66 20  73 63 72 65 65 6e 2c 20  | top of screen, |
00001440  74 6f 70 20 6f 66 20 73  63 72 65 65 6e 29 2e 0d  |top of screen)..|
00001450  05 50 07 20 20 3a 0d 05  5a 43 58 70 69 78 65 6c  |.P.  :..ZCXpixel|
00001460  73 3d a4 4d 6f 64 65 49  6e 66 6f 28 22 58 50 69  |s=.ModeInfo("XPi|
00001470  78 65 6c 73 22 2c 2d 31  29 3a 59 70 69 78 65 6c  |xels",-1):Ypixel|
00001480  73 3d a4 4d 6f 64 65 49  6e 66 6f 28 22 59 50 69  |s=.ModeInfo("YPi|
00001490  78 65 6c 73 22 2c 2d 31  29 0d 05 64 4f 58 45 69  |xels",-1)..dOXEi|
000014a0  67 46 61 63 74 6f 72 3d  a4 4d 6f 64 65 49 6e 66  |gFactor=.ModeInf|
000014b0  6f 28 22 58 45 69 67 46  61 63 74 6f 72 22 2c 2d  |o("XEigFactor",-|
000014c0  31 29 3a 59 45 69 67 46  61 63 74 6f 72 3d a4 4d  |1):YEigFactor=.M|
000014d0  6f 64 65 49 6e 66 6f 28  22 59 45 69 67 46 61 63  |odeInfo("YEigFac|
000014e0  74 6f 72 22 2c 2d 31 29  0d 05 6e 07 20 20 3a 0d  |tor",-1)..n.  :.|
000014f0  05 78 38 74 6f 70 3d 42  6c 6f 63 6b 21 31 36 3a  |.x8top=Block!16:|
00001500  72 69 67 68 74 3d 42 6c  6f 63 6b 21 31 32 3a 62  |right=Block!12:b|
00001510  6f 74 3d 42 6c 6f 63 6b  21 38 3a 6c 65 66 74 3d  |ot=Block!8:left=|
00001520  42 6c 6f 63 6b 21 34 0d  05 82 41 c8 99 20 22 57  |Block!4...A.. "W|
00001530  69 6d 70 5f 4f 70 65 6e  57 69 6e 64 6f 77 22 2c  |imp_OpenWindow",|
00001540  2c 42 6c 6f 63 6b 3a c8  99 20 22 57 69 6d 70 5f  |,Block:.. "Wimp_|
00001550  47 65 74 57 69 6e 64 6f  77 4f 75 74 6c 69 6e 65  |GetWindowOutline|
00001560  22 2c 2c 42 6c 6f 63 6b  0d 05 8c 26 54 42 3d 28  |",,Block...&TB=(|
00001570  28 42 6c 6f 63 6b 21 31  36 29 2d 74 6f 70 29 2f  |(Block!16)-top)/|
00001580  28 32 5e 59 45 69 67 46  61 63 74 6f 72 29 0d 05  |(2^YEigFactor)..|
00001590  96 28 56 53 3d 28 28 42  6c 6f 63 6b 21 31 32 29  |.(VS=((Block!12)|
000015a0  2d 72 69 67 68 74 29 2f  28 32 5e 58 45 69 67 46  |-right)/(2^XEigF|
000015b0  61 63 74 6f 72 29 0d 05  a0 25 48 53 3d 28 62 6f  |actor)...%HS=(bo|
000015c0  74 2d 28 42 6c 6f 63 6b  21 38 29 29 2f 28 32 5e  |t-(Block!8))/(2^|
000015d0  59 45 69 67 46 61 63 74  6f 72 29 0d 05 aa 26 4c  |YEigFactor)...&L|
000015e0  50 3d 28 6c 65 66 74 2d  28 42 6c 6f 63 6b 21 34  |P=(left-(Block!4|
000015f0  29 29 2f 28 32 5e 58 45  69 67 46 61 63 74 6f 72  |))/(2^XEigFactor|
00001600  29 0d 05 b4 4b f4 20 4c  50 20 69 73 20 4c 65 66  |)...K. LP is Lef|
00001610  74 20 50 69 78 65 6c 3a  20 6e 6f 72 6d 61 6c 6c  |t Pixel: normall|
00001620  79 20 70 72 65 73 65 6e  74 2c 20 62 75 74 20 6e  |y present, but n|
00001630  6f 74 20 69 66 20 77 69  6e 64 6f 77 20 69 73 20  |ot if window is |
00001640  74 72 61 6e 73 70 61 72  65 6e 74 2e 0d 05 be 25  |transparent....%|
00001650  77 69 64 74 68 3d 28 72  69 67 68 74 2d 6c 65 66  |width=(right-lef|
00001660  74 29 2f 28 32 5e 58 45  69 67 46 61 63 74 6f 72  |t)/(2^XEigFactor|
00001670  29 0d 05 c8 23 68 65 69  67 68 74 3d 28 74 6f 70  |)...#height=(top|
00001680  2d 62 6f 74 29 2f 28 32  5e 59 45 69 67 46 61 63  |-bot)/(2^YEigFac|
00001690  74 6f 72 29 0d 05 d2 0f  c8 8e 20 61 63 72 6f 73  |tor)...... acros|
000016a0  73 20 ca 0d 05 dc 0e 20  20 c9 20 30 3a 78 3d 4c  |s .....  . 0:x=L|
000016b0  50 0d 05 e6 2c 20 20 c9  20 31 3a 78 3d 4c 50 2b  |P...,  . 1:x=LP+|
000016c0  28 28 58 70 69 78 65 6c  73 2b 31 29 2d 28 77 69  |((Xpixels+1)-(wi|
000016d0  64 74 68 2b 4c 50 2b 56  53 29 29 2f 34 0d 05 f0  |dth+LP+VS))/4...|
000016e0  2c 20 20 c9 20 32 3a 78  3d 4c 50 2b 28 28 58 70  |,  . 2:x=LP+((Xp|
000016f0  69 78 65 6c 73 2b 31 29  2d 28 77 69 64 74 68 2b  |ixels+1)-(width+|
00001700  4c 50 2b 56 53 29 29 2f  32 0d 05 fa 32 20 20 c9  |LP+VS))/2...2  .|
00001710  20 33 3a 78 3d 4c 50 2b  28 33 2a 28 28 28 58 70  | 3:x=LP+(3*(((Xp|
00001720  69 78 65 6c 73 2b 31 29  2d 28 77 69 64 74 68 2b  |ixels+1)-(width+|
00001730  4c 50 2b 56 53 29 29 2f  34 29 29 0d 06 04 22 20  |LP+VS))/4))..." |
00001740  20 c9 20 34 3a 78 3d 28  58 70 69 78 65 6c 73 2b  | . 4:x=(Xpixels+|
00001750  31 29 2d 28 77 69 64 74  68 2b 56 53 29 0d 06 0e  |1)-(width+VS)...|
00001760  05 cb 0d 06 18 0b c8 8e  20 75 70 20 ca 0d 06 22  |........ up ..."|
00001770  0e 20 20 c9 20 30 3a 79  3d 48 53 0d 06 2c 23 20  |.  . 0:y=HS..,# |
00001780  20 c9 20 31 3a 79 3d 48  53 2b 28 31 33 32 2f 28  | . 1:y=HS+(132/(|
00001790  32 5e 59 45 69 67 46 61  63 74 6f 72 29 29 0d 06  |2^YEigFactor))..|
000017a0  36 2d 20 20 c9 20 32 3a  79 3d 48 53 2b 28 28 59  |6-  . 2:y=HS+((Y|
000017b0  70 69 78 65 6c 73 2b 31  29 2d 28 68 65 69 67 68  |pixels+1)-(heigh|
000017c0  74 2b 54 42 2b 48 53 29  29 2f 32 0d 06 40 33 20  |t+TB+HS))/2..@3 |
000017d0  20 c9 20 33 3a 79 3d 48  53 2b 28 33 2a 28 28 28  | . 3:y=HS+(3*(((|
000017e0  59 70 69 78 65 6c 73 2b  31 29 2d 28 68 65 69 67  |Ypixels+1)-(heig|
000017f0  68 74 2b 54 42 2b 48 53  29 29 2f 34 29 29 0d 06  |ht+TB+HS))/4))..|
00001800  4a 23 20 20 c9 20 34 3a  79 3d 28 59 70 69 78 65  |J#  . 4:y=(Ypixe|
00001810  6c 73 2b 31 29 2d 28 68  65 69 67 68 74 2b 54 42  |ls+1)-(height+TB|
00001820  29 0d 06 54 05 cb 0d 06  5e 28 f4 20 41 62 6f 76  |)..T....^(. Abov|
00001830  65 20 63 6f 6f 72 64 69  6e 61 74 65 73 20 70 6f  |e coordinates po|
00001840  73 69 74 69 6f 6e 20 77  69 6e 64 6f 77 2e 0d 06  |sition window...|
00001850  68 28 f4 20 4e 6f 77 20  63 6f 6e 76 65 72 74 20  |h(. Now convert |
00001860  74 6f 20 73 63 72 65 65  6e 20 63 6f 6f 72 64 69  |to screen coordi|
00001870  6e 61 74 65 73 3a 0d 06  72 29 78 3d 78 2a 28 32  |nates:..r)x=x*(2|
00001880  5e 58 45 69 67 46 61 63  74 6f 72 29 3a 79 3d 79  |^XEigFactor):y=y|
00001890  2a 28 32 5e 59 45 69 67  46 61 63 74 6f 72 29 0d  |*(2^YEigFactor).|
000018a0  06 7c 3b 77 69 64 74 68  3d 77 69 64 74 68 2a 28  |.|;width=width*(|
000018b0  32 5e 58 45 69 67 46 61  63 74 6f 72 29 3a 68 65  |2^XEigFactor):he|
000018c0  69 67 68 74 3d 68 65 69  67 68 74 2a 28 32 5e 59  |ight=height*(2^Y|
000018d0  45 69 67 46 61 63 74 6f  72 29 0d 06 86 1e 42 6c  |EigFactor)....Bl|
000018e0  6f 63 6b 21 31 32 3d 78  2b 77 69 64 74 68 3a 42  |ock!12=x+width:B|
000018f0  6c 6f 63 6b 21 34 3d 78  0d 06 90 1f 42 6c 6f 63  |lock!4=x....Bloc|
00001900  6b 21 31 36 3d 79 2b 68  65 69 67 68 74 3a 42 6c  |k!16=y+height:Bl|
00001910  6f 63 6b 21 38 3d 79 0d  06 9a 05 e1 0d 06 a4 05  |ock!8=y.........|
00001920  3a 0d 06 ae 4f f4 20 2d  2d 2d 2d 2d 2d 2d 2d 2d  |:...O. ---------|
00001930  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001970  0d 06 b8 18 f4 20 57 69  6d 70 20 70 6f 6c 6c 20  |..... Wimp poll |
00001980  72 6f 75 74 69 6e 65 73  0d 06 c2 4f f4 20 2d 2d  |routines...O. --|
00001990  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000019d0  2d 2d 2d 2d 2d 2d 2d 0d  06 cc 05 3a 0d 06 d6 0d  |-------....:....|
000019e0  dd 20 f2 52 65 64 72 61  77 0d 06 e0 14 e7 20 44  |. .Redraw..... D|
000019f0  6f 4d 6f 64 65 43 68 61  6e 67 65 20 8c 0d 06 ea  |oModeChange ....|
00001a00  64 20 20 f4 20 52 65 2d  6f 70 65 6e 69 6e 67 20  |d  . Re-opening |
00001a10  77 69 6e 64 6f 77 73 20  6e 65 65 64 20 61 6e 20  |windows need an |
00001a20  65 78 74 72 61 20 77 69  6d 70 5f 70 6f 6c 6c 20  |extra wimp_poll |
00001a30  74 6f 20 68 61 70 70 65  6e 20 61 66 74 65 72 20  |to happen after |
00001a40  74 68 65 20 6d 6f 64 65  20 63 68 61 6e 67 65 20  |the mode change |
00001a50  69 6e 20 6f 72 64 65 72  20 74 6f 20 77 6f 72 6b  |in order to work|
00001a60  3a 0d 06 f4 46 20 20 e7  20 a4 4f 70 65 6e 53 74  |:...F  . .OpenSt|
00001a70  61 74 65 28 4d 61 67 6e  69 66 69 65 72 29 20 8c  |ate(Magnifier) .|
00001a80  20 f2 4f 70 65 6e 28 4d  61 67 6e 69 66 69 65 72  | .Open(Magnifier|
00001a90  2c a3 2c 58 50 6f 73 69  74 69 6f 6e 2c 59 50 6f  |,.,XPosition,YPo|
00001aa0  73 69 74 69 6f 6e 29 0d  06 fe 14 20 20 44 6f 4d  |sition)....  DoM|
00001ab0  6f 64 65 43 68 61 6e 67  65 3d a3 0d 07 08 05 cd  |odeChange=......|
00001ac0  0d 07 12 10 c8 8e 20 42  6c 6f 63 6b 21 30 20 ca  |...... Block!0 .|
00001ad0  0d 07 1c 12 20 20 c9 20  4d 61 67 6e 69 66 69 65  |....  . Magnifie|
00001ae0  72 3a 0d 07 26 30 20 20  20 20 e7 20 4d 61 67 45  |r:..&0    . MagE|
00001af0  72 72 6f 72 20 8c 20 4d  61 67 45 72 72 6f 72 3d  |rror . MagError=|
00001b00  a3 3a f2 43 72 65 61 74  65 4d 61 67 53 70 72 69  |.:.CreateMagSpri|
00001b10  74 65 0d 07 30 53 20 20  20 20 58 45 69 67 46 61  |te..0S    XEigFa|
00001b20  63 74 6f 72 3d a4 4d 6f  64 65 49 6e 66 6f 28 22  |ctor=.ModeInfo("|
00001b30  58 45 69 67 46 61 63 74  6f 72 22 2c 2d 31 29 3a  |XEigFactor",-1):|
00001b40  59 45 69 67 46 61 63 74  6f 72 3d a4 4d 6f 64 65  |YEigFactor=.Mode|
00001b50  49 6e 66 6f 28 22 59 45  69 67 46 61 63 74 6f 72  |Info("YEigFactor|
00001b60  22 2c 2d 31 29 0d 07 3a  2d 20 20 20 20 c8 99 20  |",-1)..:-    .. |
00001b70  22 57 69 6d 70 5f 52 65  64 72 61 77 57 69 6e 64  |"Wimp_RedrawWind|
00001b80  6f 77 22 2c 2c 42 6c 6f  63 6b 20 b8 20 66 6c 61  |ow",,Block . fla|
00001b90  67 25 0d 07 44 10 20 20  20 20 c8 95 20 66 6c 61  |g%..D.    .. fla|
00001ba0  67 25 0d 07 4e c7 20 20  20 20 20 20 c8 99 20 22  |g%..N.      .. "|
00001bb0  4f 53 5f 53 70 72 69 74  65 4f 70 22 2c 32 35 36  |OS_SpriteOp",256|
00001bc0  2b 35 32 2c 53 6c 6f 74  45 6e 64 2c 22 6d 61 67  |+52,SlotEnd,"mag|
00001bd0  22 2c 42 6c 6f 63 6b 21  34 2d 28 28 32 30 30 2a  |",Block!4-((200*|
00001be0  53 63 61 6c 65 21 30 29  2f 53 63 61 6c 65 21 38  |Scale!0)/Scale!8|
00001bf0  29 2b 32 30 32 2d 28 28  53 63 61 6c 65 21 30 2f  |)+202-((Scale!0/|
00001c00  53 63 61 6c 65 21 38 29  2a 32 5e 58 45 69 67 46  |Scale!8)*2^XEigF|
00001c10  61 63 74 6f 72 29 2f 32  2c 42 6c 6f 63 6b 21 38  |actor)/2,Block!8|
00001c20  2d 28 28 32 30 30 2a 53  63 61 6c 65 21 34 29 2f  |-((200*Scale!4)/|
00001c30  53 63 61 6c 65 21 31 32  29 2b 32 30 32 2d 28 28  |Scale!12)+202-((|
00001c40  53 63 61 6c 65 21 34 2f  53 63 61 6c 65 21 31 32  |Scale!4/Scale!12|
00001c50  29 2a 32 5e 59 45 69 67  46 61 63 74 6f 72 29 2f  |)*2^YEigFactor)/|
00001c60  32 2c 30 2c 53 63 61 6c  65 0d 07 58 2f 20 20 20  |2,0,Scale..X/   |
00001c70  20 20 20 c8 99 20 22 57  69 6d 70 5f 47 65 74 52  |   .. "Wimp_GetR|
00001c80  65 63 74 61 6e 67 6c 65  22 2c 2c 42 6c 6f 63 6b  |ectangle",,Block|
00001c90  20 b8 20 66 6c 61 67 25  0d 07 62 09 20 20 20 20  | . flag%..b.    |
00001ca0  ce 0d 07 6c 07 20 20 7f  0d 07 76 2d 20 20 20 20  |...l.  ...v-    |
00001cb0  c8 99 20 22 57 69 6d 70  5f 52 65 64 72 61 77 57  |.. "Wimp_RedrawW|
00001cc0  69 6e 64 6f 77 22 2c 2c  42 6c 6f 63 6b 20 b8 20  |indow",,Block . |
00001cd0  66 6c 61 67 25 0d 07 80  10 20 20 20 20 c8 95 20  |flag%....    .. |
00001ce0  66 6c 61 67 25 0d 07 8a  27 20 20 20 20 20 20 c8  |flag%...'      .|
00001cf0  99 20 22 57 69 6d 70 5f  42 6f 72 64 65 72 57 69  |. "Wimp_BorderWi|
00001d00  6e 64 6f 77 22 2c 2c 42  6c 6f 63 6b 0d 07 94 2f  |ndow",,Block.../|
00001d10  20 20 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 47  |      .. "Wimp_G|
00001d20  65 74 52 65 63 74 61 6e  67 6c 65 22 2c 2c 42 6c  |etRectangle",,Bl|
00001d30  6f 63 6b 20 b8 20 66 6c  61 67 25 0d 07 9e 09 20  |ock . flag%.... |
00001d40  20 20 20 ce 0d 07 a8 05  cb 0d 07 b2 05 e1 0d 07  |   .............|
00001d50  bc 05 3a 0d 07 c6 15 dd  20 f2 52 65 63 69 65 76  |..:..... .Reciev|
00001d60  65 4d 65 73 73 61 67 65  0d 07 d0 11 c8 8e 20 42  |eMessage...... B|
00001d70  6c 6f 63 6b 21 31 36 20  ca 0d 07 da 12 20 20 c9  |lock!16 .....  .|
00001d80  20 30 20 3a 20 44 6f 6e  65 3d b9 0d 07 e4 31 20  | 0 : Done=....1 |
00001d90  20 c9 20 31 30 3a 20 e7  20 4f 6d 6e 69 44 65 73  | . 10: . OmniDes|
00001da0  6b 3d 30 20 8c 20 f2 53  61 76 65 44 65 73 6b 74  |k=0 . .SaveDeskt|
00001db0  6f 70 28 42 6c 6f 63 6b  21 32 30 29 0d 07 ee 45  |op(Block!20)...E|
00001dc0  20 20 20 20 20 20 20 20  20 20 20 f4 20 4f 6e 6c  |           . Onl|
00001dd0  79 20 73 61 76 65 20 69  66 20 77 65 20 68 61 76  |y save if we hav|
00001de0  65 20 6e 6f 74 20 62 65  65 6e 20 73 74 61 72 74  |e not been start|
00001df0  65 64 20 75 70 20 62 79  20 4f 6d 6e 69 44 65 73  |ed up by OmniDes|
00001e00  6b 0d 07 f8 14 20 20 c9  20 26 35 30 32 20 3a 20  |k....  . &502 : |
00001e10  f2 48 65 6c 70 0d 08 02  1c 20 20 c9 20 26 34 30  |.Help....  . &40|
00001e20  30 43 31 20 3a 20 f2 4d  6f 64 65 43 68 61 6e 67  |0C1 : .ModeChang|
00001e30  65 0d 08 0c 3d 20 20 c9  20 55 74 69 6c 4f 70 65  |e...=  . UtilOpe|
00001e40  6e 20 3a 20 e7 20 24 28  42 6c 6f 63 6b 2b 32 34  |n : . $(Block+24|
00001e50  29 3d 54 61 73 6b 6e 61  6d 65 24 20 8c 20 f2 4f  |)=Taskname$ . .O|
00001e60  6d 6e 69 44 65 73 6b 43  61 6c 6c 69 6e 67 0d 08  |mniDeskCalling..|
00001e70  16 26 20 20 c9 20 55 74  69 6c 51 75 69 74 74 69  |.&  . UtilQuitti|
00001e80  6e 67 20 3a 20 e7 20 4f  6d 6e 69 44 65 73 6b 3c  |ng : . OmniDesk<|
00001e90  3e 30 20 8c 0d 08 20 38  20 20 20 20 20 20 20 20  |>0 ... 8        |
00001ea0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001eb0  e7 20 42 6c 6f 63 6b 21  32 30 3d 4f 6d 6e 69 44  |. Block!20=OmniD|
00001ec0  65 73 6b 20 8c 20 44 6f  6e 65 3d b9 0d 08 2a 1b  |esk . Done=...*.|
00001ed0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001ee0  20 20 20 20 20 20 cd 0d  08 34 1b 20 20 c9 20 55  |      ...4.  . U|
00001ef0  74 69 6c 52 65 73 69 64  65 20 3a 20 45 78 69 74  |tilReside : Exit|
00001f00  3d a3 0d 08 3e 05 cb 0d  08 48 05 e1 0d 08 52 05  |=...>....H....R.|
00001f10  3a 0d 08 5c 12 dd 20 f2  4d 6f 75 73 65 42 75 74  |:..\.. .MouseBut|
00001f20  74 6f 6e 0d 08 66 31 4d  6f 75 73 65 58 3d 42 6c  |ton..f1MouseX=Bl|
00001f30  6f 63 6b 21 30 3a 4d 6f  75 73 65 59 3d 42 6c 6f  |ock!0:MouseY=Blo|
00001f40  63 6b 21 34 3a 42 75 74  74 6f 6e 73 3d 42 6c 6f  |ck!4:Buttons=Blo|
00001f50  63 6b 21 38 0d 08 70 21  57 69 6e 64 6f 77 3d 42  |ck!8..p!Window=B|
00001f60  6c 6f 63 6b 21 31 32 3a  49 63 6f 6e 3d 42 6c 6f  |lock!12:Icon=Blo|
00001f70  63 6b 21 31 36 0d 08 7a  0f c8 8e 20 57 69 6e 64  |ck!16..z... Wind|
00001f80  6f 77 20 ca 0d 08 84 22  20 20 c9 20 2d 32 3a f4  |ow ...."  . -2:.|
00001f90  20 49 63 6f 6e 20 62 61  72 20 69 63 6f 6e 20 63  | Icon bar icon c|
00001fa0  6c 69 63 6b 65 64 0d 08  8e 14 20 20 20 20 c8 8e  |licked....    ..|
00001fb0  20 42 75 74 74 6f 6e 73  20 ca 0d 08 98 18 20 20  | Buttons .....  |
00001fc0  20 20 20 20 c9 20 31 20  3a 20 f4 20 41 64 6a 75  |    . 1 : . Adju|
00001fd0  73 74 0d 08 a2 16 20 20  20 20 20 20 c9 20 32 20  |st....      . 2 |
00001fe0  3a 20 f4 20 4d 65 6e 75  0d 08 ac 39 20 20 20 20  |: . Menu...9    |
00001ff0  20 20 20 20 4d 25 3d 49  42 4d 65 6e 75 3a 4d 65  |    M%=IBMenu:Me|
00002000  6e 75 58 3d 4d 6f 75 73  65 58 3a 4d 65 6e 75 59  |nuX=MouseX:MenuY|
00002010  3d 4d 6f 75 73 65 59 3a  f2 4d 61 6b 65 4d 65 6e  |=MouseY:.MakeMen|
00002020  75 0d 08 b6 18 20 20 20  20 20 20 c9 20 34 20 3a  |u....      . 4 :|
00002030  20 f4 20 53 65 6c 65 63  74 0d 08 c0 38 20 20 20  | . Select...8   |
00002040  20 20 20 20 20 e7 20 ac  20 a4 4f 70 65 6e 53 74  |     . . .OpenSt|
00002050  61 74 65 28 4d 61 67 6e  69 66 69 65 72 29 20 8c  |ate(Magnifier) .|
00002060  20 f2 43 72 65 61 74 65  4d 61 67 53 70 72 69 74  | .CreateMagSprit|
00002070  65 0d 08 ca 32 20 20 20  20 20 20 20 20 f2 4f 70  |e...2        .Op|
00002080  65 6e 28 4d 61 67 6e 69  66 69 65 72 2c b9 2c 58  |en(Magnifier,.,X|
00002090  50 6f 73 69 74 69 6f 6e  2c 59 50 6f 73 69 74 69  |Position,YPositi|
000020a0  6f 6e 29 0d 08 d4 09 20  20 20 20 cb 0d 08 de 17  |on)....    .....|
000020b0  20 20 c9 20 5a 6f 6f 6d  3a f2 5a 6f 6f 6d 43 6c  |  . Zoom:.ZoomCl|
000020c0  69 63 6b 0d 08 e8 11 20  20 c9 20 4d 61 67 6e 69  |ick....  . Magni|
000020d0  66 69 65 72 0d 08 f2 14  20 20 20 20 c8 8e 20 42  |fier....    .. B|
000020e0  75 74 74 6f 6e 73 20 ca  0d 08 fc 18 20 20 20 20  |uttons .....    |
000020f0  20 20 c9 20 31 20 3a 20  f4 20 41 64 6a 75 73 74  |  . 1 : . Adjust|
00002100  0d 09 06 46 20 20 20 20  20 20 20 20 42 6c 61 6e  |...F        Blan|
00002110  6b 4d 61 67 3d ac 20 42  6c 61 6e 6b 4d 61 67 3a  |kMag=. BlankMag:|
00002120  f2 55 70 64 61 74 65 53  65 6c 65 63 74 65 64 46  |.UpdateSelectedF|
00002130  6c 61 67 28 5a 6f 6f 6d  2c 38 2c ac 20 42 6c 61  |lag(Zoom,8,. Bla|
00002140  6e 6b 4d 61 67 29 0d 09  10 16 20 20 20 20 20 20  |nkMag)....      |
00002150  c9 20 32 20 3a 20 f4 20  4d 65 6e 75 0d 09 1a 31  |. 2 : . Menu...1|
00002160  20 20 20 20 20 20 20 20  4d 25 3d 4d 61 69 6e 4d  |        M%=MainM|
00002170  65 6e 75 3a 4d 65 6e 75  58 3d 4d 6f 75 73 65 58  |enu:MenuX=MouseX|
00002180  3a 4d 65 6e 75 59 3d 4d  6f 75 73 65 59 0d 09 24  |:MenuY=MouseY..$|
00002190  19 20 20 20 20 20 20 20  20 e7 20 77 69 6d 70 3e  |.        . wimp>|
000021a0  3d 33 31 30 20 8c 0d 09  2e 60 20 20 20 20 20 20  |=310 ....`      |
000021b0  20 20 20 20 e7 20 c0 24  4d 61 69 6e 4d 65 6e 75  |    . .$MainMenu|
000021c0  54 69 74 6c 65 2c 31 29  3d 22 5c 22 20 8c 20 24  |Title,1)="\" . $|
000021d0  4d 61 69 6e 4d 65 6e 75  54 69 74 6c 65 3d c2 24  |MainMenuTitle=.$|
000021e0  4d 61 69 6e 4d 65 6e 75  54 69 74 6c 65 2c a9 28  |MainMenuTitle,.(|
000021f0  24 4d 61 69 6e 4d 65 6e  75 54 69 74 6c 65 29 2d  |$MainMenuTitle)-|
00002200  31 29 2b bd 31 33 0d 09  38 43 20 20 20 20 20 20  |1)+.13..8C      |
00002210  20 20 20 20 e7 20 58 50  6f 73 69 74 69 6f 6e 3d  |    . XPosition=|
00002220  34 20 8c 20 24 4d 61 69  6e 4d 65 6e 75 54 69 74  |4 . $MainMenuTit|
00002230  6c 65 3d 22 5c 22 2b 24  4d 61 69 6e 4d 65 6e 75  |le="\"+$MainMenu|
00002240  54 69 74 6c 65 2b bd 31  33 0d 09 42 0d 20 20 20  |Title+.13..B.   |
00002250  20 20 20 20 20 cd 0d 09  4c 15 20 20 20 20 20 20  |     ...L.      |
00002260  20 20 f2 4d 61 6b 65 4d  65 6e 75 0d 09 56 18 20  |  .MakeMenu..V. |
00002270  20 20 20 20 20 c9 20 34  20 3a 20 f4 20 53 65 6c  |     . 4 : . Sel|
00002280  65 63 74 0d 09 60 3b 20  20 20 20 20 20 20 20 58  |ect..`;        X|
00002290  48 61 69 72 3d ac 20 58  48 61 69 72 3a f2 55 70  |Hair=. XHair:.Up|
000022a0  64 61 74 65 53 65 6c 65  63 74 65 64 46 6c 61 67  |dateSelectedFlag|
000022b0  28 5a 6f 6f 6d 2c 37 2c  58 48 61 69 72 29 0d 09  |(Zoom,7,XHair)..|
000022c0  6a 09 20 20 20 20 cb 0d  09 74 30 20 20 c9 20 4c  |j.    ...t0  . L|
000022d0  6f 63 20 80 20 42 75 74  74 6f 6e 73 3c 38 3a f4  |oc . Buttons<8:.|
000022e0  20 52 65 70 6f 73 69 74  69 6f 6e 20 6d 61 69 6e  | Reposition main|
000022f0  20 77 69 6e 64 6f 77 0d  09 7e 13 20 20 20 20 e7  | window..~.    .|
00002300  20 49 63 6f 6e 3e 3d 36  20 8c 0d 09 88 2c 20 20  | Icon>=6 ....,  |
00002310  20 20 20 20 58 50 6f 73  69 74 69 6f 6e 3d a4 52  |    XPosition=.R|
00002320  65 61 64 57 69 6e 64 6f  77 4c 6f 63 61 74 69 6f  |eadWindowLocatio|
00002330  6e 28 22 58 22 29 0d 09  92 2c 20 20 20 20 20 20  |n("X")...,      |
00002340  59 50 6f 73 69 74 69 6f  6e 3d a4 52 65 61 64 57  |YPosition=.ReadW|
00002350  69 6e 64 6f 77 4c 6f 63  61 74 69 6f 6e 28 22 59  |indowLocation("Y|
00002360  22 29 0d 09 9c 4a 20 20  20 20 20 20 e7 20 a4 4f  |")...J      . .O|
00002370  70 65 6e 53 74 61 74 65  28 4d 61 67 6e 69 66 69  |penState(Magnifi|
00002380  65 72 29 20 8c 20 f2 4f  70 65 6e 28 4d 61 67 6e  |er) . .Open(Magn|
00002390  69 66 69 65 72 2c a3 2c  58 50 6f 73 69 74 69 6f  |ifier,.,XPositio|
000023a0  6e 2c 59 50 6f 73 69 74  69 6f 6e 29 0d 09 a6 09  |n,YPosition)....|
000023b0  20 20 20 20 cd 0d 09 b0  05 cb 0d 09 ba 05 e1 0d  |    ............|
000023c0  09 c4 05 3a 0d 09 ce 10  dd 20 f2 5a 6f 6f 6d 43  |...:..... .ZoomC|
000023d0  6c 69 63 6b 0d 09 d8 0d  c8 8e 20 49 63 6f 6e 20  |lick...... Icon |
000023e0  ca 0d 09 e2 28 20 20 c9  20 32 20 80 20 28 42 75  |....(  . 2 . (Bu|
000023f0  74 74 6f 6e 73 3d 34 29  2c 33 20 80 20 28 42 75  |ttons=4),3 . (Bu|
00002400  74 74 6f 6e 73 3d 31 29  3a 0d 09 ec 1b 20 20 20  |ttons=1):....   |
00002410  20 41 3d a4 52 65 61 64  49 63 6f 6e 28 5a 6f 6f  | A=.ReadIcon(Zoo|
00002420  6d 2c 30 29 0d 09 f6 2d  20 20 20 20 e7 20 41 3c  |m,0)...-    . A<|
00002430  39 39 39 20 8c 20 41 2b  3d 31 3a f2 55 70 64 61  |999 . A+=1:.Upda|
00002440  74 65 49 63 6f 6e 28 5a  6f 6f 6d 2c 30 2c c3 41  |teIcon(Zoom,0,.A|
00002450  29 0d 0a 00 1b 20 20 20  20 42 3d a4 52 65 61 64  |)....    B=.Read|
00002460  49 63 6f 6e 28 5a 6f 6f  6d 2c 31 29 0d 0a 0a 2a  |Icon(Zoom,1)...*|
00002470  20 20 20 20 e7 20 41 3d  30 20 8c 20 41 3d 31 3a  |    . A=0 . A=1:|
00002480  f2 55 70 64 61 74 65 49  63 6f 6e 28 5a 6f 6f 6d  |.UpdateIcon(Zoom|
00002490  2c 30 2c c3 41 29 0d 0a  14 2a 20 20 20 20 e7 20  |,0,.A)...*    . |
000024a0  42 3d 30 20 8c 20 42 3d  31 3a f2 55 70 64 61 74  |B=0 . B=1:.Updat|
000024b0  65 49 63 6f 6e 28 5a 6f  6f 6d 2c 31 2c c3 42 29  |eIcon(Zoom,1,.B)|
000024c0  0d 0a 1e 2a 20 20 20 20  e7 20 41 3c 42 20 8c 20  |...*    . A<B . |
000024d0  42 3d 41 3a f2 55 70 64  61 74 65 49 63 6f 6e 28  |B=A:.UpdateIcon(|
000024e0  5a 6f 6f 6d 2c 31 2c c3  42 29 0d 0a 28 30 20 20  |Zoom,1,.B)..(0  |
000024f0  20 20 53 63 61 6c 65 21  30 3d 41 3a 53 63 61 6c  |  Scale!0=A:Scal|
00002500  65 21 34 3d 41 3a 53 63  61 6c 65 21 38 3d 42 3a  |e!4=A:Scale!8=B:|
00002510  53 63 61 6c 65 21 31 32  3d 42 0d 0a 32 34 20 20  |Scale!12=B..24  |
00002520  20 20 c8 99 20 22 57 69  6d 70 5f 53 65 74 43 61  |  .. "Wimp_SetCa|
00002530  72 65 74 50 6f 73 69 74  69 6f 6e 22 2c 5a 6f 6f  |retPosition",Zoo|
00002540  6d 2c 30 2c 2c 2c 2d 31  2c a9 28 c3 41 29 0d 0a  |m,0,,,-1,.(.A)..|
00002550  3c 28 20 20 c9 20 32 20  80 20 28 42 75 74 74 6f  |<(  . 2 . (Butto|
00002560  6e 73 3d 31 29 2c 33 20  80 20 28 42 75 74 74 6f  |ns=1),3 . (Butto|
00002570  6e 73 3d 34 29 3a 0d 0a  46 1b 20 20 20 20 41 3d  |ns=4):..F.    A=|
00002580  a4 52 65 61 64 49 63 6f  6e 28 5a 6f 6f 6d 2c 30  |.ReadIcon(Zoom,0|
00002590  29 0d 0a 50 2b 20 20 20  20 e7 20 41 3e 31 20 8c  |)..P+    . A>1 .|
000025a0  20 41 2d 3d 31 3a f2 55  70 64 61 74 65 49 63 6f  | A-=1:.UpdateIco|
000025b0  6e 28 5a 6f 6f 6d 2c 30  2c c3 41 29 0d 0a 5a 1b  |n(Zoom,0,.A)..Z.|
000025c0  20 20 20 20 42 3d a4 52  65 61 64 49 63 6f 6e 28  |    B=.ReadIcon(|
000025d0  5a 6f 6f 6d 2c 31 29 0d  0a 64 2a 20 20 20 20 e7  |Zoom,1)..d*    .|
000025e0  20 41 3d 30 20 8c 20 41  3d 31 3a f2 55 70 64 61  | A=0 . A=1:.Upda|
000025f0  74 65 49 63 6f 6e 28 5a  6f 6f 6d 2c 30 2c c3 41  |teIcon(Zoom,0,.A|
00002600  29 0d 0a 6e 2a 20 20 20  20 e7 20 42 3d 30 20 8c  |)..n*    . B=0 .|
00002610  20 42 3d 31 3a f2 55 70  64 61 74 65 49 63 6f 6e  | B=1:.UpdateIcon|
00002620  28 5a 6f 6f 6d 2c 31 2c  c3 42 29 0d 0a 78 2a 20  |(Zoom,1,.B)..x* |
00002630  20 20 20 e7 20 41 3c 42  20 8c 20 42 3d 41 3a f2  |   . A<B . B=A:.|
00002640  55 70 64 61 74 65 49 63  6f 6e 28 5a 6f 6f 6d 2c  |UpdateIcon(Zoom,|
00002650  31 2c c3 42 29 0d 0a 82  30 20 20 20 20 53 63 61  |1,.B)...0    Sca|
00002660  6c 65 21 30 3d 41 3a 53  63 61 6c 65 21 34 3d 41  |le!0=A:Scale!4=A|
00002670  3a 53 63 61 6c 65 21 38  3d 42 3a 53 63 61 6c 65  |:Scale!8=B:Scale|
00002680  21 31 32 3d 42 0d 0a 8c  34 20 20 20 20 c8 99 20  |!12=B...4    .. |
00002690  22 57 69 6d 70 5f 53 65  74 43 61 72 65 74 50 6f  |"Wimp_SetCaretPo|
000026a0  73 69 74 69 6f 6e 22 2c  5a 6f 6f 6d 2c 30 2c 2c  |sition",Zoom,0,,|
000026b0  2c 2d 31 2c a9 28 c3 41  29 0d 0a 96 28 20 20 c9  |,-1,.(.A)...(  .|
000026c0  20 34 20 80 20 28 42 75  74 74 6f 6e 73 3d 34 29  | 4 . (Buttons=4)|
000026d0  2c 35 20 80 20 28 42 75  74 74 6f 6e 73 3d 31 29  |,5 . (Buttons=1)|
000026e0  3a 0d 0a a0 1b 20 20 20  20 42 3d a4 52 65 61 64  |:....    B=.Read|
000026f0  49 63 6f 6e 28 5a 6f 6f  6d 2c 31 29 0d 0a aa 2d  |Icon(Zoom,1)...-|
00002700  20 20 20 20 e7 20 42 3c  39 39 39 20 8c 20 42 2b  |    . B<999 . B+|
00002710  3d 31 3a f2 55 70 64 61  74 65 49 63 6f 6e 28 5a  |=1:.UpdateIcon(Z|
00002720  6f 6f 6d 2c 31 2c c3 42  29 0d 0a b4 1b 20 20 20  |oom,1,.B)....   |
00002730  20 41 3d a4 52 65 61 64  49 63 6f 6e 28 5a 6f 6f  | A=.ReadIcon(Zoo|
00002740  6d 2c 30 29 0d 0a be 2a  20 20 20 20 e7 20 41 3d  |m,0)...*    . A=|
00002750  30 20 8c 20 41 3d 31 3a  f2 55 70 64 61 74 65 49  |0 . A=1:.UpdateI|
00002760  63 6f 6e 28 5a 6f 6f 6d  2c 30 2c c3 41 29 0d 0a  |con(Zoom,0,.A)..|
00002770  c8 2a 20 20 20 20 e7 20  42 3d 30 20 8c 20 42 3d  |.*    . B=0 . B=|
00002780  31 3a f2 55 70 64 61 74  65 49 63 6f 6e 28 5a 6f  |1:.UpdateIcon(Zo|
00002790  6f 6d 2c 31 2c c3 42 29  0d 0a d2 2a 20 20 20 20  |om,1,.B)...*    |
000027a0  e7 20 41 3c 42 20 8c 20  41 3d 42 3a f2 55 70 64  |. A<B . A=B:.Upd|
000027b0  61 74 65 49 63 6f 6e 28  5a 6f 6f 6d 2c 30 2c c3  |ateIcon(Zoom,0,.|
000027c0  41 29 0d 0a dc 30 20 20  20 20 53 63 61 6c 65 21  |A)...0    Scale!|
000027d0  30 3d 41 3a 53 63 61 6c  65 21 34 3d 41 3a 53 63  |0=A:Scale!4=A:Sc|
000027e0  61 6c 65 21 38 3d 42 3a  53 63 61 6c 65 21 31 32  |ale!8=B:Scale!12|
000027f0  3d 42 0d 0a e6 34 20 20  20 20 c8 99 20 22 57 69  |=B...4    .. "Wi|
00002800  6d 70 5f 53 65 74 43 61  72 65 74 50 6f 73 69 74  |mp_SetCaretPosit|
00002810  69 6f 6e 22 2c 5a 6f 6f  6d 2c 31 2c 2c 2c 2d 31  |ion",Zoom,1,,,-1|
00002820  2c a9 28 c3 42 29 0d 0a  f0 28 20 20 c9 20 34 20  |,.(.B)...(  . 4 |
00002830  80 20 28 42 75 74 74 6f  6e 73 3d 31 29 2c 35 20  |. (Buttons=1),5 |
00002840  80 20 28 42 75 74 74 6f  6e 73 3d 34 29 3a 0d 0a  |. (Buttons=4):..|
00002850  fa 1b 20 20 20 20 42 3d  a4 52 65 61 64 49 63 6f  |..    B=.ReadIco|
00002860  6e 28 5a 6f 6f 6d 2c 31  29 0d 0b 04 2b 20 20 20  |n(Zoom,1)...+   |
00002870  20 e7 20 42 3e 31 20 8c  20 42 2d 3d 31 3a f2 55  | . B>1 . B-=1:.U|
00002880  70 64 61 74 65 49 63 6f  6e 28 5a 6f 6f 6d 2c 31  |pdateIcon(Zoom,1|
00002890  2c c3 42 29 0d 0b 0e 1b  20 20 20 20 41 3d a4 52  |,.B)....    A=.R|
000028a0  65 61 64 49 63 6f 6e 28  5a 6f 6f 6d 2c 30 29 0d  |eadIcon(Zoom,0).|
000028b0  0b 18 2a 20 20 20 20 e7  20 41 3d 30 20 8c 20 41  |..*    . A=0 . A|
000028c0  3d 31 3a f2 55 70 64 61  74 65 49 63 6f 6e 28 5a  |=1:.UpdateIcon(Z|
000028d0  6f 6f 6d 2c 30 2c c3 41  29 0d 0b 22 2a 20 20 20  |oom,0,.A).."*   |
000028e0  20 e7 20 42 3d 30 20 8c  20 42 3d 31 3a f2 55 70  | . B=0 . B=1:.Up|
000028f0  64 61 74 65 49 63 6f 6e  28 5a 6f 6f 6d 2c 31 2c  |dateIcon(Zoom,1,|
00002900  c3 42 29 0d 0b 2c 2a 20  20 20 20 e7 20 41 3c 42  |.B)..,*    . A<B|
00002910  20 8c 20 41 3d 42 3a f2  55 70 64 61 74 65 49 63  | . A=B:.UpdateIc|
00002920  6f 6e 28 5a 6f 6f 6d 2c  30 2c c3 41 29 0d 0b 36  |on(Zoom,0,.A)..6|
00002930  30 20 20 20 20 53 63 61  6c 65 21 30 3d 41 3a 53  |0    Scale!0=A:S|
00002940  63 61 6c 65 21 34 3d 41  3a 53 63 61 6c 65 21 38  |cale!4=A:Scale!8|
00002950  3d 42 3a 53 63 61 6c 65  21 31 32 3d 42 0d 0b 40  |=B:Scale!12=B..@|
00002960  34 20 20 20 20 c8 99 20  22 57 69 6d 70 5f 53 65  |4    .. "Wimp_Se|
00002970  74 43 61 72 65 74 50 6f  73 69 74 69 6f 6e 22 2c  |tCaretPosition",|
00002980  5a 6f 6f 6d 2c 31 2c 2c  2c 2d 31 2c a9 28 c3 42  |Zoom,1,,,-1,.(.B|
00002990  29 0d 0b 4a 0a 20 20 c9  20 37 3a 0d 0b 54 24 20  |)..J.  . 7:..T$ |
000029a0  20 20 20 58 48 61 69 72  3d a4 53 65 6c 65 63 74  |   XHair=.Select|
000029b0  65 64 53 74 61 74 65 28  5a 6f 6f 6d 2c 37 29 0d  |edState(Zoom,7).|
000029c0  0b 5e 0a 20 20 c9 20 38  3a 0d 0b 68 29 20 20 20  |.^.  . 8:..h)   |
000029d0  20 42 6c 61 6e 6b 4d 61  67 3d ac 20 a4 53 65 6c  | BlankMag=. .Sel|
000029e0  65 63 74 65 64 53 74 61  74 65 28 5a 6f 6f 6d 2c  |ectedState(Zoom,|
000029f0  38 29 0d 0b 72 05 cb 0d  0b 7c 05 e1 0d 0b 86 05  |8)..r....|......|
00002a00  3a 0d 0b 90 11 dd 20 f2  4b 65 79 50 72 65 73 73  |:..... .KeyPress|
00002a10  65 64 0d 0b 9a 32 57 69  6e 64 6f 77 3d 42 6c 6f  |ed...2Window=Blo|
00002a20  63 6b 21 30 3a 49 63 6f  6e 3d 42 6c 6f 63 6b 21  |ck!0:Icon=Block!|
00002a30  34 3a 43 68 61 72 61 63  74 65 72 3d 42 6c 6f 63  |4:Character=Bloc|
00002a40  6b 21 32 34 0d 0b a4 0f  c8 8e 20 57 69 6e 64 6f  |k!24...... Windo|
00002a50  77 20 ca 0d 0b ae 0d 20  20 c9 20 5a 6f 6f 6d 3a  |w .....  . Zoom:|
00002a60  0d 0b b8 16 20 20 20 20  c8 8e 20 43 68 61 72 61  |....    .. Chara|
00002a70  63 74 65 72 20 ca 0d 0b  c2 17 20 20 20 20 20 20  |cter .....      |
00002a80  c9 20 26 31 38 31 3a f4  20 3c 46 31 3e 0d 0b cc  |. &181:. <F1>...|
00002a90  3b 20 20 20 20 20 20 20  20 58 48 61 69 72 3d ac  |;        XHair=.|
00002aa0  20 58 48 61 69 72 3a f2  55 70 64 61 74 65 53 65  | XHair:.UpdateSe|
00002ab0  6c 65 63 74 65 64 46 6c  61 67 28 5a 6f 6f 6d 2c  |lectedFlag(Zoom,|
00002ac0  37 2c 58 48 61 69 72 29  0d 0b d6 17 20 20 20 20  |7,XHair)....    |
00002ad0  20 20 c9 20 26 31 38 32  3a f4 20 3c 46 32 3e 0d  |  . &182:. <F2>.|
00002ae0  0b e0 46 20 20 20 20 20  20 20 20 42 6c 61 6e 6b  |..F        Blank|
00002af0  4d 61 67 3d ac 20 42 6c  61 6e 6b 4d 61 67 3a f2  |Mag=. BlankMag:.|
00002b00  55 70 64 61 74 65 53 65  6c 65 63 74 65 64 46 6c  |UpdateSelectedFl|
00002b10  61 67 28 5a 6f 6f 6d 2c  38 2c ac 20 42 6c 61 6e  |ag(Zoom,8,. Blan|
00002b20  6b 4d 61 67 29 0d 0b ea  47 20 20 20 20 20 20 c9  |kMag)...G      .|
00002b30  20 26 31 38 45 2c 26 31  39 45 2c 26 31 41 45 2c  | &18E,&19E,&1AE,|
00002b40  26 31 42 45 2c 26 31 38  46 2c 26 31 39 46 2c 26  |&1BE,&18F,&19F,&|
00002b50  31 41 46 2c 26 31 42 46  2c 31 33 3a f4 20 44 6f  |1AF,&1BF,13:. Do|
00002b60  77 6e 2c 55 70 2c 52 65  74 75 72 6e 0d 0b f4 33  |wn,Up,Return...3|
00002b70  20 20 20 20 20 20 20 20  41 3d a4 52 65 61 64 49  |        A=.ReadI|
00002b80  63 6f 6e 28 5a 6f 6f 6d  2c 30 29 3a 42 3d a4 52  |con(Zoom,0):B=.R|
00002b90  65 61 64 49 63 6f 6e 28  5a 6f 6f 6d 2c 31 29 0d  |eadIcon(Zoom,1).|
00002ba0  0b fe 2e 20 20 20 20 20  20 20 20 e7 20 41 3d 30  |...        . A=0|
00002bb0  20 8c 20 41 3d 31 3a f2  55 70 64 61 74 65 49 63  | . A=1:.UpdateIc|
00002bc0  6f 6e 28 5a 6f 6f 6d 2c  30 2c c3 41 29 0d 0c 08  |on(Zoom,0,.A)...|
00002bd0  2e 20 20 20 20 20 20 20  20 e7 20 42 3d 30 20 8c  |.        . B=0 .|
00002be0  20 42 3d 31 3a f2 55 70  64 61 74 65 49 63 6f 6e  | B=1:.UpdateIcon|
00002bf0  28 5a 6f 6f 6d 2c 31 2c  c3 42 29 0d 0c 12 2e 20  |(Zoom,1,.B).... |
00002c00  20 20 20 20 20 20 20 e7  20 41 3c 42 20 8c 20 42  |       . A<B . B|
00002c10  3d 41 3a f2 55 70 64 61  74 65 49 63 6f 6e 28 5a  |=A:.UpdateIcon(Z|
00002c20  6f 6f 6d 2c 31 2c c3 42  29 0d 0c 1c 34 20 20 20  |oom,1,.B)...4   |
00002c30  20 20 20 20 20 53 63 61  6c 65 21 30 3d 41 3a 53  |     Scale!0=A:S|
00002c40  63 61 6c 65 21 34 3d 41  3a 53 63 61 6c 65 21 38  |cale!4=A:Scale!8|
00002c50  3d 42 3a 53 63 61 6c 65  21 31 32 3d 42 0d 0c 26  |=B:Scale!12=B..&|
00002c60  26 20 20 20 20 20 20 20  20 e7 20 49 63 6f 6e 3d  |&        . Icon=|
00002c70  30 20 8c 20 49 63 6f 6e  3d 31 20 8b 20 49 63 6f  |0 . Icon=1 . Ico|
00002c80  6e 3d 30 0d 0c 30 78 20  20 20 20 20 20 20 20 e7  |n=0..0x        .|
00002c90  20 49 63 6f 6e 3d 30 20  8c 20 c8 99 20 22 57 69  | Icon=0 . .. "Wi|
00002ca0  6d 70 5f 53 65 74 43 61  72 65 74 50 6f 73 69 74  |mp_SetCaretPosit|
00002cb0  69 6f 6e 22 2c 5a 6f 6f  6d 2c 49 63 6f 6e 2c 2c  |ion",Zoom,Icon,,|
00002cc0  2c 2d 31 2c a9 28 c3 41  29 20 8b 20 c8 99 20 22  |,-1,.(.A) . .. "|
00002cd0  57 69 6d 70 5f 53 65 74  43 61 72 65 74 50 6f 73  |Wimp_SetCaretPos|
00002ce0  69 74 69 6f 6e 22 2c 5a  6f 6f 6d 2c 49 63 6f 6e  |ition",Zoom,Icon|
00002cf0  2c 2c 2c 2d 31 2c a9 28  c3 42 29 0d 0c 3a 2f 20  |,,,-1,.(.B)..:/ |
00002d00  20 20 20 20 20 20 20 f4  20 53 65 74 73 20 63 61  |       . Sets ca|
00002d10  72 65 74 20 74 6f 20 65  6e 64 20 6f 66 20 63 75  |ret to end of cu|
00002d20  72 72 65 6e 74 20 69 63  6f 6e 0d 0c 44 3e 20 20  |rrent icon..D>  |
00002d30  20 20 20 20 20 20 e7 20  43 68 61 72 61 63 74 65  |      . Characte|
00002d40  72 3d 31 33 20 80 20 49  63 6f 6e 3d 30 20 8c 20  |r=13 . Icon=0 . |
00002d50  c8 99 20 22 57 69 6d 70  5f 43 72 65 61 74 65 4d  |.. "Wimp_CreateM|
00002d60  65 6e 75 22 2c 2c 2d 31  0d 0c 4e 3b 20 20 20 20  |enu",,-1..N;    |
00002d70  20 20 20 20 f4 20 43 6c  6f 73 65 20 77 69 6e 64  |    . Close wind|
00002d80  6f 77 20 69 66 20 52 65  74 75 72 6e 20 70 72 65  |ow if Return pre|
00002d90  73 73 65 64 20 6f 6e 20  73 65 63 6f 6e 64 20 69  |ssed on second i|
00002da0  63 6f 6e 0d 0c 58 0b 20  20 20 20 20 20 7f 0d 0c  |con..X.      ...|
00002db0  62 2a 20 20 20 20 20 20  20 20 c8 99 20 22 57 69  |b*        .. "Wi|
00002dc0  6d 70 5f 50 72 6f 63 65  73 73 4b 65 79 22 2c 43  |mp_ProcessKey",C|
00002dd0  68 61 72 61 63 74 65 72  0d 0c 6c 09 20 20 20 20  |haracter..l.    |
00002de0  cb 0d 0c 76 07 20 20 7f  0d 0c 80 26 20 20 20 20  |...v.  ....&    |
00002df0  c8 99 20 22 57 69 6d 70  5f 50 72 6f 63 65 73 73  |.. "Wimp_Process|
00002e00  4b 65 79 22 2c 43 68 61  72 61 63 74 65 72 0d 0c  |Key",Character..|
00002e10  8a 05 cb 0d 0c 94 05 e1  0d 0c 9e 05 3a 0d 0c a8  |............:...|
00002e20  11 dd 20 f2 44 65 63 6f  64 65 4d 65 6e 75 0d 0c  |.. .DecodeMenu..|
00002e30  b2 2a 53 75 62 30 3d 42  6c 6f 63 6b 21 30 3a 53  |.*Sub0=Block!0:S|
00002e40  75 62 31 3d 42 6c 6f 63  6b 21 34 3a 53 75 62 32  |ub1=Block!4:Sub2|
00002e50  3d 42 6c 6f 63 6b 21 38  0d 0c bc 0f 43 6c 6f 73  |=Block!8....Clos|
00002e60  65 4d 65 6e 75 3d a3 0d  0c c6 0b c8 8e 20 4d 25  |eMenu=....... M%|
00002e70  20 ca 0d 0c d0 0f 20 20  c9 20 49 42 4d 65 6e 75  | .....  . IBMenu|
00002e80  3a 0d 0c da 11 20 20 20  20 c8 8e 20 53 75 62 30  |:....    .. Sub0|
00002e90  20 ca 0d 0c e4 0d 20 20  20 20 20 20 c9 20 30 0d  | .....      . 0.|
00002ea0  0c ee 2b 20 20 20 20 20  20 20 20 c8 99 20 22 57  |..+        .. "W|
00002eb0  69 6d 70 5f 47 65 74 50  6f 69 6e 74 65 72 49 6e  |imp_GetPointerIn|
00002ec0  66 6f 22 2c 2c 42 6c 6f  63 6b 0d 0c f8 3c 20 20  |fo",,Block...<  |
00002ed0  20 20 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 43  |      .. "Wimp_C|
00002ee0  72 65 61 74 65 4d 65 6e  75 22 2c 2c 49 6e 66 6f  |reateMenu",,Info|
00002ef0  2c 42 6c 6f 63 6b 21 30  2d 32 34 2c 42 6c 6f 63  |,Block!0-24,Bloc|
00002f00  6b 21 34 2b 32 34 0d 0d  02 17 20 20 20 20 20 20  |k!4+24....      |
00002f10  20 20 43 6c 6f 73 65 4d  65 6e 75 3d b9 0d 0d 0c  |  CloseMenu=....|
00002f20  0d 20 20 20 20 20 20 c9  20 31 0d 0d 16 12 20 20  |.      . 1....  |
00002f30  20 20 20 20 20 20 44 6f  6e 65 3d b9 0d 0d 20 09  |      Done=... .|
00002f40  20 20 20 20 cb 0d 0d 2a  11 20 20 c9 20 4d 61 69  |    ...*.  . Mai|
00002f50  6e 4d 65 6e 75 3a 0d 0d  34 11 20 20 20 20 c8 8e  |nMenu:..4.    ..|
00002f60  20 53 75 62 30 20 ca 0d  0d 3e 0d 20 20 20 20 20  | Sub0 ...>.     |
00002f70  20 c9 20 30 0d 0d 48 2b  20 20 20 20 20 20 20 20  | . 0..H+        |
00002f80  c8 99 20 22 57 69 6d 70  5f 47 65 74 50 6f 69 6e  |.. "Wimp_GetPoin|
00002f90  74 65 72 49 6e 66 6f 22  2c 2c 42 6c 6f 63 6b 0d  |terInfo",,Block.|
00002fa0  0d 52 3c 20 20 20 20 20  20 20 20 c8 99 20 22 57  |.R<        .. "W|
00002fb0  69 6d 70 5f 43 72 65 61  74 65 4d 65 6e 75 22 2c  |imp_CreateMenu",|
00002fc0  2c 49 6e 66 6f 2c 42 6c  6f 63 6b 21 30 2d 32 34  |,Info,Block!0-24|
00002fd0  2c 42 6c 6f 63 6b 21 34  2b 32 34 0d 0d 5c 17 20  |,Block!4+24..\. |
00002fe0  20 20 20 20 20 20 20 43  6c 6f 73 65 4d 65 6e 75  |       CloseMenu|
00002ff0  3d b9 0d 0d 66 0d 20 20  20 20 20 20 c9 20 31 0d  |=...f.      . 1.|
00003000  0d 70 2b 20 20 20 20 20  20 20 20 c8 99 20 22 57  |.p+        .. "W|
00003010  69 6d 70 5f 47 65 74 50  6f 69 6e 74 65 72 49 6e  |imp_GetPointerIn|
00003020  66 6f 22 2c 2c 42 6c 6f  63 6b 0d 0d 7a 3c 20 20  |fo",,Block..z<  |
00003030  20 20 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 43  |      .. "Wimp_C|
00003040  72 65 61 74 65 4d 65 6e  75 22 2c 2c 5a 6f 6f 6d  |reateMenu",,Zoom|
00003050  2c 42 6c 6f 63 6b 21 30  2d 32 34 2c 42 6c 6f 63  |,Block!0-24,Bloc|
00003060  6b 21 34 2b 32 34 0d 0d  84 17 20 20 20 20 20 20  |k!4+24....      |
00003070  20 20 43 6c 6f 73 65 4d  65 6e 75 3d b9 0d 0d 8e  |  CloseMenu=....|
00003080  0d 20 20 20 20 20 20 c9  20 32 0d 0d 98 2b 20 20  |.      . 2...+  |
00003090  20 20 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 47  |      .. "Wimp_G|
000030a0  65 74 50 6f 69 6e 74 65  72 49 6e 66 6f 22 2c 2c  |etPointerInfo",,|
000030b0  42 6c 6f 63 6b 0d 0d a2  3b 20 20 20 20 20 20 20  |Block...;       |
000030c0  20 c8 99 20 22 57 69 6d  70 5f 43 72 65 61 74 65  | .. "Wimp_Create|
000030d0  4d 65 6e 75 22 2c 2c 4c  6f 63 2c 42 6c 6f 63 6b  |Menu",,Loc,Block|
000030e0  21 30 2d 32 34 2c 42 6c  6f 63 6b 21 34 2b 32 34  |!0-24,Block!4+24|
000030f0  0d 0d ac 17 20 20 20 20  20 20 20 20 43 6c 6f 73  |....        Clos|
00003100  65 4d 65 6e 75 3d b9 0d  0d b6 0d 20 20 20 20 20  |eMenu=.....     |
00003110  20 c9 20 33 0d 0d c0 5c  20 20 20 20 20 20 20 20  | . 3...\        |
00003120  e7 20 ac 20 a4 53 61 76  65 53 65 74 74 69 6e 67  |. . .SaveSetting|
00003130  73 20 8c 20 85 20 39 39  39 39 2c 22 41 6e 20 65  |s . . 9999,"An e|
00003140  72 72 6f 72 20 6f 63 63  75 72 72 65 64 20 77 68  |rror occurred wh|
00003150  69 6c 73 74 20 77 72 69  74 69 6e 67 20 74 68 65  |ilst writing the|
00003160  20 73 65 74 74 69 6e 67  73 20 66 69 6c 65 2e 22  | settings file."|
00003170  0d 0d ca 09 20 20 20 20  cb 0d 0d d4 05 cb 0d 0d  |....    ........|
00003180  de 23 c8 99 20 22 57 69  6d 70 5f 47 65 74 50 6f  |.#.. "Wimp_GetPo|
00003190  69 6e 74 65 72 49 6e 66  6f 22 2c 2c 42 6c 6f 63  |interInfo",,Bloc|
000031a0  6b 0d 0d e8 33 e7 20 28  28 42 6c 6f 63 6b 21 38  |k...3. ((Block!8|
000031b0  20 80 20 31 29 3d 31 29  20 80 20 28 ac 20 43 6c  | . 1)=1) . (. Cl|
000031c0  6f 73 65 4d 65 6e 75 29  20 8c 20 f2 4d 61 6b 65  |oseMenu) . .Make|
000031d0  4d 65 6e 75 0d 0d f2 05  e1 0d 0d fc 05 3a 0d 0e  |Menu.........:..|
000031e0  06 4f f4 20 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.O. ------------|
000031f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003220  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0d 0e 10  |-------------...|
00003230  13 f4 20 4d 65 6e 75 20  72 6f 75 74 69 6e 65 73  |.. Menu routines|
00003240  0d 0e 1a 4f f4 20 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...O. ----------|
00003250  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003280  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
00003290  0e 24 05 3a 0d 0e 2e 11  dd 20 f2 42 75 69 6c 64  |.$.:..... .Build|
000032a0  4d 65 6e 75 73 0d 0e 38  49 f4 20 54 68 69 73 20  |Menus..8I. This |
000032b0  70 72 6f 63 65 64 75 72  65 20 73 68 6f 75 6c 64  |procedure should|
000032c0  20 6f 6e 6c 79 20 62 65  20 76 69 73 69 74 65 64  | only be visited|
000032d0  20 6f 6e 63 65 2c 20 73  69 6e 63 65 20 69 74 20  | once, since it |
000032e0  63 6f 6e 74 61 69 6e 73  20 44 49 4d 73 2e 0d 0e  |contains DIMs...|
000032f0  42 07 20 20 3a 0d 0e 4c  4f f4 20 49 6e 20 74 68  |B.  :..LO. In th|
00003300  65 20 6d 65 6e 75 20 74  69 74 6c 65 20 73 74 72  |e menu title str|
00003310  69 6e 67 73 20 62 65 6c  6f 77 2c 20 69 66 20 61  |ings below, if a|
00003320  20 22 7c 22 20 63 68 61  72 61 63 74 65 72 20 69  | "|" character i|
00003330  73 20 70 72 65 73 65 6e  74 20 69 74 20 77 69 6c  |s present it wil|
00003340  6c 20 62 65 0d 0e 56 4f  f4 20 72 65 70 6c 61 63  |l be..VO. replac|
00003350  65 64 20 62 79 20 61 20  73 70 61 63 65 20 75 6e  |ed by a space un|
00003360  64 65 72 20 52 49 53 43  20 4f 53 20 33 2e 31 20  |der RISC OS 3.1 |
00003370  28 6f 72 20 67 72 65 61  74 65 72 29 2c 20 6f 72  |(or greater), or|
00003380  20 77 69 6c 6c 20 74 65  72 6d 69 6e 61 74 65 20  | will terminate |
00003390  74 68 65 0d 0e 60 4f f4  20 73 74 72 69 6e 67 20  |the..`O. string |
000033a0  75 6e 64 65 72 20 65 61  72 6c 69 65 72 20 76 65  |under earlier ve|
000033b0  72 73 69 6f 6e 73 20 6f  66 20 74 68 65 20 77 69  |rsions of the wi|
000033c0  6d 70 2e 20 54 68 69 73  20 61 6c 6c 6f 77 73 20  |mp. This allows |
000033d0  74 68 65 20 6e 65 77 20  69 6e 64 69 72 65 63 74  |the new indirect|
000033e0  65 64 0d 0e 6a 46 f4 20  6d 65 6e 75 20 74 69 74  |ed..jF. menu tit|
000033f0  6c 65 73 20 74 6f 20 62  65 20 75 73 65 64 20 28  |les to be used (|
00003400  77 68 69 63 68 20 77 65  72 65 20 69 6e 74 72 6f  |which were intro|
00003410  64 75 63 65 64 20 77 69  74 68 20 52 49 53 43 20  |duced with RISC |
00003420  4f 53 20 33 2e 31 29 2e  0d 0e 74 07 20 20 3a 0d  |OS 3.1)...t.  :.|
00003430  0e 7e 23 49 6e 64 69 72  65 63 74 4d 65 6e 75 54  |.~#IndirectMenuT|
00003440  65 78 74 4f 66 66 73 65  74 50 6f 69 6e 74 65 72  |extOffsetPointer|
00003450  3d 30 0d 0e 88 4e f4 20  54 68 69 73 20 70 6f 69  |=0...N. This poi|
00003460  6e 74 73 20 74 6f 20 61  20 70 6f 6f 6c 20 74 6f  |nts to a pool to|
00003470  20 62 65 20 75 73 65 64  20 62 79 20 61 6c 6c 20  | be used by all |
00003480  6d 65 6e 75 73 20 66 6f  72 20 74 68 65 69 72 20  |menus for their |
00003490  69 6e 64 69 72 65 63 74  65 64 20 74 65 78 74 2e  |indirected text.|
000034a0  0d 0e 92 07 20 20 3a 0d  0e 9c 0d 4d 25 3d 49 42  |....  :....M%=IB|
000034b0  4d 65 6e 75 0d 0e a6 48  54 69 74 6c 65 24 3d 22  |Menu...HTitle$="|
000034c0  43 6c 6f 73 65 56 69 65  77 22 3a de 20 49 42 4d  |CloseView":. IBM|
000034d0  65 6e 75 54 69 74 6c 65  20 a9 28 54 69 74 6c 65  |enuTitle .(Title|
000034e0  24 29 2b 31 3a 24 49 42  4d 65 6e 75 54 69 74 6c  |$)+1:$IBMenuTitl|
000034f0  65 3d 54 69 74 6c 65 24  2b bd 31 33 0d 0e b0 1a  |e=Title$+.13....|
00003500  f2 4d 65 6e 75 49 6e 69  74 28 49 42 4d 65 6e 75  |.MenuInit(IBMenu|
00003510  54 69 74 6c 65 29 0d 0e  ba 1c f2 4d 65 6e 75 49  |Title).....MenuI|
00003520  74 65 6d 28 22 49 6e 66  6f 22 2c 30 2c 49 6e 66  |tem("Info",0,Inf|
00003530  6f 29 0d 0e c4 1c f2 4d  65 6e 75 49 74 65 6d 28  |o).....MenuItem(|
00003540  22 51 75 69 74 22 2c 31  32 38 2c 2d 31 29 0d 0e  |"Quit",128,-1)..|
00003550  ce 07 20 20 3a 0d 0e d8  0f 4d 25 3d 4d 61 69 6e  |..  :....M%=Main|
00003560  4d 65 6e 75 0d 0e e2 56  54 69 74 6c 65 24 3d 22  |Menu...VTitle$="|
00003570  43 6c 6f 73 65 56 69 65  77 7c 4d 61 67 6e 69 66  |CloseView|Magnif|
00003580  69 65 72 22 3a de 20 4d  61 69 6e 4d 65 6e 75 54  |ier":. MainMenuT|
00003590  69 74 6c 65 20 a9 28 54  69 74 6c 65 24 29 2b 32  |itle .(Title$)+2|
000035a0  3a 24 4d 61 69 6e 4d 65  6e 75 54 69 74 6c 65 3d  |:$MainMenuTitle=|
000035b0  54 69 74 6c 65 24 2b bd  31 33 0d 0e ec 1c f2 4d  |Title$+.13.....M|
000035c0  65 6e 75 49 6e 69 74 28  4d 61 69 6e 4d 65 6e 75  |enuInit(MainMenu|
000035d0  54 69 74 6c 65 29 0d 0e  f6 1c f2 4d 65 6e 75 49  |Title).....MenuI|
000035e0  74 65 6d 28 22 49 6e 66  6f 22 2c 32 2c 49 6e 66  |tem("Info",2,Inf|
000035f0  6f 29 0d 0f 00 2a f2 4d  65 6e 75 49 74 65 6d 28  |o)...*.MenuItem(|
00003600  22 4d 61 67 6e 69 66 69  63 61 74 69 6f 6e 20 65  |"Magnification e|
00003610  74 63 2e 22 2c 30 2c 5a  6f 6f 6d 29 0d 0f 0a 26  |tc.",0,Zoom)...&|
00003620  f2 4d 65 6e 75 49 74 65  6d 28 22 57 69 6e 64 6f  |.MenuItem("Windo|
00003630  77 20 70 6f 73 69 74 69  6f 6e 22 2c 32 2c 4c 6f  |w position",2,Lo|
00003640  63 29 0d 0f 14 25 f2 4d  65 6e 75 49 74 65 6d 28  |c)...%.MenuItem(|
00003650  22 53 61 76 65 20 73 65  74 74 69 6e 67 73 22 2c  |"Save settings",|
00003660  31 32 38 2c 2d 31 29 0d  0f 1e 05 e1 0d 0f 28 05  |128,-1).......(.|
00003670  3a 0d 0f 32 0f dd 20 f2  4d 61 6b 65 4d 65 6e 75  |:..2.. .MakeMenu|
00003680  0d 0f 3c 17 e7 20 4d 65  6e 75 58 3c 30 20 8c 20  |..<.. MenuX<0 . |
00003690  4d 65 6e 75 58 3d 30 0d  0f 46 2a e7 20 4d 65 6e  |MenuX=0..F*. Men|
000036a0  75 59 3c 31 38 34 20 8c  20 4d 65 6e 75 59 3d 31  |uY<184 . MenuY=1|
000036b0  38 34 3a f4 20 66 6f 72  20 69 63 6f 6e 20 62 61  |84:. for icon ba|
000036c0  72 0d 0f 50 37 c8 99 20  22 57 69 6d 70 5f 43 72  |r..P7.. "Wimp_Cr|
000036d0  65 61 74 65 4d 65 6e 75  22 2c 2c 4d 25 2c 4d 65  |eateMenu",,M%,Me|
000036e0  6e 75 58 2d 28 28 33 36  2b 4d 25 21 31 36 29 2f  |nuX-((36+M%!16)/|
000036f0  32 29 2c 4d 65 6e 75 59  0d 0f 5a 05 e1 0d 0f 64  |2),MenuY..Z....d|
00003700  05 3a 0d 0f 6e 1a dd 20  f2 4d 65 6e 75 49 6e 69  |.:..n.. .MenuIni|
00003710  74 28 4d 65 6e 75 54 69  74 6c 65 29 0d 0f 78 11  |t(MenuTitle)..x.|
00003720  e7 20 77 69 6d 70 3e 3d  33 31 30 20 8c 0d 0f 82  |. wimp>=310 ....|
00003730  37 20 20 41 3d a7 24 4d  65 6e 75 54 69 74 6c 65  |7  A=.$MenuTitle|
00003740  2c 22 7c 22 29 3a e7 20  41 3c 3e 30 20 8c 20 3f  |,"|"):. A<>0 . ?|
00003750  28 4d 65 6e 75 54 69 74  6c 65 2b 28 41 2d 31 29  |(MenuTitle+(A-1)|
00003760  29 3d 33 32 0d 0f 8c 1b  20 20 4d 65 6e 75 4d 61  |)=32....  MenuMa|
00003770  78 3d a9 28 24 4d 65 6e  75 54 69 74 6c 65 29 0d  |x=.($MenuTitle).|
00003780  0f 96 14 20 20 4d 25 21  30 3d 4d 65 6e 75 54 69  |...  M%!0=MenuTi|
00003790  74 6c 65 0d 0f a0 05 cc  0d 0f aa 37 20 20 41 3d  |tle........7  A=|
000037a0  a7 24 4d 65 6e 75 54 69  74 6c 65 2c 22 7c 22 29  |.$MenuTitle,"|")|
000037b0  3a e7 20 41 3c 3e 30 20  8c 20 3f 28 4d 65 6e 75  |:. A<>0 . ?(Menu|
000037c0  54 69 74 6c 65 2b 28 41  2d 31 29 29 3d 31 33 0d  |Title+(A-1))=13.|
000037d0  0f b4 20 20 20 4d 65 6e  75 4d 61 78 3d a9 28 c0  |..   MenuMax=.(.|
000037e0  24 4d 65 6e 75 54 69 74  6c 65 2c 31 32 29 29 0d  |$MenuTitle,12)).|
000037f0  0f be 19 20 20 24 4d 25  3d c0 24 4d 65 6e 75 54  |...  $M%=.$MenuT|
00003800  69 74 6c 65 2c 31 32 29  0d 0f c8 05 cd 0d 0f d2  |itle,12)........|
00003810  24 4d 25 3f 31 32 3d 37  3a 4d 25 3f 31 33 3d 32  |$M%?12=7:M%?13=2|
00003820  3a 4d 25 3f 31 34 3d 31  31 3a 4d 25 3f 31 35 3d  |:M%?14=11:M%?15=|
00003830  30 0d 0f dc 14 4d 25 21  31 36 3d 4d 65 6e 75 4d  |0....M%!16=MenuM|
00003840  61 78 2a 31 36 0d 0f e6  14 4d 25 21 32 30 3d 34  |ax*16....M%!20=4|
00003850  34 3a 4d 25 21 32 34 3d  30 0d 0f f0 0c 50 25 3d  |4:M%!24=0....P%=|
00003860  4d 25 2b 32 38 0d 0f fa  05 e1 0d 10 04 05 3a 0d  |M%+28.........:.|
00003870  10 0e 21 dd 20 f2 4d 65  6e 75 49 74 65 6d 28 54  |..!. .MenuItem(T|
00003880  65 78 74 24 2c 46 6c 61  67 73 2c 4c 69 6e 6b 29  |ext$,Flags,Link)|
00003890  0d 10 18 4b f4 20 46 6c  61 67 73 3a 20 31 2d 74  |...K. Flags: 1-t|
000038a0  69 63 6b 65 64 2c 20 32  2d 64 61 73 68 65 64 20  |icked, 2-dashed |
000038b0  6c 69 6e 65 2c 20 34 2d  77 72 69 74 65 61 62 6c  |line, 4-writeabl|
000038c0  65 2c 20 38 2d 6d 65 73  73 61 67 65 2c 20 31 32  |e, 8-message, 12|
000038d0  38 2d 6c 61 73 74 20 69  74 65 6d 0d 10 22 31 f4  |8-last item.."1.|
000038e0  20 4c 69 6e 6b 3a 20 6d  65 6e 75 20 6f 72 20 77  | Link: menu or w|
000038f0  69 6e 64 6f 77 20 68 61  6e 64 6c 65 20 66 6f 72  |indow handle for|
00003900  20 73 75 62 2d 70 6f 69  6e 74 65 72 0d 10 2c 18  | sub-pointer..,.|
00003910  50 25 21 30 3d 46 6c 61  67 73 3a 50 25 21 34 3d  |P%!0=Flags:P%!4=|
00003920  4c 69 6e 6b 0d 10 36 14  e7 20 a9 28 54 65 78 74  |Link..6.. .(Text|
00003930  24 29 3c 3d 31 32 20 8c  0d 10 40 25 20 20 50 25  |$)<=12 ...@%  P%|
00003940  21 38 3d 26 30 37 30 30  33 30 32 31 3a f4 20 4e  |!8=&07003021:. N|
00003950  6f 74 20 69 6e 64 69 72  65 63 74 65 64 0d 10 4a  |ot indirected..J|
00003960  14 20 20 24 28 50 25 2b  31 32 29 3d 54 65 78 74  |.  $(P%+12)=Text|
00003970  24 0d 10 54 05 cc 0d 10  5e 21 20 20 50 25 21 38  |$..T....^!  P%!8|
00003980  3d 26 30 37 30 30 33 31  32 31 3a f4 20 49 6e 64  |=&07003121:. Ind|
00003990  69 72 65 63 74 65 64 0d  10 68 3a 20 20 50 25 21  |irected..h:  P%!|
000039a0  31 32 3d 49 6e 64 69 72  65 63 74 4d 65 6e 75 54  |12=IndirectMenuT|
000039b0  65 78 74 2b 49 6e 64 69  72 65 63 74 4d 65 6e 75  |ext+IndirectMenu|
000039c0  54 65 78 74 4f 66 66 73  65 74 50 6f 69 6e 74 65  |TextOffsetPointe|
000039d0  72 0d 10 72 15 20 20 50  25 21 31 36 3d 30 3a 50  |r..r.  P%!16=0:P|
000039e0  25 21 32 30 3d 30 0d 10  7c 41 20 20 24 28 49 6e  |%!20=0..|A  $(In|
000039f0  64 69 72 65 63 74 4d 65  6e 75 54 65 78 74 2b 49  |directMenuText+I|
00003a00  6e 64 69 72 65 63 74 4d  65 6e 75 54 65 78 74 4f  |ndirectMenuTextO|
00003a10  66 66 73 65 74 50 6f 69  6e 74 65 72 29 3d 54 65  |ffsetPointer)=Te|
00003a20  78 74 24 2b bd 31 33 0d  10 86 2f 20 20 49 6e 64  |xt$+.13.../  Ind|
00003a30  69 72 65 63 74 4d 65 6e  75 54 65 78 74 4f 66 66  |irectMenuTextOff|
00003a40  73 65 74 50 6f 69 6e 74  65 72 2b 3d a9 28 54 65  |setPointer+=.(Te|
00003a50  78 74 24 29 2b 31 0d 10  90 82 20 20 e7 20 49 6e  |xt$)+1....  . In|
00003a60  64 69 72 65 63 74 4d 65  6e 75 54 65 78 74 4f 66  |directMenuTextOf|
00003a70  66 73 65 74 50 6f 69 6e  74 65 72 3e 49 6e 64 4d  |fsetPointer>IndM|
00003a80  65 6e 75 4d 61 78 20 8c  20 85 20 30 2c 22 54 68  |enuMax . . 0,"Th|
00003a90  65 20 69 6e 64 69 72 65  63 74 20 6d 65 6e 75 20  |e indirect menu |
00003aa0  74 65 78 74 20 62 75 66  66 65 72 20 68 61 73 20  |text buffer has |
00003ab0  6f 76 65 72 66 6c 6f 77  65 64 2e 20 50 6c 65 61  |overflowed. Plea|
00003ac0  73 65 20 61 6c 6c 6f 63  61 74 65 20 6d 6f 72 65  |se allocate more|
00003ad0  20 73 70 61 63 65 2e 22  0d 10 9a 05 cd 0d 10 a4  | space."........|
00003ae0  0a 50 25 2b 3d 32 34 0d  10 ae 3e e7 20 4d 65 6e  |.P%+=24...>. Men|
00003af0  75 4d 61 78 3c a9 28 54  65 78 74 24 29 20 8c 20  |uMax<.(Text$) . |
00003b00  4d 65 6e 75 4d 61 78 3d  a9 28 54 65 78 74 24 29  |MenuMax=.(Text$)|
00003b10  3a 4d 25 21 31 36 3d 28  4d 65 6e 75 4d 61 78 2b  |:M%!16=(MenuMax+|
00003b20  31 29 2a 31 36 0d 10 b8  41 e7 20 28 46 6c 61 67  |1)*16...A. (Flag|
00003b30  73 3d 31 32 38 29 20 80  20 28 77 69 6d 70 3e 3d  |s=128) . (wimp>=|
00003b40  33 31 30 29 20 8c 20 4d  25 21 32 38 3d 28 28 28  |310) . M%!28=(((|
00003b50  4d 25 21 32 38 29 20 80  20 ac 20 32 35 36 29 20  |M%!28) . . 256) |
00003b60  82 20 32 35 36 29 0d 10  c2 37 20 20 f4 20 49 6e  |. 256)...7  . In|
00003b70  64 69 72 65 63 74 65 64  20 6d 65 6e 75 20 74 69  |directed menu ti|
00003b80  74 6c 65 73 20 66 6f 72  20 52 49 53 43 20 4f 53  |tles for RISC OS|
00003b90  20 33 2e 31 20 75 70 77  61 72 64 73 2e 0d 10 cc  | 3.1 upwards....|
00003ba0  05 e1 0d 10 d6 05 3a 0d  10 e0 4f f4 20 2d 2d 2d  |......:...O. ---|
00003bb0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003bf0  2d 2d 2d 2d 2d 2d 0d 10  ea 29 f4 20 52 65 73 70  |------...). Resp|
00003c00  6f 6e 73 65 73 20 74 6f  20 69 6e 63 6f 6d 69 6e  |onses to incomin|
00003c10  67 20 77 69 6d 70 20 6d  65 73 73 61 67 65 73 0d  |g wimp messages.|
00003c20  10 f4 4f f4 20 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |..O. -----------|
00003c30  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003c60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d 10  |--------------..|
00003c70  fe 05 3a 0d 11 08 18 dd  20 f2 53 61 76 65 44 65  |..:..... .SaveDe|
00003c80  73 6b 74 6f 70 28 46 69  6c 65 29 0d 11 12 07 ea  |sktop(File).....|
00003c90  20 85 0d 11 1c 47 ee 20  85 20 ea 20 42 6c 6f 63  | ....G. . . Bloc|
00003ca0  6b 21 31 32 3d 42 6c 6f  63 6b 21 38 3a c8 99 20  |k!12=Block!8:.. |
00003cb0  22 57 69 6d 70 5f 53 65  6e 64 4d 65 73 73 61 67  |"Wimp_SendMessag|
00003cc0  65 22 2c 31 39 2c 42 6c  6f 63 6b 2c 42 6c 6f 63  |e",19,Block,Bloc|
00003cd0  6b 21 34 3a f7 20 85 3a  e1 0d 11 26 49 f4 20 54  |k!4:. .:...&I. T|
00003ce0  68 65 20 61 62 6f 76 65  20 6c 69 6e 65 20 61 63  |he above line ac|
00003cf0  6b 6e 6f 77 6c 65 64 67  65 73 20 74 68 65 20 6d  |knowledges the m|
00003d00  65 73 73 61 67 65 20 69  66 20 61 6e 20 65 72 72  |essage if an err|
00003d10  6f 72 20 6f 63 63 75 72  73 2c 20 74 68 65 72 65  |or occurs, there|
00003d20  62 79 0d 11 30 20 f4 20  61 62 6f 72 74 69 6e 67  |by..0 . aborting|
00003d30  20 74 68 65 20 64 65 73  6b 74 6f 70 20 73 61 76  | the desktop sav|
00003d40  65 2e 0d 11 3a 2b d5 23  46 69 6c 65 2c 22 52 75  |e...:+.#File,"Ru|
00003d50  6e 20 22 2b 4f 75 72 50  61 74 68 4e 61 6d 65 24  |n "+OurPathName$|
00003d60  2b 4f 75 72 46 69 6c 65  4e 61 6d 65 24 0d 11 44  |+OurFileName$..D|
00003d70  05 e1 0d 11 4e 05 3a 0d  11 58 0b dd 20 f2 48 65  |....N.:..X.. .He|
00003d80  6c 70 0d 11 62 34 42 6c  6f 63 6b 21 31 32 3d 42  |lp..b4Block!12=B|
00003d90  6c 6f 63 6b 21 38 3a 42  6c 6f 63 6b 21 31 36 3d  |lock!8:Block!16=|
00003da0  26 35 30 33 3a 48 65 6c  70 49 6e 66 6f 3d 42 6c  |&503:HelpInfo=Bl|
00003db0  6f 63 6b 2b 32 30 0d 11  6c 07 20 20 3a 0d 11 76  |ock+20..l.  :..v|
00003dc0  30 f4 20 42 6c 6f 63 6b  21 33 32 20 67 69 76 65  |0. Block!32 give|
00003dd0  73 20 77 69 6e 64 6f 77  2c 20 42 6c 6f 63 6b 21  |s window, Block!|
00003de0  33 36 20 67 69 76 65 73  20 69 63 6f 6e 0d 11 80  |36 gives icon...|
00003df0  07 20 20 3a 0d 11 8a 11  c8 8e 20 42 6c 6f 63 6b  |.  :...... Block|
00003e00  21 33 32 20 ca 0d 11 94  2f 20 20 c9 20 2d 32 3a  |!32 ..../  . -2:|
00003e10  f2 53 65 6e 64 28 22 54  68 69 73 20 69 73 20 74  |.Send("This is t|
00003e20  68 65 20 43 6c 6f 73 65  56 69 65 77 20 69 63 6f  |he CloseView ico|
00003e30  6e 2e 22 29 0d 11 9e 3d  20 20 20 20 20 20 20 20  |n.")...=        |
00003e40  20 20 f2 53 65 6e 64 28  22 43 6c 69 63 6b 20 4d  |  .Send("Click M|
00003e50  45 4e 55 20 66 6f 72 20  69 6e 66 6f 72 6d 61 74  |ENU for informat|
00003e60  69 6f 6e 20 6f 72 20 74  6f 20 71 75 69 74 2e 22  |ion or to quit."|
00003e70  29 0d 11 a8 41 20 20 20  20 20 20 20 20 20 20 f2  |)...A          .|
00003e80  53 65 6e 64 28 22 43 6c  69 63 6b 20 53 45 4c 45  |Send("Click SELE|
00003e90  43 54 20 74 6f 20 6f 70  65 6e 20 74 68 65 20 6d  |CT to open the m|
00003ea0  61 67 6e 69 66 69 65 72  20 77 69 6e 64 6f 77 2e  |agnifier window.|
00003eb0  22 29 0d 11 b2 42 20 20  c9 20 4d 61 67 6e 69 66  |")...B  . Magnif|
00003ec0  69 65 72 3a f2 53 65 6e  64 28 22 54 68 69 73 20  |ier:.Send("This |
00003ed0  69 73 20 74 68 65 20 43  6c 6f 73 65 56 69 65 77  |is the CloseView|
00003ee0  20 4d 61 67 6e 69 66 69  65 72 20 77 69 6e 64 6f  | Magnifier windo|
00003ef0  77 2e 22 29 0d 11 bc 3b  20 20 20 20 20 20 20 20  |w.")...;        |
00003f00  20 20 20 20 20 20 20 20  20 f2 53 65 6e 64 28 22  |         .Send("|
00003f10  43 6c 69 63 6b 20 4d 45  4e 55 20 66 6f 72 20 74  |Click MENU for t|
00003f20  68 65 20 6d 61 69 6e 20  6d 65 6e 75 2e 22 29 0d  |he main menu.").|
00003f30  11 c6 50 20 20 20 20 20  20 20 20 20 20 20 20 20  |..P             |
00003f40  20 20 20 20 f2 53 65 6e  64 28 22 43 6c 69 63 6b  |    .Send("Click|
00003f50  20 53 45 4c 45 43 54 20  74 6f 20 74 6f 67 67 6c  | SELECT to toggl|
00003f60  65 20 74 68 65 20 63 72  6f 73 73 2d 68 61 69 72  |e the cross-hair|
00003f70  73 20 6f 6e 20 61 6e 64  20 6f 66 66 2e 22 29 0d  |s on and off.").|
00003f80  11 d0 58 20 20 20 20 20  20 20 20 20 20 20 20 20  |..X             |
00003f90  20 20 20 20 f2 53 65 6e  64 28 22 43 6c 69 63 6b  |    .Send("Click|
00003fa0  20 41 44 4a 55 53 54 20  74 6f 20 74 6f 67 67 6c  | ADJUST to toggl|
00003fb0  65 20 72 65 63 75 72 73  69 76 65 20 6d 61 67 6e  |e recursive magn|
00003fc0  69 66 69 63 61 74 69 6f  6e 20 6f 6e 20 61 6e 64  |ification on and|
00003fd0  20 6f 66 66 2e 22 29 0d  11 da 47 20 20 c9 20 49  | off.")...G  . I|
00003fe0  6e 66 6f 3a f2 53 65 6e  64 28 22 54 68 69 73 20  |nfo:.Send("This |
00003ff0  77 69 6e 64 6f 77 20 64  69 73 70 6c 61 79 73 20  |window displays |
00004000  69 6e 66 6f 72 6d 61 74  69 6f 6e 20 61 62 6f 75  |information abou|
00004010  74 20 43 6c 6f 73 65 56  69 65 77 2e 22 29 0d 11  |t CloseView.")..|
00004020  e4 5a 20 20 20 20 20 20  20 20 20 20 20 20 f2 53  |.Z            .S|
00004030  65 6e 64 28 22 43 6c 6f  73 65 56 69 65 77 20 69  |end("CloseView i|
00004040  73 20 61 20 6d 65 6d 62  65 72 20 6f 66 20 74 68  |s a member of th|
00004050  65 20 4f 6d 6e 69 44 65  73 6b 20 53 75 69 74 65  |e OmniDesk Suite|
00004060  20 6f 66 20 64 65 73 6b  74 6f 70 20 75 74 69 6c  | of desktop util|
00004070  69 74 69 65 73 2e 22 29  0d 11 ee 0d 20 20 c9 20  |ities.")....  . |
00004080  5a 6f 6f 6d 3a 0d 11 f8  14 20 20 20 c8 8e 20 42  |Zoom:....   .. B|
00004090  6c 6f 63 6b 21 33 36 20  ca 0d 12 02 45 20 20 20  |lock!36 ....E   |
000040a0  20 20 c9 20 30 2c 31 3a  f2 53 65 6e 64 28 22 45  |  . 0,1:.Send("E|
000040b0  6e 74 65 72 20 74 68 65  20 72 65 71 75 69 72 65  |nter the require|
000040c0  64 20 6d 61 67 6e 69 66  69 63 61 74 69 6f 6e 20  |d magnification |
000040d0  66 61 63 74 6f 72 20 68  65 72 65 2e 22 29 0d 12  |factor here.")..|
000040e0  0c 90 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |..              |
000040f0  f2 53 65 6e 64 28 22 54  68 65 20 55 50 20 61 6e  |.Send("The UP an|
00004100  64 20 44 4f 57 4e 20 61  72 72 6f 77 20 6b 65 79  |d DOWN arrow key|
00004110  73 20 61 6e 64 20 52 45  54 55 52 4e 20 6d 6f 76  |s and RETURN mov|
00004120  65 20 74 68 65 20 63 61  72 65 74 20 62 65 74 77  |e the caret betw|
00004130  65 65 6e 20 66 69 65 6c  64 73 3a 20 52 45 54 55  |een fields: RETU|
00004140  52 4e 20 63 6c 6f 73 65  73 20 74 68 65 20 77 69  |RN closes the wi|
00004150  6e 64 6f 77 20 61 66 74  65 72 20 74 68 65 20 73  |ndow after the s|
00004160  65 63 6f 6e 64 20 66 69  65 6c 64 2e 22 29 0d 12  |econd field.")..|
00004170  16 5d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.]              |
00004180  f2 53 65 6e 64 28 22 59  6f 75 20 6d 61 79 20 6e  |.Send("You may n|
00004190  6f 74 20 73 65 74 20 61  20 72 65 64 75 63 74 69  |ot set a reducti|
000041a0  6f 6e 20 66 61 63 74 6f  72 3a 20 6f 6e 6c 79 20  |on factor: only |
000041b0  6d 61 67 6e 69 66 69 63  61 74 69 6f 6e 20 69 73  |magnification is|
000041c0  20 61 6c 6c 6f 77 65 64  2e 22 29 0d 12 20 5a 20  | allowed.").. Z |
000041d0  20 20 20 20 c9 20 32 2c  33 2c 34 2c 35 3a f2 53  |    . 2,3,4,5:.S|
000041e0  65 6e 64 28 22 43 6c 69  63 6b 20 53 45 4c 45 43  |end("Click SELEC|
000041f0  54 20 6f 6e 20 74 68 65  20 61 72 72 6f 77 73 20  |T on the arrows |
00004200  74 6f 20 61 6c 74 65 72  20 74 68 65 20 6d 61 67  |to alter the mag|
00004210  6e 69 66 69 63 61 74 69  6f 6e 20 73 65 74 74 69  |nification setti|
00004220  6e 67 2e 22 29 0d 12 2a  56 20 20 20 20 20 20 20  |ng.")..*V       |
00004230  20 20 20 20 20 20 20 20  20 20 20 f2 53 65 6e 64  |           .Send|
00004240  28 22 41 44 4a 55 53 54  20 6d 61 6b 65 73 20 74  |("ADJUST makes t|
00004250  68 65 20 61 72 72 6f 77  73 20 77 6f 72 6b 20 69  |he arrows work i|
00004260  6e 20 74 68 65 20 6f 70  70 6f 73 69 74 65 20 64  |n the opposite d|
00004270  69 72 65 63 74 69 6f 6e  2e 22 29 0d 12 34 61 20  |irection.")..4a |
00004280  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004290  20 f2 53 65 6e 64 28 22  59 6f 75 20 6d 61 79 20  | .Send("You may |
000042a0  6e 6f 74 20 73 65 74 20  61 20 72 65 64 75 63 74  |not set a reduct|
000042b0  69 6f 6e 20 66 61 63 74  6f 72 3a 20 6f 6e 6c 79  |ion factor: only|
000042c0  20 6d 61 67 6e 69 66 69  63 61 74 69 6f 6e 20 69  | magnification i|
000042d0  73 20 61 6c 6c 6f 77 65  64 2e 22 29 0d 12 3e 5e  |s allowed.")..>^|
000042e0  20 20 20 20 20 c9 20 37  3a f2 53 65 6e 64 28 22  |     . 7:.Send("|
000042f0  43 6c 69 63 6b 20 53 45  4c 45 43 54 20 6f 72 20  |Click SELECT or |
00004300  41 44 4a 55 53 54 20 6f  72 20 70 72 65 73 73 20  |ADJUST or press |
00004310  46 31 20 74 6f 20 74 6f  67 67 6c 65 20 74 68 65  |F1 to toggle the|
00004320  20 63 72 6f 73 73 2d 68  61 69 72 73 20 6f 6e 20  | cross-hairs on |
00004330  61 6e 64 20 6f 66 66 2e  22 29 0d 12 48 66 20 20  |and off.")..Hf  |
00004340  20 20 20 c9 20 38 3a f2  53 65 6e 64 28 22 43 6c  |   . 8:.Send("Cl|
00004350  69 63 6b 20 53 45 4c 45  43 54 20 6f 72 20 41 44  |ick SELECT or AD|
00004360  4a 55 53 54 20 6f 72 20  70 72 65 73 73 20 46 32  |JUST or press F2|
00004370  20 74 6f 20 74 6f 67 67  6c 65 20 72 65 63 75 72  | to toggle recur|
00004380  73 69 76 65 20 6d 61 67  6e 69 66 69 63 61 74 69  |sive magnificati|
00004390  6f 6e 20 6f 6e 20 61 6e  64 20 6f 66 66 2e 22 29  |on on and off.")|
000043a0  0d 12 52 98 20 20 20 20  20 7f 20 f2 53 65 6e 64  |..R.     . .Send|
000043b0  28 22 54 68 69 73 20 77  69 6e 64 6f 77 20 6c 65  |("This window le|
000043c0  74 73 20 79 6f 75 20 73  65 74 20 74 68 65 20 6d  |ts you set the m|
000043d0  61 67 6e 69 66 69 63 61  74 69 6f 6e 20 66 61 63  |agnification fac|
000043e0  74 6f 72 20 61 6e 64 20  77 68 65 74 68 65 72 20  |tor and whether |
000043f0  74 68 65 20 6d 61 67 6e  69 66 69 65 72 20 77 69  |the magnifier wi|
00004400  6e 64 6f 77 20 64 69 73  70 6c 61 79 73 20 63 72  |ndow displays cr|
00004410  6f 73 73 2d 68 61 69 72  73 20 61 6e 64 20 72 65  |oss-hairs and re|
00004420  63 75 72 73 69 76 65 20  6d 61 67 6e 69 66 69 63  |cursive magnific|
00004430  61 74 69 6f 6e 2e 22 29  0d 12 5c 5e 20 20 20 20  |ation.")..\^    |
00004440  20 20 20 20 20 20 20 20  20 20 20 f2 53 65 6e 64  |           .Send|
00004450  28 22 59 6f 75 20 6d 61  79 20 6e 6f 74 20 73 65  |("You may not se|
00004460  74 20 61 20 72 65 64 75  63 74 69 6f 6e 20 66 61  |t a reduction fa|
00004470  63 74 6f 72 3a 20 6f 6e  6c 79 20 6d 61 67 6e 69  |ctor: only magni|
00004480  66 69 63 61 74 69 6f 6e  20 69 73 20 61 6c 6c 6f  |fication is allo|
00004490  77 65 64 2e 22 29 0d 12  66 08 20 20 20 cb 0d 12  |wed.")..f.   ...|
000044a0  70 0c 20 20 c9 20 4c 6f  63 3a 0d 12 7a 0d 20 20  |p.  . Loc:..z.  |
000044b0  20 c8 8e 20 b9 20 ca 0d  12 84 6d 20 20 20 20 20  | .. . ....m     |
000044c0  c9 20 28 28 42 6c 6f 63  6b 21 33 36 29 3c 36 29  |. ((Block!36)<6)|
000044d0  3a f2 53 65 6e 64 28 22  54 68 69 73 20 77 69 6e  |:.Send("This win|
000044e0  64 6f 77 20 6c 65 74 73  20 79 6f 75 20 73 6e 61  |dow lets you sna|
000044f0  70 20 74 68 65 20 6d 61  67 6e 69 66 69 65 72 20  |p the magnifier |
00004500  77 69 6e 64 6f 77 20 74  6f 20 61 6e 20 69 6e 76  |window to an inv|
00004510  69 73 62 6c 65 20 73 63  72 65 65 6e 20 67 72 69  |isble screen gri|
00004520  64 2e 22 29 0d 12 8e 9d  20 20 20 20 20 20 20 20  |d.")....        |
00004530  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004540  20 f2 53 65 6e 64 28 22  54 68 65 20 73 65 63 6f  | .Send("The seco|
00004550  6e 64 20 70 6f 73 69 74  69 6f 6e 20 75 70 20 70  |nd position up p|
00004560  75 74 73 20 74 68 65 20  77 69 6e 64 6f 77 20 6a  |uts the window j|
00004570  75 73 74 20 61 62 6f 76  65 20 74 68 65 20 69 63  |ust above the ic|
00004580  6f 6e 2d 62 61 72 2c 20  61 6e 64 20 69 73 20 74  |on-bar, and is t|
00004590  68 65 72 65 66 6f 72 65  20 6e 6f 74 20 65 76 65  |herefore not eve|
000045a0  6e 6c 79 20 73 70 61 63  65 64 20 77 69 74 68 20  |nly spaced with |
000045b0  74 68 65 20 6f 74 68 65  72 20 72 6f 77 73 2e 22  |the other rows."|
000045c0  29 0d 12 98 87 20 20 20  20 20 7f 20 f2 53 65 6e  |)....     . .Sen|
000045d0  64 28 22 43 6c 69 63 6b  20 53 45 4c 45 43 54 20  |d("Click SELECT |
000045e0  6f 6e 20 74 68 65 20 70  6f 73 69 74 69 6f 6e 20  |on the position |
000045f0  79 6f 75 20 77 61 6e 74  20 74 68 65 20 77 69 6e  |you want the win|
00004600  64 6f 77 20 74 6f 20 73  6e 61 70 20 74 6f 2c 20  |dow to snap to, |
00004610  6f 72 20 41 44 4a 55 53  54 20 6f 6e 20 74 68 65  |or ADJUST on the|
00004620  20 77 69 6e 64 6f 77 20  69 63 6f 6e 20 74 6f 20  | window icon to |
00004630  74 75 72 6e 20 74 68 65  20 73 6e 61 70 70 69 6e  |turn the snappin|
00004640  67 20 6f 66 66 2e 22 29  0d 12 a2 75 20 20 20 20  |g off.")...u    |
00004650  20 20 20 20 20 20 20 20  20 20 20 f2 53 65 6e 64  |           .Send|
00004660  28 22 49 66 20 73 6e 61  70 70 69 6e 67 20 69 73  |("If snapping is|
00004670  20 6f 6e 2c 20 74 68 65  20 77 69 6e 64 6f 77 20  | on, the window |
00004680  77 69 6c 6c 20 6f 70 65  6e 20 61 74 20 74 68 65  |will open at the|
00004690  20 61 70 70 72 6f 70 72  69 61 74 65 20 70 6f 73  | appropriate pos|
000046a0  69 74 69 6f 6e 20 77 68  65 6e 20 79 6f 75 20 63  |ition when you c|
000046b0  68 61 6e 67 65 20 6d 6f  64 65 2e 22 29 0d 12 ac  |hange mode.")...|
000046c0  08 20 20 20 cb 0d 12 b6  05 7f 0d 12 c0 13 20 20  |.   ..........  |
000046d0  e7 20 77 69 6d 70 3e 3d  32 31 37 20 8c 0d 12 ca  |. wimp>=217 ....|
000046e0  31 20 20 20 20 4d 65 6e  75 48 65 6c 70 21 30 3d  |1    MenuHelp!0=|
000046f0  2d 31 3a 4d 65 6e 75 48  65 6c 70 21 34 3d 2d 31  |-1:MenuHelp!4=-1|
00004700  3a 4d 65 6e 75 48 65 6c  70 21 38 3d 2d 31 0d 12  |:MenuHelp!8=-1..|
00004710  d4 3b 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 47  |.;    .. "Wimp_G|
00004720  65 74 4d 65 6e 75 53 74  61 74 65 22 2c 31 2c 4d  |etMenuState",1,M|
00004730  65 6e 75 48 65 6c 70 2c  42 6c 6f 63 6b 21 33 32  |enuHelp,Block!32|
00004740  2c 42 6c 6f 63 6b 21 33  36 0d 12 de 0f 20 20 20  |,Block!36....   |
00004750  20 c8 8e 20 4d 25 20 ca  0d 12 e8 13 20 20 20 20  | .. M% .....    |
00004760  20 20 c9 20 49 42 4d 65  6e 75 3a 0d 12 f2 1d 20  |  . IBMenu:.... |
00004770  20 20 20 20 20 20 20 e7  20 4d 65 6e 75 48 65 6c  |       . MenuHel|
00004780  70 21 34 3d 2d 31 20 8c  0d 12 fc 1d 20 20 20 20  |p!4=-1 .....    |
00004790  20 20 20 20 20 20 c8 8e  20 4d 65 6e 75 48 65 6c  |      .. MenuHel|
000047a0  70 21 30 20 ca 0d 13 06  57 20 20 20 20 20 20 20  |p!0 ....W       |
000047b0  20 20 20 20 20 c9 20 30  3a f2 53 65 6e 64 28 22  |     . 0:.Send("|
000047c0  4d 6f 76 65 20 74 68 65  20 70 6f 69 6e 74 65 72  |Move the pointer|
000047d0  20 72 69 67 68 74 20 74  6f 20 73 65 65 20 69 6e  | right to see in|
000047e0  66 6f 72 6d 61 74 69 6f  6e 20 61 62 6f 75 74 20  |formation about |
000047f0  43 6c 6f 73 65 56 69 65  77 2e 22 29 0d 13 10 3c  |CloseView.")...<|
00004800  20 20 20 20 20 20 20 20  20 20 20 20 c9 20 31 3a  |            . 1:|
00004810  f2 53 65 6e 64 28 22 43  6c 69 63 6b 20 53 45 4c  |.Send("Click SEL|
00004820  45 43 54 20 74 6f 20 71  75 69 74 20 43 6c 6f 73  |ECT to quit Clos|
00004830  65 56 69 65 77 2e 22 29  0d 13 1a 3f 20 20 20 20  |eView.")...?    |
00004840  20 20 20 20 20 20 20 20  7f 20 f2 53 65 6e 64 28  |        . .Send(|
00004850  22 54 68 69 73 20 69 73  20 74 68 65 20 43 6c 6f  |"This is the Clo|
00004860  73 65 56 69 65 77 20 69  63 6f 6e 2d 62 61 72 20  |seView icon-bar |
00004870  6d 65 6e 75 2e 22 29 0d  13 24 0f 20 20 20 20 20  |menu.")..$.     |
00004880  20 20 20 20 20 cb 0d 13  2e 0d 20 20 20 20 20 20  |     .....      |
00004890  20 20 cd 0d 13 38 15 20  20 20 20 20 20 c9 20 4d  |  ...8.      . M|
000048a0  61 69 6e 4d 65 6e 75 3a  0d 13 42 57 20 20 20 20  |ainMenu:..BW    |
000048b0  20 20 20 20 44 69 72 65  63 74 69 6f 6e 24 3d 22  |    Direction$="|
000048c0  72 69 67 68 74 22 3a e7  20 77 69 6d 70 3e 3d 33  |right":. wimp>=3|
000048d0  31 30 20 80 20 bd 28 4d  61 69 6e 4d 65 6e 75 54  |10 . .(MainMenuT|
000048e0  69 74 6c 65 3f 30 29 3d  22 5c 22 20 8c 20 44 69  |itle?0)="\" . Di|
000048f0  72 65 63 74 69 6f 6e 24  3d 22 6c 65 66 74 22 0d  |rection$="left".|
00004900  13 4c 1b 20 20 20 20 20  20 20 20 c8 8e 20 4d 65  |.L.        .. Me|
00004910  6e 75 48 65 6c 70 21 30  20 ca 0d 13 56 5e 20 20  |nuHelp!0 ...V^  |
00004920  20 20 20 20 20 20 20 20  c9 20 30 3a f2 53 65 6e  |        . 0:.Sen|
00004930  64 28 22 4d 6f 76 65 20  74 68 65 20 70 6f 69 6e  |d("Move the poin|
00004940  74 65 72 20 22 2b 44 69  72 65 63 74 69 6f 6e 24  |ter "+Direction$|
00004950  2b 22 20 74 6f 20 73 65  65 20 69 6e 66 6f 72 6d  |+" to see inform|
00004960  61 74 69 6f 6e 20 61 62  6f 75 74 20 43 6c 6f 73  |ation about Clos|
00004970  65 56 69 65 77 2e 22 29  0d 13 60 9e 20 20 20 20  |eView.")..`.    |
00004980  20 20 20 20 20 20 c9 20  31 3a f2 53 65 6e 64 28  |      . 1:.Send(|
00004990  22 4d 6f 76 65 20 74 68  65 20 70 6f 69 6e 74 65  |"Move the pointe|
000049a0  72 20 22 2b 44 69 72 65  63 74 69 6f 6e 24 2b 22  |r "+Direction$+"|
000049b0  20 74 6f 20 73 65 74 20  74 68 65 20 6d 61 67 6e  | to set the magn|
000049c0  69 66 69 63 61 74 69 6f  6e 20 66 61 63 74 6f 72  |ification factor|
000049d0  20 61 6e 64 20 74 6f 20  74 75 72 6e 20 74 68 65  | and to turn the|
000049e0  20 63 72 6f 73 73 2d 68  61 69 72 73 20 61 6e 64  | cross-hairs and|
000049f0  20 72 65 63 75 72 73 69  76 65 20 6d 61 67 6e 69  | recursive magni|
00004a00  66 69 63 61 74 69 6f 6e  20 6f 6e 20 61 6e 64 20  |fication on and |
00004a10  6f 66 66 2e 22 29 0d 13  6a 75 20 20 20 20 20 20  |off.")..ju      |
00004a20  20 20 20 20 c9 20 32 3a  f2 53 65 6e 64 28 22 4d  |    . 2:.Send("M|
00004a30  6f 76 65 20 74 68 65 20  70 6f 69 6e 74 65 72 20  |ove the pointer |
00004a40  22 2b 44 69 72 65 63 74  69 6f 6e 24 2b 22 20 74  |"+Direction$+" t|
00004a50  6f 20 73 65 74 20 74 68  65 20 70 6f 73 69 74 69  |o set the positi|
00004a60  6f 6e 20 6f 66 20 74 68  65 20 6d 61 67 6e 69 66  |on of the magnif|
00004a70  69 65 72 20 77 69 6e 64  6f 77 20 6f 6e 20 74 68  |ier window on th|
00004a80  65 20 73 63 72 65 65 6e  2e 22 29 0d 13 74 8d 20  |e screen.")..t. |
00004a90  20 20 20 20 20 20 20 20  20 c9 20 33 3a f2 53 65  |         . 3:.Se|
00004aa0  6e 64 28 22 43 6c 69 63  6b 20 53 45 4c 45 43 54  |nd("Click SELECT|
00004ab0  20 6f 72 20 41 44 4a 55  53 54 20 74 6f 20 73 61  | or ADJUST to sa|
00004ac0  76 65 20 74 68 65 20 6d  61 67 6e 69 66 69 63 61  |ve the magnifica|
00004ad0  74 69 6f 6e 20 66 61 63  74 6f 72 2c 20 77 69 6e  |tion factor, win|
00004ae0  64 6f 77 20 70 6f 73 69  74 69 6f 6e 20 61 6e 64  |dow position and|
00004af0  20 74 68 65 20 63 72 6f  73 73 2d 68 61 69 72 20  | the cross-hair |
00004b00  61 6e 64 20 72 65 63 75  72 73 69 6f 6e 20 6f 70  |and recursion op|
00004b10  74 69 6f 6e 73 2e 22 29  0d 13 7e 39 20 20 20 20  |tions.")..~9    |
00004b20  20 20 20 20 20 20 7f 20  f2 53 65 6e 64 28 22 54  |      . .Send("T|
00004b30  68 69 73 20 69 73 20 74  68 65 20 43 6c 6f 73 65  |his is the Close|
00004b40  56 69 65 77 20 6d 61 69  6e 20 6d 65 6e 75 2e 22  |View main menu."|
00004b50  29 0d 13 88 0d 20 20 20  20 20 20 20 20 cb 0d 13  |)....        ...|
00004b60  92 09 20 20 20 20 cb 0d  13 9c 07 20 20 cd 0d 13  |..    .....  ...|
00004b70  a6 05 cb 0d 13 b0 07 20  20 3a 0d 13 ba 0f 3f 48  |.......  :....?H|
00004b80  65 6c 70 49 6e 66 6f 3d  30 0d 13 c4 24 42 6c 6f  |elpInfo=0...$Blo|
00004b90  63 6b 21 30 3d 28 48 65  6c 70 49 6e 66 6f 2b 34  |ck!0=(HelpInfo+4|
00004ba0  2d 42 6c 6f 63 6b 29 20  80 20 ac 20 33 0d 13 ce  |-Block) . . 3...|
00004bb0  2a c8 99 20 22 57 69 6d  70 5f 53 65 6e 64 4d 65  |*.. "Wimp_SendMe|
00004bc0  73 73 61 67 65 22 2c 31  37 2c 42 6c 6f 63 6b 2c  |ssage",17,Block,|
00004bd0  42 6c 6f 63 6b 21 34 0d  13 d8 05 e1 0d 13 e2 05  |Block!4.........|
00004be0  3a 0d 13 ec 1a dd 20 a4  4f 6d 6e 69 48 65 6c 70  |:..... .OmniHelp|
00004bf0  4d 65 73 73 61 67 65 28  41 24 29 0d 13 f6 39 e7  |Message(A$)...9.|
00004c00  20 41 24 3d 22 43 4c 49  43 4b 22 20 8c 20 3d c0  | A$="CLICK" . =.|
00004c10  22 6f 70 65 6e 20 74 68  65 20 6d 61 67 6e 69 66  |"open the magnif|
00004c20  69 65 72 20 77 69 6e 64  6f 77 2e 22 2c 37 36 29  |ier window.",76)|
00004c30  2b bd 31 33 0d 14 00 1e  e7 20 41 24 3d 22 44 52  |+.13..... A$="DR|
00004c40  41 47 22 20 8c 20 3d c0  22 22 2c 37 36 29 2b bd  |AG" . =."",76)+.|
00004c50  31 33 0d 14 0a 07 3d 22  22 0d 14 14 05 3a 0d 14  |13....=""....:..|
00004c60  1e 12 dd 20 f2 53 65 6e  64 28 54 65 78 74 24 29  |... .Send(Text$)|
00004c70  0d 14 28 18 24 48 65 6c  70 49 6e 66 6f 3d 54 65  |..(.$HelpInfo=Te|
00004c80  78 74 24 2b 22 7c 4d 22  0d 14 32 18 48 65 6c 70  |xt$+"|M"..2.Help|
00004c90  49 6e 66 6f 2b 3d a9 28  54 65 78 74 24 29 2b 32  |Info+=.(Text$)+2|
00004ca0  0d 14 3c 05 e1 0d 14 46  05 3a 0d 14 50 16 dd 20  |..<....F.:..P.. |
00004cb0  f2 4f 6d 6e 69 44 65 73  6b 43 61 6c 6c 69 6e 67  |.OmniDeskCalling|
00004cc0  0d 14 5a 14 e7 20 4f 6d  6e 69 44 65 73 6b 3d 30  |..Z.. OmniDesk=0|
00004cd0  20 8c 20 e1 0d 14 64 49  f4 20 54 68 69 73 20 66  | . ...dI. This f|
00004ce0  69 72 73 74 20 6c 69 6e  65 20 69 73 20 66 6f 72  |irst line is for|
00004cf0  20 69 66 20 61 20 62 72  6f 61 64 63 61 73 74 20  | if a broadcast |
00004d00  6d 65 73 73 61 67 65 20  69 73 20 72 65 63 65 69  |message is recei|
00004d10  76 65 64 20 77 68 69 63  68 20 77 61 73 0d 14 6e  |ved which was..n|
00004d20  41 f4 20 69 6e 74 65 6e  64 65 64 20 66 6f 72 20  |A. intended for |
00004d30  61 20 74 72 61 6e 73 69  65 6e 74 20 63 6f 70 79  |a transient copy|
00004d40  20 6f 66 20 74 68 65 20  75 74 69 6c 69 74 79 2e  | of the utility.|
00004d50  20 41 20 73 74 61 6e 64  2d 61 6c 6f 6e 65 0d 14  | A stand-alone..|
00004d60  78 3f f4 20 69 6e 73 74  61 6e 74 69 61 74 69 6f  |x?. instantiatio|
00004d70  6e 20 6f 66 20 74 68 65  20 75 74 69 6c 69 74 79  |n of the utility|
00004d80  20 73 68 6f 75 6c 64 20  69 67 6e 6f 72 65 20 73  | should ignore s|
00004d90  75 63 68 20 6d 65 73 73  61 67 65 73 2e 0d 14 82  |uch messages....|
00004da0  11 c8 8e 20 42 6c 6f 63  6b 21 32 30 20 ca 0d 14  |... Block!20 ...|
00004db0  8c 36 20 20 c9 20 34 3a  e7 20 ac 20 a4 4f 70 65  |.6  . 4:. . .Ope|
00004dc0  6e 53 74 61 74 65 28 4d  61 67 6e 69 66 69 65 72  |nState(Magnifier|
00004dd0  29 20 8c 20 f2 43 72 65  61 74 65 4d 61 67 53 70  |) . .CreateMagSp|
00004de0  72 69 74 65 0d 14 96 33  20 20 20 20 20 20 20 20  |rite...3        |
00004df0  20 f2 4f 70 65 6e 28 4d  61 67 6e 69 66 69 65 72  | .Open(Magnifier|
00004e00  2c b9 2c 58 50 6f 73 69  74 69 6f 6e 2c 59 50 6f  |,.,XPosition,YPo|
00004e10  73 69 74 69 6f 6e 29 0d  14 a0 05 cb 0d 14 aa 05  |sition).........|
00004e20  e1 0d 14 b4 05 3a 0d 14  be 11 dd 20 f2 4d 6f 64  |.....:..... .Mod|
00004e30  65 43 68 61 6e 67 65 0d  14 c8 0e 4d 61 67 45 72  |eChange....MagEr|
00004e40  72 6f 72 3d b9 0d 14 d2  48 f4 20 54 68 69 73 20  |ror=....H. This |
00004e50  63 61 75 73 65 73 20 74  68 65 20 77 69 6e 64 6f  |causes the windo|
00004e60  77 20 72 65 64 72 61 77  20 72 6f 75 74 69 6e 65  |w redraw routine|
00004e70  20 74 6f 20 63 61 6c 6c  20 50 52 4f 43 43 72 65  | to call PROCCre|
00004e80  61 74 65 4d 61 67 53 70  72 69 74 65 2e 0d 14 dc  |ateMagSprite....|
00004e90  46 f4 20 49 74 27 73 20  6e 65 65 64 65 64 20 73  |F. It's needed s|
00004ea0  6f 20 74 68 61 74 20 61  20 6e 65 77 20 73 70 72  |o that a new spr|
00004eb0  69 74 65 20 69 73 6e 27  74 20 63 72 65 61 74 65  |ite isn't create|
00004ec0  64 20 6f 6e 20 61 20 6d  6f 64 65 20 63 68 61 6e  |d on a mode chan|
00004ed0  67 65 3b 0d 14 e6 46 f4  20 72 61 74 68 65 72 2c  |ge;...F. rather,|
00004ee0  20 69 74 27 73 20 63 72  65 61 74 65 64 20 77 68  | it's created wh|
00004ef0  65 6e 20 6e 65 65 64 65  64 20 28 69 65 20 77 68  |en needed (ie wh|
00004f00  65 6e 20 74 68 65 20 77  69 6e 64 6f 77 20 69 73  |en the window is|
00004f10  20 6f 70 65 6e 65 64 29  2e 0d 14 f0 12 44 6f 4d  | opened).....DoM|
00004f20  6f 64 65 43 68 61 6e 67  65 3d b9 0d 14 fa 3e e7  |odeChange=....>.|
00004f30  20 4f 6d 6e 69 44 65 73  6b 3d 30 20 8c 20 f2 55  | OmniDesk=0 . .U|
00004f40  70 64 61 74 65 49 63 6f  6e 46 6f 72 4d 6f 64 65  |pdateIconForMode|
00004f50  28 22 21 43 6c 6f 73 65  56 69 65 77 22 2c 2d 32  |("!CloseView",-2|
00004f60  2c 49 63 6f 6e 42 61 72  29 0d 15 04 05 e1 0d 15  |,IconBar).......|
00004f70  0e 05 3a 0d 15 18 4f f4  20 2d 2d 2d 2d 2d 2d 2d  |..:...O. -------|
00004f80  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00004fc0  2d 2d 0d 15 22 38 f4 20  47 65 6e 65 72 61 6c 20  |--.."8. General |
00004fd0  6e 6f 6e 2d 73 70 65 63  69 66 69 63 20 75 73 65  |non-specific use|
00004fe0  66 75 6c 20 72 6f 75 74  69 6e 65 73 20 28 6d 6f  |ful routines (mo|
00004ff0  73 74 6c 79 20 77 69 6d  70 29 0d 15 2c 4f f4 20  |stly wimp)..,O. |
00005000  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00005040  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 15 36 05 3a 0d 15  |---------..6.:..|
00005050  40 20 dd 20 f2 55 70 64  61 74 65 49 63 6f 6e 28  |@ . .UpdateIcon(|
00005060  57 6e 64 77 2c 49 63 6e  2c 54 78 74 24 29 0d 15  |Wndw,Icn,Txt$)..|
00005070  4a 3a 42 6c 6f 63 6b 21  30 3d 57 6e 64 77 3a 42  |J:Block!0=Wndw:B|
00005080  6c 6f 63 6b 21 34 3d 49  63 6e 3a c8 99 20 22 57  |lock!4=Icn:.. "W|
00005090  69 6d 70 5f 47 65 74 49  63 6f 6e 53 74 61 74 65  |imp_GetIconState|
000050a0  22 2c 2c 42 6c 6f 63 6b  0d 15 54 1c e7 20 a9 28  |",,Block..T.. .(|
000050b0  54 78 74 24 29 3e 28 42  6c 6f 63 6b 21 33 36 29  |Txt$)>(Block!36)|
000050c0  2d 31 20 8c 0d 15 5e 26  20 20 e7 20 28 28 42 6c  |-1 ...^&  . ((Bl|
000050d0  6f 63 6b 21 32 34 29 20  80 20 28 31 3c 3c 39 29  |ock!24) . (1<<9)|
000050e0  29 3d 28 31 3c 3c 39 29  20 8c 0d 15 68 19 20 20  |)=(1<<9) ...h.  |
000050f0  20 20 f4 20 52 69 67 68  74 2d 6a 75 73 74 69 66  |  . Right-justif|
00005100  69 65 64 0d 15 72 24 20  20 20 20 54 78 74 24 3d  |ied..r$    Txt$=|
00005110  22 88 22 2b c2 54 78 74  24 2c 28 42 6c 6f 63 6b  |"."+.Txt$,(Block|
00005120  21 33 36 29 2d 32 29 0d  15 7c 07 20 20 cc 0d 15  |!36)-2)..|.  ...|
00005130  86 23 20 20 20 20 f4 20  4c 65 66 74 2d 6a 75 73  |.#    . Left-jus|
00005140  74 69 66 69 65 64 20 6f  72 20 63 65 6e 74 72 65  |tified or centre|
00005150  64 0d 15 90 2b 20 20 20  20 54 78 74 24 3d c0 54  |d...+    Txt$=.T|
00005160  78 74 24 2c 28 42 6c 6f  63 6b 21 33 36 29 2d 31  |xt$,(Block!36)-1|
00005170  29 3a c2 54 78 74 24 29  3d 22 89 22 0d 15 9a 07  |):.Txt$)="."....|
00005180  20 20 cd 0d 15 a4 05 cd  0d 15 ae 46 f4 20 5e 20  |  .........F. ^ |
00005190  45 6e 73 75 72 65 73 20  74 68 65 20 74 65 78 74  |Ensures the text|
000051a0  20 63 61 6e 27 74 20 6f  76 65 72 66 6c 6f 77 20  | can't overflow |
000051b0  74 68 65 20 6d 61 78 69  6d 75 6d 20 73 70 61 63  |the maximum spac|
000051c0  65 20 69 6e 20 74 68 65  20 69 63 6f 6e 2e 0d 15  |e in the icon...|
000051d0  b8 19 e7 20 24 28 42 6c  6f 63 6b 21 32 38 29 3c  |... $(Block!28)<|
000051e0  3e 54 78 74 24 20 8c 0d  15 c2 2b 20 20 24 28 42  |>Txt$ ....+  $(B|
000051f0  6c 6f 63 6b 21 32 38 29  3d 54 78 74 24 3a 42 6c  |lock!28)=Txt$:Bl|
00005200  6f 63 6b 21 38 3d 30 3a  42 6c 6f 63 6b 21 31 32  |ock!8=0:Block!12|
00005210  3d 30 0d 15 cc 23 20 20  c8 99 20 22 57 69 6d 70  |=0...#  .. "Wimp|
00005220  5f 53 65 74 49 63 6f 6e  53 74 61 74 65 22 2c 2c  |_SetIconState",,|
00005230  42 6c 6f 63 6b 0d 15 d6  05 cd 0d 15 e0 25 c8 99  |Block........%..|
00005240  20 22 57 69 6d 70 5f 47  65 74 43 61 72 65 74 50  | "Wimp_GetCaretP|
00005250  6f 73 69 74 69 6f 6e 22  2c 2c 42 6c 6f 63 6b 0d  |osition",,Block.|
00005260  15 ea 22 e7 20 42 6c 6f  63 6b 21 30 3d 57 6e 64  |..". Block!0=Wnd|
00005270  77 20 80 20 42 6c 6f 63  6b 21 34 3d 49 63 6e 20  |w . Block!4=Icn |
00005280  8c 0d 15 f4 3c 20 20 f4  20 49 66 20 74 68 69 73  |....<  . If this|
00005290  20 69 63 6f 6e 20 6f 77  6e 73 20 74 68 65 20 63  | icon owns the c|
000052a0  61 72 65 74 2c 20 74 68  65 6e 20 70 75 74 20 69  |aret, then put i|
000052b0  74 20 61 74 20 74 68 65  20 65 6e 64 2e 0d 15 fe  |t at the end....|
000052c0  38 20 20 c8 99 20 22 57  69 6d 70 5f 53 65 74 43  |8  .. "Wimp_SetC|
000052d0  61 72 65 74 50 6f 73 69  74 69 6f 6e 22 2c 57 6e  |aretPosition",Wn|
000052e0  64 77 2c 49 63 6e 2c 30  2c 30 2c 2d 31 2c a9 28  |dw,Icn,0,0,-1,.(|
000052f0  54 78 74 24 29 0d 16 08  05 cd 0d 16 12 05 e1 0d  |Txt$)...........|
00005300  16 1c 05 3a 0d 16 26 2b  dd 20 f2 55 70 64 61 74  |...:..&+. .Updat|
00005310  65 49 63 6f 6e 43 6f 6c  6f 75 72 28 57 6e 64 77  |eIconColour(Wndw|
00005320  2c 49 63 6e 2c 46 43 6f  6c 2c 42 43 6f 6c 29 0d  |,Icn,FCol,BCol).|
00005330  16 30 1e f4 20 43 68 61  6e 67 65 20 61 6e 20 69  |.0.. Change an i|
00005340  63 6f 6e 27 73 20 63 6f  6c 6f 75 72 73 0d 16 3a  |con's colours..:|
00005350  3a 42 6c 6f 63 6b 21 30  3d 57 6e 64 77 3a 42 6c  |:Block!0=Wndw:Bl|
00005360  6f 63 6b 21 34 3d 49 63  6e 3a c8 99 20 22 57 69  |ock!4=Icn:.. "Wi|
00005370  6d 70 5f 47 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_GetIconState"|
00005380  2c 2c 42 6c 6f 63 6b 0d  16 44 3b e7 20 28 28 28  |,,Block..D;. (((|
00005390  42 6c 6f 63 6b 3f 32 37  29 3e 3e 34 29 3d 42 43  |Block?27)>>4)=BC|
000053a0  6f 6c 29 20 80 20 28 28  28 42 6c 6f 63 6b 3f 32  |ol) . (((Block?2|
000053b0  37 29 20 83 20 31 36 29  3d 46 43 6f 6c 29 20 8c  |7) . 16)=FCol) .|
000053c0  20 e1 0d 16 4e 27 20 20  f4 20 5e 20 53 61 6d 65  | ...N'  . ^ Same|
000053d0  20 63 6f 6c 6f 75 72 2c  20 73 6f 20 64 6f 6e 27  | colour, so don'|
000053e0  74 20 63 68 61 6e 67 65  2e 0d 16 58 3a 42 6c 6f  |t change...X:Blo|
000053f0  63 6b 21 31 32 3d 28 25  31 31 31 31 31 31 31 31  |ck!12=(%11111111|
00005400  3c 3c 32 34 29 3a 42 6c  6f 63 6b 21 38 3d 28 42  |<<24):Block!8=(B|
00005410  43 6f 6c 3c 3c 32 38 29  2b 28 46 43 6f 6c 3c 3c  |Col<<28)+(FCol<<|
00005420  32 34 29 0d 16 62 21 c8  99 20 22 57 69 6d 70 5f  |24)..b!.. "Wimp_|
00005430  53 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 42  |SetIconState",,B|
00005440  6c 6f 63 6b 0d 16 6c 05  e1 0d 16 76 05 3a 0d 16  |lock..l....v.:..|
00005450  80 29 dd 20 f2 55 70 64  61 74 65 53 65 6c 65 63  |.). .UpdateSelec|
00005460  74 65 64 46 6c 61 67 28  57 6e 64 77 2c 49 63 6e  |tedFlag(Wndw,Icn|
00005470  2c 53 74 61 74 65 29 0d  16 8a 31 f4 20 55 73 65  |,State)...1. Use|
00005480  20 53 74 61 74 65 3d 54  52 55 45 20 74 6f 20 6d  | State=TRUE to m|
00005490  61 6b 65 20 69 63 6f 6e  20 62 65 63 6f 6d 65 20  |ake icon become |
000054a0  73 65 6c 65 63 74 65 64  0d 16 94 3a 42 6c 6f 63  |selected...:Bloc|
000054b0  6b 21 30 3d 57 6e 64 77  3a 42 6c 6f 63 6b 21 34  |k!0=Wndw:Block!4|
000054c0  3d 49 63 6e 3a c8 99 20  22 57 69 6d 70 5f 47 65  |=Icn:.. "Wimp_Ge|
000054d0  74 49 63 6f 6e 53 74 61  74 65 22 2c 2c 42 6c 6f  |tIconState",,Blo|
000054e0  63 6b 0d 16 9e 2f e7 20  28 28 42 6c 6f 63 6b 21  |ck.../. ((Block!|
000054f0  32 34 29 20 80 20 28 31  3c 3c 32 31 29 29 3d 28  |24) . (1<<21))=(|
00005500  28 2d 53 74 61 74 65 29  3c 3c 32 31 29 20 8c 20  |(-State)<<21) . |
00005510  e1 0d 16 a8 40 42 6c 6f  63 6b 21 31 32 3d 28 31  |....@Block!12=(1|
00005520  3c 3c 32 31 29 3a e7 20  53 74 61 74 65 20 8c 20  |<<21):. State . |
00005530  42 6c 6f 63 6b 21 38 3d  28 31 3c 3c 32 31 29 20  |Block!8=(1<<21) |
00005540  8b 20 42 6c 6f 63 6b 21  38 3d 28 30 3c 3c 32 31  |. Block!8=(0<<21|
00005550  29 0d 16 b2 21 c8 99 20  22 57 69 6d 70 5f 53 65  |)...!.. "Wimp_Se|
00005560  74 49 63 6f 6e 53 74 61  74 65 22 2c 2c 42 6c 6f  |tIconState",,Blo|
00005570  63 6b 0d 16 bc 05 e1 0d  16 c6 05 3a 0d 16 d0 27  |ck.........:...'|
00005580  dd 20 f2 55 70 64 61 74  65 53 68 61 64 65 64 46  |. .UpdateShadedF|
00005590  6c 61 67 28 57 6e 64 77  2c 49 63 6e 2c 53 74 61  |lag(Wndw,Icn,Sta|
000055a0  74 65 29 0d 16 da 2f f4  20 55 73 65 20 53 74 61  |te).../. Use Sta|
000055b0  74 65 3d 54 52 55 45 20  74 6f 20 6d 61 6b 65 20  |te=TRUE to make |
000055c0  69 63 6f 6e 20 62 65 63  6f 6d 65 20 73 68 61 64  |icon become shad|
000055d0  65 64 0d 16 e4 3a 42 6c  6f 63 6b 21 30 3d 57 6e  |ed...:Block!0=Wn|
000055e0  64 77 3a 42 6c 6f 63 6b  21 34 3d 49 63 6e 3a c8  |dw:Block!4=Icn:.|
000055f0  99 20 22 57 69 6d 70 5f  47 65 74 49 63 6f 6e 53  |. "Wimp_GetIconS|
00005600  74 61 74 65 22 2c 2c 42  6c 6f 63 6b 0d 16 ee 2f  |tate",,Block.../|
00005610  e7 20 28 28 42 6c 6f 63  6b 21 32 34 29 20 80 20  |. ((Block!24) . |
00005620  28 31 3c 3c 32 32 29 29  3d 28 28 2d 53 74 61 74  |(1<<22))=((-Stat|
00005630  65 29 3c 3c 32 32 29 20  8c 20 e1 0d 16 f8 40 42  |e)<<22) . ....@B|
00005640  6c 6f 63 6b 21 31 32 3d  28 31 3c 3c 32 32 29 3a  |lock!12=(1<<22):|
00005650  e7 20 53 74 61 74 65 20  8c 20 42 6c 6f 63 6b 21  |. State . Block!|
00005660  38 3d 28 31 3c 3c 32 32  29 20 8b 20 42 6c 6f 63  |8=(1<<22) . Bloc|
00005670  6b 21 38 3d 28 30 3c 3c  32 32 29 0d 17 02 21 c8  |k!8=(0<<22)...!.|
00005680  99 20 22 57 69 6d 70 5f  53 65 74 49 63 6f 6e 53  |. "Wimp_SetIconS|
00005690  74 61 74 65 22 2c 2c 42  6c 6f 63 6b 0d 17 0c 05  |tate",,Block....|
000056a0  e1 0d 17 16 05 3a 0d 17  20 1e dd 20 a4 53 65 6c  |.....:.. .. .Sel|
000056b0  65 63 74 65 64 53 74 61  74 65 28 57 6e 64 77 2c  |ectedState(Wndw,|
000056c0  49 63 6e 29 0d 17 2a 3a  42 6c 6f 63 6b 21 30 3d  |Icn)..*:Block!0=|
000056d0  57 6e 64 77 3a 42 6c 6f  63 6b 21 34 3d 49 63 6e  |Wndw:Block!4=Icn|
000056e0  3a c8 99 20 22 57 69 6d  70 5f 47 65 74 49 63 6f  |:.. "Wimp_GetIco|
000056f0  6e 53 74 61 74 65 22 2c  2c 42 6c 6f 63 6b 0d 17  |nState",,Block..|
00005700  34 29 e7 20 28 28 42 6c  6f 63 6b 21 32 34 29 20  |4). ((Block!24) |
00005710  80 20 28 31 3c 3c 32 31  29 29 3d 28 31 3c 3c 32  |. (1<<21))=(1<<2|
00005720  31 29 20 8c 20 3d b9 0d  17 3e 06 3d a3 0d 17 48  |1) . =...>.=...H|
00005730  05 3a 0d 17 52 1c dd 20  a4 53 68 61 64 65 64 53  |.:..R.. .ShadedS|
00005740  74 61 74 65 28 57 6e 64  77 2c 49 63 6e 29 0d 17  |tate(Wndw,Icn)..|
00005750  5c 3a 42 6c 6f 63 6b 21  30 3d 57 6e 64 77 3a 42  |\:Block!0=Wndw:B|
00005760  6c 6f 63 6b 21 34 3d 49  63 6e 3a c8 99 20 22 57  |lock!4=Icn:.. "W|
00005770  69 6d 70 5f 47 65 74 49  63 6f 6e 53 74 61 74 65  |imp_GetIconState|
00005780  22 2c 2c 42 6c 6f 63 6b  0d 17 66 29 e7 20 28 28  |",,Block..f). ((|
00005790  42 6c 6f 63 6b 21 32 34  29 20 80 20 28 31 3c 3c  |Block!24) . (1<<|
000057a0  32 32 29 29 3d 28 31 3c  3c 32 32 29 20 8c 20 3d  |22))=(1<<22) . =|
000057b0  b9 0d 17 70 06 3d a3 0d  17 7a 05 3a 0d 17 84 16  |...p.=...z.:....|
000057c0  dd 20 a4 4f 70 65 6e 53  74 61 74 65 28 57 6e 64  |. .OpenState(Wnd|
000057d0  77 29 0d 17 8e 35 f4 20  52 65 74 75 72 6e 73 20  |w)...5. Returns |
000057e0  54 52 55 45 20 69 66 20  77 69 6e 64 6f 77 20 69  |TRUE if window i|
000057f0  73 20 6f 70 65 6e 3b 20  66 61 6c 73 65 20 6f 74  |s open; false ot|
00005800  68 65 72 77 69 73 65 0d  17 98 30 42 6c 6f 63 6b  |herwise...0Block|
00005810  21 30 3d 57 6e 64 77 3a  c8 99 20 22 57 69 6d 70  |!0=Wndw:.. "Wimp|
00005820  5f 47 65 74 57 69 6e 64  6f 77 53 74 61 74 65 22  |_GetWindowState"|
00005830  2c 2c 42 6c 6f 63 6b 0d  17 a2 29 e7 20 28 28 42  |,,Block...). ((B|
00005840  6c 6f 63 6b 21 33 32 29  20 80 20 28 31 3c 3c 31  |lock!32) . (1<<1|
00005850  36 29 29 3d 28 31 3c 3c  31 36 29 20 8c 20 3d b9  |6))=(1<<16) . =.|
00005860  0d 17 ac 06 3d a3 0d 17  b6 05 3a 0d 17 c0 21 dd  |....=.....:...!.|
00005870  20 f2 53 68 61 64 65 4d  65 6e 75 28 4d 65 6e 75  | .ShadeMenu(Menu|
00005880  2c 49 74 65 6d 2c 53 74  61 74 65 29 0d 17 ca 50  |,Item,State)...P|
00005890  21 28 4d 65 6e 75 2b 32  38 2b 28 32 34 2a 49 74  |!(Menu+28+(24*It|
000058a0  65 6d 29 2b 38 29 3d 28  21 28 4d 65 6e 75 2b 32  |em)+8)=(!(Menu+2|
000058b0  38 2b 28 32 34 2a 49 74  65 6d 29 2b 38 29 20 80  |8+(24*Item)+8) .|
000058c0  20 ac 20 28 31 3c 3c 32  32 29 29 20 82 20 28 28  | . (1<<22)) . ((|
000058d0  2d 53 74 61 74 65 29 3c  3c 32 32 29 0d 17 d4 05  |-State)<<22)....|
000058e0  e1 0d 17 de 05 3a 0d 17  e8 20 dd 20 f2 54 69 63  |.....:... . .Tic|
000058f0  6b 4d 65 6e 75 28 4d 65  6e 75 2c 49 74 65 6d 2c  |kMenu(Menu,Item,|
00005900  53 74 61 74 65 29 0d 17  f2 40 21 28 4d 65 6e 75  |State)...@!(Menu|
00005910  2b 32 38 2b 28 32 34 2a  49 74 65 6d 29 29 3d 28  |+28+(24*Item))=(|
00005920  21 28 4d 65 6e 75 2b 32  38 2b 28 32 34 2a 49 74  |!(Menu+28+(24*It|
00005930  65 6d 29 29 20 80 20 ac  20 31 29 20 82 20 28 2d  |em)) . . 1) . (-|
00005940  53 74 61 74 65 29 0d 17  fc 05 e1 0d 18 06 05 3a  |State).........:|
00005950  0d 18 10 1c dd 20 a4 4d  65 6e 75 53 68 61 64 65  |..... .MenuShade|
00005960  64 28 4d 65 6e 75 2c 49  74 65 6d 29 0d 18 1a 35  |d(Menu,Item)...5|
00005970  e7 20 28 21 28 4d 65 6e  75 2b 32 38 2b 28 32 34  |. (!(Menu+28+(24|
00005980  2a 49 74 65 6d 29 2b 38  29 20 80 20 28 31 3c 3c  |*Item)+8) . (1<<|
00005990  32 32 29 29 3d 28 31 3c  3c 32 32 29 20 8c 20 3d  |22))=(1<<22) . =|
000059a0  b9 0d 18 24 06 3d a3 0d  18 2e 05 3a 0d 18 38 1c  |...$.=.....:..8.|
000059b0  dd 20 a4 4d 65 6e 75 54  69 63 6b 65 64 28 4d 65  |. .MenuTicked(Me|
000059c0  6e 75 2c 49 74 65 6d 29  0d 18 42 27 e7 20 28 21  |nu,Item)..B'. (!|
000059d0  28 4d 65 6e 75 2b 32 38  2b 28 32 34 2a 49 74 65  |(Menu+28+(24*Ite|
000059e0  6d 29 29 20 80 20 31 29  3d 31 20 8c 20 3d b9 0d  |m)) . 1)=1 . =..|
000059f0  18 4c 06 3d a3 0d 18 56  05 3a 0d 18 60 19 dd 20  |.L.=...V.:..`.. |
00005a00  a4 52 65 61 64 49 63 6f  6e 28 57 6e 64 77 2c 49  |.ReadIcon(Wndw,I|
00005a10  63 6e 29 0d 18 6a 20 f4  20 52 65 61 64 20 6e 75  |cn)..j . Read nu|
00005a20  6d 65 72 69 63 20 76 61  6c 75 65 20 6f 66 20 69  |meric value of i|
00005a30  63 6f 6e 0d 18 74 3a 42  6c 6f 63 6b 21 30 3d 57  |con..t:Block!0=W|
00005a40  6e 64 77 3a 42 6c 6f 63  6b 21 34 3d 49 63 6e 3a  |ndw:Block!4=Icn:|
00005a50  c8 99 20 22 57 69 6d 70  5f 47 65 74 49 63 6f 6e  |.. "Wimp_GetIcon|
00005a60  53 74 61 74 65 22 2c 2c  42 6c 6f 63 6b 0d 18 7e  |State",,Block..~|
00005a70  13 3d bb 28 24 28 42 6c  6f 63 6b 21 32 38 29 29  |.=.($(Block!28))|
00005a80  0d 18 88 05 3a 0d 18 92  1c dd 20 a4 52 65 61 64  |....:..... .Read|
00005a90  49 63 6f 6e 53 74 72 28  57 6e 64 77 2c 49 63 6e  |IconStr(Wndw,Icn|
00005aa0  29 0d 18 9c 1f f4 20 52  65 61 64 20 73 74 72 69  |)..... Read stri|
00005ab0  6e 67 20 76 61 6c 75 65  20 6f 66 20 69 63 6f 6e  |ng value of icon|
00005ac0  0d 18 a6 3a 42 6c 6f 63  6b 21 30 3d 57 6e 64 77  |...:Block!0=Wndw|
00005ad0  3a 42 6c 6f 63 6b 21 34  3d 49 63 6e 3a c8 99 20  |:Block!4=Icn:.. |
00005ae0  22 57 69 6d 70 5f 47 65  74 49 63 6f 6e 53 74 61  |"Wimp_GetIconSta|
00005af0  74 65 22 2c 2c 42 6c 6f  63 6b 0d 18 b0 10 3d 24  |te",,Block....=$|
00005b00  28 42 6c 6f 63 6b 21 32  38 29 0d 18 ba 05 3a 0d  |(Block!28)....:.|
00005b10  18 c4 1a dd 20 a4 4d 6f  64 65 49 6e 66 6f 28 76  |.... .ModeInfo(v|
00005b20  61 72 24 2c 6d 6f 64 65  29 0d 18 ce 29 f4 20 55  |ar$,mode)...). U|
00005b30  73 65 20 6d 6f 64 65 3d  2d 31 20 66 6f 72 20 63  |se mode=-1 for c|
00005b40  75 72 72 65 6e 74 20 73  63 72 65 65 6e 20 6d 6f  |urrent screen mo|
00005b50  64 65 0d 18 d8 0d c8 8e  20 76 61 72 24 20 ca 0d  |de...... var$ ..|
00005b60  18 e2 3a 20 20 c9 20 22  58 50 69 78 65 6c 73 22  |..:  . "XPixels"|
00005b70  3a c8 99 20 22 4f 53 5f  52 65 61 64 4d 6f 64 65  |:.. "OS_ReadMode|
00005b80  56 61 72 69 61 62 6c 65  22 2c 6d 6f 64 65 2c 31  |Variable",mode,1|
00005b90  31 20 b8 20 2c 2c 76 61  72 0d 18 ec 3a 20 20 c9  |1 . ,,var...:  .|
00005ba0  20 22 59 50 69 78 65 6c  73 22 3a c8 99 20 22 4f  | "YPixels":.. "O|
00005bb0  53 5f 52 65 61 64 4d 6f  64 65 56 61 72 69 61 62  |S_ReadModeVariab|
00005bc0  6c 65 22 2c 6d 6f 64 65  2c 31 32 20 b8 20 2c 2c  |le",mode,12 . ,,|
00005bd0  76 61 72 0d 18 f6 36 20  20 c9 20 22 4e 43 6f 6c  |var...6  . "NCol|
00005be0  22 3a c8 99 20 22 4f 53  5f 52 65 61 64 4d 6f 64  |":.. "OS_ReadMod|
00005bf0  65 56 61 72 69 61 62 6c  65 22 2c 6d 6f 64 65 2c  |eVariable",mode,|
00005c00  33 20 b8 20 2c 2c 76 61  72 0d 19 00 3c 20 20 c9  |3 . ,,var...<  .|
00005c10  20 22 58 45 69 67 46 61  63 74 6f 72 22 3a c8 99  | "XEigFactor":..|
00005c20  20 22 4f 53 5f 52 65 61  64 4d 6f 64 65 56 61 72  | "OS_ReadModeVar|
00005c30  69 61 62 6c 65 22 2c 6d  6f 64 65 2c 34 20 b8 20  |iable",mode,4 . |
00005c40  2c 2c 76 61 72 0d 19 0a  3c 20 20 c9 20 22 59 45  |,,var...<  . "YE|
00005c50  69 67 46 61 63 74 6f 72  22 3a c8 99 20 22 4f 53  |igFactor":.. "OS|
00005c60  5f 52 65 61 64 4d 6f 64  65 56 61 72 69 61 62 6c  |_ReadModeVariabl|
00005c70  65 22 2c 6d 6f 64 65 2c  35 20 b8 20 2c 2c 76 61  |e",mode,5 . ,,va|
00005c80  72 0d 19 14 3f 20 20 c9  20 22 42 50 50 22 3a c8  |r...?  . "BPP":.|
00005c90  99 20 22 4f 53 5f 52 65  61 64 4d 6f 64 65 56 61  |. "OS_ReadModeVa|
00005ca0  72 69 61 62 6c 65 22 2c  6d 6f 64 65 2c 39 20 b8  |riable",mode,9 .|
00005cb0  20 2c 2c 76 61 72 3a 76  61 72 3d 32 5e 76 61 72  | ,,var:var=2^var|
00005cc0  0d 19 1e 36 20 20 7f 20  76 61 72 3d 2d 31 3a f4  |...6  . var=-1:.|
00005cd0  20 46 61 6c 6c 2d 74 68  72 6f 75 67 68 20 66 6f  | Fall-through fo|
00005ce0  72 20 61 20 66 61 75 6c  74 79 20 69 6e 70 75 74  |r a faulty input|
00005cf0  20 76 61 6c 75 65 0d 19  28 05 cb 0d 19 32 08 3d  | value..(....2.=|
00005d00  76 61 72 0d 19 3c 05 3a  0d 19 46 2b dd 20 f2 55  |var..<.:..F+. .U|
00005d10  70 64 61 74 65 49 63 6f  6e 46 6f 72 4d 6f 64 65  |pdateIconForMode|
00005d20  28 41 70 70 6e 61 6d 65  24 2c 57 6e 64 77 2c 49  |(Appname$,Wndw,I|
00005d30  63 6e 29 0d 19 50 4e f4  20 54 68 69 73 20 70 72  |cn)..PN. This pr|
00005d40  6f 63 65 64 75 72 65 20  72 65 71 75 69 72 65 73  |ocedure requires|
00005d50  20 74 68 61 74 20 41 4c  4c 20 74 68 65 20 69 63  | that ALL the ic|
00005d60  6f 6e 20 73 70 72 69 74  65 73 20 61 72 65 20 64  |on sprites are d|
00005d70  65 66 69 6e 65 64 20 69  6e 20 6d 6f 64 65 20 32  |efined in mode 2|
00005d80  30 0d 19 5a 4e f4 20 6f  72 20 6d 6f 64 65 20 32  |0..ZN. or mode 2|
00005d90  37 20 28 77 68 69 63 68  20 69 73 20 65 71 75 69  |7 (which is equi|
00005da0  76 61 6c 65 6e 74 29 20  77 69 74 68 20 61 20 6d  |valent) with a m|
00005db0  61 73 6b 20 62 75 74 20  6e 6f 20 70 61 6c 65 74  |ask but no palet|
00005dc0  74 65 2e 20 54 68 65 79  20 73 68 6f 75 6c 64 0d  |te. They should.|
00005dd0  19 64 4e f4 20 73 74 69  6c 6c 20 61 70 70 65 61  |.dN. still appea|
00005de0  72 20 74 6f 20 68 61 76  65 20 74 68 65 20 65 78  |r to have the ex|
00005df0  70 65 63 74 65 64 20 72  65 73 6f 6c 75 74 69 6f  |pected resolutio|
00005e00  6e 73 20 61 6e 64 20 6e  75 6d 62 65 72 20 6f 66  |ns and number of|
00005e10  20 63 6f 6c 6f 75 72 73  2c 20 69 2e 65 0d 19 6e  | colours, i.e..n|
00005e20  4e f4 20 21 53 70 72 69  74 65 73 32 33 3a 20 74  |N. !Sprites23: t|
00005e30  77 6f 20 63 6f 6c 6f 75  72 73 2c 20 68 69 67 68  |wo colours, high|
00005e40  20 72 65 73 6f 6c 75 74  69 6f 6e 2c 20 21 53 70  | resolution, !Sp|
00005e50  72 69 74 65 73 20 28 61  63 74 75 61 6c 6c 79 20  |rites (actually |
00005e60  21 53 70 72 69 74 65 73  32 34 29 0d 19 78 4c f4  |!Sprites24)..xL.|
00005e70  20 61 74 20 6d 6f 64 65  20 31 32 20 72 65 73 6f  | at mode 12 reso|
00005e80  6c 75 74 69 6f 6e 20 28  64 6f 75 62 6c 65 20 68  |lution (double h|
00005e90  65 69 67 68 74 20 70 69  78 65 6c 73 29 20 69 6e  |eight pixels) in|
00005ea0  20 31 36 20 63 6f 6c 6f  75 72 73 2c 20 61 6e 64  | 16 colours, and|
00005eb0  20 6e 6f 72 6d 61 6c 0d  19 82 4c f4 20 6d 6f 64  | normal...L. mod|
00005ec0  65 20 32 30 20 72 65 73  6f 6c 75 74 69 6f 6e 2c  |e 20 resolution,|
00005ed0  20 31 36 20 63 6f 6c 6f  75 72 73 20 66 6f 72 20  | 16 colours for |
00005ee0  74 68 65 20 21 53 70 72  69 74 65 73 32 32 20 69  |the !Sprites22 i|
00005ef0  63 6f 6e 2e 20 49 66 20  74 68 69 73 20 69 73 20  |con. If this is |
00005f00  6e 6f 74 0d 19 8c 49 f4  20 61 64 68 65 72 65 64  |not...I. adhered|
00005f10  20 74 6f 2c 20 74 68 65  6e 20 6d 65 6d 6f 72 79  | to, then memory|
00005f20  20 73 68 6f 72 74 61 67  65 20 65 72 72 6f 72 73  | shortage errors|
00005f30  20 6d 61 79 20 6f 63 63  75 72 20 6f 6e 20 61 20  | may occur on a |
00005f40  6d 6f 64 65 20 63 68 61  6e 67 65 2e 0d 19 96 13  |mode change.....|
00005f50  45 78 74 65 6e 73 69 6f  6e 24 3d 22 32 34 22 0d  |Extension$="24".|
00005f60  19 a0 24 e7 20 a4 4d 6f  64 65 49 6e 66 6f 28 22  |..$. .ModeInfo("|
00005f70  59 45 69 67 46 61 63 74  6f 72 22 2c 2d 31 29 3c  |YEigFactor",-1)<|
00005f80  32 20 8c 0d 19 aa 20 20  20 e7 20 a4 4d 6f 64 65  |2 ....   . .Mode|
00005f90  49 6e 66 6f 28 22 4e 43  6f 6c 22 2c 2d 31 29 3e  |Info("NCol",-1)>|
00005fa0  32 20 8c 0d 19 b4 17 20  20 20 20 45 78 74 65 6e  |2 .....    Exten|
00005fb0  73 69 6f 6e 24 3d 22 32  32 22 0d 19 be 07 20 20  |sion$="22"....  |
00005fc0  cc 0d 19 c8 17 20 20 20  20 45 78 74 65 6e 73 69  |.....    Extensi|
00005fd0  6f 6e 24 3d 22 32 33 22  0d 19 d2 07 20 20 cd 0d  |on$="23"....  ..|
00005fe0  19 dc 05 cd 0d 19 e6 2a  c8 99 20 22 57 69 6d 70  |.......*.. "Wimp|
00005ff0  5f 42 61 73 65 4f 66 53  70 72 69 74 65 73 22 20  |_BaseOfSprites" |
00006000  b8 20 2c 69 63 6f 6e 73  70 72 69 74 65 25 0d 19  |. ,iconsprite%..|
00006010  f0 45 c8 99 20 22 4f 53  5f 53 70 72 69 74 65 4f  |.E.. "OS_SpriteO|
00006020  70 22 2c 32 35 36 2b 32  35 2c 69 63 6f 6e 73 70  |p",256+25,iconsp|
00006030  72 69 74 65 25 2c 41 70  70 6e 61 6d 65 24 3a f4  |rite%,Appname$:.|
00006040  20 44 65 6c 65 74 65 20  69 63 6f 6e 20 73 70 72  | Delete icon spr|
00006050  69 74 65 0d 19 fa 3d f4  20 54 68 65 20 66 6f 6c  |ite...=. The fol|
00006060  6c 6f 77 69 6e 67 20 74  68 72 65 65 20 6c 69 6e  |lowing three lin|
00006070  65 73 20 61 73 73 75 6d  65 20 61 20 6d 61 73 6b  |es assume a mask|
00006080  20 62 75 74 20 6e 6f 20  70 61 6c 65 74 74 65 3a  | but no palette:|
00006090  0d 1a 04 62 c8 99 20 22  4f 53 5f 53 70 72 69 74  |...b.. "OS_Sprit|
000060a0  65 4f 70 22 2c 32 35 36  2b 34 30 2c 53 70 72 69  |eOp",256+40,Spri|
000060b0  74 65 73 2c 41 70 70 6e  61 6d 65 24 2b 45 78 74  |tes,Appname$+Ext|
000060c0  65 6e 73 69 6f 6e 24 20  b8 20 2c 2c 2c 77 2c 68  |ension$ . ,,,w,h|
000060d0  2c 2c 6d 6f 64 65 3a f4  20 47 65 74 20 69 6e 66  |,,mode:. Get inf|
000060e0  6f 20 61 62 6f 75 74 20  6e 65 77 20 73 70 72 69  |o about new spri|
000060f0  74 65 0d 1a 0e 5c c8 99  20 22 4f 53 5f 53 70 72  |te...\.. "OS_Spr|
00006100  69 74 65 4f 70 22 2c 32  35 36 2b 31 35 2c 69 63  |iteOp",256+15,ic|
00006110  6f 6e 73 70 72 69 74 65  25 2c 41 70 70 6e 61 6d  |onsprite%,Appnam|
00006120  65 24 2c 30 2c 77 2c 68  2c 6d 6f 64 65 3a f4 20  |e$,0,w,h,mode:. |
00006130  43 72 65 61 74 65 20 72  65 70 6c 61 63 65 6d 65  |Create replaceme|
00006140  6e 74 20 69 63 6f 6e 20  73 70 72 69 74 65 0d 1a  |nt icon sprite..|
00006150  18 3f c8 99 20 22 58 4f  53 5f 53 70 72 69 74 65  |.?.. "XOS_Sprite|
00006160  4f 70 22 2c 32 35 36 2b  32 39 2c 69 63 6f 6e 73  |Op",256+29,icons|
00006170  70 72 69 74 65 25 2c 41  70 70 6e 61 6d 65 24 3a  |prite%,Appname$:|
00006180  f4 20 43 72 65 61 74 65  20 6d 61 73 6b 0d 1a 22  |. Create mask.."|
00006190  07 20 20 3a 0d 1a 2c 2d  f4 20 50 61 69 6e 74 20  |.  :..,-. Paint |
000061a0  73 70 72 69 74 65 20 6d  61 73 6b 20 69 6e 74 6f  |sprite mask into|
000061b0  20 69 63 6f 6e 73 70 72  69 74 65 20 6d 61 73 6b  | iconsprite mask|
000061c0  3a 0d 1a 36 51 c8 99 20  22 4f 53 5f 53 70 72 69  |:..6Q.. "OS_Spri|
000061d0  74 65 4f 70 22 2c 32 35  36 2b 36 31 2c 69 63 6f  |teOp",256+61,ico|
000061e0  6e 73 70 72 69 74 65 25  2c 41 70 70 6e 61 6d 65  |nsprite%,Appname|
000061f0  24 2c 30 20 b8 20 72 30  2c 72 31 2c 72 32 2c 72  |$,0 . r0,r1,r2,r|
00006200  33 3a f4 20 4f 75 74 70  75 74 20 74 6f 20 6d 61  |3:. Output to ma|
00006210  73 6b 0d 1a 40 55 c8 99  20 22 4f 53 5f 53 70 72  |sk..@U.. "OS_Spr|
00006220  69 74 65 4f 70 22 2c 32  35 36 2b 34 39 2c 53 70  |iteOp",256+49,Sp|
00006230  72 69 74 65 73 2c 41 70  70 6e 61 6d 65 24 2b 45  |rites,Appname$+E|
00006240  78 74 65 6e 73 69 6f 6e  24 2c 30 2c 30 3a f4 20  |xtension$,0,0:. |
00006250  50 61 69 6e 74 20 6d 61  73 6b 20 66 72 6f 6d 20  |Paint mask from |
00006260  53 70 72 69 74 65 73 0d  1a 4a 37 e6 20 34 2c 31  |Sprites..J7. 4,1|
00006270  32 38 3a da 3a f4 20 49  6e 76 65 72 74 20 74 6f  |28:.:. Invert to|
00006280  20 6d 61 6b 65 20 6d 61  73 6b 20 74 68 65 20 72  | make mask the r|
00006290  69 67 68 74 20 77 61 79  20 72 6f 75 6e 64 0d 1a  |ight way round..|
000062a0  54 36 c8 99 20 22 4f 53  5f 53 70 72 69 74 65 4f  |T6.. "OS_SpriteO|
000062b0  70 22 2c 72 30 2c 72 31  2c 72 32 2c 72 33 3a f4  |p",r0,r1,r2,r3:.|
000062c0  20 52 65 73 65 74 20 73  63 72 65 65 6e 20 6f 75  | Reset screen ou|
000062d0  74 70 75 74 0d 1a 5e 07  20 20 3a 0d 1a 68 23 f4  |tput..^.  :..h#.|
000062e0  20 50 61 69 6e 74 20 73  70 72 69 74 65 20 69 6e  | Paint sprite in|
000062f0  74 6f 20 69 63 6f 6e 73  70 72 69 74 65 3a 0d 1a  |to iconsprite:..|
00006300  72 5c c8 99 20 22 4f 53  5f 53 70 72 69 74 65 4f  |r\.. "OS_SpriteO|
00006310  70 22 2c 32 35 36 2b 36  30 2c 69 63 6f 6e 73 70  |p",256+60,iconsp|
00006320  72 69 74 65 25 2c 41 70  70 6e 61 6d 65 24 2c 30  |rite%,Appname$,0|
00006330  20 b8 20 72 30 2c 72 31  2c 72 32 2c 72 33 3a f4  | . r0,r1,r2,r3:.|
00006340  20 4f 75 74 70 75 74 20  74 6f 20 6e 65 77 20 69  | Output to new i|
00006350  63 6f 6e 20 73 70 72 69  74 65 0d 1a 7c 57 c8 99  |con sprite..|W..|
00006360  20 22 4f 53 5f 53 70 72  69 74 65 4f 70 22 2c 32  | "OS_SpriteOp",2|
00006370  35 36 2b 33 34 2c 53 70  72 69 74 65 73 2c 41 70  |56+34,Sprites,Ap|
00006380  70 6e 61 6d 65 24 2b 45  78 74 65 6e 73 69 6f 6e  |pname$+Extension|
00006390  24 2c 30 2c 30 2c 38 3a  f4 20 50 61 69 6e 74 20  |$,0,0,8:. Paint |
000063a0  63 6f 70 79 20 66 72 6f  6d 20 53 70 72 69 74 65  |copy from Sprite|
000063b0  73 0d 1a 86 36 c8 99 20  22 4f 53 5f 53 70 72 69  |s...6.. "OS_Spri|
000063c0  74 65 4f 70 22 2c 72 30  2c 72 31 2c 72 32 2c 72  |teOp",r0,r1,r2,r|
000063d0  33 3a f4 20 52 65 73 65  74 20 73 63 72 65 65 6e  |3:. Reset screen|
000063e0  20 6f 75 74 70 75 74 0d  1a 90 3a 42 6c 6f 63 6b  | output...:Block|
000063f0  21 30 3d 57 6e 64 77 3a  42 6c 6f 63 6b 21 34 3d  |!0=Wndw:Block!4=|
00006400  49 63 6e 3a c8 99 20 22  57 69 6d 70 5f 47 65 74  |Icn:.. "Wimp_Get|
00006410  49 63 6f 6e 53 74 61 74  65 22 2c 2c 42 6c 6f 63  |IconState",,Bloc|
00006420  6b 0d 1a 9a 45 42 6c 6f  63 6b 21 38 3d 30 3a 42  |k...EBlock!8=0:B|
00006430  6c 6f 63 6b 21 31 32 3d  30 3a c8 99 20 22 57 69  |lock!12=0:.. "Wi|
00006440  6d 70 5f 53 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_SetIconState"|
00006450  2c 2c 42 6c 6f 63 6b 3a  f4 20 52 65 2d 70 6c 6f  |,,Block:. Re-plo|
00006460  74 20 69 63 6f 6e 0d 1a  a4 05 e1 0d 1a ae 05 3a  |t icon.........:|
00006470  0d 1a b8 d8 dd 20 a4 43  72 65 61 74 65 57 69 6e  |..... .CreateWin|
00006480  64 6f 77 28 6d 69 6e 58  2c 6d 69 6e 59 2c 6d 61  |dow(minX,minY,ma|
00006490  78 58 2c 6d 61 78 59 2c  58 6f 66 66 73 65 74 2c  |xX,maxY,Xoffset,|
000064a0  59 6f 66 66 73 65 74 2c  48 61 6e 64 6c 65 2c 46  |Yoffset,Handle,F|
000064b0  6c 61 67 73 2c 54 69 74  6c 65 43 6f 6c 2c 54 69  |lags,TitleCol,Ti|
000064c0  74 6c 65 42 61 63 6b 43  6f 6c 2c 57 6f 72 6b 43  |tleBackCol,WorkC|
000064d0  6f 6c 2c 57 6f 72 6b 42  61 63 6b 43 6f 6c 2c 53  |ol,WorkBackCol,S|
000064e0  63 72 6f 6c 6c 43 6f 6c  2c 53 6c 69 64 65 72 43  |crollCol,SliderC|
000064f0  6f 6c 2c 49 6e 70 75 74  43 6f 6c 2c 57 6d 69 6e  |ol,InputCol,Wmin|
00006500  58 2c 57 6d 69 6e 59 2c  57 6d 61 78 58 2c 57 6d  |X,WminY,WmaxX,Wm|
00006510  61 78 59 2c 54 69 74 6c  65 46 6c 61 67 73 2c 57  |axY,TitleFlags,W|
00006520  62 75 74 74 6f 6e 2c 53  70 72 69 74 65 50 6f 69  |button,SpritePoi|
00006530  6e 74 2c 4d 69 6e 57 2c  4d 69 6e 48 2c 54 69 74  |nt,MinW,MinH,Tit|
00006540  6c 65 44 61 74 61 24 29  0d 1a c2 5a 42 6c 6f 63  |leData$)...ZBloc|
00006550  6b 21 30 3d 6d 69 6e 58  3a 42 6c 6f 63 6b 21 34  |k!0=minX:Block!4|
00006560  3d 6d 69 6e 59 3a 42 6c  6f 63 6b 21 38 3d 6d 61  |=minY:Block!8=ma|
00006570  78 58 3a 42 6c 6f 63 6b  21 31 32 3d 6d 61 78 59  |xX:Block!12=maxY|
00006580  3a 42 6c 6f 63 6b 21 31  36 3d 58 6f 66 66 73 65  |:Block!16=Xoffse|
00006590  74 3a 42 6c 6f 63 6b 21  32 30 3d 59 6f 66 66 73  |t:Block!20=Yoffs|
000065a0  65 74 0d 1a cc 22 42 6c  6f 63 6b 21 32 34 3d 48  |et..."Block!24=H|
000065b0  61 6e 64 6c 65 3a 42 6c  6f 63 6b 21 32 38 3d 46  |andle:Block!28=F|
000065c0  6c 61 67 73 0d 1a d6 51  42 6c 6f 63 6b 3f 33 32  |lags...QBlock?32|
000065d0  3d 54 69 74 6c 65 43 6f  6c 3a 42 6c 6f 63 6b 3f  |=TitleCol:Block?|
000065e0  33 33 3d 54 69 74 6c 65  42 61 63 6b 43 6f 6c 3a  |33=TitleBackCol:|
000065f0  42 6c 6f 63 6b 3f 33 34  3d 57 6f 72 6b 43 6f 6c  |Block?34=WorkCol|
00006600  3a 42 6c 6f 63 6b 3f 33  35 3d 57 6f 72 6b 42 61  |:Block?35=WorkBa|
00006610  63 6b 43 6f 6c 0d 1a e0  46 42 6c 6f 63 6b 3f 33  |ckCol...FBlock?3|
00006620  36 3d 53 63 72 6f 6c 6c  43 6f 6c 3a 42 6c 6f 63  |6=ScrollCol:Bloc|
00006630  6b 3f 33 37 3d 53 6c 69  64 65 72 43 6f 6c 3a 42  |k?37=SliderCol:B|
00006640  6c 6f 63 6b 3f 33 38 3d  49 6e 70 75 74 43 6f 6c  |lock?38=InputCol|
00006650  3a 42 6c 6f 63 6b 3f 33  39 3d 30 0d 1a ea 3f 42  |:Block?39=0...?B|
00006660  6c 6f 63 6b 21 34 30 3d  57 6d 69 6e 58 3a 42 6c  |lock!40=WminX:Bl|
00006670  6f 63 6b 21 34 34 3d 57  6d 69 6e 59 3a 42 6c 6f  |ock!44=WminY:Blo|
00006680  63 6b 21 34 38 3d 57 6d  61 78 58 3a 42 6c 6f 63  |ck!48=WmaxX:Bloc|
00006690  6b 21 35 32 3d 57 6d 61  78 59 0d 1a f4 3d 42 6c  |k!52=WmaxY...=Bl|
000066a0  6f 63 6b 21 35 36 3d 54  69 74 6c 65 46 6c 61 67  |ock!56=TitleFlag|
000066b0  73 3a 42 6c 6f 63 6b 21  36 30 3d 57 62 75 74 74  |s:Block!60=Wbutt|
000066c0  6f 6e 3a 42 6c 6f 63 6b  21 36 34 3d 53 70 72 69  |on:Block!64=Spri|
000066d0  74 65 50 6f 69 6e 74 0d  1a fe 5f 42 6c 6f 63 6b  |tePoint..._Block|
000066e0  21 36 38 3d 28 4d 69 6e  48 3c 3c 31 35 29 2b 4d  |!68=(MinH<<15)+M|
000066f0  69 6e 57 20 3a 3a 3a 3a  3a 3a 3a 3a 3a 3a 3a 3a  |inW ::::::::::::|
00006700  20 f4 20 30 2c 30 20 73  65 74 73 20 74 68 65 20  | . 0,0 sets the |
00006710  6d 69 6e 69 6d 75 6d 20  77 69 6e 64 6f 77 20 77  |minimum window w|
00006720  69 74 68 20 74 6f 20 74  68 65 20 74 69 74 6c 65  |ith to the title|
00006730  20 77 69 64 74 68 0d 1b  08 3e 24 28 42 6c 6f 63  | width...>$(Bloc|
00006740  6b 2b 37 32 29 3d 54 69  74 6c 65 44 61 74 61 24  |k+72)=TitleData$|
00006750  3a 42 6c 6f 63 6b 21 38  34 3d 30 20 3a 3a 3a 20  |:Block!84=0 ::: |
00006760  f4 20 4e 6f 20 69 63 6f  6e 73 20 69 6e 69 74 69  |. No icons initi|
00006770  61 6c 6c 79 0d 1b 12 30  c8 99 20 22 57 69 6d 70  |ally...0.. "Wimp|
00006780  5f 43 72 65 61 74 65 57  69 6e 64 6f 77 22 2c 2c  |_CreateWindow",,|
00006790  42 6c 6f 63 6b 20 b8 20  57 69 6e 64 6f 77 48 61  |Block . WindowHa|
000067a0  6e 64 6c 65 0d 1b 1c 11  3d 57 69 6e 64 6f 77 48  |ndle....=WindowH|
000067b0  61 6e 64 6c 65 0d 1b 26  05 3a 0d 1b 30 11 dd 20  |andle..&.:..0.. |
000067c0  f2 49 6e 69 74 69 61 6c  69 73 65 0d 1b 3a 2d 41  |.Initialise..:-A|
000067d0  70 70 53 69 7a 65 3d 93  2d 26 38 30 30 30 3a 4d  |ppSize=.-&8000:M|
000067e0  69 6e 53 69 7a 65 3d 41  70 70 53 69 7a 65 3a 53  |inSize=AppSize:S|
000067f0  6c 6f 74 45 6e 64 3d 93  0d 1b 44 05 e1 0d 1b 4e  |lotEnd=...D....N|
00006800  05 3a 0d 1b 58 1f dd 20  a4 41 6c 6c 6f 63 61 74  |.:..X.. .Allocat|
00006810  65 4d 65 6d 6f 72 79 28  52 65 71 75 69 72 65 64  |eMemory(Required|
00006820  29 0d 1b 62 1a 53 6c 6f  74 53 69 7a 65 3d a4 53  |)..b.SlotSize=.S|
00006830  6c 6f 74 53 69 7a 65 28  2d 31 29 0d 1b 6c 92 e7  |lotSize(-1)..l..|
00006840  20 53 6c 6f 74 53 69 7a  65 3c 52 65 71 75 69 72  | SlotSize<Requir|
00006850  65 64 20 8c 20 4e 65 77  53 69 7a 65 3d a4 53 6c  |ed . NewSize=.Sl|
00006860  6f 74 53 69 7a 65 28 52  65 71 75 69 72 65 64 29  |otSize(Required)|
00006870  3a e7 20 4e 65 77 53 69  7a 65 3c 52 65 71 75 69  |:. NewSize<Requi|
00006880  72 65 64 20 8c 20 53 6c  6f 74 53 69 7a 65 3d a4  |red . SlotSize=.|
00006890  53 6c 6f 74 53 69 7a 65  28 41 70 70 53 69 7a 65  |SlotSize(AppSize|
000068a0  29 3a 3d 30 3a f4 20 52  65 74 75 72 6e 73 2c 20  |):=0:. Returns, |
000068b0  69 6e 64 69 63 61 74 69  6e 67 20 6d 65 6d 6f 72  |indicating memor|
000068c0  79 20 6e 6f 74 20 63 6c  61 69 6d 65 64 0d 1b 76  |y not claimed..v|
000068d0  36 e7 20 53 6c 6f 74 53  69 7a 65 3e 52 65 71 75  |6. SlotSize>Requ|
000068e0  69 72 65 64 20 8c 20 53  6c 6f 74 53 69 7a 65 3d  |ired . SlotSize=|
000068f0  a4 53 6c 6f 74 53 69 7a  65 28 52 65 71 75 69 72  |.SlotSize(Requir|
00006900  65 64 29 0d 1b 80 2a 3d  53 6c 6f 74 53 69 7a 65  |ed)...*=SlotSize|
00006910  3a f4 20 52 65 74 75 72  6e 73 20 77 69 74 68 20  |:. Returns with |
00006920  62 79 74 65 73 20 63 6c  61 69 6d 65 64 0d 1b 8a  |bytes claimed...|
00006930  05 3a 0d 1b 94 16 dd 20  a4 53 6c 6f 74 53 69 7a  |.:..... .SlotSiz|
00006940  65 28 42 79 74 65 73 29  0d 1b 9e 27 c8 99 20 22  |e(Bytes)...'.. "|
00006950  57 69 6d 70 5f 53 6c 6f  74 53 69 7a 65 22 2c 42  |Wimp_SlotSize",B|
00006960  79 74 65 73 2c 2d 31 20  b8 20 42 79 74 65 73 0d  |ytes,-1 . Bytes.|
00006970  1b a8 0a 3d 42 79 74 65  73 0d 1b b2 05 3a 0d 1b  |...=Bytes....:..|
00006980  bc 17 dd 20 f2 4d 69 6e  69 6d 69 73 65 57 69 6d  |... .MinimiseWim|
00006990  70 53 6c 6f 74 0d 1b c6  22 64 75 6d 6d 79 3d a4  |pSlot..."dummy=.|
000069a0  41 6c 6c 6f 63 61 74 65  4d 65 6d 6f 72 79 28 4d  |AllocateMemory(M|
000069b0  69 6e 53 69 7a 65 29 0d  1b d0 05 e1 0d 1b da 05  |inSize).........|
000069c0  3a 0d 1b e4 22 dd 20 f2  43 6c 6f 73 65 46 69 6c  |:...". .CloseFil|
000069d0  65 49 66 50 6f 73 73 28  46 69 6c 65 48 61 6e 64  |eIfPoss(FileHand|
000069e0  6c 65 29 0d 1b ee 07 ea  20 85 0d 1b f8 26 ee 20  |le)..... ....&. |
000069f0  85 20 ea 20 f7 20 85 3a  e1 3a f4 20 55 6e 61 62  |. . . .:.:. Unab|
00006a00  6c 65 20 74 6f 20 63 6c  6f 73 65 20 66 69 6c 65  |le to close file|
00006a10  0d 1c 02 10 d9 23 46 69  6c 65 48 61 6e 64 6c 65  |.....#FileHandle|
00006a20  0d 1c 0c 05 e1 0d 1c 16  05 3a 0d 1c 20 1e dd 20  |.........:.. .. |
00006a30  a4 46 69 6e 64 46 69 6c  65 53 69 7a 65 28 46 69  |.FindFileSize(Fi|
00006a40  6c 65 4e 61 6d 65 24 29  0d 1c 2a 20 e7 20 46 69  |leName$)..* . Fi|
00006a50  6c 65 4e 61 6d 65 24 3d  22 3c 57 69 6d 70 24 53  |leName$="<Wimp$S|
00006a60  63 72 61 70 3e 22 20 8c  0d 1c 34 3a 20 20 c8 99  |crap>" ...4:  ..|
00006a70  20 22 4f 53 5f 46 69 6c  65 22 2c 31 35 2c 46 69  | "OS_File",15,Fi|
00006a80  6c 65 4e 61 6d 65 24 2c  2c 2c 46 69 6c 65 4e 61  |leName$,,,FileNa|
00006a90  6d 65 24 20 b8 20 2c 2c  2c 2c 46 69 6c 65 53 69  |me$ . ,,,,FileSi|
00006aa0  7a 65 0d 1c 3e 05 cc 0d  1c 48 34 20 20 4e 3d 2d  |ze..>....H4  N=-|
00006ab0  31 3a f5 3a 4e 2b 3d 31  3a fd 20 c1 46 69 6c 65  |1:.:N+=1:. .File|
00006ac0  4e 61 6d 65 24 2c a9 28  46 69 6c 65 4e 61 6d 65  |Name$,.(FileName|
00006ad0  24 29 2d 4e 2c 31 29 3d  22 2e 22 0d 1c 52 42 20  |$)-N,1)="."..RB |
00006ae0  20 50 61 74 68 4e 61 6d  65 24 3d c0 46 69 6c 65  | PathName$=.File|
00006af0  4e 61 6d 65 24 2c a9 28  46 69 6c 65 4e 61 6d 65  |Name$,.(FileName|
00006b00  24 29 2d 4e 29 3a 4c 65  61 66 4e 61 6d 65 24 3d  |$)-N):LeafName$=|
00006b10  c2 46 69 6c 65 4e 61 6d  65 24 2c 4e 29 0d 1c 5c  |.FileName$,N)..\|
00006b20  3a 20 20 c8 99 20 22 4f  53 5f 46 69 6c 65 22 2c  |:  .. "OS_File",|
00006b30  31 33 2c 4c 65 61 66 4e  61 6d 65 24 2c 2c 2c 50  |13,LeafName$,,,P|
00006b40  61 74 68 4e 61 6d 65 24  20 b8 20 2c 2c 2c 2c 46  |athName$ . ,,,,F|
00006b50  69 6c 65 53 69 7a 65 0d  1c 66 05 cd 0d 1c 70 0d  |ileSize..f....p.|
00006b60  3d 46 69 6c 65 53 69 7a  65 0d 1c 7a 05 3a 0d 1c  |=FileSize..z.:..|
00006b70  84 10 dd 20 a4 4e 65 78  74 45 6e 74 72 79 0d 1c  |... .NextEntry..|
00006b80  8e 48 f4 20 47 65 74 73  20 6e 65 78 74 20 65 6e  |.H. Gets next en|
00006b90  74 72 79 20 28 63 72 65  61 74 65 64 20 62 79 20  |try (created by |
00006ba0  42 50 55 54 23 44 61 74  61 2c 41 24 29 20 66 72  |BPUT#Data,A$) fr|
00006bb0  6f 6d 20 61 20 66 69 6c  65 20 61 73 20 61 20 73  |om a file as a s|
00006bc0  74 72 69 6e 67 2e 0d 1c  98 1c f4 20 55 73 65 20  |tring...... Use |
00006bd0  61 73 20 41 24 3d 46 4e  4e 65 78 74 45 6e 74 72  |as A$=FNNextEntr|
00006be0  79 2e 0d 1c a2 07 ea 20  85 0d 1c ac 26 ee 20 85  |y...... ....&. .|
00006bf0  20 ea 20 f7 20 85 3a 3d  22 22 3a f4 20 45 72 72  | . . .:="":. Err|
00006c00  6f 72 20 72 65 61 64 69  6e 67 20 66 69 6c 65 0d  |or reading file.|
00006c10  1c b6 0e 4e 45 24 3d be  23 44 61 74 61 0d 1c c0  |...NE$=.#Data...|
00006c20  12 c8 95 20 c0 4e 45 24  2c 31 29 3d 22 7c 22 0d  |... .NE$,1)="|".|
00006c30  1c ca 10 20 20 4e 45 24  3d be 23 44 61 74 61 0d  |...  NE$=.#Data.|
00006c40  1c d4 05 ce 0d 1c de 08  3d 4e 45 24 0d 1c e8 05  |........=NE$....|
00006c50  3a 0d 1c f2 4f f4 20 2d  2d 2d 2d 2d 2d 2d 2d 2d  |:...O. ---------|
00006c60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00006ca0  0d 1c fc 2f f4 20 52 6f  75 74 69 6e 65 73 20 63  |.../. Routines c|
00006cb0  6f 6d 6d 6f 6e 20 74 6f  20 74 68 65 20 4f 6d 6e  |ommon to the Omn|
00006cc0  69 44 65 73 6b 20 75 74  69 6c 69 74 69 65 73 0d  |iDesk utilities.|
00006cd0  1d 06 4f f4 20 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |..O. -----------|
00006ce0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00006d10  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d 1d  |--------------..|
00006d20  10 05 3a 0d 1d 1a 18 dd  20 f2 44 65 63 6c 61 72  |..:..... .Declar|
00006d30  65 54 6f 4f 6d 6e 69 44  65 73 6b 0d 1d 24 2f 42  |eToOmniDesk..$/B|
00006d40  6c 6f 63 6b 21 30 3d 32  30 38 3a 42 6c 6f 63 6b  |lock!0=208:Block|
00006d50  21 31 32 3d 30 3a 42 6c  6f 63 6b 21 31 36 3d 55  |!12=0:Block!16=U|
00006d60  74 69 6c 44 65 63 6c 61  72 65 0d 1d 2e 11 42 6c  |tilDeclare....Bl|
00006d70  6f 63 6b 21 32 30 3d 54  61 73 6b 0d 1d 38 19 24  |ock!20=Task..8.$|
00006d80  28 42 6c 6f 63 6b 2b 32  34 29 3d 54 61 73 6b 6e  |(Block+24)=Taskn|
00006d90  61 6d 65 24 0d 1d 42 1c  24 28 42 6c 6f 63 6b 2b  |ame$..B.$(Block+|
00006da0  34 34 29 3d 4f 75 72 46  69 6c 65 4e 61 6d 65 24  |44)=OurFileName$|
00006db0  0d 1d 4c 29 24 28 42 6c  6f 63 6b 2b 35 35 29 3d  |..L)$(Block+55)=|
00006dc0  a4 4f 6d 6e 69 48 65 6c  70 4d 65 73 73 61 67 65  |.OmniHelpMessage|
00006dd0  28 22 43 4c 49 43 4b 22  29 0d 1d 56 29 24 28 42  |("CLICK")..V)$(B|
00006de0  6c 6f 63 6b 2b 31 33 32  29 3d a4 4f 6d 6e 69 48  |lock+132)=.OmniH|
00006df0  65 6c 70 4d 65 73 73 61  67 65 28 22 44 52 41 47  |elpMessage("DRAG|
00006e00  22 29 0d 1d 60 2b c8 99  20 22 57 69 6d 70 5f 53  |")..`+.. "Wimp_S|
00006e10  65 6e 64 4d 65 73 73 61  67 65 22 2c 31 37 2c 42  |endMessage",17,B|
00006e20  6c 6f 63 6b 2c 4f 6d 6e  69 44 65 73 6b 0d 1d 6a  |lock,OmniDesk..j|
00006e30  05 e1 0d 1d 74 05 3a 0d  1d 7e 11 dd 20 f2 53 61  |....t.:..~.. .Sa|
00006e40  79 47 6f 6f 64 62 79 65  0d 1d 88 14 e7 20 4f 6d  |yGoodbye..... Om|
00006e50  6e 69 44 65 73 6b 3d 30  20 8c 20 e1 0d 1d 92 2f  |niDesk=0 . ..../|
00006e60  42 6c 6f 63 6b 21 30 3d  32 34 3a 42 6c 6f 63 6b  |Block!0=24:Block|
00006e70  21 31 32 3d 30 3a 42 6c  6f 63 6b 21 31 36 3d 55  |!12=0:Block!16=U|
00006e80  74 69 6c 51 75 69 74 74  69 6e 67 0d 1d 9c 11 42  |tilQuitting....B|
00006e90  6c 6f 63 6b 21 32 30 3d  54 61 73 6b 0d 1d a6 2b  |lock!20=Task...+|
00006ea0  c8 99 20 22 57 69 6d 70  5f 53 65 6e 64 4d 65 73  |.. "Wimp_SendMes|
00006eb0  73 61 67 65 22 2c 31 37  2c 42 6c 6f 63 6b 2c 4f  |sage",17,Block,O|
00006ec0  6d 6e 69 44 65 73 6b 0d  1d b0 05 e1 0d 1d ba 05  |mniDesk.........|
00006ed0  3a 0d 1d c4 18 dd 20 a4  52 65 61 64 53 74 61 72  |:..... .ReadStar|
00006ee0  74 75 70 53 74 72 69 6e  67 0d 1d ce 4d f4 20 52  |tupString...M. R|
00006ef0  65 74 75 72 6e 73 20 74  61 73 6b 20 68 61 6e 64  |eturns task hand|
00006f00  6c 65 20 6f 66 20 4f 6d  6e 69 44 65 73 6b 20 28  |le of OmniDesk (|
00006f10  77 68 69 63 68 20 69 73  20 70 61 73 73 65 64 20  |which is passed |
00006f20  69 6e 20 74 68 65 20 63  6f 6d 6d 61 6e 64 20 73  |in the command s|
00006f30  74 72 69 6e 67 29 0d 1d  d8 26 f4 20 6f 72 20 30  |tring)...&. or 0|
00006f40  20 69 66 20 6e 6f 74 20  73 74 61 72 74 65 64 20  | if not started |
00006f50  62 79 20 4f 6d 6e 69 44  65 73 6b 2e 0d 1d e2 1d  |by OmniDesk.....|
00006f60  c8 99 20 22 4f 53 5f 47  65 74 45 6e 76 22 20 b8  |.. "OS_GetEnv" .|
00006f70  20 43 6f 6d 6d 61 6e 64  24 0d 1d ec 1b 41 3d a7  | Command$....A=.|
00006f80  43 6f 6d 6d 61 6e 64 24  2c 22 2d 53 74 61 72 74  |Command$,"-Start|
00006f90  75 70 22 29 0d 1d f6 16  e7 20 41 3c 3e 30 20 8c  |up")..... A<>0 .|
00006fa0  20 53 74 61 72 74 75 70  3d b9 0d 1e 00 18 41 3d  | Startup=.....A=|
00006fb0  a7 43 6f 6d 6d 61 6e 64  24 2c 22 2d 45 78 69 74  |.Command$,"-Exit|
00006fc0  22 29 0d 1e 0a 13 e7 20  41 3c 3e 30 20 8c 20 45  |")..... A<>0 . E|
00006fd0  78 69 74 3d b9 0d 1e 14  1c 41 3d a7 43 6f 6d 6d  |xit=.....A=.Comm|
00006fe0  61 6e 64 24 2c 22 2d 4f  6d 6e 69 44 65 73 6b 22  |and$,"-OmniDesk"|
00006ff0  29 0d 1e 1e 0e e7 20 41  3d 30 20 8c 20 3d 30 0d  |)..... A=0 . =0.|
00007000  1e 28 16 3d bb 28 c1 43  6f 6d 6d 61 6e 64 24 2c  |.(.=.(.Command$,|
00007010  41 2b 39 29 29 0d 1e 32  05 3a 0d 1e 3c 20 dd 20  |A+9))..2.:..< . |
00007020  a4 52 65 61 64 57 69 6e  64 6f 77 4c 6f 63 61 74  |.ReadWindowLocat|
00007030  69 6f 6e 28 41 78 69 73  24 29 0d 1e 46 48 f4 20  |ion(Axis$)..FH. |
00007040  52 65 61 64 73 20 77 68  69 63 68 20 72 61 64 69  |Reads which radi|
00007050  6f 20 69 63 6f 6e 20 28  69 66 20 61 6e 79 29 20  |o icon (if any) |
00007060  69 73 20 73 65 6c 65 63  74 65 64 20 69 6e 20 74  |is selected in t|
00007070  68 65 20 57 69 6e 64 6f  77 20 50 6f 73 69 74 69  |he Window Positi|
00007080  6f 6e 0d 1e 50 48 f4 20  73 65 6c 65 63 74 6f 72  |on..PH. selector|
00007090  20 77 69 6e 64 6f 77 20  61 6e 64 20 72 65 74 75  | window and retu|
000070a0  72 6e 73 20 74 68 65 20  61 78 69 73 20 63 6f 6f  |rns the axis coo|
000070b0  72 64 69 6e 61 74 65 20  28 74 77 6f 20 63 61 6c  |rdinate (two cal|
000070c0  6c 73 20 6e 65 65 64 65  64 29 0d 1e 5a 25 f4 20  |ls needed)..Z%. |
000070d0  6f 72 20 2d 31 20 66 6f  72 20 6e 6f 20 70 6f 73  |or -1 for no pos|
000070e0  69 74 69 6f 6e 20 73 65  6c 65 63 74 65 64 2e 0d  |ition selected..|
000070f0  1e 64 3f 49 63 6f 6e 3d  35 3a f5 3a 49 63 6f 6e  |.d?Icon=5:.:Icon|
00007100  2b 3d 31 3a fd 20 28 a4  53 65 6c 65 63 74 65 64  |+=1:. (.Selected|
00007110  53 74 61 74 65 28 4c 6f  63 2c 49 63 6f 6e 29 3d  |State(Loc,Icon)=|
00007120  b9 29 20 84 20 28 49 63  6f 6e 3d 33 31 29 0d 1e  |.) . (Icon=31)..|
00007130  6e 2a e7 20 49 63 6f 6e  3d 33 31 20 8c 20 3d 2d  |n*. Icon=31 . =-|
00007140  31 3a f4 20 41 6c 6c 20  69 63 6f 6e 73 20 64 65  |1:. All icons de|
00007150  73 65 6c 65 63 74 65 64  0d 1e 78 34 4c 6f 63 61  |selected..x4Loca|
00007160  74 69 6f 6e 3d 2d 31 3a  49 63 6f 6e 2d 3d 36 3a  |tion=-1:Icon-=6:|
00007170  f4 20 42 72 69 6e 67 20  69 63 6f 6e 20 69 6e 74  |. Bring icon int|
00007180  6f 20 72 61 6e 67 65 20  30 2d 31 34 0d 1e 82 0e  |o range 0-14....|
00007190  c8 8e 20 41 78 69 73 24  20 ca 0d 1e 8c 21 20 20  |.. Axis$ ....!  |
000071a0  c9 20 22 58 22 2c 22 78  22 3a 4c 6f 63 61 74 69  |. "X","x":Locati|
000071b0  6f 6e 3d 49 63 6f 6e 20  81 20 35 0d 1e 96 25 20  |on=Icon . 5...% |
000071c0  20 c9 20 22 59 22 2c 22  79 22 3a 4c 6f 63 61 74  | . "Y","y":Locat|
000071d0  69 6f 6e 3d 34 2d 28 49  63 6f 6e 20 83 20 35 29  |ion=4-(Icon . 5)|
000071e0  0d 1e a0 05 cb 0d 1e aa  0d 3d 4c 6f 63 61 74 69  |.........=Locati|
000071f0  6f 6e 0d 1e b4 05 3a 0d  1e be 17 dd 20 f2 43 6c  |on....:..... .Cl|
00007200  65 61 6e 55 70 4c 6f 63  57 69 6e 64 6f 77 0d 1e  |eanUpLocWindow..|
00007210  c8 4f f4 20 4d 61 6b 65  73 20 73 75 72 65 20 74  |.O. Makes sure t|
00007220  68 61 74 20 6e 6f 6e 65  20 6f 66 20 74 68 65 20  |hat none of the |
00007230  27 77 69 6e 64 6f 77 27  20 69 63 6f 6e 73 20 69  |'window' icons i|
00007240  6e 20 74 68 65 20 4c 6f  63 20 77 69 6e 64 6f 77  |n the Loc window|
00007250  20 69 73 20 73 65 6c 65  63 74 65 64 2e 0d 1e d2  | is selected....|
00007260  09 4e 3d 35 3a f5 0d 1e  dc 27 4e 2b 3d 31 3a fd  |.N=5:....'N+=1:.|
00007270  20 4e 3d 33 30 20 84 20  a4 53 65 6c 65 63 74 65  | N=30 . .Selecte|
00007280  64 53 74 61 74 65 28 4c  6f 63 2c 4e 29 0d 1e e6  |dState(Loc,N)...|
00007290  20 f2 55 70 64 61 74 65  53 65 6c 65 63 74 65 64  | .UpdateSelected|
000072a0  46 6c 61 67 28 4c 6f 63  2c 4e 2c a3 29 0d 1e f0  |Flag(Loc,N,.)...|
000072b0  05 e1 0d 1e fa 05 3a 0d  1f 04 4f f4 20 2d 2d 2d  |......:...O. ---|
000072c0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00007300  2d 2d 2d 2d 2d 2d 0d 1f  0e 2c f4 20 53 70 65 63  |------...,. Spec|
00007310  69 61 6c 20 72 6f 75 74  69 6e 65 73 20 66 6f 72  |ial routines for|
00007320  20 74 68 69 73 20 70 72  6f 67 72 61 6d 20 6f 6e  | this program on|
00007330  6c 79 0d 1f 18 4f f4 20  2d 2d 2d 2d 2d 2d 2d 2d  |ly...O. --------|
00007340  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00007380  2d 0d 1f 22 05 3a 0d 1f  2c 0c dd 20 f2 44 6f 4d  |-..".:..,.. .DoM|
00007390  61 67 0d 1f 36 4f 58 45  69 67 46 61 63 74 6f 72  |ag..6OXEigFactor|
000073a0  3d a4 4d 6f 64 65 49 6e  66 6f 28 22 58 45 69 67  |=.ModeInfo("XEig|
000073b0  46 61 63 74 6f 72 22 2c  2d 31 29 3a 59 45 69 67  |Factor",-1):YEig|
000073c0  46 61 63 74 6f 72 3d a4  4d 6f 64 65 49 6e 66 6f  |Factor=.ModeInfo|
000073d0  28 22 59 45 69 67 46 61  63 74 6f 72 22 2c 2d 31  |("YEigFactor",-1|
000073e0  29 0d 1f 40 23 c8 99 20  22 57 69 6d 70 5f 47 65  |)..@#.. "Wimp_Ge|
000073f0  74 50 6f 69 6e 74 65 72  49 6e 66 6f 22 2c 2c 42  |tPointerInfo",,B|
00007400  6c 6f 63 6b 0d 1f 4a 17  58 3d 42 6c 6f 63 6b 21  |lock..J.X=Block!|
00007410  30 3a 59 3d 42 6c 6f 63  6b 21 34 0d 1f 54 26 f4  |0:Y=Block!4..T&.|
00007420  20 53 65 74 20 62 61 63  6b 67 72 6f 75 6e 64 20  | Set background |
00007430  74 6f 20 62 6f 72 64 65  72 20 63 6f 6c 6f 75 72  |to border colour|
00007440  3a 0d 1f 5e 26 c8 99 20  22 4f 53 5f 52 65 61 64  |:..^&.. "OS_Read|
00007450  50 61 6c 65 74 74 65 22  2c 2c 32 34 20 b8 20 2c  |Palette",,24 . ,|
00007460  2c 42 6f 72 64 65 72 0d  1f 68 2d c8 99 20 22 43  |,Border..h-.. "C|
00007470  6f 6c 6f 75 72 54 72 61  6e 73 5f 53 65 74 47 43  |olourTrans_SetGC|
00007480  4f 4c 22 2c 42 6f 72 64  65 72 2c 2c 2c 31 32 38  |OL",Border,,,128|
00007490  2b 32 35 36 0d 1f 72 26  f4 20 32 35 36 20 73 65  |+256..r&. 256 se|
000074a0  74 73 20 64 69 74 68 65  72 69 6e 67 2c 20 69 66  |ts dithering, if|
000074b0  20 61 76 61 69 6c 61 62  6c 65 0d 1f 7c 43 c8 99  | available..|C..|
000074c0  20 22 4f 53 5f 53 70 72  69 74 65 4f 70 22 2c 32  | "OS_SpriteOp",2|
000074d0  35 36 2b 31 36 2c 53 6c  6f 74 45 6e 64 2c 22 6d  |56+16,SlotEnd,"m|
000074e0  61 67 22 2c 30 2c 58 2d  32 30 30 2c 59 2d 32 30  |ag",0,X-200,Y-20|
000074f0  30 2c 58 2b 31 39 38 2c  59 2b 31 39 38 0d 1f 86  |0,X+198,Y+198...|
00007500  39 c8 99 20 22 4f 53 5f  53 70 72 69 74 65 4f 70  |9.. "OS_SpriteOp|
00007510  22 2c 32 35 36 2b 36 30  2c 53 6c 6f 74 45 6e 64  |",256+60,SlotEnd|
00007520  2c 22 6d 61 67 22 2c 30  20 b8 20 72 30 2c 72 31  |,"mag",0 . r0,r1|
00007530  2c 72 32 2c 72 33 0d 1f  90 10 e7 20 42 6c 61 6e  |,r2,r3..... Blan|
00007540  6b 4d 61 67 20 8c 0d 1f  9a 2b 20 20 c8 99 20 22  |kMag ....+  .. "|
00007550  43 6f 6c 6f 75 72 54 72  61 6e 73 5f 53 65 74 47  |ColourTrans_SetG|
00007560  43 4f 4c 22 2c 42 6f 72  64 65 72 2c 2c 2c 32 35  |COL",Border,,,25|
00007570  36 0d 1f a4 42 20 20 f4  20 53 65 74 20 62 6c 61  |6...B  . Set bla|
00007580  6e 6b 69 6e 67 20 72 65  63 74 61 6e 67 6c 65 20  |nking rectangle |
00007590  74 6f 20 62 65 20 74 68  65 20 73 61 6d 65 20 61  |to be the same a|
000075a0  73 20 74 68 65 20 62 6f  72 64 65 72 20 63 6f 6c  |s the border col|
000075b0  6f 75 72 0d 1f ae 65 20  20 42 6c 6f 63 6b 21 30  |our...e  Block!0|
000075c0  3d 4d 61 67 6e 69 66 69  65 72 3a c8 99 20 22 57  |=Magnifier:.. "W|
000075d0  69 6d 70 5f 47 65 74 57  69 6e 64 6f 77 53 74 61  |imp_GetWindowSta|
000075e0  74 65 22 2c 2c 42 6c 6f  63 6b 3a 58 4c 3d 42 6c  |te",,Block:XL=Bl|
000075f0  6f 63 6b 21 34 3a 59 42  3d 42 6c 6f 63 6b 21 38  |ock!4:YB=Block!8|
00007600  3a 58 52 3d 42 6c 6f 63  6b 21 31 32 3a 59 54 3d  |:XR=Block!12:YT=|
00007610  42 6c 6f 63 6b 21 31 36  0d 1f b8 2d 20 20 c8 93  |Block!16...-  ..|
00007620  20 c8 90 20 58 4c 2d 58  2b 32 30 31 2c 59 42 2d  | .. XL-X+201,YB-|
00007630  59 2b 32 30 31 2c 58 52  2d 58 4c 2d 32 2c 59 54  |Y+201,XR-XL-2,YT|
00007640  2d 59 42 2d 32 0d 1f c2  05 cd 0d 1f cc 0d e7 20  |-YB-2.......... |
00007650  58 48 61 69 72 20 8c 0d  1f d6 32 20 20 c8 99 20  |XHair ....2  .. |
00007660  22 57 69 6d 70 5f 53 65  74 43 6f 6c 6f 75 72 22  |"Wimp_SetColour"|
00007670  2c 28 34 3c 3c 34 29 3a  f4 20 53 65 74 20 47 43  |,(4<<4):. Set GC|
00007680  4f 4c 20 61 63 74 69 6f  6e 0d 1f e0 17 20 20 ec  |OL action....  .|
00007690  20 32 30 30 2c 30 3a df  20 32 30 30 2c 34 30 30  | 200,0:. 200,400|
000076a0  0d 1f ea 17 20 20 ec 20  30 2c 32 30 30 3a df 20  |....  . 0,200:. |
000076b0  34 30 30 2c 32 30 30 0d  1f f4 05 cd 0d 1f fe 20  |400,200........ |
000076c0  c8 99 20 22 4f 53 5f 53  70 72 69 74 65 4f 70 22  |.. "OS_SpriteOp"|
000076d0  2c 72 30 2c 72 31 2c 72  32 2c 72 33 0d 20 08 44  |,r0,r1,r2,r3. .D|
000076e0  42 6c 6f 63 6b 21 30 3d  4d 61 67 6e 69 66 69 65  |Block!0=Magnifie|
000076f0  72 3a 42 6c 6f 63 6b 21  34 3d 30 3a 42 6c 6f 63  |r:Block!4=0:Bloc|
00007700  6b 21 38 3d 2d 34 30 30  3a 42 6c 6f 63 6b 21 31  |k!8=-400:Block!1|
00007710  32 3d 34 30 30 3a 42 6c  6f 63 6b 21 31 36 3d 30  |2=400:Block!16=0|
00007720  0d 20 12 29 c8 99 20 22  57 69 6d 70 5f 55 70 64  |. .).. "Wimp_Upd|
00007730  61 74 65 57 69 6e 64 6f  77 22 2c 2c 42 6c 6f 63  |ateWindow",,Bloc|
00007740  6b 20 b8 20 66 6c 61 67  25 0d 20 1c 0c c8 95 20  |k . flag%. .... |
00007750  66 6c 61 67 25 0d 20 26  c3 20 20 c8 99 20 22 4f  |flag%. &.  .. "O|
00007760  53 5f 53 70 72 69 74 65  4f 70 22 2c 32 35 36 2b  |S_SpriteOp",256+|
00007770  35 32 2c 53 6c 6f 74 45  6e 64 2c 22 6d 61 67 22  |52,SlotEnd,"mag"|
00007780  2c 42 6c 6f 63 6b 21 34  2d 28 28 32 30 30 2a 53  |,Block!4-((200*S|
00007790  63 61 6c 65 21 30 29 2f  53 63 61 6c 65 21 38 29  |cale!0)/Scale!8)|
000077a0  2b 32 30 32 2d 28 28 53  63 61 6c 65 21 30 2f 53  |+202-((Scale!0/S|
000077b0  63 61 6c 65 21 38 29 2a  32 5e 58 45 69 67 46 61  |cale!8)*2^XEigFa|
000077c0  63 74 6f 72 29 2f 32 2c  42 6c 6f 63 6b 21 38 2d  |ctor)/2,Block!8-|
000077d0  28 28 32 30 30 2a 53 63  61 6c 65 21 34 29 2f 53  |((200*Scale!4)/S|
000077e0  63 61 6c 65 21 31 32 29  2b 32 30 32 2d 28 28 53  |cale!12)+202-((S|
000077f0  63 61 6c 65 21 34 2f 53  63 61 6c 65 21 31 32 29  |cale!4/Scale!12)|
00007800  2a 32 5e 59 45 69 67 46  61 63 74 6f 72 29 2f 32  |*2^YEigFactor)/2|
00007810  2c 30 2c 53 63 61 6c 65  0d 20 30 2b 20 20 c8 99  |,0,Scale. 0+  ..|
00007820  20 22 57 69 6d 70 5f 47  65 74 52 65 63 74 61 6e  | "Wimp_GetRectan|
00007830  67 6c 65 22 2c 2c 42 6c  6f 63 6b 20 b8 20 66 6c  |gle",,Block . fl|
00007840  61 67 25 0d 20 3a 05 ce  0d 20 44 05 e1 0d 20 4e  |ag%. :... D... N|
00007850  05 3a 0d 20 58 16 dd 20  f2 43 72 65 61 74 65 4d  |.:. X.. .CreateM|
00007860  61 67 53 70 72 69 74 65  0d 20 62 15 f2 4d 69 6e  |agSprite. b..Min|
00007870  69 6d 69 73 65 57 69 6d  70 53 6c 6f 74 0d 20 6c  |imiseWimpSlot. l|
00007880  07 20 20 3a 0d 20 76 4f  58 45 69 67 46 61 63 74  |.  :. vOXEigFact|
00007890  6f 72 3d a4 4d 6f 64 65  49 6e 66 6f 28 22 58 45  |or=.ModeInfo("XE|
000078a0  69 67 46 61 63 74 6f 72  22 2c 2d 31 29 3a 59 45  |igFactor",-1):YE|
000078b0  69 67 46 61 63 74 6f 72  3d a4 4d 6f 64 65 49 6e  |igFactor=.ModeIn|
000078c0  66 6f 28 22 59 45 69 67  46 61 63 74 6f 72 22 2c  |fo("YEigFactor",|
000078d0  2d 31 29 0d 20 80 76 58  50 69 78 65 6c 73 3d 28  |-1). .vXPixels=(|
000078e0  32 2a 32 5e 58 45 69 67  46 61 63 74 6f 72 29 2b  |2*2^XEigFactor)+|
000078f0  28 34 30 30 2f 28 32 5e  58 45 69 67 46 61 63 74  |(400/(2^XEigFact|
00007900  6f 72 29 29 3a 59 50 69  78 65 6c 73 3d 28 32 2a  |or)):YPixels=(2*|
00007910  32 5e 59 45 69 67 46 61  63 74 6f 72 29 2b 28 34  |2^YEigFactor)+(4|
00007920  30 30 2f 28 32 5e 59 45  69 67 46 61 63 74 6f 72  |00/(2^YEigFactor|
00007930  29 29 3a 50 69 78 65 6c  73 3d 58 50 69 78 65 6c  |)):Pixels=XPixel|
00007940  73 2a 59 50 69 78 65 6c  73 0d 20 8a 3f 53 70 72  |s*YPixels. .?Spr|
00007950  69 74 65 42 79 74 65 73  3d 28 50 69 78 65 6c 73  |iteBytes=(Pixels|
00007960  2a 28 a4 4d 6f 64 65 49  6e 66 6f 28 22 42 50 50  |*(.ModeInfo("BPP|
00007970  22 2c 2d 31 29 2f 38 29  29 2b 28 36 2a 59 50 69  |",-1)/8))+(6*YPi|
00007980  78 65 6c 73 29 2b 36 30  0d 20 94 5e f4 20 3d 20  |xels)+60. .^. = |
00007990  50 69 78 65 6c 73 2a 28  62 69 74 73 20 70 65 72  |Pixels*(bits per|
000079a0  20 70 69 78 65 6c 2f 38  29 20 2b 20 36 20 62 79  | pixel/8) + 6 by|
000079b0  74 65 73 20 77 61 73 74  61 67 65 20 70 65 72 20  |tes wastage per |
000079c0  72 6f 77 20 2b 20 36 30  20 66 6f 72 20 73 70 72  |row + 60 for spr|
000079d0  69 74 65 20 63 6f 6e 74  72 6f 6c 20 61 72 65 61  |ite control area|
000079e0  20 62 6c 6f 63 6b 0d 20  9e 07 20 20 3a 0d 20 a8  | block. ..  :. .|
000079f0  b9 e7 20 a4 41 6c 6c 6f  63 61 74 65 4d 65 6d 6f  |.. .AllocateMemo|
00007a00  72 79 28 53 70 72 69 74  65 42 79 74 65 73 2b 41  |ry(SpriteBytes+A|
00007a10  70 70 53 69 7a 65 29 3d  30 20 8c 20 4d 61 67 45  |ppSize)=0 . MagE|
00007a20  72 72 6f 72 3d b9 3a f2  43 6c 6f 73 65 28 4d 61  |rror=.:.Close(Ma|
00007a30  67 6e 69 66 69 65 72 29  3a 85 20 39 39 39 39 2c  |gnifier):. 9999,|
00007a40  22 54 68 65 72 65 20 69  73 20 6e 6f 74 20 65 6e  |"There is not en|
00007a50  6f 75 67 68 20 6d 65 6d  6f 72 79 20 74 6f 20 6d  |ough memory to m|
00007a60  61 6b 65 20 74 68 65 20  6d 61 67 6e 69 66 69 65  |ake the magnifie|
00007a70  72 20 73 70 72 69 74 65  2e 20 50 6c 65 61 73 65  |r sprite. Please|
00007a80  20 66 72 65 65 20 73 6f  6d 65 20 6d 6f 72 65 20  | free some more |
00007a90  6d 65 6d 6f 72 79 20 61  6e 64 20 74 72 79 20 61  |memory and try a|
00007aa0  67 61 69 6e 2e 22 0d 20  b2 07 20 20 3a 0d 20 bc  |gain.". ..  :. .|
00007ab0  58 53 6c 6f 74 45 6e 64  21 30 3d 53 70 72 69 74  |XSlotEnd!0=Sprit|
00007ac0  65 42 79 74 65 73 3a 53  6c 6f 74 45 6e 64 21 38  |eBytes:SlotEnd!8|
00007ad0  3d 31 36 3a c8 99 20 22  4f 53 5f 53 70 72 69 74  |=16:.. "OS_Sprit|
00007ae0  65 4f 70 22 2c 32 35 36  2b 39 2c 53 6c 6f 74 45  |eOp",256+9,SlotE|
00007af0  6e 64 3a f4 20 49 6e 69  74 20 73 70 72 69 74 65  |nd:. Init sprite|
00007b00  20 61 72 65 61 0d 20 c6  79 c8 99 20 22 4f 53 5f  | area. .y.. "OS_|
00007b10  53 70 72 69 74 65 4f 70  22 2c 32 35 36 2b 31 35  |SpriteOp",256+15|
00007b20  2c 53 6c 6f 74 45 6e 64  2c 22 6d 61 67 22 2c 30  |,SlotEnd,"mag",0|
00007b30  2c 28 32 2a 32 5e 58 45  69 67 46 61 63 74 6f 72  |,(2*2^XEigFactor|
00007b40  29 2b 28 34 30 30 2f 28  32 5e 58 45 69 67 46 61  |)+(400/(2^XEigFa|
00007b50  63 74 6f 72 29 29 2c 28  32 2a 32 5e 59 45 69 67  |ctor)),(2*2^YEig|
00007b60  46 61 63 74 6f 72 29 2b  28 34 30 30 2f 28 32 5e  |Factor)+(400/(2^|
00007b70  59 45 69 67 46 61 63 74  6f 72 29 29 2c eb 0d 20  |YEigFactor)),.. |
00007b80  d0 23 f4 20 43 72 65 61  74 65 20 69 6e 69 74 69  |.#. Create initi|
00007b90  61 6c 6c 79 20 65 6d 70  74 79 20 73 70 72 69 74  |ally empty sprit|
00007ba0  65 0d 20 da 05 e1 0d 20  e4 05 3a 0d 20 ee 13 dd  |e. .... ..:. ...|
00007bb0  20 a4 53 61 76 65 53 65  74 74 69 6e 67 73 0d 20  | .SaveSettings. |
00007bc0  f8 07 ea 20 85 0d 21 02  3c ee 20 85 20 ea 20 f7  |... ..!.<. . . .|
00007bd0  20 85 3a f2 43 6c 6f 73  65 46 69 6c 65 49 66 50  | .:.CloseFileIfP|
00007be0  6f 73 73 28 44 61 74 61  29 3a 3d a3 3a f4 20 45  |oss(Data):=.:. E|
00007bf0  72 72 6f 72 20 77 72 69  74 69 6e 67 20 66 69 6c  |rror writing fil|
00007c00  65 0d 21 0c 07 20 20 3a  0d 21 16 29 20 20 44 61  |e.!..  :.!.)  Da|
00007c10  74 61 3d ae 20 28 22 3c  43 6c 6f 73 65 56 69 65  |ta=. ("<CloseVie|
00007c20  77 24 44 69 72 3e 2e 53  65 74 74 69 6e 67 73 22  |w$Dir>.Settings"|
00007c30  29 0d 21 20 3e 20 20 d5  23 44 61 74 61 2c 22 7c  |).! >  .#Data,"||
00007c40  20 58 20 61 6e 64 20 59  20 67 72 69 64 20 63 6f  | X and Y grid co|
00007c50  6f 72 64 69 6e 61 74 65  73 20 6f 66 20 4d 61 67  |ordinates of Mag|
00007c60  6e 69 66 69 65 72 20 77  69 6e 64 6f 77 3a 22 0d  |nifier window:".|
00007c70  21 2a 19 20 20 d5 23 44  61 74 61 2c c3 28 58 50  |!*.  .#Data,.(XP|
00007c80  6f 73 69 74 69 6f 6e 29  0d 21 34 19 20 20 d5 23  |osition).!4.  .#|
00007c90  44 61 74 61 2c c3 28 59  50 6f 73 69 74 69 6f 6e  |Data,.(YPosition|
00007ca0  29 0d 21 3e 27 20 20 d5  23 44 61 74 61 2c 22 7c  |).!>'  .#Data,"||
00007cb0  20 4d 61 67 6e 69 66 69  63 61 74 69 6f 6e 20 66  | Magnification f|
00007cc0  61 63 74 6f 72 73 3a 22  0d 21 48 21 20 20 d5 23  |actors:".!H!  .#|
00007cd0  44 61 74 61 2c a4 52 65  61 64 49 63 6f 6e 53 74  |Data,.ReadIconSt|
00007ce0  72 28 5a 6f 6f 6d 2c 30  29 0d 21 52 21 20 20 d5  |r(Zoom,0).!R!  .|
00007cf0  23 44 61 74 61 2c a4 52  65 61 64 49 63 6f 6e 53  |#Data,.ReadIconS|
00007d00  74 72 28 5a 6f 6f 6d 2c  31 29 0d 21 5c 3d 20 20  |tr(Zoom,1).!\=  |
00007d10  d5 23 44 61 74 61 2c 22  7c 20 53 68 6f 77 20 63  |.#Data,"| Show c|
00007d20  72 6f 73 73 2d 68 61 69  72 73 20 28 2d 31 20 66  |ross-hairs (-1 f|
00007d30  6f 72 20 54 52 55 45 2c  20 30 20 66 6f 72 20 46  |or TRUE, 0 for F|
00007d40  41 4c 53 45 29 3a 22 0d  21 66 26 20 20 d5 23 44  |ALSE):".!f&  .#D|
00007d50  61 74 61 2c c3 28 a4 53  65 6c 65 63 74 65 64 53  |ata,.(.SelectedS|
00007d60  74 61 74 65 28 5a 6f 6f  6d 2c 37 29 29 0d 21 70  |tate(Zoom,7)).!p|
00007d70  44 20 20 d5 23 44 61 74  61 2c 22 7c 20 52 65 63  |D  .#Data,"| Rec|
00007d80  75 72 73 69 76 65 20 6d  61 67 6e 69 66 69 63 61  |ursive magnifica|
00007d90  74 69 6f 6e 20 28 2d 31  20 66 6f 72 20 54 52 55  |tion (-1 for TRU|
00007da0  45 2c 20 30 20 66 6f 72  20 46 41 4c 53 45 29 3a  |E, 0 for FALSE):|
00007db0  22 0d 21 7a 26 20 20 d5  23 44 61 74 61 2c c3 28  |".!z&  .#Data,.(|
00007dc0  a4 53 65 6c 65 63 74 65  64 53 74 61 74 65 28 5a  |.SelectedState(Z|
00007dd0  6f 6f 6d 2c 38 29 29 0d  21 84 0c 20 20 d9 23 44  |oom,8)).!..  .#D|
00007de0  61 74 61 0d 21 8e 30 20  20 ff 28 22 53 65 74 74  |ata.!.0  .("Sett|
00007df0  79 70 65 20 3c 43 6c 6f  73 65 56 69 65 77 24 44  |ype <CloseView$D|
00007e00  69 72 3e 2e 53 65 74 74  69 6e 67 73 20 54 65 78  |ir>.Settings Tex|
00007e10  74 22 29 0d 21 98 07 20  20 3a 0d 21 a2 06 3d b9  |t").!..  :.!..=.|
00007e20  0d 21 ac 05 3a 0d 21 b6  13 dd 20 a4 4c 6f 61 64  |.!..:.!... .Load|
00007e30  53 65 74 74 69 6e 67 73  0d 21 c0 07 ea 20 85 0d  |Settings.!... ..|
00007e40  21 ca 4f ee 20 85 20 ea  20 f7 20 85 3a f2 43 6c  |!.O. . . . .:.Cl|
00007e50  6f 73 65 46 69 6c 65 49  66 50 6f 73 73 28 44 61  |oseFileIfPoss(Da|
00007e60  74 61 29 3a 3d a3 3a f4  20 27 53 65 74 74 69 6e  |ta):=.:. 'Settin|
00007e70  67 73 27 20 66 69 6c 65  20 69 73 20 64 61 6d 61  |gs' file is dama|
00007e80  67 65 64 20 6f 72 20 6d  69 73 73 69 6e 67 0d 21  |ged or missing.!|
00007e90  d4 07 20 20 3a 0d 21 de  27 20 20 44 61 74 61 3d  |..  :.!.'  Data=|
00007ea0  8e 20 22 3c 43 6c 6f 73  65 56 69 65 77 24 44 69  |. "<CloseView$Di|
00007eb0  72 3e 2e 53 65 74 74 69  6e 67 73 22 0d 21 e8 1d  |r>.Settings".!..|
00007ec0  20 20 58 50 6f 73 69 74  69 6f 6e 3d bb 28 a4 4e  |  XPosition=.(.N|
00007ed0  65 78 74 45 6e 74 72 79  29 0d 21 f2 1d 20 20 59  |extEntry).!..  Y|
00007ee0  50 6f 73 69 74 69 6f 6e  3d bb 28 a4 4e 65 78 74  |Position=.(.Next|
00007ef0  45 6e 74 72 79 29 0d 21  fc 24 20 20 f2 55 70 64  |Entry).!.$  .Upd|
00007f00  61 74 65 49 63 6f 6e 28  5a 6f 6f 6d 2c 30 2c a4  |ateIcon(Zoom,0,.|
00007f10  4e 65 78 74 45 6e 74 72  79 29 0d 22 06 24 20 20  |NextEntry).".$  |
00007f20  f2 55 70 64 61 74 65 49  63 6f 6e 28 5a 6f 6f 6d  |.UpdateIcon(Zoom|
00007f30  2c 31 2c a4 4e 65 78 74  45 6e 74 72 79 29 0d 22  |,1,.NextEntry)."|
00007f40  10 2f 20 20 f2 55 70 64  61 74 65 53 65 6c 65 63  |./  .UpdateSelec|
00007f50  74 65 64 46 6c 61 67 28  5a 6f 6f 6d 2c 37 2c bb  |tedFlag(Zoom,7,.|
00007f60  28 a4 4e 65 78 74 45 6e  74 72 79 29 29 0d 22 1a  |(.NextEntry)).".|
00007f70  2f 20 20 f2 55 70 64 61  74 65 53 65 6c 65 63 74  |/  .UpdateSelect|
00007f80  65 64 46 6c 61 67 28 5a  6f 6f 6d 2c 38 2c bb 28  |edFlag(Zoom,8,.(|
00007f90  a4 4e 65 78 74 45 6e 74  72 79 29 29 0d 22 24 0c  |.NextEntry))."$.|
00007fa0  20 20 d9 23 44 61 74 61  0d 22 2e 07 20 20 3a 0d  |  .#Data."..  :.|
00007fb0  22 38 5a 20 20 53 63 61  6c 65 21 30 3d a4 52 65  |"8Z  Scale!0=.Re|
00007fc0  61 64 49 63 6f 6e 28 5a  6f 6f 6d 2c 30 29 3a 53  |adIcon(Zoom,0):S|
00007fd0  63 61 6c 65 21 34 3d 53  63 61 6c 65 21 30 3a 53  |cale!4=Scale!0:S|
00007fe0  63 61 6c 65 21 38 3d a4  52 65 61 64 49 63 6f 6e  |cale!8=.ReadIcon|
00007ff0  28 5a 6f 6f 6d 2c 31 29  3a 53 63 61 6c 65 21 31  |(Zoom,1):Scale!1|
00008000  32 3d 53 63 61 6c 65 21  38 0d 22 42 22 20 20 58  |2=Scale!8."B"  X|
00008010  48 61 69 72 3d a4 53 65  6c 65 63 74 65 64 53 74  |Hair=.SelectedSt|
00008020  61 74 65 28 5a 6f 6f 6d  2c 37 29 0d 22 4c 28 20  |ate(Zoom,7)."L( |
00008030  20 42 6c 61 6e 6b 4d 61  67 3d ac 28 a4 53 65 6c  | BlankMag=.(.Sel|
00008040  65 63 74 65 64 53 74 61  74 65 28 5a 6f 6f 6d 2c  |ectedState(Zoom,|
00008050  37 29 29 0d 22 56 62 20  20 e7 20 58 50 6f 73 69  |7))."Vb  . XPosi|
00008060  74 69 6f 6e 3c 3e 2d 31  20 80 20 59 50 6f 73 69  |tion<>-1 . YPosi|
00008070  74 69 6f 6e 3c 3e 2d 31  20 8c 20 f2 55 70 64 61  |tion<>-1 . .Upda|
00008080  74 65 53 65 6c 65 63 74  65 64 46 6c 61 67 28 4c  |teSelectedFlag(L|
00008090  6f 63 2c 36 2b 28 28 35  2a 58 50 6f 73 69 74 69  |oc,6+((5*XPositi|
000080a0  6f 6e 29 2b 28 34 2d 59  50 6f 73 69 74 69 6f 6e  |on)+(4-YPosition|
000080b0  29 29 2c b9 29 0d 22 60  07 20 20 3a 0d 22 6a 06  |)),.)."`.  :."j.|
000080c0  3d b9 0d 22 74 05 3a 0d  22 7e 16 dd 20 f2 44 65  |=.."t.:."~.. .De|
000080d0  66 61 75 6c 74 53 65 74  74 69 6e 67 73 0d 22 88  |faultSettings.".|
000080e0  0e 42 6c 61 6e 6b 4d 61  67 3d a3 0d 22 92 0b 58  |.BlankMag=.."..X|
000080f0  48 61 69 72 3d b9 0d 22  9c 2c 53 63 61 6c 65 21  |Hair=..".,Scale!|
00008100  30 3d 32 3a 53 63 61 6c  65 21 34 3d 32 3a 53 63  |0=2:Scale!4=2:Sc|
00008110  61 6c 65 21 38 3d 31 3a  53 63 61 6c 65 21 31 32  |ale!8=1:Scale!12|
00008120  3d 31 0d 22 a6 1b 58 50  6f 73 69 74 69 6f 6e 3d  |=1."..XPosition=|
00008130  30 3a 59 50 6f 73 69 74  69 6f 6e 3d 34 0d 22 b0  |0:YPosition=4.".|
00008140  1b f2 55 70 64 61 74 65  49 63 6f 6e 28 5a 6f 6f  |..UpdateIcon(Zoo|
00008150  6d 2c 30 2c 22 32 22 29  0d 22 ba 1b f2 55 70 64  |m,0,"2")."...Upd|
00008160  61 74 65 49 63 6f 6e 28  5a 6f 6f 6d 2c 31 2c 22  |ateIcon(Zoom,1,"|
00008170  31 22 29 0d 22 c4 25 f2  55 70 64 61 74 65 53 65  |1").".%.UpdateSe|
00008180  6c 65 63 74 65 64 46 6c  61 67 28 5a 6f 6f 6d 2c  |lectedFlag(Zoom,|
00008190  37 2c 58 48 61 69 72 29  0d 22 ce 2a f2 55 70 64  |7,XHair).".*.Upd|
000081a0  61 74 65 53 65 6c 65 63  74 65 64 46 6c 61 67 28  |ateSelectedFlag(|
000081b0  5a 6f 6f 6d 2c 38 2c ac  20 42 6c 61 6e 6b 4d 61  |Zoom,8,. BlankMa|
000081c0  67 29 0d 22 d8 3e f2 55  70 64 61 74 65 53 65 6c  |g).".>.UpdateSel|
000081d0  65 63 74 65 64 46 6c 61  67 28 4c 6f 63 2c 36 2b  |ectedFlag(Loc,6+|
000081e0  28 28 35 2a 58 50 6f 73  69 74 69 6f 6e 29 2b 28  |((5*XPosition)+(|
000081f0  34 2d 59 50 6f 73 69 74  69 6f 6e 29 29 2c b9 29  |4-YPosition)),.)|
00008200  0d 22 e2 05 e1 0d ff                              |.".....|
00008207