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

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

 � >!RunImage for Coordinates
:
@VersionNumber$="1�02 (18 June 1993)":Taskname$="Coordinates"
(Exit=�:Startup=�:Done=�
2DoModeChange=�
<:
F� Block 256,MenuHelp 16
P/IndMenuMax=64:� IndirectMenuText IndMenuMax
Z:� Templates 1632,InfoInd 190,LocInd 592,CoordsInd 1500
d� IBMenu 76,MainMenu 100
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 Coordinates$RISCOS 3
�9*RMEnsure UtilityModule 3.00 Set Coordinates$RISCOS 2
�\ș "XOS_ReadVarVal","Coordinates$RISCOS",Block,256,0,0 � ,,len:Block?len=13:wimp$=$Block
�� wimp$<>"3" � wimp$="2"
�*Unset Coordinates$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,"<Coordinates$Dir>.Sprites" � ,,len
6�� Sprites len+16:!Sprites=len+16:Sprites!4=0:Sprites!8=16:Sprites!12=16:ș "OS_SpriteOp",256+10,Sprites,"<Coordinates$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
�:
�9ș "Wimp_OpenTemplate",,"<Coordinates$Dir>.Templates"
�Eș "Wimp_LoadTemplate",,Templates,InfoInd,InfoInd+190,-1,"Info",0
�,ș "Wimp_CreateWindow",,Templates � Info
�\ș "Wimp_LoadTemplate",,Templates,LocInd,LocInd+592,-1,"WindowXY",0:Templates!64=Sprites
�+ș "Wimp_CreateWindow",,Templates � Loc
�Lș "Wimp_LoadTemplate",,Templates,CoordsInd,CoordsInd+1500,-1,"Coords",0
�.ș "Wimp_CreateWindow",,Templates � Coords
ș "Wimp_CloseTemplate"
:
�BuildMenus
&:
0� OmniDesk=0 �
:   � Put Icon on the icon-bar
D  Block!0=-1
N1  Block!4=0:Block!8=0:Block!12=68:Block!16=68
X2  Block!20=&17003002:$(Block+24)="!Coords"+�13
b+  ș "Wimp_CreateIcon",,Block � IconBar
l�
v:
��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
�
2  ș "Wimp_Poll",%1100000110000,Block � Reason
 &  ș "Interface_Poll",Reason,,Task
*4  ș "Interface_PreProcessKey",Reason,Block,Task
4  Ȏ Reason �
>.    � 0 : � �OpenState(Coords) � �DoCoords
H\             � DoModeChange � � �OpenState(Coords) � �Open(Coords,�,XPosition,YPosition)
R    � 1 : �Redraw
\)    � 2 : ș "Wimp_OpenWindow",,Block
f*    � 3 : ș "Wimp_CloseWindow",,Block
p              � Exit � Done=�
z    � 6 : �MouseButton
�    � 8 : �KeyPressed
�    � 9 : �DecodeMenu
�$    � 17,18,19 : �RecieveMessage
�  �
�
� Done
��SayGoodbye
��
�:
�� �Error
�Click=0:Block!0=�:Ȏ � �
�  � 9999:� Custom error
�    $(Block+4)=�$+�0
�@    ș "Wimp_ReportError",Block,17,"Notice from Coordinates"
C    � Exit � Click=2:�SayGoodbye:� Quit if called from OmniDesk
  
v    $(Block+4)=�$+" (internal error code "+Þ+"). Click on OK to continue, or Cancel to terminate the program."+�0
$8    ș "Wimp_ReportError",Block,3,Taskname$ � ,Click
.�
8� Click=2 � �SayGoodbye:�
B�
L:
V.� �Open(WindowHandle,TopOfStack,across,up)
`Block!0=WindowHandle
j#ș "Wimp_GetWindowState",,Block
tJ� (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
J� positions across (left, mid-left, centre, mid-right, right) and five

G� positions up (bottom of screen, above icon-bar, centre of screen,
+� centre top of screen, top of screen).
  :
(CXpixels=�ModeInfo("XPixels",-1):Ypixels=�ModeInfo("YPixels",-1)
2OXEigFactor=�ModeInfo("XEigFactor",-1):YEigFactor=�ModeInfo("YEigFactor",-1)
<  :
F8top=Block!16:right=Block!12:bot=Block!8:left=Block!4
PAș "Wimp_OpenWindow",,Block:ș "Wimp_GetWindowOutline",,Block
Z&TB=((Block!16)-top)/(2^YEigFactor)
d(VS=((Block!12)-right)/(2^XEigFactor)
n%HS=(bot-(Block!8))/(2^YEigFactor)
x&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))
-  � 2:y=HS+((Ypixels+1)-(height+TB+HS))/2
3  � 3:y=HS+(3*(((Ypixels+1)-(height+TB+HS))/4))
#  � 4:y=(Ypixels+1)-(height+TB)
"�
,(� Above coordinates position window.
6(� Now convert to screen coordinates:
@)x=x*(2^XEigFactor):y=y*(2^YEigFactor)
J;width=width*(2^XEigFactor):height=height*(2^YEigFactor)
TBlock!12=x+width:Block!4=x
^Block!16=y+height:Block!8=y
h�
r:
|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:
�@  � �OpenState(Coords) � �Open(Coords,�,XPosition,YPosition)
�  DoModeChange=�
��
�(ș "Wimp_RedrawWindow",,Block � flag
�ȕ flag
�*  ș "Interface_Render3dWindow",,Block
�*  ș "Wimp_GetRectangle",,Block � flag
�
�
:
&� �RecieveMessage
0Ȏ Block!16 �
:  � 0 : Done=�
D1  � 10: � OmniDesk=0 � �SaveDesktop(Block!20)
NE           � Only save if we have not been started up by OmniDesk
X  � &502 : �Help
b  � &400C1 : �ModeChange
l=  � UtilOpen : � $(Block+24)=Taskname$ � �OmniDeskCalling
v&  � UtilQuitting : � OmniDesk<>0 �
�8                        � Block!20=OmniDesk � Done=�
�                      �
�  � UtilReside : Exit=�
��
��
�:
�� �MouseButton
�1MouseX=Block!0:MouseY=Block!4:Buttons=Block!8
�!Window=Block!12:Icon=Block!16
�Ȏ Window �
�"  � -2:� Icon bar icon clicked
�    Ȏ Buttons �
�      � 1 : � Adjust
      � 2 : � Menu
9        M%=IBMenu:MenuX=MouseX:MenuY=MouseY:�MakeMenu
      � 4 : � Select
 /        �Open(Coords,�,XPosition,YPosition)
*	    �
4  � Coords
>    Ȏ Buttons �
H      � 1 : � Adjust
R      � 2 : � Menu
\1        M%=MainMenu:MenuX=MouseX:MenuY=MouseY
f        � wimp>=310 �
p`          � �$MainMenuTitle,1)="\" � $MainMenuTitle=�$MainMenuTitle,�($MainMenuTitle)-1)+�13
zC          � XPosition=4 � $MainMenuTitle="\"+$MainMenuTitle+�13
�
        �
�        �MakeMenu
�      � 4 : � Select
�	    �
�0  � Loc � Buttons<8:� Reposition main window
�    � Icon>=6 �
�,      XPosition=�ReadWindowLocation("X")
�,      YPosition=�ReadWindowLocation("Y")
�D      � �OpenState(Coords) � �Open(Coords,�,XPosition,YPosition)
�	    �
��
��
�:
	� �KeyPressed
	2Window=Block!0:Icon=Block!4:Character=Block!24
	Ȏ Window �
	$
  � 0:
	.  
	8&    ș "Wimp_ProcessKey",Character
	B�
	L�
	V:
	`� �DecodeMenu
	j*Sub0=Block!0:Sub1=Block!4:Sub2=Block!8
	tCloseMenu=�
	~Ȏ M% �
	�  � IBMenu:
	�    Ȏ Sub0 �
	�
      � 0
	�+        ș "Wimp_GetPointerInfo",,Block
	�<        ș "Wimp_CreateMenu",,Info,Block!0-24,Block!4+24
	�        CloseMenu=�
	�
      � 1
	�        Done=�
	�	    �
	�  � MainMenu:
	�    Ȏ Sub0 �
	�
      � 0
+        ș "Wimp_GetPointerInfo",,Block

<        ș "Wimp_CreateMenu",,Info,Block!0-24,Block!4+24
        CloseMenu=�

      � 1
(+        ș "Wimp_GetPointerInfo",,Block
2;        ș "Wimp_CreateMenu",,Loc,Block!0-24,Block!4+24
<        CloseMenu=�
F
      � 2
P\        � � �SaveSettings � � 9999,"An error occurred whilst writing the settings file."
Z	    �
d�
n#ș "Wimp_GetPointerInfo",,Block
x3� ((Block!8 � 1)=1) � (� CloseMenu) � �MakeMenu
��
�:
�O� -------------------------------------------------------------------------
�� Menu routines
�O� -------------------------------------------------------------------------
�:
�� �BuildMenus
�I� This procedure should only be visited once, since it contains DIMs.
�  :
�O� In the menu title strings below, if a "|" character is present it will be
�O� 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
�F� menu titles to be used (which were introduced with RISC OS 3.1).
  :
#IndirectMenuTextOffsetPointer=0
N� This points to a pool to be used by all menus for their indirected text.
"  :
,
M%=IBMenu
6JTitle$="Coordinates":� IBMenuTitle �(Title$)+1:$IBMenuTitle=Title$+�13
@�MenuInit(IBMenuTitle)
J�MenuItem("Info",0,Info)
T�MenuItem("Quit",128,-1)
^  :
hM%=MainMenu
rNTitle$="Coordinates":� MainMenuTitle �(Title$)+2:$MainMenuTitle=Title$+�13
|�MenuInit(MainMenuTitle)
��MenuItem("Info",2,Info)
�&�MenuItem("Window position",2,Loc)
�%�MenuItem("Save settings",128,-1)
��
�:
�� �MakeMenu
�� MenuX<0 � MenuX=0
�*� MenuY<184 � MenuY=184:� for icon bar
�7ș "Wimp_CreateMenu",,M%,MenuX-((36+M%!16)/2),MenuY
��
�:
�� �MenuInit(MenuTitle)
�� wimp>=310 �
7  A=�$MenuTitle,"|"):� A<>0 � ?(MenuTitle+(A-1))=32
  MenuMax=�($MenuTitle)
  M%!0=MenuTitle
&�
07  A=�$MenuTitle,"|"):� A<>0 � ?(MenuTitle+(A-1))=13
:   MenuMax=�(�$MenuTitle,12))
D  $M%=�$MenuTitle,12)
N�
X$M%?12=7:M%?13=2:M%?14=11:M%?15=0
bM%!16=MenuMax*16
lM%!20=44:M%!24=0
v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
�� �(Text$)<=12 �
�%  P%!8=&07003021:� Not indirected
�  $(P%+12)=Text$
��
�!  P%!8=&07003121:� Indirected
�:  P%!12=IndirectMenuText+IndirectMenuTextOffsetPointer
�  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

4>� MenuMax<�(Text$) � MenuMax=�(Text$):M%!16=(MenuMax+1)*16

>A� (Flags=128) � (wimp>=310) � M%!28=(((M%!28) � � 256) � 256)

H7  � Indirected menu titles for RISC OS 3.1 upwards.

R�

\:

fO� -------------------------------------------------------------------------

p)� Responses to incoming wimp messages

zO� -------------------------------------------------------------------------

�:

�� �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

� � aborting the desktop save.

�+�#File,"Run "+OurPathName$+OurFileName$

��

�:

�� �Help

�4Block!12=Block!8:Block!16=&503:HelpInfo=Block+20

�  :

�0� Block!32 gives window, Block!36 gives icon
  :
Ȏ Block!32 �
1  � -2:�Send("This is the Coordinates icon.")
$=          �Send("Click MENU for information or to quit.")
.C          �Send("Click SELECT to open the coordinates window.")
8  � Coords:
B    Ȏ Block!36 �
Lo      � 0,1,4,5,8,9:�Send("This area displays the pointer's screen coordinates in Operating System units.")
VS                       �Send("The origin is at the bottom left of the screen.")
`h      � 2,3,6,7,10,11:�Send("This area displays the pointer's screen coordinates in screen pixels.")
jU                         �Send("The origin is at the bottom left of the screen.")
t�      � 12,13,16,17,20,21:�Send("This area displays the coordinates of the pointer within a window in Operating System units.")
~�                         �Send("The origin of a window is usually at the top left of the work area, but this is not always true.")
�z      � 14,15,18,19,22,23:�Send("This area displays the handles of the window and icon (if any) beneath the pointer.")
�4       �Send("This is the Coordinates window.")
�:                �Send("Click MENU for the main menu.")
�	    �
�I  � Info:�Send("This window displays information about Coordinates.")
�\            �Send("Coordinates is a member of the OmniDesk Suite of desktop utilities.")
�  � Loc:
�
   Ȏ � �
�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
2    Ȏ M% �
<      � IBMenu:
F        � MenuHelp!4=-1 �
P          Ȏ MenuHelp!0 �
ZY            � 0:�Send("Move the pointer right to see information about Coordinates.")
d>            � 1:�Send("Click SELECT to quit Coordinates.")
nA             �Send("This is the Coordinates icon-bar menu.")
x          �
�
        �
�      � MainMenu:
�W        Direction$="right":� wimp>=310 � �(MainMenuTitle?0)="\" � Direction$="left"
�        Ȏ MenuHelp!0 �
�`          � 0:�Send("Move the pointer "+Direction$+" to see information about Coordinates.")
�w          � 1:�Send("Move the pointer "+Direction$+" to set the position of the coordinates window on the screen.")
�Z          � 2:�Send("Click SELECT or ADJUST to save the coordinates window position.")
�;           �Send("This is the Coordinates main menu.")
�
        �
�	    �
�  �
��
�  :
?HelpInfo=0
$Block!0=(HelpInfo+4-Block) � � 3
*ș "Wimp_SendMessage",17,Block,Block!4
"�
,:
6� �OmniHelpMessage(A$)
@;� A$="CLICK" � =�"open the coordinates window.",76)+�13
J� A$="DRAG" � =�"",76)+�13
T=""
^:
h� �Send(Text$)
r$HelpInfo=Text$+"|M"
|HelpInfo+=�(Text$)+2
��
�:
�� �OmniDeskCalling
�� OmniDesk=0 � �
�I� This first line is for if a broadcast message is received which was
�A� intended for a transient copy of the utility. A stand-alone
�?� instantiation of the utility should ignore such messages.
�Ȏ Block!20 �
�-  � 4:�Open(Coords,�,XPosition,YPosition)
��
��
�:
�� �ModeChange
DoModeChange=�
;� OmniDesk=0 � �UpdateIconForMode("!Coords",-2,IconBar)
�
&:
0O� -------------------------------------------------------------------------
:8� General non-specific useful routines (mostly wimp)
DO� -------------------------------------------------------------------------
N:
X � �UpdateIcon(Wndw,Icn,Txt$)
b:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
l� �(Txt$)>(Block!36)-1 �
v&  � ((Block!24) � (1<<9))=(1<<9) �
�    � Right-justified
�$    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$)
 �
*�
4:
>+� �UpdateIconColour(Wndw,Icn,FCol,BCol)
H� Change an icon's colours
R:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
\;� (((Block?27)>>4)=BCol) � (((Block?27) � 16)=FCol) � �
f'  � ^ Same colour, so don't change.
p:Block!12=(%11111111<<24):Block!8=(BCol<<28)+(FCol<<24)
z!ș "Wimp_SetIconState",,Block
��
�:
�)� �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
$�
.:
8� �SelectedState(Wndw,Icn)
B:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
L)� ((Block!24) � (1<<21))=(1<<21) � =�
V=�
`:
j� �ShadedState(Wndw,Icn)
t:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
~)� ((Block!24) � (1<<22))=(1<<22) � =�
�=�
�:
�� �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)
25� (!(Menu+28+(24*Item)+8) � (1<<22))=(1<<22) � =�
<=�
F:
P� �MenuTicked(Menu,Item)
Z'� (!(Menu+28+(24*Item)) � 1)=1 � =�
d=�
n:
x� �ReadIcon(Wndw,Icn)
� � Read numeric value of icon
�: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
66   var=-1:� Fall-through for a faulty input value
@�
J=var
T:
^+� �UpdateIconForMode(Appname$,Wndw,Icn)
hN� This procedure requires that ALL the icon sprites are defined in mode 20
rN� or mode 27 (which is equivalent) with a mask but no palette. They should
|N� still appear to have the expected resolutions and number of colours, i.e
�N� !Sprites23: two colours, high resolution, !Sprites (actually !Sprites24)
�L� 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
0>ș "OS_SpriteOp",256+29,iconsprite%,Appname$:� Create mask
:  :
D-� Paint sprite mask into iconsprite mask:
NQș "OS_SpriteOp",256+61,iconsprite%,Appname$,0 � r0,r1,r2,r3:� Output to mask
XUș "OS_SpriteOp",256+49,Sprites,Appname$+Extension$,0,0:� Paint mask from Sprites
b7� 4,128:�:� Invert to make mask the right way round
l6ș "OS_SpriteOp",r0,r1,r2,r3:� Reset screen output
v  :
�#� Paint sprite into iconsprite:
�\ș "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
4=WindowHandle
>:
H� �Initialise
R-AppSize=�-&8000:MinSize=AppSize:SlotEnd=�
\�
f:
p� �AllocateMemory(Required)
zSlotSize=�SlotSize(-1)
��� SlotSize<Required � NewSize=�SlotSize(Required):� NewSize<Required � SlotSize=�SlotSize(AppSize):=0:� Returns, indicating memory not claimed
�6� 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
$�
.:
8� �FindFileSize(FileName$)
B � FileName$="<Wimp$Scrap>" �
L:  ș "OS_File",15,FileName$,,,FileName$ � ,,,,FileSize
V�
`4  N=-1:�:N+=1:� �FileName$,�(FileName$)-N,1)="."
jB  PathName$=�FileName$,�(FileName$)-N):LeafName$=�FileName$,N)
t:  ș "OS_File",13,LeafName$,,,PathName$ � ,,,,FileSize
~�
�
=FileSize
�:
�� �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� -------------------------------------------------------------------------
(:
2� �DeclareToOmniDesk
</Block!0=208:Block!12=0:Block!16=UtilDeclare
FBlock!20=Task
P$(Block+24)=Taskname$
Z$(Block+44)=OurFileName$
d)$(Block+55)=�OmniHelpMessage("CLICK")
n)$(Block+132)=�OmniHelpMessage("DRAG")
x+ș "Wimp_SendMessage",17,Block,OmniDesk
��
�:
�� �SayGoodbye
�� OmniDesk<>0 �
�1  Block!0=24:Block!12=0:Block!16=UtilQuitting
�  Block!20=Task
�-  ș "Wimp_SendMessage",17,Block,OmniDesk
��
�!ș "Interface_CloseDown",Task
�&ș "Wimp_CloseDown",Task,&4B534154
��
�:
�� �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=�
6A=�Command$,"-Exit")
@� A<>0 � Exit=�
JA=�Command$,"-OmniDesk")
T� A=0 � =0
^=�(�Command$,A+9))
h:
r � �ReadWindowLocation(Axis$)
|H� Reads which radio icon (if any) is selected in the Window Position
�H� selector window and returns the axis coordinate (two calls needed)
�%� or -1 for no position selected.
�?Icon=5:�:Icon+=1:� (�SelectedState(Loc,Icon)=�) � (Icon=31)
�*� Icon=31 � =-1:� All icons deselected
�4Location=-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,�)
&�
0:
:O� -------------------------------------------------------------------------
D,� Special routines for this program only
NO� -------------------------------------------------------------------------
X:
b� �DoCoords
lOXEigFactor=�ModeInfo("XEigFactor",-1):YEigFactor=�ModeInfo("YEigFactor",-1)
v#ș "Wimp_GetPointerInfo",,Block
�0X=Block!0:Y=Block!4:Win=Block!12:Ic=Block!16
�I�UpdateIcon(Coords,8,�(X)):�UpdateIcon(Coords,10,�(X/(2^XEigFactor)))
�I�UpdateIcon(Coords,9,�(Y)):�UpdateIcon(Coords,11,�(Y/(2^YEigFactor)))
�H� Win=-1 � �UpdateIcon(Coords,22,"") � �UpdateIcon(Coords,22,�(Win))
�F� Ic=-1 � �UpdateIcon(Coords,23,"") � �UpdateIcon(Coords,23,�(Ic))
�Block!0=Win
�,� (Win>=0) � ((Win<>-1) � (wimp>=310)) �
�'  ș "Wimp_GetWindowOutline",,Block
�"  WminX=Block!4:WmaxY=Block!16
�%  ș "Wimp_GetWindowState",,Block
�!  OffX=Block!20:OffY=Block!24
�M  Title=�:� ((Block!32) � (1<<26))=(1<<26) � ((Block!32) � 1)=1 � Title=�
�0  �UpdateIcon(Coords,20,�((X-WminX)+OffX-2))
=  �UpdateIcon(Coords,21,�((Y-WmaxY)+OffY+2+(40 � Title)))
�
  �UpdateIcon(Coords,20,"")
   �UpdateIcon(Coords,21,"")
*�
4�
>:
H� �SaveSettings
R� �
\<� � � � �:�CloseFileIfPoss(Data):=�:� Error writing file
f  :
p+  Data=� ("<Coordinates$Dir>.Settings")
z@  �#Data,"| X and Y grid coordinates of Coordinates window:"
�  �#Data,�(XPosition)
�  �#Data,�(YPosition)
�  �#Data
�2  �("Settype <Coordinates$Dir>.Settings Text")
�  :
�=�
�:
�� �LoadSettings
�� �
�O� � � � �:�CloseFileIfPoss(Data):=�:� 'Settings' file is damaged or missing
�  :
�)  Data=� "<Coordinates$Dir>.Settings"
�  XPosition=�(�NextEntry)
  YPosition=�(�NextEntry)
  �#Data
  :
$b  � XPosition<>-1 � YPosition<>-1 � �UpdateSelectedFlag(Loc,6+((5*XPosition)+(4-YPosition)),�)
.  :
8=�
B:
L� �DefaultSettings
VXPosition=4:YPosition=4
`>�UpdateSelectedFlag(Loc,6+((5*XPosition)+(4-YPosition)),�)
j�
�
00000000  0d 00 0a 20 f4 20 3e 21  52 75 6e 49 6d 61 67 65  |... . >!RunImage|
00000010  20 66 6f 72 20 43 6f 6f  72 64 69 6e 61 74 65 73  | for Coordinates|
00000020  0d 00 14 05 3a 0d 00 1e  40 56 65 72 73 69 6f 6e  |....:...@Version|
00000030  4e 75 6d 62 65 72 24 3d  22 31 b7 30 32 20 28 31  |Number$="1.02 (1|
00000040  38 20 4a 75 6e 65 20 31  39 39 33 29 22 3a 54 61  |8 June 1993)":Ta|
00000050  73 6b 6e 61 6d 65 24 3d  22 43 6f 6f 72 64 69 6e  |skname$="Coordin|
00000060  61 74 65 73 22 0d 00 28  1b 45 78 69 74 3d a3 3a  |ates"..(.Exit=.:|
00000070  53 74 61 72 74 75 70 3d  a3 3a 44 6f 6e 65 3d a3  |Startup=.:Done=.|
00000080  0d 00 32 12 44 6f 4d 6f  64 65 43 68 61 6e 67 65  |..2.DoModeChange|
00000090  3d a3 0d 00 3c 05 3a 0d  00 46 1b de 20 42 6c 6f  |=...<.:..F.. Blo|
000000a0  63 6b 20 32 35 36 2c 4d  65 6e 75 48 65 6c 70 20  |ck 256,MenuHelp |
000000b0  31 36 0d 00 50 2f 49 6e  64 4d 65 6e 75 4d 61 78  |16..P/IndMenuMax|
000000c0  3d 36 34 3a de 20 49 6e  64 69 72 65 63 74 4d 65  |=64:. IndirectMe|
000000d0  6e 75 54 65 78 74 20 49  6e 64 4d 65 6e 75 4d 61  |nuText IndMenuMa|
000000e0  78 0d 00 5a 3a de 20 54  65 6d 70 6c 61 74 65 73  |x..Z:. Templates|
000000f0  20 31 36 33 32 2c 49 6e  66 6f 49 6e 64 20 31 39  | 1632,InfoInd 19|
00000100  30 2c 4c 6f 63 49 6e 64  20 35 39 32 2c 43 6f 6f  |0,LocInd 592,Coo|
00000110  72 64 73 49 6e 64 20 31  35 30 30 0d 00 64 1c de  |rdsInd 1500..d..|
00000120  20 49 42 4d 65 6e 75 20  37 36 2c 4d 61 69 6e 4d  | IBMenu 76,MainM|
00000130  65 6e 75 20 31 30 30 0d  00 6e 05 3a 0d 00 78 2a  |enu 100..n.:..x*|
00000140  f4 20 4d 65 73 73 61 67  65 73 20 75 73 65 64 20  |. Messages used |
00000150  62 79 20 74 68 65 20 4f  6d 6e 69 44 65 73 6b 20  |by the OmniDesk |
00000160  73 75 69 74 65 3a 0d 00  82 5f 55 74 69 6c 44 65  |suite:..._UtilDe|
00000170  63 6c 61 72 65 3d 26 38  32 35 43 30 3a 55 74 69  |clare=&825C0:Uti|
00000180  6c 4f 70 65 6e 3d 26 38  32 35 43 31 3a 55 74 69  |lOpen=&825C1:Uti|
00000190  6c 51 75 69 74 74 69 6e  67 3d 26 38 32 35 43 32  |lQuitting=&825C2|
000001a0  3a 55 74 69 6c 52 65 73  69 64 65 3d 26 38 32 35  |:UtilReside=&825|
000001b0  43 33 3a 55 74 69 6c 41  63 6b 4c 6f 61 64 3d 26  |C3:UtilAckLoad=&|
000001c0  38 32 35 43 34 0d 00 8c  2b f4 20 54 68 65 73 65  |825C4...+. These|
000001d0  20 61 72 65 20 6f 66 66  69 63 69 61 6c 20 41 63  | are official Ac|
000001e0  6f 72 6e 20 61 6c 6c 6f  63 61 74 69 6f 6e 73 2e  |orn allocations.|
000001f0  0d 00 96 05 3a 0d 00 a0  6e ee 20 85 20 42 6c 6f  |....:...n. . Blo|
00000200  63 6b 21 30 3d 9f 3a 24  28 42 6c 6f 63 6b 2b 34  |ck!0=.:$(Block+4|
00000210  29 3d f6 24 2b 22 20 28  69 6e 74 65 72 6e 61 6c  |)=.$+" (internal|
00000220  20 65 72 72 6f 72 20 63  6f 64 65 20 22 2b c3 28  | error code "+.(|
00000230  9e 29 2b 22 29 22 2b bd  30 3a c8 99 20 22 57 69  |.)+")"+.0:.. "Wi|
00000240  6d 70 5f 52 65 70 6f 72  74 45 72 72 6f 72 22 2c  |mp_ReportError",|
00000250  42 6c 6f 63 6b 2c 31 2c  54 61 73 6b 6e 61 6d 65  |Block,1,Taskname|
00000260  24 3a e0 0d 00 aa 05 3a  0d 00 b4 3f 4f 6d 6e 69  |$:.....:...?Omni|
00000270  44 65 73 6b 3d a4 52 65  61 64 53 74 61 72 74 75  |Desk=.ReadStartu|
00000280  70 53 74 72 69 6e 67 3a  f4 20 41 6c 73 6f 20 61  |pString:. Also a|
00000290  73 73 69 67 6e 73 20 45  78 69 74 20 61 6e 64 20  |ssigns Exit and |
000002a0  53 74 61 72 74 75 70 0d  00 be 05 3a 0d 00 c8 1d  |Startup....:....|
000002b0  2a 53 65 74 20 43 6f 6f  72 64 69 6e 61 74 65 73  |*Set Coordinates|
000002c0  24 52 49 53 43 4f 53 20  33 0d 00 d2 39 2a 52 4d  |$RISCOS 3...9*RM|
000002d0  45 6e 73 75 72 65 20 55  74 69 6c 69 74 79 4d 6f  |Ensure UtilityMo|
000002e0  64 75 6c 65 20 33 2e 30  30 20 53 65 74 20 43 6f  |dule 3.00 Set Co|
000002f0  6f 72 64 69 6e 61 74 65  73 24 52 49 53 43 4f 53  |ordinates$RISCOS|
00000300  20 32 0d 00 dc 5c c8 99  20 22 58 4f 53 5f 52 65  | 2...\.. "XOS_Re|
00000310  61 64 56 61 72 56 61 6c  22 2c 22 43 6f 6f 72 64  |adVarVal","Coord|
00000320  69 6e 61 74 65 73 24 52  49 53 43 4f 53 22 2c 42  |inates$RISCOS",B|
00000330  6c 6f 63 6b 2c 32 35 36  2c 30 2c 30 20 b8 20 2c  |lock,256,0,0 . ,|
00000340  2c 6c 65 6e 3a 42 6c 6f  63 6b 3f 6c 65 6e 3d 31  |,len:Block?len=1|
00000350  33 3a 77 69 6d 70 24 3d  24 42 6c 6f 63 6b 0d 00  |3:wimp$=$Block..|
00000360  e6 1c e7 20 77 69 6d 70  24 3c 3e 22 33 22 20 8c  |... wimp$<>"3" .|
00000370  20 77 69 6d 70 24 3d 22  32 22 0d 00 f0 1d 2a 55  | wimp$="2"....*U|
00000380  6e 73 65 74 20 43 6f 6f  72 64 69 6e 61 74 65 73  |nset Coordinates|
00000390  24 52 49 53 43 4f 53 0d  00 fa 59 c8 99 20 22 58  |$RISCOS...Y.. "X|
000003a0  4f 53 5f 52 65 61 64 56  61 72 56 61 6c 22 2c 22  |OS_ReadVarVal","|
000003b0  4f 62 65 79 24 44 69 72  22 2c 42 6c 6f 63 6b 2c  |Obey$Dir",Block,|
000003c0  32 35 36 2c 30 2c 30 20  b8 20 2c 2c 6c 65 6e 3a  |256,0,0 . ,,len:|
000003d0  42 6c 6f 63 6b 3f 6c 65  6e 3d 31 33 3a 4f 75 72  |Block?len=13:Our|
000003e0  46 69 6c 65 4e 61 6d 65  24 3d 24 42 6c 6f 63 6b  |FileName$=$Block|
000003f0  0d 01 04 38 4e 3d 2d 31  3a f5 3a 4e 2b 3d 31 3a  |...8N=-1:.:N+=1:|
00000400  fd 20 c1 4f 75 72 46 69  6c 65 4e 61 6d 65 24 2c  |. .OurFileName$,|
00000410  a9 28 4f 75 72 46 69 6c  65 4e 61 6d 65 24 29 2d  |.(OurFileName$)-|
00000420  4e 2c 31 29 3d 22 2e 22  0d 01 0e 4f 4f 75 72 50  |N,1)="."...OOurP|
00000430  61 74 68 4e 61 6d 65 24  3d c0 4f 75 72 46 69 6c  |athName$=.OurFil|
00000440  65 4e 61 6d 65 24 2c a9  28 4f 75 72 46 69 6c 65  |eName$,.(OurFile|
00000450  4e 61 6d 65 24 29 2d 4e  29 3a 4f 75 72 46 69 6c  |Name$)-N):OurFil|
00000460  65 4e 61 6d 65 24 3d c2  4f 75 72 46 69 6c 65 4e  |eName$=.OurFileN|
00000470  61 6d 65 24 2c 4e 29 0d  01 18 05 3a 0d 01 22 5e  |ame$,N)....:.."^|
00000480  f4 20 52 65 61 64 20 73  69 7a 65 20 6f 66 20 73  |. Read size of s|
00000490  70 72 69 74 65 20 66 69  6c 65 20 61 6e 64 20 6c  |prite file and l|
000004a0  6f 61 64 20 69 74 2e 20  57 65 20 6e 65 65 64 20  |oad it. We need |
000004b0  74 6f 20 44 49 4d 20 31  36 20 62 79 74 65 73 20  |to DIM 16 bytes |
000004c0  6d 6f 72 65 20 74 68 61  6e 20 74 68 65 20 66 69  |more than the fi|
000004d0  6c 65 27 73 20 73 69 7a  65 2e 0d 01 2c 3c c8 99  |le's size...,<..|
000004e0  20 22 4f 53 5f 46 53 43  6f 6e 74 72 6f 6c 22 2c  | "OS_FSControl",|
000004f0  32 38 2c 22 3c 43 6f 6f  72 64 69 6e 61 74 65 73  |28,"<Coordinates|
00000500  24 44 69 72 3e 2e 53 70  72 69 74 65 73 22 20 b8  |$Dir>.Sprites" .|
00000510  20 2c 2c 6c 65 6e 0d 01  36 87 de 20 53 70 72 69  | ,,len..6.. Spri|
00000520  74 65 73 20 6c 65 6e 2b  31 36 3a 21 53 70 72 69  |tes len+16:!Spri|
00000530  74 65 73 3d 6c 65 6e 2b  31 36 3a 53 70 72 69 74  |tes=len+16:Sprit|
00000540  65 73 21 34 3d 30 3a 53  70 72 69 74 65 73 21 38  |es!4=0:Sprites!8|
00000550  3d 31 36 3a 53 70 72 69  74 65 73 21 31 32 3d 31  |=16:Sprites!12=1|
00000560  36 3a c8 99 20 22 4f 53  5f 53 70 72 69 74 65 4f  |6:.. "OS_SpriteO|
00000570  70 22 2c 32 35 36 2b 31  30 2c 53 70 72 69 74 65  |p",256+10,Sprite|
00000580  73 2c 22 3c 43 6f 6f 72  64 69 6e 61 74 65 73 24  |s,"<Coordinates$|
00000590  44 69 72 3e 2e 53 70 72  69 74 65 73 22 0d 01 40  |Dir>.Sprites"..@|
000005a0  05 3a 0d 01 4a 11 e7 20  77 69 6d 70 24 3d 22 33  |.:..J.. wimp$="3|
000005b0  22 20 8c 0d 01 54 17 20  20 de 20 6d 65 73 73 61  |" ...T.  . messa|
000005c0  67 65 6c 69 73 74 25 20  32 38 0d 01 5e 2f 20 20  |gelist% 28..^/  |
000005d0  6d 65 73 73 61 67 65 6c  69 73 74 25 21 30 3d 26  |messagelist%!0=&|
000005e0  35 30 32 3a 6d 65 73 73  61 67 65 6c 69 73 74 25  |502:messagelist%|
000005f0  21 34 3d 26 34 30 30 43  31 0d 01 68 3a 20 20 6d  |!4=&400C1..h:  m|
00000600  65 73 73 61 67 65 6c 69  73 74 25 21 38 3d 55 74  |essagelist%!8=Ut|
00000610  69 6c 4f 70 65 6e 3a 6d  65 73 73 61 67 65 6c 69  |ilOpen:messageli|
00000620  73 74 25 21 31 32 3d 55  74 69 6c 51 75 69 74 74  |st%!12=UtilQuitt|
00000630  69 6e 67 0d 01 72 45 20  20 6d 65 73 73 61 67 65  |ing..rE  message|
00000640  6c 69 73 74 25 21 31 36  3d 55 74 69 6c 52 65 73  |list%!16=UtilRes|
00000650  69 64 65 3a 6d 65 73 73  61 67 65 6c 69 73 74 25  |ide:messagelist%|
00000660  21 32 30 3d 31 30 3a 6d  65 73 73 61 67 65 6c 69  |!20=10:messageli|
00000670  73 74 25 21 32 34 3d 30  0d 01 7c 4b 20 20 c8 99  |st%!24=0..|K  ..|
00000680  20 22 57 69 6d 70 5f 49  6e 69 74 69 61 6c 69 73  | "Wimp_Initialis|
00000690  65 22 2c 33 30 30 2c 26  34 42 35 33 34 31 35 34  |e",300,&4B534154|
000006a0  2c 54 61 73 6b 6e 61 6d  65 24 2c 6d 65 73 73 61  |,Taskname$,messa|
000006b0  67 65 6c 69 73 74 25 20  b8 20 77 69 6d 70 2c 54  |gelist% . wimp,T|
000006c0  61 73 6b 0d 01 86 05 cc  0d 01 90 3e 20 20 c8 99  |ask........>  ..|
000006d0  20 22 57 69 6d 70 5f 49  6e 69 74 69 61 6c 69 73  | "Wimp_Initialis|
000006e0  65 22 2c 32 30 30 2c 26  34 42 35 33 34 31 35 34  |e",200,&4B534154|
000006f0  2c 54 61 73 6b 6e 61 6d  65 24 20 b8 20 77 69 6d  |,Taskname$ . wim|
00000700  70 2c 54 61 73 6b 0d 01  9a 05 cd 0d 01 a4 05 3a  |p,Task.........:|
00000710  0d 01 ae 22 c8 99 20 22  49 6e 74 65 72 66 61 63  |...".. "Interfac|
00000720  65 5f 49 6e 69 74 69 61  6c 69 73 65 22 2c 54 61  |e_Initialise",Ta|
00000730  73 6b 0d 01 b8 05 3a 0d  01 c2 39 c8 99 20 22 57  |sk....:...9.. "W|
00000740  69 6d 70 5f 4f 70 65 6e  54 65 6d 70 6c 61 74 65  |imp_OpenTemplate|
00000750  22 2c 2c 22 3c 43 6f 6f  72 64 69 6e 61 74 65 73  |",,"<Coordinates|
00000760  24 44 69 72 3e 2e 54 65  6d 70 6c 61 74 65 73 22  |$Dir>.Templates"|
00000770  0d 01 cc 45 c8 99 20 22  57 69 6d 70 5f 4c 6f 61  |...E.. "Wimp_Loa|
00000780  64 54 65 6d 70 6c 61 74  65 22 2c 2c 54 65 6d 70  |dTemplate",,Temp|
00000790  6c 61 74 65 73 2c 49 6e  66 6f 49 6e 64 2c 49 6e  |lates,InfoInd,In|
000007a0  66 6f 49 6e 64 2b 31 39  30 2c 2d 31 2c 22 49 6e  |foInd+190,-1,"In|
000007b0  66 6f 22 2c 30 0d 01 d6  2c c8 99 20 22 57 69 6d  |fo",0...,.. "Wim|
000007c0  70 5f 43 72 65 61 74 65  57 69 6e 64 6f 77 22 2c  |p_CreateWindow",|
000007d0  2c 54 65 6d 70 6c 61 74  65 73 20 b8 20 49 6e 66  |,Templates . Inf|
000007e0  6f 0d 01 e0 5c c8 99 20  22 57 69 6d 70 5f 4c 6f  |o...\.. "Wimp_Lo|
000007f0  61 64 54 65 6d 70 6c 61  74 65 22 2c 2c 54 65 6d  |adTemplate",,Tem|
00000800  70 6c 61 74 65 73 2c 4c  6f 63 49 6e 64 2c 4c 6f  |plates,LocInd,Lo|
00000810  63 49 6e 64 2b 35 39 32  2c 2d 31 2c 22 57 69 6e  |cInd+592,-1,"Win|
00000820  64 6f 77 58 59 22 2c 30  3a 54 65 6d 70 6c 61 74  |dowXY",0:Templat|
00000830  65 73 21 36 34 3d 53 70  72 69 74 65 73 0d 01 ea  |es!64=Sprites...|
00000840  2b c8 99 20 22 57 69 6d  70 5f 43 72 65 61 74 65  |+.. "Wimp_Create|
00000850  57 69 6e 64 6f 77 22 2c  2c 54 65 6d 70 6c 61 74  |Window",,Templat|
00000860  65 73 20 b8 20 4c 6f 63  0d 01 f4 4c c8 99 20 22  |es . Loc...L.. "|
00000870  57 69 6d 70 5f 4c 6f 61  64 54 65 6d 70 6c 61 74  |Wimp_LoadTemplat|
00000880  65 22 2c 2c 54 65 6d 70  6c 61 74 65 73 2c 43 6f  |e",,Templates,Co|
00000890  6f 72 64 73 49 6e 64 2c  43 6f 6f 72 64 73 49 6e  |ordsInd,CoordsIn|
000008a0  64 2b 31 35 30 30 2c 2d  31 2c 22 43 6f 6f 72 64  |d+1500,-1,"Coord|
000008b0  73 22 2c 30 0d 01 fe 2e  c8 99 20 22 57 69 6d 70  |s",0...... "Wimp|
000008c0  5f 43 72 65 61 74 65 57  69 6e 64 6f 77 22 2c 2c  |_CreateWindow",,|
000008d0  54 65 6d 70 6c 61 74 65  73 20 b8 20 43 6f 6f 72  |Templates . Coor|
000008e0  64 73 0d 02 08 1b c8 99  20 22 57 69 6d 70 5f 43  |ds...... "Wimp_C|
000008f0  6c 6f 73 65 54 65 6d 70  6c 61 74 65 22 0d 02 12  |loseTemplate"...|
00000900  05 3a 0d 02 1c 0f f2 42  75 69 6c 64 4d 65 6e 75  |.:.....BuildMenu|
00000910  73 0d 02 26 05 3a 0d 02  30 12 e7 20 4f 6d 6e 69  |s..&.:..0.. Omni|
00000920  44 65 73 6b 3d 30 20 8c  0d 02 3a 20 20 20 f4 20  |Desk=0 ...:   . |
00000930  50 75 74 20 49 63 6f 6e  20 6f 6e 20 74 68 65 20  |Put Icon on the |
00000940  69 63 6f 6e 2d 62 61 72  0d 02 44 10 20 20 42 6c  |icon-bar..D.  Bl|
00000950  6f 63 6b 21 30 3d 2d 31  0d 02 4e 31 20 20 42 6c  |ock!0=-1..N1  Bl|
00000960  6f 63 6b 21 34 3d 30 3a  42 6c 6f 63 6b 21 38 3d  |ock!4=0:Block!8=|
00000970  30 3a 42 6c 6f 63 6b 21  31 32 3d 36 38 3a 42 6c  |0:Block!12=68:Bl|
00000980  6f 63 6b 21 31 36 3d 36  38 0d 02 58 32 20 20 42  |ock!16=68..X2  B|
00000990  6c 6f 63 6b 21 32 30 3d  26 31 37 30 30 33 30 30  |lock!20=&1700300|
000009a0  32 3a 24 28 42 6c 6f 63  6b 2b 32 34 29 3d 22 21  |2:$(Block+24)="!|
000009b0  43 6f 6f 72 64 73 22 2b  bd 31 33 0d 02 62 2b 20  |Coords"+.13..b+ |
000009c0  20 c8 99 20 22 57 69 6d  70 5f 43 72 65 61 74 65  | .. "Wimp_Create|
000009d0  49 63 6f 6e 22 2c 2c 42  6c 6f 63 6b 20 b8 20 49  |Icon",,Block . I|
000009e0  63 6f 6e 42 61 72 0d 02  6c 05 cd 0d 02 76 05 3a  |conBar..l....v.:|
000009f0  0d 02 80 0f f2 49 6e 69  74 69 61 6c 69 73 65 0d  |.....Initialise.|
00000a00  02 8a 26 e7 20 4f 6d 6e  69 44 65 73 6b 3c 3e 30  |..&. OmniDesk<>0|
00000a10  20 8c 20 f2 44 65 63 6c  61 72 65 54 6f 4f 6d 6e  | . .DeclareToOmn|
00000a20  69 44 65 73 6b 0d 02 94  52 e7 20 53 74 61 72 74  |iDesk...R. Start|
00000a30  75 70 20 8c 20 44 6f 6e  65 3d b9 3a f4 20 27 2d  |up . Done=.:. '-|
00000a40  53 74 61 72 74 75 70 27  20 70 61 72 61 6d 65 74  |Startup' paramet|
00000a50  65 72 20 6d 65 61 6e 73  20 27 64 65 63 6c 61 72  |er means 'declar|
00000a60  65 20 61 6e 64 20 64 69  65 20 69 6d 6d 65 64 69  |e and die immedi|
00000a70  61 74 65 6c 79 27 2e 0d  02 9e 05 3a 0d 02 a8 26  |ately'.....:...&|
00000a80  f2 55 70 64 61 74 65 49  63 6f 6e 28 49 6e 66 6f  |.UpdateIcon(Info|
00000a90  2c 33 2c 56 65 72 73 69  6f 6e 4e 75 6d 62 65 72  |,3,VersionNumber|
00000aa0  24 29 0d 02 b2 36 f2 4d  6f 64 65 43 68 61 6e 67  |$)...6.ModeChang|
00000ab0  65 3a f4 20 54 6f 20 75  70 64 61 74 65 20 69 63  |e:. To update ic|
00000ac0  6f 6e 2d 62 61 72 20 69  63 6f 6e 20 69 66 20 6e  |on-bar icon if n|
00000ad0  65 63 65 73 73 61 72 79  0d 02 bc 15 f2 43 6c 65  |ecessary.....Cle|
00000ae0  61 6e 55 70 4c 6f 63 57  69 6e 64 6f 77 0d 02 c6  |anUpLocWindow...|
00000af0  05 3a 0d 02 d0 1e 52 65  61 64 45 72 72 6f 72 3d  |.:....ReadError=|
00000b00  ac 28 a4 4c 6f 61 64 53  65 74 74 69 6e 67 73 29  |.(.LoadSettings)|
00000b10  0d 02 da 05 3a 0d 02 e4  0e ee 20 85 20 f2 45 72  |....:..... . .Er|
00000b20  72 6f 72 0d 02 ee 94 e7  20 52 65 61 64 45 72 72  |ror..... ReadErr|
00000b30  6f 72 20 8c 20 52 65 61  64 45 72 72 6f 72 3d a3  |or . ReadError=.|
00000b40  3a f2 44 65 66 61 75 6c  74 53 65 74 74 69 6e 67  |:.DefaultSetting|
00000b50  73 3a 85 20 39 39 39 39  2c 22 41 6e 20 65 72 72  |s:. 9999,"An err|
00000b60  6f 72 20 6f 63 63 75 72  72 65 64 20 77 68 69 6c  |or occurred whil|
00000b70  73 74 20 72 65 61 64 69  6e 67 20 74 68 65 20 73  |st reading the s|
00000b80  65 74 74 69 6e 67 73 20  66 69 6c 65 2e 20 44 65  |ettings file. De|
00000b90  66 61 75 6c 74 20 73 65  74 74 69 6e 67 73 20 77  |fault settings w|
00000ba0  69 6c 6c 20 74 68 65 72  65 66 6f 72 65 20 62 65  |ill therefore be|
00000bb0  20 75 73 65 64 2e 22 0d  02 f8 05 3a 0d 03 02 17  | used."....:....|
00000bc0  f4 20 4d 61 69 6e 20 70  72 6f 67 72 61 6d 20 6c  |. Main program l|
00000bd0  6f 6f 70 0d 03 0c 05 f5  0d 03 16 32 20 20 c8 99  |oop........2  ..|
00000be0  20 22 57 69 6d 70 5f 50  6f 6c 6c 22 2c 25 31 31  | "Wimp_Poll",%11|
00000bf0  30 30 30 30 30 31 31 30  30 30 30 2c 42 6c 6f 63  |00000110000,Bloc|
00000c00  6b 20 b8 20 52 65 61 73  6f 6e 0d 03 20 26 20 20  |k . Reason.. &  |
00000c10  c8 99 20 22 49 6e 74 65  72 66 61 63 65 5f 50 6f  |.. "Interface_Po|
00000c20  6c 6c 22 2c 52 65 61 73  6f 6e 2c 2c 54 61 73 6b  |ll",Reason,,Task|
00000c30  0d 03 2a 34 20 20 c8 99  20 22 49 6e 74 65 72 66  |..*4  .. "Interf|
00000c40  61 63 65 5f 50 72 65 50  72 6f 63 65 73 73 4b 65  |ace_PreProcessKe|
00000c50  79 22 2c 52 65 61 73 6f  6e 2c 42 6c 6f 63 6b 2c  |y",Reason,Block,|
00000c60  54 61 73 6b 0d 03 34 11  20 20 c8 8e 20 52 65 61  |Task..4.  .. Rea|
00000c70  73 6f 6e 20 ca 0d 03 3e  2e 20 20 20 20 c9 20 30  |son ...>.    . 0|
00000c80  20 3a 20 e7 20 a4 4f 70  65 6e 53 74 61 74 65 28  | : . .OpenState(|
00000c90  43 6f 6f 72 64 73 29 20  8c 20 f2 44 6f 43 6f 6f  |Coords) . .DoCoo|
00000ca0  72 64 73 0d 03 48 5c 20  20 20 20 20 20 20 20 20  |rds..H\         |
00000cb0  20 20 20 20 e7 20 44 6f  4d 6f 64 65 43 68 61 6e  |    . DoModeChan|
00000cc0  67 65 20 8c 20 e7 20 a4  4f 70 65 6e 53 74 61 74  |ge . . .OpenStat|
00000cd0  65 28 43 6f 6f 72 64 73  29 20 8c 20 f2 4f 70 65  |e(Coords) . .Ope|
00000ce0  6e 28 43 6f 6f 72 64 73  2c a3 2c 58 50 6f 73 69  |n(Coords,.,XPosi|
00000cf0  74 69 6f 6e 2c 59 50 6f  73 69 74 69 6f 6e 29 0d  |tion,YPosition).|
00000d00  03 52 15 20 20 20 20 c9  20 31 20 3a 20 f2 52 65  |.R.    . 1 : .Re|
00000d10  64 72 61 77 0d 03 5c 29  20 20 20 20 c9 20 32 20  |draw..\)    . 2 |
00000d20  3a 20 c8 99 20 22 57 69  6d 70 5f 4f 70 65 6e 57  |: .. "Wimp_OpenW|
00000d30  69 6e 64 6f 77 22 2c 2c  42 6c 6f 63 6b 0d 03 66  |indow",,Block..f|
00000d40  2a 20 20 20 20 c9 20 33  20 3a 20 c8 99 20 22 57  |*    . 3 : .. "W|
00000d50  69 6d 70 5f 43 6c 6f 73  65 57 69 6e 64 6f 77 22  |imp_CloseWindow"|
00000d60  2c 2c 42 6c 6f 63 6b 0d  03 70 20 20 20 20 20 20  |,,Block..p      |
00000d70  20 20 20 20 20 20 20 20  e7 20 45 78 69 74 20 8c  |        . Exit .|
00000d80  20 44 6f 6e 65 3d b9 0d  03 7a 1a 20 20 20 20 c9  | Done=...z.    .|
00000d90  20 36 20 3a 20 f2 4d 6f  75 73 65 42 75 74 74 6f  | 6 : .MouseButto|
00000da0  6e 0d 03 84 19 20 20 20  20 c9 20 38 20 3a 20 f2  |n....    . 8 : .|
00000db0  4b 65 79 50 72 65 73 73  65 64 0d 03 8e 19 20 20  |KeyPressed....  |
00000dc0  20 20 c9 20 39 20 3a 20  f2 44 65 63 6f 64 65 4d  |  . 9 : .DecodeM|
00000dd0  65 6e 75 0d 03 98 24 20  20 20 20 c9 20 31 37 2c  |enu...$    . 17,|
00000de0  31 38 2c 31 39 20 3a 20  f2 52 65 63 69 65 76 65  |18,19 : .Recieve|
00000df0  4d 65 73 73 61 67 65 0d  03 a2 07 20 20 cb 0d 03  |Message....  ...|
00000e00  ac 0a fd 20 44 6f 6e 65  0d 03 b6 0f f2 53 61 79  |... Done.....Say|
00000e10  47 6f 6f 64 62 79 65 0d  03 c0 05 e0 0d 03 ca 05  |Goodbye.........|
00000e20  3a 0d 03 d4 0c dd 20 f2  45 72 72 6f 72 0d 03 de  |:..... .Error...|
00000e30  1c 43 6c 69 63 6b 3d 30  3a 42 6c 6f 63 6b 21 30  |.Click=0:Block!0|
00000e40  3d 9f 3a c8 8e 20 9f 20  ca 0d 03 e8 1b 20 20 c9  |=.:.. . .....  .|
00000e50  20 39 39 39 39 3a f4 20  43 75 73 74 6f 6d 20 65  | 9999:. Custom e|
00000e60  72 72 6f 72 0d 03 f2 18  20 20 20 20 24 28 42 6c  |rror....    $(Bl|
00000e70  6f 63 6b 2b 34 29 3d f6  24 2b bd 30 0d 03 fc 40  |ock+4)=.$+.0...@|
00000e80  20 20 20 20 c8 99 20 22  57 69 6d 70 5f 52 65 70  |    .. "Wimp_Rep|
00000e90  6f 72 74 45 72 72 6f 72  22 2c 42 6c 6f 63 6b 2c  |ortError",Block,|
00000ea0  31 37 2c 22 4e 6f 74 69  63 65 20 66 72 6f 6d 20  |17,"Notice from |
00000eb0  43 6f 6f 72 64 69 6e 61  74 65 73 22 0d 04 06 43  |Coordinates"...C|
00000ec0  20 20 20 20 e7 20 45 78  69 74 20 8c 20 43 6c 69  |    . Exit . Cli|
00000ed0  63 6b 3d 32 3a f2 53 61  79 47 6f 6f 64 62 79 65  |ck=2:.SayGoodbye|
00000ee0  3a f4 20 51 75 69 74 20  69 66 20 63 61 6c 6c 65  |:. Quit if calle|
00000ef0  64 20 66 72 6f 6d 20 4f  6d 6e 69 44 65 73 6b 0d  |d from OmniDesk.|
00000f00  04 10 07 20 20 7f 0d 04  1a 76 20 20 20 20 24 28  |...  ....v    $(|
00000f10  42 6c 6f 63 6b 2b 34 29  3d f6 24 2b 22 20 28 69  |Block+4)=.$+" (i|
00000f20  6e 74 65 72 6e 61 6c 20  65 72 72 6f 72 20 63 6f  |nternal error co|
00000f30  64 65 20 22 2b c3 9e 2b  22 29 2e 20 43 6c 69 63  |de "+..+"). Clic|
00000f40  6b 20 6f 6e 20 4f 4b 20  74 6f 20 63 6f 6e 74 69  |k on OK to conti|
00000f50  6e 75 65 2c 20 6f 72 20  43 61 6e 63 65 6c 20 74  |nue, or Cancel t|
00000f60  6f 20 74 65 72 6d 69 6e  61 74 65 20 74 68 65 20  |o terminate the |
00000f70  70 72 6f 67 72 61 6d 2e  22 2b bd 30 0d 04 24 38  |program."+.0..$8|
00000f80  20 20 20 20 c8 99 20 22  57 69 6d 70 5f 52 65 70  |    .. "Wimp_Rep|
00000f90  6f 72 74 45 72 72 6f 72  22 2c 42 6c 6f 63 6b 2c  |ortError",Block,|
00000fa0  33 2c 54 61 73 6b 6e 61  6d 65 24 20 b8 20 2c 43  |3,Taskname$ . ,C|
00000fb0  6c 69 63 6b 0d 04 2e 05  cb 0d 04 38 1d e7 20 43  |lick.......8.. C|
00000fc0  6c 69 63 6b 3d 32 20 8c  20 f2 53 61 79 47 6f 6f  |lick=2 . .SayGoo|
00000fd0  64 62 79 65 3a e0 0d 04  42 05 e1 0d 04 4c 05 3a  |dbye:...B....L.:|
00000fe0  0d 04 56 2e dd 20 f2 4f  70 65 6e 28 57 69 6e 64  |..V.. .Open(Wind|
00000ff0  6f 77 48 61 6e 64 6c 65  2c 54 6f 70 4f 66 53 74  |owHandle,TopOfSt|
00001000  61 63 6b 2c 61 63 72 6f  73 73 2c 75 70 29 0d 04  |ack,across,up)..|
00001010  60 18 42 6c 6f 63 6b 21  30 3d 57 69 6e 64 6f 77  |`.Block!0=Window|
00001020  48 61 6e 64 6c 65 0d 04  6a 23 c8 99 20 22 57 69  |Handle..j#.. "Wi|
00001030  6d 70 5f 47 65 74 57 69  6e 64 6f 77 53 74 61 74  |mp_GetWindowStat|
00001040  65 22 2c 2c 42 6c 6f 63  6b 0d 04 74 4a e7 20 28  |e",,Block..tJ. (|
00001050  61 63 72 6f 73 73 3c 3e  2d 31 29 20 80 20 28 61  |across<>-1) . (a|
00001060  63 72 6f 73 73 3c 3e 2d  31 29 20 8c 20 f2 44 65  |cross<>-1) . .De|
00001070  63 69 64 65 57 69 6e 64  6f 77 50 6f 73 69 74 69  |cideWindowPositi|
00001080  6f 6e 28 42 6c 6f 63 6b  2c 61 63 72 6f 73 73 2c  |on(Block,across,|
00001090  75 70 29 0d 04 7e 1e e7  20 54 6f 70 4f 66 53 74  |up)..~.. TopOfSt|
000010a0  61 63 6b 20 8c 20 42 6c  6f 63 6b 21 32 38 3d 2d  |ack . Block!28=-|
000010b0  31 0d 04 88 1f c8 99 20  22 57 69 6d 70 5f 4f 70  |1...... "Wimp_Op|
000010c0  65 6e 57 69 6e 64 6f 77  22 2c 2c 42 6c 6f 63 6b  |enWindow",,Block|
000010d0  0d 04 92 05 e1 0d 04 9c  05 3a 0d 04 a6 1a dd 20  |.........:..... |
000010e0  f2 43 6c 6f 73 65 28 57  69 6e 64 6f 77 48 61 6e  |.Close(WindowHan|
000010f0  64 6c 65 29 0d 04 b0 18  42 6c 6f 63 6b 21 30 3d  |dle)....Block!0=|
00001100  57 69 6e 64 6f 77 48 61  6e 64 6c 65 0d 04 ba 23  |WindowHandle...#|
00001110  c8 99 20 22 57 69 6d 70  5f 47 65 74 57 69 6e 64  |.. "Wimp_GetWind|
00001120  6f 77 53 74 61 74 65 22  2c 2c 42 6c 6f 63 6b 0d  |owState",,Block.|
00001130  04 c4 20 c8 99 20 22 57  69 6d 70 5f 43 6c 6f 73  |.. .. "Wimp_Clos|
00001140  65 57 69 6e 64 6f 77 22  2c 2c 42 6c 6f 63 6b 0d  |eWindow",,Block.|
00001150  04 ce 05 e1 0d 04 d8 05  3a 0d 04 e2 2c dd 20 f2  |........:...,. .|
00001160  44 65 63 69 64 65 57 69  6e 64 6f 77 50 6f 73 69  |DecideWindowPosi|
00001170  74 69 6f 6e 28 42 6c 6f  63 6b 2c 61 63 72 6f 73  |tion(Block,acros|
00001180  73 2c 75 70 29 0d 04 ec  4c f4 20 55 73 65 20 6f  |s,up)...L. Use o|
00001190  66 20 74 68 69 73 20 70  72 6f 63 65 64 75 72 65  |f this procedure|
000011a0  20 6c 65 74 73 20 79 6f  75 20 6f 70 65 6e 20 77  | lets you open w|
000011b0  69 6e 64 6f 77 73 20 6f  6e 20 61 6e 20 69 6e 76  |indows on an inv|
000011c0  69 73 69 62 6c 65 20 67  72 69 64 20 77 68 69 63  |isible grid whic|
000011d0  68 0d 04 f6 49 f4 20 61  75 74 6f 6d 61 74 69 63  |h...I. automatic|
000011e0  61 6c 6c 79 20 66 69 74  73 20 69 74 73 65 6c 66  |ally fits itself|
000011f0  20 74 6f 20 74 68 65 20  73 63 72 65 65 6e 20 6d  | to the screen m|
00001200  6f 64 65 20 69 6e 20 75  73 65 2e 20 54 68 65 72  |ode in use. Ther|
00001210  65 20 61 72 65 20 66 69  76 65 0d 05 00 4a f4 20  |e are five...J. |
00001220  70 6f 73 69 74 69 6f 6e  73 20 61 63 72 6f 73 73  |positions across|
00001230  20 28 6c 65 66 74 2c 20  6d 69 64 2d 6c 65 66 74  | (left, mid-left|
00001240  2c 20 63 65 6e 74 72 65  2c 20 6d 69 64 2d 72 69  |, centre, mid-ri|
00001250  67 68 74 2c 20 72 69 67  68 74 29 20 61 6e 64 20  |ght, right) and |
00001260  66 69 76 65 0d 05 0a 47  f4 20 70 6f 73 69 74 69  |five...G. positi|
00001270  6f 6e 73 20 75 70 20 28  62 6f 74 74 6f 6d 20 6f  |ons up (bottom o|
00001280  66 20 73 63 72 65 65 6e  2c 20 61 62 6f 76 65 20  |f screen, above |
00001290  69 63 6f 6e 2d 62 61 72  2c 20 63 65 6e 74 72 65  |icon-bar, centre|
000012a0  20 6f 66 20 73 63 72 65  65 6e 2c 0d 05 14 2b f4  | of screen,...+.|
000012b0  20 63 65 6e 74 72 65 20  74 6f 70 20 6f 66 20 73  | centre top of s|
000012c0  63 72 65 65 6e 2c 20 74  6f 70 20 6f 66 20 73 63  |creen, top of sc|
000012d0  72 65 65 6e 29 2e 0d 05  1e 07 20 20 3a 0d 05 28  |reen).....  :..(|
000012e0  43 58 70 69 78 65 6c 73  3d a4 4d 6f 64 65 49 6e  |CXpixels=.ModeIn|
000012f0  66 6f 28 22 58 50 69 78  65 6c 73 22 2c 2d 31 29  |fo("XPixels",-1)|
00001300  3a 59 70 69 78 65 6c 73  3d a4 4d 6f 64 65 49 6e  |:Ypixels=.ModeIn|
00001310  66 6f 28 22 59 50 69 78  65 6c 73 22 2c 2d 31 29  |fo("YPixels",-1)|
00001320  0d 05 32 4f 58 45 69 67  46 61 63 74 6f 72 3d a4  |..2OXEigFactor=.|
00001330  4d 6f 64 65 49 6e 66 6f  28 22 58 45 69 67 46 61  |ModeInfo("XEigFa|
00001340  63 74 6f 72 22 2c 2d 31  29 3a 59 45 69 67 46 61  |ctor",-1):YEigFa|
00001350  63 74 6f 72 3d a4 4d 6f  64 65 49 6e 66 6f 28 22  |ctor=.ModeInfo("|
00001360  59 45 69 67 46 61 63 74  6f 72 22 2c 2d 31 29 0d  |YEigFactor",-1).|
00001370  05 3c 07 20 20 3a 0d 05  46 38 74 6f 70 3d 42 6c  |.<.  :..F8top=Bl|
00001380  6f 63 6b 21 31 36 3a 72  69 67 68 74 3d 42 6c 6f  |ock!16:right=Blo|
00001390  63 6b 21 31 32 3a 62 6f  74 3d 42 6c 6f 63 6b 21  |ck!12:bot=Block!|
000013a0  38 3a 6c 65 66 74 3d 42  6c 6f 63 6b 21 34 0d 05  |8:left=Block!4..|
000013b0  50 41 c8 99 20 22 57 69  6d 70 5f 4f 70 65 6e 57  |PA.. "Wimp_OpenW|
000013c0  69 6e 64 6f 77 22 2c 2c  42 6c 6f 63 6b 3a c8 99  |indow",,Block:..|
000013d0  20 22 57 69 6d 70 5f 47  65 74 57 69 6e 64 6f 77  | "Wimp_GetWindow|
000013e0  4f 75 74 6c 69 6e 65 22  2c 2c 42 6c 6f 63 6b 0d  |Outline",,Block.|
000013f0  05 5a 26 54 42 3d 28 28  42 6c 6f 63 6b 21 31 36  |.Z&TB=((Block!16|
00001400  29 2d 74 6f 70 29 2f 28  32 5e 59 45 69 67 46 61  |)-top)/(2^YEigFa|
00001410  63 74 6f 72 29 0d 05 64  28 56 53 3d 28 28 42 6c  |ctor)..d(VS=((Bl|
00001420  6f 63 6b 21 31 32 29 2d  72 69 67 68 74 29 2f 28  |ock!12)-right)/(|
00001430  32 5e 58 45 69 67 46 61  63 74 6f 72 29 0d 05 6e  |2^XEigFactor)..n|
00001440  25 48 53 3d 28 62 6f 74  2d 28 42 6c 6f 63 6b 21  |%HS=(bot-(Block!|
00001450  38 29 29 2f 28 32 5e 59  45 69 67 46 61 63 74 6f  |8))/(2^YEigFacto|
00001460  72 29 0d 05 78 26 4c 50  3d 28 6c 65 66 74 2d 28  |r)..x&LP=(left-(|
00001470  42 6c 6f 63 6b 21 34 29  29 2f 28 32 5e 58 45 69  |Block!4))/(2^XEi|
00001480  67 46 61 63 74 6f 72 29  0d 05 82 4b f4 20 4c 50  |gFactor)...K. LP|
00001490  20 69 73 20 4c 65 66 74  20 50 69 78 65 6c 3a 20  | is Left Pixel: |
000014a0  6e 6f 72 6d 61 6c 6c 79  20 70 72 65 73 65 6e 74  |normally present|
000014b0  2c 20 62 75 74 20 6e 6f  74 20 69 66 20 77 69 6e  |, but not if win|
000014c0  64 6f 77 20 69 73 20 74  72 61 6e 73 70 61 72 65  |dow is transpare|
000014d0  6e 74 2e 0d 05 8c 25 77  69 64 74 68 3d 28 72 69  |nt....%width=(ri|
000014e0  67 68 74 2d 6c 65 66 74  29 2f 28 32 5e 58 45 69  |ght-left)/(2^XEi|
000014f0  67 46 61 63 74 6f 72 29  0d 05 96 23 68 65 69 67  |gFactor)...#heig|
00001500  68 74 3d 28 74 6f 70 2d  62 6f 74 29 2f 28 32 5e  |ht=(top-bot)/(2^|
00001510  59 45 69 67 46 61 63 74  6f 72 29 0d 05 a0 0f c8  |YEigFactor).....|
00001520  8e 20 61 63 72 6f 73 73  20 ca 0d 05 aa 0e 20 20  |. across .....  |
00001530  c9 20 30 3a 78 3d 4c 50  0d 05 b4 2c 20 20 c9 20  |. 0:x=LP...,  . |
00001540  31 3a 78 3d 4c 50 2b 28  28 58 70 69 78 65 6c 73  |1:x=LP+((Xpixels|
00001550  2b 31 29 2d 28 77 69 64  74 68 2b 4c 50 2b 56 53  |+1)-(width+LP+VS|
00001560  29 29 2f 34 0d 05 be 2c  20 20 c9 20 32 3a 78 3d  |))/4...,  . 2:x=|
00001570  4c 50 2b 28 28 58 70 69  78 65 6c 73 2b 31 29 2d  |LP+((Xpixels+1)-|
00001580  28 77 69 64 74 68 2b 4c  50 2b 56 53 29 29 2f 32  |(width+LP+VS))/2|
00001590  0d 05 c8 32 20 20 c9 20  33 3a 78 3d 4c 50 2b 28  |...2  . 3:x=LP+(|
000015a0  33 2a 28 28 28 58 70 69  78 65 6c 73 2b 31 29 2d  |3*(((Xpixels+1)-|
000015b0  28 77 69 64 74 68 2b 4c  50 2b 56 53 29 29 2f 34  |(width+LP+VS))/4|
000015c0  29 29 0d 05 d2 22 20 20  c9 20 34 3a 78 3d 28 58  |))..."  . 4:x=(X|
000015d0  70 69 78 65 6c 73 2b 31  29 2d 28 77 69 64 74 68  |pixels+1)-(width|
000015e0  2b 56 53 29 0d 05 dc 05  cb 0d 05 e6 0b c8 8e 20  |+VS)........... |
000015f0  75 70 20 ca 0d 05 f0 0e  20 20 c9 20 30 3a 79 3d  |up .....  . 0:y=|
00001600  48 53 0d 05 fa 23 20 20  c9 20 31 3a 79 3d 48 53  |HS...#  . 1:y=HS|
00001610  2b 28 31 33 32 2f 28 32  5e 59 45 69 67 46 61 63  |+(132/(2^YEigFac|
00001620  74 6f 72 29 29 0d 06 04  2d 20 20 c9 20 32 3a 79  |tor))...-  . 2:y|
00001630  3d 48 53 2b 28 28 59 70  69 78 65 6c 73 2b 31 29  |=HS+((Ypixels+1)|
00001640  2d 28 68 65 69 67 68 74  2b 54 42 2b 48 53 29 29  |-(height+TB+HS))|
00001650  2f 32 0d 06 0e 33 20 20  c9 20 33 3a 79 3d 48 53  |/2...3  . 3:y=HS|
00001660  2b 28 33 2a 28 28 28 59  70 69 78 65 6c 73 2b 31  |+(3*(((Ypixels+1|
00001670  29 2d 28 68 65 69 67 68  74 2b 54 42 2b 48 53 29  |)-(height+TB+HS)|
00001680  29 2f 34 29 29 0d 06 18  23 20 20 c9 20 34 3a 79  |)/4))...#  . 4:y|
00001690  3d 28 59 70 69 78 65 6c  73 2b 31 29 2d 28 68 65  |=(Ypixels+1)-(he|
000016a0  69 67 68 74 2b 54 42 29  0d 06 22 05 cb 0d 06 2c  |ight+TB).."....,|
000016b0  28 f4 20 41 62 6f 76 65  20 63 6f 6f 72 64 69 6e  |(. Above coordin|
000016c0  61 74 65 73 20 70 6f 73  69 74 69 6f 6e 20 77 69  |ates position wi|
000016d0  6e 64 6f 77 2e 0d 06 36  28 f4 20 4e 6f 77 20 63  |ndow...6(. Now c|
000016e0  6f 6e 76 65 72 74 20 74  6f 20 73 63 72 65 65 6e  |onvert to screen|
000016f0  20 63 6f 6f 72 64 69 6e  61 74 65 73 3a 0d 06 40  | coordinates:..@|
00001700  29 78 3d 78 2a 28 32 5e  58 45 69 67 46 61 63 74  |)x=x*(2^XEigFact|
00001710  6f 72 29 3a 79 3d 79 2a  28 32 5e 59 45 69 67 46  |or):y=y*(2^YEigF|
00001720  61 63 74 6f 72 29 0d 06  4a 3b 77 69 64 74 68 3d  |actor)..J;width=|
00001730  77 69 64 74 68 2a 28 32  5e 58 45 69 67 46 61 63  |width*(2^XEigFac|
00001740  74 6f 72 29 3a 68 65 69  67 68 74 3d 68 65 69 67  |tor):height=heig|
00001750  68 74 2a 28 32 5e 59 45  69 67 46 61 63 74 6f 72  |ht*(2^YEigFactor|
00001760  29 0d 06 54 1e 42 6c 6f  63 6b 21 31 32 3d 78 2b  |)..T.Block!12=x+|
00001770  77 69 64 74 68 3a 42 6c  6f 63 6b 21 34 3d 78 0d  |width:Block!4=x.|
00001780  06 5e 1f 42 6c 6f 63 6b  21 31 36 3d 79 2b 68 65  |.^.Block!16=y+he|
00001790  69 67 68 74 3a 42 6c 6f  63 6b 21 38 3d 79 0d 06  |ight:Block!8=y..|
000017a0  68 05 e1 0d 06 72 05 3a  0d 06 7c 4f f4 20 2d 2d  |h....r.:..|O. --|
000017b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000017f0  2d 2d 2d 2d 2d 2d 2d 0d  06 86 18 f4 20 57 69 6d  |-------..... Wim|
00001800  70 20 70 6f 6c 6c 20 72  6f 75 74 69 6e 65 73 0d  |p poll routines.|
00001810  06 90 4f f4 20 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |..O. -----------|
00001820  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001850  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d 06  |--------------..|
00001860  9a 05 3a 0d 06 a4 0d dd  20 f2 52 65 64 72 61 77  |..:..... .Redraw|
00001870  0d 06 ae 14 e7 20 44 6f  4d 6f 64 65 43 68 61 6e  |..... DoModeChan|
00001880  67 65 20 8c 0d 06 b8 64  20 20 f4 20 52 65 2d 6f  |ge ....d  . Re-o|
00001890  70 65 6e 69 6e 67 20 77  69 6e 64 6f 77 73 20 6e  |pening windows n|
000018a0  65 65 64 20 61 6e 20 65  78 74 72 61 20 77 69 6d  |eed an extra wim|
000018b0  70 5f 70 6f 6c 6c 20 74  6f 20 68 61 70 70 65 6e  |p_poll to happen|
000018c0  20 61 66 74 65 72 20 74  68 65 20 6d 6f 64 65 20  | after the mode |
000018d0  63 68 61 6e 67 65 20 69  6e 20 6f 72 64 65 72 20  |change in order |
000018e0  74 6f 20 77 6f 72 6b 3a  0d 06 c2 40 20 20 e7 20  |to work:...@  . |
000018f0  a4 4f 70 65 6e 53 74 61  74 65 28 43 6f 6f 72 64  |.OpenState(Coord|
00001900  73 29 20 8c 20 f2 4f 70  65 6e 28 43 6f 6f 72 64  |s) . .Open(Coord|
00001910  73 2c a3 2c 58 50 6f 73  69 74 69 6f 6e 2c 59 50  |s,.,XPosition,YP|
00001920  6f 73 69 74 69 6f 6e 29  0d 06 cc 14 20 20 44 6f  |osition)....  Do|
00001930  4d 6f 64 65 43 68 61 6e  67 65 3d a3 0d 06 d6 05  |ModeChange=.....|
00001940  cd 0d 06 e0 28 c8 99 20  22 57 69 6d 70 5f 52 65  |....(.. "Wimp_Re|
00001950  64 72 61 77 57 69 6e 64  6f 77 22 2c 2c 42 6c 6f  |drawWindow",,Blo|
00001960  63 6b 20 b8 20 66 6c 61  67 0d 06 ea 0b c8 95 20  |ck . flag...... |
00001970  66 6c 61 67 0d 06 f4 2a  20 20 c8 99 20 22 49 6e  |flag...*  .. "In|
00001980  74 65 72 66 61 63 65 5f  52 65 6e 64 65 72 33 64  |terface_Render3d|
00001990  57 69 6e 64 6f 77 22 2c  2c 42 6c 6f 63 6b 0d 06  |Window",,Block..|
000019a0  fe 2a 20 20 c8 99 20 22  57 69 6d 70 5f 47 65 74  |.*  .. "Wimp_Get|
000019b0  52 65 63 74 61 6e 67 6c  65 22 2c 2c 42 6c 6f 63  |Rectangle",,Bloc|
000019c0  6b 20 b8 20 66 6c 61 67  0d 07 08 05 ce 0d 07 12  |k . flag........|
000019d0  05 e1 0d 07 1c 05 3a 0d  07 26 15 dd 20 f2 52 65  |......:..&.. .Re|
000019e0  63 69 65 76 65 4d 65 73  73 61 67 65 0d 07 30 11  |cieveMessage..0.|
000019f0  c8 8e 20 42 6c 6f 63 6b  21 31 36 20 ca 0d 07 3a  |.. Block!16 ...:|
00001a00  12 20 20 c9 20 30 20 3a  20 44 6f 6e 65 3d b9 0d  |.  . 0 : Done=..|
00001a10  07 44 31 20 20 c9 20 31  30 3a 20 e7 20 4f 6d 6e  |.D1  . 10: . Omn|
00001a20  69 44 65 73 6b 3d 30 20  8c 20 f2 53 61 76 65 44  |iDesk=0 . .SaveD|
00001a30  65 73 6b 74 6f 70 28 42  6c 6f 63 6b 21 32 30 29  |esktop(Block!20)|
00001a40  0d 07 4e 45 20 20 20 20  20 20 20 20 20 20 20 f4  |..NE           .|
00001a50  20 4f 6e 6c 79 20 73 61  76 65 20 69 66 20 77 65  | Only save if we|
00001a60  20 68 61 76 65 20 6e 6f  74 20 62 65 65 6e 20 73  | have not been s|
00001a70  74 61 72 74 65 64 20 75  70 20 62 79 20 4f 6d 6e  |tarted up by Omn|
00001a80  69 44 65 73 6b 0d 07 58  14 20 20 c9 20 26 35 30  |iDesk..X.  . &50|
00001a90  32 20 3a 20 f2 48 65 6c  70 0d 07 62 1c 20 20 c9  |2 : .Help..b.  .|
00001aa0  20 26 34 30 30 43 31 20  3a 20 f2 4d 6f 64 65 43  | &400C1 : .ModeC|
00001ab0  68 61 6e 67 65 0d 07 6c  3d 20 20 c9 20 55 74 69  |hange..l=  . Uti|
00001ac0  6c 4f 70 65 6e 20 3a 20  e7 20 24 28 42 6c 6f 63  |lOpen : . $(Bloc|
00001ad0  6b 2b 32 34 29 3d 54 61  73 6b 6e 61 6d 65 24 20  |k+24)=Taskname$ |
00001ae0  8c 20 f2 4f 6d 6e 69 44  65 73 6b 43 61 6c 6c 69  |. .OmniDeskCalli|
00001af0  6e 67 0d 07 76 26 20 20  c9 20 55 74 69 6c 51 75  |ng..v&  . UtilQu|
00001b00  69 74 74 69 6e 67 20 3a  20 e7 20 4f 6d 6e 69 44  |itting : . OmniD|
00001b10  65 73 6b 3c 3e 30 20 8c  0d 07 80 38 20 20 20 20  |esk<>0 ....8    |
00001b20  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001b30  20 20 20 20 e7 20 42 6c  6f 63 6b 21 32 30 3d 4f  |    . Block!20=O|
00001b40  6d 6e 69 44 65 73 6b 20  8c 20 44 6f 6e 65 3d b9  |mniDesk . Done=.|
00001b50  0d 07 8a 1b 20 20 20 20  20 20 20 20 20 20 20 20  |....            |
00001b60  20 20 20 20 20 20 20 20  20 20 cd 0d 07 94 1b 20  |          ..... |
00001b70  20 c9 20 55 74 69 6c 52  65 73 69 64 65 20 3a 20  | . UtilReside : |
00001b80  45 78 69 74 3d a3 0d 07  9e 05 cb 0d 07 a8 05 e1  |Exit=...........|
00001b90  0d 07 b2 05 3a 0d 07 bc  12 dd 20 f2 4d 6f 75 73  |....:..... .Mous|
00001ba0  65 42 75 74 74 6f 6e 0d  07 c6 31 4d 6f 75 73 65  |eButton...1Mouse|
00001bb0  58 3d 42 6c 6f 63 6b 21  30 3a 4d 6f 75 73 65 59  |X=Block!0:MouseY|
00001bc0  3d 42 6c 6f 63 6b 21 34  3a 42 75 74 74 6f 6e 73  |=Block!4:Buttons|
00001bd0  3d 42 6c 6f 63 6b 21 38  0d 07 d0 21 57 69 6e 64  |=Block!8...!Wind|
00001be0  6f 77 3d 42 6c 6f 63 6b  21 31 32 3a 49 63 6f 6e  |ow=Block!12:Icon|
00001bf0  3d 42 6c 6f 63 6b 21 31  36 0d 07 da 0f c8 8e 20  |=Block!16...... |
00001c00  57 69 6e 64 6f 77 20 ca  0d 07 e4 22 20 20 c9 20  |Window ...."  . |
00001c10  2d 32 3a f4 20 49 63 6f  6e 20 62 61 72 20 69 63  |-2:. Icon bar ic|
00001c20  6f 6e 20 63 6c 69 63 6b  65 64 0d 07 ee 14 20 20  |on clicked....  |
00001c30  20 20 c8 8e 20 42 75 74  74 6f 6e 73 20 ca 0d 07  |  .. Buttons ...|
00001c40  f8 18 20 20 20 20 20 20  c9 20 31 20 3a 20 f4 20  |..      . 1 : . |
00001c50  41 64 6a 75 73 74 0d 08  02 16 20 20 20 20 20 20  |Adjust....      |
00001c60  c9 20 32 20 3a 20 f4 20  4d 65 6e 75 0d 08 0c 39  |. 2 : . Menu...9|
00001c70  20 20 20 20 20 20 20 20  4d 25 3d 49 42 4d 65 6e  |        M%=IBMen|
00001c80  75 3a 4d 65 6e 75 58 3d  4d 6f 75 73 65 58 3a 4d  |u:MenuX=MouseX:M|
00001c90  65 6e 75 59 3d 4d 6f 75  73 65 59 3a f2 4d 61 6b  |enuY=MouseY:.Mak|
00001ca0  65 4d 65 6e 75 0d 08 16  18 20 20 20 20 20 20 c9  |eMenu....      .|
00001cb0  20 34 20 3a 20 f4 20 53  65 6c 65 63 74 0d 08 20  | 4 : . Select.. |
00001cc0  2f 20 20 20 20 20 20 20  20 f2 4f 70 65 6e 28 43  |/        .Open(C|
00001cd0  6f 6f 72 64 73 2c b9 2c  58 50 6f 73 69 74 69 6f  |oords,.,XPositio|
00001ce0  6e 2c 59 50 6f 73 69 74  69 6f 6e 29 0d 08 2a 09  |n,YPosition)..*.|
00001cf0  20 20 20 20 cb 0d 08 34  0e 20 20 c9 20 43 6f 6f  |    ...4.  . Coo|
00001d00  72 64 73 0d 08 3e 14 20  20 20 20 c8 8e 20 42 75  |rds..>.    .. Bu|
00001d10  74 74 6f 6e 73 20 ca 0d  08 48 18 20 20 20 20 20  |ttons ...H.     |
00001d20  20 c9 20 31 20 3a 20 f4  20 41 64 6a 75 73 74 0d  | . 1 : . Adjust.|
00001d30  08 52 16 20 20 20 20 20  20 c9 20 32 20 3a 20 f4  |.R.      . 2 : .|
00001d40  20 4d 65 6e 75 0d 08 5c  31 20 20 20 20 20 20 20  | Menu..\1       |
00001d50  20 4d 25 3d 4d 61 69 6e  4d 65 6e 75 3a 4d 65 6e  | M%=MainMenu:Men|
00001d60  75 58 3d 4d 6f 75 73 65  58 3a 4d 65 6e 75 59 3d  |uX=MouseX:MenuY=|
00001d70  4d 6f 75 73 65 59 0d 08  66 19 20 20 20 20 20 20  |MouseY..f.      |
00001d80  20 20 e7 20 77 69 6d 70  3e 3d 33 31 30 20 8c 0d  |  . wimp>=310 ..|
00001d90  08 70 60 20 20 20 20 20  20 20 20 20 20 e7 20 c0  |.p`          . .|
00001da0  24 4d 61 69 6e 4d 65 6e  75 54 69 74 6c 65 2c 31  |$MainMenuTitle,1|
00001db0  29 3d 22 5c 22 20 8c 20  24 4d 61 69 6e 4d 65 6e  |)="\" . $MainMen|
00001dc0  75 54 69 74 6c 65 3d c2  24 4d 61 69 6e 4d 65 6e  |uTitle=.$MainMen|
00001dd0  75 54 69 74 6c 65 2c a9  28 24 4d 61 69 6e 4d 65  |uTitle,.($MainMe|
00001de0  6e 75 54 69 74 6c 65 29  2d 31 29 2b bd 31 33 0d  |nuTitle)-1)+.13.|
00001df0  08 7a 43 20 20 20 20 20  20 20 20 20 20 e7 20 58  |.zC          . X|
00001e00  50 6f 73 69 74 69 6f 6e  3d 34 20 8c 20 24 4d 61  |Position=4 . $Ma|
00001e10  69 6e 4d 65 6e 75 54 69  74 6c 65 3d 22 5c 22 2b  |inMenuTitle="\"+|
00001e20  24 4d 61 69 6e 4d 65 6e  75 54 69 74 6c 65 2b bd  |$MainMenuTitle+.|
00001e30  31 33 0d 08 84 0d 20 20  20 20 20 20 20 20 cd 0d  |13....        ..|
00001e40  08 8e 15 20 20 20 20 20  20 20 20 f2 4d 61 6b 65  |...        .Make|
00001e50  4d 65 6e 75 0d 08 98 18  20 20 20 20 20 20 c9 20  |Menu....      . |
00001e60  34 20 3a 20 f4 20 53 65  6c 65 63 74 0d 08 a2 09  |4 : . Select....|
00001e70  20 20 20 20 cb 0d 08 ac  30 20 20 c9 20 4c 6f 63  |    ....0  . Loc|
00001e80  20 80 20 42 75 74 74 6f  6e 73 3c 38 3a f4 20 52  | . Buttons<8:. R|
00001e90  65 70 6f 73 69 74 69 6f  6e 20 6d 61 69 6e 20 77  |eposition main w|
00001ea0  69 6e 64 6f 77 0d 08 b6  13 20 20 20 20 e7 20 49  |indow....    . I|
00001eb0  63 6f 6e 3e 3d 36 20 8c  0d 08 c0 2c 20 20 20 20  |con>=6 ....,    |
00001ec0  20 20 58 50 6f 73 69 74  69 6f 6e 3d a4 52 65 61  |  XPosition=.Rea|
00001ed0  64 57 69 6e 64 6f 77 4c  6f 63 61 74 69 6f 6e 28  |dWindowLocation(|
00001ee0  22 58 22 29 0d 08 ca 2c  20 20 20 20 20 20 59 50  |"X")...,      YP|
00001ef0  6f 73 69 74 69 6f 6e 3d  a4 52 65 61 64 57 69 6e  |osition=.ReadWin|
00001f00  64 6f 77 4c 6f 63 61 74  69 6f 6e 28 22 59 22 29  |dowLocation("Y")|
00001f10  0d 08 d4 44 20 20 20 20  20 20 e7 20 a4 4f 70 65  |...D      . .Ope|
00001f20  6e 53 74 61 74 65 28 43  6f 6f 72 64 73 29 20 8c  |nState(Coords) .|
00001f30  20 f2 4f 70 65 6e 28 43  6f 6f 72 64 73 2c a3 2c  | .Open(Coords,.,|
00001f40  58 50 6f 73 69 74 69 6f  6e 2c 59 50 6f 73 69 74  |XPosition,YPosit|
00001f50  69 6f 6e 29 0d 08 de 09  20 20 20 20 cd 0d 08 e8  |ion)....    ....|
00001f60  05 cb 0d 08 f2 05 e1 0d  08 fc 05 3a 0d 09 06 11  |...........:....|
00001f70  dd 20 f2 4b 65 79 50 72  65 73 73 65 64 0d 09 10  |. .KeyPressed...|
00001f80  32 57 69 6e 64 6f 77 3d  42 6c 6f 63 6b 21 30 3a  |2Window=Block!0:|
00001f90  49 63 6f 6e 3d 42 6c 6f  63 6b 21 34 3a 43 68 61  |Icon=Block!4:Cha|
00001fa0  72 61 63 74 65 72 3d 42  6c 6f 63 6b 21 32 34 0d  |racter=Block!24.|
00001fb0  09 1a 0f c8 8e 20 57 69  6e 64 6f 77 20 ca 0d 09  |..... Window ...|
00001fc0  24 0a 20 20 c9 20 30 3a  0d 09 2e 07 20 20 7f 0d  |$.  . 0:....  ..|
00001fd0  09 38 26 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |.8&    .. "Wimp_|
00001fe0  50 72 6f 63 65 73 73 4b  65 79 22 2c 43 68 61 72  |ProcessKey",Char|
00001ff0  61 63 74 65 72 0d 09 42  05 cb 0d 09 4c 05 e1 0d  |acter..B....L...|
00002000  09 56 05 3a 0d 09 60 11  dd 20 f2 44 65 63 6f 64  |.V.:..`.. .Decod|
00002010  65 4d 65 6e 75 0d 09 6a  2a 53 75 62 30 3d 42 6c  |eMenu..j*Sub0=Bl|
00002020  6f 63 6b 21 30 3a 53 75  62 31 3d 42 6c 6f 63 6b  |ock!0:Sub1=Block|
00002030  21 34 3a 53 75 62 32 3d  42 6c 6f 63 6b 21 38 0d  |!4:Sub2=Block!8.|
00002040  09 74 0f 43 6c 6f 73 65  4d 65 6e 75 3d a3 0d 09  |.t.CloseMenu=...|
00002050  7e 0b c8 8e 20 4d 25 20  ca 0d 09 88 0f 20 20 c9  |~... M% .....  .|
00002060  20 49 42 4d 65 6e 75 3a  0d 09 92 11 20 20 20 20  | IBMenu:....    |
00002070  c8 8e 20 53 75 62 30 20  ca 0d 09 9c 0d 20 20 20  |.. Sub0 .....   |
00002080  20 20 20 c9 20 30 0d 09  a6 2b 20 20 20 20 20 20  |   . 0...+      |
00002090  20 20 c8 99 20 22 57 69  6d 70 5f 47 65 74 50 6f  |  .. "Wimp_GetPo|
000020a0  69 6e 74 65 72 49 6e 66  6f 22 2c 2c 42 6c 6f 63  |interInfo",,Bloc|
000020b0  6b 0d 09 b0 3c 20 20 20  20 20 20 20 20 c8 99 20  |k...<        .. |
000020c0  22 57 69 6d 70 5f 43 72  65 61 74 65 4d 65 6e 75  |"Wimp_CreateMenu|
000020d0  22 2c 2c 49 6e 66 6f 2c  42 6c 6f 63 6b 21 30 2d  |",,Info,Block!0-|
000020e0  32 34 2c 42 6c 6f 63 6b  21 34 2b 32 34 0d 09 ba  |24,Block!4+24...|
000020f0  17 20 20 20 20 20 20 20  20 43 6c 6f 73 65 4d 65  |.        CloseMe|
00002100  6e 75 3d b9 0d 09 c4 0d  20 20 20 20 20 20 c9 20  |nu=.....      . |
00002110  31 0d 09 ce 12 20 20 20  20 20 20 20 20 44 6f 6e  |1....        Don|
00002120  65 3d b9 0d 09 d8 09 20  20 20 20 cb 0d 09 e2 11  |e=.....    .....|
00002130  20 20 c9 20 4d 61 69 6e  4d 65 6e 75 3a 0d 09 ec  |  . MainMenu:...|
00002140  11 20 20 20 20 c8 8e 20  53 75 62 30 20 ca 0d 09  |.    .. Sub0 ...|
00002150  f6 0d 20 20 20 20 20 20  c9 20 30 0d 0a 00 2b 20  |..      . 0...+ |
00002160  20 20 20 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |       .. "Wimp_|
00002170  47 65 74 50 6f 69 6e 74  65 72 49 6e 66 6f 22 2c  |GetPointerInfo",|
00002180  2c 42 6c 6f 63 6b 0d 0a  0a 3c 20 20 20 20 20 20  |,Block...<      |
00002190  20 20 c8 99 20 22 57 69  6d 70 5f 43 72 65 61 74  |  .. "Wimp_Creat|
000021a0  65 4d 65 6e 75 22 2c 2c  49 6e 66 6f 2c 42 6c 6f  |eMenu",,Info,Blo|
000021b0  63 6b 21 30 2d 32 34 2c  42 6c 6f 63 6b 21 34 2b  |ck!0-24,Block!4+|
000021c0  32 34 0d 0a 14 17 20 20  20 20 20 20 20 20 43 6c  |24....        Cl|
000021d0  6f 73 65 4d 65 6e 75 3d  b9 0d 0a 1e 0d 20 20 20  |oseMenu=.....   |
000021e0  20 20 20 c9 20 31 0d 0a  28 2b 20 20 20 20 20 20  |   . 1..(+      |
000021f0  20 20 c8 99 20 22 57 69  6d 70 5f 47 65 74 50 6f  |  .. "Wimp_GetPo|
00002200  69 6e 74 65 72 49 6e 66  6f 22 2c 2c 42 6c 6f 63  |interInfo",,Bloc|
00002210  6b 0d 0a 32 3b 20 20 20  20 20 20 20 20 c8 99 20  |k..2;        .. |
00002220  22 57 69 6d 70 5f 43 72  65 61 74 65 4d 65 6e 75  |"Wimp_CreateMenu|
00002230  22 2c 2c 4c 6f 63 2c 42  6c 6f 63 6b 21 30 2d 32  |",,Loc,Block!0-2|
00002240  34 2c 42 6c 6f 63 6b 21  34 2b 32 34 0d 0a 3c 17  |4,Block!4+24..<.|
00002250  20 20 20 20 20 20 20 20  43 6c 6f 73 65 4d 65 6e  |        CloseMen|
00002260  75 3d b9 0d 0a 46 0d 20  20 20 20 20 20 c9 20 32  |u=...F.      . 2|
00002270  0d 0a 50 5c 20 20 20 20  20 20 20 20 e7 20 ac 20  |..P\        . . |
00002280  a4 53 61 76 65 53 65 74  74 69 6e 67 73 20 8c 20  |.SaveSettings . |
00002290  85 20 39 39 39 39 2c 22  41 6e 20 65 72 72 6f 72  |. 9999,"An error|
000022a0  20 6f 63 63 75 72 72 65  64 20 77 68 69 6c 73 74  | occurred whilst|
000022b0  20 77 72 69 74 69 6e 67  20 74 68 65 20 73 65 74  | writing the set|
000022c0  74 69 6e 67 73 20 66 69  6c 65 2e 22 0d 0a 5a 09  |tings file."..Z.|
000022d0  20 20 20 20 cb 0d 0a 64  05 cb 0d 0a 6e 23 c8 99  |    ...d....n#..|
000022e0  20 22 57 69 6d 70 5f 47  65 74 50 6f 69 6e 74 65  | "Wimp_GetPointe|
000022f0  72 49 6e 66 6f 22 2c 2c  42 6c 6f 63 6b 0d 0a 78  |rInfo",,Block..x|
00002300  33 e7 20 28 28 42 6c 6f  63 6b 21 38 20 80 20 31  |3. ((Block!8 . 1|
00002310  29 3d 31 29 20 80 20 28  ac 20 43 6c 6f 73 65 4d  |)=1) . (. CloseM|
00002320  65 6e 75 29 20 8c 20 f2  4d 61 6b 65 4d 65 6e 75  |enu) . .MakeMenu|
00002330  0d 0a 82 05 e1 0d 0a 8c  05 3a 0d 0a 96 4f f4 20  |.........:...O. |
00002340  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002380  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 0a a0 13 f4 20 4d  |---------..... M|
00002390  65 6e 75 20 72 6f 75 74  69 6e 65 73 0d 0a aa 4f  |enu routines...O|
000023a0  f4 20 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |. --------------|
000023b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000023e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 0a b4 05 3a  |-----------....:|
000023f0  0d 0a be 11 dd 20 f2 42  75 69 6c 64 4d 65 6e 75  |..... .BuildMenu|
00002400  73 0d 0a c8 49 f4 20 54  68 69 73 20 70 72 6f 63  |s...I. This proc|
00002410  65 64 75 72 65 20 73 68  6f 75 6c 64 20 6f 6e 6c  |edure should onl|
00002420  79 20 62 65 20 76 69 73  69 74 65 64 20 6f 6e 63  |y be visited onc|
00002430  65 2c 20 73 69 6e 63 65  20 69 74 20 63 6f 6e 74  |e, since it cont|
00002440  61 69 6e 73 20 44 49 4d  73 2e 0d 0a d2 07 20 20  |ains DIMs.....  |
00002450  3a 0d 0a dc 4f f4 20 49  6e 20 74 68 65 20 6d 65  |:...O. In the me|
00002460  6e 75 20 74 69 74 6c 65  20 73 74 72 69 6e 67 73  |nu title strings|
00002470  20 62 65 6c 6f 77 2c 20  69 66 20 61 20 22 7c 22  | below, if a "|"|
00002480  20 63 68 61 72 61 63 74  65 72 20 69 73 20 70 72  | character is pr|
00002490  65 73 65 6e 74 20 69 74  20 77 69 6c 6c 20 62 65  |esent it will be|
000024a0  0d 0a e6 4f f4 20 72 65  70 6c 61 63 65 64 20 62  |...O. replaced b|
000024b0  79 20 61 20 73 70 61 63  65 20 75 6e 64 65 72 20  |y a space under |
000024c0  52 49 53 43 20 4f 53 20  33 2e 31 20 28 6f 72 20  |RISC OS 3.1 (or |
000024d0  67 72 65 61 74 65 72 29  2c 20 6f 72 20 77 69 6c  |greater), or wil|
000024e0  6c 20 74 65 72 6d 69 6e  61 74 65 20 74 68 65 0d  |l terminate the.|
000024f0  0a f0 4f f4 20 73 74 72  69 6e 67 20 75 6e 64 65  |..O. string unde|
00002500  72 20 65 61 72 6c 69 65  72 20 76 65 72 73 69 6f  |r earlier versio|
00002510  6e 73 20 6f 66 20 74 68  65 20 77 69 6d 70 2e 20  |ns of the wimp. |
00002520  54 68 69 73 20 61 6c 6c  6f 77 73 20 74 68 65 20  |This allows the |
00002530  6e 65 77 20 69 6e 64 69  72 65 63 74 65 64 0d 0a  |new indirected..|
00002540  fa 46 f4 20 6d 65 6e 75  20 74 69 74 6c 65 73 20  |.F. menu titles |
00002550  74 6f 20 62 65 20 75 73  65 64 20 28 77 68 69 63  |to be used (whic|
00002560  68 20 77 65 72 65 20 69  6e 74 72 6f 64 75 63 65  |h were introduce|
00002570  64 20 77 69 74 68 20 52  49 53 43 20 4f 53 20 33  |d with RISC OS 3|
00002580  2e 31 29 2e 0d 0b 04 07  20 20 3a 0d 0b 0e 23 49  |.1).....  :...#I|
00002590  6e 64 69 72 65 63 74 4d  65 6e 75 54 65 78 74 4f  |ndirectMenuTextO|
000025a0  66 66 73 65 74 50 6f 69  6e 74 65 72 3d 30 0d 0b  |ffsetPointer=0..|
000025b0  18 4e f4 20 54 68 69 73  20 70 6f 69 6e 74 73 20  |.N. This points |
000025c0  74 6f 20 61 20 70 6f 6f  6c 20 74 6f 20 62 65 20  |to a pool to be |
000025d0  75 73 65 64 20 62 79 20  61 6c 6c 20 6d 65 6e 75  |used by all menu|
000025e0  73 20 66 6f 72 20 74 68  65 69 72 20 69 6e 64 69  |s for their indi|
000025f0  72 65 63 74 65 64 20 74  65 78 74 2e 0d 0b 22 07  |rected text...".|
00002600  20 20 3a 0d 0b 2c 0d 4d  25 3d 49 42 4d 65 6e 75  |  :..,.M%=IBMenu|
00002610  0d 0b 36 4a 54 69 74 6c  65 24 3d 22 43 6f 6f 72  |..6JTitle$="Coor|
00002620  64 69 6e 61 74 65 73 22  3a de 20 49 42 4d 65 6e  |dinates":. IBMen|
00002630  75 54 69 74 6c 65 20 a9  28 54 69 74 6c 65 24 29  |uTitle .(Title$)|
00002640  2b 31 3a 24 49 42 4d 65  6e 75 54 69 74 6c 65 3d  |+1:$IBMenuTitle=|
00002650  54 69 74 6c 65 24 2b bd  31 33 0d 0b 40 1a f2 4d  |Title$+.13..@..M|
00002660  65 6e 75 49 6e 69 74 28  49 42 4d 65 6e 75 54 69  |enuInit(IBMenuTi|
00002670  74 6c 65 29 0d 0b 4a 1c  f2 4d 65 6e 75 49 74 65  |tle)..J..MenuIte|
00002680  6d 28 22 49 6e 66 6f 22  2c 30 2c 49 6e 66 6f 29  |m("Info",0,Info)|
00002690  0d 0b 54 1c f2 4d 65 6e  75 49 74 65 6d 28 22 51  |..T..MenuItem("Q|
000026a0  75 69 74 22 2c 31 32 38  2c 2d 31 29 0d 0b 5e 07  |uit",128,-1)..^.|
000026b0  20 20 3a 0d 0b 68 0f 4d  25 3d 4d 61 69 6e 4d 65  |  :..h.M%=MainMe|
000026c0  6e 75 0d 0b 72 4e 54 69  74 6c 65 24 3d 22 43 6f  |nu..rNTitle$="Co|
000026d0  6f 72 64 69 6e 61 74 65  73 22 3a de 20 4d 61 69  |ordinates":. Mai|
000026e0  6e 4d 65 6e 75 54 69 74  6c 65 20 a9 28 54 69 74  |nMenuTitle .(Tit|
000026f0  6c 65 24 29 2b 32 3a 24  4d 61 69 6e 4d 65 6e 75  |le$)+2:$MainMenu|
00002700  54 69 74 6c 65 3d 54 69  74 6c 65 24 2b bd 31 33  |Title=Title$+.13|
00002710  0d 0b 7c 1c f2 4d 65 6e  75 49 6e 69 74 28 4d 61  |..|..MenuInit(Ma|
00002720  69 6e 4d 65 6e 75 54 69  74 6c 65 29 0d 0b 86 1c  |inMenuTitle)....|
00002730  f2 4d 65 6e 75 49 74 65  6d 28 22 49 6e 66 6f 22  |.MenuItem("Info"|
00002740  2c 32 2c 49 6e 66 6f 29  0d 0b 90 26 f2 4d 65 6e  |,2,Info)...&.Men|
00002750  75 49 74 65 6d 28 22 57  69 6e 64 6f 77 20 70 6f  |uItem("Window po|
00002760  73 69 74 69 6f 6e 22 2c  32 2c 4c 6f 63 29 0d 0b  |sition",2,Loc)..|
00002770  9a 25 f2 4d 65 6e 75 49  74 65 6d 28 22 53 61 76  |.%.MenuItem("Sav|
00002780  65 20 73 65 74 74 69 6e  67 73 22 2c 31 32 38 2c  |e settings",128,|
00002790  2d 31 29 0d 0b a4 05 e1  0d 0b ae 05 3a 0d 0b b8  |-1).........:...|
000027a0  0f dd 20 f2 4d 61 6b 65  4d 65 6e 75 0d 0b c2 17  |.. .MakeMenu....|
000027b0  e7 20 4d 65 6e 75 58 3c  30 20 8c 20 4d 65 6e 75  |. MenuX<0 . Menu|
000027c0  58 3d 30 0d 0b cc 2a e7  20 4d 65 6e 75 59 3c 31  |X=0...*. MenuY<1|
000027d0  38 34 20 8c 20 4d 65 6e  75 59 3d 31 38 34 3a f4  |84 . MenuY=184:.|
000027e0  20 66 6f 72 20 69 63 6f  6e 20 62 61 72 0d 0b d6  | for icon bar...|
000027f0  37 c8 99 20 22 57 69 6d  70 5f 43 72 65 61 74 65  |7.. "Wimp_Create|
00002800  4d 65 6e 75 22 2c 2c 4d  25 2c 4d 65 6e 75 58 2d  |Menu",,M%,MenuX-|
00002810  28 28 33 36 2b 4d 25 21  31 36 29 2f 32 29 2c 4d  |((36+M%!16)/2),M|
00002820  65 6e 75 59 0d 0b e0 05  e1 0d 0b ea 05 3a 0d 0b  |enuY.........:..|
00002830  f4 1a dd 20 f2 4d 65 6e  75 49 6e 69 74 28 4d 65  |... .MenuInit(Me|
00002840  6e 75 54 69 74 6c 65 29  0d 0b fe 11 e7 20 77 69  |nuTitle)..... wi|
00002850  6d 70 3e 3d 33 31 30 20  8c 0d 0c 08 37 20 20 41  |mp>=310 ....7  A|
00002860  3d a7 24 4d 65 6e 75 54  69 74 6c 65 2c 22 7c 22  |=.$MenuTitle,"|"|
00002870  29 3a e7 20 41 3c 3e 30  20 8c 20 3f 28 4d 65 6e  |):. A<>0 . ?(Men|
00002880  75 54 69 74 6c 65 2b 28  41 2d 31 29 29 3d 33 32  |uTitle+(A-1))=32|
00002890  0d 0c 12 1b 20 20 4d 65  6e 75 4d 61 78 3d a9 28  |....  MenuMax=.(|
000028a0  24 4d 65 6e 75 54 69 74  6c 65 29 0d 0c 1c 14 20  |$MenuTitle).... |
000028b0  20 4d 25 21 30 3d 4d 65  6e 75 54 69 74 6c 65 0d  | M%!0=MenuTitle.|
000028c0  0c 26 05 cc 0d 0c 30 37  20 20 41 3d a7 24 4d 65  |.&....07  A=.$Me|
000028d0  6e 75 54 69 74 6c 65 2c  22 7c 22 29 3a e7 20 41  |nuTitle,"|"):. A|
000028e0  3c 3e 30 20 8c 20 3f 28  4d 65 6e 75 54 69 74 6c  |<>0 . ?(MenuTitl|
000028f0  65 2b 28 41 2d 31 29 29  3d 31 33 0d 0c 3a 20 20  |e+(A-1))=13..:  |
00002900  20 4d 65 6e 75 4d 61 78  3d a9 28 c0 24 4d 65 6e  | MenuMax=.(.$Men|
00002910  75 54 69 74 6c 65 2c 31  32 29 29 0d 0c 44 19 20  |uTitle,12))..D. |
00002920  20 24 4d 25 3d c0 24 4d  65 6e 75 54 69 74 6c 65  | $M%=.$MenuTitle|
00002930  2c 31 32 29 0d 0c 4e 05  cd 0d 0c 58 24 4d 25 3f  |,12)..N....X$M%?|
00002940  31 32 3d 37 3a 4d 25 3f  31 33 3d 32 3a 4d 25 3f  |12=7:M%?13=2:M%?|
00002950  31 34 3d 31 31 3a 4d 25  3f 31 35 3d 30 0d 0c 62  |14=11:M%?15=0..b|
00002960  14 4d 25 21 31 36 3d 4d  65 6e 75 4d 61 78 2a 31  |.M%!16=MenuMax*1|
00002970  36 0d 0c 6c 14 4d 25 21  32 30 3d 34 34 3a 4d 25  |6..l.M%!20=44:M%|
00002980  21 32 34 3d 30 0d 0c 76  0c 50 25 3d 4d 25 2b 32  |!24=0..v.P%=M%+2|
00002990  38 0d 0c 80 05 e1 0d 0c  8a 05 3a 0d 0c 94 21 dd  |8.........:...!.|
000029a0  20 f2 4d 65 6e 75 49 74  65 6d 28 54 65 78 74 24  | .MenuItem(Text$|
000029b0  2c 46 6c 61 67 73 2c 4c  69 6e 6b 29 0d 0c 9e 4b  |,Flags,Link)...K|
000029c0  f4 20 46 6c 61 67 73 3a  20 31 2d 74 69 63 6b 65  |. Flags: 1-ticke|
000029d0  64 2c 20 32 2d 64 61 73  68 65 64 20 6c 69 6e 65  |d, 2-dashed line|
000029e0  2c 20 34 2d 77 72 69 74  65 61 62 6c 65 2c 20 38  |, 4-writeable, 8|
000029f0  2d 6d 65 73 73 61 67 65  2c 20 31 32 38 2d 6c 61  |-message, 128-la|
00002a00  73 74 20 69 74 65 6d 0d  0c a8 31 f4 20 4c 69 6e  |st item...1. Lin|
00002a10  6b 3a 20 6d 65 6e 75 20  6f 72 20 77 69 6e 64 6f  |k: menu or windo|
00002a20  77 20 68 61 6e 64 6c 65  20 66 6f 72 20 73 75 62  |w handle for sub|
00002a30  2d 70 6f 69 6e 74 65 72  0d 0c b2 18 50 25 21 30  |-pointer....P%!0|
00002a40  3d 46 6c 61 67 73 3a 50  25 21 34 3d 4c 69 6e 6b  |=Flags:P%!4=Link|
00002a50  0d 0c bc 14 e7 20 a9 28  54 65 78 74 24 29 3c 3d  |..... .(Text$)<=|
00002a60  31 32 20 8c 0d 0c c6 25  20 20 50 25 21 38 3d 26  |12 ....%  P%!8=&|
00002a70  30 37 30 30 33 30 32 31  3a f4 20 4e 6f 74 20 69  |07003021:. Not i|
00002a80  6e 64 69 72 65 63 74 65  64 0d 0c d0 14 20 20 24  |ndirected....  $|
00002a90  28 50 25 2b 31 32 29 3d  54 65 78 74 24 0d 0c da  |(P%+12)=Text$...|
00002aa0  05 cc 0d 0c e4 21 20 20  50 25 21 38 3d 26 30 37  |.....!  P%!8=&07|
00002ab0  30 30 33 31 32 31 3a f4  20 49 6e 64 69 72 65 63  |003121:. Indirec|
00002ac0  74 65 64 0d 0c ee 3a 20  20 50 25 21 31 32 3d 49  |ted...:  P%!12=I|
00002ad0  6e 64 69 72 65 63 74 4d  65 6e 75 54 65 78 74 2b  |ndirectMenuText+|
00002ae0  49 6e 64 69 72 65 63 74  4d 65 6e 75 54 65 78 74  |IndirectMenuText|
00002af0  4f 66 66 73 65 74 50 6f  69 6e 74 65 72 0d 0c f8  |OffsetPointer...|
00002b00  15 20 20 50 25 21 31 36  3d 30 3a 50 25 21 32 30  |.  P%!16=0:P%!20|
00002b10  3d 30 0d 0d 02 41 20 20  24 28 49 6e 64 69 72 65  |=0...A  $(Indire|
00002b20  63 74 4d 65 6e 75 54 65  78 74 2b 49 6e 64 69 72  |ctMenuText+Indir|
00002b30  65 63 74 4d 65 6e 75 54  65 78 74 4f 66 66 73 65  |ectMenuTextOffse|
00002b40  74 50 6f 69 6e 74 65 72  29 3d 54 65 78 74 24 2b  |tPointer)=Text$+|
00002b50  bd 31 33 0d 0d 0c 2f 20  20 49 6e 64 69 72 65 63  |.13.../  Indirec|
00002b60  74 4d 65 6e 75 54 65 78  74 4f 66 66 73 65 74 50  |tMenuTextOffsetP|
00002b70  6f 69 6e 74 65 72 2b 3d  a9 28 54 65 78 74 24 29  |ointer+=.(Text$)|
00002b80  2b 31 0d 0d 16 82 20 20  e7 20 49 6e 64 69 72 65  |+1....  . Indire|
00002b90  63 74 4d 65 6e 75 54 65  78 74 4f 66 66 73 65 74  |ctMenuTextOffset|
00002ba0  50 6f 69 6e 74 65 72 3e  49 6e 64 4d 65 6e 75 4d  |Pointer>IndMenuM|
00002bb0  61 78 20 8c 20 85 20 30  2c 22 54 68 65 20 69 6e  |ax . . 0,"The in|
00002bc0  64 69 72 65 63 74 20 6d  65 6e 75 20 74 65 78 74  |direct menu text|
00002bd0  20 62 75 66 66 65 72 20  68 61 73 20 6f 76 65 72  | buffer has over|
00002be0  66 6c 6f 77 65 64 2e 20  50 6c 65 61 73 65 20 61  |flowed. Please a|
00002bf0  6c 6c 6f 63 61 74 65 20  6d 6f 72 65 20 73 70 61  |llocate more spa|
00002c00  63 65 2e 22 0d 0d 20 05  cd 0d 0d 2a 0a 50 25 2b  |ce.".. ....*.P%+|
00002c10  3d 32 34 0d 0d 34 3e e7  20 4d 65 6e 75 4d 61 78  |=24..4>. MenuMax|
00002c20  3c a9 28 54 65 78 74 24  29 20 8c 20 4d 65 6e 75  |<.(Text$) . Menu|
00002c30  4d 61 78 3d a9 28 54 65  78 74 24 29 3a 4d 25 21  |Max=.(Text$):M%!|
00002c40  31 36 3d 28 4d 65 6e 75  4d 61 78 2b 31 29 2a 31  |16=(MenuMax+1)*1|
00002c50  36 0d 0d 3e 41 e7 20 28  46 6c 61 67 73 3d 31 32  |6..>A. (Flags=12|
00002c60  38 29 20 80 20 28 77 69  6d 70 3e 3d 33 31 30 29  |8) . (wimp>=310)|
00002c70  20 8c 20 4d 25 21 32 38  3d 28 28 28 4d 25 21 32  | . M%!28=(((M%!2|
00002c80  38 29 20 80 20 ac 20 32  35 36 29 20 82 20 32 35  |8) . . 256) . 25|
00002c90  36 29 0d 0d 48 37 20 20  f4 20 49 6e 64 69 72 65  |6)..H7  . Indire|
00002ca0  63 74 65 64 20 6d 65 6e  75 20 74 69 74 6c 65 73  |cted menu titles|
00002cb0  20 66 6f 72 20 52 49 53  43 20 4f 53 20 33 2e 31  | for RISC OS 3.1|
00002cc0  20 75 70 77 61 72 64 73  2e 0d 0d 52 05 e1 0d 0d  | upwards...R....|
00002cd0  5c 05 3a 0d 0d 66 4f f4  20 2d 2d 2d 2d 2d 2d 2d  |\.:..fO. -------|
00002ce0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002d20  2d 2d 0d 0d 70 29 f4 20  52 65 73 70 6f 6e 73 65  |--..p). Response|
00002d30  73 20 74 6f 20 69 6e 63  6f 6d 69 6e 67 20 77 69  |s to incoming wi|
00002d40  6d 70 20 6d 65 73 73 61  67 65 73 0d 0d 7a 4f f4  |mp messages..zO.|
00002d50  20 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  | ---------------|
00002d60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00002d90  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0d 0d 84 05 3a 0d  |----------....:.|
00002da0  0d 8e 18 dd 20 f2 53 61  76 65 44 65 73 6b 74 6f  |.... .SaveDeskto|
00002db0  70 28 46 69 6c 65 29 0d  0d 98 07 ea 20 85 0d 0d  |p(File)..... ...|
00002dc0  a2 47 ee 20 85 20 ea 20  42 6c 6f 63 6b 21 31 32  |.G. . . Block!12|
00002dd0  3d 42 6c 6f 63 6b 21 38  3a c8 99 20 22 57 69 6d  |=Block!8:.. "Wim|
00002de0  70 5f 53 65 6e 64 4d 65  73 73 61 67 65 22 2c 31  |p_SendMessage",1|
00002df0  39 2c 42 6c 6f 63 6b 2c  42 6c 6f 63 6b 21 34 3a  |9,Block,Block!4:|
00002e00  f7 20 85 3a e1 0d 0d ac  49 f4 20 54 68 65 20 61  |. .:....I. The a|
00002e10  62 6f 76 65 20 6c 69 6e  65 20 61 63 6b 6e 6f 77  |bove line acknow|
00002e20  6c 65 64 67 65 73 20 74  68 65 20 6d 65 73 73 61  |ledges the messa|
00002e30  67 65 20 69 66 20 61 6e  20 65 72 72 6f 72 20 6f  |ge if an error o|
00002e40  63 63 75 72 73 2c 20 74  68 65 72 65 62 79 0d 0d  |ccurs, thereby..|
00002e50  b6 20 f4 20 61 62 6f 72  74 69 6e 67 20 74 68 65  |. . aborting the|
00002e60  20 64 65 73 6b 74 6f 70  20 73 61 76 65 2e 0d 0d  | desktop save...|
00002e70  c0 2b d5 23 46 69 6c 65  2c 22 52 75 6e 20 22 2b  |.+.#File,"Run "+|
00002e80  4f 75 72 50 61 74 68 4e  61 6d 65 24 2b 4f 75 72  |OurPathName$+Our|
00002e90  46 69 6c 65 4e 61 6d 65  24 0d 0d ca 05 e1 0d 0d  |FileName$.......|
00002ea0  d4 05 3a 0d 0d de 0b dd  20 f2 48 65 6c 70 0d 0d  |..:..... .Help..|
00002eb0  e8 34 42 6c 6f 63 6b 21  31 32 3d 42 6c 6f 63 6b  |.4Block!12=Block|
00002ec0  21 38 3a 42 6c 6f 63 6b  21 31 36 3d 26 35 30 33  |!8:Block!16=&503|
00002ed0  3a 48 65 6c 70 49 6e 66  6f 3d 42 6c 6f 63 6b 2b  |:HelpInfo=Block+|
00002ee0  32 30 0d 0d f2 07 20 20  3a 0d 0d fc 30 f4 20 42  |20....  :...0. B|
00002ef0  6c 6f 63 6b 21 33 32 20  67 69 76 65 73 20 77 69  |lock!32 gives wi|
00002f00  6e 64 6f 77 2c 20 42 6c  6f 63 6b 21 33 36 20 67  |ndow, Block!36 g|
00002f10  69 76 65 73 20 69 63 6f  6e 0d 0e 06 07 20 20 3a  |ives icon....  :|
00002f20  0d 0e 10 11 c8 8e 20 42  6c 6f 63 6b 21 33 32 20  |...... Block!32 |
00002f30  ca 0d 0e 1a 31 20 20 c9  20 2d 32 3a f2 53 65 6e  |....1  . -2:.Sen|
00002f40  64 28 22 54 68 69 73 20  69 73 20 74 68 65 20 43  |d("This is the C|
00002f50  6f 6f 72 64 69 6e 61 74  65 73 20 69 63 6f 6e 2e  |oordinates icon.|
00002f60  22 29 0d 0e 24 3d 20 20  20 20 20 20 20 20 20 20  |")..$=          |
00002f70  f2 53 65 6e 64 28 22 43  6c 69 63 6b 20 4d 45 4e  |.Send("Click MEN|
00002f80  55 20 66 6f 72 20 69 6e  66 6f 72 6d 61 74 69 6f  |U for informatio|
00002f90  6e 20 6f 72 20 74 6f 20  71 75 69 74 2e 22 29 0d  |n or to quit.").|
00002fa0  0e 2e 43 20 20 20 20 20  20 20 20 20 20 f2 53 65  |..C          .Se|
00002fb0  6e 64 28 22 43 6c 69 63  6b 20 53 45 4c 45 43 54  |nd("Click SELECT|
00002fc0  20 74 6f 20 6f 70 65 6e  20 74 68 65 20 63 6f 6f  | to open the coo|
00002fd0  72 64 69 6e 61 74 65 73  20 77 69 6e 64 6f 77 2e  |rdinates window.|
00002fe0  22 29 0d 0e 38 0f 20 20  c9 20 43 6f 6f 72 64 73  |")..8.  . Coords|
00002ff0  3a 0d 0e 42 15 20 20 20  20 c8 8e 20 42 6c 6f 63  |:..B.    .. Bloc|
00003000  6b 21 33 36 20 ca 0d 0e  4c 6f 20 20 20 20 20 20  |k!36 ...Lo      |
00003010  c9 20 30 2c 31 2c 34 2c  35 2c 38 2c 39 3a f2 53  |. 0,1,4,5,8,9:.S|
00003020  65 6e 64 28 22 54 68 69  73 20 61 72 65 61 20 64  |end("This area d|
00003030  69 73 70 6c 61 79 73 20  74 68 65 20 70 6f 69 6e  |isplays the poin|
00003040  74 65 72 27 73 20 73 63  72 65 65 6e 20 63 6f 6f  |ter's screen coo|
00003050  72 64 69 6e 61 74 65 73  20 69 6e 20 4f 70 65 72  |rdinates in Oper|
00003060  61 74 69 6e 67 20 53 79  73 74 65 6d 20 75 6e 69  |ating System uni|
00003070  74 73 2e 22 29 0d 0e 56  53 20 20 20 20 20 20 20  |ts.")..VS       |
00003080  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003090  f2 53 65 6e 64 28 22 54  68 65 20 6f 72 69 67 69  |.Send("The origi|
000030a0  6e 20 69 73 20 61 74 20  74 68 65 20 62 6f 74 74  |n is at the bott|
000030b0  6f 6d 20 6c 65 66 74 20  6f 66 20 74 68 65 20 73  |om left of the s|
000030c0  63 72 65 65 6e 2e 22 29  0d 0e 60 68 20 20 20 20  |creen.")..`h    |
000030d0  20 20 c9 20 32 2c 33 2c  36 2c 37 2c 31 30 2c 31  |  . 2,3,6,7,10,1|
000030e0  31 3a f2 53 65 6e 64 28  22 54 68 69 73 20 61 72  |1:.Send("This ar|
000030f0  65 61 20 64 69 73 70 6c  61 79 73 20 74 68 65 20  |ea displays the |
00003100  70 6f 69 6e 74 65 72 27  73 20 73 63 72 65 65 6e  |pointer's screen|
00003110  20 63 6f 6f 72 64 69 6e  61 74 65 73 20 69 6e 20  | coordinates in |
00003120  73 63 72 65 65 6e 20 70  69 78 65 6c 73 2e 22 29  |screen pixels.")|
00003130  0d 0e 6a 55 20 20 20 20  20 20 20 20 20 20 20 20  |..jU            |
00003140  20 20 20 20 20 20 20 20  20 20 20 20 20 f2 53 65  |             .Se|
00003150  6e 64 28 22 54 68 65 20  6f 72 69 67 69 6e 20 69  |nd("The origin i|
00003160  73 20 61 74 20 74 68 65  20 62 6f 74 74 6f 6d 20  |s at the bottom |
00003170  6c 65 66 74 20 6f 66 20  74 68 65 20 73 63 72 65  |left of the scre|
00003180  65 6e 2e 22 29 0d 0e 74  83 20 20 20 20 20 20 c9  |en.")..t.      .|
00003190  20 31 32 2c 31 33 2c 31  36 2c 31 37 2c 32 30 2c  | 12,13,16,17,20,|
000031a0  32 31 3a f2 53 65 6e 64  28 22 54 68 69 73 20 61  |21:.Send("This a|
000031b0  72 65 61 20 64 69 73 70  6c 61 79 73 20 74 68 65  |rea displays the|
000031c0  20 63 6f 6f 72 64 69 6e  61 74 65 73 20 6f 66 20  | coordinates of |
000031d0  74 68 65 20 70 6f 69 6e  74 65 72 20 77 69 74 68  |the pointer with|
000031e0  69 6e 20 61 20 77 69 6e  64 6f 77 20 69 6e 20 4f  |in a window in O|
000031f0  70 65 72 61 74 69 6e 67  20 53 79 73 74 65 6d 20  |perating System |
00003200  75 6e 69 74 73 2e 22 29  0d 0e 7e 86 20 20 20 20  |units.")..~.    |
00003210  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003220  20 20 20 20 20 f2 53 65  6e 64 28 22 54 68 65 20  |     .Send("The |
00003230  6f 72 69 67 69 6e 20 6f  66 20 61 20 77 69 6e 64  |origin of a wind|
00003240  6f 77 20 69 73 20 75 73  75 61 6c 6c 79 20 61 74  |ow is usually at|
00003250  20 74 68 65 20 74 6f 70  20 6c 65 66 74 20 6f 66  | the top left of|
00003260  20 74 68 65 20 77 6f 72  6b 20 61 72 65 61 2c 20  | the work area, |
00003270  62 75 74 20 74 68 69 73  20 69 73 20 6e 6f 74 20  |but this is not |
00003280  61 6c 77 61 79 73 20 74  72 75 65 2e 22 29 0d 0e  |always true.")..|
00003290  88 7a 20 20 20 20 20 20  c9 20 31 34 2c 31 35 2c  |.z      . 14,15,|
000032a0  31 38 2c 31 39 2c 32 32  2c 32 33 3a f2 53 65 6e  |18,19,22,23:.Sen|
000032b0  64 28 22 54 68 69 73 20  61 72 65 61 20 64 69 73  |d("This area dis|
000032c0  70 6c 61 79 73 20 74 68  65 20 68 61 6e 64 6c 65  |plays the handle|
000032d0  73 20 6f 66 20 74 68 65  20 77 69 6e 64 6f 77 20  |s of the window |
000032e0  61 6e 64 20 69 63 6f 6e  20 28 69 66 20 61 6e 79  |and icon (if any|
000032f0  29 20 62 65 6e 65 61 74  68 20 74 68 65 20 70 6f  |) beneath the po|
00003300  69 6e 74 65 72 2e 22 29  0d 0e 92 34 20 20 20 20  |inter.")...4    |
00003310  20 20 7f 20 f2 53 65 6e  64 28 22 54 68 69 73 20  |  . .Send("This |
00003320  69 73 20 74 68 65 20 43  6f 6f 72 64 69 6e 61 74  |is the Coordinat|
00003330  65 73 20 77 69 6e 64 6f  77 2e 22 29 0d 0e 9c 3a  |es window.")...:|
00003340  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003350  f2 53 65 6e 64 28 22 43  6c 69 63 6b 20 4d 45 4e  |.Send("Click MEN|
00003360  55 20 66 6f 72 20 74 68  65 20 6d 61 69 6e 20 6d  |U for the main m|
00003370  65 6e 75 2e 22 29 0d 0e  a6 09 20 20 20 20 cb 0d  |enu.")....    ..|
00003380  0e b0 49 20 20 c9 20 49  6e 66 6f 3a f2 53 65 6e  |..I  . Info:.Sen|
00003390  64 28 22 54 68 69 73 20  77 69 6e 64 6f 77 20 64  |d("This window d|
000033a0  69 73 70 6c 61 79 73 20  69 6e 66 6f 72 6d 61 74  |isplays informat|
000033b0  69 6f 6e 20 61 62 6f 75  74 20 43 6f 6f 72 64 69  |ion about Coordi|
000033c0  6e 61 74 65 73 2e 22 29  0d 0e ba 5c 20 20 20 20  |nates.")...\    |
000033d0  20 20 20 20 20 20 20 20  f2 53 65 6e 64 28 22 43  |        .Send("C|
000033e0  6f 6f 72 64 69 6e 61 74  65 73 20 69 73 20 61 20  |oordinates is a |
000033f0  6d 65 6d 62 65 72 20 6f  66 20 74 68 65 20 4f 6d  |member of the Om|
00003400  6e 69 44 65 73 6b 20 53  75 69 74 65 20 6f 66 20  |niDesk Suite of |
00003410  64 65 73 6b 74 6f 70 20  75 74 69 6c 69 74 69 65  |desktop utilitie|
00003420  73 2e 22 29 0d 0e c4 0c  20 20 c9 20 4c 6f 63 3a  |s.")....  . Loc:|
00003430  0d 0e ce 0d 20 20 20 c8  8e 20 b9 20 ca 0d 0e d8  |....   .. . ....|
00003440  6d 20 20 20 20 20 c9 20  28 28 42 6c 6f 63 6b 21  |m     . ((Block!|
00003450  33 36 29 3c 36 29 3a f2  53 65 6e 64 28 22 54 68  |36)<6):.Send("Th|
00003460  69 73 20 77 69 6e 64 6f  77 20 6c 65 74 73 20 79  |is window lets y|
00003470  6f 75 20 73 6e 61 70 20  74 68 65 20 6d 61 67 6e  |ou snap the magn|
00003480  69 66 69 65 72 20 77 69  6e 64 6f 77 20 74 6f 20  |ifier window to |
00003490  61 6e 20 69 6e 76 69 73  62 6c 65 20 73 63 72 65  |an invisble scre|
000034a0  65 6e 20 67 72 69 64 2e  22 29 0d 0e e2 9d 20 20  |en grid.")....  |
000034b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000034c0  20 20 20 20 20 20 20 f2  53 65 6e 64 28 22 54 68  |       .Send("Th|
000034d0  65 20 73 65 63 6f 6e 64  20 70 6f 73 69 74 69 6f  |e second positio|
000034e0  6e 20 75 70 20 70 75 74  73 20 74 68 65 20 77 69  |n up puts the wi|
000034f0  6e 64 6f 77 20 6a 75 73  74 20 61 62 6f 76 65 20  |ndow just above |
00003500  74 68 65 20 69 63 6f 6e  2d 62 61 72 2c 20 61 6e  |the icon-bar, an|
00003510  64 20 69 73 20 74 68 65  72 65 66 6f 72 65 20 6e  |d is therefore n|
00003520  6f 74 20 65 76 65 6e 6c  79 20 73 70 61 63 65 64  |ot evenly spaced|
00003530  20 77 69 74 68 20 74 68  65 20 6f 74 68 65 72 20  | with the other |
00003540  72 6f 77 73 2e 22 29 0d  0e ec 87 20 20 20 20 20  |rows.")....     |
00003550  7f 20 f2 53 65 6e 64 28  22 43 6c 69 63 6b 20 53  |. .Send("Click S|
00003560  45 4c 45 43 54 20 6f 6e  20 74 68 65 20 70 6f 73  |ELECT on the pos|
00003570  69 74 69 6f 6e 20 79 6f  75 20 77 61 6e 74 20 74  |ition you want t|
00003580  68 65 20 77 69 6e 64 6f  77 20 74 6f 20 73 6e 61  |he window to sna|
00003590  70 20 74 6f 2c 20 6f 72  20 41 44 4a 55 53 54 20  |p to, or ADJUST |
000035a0  6f 6e 20 74 68 65 20 77  69 6e 64 6f 77 20 69 63  |on the window ic|
000035b0  6f 6e 20 74 6f 20 74 75  72 6e 20 74 68 65 20 73  |on to turn the s|
000035c0  6e 61 70 70 69 6e 67 20  6f 66 66 2e 22 29 0d 0e  |napping off.")..|
000035d0  f6 75 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.u              |
000035e0  20 f2 53 65 6e 64 28 22  49 66 20 73 6e 61 70 70  | .Send("If snapp|
000035f0  69 6e 67 20 69 73 20 6f  6e 2c 20 74 68 65 20 77  |ing is on, the w|
00003600  69 6e 64 6f 77 20 77 69  6c 6c 20 6f 70 65 6e 20  |indow will open |
00003610  61 74 20 74 68 65 20 61  70 70 72 6f 70 72 69 61  |at the appropria|
00003620  74 65 20 70 6f 73 69 74  69 6f 6e 20 77 68 65 6e  |te position when|
00003630  20 79 6f 75 20 63 68 61  6e 67 65 20 6d 6f 64 65  | you change mode|
00003640  2e 22 29 0d 0f 00 08 20  20 20 cb 0d 0f 0a 05 7f  |.")....   ......|
00003650  0d 0f 14 13 20 20 e7 20  77 69 6d 70 3e 3d 32 31  |....  . wimp>=21|
00003660  37 20 8c 0d 0f 1e 31 20  20 20 20 4d 65 6e 75 48  |7 ....1    MenuH|
00003670  65 6c 70 21 30 3d 2d 31  3a 4d 65 6e 75 48 65 6c  |elp!0=-1:MenuHel|
00003680  70 21 34 3d 2d 31 3a 4d  65 6e 75 48 65 6c 70 21  |p!4=-1:MenuHelp!|
00003690  38 3d 2d 31 0d 0f 28 3b  20 20 20 20 c8 99 20 22  |8=-1..(;    .. "|
000036a0  57 69 6d 70 5f 47 65 74  4d 65 6e 75 53 74 61 74  |Wimp_GetMenuStat|
000036b0  65 22 2c 31 2c 4d 65 6e  75 48 65 6c 70 2c 42 6c  |e",1,MenuHelp,Bl|
000036c0  6f 63 6b 21 33 32 2c 42  6c 6f 63 6b 21 33 36 0d  |ock!32,Block!36.|
000036d0  0f 32 0f 20 20 20 20 c8  8e 20 4d 25 20 ca 0d 0f  |.2.    .. M% ...|
000036e0  3c 13 20 20 20 20 20 20  c9 20 49 42 4d 65 6e 75  |<.      . IBMenu|
000036f0  3a 0d 0f 46 1d 20 20 20  20 20 20 20 20 e7 20 4d  |:..F.        . M|
00003700  65 6e 75 48 65 6c 70 21  34 3d 2d 31 20 8c 0d 0f  |enuHelp!4=-1 ...|
00003710  50 1d 20 20 20 20 20 20  20 20 20 20 c8 8e 20 4d  |P.          .. M|
00003720  65 6e 75 48 65 6c 70 21  30 20 ca 0d 0f 5a 59 20  |enuHelp!0 ...ZY |
00003730  20 20 20 20 20 20 20 20  20 20 20 c9 20 30 3a f2  |           . 0:.|
00003740  53 65 6e 64 28 22 4d 6f  76 65 20 74 68 65 20 70  |Send("Move the p|
00003750  6f 69 6e 74 65 72 20 72  69 67 68 74 20 74 6f 20  |ointer right to |
00003760  73 65 65 20 69 6e 66 6f  72 6d 61 74 69 6f 6e 20  |see information |
00003770  61 62 6f 75 74 20 43 6f  6f 72 64 69 6e 61 74 65  |about Coordinate|
00003780  73 2e 22 29 0d 0f 64 3e  20 20 20 20 20 20 20 20  |s.")..d>        |
00003790  20 20 20 20 c9 20 31 3a  f2 53 65 6e 64 28 22 43  |    . 1:.Send("C|
000037a0  6c 69 63 6b 20 53 45 4c  45 43 54 20 74 6f 20 71  |lick SELECT to q|
000037b0  75 69 74 20 43 6f 6f 72  64 69 6e 61 74 65 73 2e  |uit Coordinates.|
000037c0  22 29 0d 0f 6e 41 20 20  20 20 20 20 20 20 20 20  |")..nA          |
000037d0  20 20 7f 20 f2 53 65 6e  64 28 22 54 68 69 73 20  |  . .Send("This |
000037e0  69 73 20 74 68 65 20 43  6f 6f 72 64 69 6e 61 74  |is the Coordinat|
000037f0  65 73 20 69 63 6f 6e 2d  62 61 72 20 6d 65 6e 75  |es icon-bar menu|
00003800  2e 22 29 0d 0f 78 0f 20  20 20 20 20 20 20 20 20  |.")..x.         |
00003810  20 cb 0d 0f 82 0d 20 20  20 20 20 20 20 20 cd 0d  | .....        ..|
00003820  0f 8c 15 20 20 20 20 20  20 c9 20 4d 61 69 6e 4d  |...      . MainM|
00003830  65 6e 75 3a 0d 0f 96 57  20 20 20 20 20 20 20 20  |enu:...W        |
00003840  44 69 72 65 63 74 69 6f  6e 24 3d 22 72 69 67 68  |Direction$="righ|
00003850  74 22 3a e7 20 77 69 6d  70 3e 3d 33 31 30 20 80  |t":. wimp>=310 .|
00003860  20 bd 28 4d 61 69 6e 4d  65 6e 75 54 69 74 6c 65  | .(MainMenuTitle|
00003870  3f 30 29 3d 22 5c 22 20  8c 20 44 69 72 65 63 74  |?0)="\" . Direct|
00003880  69 6f 6e 24 3d 22 6c 65  66 74 22 0d 0f a0 1b 20  |ion$="left".... |
00003890  20 20 20 20 20 20 20 c8  8e 20 4d 65 6e 75 48 65  |       .. MenuHe|
000038a0  6c 70 21 30 20 ca 0d 0f  aa 60 20 20 20 20 20 20  |lp!0 ....`      |
000038b0  20 20 20 20 c9 20 30 3a  f2 53 65 6e 64 28 22 4d  |    . 0:.Send("M|
000038c0  6f 76 65 20 74 68 65 20  70 6f 69 6e 74 65 72 20  |ove the pointer |
000038d0  22 2b 44 69 72 65 63 74  69 6f 6e 24 2b 22 20 74  |"+Direction$+" t|
000038e0  6f 20 73 65 65 20 69 6e  66 6f 72 6d 61 74 69 6f  |o see informatio|
000038f0  6e 20 61 62 6f 75 74 20  43 6f 6f 72 64 69 6e 61  |n about Coordina|
00003900  74 65 73 2e 22 29 0d 0f  b4 77 20 20 20 20 20 20  |tes.")...w      |
00003910  20 20 20 20 c9 20 31 3a  f2 53 65 6e 64 28 22 4d  |    . 1:.Send("M|
00003920  6f 76 65 20 74 68 65 20  70 6f 69 6e 74 65 72 20  |ove the pointer |
00003930  22 2b 44 69 72 65 63 74  69 6f 6e 24 2b 22 20 74  |"+Direction$+" t|
00003940  6f 20 73 65 74 20 74 68  65 20 70 6f 73 69 74 69  |o set the positi|
00003950  6f 6e 20 6f 66 20 74 68  65 20 63 6f 6f 72 64 69  |on of the coordi|
00003960  6e 61 74 65 73 20 77 69  6e 64 6f 77 20 6f 6e 20  |nates window on |
00003970  74 68 65 20 73 63 72 65  65 6e 2e 22 29 0d 0f be  |the screen.")...|
00003980  5a 20 20 20 20 20 20 20  20 20 20 c9 20 32 3a f2  |Z          . 2:.|
00003990  53 65 6e 64 28 22 43 6c  69 63 6b 20 53 45 4c 45  |Send("Click SELE|
000039a0  43 54 20 6f 72 20 41 44  4a 55 53 54 20 74 6f 20  |CT or ADJUST to |
000039b0  73 61 76 65 20 74 68 65  20 63 6f 6f 72 64 69 6e  |save the coordin|
000039c0  61 74 65 73 20 77 69 6e  64 6f 77 20 70 6f 73 69  |ates window posi|
000039d0  74 69 6f 6e 2e 22 29 0d  0f c8 3b 20 20 20 20 20  |tion.")...;     |
000039e0  20 20 20 20 20 7f 20 f2  53 65 6e 64 28 22 54 68  |     . .Send("Th|
000039f0  69 73 20 69 73 20 74 68  65 20 43 6f 6f 72 64 69  |is is the Coordi|
00003a00  6e 61 74 65 73 20 6d 61  69 6e 20 6d 65 6e 75 2e  |nates main menu.|
00003a10  22 29 0d 0f d2 0d 20 20  20 20 20 20 20 20 cb 0d  |")....        ..|
00003a20  0f dc 09 20 20 20 20 cb  0d 0f e6 07 20 20 cd 0d  |...    .....  ..|
00003a30  0f f0 05 cb 0d 0f fa 07  20 20 3a 0d 10 04 0f 3f  |........  :....?|
00003a40  48 65 6c 70 49 6e 66 6f  3d 30 0d 10 0e 24 42 6c  |HelpInfo=0...$Bl|
00003a50  6f 63 6b 21 30 3d 28 48  65 6c 70 49 6e 66 6f 2b  |ock!0=(HelpInfo+|
00003a60  34 2d 42 6c 6f 63 6b 29  20 80 20 ac 20 33 0d 10  |4-Block) . . 3..|
00003a70  18 2a c8 99 20 22 57 69  6d 70 5f 53 65 6e 64 4d  |.*.. "Wimp_SendM|
00003a80  65 73 73 61 67 65 22 2c  31 37 2c 42 6c 6f 63 6b  |essage",17,Block|
00003a90  2c 42 6c 6f 63 6b 21 34  0d 10 22 05 e1 0d 10 2c  |,Block!4.."....,|
00003aa0  05 3a 0d 10 36 1a dd 20  a4 4f 6d 6e 69 48 65 6c  |.:..6.. .OmniHel|
00003ab0  70 4d 65 73 73 61 67 65  28 41 24 29 0d 10 40 3b  |pMessage(A$)..@;|
00003ac0  e7 20 41 24 3d 22 43 4c  49 43 4b 22 20 8c 20 3d  |. A$="CLICK" . =|
00003ad0  c0 22 6f 70 65 6e 20 74  68 65 20 63 6f 6f 72 64  |."open the coord|
00003ae0  69 6e 61 74 65 73 20 77  69 6e 64 6f 77 2e 22 2c  |inates window.",|
00003af0  37 36 29 2b bd 31 33 0d  10 4a 1e e7 20 41 24 3d  |76)+.13..J.. A$=|
00003b00  22 44 52 41 47 22 20 8c  20 3d c0 22 22 2c 37 36  |"DRAG" . =."",76|
00003b10  29 2b bd 31 33 0d 10 54  07 3d 22 22 0d 10 5e 05  |)+.13..T.=""..^.|
00003b20  3a 0d 10 68 12 dd 20 f2  53 65 6e 64 28 54 65 78  |:..h.. .Send(Tex|
00003b30  74 24 29 0d 10 72 18 24  48 65 6c 70 49 6e 66 6f  |t$)..r.$HelpInfo|
00003b40  3d 54 65 78 74 24 2b 22  7c 4d 22 0d 10 7c 18 48  |=Text$+"|M"..|.H|
00003b50  65 6c 70 49 6e 66 6f 2b  3d a9 28 54 65 78 74 24  |elpInfo+=.(Text$|
00003b60  29 2b 32 0d 10 86 05 e1  0d 10 90 05 3a 0d 10 9a  |)+2.........:...|
00003b70  16 dd 20 f2 4f 6d 6e 69  44 65 73 6b 43 61 6c 6c  |.. .OmniDeskCall|
00003b80  69 6e 67 0d 10 a4 14 e7  20 4f 6d 6e 69 44 65 73  |ing..... OmniDes|
00003b90  6b 3d 30 20 8c 20 e1 0d  10 ae 49 f4 20 54 68 69  |k=0 . ....I. Thi|
00003ba0  73 20 66 69 72 73 74 20  6c 69 6e 65 20 69 73 20  |s first line is |
00003bb0  66 6f 72 20 69 66 20 61  20 62 72 6f 61 64 63 61  |for if a broadca|
00003bc0  73 74 20 6d 65 73 73 61  67 65 20 69 73 20 72 65  |st message is re|
00003bd0  63 65 69 76 65 64 20 77  68 69 63 68 20 77 61 73  |ceived which was|
00003be0  0d 10 b8 41 f4 20 69 6e  74 65 6e 64 65 64 20 66  |...A. intended f|
00003bf0  6f 72 20 61 20 74 72 61  6e 73 69 65 6e 74 20 63  |or a transient c|
00003c00  6f 70 79 20 6f 66 20 74  68 65 20 75 74 69 6c 69  |opy of the utili|
00003c10  74 79 2e 20 41 20 73 74  61 6e 64 2d 61 6c 6f 6e  |ty. A stand-alon|
00003c20  65 0d 10 c2 3f f4 20 69  6e 73 74 61 6e 74 69 61  |e...?. instantia|
00003c30  74 69 6f 6e 20 6f 66 20  74 68 65 20 75 74 69 6c  |tion of the util|
00003c40  69 74 79 20 73 68 6f 75  6c 64 20 69 67 6e 6f 72  |ity should ignor|
00003c50  65 20 73 75 63 68 20 6d  65 73 73 61 67 65 73 2e  |e such messages.|
00003c60  0d 10 cc 11 c8 8e 20 42  6c 6f 63 6b 21 32 30 20  |...... Block!20 |
00003c70  ca 0d 10 d6 2d 20 20 c9  20 34 3a f2 4f 70 65 6e  |....-  . 4:.Open|
00003c80  28 43 6f 6f 72 64 73 2c  b9 2c 58 50 6f 73 69 74  |(Coords,.,XPosit|
00003c90  69 6f 6e 2c 59 50 6f 73  69 74 69 6f 6e 29 0d 10  |ion,YPosition)..|
00003ca0  e0 05 cb 0d 10 ea 05 e1  0d 10 f4 05 3a 0d 10 fe  |............:...|
00003cb0  11 dd 20 f2 4d 6f 64 65  43 68 61 6e 67 65 0d 11  |.. .ModeChange..|
00003cc0  08 12 44 6f 4d 6f 64 65  43 68 61 6e 67 65 3d b9  |..DoModeChange=.|
00003cd0  0d 11 12 3b e7 20 4f 6d  6e 69 44 65 73 6b 3d 30  |...;. OmniDesk=0|
00003ce0  20 8c 20 f2 55 70 64 61  74 65 49 63 6f 6e 46 6f  | . .UpdateIconFo|
00003cf0  72 4d 6f 64 65 28 22 21  43 6f 6f 72 64 73 22 2c  |rMode("!Coords",|
00003d00  2d 32 2c 49 63 6f 6e 42  61 72 29 0d 11 1c 05 e1  |-2,IconBar).....|
00003d10  0d 11 26 05 3a 0d 11 30  4f f4 20 2d 2d 2d 2d 2d  |..&.:..0O. -----|
00003d20  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003d60  2d 2d 2d 2d 0d 11 3a 38  f4 20 47 65 6e 65 72 61  |----..:8. Genera|
00003d70  6c 20 6e 6f 6e 2d 73 70  65 63 69 66 69 63 20 75  |l non-specific u|
00003d80  73 65 66 75 6c 20 72 6f  75 74 69 6e 65 73 20 28  |seful routines (|
00003d90  6d 6f 73 74 6c 79 20 77  69 6d 70 29 0d 11 44 4f  |mostly wimp)..DO|
00003da0  f4 20 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |. --------------|
00003db0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00003de0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 11 4e 05 3a  |-----------..N.:|
00003df0  0d 11 58 20 dd 20 f2 55  70 64 61 74 65 49 63 6f  |..X . .UpdateIco|
00003e00  6e 28 57 6e 64 77 2c 49  63 6e 2c 54 78 74 24 29  |n(Wndw,Icn,Txt$)|
00003e10  0d 11 62 3a 42 6c 6f 63  6b 21 30 3d 57 6e 64 77  |..b:Block!0=Wndw|
00003e20  3a 42 6c 6f 63 6b 21 34  3d 49 63 6e 3a c8 99 20  |:Block!4=Icn:.. |
00003e30  22 57 69 6d 70 5f 47 65  74 49 63 6f 6e 53 74 61  |"Wimp_GetIconSta|
00003e40  74 65 22 2c 2c 42 6c 6f  63 6b 0d 11 6c 1c e7 20  |te",,Block..l.. |
00003e50  a9 28 54 78 74 24 29 3e  28 42 6c 6f 63 6b 21 33  |.(Txt$)>(Block!3|
00003e60  36 29 2d 31 20 8c 0d 11  76 26 20 20 e7 20 28 28  |6)-1 ...v&  . ((|
00003e70  42 6c 6f 63 6b 21 32 34  29 20 80 20 28 31 3c 3c  |Block!24) . (1<<|
00003e80  39 29 29 3d 28 31 3c 3c  39 29 20 8c 0d 11 80 19  |9))=(1<<9) .....|
00003e90  20 20 20 20 f4 20 52 69  67 68 74 2d 6a 75 73 74  |    . Right-just|
00003ea0  69 66 69 65 64 0d 11 8a  24 20 20 20 20 54 78 74  |ified...$    Txt|
00003eb0  24 3d 22 88 22 2b c2 54  78 74 24 2c 28 42 6c 6f  |$="."+.Txt$,(Blo|
00003ec0  63 6b 21 33 36 29 2d 32  29 0d 11 94 07 20 20 cc  |ck!36)-2)....  .|
00003ed0  0d 11 9e 23 20 20 20 20  f4 20 4c 65 66 74 2d 6a  |...#    . Left-j|
00003ee0  75 73 74 69 66 69 65 64  20 6f 72 20 63 65 6e 74  |ustified or cent|
00003ef0  72 65 64 0d 11 a8 2b 20  20 20 20 54 78 74 24 3d  |red...+    Txt$=|
00003f00  c0 54 78 74 24 2c 28 42  6c 6f 63 6b 21 33 36 29  |.Txt$,(Block!36)|
00003f10  2d 31 29 3a c2 54 78 74  24 29 3d 22 89 22 0d 11  |-1):.Txt$)="."..|
00003f20  b2 07 20 20 cd 0d 11 bc  05 cd 0d 11 c6 46 f4 20  |..  .........F. |
00003f30  5e 20 45 6e 73 75 72 65  73 20 74 68 65 20 74 65  |^ Ensures the te|
00003f40  78 74 20 63 61 6e 27 74  20 6f 76 65 72 66 6c 6f  |xt can't overflo|
00003f50  77 20 74 68 65 20 6d 61  78 69 6d 75 6d 20 73 70  |w the maximum sp|
00003f60  61 63 65 20 69 6e 20 74  68 65 20 69 63 6f 6e 2e  |ace in the icon.|
00003f70  0d 11 d0 19 e7 20 24 28  42 6c 6f 63 6b 21 32 38  |..... $(Block!28|
00003f80  29 3c 3e 54 78 74 24 20  8c 0d 11 da 2b 20 20 24  |)<>Txt$ ....+  $|
00003f90  28 42 6c 6f 63 6b 21 32  38 29 3d 54 78 74 24 3a  |(Block!28)=Txt$:|
00003fa0  42 6c 6f 63 6b 21 38 3d  30 3a 42 6c 6f 63 6b 21  |Block!8=0:Block!|
00003fb0  31 32 3d 30 0d 11 e4 23  20 20 c8 99 20 22 57 69  |12=0...#  .. "Wi|
00003fc0  6d 70 5f 53 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_SetIconState"|
00003fd0  2c 2c 42 6c 6f 63 6b 0d  11 ee 05 cd 0d 11 f8 25  |,,Block........%|
00003fe0  c8 99 20 22 57 69 6d 70  5f 47 65 74 43 61 72 65  |.. "Wimp_GetCare|
00003ff0  74 50 6f 73 69 74 69 6f  6e 22 2c 2c 42 6c 6f 63  |tPosition",,Bloc|
00004000  6b 0d 12 02 22 e7 20 42  6c 6f 63 6b 21 30 3d 57  |k...". Block!0=W|
00004010  6e 64 77 20 80 20 42 6c  6f 63 6b 21 34 3d 49 63  |ndw . Block!4=Ic|
00004020  6e 20 8c 0d 12 0c 3c 20  20 f4 20 49 66 20 74 68  |n ....<  . If th|
00004030  69 73 20 69 63 6f 6e 20  6f 77 6e 73 20 74 68 65  |is icon owns the|
00004040  20 63 61 72 65 74 2c 20  74 68 65 6e 20 70 75 74  | caret, then put|
00004050  20 69 74 20 61 74 20 74  68 65 20 65 6e 64 2e 0d  | it at the end..|
00004060  12 16 38 20 20 c8 99 20  22 57 69 6d 70 5f 53 65  |..8  .. "Wimp_Se|
00004070  74 43 61 72 65 74 50 6f  73 69 74 69 6f 6e 22 2c  |tCaretPosition",|
00004080  57 6e 64 77 2c 49 63 6e  2c 30 2c 30 2c 2d 31 2c  |Wndw,Icn,0,0,-1,|
00004090  a9 28 54 78 74 24 29 0d  12 20 05 cd 0d 12 2a 05  |.(Txt$).. ....*.|
000040a0  e1 0d 12 34 05 3a 0d 12  3e 2b dd 20 f2 55 70 64  |...4.:..>+. .Upd|
000040b0  61 74 65 49 63 6f 6e 43  6f 6c 6f 75 72 28 57 6e  |ateIconColour(Wn|
000040c0  64 77 2c 49 63 6e 2c 46  43 6f 6c 2c 42 43 6f 6c  |dw,Icn,FCol,BCol|
000040d0  29 0d 12 48 1e f4 20 43  68 61 6e 67 65 20 61 6e  |)..H.. Change an|
000040e0  20 69 63 6f 6e 27 73 20  63 6f 6c 6f 75 72 73 0d  | icon's colours.|
000040f0  12 52 3a 42 6c 6f 63 6b  21 30 3d 57 6e 64 77 3a  |.R:Block!0=Wndw:|
00004100  42 6c 6f 63 6b 21 34 3d  49 63 6e 3a c8 99 20 22  |Block!4=Icn:.. "|
00004110  57 69 6d 70 5f 47 65 74  49 63 6f 6e 53 74 61 74  |Wimp_GetIconStat|
00004120  65 22 2c 2c 42 6c 6f 63  6b 0d 12 5c 3b e7 20 28  |e",,Block..\;. (|
00004130  28 28 42 6c 6f 63 6b 3f  32 37 29 3e 3e 34 29 3d  |((Block?27)>>4)=|
00004140  42 43 6f 6c 29 20 80 20  28 28 28 42 6c 6f 63 6b  |BCol) . (((Block|
00004150  3f 32 37 29 20 83 20 31  36 29 3d 46 43 6f 6c 29  |?27) . 16)=FCol)|
00004160  20 8c 20 e1 0d 12 66 27  20 20 f4 20 5e 20 53 61  | . ...f'  . ^ Sa|
00004170  6d 65 20 63 6f 6c 6f 75  72 2c 20 73 6f 20 64 6f  |me colour, so do|
00004180  6e 27 74 20 63 68 61 6e  67 65 2e 0d 12 70 3a 42  |n't change...p:B|
00004190  6c 6f 63 6b 21 31 32 3d  28 25 31 31 31 31 31 31  |lock!12=(%111111|
000041a0  31 31 3c 3c 32 34 29 3a  42 6c 6f 63 6b 21 38 3d  |11<<24):Block!8=|
000041b0  28 42 43 6f 6c 3c 3c 32  38 29 2b 28 46 43 6f 6c  |(BCol<<28)+(FCol|
000041c0  3c 3c 32 34 29 0d 12 7a  21 c8 99 20 22 57 69 6d  |<<24)..z!.. "Wim|
000041d0  70 5f 53 65 74 49 63 6f  6e 53 74 61 74 65 22 2c  |p_SetIconState",|
000041e0  2c 42 6c 6f 63 6b 0d 12  84 05 e1 0d 12 8e 05 3a  |,Block.........:|
000041f0  0d 12 98 29 dd 20 f2 55  70 64 61 74 65 53 65 6c  |...). .UpdateSel|
00004200  65 63 74 65 64 46 6c 61  67 28 57 6e 64 77 2c 49  |ectedFlag(Wndw,I|
00004210  63 6e 2c 53 74 61 74 65  29 0d 12 a2 31 f4 20 55  |cn,State)...1. U|
00004220  73 65 20 53 74 61 74 65  3d 54 52 55 45 20 74 6f  |se State=TRUE to|
00004230  20 6d 61 6b 65 20 69 63  6f 6e 20 62 65 63 6f 6d  | make icon becom|
00004240  65 20 73 65 6c 65 63 74  65 64 0d 12 ac 3a 42 6c  |e selected...:Bl|
00004250  6f 63 6b 21 30 3d 57 6e  64 77 3a 42 6c 6f 63 6b  |ock!0=Wndw:Block|
00004260  21 34 3d 49 63 6e 3a c8  99 20 22 57 69 6d 70 5f  |!4=Icn:.. "Wimp_|
00004270  47 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 42  |GetIconState",,B|
00004280  6c 6f 63 6b 0d 12 b6 2f  e7 20 28 28 42 6c 6f 63  |lock.../. ((Bloc|
00004290  6b 21 32 34 29 20 80 20  28 31 3c 3c 32 31 29 29  |k!24) . (1<<21))|
000042a0  3d 28 28 2d 53 74 61 74  65 29 3c 3c 32 31 29 20  |=((-State)<<21) |
000042b0  8c 20 e1 0d 12 c0 40 42  6c 6f 63 6b 21 31 32 3d  |. ....@Block!12=|
000042c0  28 31 3c 3c 32 31 29 3a  e7 20 53 74 61 74 65 20  |(1<<21):. State |
000042d0  8c 20 42 6c 6f 63 6b 21  38 3d 28 31 3c 3c 32 31  |. Block!8=(1<<21|
000042e0  29 20 8b 20 42 6c 6f 63  6b 21 38 3d 28 30 3c 3c  |) . Block!8=(0<<|
000042f0  32 31 29 0d 12 ca 21 c8  99 20 22 57 69 6d 70 5f  |21)...!.. "Wimp_|
00004300  53 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 42  |SetIconState",,B|
00004310  6c 6f 63 6b 0d 12 d4 05  e1 0d 12 de 05 3a 0d 12  |lock.........:..|
00004320  e8 27 dd 20 f2 55 70 64  61 74 65 53 68 61 64 65  |.'. .UpdateShade|
00004330  64 46 6c 61 67 28 57 6e  64 77 2c 49 63 6e 2c 53  |dFlag(Wndw,Icn,S|
00004340  74 61 74 65 29 0d 12 f2  2f f4 20 55 73 65 20 53  |tate).../. Use S|
00004350  74 61 74 65 3d 54 52 55  45 20 74 6f 20 6d 61 6b  |tate=TRUE to mak|
00004360  65 20 69 63 6f 6e 20 62  65 63 6f 6d 65 20 73 68  |e icon become sh|
00004370  61 64 65 64 0d 12 fc 3a  42 6c 6f 63 6b 21 30 3d  |aded...:Block!0=|
00004380  57 6e 64 77 3a 42 6c 6f  63 6b 21 34 3d 49 63 6e  |Wndw:Block!4=Icn|
00004390  3a c8 99 20 22 57 69 6d  70 5f 47 65 74 49 63 6f  |:.. "Wimp_GetIco|
000043a0  6e 53 74 61 74 65 22 2c  2c 42 6c 6f 63 6b 0d 13  |nState",,Block..|
000043b0  06 2f e7 20 28 28 42 6c  6f 63 6b 21 32 34 29 20  |./. ((Block!24) |
000043c0  80 20 28 31 3c 3c 32 32  29 29 3d 28 28 2d 53 74  |. (1<<22))=((-St|
000043d0  61 74 65 29 3c 3c 32 32  29 20 8c 20 e1 0d 13 10  |ate)<<22) . ....|
000043e0  40 42 6c 6f 63 6b 21 31  32 3d 28 31 3c 3c 32 32  |@Block!12=(1<<22|
000043f0  29 3a e7 20 53 74 61 74  65 20 8c 20 42 6c 6f 63  |):. State . Bloc|
00004400  6b 21 38 3d 28 31 3c 3c  32 32 29 20 8b 20 42 6c  |k!8=(1<<22) . Bl|
00004410  6f 63 6b 21 38 3d 28 30  3c 3c 32 32 29 0d 13 1a  |ock!8=(0<<22)...|
00004420  21 c8 99 20 22 57 69 6d  70 5f 53 65 74 49 63 6f  |!.. "Wimp_SetIco|
00004430  6e 53 74 61 74 65 22 2c  2c 42 6c 6f 63 6b 0d 13  |nState",,Block..|
00004440  24 05 e1 0d 13 2e 05 3a  0d 13 38 1e dd 20 a4 53  |$......:..8.. .S|
00004450  65 6c 65 63 74 65 64 53  74 61 74 65 28 57 6e 64  |electedState(Wnd|
00004460  77 2c 49 63 6e 29 0d 13  42 3a 42 6c 6f 63 6b 21  |w,Icn)..B:Block!|
00004470  30 3d 57 6e 64 77 3a 42  6c 6f 63 6b 21 34 3d 49  |0=Wndw:Block!4=I|
00004480  63 6e 3a c8 99 20 22 57  69 6d 70 5f 47 65 74 49  |cn:.. "Wimp_GetI|
00004490  63 6f 6e 53 74 61 74 65  22 2c 2c 42 6c 6f 63 6b  |conState",,Block|
000044a0  0d 13 4c 29 e7 20 28 28  42 6c 6f 63 6b 21 32 34  |..L). ((Block!24|
000044b0  29 20 80 20 28 31 3c 3c  32 31 29 29 3d 28 31 3c  |) . (1<<21))=(1<|
000044c0  3c 32 31 29 20 8c 20 3d  b9 0d 13 56 06 3d a3 0d  |<21) . =...V.=..|
000044d0  13 60 05 3a 0d 13 6a 1c  dd 20 a4 53 68 61 64 65  |.`.:..j.. .Shade|
000044e0  64 53 74 61 74 65 28 57  6e 64 77 2c 49 63 6e 29  |dState(Wndw,Icn)|
000044f0  0d 13 74 3a 42 6c 6f 63  6b 21 30 3d 57 6e 64 77  |..t:Block!0=Wndw|
00004500  3a 42 6c 6f 63 6b 21 34  3d 49 63 6e 3a c8 99 20  |:Block!4=Icn:.. |
00004510  22 57 69 6d 70 5f 47 65  74 49 63 6f 6e 53 74 61  |"Wimp_GetIconSta|
00004520  74 65 22 2c 2c 42 6c 6f  63 6b 0d 13 7e 29 e7 20  |te",,Block..~). |
00004530  28 28 42 6c 6f 63 6b 21  32 34 29 20 80 20 28 31  |((Block!24) . (1|
00004540  3c 3c 32 32 29 29 3d 28  31 3c 3c 32 32 29 20 8c  |<<22))=(1<<22) .|
00004550  20 3d b9 0d 13 88 06 3d  a3 0d 13 92 05 3a 0d 13  | =.....=.....:..|
00004560  9c 16 dd 20 a4 4f 70 65  6e 53 74 61 74 65 28 57  |... .OpenState(W|
00004570  6e 64 77 29 0d 13 a6 35  f4 20 52 65 74 75 72 6e  |ndw)...5. Return|
00004580  73 20 54 52 55 45 20 69  66 20 77 69 6e 64 6f 77  |s TRUE if window|
00004590  20 69 73 20 6f 70 65 6e  3b 20 66 61 6c 73 65 20  | is open; false |
000045a0  6f 74 68 65 72 77 69 73  65 0d 13 b0 30 42 6c 6f  |otherwise...0Blo|
000045b0  63 6b 21 30 3d 57 6e 64  77 3a c8 99 20 22 57 69  |ck!0=Wndw:.. "Wi|
000045c0  6d 70 5f 47 65 74 57 69  6e 64 6f 77 53 74 61 74  |mp_GetWindowStat|
000045d0  65 22 2c 2c 42 6c 6f 63  6b 0d 13 ba 29 e7 20 28  |e",,Block...). (|
000045e0  28 42 6c 6f 63 6b 21 33  32 29 20 80 20 28 31 3c  |(Block!32) . (1<|
000045f0  3c 31 36 29 29 3d 28 31  3c 3c 31 36 29 20 8c 20  |<16))=(1<<16) . |
00004600  3d b9 0d 13 c4 06 3d a3  0d 13 ce 05 3a 0d 13 d8  |=.....=.....:...|
00004610  21 dd 20 f2 53 68 61 64  65 4d 65 6e 75 28 4d 65  |!. .ShadeMenu(Me|
00004620  6e 75 2c 49 74 65 6d 2c  53 74 61 74 65 29 0d 13  |nu,Item,State)..|
00004630  e2 50 21 28 4d 65 6e 75  2b 32 38 2b 28 32 34 2a  |.P!(Menu+28+(24*|
00004640  49 74 65 6d 29 2b 38 29  3d 28 21 28 4d 65 6e 75  |Item)+8)=(!(Menu|
00004650  2b 32 38 2b 28 32 34 2a  49 74 65 6d 29 2b 38 29  |+28+(24*Item)+8)|
00004660  20 80 20 ac 20 28 31 3c  3c 32 32 29 29 20 82 20  | . . (1<<22)) . |
00004670  28 28 2d 53 74 61 74 65  29 3c 3c 32 32 29 0d 13  |((-State)<<22)..|
00004680  ec 05 e1 0d 13 f6 05 3a  0d 14 00 20 dd 20 f2 54  |.......:... . .T|
00004690  69 63 6b 4d 65 6e 75 28  4d 65 6e 75 2c 49 74 65  |ickMenu(Menu,Ite|
000046a0  6d 2c 53 74 61 74 65 29  0d 14 0a 40 21 28 4d 65  |m,State)...@!(Me|
000046b0  6e 75 2b 32 38 2b 28 32  34 2a 49 74 65 6d 29 29  |nu+28+(24*Item))|
000046c0  3d 28 21 28 4d 65 6e 75  2b 32 38 2b 28 32 34 2a  |=(!(Menu+28+(24*|
000046d0  49 74 65 6d 29 29 20 80  20 ac 20 31 29 20 82 20  |Item)) . . 1) . |
000046e0  28 2d 53 74 61 74 65 29  0d 14 14 05 e1 0d 14 1e  |(-State)........|
000046f0  05 3a 0d 14 28 1c dd 20  a4 4d 65 6e 75 53 68 61  |.:..(.. .MenuSha|
00004700  64 65 64 28 4d 65 6e 75  2c 49 74 65 6d 29 0d 14  |ded(Menu,Item)..|
00004710  32 35 e7 20 28 21 28 4d  65 6e 75 2b 32 38 2b 28  |25. (!(Menu+28+(|
00004720  32 34 2a 49 74 65 6d 29  2b 38 29 20 80 20 28 31  |24*Item)+8) . (1|
00004730  3c 3c 32 32 29 29 3d 28  31 3c 3c 32 32 29 20 8c  |<<22))=(1<<22) .|
00004740  20 3d b9 0d 14 3c 06 3d  a3 0d 14 46 05 3a 0d 14  | =...<.=...F.:..|
00004750  50 1c dd 20 a4 4d 65 6e  75 54 69 63 6b 65 64 28  |P.. .MenuTicked(|
00004760  4d 65 6e 75 2c 49 74 65  6d 29 0d 14 5a 27 e7 20  |Menu,Item)..Z'. |
00004770  28 21 28 4d 65 6e 75 2b  32 38 2b 28 32 34 2a 49  |(!(Menu+28+(24*I|
00004780  74 65 6d 29 29 20 80 20  31 29 3d 31 20 8c 20 3d  |tem)) . 1)=1 . =|
00004790  b9 0d 14 64 06 3d a3 0d  14 6e 05 3a 0d 14 78 19  |...d.=...n.:..x.|
000047a0  dd 20 a4 52 65 61 64 49  63 6f 6e 28 57 6e 64 77  |. .ReadIcon(Wndw|
000047b0  2c 49 63 6e 29 0d 14 82  20 f4 20 52 65 61 64 20  |,Icn)... . Read |
000047c0  6e 75 6d 65 72 69 63 20  76 61 6c 75 65 20 6f 66  |numeric value of|
000047d0  20 69 63 6f 6e 0d 14 8c  3a 42 6c 6f 63 6b 21 30  | icon...:Block!0|
000047e0  3d 57 6e 64 77 3a 42 6c  6f 63 6b 21 34 3d 49 63  |=Wndw:Block!4=Ic|
000047f0  6e 3a c8 99 20 22 57 69  6d 70 5f 47 65 74 49 63  |n:.. "Wimp_GetIc|
00004800  6f 6e 53 74 61 74 65 22  2c 2c 42 6c 6f 63 6b 0d  |onState",,Block.|
00004810  14 96 13 3d bb 28 24 28  42 6c 6f 63 6b 21 32 38  |...=.($(Block!28|
00004820  29 29 0d 14 a0 05 3a 0d  14 aa 1c dd 20 a4 52 65  |))....:..... .Re|
00004830  61 64 49 63 6f 6e 53 74  72 28 57 6e 64 77 2c 49  |adIconStr(Wndw,I|
00004840  63 6e 29 0d 14 b4 1f f4  20 52 65 61 64 20 73 74  |cn)..... Read st|
00004850  72 69 6e 67 20 76 61 6c  75 65 20 6f 66 20 69 63  |ring value of ic|
00004860  6f 6e 0d 14 be 3a 42 6c  6f 63 6b 21 30 3d 57 6e  |on...:Block!0=Wn|
00004870  64 77 3a 42 6c 6f 63 6b  21 34 3d 49 63 6e 3a c8  |dw:Block!4=Icn:.|
00004880  99 20 22 57 69 6d 70 5f  47 65 74 49 63 6f 6e 53  |. "Wimp_GetIconS|
00004890  74 61 74 65 22 2c 2c 42  6c 6f 63 6b 0d 14 c8 10  |tate",,Block....|
000048a0  3d 24 28 42 6c 6f 63 6b  21 32 38 29 0d 14 d2 05  |=$(Block!28)....|
000048b0  3a 0d 14 dc 1a dd 20 a4  4d 6f 64 65 49 6e 66 6f  |:..... .ModeInfo|
000048c0  28 76 61 72 24 2c 6d 6f  64 65 29 0d 14 e6 29 f4  |(var$,mode)...).|
000048d0  20 55 73 65 20 6d 6f 64  65 3d 2d 31 20 66 6f 72  | Use mode=-1 for|
000048e0  20 63 75 72 72 65 6e 74  20 73 63 72 65 65 6e 20  | current screen |
000048f0  6d 6f 64 65 0d 14 f0 0d  c8 8e 20 76 61 72 24 20  |mode...... var$ |
00004900  ca 0d 14 fa 3a 20 20 c9  20 22 58 50 69 78 65 6c  |....:  . "XPixel|
00004910  73 22 3a c8 99 20 22 4f  53 5f 52 65 61 64 4d 6f  |s":.. "OS_ReadMo|
00004920  64 65 56 61 72 69 61 62  6c 65 22 2c 6d 6f 64 65  |deVariable",mode|
00004930  2c 31 31 20 b8 20 2c 2c  76 61 72 0d 15 04 3a 20  |,11 . ,,var...: |
00004940  20 c9 20 22 59 50 69 78  65 6c 73 22 3a c8 99 20  | . "YPixels":.. |
00004950  22 4f 53 5f 52 65 61 64  4d 6f 64 65 56 61 72 69  |"OS_ReadModeVari|
00004960  61 62 6c 65 22 2c 6d 6f  64 65 2c 31 32 20 b8 20  |able",mode,12 . |
00004970  2c 2c 76 61 72 0d 15 0e  36 20 20 c9 20 22 4e 43  |,,var...6  . "NC|
00004980  6f 6c 22 3a c8 99 20 22  4f 53 5f 52 65 61 64 4d  |ol":.. "OS_ReadM|
00004990  6f 64 65 56 61 72 69 61  62 6c 65 22 2c 6d 6f 64  |odeVariable",mod|
000049a0  65 2c 33 20 b8 20 2c 2c  76 61 72 0d 15 18 3c 20  |e,3 . ,,var...< |
000049b0  20 c9 20 22 58 45 69 67  46 61 63 74 6f 72 22 3a  | . "XEigFactor":|
000049c0  c8 99 20 22 4f 53 5f 52  65 61 64 4d 6f 64 65 56  |.. "OS_ReadModeV|
000049d0  61 72 69 61 62 6c 65 22  2c 6d 6f 64 65 2c 34 20  |ariable",mode,4 |
000049e0  b8 20 2c 2c 76 61 72 0d  15 22 3c 20 20 c9 20 22  |. ,,var.."<  . "|
000049f0  59 45 69 67 46 61 63 74  6f 72 22 3a c8 99 20 22  |YEigFactor":.. "|
00004a00  4f 53 5f 52 65 61 64 4d  6f 64 65 56 61 72 69 61  |OS_ReadModeVaria|
00004a10  62 6c 65 22 2c 6d 6f 64  65 2c 35 20 b8 20 2c 2c  |ble",mode,5 . ,,|
00004a20  76 61 72 0d 15 2c 3f 20  20 c9 20 22 42 50 50 22  |var..,?  . "BPP"|
00004a30  3a c8 99 20 22 4f 53 5f  52 65 61 64 4d 6f 64 65  |:.. "OS_ReadMode|
00004a40  56 61 72 69 61 62 6c 65  22 2c 6d 6f 64 65 2c 39  |Variable",mode,9|
00004a50  20 b8 20 2c 2c 76 61 72  3a 76 61 72 3d 32 5e 76  | . ,,var:var=2^v|
00004a60  61 72 0d 15 36 36 20 20  7f 20 76 61 72 3d 2d 31  |ar..66  . var=-1|
00004a70  3a f4 20 46 61 6c 6c 2d  74 68 72 6f 75 67 68 20  |:. Fall-through |
00004a80  66 6f 72 20 61 20 66 61  75 6c 74 79 20 69 6e 70  |for a faulty inp|
00004a90  75 74 20 76 61 6c 75 65  0d 15 40 05 cb 0d 15 4a  |ut value..@....J|
00004aa0  08 3d 76 61 72 0d 15 54  05 3a 0d 15 5e 2b dd 20  |.=var..T.:..^+. |
00004ab0  f2 55 70 64 61 74 65 49  63 6f 6e 46 6f 72 4d 6f  |.UpdateIconForMo|
00004ac0  64 65 28 41 70 70 6e 61  6d 65 24 2c 57 6e 64 77  |de(Appname$,Wndw|
00004ad0  2c 49 63 6e 29 0d 15 68  4e f4 20 54 68 69 73 20  |,Icn)..hN. This |
00004ae0  70 72 6f 63 65 64 75 72  65 20 72 65 71 75 69 72  |procedure requir|
00004af0  65 73 20 74 68 61 74 20  41 4c 4c 20 74 68 65 20  |es that ALL the |
00004b00  69 63 6f 6e 20 73 70 72  69 74 65 73 20 61 72 65  |icon sprites are|
00004b10  20 64 65 66 69 6e 65 64  20 69 6e 20 6d 6f 64 65  | defined in mode|
00004b20  20 32 30 0d 15 72 4e f4  20 6f 72 20 6d 6f 64 65  | 20..rN. or mode|
00004b30  20 32 37 20 28 77 68 69  63 68 20 69 73 20 65 71  | 27 (which is eq|
00004b40  75 69 76 61 6c 65 6e 74  29 20 77 69 74 68 20 61  |uivalent) with a|
00004b50  20 6d 61 73 6b 20 62 75  74 20 6e 6f 20 70 61 6c  | mask but no pal|
00004b60  65 74 74 65 2e 20 54 68  65 79 20 73 68 6f 75 6c  |ette. They shoul|
00004b70  64 0d 15 7c 4e f4 20 73  74 69 6c 6c 20 61 70 70  |d..|N. still app|
00004b80  65 61 72 20 74 6f 20 68  61 76 65 20 74 68 65 20  |ear to have the |
00004b90  65 78 70 65 63 74 65 64  20 72 65 73 6f 6c 75 74  |expected resolut|
00004ba0  69 6f 6e 73 20 61 6e 64  20 6e 75 6d 62 65 72 20  |ions and number |
00004bb0  6f 66 20 63 6f 6c 6f 75  72 73 2c 20 69 2e 65 0d  |of colours, i.e.|
00004bc0  15 86 4e f4 20 21 53 70  72 69 74 65 73 32 33 3a  |..N. !Sprites23:|
00004bd0  20 74 77 6f 20 63 6f 6c  6f 75 72 73 2c 20 68 69  | two colours, hi|
00004be0  67 68 20 72 65 73 6f 6c  75 74 69 6f 6e 2c 20 21  |gh resolution, !|
00004bf0  53 70 72 69 74 65 73 20  28 61 63 74 75 61 6c 6c  |Sprites (actuall|
00004c00  79 20 21 53 70 72 69 74  65 73 32 34 29 0d 15 90  |y !Sprites24)...|
00004c10  4c f4 20 61 74 20 6d 6f  64 65 20 31 32 20 72 65  |L. at mode 12 re|
00004c20  73 6f 6c 75 74 69 6f 6e  20 28 64 6f 75 62 6c 65  |solution (double|
00004c30  20 68 65 69 67 68 74 20  70 69 78 65 6c 73 29 20  | height pixels) |
00004c40  69 6e 20 31 36 20 63 6f  6c 6f 75 72 73 2c 20 61  |in 16 colours, a|
00004c50  6e 64 20 6e 6f 72 6d 61  6c 0d 15 9a 4c f4 20 6d  |nd normal...L. m|
00004c60  6f 64 65 20 32 30 20 72  65 73 6f 6c 75 74 69 6f  |ode 20 resolutio|
00004c70  6e 2c 20 31 36 20 63 6f  6c 6f 75 72 73 20 66 6f  |n, 16 colours fo|
00004c80  72 20 74 68 65 20 21 53  70 72 69 74 65 73 32 32  |r the !Sprites22|
00004c90  20 69 63 6f 6e 2e 20 49  66 20 74 68 69 73 20 69  | icon. If this i|
00004ca0  73 20 6e 6f 74 0d 15 a4  49 f4 20 61 64 68 65 72  |s not...I. adher|
00004cb0  65 64 20 74 6f 2c 20 74  68 65 6e 20 6d 65 6d 6f  |ed to, then memo|
00004cc0  72 79 20 73 68 6f 72 74  61 67 65 20 65 72 72 6f  |ry shortage erro|
00004cd0  72 73 20 6d 61 79 20 6f  63 63 75 72 20 6f 6e 20  |rs may occur on |
00004ce0  61 20 6d 6f 64 65 20 63  68 61 6e 67 65 2e 0d 15  |a mode change...|
00004cf0  ae 13 45 78 74 65 6e 73  69 6f 6e 24 3d 22 32 34  |..Extension$="24|
00004d00  22 0d 15 b8 24 e7 20 a4  4d 6f 64 65 49 6e 66 6f  |"...$. .ModeInfo|
00004d10  28 22 59 45 69 67 46 61  63 74 6f 72 22 2c 2d 31  |("YEigFactor",-1|
00004d20  29 3c 32 20 8c 0d 15 c2  20 20 20 e7 20 a4 4d 6f  |)<2 ....   . .Mo|
00004d30  64 65 49 6e 66 6f 28 22  4e 43 6f 6c 22 2c 2d 31  |deInfo("NCol",-1|
00004d40  29 3e 32 20 8c 0d 15 cc  17 20 20 20 20 45 78 74  |)>2 .....    Ext|
00004d50  65 6e 73 69 6f 6e 24 3d  22 32 32 22 0d 15 d6 07  |ension$="22"....|
00004d60  20 20 cc 0d 15 e0 17 20  20 20 20 45 78 74 65 6e  |  .....    Exten|
00004d70  73 69 6f 6e 24 3d 22 32  33 22 0d 15 ea 07 20 20  |sion$="23"....  |
00004d80  cd 0d 15 f4 05 cd 0d 15  fe 2a c8 99 20 22 57 69  |.........*.. "Wi|
00004d90  6d 70 5f 42 61 73 65 4f  66 53 70 72 69 74 65 73  |mp_BaseOfSprites|
00004da0  22 20 b8 20 2c 69 63 6f  6e 73 70 72 69 74 65 25  |" . ,iconsprite%|
00004db0  0d 16 08 45 c8 99 20 22  4f 53 5f 53 70 72 69 74  |...E.. "OS_Sprit|
00004dc0  65 4f 70 22 2c 32 35 36  2b 32 35 2c 69 63 6f 6e  |eOp",256+25,icon|
00004dd0  73 70 72 69 74 65 25 2c  41 70 70 6e 61 6d 65 24  |sprite%,Appname$|
00004de0  3a f4 20 44 65 6c 65 74  65 20 69 63 6f 6e 20 73  |:. Delete icon s|
00004df0  70 72 69 74 65 0d 16 12  3d f4 20 54 68 65 20 66  |prite...=. The f|
00004e00  6f 6c 6c 6f 77 69 6e 67  20 74 68 72 65 65 20 6c  |ollowing three l|
00004e10  69 6e 65 73 20 61 73 73  75 6d 65 20 61 20 6d 61  |ines assume a ma|
00004e20  73 6b 20 62 75 74 20 6e  6f 20 70 61 6c 65 74 74  |sk but no palett|
00004e30  65 3a 0d 16 1c 62 c8 99  20 22 4f 53 5f 53 70 72  |e:...b.. "OS_Spr|
00004e40  69 74 65 4f 70 22 2c 32  35 36 2b 34 30 2c 53 70  |iteOp",256+40,Sp|
00004e50  72 69 74 65 73 2c 41 70  70 6e 61 6d 65 24 2b 45  |rites,Appname$+E|
00004e60  78 74 65 6e 73 69 6f 6e  24 20 b8 20 2c 2c 2c 77  |xtension$ . ,,,w|
00004e70  2c 68 2c 2c 6d 6f 64 65  3a f4 20 47 65 74 20 69  |,h,,mode:. Get i|
00004e80  6e 66 6f 20 61 62 6f 75  74 20 6e 65 77 20 73 70  |nfo about new sp|
00004e90  72 69 74 65 0d 16 26 5c  c8 99 20 22 4f 53 5f 53  |rite..&\.. "OS_S|
00004ea0  70 72 69 74 65 4f 70 22  2c 32 35 36 2b 31 35 2c  |priteOp",256+15,|
00004eb0  69 63 6f 6e 73 70 72 69  74 65 25 2c 41 70 70 6e  |iconsprite%,Appn|
00004ec0  61 6d 65 24 2c 30 2c 77  2c 68 2c 6d 6f 64 65 3a  |ame$,0,w,h,mode:|
00004ed0  f4 20 43 72 65 61 74 65  20 72 65 70 6c 61 63 65  |. Create replace|
00004ee0  6d 65 6e 74 20 69 63 6f  6e 20 73 70 72 69 74 65  |ment icon sprite|
00004ef0  0d 16 30 3e c8 99 20 22  4f 53 5f 53 70 72 69 74  |..0>.. "OS_Sprit|
00004f00  65 4f 70 22 2c 32 35 36  2b 32 39 2c 69 63 6f 6e  |eOp",256+29,icon|
00004f10  73 70 72 69 74 65 25 2c  41 70 70 6e 61 6d 65 24  |sprite%,Appname$|
00004f20  3a f4 20 43 72 65 61 74  65 20 6d 61 73 6b 0d 16  |:. Create mask..|
00004f30  3a 07 20 20 3a 0d 16 44  2d f4 20 50 61 69 6e 74  |:.  :..D-. Paint|
00004f40  20 73 70 72 69 74 65 20  6d 61 73 6b 20 69 6e 74  | sprite mask int|
00004f50  6f 20 69 63 6f 6e 73 70  72 69 74 65 20 6d 61 73  |o iconsprite mas|
00004f60  6b 3a 0d 16 4e 51 c8 99  20 22 4f 53 5f 53 70 72  |k:..NQ.. "OS_Spr|
00004f70  69 74 65 4f 70 22 2c 32  35 36 2b 36 31 2c 69 63  |iteOp",256+61,ic|
00004f80  6f 6e 73 70 72 69 74 65  25 2c 41 70 70 6e 61 6d  |onsprite%,Appnam|
00004f90  65 24 2c 30 20 b8 20 72  30 2c 72 31 2c 72 32 2c  |e$,0 . r0,r1,r2,|
00004fa0  72 33 3a f4 20 4f 75 74  70 75 74 20 74 6f 20 6d  |r3:. Output to m|
00004fb0  61 73 6b 0d 16 58 55 c8  99 20 22 4f 53 5f 53 70  |ask..XU.. "OS_Sp|
00004fc0  72 69 74 65 4f 70 22 2c  32 35 36 2b 34 39 2c 53  |riteOp",256+49,S|
00004fd0  70 72 69 74 65 73 2c 41  70 70 6e 61 6d 65 24 2b  |prites,Appname$+|
00004fe0  45 78 74 65 6e 73 69 6f  6e 24 2c 30 2c 30 3a f4  |Extension$,0,0:.|
00004ff0  20 50 61 69 6e 74 20 6d  61 73 6b 20 66 72 6f 6d  | Paint mask from|
00005000  20 53 70 72 69 74 65 73  0d 16 62 37 e6 20 34 2c  | Sprites..b7. 4,|
00005010  31 32 38 3a da 3a f4 20  49 6e 76 65 72 74 20 74  |128:.:. Invert t|
00005020  6f 20 6d 61 6b 65 20 6d  61 73 6b 20 74 68 65 20  |o make mask the |
00005030  72 69 67 68 74 20 77 61  79 20 72 6f 75 6e 64 0d  |right way round.|
00005040  16 6c 36 c8 99 20 22 4f  53 5f 53 70 72 69 74 65  |.l6.. "OS_Sprite|
00005050  4f 70 22 2c 72 30 2c 72  31 2c 72 32 2c 72 33 3a  |Op",r0,r1,r2,r3:|
00005060  f4 20 52 65 73 65 74 20  73 63 72 65 65 6e 20 6f  |. Reset screen o|
00005070  75 74 70 75 74 0d 16 76  07 20 20 3a 0d 16 80 23  |utput..v.  :...#|
00005080  f4 20 50 61 69 6e 74 20  73 70 72 69 74 65 20 69  |. Paint sprite i|
00005090  6e 74 6f 20 69 63 6f 6e  73 70 72 69 74 65 3a 0d  |nto iconsprite:.|
000050a0  16 8a 5c c8 99 20 22 4f  53 5f 53 70 72 69 74 65  |..\.. "OS_Sprite|
000050b0  4f 70 22 2c 32 35 36 2b  36 30 2c 69 63 6f 6e 73  |Op",256+60,icons|
000050c0  70 72 69 74 65 25 2c 41  70 70 6e 61 6d 65 24 2c  |prite%,Appname$,|
000050d0  30 20 b8 20 72 30 2c 72  31 2c 72 32 2c 72 33 3a  |0 . r0,r1,r2,r3:|
000050e0  f4 20 4f 75 74 70 75 74  20 74 6f 20 6e 65 77 20  |. Output to new |
000050f0  69 63 6f 6e 20 73 70 72  69 74 65 0d 16 94 57 c8  |icon sprite...W.|
00005100  99 20 22 4f 53 5f 53 70  72 69 74 65 4f 70 22 2c  |. "OS_SpriteOp",|
00005110  32 35 36 2b 33 34 2c 53  70 72 69 74 65 73 2c 41  |256+34,Sprites,A|
00005120  70 70 6e 61 6d 65 24 2b  45 78 74 65 6e 73 69 6f  |ppname$+Extensio|
00005130  6e 24 2c 30 2c 30 2c 38  3a f4 20 50 61 69 6e 74  |n$,0,0,8:. Paint|
00005140  20 63 6f 70 79 20 66 72  6f 6d 20 53 70 72 69 74  | copy from Sprit|
00005150  65 73 0d 16 9e 36 c8 99  20 22 4f 53 5f 53 70 72  |es...6.. "OS_Spr|
00005160  69 74 65 4f 70 22 2c 72  30 2c 72 31 2c 72 32 2c  |iteOp",r0,r1,r2,|
00005170  72 33 3a f4 20 52 65 73  65 74 20 73 63 72 65 65  |r3:. Reset scree|
00005180  6e 20 6f 75 74 70 75 74  0d 16 a8 3a 42 6c 6f 63  |n output...:Bloc|
00005190  6b 21 30 3d 57 6e 64 77  3a 42 6c 6f 63 6b 21 34  |k!0=Wndw:Block!4|
000051a0  3d 49 63 6e 3a c8 99 20  22 57 69 6d 70 5f 47 65  |=Icn:.. "Wimp_Ge|
000051b0  74 49 63 6f 6e 53 74 61  74 65 22 2c 2c 42 6c 6f  |tIconState",,Blo|
000051c0  63 6b 0d 16 b2 45 42 6c  6f 63 6b 21 38 3d 30 3a  |ck...EBlock!8=0:|
000051d0  42 6c 6f 63 6b 21 31 32  3d 30 3a c8 99 20 22 57  |Block!12=0:.. "W|
000051e0  69 6d 70 5f 53 65 74 49  63 6f 6e 53 74 61 74 65  |imp_SetIconState|
000051f0  22 2c 2c 42 6c 6f 63 6b  3a f4 20 52 65 2d 70 6c  |",,Block:. Re-pl|
00005200  6f 74 20 69 63 6f 6e 0d  16 bc 05 e1 0d 16 c6 05  |ot icon.........|
00005210  3a 0d 16 d0 d8 dd 20 a4  43 72 65 61 74 65 57 69  |:..... .CreateWi|
00005220  6e 64 6f 77 28 6d 69 6e  58 2c 6d 69 6e 59 2c 6d  |ndow(minX,minY,m|
00005230  61 78 58 2c 6d 61 78 59  2c 58 6f 66 66 73 65 74  |axX,maxY,Xoffset|
00005240  2c 59 6f 66 66 73 65 74  2c 48 61 6e 64 6c 65 2c  |,Yoffset,Handle,|
00005250  46 6c 61 67 73 2c 54 69  74 6c 65 43 6f 6c 2c 54  |Flags,TitleCol,T|
00005260  69 74 6c 65 42 61 63 6b  43 6f 6c 2c 57 6f 72 6b  |itleBackCol,Work|
00005270  43 6f 6c 2c 57 6f 72 6b  42 61 63 6b 43 6f 6c 2c  |Col,WorkBackCol,|
00005280  53 63 72 6f 6c 6c 43 6f  6c 2c 53 6c 69 64 65 72  |ScrollCol,Slider|
00005290  43 6f 6c 2c 49 6e 70 75  74 43 6f 6c 2c 57 6d 69  |Col,InputCol,Wmi|
000052a0  6e 58 2c 57 6d 69 6e 59  2c 57 6d 61 78 58 2c 57  |nX,WminY,WmaxX,W|
000052b0  6d 61 78 59 2c 54 69 74  6c 65 46 6c 61 67 73 2c  |maxY,TitleFlags,|
000052c0  57 62 75 74 74 6f 6e 2c  53 70 72 69 74 65 50 6f  |Wbutton,SpritePo|
000052d0  69 6e 74 2c 4d 69 6e 57  2c 4d 69 6e 48 2c 54 69  |int,MinW,MinH,Ti|
000052e0  74 6c 65 44 61 74 61 24  29 0d 16 da 5a 42 6c 6f  |tleData$)...ZBlo|
000052f0  63 6b 21 30 3d 6d 69 6e  58 3a 42 6c 6f 63 6b 21  |ck!0=minX:Block!|
00005300  34 3d 6d 69 6e 59 3a 42  6c 6f 63 6b 21 38 3d 6d  |4=minY:Block!8=m|
00005310  61 78 58 3a 42 6c 6f 63  6b 21 31 32 3d 6d 61 78  |axX:Block!12=max|
00005320  59 3a 42 6c 6f 63 6b 21  31 36 3d 58 6f 66 66 73  |Y:Block!16=Xoffs|
00005330  65 74 3a 42 6c 6f 63 6b  21 32 30 3d 59 6f 66 66  |et:Block!20=Yoff|
00005340  73 65 74 0d 16 e4 22 42  6c 6f 63 6b 21 32 34 3d  |set..."Block!24=|
00005350  48 61 6e 64 6c 65 3a 42  6c 6f 63 6b 21 32 38 3d  |Handle:Block!28=|
00005360  46 6c 61 67 73 0d 16 ee  51 42 6c 6f 63 6b 3f 33  |Flags...QBlock?3|
00005370  32 3d 54 69 74 6c 65 43  6f 6c 3a 42 6c 6f 63 6b  |2=TitleCol:Block|
00005380  3f 33 33 3d 54 69 74 6c  65 42 61 63 6b 43 6f 6c  |?33=TitleBackCol|
00005390  3a 42 6c 6f 63 6b 3f 33  34 3d 57 6f 72 6b 43 6f  |:Block?34=WorkCo|
000053a0  6c 3a 42 6c 6f 63 6b 3f  33 35 3d 57 6f 72 6b 42  |l:Block?35=WorkB|
000053b0  61 63 6b 43 6f 6c 0d 16  f8 46 42 6c 6f 63 6b 3f  |ackCol...FBlock?|
000053c0  33 36 3d 53 63 72 6f 6c  6c 43 6f 6c 3a 42 6c 6f  |36=ScrollCol:Blo|
000053d0  63 6b 3f 33 37 3d 53 6c  69 64 65 72 43 6f 6c 3a  |ck?37=SliderCol:|
000053e0  42 6c 6f 63 6b 3f 33 38  3d 49 6e 70 75 74 43 6f  |Block?38=InputCo|
000053f0  6c 3a 42 6c 6f 63 6b 3f  33 39 3d 30 0d 17 02 3f  |l:Block?39=0...?|
00005400  42 6c 6f 63 6b 21 34 30  3d 57 6d 69 6e 58 3a 42  |Block!40=WminX:B|
00005410  6c 6f 63 6b 21 34 34 3d  57 6d 69 6e 59 3a 42 6c  |lock!44=WminY:Bl|
00005420  6f 63 6b 21 34 38 3d 57  6d 61 78 58 3a 42 6c 6f  |ock!48=WmaxX:Blo|
00005430  63 6b 21 35 32 3d 57 6d  61 78 59 0d 17 0c 3d 42  |ck!52=WmaxY...=B|
00005440  6c 6f 63 6b 21 35 36 3d  54 69 74 6c 65 46 6c 61  |lock!56=TitleFla|
00005450  67 73 3a 42 6c 6f 63 6b  21 36 30 3d 57 62 75 74  |gs:Block!60=Wbut|
00005460  74 6f 6e 3a 42 6c 6f 63  6b 21 36 34 3d 53 70 72  |ton:Block!64=Spr|
00005470  69 74 65 50 6f 69 6e 74  0d 17 16 5f 42 6c 6f 63  |itePoint..._Bloc|
00005480  6b 21 36 38 3d 28 4d 69  6e 48 3c 3c 31 35 29 2b  |k!68=(MinH<<15)+|
00005490  4d 69 6e 57 20 3a 3a 3a  3a 3a 3a 3a 3a 3a 3a 3a  |MinW :::::::::::|
000054a0  3a 20 f4 20 30 2c 30 20  73 65 74 73 20 74 68 65  |: . 0,0 sets the|
000054b0  20 6d 69 6e 69 6d 75 6d  20 77 69 6e 64 6f 77 20  | minimum window |
000054c0  77 69 74 68 20 74 6f 20  74 68 65 20 74 69 74 6c  |with to the titl|
000054d0  65 20 77 69 64 74 68 0d  17 20 3e 24 28 42 6c 6f  |e width.. >$(Blo|
000054e0  63 6b 2b 37 32 29 3d 54  69 74 6c 65 44 61 74 61  |ck+72)=TitleData|
000054f0  24 3a 42 6c 6f 63 6b 21  38 34 3d 30 20 3a 3a 3a  |$:Block!84=0 :::|
00005500  20 f4 20 4e 6f 20 69 63  6f 6e 73 20 69 6e 69 74  | . No icons init|
00005510  69 61 6c 6c 79 0d 17 2a  30 c8 99 20 22 57 69 6d  |ially..*0.. "Wim|
00005520  70 5f 43 72 65 61 74 65  57 69 6e 64 6f 77 22 2c  |p_CreateWindow",|
00005530  2c 42 6c 6f 63 6b 20 b8  20 57 69 6e 64 6f 77 48  |,Block . WindowH|
00005540  61 6e 64 6c 65 0d 17 34  11 3d 57 69 6e 64 6f 77  |andle..4.=Window|
00005550  48 61 6e 64 6c 65 0d 17  3e 05 3a 0d 17 48 11 dd  |Handle..>.:..H..|
00005560  20 f2 49 6e 69 74 69 61  6c 69 73 65 0d 17 52 2d  | .Initialise..R-|
00005570  41 70 70 53 69 7a 65 3d  93 2d 26 38 30 30 30 3a  |AppSize=.-&8000:|
00005580  4d 69 6e 53 69 7a 65 3d  41 70 70 53 69 7a 65 3a  |MinSize=AppSize:|
00005590  53 6c 6f 74 45 6e 64 3d  93 0d 17 5c 05 e1 0d 17  |SlotEnd=...\....|
000055a0  66 05 3a 0d 17 70 1f dd  20 a4 41 6c 6c 6f 63 61  |f.:..p.. .Alloca|
000055b0  74 65 4d 65 6d 6f 72 79  28 52 65 71 75 69 72 65  |teMemory(Require|
000055c0  64 29 0d 17 7a 1a 53 6c  6f 74 53 69 7a 65 3d a4  |d)..z.SlotSize=.|
000055d0  53 6c 6f 74 53 69 7a 65  28 2d 31 29 0d 17 84 92  |SlotSize(-1)....|
000055e0  e7 20 53 6c 6f 74 53 69  7a 65 3c 52 65 71 75 69  |. SlotSize<Requi|
000055f0  72 65 64 20 8c 20 4e 65  77 53 69 7a 65 3d a4 53  |red . NewSize=.S|
00005600  6c 6f 74 53 69 7a 65 28  52 65 71 75 69 72 65 64  |lotSize(Required|
00005610  29 3a e7 20 4e 65 77 53  69 7a 65 3c 52 65 71 75  |):. NewSize<Requ|
00005620  69 72 65 64 20 8c 20 53  6c 6f 74 53 69 7a 65 3d  |ired . SlotSize=|
00005630  a4 53 6c 6f 74 53 69 7a  65 28 41 70 70 53 69 7a  |.SlotSize(AppSiz|
00005640  65 29 3a 3d 30 3a f4 20  52 65 74 75 72 6e 73 2c  |e):=0:. Returns,|
00005650  20 69 6e 64 69 63 61 74  69 6e 67 20 6d 65 6d 6f  | indicating memo|
00005660  72 79 20 6e 6f 74 20 63  6c 61 69 6d 65 64 0d 17  |ry not claimed..|
00005670  8e 36 e7 20 53 6c 6f 74  53 69 7a 65 3e 52 65 71  |.6. SlotSize>Req|
00005680  75 69 72 65 64 20 8c 20  53 6c 6f 74 53 69 7a 65  |uired . SlotSize|
00005690  3d a4 53 6c 6f 74 53 69  7a 65 28 52 65 71 75 69  |=.SlotSize(Requi|
000056a0  72 65 64 29 0d 17 98 2a  3d 53 6c 6f 74 53 69 7a  |red)...*=SlotSiz|
000056b0  65 3a f4 20 52 65 74 75  72 6e 73 20 77 69 74 68  |e:. Returns with|
000056c0  20 62 79 74 65 73 20 63  6c 61 69 6d 65 64 0d 17  | bytes claimed..|
000056d0  a2 05 3a 0d 17 ac 16 dd  20 a4 53 6c 6f 74 53 69  |..:..... .SlotSi|
000056e0  7a 65 28 42 79 74 65 73  29 0d 17 b6 27 c8 99 20  |ze(Bytes)...'.. |
000056f0  22 57 69 6d 70 5f 53 6c  6f 74 53 69 7a 65 22 2c  |"Wimp_SlotSize",|
00005700  42 79 74 65 73 2c 2d 31  20 b8 20 42 79 74 65 73  |Bytes,-1 . Bytes|
00005710  0d 17 c0 0a 3d 42 79 74  65 73 0d 17 ca 05 3a 0d  |....=Bytes....:.|
00005720  17 d4 17 dd 20 f2 4d 69  6e 69 6d 69 73 65 57 69  |.... .MinimiseWi|
00005730  6d 70 53 6c 6f 74 0d 17  de 22 64 75 6d 6d 79 3d  |mpSlot..."dummy=|
00005740  a4 41 6c 6c 6f 63 61 74  65 4d 65 6d 6f 72 79 28  |.AllocateMemory(|
00005750  4d 69 6e 53 69 7a 65 29  0d 17 e8 05 e1 0d 17 f2  |MinSize)........|
00005760  05 3a 0d 17 fc 22 dd 20  f2 43 6c 6f 73 65 46 69  |.:...". .CloseFi|
00005770  6c 65 49 66 50 6f 73 73  28 46 69 6c 65 48 61 6e  |leIfPoss(FileHan|
00005780  64 6c 65 29 0d 18 06 07  ea 20 85 0d 18 10 26 ee  |dle)..... ....&.|
00005790  20 85 20 ea 20 f7 20 85  3a e1 3a f4 20 55 6e 61  | . . . .:.:. Una|
000057a0  62 6c 65 20 74 6f 20 63  6c 6f 73 65 20 66 69 6c  |ble to close fil|
000057b0  65 0d 18 1a 10 d9 23 46  69 6c 65 48 61 6e 64 6c  |e.....#FileHandl|
000057c0  65 0d 18 24 05 e1 0d 18  2e 05 3a 0d 18 38 1e dd  |e..$......:..8..|
000057d0  20 a4 46 69 6e 64 46 69  6c 65 53 69 7a 65 28 46  | .FindFileSize(F|
000057e0  69 6c 65 4e 61 6d 65 24  29 0d 18 42 20 e7 20 46  |ileName$)..B . F|
000057f0  69 6c 65 4e 61 6d 65 24  3d 22 3c 57 69 6d 70 24  |ileName$="<Wimp$|
00005800  53 63 72 61 70 3e 22 20  8c 0d 18 4c 3a 20 20 c8  |Scrap>" ...L:  .|
00005810  99 20 22 4f 53 5f 46 69  6c 65 22 2c 31 35 2c 46  |. "OS_File",15,F|
00005820  69 6c 65 4e 61 6d 65 24  2c 2c 2c 46 69 6c 65 4e  |ileName$,,,FileN|
00005830  61 6d 65 24 20 b8 20 2c  2c 2c 2c 46 69 6c 65 53  |ame$ . ,,,,FileS|
00005840  69 7a 65 0d 18 56 05 cc  0d 18 60 34 20 20 4e 3d  |ize..V....`4  N=|
00005850  2d 31 3a f5 3a 4e 2b 3d  31 3a fd 20 c1 46 69 6c  |-1:.:N+=1:. .Fil|
00005860  65 4e 61 6d 65 24 2c a9  28 46 69 6c 65 4e 61 6d  |eName$,.(FileNam|
00005870  65 24 29 2d 4e 2c 31 29  3d 22 2e 22 0d 18 6a 42  |e$)-N,1)="."..jB|
00005880  20 20 50 61 74 68 4e 61  6d 65 24 3d c0 46 69 6c  |  PathName$=.Fil|
00005890  65 4e 61 6d 65 24 2c a9  28 46 69 6c 65 4e 61 6d  |eName$,.(FileNam|
000058a0  65 24 29 2d 4e 29 3a 4c  65 61 66 4e 61 6d 65 24  |e$)-N):LeafName$|
000058b0  3d c2 46 69 6c 65 4e 61  6d 65 24 2c 4e 29 0d 18  |=.FileName$,N)..|
000058c0  74 3a 20 20 c8 99 20 22  4f 53 5f 46 69 6c 65 22  |t:  .. "OS_File"|
000058d0  2c 31 33 2c 4c 65 61 66  4e 61 6d 65 24 2c 2c 2c  |,13,LeafName$,,,|
000058e0  50 61 74 68 4e 61 6d 65  24 20 b8 20 2c 2c 2c 2c  |PathName$ . ,,,,|
000058f0  46 69 6c 65 53 69 7a 65  0d 18 7e 05 cd 0d 18 88  |FileSize..~.....|
00005900  0d 3d 46 69 6c 65 53 69  7a 65 0d 18 92 05 3a 0d  |.=FileSize....:.|
00005910  18 9c 10 dd 20 a4 4e 65  78 74 45 6e 74 72 79 0d  |.... .NextEntry.|
00005920  18 a6 48 f4 20 47 65 74  73 20 6e 65 78 74 20 65  |..H. Gets next e|
00005930  6e 74 72 79 20 28 63 72  65 61 74 65 64 20 62 79  |ntry (created by|
00005940  20 42 50 55 54 23 44 61  74 61 2c 41 24 29 20 66  | BPUT#Data,A$) f|
00005950  72 6f 6d 20 61 20 66 69  6c 65 20 61 73 20 61 20  |rom a file as a |
00005960  73 74 72 69 6e 67 2e 0d  18 b0 1c f4 20 55 73 65  |string...... Use|
00005970  20 61 73 20 41 24 3d 46  4e 4e 65 78 74 45 6e 74  | as A$=FNNextEnt|
00005980  72 79 2e 0d 18 ba 07 ea  20 85 0d 18 c4 26 ee 20  |ry...... ....&. |
00005990  85 20 ea 20 f7 20 85 3a  3d 22 22 3a f4 20 45 72  |. . . .:="":. Er|
000059a0  72 6f 72 20 72 65 61 64  69 6e 67 20 66 69 6c 65  |ror reading file|
000059b0  0d 18 ce 0e 4e 45 24 3d  be 23 44 61 74 61 0d 18  |....NE$=.#Data..|
000059c0  d8 12 c8 95 20 c0 4e 45  24 2c 31 29 3d 22 7c 22  |.... .NE$,1)="|"|
000059d0  0d 18 e2 10 20 20 4e 45  24 3d be 23 44 61 74 61  |....  NE$=.#Data|
000059e0  0d 18 ec 05 ce 0d 18 f6  08 3d 4e 45 24 0d 19 00  |.........=NE$...|
000059f0  05 3a 0d 19 0a 4f f4 20  2d 2d 2d 2d 2d 2d 2d 2d  |.:...O. --------|
00005a00  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00005a40  2d 0d 19 14 2f f4 20 52  6f 75 74 69 6e 65 73 20  |-.../. Routines |
00005a50  63 6f 6d 6d 6f 6e 20 74  6f 20 74 68 65 20 4f 6d  |common to the Om|
00005a60  6e 69 44 65 73 6b 20 75  74 69 6c 69 74 69 65 73  |niDesk utilities|
00005a70  0d 19 1e 4f f4 20 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...O. ----------|
00005a80  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00005ab0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
00005ac0  19 28 05 3a 0d 19 32 18  dd 20 f2 44 65 63 6c 61  |.(.:..2.. .Decla|
00005ad0  72 65 54 6f 4f 6d 6e 69  44 65 73 6b 0d 19 3c 2f  |reToOmniDesk..</|
00005ae0  42 6c 6f 63 6b 21 30 3d  32 30 38 3a 42 6c 6f 63  |Block!0=208:Bloc|
00005af0  6b 21 31 32 3d 30 3a 42  6c 6f 63 6b 21 31 36 3d  |k!12=0:Block!16=|
00005b00  55 74 69 6c 44 65 63 6c  61 72 65 0d 19 46 11 42  |UtilDeclare..F.B|
00005b10  6c 6f 63 6b 21 32 30 3d  54 61 73 6b 0d 19 50 19  |lock!20=Task..P.|
00005b20  24 28 42 6c 6f 63 6b 2b  32 34 29 3d 54 61 73 6b  |$(Block+24)=Task|
00005b30  6e 61 6d 65 24 0d 19 5a  1c 24 28 42 6c 6f 63 6b  |name$..Z.$(Block|
00005b40  2b 34 34 29 3d 4f 75 72  46 69 6c 65 4e 61 6d 65  |+44)=OurFileName|
00005b50  24 0d 19 64 29 24 28 42  6c 6f 63 6b 2b 35 35 29  |$..d)$(Block+55)|
00005b60  3d a4 4f 6d 6e 69 48 65  6c 70 4d 65 73 73 61 67  |=.OmniHelpMessag|
00005b70  65 28 22 43 4c 49 43 4b  22 29 0d 19 6e 29 24 28  |e("CLICK")..n)$(|
00005b80  42 6c 6f 63 6b 2b 31 33  32 29 3d a4 4f 6d 6e 69  |Block+132)=.Omni|
00005b90  48 65 6c 70 4d 65 73 73  61 67 65 28 22 44 52 41  |HelpMessage("DRA|
00005ba0  47 22 29 0d 19 78 2b c8  99 20 22 57 69 6d 70 5f  |G")..x+.. "Wimp_|
00005bb0  53 65 6e 64 4d 65 73 73  61 67 65 22 2c 31 37 2c  |SendMessage",17,|
00005bc0  42 6c 6f 63 6b 2c 4f 6d  6e 69 44 65 73 6b 0d 19  |Block,OmniDesk..|
00005bd0  82 05 e1 0d 19 8c 05 3a  0d 19 96 11 dd 20 f2 53  |.......:..... .S|
00005be0  61 79 47 6f 6f 64 62 79  65 0d 19 a0 13 e7 20 4f  |ayGoodbye..... O|
00005bf0  6d 6e 69 44 65 73 6b 3c  3e 30 20 8c 0d 19 aa 31  |mniDesk<>0 ....1|
00005c00  20 20 42 6c 6f 63 6b 21  30 3d 32 34 3a 42 6c 6f  |  Block!0=24:Blo|
00005c10  63 6b 21 31 32 3d 30 3a  42 6c 6f 63 6b 21 31 36  |ck!12=0:Block!16|
00005c20  3d 55 74 69 6c 51 75 69  74 74 69 6e 67 0d 19 b4  |=UtilQuitting...|
00005c30  13 20 20 42 6c 6f 63 6b  21 32 30 3d 54 61 73 6b  |.  Block!20=Task|
00005c40  0d 19 be 2d 20 20 c8 99  20 22 57 69 6d 70 5f 53  |...-  .. "Wimp_S|
00005c50  65 6e 64 4d 65 73 73 61  67 65 22 2c 31 37 2c 42  |endMessage",17,B|
00005c60  6c 6f 63 6b 2c 4f 6d 6e  69 44 65 73 6b 0d 19 c8  |lock,OmniDesk...|
00005c70  05 cd 0d 19 d2 21 c8 99  20 22 49 6e 74 65 72 66  |.....!.. "Interf|
00005c80  61 63 65 5f 43 6c 6f 73  65 44 6f 77 6e 22 2c 54  |ace_CloseDown",T|
00005c90  61 73 6b 0d 19 dc 26 c8  99 20 22 57 69 6d 70 5f  |ask...&.. "Wimp_|
00005ca0  43 6c 6f 73 65 44 6f 77  6e 22 2c 54 61 73 6b 2c  |CloseDown",Task,|
00005cb0  26 34 42 35 33 34 31 35  34 0d 19 e6 05 e1 0d 19  |&4B534154.......|
00005cc0  f0 05 3a 0d 19 fa 18 dd  20 a4 52 65 61 64 53 74  |..:..... .ReadSt|
00005cd0  61 72 74 75 70 53 74 72  69 6e 67 0d 1a 04 4d f4  |artupString...M.|
00005ce0  20 52 65 74 75 72 6e 73  20 74 61 73 6b 20 68 61  | Returns task ha|
00005cf0  6e 64 6c 65 20 6f 66 20  4f 6d 6e 69 44 65 73 6b  |ndle of OmniDesk|
00005d00  20 28 77 68 69 63 68 20  69 73 20 70 61 73 73 65  | (which is passe|
00005d10  64 20 69 6e 20 74 68 65  20 63 6f 6d 6d 61 6e 64  |d in the command|
00005d20  20 73 74 72 69 6e 67 29  0d 1a 0e 26 f4 20 6f 72  | string)...&. or|
00005d30  20 30 20 69 66 20 6e 6f  74 20 73 74 61 72 74 65  | 0 if not starte|
00005d40  64 20 62 79 20 4f 6d 6e  69 44 65 73 6b 2e 0d 1a  |d by OmniDesk...|
00005d50  18 1d c8 99 20 22 4f 53  5f 47 65 74 45 6e 76 22  |.... "OS_GetEnv"|
00005d60  20 b8 20 43 6f 6d 6d 61  6e 64 24 0d 1a 22 1b 41  | . Command$..".A|
00005d70  3d a7 43 6f 6d 6d 61 6e  64 24 2c 22 2d 53 74 61  |=.Command$,"-Sta|
00005d80  72 74 75 70 22 29 0d 1a  2c 16 e7 20 41 3c 3e 30  |rtup")..,.. A<>0|
00005d90  20 8c 20 53 74 61 72 74  75 70 3d b9 0d 1a 36 18  | . Startup=...6.|
00005da0  41 3d a7 43 6f 6d 6d 61  6e 64 24 2c 22 2d 45 78  |A=.Command$,"-Ex|
00005db0  69 74 22 29 0d 1a 40 13  e7 20 41 3c 3e 30 20 8c  |it")..@.. A<>0 .|
00005dc0  20 45 78 69 74 3d b9 0d  1a 4a 1c 41 3d a7 43 6f  | Exit=...J.A=.Co|
00005dd0  6d 6d 61 6e 64 24 2c 22  2d 4f 6d 6e 69 44 65 73  |mmand$,"-OmniDes|
00005de0  6b 22 29 0d 1a 54 0e e7  20 41 3d 30 20 8c 20 3d  |k")..T.. A=0 . =|
00005df0  30 0d 1a 5e 16 3d bb 28  c1 43 6f 6d 6d 61 6e 64  |0..^.=.(.Command|
00005e00  24 2c 41 2b 39 29 29 0d  1a 68 05 3a 0d 1a 72 20  |$,A+9))..h.:..r |
00005e10  dd 20 a4 52 65 61 64 57  69 6e 64 6f 77 4c 6f 63  |. .ReadWindowLoc|
00005e20  61 74 69 6f 6e 28 41 78  69 73 24 29 0d 1a 7c 48  |ation(Axis$)..|H|
00005e30  f4 20 52 65 61 64 73 20  77 68 69 63 68 20 72 61  |. Reads which ra|
00005e40  64 69 6f 20 69 63 6f 6e  20 28 69 66 20 61 6e 79  |dio icon (if any|
00005e50  29 20 69 73 20 73 65 6c  65 63 74 65 64 20 69 6e  |) is selected in|
00005e60  20 74 68 65 20 57 69 6e  64 6f 77 20 50 6f 73 69  | the Window Posi|
00005e70  74 69 6f 6e 0d 1a 86 48  f4 20 73 65 6c 65 63 74  |tion...H. select|
00005e80  6f 72 20 77 69 6e 64 6f  77 20 61 6e 64 20 72 65  |or window and re|
00005e90  74 75 72 6e 73 20 74 68  65 20 61 78 69 73 20 63  |turns the axis c|
00005ea0  6f 6f 72 64 69 6e 61 74  65 20 28 74 77 6f 20 63  |oordinate (two c|
00005eb0  61 6c 6c 73 20 6e 65 65  64 65 64 29 0d 1a 90 25  |alls needed)...%|
00005ec0  f4 20 6f 72 20 2d 31 20  66 6f 72 20 6e 6f 20 70  |. or -1 for no p|
00005ed0  6f 73 69 74 69 6f 6e 20  73 65 6c 65 63 74 65 64  |osition selected|
00005ee0  2e 0d 1a 9a 3f 49 63 6f  6e 3d 35 3a f5 3a 49 63  |....?Icon=5:.:Ic|
00005ef0  6f 6e 2b 3d 31 3a fd 20  28 a4 53 65 6c 65 63 74  |on+=1:. (.Select|
00005f00  65 64 53 74 61 74 65 28  4c 6f 63 2c 49 63 6f 6e  |edState(Loc,Icon|
00005f10  29 3d b9 29 20 84 20 28  49 63 6f 6e 3d 33 31 29  |)=.) . (Icon=31)|
00005f20  0d 1a a4 2a e7 20 49 63  6f 6e 3d 33 31 20 8c 20  |...*. Icon=31 . |
00005f30  3d 2d 31 3a f4 20 41 6c  6c 20 69 63 6f 6e 73 20  |=-1:. All icons |
00005f40  64 65 73 65 6c 65 63 74  65 64 0d 1a ae 34 4c 6f  |deselected...4Lo|
00005f50  63 61 74 69 6f 6e 3d 2d  31 3a 49 63 6f 6e 2d 3d  |cation=-1:Icon-=|
00005f60  36 3a f4 20 42 72 69 6e  67 20 69 63 6f 6e 20 69  |6:. Bring icon i|
00005f70  6e 74 6f 20 72 61 6e 67  65 20 30 2d 31 34 0d 1a  |nto range 0-14..|
00005f80  b8 0e c8 8e 20 41 78 69  73 24 20 ca 0d 1a c2 21  |.... Axis$ ....!|
00005f90  20 20 c9 20 22 58 22 2c  22 78 22 3a 4c 6f 63 61  |  . "X","x":Loca|
00005fa0  74 69 6f 6e 3d 49 63 6f  6e 20 81 20 35 0d 1a cc  |tion=Icon . 5...|
00005fb0  25 20 20 c9 20 22 59 22  2c 22 79 22 3a 4c 6f 63  |%  . "Y","y":Loc|
00005fc0  61 74 69 6f 6e 3d 34 2d  28 49 63 6f 6e 20 83 20  |ation=4-(Icon . |
00005fd0  35 29 0d 1a d6 05 cb 0d  1a e0 0d 3d 4c 6f 63 61  |5).........=Loca|
00005fe0  74 69 6f 6e 0d 1a ea 05  3a 0d 1a f4 17 dd 20 f2  |tion....:..... .|
00005ff0  43 6c 65 61 6e 55 70 4c  6f 63 57 69 6e 64 6f 77  |CleanUpLocWindow|
00006000  0d 1a fe 4f f4 20 4d 61  6b 65 73 20 73 75 72 65  |...O. Makes sure|
00006010  20 74 68 61 74 20 6e 6f  6e 65 20 6f 66 20 74 68  | that none of th|
00006020  65 20 27 77 69 6e 64 6f  77 27 20 69 63 6f 6e 73  |e 'window' icons|
00006030  20 69 6e 20 74 68 65 20  4c 6f 63 20 77 69 6e 64  | in the Loc wind|
00006040  6f 77 20 69 73 20 73 65  6c 65 63 74 65 64 2e 0d  |ow is selected..|
00006050  1b 08 09 4e 3d 35 3a f5  0d 1b 12 27 4e 2b 3d 31  |...N=5:....'N+=1|
00006060  3a fd 20 4e 3d 33 30 20  84 20 a4 53 65 6c 65 63  |:. N=30 . .Selec|
00006070  74 65 64 53 74 61 74 65  28 4c 6f 63 2c 4e 29 0d  |tedState(Loc,N).|
00006080  1b 1c 20 f2 55 70 64 61  74 65 53 65 6c 65 63 74  |.. .UpdateSelect|
00006090  65 64 46 6c 61 67 28 4c  6f 63 2c 4e 2c a3 29 0d  |edFlag(Loc,N,.).|
000060a0  1b 26 05 e1 0d 1b 30 05  3a 0d 1b 3a 4f f4 20 2d  |.&....0.:..:O. -|
000060b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000060f0  2d 2d 2d 2d 2d 2d 2d 2d  0d 1b 44 2c f4 20 53 70  |--------..D,. Sp|
00006100  65 63 69 61 6c 20 72 6f  75 74 69 6e 65 73 20 66  |ecial routines f|
00006110  6f 72 20 74 68 69 73 20  70 72 6f 67 72 61 6d 20  |or this program |
00006120  6f 6e 6c 79 0d 1b 4e 4f  f4 20 2d 2d 2d 2d 2d 2d  |only..NO. ------|
00006130  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00006170  2d 2d 2d 0d 1b 58 05 3a  0d 1b 62 0f dd 20 f2 44  |---..X.:..b.. .D|
00006180  6f 43 6f 6f 72 64 73 0d  1b 6c 4f 58 45 69 67 46  |oCoords..lOXEigF|
00006190  61 63 74 6f 72 3d a4 4d  6f 64 65 49 6e 66 6f 28  |actor=.ModeInfo(|
000061a0  22 58 45 69 67 46 61 63  74 6f 72 22 2c 2d 31 29  |"XEigFactor",-1)|
000061b0  3a 59 45 69 67 46 61 63  74 6f 72 3d a4 4d 6f 64  |:YEigFactor=.Mod|
000061c0  65 49 6e 66 6f 28 22 59  45 69 67 46 61 63 74 6f  |eInfo("YEigFacto|
000061d0  72 22 2c 2d 31 29 0d 1b  76 23 c8 99 20 22 57 69  |r",-1)..v#.. "Wi|
000061e0  6d 70 5f 47 65 74 50 6f  69 6e 74 65 72 49 6e 66  |mp_GetPointerInf|
000061f0  6f 22 2c 2c 42 6c 6f 63  6b 0d 1b 80 30 58 3d 42  |o",,Block...0X=B|
00006200  6c 6f 63 6b 21 30 3a 59  3d 42 6c 6f 63 6b 21 34  |lock!0:Y=Block!4|
00006210  3a 57 69 6e 3d 42 6c 6f  63 6b 21 31 32 3a 49 63  |:Win=Block!12:Ic|
00006220  3d 42 6c 6f 63 6b 21 31  36 0d 1b 8a 49 f2 55 70  |=Block!16...I.Up|
00006230  64 61 74 65 49 63 6f 6e  28 43 6f 6f 72 64 73 2c  |dateIcon(Coords,|
00006240  38 2c c3 28 58 29 29 3a  f2 55 70 64 61 74 65 49  |8,.(X)):.UpdateI|
00006250  63 6f 6e 28 43 6f 6f 72  64 73 2c 31 30 2c c3 28  |con(Coords,10,.(|
00006260  58 2f 28 32 5e 58 45 69  67 46 61 63 74 6f 72 29  |X/(2^XEigFactor)|
00006270  29 29 0d 1b 94 49 f2 55  70 64 61 74 65 49 63 6f  |))...I.UpdateIco|
00006280  6e 28 43 6f 6f 72 64 73  2c 39 2c c3 28 59 29 29  |n(Coords,9,.(Y))|
00006290  3a f2 55 70 64 61 74 65  49 63 6f 6e 28 43 6f 6f  |:.UpdateIcon(Coo|
000062a0  72 64 73 2c 31 31 2c c3  28 59 2f 28 32 5e 59 45  |rds,11,.(Y/(2^YE|
000062b0  69 67 46 61 63 74 6f 72  29 29 29 0d 1b 9e 48 e7  |igFactor)))...H.|
000062c0  20 57 69 6e 3d 2d 31 20  8c 20 f2 55 70 64 61 74  | Win=-1 . .Updat|
000062d0  65 49 63 6f 6e 28 43 6f  6f 72 64 73 2c 32 32 2c  |eIcon(Coords,22,|
000062e0  22 22 29 20 8b 20 f2 55  70 64 61 74 65 49 63 6f  |"") . .UpdateIco|
000062f0  6e 28 43 6f 6f 72 64 73  2c 32 32 2c c3 28 57 69  |n(Coords,22,.(Wi|
00006300  6e 29 29 0d 1b a8 46 e7  20 49 63 3d 2d 31 20 8c  |n))...F. Ic=-1 .|
00006310  20 f2 55 70 64 61 74 65  49 63 6f 6e 28 43 6f 6f  | .UpdateIcon(Coo|
00006320  72 64 73 2c 32 33 2c 22  22 29 20 8b 20 f2 55 70  |rds,23,"") . .Up|
00006330  64 61 74 65 49 63 6f 6e  28 43 6f 6f 72 64 73 2c  |dateIcon(Coords,|
00006340  32 33 2c c3 28 49 63 29  29 0d 1b b2 0f 42 6c 6f  |23,.(Ic))....Blo|
00006350  63 6b 21 30 3d 57 69 6e  0d 1b bc 2c e7 20 28 57  |ck!0=Win...,. (W|
00006360  69 6e 3e 3d 30 29 20 84  20 28 28 57 69 6e 3c 3e  |in>=0) . ((Win<>|
00006370  2d 31 29 20 80 20 28 77  69 6d 70 3e 3d 33 31 30  |-1) . (wimp>=310|
00006380  29 29 20 8c 0d 1b c6 27  20 20 c8 99 20 22 57 69  |)) ....'  .. "Wi|
00006390  6d 70 5f 47 65 74 57 69  6e 64 6f 77 4f 75 74 6c  |mp_GetWindowOutl|
000063a0  69 6e 65 22 2c 2c 42 6c  6f 63 6b 0d 1b d0 22 20  |ine",,Block..." |
000063b0  20 57 6d 69 6e 58 3d 42  6c 6f 63 6b 21 34 3a 57  | WminX=Block!4:W|
000063c0  6d 61 78 59 3d 42 6c 6f  63 6b 21 31 36 0d 1b da  |maxY=Block!16...|
000063d0  25 20 20 c8 99 20 22 57  69 6d 70 5f 47 65 74 57  |%  .. "Wimp_GetW|
000063e0  69 6e 64 6f 77 53 74 61  74 65 22 2c 2c 42 6c 6f  |indowState",,Blo|
000063f0  63 6b 0d 1b e4 21 20 20  4f 66 66 58 3d 42 6c 6f  |ck...!  OffX=Blo|
00006400  63 6b 21 32 30 3a 4f 66  66 59 3d 42 6c 6f 63 6b  |ck!20:OffY=Block|
00006410  21 32 34 0d 1b ee 4d 20  20 54 69 74 6c 65 3d a3  |!24...M  Title=.|
00006420  3a e7 20 28 28 42 6c 6f  63 6b 21 33 32 29 20 80  |:. ((Block!32) .|
00006430  20 28 31 3c 3c 32 36 29  29 3d 28 31 3c 3c 32 36  | (1<<26))=(1<<26|
00006440  29 20 84 20 28 28 42 6c  6f 63 6b 21 33 32 29 20  |) . ((Block!32) |
00006450  80 20 31 29 3d 31 20 8c  20 54 69 74 6c 65 3d b9  |. 1)=1 . Title=.|
00006460  0d 1b f8 30 20 20 f2 55  70 64 61 74 65 49 63 6f  |...0  .UpdateIco|
00006470  6e 28 43 6f 6f 72 64 73  2c 32 30 2c c3 28 28 58  |n(Coords,20,.((X|
00006480  2d 57 6d 69 6e 58 29 2b  4f 66 66 58 2d 32 29 29  |-WminX)+OffX-2))|
00006490  0d 1c 02 3d 20 20 f2 55  70 64 61 74 65 49 63 6f  |...=  .UpdateIco|
000064a0  6e 28 43 6f 6f 72 64 73  2c 32 31 2c c3 28 28 59  |n(Coords,21,.((Y|
000064b0  2d 57 6d 61 78 59 29 2b  4f 66 66 59 2b 32 2b 28  |-WmaxY)+OffY+2+(|
000064c0  34 30 20 80 20 54 69 74  6c 65 29 29 29 0d 1c 0c  |40 . Title)))...|
000064d0  05 cc 0d 1c 16 1f 20 20  f2 55 70 64 61 74 65 49  |......  .UpdateI|
000064e0  63 6f 6e 28 43 6f 6f 72  64 73 2c 32 30 2c 22 22  |con(Coords,20,""|
000064f0  29 0d 1c 20 1f 20 20 f2  55 70 64 61 74 65 49 63  |).. .  .UpdateIc|
00006500  6f 6e 28 43 6f 6f 72 64  73 2c 32 31 2c 22 22 29  |on(Coords,21,"")|
00006510  0d 1c 2a 05 cd 0d 1c 34  05 e1 0d 1c 3e 05 3a 0d  |..*....4....>.:.|
00006520  1c 48 13 dd 20 a4 53 61  76 65 53 65 74 74 69 6e  |.H.. .SaveSettin|
00006530  67 73 0d 1c 52 07 ea 20  85 0d 1c 5c 3c ee 20 85  |gs..R.. ...\<. .|
00006540  20 ea 20 f7 20 85 3a f2  43 6c 6f 73 65 46 69 6c  | . . .:.CloseFil|
00006550  65 49 66 50 6f 73 73 28  44 61 74 61 29 3a 3d a3  |eIfPoss(Data):=.|
00006560  3a f4 20 45 72 72 6f 72  20 77 72 69 74 69 6e 67  |:. Error writing|
00006570  20 66 69 6c 65 0d 1c 66  07 20 20 3a 0d 1c 70 2b  | file..f.  :..p+|
00006580  20 20 44 61 74 61 3d ae  20 28 22 3c 43 6f 6f 72  |  Data=. ("<Coor|
00006590  64 69 6e 61 74 65 73 24  44 69 72 3e 2e 53 65 74  |dinates$Dir>.Set|
000065a0  74 69 6e 67 73 22 29 0d  1c 7a 40 20 20 d5 23 44  |tings")..z@  .#D|
000065b0  61 74 61 2c 22 7c 20 58  20 61 6e 64 20 59 20 67  |ata,"| X and Y g|
000065c0  72 69 64 20 63 6f 6f 72  64 69 6e 61 74 65 73 20  |rid coordinates |
000065d0  6f 66 20 43 6f 6f 72 64  69 6e 61 74 65 73 20 77  |of Coordinates w|
000065e0  69 6e 64 6f 77 3a 22 0d  1c 84 19 20 20 d5 23 44  |indow:"....  .#D|
000065f0  61 74 61 2c c3 28 58 50  6f 73 69 74 69 6f 6e 29  |ata,.(XPosition)|
00006600  0d 1c 8e 19 20 20 d5 23  44 61 74 61 2c c3 28 59  |....  .#Data,.(Y|
00006610  50 6f 73 69 74 69 6f 6e  29 0d 1c 98 0c 20 20 d9  |Position)....  .|
00006620  23 44 61 74 61 0d 1c a2  32 20 20 ff 28 22 53 65  |#Data...2  .("Se|
00006630  74 74 79 70 65 20 3c 43  6f 6f 72 64 69 6e 61 74  |ttype <Coordinat|
00006640  65 73 24 44 69 72 3e 2e  53 65 74 74 69 6e 67 73  |es$Dir>.Settings|
00006650  20 54 65 78 74 22 29 0d  1c ac 07 20 20 3a 0d 1c  | Text")....  :..|
00006660  b6 06 3d b9 0d 1c c0 05  3a 0d 1c ca 13 dd 20 a4  |..=.....:..... .|
00006670  4c 6f 61 64 53 65 74 74  69 6e 67 73 0d 1c d4 07  |LoadSettings....|
00006680  ea 20 85 0d 1c de 4f ee  20 85 20 ea 20 f7 20 85  |. ....O. . . . .|
00006690  3a f2 43 6c 6f 73 65 46  69 6c 65 49 66 50 6f 73  |:.CloseFileIfPos|
000066a0  73 28 44 61 74 61 29 3a  3d a3 3a f4 20 27 53 65  |s(Data):=.:. 'Se|
000066b0  74 74 69 6e 67 73 27 20  66 69 6c 65 20 69 73 20  |ttings' file is |
000066c0  64 61 6d 61 67 65 64 20  6f 72 20 6d 69 73 73 69  |damaged or missi|
000066d0  6e 67 0d 1c e8 07 20 20  3a 0d 1c f2 29 20 20 44  |ng....  :...)  D|
000066e0  61 74 61 3d 8e 20 22 3c  43 6f 6f 72 64 69 6e 61  |ata=. "<Coordina|
000066f0  74 65 73 24 44 69 72 3e  2e 53 65 74 74 69 6e 67  |tes$Dir>.Setting|
00006700  73 22 0d 1c fc 1d 20 20  58 50 6f 73 69 74 69 6f  |s"....  XPositio|
00006710  6e 3d bb 28 a4 4e 65 78  74 45 6e 74 72 79 29 0d  |n=.(.NextEntry).|
00006720  1d 06 1d 20 20 59 50 6f  73 69 74 69 6f 6e 3d bb  |...  YPosition=.|
00006730  28 a4 4e 65 78 74 45 6e  74 72 79 29 0d 1d 10 0c  |(.NextEntry)....|
00006740  20 20 d9 23 44 61 74 61  0d 1d 1a 07 20 20 3a 0d  |  .#Data....  :.|
00006750  1d 24 62 20 20 e7 20 58  50 6f 73 69 74 69 6f 6e  |.$b  . XPosition|
00006760  3c 3e 2d 31 20 80 20 59  50 6f 73 69 74 69 6f 6e  |<>-1 . YPosition|
00006770  3c 3e 2d 31 20 8c 20 f2  55 70 64 61 74 65 53 65  |<>-1 . .UpdateSe|
00006780  6c 65 63 74 65 64 46 6c  61 67 28 4c 6f 63 2c 36  |lectedFlag(Loc,6|
00006790  2b 28 28 35 2a 58 50 6f  73 69 74 69 6f 6e 29 2b  |+((5*XPosition)+|
000067a0  28 34 2d 59 50 6f 73 69  74 69 6f 6e 29 29 2c b9  |(4-YPosition)),.|
000067b0  29 0d 1d 2e 07 20 20 3a  0d 1d 38 06 3d b9 0d 1d  |)....  :..8.=...|
000067c0  42 05 3a 0d 1d 4c 16 dd  20 f2 44 65 66 61 75 6c  |B.:..L.. .Defaul|
000067d0  74 53 65 74 74 69 6e 67  73 0d 1d 56 1b 58 50 6f  |tSettings..V.XPo|
000067e0  73 69 74 69 6f 6e 3d 34  3a 59 50 6f 73 69 74 69  |sition=4:YPositi|
000067f0  6f 6e 3d 34 0d 1d 60 3e  f2 55 70 64 61 74 65 53  |on=4..`>.UpdateS|
00006800  65 6c 65 63 74 65 64 46  6c 61 67 28 4c 6f 63 2c  |electedFlag(Loc,|
00006810  36 2b 28 28 35 2a 58 50  6f 73 69 74 69 6f 6e 29  |6+((5*XPosition)|
00006820  2b 28 34 2d 59 50 6f 73  69 74 69 6f 6e 29 29 2c  |+(4-YPosition)),|
00006830  b9 29 0d 1d 6a 05 e1 0d  ff                       |.)..j....|
00006839