Home » Archimedes archive » Acorn User » AU 1994-01.adf » !OmniDesk_OmniDesk » !TextGrab/!RunImage

!TextGrab/!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 1994-01.adf » !OmniDesk_OmniDesk
Filename: !TextGrab/!RunImage
Read OK:
File size: CF7B bytes
Load address: 0000
Exec address: 0000
File contents
   10REM >!RunImage for Text Grabber
   20:
   30VersionNumber$="1�01 (24 Aug 1993)":Taskname$="Text�Grabber"
   40Exit=FALSE:Startup=FALSE:Done=FALSE
   50DoModeChange=FALSE
   60Grabbing=FALSE:Transferring=FALSE:Poke=FALSE:Transmit=FALSE:Typing=FALSE:TypeCounter=0
   70DIM GrabIconValid 5:$GrabIconValid="Z3;L"
   80:
   90DIM Block 256,MenuHelp 16,TempBlock 256,Caret 24
  100IndMenuMax=64:DIM IndirectMenuText IndMenuMax
  110DIM Templates 1636,InfoInd 190,LocInd 592,GrabInd 238,SaveInd 352
  120DIM IBMenu 76,MainMenu 172
  130:
  140REM Messages used by the OmniDesk suite:
  150UtilDeclare=&825C0:UtilOpen=&825C1:UtilQuitting=&825C2:UtilReside=&825C3:UtilAckLoad=&825C4
  160REM These are official Acorn allocations.
  170:
  180ON ERROR Block!0=ERR:$(Block+4)=REPORT$+" (internal error code "+STR$(ERL)+")"+CHR$0:SYS "Wimp_ReportError",Block,1,Taskname$:END
  190:
  200OmniDesk=FNReadStartupString:REM Also assigns Exit and Startup
  210:
  220*Set TextGrab$RISCOS 3
  230*RMEnsure UtilityModule 3.00 Set TextGrab$RISCOS 2
  240SYS "XOS_ReadVarVal","TextGrab$RISCOS",Block,256,0,0 TO ,,len:Block?len=13:wimp$=$Block
  250IF wimp$<>"3" THEN wimp$="2"
  260*Unset TextGrab$RISCOS
  270:
  280*Set TextGrab$SpriteDrag Yes
  290*RMEnsure DragASprite 0.00 Set TextGrab$SpriteDrag No
  300SYS "XOS_ReadVarVal","TextGrab$SpriteDrag",Block,256,0,0 TO ,,len:Block?len=13
  310IF $Block="Yes" THEN DragASprite=TRUE:ELSE DragASprite=FALSE
  320*Unset TextGrab$SpriteDrag
  330:
  340SYS "XOS_ReadVarVal","Obey$Dir",Block,256,0,0 TO ,,len:Block?len=13:OurFileName$=$Block
  350N=-1:REPEAT:N+=1:UNTIL MID$(OurFileName$,LEN(OurFileName$)-N,1)="."
  360OurPathName$=LEFT$(OurFileName$,LEN(OurFileName$)-N):OurFileName$=RIGHT$(OurFileName$,N)
  370:
  380REM Read size of sprite file and load it. We need to DIM 16 bytes more than the file's size.
  390SYS "OS_FSControl",28,"<TextGrab$Dir>.Sprites" TO ,,len
  400DIM Sprites len+16:!Sprites=len+16:Sprites!4=0:Sprites!8=16:Sprites!12=16:SYS "OS_SpriteOp",256+10,Sprites,"<TextGrab$Dir>.Sprites"
  410:
  420IF wimp$="3" THEN
  430  DIM messagelist% 56
  440  messagelist%!0=&502:messagelist%!4=&400C1
  450  messagelist%!8=UtilOpen:messagelist%!12=UtilQuitting
  460  messagelist%!16=UtilReside:messagelist%!20=10
  470  messagelist%!24=&400C7:REM TaskNameIs
  480  messagelist%!28=7:messagelist%!32=6
  490  messagelist%!36=4:messagelist%!40=3
  500  messagelist%!44=2:messagelist%!48=1:messagelist%!52=0
  510  SYS "Wimp_Initialise",300,&4B534154,Taskname$,messagelist% TO wimp,Task
  520ELSE
  530  SYS "Wimp_Initialise",200,&4B534154,Taskname$ TO wimp,Task
  540ENDIF
  550:
  560SYS "Interface_Initialise",Task
  570:
  580SYS "Wimp_OpenTemplate",,"<TextGrab$Dir>.Templates"
  590SYS "Wimp_LoadTemplate",,Templates,InfoInd,InfoInd+190,-1,"Info",0
  600SYS "Wimp_CreateWindow",,Templates TO Info
  610SYS "Wimp_LoadTemplate",,Templates,LocInd,LocInd+592,-1,"WindowXY",0:Templates!64=Sprites
  620SYS "Wimp_CreateWindow",,Templates TO Loc
  630SYS "Wimp_LoadTemplate",,Templates,SaveInd,SaveInd+352,-1,"Save",0
  640SYS "Wimp_CreateWindow",,Templates TO Save
  650REM It is important that the Stats window is defined last:
  660SYS "Wimp_LoadTemplate",,Templates,GrabInd,GrabInd+238,-1,"Grab",0
  670SYS "Wimp_CreateWindow",,Templates TO Grab
  680SYS "Wimp_CloseTemplate"
  690:
  700PROCBuildMenus
  710:
  720IF OmniDesk=0 THEN
  730  REM Put Icon on the icon-bar
  740  Block!0=-1
  750  Block!4=0:Block!8=0:Block!12=68:Block!16=68
  760  Block!20=&17003002:$(Block+24)="!TextGrab"+CHR$13
  770  SYS "Wimp_CreateIcon",,Block TO IconBar
  780ENDIF
  790:
  800PROCInitialise
  810IF OmniDesk<>0 THEN PROCDeclareToOmniDesk
  820IF Startup THEN Done=TRUE:REM '-Startup' parameter means 'declare and die immediately'.
  830:
  840PROCUpdateIcon(Info,3,VersionNumber$)
  850PROCModeChange:REM To update icon-bar icon if necessary
  860PROCCleanUpLocWindow
  870:
  880PROCResetGrabber
  890:
  900MyRef=-1:REM Just an arbitrary value to start with.
  910:
  920LoadFileError=FALSE
  930ReadError=NOT(FNLoadSettings)
  940:
  950HotKeys=FNCreateWindow(0,0,0,0,0,0,-2,%10000000000000000001000001010000,&FF,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"")
  960PROCOpen(HotKeys,FALSE,0,0)
  970:
  980ON ERROR PROCError
  990IF ReadError THEN ReadError=FALSE:PROCDefaultSettings:ERROR 9999,"An error occurred whilst reading the settings file. Default settings will therefore be used."
 1000:
 1010SYS "OS_ReadMonotonicTime" TO polltime%
 1020:
 1030REM Main program loop
 1040REPEAT
 1050  SYS "Wimp_PollIdle",%1100000110000,Block,polltime% TO Reason
 1060  SYS "Interface_Poll",Reason,,Task
 1070  SYS "Interface_PreProcessKey",Reason,Block,Task
 1080  CASE Reason OF
 1090    WHEN 0 : SYS "OS_ReadMonotonicTime" TO polltime%
 1100             IF (Grabbing>0) OR (Transferring>0) OR Typing OR Transmit THEN
 1110               polltime%+=1
 1120             ELSE
 1130               polltime%+=100:REM Do a Wimp_Poll approximately once a second
 1140             ENDIF
 1150             IF DoModeChange THEN IF FNOpenState(Grab) THEN PROCOpen(Grab,FALSE,XPosition,YPosition)
 1160             IF Grabbing>0 THEN Grabbing-=1:IF Grabbing=0 THEN PROCGrabText
 1170             IF Transferring>0 THEN Transferring-=1:IF Transferring=0 THEN PROCTransferText
 1180             IF Typing THEN PROCTypeACharacter
 1190    WHEN 1 : PROCRedraw
 1200    WHEN 2 : SYS "Wimp_OpenWindow",,Block
 1210    WHEN 3 : SYS "Wimp_CloseWindow",,Block
 1220             IF Exit THEN Done=TRUE
 1230    WHEN 6 : PROCMouseButton
 1240    WHEN 7 : PROCDragFinished
 1250    WHEN 8 : PROCKeyPressed
 1260    WHEN 9 : PROCDecodeMenu
 1270    WHEN 17,18,19 : PROCRecieveMessage
 1280  ENDCASE
 1290UNTIL Done
 1300PROCSayGoodbye
 1310SYS "Interface_CloseDown",Task
 1320SYS "Wimp_CloseDown",Task,&4B534154
 1330END
 1340:
 1350DEF PROCError
 1360Click=0:Block!0=ERR:CASE ERR OF
 1370  WHEN 9999:REM Custom error
 1380    $(Block+4)=REPORT$+CHR$0
 1390    SYS "Wimp_ReportError",Block,17,"Notice from Text Grabber"
 1400  OTHERWISE
 1410    $(Block+4)=REPORT$+" (internal error code "+STR$ERL+"). Click on OK to continue, or Cancel to terminate the program."+CHR$0
 1420    SYS "Wimp_ReportError",Block,3,Taskname$ TO ,Click
 1430ENDCASE
 1440IF Click=2 THEN PROCSayGoodbye:SYS "Interface_CloseDown",Task:SYS "Wimp_CloseDown",Task,&4B534154:END
 1450ENDPROC
 1460:
 1470DEF PROCOpen(WindowHandle,TopOfStack,across,up)
 1480Block!0=WindowHandle
 1490SYS "Wimp_GetWindowState",,Block
 1500IF (across<>-1) AND (across<>-1) THEN PROCDecideWindowPosition(Block,across,up)
 1510IF TopOfStack THEN Block!28=-1
 1520SYS "Wimp_OpenWindow",,Block
 1530ENDPROC
 1540:
 1550DEF PROCClose(WindowHandle)
 1560Block!0=WindowHandle
 1570SYS "Wimp_GetWindowState",,Block
 1580SYS "Wimp_CloseWindow",,Block
 1590ENDPROC
 1600:
 1610DEF PROCDecideWindowPosition(Block,across,up)
 1620REM Use of this procedure lets you open windows on an invisible grid which
 1630REM automatically fits itself to the screen mode in use. There are five
 1640REM positions across (left, mid-left, centre, mid-right, right) and five
 1650REM positions up (bottom of screen, above icon-bar, centre of screen,
 1660REM centre top of screen, top of screen).
 1670  :
 1680Xpixels=FNModeInfo("XPixels",-1):Ypixels=FNModeInfo("YPixels",-1)
 1690XEigFactor=FNModeInfo("XEigFactor",-1):YEigFactor=FNModeInfo("YEigFactor",-1)
 1700  :
 1710top=Block!16:right=Block!12:bot=Block!8:left=Block!4
 1720SYS "Wimp_OpenWindow",,Block:SYS "Wimp_GetWindowOutline",,Block
 1730TB=((Block!16)-top)/(2^YEigFactor)
 1740VS=((Block!12)-right)/(2^XEigFactor)
 1750HS=(bot-(Block!8))/(2^YEigFactor)
 1760LP=(left-(Block!4))/(2^XEigFactor)
 1770REM LP is Left Pixel: normally present, but not if window is transparent.
 1780width=(right-left)/(2^XEigFactor)
 1790height=(top-bot)/(2^YEigFactor)
 1800CASE across OF
 1810  WHEN 0:x=LP
 1820  WHEN 1:x=LP+((Xpixels+1)-(width+LP+VS))/4
 1830  WHEN 2:x=LP+((Xpixels+1)-(width+LP+VS))/2
 1840  WHEN 3:x=LP+(3*(((Xpixels+1)-(width+LP+VS))/4))
 1850  WHEN 4:x=(Xpixels+1)-(width+VS)
 1860ENDCASE
 1870CASE up OF
 1880  WHEN 0:y=HS
 1890  WHEN 1:y=HS+(132/(2^YEigFactor))
 1900  WHEN 2:y=HS+((Ypixels+1)-(height+TB+HS))/2
 1910  WHEN 3:y=HS+(3*(((Ypixels+1)-(height+TB+HS))/4))
 1920  WHEN 4:y=(Ypixels+1)-(height+TB)
 1930ENDCASE
 1940REM Above coordinates position window.
 1950REM Now convert to screen coordinates:
 1960x=x*(2^XEigFactor):y=y*(2^YEigFactor)
 1970width=width*(2^XEigFactor):height=height*(2^YEigFactor)
 1980Block!12=x+width:Block!4=x
 1990Block!16=y+height:Block!8=y
 2000ENDPROC
 2010:
 2020REM -------------------------------------------------------------------------
 2030REM Wimp poll routines
 2040REM -------------------------------------------------------------------------
 2050:
 2060DEF PROCRedraw
 2070IF DoModeChange THEN
 2080  REM Re-opening windows need an extra wimp_poll to happen after the mode
 2090  REM change in order to work:
 2100  IF FNOpenState(Grab) THEN PROCOpen(Grab,FALSE,XPosition,YPosition)
 2110  DoModeChange=FALSE
 2120ENDIF
 2130SYS "Wimp_RedrawWindow",,Block TO flag
 2140WHILE flag
 2150  SYS "Interface_Render3dWindow",,Block
 2160  SYS "Wimp_GetRectangle",,Block TO flag
 2170ENDWHILE
 2180ENDPROC
 2190:
 2200DEF PROCRecieveMessage
 2210CASE Block!16 OF
 2220  WHEN 0 : Done=TRUE
 2230  WHEN 1 : REM A task is trying to save a file into us.
 2240           REM We must tell it to use <Wimp$Scrap> because RAM transfer is
 2250           REM too much like hard work for loading files (although we need
 2260           REM to do it when transferring out, due to the nature of this
 2270           REM utility).
 2280           IF Block!12<>MyRef THEN
 2290             REM Ignore the message if the user has dragged our save file
 2300             REM back into us.
 2310             Block!0=60:Block!12=Block!8:Block!16=2
 2320             Block!36=-1:$(Block+44)="<Wimp$Scrap>"+CHR$0
 2330             SYS "Wimp_SendMessage",17,Block,Block!4
 2340           ENDIF
 2350  WHEN 2 : REM We're saving out to another application or to the filer.
 2360           REM We've just received acknowledgement to go ahead and save.
 2370           FileName$="":N=44:WHILE ((Block?N)>=32) AND (N<256):FileName$+=CHR$(Block?N):N+=1:ENDWHILE
 2380           IF FileName$<>"" THEN
 2390             REM ^ We can get funny results from some programs when using
 2400             REM RAM data transfer protocol.
 2410             IF NOT FNSaveGrabbedToFile(FileName$) THEN PROCDeleteWimpScrap:ERROR 9999,"An error occurred whilst saving the file."
 2420             Block!12=Block!8:Block!16=3:SYS "Wimp_SendMessage",17,Block,Block!4
 2430             MyRef=-1:REM Invalidate once again, until our next save out.
 2440             IF FileName$<>"<Wimp$Scrap>" THEN
 2450               PROCUpdateIcon(Save,2,FileName$)
 2460               REM Put full filename into save box
 2470             ENDIF
 2480           ENDIF
 2490  WHEN 3 : REM File dragged into application
 2500           PROCMinimiseWimpSlot
 2510           FileName$="":N=44:WHILE ((Block?N)>=32) AND (N<256):FileName$+=CHR$(Block?N):N+=1:ENDWHILE
 2520           FileType=Block!40:FileSize=Block!36
 2530           LoadFileError=FNLoadFile(FileSize,FileType,FileName$)
 2540           IF FileName$="<Wimp$Scrap>" THEN PROCDeleteWimpScrap
 2550           Block!12=Block!8:Block!16=4
 2560           Block!36=-1:Block!40=FileType:$(Block+44)=FileName$+CHR$0
 2570           SYS "Wimp_SendMessage",17,Block,Block!4
 2580           Typing=FALSE:PROCTickMenu(MainMenu,2,FALSE)
 2590           PROCCheckLoadFileError
 2600           PROCUpdateGrabIcon("",BufferLength,FALSE):REM The FALSE lets us
 2610                                                     REM include CHR$(13).
 2620           PROCUpdateIconColour(Grab,4,7,1)
 2630           PROCShadeMenu(MainMenu,1,FALSE)
 2640           PROCShadeMenu(MainMenu,2,FALSE)
 2650           PROCShadeMenu(MainMenu,4,FALSE)
 2660           IF NOT FNOpenState(Grab) THEN PROCOpen(Grab,TRUE,XPosition,YPosition)
 2670  WHEN 4 : REM We have saved the text file, and are receiving acknowledgement
 2680           REM We need to close the menu and turn transmission off.
 2690           SYS "Wimp_CreateMenu",,-1
 2700           Transmit=FALSE:MyRef=-1
 2710  WHEN 6 : IF Transmit THEN PROCTransmitText
 2720  WHEN 10: IF OmniDesk=0 THEN PROCSaveDesktop(Block!20)
 2730           REM Only save if we have not been started up by OmniDesk
 2740  WHEN &502 : PROCHelp
 2750  WHEN &400C1 : PROCModeChange
 2760  WHEN &400C7 : A$="":N=0
 2770                WHILE Block?(28+N)>31:A$+=CHR$(Block?(28+N)):N+=1:ENDWHILE
 2780                CASE A$ OF
 2790                  WHEN "Filer":PROCGrabFilerTitle
 2800                  OTHERWISE PROCGrabTitleBar
 2810                ENDCASE
 2820  WHEN UtilOpen : IF $(Block+24)=Taskname$ THEN PROCOmniDeskCalling
 2830  WHEN UtilQuitting : IF OmniDesk<>0 THEN
 2840                        IF Block!20=OmniDesk THEN Done=TRUE
 2850                      ENDIF
 2860  WHEN UtilReside : Exit=FALSE
 2870ENDCASE
 2880ENDPROC
 2890:
 2900DEF PROCDeleteWimpScrap
 2910LOCAL ERROR
 2920ON ERROR LOCAL RESTORE ERROR:ENDPROC
 2930REM We may receive try to delete a non-existant Wimp$Scrap
 2940REM file if the receiving task did not recognise the filetype.
 2950OSCLI("Delete <Wimp$Scrap>")
 2960ENDPROC
 2970:
 2980DEF PROCMouseButton
 2990MouseX=Block!0:MouseY=Block!4:Buttons=Block!8
 3000Window=Block!12:Icon=Block!16
 3010CASE Window OF
 3020  WHEN -2:REM Icon bar icon clicked
 3030    CASE Buttons OF
 3040      WHEN 1 : REM Adjust
 3050      WHEN 2 : REM Menu
 3060        M%=IBMenu:MenuX=MouseX:MenuY=MouseY:PROCMakeMenu
 3070      WHEN 4 : REM Select
 3080        PROCOpen(Grab,TRUE,XPosition,YPosition)
 3090    ENDCASE
 3100  WHEN Grab
 3110    CASE Buttons OF
 3120      WHEN 2 : REM Menu
 3130        M%=MainMenu:MenuX=MouseX:MenuY=MouseY
 3140        IF wimp>=310 THEN
 3150          IF LEFT$($MainMenuTitle,1)="\" THEN $MainMenuTitle=RIGHT$($MainMenuTitle,LEN($MainMenuTitle)-1)+CHR$13
 3160          IF XPosition=4 THEN $MainMenuTitle="\"+$MainMenuTitle+CHR$13
 3170        ENDIF
 3180        PROCMakeMenu
 3190      OTHERWISE : REM Select, Adjust
 3200        CASE Icon OF
 3210          WHEN 3:REM Grab text
 3220            IF Buttons<8 THEN
 3230              SYS "Interface_SlabButton",,Block
 3240              PROCGrabTextStart
 3250              Block!8=0:Block!12=Grab:Block!16=3:SYS "Interface_SlabButton",,Block
 3260            ENDIF
 3270          WHEN 4:REM Export text
 3280            IF (Buttons<8) AND (BufferLength>0) THEN
 3290              SYS "Interface_SlabButton",,Block
 3300              IF Buttons=1 THEN Poke=TRUE:ELSE Poke=FALSE
 3310              PROCTransferTextStart
 3320              Block!8=0:Block!12=Grab:Block!16=4:SYS "Interface_SlabButton",,Block
 3330            ENDIF
 3340        ENDCASE
 3350    ENDCASE
 3360  WHEN Loc AND Buttons<8:REM Reposition main window
 3370    IF Icon>=6 THEN
 3380      XPosition=FNReadWindowLocation("X")
 3390      YPosition=FNReadWindowLocation("Y")
 3400      IF FNOpenState(Grab) THEN PROCOpen(Grab,FALSE,XPosition,YPosition)
 3410    ENDIF
 3420  WHEN Save
 3430    CASE Icon OF
 3440      WHEN 1:REM File icon
 3450        IF Buttons>=8 THEN
 3460          IF DragASprite THEN
 3470            REM The following lines delete the file icon from the save window
 3480            REM giving the impression that you are actually dragging it out.
 3490            REM It will be replaced in PROCDragFinished.
 3500            Block!0=Save:Block!4=1:SYS "Wimp_GetIconState",,Block
 3510            SaveBoxDragFile$=$(Block!32)
 3520            Block!8=0:Block!12=0:$(Block!32)=CHR$13
 3530            SYS "Wimp_SetIconState",,Block
 3540          ENDIF
 3550          PROCDragBox(Save,1,5,1,"file_fff")
 3560        ENDIF
 3570      WHEN 3:REM OK icon
 3580        IF (Buttons<8) AND (Buttons<>2) THEN
 3590          SYS "Interface_SlabButton",,Block
 3600          IF Buttons<>1 THEN SYS "Wimp_CreateMenu",,-1
 3610          A$=FNReadIconStr(Save,2):IF A$="" THEN A$="Grabbed"
 3620          PROCUpdateIcon(Save,2,A$)
 3630          IF INSTR(A$,".")=0 THEN Block!8=0:Block!12=Save:Block!16=3:SYS "Interface_SlabButton",,Block:ERROR 9999,"To save, drag the icon to a directory display."
 3640          IF NOT FNSaveGrabbedToFile(A$) THEN PROCDeleteWimpScrap:Block!8=0:Block!12=Save:Block!16=3:SYS "Interface_SlabButton",,Block:ERROR 9999,"An error occurred whilst saving the file."
 3650          Block!8=0:Block!12=Save:Block!16=3:SYS "Interface_SlabButton",,Block
 3660        ENDIF
 3670    ENDCASE
 3680ENDCASE
 3690ENDPROC
 3700:
 3710DEF PROCDragFinished
 3720IF DragASprite THEN
 3730  SYS "DragASprite_Stop"
 3740  REM The following lines replace the sprite in the save box.
 3750  Block!0=Save:Block!4=1:SYS "Wimp_GetIconState",,Block
 3760  Block!8=0:Block!12=0:$(Block!32)=SaveBoxDragFile$
 3770  SYS "Wimp_SetIconState",,Block
 3780ENDIF
 3790SYS "Wimp_GetPointerInfo",,Block
 3800IF Block!12=-1 THEN ENDPROC:REM Dragged to background.
 3810DraggedToX=Block!0:DraggedToY=Block!4:DraggedToWindow=Block!12:DraggedToIcon=Block!16
 3820REM Find out leaf name in save box:
 3830Dragging$=FNReadIconStr(Save,2):len=LEN(Dragging$)
 3840N=-1:REPEAT:N+=1:UNTIL (MID$(Dragging$,LEN(Dragging$)-N,1)=".") OR (N=len)
 3850IF N<len THEN Dragging$=RIGHT$(Dragging$,N)
 3860IF Dragging$="" THEN Dragging$="Grabbed":PROCUpdateIcon(Save,2,Dragging$)
 3870REM OK - Let's begin an inter-application save
 3880MyRef=0
 3890Block!0=256:Block!12=MyRef:Block!16=1:REM DataSave
 3900Block!20=DraggedToWindow:Block!24=DraggedToIcon:Block!28=DraggedToX:Block!32=DraggedToY
 3910Block!36=BufferLength
 3920Block!40=&FFF:REM Filetype of Text
 3930$(Block+44)=Dragging$+CHR$0
 3940SYS "Wimp_SendMessage",17,Block,DraggedToWindow,DraggedToIcon TO ,,DestTask
 3950REM DraggedToIcon included in case DraggedToWindow=-2 (icon bar)
 3960Transmit=TRUE:TransmittedBytes=0
 3970ENDPROC
 3980:
 3990DEF PROCKeyPressed
 4000Window=Block!0:Icon=Block!4:Character=Block!24
 4010CASE Window OF
 4020  WHEN Save:
 4030    IF Character=13 THEN
 4040      Block!8=4:Block!12=Save:Block!16=3:SYS "Interface_SlabButton",,Block
 4050      A$=FNReadIconStr(Save,2):IF A$="" THEN A$="Grabbed"
 4060      PROCUpdateIcon(Save,2,A$)
 4070      IF INSTR(A$,".")=0 THEN Block!8=0:Block!12=Save:Block!16=3:SYS "Interface_SlabButton",,Block:ERROR 9999,"To save, drag the icon to a directory display."
 4080      IF NOT FNSaveGrabbedToFile(A$) THEN PROCDeleteWimpScrap:Block!8=0:Block!12=Save:Block!16=3:SYS "Interface_SlabButton",,Block:ERROR 9999,"An error occurred whilst saving the file."
 4090      Block!8=0:Block!12=Save:Block!16=3:SYS "Interface_SlabButton",,Block
 4100      SYS "Wimp_CreateMenu",,-1
 4110    ELSE
 4120      SYS "Wimp_ProcessKey",Character
 4130    ENDIF
 4140  OTHERWISE
 4150    CASE Character OF
 4160      WHEN &1AB:REM <Ctrl-Copy>: Grab text at pointer
 4170        PROCGrabText
 4180        PROCOpen(Grab,TRUE,XPosition,YPosition)
 4190      WHEN &1BB:REM <Ctrl-Shift-Copy>: Send text at pointer straight to caret
 4200        PROCGrabText:IF BufferLength>0 THEN Poke=FALSE:PROCTransferText
 4210      WHEN &1ED:REM <Ctrl-Insert>, Transfer text to pointer icon (poke)
 4220        IF BufferLength>0 THEN Poke=TRUE:PROCTransferText
 4230      WHEN &1FD:REM <Ctrl-Shift-Insert>, Transfer text to caret (no poke)
 4240        IF BufferLength>0 THEN Poke=FALSE:PROCTransferText
 4250    OTHERWISE
 4260      SYS "Wimp_ProcessKey",Character
 4270    ENDCASE
 4280ENDCASE
 4290ENDPROC
 4300:
 4310DEF PROCDecodeMenu
 4320Sub0=Block!0:Sub1=Block!4:Sub2=Block!8
 4330CloseMenu=FALSE
 4340CASE M% OF
 4350  WHEN IBMenu:
 4360    CASE Sub0 OF
 4370      WHEN 0
 4380        SYS "Wimp_GetPointerInfo",,Block
 4390        SYS "Wimp_CreateMenu",,Info,Block!0-24,Block!4+24
 4400        CloseMenu=TRUE
 4410      WHEN 1
 4420        Done=TRUE
 4430    ENDCASE
 4440  WHEN MainMenu:
 4450    CASE Sub0 OF
 4460      WHEN 0
 4470        SYS "Wimp_GetPointerInfo",,Block
 4480        SYS "Wimp_CreateMenu",,Info,Block!0-24,Block!4+24
 4490        CloseMenu=TRUE
 4500      WHEN 1
 4510        PROCResetGrabber
 4520      WHEN 2
 4530        IF Typing THEN
 4540          PROCTickMenu(MainMenu,2,FALSE):Typing=FALSE
 4550        ELSE
 4560          PROCTickMenu(MainMenu,2,TRUE):Typing=TRUE:TypeCounter=0
 4570        ENDIF
 4580      WHEN 3
 4590        SYS "Wimp_GetPointerInfo",,Block
 4600        SYS "Wimp_CreateMenu",,Loc,Block!0-24,Block!4+24
 4610        CloseMenu=TRUE
 4620      WHEN 4
 4630        SYS "Wimp_GetPointerInfo",,Block
 4640        SYS "Wimp_CreateMenu",,Save,Block!0-146,Block!4+60
 4650        CloseMenu=TRUE
 4660      WHEN 5
 4670        IF NOT FNSaveSettings THEN ERROR 9999,"An error occurred whilst writing the settings file."
 4680    ENDCASE
 4690ENDCASE
 4700SYS "Wimp_GetPointerInfo",,Block
 4710IF ((Block!8 AND 1)=1) AND (NOT CloseMenu) THEN PROCMakeMenu
 4720ENDPROC
 4730:
 4740REM -------------------------------------------------------------------------
 4750REM Menu routines
 4760REM -------------------------------------------------------------------------
 4770:
 4780DEF PROCBuildMenus
 4790REM This procedure should only be visited once, since it contains DIMs.
 4800  :
 4810REM In the menu title strings below, if a "|" character is present it will be
 4820REM replaced by a space under RISC OS 3.1 (or greater), or will terminate the
 4830REM string under earlier versions of the wimp. This allows the new indirected
 4840REM menu titles to be used (which were introduced with RISC OS 3.1).
 4850  :
 4860IndirectMenuTextOffsetPointer=0
 4870REM This points to a pool to be used by all menus for their indirected text.
 4880  :
 4890M%=IBMenu
 4900Title$="Text Grabber":DIM IBMenuTitle LEN(Title$)+1:$IBMenuTitle=Title$+CHR$13
 4910PROCMenuInit(IBMenuTitle)
 4920PROCMenuItem("Info",0,Info)
 4930PROCMenuItem("Quit",128,-1)
 4940  :
 4950M%=MainMenu
 4960Title$="Text Grabber":DIM MainMenuTitle LEN(Title$)+2:$MainMenuTitle=Title$+CHR$13
 4970PROCMenuInit(MainMenuTitle)
 4980PROCMenuItem("Info",2,Info)
 4990PROCMenuItem("Clear text",0,-1)
 5000PROCMenuItem("Type text out",0,-1)
 5010PROCMenuItem("Window position",2,Loc)
 5020PROCMenuItem("Save text",0,Save)
 5030PROCMenuItem("Save settings",128,-1)
 5040ENDPROC
 5050:
 5060DEF PROCMakeMenu
 5070IF MenuX<0 THEN MenuX=0
 5080IF MenuY<184 THEN MenuY=184:REM for icon bar
 5090SYS "Wimp_CreateMenu",,M%,MenuX-((36+M%!16)/2),MenuY
 5100ENDPROC
 5110:
 5120DEF PROCMenuInit(MenuTitle)
 5130IF wimp>=310 THEN
 5140  A=INSTR($MenuTitle,"|"):IF A<>0 THEN ?(MenuTitle+(A-1))=32
 5150  MenuMax=LEN($MenuTitle)
 5160  M%!0=MenuTitle
 5170ELSE
 5180  A=INSTR($MenuTitle,"|"):IF A<>0 THEN ?(MenuTitle+(A-1))=13
 5190  MenuMax=LEN(LEFT$($MenuTitle,12))
 5200  $M%=LEFT$($MenuTitle,12)
 5210ENDIF
 5220M%?12=7:M%?13=2:M%?14=11:M%?15=0
 5230M%!16=MenuMax*16
 5240M%!20=44:M%!24=0
 5250P%=M%+28
 5260ENDPROC
 5270:
 5280DEF PROCMenuItem(Text$,Flags,Link)
 5290REM Flags: 1-ticked, 2-dashed line, 4-writeable, 8-message, 128-last item
 5300REM Link: menu or window handle for sub-pointer
 5310P%!0=Flags:P%!4=Link
 5320IF LEN(Text$)<=12 THEN
 5330  P%!8=&07003021:REM Not indirected
 5340  $(P%+12)=Text$
 5350ELSE
 5360  P%!8=&07003121:REM Indirected
 5370  P%!12=IndirectMenuText+IndirectMenuTextOffsetPointer
 5380  P%!16=0:P%!20=0
 5390  $(IndirectMenuText+IndirectMenuTextOffsetPointer)=Text$+CHR$13
 5400  IndirectMenuTextOffsetPointer+=LEN(Text$)+1
 5410  IF IndirectMenuTextOffsetPointer>IndMenuMax THEN ERROR 0,"The indirect menu text buffer has overflowed. Please allocate more space."
 5420ENDIF
 5430P%+=24
 5440IF MenuMax<LEN(Text$) THEN MenuMax=LEN(Text$):M%!16=(MenuMax+1)*16
 5450IF (Flags=128) AND (wimp>=310) THEN M%!28=(((M%!28) AND NOT 256) EOR 256)
 5460  REM Indirected menu titles for RISC OS 3.1 upwards.
 5470ENDPROC
 5480:
 5490REM -------------------------------------------------------------------------
 5500REM Responses to incoming wimp messages
 5510REM -------------------------------------------------------------------------
 5520:
 5530DEF PROCSaveDesktop(File)
 5540LOCAL ERROR
 5550ON ERROR LOCAL Block!12=Block!8:SYS "Wimp_SendMessage",19,Block,Block!4:RESTORE ERROR:ENDPROC
 5560REM The above line acknowledges the message if an error occurs, thereby
 5570REM aborting the desktop save.
 5580BPUT#File,"Run "+OurPathName$+OurFileName$
 5590ENDPROC
 5600:
 5610DEF PROCHelp
 5620Block!12=Block!8:Block!16=&503:HelpInfo=Block+20
 5630  :
 5640REM Block!32 gives window, Block!36 gives icon
 5650  :
 5660CASE Block!32 OF
 5670  WHEN -2:PROCSend("This is the Text Grabber icon.")
 5680          PROCSend("Click MENU for information or to quit.")
 5690          PROCSend("Click SELECT to open the text grabber window.")
 5700  WHEN Grab:
 5710    CASE Block!36 OF
 5720      WHEN 0,1,2:PROCSend("This area displays the text you have grabbed or loaded (or as much of it as will fit in the display area).")
 5730      WHEN 3:PROCSend("Click this icon to choose some text to grab.")
 5740             PROCSend("(Alternatively, press the hot-key combination CTRL-COPY.)")
 5750             PROCSend("Using the hot-key is the only way to grab menu items.")
 5760             PROCSend("CTRL-SHIFT-COPY sends the text at the pointer straight to the caret.")
 5770      WHEN 4:IF BufferLength=0 THEN
 5780               PROCSend("You cannot press this button because there is no text to export.")
 5790             ELSE
 5800               PROCSend("Click SELECT to send the text to the caret.")
 5810               PROCSend("(Alternatively, press the hot-key combination CTRL-SHIFT-INSERT.)")
 5820               PROCSend("Click ADJUST to send the text to a specific area (via hand).")
 5830               PROCSend("(Alternatively, press the hot-key combination CTRL-INSERT.)")
 5840             ENDIF
 5850      OTHERWISE:PROCSend("This is the Text Grabber window.")
 5860                PROCSend("Click MENU for the main menu.")
 5870    ENDCASE
 5880  WHEN Info:PROCSend("This window displays information about Text Grabber.")
 5890            PROCSend("Text Grabber is a member of the OmniDesk Suite of desktop utilities.")
 5900  WHEN Loc:
 5910   CASE TRUE OF
 5920     WHEN ((Block!36)<6):PROCSend("This window lets you snap the magnifier window to an invisble screen grid.")
 5930                         PROCSend("The second position up puts the window just above the icon-bar, and is therefore not evenly spaced with the other rows.")
 5940     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.")
 5950               PROCSend("If snapping is on, the window will open at the appropriate position when you change mode.")
 5960   ENDCASE
 5970 WHEN Save:
 5980   CASE Block!36 OF
 5990     WHEN 0:PROCSend("Drag the file icon to a filer window or to another application which can accept text files, or enter a filename and click OK (or press RETURN) to save.")
 6000     WHEN 1:PROCSend("Drag this icon to a filer window or to another application which can accept text files.")
 6010     WHEN 2:PROCSend("Enter a filename here and click OK (or press RETURN) to save, or drag the file icon to a filer window or to another application which can accept text files.")
 6020     WHEN 3:PROCSend("Click OK (or press RETURN) to save the file, or drag the file icon to a filer window or to another application which can accept text files.")
 6030     OTHERWISE PROCSend("This is the Save window.")
 6040   ENDCASE
 6050OTHERWISE
 6060  IF wimp>=217 THEN
 6070    MenuHelp!0=-1:MenuHelp!4=-1:MenuHelp!8=-1
 6080    SYS "Wimp_GetMenuState",1,MenuHelp,Block!32,Block!36
 6090    CASE M% OF
 6100      WHEN IBMenu:
 6110        IF MenuHelp!4=-1 THEN
 6120          CASE MenuHelp!0 OF
 6130            WHEN 0:PROCSend("Move the pointer right to see information about Text Grabber.")
 6140            WHEN 1:PROCSend("Click SELECT to quit Text Grabber.")
 6150            OTHERWISE PROCSend("This is the Text Grabber icon-bar menu.")
 6160          ENDCASE
 6170        ENDIF
 6180      WHEN MainMenu:
 6190        Direction$="right":IF wimp>=310 AND CHR$(MainMenuTitle?0)="\" THEN Direction$="left"
 6200        CASE MenuHelp!0 OF
 6210          WHEN 0:PROCSend("Move the pointer "+Direction$+" to see information about Text Grabber.")
 6220          WHEN 1:IF FNMenuShaded(MainMenu,1) THEN
 6230                   PROCSend("When you have grabbed or loaded some text, this option will clear it and reset Text Grabber, thereby freeing a small amount of memory for other tasks.")
 6240                 ELSE
 6250                   PROCSend("Click SELECT or ADJUST to clear out the current text and reset Text Grabber.")
 6260                   PROCSend("This will free a small amount of memory for other tasks.")
 6270                 ENDIF
 6280          WHEN 2:IF FNMenuShaded(MainMenu,2) THEN
 6290                   PROCSend("When you have grabbed or loaded some text, this option will cause Text Grabber to type it out at the caret.")
 6300                 ELSE
 6310                   PROCSend("Click SELECT or ADJUST to make Text Grabber type the text at the caret.")
 6320                   PROCSend("This is useful it the Export button doesn't work with the program you are trying to send text to.")
 6330                 ENDIF
 6340          WHEN 3:PROCSend("Move the pointer "+Direction$+" to set the position of the Text Grabber window on the screen.")
 6350          WHEN 4:IF FNMenuShaded(MainMenu,4) THEN
 6360                   PROCSend("When you have grabbed or loaded some text, this option will allow you to save it out to other destinations.")
 6370                 ELSE
 6380                   PROCSend("Move the pointer "+Direction$+" to save the grabbed text as a text file.")
 6390                 ENDIF
 6400          WHEN 5:PROCSend("Click SELECT or ADJUST to save the Text Grabber window position.")
 6410          OTHERWISE PROCSend("This is the Text Grabber main menu.")
 6420        ENDCASE
 6430    ENDCASE
 6440  ENDIF
 6450ENDCASE
 6460  :
 6470?HelpInfo=0
 6480Block!0=(HelpInfo+4-Block) AND NOT 3
 6490SYS "Wimp_SendMessage",17,Block,Block!4
 6500ENDPROC
 6510:
 6520DEF FNOmniHelpMessage(A$)
 6530IF A$="CLICK" THEN =LEFT$("open the text grabber window.",76)+CHR$13
 6540IF A$="DRAG" THEN =LEFT$("Drag a text file here to load it into the text grabber window.",76)+CHR$13
 6550=""
 6560:
 6570DEF PROCSend(Text$)
 6580$HelpInfo=Text$+"|M"
 6590HelpInfo+=LEN(Text$)+2
 6600ENDPROC
 6610:
 6620DEF PROCOmniDeskCalling
 6630IF OmniDesk=0 THEN ENDPROC
 6640REM This first line is for if a broadcast message is received which was
 6650REM intended for a transient copy of the utility. A stand-alone
 6660REM instantiation of the utility should ignore such messages.
 6670CASE Block!20 OF
 6680  WHEN 4:PROCOpen(Grab,TRUE,XPosition,YPosition)
 6690  WHEN 2:LoadFileError=FNLoadFile(Block!44,Block!48,$(Block+52))
 6700         Block!0=20:Block!16=UtilAckLoad:SYS "Wimp_SendMessage",17,Block,OmniDesk
 6710         PROCCheckLoadFileError
 6720         PROCUpdateGrabIcon("",BufferLength,FALSE):REM The FALSE lets us
 6730                                                   REM include CHR$(13).
 6740         PROCUpdateIconColour(Grab,4,7,1)
 6750         PROCShadeMenu(MainMenu,1,FALSE)
 6760         PROCShadeMenu(MainMenu,2,FALSE)
 6770         PROCShadeMenu(MainMenu,4,FALSE)
 6780         Typing=FALSE:PROCTickMenu(MainMenu,2,FALSE)
 6790         IF NOT FNOpenState(Grab) THEN PROCOpen(Grab,TRUE,XPosition,YPosition)
 6800ENDCASE
 6810ENDPROC
 6820:
 6830DEF PROCModeChange
 6840DoModeChange=TRUE
 6850IF OmniDesk=0 THEN PROCUpdateIconForMode("!TextGrab",-2,IconBar)
 6860ENDPROC
 6870:
 6880REM -------------------------------------------------------------------------
 6890REM General non-specific useful routines (mostly wimp)
 6900REM -------------------------------------------------------------------------
 6910:
 6920DEF PROCUpdateIcon(Wndw,Icn,Txt$)
 6930Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 6940IF LEN(Txt$)>(Block!36)-1 THEN
 6950  IF ((Block!24) AND (1<<9))=(1<<9) THEN
 6960    REM Right-justified
 6970    Txt$="�"+RIGHT$(Txt$,(Block!36)-2)
 6980  ELSE
 6990    REM Left-justified or centred
 7000    Txt$=LEFT$(Txt$,(Block!36)-1):RIGHT$(Txt$)="�"
 7010  ENDIF
 7020ENDIF
 7030REM ^ Ensures the text can't overflow the maximum space in the icon.
 7040IF $(Block!28)<>Txt$ THEN
 7050  $(Block!28)=Txt$:Block!8=0:Block!12=0
 7060  SYS "Wimp_SetIconState",,Block
 7070ENDIF
 7080SYS "Wimp_GetCaretPosition",,Block
 7090IF Block!0=Wndw AND Block!4=Icn THEN
 7100  REM If this icon owns the caret, then put it at the end.
 7110  SYS "Wimp_SetCaretPosition",Wndw,Icn,0,0,-1,LEN(Txt$)
 7120ENDIF
 7130ENDPROC
 7140:
 7150DEF PROCUpdateIconColour(Wndw,Icn,FCol,BCol)
 7160REM Change an icon's colours
 7170Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 7180IF (((Block?27)>>4)=BCol) AND (((Block?27) MOD 16)=FCol) THEN ENDPROC
 7190  REM ^ Same colour, so don't change.
 7200Block!12=(%11111111<<24):Block!8=(BCol<<28)+(FCol<<24)
 7210SYS "Wimp_SetIconState",,Block
 7220ENDPROC
 7230:
 7240DEF PROCUpdateSelectedFlag(Wndw,Icn,State)
 7250REM Use State=TRUE to make icon become selected
 7260Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 7270IF ((Block!24) AND (1<<21))=((-State)<<21) THEN ENDPROC
 7280Block!12=(1<<21):IF State THEN Block!8=(1<<21) ELSE Block!8=(0<<21)
 7290SYS "Wimp_SetIconState",,Block
 7300ENDPROC
 7310:
 7320DEF PROCUpdateShadedFlag(Wndw,Icn,State)
 7330REM Use State=TRUE to make icon become shaded
 7340Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 7350IF ((Block!24) AND (1<<22))=((-State)<<22) THEN ENDPROC
 7360Block!12=(1<<22):IF State THEN Block!8=(1<<22) ELSE Block!8=(0<<22)
 7370SYS "Wimp_SetIconState",,Block
 7380ENDPROC
 7390:
 7400DEF FNSelectedState(Wndw,Icn)
 7410Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 7420IF ((Block!24) AND (1<<21))=(1<<21) THEN =TRUE
 7430=FALSE
 7440:
 7450DEF FNShadedState(Wndw,Icn)
 7460Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 7470IF ((Block!24) AND (1<<22))=(1<<22) THEN =TRUE
 7480=FALSE
 7490:
 7500DEF FNOpenState(Wndw)
 7510REM Returns TRUE if window is open; false otherwise
 7520Block!0=Wndw:SYS "Wimp_GetWindowState",,Block
 7530IF ((Block!32) AND (1<<16))=(1<<16) THEN =TRUE
 7540=FALSE
 7550:
 7560DEF PROCShadeMenu(Menu,Item,State)
 7570!(Menu+28+(24*Item)+8)=(!(Menu+28+(24*Item)+8) AND NOT (1<<22)) EOR ((-State)<<22)
 7580ENDPROC
 7590:
 7600DEF PROCTickMenu(Menu,Item,State)
 7610!(Menu+28+(24*Item))=(!(Menu+28+(24*Item)) AND NOT 1) EOR (-State)
 7620ENDPROC
 7630:
 7640DEF FNMenuShaded(Menu,Item)
 7650IF (!(Menu+28+(24*Item)+8) AND (1<<22))=(1<<22) THEN =TRUE
 7660=FALSE
 7670:
 7680DEF FNMenuTicked(Menu,Item)
 7690IF (!(Menu+28+(24*Item)) AND 1)=1 THEN =TRUE
 7700=FALSE
 7710:
 7720DEF FNReadIcon(Wndw,Icn)
 7730REM Read numeric value of icon
 7740Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 7750=VAL($(Block!28))
 7760:
 7770DEF FNReadIconStr(Wndw,Icn)
 7780REM Read string value of icon
 7790Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 7800=$(Block!28)
 7810:
 7820DEF FNModeInfo(var$,mode)
 7830REM Use mode=-1 for current screen mode
 7840CASE var$ OF
 7850  WHEN "XPixels":SYS "OS_ReadModeVariable",mode,11 TO ,,var
 7860  WHEN "YPixels":SYS "OS_ReadModeVariable",mode,12 TO ,,var
 7870  WHEN "NCol":SYS "OS_ReadModeVariable",mode,3 TO ,,var
 7880  WHEN "XEigFactor":SYS "OS_ReadModeVariable",mode,4 TO ,,var
 7890  WHEN "YEigFactor":SYS "OS_ReadModeVariable",mode,5 TO ,,var
 7900  WHEN "BPP":SYS "OS_ReadModeVariable",mode,9 TO ,,var:var=2^var
 7910  OTHERWISE var=-1:REM Fall-through for a faulty input value
 7920ENDCASE
 7930=var
 7940:
 7950DEF PROCUpdateIconForMode(Appname$,Wndw,Icn)
 7960REM This procedure requires that ALL the icon sprites are defined in mode 20
 7970REM or mode 27 (which is equivalent) with a mask but no palette. They should
 7980REM still appear to have the expected resolutions and number of colours, i.e
 7990REM !Sprites23: two colours, high resolution, !Sprites (actually !Sprites24)
 8000REM at mode 12 resolution (double height pixels) in 16 colours, and normal
 8010REM mode 20 resolution, 16 colours for the !Sprites22 icon. If this is not
 8020REM adhered to, then memory shortage errors may occur on a mode change.
 8030Extension$="24"
 8040IF FNModeInfo("YEigFactor",-1)<2 THEN
 8050  IF FNModeInfo("NCol",-1)>2 THEN
 8060    Extension$="22"
 8070  ELSE
 8080    Extension$="23"
 8090  ENDIF
 8100ENDIF
 8110SYS "Wimp_BaseOfSprites" TO ,iconsprite%
 8120SYS "OS_SpriteOp",256+25,iconsprite%,Appname$:REM Delete icon sprite
 8130REM The following three lines assume a mask but no palette:
 8140SYS "OS_SpriteOp",256+40,Sprites,Appname$+Extension$ TO ,,,w,h,,mode:REM Get info about new sprite
 8150SYS "OS_SpriteOp",256+15,iconsprite%,Appname$,0,w,h,mode:REM Create replacement icon sprite
 8160SYS "OS_SpriteOp",256+29,iconsprite%,Appname$:REM Create mask
 8170  :
 8180REM Paint sprite mask into iconsprite mask:
 8190SYS "OS_SpriteOp",256+61,iconsprite%,Appname$,0 TO r0,r1,r2,r3:REM Output to mask
 8200SYS "OS_SpriteOp",256+49,Sprites,Appname$+Extension$,0,0:REM Paint mask from Sprites
 8210GCOL 4,128:CLG:REM Invert to make mask the right way round
 8220SYS "OS_SpriteOp",r0,r1,r2,r3:REM Reset screen output
 8230  :
 8240REM Paint sprite into iconsprite:
 8250SYS "OS_SpriteOp",256+60,iconsprite%,Appname$,0 TO r0,r1,r2,r3:REM Output to new icon sprite
 8260SYS "OS_SpriteOp",256+34,Sprites,Appname$+Extension$,0,0,8:REM Paint copy from Sprites
 8270SYS "OS_SpriteOp",r0,r1,r2,r3:REM Reset screen output
 8280Block!0=Wndw:Block!4=Icn:SYS "Wimp_GetIconState",,Block
 8290Block!8=0:Block!12=0:SYS "Wimp_SetIconState",,Block:REM Re-plot icon
 8300ENDPROC
 8310:
 8320DEF 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$)
 8330Block!0=minX:Block!4=minY:Block!8=maxX:Block!12=maxY:Block!16=Xoffset:Block!20=Yoffset
 8340Block!24=Handle:Block!28=Flags
 8350Block?32=TitleCol:Block?33=TitleBackCol:Block?34=WorkCol:Block?35=WorkBackCol
 8360Block?36=ScrollCol:Block?37=SliderCol:Block?38=InputCol:Block?39=0
 8370Block!40=WminX:Block!44=WminY:Block!48=WmaxX:Block!52=WmaxY
 8380Block!56=TitleFlags:Block!60=Wbutton:Block!64=SpritePoint
 8390Block!68=(MinH<<15)+MinW :::::::::::: REM 0,0 sets the minimum window with to the title width
 8400$(Block+72)=TitleData$:Block!84=0 ::: REM No icons initially
 8410SYS "Wimp_CreateWindow",,Block TO WindowHandle
 8420=WindowHandle
 8430:
 8440DEF PROCInitialise
 8450AppSize=HIMEM-&8000:MinSize=AppSize:SlotEnd=HIMEM
 8460ENDPROC
 8470:
 8480DEF FNAllocateMemory(Required)
 8490SlotSize=FNSlotSize(-1)
 8500IF SlotSize<Required THEN NewSize=FNSlotSize(Required):IF NewSize<Required THEN SlotSize=FNSlotSize(AppSize):=0:REM Returns, indicating memory not claimed
 8510IF SlotSize>Required THEN SlotSize=FNSlotSize(Required)
 8520=SlotSize:REM Returns with bytes claimed
 8530:
 8540DEF FNSlotSize(Bytes)
 8550SYS "Wimp_SlotSize",Bytes,-1 TO Bytes
 8560=Bytes
 8570:
 8580DEF PROCMinimiseWimpSlot
 8590dummy=FNAllocateMemory(MinSize)
 8600ENDPROC
 8610:
 8620DEF PROCCloseFileIfPoss(FileHandle)
 8630LOCAL ERROR
 8640ON ERROR LOCAL RESTORE ERROR:ENDPROC:REM Unable to close file
 8650CLOSE#FileHandle
 8660ENDPROC
 8670:
 8680DEF FNFindFileSize(FileName$)
 8690IF FileName$="<Wimp$Scrap>" THEN
 8700  SYS "OS_File",15,FileName$,,,FileName$ TO ,,,,FileSize
 8710ELSE
 8720  N=-1:REPEAT:N+=1:UNTIL MID$(FileName$,LEN(FileName$)-N,1)="."
 8730  PathName$=LEFT$(FileName$,LEN(FileName$)-N):LeafName$=RIGHT$(FileName$,N)
 8740  SYS "OS_File",13,LeafName$,,,PathName$ TO ,,,,FileSize
 8750ENDIF
 8760=FileSize
 8770:
 8780DEF FNNextEntry
 8790REM Gets next entry (created by BPUT#Data,A$) from a file as a string.
 8800REM Use as A$=FNNextEntry.
 8810LOCAL ERROR
 8820ON ERROR LOCAL RESTORE ERROR:="":REM Error reading file
 8830NE$=GET$#Data
 8840WHILE LEFT$(NE$,1)="|"
 8850  NE$=GET$#Data
 8860ENDWHILE
 8870=NE$
 8880:
 8890DEF PROCDragBox(WindowHandle,IconHandle,DragType,SpriteArea,SpriteName$)
 8900Block!0=WindowHandle:SYS "Wimp_GetWindowState",,Block
 8910wminx=Block!4:wmaxy=Block!16
 8920Block!0=WindowHandle:Block!4=IconHandle:SYS "Wimp_GetIconState",,Block
 8930iminx=Block!8:iminy=Block!12:imaxx=Block!16:imaxy=Block!20
 8940Block!0=WindowHandle:Block!4=DragType
 8950Block!8=(wminx+iminx)
 8960Block!12=(wmaxy+iminy)
 8970Block!16=(wminx+imaxx)
 8980Block!20=(wmaxy+imaxy)
 8990Block!24=1:Block!28=1
 9000Block!32=(FNModeInfo("Xpixels",-1)+1)*(2^FNModeInfo("XEigFactor",-1))
 9010Block!36=(FNModeInfo("Ypixels",-1)+1)*(2^FNModeInfo("YEigFactor",-1))
 9020IF DragASprite THEN
 9030  SYS "DragASprite_Start",%10000101,SpriteArea,SpriteName$,Block+8
 9040ELSE
 9050  SYS "Wimp_DragBox",,Block
 9060ENDIF
 9070ENDPROC
 9080:
 9090REM -------------------------------------------------------------------------
 9100REM Routines common to the OmniDesk utilities
 9110REM -------------------------------------------------------------------------
 9120:
 9130DEF PROCDeclareToOmniDesk
 9140Block!0=208:Block!12=0:Block!16=UtilDeclare
 9150Block!20=Task
 9160$(Block+24)=Taskname$
 9170$(Block+44)=OurFileName$
 9180$(Block+55)=FNOmniHelpMessage("CLICK")
 9190$(Block+132)=FNOmniHelpMessage("DRAG")
 9200SYS "Wimp_SendMessage",17,Block,OmniDesk
 9210ENDPROC
 9220:
 9230DEF PROCSayGoodbye
 9240IF OmniDesk=0 THEN ENDPROC
 9250Block!0=24:Block!12=0:Block!16=UtilQuitting
 9260Block!20=Task
 9270SYS "Wimp_SendMessage",17,Block,OmniDesk
 9280ENDPROC
 9290:
 9300DEF FNReadStartupString
 9310REM Returns task handle of OmniDesk (which is passed in the command string)
 9320REM or 0 if not started by OmniDesk.
 9330SYS "OS_GetEnv" TO Command$
 9340A=INSTR(Command$,"-Startup")
 9350IF A<>0 THEN Startup=TRUE
 9360A=INSTR(Command$,"-Exit")
 9370IF A<>0 THEN Exit=TRUE
 9380A=INSTR(Command$,"-OmniDesk")
 9390IF A=0 THEN =0
 9400=VAL(MID$(Command$,A+9))
 9410:
 9420DEF FNReadWindowLocation(Axis$)
 9430REM Reads which radio icon (if any) is selected in the Window Position
 9440REM selector window and returns the axis coordinate (two calls needed)
 9450REM or -1 for no position selected.
 9460Icon=5:REPEAT:Icon+=1:UNTIL (FNSelectedState(Loc,Icon)=TRUE) OR (Icon=31)
 9470IF Icon=31 THEN =-1:REM All icons deselected
 9480Location=-1:Icon-=6:REM Bring icon into range 0-14
 9490CASE Axis$ OF
 9500  WHEN "X","x":Location=Icon DIV 5
 9510  WHEN "Y","y":Location=4-(Icon MOD 5)
 9520ENDCASE
 9530=Location
 9540:
 9550DEF PROCCleanUpLocWindow
 9560REM Makes sure that none of the 'window' icons in the Loc window is selected.
 9570N=5:REPEAT
 9580N+=1:UNTIL N=30 OR FNSelectedState(Loc,N)
 9590PROCUpdateSelectedFlag(Loc,N,FALSE)
 9600ENDPROC
 9610:
 9620REM -------------------------------------------------------------------------
 9630REM Special routines for this program only
 9640REM -------------------------------------------------------------------------
 9650:
 9660DEF PROCUpdateGrabIcon(Txt$,Length,IgnoreCTRL)
 9670REM This procedure updates the main icon (which contains the grabbed text)
 9680REM in the Text Grabber window. We need a special procedure to do this,
 9690REM because the BASIC string handling facilities won't work for strings
 9700REM which are longer than 255 characters. We also need to do a bit of
 9710REM processing to make the text look tidy if it can't be entirely
 9720REM accomodated by the icon.
 9730REM
 9740REM IgnoreCTRL will, if FALSE, allow control characters to appear as "�".
 9750REM
 9760U%=SlotEnd
 9770Block!0=Grab:Block!4=2:SYS "Wimp_GetIconState",,Block
 9780IF Length=-1 THEN Length=LEN(Txt$)
 9790IF Txt$<>"" THEN
 9800  $(Block!28)=LEFT$(Txt$,130)
 9810ELSE
 9820  IF Length>129 THEN
 9830    N=130:REPEAT:N-=1
 9840    UNTIL (N=0) OR (CHR$(U%?N)=" ")
 9850    IF N=0 THEN N=129
 9860    Count=0
 9870    A$="":M=0:REPEAT
 9880      IF (U%?M)<32 THEN
 9890        IF IgnoreCTRL THEN
 9900          M=(N-1):REM End loop
 9910        ELSE
 9920          A$+="�":Count+=1
 9930        ENDIF
 9940      ELSE
 9950        A$+=CHR$(U%?M):Count+=1
 9960      ENDIF
 9970      M+=1
 9980    UNTIL M=N
 9990    IF Count=N THEN A$+=" �"
10000    $(Block!28)=A$
10010  ELSE
10020    A$="":M=0:REPEAT
10030      IF (U%?M)<32 THEN
10040        IF IgnoreCTRL THEN
10050          M=(Length-1):REM End loop
10060        ELSE
10070          A$+="�"
10080        ENDIF
10090      ELSE
10100        A$+=CHR$(U%?M)
10110      ENDIF
10120      M+=1
10130    UNTIL M=Length
10140    $(Block!28)=A$
10150  ENDIF
10160ENDIF
10170Block!8=0:Block!12=0
10180SYS "Wimp_SetIconState",,Block
10190ENDPROC
10200:
10210DEF PROCGrabTextStart
10220SYS "Wimp_SpriteOp",36,,"ptr_grabhand",2,5,0
10230REPEAT UNTIL (INKEY(-10) OR INKEY(-12))
10240SYS "Wimp_SpriteOp",36,,"ptr_default",1
10250SYS "OS_Byte",21,9:REM Flush mouse buffer in case MENU has been clicked.
10260Grabbing=2:REM Wait 2 Wimp_Polls
10270ENDPROC
10280:
10290:REM We can't make PROCGrabTextStart and PROCGrabText into a single procedure
10300:REM because 2 Wimp_Polls need to happen before we read the mouse position:
10310:REM otherwise we get the Grab window handle and 'Grab text' icon handle.
10320:
10330DEF PROCGrabText
10340LOCAL ERROR
10350ON ERROR LOCAL RESTORE ERROR:ERROR 9999,"An error occurred whilst trying to grab some text. Please note that attempts to grab menu items and titles sometimes fail."
10360SYS "Wimp_GetPointerInfo",,Block
10370Window=Block!12:Icon=Block!16
10380IF Icon>=0 THEN
10390  Block!0=Window:Block!4=Icon:SYS "Wimp_GetIconState",,Block
10400  IconFlags=Block!24
10410  IST=((IconFlags AND (1<<8))>>6)+(IconFlags AND (1<<1))+(IconFlags AND 1)
10420  IF (IconFlags AND (1<<8))=(1<<8) THEN BufferLength=Block!36:ELSE BufferLength=12
10421  IF BufferLength=0 THEN BufferLength=256
10430  U%=FNAllocateMemory(AppSize+BufferLength)
10440  IF U%=0 THEN ERROR 9999,"Unable to claim enough memory to grab the text."
10450  U%=SlotEnd
10460ENDIF
10470IF Icon<0 THEN
10480  IF Icon=-4 THEN
10490    REM Title bar clicked
10500    Block!0=20:Block!12=0:Block!16=0
10510    SYS "Wimp_SendMessage",19,Block,Window,Icon TO ,,SourceTask
10520    REM ^ This gets the required taskname without sending a real message.
10530    :
10540    REM The following condition varies the action depending on the version of
10550    REM RISC OS in use. RISC OS 3 onwards includes the new SWI call
10560    REM TaskManager_TaskNameFromHandle, which makes life easier and is
10570    REM supposed to be used instead of the TaskNameRequ message pair.
10580    REM However, this message pair has been incorporated so the program will
10590    REM still work on RISC OS 2.
10600    :
10610    IF wimp<300 THEN
10620      Block!0=24:Block!12=0:Block!16=&400C6:Block!20=SourceTask
10630      REM Request task name to see if it's the Filer, as Filer windows seem
10640      REM to be stored differently (the buffer length is always 14).
10650      SYS "Wimp_SendMessage",17,Block,0
10660    ELSE
10670      SYS "TaskManager_TaskNameFromHandle",SourceTask TO SourceName$
10680      IF SourceName$="Filer" THEN
10690        PROCGrabFilerTitle
10700      ELSE
10710        PROCGrabTitleBar
10720      ENDIF
10730    ENDIF
10740  ELSE
10750    IF Icon=-1 THEN RESTORE ERROR:ERROR 9999,"The object you chose is not a true icon, and therefore cannot be handled. Sorry."
10760    REM Any other negative value means a window tool:
10770    RESTORE ERROR:ERROR 9999,"You may grab text from window title bars, but not from any other parts of window borders."
10780  ENDIF
10790ELSE
10800  REM Normal icon clicked
10810  Block!0=20:Block!12=0:Block!16=0
10820  SYS "Wimp_SendMessage",19,Block,Window,Icon TO ,,SourceTask
10830  REM ^ This gets the required taskname without sending a real message.
10840  CASE IST OF
10850    WHEN %101,%111,%110
10860      Block!0=Window:Block!4=Icon:SYS "Wimp_GetIconState",,Block
10870      IF SourceTask=0 THEN
10880        REM You get a task handle of 0 for menus.
10890        A$="":N=0
10900        WHILE (N<BufferLength) AND (?((Block!28)+N)>31)
10910          A$+=CHR$(?((Block!28)+N))
10920          N+=1
10930        ENDWHILE
10940        $U%=A$+CHR$10:BufferLength=N+1
10950      ELSE
10970        SYS "Wimp_TransferBlock",SourceTask,Block!28,Task,U%,BufferLength
10980        N=0:WHILE ((U%?N)>31) AND (N<BufferLength):N+=1:ENDWHILE:U%?N=10:BufferLength=N+1
10990        U%?BufferLength=10
11020      ENDIF
11030      PROCUpdateGrabIcon("",BufferLength,TRUE)
11040      PROCUpdateIconColour(Grab,4,7,1)
11050      PROCShadeMenu(MainMenu,1,FALSE)
11060      PROCShadeMenu(MainMenu,2,FALSE)
11070      PROCShadeMenu(MainMenu,4,FALSE)
11080      Typing=FALSE:PROCTickMenu(MainMenu,2,FALSE)
11090    WHEN %001,%011,%010
11100      A$="":N=0
11110      WHILE (N<12) AND (Block?(28+N)>31)
11120        A$+=CHR$(Block?(28+N))
11130        N+=1
11140      ENDWHILE
11150      $U%=A$+CHR$10:BufferLength=N+1
11160      PROCUpdateGrabIcon("",BufferLength,TRUE)
11170      PROCUpdateIconColour(Grab,4,7,1)
11180      PROCShadeMenu(MainMenu,1,FALSE)
11190      PROCShadeMenu(MainMenu,2,FALSE)
11200      PROCShadeMenu(MainMenu,4,FALSE)
11210      Typing=FALSE:PROCTickMenu(MainMenu,2,FALSE)
11220    OTHERWISE
11230      RESTORE ERROR:ERROR 9999,"There was no text available to grab."
11240  ENDCASE
11250  IF BufferLength=1 THEN PROCResetGrabber:REM Empty grab
11260ENDIF
11270ENDPROC
11280:   
11290DEF PROCGrabTitleBar
11300REM Ask for a 32K block to hold the window definition, and pray it's
11310REM enough...  If not, we may be talking NASTY crashes...
11320REM It's unlikely that a window will contain more than 32K's worth of
11330REM icons; but they DO exist...
11340BufferLength=32768:U%=FNAllocateMemory(AppSize+BufferLength)
11350IF U%=0 THEN ERROR 9999,"Unable to claim enough memory to grab the text."
11360U%=SlotEnd:U%!0=Window
11370SYS "Wimp_GetWindowInfo",,U%
11380TitleFlags=U%!60:IST=((TitleFlags AND (1<<8))>>6)+(TitleFlags AND (1<<1))+(TitleFlags AND 1)
11390IF (TitleFlags AND (1<<8))=(1<<8) THEN BufferLength=U%!84:ELSE BufferLength=12
11400CASE IST OF
11410  WHEN %101,%111,%110
11420    SYS "Wimp_TransferBlock",SourceTask,U%!76,Task,U%,BufferLength
11430    N=0:WHILE ((U%?N)>31) AND (N<BufferLength):N+=1:ENDWHILE:U%?N=10:BufferLength=N+1
11440    PROCUpdateGrabIcon("",BufferLength,TRUE)
11450    PROCUpdateIconColour(Grab,4,7,1)
11460    PROCShadeMenu(MainMenu,1,FALSE)
11470    PROCShadeMenu(MainMenu,2,FALSE)
11480    PROCShadeMenu(MainMenu,4,FALSE)
11490    Typing=FALSE:PROCTickMenu(MainMenu,2,FALSE)
11500  WHEN %001,%011,%010
11510    A$="":N=0
11520    WHILE (N<12) AND (U%?(76+N)>31)
11530      A$+=CHR$(U%?(76+N))
11540      N+=1
11550    ENDWHILE
11560    $U%=A$+CHR$10:BufferLength=N+1
11570    PROCUpdateGrabIcon("",BufferLength,TRUE)
11580    PROCUpdateIconColour(Grab,4,7,1)
11590    PROCShadeMenu(MainMenu,1,FALSE)
11600    PROCShadeMenu(MainMenu,2,FALSE)
11610    PROCShadeMenu(MainMenu,4,FALSE)
11620    Typing=FALSE:PROCTickMenu(MainMenu,2,FALSE)
11630ENDCASE
11640ENDPROC
11650:
11660DEF PROCGrabFilerTitle
11670REM It appears that all Filer windows are stored with a 'title text buffer'
11680REM length of 14, regardless of how long they really are. This is a nuisance,
11690REM as it means that they must be treated differently to all other windows.
11700REM This procedure will extract the required filename text, and up to 1024
11710REM characters are allowed for. In fact, 200 characters should suffice, as
11720REM there is an upper limit on the length of filenames of about that number
11730REM of characters. However, we've claimed plenty of memory, so we may as well
11740REM cater for the possibility of that restriction being lifted in future...
11750REM
11760BufferLength=32768:U%=FNAllocateMemory(AppSize+BufferLength)
11770IF U%=0 THEN ERROR 9999,"Unable to claim enough memory to grab the text."
11780U%=SlotEnd:U%!0=Window
11790SYS "Wimp_GetWindowInfo",,U%
11800SYS "Wimp_TransferBlock",SourceTask,U%!76,Task,U%,1024
11810BufferLength=-1:REPEAT
11820BufferLength+=1:UNTIL ((U%?BufferLength)<32) OR BufferLength=1024
11830U%?BufferLength=10
11840PROCUpdateGrabIcon("",BufferLength,TRUE)
11850PROCUpdateIconColour(Grab,4,7,1)
11860PROCShadeMenu(MainMenu,1,FALSE)
11870PROCShadeMenu(MainMenu,2,FALSE)
11880PROCShadeMenu(MainMenu,4,FALSE)
11890Typing=FALSE:PROCTickMenu(MainMenu,2,FALSE)
11900ENDPROC
11910:
11920DEF PROCResetGrabber
11930PROCMinimiseWimpSlot:BufferLength=0
11940PROCUpdateGrabIcon("Waiting...",-1,TRUE)
11950PROCUpdateIconColour(Grab,4,3,1)
11960PROCShadeMenu(MainMenu,1,TRUE)
11970PROCShadeMenu(MainMenu,2,TRUE)
11980PROCShadeMenu(MainMenu,4,TRUE)
11990Typing=FALSE:PROCTickMenu(MainMenu,2,FALSE)
12000ENDPROC
12010:
12020DEF PROCTypeACharacter
12030SYS "Wimp_GetCaretPosition",,Block:IF Block!0=-1 THEN Typing=FALSE:VDU 7:PROCTickMenu(MainMenu,2,FALSE):ENDPROC
12040IF U%?TypeCounter<32 THEN
12050  IF (U%?TypeCounter=13) OR ((U%?TypeCounter>=8) AND (U%?TypeCounter<=11)) THEN
12060    SYS "Wimp_ProcessKey",U%?TypeCounter
12070  ELSE
12080    SYS "Wimp_ProcessKey",32
12090  ENDIF
12100ELSE
12110  SYS "Wimp_ProcessKey",U%?TypeCounter
12120ENDIF
12130TypeCounter+=1
12140IF TypeCounter>=BufferLength THEN Typing=FALSE:PROCTickMenu(MainMenu,2,FALSE)
12150ENDPROC
12160:
12170DEF PROCTransferTextStart
12180IF Poke THEN
12190  REM We're using the hand pointer to poke text into an arbitrary icon
12200  SYS "Wimp_SpriteOp",36,,"ptr_grabhand",2,5,0
12210  REPEAT UNTIL (INKEY(-10) OR INKEY(-12))
12220  SYS "Wimp_SpriteOp",36,,"ptr_default",1
12230  SYS "OS_Byte",21,9:REM Flush mouse buffer in case MENU has been clicked.
12240  Transferring=2:REM Wait 2 Wimp_Polls
12250ELSE
12260  REM We're sending the text straight to the caret
12270  Transferring=1:REM Wait 1 Wimp_Poll
12280ENDIF
12290ENDPROC
12300:
12310DEF PROCTransferText
12320LOCAL ERROR
12330ON ERROR LOCAL RESTORE ERROR:ERROR 9999,"An error occurred whilst trying to transfer the text."
12340IF Poke THEN
12350  SYS "Wimp_GetPointerInfo",,Block
12360  Window=Block!12:Icon=Block!16
12370  IF Icon>=0 THEN
12380    Block!0=Window:Block!4=Icon:SYS "Wimp_GetIconState",,Block
12390    iminX=Block!8:iminY=Block!12
12400    imaxX=Block!16:imaxY=Block!20
12410    IconFlags=Block!24
12420    IST=((IconFlags AND (1<<8))>>6)+(IconFlags AND (1<<1))+(IconFlags AND 1)
12430    IF (IconFlags AND (1<<8))=(1<<8) THEN DestLength=Block!36:ELSE DestLength=12
12440  ENDIF
12450  IF Icon<0 THEN
12460    IF Icon=-4 THEN
12470      REM Title bar clicked
12480      RESTORE ERROR:ERROR 9999,"You cannot transfer text into title bars. Sorry."
12490    ELSE
12500      IF Icon=-1 THEN
12510        REM Window background clicked
12520        SYS "Wimp_GetCaretPosition",,Block
12530        IF Block!0=Window THEN
12540          REM Clicked on the background of the window owning the caret
12550          RESTORE ERROR:PROCTransmitTextStart
12560        ELSE
12570          REM Clicked on another window's background
12580          RESTORE ERROR:ERROR 9999,"You cannot transfer text to window backgrounds unless they own the caret."
12590        ENDIF
12600      ELSE
12610        REM Any other negative value means a window tool:
12620        RESTORE ERROR:ERROR 9999,"You cannot transfer text into the window tools."
12630      ENDIF
12640    ENDIF
12650  ELSE
12660    REM Normal icon clicked
12670    Block!0=20:Block!12=0:Block!16=0
12680    SYS "Wimp_SendMessage",19,Block,Window,Icon TO ,,DestTask
12690    REM ^ This gets the required taskname without sending a real message.
12700    CASE IST OF
12710      WHEN %101,%111,%110
12720        Block!0=Window:Block!4=Icon:SYS "Wimp_GetIconState",,Block
12730        IF DestTask=0 THEN
12740          REM You get a task handle of 0 for menus.
12750          N=0
12760          WHILE (N<DestLength) AND (N<BufferLength)
12770            ?((Block!28)+N)=U%?N
12780            N+=1
12790          ENDWHILE
12800        ELSE
12810          IF BufferLength<DestLength THEN DestLength=BufferLength
12820          SYS "Wimp_TransferBlock",Task,U%,DestTask,Block!28,DestLength-1
12830          SYS "Wimp_TransferBlock",Task,CHR$13,DestTask,(Block!28)+DestLength-1,1:REM Transmit a terminator to avoid crashes.
12840          SYS "Wimp_GetCaretPosition",,Block
12850          IF Block!0=Window AND Block!4=Icon THEN SYS "Wimp_SetCaretPosition",Window,Icon,,,-1,DestLength-1
12860          SYS "Wimp_ForceRedraw",Window,iminX,iminY,imaxX,imaxY
12870        ENDIF
12880      WHEN %001,%011,%010
12890        RESTORE ERROR:ERROR 9999,"Inappropriate destination. You cannot export to direct text (short labels etc) or sprite icons."
12900      OTHERWISE
12910        RESTORE ERROR:ERROR 9999,"Inappropriate destination."
12920    ENDCASE
12930  ENDIF
12940ELSE
12950  REM Poke is FALSE, so transmit the text to the caret
12960  RESTORE ERROR:PROCTransmitTextStart
12970ENDIF
12980ENDPROC
12990:
13000DEF PROCTransmitTextStart
13010REM Not poking, so send the text to the caret, or beep if there isn't one
13020SYS "Wimp_GetCaretPosition",,Block
13030Window=Block!0:Icon=Block!4
13040IF Window=-1 THEN VDU7:ENDPROC
13050REM Find out leaf name in save box:
13060Dragging$=FNReadIconStr(Save,2):MyRef=0
13070Block!0=52:Block!12=MyRef:Block!16=1
13080Block!20=Window:Block!24=Icon
13090Block!28=FNCaretPositionToCoordinate("X")
13100Block!32=FNCaretPositionToCoordinate("Y")
13110Block!36=BufferLength:Block!40=&FFF:$(Block+44)=Dragging$+CHR$0
13120SYS "Wimp_SendMessage",17,Block,Window,Icon TO ,,DestTask
13130Transmit=TRUE:TransmittedBytes=0
13140ENDPROC
13150:
13160DEF PROCTransmitText
13170REM We are exporting grabbed text through memory
13180REM Block!20 is the address we are writing to.
13190REM Block!24 is the size of the buffer we are writing into.
13200Transmit=FALSE:SYS "Wimp_CreateMenu",,-1:MyRef=-1
13210IF Reason>17 THEN Transmit=TRUE:REM Continue if we received acknowledgement
13220IF (BufferLength-TransmittedBytes)>(Block!24) THEN
13230  BytesWritten=Block!24
13240ELSE
13250  BytesWritten=BufferLength-TransmittedBytes
13260  IF TransmittedBytes>=BufferLength THEN BytesWritten=0
13270ENDIF
13280SYS "Wimp_TransferBlock",Task,U%+TransmittedBytes,Block!4,Block!20,BytesWritten
13290TransmittedBytes+=BytesWritten
13300Block!12=Block!8
13310Block!0=28:Block!16=7:Block!24=BytesWritten
13320IF BytesWritten<Block!24 THEN
13330  REM Last message
13340  SYS "Wimp_SendMessage",17,Block,Block!4
13350ELSE
13360  SYS "Wimp_SendMessage",18,Block,Block!4
13370ENDIF
13380ENDPROC
13390:
13400DEF FNCaretPositionToCoordinate(Direction$)
13410SYS "Wimp_GetCaretPosition",,Caret
13420TempBlock!0=Caret!0
13430SYS "Wimp_GetWindowState",,TempBlock
13440CASE Direction$ OF
13450  WHEN "X","x":Position=(TempBlock!4+(Caret!8-TempBlock!20))+(2*2^FNModeInfo("XEigFactor",-1))
13460  WHEN "Y","y":Position=(TempBlock!16+(Caret!12-TempBlock!24))+((Caret?16+256*Caret?17)/2)
13470  OTHERWISE:Position=-1
13480ENDCASE
13490=Position
13500:
13510DEF FNSaveGrabbedToFile(Output$)
13520LOCAL ERROR
13530ON ERROR LOCAL RESTORE ERROR:=FALSE:REM Error writing file
13540  :
13550SYS "OS_File",10,Output$,&FFF,,U%,U%+BufferLength
13560  :
13570=TRUE
13580:
13590DEF FNLoadFile(FileSize,FileType,FileName$)
13600LOCAL ERROR
13610ON ERROR LOCAL RESTORE ERROR:=1:REM Error
13620IF FileType<>&FFF THEN =2:REM Not a text file.
13630PROCMinimiseWimpSlot
13640IF FileSize=-1 THEN FileSize=FNFindFileSize(FileName$)
13650IF FileSize<1 THEN =4
13660BufferLength=FileSize
13670IF FNAllocateMemory(FileSize+AppSize)=0 THEN =3
13680SYS "OS_File",16,FileName$,SlotEnd,0
13690=0
13700:
13710DEF PROCCheckLoadFileError
13720CASE LoadFileError OF
13730  WHEN 1:ERROR 9999,"An error occurred whilst reading the file."
13740  WHEN 2:ERROR 9999,"Text Grabber can only handle text files."
13750  WHEN 3:ERROR 9999,"Unable to claim enough memory to load the file."
13760  WHEN 4:ERROR 9999,"It would be pointless to load an empty file."
13770  OTHERWISE REM We're alright.
13780ENDCASE
13790ENDPROC
13800:
13810DEF FNSaveSettings
13820LOCAL ERROR
13830ON ERROR LOCAL RESTORE ERROR:PROCCloseFileIfPoss(Data):=FALSE:REM Error writing file
13840  :
13850  Data=OPENOUT ("<TextGrab$Dir>.Settings")
13860  BPUT#Data,"| X and Y grid coordinates of Text Grabber window:"
13870  BPUT#Data,STR$(XPosition)
13880  BPUT#Data,STR$(YPosition)
13890  CLOSE#Data
13900  OSCLI("Settype <TextGrab$Dir>.Settings Text")
13910  :
13920=TRUE
13930:
13940DEF FNLoadSettings
13950LOCAL ERROR
13960ON ERROR LOCAL RESTORE ERROR:PROCCloseFileIfPoss(Data):=FALSE:REM 'Settings' file is damaged or missing
13970  :
13980  Data=OPENIN "<TextGrab$Dir>.Settings"
13990  XPosition=VAL(FNNextEntry)
14000  YPosition=VAL(FNNextEntry)
14010  CLOSE#Data
14020  :
14030  IF XPosition<>-1 AND YPosition<>-1 THEN PROCUpdateSelectedFlag(Loc,6+((5*XPosition)+(4-YPosition)),TRUE)
14040  :
14050=TRUE
14060:
14070DEF PROCDefaultSettings
14080XPosition=3:YPosition=3
14090PROCUpdateSelectedFlag(Loc,6+((5*XPosition)+(4-YPosition)),TRUE)
14100ENDPROC

!� >!RunImage for Text Grabber
:
@VersionNumber$="1�01 (24 Aug 1993)":Taskname$="Text�Grabber"
(Exit=�:Startup=�:Done=�
2DoModeChange=�
<FGrabbing=�:Transferring=�:Poke=�:Transmit=�:Typing=�:TypeCounter=0
F+� GrabIconValid 5:$GrabIconValid="Z3;L"
P:
Z2� Block 256,MenuHelp 16,TempBlock 256,Caret 24
d/IndMenuMax=64:� IndirectMenuText IndMenuMax
nC� Templates 1636,InfoInd 190,LocInd 592,GrabInd 238,SaveInd 352
x� IBMenu 76,MainMenu 172
�:
�*� 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 TextGrab$RISCOS 3
�6*RMEnsure UtilityModule 3.00 Set TextGrab$RISCOS 2
�Yș "XOS_ReadVarVal","TextGrab$RISCOS",Block,256,0,0 � ,,len:Block?len=13:wimp$=$Block
�� wimp$<>"3" � wimp$="2"
*Unset TextGrab$RISCOS
:
 *Set TextGrab$SpriteDrag Yes
"9*RMEnsure DragASprite 0.00 Set TextGrab$SpriteDrag No
,Pș "XOS_ReadVarVal","TextGrab$SpriteDrag",Block,256,0,0 � ,,len:Block?len=13
62� $Block="Yes" � DragASprite=�:� DragASprite=�
@*Unset TextGrab$SpriteDrag
J:
TYș "XOS_ReadVarVal","Obey$Dir",Block,256,0,0 � ,,len:Block?len=13:OurFileName$=$Block
^8N=-1:�:N+=1:� �OurFileName$,�(OurFileName$)-N,1)="."
hOOurPathName$=�OurFileName$,�(OurFileName$)-N):OurFileName$=�OurFileName$,N)
r:
|^� Read size of sprite file and load it. We need to DIM 16 bytes more than the file's size.
�9ș "OS_FSControl",28,"<TextGrab$Dir>.Sprites" � ,,len
��� Sprites len+16:!Sprites=len+16:Sprites!4=0:Sprites!8=16:Sprites!12=16:ș "OS_SpriteOp",256+10,Sprites,"<TextGrab$Dir>.Sprites"
�:
�� wimp$="3" �
�  � messagelist% 56
�/  messagelist%!0=&502:messagelist%!4=&400C1
�:  messagelist%!8=UtilOpen:messagelist%!12=UtilQuitting
�3  messagelist%!16=UtilReside:messagelist%!20=10
�)  messagelist%!24=&400C7:� TaskNameIs
�)  messagelist%!28=7:messagelist%!32=6
�)  messagelist%!36=4:messagelist%!40=3
�;  messagelist%!44=2:messagelist%!48=1:messagelist%!52=0
�K  ș "Wimp_Initialise",300,&4B534154,Taskname$,messagelist% � wimp,Task
�
>  ș "Wimp_Initialise",200,&4B534154,Taskname$ � wimp,Task
�
&:
0"ș "Interface_Initialise",Task
::
D6ș "Wimp_OpenTemplate",,"<TextGrab$Dir>.Templates"
NEș "Wimp_LoadTemplate",,Templates,InfoInd,InfoInd+190,-1,"Info",0
X,ș "Wimp_CreateWindow",,Templates � Info
b\ș "Wimp_LoadTemplate",,Templates,LocInd,LocInd+592,-1,"WindowXY",0:Templates!64=Sprites
l+ș "Wimp_CreateWindow",,Templates � Loc
vEș "Wimp_LoadTemplate",,Templates,SaveInd,SaveInd+352,-1,"Save",0
�,ș "Wimp_CreateWindow",,Templates � Save
�<� It is important that the Stats window is defined last:
�Eș "Wimp_LoadTemplate",,Templates,GrabInd,GrabInd+238,-1,"Grab",0
�,ș "Wimp_CreateWindow",,Templates � Grab
�ș "Wimp_CloseTemplate"
�:
��BuildMenus
�:
�� OmniDesk=0 �
�   � Put Icon on the icon-bar
�  Block!0=-1
�1  Block!4=0:Block!8=0:Block!12=68:Block!16=68
�4  Block!20=&17003002:$(Block+24)="!TextGrab"+�13
+  ș "Wimp_CreateIcon",,Block � IconBar
�
:
 �Initialise
*&� OmniDesk<>0 � �DeclareToOmniDesk
4R� Startup � Done=�:� '-Startup' parameter means 'declare and die immediately'.
>:
H&�UpdateIcon(Info,3,VersionNumber$)
R6�ModeChange:� To update icon-bar icon if necessary
\�CleanUpLocWindow
f:
p�ResetGrabber
z:
�5MyRef=-1:� Just an arbitrary value to start with.
�:
�LoadFileError=�
�ReadError=�(�LoadSettings)
�:
�pHotKeys=�CreateWindow(0,0,0,0,0,0,-2,%10000000000000000001000001010000,&FF,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"")
��Open(HotKeys,�,0,0)
�:
�� � �Error
ޔ� ReadError � ReadError=�:�DefaultSettings:� 9999,"An error occurred whilst reading the settings file. Default settings will therefore be used."
�:
�)ș "OS_ReadMonotonicTime" � polltime%
�:
� Main program loop
�
@  ș "Wimp_PollIdle",%1100000110000,Block,polltime% � Reason
$&  ș "Interface_Poll",Reason,,Task
.4  ș "Interface_PreProcessKey",Reason,Block,Task
8  Ȏ Reason �
B3    � 0 : ș "OS_ReadMonotonicTime" � polltime%
LH             � (Grabbing>0) � (Transferring>0) � Typing � Transmit �
V               polltime%+=1
`             �
jN               polltime%+=100:� Do a Wimp_Poll approximately once a second
t             �
~X             � DoModeChange � � �OpenState(Grab) � �Open(Grab,�,XPosition,YPosition)
�D             � Grabbing>0 � Grabbing-=1:� Grabbing=0 � �GrabText
�T             � Transferring>0 � Transferring-=1:� Transferring=0 � �TransferText
�+             � Typing � �TypeACharacter
�    � 1 : �Redraw
�)    � 2 : ș "Wimp_OpenWindow",,Block
�*    � 3 : ș "Wimp_CloseWindow",,Block
�              � Exit � Done=�
�    � 6 : �MouseButton
�    � 7 : �DragFinished
�    � 8 : �KeyPressed
�    � 9 : �DecodeMenu
�$    � 17,18,19 : �RecieveMessage
  �


� Done
�SayGoodbye
!ș "Interface_CloseDown",Task
(&ș "Wimp_CloseDown",Task,&4B534154
2�
<:
F� �Error
PClick=0:Block!0=�:Ȏ � �
Z  � 9999:� Custom error
d    $(Block+4)=�$+�0
nA    ș "Wimp_ReportError",Block,17,"Notice from Text Grabber"
x  
�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
��
�^� Click=2 � �SayGoodbye:ș "Interface_CloseDown",Task:ș "Wimp_CloseDown",Task,&4B534154:�
��
�:
�.� �Open(WindowHandle,TopOfStack,across,up)
�Block!0=WindowHandle
�#ș "Wimp_GetWindowState",,Block
�J� (across<>-1) � (across<>-1) � �DecideWindowPosition(Block,across,up)
�� TopOfStack � Block!28=-1
�ș "Wimp_OpenWindow",,Block
��
:
� �Close(WindowHandle)
Block!0=WindowHandle
"#ș "Wimp_GetWindowState",,Block
, ș "Wimp_CloseWindow",,Block
6�
@:
J,� �DecideWindowPosition(Block,across,up)
TL� 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
hJ� positions across (left, mid-left, centre, mid-right, right) and five
rG� 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)
�OXEigFactor=�ModeInfo("XEigFactor",-1):YEigFactor=�ModeInfo("YEigFactor",-1)
�  :
�8top=Block!16:right=Block!12:bot=Block!8:left=Block!4
�Aș "Wimp_OpenWindow",,Block:ș "Wimp_GetWindowOutline",,Block
�&TB=((Block!16)-top)/(2^YEigFactor)
�(VS=((Block!12)-right)/(2^XEigFactor)
�%HS=(bot-(Block!8))/(2^YEigFactor)
�&LP=(left-(Block!4))/(2^XEigFactor)
�K� LP is Left Pixel: normally present, but not if window is transparent.
�%width=(right-left)/(2^XEigFactor)
�#height=(top-bot)/(2^YEigFactor)
Ȏ across �
  � 0:x=LP
,  � 1:x=LP+((Xpixels+1)-(width+LP+VS))/4
&,  � 2:x=LP+((Xpixels+1)-(width+LP+VS))/2
02  � 3:x=LP+(3*(((Xpixels+1)-(width+LP+VS))/4))
:"  � 4:x=(Xpixels+1)-(width+VS)
D�
NȎ up �
X  � 0:y=HS
b#  � 1:y=HS+(132/(2^YEigFactor))
l-  � 2:y=HS+((Ypixels+1)-(height+TB+HS))/2
v3  � 3:y=HS+(3*(((Ypixels+1)-(height+TB+HS))/4))
�#  � 4:y=(Ypixels+1)-(height+TB)
��
�(� Above coordinates position window.
�(� Now convert to screen coordinates:
�)x=x*(2^XEigFactor):y=y*(2^YEigFactor)
�;width=width*(2^XEigFactor):height=height*(2^YEigFactor)
�Block!12=x+width:Block!4=x
�Block!16=y+height:Block!8=y
��
�:
�O� -------------------------------------------------------------------------
�� Wimp poll routines
�O� -------------------------------------------------------------------------
:

� �Redraw
� DoModeChange �
 K  � Re-opening windows need an extra wimp_poll to happen after the mode
*   � change in order to work:
4<  � �OpenState(Grab) � �Open(Grab,�,XPosition,YPosition)
>  DoModeChange=�
H�
R(ș "Wimp_RedrawWindow",,Block � flag
\ȕ flag
f*  ș "Interface_Render3dWindow",,Block
p*  ș "Wimp_GetRectangle",,Block � flag
z�
��
�:
�� �RecieveMessage
�Ȏ Block!16 �
�  � 0 : Done=�
�6  � 1 : � A task is trying to save a file into us.
�L           � We must tell it to use <Wimp$Scrap> because RAM transfer is
�L           � too much like hard work for loading files (although we need
�J           � to do it when transferring out, due to the nature of this
�           � utility).
�"           � Block!12<>MyRef �
�K             � Ignore the message if the user has dragged our save file
�              � back into us.
	7             Block!0=60:Block!12=Block!8:Block!16=2
	:             Block!36=-1:$(Block+44)="<Wimp$Scrap>"+�0
	7             ș "Wimp_SendMessage",17,Block,Block!4
	$           �
	.F  � 2 : � We're saving out to another application or to the filer.
	8J           � We've just received acknowledgement to go ahead and save.
	BZ           FileName$="":N=44:ȕ ((Block?N)>=32) � (N<256):FileName$+=�(Block?N):N+=1:�
	L            � FileName$<>"" �
	VK             � ^ We can get funny results from some programs when using
	`.             � RAM data transfer protocol.
	jx             � � �SaveGrabbedToFile(FileName$) � �DeleteWimpScrap:� 9999,"An error occurred whilst saving the file."
	tS             Block!12=Block!8:Block!16=3:ș "Wimp_SendMessage",17,Block,Block!4
	~K             MyRef=-1:� Invalidate once again, until our next save out.
	�.             � FileName$<>"<Wimp$Scrap>" �
	�0               �UpdateIcon(Save,2,FileName$)
	�4               � Put full filename into save box
	�             �
	�           �
	�+  � 3 : � File dragged into application
	�            �MinimiseWimpSlot
	�Z           FileName$="":N=44:ȕ ((Block?N)>=32) � (N<256):FileName$+=�(Block?N):N+=1:�
	�2           FileType=Block!40:FileSize=Block!36
	�C           LoadFileError=�LoadFile(FileSize,FileType,FileName$)
	�<           � FileName$="<Wimp$Scrap>" � �DeleteWimpScrap
	�*           Block!12=Block!8:Block!16=4
E           Block!36=-1:Block!40=FileType:$(Block+44)=FileName$+�0

5           ș "Wimp_SendMessage",17,Block,Block!4
/           Typing=�:�TickMenu(MainMenu,2,�)
"           �CheckLoadFileError
(E           �UpdateGrabIcon("",BufferLength,�):� The FALSE lets us
2L                                                     � include CHR$(13).
<,           �UpdateIconColour(Grab,4,7,1)
F'           �ShadeMenu(MainMenu,1,�)
P'           �ShadeMenu(MainMenu,2,�)
Z'           �ShadeMenu(MainMenu,4,�)
dG           � � �OpenState(Grab) � �Open(Grab,�,XPosition,YPosition)
nL  � 4 : � We have saved the text file, and are receiving acknowledgement
xE           � We need to close the menu and turn transmission off.
�'           ș "Wimp_CreateMenu",,-1
�"           Transmit=�:MyRef=-1
�&  � 6 : � Transmit � �TransmitText
�1  � 10: � OmniDesk=0 � �SaveDesktop(Block!20)
�E           � Only save if we have not been started up by OmniDesk
�  � &502 : �Help
�  � &400C1 : �ModeChange
�  � &400C7 : A$="":N=0
�A                ȕ Block?(28+N)>31:A$+=�(Block?(28+N)):N+=1:�
�                Ȏ A$ �
�/                  � "Filer":�GrabFilerTitle
�%                   �GrabTitleBar
�                �
=  � UtilOpen : � $(Block+24)=Taskname$ � �OmniDeskCalling
&  � UtilQuitting : � OmniDesk<>0 �
8                        � Block!20=OmniDesk � Done=�
"                      �
,  � UtilReside : Exit=�
6�
@�
J:
T� �DeleteWimpScrap
^� �
h� � � � �:�
r<� We may receive try to delete a non-existant Wimp$Scrap
|@� file if the receiving task did not recognise the filetype.
��("Delete <Wimp$Scrap>")
��
�:
�� �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(Grab,�,XPosition,YPosition)
	    �
  � Grab
&    Ȏ Buttons �
0      � 2 : � Menu
:1        M%=MainMenu:MenuX=MouseX:MenuY=MouseY
D        � wimp>=310 �
N`          � �$MainMenuTitle,1)="\" � $MainMenuTitle=�$MainMenuTitle,�($MainMenuTitle)-1)+�13
XC          � XPosition=4 � $MainMenuTitle="\"+$MainMenuTitle+�13
b
        �
l        �MakeMenu
v       : � Select, Adjust
�        Ȏ Icon �
�          � 3:� Grab text
�            � Buttons<8 �
�2              ș "Interface_SlabButton",,Block
�               �GrabTextStart
�U              Block!8=0:Block!12=Grab:Block!16=3:ș "Interface_SlabButton",,Block
�            �
�          � 4:� Export text
�2            � (Buttons<8) � (BufferLength>0) �
�2              ș "Interface_SlabButton",,Block
�/              � Buttons=1 � Poke=�:� Poke=�
�$              �TransferTextStart
�U              Block!8=0:Block!12=Grab:Block!16=4:ș "Interface_SlabButton",,Block

            �


        �

	    �

 0  � Loc � Buttons<8:� Reposition main window

*    � Icon>=6 �

4,      XPosition=�ReadWindowLocation("X")

>,      YPosition=�ReadWindowLocation("Y")

H@      � �OpenState(Grab) � �Open(Grab,�,XPosition,YPosition)

R	    �

\  � Save

f    Ȏ Icon �

p      � 1:� File icon

z        � Buttons>=8 �

�          � DragASprite �

�O            � The following lines delete the file icon from the save window

�N            � giving the impression that you are actually dragging it out.

�:            � It will be replaced in PROCDragFinished.

�D            Block!0=Save:Block!4=1:ș "Wimp_GetIconState",,Block

�,            SaveBoxDragFile$=$(Block!32)

�4            Block!8=0:Block!12=0:$(Block!32)=�13

�-            ș "Wimp_SetIconState",,Block

�          �

�-          �DragBox(Save,1,5,1,"file_fff")

�
        �

�      � 3:� OK icon

�*        � (Buttons<8) � (Buttons<>2) �
.          ș "Interface_SlabButton",,Block
5          � Buttons<>1 � ș "Wimp_CreateMenu",,-1
<          A$=�ReadIconStr(Save,2):� A$="" � A$="Grabbed"
$$          �UpdateIcon(Save,2,A$)
.�          � �A$,".")=0 � Block!8=0:Block!12=Save:Block!16=3:ș "Interface_SlabButton",,Block:� 9999,"To save, drag the icon to a directory display."
8�          � � �SaveGrabbedToFile(A$) � �DeleteWimpScrap:Block!8=0:Block!12=Save:Block!16=3:ș "Interface_SlabButton",,Block:� 9999,"An error occurred whilst saving the file."
BQ          Block!8=0:Block!12=Save:Block!16=3:ș "Interface_SlabButton",,Block
L
        �
V	    �
`�
j�
t:
~� �DragFinished
�� DragASprite �
�  ș "DragASprite_Stop"
�?  � The following lines replace the sprite in the save box.
�:  Block!0=Save:Block!4=1:ș "Wimp_GetIconState",,Block
�7  Block!8=0:Block!12=0:$(Block!32)=SaveBoxDragFile$
�#  ș "Wimp_SetIconState",,Block
��
�#ș "Wimp_GetPointerInfo",,Block
�.� Block!12=-1 � �:� Dragged to background.
�YDraggedToX=Block!0:DraggedToY=Block!4:DraggedToWindow=Block!12:DraggedToIcon=Block!16
�%� Find out leaf name in save box:
�3Dragging$=�ReadIconStr(Save,2):len=�(Dragging$)
>N=-1:�:N+=1:� (�Dragging$,�(Dragging$)-N,1)=".") � (N=len)

%� N<len � Dragging$=�Dragging$,N)
F� Dragging$="" � Dragging$="Grabbed":�UpdateIcon(Save,2,Dragging$)
0� OK - Let's begin an inter-application save
(MyRef=0
24Block!0=256:Block!12=MyRef:Block!16=1:� DataSave
<[Block!20=DraggedToWindow:Block!24=DraggedToIcon:Block!28=DraggedToX:Block!32=DraggedToY
FBlock!36=BufferLength
P$Block!40=&FFF:� Filetype of Text
Z$(Block+44)=Dragging$+�0
dMș "Wimp_SendMessage",17,Block,DraggedToWindow,DraggedToIcon � ,,DestTask
nB� DraggedToIcon included in case DraggedToWindow=-2 (icon bar)
x!Transmit=�:TransmittedBytes=0
��
�:
�� �KeyPressed
�2Window=Block!0:Icon=Block!4:Character=Block!24
�Ȏ Window �
�
  � Save:
�    � Character=13 �
�M      Block!8=4:Block!12=Save:Block!16=3:ș "Interface_SlabButton",,Block
�8      A$=�ReadIconStr(Save,2):� A$="" � A$="Grabbed"
�       �UpdateIcon(Save,2,A$)
�      � �A$,".")=0 � Block!8=0:Block!12=Save:Block!16=3:ș "Interface_SlabButton",,Block:� 9999,"To save, drag the icon to a directory display."
�      � � �SaveGrabbedToFile(A$) � �DeleteWimpScrap:Block!8=0:Block!12=Save:Block!16=3:ș "Interface_SlabButton",,Block:� 9999,"An error occurred whilst saving the file."
�M      Block!8=0:Block!12=Save:Block!16=3:ș "Interface_SlabButton",,Block
"      ș "Wimp_CreateMenu",,-1
	    �
(      ș "Wimp_ProcessKey",Character
"	    �
,  
6    Ȏ Character �
@4      � &1AB:� <Ctrl-Copy>: Grab text at pointer
J        �GrabText
T-        �Open(Grab,�,XPosition,YPosition)
^L      � &1BB:� <Ctrl-Shift-Copy>: Send text at pointer straight to caret
h=        �GrabText:� BufferLength>0 � Poke=�:�TransferText
rF      � &1ED:� <Ctrl-Insert>, Transfer text to pointer icon (poke)
|3        � BufferLength>0 � Poke=�:�TransferText
�H      � &1FD:� <Ctrl-Shift-Insert>, Transfer text to caret (no poke)
�3        � BufferLength>0 � Poke=�:�TransferText
�	    
�(      ș "Wimp_ProcessKey",Character
�	    �
��
��
�:
�� �DecodeMenu
�*Sub0=Block!0:Sub1=Block!4:Sub2=Block!8
�CloseMenu=�
�Ȏ M% �
�  � IBMenu:
    Ȏ Sub0 �

      � 0
+        ș "Wimp_GetPointerInfo",,Block
&<        ș "Wimp_CreateMenu",,Info,Block!0-24,Block!4+24
0        CloseMenu=�
:
      � 1
D        Done=�
N	    �
X  � MainMenu:
b    Ȏ Sub0 �
l
      � 0
v+        ș "Wimp_GetPointerInfo",,Block
�<        ș "Wimp_CreateMenu",,Info,Block!0-24,Block!4+24
�        CloseMenu=�
�
      � 1
�        �ResetGrabber
�
      � 2
�        � Typing �
�.          �TickMenu(MainMenu,2,�):Typing=�
�
        �
�<          �TickMenu(MainMenu,2,�):Typing=�:TypeCounter=0
�
        �
�
      � 3
�+        ș "Wimp_GetPointerInfo",,Block
�;        ș "Wimp_CreateMenu",,Loc,Block!0-24,Block!4+24
        CloseMenu=�

      � 4
+        ș "Wimp_GetPointerInfo",,Block
 =        ș "Wimp_CreateMenu",,Save,Block!0-146,Block!4+60
*        CloseMenu=�
4
      � 5
>\        � � �SaveSettings � � 9999,"An error occurred whilst writing the settings file."
H	    �
R�
\#ș "Wimp_GetPointerInfo",,Block
f3� ((Block!8 � 1)=1) � (� CloseMenu) � �MakeMenu
p�
z:
�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
$KTitle$="Text Grabber":� IBMenuTitle �(Title$)+1:$IBMenuTitle=Title$+�13
.�MenuInit(IBMenuTitle)
8�MenuItem("Info",0,Info)
B�MenuItem("Quit",128,-1)
L  :
VM%=MainMenu
`OTitle$="Text Grabber":� MainMenuTitle �(Title$)+2:$MainMenuTitle=Title$+�13
j�MenuInit(MainMenuTitle)
t�MenuItem("Info",2,Info)
~ �MenuItem("Clear text",0,-1)
�#�MenuItem("Type text out",0,-1)
�&�MenuItem("Window position",2,Loc)
�!�MenuItem("Save text",0,Save)
�%�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
2�
<7  A=�$MenuTitle,"|"):� A<>0 � ?(MenuTitle+(A-1))=13
F   MenuMax=�(�$MenuTitle,12))
P  $M%=�$MenuTitle,12)
Z�
d$M%?12=7:M%?13=2:M%?14=11:M%?15=0
nM%!16=MenuMax*16
xM%!20=44:M%!24=0
�P%=M%+28
��
�:
�!� �MenuItem(Text$,Flags,Link)
�K� Flags: 1-ticked, 2-dashed line, 4-writeable, 8-message, 128-last item
�1� Link: menu or window handle for sub-pointer
�P%!0=Flags:P%!4=Link
�� �(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."
,�
6
P%+=24
@>� MenuMax<�(Text$) � MenuMax=�(Text$):M%!16=(MenuMax+1)*16
JA� (Flags=128) � (wimp>=310) � M%!28=(((M%!28) � � 256) � 256)
T7  � Indirected menu titles for RISC OS 3.1 upwards.
^�
h:
rO� -------------------------------------------------------------------------
|)� Responses to incoming wimp messages
�O� -------------------------------------------------------------------------
�:
�� �SaveDesktop(File)
�� �
�G� � � Block!12=Block!8:ș "Wimp_SendMessage",19,Block,Block!4:� �:�
�I� The above line acknowledges the message if an error occurs, thereby
� � 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 �
&2  � -2:�Send("This is the Text Grabber icon.")
0=          �Send("Click MENU for information or to quit.")
:D          �Send("Click SELECT to open the text grabber window.")
D
  � Grab:
N    Ȏ Block!36 �
X�      � 0,1,2:�Send("This area displays the text you have grabbed or loaded (or as much of it as will fit in the display area).")
bC      � 3:�Send("Click this icon to choose some text to grab.")
lS             �Send("(Alternatively, press the hot-key combination CTRL-COPY.)")
vO             �Send("Using the hot-key is the only way to grab menu items.")
�^             �Send("CTRL-SHIFT-COPY sends the text at the pointer straight to the caret.")
�       � 4:� BufferLength=0 �
�\               �Send("You cannot press this button because there is no text to export.")
�             �
�G               �Send("Click SELECT to send the text to the caret.")
�]               �Send("(Alternatively, press the hot-key combination CTRL-SHIFT-INSERT.)")
�X               �Send("Click ADJUST to send the text to a specific area (via hand).")
�W               �Send("(Alternatively, press the hot-key combination CTRL-INSERT.)")
�             �
�5      :�Send("This is the Text Grabber window.")
�:                �Send("Click MENU for the main menu.")
�	    �
�J  � Info:�Send("This window displays information about Text Grabber.")
]            �Send("Text Grabber 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.")
4�      �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.")
H   �
R � Save:
\   Ȏ Block!36 �
f�     � 0:�Send("Drag the file icon to a filer window or to another application which can accept text files, or enter a filename and click OK (or press RETURN) to save.")
pm     � 1:�Send("Drag this icon to a filer window or to another application which can accept text files.")
z�     � 2:�Send("Enter a filename here and click OK (or press RETURN) to save, or drag the file icon to a filer window or to another application which can accept text files.")
��     � 3:�Send("Click OK (or press RETURN) to save the file, or drag the file icon to a filer window or to another application which can accept text files.")
�,      �Send("This is the Save window.")
�   �
�
�  � wimp>=217 �
�1    MenuHelp!0=-1:MenuHelp!4=-1:MenuHelp!8=-1
�;    ș "Wimp_GetMenuState",1,MenuHelp,Block!32,Block!36
�    Ȏ M% �
�      � IBMenu:
�        � MenuHelp!4=-1 �
�          Ȏ MenuHelp!0 �
�Z            � 0:�Send("Move the pointer right to see information about Text Grabber.")
�?            � 1:�Send("Click SELECT to quit Text Grabber.")
B             �Send("This is the Text Grabber icon-bar menu.")
          �

        �
$      � MainMenu:
.W        Direction$="right":� wimp>=310 � �(MainMenuTitle?0)="\" � Direction$="left"
8        Ȏ MenuHelp!0 �
Ba          � 0:�Send("Move the pointer "+Direction$+" to see information about Text Grabber.")
L-          � 1:� �MenuShaded(MainMenu,1) �
V�                   �Send("When you have grabbed or loaded some text, this option will clear it and reset Text Grabber, thereby freeing a small amount of memory for other tasks.")
`                 �
jl                   �Send("Click SELECT or ADJUST to clear out the current text and reset Text Grabber.")
tX                   �Send("This will free a small amount of memory for other tasks.")
~                 �
�-          � 2:� �MenuShaded(MainMenu,2) �
��                   �Send("When you have grabbed or loaded some text, this option will cause Text Grabber to type it out at the caret.")
�                 �
�g                   �Send("Click SELECT or ADJUST to make Text Grabber type the text at the caret.")
��                   �Send("This is useful it the Export button doesn't work with the program you are trying to send text to.")
�                 �
�x          � 3:�Send("Move the pointer "+Direction$+" to set the position of the Text Grabber window on the screen.")
�-          � 4:� �MenuShaded(MainMenu,4) �
؋                   �Send("When you have grabbed or loaded some text, this option will allow you to save it out to other destinations.")
�                 �
�h                   �Send("Move the pointer "+Direction$+" to save the grabbed text as a text file.")
�                 �
[          � 5:�Send("Click SELECT or ADJUST to save the Text Grabber window position.")

<           �Send("This is the Text Grabber main menu.")

        �
	    �
(  �
2�
<  :
F?HelpInfo=0
P$Block!0=(HelpInfo+4-Block) � � 3
Z*ș "Wimp_SendMessage",17,Block,Block!4
d�
n:
x� �OmniHelpMessage(A$)
�<� A$="CLICK" � =�"open the text grabber window.",76)+�13
�\� A$="DRAG" � =�"Drag a text file here to load it into the text grabber window.",76)+�13
�=""
�:
�� �Send(Text$)
�$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(Grab,�,XPosition,YPosition)
"@  � 2:LoadFileError=�LoadFile(Block!44,Block!48,$(Block+52))
,T         Block!0=20:Block!16=UtilAckLoad:ș "Wimp_SendMessage",17,Block,OmniDesk
6          �CheckLoadFileError
@C         �UpdateGrabIcon("",BufferLength,�):� The FALSE lets us
JJ                                                   � include CHR$(13).
T*         �UpdateIconColour(Grab,4,7,1)
^%         �ShadeMenu(MainMenu,1,�)
h%         �ShadeMenu(MainMenu,2,�)
r%         �ShadeMenu(MainMenu,4,�)
|-         Typing=�:�TickMenu(MainMenu,2,�)
�E         � � �OpenState(Grab) � �Open(Grab,�,XPosition,YPosition)
��
��
�:
�� �ModeChange
�DoModeChange=�
�=� OmniDesk=0 � �UpdateIconForMode("!TextGrab",-2,IconBar)
��
�:
�O� -------------------------------------------------------------------------
�8� General non-specific useful routines (mostly wimp)
�O� -------------------------------------------------------------------------
�:
 � �UpdateIcon(Wndw,Icn,Txt$)
:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
� �(Txt$)>(Block!36)-1 �
&&  � ((Block!24) � (1<<9))=(1<<9) �
0    � Right-justified
:$    Txt$="�"+�Txt$,(Block!36)-2)
D  �
N#    � Left-justified or centred
X+    Txt$=�Txt$,(Block!36)-1):�Txt$)="�"
b  �
l�
vF� ^ Ensures the text can't overflow the maximum space in the icon.
�� $(Block!28)<>Txt$ �
�+  $(Block!28)=Txt$:Block!8=0:Block!12=0
�#  ș "Wimp_SetIconState",,Block
��
�%ș "Wimp_GetCaretPosition",,Block
�"� Block!0=Wndw � Block!4=Icn �
�<  � If this icon owns the caret, then put it at the end.
�8  ș "Wimp_SetCaretPosition",Wndw,Icn,0,0,-1,�(Txt$)
��
��
�:
�+� �UpdateIconColour(Wndw,Icn,FCol,BCol)
�� Change an icon's colours
:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
;� (((Block?27)>>4)=BCol) � (((Block?27) � 16)=FCol) � �
'  � ^ Same colour, so don't change.
 :Block!12=(%11111111<<24):Block!8=(BCol<<28)+(FCol<<24)
*!ș "Wimp_SetIconState",,Block
4�
>:
H)� �UpdateSelectedFlag(Wndw,Icn,State)
R1� Use State=TRUE to make icon become selected
\:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
f/� ((Block!24) � (1<<21))=((-State)<<21) � �
p@Block!12=(1<<21):� State � Block!8=(1<<21) � Block!8=(0<<21)
z!ș "Wimp_SetIconState",,Block
��
�:
�'� �UpdateShadedFlag(Wndw,Icn,State)
�/� Use State=TRUE to make icon become shaded
�:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
�/� ((Block!24) � (1<<22))=((-State)<<22) � �
�@Block!12=(1<<22):� State � Block!8=(1<<22) � Block!8=(0<<22)
�!ș "Wimp_SetIconState",,Block
��
�:
�� �SelectedState(Wndw,Icn)
�:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
�)� ((Block!24) � (1<<21))=(1<<21) � =�
=�
:
� �ShadedState(Wndw,Icn)
$:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
.)� ((Block!24) � (1<<22))=(1<<22) � =�
8=�
B:
L� �OpenState(Wndw)
V5� Returns TRUE if window is open; false otherwise
`0Block!0=Wndw:ș "Wimp_GetWindowState",,Block
j)� ((Block!32) � (1<<16))=(1<<16) � =�
t=�
~:
�!� �ShadeMenu(Menu,Item,State)
�P!(Menu+28+(24*Item)+8)=(!(Menu+28+(24*Item)+8) � � (1<<22)) � ((-State)<<22)
��
�:
� � �TickMenu(Menu,Item,State)
�@!(Menu+28+(24*Item))=(!(Menu+28+(24*Item)) � � 1) � (-State)
��
�:
�� �MenuShaded(Menu,Item)
�5� (!(Menu+28+(24*Item)+8) � (1<<22))=(1<<22) � =�
�=�
�:
� �MenuTicked(Menu,Item)

'� (!(Menu+28+(24*Item)) � 1)=1 � =�
=�
:
(� �ReadIcon(Wndw,Icn)
2 � Read numeric value of icon
<:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
F=�($(Block!28))
P:
Z� �ReadIconStr(Wndw,Icn)
d� Read string value of icon
n:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
x=$(Block!28)
�:
�� �ModeInfo(var$,mode)
�)� Use mode=-1 for current screen mode
�
Ȏ var$ �
�:  � "XPixels":ș "OS_ReadModeVariable",mode,11 � ,,var
�:  � "YPixels":ș "OS_ReadModeVariable",mode,12 � ,,var
�6  � "NCol":ș "OS_ReadModeVariable",mode,3 � ,,var
�<  � "XEigFactor":ș "OS_ReadModeVariable",mode,4 � ,,var
�<  � "YEigFactor":ș "OS_ReadModeVariable",mode,5 � ,,var
�?  � "BPP":ș "OS_ReadModeVariable",mode,9 � ,,var:var=2^var
�6   var=-1:� Fall-through for a faulty input value
��
�=var
:
+� �UpdateIconForMode(Appname$,Wndw,Icn)
N� This procedure requires that ALL the icon sprites are defined in mode 20
"N� 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
6N� !Sprites23: two colours, high resolution, !Sprites (actually !Sprites24)
@L� at mode 12 resolution (double height pixels) in 16 colours, and normal
JL� mode 20 resolution, 16 colours for the !Sprites22 icon. If this is not
TI� adhered to, then memory shortage errors may occur on a mode change.
^Extension$="24"
h$� �ModeInfo("YEigFactor",-1)<2 �
r   � �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
�>ș "OS_SpriteOp",256+29,iconsprite%,Appname$:� Create mask
�  :
�-� Paint sprite mask into iconsprite mask:
�Qș "OS_SpriteOp",256+61,iconsprite%,Appname$,0 � r0,r1,r2,r3:� Output to mask
 Uș "OS_SpriteOp",256+49,Sprites,Appname$+Extension$,0,0:� Paint mask from Sprites
 7� 4,128:�:� Invert to make mask the right way round
 6ș "OS_SpriteOp",r0,r1,r2,r3:� Reset screen output
 &  :
 0#� Paint sprite into iconsprite:
 :\ș "OS_SpriteOp",256+60,iconsprite%,Appname$,0 � r0,r1,r2,r3:� Output to new icon sprite
 DWș "OS_SpriteOp",256+34,Sprites,Appname$+Extension$,0,0,8:� Paint copy from Sprites
 N6ș "OS_SpriteOp",r0,r1,r2,r3:� Reset screen output
 X:Block!0=Wndw:Block!4=Icn:ș "Wimp_GetIconState",,Block
 bEBlock!8=0:Block!12=0:ș "Wimp_SetIconState",,Block:� Re-plot icon
 l�
 v:
 ��� �CreateWindow(minX,minY,maxX,maxY,Xoffset,Yoffset,Handle,Flags,TitleCol,TitleBackCol,WorkCol,WorkBackCol,ScrollCol,SliderCol,InputCol,WminX,WminY,WmaxX,WmaxY,TitleFlags,Wbutton,SpritePoint,MinW,MinH,TitleData$)
 �ZBlock!0=minX:Block!4=minY:Block!8=maxX:Block!12=maxY:Block!16=Xoffset:Block!20=Yoffset
 �"Block!24=Handle:Block!28=Flags
 �QBlock?32=TitleCol:Block?33=TitleBackCol:Block?34=WorkCol:Block?35=WorkBackCol
 �FBlock?36=ScrollCol:Block?37=SliderCol:Block?38=InputCol:Block?39=0
 �?Block!40=WminX:Block!44=WminY:Block!48=WmaxX:Block!52=WmaxY
 �=Block!56=TitleFlags:Block!60=Wbutton:Block!64=SpritePoint
 �_Block!68=(MinH<<15)+MinW :::::::::::: � 0,0 sets the minimum window with to the title width
 �>$(Block+72)=TitleData$:Block!84=0 ::: � No icons initially
 �0ș "Wimp_CreateWindow",,Block � WindowHandle
 �=WindowHandle
 �:
 �� �Initialise
!-AppSize=�-&8000:MinSize=AppSize:SlotEnd=�
!�
!:
! � �AllocateMemory(Required)
!*SlotSize=�SlotSize(-1)
!4�� SlotSize<Required � NewSize=�SlotSize(Required):� NewSize<Required � SlotSize=�SlotSize(AppSize):=0:� Returns, indicating memory not claimed
!>6� SlotSize>Required � SlotSize=�SlotSize(Required)
!H*=SlotSize:� Returns with bytes claimed
!R:
!\� �SlotSize(Bytes)
!f'ș "Wimp_SlotSize",Bytes,-1 � Bytes
!p
=Bytes
!z:
!�� �MinimiseWimpSlot
!�"dummy=�AllocateMemory(MinSize)
!��
!�:
!�"� �CloseFileIfPoss(FileHandle)
!�� �
!�&� � � � �:�:� Unable to close file
!��#FileHandle
!��
!�:
!�� �FindFileSize(FileName$)
!� � FileName$="<Wimp$Scrap>" �
!�:  ș "OS_File",15,FileName$,,,FileName$ � ,,,,FileSize
"�
"4  N=-1:�:N+=1:� �FileName$,�(FileName$)-N,1)="."
"B  PathName$=�FileName$,�(FileName$)-N):LeafName$=�FileName$,N)
"$:  ș "OS_File",13,LeafName$,,,PathName$ � ,,,,FileSize
".�
"8
=FileSize
"B:
"L� �NextEntry
"VH� Gets next entry (created by BPUT#Data,A$) from a file as a string.
"`� Use as A$=FNNextEntry.
"j� �
"t&� � � � �:="":� Error reading file
"~NE$=�#Data
"�ȕ �NE$,1)="|"
"�  NE$=�#Data
"��
"�=NE$
"�:
"�G� �DragBox(WindowHandle,IconHandle,DragType,SpriteArea,SpriteName$)
"�8Block!0=WindowHandle:ș "Wimp_GetWindowState",,Block
"� wminx=Block!4:wmaxy=Block!16
"�IBlock!0=WindowHandle:Block!4=IconHandle:ș "Wimp_GetIconState",,Block
"�>iminx=Block!8:iminy=Block!12:imaxx=Block!16:imaxy=Block!20
"�)Block!0=WindowHandle:Block!4=DragType
"�Block!8=(wminx+iminx)
#Block!12=(wmaxy+iminy)
#
Block!16=(wminx+imaxx)
#Block!20=(wmaxy+imaxy)
#Block!24=1:Block!28=1
#(GBlock!32=(�ModeInfo("Xpixels",-1)+1)*(2^�ModeInfo("XEigFactor",-1))
#2GBlock!36=(�ModeInfo("Ypixels",-1)+1)*(2^�ModeInfo("YEigFactor",-1))
#<� DragASprite �
#FE  ș "DragASprite_Start",%10000101,SpriteArea,SpriteName$,Block+8
#P�
#Z  ș "Wimp_DragBox",,Block
#d�
#n�
#x:
#�O� -------------------------------------------------------------------------
#�/� Routines common to the OmniDesk utilities
#�O� -------------------------------------------------------------------------
#�:
#�� �DeclareToOmniDesk
#�/Block!0=208:Block!12=0:Block!16=UtilDeclare
#�Block!20=Task
#�$(Block+24)=Taskname$
#�$(Block+44)=OurFileName$
#�)$(Block+55)=�OmniHelpMessage("CLICK")
#�)$(Block+132)=�OmniHelpMessage("DRAG")
#�+ș "Wimp_SendMessage",17,Block,OmniDesk
#��
$:
$� �SayGoodbye
$� OmniDesk=0 � �
$"/Block!0=24:Block!12=0:Block!16=UtilQuitting
$,Block!20=Task
$6+ș "Wimp_SendMessage",17,Block,OmniDesk
$@�
$J:
$T� �ReadStartupString
$^M� Returns task handle of OmniDesk (which is passed in the command string)
$h&� or 0 if not started by OmniDesk.
$rș "OS_GetEnv" � Command$
$|A=�Command$,"-Startup")
$�� A<>0 � Startup=�
$�A=�Command$,"-Exit")
$�� A<>0 � Exit=�
$�A=�Command$,"-OmniDesk")
$�� A=0 � =0
$�=�(�Command$,A+9))
$�:
$� � �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)
%0�
%:
=Location
%D:
%N� �CleanUpLocWindow
%XO� Makes sure that none of the 'window' icons in the Loc window is selected.
%b	N=5:�
%l'N+=1:� N=30 � �SelectedState(Loc,N)
%v �UpdateSelectedFlag(Loc,N,�)
%��
%�:
%�O� -------------------------------------------------------------------------
%�,� Special routines for this program only
%�O� -------------------------------------------------------------------------
%�:
%�-� �UpdateGrabIcon(Txt$,Length,IgnoreCTRL)
%�L� This procedure updates the main icon (which contains the grabbed text)
%�I� in the Text Grabber window. We need a special procedure to do this,
%�I� because the BASIC string handling facilities won't work for strings
%�G� which are longer than 255 characters. We also need to do a bit of
%�C� processing to make the text look tidy if it can't be entirely
%�� accomodated by the icon.
&�
&K� IgnoreCTRL will, if FALSE, allow control characters to appear as "�".
&�
& U%=SlotEnd
&*8Block!0=Grab:Block!4=2:ș "Wimp_GetIconState",,Block
&4 � Length=-1 � Length=�(Txt$)
&>� Txt$<>"" �
&H  $(Block!28)=�Txt$,130)
&R�
&\  � Length>129 �
&f    N=130:�:N-=1
&p    � (N=0) � (�(U%?N)=" ")
&z    � N=0 � N=129
&�    Count=0
&�    A$="":M=0:�
&�      � (U%?M)<32 �
&�        � IgnoreCTRL �
&�           M=(N-1):� End loop
&�
        �
&�          A$+="�":Count+=1
&�
        �
&�      �
&�         A$+=�(U%?M):Count+=1
&�      �
&�      M+=1
&�
    � M=N
'    � Count=N � A$+=" �"
'    $(Block!28)=A$
'  �
'$    A$="":M=0:�
'.      � (U%?M)<32 �
'8        � IgnoreCTRL �
'B%          M=(Length-1):� End loop
'L
        �
'V          A$+="�"
'`
        �
'j      �
't        A$+=�(U%?M)
'~      �
'�      M+=1
'�    � M=Length
'�    $(Block!28)=A$
'�  �
'��
'�Block!8=0:Block!12=0
'�!ș "Wimp_SetIconState",,Block
'��
'�:
'�� �GrabTextStart
'�/ș "Wimp_SpriteOp",36,,"ptr_grabhand",2,5,0
'�� � (�(-10) � �(-12))
(*ș "Wimp_SpriteOp",36,,"ptr_default",1
(
Iș "OS_Byte",21,9:� Flush mouse buffer in case MENU has been clicked.
("Grabbing=2:� Wait 2 Wimp_Polls
(�
((:
(2O:� We can't make PROCGrabTextStart and PROCGrabText into a single procedure
(<M:� because 2 Wimp_Polls need to happen before we read the mouse position:
(FK:� otherwise we get the Grab window handle and 'Grab text' icon handle.
(P:
(Z� �GrabText
(d� �
(n�� � � � �:� 9999,"An error occurred whilst trying to grab some text. Please note that attempts to grab menu items and titles sometimes fail."
(x#ș "Wimp_GetPointerInfo",,Block
(�!Window=Block!12:Icon=Block!16
(�� Icon>=0 �
(�?  Block!0=Window:Block!4=Icon:ș "Wimp_GetIconState",,Block
(�  IconFlags=Block!24
(�H  IST=((IconFlags � (1<<8))>>6)+(IconFlags � (1<<1))+(IconFlags � 1)
(�M  � (IconFlags � (1<<8))=(1<<8) � BufferLength=Block!36:� BufferLength=12
(�)  � BufferLength=0 � BufferLength=256
(�.  U%=�AllocateMemory(AppSize+BufferLength)
(�G  � U%=0 � � 9999,"Unable to claim enough memory to grab the text."
(�  U%=SlotEnd
(��
(�� Icon<0 �
(�  � Icon=-4 �
(�    � Title bar clicked
)(    Block!0=20:Block!12=0:Block!16=0
)A    ș "Wimp_SendMessage",19,Block,Window,Icon � ,,SourceTask
)K    � ^ This gets the required taskname without sending a real message.
)"	    :
),O    � The following condition varies the action depending on the version of
)6E    � RISC OS in use. RISC OS 3 onwards includes the new SWI call
)@H    � TaskManager_TaskNameFromHandle, which makes life easier and is
)JG    � supposed to be used instead of the TaskNameRequ message pair.
)TN    � However, this message pair has been incorporated so the program will
)^"    � still work on RISC OS 2.
)h	    :
)r    � wimp<300 �
)|C      Block!0=24:Block!12=0:Block!16=&400C6:Block!20=SourceTask
)�M      � Request task name to see if it's the Filer, as Filer windows seem
)�F      � to be stored differently (the buffer length is always 14).
)�*      ș "Wimp_SendMessage",17,Block,0
)�	    �
)�F      ș "TaskManager_TaskNameFromHandle",SourceTask � SourceName$
)�!      � SourceName$="Filer" �
)�        �GrabFilerTitle
)�      �
)�        �GrabTitleBar
)�      �
)�	    �
)�  �
)�q    � Icon=-1 � � �:� 9999,"The object you chose is not a true icon, and therefore cannot be handled. Sorry."
*7    � Any other negative value means a window tool:
*n    � �:� 9999,"You may grab text from window title bars, but not from any other parts of window borders."
*  �
*&�
*0  � Normal icon clicked
*:&  Block!0=20:Block!12=0:Block!16=0
*D?  ș "Wimp_SendMessage",19,Block,Window,Icon � ,,SourceTask
*NI  � ^ This gets the required taskname without sending a real message.
*X  Ȏ IST �
*b    � %101,%111,%110
*lC      Block!0=Window:Block!4=Icon:ș "Wimp_GetIconState",,Block
*v      � SourceTask=0 �
*�3        � You get a task handle of 0 for menus.
*�        A$="":N=0
*�6        ȕ (N<BufferLength) � (?((Block!28)+N)>31)
*�$          A$+=�(?((Block!28)+N))
*�          N+=1
*�
        �
*�'        $U%=A$+�10:BufferLength=N+1
*�      �
*�L        ș "Wimp_TransferBlock",SourceTask,Block!28,Task,U%,BufferLength
*�Q        N=0:ȕ ((U%?N)>31) � (N<BufferLength):N+=1:�:U%?N=10:BufferLength=N+1
*�        U%?BufferLength=10
+      �
+,      �UpdateGrabIcon("",BufferLength,�)
+ '      �UpdateIconColour(Grab,4,7,1)
+*"      �ShadeMenu(MainMenu,1,�)
+4"      �ShadeMenu(MainMenu,2,�)
+>"      �ShadeMenu(MainMenu,4,�)
+H*      Typing=�:�TickMenu(MainMenu,2,�)
+R    � %001,%011,%010
+\      A$="":N=0
+f'      ȕ (N<12) � (Block?(28+N)>31)
+p        A$+=�(Block?(28+N))
+z        N+=1
+�      �
+�%      $U%=A$+�10:BufferLength=N+1
+�,      �UpdateGrabIcon("",BufferLength,�)
+�'      �UpdateIconColour(Grab,4,7,1)
+�"      �ShadeMenu(MainMenu,1,�)
+�"      �ShadeMenu(MainMenu,2,�)
+�"      �ShadeMenu(MainMenu,4,�)
+�*      Typing=�:�TickMenu(MainMenu,2,�)
+�	    
+�;      � �:� 9999,"There was no text available to grab."
+�  �
+�3  � BufferLength=1 � �ResetGrabber:� Empty grab
+��
,�
,:   
,� �GrabTitleBar
,$F� Ask for a 32K block to hold the window definition, and pray it's
,.;� enough...  If not, we may be talking NASTY crashes...
,8G� It's unlikely that a window will contain more than 32K's worth of
,B!� icons; but they DO exist...
,L?BufferLength=32768:U%=�AllocateMemory(AppSize+BufferLength)
,VE� U%=0 � � 9999,"Unable to claim enough memory to grab the text."
,`U%=SlotEnd:U%!0=Window
,jș "Wimp_GetWindowInfo",,U%
,tZTitleFlags=U%!60:IST=((TitleFlags � (1<<8))>>6)+(TitleFlags � (1<<1))+(TitleFlags � 1)
,~I� (TitleFlags � (1<<8))=(1<<8) � BufferLength=U%!84:� BufferLength=12
,�Ȏ IST �
,�  � %101,%111,%110
,�E    ș "Wimp_TransferBlock",SourceTask,U%!76,Task,U%,BufferLength
,�M    N=0:ȕ ((U%?N)>31) � (N<BufferLength):N+=1:�:U%?N=10:BufferLength=N+1
,�*    �UpdateGrabIcon("",BufferLength,�)
,�%    �UpdateIconColour(Grab,4,7,1)
,�     �ShadeMenu(MainMenu,1,�)
,�     �ShadeMenu(MainMenu,2,�)
,�     �ShadeMenu(MainMenu,4,�)
,�(    Typing=�:�TickMenu(MainMenu,2,�)
,�  � %001,%011,%010
,�    A$="":N=0
-"    ȕ (N<12) � (U%?(76+N)>31)
-
      A$+=�(U%?(76+N))
-      N+=1
-	    �
-(#    $U%=A$+�10:BufferLength=N+1
-2*    �UpdateGrabIcon("",BufferLength,�)
-<%    �UpdateIconColour(Grab,4,7,1)
-F     �ShadeMenu(MainMenu,1,�)
-P     �ShadeMenu(MainMenu,2,�)
-Z     �ShadeMenu(MainMenu,4,�)
-d(    Typing=�:�TickMenu(MainMenu,2,�)
-n�
-x�
-�:
-�� �GrabFilerTitle
-�M� It appears that all Filer windows are stored with a 'title text buffer'
-�O� length of 14, regardless of how long they really are. This is a nuisance,
-�M� as it means that they must be treated differently to all other windows.
-�L� This procedure will extract the required filename text, and up to 1024
-�L� characters are allowed for. In fact, 200 characters should suffice, as
-�M� there is an upper limit on the length of filenames of about that number
-�O� of characters. However, we've claimed plenty of memory, so we may as well
-�M� cater for the possibility of that restriction being lifted in future...
-��
-�?BufferLength=32768:U%=�AllocateMemory(AppSize+BufferLength)
-�E� U%=0 � � 9999,"Unable to claim enough memory to grab the text."
.U%=SlotEnd:U%!0=Window
.ș "Wimp_GetWindowInfo",,U%
.9ș "Wimp_TransferBlock",SourceTask,U%!76,Task,U%,1024
."BufferLength=-1:�
.,@BufferLength+=1:� ((U%?BufferLength)<32) � BufferLength=1024
.6U%?BufferLength=10
.@&�UpdateGrabIcon("",BufferLength,�)
.J!�UpdateIconColour(Grab,4,7,1)
.T�ShadeMenu(MainMenu,1,�)
.^�ShadeMenu(MainMenu,2,�)
.h�ShadeMenu(MainMenu,4,�)
.r$Typing=�:�TickMenu(MainMenu,2,�)
.|�
.�:
.�� �ResetGrabber
.�$�MinimiseWimpSlot:BufferLength=0
.�&�UpdateGrabIcon("Waiting...",-1,�)
.�!�UpdateIconColour(Grab,4,3,1)
.��ShadeMenu(MainMenu,1,�)
.��ShadeMenu(MainMenu,2,�)
.��ShadeMenu(MainMenu,4,�)
.�$Typing=�:�TickMenu(MainMenu,2,�)
.��
.�:
.�� �TypeACharacter
.�[ș "Wimp_GetCaretPosition",,Block:� Block!0=-1 � Typing=�:� 7:�TickMenu(MainMenu,2,�):�
/� U%?TypeCounter<32 �
/L  � (U%?TypeCounter=13) � ((U%?TypeCounter>=8) � (U%?TypeCounter<=11)) �
/+    ș "Wimp_ProcessKey",U%?TypeCounter
/&  �
/0    ș "Wimp_ProcessKey",32
/:  �
/D�
/N)  ș "Wimp_ProcessKey",U%?TypeCounter
/X�
/bTypeCounter+=1
/lB� TypeCounter>=BufferLength � Typing=�:�TickMenu(MainMenu,2,�)
/v�
/�:
/�� �TransferTextStart
/�� Poke �
/�H  � We're using the hand pointer to poke text into an arbitrary icon
/�1  ș "Wimp_SpriteOp",36,,"ptr_grabhand",2,5,0
/�  � � (�(-10) � �(-12))
/�,  ș "Wimp_SpriteOp",36,,"ptr_default",1
/�K  ș "OS_Byte",21,9:� Flush mouse buffer in case MENU has been clicked.
/�(  Transferring=2:� Wait 2 Wimp_Polls
/��
/�4  � We're sending the text straight to the caret
/�'  Transferring=1:� Wait 1 Wimp_Poll
/��
0�
0:
0� �TransferText
0 � �
0*L� � � � �:� 9999,"An error occurred whilst trying to transfer the text."
04� Poke �
0>%  ș "Wimp_GetPointerInfo",,Block
0H#  Window=Block!12:Icon=Block!16
0R  � Icon>=0 �
0\A    Block!0=Window:Block!4=Icon:ș "Wimp_GetIconState",,Block
0f$    iminX=Block!8:iminY=Block!12
0p%    imaxX=Block!16:imaxY=Block!20
0z    IconFlags=Block!24
0�J    IST=((IconFlags � (1<<8))>>6)+(IconFlags � (1<<1))+(IconFlags � 1)
0�K    � (IconFlags � (1<<8))=(1<<8) � DestLength=Block!36:� DestLength=12
0�  �
0�  � Icon<0 �
0�    � Icon=-4 �
0�      � Title bar clicked
0�G      � �:� 9999,"You cannot transfer text into title bars. Sorry."
0�	    �
0�      � Icon=-1 �
0�'        � Window background clicked
0�-        ș "Wimp_GetCaretPosition",,Block
0�        � Block!0=Window �
0�H          � Clicked on the background of the window owning the caret
1$          � �:�TransmitTextStart
1
        �
16          � Clicked on another window's background
1$d          � �:� 9999,"You cannot transfer text to window backgrounds unless they own the caret."
1.
        �
18      �
1B;        � Any other negative value means a window tool:
1LH        � �:� 9999,"You cannot transfer text into the window tools."
1V      �
1`	    �
1j  �
1t    � Normal icon clicked
1~(    Block!0=20:Block!12=0:Block!16=0
1�?    ș "Wimp_SendMessage",19,Block,Window,Icon � ,,DestTask
1�K    � ^ This gets the required taskname without sending a real message.
1�    Ȏ IST �
1�      � %101,%111,%110
1�E        Block!0=Window:Block!4=Icon:ș "Wimp_GetIconState",,Block
1�        � DestTask=0 �
1�5          � You get a task handle of 0 for menus.
1�          N=0
1�2          ȕ (N<DestLength) � (N<BufferLength)
1�$            ?((Block!28)+N)=U%?N
1�            N+=1
1�          �
2
        �
2
A          � BufferLength<DestLength � DestLength=BufferLength
2L          ș "Wimp_TransferBlock",Task,U%,DestTask,Block!28,DestLength-1
2{          ș "Wimp_TransferBlock",Task,�13,DestTask,(Block!28)+DestLength-1,1:� Transmit a terminator to avoid crashes.
2(/          ș "Wimp_GetCaretPosition",,Block
22h          � Block!0=Window � Block!4=Icon � ș "Wimp_SetCaretPosition",Window,Icon,,,-1,DestLength-1
2<B          ș "Wimp_ForceRedraw",Window,iminX,iminY,imaxX,imaxY
2F
        �
2P      � %001,%011,%010
2Zx        � �:� 9999,"Inappropriate destination. You cannot export to direct text (short labels etc) or sprite icons."
2d      
2n3        � �:� 9999,"Inappropriate destination."
2x	    �
2�  �
2��
2�8  � Poke is FALSE, so transmit the text to the caret
2�  � �:�TransmitTextStart
2��
2��
2�:
2�� �TransmitTextStart
2�K� Not poking, so send the text to the caret, or beep if there isn't one
2�%ș "Wimp_GetCaretPosition",,Block
2�Window=Block!0:Icon=Block!4
2�� Window=-1 � �7:�
2�%� Find out leaf name in save box:
3*Dragging$=�ReadIconStr(Save,2):MyRef=0
3(Block!0=52:Block!12=MyRef:Block!16=1
3!Block!20=Window:Block!24=Icon
3",Block!28=�CaretPositionToCoordinate("X")
3,,Block!32=�CaretPositionToCoordinate("Y")
36@Block!36=BufferLength:Block!40=&FFF:$(Block+44)=Dragging$+�0
3@;ș "Wimp_SendMessage",17,Block,Window,Icon � ,,DestTask
3J!Transmit=�:TransmittedBytes=0
3T�
3^:
3h� �TransmitText
3r2� We are exporting grabbed text through memory
3|0� Block!20 is the address we are writing to.
3�=� Block!24 is the size of the buffer we are writing into.
3�0Transmit=�:ș "Wimp_CreateMenu",,-1:MyRef=-1
3�F� Reason>17 � Transmit=�:� Continue if we received acknowledgement
3�2� (BufferLength-TransmittedBytes)>(Block!24) �
3�  BytesWritten=Block!24
3��
3�0  BytesWritten=BufferLength-TransmittedBytes
3�7  � TransmittedBytes>=BufferLength � BytesWritten=0
3��
3�Rș "Wimp_TransferBlock",Task,U%+TransmittedBytes,Block!4,Block!20,BytesWritten
3�"TransmittedBytes+=BytesWritten
3�Block!12=Block!8
3�/Block!0=28:Block!16=7:Block!24=BytesWritten
4� BytesWritten<Block!24 �
4  � Last message
4,  ș "Wimp_SendMessage",17,Block,Block!4
4&�
40,  ș "Wimp_SendMessage",18,Block,Block!4
4:�
4D�
4N:
4X,� �CaretPositionToCoordinate(Direction$)
4b%ș "Wimp_GetCaretPosition",,Caret
4lTempBlock!0=Caret!0
4v'ș "Wimp_GetWindowState",,TempBlock
4�Ȏ Direction$ �
4�^  � "X","x":Position=(TempBlock!4+(Caret!8-TempBlock!20))+(2*2^�ModeInfo("XEigFactor",-1))
4�[  � "Y","y":Position=(TempBlock!16+(Caret!12-TempBlock!24))+((Caret?16+256*Caret?17)/2)
4�  :Position=-1
4��
4�
=Position
4�:
4�!� �SaveGrabbedToFile(Output$)
4�� �
4�%� � � � �:=�:� Error writing file
4�  :
4�4ș "OS_File",10,Output$,&FFF,,U%,U%+BufferLength
4�  :
5=�
5:
5,� �LoadFile(FileSize,FileType,FileName$)
5 � �
5*� � � � �:=1:� Error
54,� FileType<>&FFF � =2:� Not a text file.
5>�MinimiseWimpSlot
5H5� FileSize=-1 � FileSize=�FindFileSize(FileName$)
5R� FileSize<1 � =4
5\BufferLength=FileSize
5f.� �AllocateMemory(FileSize+AppSize)=0 � =3
5p'ș "OS_File",16,FileName$,SlotEnd,0
5z=0
5�:
5�� �CheckLoadFileError
5�Ȏ LoadFileError �
5�=  � 1:� 9999,"An error occurred whilst reading the file."
5�;  � 2:� 9999,"Text Grabber can only handle text files."
5�B  � 3:� 9999,"Unable to claim enough memory to load the file."
5�?  � 4:� 9999,"It would be pointless to load an empty file."
5�   � We're alright.
5��
5��
5�:
5�� �SaveSettings
5�� �
6<� � � � �:�CloseFileIfPoss(Data):=�:� Error writing file
6  :
6(  Data=� ("<TextGrab$Dir>.Settings")
6$A  �#Data,"| X and Y grid coordinates of Text Grabber window:"
6.  �#Data,�(XPosition)
68  �#Data,�(YPosition)
6B  �#Data
6L/  �("Settype <TextGrab$Dir>.Settings Text")
6V  :
6`=�
6j:
6t� �LoadSettings
6~� �
6�O� � � � �:�CloseFileIfPoss(Data):=�:� 'Settings' file is damaged or missing
6�  :
6�&  Data=� "<TextGrab$Dir>.Settings"
6�  XPosition=�(�NextEntry)
6�  YPosition=�(�NextEntry)
6�  �#Data
6�  :
6�b  � XPosition<>-1 � YPosition<>-1 � �UpdateSelectedFlag(Loc,6+((5*XPosition)+(4-YPosition)),�)
6�  :
6�=�
6�:
6�� �DefaultSettings
7XPosition=3:YPosition=3
7
>�UpdateSelectedFlag(Loc,6+((5*XPosition)+(4-YPosition)),�)
7�
�
00000000  0d 00 0a 21 f4 20 3e 21  52 75 6e 49 6d 61 67 65  |...!. >!RunImage|
00000010  20 66 6f 72 20 54 65 78  74 20 47 72 61 62 62 65  | for Text Grabbe|
00000020  72 0d 00 14 05 3a 0d 00  1e 40 56 65 72 73 69 6f  |r....:...@Versio|
00000030  6e 4e 75 6d 62 65 72 24  3d 22 31 b7 30 31 20 28  |nNumber$="1.01 (|
00000040  32 34 20 41 75 67 20 31  39 39 33 29 22 3a 54 61  |24 Aug 1993)":Ta|
00000050  73 6b 6e 61 6d 65 24 3d  22 54 65 78 74 a0 47 72  |skname$="Text.Gr|
00000060  61 62 62 65 72 22 0d 00  28 1b 45 78 69 74 3d a3  |abber"..(.Exit=.|
00000070  3a 53 74 61 72 74 75 70  3d a3 3a 44 6f 6e 65 3d  |:Startup=.:Done=|
00000080  a3 0d 00 32 12 44 6f 4d  6f 64 65 43 68 61 6e 67  |...2.DoModeChang|
00000090  65 3d a3 0d 00 3c 46 47  72 61 62 62 69 6e 67 3d  |e=...<FGrabbing=|
000000a0  a3 3a 54 72 61 6e 73 66  65 72 72 69 6e 67 3d a3  |.:Transferring=.|
000000b0  3a 50 6f 6b 65 3d a3 3a  54 72 61 6e 73 6d 69 74  |:Poke=.:Transmit|
000000c0  3d a3 3a 54 79 70 69 6e  67 3d a3 3a 54 79 70 65  |=.:Typing=.:Type|
000000d0  43 6f 75 6e 74 65 72 3d  30 0d 00 46 2b de 20 47  |Counter=0..F+. G|
000000e0  72 61 62 49 63 6f 6e 56  61 6c 69 64 20 35 3a 24  |rabIconValid 5:$|
000000f0  47 72 61 62 49 63 6f 6e  56 61 6c 69 64 3d 22 5a  |GrabIconValid="Z|
00000100  33 3b 4c 22 0d 00 50 05  3a 0d 00 5a 32 de 20 42  |3;L"..P.:..Z2. B|
00000110  6c 6f 63 6b 20 32 35 36  2c 4d 65 6e 75 48 65 6c  |lock 256,MenuHel|
00000120  70 20 31 36 2c 54 65 6d  70 42 6c 6f 63 6b 20 32  |p 16,TempBlock 2|
00000130  35 36 2c 43 61 72 65 74  20 32 34 0d 00 64 2f 49  |56,Caret 24..d/I|
00000140  6e 64 4d 65 6e 75 4d 61  78 3d 36 34 3a de 20 49  |ndMenuMax=64:. I|
00000150  6e 64 69 72 65 63 74 4d  65 6e 75 54 65 78 74 20  |ndirectMenuText |
00000160  49 6e 64 4d 65 6e 75 4d  61 78 0d 00 6e 43 de 20  |IndMenuMax..nC. |
00000170  54 65 6d 70 6c 61 74 65  73 20 31 36 33 36 2c 49  |Templates 1636,I|
00000180  6e 66 6f 49 6e 64 20 31  39 30 2c 4c 6f 63 49 6e  |nfoInd 190,LocIn|
00000190  64 20 35 39 32 2c 47 72  61 62 49 6e 64 20 32 33  |d 592,GrabInd 23|
000001a0  38 2c 53 61 76 65 49 6e  64 20 33 35 32 0d 00 78  |8,SaveInd 352..x|
000001b0  1c de 20 49 42 4d 65 6e  75 20 37 36 2c 4d 61 69  |.. IBMenu 76,Mai|
000001c0  6e 4d 65 6e 75 20 31 37  32 0d 00 82 05 3a 0d 00  |nMenu 172....:..|
000001d0  8c 2a f4 20 4d 65 73 73  61 67 65 73 20 75 73 65  |.*. Messages use|
000001e0  64 20 62 79 20 74 68 65  20 4f 6d 6e 69 44 65 73  |d by the OmniDes|
000001f0  6b 20 73 75 69 74 65 3a  0d 00 96 5f 55 74 69 6c  |k suite:..._Util|
00000200  44 65 63 6c 61 72 65 3d  26 38 32 35 43 30 3a 55  |Declare=&825C0:U|
00000210  74 69 6c 4f 70 65 6e 3d  26 38 32 35 43 31 3a 55  |tilOpen=&825C1:U|
00000220  74 69 6c 51 75 69 74 74  69 6e 67 3d 26 38 32 35  |tilQuitting=&825|
00000230  43 32 3a 55 74 69 6c 52  65 73 69 64 65 3d 26 38  |C2:UtilReside=&8|
00000240  32 35 43 33 3a 55 74 69  6c 41 63 6b 4c 6f 61 64  |25C3:UtilAckLoad|
00000250  3d 26 38 32 35 43 34 0d  00 a0 2b f4 20 54 68 65  |=&825C4...+. The|
00000260  73 65 20 61 72 65 20 6f  66 66 69 63 69 61 6c 20  |se are official |
00000270  41 63 6f 72 6e 20 61 6c  6c 6f 63 61 74 69 6f 6e  |Acorn allocation|
00000280  73 2e 0d 00 aa 05 3a 0d  00 b4 6e ee 20 85 20 42  |s.....:...n. . B|
00000290  6c 6f 63 6b 21 30 3d 9f  3a 24 28 42 6c 6f 63 6b  |lock!0=.:$(Block|
000002a0  2b 34 29 3d f6 24 2b 22  20 28 69 6e 74 65 72 6e  |+4)=.$+" (intern|
000002b0  61 6c 20 65 72 72 6f 72  20 63 6f 64 65 20 22 2b  |al error code "+|
000002c0  c3 28 9e 29 2b 22 29 22  2b bd 30 3a c8 99 20 22  |.(.)+")"+.0:.. "|
000002d0  57 69 6d 70 5f 52 65 70  6f 72 74 45 72 72 6f 72  |Wimp_ReportError|
000002e0  22 2c 42 6c 6f 63 6b 2c  31 2c 54 61 73 6b 6e 61  |",Block,1,Taskna|
000002f0  6d 65 24 3a e0 0d 00 be  05 3a 0d 00 c8 3f 4f 6d  |me$:.....:...?Om|
00000300  6e 69 44 65 73 6b 3d a4  52 65 61 64 53 74 61 72  |niDesk=.ReadStar|
00000310  74 75 70 53 74 72 69 6e  67 3a f4 20 41 6c 73 6f  |tupString:. Also|
00000320  20 61 73 73 69 67 6e 73  20 45 78 69 74 20 61 6e  | assigns Exit an|
00000330  64 20 53 74 61 72 74 75  70 0d 00 d2 05 3a 0d 00  |d Startup....:..|
00000340  dc 1a 2a 53 65 74 20 54  65 78 74 47 72 61 62 24  |..*Set TextGrab$|
00000350  52 49 53 43 4f 53 20 33  0d 00 e6 36 2a 52 4d 45  |RISCOS 3...6*RME|
00000360  6e 73 75 72 65 20 55 74  69 6c 69 74 79 4d 6f 64  |nsure UtilityMod|
00000370  75 6c 65 20 33 2e 30 30  20 53 65 74 20 54 65 78  |ule 3.00 Set Tex|
00000380  74 47 72 61 62 24 52 49  53 43 4f 53 20 32 0d 00  |tGrab$RISCOS 2..|
00000390  f0 59 c8 99 20 22 58 4f  53 5f 52 65 61 64 56 61  |.Y.. "XOS_ReadVa|
000003a0  72 56 61 6c 22 2c 22 54  65 78 74 47 72 61 62 24  |rVal","TextGrab$|
000003b0  52 49 53 43 4f 53 22 2c  42 6c 6f 63 6b 2c 32 35  |RISCOS",Block,25|
000003c0  36 2c 30 2c 30 20 b8 20  2c 2c 6c 65 6e 3a 42 6c  |6,0,0 . ,,len:Bl|
000003d0  6f 63 6b 3f 6c 65 6e 3d  31 33 3a 77 69 6d 70 24  |ock?len=13:wimp$|
000003e0  3d 24 42 6c 6f 63 6b 0d  00 fa 1c e7 20 77 69 6d  |=$Block..... wim|
000003f0  70 24 3c 3e 22 33 22 20  8c 20 77 69 6d 70 24 3d  |p$<>"3" . wimp$=|
00000400  22 32 22 0d 01 04 1a 2a  55 6e 73 65 74 20 54 65  |"2"....*Unset Te|
00000410  78 74 47 72 61 62 24 52  49 53 43 4f 53 0d 01 0e  |xtGrab$RISCOS...|
00000420  05 3a 0d 01 18 20 2a 53  65 74 20 54 65 78 74 47  |.:... *Set TextG|
00000430  72 61 62 24 53 70 72 69  74 65 44 72 61 67 20 59  |rab$SpriteDrag Y|
00000440  65 73 0d 01 22 39 2a 52  4d 45 6e 73 75 72 65 20  |es.."9*RMEnsure |
00000450  44 72 61 67 41 53 70 72  69 74 65 20 30 2e 30 30  |DragASprite 0.00|
00000460  20 53 65 74 20 54 65 78  74 47 72 61 62 24 53 70  | Set TextGrab$Sp|
00000470  72 69 74 65 44 72 61 67  20 4e 6f 0d 01 2c 50 c8  |riteDrag No..,P.|
00000480  99 20 22 58 4f 53 5f 52  65 61 64 56 61 72 56 61  |. "XOS_ReadVarVa|
00000490  6c 22 2c 22 54 65 78 74  47 72 61 62 24 53 70 72  |l","TextGrab$Spr|
000004a0  69 74 65 44 72 61 67 22  2c 42 6c 6f 63 6b 2c 32  |iteDrag",Block,2|
000004b0  35 36 2c 30 2c 30 20 b8  20 2c 2c 6c 65 6e 3a 42  |56,0,0 . ,,len:B|
000004c0  6c 6f 63 6b 3f 6c 65 6e  3d 31 33 0d 01 36 32 e7  |lock?len=13..62.|
000004d0  20 24 42 6c 6f 63 6b 3d  22 59 65 73 22 20 8c 20  | $Block="Yes" . |
000004e0  44 72 61 67 41 53 70 72  69 74 65 3d b9 3a 8b 20  |DragASprite=.:. |
000004f0  44 72 61 67 41 53 70 72  69 74 65 3d a3 0d 01 40  |DragASprite=...@|
00000500  1e 2a 55 6e 73 65 74 20  54 65 78 74 47 72 61 62  |.*Unset TextGrab|
00000510  24 53 70 72 69 74 65 44  72 61 67 0d 01 4a 05 3a  |$SpriteDrag..J.:|
00000520  0d 01 54 59 c8 99 20 22  58 4f 53 5f 52 65 61 64  |..TY.. "XOS_Read|
00000530  56 61 72 56 61 6c 22 2c  22 4f 62 65 79 24 44 69  |VarVal","Obey$Di|
00000540  72 22 2c 42 6c 6f 63 6b  2c 32 35 36 2c 30 2c 30  |r",Block,256,0,0|
00000550  20 b8 20 2c 2c 6c 65 6e  3a 42 6c 6f 63 6b 3f 6c  | . ,,len:Block?l|
00000560  65 6e 3d 31 33 3a 4f 75  72 46 69 6c 65 4e 61 6d  |en=13:OurFileNam|
00000570  65 24 3d 24 42 6c 6f 63  6b 0d 01 5e 38 4e 3d 2d  |e$=$Block..^8N=-|
00000580  31 3a f5 3a 4e 2b 3d 31  3a fd 20 c1 4f 75 72 46  |1:.:N+=1:. .OurF|
00000590  69 6c 65 4e 61 6d 65 24  2c a9 28 4f 75 72 46 69  |ileName$,.(OurFi|
000005a0  6c 65 4e 61 6d 65 24 29  2d 4e 2c 31 29 3d 22 2e  |leName$)-N,1)=".|
000005b0  22 0d 01 68 4f 4f 75 72  50 61 74 68 4e 61 6d 65  |"..hOOurPathName|
000005c0  24 3d c0 4f 75 72 46 69  6c 65 4e 61 6d 65 24 2c  |$=.OurFileName$,|
000005d0  a9 28 4f 75 72 46 69 6c  65 4e 61 6d 65 24 29 2d  |.(OurFileName$)-|
000005e0  4e 29 3a 4f 75 72 46 69  6c 65 4e 61 6d 65 24 3d  |N):OurFileName$=|
000005f0  c2 4f 75 72 46 69 6c 65  4e 61 6d 65 24 2c 4e 29  |.OurFileName$,N)|
00000600  0d 01 72 05 3a 0d 01 7c  5e f4 20 52 65 61 64 20  |..r.:..|^. Read |
00000610  73 69 7a 65 20 6f 66 20  73 70 72 69 74 65 20 66  |size of sprite f|
00000620  69 6c 65 20 61 6e 64 20  6c 6f 61 64 20 69 74 2e  |ile and load it.|
00000630  20 57 65 20 6e 65 65 64  20 74 6f 20 44 49 4d 20  | We need to DIM |
00000640  31 36 20 62 79 74 65 73  20 6d 6f 72 65 20 74 68  |16 bytes more th|
00000650  61 6e 20 74 68 65 20 66  69 6c 65 27 73 20 73 69  |an the file's si|
00000660  7a 65 2e 0d 01 86 39 c8  99 20 22 4f 53 5f 46 53  |ze....9.. "OS_FS|
00000670  43 6f 6e 74 72 6f 6c 22  2c 32 38 2c 22 3c 54 65  |Control",28,"<Te|
00000680  78 74 47 72 61 62 24 44  69 72 3e 2e 53 70 72 69  |xtGrab$Dir>.Spri|
00000690  74 65 73 22 20 b8 20 2c  2c 6c 65 6e 0d 01 90 84  |tes" . ,,len....|
000006a0  de 20 53 70 72 69 74 65  73 20 6c 65 6e 2b 31 36  |. Sprites len+16|
000006b0  3a 21 53 70 72 69 74 65  73 3d 6c 65 6e 2b 31 36  |:!Sprites=len+16|
000006c0  3a 53 70 72 69 74 65 73  21 34 3d 30 3a 53 70 72  |:Sprites!4=0:Spr|
000006d0  69 74 65 73 21 38 3d 31  36 3a 53 70 72 69 74 65  |ites!8=16:Sprite|
000006e0  73 21 31 32 3d 31 36 3a  c8 99 20 22 4f 53 5f 53  |s!12=16:.. "OS_S|
000006f0  70 72 69 74 65 4f 70 22  2c 32 35 36 2b 31 30 2c  |priteOp",256+10,|
00000700  53 70 72 69 74 65 73 2c  22 3c 54 65 78 74 47 72  |Sprites,"<TextGr|
00000710  61 62 24 44 69 72 3e 2e  53 70 72 69 74 65 73 22  |ab$Dir>.Sprites"|
00000720  0d 01 9a 05 3a 0d 01 a4  11 e7 20 77 69 6d 70 24  |....:..... wimp$|
00000730  3d 22 33 22 20 8c 0d 01  ae 17 20 20 de 20 6d 65  |="3" .....  . me|
00000740  73 73 61 67 65 6c 69 73  74 25 20 35 36 0d 01 b8  |ssagelist% 56...|
00000750  2f 20 20 6d 65 73 73 61  67 65 6c 69 73 74 25 21  |/  messagelist%!|
00000760  30 3d 26 35 30 32 3a 6d  65 73 73 61 67 65 6c 69  |0=&502:messageli|
00000770  73 74 25 21 34 3d 26 34  30 30 43 31 0d 01 c2 3a  |st%!4=&400C1...:|
00000780  20 20 6d 65 73 73 61 67  65 6c 69 73 74 25 21 38  |  messagelist%!8|
00000790  3d 55 74 69 6c 4f 70 65  6e 3a 6d 65 73 73 61 67  |=UtilOpen:messag|
000007a0  65 6c 69 73 74 25 21 31  32 3d 55 74 69 6c 51 75  |elist%!12=UtilQu|
000007b0  69 74 74 69 6e 67 0d 01  cc 33 20 20 6d 65 73 73  |itting...3  mess|
000007c0  61 67 65 6c 69 73 74 25  21 31 36 3d 55 74 69 6c  |agelist%!16=Util|
000007d0  52 65 73 69 64 65 3a 6d  65 73 73 61 67 65 6c 69  |Reside:messageli|
000007e0  73 74 25 21 32 30 3d 31  30 0d 01 d6 29 20 20 6d  |st%!20=10...)  m|
000007f0  65 73 73 61 67 65 6c 69  73 74 25 21 32 34 3d 26  |essagelist%!24=&|
00000800  34 30 30 43 37 3a f4 20  54 61 73 6b 4e 61 6d 65  |400C7:. TaskName|
00000810  49 73 0d 01 e0 29 20 20  6d 65 73 73 61 67 65 6c  |Is...)  messagel|
00000820  69 73 74 25 21 32 38 3d  37 3a 6d 65 73 73 61 67  |ist%!28=7:messag|
00000830  65 6c 69 73 74 25 21 33  32 3d 36 0d 01 ea 29 20  |elist%!32=6...) |
00000840  20 6d 65 73 73 61 67 65  6c 69 73 74 25 21 33 36  | messagelist%!36|
00000850  3d 34 3a 6d 65 73 73 61  67 65 6c 69 73 74 25 21  |=4:messagelist%!|
00000860  34 30 3d 33 0d 01 f4 3b  20 20 6d 65 73 73 61 67  |40=3...;  messag|
00000870  65 6c 69 73 74 25 21 34  34 3d 32 3a 6d 65 73 73  |elist%!44=2:mess|
00000880  61 67 65 6c 69 73 74 25  21 34 38 3d 31 3a 6d 65  |agelist%!48=1:me|
00000890  73 73 61 67 65 6c 69 73  74 25 21 35 32 3d 30 0d  |ssagelist%!52=0.|
000008a0  01 fe 4b 20 20 c8 99 20  22 57 69 6d 70 5f 49 6e  |..K  .. "Wimp_In|
000008b0  69 74 69 61 6c 69 73 65  22 2c 33 30 30 2c 26 34  |itialise",300,&4|
000008c0  42 35 33 34 31 35 34 2c  54 61 73 6b 6e 61 6d 65  |B534154,Taskname|
000008d0  24 2c 6d 65 73 73 61 67  65 6c 69 73 74 25 20 b8  |$,messagelist% .|
000008e0  20 77 69 6d 70 2c 54 61  73 6b 0d 02 08 05 cc 0d  | wimp,Task......|
000008f0  02 12 3e 20 20 c8 99 20  22 57 69 6d 70 5f 49 6e  |..>  .. "Wimp_In|
00000900  69 74 69 61 6c 69 73 65  22 2c 32 30 30 2c 26 34  |itialise",200,&4|
00000910  42 35 33 34 31 35 34 2c  54 61 73 6b 6e 61 6d 65  |B534154,Taskname|
00000920  24 20 b8 20 77 69 6d 70  2c 54 61 73 6b 0d 02 1c  |$ . wimp,Task...|
00000930  05 cd 0d 02 26 05 3a 0d  02 30 22 c8 99 20 22 49  |....&.:..0".. "I|
00000940  6e 74 65 72 66 61 63 65  5f 49 6e 69 74 69 61 6c  |nterface_Initial|
00000950  69 73 65 22 2c 54 61 73  6b 0d 02 3a 05 3a 0d 02  |ise",Task..:.:..|
00000960  44 36 c8 99 20 22 57 69  6d 70 5f 4f 70 65 6e 54  |D6.. "Wimp_OpenT|
00000970  65 6d 70 6c 61 74 65 22  2c 2c 22 3c 54 65 78 74  |emplate",,"<Text|
00000980  47 72 61 62 24 44 69 72  3e 2e 54 65 6d 70 6c 61  |Grab$Dir>.Templa|
00000990  74 65 73 22 0d 02 4e 45  c8 99 20 22 57 69 6d 70  |tes"..NE.. "Wimp|
000009a0  5f 4c 6f 61 64 54 65 6d  70 6c 61 74 65 22 2c 2c  |_LoadTemplate",,|
000009b0  54 65 6d 70 6c 61 74 65  73 2c 49 6e 66 6f 49 6e  |Templates,InfoIn|
000009c0  64 2c 49 6e 66 6f 49 6e  64 2b 31 39 30 2c 2d 31  |d,InfoInd+190,-1|
000009d0  2c 22 49 6e 66 6f 22 2c  30 0d 02 58 2c c8 99 20  |,"Info",0..X,.. |
000009e0  22 57 69 6d 70 5f 43 72  65 61 74 65 57 69 6e 64  |"Wimp_CreateWind|
000009f0  6f 77 22 2c 2c 54 65 6d  70 6c 61 74 65 73 20 b8  |ow",,Templates .|
00000a00  20 49 6e 66 6f 0d 02 62  5c c8 99 20 22 57 69 6d  | Info..b\.. "Wim|
00000a10  70 5f 4c 6f 61 64 54 65  6d 70 6c 61 74 65 22 2c  |p_LoadTemplate",|
00000a20  2c 54 65 6d 70 6c 61 74  65 73 2c 4c 6f 63 49 6e  |,Templates,LocIn|
00000a30  64 2c 4c 6f 63 49 6e 64  2b 35 39 32 2c 2d 31 2c  |d,LocInd+592,-1,|
00000a40  22 57 69 6e 64 6f 77 58  59 22 2c 30 3a 54 65 6d  |"WindowXY",0:Tem|
00000a50  70 6c 61 74 65 73 21 36  34 3d 53 70 72 69 74 65  |plates!64=Sprite|
00000a60  73 0d 02 6c 2b c8 99 20  22 57 69 6d 70 5f 43 72  |s..l+.. "Wimp_Cr|
00000a70  65 61 74 65 57 69 6e 64  6f 77 22 2c 2c 54 65 6d  |eateWindow",,Tem|
00000a80  70 6c 61 74 65 73 20 b8  20 4c 6f 63 0d 02 76 45  |plates . Loc..vE|
00000a90  c8 99 20 22 57 69 6d 70  5f 4c 6f 61 64 54 65 6d  |.. "Wimp_LoadTem|
00000aa0  70 6c 61 74 65 22 2c 2c  54 65 6d 70 6c 61 74 65  |plate",,Template|
00000ab0  73 2c 53 61 76 65 49 6e  64 2c 53 61 76 65 49 6e  |s,SaveInd,SaveIn|
00000ac0  64 2b 33 35 32 2c 2d 31  2c 22 53 61 76 65 22 2c  |d+352,-1,"Save",|
00000ad0  30 0d 02 80 2c c8 99 20  22 57 69 6d 70 5f 43 72  |0...,.. "Wimp_Cr|
00000ae0  65 61 74 65 57 69 6e 64  6f 77 22 2c 2c 54 65 6d  |eateWindow",,Tem|
00000af0  70 6c 61 74 65 73 20 b8  20 53 61 76 65 0d 02 8a  |plates . Save...|
00000b00  3c f4 20 49 74 20 69 73  20 69 6d 70 6f 72 74 61  |<. It is importa|
00000b10  6e 74 20 74 68 61 74 20  74 68 65 20 53 74 61 74  |nt that the Stat|
00000b20  73 20 77 69 6e 64 6f 77  20 69 73 20 64 65 66 69  |s window is defi|
00000b30  6e 65 64 20 6c 61 73 74  3a 0d 02 94 45 c8 99 20  |ned last:...E.. |
00000b40  22 57 69 6d 70 5f 4c 6f  61 64 54 65 6d 70 6c 61  |"Wimp_LoadTempla|
00000b50  74 65 22 2c 2c 54 65 6d  70 6c 61 74 65 73 2c 47  |te",,Templates,G|
00000b60  72 61 62 49 6e 64 2c 47  72 61 62 49 6e 64 2b 32  |rabInd,GrabInd+2|
00000b70  33 38 2c 2d 31 2c 22 47  72 61 62 22 2c 30 0d 02  |38,-1,"Grab",0..|
00000b80  9e 2c c8 99 20 22 57 69  6d 70 5f 43 72 65 61 74  |.,.. "Wimp_Creat|
00000b90  65 57 69 6e 64 6f 77 22  2c 2c 54 65 6d 70 6c 61  |eWindow",,Templa|
00000ba0  74 65 73 20 b8 20 47 72  61 62 0d 02 a8 1b c8 99  |tes . Grab......|
00000bb0  20 22 57 69 6d 70 5f 43  6c 6f 73 65 54 65 6d 70  | "Wimp_CloseTemp|
00000bc0  6c 61 74 65 22 0d 02 b2  05 3a 0d 02 bc 0f f2 42  |late"....:.....B|
00000bd0  75 69 6c 64 4d 65 6e 75  73 0d 02 c6 05 3a 0d 02  |uildMenus....:..|
00000be0  d0 12 e7 20 4f 6d 6e 69  44 65 73 6b 3d 30 20 8c  |... OmniDesk=0 .|
00000bf0  0d 02 da 20 20 20 f4 20  50 75 74 20 49 63 6f 6e  |...   . Put Icon|
00000c00  20 6f 6e 20 74 68 65 20  69 63 6f 6e 2d 62 61 72  | on the icon-bar|
00000c10  0d 02 e4 10 20 20 42 6c  6f 63 6b 21 30 3d 2d 31  |....  Block!0=-1|
00000c20  0d 02 ee 31 20 20 42 6c  6f 63 6b 21 34 3d 30 3a  |...1  Block!4=0:|
00000c30  42 6c 6f 63 6b 21 38 3d  30 3a 42 6c 6f 63 6b 21  |Block!8=0:Block!|
00000c40  31 32 3d 36 38 3a 42 6c  6f 63 6b 21 31 36 3d 36  |12=68:Block!16=6|
00000c50  38 0d 02 f8 34 20 20 42  6c 6f 63 6b 21 32 30 3d  |8...4  Block!20=|
00000c60  26 31 37 30 30 33 30 30  32 3a 24 28 42 6c 6f 63  |&17003002:$(Bloc|
00000c70  6b 2b 32 34 29 3d 22 21  54 65 78 74 47 72 61 62  |k+24)="!TextGrab|
00000c80  22 2b bd 31 33 0d 03 02  2b 20 20 c8 99 20 22 57  |"+.13...+  .. "W|
00000c90  69 6d 70 5f 43 72 65 61  74 65 49 63 6f 6e 22 2c  |imp_CreateIcon",|
00000ca0  2c 42 6c 6f 63 6b 20 b8  20 49 63 6f 6e 42 61 72  |,Block . IconBar|
00000cb0  0d 03 0c 05 cd 0d 03 16  05 3a 0d 03 20 0f f2 49  |.........:.. ..I|
00000cc0  6e 69 74 69 61 6c 69 73  65 0d 03 2a 26 e7 20 4f  |nitialise..*&. O|
00000cd0  6d 6e 69 44 65 73 6b 3c  3e 30 20 8c 20 f2 44 65  |mniDesk<>0 . .De|
00000ce0  63 6c 61 72 65 54 6f 4f  6d 6e 69 44 65 73 6b 0d  |clareToOmniDesk.|
00000cf0  03 34 52 e7 20 53 74 61  72 74 75 70 20 8c 20 44  |.4R. Startup . D|
00000d00  6f 6e 65 3d b9 3a f4 20  27 2d 53 74 61 72 74 75  |one=.:. '-Startu|
00000d10  70 27 20 70 61 72 61 6d  65 74 65 72 20 6d 65 61  |p' parameter mea|
00000d20  6e 73 20 27 64 65 63 6c  61 72 65 20 61 6e 64 20  |ns 'declare and |
00000d30  64 69 65 20 69 6d 6d 65  64 69 61 74 65 6c 79 27  |die immediately'|
00000d40  2e 0d 03 3e 05 3a 0d 03  48 26 f2 55 70 64 61 74  |...>.:..H&.Updat|
00000d50  65 49 63 6f 6e 28 49 6e  66 6f 2c 33 2c 56 65 72  |eIcon(Info,3,Ver|
00000d60  73 69 6f 6e 4e 75 6d 62  65 72 24 29 0d 03 52 36  |sionNumber$)..R6|
00000d70  f2 4d 6f 64 65 43 68 61  6e 67 65 3a f4 20 54 6f  |.ModeChange:. To|
00000d80  20 75 70 64 61 74 65 20  69 63 6f 6e 2d 62 61 72  | update icon-bar|
00000d90  20 69 63 6f 6e 20 69 66  20 6e 65 63 65 73 73 61  | icon if necessa|
00000da0  72 79 0d 03 5c 15 f2 43  6c 65 61 6e 55 70 4c 6f  |ry..\..CleanUpLo|
00000db0  63 57 69 6e 64 6f 77 0d  03 66 05 3a 0d 03 70 11  |cWindow..f.:..p.|
00000dc0  f2 52 65 73 65 74 47 72  61 62 62 65 72 0d 03 7a  |.ResetGrabber..z|
00000dd0  05 3a 0d 03 84 35 4d 79  52 65 66 3d 2d 31 3a f4  |.:...5MyRef=-1:.|
00000de0  20 4a 75 73 74 20 61 6e  20 61 72 62 69 74 72 61  | Just an arbitra|
00000df0  72 79 20 76 61 6c 75 65  20 74 6f 20 73 74 61 72  |ry value to star|
00000e00  74 20 77 69 74 68 2e 0d  03 8e 05 3a 0d 03 98 13  |t with.....:....|
00000e10  4c 6f 61 64 46 69 6c 65  45 72 72 6f 72 3d a3 0d  |LoadFileError=..|
00000e20  03 a2 1e 52 65 61 64 45  72 72 6f 72 3d ac 28 a4  |...ReadError=.(.|
00000e30  4c 6f 61 64 53 65 74 74  69 6e 67 73 29 0d 03 ac  |LoadSettings)...|
00000e40  05 3a 0d 03 b6 70 48 6f  74 4b 65 79 73 3d a4 43  |.:...pHotKeys=.C|
00000e50  72 65 61 74 65 57 69 6e  64 6f 77 28 30 2c 30 2c  |reateWindow(0,0,|
00000e60  30 2c 30 2c 30 2c 30 2c  2d 32 2c 25 31 30 30 30  |0,0,0,0,-2,%1000|
00000e70  30 30 30 30 30 30 30 30  30 30 30 30 30 30 30 31  |0000000000000001|
00000e80  30 30 30 30 30 31 30 31  30 30 30 30 2c 26 46 46  |000001010000,&FF|
00000e90  2c 30 2c 30 2c 30 2c 30  2c 30 2c 30 2c 30 2c 30  |,0,0,0,0,0,0,0,0|
00000ea0  2c 30 2c 30 2c 30 2c 30  2c 30 2c 30 2c 30 2c 22  |,0,0,0,0,0,0,0,"|
00000eb0  22 29 0d 03 c0 18 f2 4f  70 65 6e 28 48 6f 74 4b  |").....Open(HotK|
00000ec0  65 79 73 2c a3 2c 30 2c  30 29 0d 03 ca 05 3a 0d  |eys,.,0,0)....:.|
00000ed0  03 d4 0e ee 20 85 20 f2  45 72 72 6f 72 0d 03 de  |.... . .Error...|
00000ee0  94 e7 20 52 65 61 64 45  72 72 6f 72 20 8c 20 52  |.. ReadError . R|
00000ef0  65 61 64 45 72 72 6f 72  3d a3 3a f2 44 65 66 61  |eadError=.:.Defa|
00000f00  75 6c 74 53 65 74 74 69  6e 67 73 3a 85 20 39 39  |ultSettings:. 99|
00000f10  39 39 2c 22 41 6e 20 65  72 72 6f 72 20 6f 63 63  |99,"An error occ|
00000f20  75 72 72 65 64 20 77 68  69 6c 73 74 20 72 65 61  |urred whilst rea|
00000f30  64 69 6e 67 20 74 68 65  20 73 65 74 74 69 6e 67  |ding the setting|
00000f40  73 20 66 69 6c 65 2e 20  44 65 66 61 75 6c 74 20  |s file. Default |
00000f50  73 65 74 74 69 6e 67 73  20 77 69 6c 6c 20 74 68  |settings will th|
00000f60  65 72 65 66 6f 72 65 20  62 65 20 75 73 65 64 2e  |erefore be used.|
00000f70  22 0d 03 e8 05 3a 0d 03  f2 29 c8 99 20 22 4f 53  |"....:...).. "OS|
00000f80  5f 52 65 61 64 4d 6f 6e  6f 74 6f 6e 69 63 54 69  |_ReadMonotonicTi|
00000f90  6d 65 22 20 b8 20 70 6f  6c 6c 74 69 6d 65 25 0d  |me" . polltime%.|
00000fa0  03 fc 05 3a 0d 04 06 17  f4 20 4d 61 69 6e 20 70  |...:..... Main p|
00000fb0  72 6f 67 72 61 6d 20 6c  6f 6f 70 0d 04 10 05 f5  |rogram loop.....|
00000fc0  0d 04 1a 40 20 20 c8 99  20 22 57 69 6d 70 5f 50  |...@  .. "Wimp_P|
00000fd0  6f 6c 6c 49 64 6c 65 22  2c 25 31 31 30 30 30 30  |ollIdle",%110000|
00000fe0  30 31 31 30 30 30 30 2c  42 6c 6f 63 6b 2c 70 6f  |0110000,Block,po|
00000ff0  6c 6c 74 69 6d 65 25 20  b8 20 52 65 61 73 6f 6e  |lltime% . Reason|
00001000  0d 04 24 26 20 20 c8 99  20 22 49 6e 74 65 72 66  |..$&  .. "Interf|
00001010  61 63 65 5f 50 6f 6c 6c  22 2c 52 65 61 73 6f 6e  |ace_Poll",Reason|
00001020  2c 2c 54 61 73 6b 0d 04  2e 34 20 20 c8 99 20 22  |,,Task...4  .. "|
00001030  49 6e 74 65 72 66 61 63  65 5f 50 72 65 50 72 6f  |Interface_PrePro|
00001040  63 65 73 73 4b 65 79 22  2c 52 65 61 73 6f 6e 2c  |cessKey",Reason,|
00001050  42 6c 6f 63 6b 2c 54 61  73 6b 0d 04 38 11 20 20  |Block,Task..8.  |
00001060  c8 8e 20 52 65 61 73 6f  6e 20 ca 0d 04 42 33 20  |.. Reason ...B3 |
00001070  20 20 20 c9 20 30 20 3a  20 c8 99 20 22 4f 53 5f  |   . 0 : .. "OS_|
00001080  52 65 61 64 4d 6f 6e 6f  74 6f 6e 69 63 54 69 6d  |ReadMonotonicTim|
00001090  65 22 20 b8 20 70 6f 6c  6c 74 69 6d 65 25 0d 04  |e" . polltime%..|
000010a0  4c 48 20 20 20 20 20 20  20 20 20 20 20 20 20 e7  |LH             .|
000010b0  20 28 47 72 61 62 62 69  6e 67 3e 30 29 20 84 20  | (Grabbing>0) . |
000010c0  28 54 72 61 6e 73 66 65  72 72 69 6e 67 3e 30 29  |(Transferring>0)|
000010d0  20 84 20 54 79 70 69 6e  67 20 84 20 54 72 61 6e  | . Typing . Tran|
000010e0  73 6d 69 74 20 8c 0d 04  56 1f 20 20 20 20 20 20  |smit ...V.      |
000010f0  20 20 20 20 20 20 20 20  20 70 6f 6c 6c 74 69 6d  |         polltim|
00001100  65 25 2b 3d 31 0d 04 60  12 20 20 20 20 20 20 20  |e%+=1..`.       |
00001110  20 20 20 20 20 20 cc 0d  04 6a 4e 20 20 20 20 20  |      ...jN     |
00001120  20 20 20 20 20 20 20 20  20 20 70 6f 6c 6c 74 69  |          pollti|
00001130  6d 65 25 2b 3d 31 30 30  3a f4 20 44 6f 20 61 20  |me%+=100:. Do a |
00001140  57 69 6d 70 5f 50 6f 6c  6c 20 61 70 70 72 6f 78  |Wimp_Poll approx|
00001150  69 6d 61 74 65 6c 79 20  6f 6e 63 65 20 61 20 73  |imately once a s|
00001160  65 63 6f 6e 64 0d 04 74  12 20 20 20 20 20 20 20  |econd..t.       |
00001170  20 20 20 20 20 20 cd 0d  04 7e 58 20 20 20 20 20  |      ...~X     |
00001180  20 20 20 20 20 20 20 20  e7 20 44 6f 4d 6f 64 65  |        . DoMode|
00001190  43 68 61 6e 67 65 20 8c  20 e7 20 a4 4f 70 65 6e  |Change . . .Open|
000011a0  53 74 61 74 65 28 47 72  61 62 29 20 8c 20 f2 4f  |State(Grab) . .O|
000011b0  70 65 6e 28 47 72 61 62  2c a3 2c 58 50 6f 73 69  |pen(Grab,.,XPosi|
000011c0  74 69 6f 6e 2c 59 50 6f  73 69 74 69 6f 6e 29 0d  |tion,YPosition).|
000011d0  04 88 44 20 20 20 20 20  20 20 20 20 20 20 20 20  |..D             |
000011e0  e7 20 47 72 61 62 62 69  6e 67 3e 30 20 8c 20 47  |. Grabbing>0 . G|
000011f0  72 61 62 62 69 6e 67 2d  3d 31 3a e7 20 47 72 61  |rabbing-=1:. Gra|
00001200  62 62 69 6e 67 3d 30 20  8c 20 f2 47 72 61 62 54  |bbing=0 . .GrabT|
00001210  65 78 74 0d 04 92 54 20  20 20 20 20 20 20 20 20  |ext...T         |
00001220  20 20 20 20 e7 20 54 72  61 6e 73 66 65 72 72 69  |    . Transferri|
00001230  6e 67 3e 30 20 8c 20 54  72 61 6e 73 66 65 72 72  |ng>0 . Transferr|
00001240  69 6e 67 2d 3d 31 3a e7  20 54 72 61 6e 73 66 65  |ing-=1:. Transfe|
00001250  72 72 69 6e 67 3d 30 20  8c 20 f2 54 72 61 6e 73  |rring=0 . .Trans|
00001260  66 65 72 54 65 78 74 0d  04 9c 2b 20 20 20 20 20  |ferText...+     |
00001270  20 20 20 20 20 20 20 20  e7 20 54 79 70 69 6e 67  |        . Typing|
00001280  20 8c 20 f2 54 79 70 65  41 43 68 61 72 61 63 74  | . .TypeACharact|
00001290  65 72 0d 04 a6 15 20 20  20 20 c9 20 31 20 3a 20  |er....    . 1 : |
000012a0  f2 52 65 64 72 61 77 0d  04 b0 29 20 20 20 20 c9  |.Redraw...)    .|
000012b0  20 32 20 3a 20 c8 99 20  22 57 69 6d 70 5f 4f 70  | 2 : .. "Wimp_Op|
000012c0  65 6e 57 69 6e 64 6f 77  22 2c 2c 42 6c 6f 63 6b  |enWindow",,Block|
000012d0  0d 04 ba 2a 20 20 20 20  c9 20 33 20 3a 20 c8 99  |...*    . 3 : ..|
000012e0  20 22 57 69 6d 70 5f 43  6c 6f 73 65 57 69 6e 64  | "Wimp_CloseWind|
000012f0  6f 77 22 2c 2c 42 6c 6f  63 6b 0d 04 c4 20 20 20  |ow",,Block...   |
00001300  20 20 20 20 20 20 20 20  20 20 20 e7 20 45 78 69  |           . Exi|
00001310  74 20 8c 20 44 6f 6e 65  3d b9 0d 04 ce 1a 20 20  |t . Done=.....  |
00001320  20 20 c9 20 36 20 3a 20  f2 4d 6f 75 73 65 42 75  |  . 6 : .MouseBu|
00001330  74 74 6f 6e 0d 04 d8 1b  20 20 20 20 c9 20 37 20  |tton....    . 7 |
00001340  3a 20 f2 44 72 61 67 46  69 6e 69 73 68 65 64 0d  |: .DragFinished.|
00001350  04 e2 19 20 20 20 20 c9  20 38 20 3a 20 f2 4b 65  |...    . 8 : .Ke|
00001360  79 50 72 65 73 73 65 64  0d 04 ec 19 20 20 20 20  |yPressed....    |
00001370  c9 20 39 20 3a 20 f2 44  65 63 6f 64 65 4d 65 6e  |. 9 : .DecodeMen|
00001380  75 0d 04 f6 24 20 20 20  20 c9 20 31 37 2c 31 38  |u...$    . 17,18|
00001390  2c 31 39 20 3a 20 f2 52  65 63 69 65 76 65 4d 65  |,19 : .RecieveMe|
000013a0  73 73 61 67 65 0d 05 00  07 20 20 cb 0d 05 0a 0a  |ssage....  .....|
000013b0  fd 20 44 6f 6e 65 0d 05  14 0f f2 53 61 79 47 6f  |. Done.....SayGo|
000013c0  6f 64 62 79 65 0d 05 1e  21 c8 99 20 22 49 6e 74  |odbye...!.. "Int|
000013d0  65 72 66 61 63 65 5f 43  6c 6f 73 65 44 6f 77 6e  |erface_CloseDown|
000013e0  22 2c 54 61 73 6b 0d 05  28 26 c8 99 20 22 57 69  |",Task..(&.. "Wi|
000013f0  6d 70 5f 43 6c 6f 73 65  44 6f 77 6e 22 2c 54 61  |mp_CloseDown",Ta|
00001400  73 6b 2c 26 34 42 35 33  34 31 35 34 0d 05 32 05  |sk,&4B534154..2.|
00001410  e0 0d 05 3c 05 3a 0d 05  46 0c dd 20 f2 45 72 72  |...<.:..F.. .Err|
00001420  6f 72 0d 05 50 1c 43 6c  69 63 6b 3d 30 3a 42 6c  |or..P.Click=0:Bl|
00001430  6f 63 6b 21 30 3d 9f 3a  c8 8e 20 9f 20 ca 0d 05  |ock!0=.:.. . ...|
00001440  5a 1b 20 20 c9 20 39 39  39 39 3a f4 20 43 75 73  |Z.  . 9999:. Cus|
00001450  74 6f 6d 20 65 72 72 6f  72 0d 05 64 18 20 20 20  |tom error..d.   |
00001460  20 24 28 42 6c 6f 63 6b  2b 34 29 3d f6 24 2b bd  | $(Block+4)=.$+.|
00001470  30 0d 05 6e 41 20 20 20  20 c8 99 20 22 57 69 6d  |0..nA    .. "Wim|
00001480  70 5f 52 65 70 6f 72 74  45 72 72 6f 72 22 2c 42  |p_ReportError",B|
00001490  6c 6f 63 6b 2c 31 37 2c  22 4e 6f 74 69 63 65 20  |lock,17,"Notice |
000014a0  66 72 6f 6d 20 54 65 78  74 20 47 72 61 62 62 65  |from Text Grabbe|
000014b0  72 22 0d 05 78 07 20 20  7f 0d 05 82 76 20 20 20  |r"..x.  ....v   |
000014c0  20 24 28 42 6c 6f 63 6b  2b 34 29 3d f6 24 2b 22  | $(Block+4)=.$+"|
000014d0  20 28 69 6e 74 65 72 6e  61 6c 20 65 72 72 6f 72  | (internal error|
000014e0  20 63 6f 64 65 20 22 2b  c3 9e 2b 22 29 2e 20 43  | code "+..+"). C|
000014f0  6c 69 63 6b 20 6f 6e 20  4f 4b 20 74 6f 20 63 6f  |lick on OK to co|
00001500  6e 74 69 6e 75 65 2c 20  6f 72 20 43 61 6e 63 65  |ntinue, or Cance|
00001510  6c 20 74 6f 20 74 65 72  6d 69 6e 61 74 65 20 74  |l to terminate t|
00001520  68 65 20 70 72 6f 67 72  61 6d 2e 22 2b bd 30 0d  |he program."+.0.|
00001530  05 8c 38 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |..8    .. "Wimp_|
00001540  52 65 70 6f 72 74 45 72  72 6f 72 22 2c 42 6c 6f  |ReportError",Blo|
00001550  63 6b 2c 33 2c 54 61 73  6b 6e 61 6d 65 24 20 b8  |ck,3,Taskname$ .|
00001560  20 2c 43 6c 69 63 6b 0d  05 96 05 cb 0d 05 a0 5e  | ,Click........^|
00001570  e7 20 43 6c 69 63 6b 3d  32 20 8c 20 f2 53 61 79  |. Click=2 . .Say|
00001580  47 6f 6f 64 62 79 65 3a  c8 99 20 22 49 6e 74 65  |Goodbye:.. "Inte|
00001590  72 66 61 63 65 5f 43 6c  6f 73 65 44 6f 77 6e 22  |rface_CloseDown"|
000015a0  2c 54 61 73 6b 3a c8 99  20 22 57 69 6d 70 5f 43  |,Task:.. "Wimp_C|
000015b0  6c 6f 73 65 44 6f 77 6e  22 2c 54 61 73 6b 2c 26  |loseDown",Task,&|
000015c0  34 42 35 33 34 31 35 34  3a e0 0d 05 aa 05 e1 0d  |4B534154:.......|
000015d0  05 b4 05 3a 0d 05 be 2e  dd 20 f2 4f 70 65 6e 28  |...:..... .Open(|
000015e0  57 69 6e 64 6f 77 48 61  6e 64 6c 65 2c 54 6f 70  |WindowHandle,Top|
000015f0  4f 66 53 74 61 63 6b 2c  61 63 72 6f 73 73 2c 75  |OfStack,across,u|
00001600  70 29 0d 05 c8 18 42 6c  6f 63 6b 21 30 3d 57 69  |p)....Block!0=Wi|
00001610  6e 64 6f 77 48 61 6e 64  6c 65 0d 05 d2 23 c8 99  |ndowHandle...#..|
00001620  20 22 57 69 6d 70 5f 47  65 74 57 69 6e 64 6f 77  | "Wimp_GetWindow|
00001630  53 74 61 74 65 22 2c 2c  42 6c 6f 63 6b 0d 05 dc  |State",,Block...|
00001640  4a e7 20 28 61 63 72 6f  73 73 3c 3e 2d 31 29 20  |J. (across<>-1) |
00001650  80 20 28 61 63 72 6f 73  73 3c 3e 2d 31 29 20 8c  |. (across<>-1) .|
00001660  20 f2 44 65 63 69 64 65  57 69 6e 64 6f 77 50 6f  | .DecideWindowPo|
00001670  73 69 74 69 6f 6e 28 42  6c 6f 63 6b 2c 61 63 72  |sition(Block,acr|
00001680  6f 73 73 2c 75 70 29 0d  05 e6 1e e7 20 54 6f 70  |oss,up)..... Top|
00001690  4f 66 53 74 61 63 6b 20  8c 20 42 6c 6f 63 6b 21  |OfStack . Block!|
000016a0  32 38 3d 2d 31 0d 05 f0  1f c8 99 20 22 57 69 6d  |28=-1...... "Wim|
000016b0  70 5f 4f 70 65 6e 57 69  6e 64 6f 77 22 2c 2c 42  |p_OpenWindow",,B|
000016c0  6c 6f 63 6b 0d 05 fa 05  e1 0d 06 04 05 3a 0d 06  |lock.........:..|
000016d0  0e 1a dd 20 f2 43 6c 6f  73 65 28 57 69 6e 64 6f  |... .Close(Windo|
000016e0  77 48 61 6e 64 6c 65 29  0d 06 18 18 42 6c 6f 63  |wHandle)....Bloc|
000016f0  6b 21 30 3d 57 69 6e 64  6f 77 48 61 6e 64 6c 65  |k!0=WindowHandle|
00001700  0d 06 22 23 c8 99 20 22  57 69 6d 70 5f 47 65 74  |.."#.. "Wimp_Get|
00001710  57 69 6e 64 6f 77 53 74  61 74 65 22 2c 2c 42 6c  |WindowState",,Bl|
00001720  6f 63 6b 0d 06 2c 20 c8  99 20 22 57 69 6d 70 5f  |ock.., .. "Wimp_|
00001730  43 6c 6f 73 65 57 69 6e  64 6f 77 22 2c 2c 42 6c  |CloseWindow",,Bl|
00001740  6f 63 6b 0d 06 36 05 e1  0d 06 40 05 3a 0d 06 4a  |ock..6....@.:..J|
00001750  2c dd 20 f2 44 65 63 69  64 65 57 69 6e 64 6f 77  |,. .DecideWindow|
00001760  50 6f 73 69 74 69 6f 6e  28 42 6c 6f 63 6b 2c 61  |Position(Block,a|
00001770  63 72 6f 73 73 2c 75 70  29 0d 06 54 4c f4 20 55  |cross,up)..TL. U|
00001780  73 65 20 6f 66 20 74 68  69 73 20 70 72 6f 63 65  |se of this proce|
00001790  64 75 72 65 20 6c 65 74  73 20 79 6f 75 20 6f 70  |dure lets you op|
000017a0  65 6e 20 77 69 6e 64 6f  77 73 20 6f 6e 20 61 6e  |en windows on an|
000017b0  20 69 6e 76 69 73 69 62  6c 65 20 67 72 69 64 20  | invisible grid |
000017c0  77 68 69 63 68 0d 06 5e  49 f4 20 61 75 74 6f 6d  |which..^I. autom|
000017d0  61 74 69 63 61 6c 6c 79  20 66 69 74 73 20 69 74  |atically fits it|
000017e0  73 65 6c 66 20 74 6f 20  74 68 65 20 73 63 72 65  |self to the scre|
000017f0  65 6e 20 6d 6f 64 65 20  69 6e 20 75 73 65 2e 20  |en mode in use. |
00001800  54 68 65 72 65 20 61 72  65 20 66 69 76 65 0d 06  |There are five..|
00001810  68 4a f4 20 70 6f 73 69  74 69 6f 6e 73 20 61 63  |hJ. positions ac|
00001820  72 6f 73 73 20 28 6c 65  66 74 2c 20 6d 69 64 2d  |ross (left, mid-|
00001830  6c 65 66 74 2c 20 63 65  6e 74 72 65 2c 20 6d 69  |left, centre, mi|
00001840  64 2d 72 69 67 68 74 2c  20 72 69 67 68 74 29 20  |d-right, right) |
00001850  61 6e 64 20 66 69 76 65  0d 06 72 47 f4 20 70 6f  |and five..rG. po|
00001860  73 69 74 69 6f 6e 73 20  75 70 20 28 62 6f 74 74  |sitions up (bott|
00001870  6f 6d 20 6f 66 20 73 63  72 65 65 6e 2c 20 61 62  |om of screen, ab|
00001880  6f 76 65 20 69 63 6f 6e  2d 62 61 72 2c 20 63 65  |ove icon-bar, ce|
00001890  6e 74 72 65 20 6f 66 20  73 63 72 65 65 6e 2c 0d  |ntre of screen,.|
000018a0  06 7c 2b f4 20 63 65 6e  74 72 65 20 74 6f 70 20  |.|+. centre top |
000018b0  6f 66 20 73 63 72 65 65  6e 2c 20 74 6f 70 20 6f  |of screen, top o|
000018c0  66 20 73 63 72 65 65 6e  29 2e 0d 06 86 07 20 20  |f screen).....  |
000018d0  3a 0d 06 90 43 58 70 69  78 65 6c 73 3d a4 4d 6f  |:...CXpixels=.Mo|
000018e0  64 65 49 6e 66 6f 28 22  58 50 69 78 65 6c 73 22  |deInfo("XPixels"|
000018f0  2c 2d 31 29 3a 59 70 69  78 65 6c 73 3d a4 4d 6f  |,-1):Ypixels=.Mo|
00001900  64 65 49 6e 66 6f 28 22  59 50 69 78 65 6c 73 22  |deInfo("YPixels"|
00001910  2c 2d 31 29 0d 06 9a 4f  58 45 69 67 46 61 63 74  |,-1)...OXEigFact|
00001920  6f 72 3d a4 4d 6f 64 65  49 6e 66 6f 28 22 58 45  |or=.ModeInfo("XE|
00001930  69 67 46 61 63 74 6f 72  22 2c 2d 31 29 3a 59 45  |igFactor",-1):YE|
00001940  69 67 46 61 63 74 6f 72  3d a4 4d 6f 64 65 49 6e  |igFactor=.ModeIn|
00001950  66 6f 28 22 59 45 69 67  46 61 63 74 6f 72 22 2c  |fo("YEigFactor",|
00001960  2d 31 29 0d 06 a4 07 20  20 3a 0d 06 ae 38 74 6f  |-1)....  :...8to|
00001970  70 3d 42 6c 6f 63 6b 21  31 36 3a 72 69 67 68 74  |p=Block!16:right|
00001980  3d 42 6c 6f 63 6b 21 31  32 3a 62 6f 74 3d 42 6c  |=Block!12:bot=Bl|
00001990  6f 63 6b 21 38 3a 6c 65  66 74 3d 42 6c 6f 63 6b  |ock!8:left=Block|
000019a0  21 34 0d 06 b8 41 c8 99  20 22 57 69 6d 70 5f 4f  |!4...A.. "Wimp_O|
000019b0  70 65 6e 57 69 6e 64 6f  77 22 2c 2c 42 6c 6f 63  |penWindow",,Bloc|
000019c0  6b 3a c8 99 20 22 57 69  6d 70 5f 47 65 74 57 69  |k:.. "Wimp_GetWi|
000019d0  6e 64 6f 77 4f 75 74 6c  69 6e 65 22 2c 2c 42 6c  |ndowOutline",,Bl|
000019e0  6f 63 6b 0d 06 c2 26 54  42 3d 28 28 42 6c 6f 63  |ock...&TB=((Bloc|
000019f0  6b 21 31 36 29 2d 74 6f  70 29 2f 28 32 5e 59 45  |k!16)-top)/(2^YE|
00001a00  69 67 46 61 63 74 6f 72  29 0d 06 cc 28 56 53 3d  |igFactor)...(VS=|
00001a10  28 28 42 6c 6f 63 6b 21  31 32 29 2d 72 69 67 68  |((Block!12)-righ|
00001a20  74 29 2f 28 32 5e 58 45  69 67 46 61 63 74 6f 72  |t)/(2^XEigFactor|
00001a30  29 0d 06 d6 25 48 53 3d  28 62 6f 74 2d 28 42 6c  |)...%HS=(bot-(Bl|
00001a40  6f 63 6b 21 38 29 29 2f  28 32 5e 59 45 69 67 46  |ock!8))/(2^YEigF|
00001a50  61 63 74 6f 72 29 0d 06  e0 26 4c 50 3d 28 6c 65  |actor)...&LP=(le|
00001a60  66 74 2d 28 42 6c 6f 63  6b 21 34 29 29 2f 28 32  |ft-(Block!4))/(2|
00001a70  5e 58 45 69 67 46 61 63  74 6f 72 29 0d 06 ea 4b  |^XEigFactor)...K|
00001a80  f4 20 4c 50 20 69 73 20  4c 65 66 74 20 50 69 78  |. LP is Left Pix|
00001a90  65 6c 3a 20 6e 6f 72 6d  61 6c 6c 79 20 70 72 65  |el: normally pre|
00001aa0  73 65 6e 74 2c 20 62 75  74 20 6e 6f 74 20 69 66  |sent, but not if|
00001ab0  20 77 69 6e 64 6f 77 20  69 73 20 74 72 61 6e 73  | window is trans|
00001ac0  70 61 72 65 6e 74 2e 0d  06 f4 25 77 69 64 74 68  |parent....%width|
00001ad0  3d 28 72 69 67 68 74 2d  6c 65 66 74 29 2f 28 32  |=(right-left)/(2|
00001ae0  5e 58 45 69 67 46 61 63  74 6f 72 29 0d 06 fe 23  |^XEigFactor)...#|
00001af0  68 65 69 67 68 74 3d 28  74 6f 70 2d 62 6f 74 29  |height=(top-bot)|
00001b00  2f 28 32 5e 59 45 69 67  46 61 63 74 6f 72 29 0d  |/(2^YEigFactor).|
00001b10  07 08 0f c8 8e 20 61 63  72 6f 73 73 20 ca 0d 07  |..... across ...|
00001b20  12 0e 20 20 c9 20 30 3a  78 3d 4c 50 0d 07 1c 2c  |..  . 0:x=LP...,|
00001b30  20 20 c9 20 31 3a 78 3d  4c 50 2b 28 28 58 70 69  |  . 1:x=LP+((Xpi|
00001b40  78 65 6c 73 2b 31 29 2d  28 77 69 64 74 68 2b 4c  |xels+1)-(width+L|
00001b50  50 2b 56 53 29 29 2f 34  0d 07 26 2c 20 20 c9 20  |P+VS))/4..&,  . |
00001b60  32 3a 78 3d 4c 50 2b 28  28 58 70 69 78 65 6c 73  |2:x=LP+((Xpixels|
00001b70  2b 31 29 2d 28 77 69 64  74 68 2b 4c 50 2b 56 53  |+1)-(width+LP+VS|
00001b80  29 29 2f 32 0d 07 30 32  20 20 c9 20 33 3a 78 3d  |))/2..02  . 3:x=|
00001b90  4c 50 2b 28 33 2a 28 28  28 58 70 69 78 65 6c 73  |LP+(3*(((Xpixels|
00001ba0  2b 31 29 2d 28 77 69 64  74 68 2b 4c 50 2b 56 53  |+1)-(width+LP+VS|
00001bb0  29 29 2f 34 29 29 0d 07  3a 22 20 20 c9 20 34 3a  |))/4))..:"  . 4:|
00001bc0  78 3d 28 58 70 69 78 65  6c 73 2b 31 29 2d 28 77  |x=(Xpixels+1)-(w|
00001bd0  69 64 74 68 2b 56 53 29  0d 07 44 05 cb 0d 07 4e  |idth+VS)..D....N|
00001be0  0b c8 8e 20 75 70 20 ca  0d 07 58 0e 20 20 c9 20  |... up ...X.  . |
00001bf0  30 3a 79 3d 48 53 0d 07  62 23 20 20 c9 20 31 3a  |0:y=HS..b#  . 1:|
00001c00  79 3d 48 53 2b 28 31 33  32 2f 28 32 5e 59 45 69  |y=HS+(132/(2^YEi|
00001c10  67 46 61 63 74 6f 72 29  29 0d 07 6c 2d 20 20 c9  |gFactor))..l-  .|
00001c20  20 32 3a 79 3d 48 53 2b  28 28 59 70 69 78 65 6c  | 2:y=HS+((Ypixel|
00001c30  73 2b 31 29 2d 28 68 65  69 67 68 74 2b 54 42 2b  |s+1)-(height+TB+|
00001c40  48 53 29 29 2f 32 0d 07  76 33 20 20 c9 20 33 3a  |HS))/2..v3  . 3:|
00001c50  79 3d 48 53 2b 28 33 2a  28 28 28 59 70 69 78 65  |y=HS+(3*(((Ypixe|
00001c60  6c 73 2b 31 29 2d 28 68  65 69 67 68 74 2b 54 42  |ls+1)-(height+TB|
00001c70  2b 48 53 29 29 2f 34 29  29 0d 07 80 23 20 20 c9  |+HS))/4))...#  .|
00001c80  20 34 3a 79 3d 28 59 70  69 78 65 6c 73 2b 31 29  | 4:y=(Ypixels+1)|
00001c90  2d 28 68 65 69 67 68 74  2b 54 42 29 0d 07 8a 05  |-(height+TB)....|
00001ca0  cb 0d 07 94 28 f4 20 41  62 6f 76 65 20 63 6f 6f  |....(. Above coo|
00001cb0  72 64 69 6e 61 74 65 73  20 70 6f 73 69 74 69 6f  |rdinates positio|
00001cc0  6e 20 77 69 6e 64 6f 77  2e 0d 07 9e 28 f4 20 4e  |n window....(. N|
00001cd0  6f 77 20 63 6f 6e 76 65  72 74 20 74 6f 20 73 63  |ow convert to sc|
00001ce0  72 65 65 6e 20 63 6f 6f  72 64 69 6e 61 74 65 73  |reen coordinates|
00001cf0  3a 0d 07 a8 29 78 3d 78  2a 28 32 5e 58 45 69 67  |:...)x=x*(2^XEig|
00001d00  46 61 63 74 6f 72 29 3a  79 3d 79 2a 28 32 5e 59  |Factor):y=y*(2^Y|
00001d10  45 69 67 46 61 63 74 6f  72 29 0d 07 b2 3b 77 69  |EigFactor)...;wi|
00001d20  64 74 68 3d 77 69 64 74  68 2a 28 32 5e 58 45 69  |dth=width*(2^XEi|
00001d30  67 46 61 63 74 6f 72 29  3a 68 65 69 67 68 74 3d  |gFactor):height=|
00001d40  68 65 69 67 68 74 2a 28  32 5e 59 45 69 67 46 61  |height*(2^YEigFa|
00001d50  63 74 6f 72 29 0d 07 bc  1e 42 6c 6f 63 6b 21 31  |ctor)....Block!1|
00001d60  32 3d 78 2b 77 69 64 74  68 3a 42 6c 6f 63 6b 21  |2=x+width:Block!|
00001d70  34 3d 78 0d 07 c6 1f 42  6c 6f 63 6b 21 31 36 3d  |4=x....Block!16=|
00001d80  79 2b 68 65 69 67 68 74  3a 42 6c 6f 63 6b 21 38  |y+height:Block!8|
00001d90  3d 79 0d 07 d0 05 e1 0d  07 da 05 3a 0d 07 e4 4f  |=y.........:...O|
00001da0  f4 20 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |. --------------|
00001db0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001de0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 07 ee 18 f4  |-----------.....|
00001df0  20 57 69 6d 70 20 70 6f  6c 6c 20 72 6f 75 74 69  | Wimp poll routi|
00001e00  6e 65 73 0d 07 f8 4f f4  20 2d 2d 2d 2d 2d 2d 2d  |nes...O. -------|
00001e10  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001e50  2d 2d 0d 08 02 05 3a 0d  08 0c 0d dd 20 f2 52 65  |--....:..... .Re|
00001e60  64 72 61 77 0d 08 16 14  e7 20 44 6f 4d 6f 64 65  |draw..... DoMode|
00001e70  43 68 61 6e 67 65 20 8c  0d 08 20 4b 20 20 f4 20  |Change ... K  . |
00001e80  52 65 2d 6f 70 65 6e 69  6e 67 20 77 69 6e 64 6f  |Re-opening windo|
00001e90  77 73 20 6e 65 65 64 20  61 6e 20 65 78 74 72 61  |ws need an extra|
00001ea0  20 77 69 6d 70 5f 70 6f  6c 6c 20 74 6f 20 68 61  | wimp_poll to ha|
00001eb0  70 70 65 6e 20 61 66 74  65 72 20 74 68 65 20 6d  |ppen after the m|
00001ec0  6f 64 65 0d 08 2a 20 20  20 f4 20 63 68 61 6e 67  |ode..*   . chang|
00001ed0  65 20 69 6e 20 6f 72 64  65 72 20 74 6f 20 77 6f  |e in order to wo|
00001ee0  72 6b 3a 0d 08 34 3c 20  20 e7 20 a4 4f 70 65 6e  |rk:..4<  . .Open|
00001ef0  53 74 61 74 65 28 47 72  61 62 29 20 8c 20 f2 4f  |State(Grab) . .O|
00001f00  70 65 6e 28 47 72 61 62  2c a3 2c 58 50 6f 73 69  |pen(Grab,.,XPosi|
00001f10  74 69 6f 6e 2c 59 50 6f  73 69 74 69 6f 6e 29 0d  |tion,YPosition).|
00001f20  08 3e 14 20 20 44 6f 4d  6f 64 65 43 68 61 6e 67  |.>.  DoModeChang|
00001f30  65 3d a3 0d 08 48 05 cd  0d 08 52 28 c8 99 20 22  |e=...H....R(.. "|
00001f40  57 69 6d 70 5f 52 65 64  72 61 77 57 69 6e 64 6f  |Wimp_RedrawWindo|
00001f50  77 22 2c 2c 42 6c 6f 63  6b 20 b8 20 66 6c 61 67  |w",,Block . flag|
00001f60  0d 08 5c 0b c8 95 20 66  6c 61 67 0d 08 66 2a 20  |..\... flag..f* |
00001f70  20 c8 99 20 22 49 6e 74  65 72 66 61 63 65 5f 52  | .. "Interface_R|
00001f80  65 6e 64 65 72 33 64 57  69 6e 64 6f 77 22 2c 2c  |ender3dWindow",,|
00001f90  42 6c 6f 63 6b 0d 08 70  2a 20 20 c8 99 20 22 57  |Block..p*  .. "W|
00001fa0  69 6d 70 5f 47 65 74 52  65 63 74 61 6e 67 6c 65  |imp_GetRectangle|
00001fb0  22 2c 2c 42 6c 6f 63 6b  20 b8 20 66 6c 61 67 0d  |",,Block . flag.|
00001fc0  08 7a 05 ce 0d 08 84 05  e1 0d 08 8e 05 3a 0d 08  |.z...........:..|
00001fd0  98 15 dd 20 f2 52 65 63  69 65 76 65 4d 65 73 73  |... .RecieveMess|
00001fe0  61 67 65 0d 08 a2 11 c8  8e 20 42 6c 6f 63 6b 21  |age...... Block!|
00001ff0  31 36 20 ca 0d 08 ac 12  20 20 c9 20 30 20 3a 20  |16 .....  . 0 : |
00002000  44 6f 6e 65 3d b9 0d 08  b6 36 20 20 c9 20 31 20  |Done=....6  . 1 |
00002010  3a 20 f4 20 41 20 74 61  73 6b 20 69 73 20 74 72  |: . A task is tr|
00002020  79 69 6e 67 20 74 6f 20  73 61 76 65 20 61 20 66  |ying to save a f|
00002030  69 6c 65 20 69 6e 74 6f  20 75 73 2e 0d 08 c0 4c  |ile into us....L|
00002040  20 20 20 20 20 20 20 20  20 20 20 f4 20 57 65 20  |           . We |
00002050  6d 75 73 74 20 74 65 6c  6c 20 69 74 20 74 6f 20  |must tell it to |
00002060  75 73 65 20 3c 57 69 6d  70 24 53 63 72 61 70 3e  |use <Wimp$Scrap>|
00002070  20 62 65 63 61 75 73 65  20 52 41 4d 20 74 72 61  | because RAM tra|
00002080  6e 73 66 65 72 20 69 73  0d 08 ca 4c 20 20 20 20  |nsfer is...L    |
00002090  20 20 20 20 20 20 20 f4  20 74 6f 6f 20 6d 75 63  |       . too muc|
000020a0  68 20 6c 69 6b 65 20 68  61 72 64 20 77 6f 72 6b  |h like hard work|
000020b0  20 66 6f 72 20 6c 6f 61  64 69 6e 67 20 66 69 6c  | for loading fil|
000020c0  65 73 20 28 61 6c 74 68  6f 75 67 68 20 77 65 20  |es (although we |
000020d0  6e 65 65 64 0d 08 d4 4a  20 20 20 20 20 20 20 20  |need...J        |
000020e0  20 20 20 f4 20 74 6f 20  64 6f 20 69 74 20 77 68  |   . to do it wh|
000020f0  65 6e 20 74 72 61 6e 73  66 65 72 72 69 6e 67 20  |en transferring |
00002100  6f 75 74 2c 20 64 75 65  20 74 6f 20 74 68 65 20  |out, due to the |
00002110  6e 61 74 75 72 65 20 6f  66 20 74 68 69 73 0d 08  |nature of this..|
00002120  de 1a 20 20 20 20 20 20  20 20 20 20 20 f4 20 75  |..           . u|
00002130  74 69 6c 69 74 79 29 2e  0d 08 e8 22 20 20 20 20  |tility)...."    |
00002140  20 20 20 20 20 20 20 e7  20 42 6c 6f 63 6b 21 31  |       . Block!1|
00002150  32 3c 3e 4d 79 52 65 66  20 8c 0d 08 f2 4b 20 20  |2<>MyRef ....K  |
00002160  20 20 20 20 20 20 20 20  20 20 20 f4 20 49 67 6e  |           . Ign|
00002170  6f 72 65 20 74 68 65 20  6d 65 73 73 61 67 65 20  |ore the message |
00002180  69 66 20 74 68 65 20 75  73 65 72 20 68 61 73 20  |if the user has |
00002190  64 72 61 67 67 65 64 20  6f 75 72 20 73 61 76 65  |dragged our save|
000021a0  20 66 69 6c 65 0d 08 fc  20 20 20 20 20 20 20 20  | file...        |
000021b0  20 20 20 20 20 20 f4 20  62 61 63 6b 20 69 6e 74  |      . back int|
000021c0  6f 20 75 73 2e 0d 09 06  37 20 20 20 20 20 20 20  |o us....7       |
000021d0  20 20 20 20 20 20 42 6c  6f 63 6b 21 30 3d 36 30  |      Block!0=60|
000021e0  3a 42 6c 6f 63 6b 21 31  32 3d 42 6c 6f 63 6b 21  |:Block!12=Block!|
000021f0  38 3a 42 6c 6f 63 6b 21  31 36 3d 32 0d 09 10 3a  |8:Block!16=2...:|
00002200  20 20 20 20 20 20 20 20  20 20 20 20 20 42 6c 6f  |             Blo|
00002210  63 6b 21 33 36 3d 2d 31  3a 24 28 42 6c 6f 63 6b  |ck!36=-1:$(Block|
00002220  2b 34 34 29 3d 22 3c 57  69 6d 70 24 53 63 72 61  |+44)="<Wimp$Scra|
00002230  70 3e 22 2b bd 30 0d 09  1a 37 20 20 20 20 20 20  |p>"+.0...7      |
00002240  20 20 20 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |       .. "Wimp_|
00002250  53 65 6e 64 4d 65 73 73  61 67 65 22 2c 31 37 2c  |SendMessage",17,|
00002260  42 6c 6f 63 6b 2c 42 6c  6f 63 6b 21 34 0d 09 24  |Block,Block!4..$|
00002270  10 20 20 20 20 20 20 20  20 20 20 20 cd 0d 09 2e  |.           ....|
00002280  46 20 20 c9 20 32 20 3a  20 f4 20 57 65 27 72 65  |F  . 2 : . We're|
00002290  20 73 61 76 69 6e 67 20  6f 75 74 20 74 6f 20 61  | saving out to a|
000022a0  6e 6f 74 68 65 72 20 61  70 70 6c 69 63 61 74 69  |nother applicati|
000022b0  6f 6e 20 6f 72 20 74 6f  20 74 68 65 20 66 69 6c  |on or to the fil|
000022c0  65 72 2e 0d 09 38 4a 20  20 20 20 20 20 20 20 20  |er...8J         |
000022d0  20 20 f4 20 57 65 27 76  65 20 6a 75 73 74 20 72  |  . We've just r|
000022e0  65 63 65 69 76 65 64 20  61 63 6b 6e 6f 77 6c 65  |eceived acknowle|
000022f0  64 67 65 6d 65 6e 74 20  74 6f 20 67 6f 20 61 68  |dgement to go ah|
00002300  65 61 64 20 61 6e 64 20  73 61 76 65 2e 0d 09 42  |ead and save...B|
00002310  5a 20 20 20 20 20 20 20  20 20 20 20 46 69 6c 65  |Z           File|
00002320  4e 61 6d 65 24 3d 22 22  3a 4e 3d 34 34 3a c8 95  |Name$="":N=44:..|
00002330  20 28 28 42 6c 6f 63 6b  3f 4e 29 3e 3d 33 32 29  | ((Block?N)>=32)|
00002340  20 80 20 28 4e 3c 32 35  36 29 3a 46 69 6c 65 4e  | . (N<256):FileN|
00002350  61 6d 65 24 2b 3d bd 28  42 6c 6f 63 6b 3f 4e 29  |ame$+=.(Block?N)|
00002360  3a 4e 2b 3d 31 3a ce 0d  09 4c 20 20 20 20 20 20  |:N+=1:...L      |
00002370  20 20 20 20 20 20 e7 20  46 69 6c 65 4e 61 6d 65  |      . FileName|
00002380  24 3c 3e 22 22 20 8c 0d  09 56 4b 20 20 20 20 20  |$<>"" ...VK     |
00002390  20 20 20 20 20 20 20 20  f4 20 5e 20 57 65 20 63  |        . ^ We c|
000023a0  61 6e 20 67 65 74 20 66  75 6e 6e 79 20 72 65 73  |an get funny res|
000023b0  75 6c 74 73 20 66 72 6f  6d 20 73 6f 6d 65 20 70  |ults from some p|
000023c0  72 6f 67 72 61 6d 73 20  77 68 65 6e 20 75 73 69  |rograms when usi|
000023d0  6e 67 0d 09 60 2e 20 20  20 20 20 20 20 20 20 20  |ng..`.          |
000023e0  20 20 20 f4 20 52 41 4d  20 64 61 74 61 20 74 72  |   . RAM data tr|
000023f0  61 6e 73 66 65 72 20 70  72 6f 74 6f 63 6f 6c 2e  |ansfer protocol.|
00002400  0d 09 6a 78 20 20 20 20  20 20 20 20 20 20 20 20  |..jx            |
00002410  20 e7 20 ac 20 a4 53 61  76 65 47 72 61 62 62 65  | . . .SaveGrabbe|
00002420  64 54 6f 46 69 6c 65 28  46 69 6c 65 4e 61 6d 65  |dToFile(FileName|
00002430  24 29 20 8c 20 f2 44 65  6c 65 74 65 57 69 6d 70  |$) . .DeleteWimp|
00002440  53 63 72 61 70 3a 85 20  39 39 39 39 2c 22 41 6e  |Scrap:. 9999,"An|
00002450  20 65 72 72 6f 72 20 6f  63 63 75 72 72 65 64 20  | error occurred |
00002460  77 68 69 6c 73 74 20 73  61 76 69 6e 67 20 74 68  |whilst saving th|
00002470  65 20 66 69 6c 65 2e 22  0d 09 74 53 20 20 20 20  |e file."..tS    |
00002480  20 20 20 20 20 20 20 20  20 42 6c 6f 63 6b 21 31  |         Block!1|
00002490  32 3d 42 6c 6f 63 6b 21  38 3a 42 6c 6f 63 6b 21  |2=Block!8:Block!|
000024a0  31 36 3d 33 3a c8 99 20  22 57 69 6d 70 5f 53 65  |16=3:.. "Wimp_Se|
000024b0  6e 64 4d 65 73 73 61 67  65 22 2c 31 37 2c 42 6c  |ndMessage",17,Bl|
000024c0  6f 63 6b 2c 42 6c 6f 63  6b 21 34 0d 09 7e 4b 20  |ock,Block!4..~K |
000024d0  20 20 20 20 20 20 20 20  20 20 20 20 4d 79 52 65  |            MyRe|
000024e0  66 3d 2d 31 3a f4 20 49  6e 76 61 6c 69 64 61 74  |f=-1:. Invalidat|
000024f0  65 20 6f 6e 63 65 20 61  67 61 69 6e 2c 20 75 6e  |e once again, un|
00002500  74 69 6c 20 6f 75 72 20  6e 65 78 74 20 73 61 76  |til our next sav|
00002510  65 20 6f 75 74 2e 0d 09  88 2e 20 20 20 20 20 20  |e out.....      |
00002520  20 20 20 20 20 20 20 e7  20 46 69 6c 65 4e 61 6d  |       . FileNam|
00002530  65 24 3c 3e 22 3c 57 69  6d 70 24 53 63 72 61 70  |e$<>"<Wimp$Scrap|
00002540  3e 22 20 8c 0d 09 92 30  20 20 20 20 20 20 20 20  |>" ....0        |
00002550  20 20 20 20 20 20 20 f2  55 70 64 61 74 65 49 63  |       .UpdateIc|
00002560  6f 6e 28 53 61 76 65 2c  32 2c 46 69 6c 65 4e 61  |on(Save,2,FileNa|
00002570  6d 65 24 29 0d 09 9c 34  20 20 20 20 20 20 20 20  |me$)...4        |
00002580  20 20 20 20 20 20 20 f4  20 50 75 74 20 66 75 6c  |       . Put ful|
00002590  6c 20 66 69 6c 65 6e 61  6d 65 20 69 6e 74 6f 20  |l filename into |
000025a0  73 61 76 65 20 62 6f 78  0d 09 a6 12 20 20 20 20  |save box....    |
000025b0  20 20 20 20 20 20 20 20  20 cd 0d 09 b0 10 20 20  |         .....  |
000025c0  20 20 20 20 20 20 20 20  20 cd 0d 09 ba 2b 20 20  |         ....+  |
000025d0  c9 20 33 20 3a 20 f4 20  46 69 6c 65 20 64 72 61  |. 3 : . File dra|
000025e0  67 67 65 64 20 69 6e 74  6f 20 61 70 70 6c 69 63  |gged into applic|
000025f0  61 74 69 6f 6e 0d 09 c4  20 20 20 20 20 20 20 20  |ation...        |
00002600  20 20 20 20 f2 4d 69 6e  69 6d 69 73 65 57 69 6d  |    .MinimiseWim|
00002610  70 53 6c 6f 74 0d 09 ce  5a 20 20 20 20 20 20 20  |pSlot...Z       |
00002620  20 20 20 20 46 69 6c 65  4e 61 6d 65 24 3d 22 22  |    FileName$=""|
00002630  3a 4e 3d 34 34 3a c8 95  20 28 28 42 6c 6f 63 6b  |:N=44:.. ((Block|
00002640  3f 4e 29 3e 3d 33 32 29  20 80 20 28 4e 3c 32 35  |?N)>=32) . (N<25|
00002650  36 29 3a 46 69 6c 65 4e  61 6d 65 24 2b 3d bd 28  |6):FileName$+=.(|
00002660  42 6c 6f 63 6b 3f 4e 29  3a 4e 2b 3d 31 3a ce 0d  |Block?N):N+=1:..|
00002670  09 d8 32 20 20 20 20 20  20 20 20 20 20 20 46 69  |..2           Fi|
00002680  6c 65 54 79 70 65 3d 42  6c 6f 63 6b 21 34 30 3a  |leType=Block!40:|
00002690  46 69 6c 65 53 69 7a 65  3d 42 6c 6f 63 6b 21 33  |FileSize=Block!3|
000026a0  36 0d 09 e2 43 20 20 20  20 20 20 20 20 20 20 20  |6...C           |
000026b0  4c 6f 61 64 46 69 6c 65  45 72 72 6f 72 3d a4 4c  |LoadFileError=.L|
000026c0  6f 61 64 46 69 6c 65 28  46 69 6c 65 53 69 7a 65  |oadFile(FileSize|
000026d0  2c 46 69 6c 65 54 79 70  65 2c 46 69 6c 65 4e 61  |,FileType,FileNa|
000026e0  6d 65 24 29 0d 09 ec 3c  20 20 20 20 20 20 20 20  |me$)...<        |
000026f0  20 20 20 e7 20 46 69 6c  65 4e 61 6d 65 24 3d 22  |   . FileName$="|
00002700  3c 57 69 6d 70 24 53 63  72 61 70 3e 22 20 8c 20  |<Wimp$Scrap>" . |
00002710  f2 44 65 6c 65 74 65 57  69 6d 70 53 63 72 61 70  |.DeleteWimpScrap|
00002720  0d 09 f6 2a 20 20 20 20  20 20 20 20 20 20 20 42  |...*           B|
00002730  6c 6f 63 6b 21 31 32 3d  42 6c 6f 63 6b 21 38 3a  |lock!12=Block!8:|
00002740  42 6c 6f 63 6b 21 31 36  3d 34 0d 0a 00 45 20 20  |Block!16=4...E  |
00002750  20 20 20 20 20 20 20 20  20 42 6c 6f 63 6b 21 33  |         Block!3|
00002760  36 3d 2d 31 3a 42 6c 6f  63 6b 21 34 30 3d 46 69  |6=-1:Block!40=Fi|
00002770  6c 65 54 79 70 65 3a 24  28 42 6c 6f 63 6b 2b 34  |leType:$(Block+4|
00002780  34 29 3d 46 69 6c 65 4e  61 6d 65 24 2b bd 30 0d  |4)=FileName$+.0.|
00002790  0a 0a 35 20 20 20 20 20  20 20 20 20 20 20 c8 99  |..5           ..|
000027a0  20 22 57 69 6d 70 5f 53  65 6e 64 4d 65 73 73 61  | "Wimp_SendMessa|
000027b0  67 65 22 2c 31 37 2c 42  6c 6f 63 6b 2c 42 6c 6f  |ge",17,Block,Blo|
000027c0  63 6b 21 34 0d 0a 14 2f  20 20 20 20 20 20 20 20  |ck!4.../        |
000027d0  20 20 20 54 79 70 69 6e  67 3d a3 3a f2 54 69 63  |   Typing=.:.Tic|
000027e0  6b 4d 65 6e 75 28 4d 61  69 6e 4d 65 6e 75 2c 32  |kMenu(MainMenu,2|
000027f0  2c a3 29 0d 0a 1e 22 20  20 20 20 20 20 20 20 20  |,.)..."         |
00002800  20 20 f2 43 68 65 63 6b  4c 6f 61 64 46 69 6c 65  |  .CheckLoadFile|
00002810  45 72 72 6f 72 0d 0a 28  45 20 20 20 20 20 20 20  |Error..(E       |
00002820  20 20 20 20 f2 55 70 64  61 74 65 47 72 61 62 49  |    .UpdateGrabI|
00002830  63 6f 6e 28 22 22 2c 42  75 66 66 65 72 4c 65 6e  |con("",BufferLen|
00002840  67 74 68 2c a3 29 3a f4  20 54 68 65 20 46 41 4c  |gth,.):. The FAL|
00002850  53 45 20 6c 65 74 73 20  75 73 0d 0a 32 4c 20 20  |SE lets us..2L  |
00002860  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00002890  20 20 20 f4 20 69 6e 63  6c 75 64 65 20 43 48 52  |   . include CHR|
000028a0  24 28 31 33 29 2e 0d 0a  3c 2c 20 20 20 20 20 20  |$(13)...<,      |
000028b0  20 20 20 20 20 f2 55 70  64 61 74 65 49 63 6f 6e  |     .UpdateIcon|
000028c0  43 6f 6c 6f 75 72 28 47  72 61 62 2c 34 2c 37 2c  |Colour(Grab,4,7,|
000028d0  31 29 0d 0a 46 27 20 20  20 20 20 20 20 20 20 20  |1)..F'          |
000028e0  20 f2 53 68 61 64 65 4d  65 6e 75 28 4d 61 69 6e  | .ShadeMenu(Main|
000028f0  4d 65 6e 75 2c 31 2c a3  29 0d 0a 50 27 20 20 20  |Menu,1,.)..P'   |
00002900  20 20 20 20 20 20 20 20  f2 53 68 61 64 65 4d 65  |        .ShadeMe|
00002910  6e 75 28 4d 61 69 6e 4d  65 6e 75 2c 32 2c a3 29  |nu(MainMenu,2,.)|
00002920  0d 0a 5a 27 20 20 20 20  20 20 20 20 20 20 20 f2  |..Z'           .|
00002930  53 68 61 64 65 4d 65 6e  75 28 4d 61 69 6e 4d 65  |ShadeMenu(MainMe|
00002940  6e 75 2c 34 2c a3 29 0d  0a 64 47 20 20 20 20 20  |nu,4,.)..dG     |
00002950  20 20 20 20 20 20 e7 20  ac 20 a4 4f 70 65 6e 53  |      . . .OpenS|
00002960  74 61 74 65 28 47 72 61  62 29 20 8c 20 f2 4f 70  |tate(Grab) . .Op|
00002970  65 6e 28 47 72 61 62 2c  b9 2c 58 50 6f 73 69 74  |en(Grab,.,XPosit|
00002980  69 6f 6e 2c 59 50 6f 73  69 74 69 6f 6e 29 0d 0a  |ion,YPosition)..|
00002990  6e 4c 20 20 c9 20 34 20  3a 20 f4 20 57 65 20 68  |nL  . 4 : . We h|
000029a0  61 76 65 20 73 61 76 65  64 20 74 68 65 20 74 65  |ave saved the te|
000029b0  78 74 20 66 69 6c 65 2c  20 61 6e 64 20 61 72 65  |xt file, and are|
000029c0  20 72 65 63 65 69 76 69  6e 67 20 61 63 6b 6e 6f  | receiving ackno|
000029d0  77 6c 65 64 67 65 6d 65  6e 74 0d 0a 78 45 20 20  |wledgement..xE  |
000029e0  20 20 20 20 20 20 20 20  20 f4 20 57 65 20 6e 65  |         . We ne|
000029f0  65 64 20 74 6f 20 63 6c  6f 73 65 20 74 68 65 20  |ed to close the |
00002a00  6d 65 6e 75 20 61 6e 64  20 74 75 72 6e 20 74 72  |menu and turn tr|
00002a10  61 6e 73 6d 69 73 73 69  6f 6e 20 6f 66 66 2e 0d  |ansmission off..|
00002a20  0a 82 27 20 20 20 20 20  20 20 20 20 20 20 c8 99  |..'           ..|
00002a30  20 22 57 69 6d 70 5f 43  72 65 61 74 65 4d 65 6e  | "Wimp_CreateMen|
00002a40  75 22 2c 2c 2d 31 0d 0a  8c 22 20 20 20 20 20 20  |u",,-1..."      |
00002a50  20 20 20 20 20 54 72 61  6e 73 6d 69 74 3d a3 3a  |     Transmit=.:|
00002a60  4d 79 52 65 66 3d 2d 31  0d 0a 96 26 20 20 c9 20  |MyRef=-1...&  . |
00002a70  36 20 3a 20 e7 20 54 72  61 6e 73 6d 69 74 20 8c  |6 : . Transmit .|
00002a80  20 f2 54 72 61 6e 73 6d  69 74 54 65 78 74 0d 0a  | .TransmitText..|
00002a90  a0 31 20 20 c9 20 31 30  3a 20 e7 20 4f 6d 6e 69  |.1  . 10: . Omni|
00002aa0  44 65 73 6b 3d 30 20 8c  20 f2 53 61 76 65 44 65  |Desk=0 . .SaveDe|
00002ab0  73 6b 74 6f 70 28 42 6c  6f 63 6b 21 32 30 29 0d  |sktop(Block!20).|
00002ac0  0a aa 45 20 20 20 20 20  20 20 20 20 20 20 f4 20  |..E           . |
00002ad0  4f 6e 6c 79 20 73 61 76  65 20 69 66 20 77 65 20  |Only save if we |
00002ae0  68 61 76 65 20 6e 6f 74  20 62 65 65 6e 20 73 74  |have not been st|
00002af0  61 72 74 65 64 20 75 70  20 62 79 20 4f 6d 6e 69  |arted up by Omni|
00002b00  44 65 73 6b 0d 0a b4 14  20 20 c9 20 26 35 30 32  |Desk....  . &502|
00002b10  20 3a 20 f2 48 65 6c 70  0d 0a be 1c 20 20 c9 20  | : .Help....  . |
00002b20  26 34 30 30 43 31 20 3a  20 f2 4d 6f 64 65 43 68  |&400C1 : .ModeCh|
00002b30  61 6e 67 65 0d 0a c8 1a  20 20 c9 20 26 34 30 30  |ange....  . &400|
00002b40  43 37 20 3a 20 41 24 3d  22 22 3a 4e 3d 30 0d 0a  |C7 : A$="":N=0..|
00002b50  d2 41 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.A              |
00002b60  20 20 c8 95 20 42 6c 6f  63 6b 3f 28 32 38 2b 4e  |  .. Block?(28+N|
00002b70  29 3e 33 31 3a 41 24 2b  3d bd 28 42 6c 6f 63 6b  |)>31:A$+=.(Block|
00002b80  3f 28 32 38 2b 4e 29 29  3a 4e 2b 3d 31 3a ce 0d  |?(28+N)):N+=1:..|
00002b90  0a dc 1b 20 20 20 20 20  20 20 20 20 20 20 20 20  |...             |
00002ba0  20 20 20 c8 8e 20 41 24  20 ca 0d 0a e6 2f 20 20  |   .. A$ ..../  |
00002bb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002bc0  c9 20 22 46 69 6c 65 72  22 3a f2 47 72 61 62 46  |. "Filer":.GrabF|
00002bd0  69 6c 65 72 54 69 74 6c  65 0d 0a f0 25 20 20 20  |ilerTitle...%   |
00002be0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 7f  |               .|
00002bf0  20 f2 47 72 61 62 54 69  74 6c 65 42 61 72 0d 0a  | .GrabTitleBar..|
00002c00  fa 15 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |..              |
00002c10  20 20 cb 0d 0b 04 3d 20  20 c9 20 55 74 69 6c 4f  |  ....=  . UtilO|
00002c20  70 65 6e 20 3a 20 e7 20  24 28 42 6c 6f 63 6b 2b  |pen : . $(Block+|
00002c30  32 34 29 3d 54 61 73 6b  6e 61 6d 65 24 20 8c 20  |24)=Taskname$ . |
00002c40  f2 4f 6d 6e 69 44 65 73  6b 43 61 6c 6c 69 6e 67  |.OmniDeskCalling|
00002c50  0d 0b 0e 26 20 20 c9 20  55 74 69 6c 51 75 69 74  |...&  . UtilQuit|
00002c60  74 69 6e 67 20 3a 20 e7  20 4f 6d 6e 69 44 65 73  |ting : . OmniDes|
00002c70  6b 3c 3e 30 20 8c 0d 0b  18 38 20 20 20 20 20 20  |k<>0 ....8      |
00002c80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002c90  20 20 e7 20 42 6c 6f 63  6b 21 32 30 3d 4f 6d 6e  |  . Block!20=Omn|
00002ca0  69 44 65 73 6b 20 8c 20  44 6f 6e 65 3d b9 0d 0b  |iDesk . Done=...|
00002cb0  22 1b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |".              |
00002cc0  20 20 20 20 20 20 20 20  cd 0d 0b 2c 1b 20 20 c9  |        ...,.  .|
00002cd0  20 55 74 69 6c 52 65 73  69 64 65 20 3a 20 45 78  | UtilReside : Ex|
00002ce0  69 74 3d a3 0d 0b 36 05  cb 0d 0b 40 05 e1 0d 0b  |it=...6....@....|
00002cf0  4a 05 3a 0d 0b 54 16 dd  20 f2 44 65 6c 65 74 65  |J.:..T.. .Delete|
00002d00  57 69 6d 70 53 63 72 61  70 0d 0b 5e 07 ea 20 85  |WimpScrap..^.. .|
00002d10  0d 0b 68 0f ee 20 85 20  ea 20 f7 20 85 3a e1 0d  |..h.. . . . .:..|
00002d20  0b 72 3c f4 20 57 65 20  6d 61 79 20 72 65 63 65  |.r<. We may rece|
00002d30  69 76 65 20 74 72 79 20  74 6f 20 64 65 6c 65 74  |ive try to delet|
00002d40  65 20 61 20 6e 6f 6e 2d  65 78 69 73 74 61 6e 74  |e a non-existant|
00002d50  20 57 69 6d 70 24 53 63  72 61 70 0d 0b 7c 40 f4  | Wimp$Scrap..|@.|
00002d60  20 66 69 6c 65 20 69 66  20 74 68 65 20 72 65 63  | file if the rec|
00002d70  65 69 76 69 6e 67 20 74  61 73 6b 20 64 69 64 20  |eiving task did |
00002d80  6e 6f 74 20 72 65 63 6f  67 6e 69 73 65 20 74 68  |not recognise th|
00002d90  65 20 66 69 6c 65 74 79  70 65 2e 0d 0b 86 1c ff  |e filetype......|
00002da0  28 22 44 65 6c 65 74 65  20 3c 57 69 6d 70 24 53  |("Delete <Wimp$S|
00002db0  63 72 61 70 3e 22 29 0d  0b 90 05 e1 0d 0b 9a 05  |crap>").........|
00002dc0  3a 0d 0b a4 12 dd 20 f2  4d 6f 75 73 65 42 75 74  |:..... .MouseBut|
00002dd0  74 6f 6e 0d 0b ae 31 4d  6f 75 73 65 58 3d 42 6c  |ton...1MouseX=Bl|
00002de0  6f 63 6b 21 30 3a 4d 6f  75 73 65 59 3d 42 6c 6f  |ock!0:MouseY=Blo|
00002df0  63 6b 21 34 3a 42 75 74  74 6f 6e 73 3d 42 6c 6f  |ck!4:Buttons=Blo|
00002e00  63 6b 21 38 0d 0b b8 21  57 69 6e 64 6f 77 3d 42  |ck!8...!Window=B|
00002e10  6c 6f 63 6b 21 31 32 3a  49 63 6f 6e 3d 42 6c 6f  |lock!12:Icon=Blo|
00002e20  63 6b 21 31 36 0d 0b c2  0f c8 8e 20 57 69 6e 64  |ck!16...... Wind|
00002e30  6f 77 20 ca 0d 0b cc 22  20 20 c9 20 2d 32 3a f4  |ow ...."  . -2:.|
00002e40  20 49 63 6f 6e 20 62 61  72 20 69 63 6f 6e 20 63  | Icon bar icon c|
00002e50  6c 69 63 6b 65 64 0d 0b  d6 14 20 20 20 20 c8 8e  |licked....    ..|
00002e60  20 42 75 74 74 6f 6e 73  20 ca 0d 0b e0 18 20 20  | Buttons .....  |
00002e70  20 20 20 20 c9 20 31 20  3a 20 f4 20 41 64 6a 75  |    . 1 : . Adju|
00002e80  73 74 0d 0b ea 16 20 20  20 20 20 20 c9 20 32 20  |st....      . 2 |
00002e90  3a 20 f4 20 4d 65 6e 75  0d 0b f4 39 20 20 20 20  |: . Menu...9    |
00002ea0  20 20 20 20 4d 25 3d 49  42 4d 65 6e 75 3a 4d 65  |    M%=IBMenu:Me|
00002eb0  6e 75 58 3d 4d 6f 75 73  65 58 3a 4d 65 6e 75 59  |nuX=MouseX:MenuY|
00002ec0  3d 4d 6f 75 73 65 59 3a  f2 4d 61 6b 65 4d 65 6e  |=MouseY:.MakeMen|
00002ed0  75 0d 0b fe 18 20 20 20  20 20 20 c9 20 34 20 3a  |u....      . 4 :|
00002ee0  20 f4 20 53 65 6c 65 63  74 0d 0c 08 2d 20 20 20  | . Select...-   |
00002ef0  20 20 20 20 20 f2 4f 70  65 6e 28 47 72 61 62 2c  |     .Open(Grab,|
00002f00  b9 2c 58 50 6f 73 69 74  69 6f 6e 2c 59 50 6f 73  |.,XPosition,YPos|
00002f10  69 74 69 6f 6e 29 0d 0c  12 09 20 20 20 20 cb 0d  |ition)....    ..|
00002f20  0c 1c 0c 20 20 c9 20 47  72 61 62 0d 0c 26 14 20  |...  . Grab..&. |
00002f30  20 20 20 c8 8e 20 42 75  74 74 6f 6e 73 20 ca 0d  |   .. Buttons ..|
00002f40  0c 30 16 20 20 20 20 20  20 c9 20 32 20 3a 20 f4  |.0.      . 2 : .|
00002f50  20 4d 65 6e 75 0d 0c 3a  31 20 20 20 20 20 20 20  | Menu..:1       |
00002f60  20 4d 25 3d 4d 61 69 6e  4d 65 6e 75 3a 4d 65 6e  | M%=MainMenu:Men|
00002f70  75 58 3d 4d 6f 75 73 65  58 3a 4d 65 6e 75 59 3d  |uX=MouseX:MenuY=|
00002f80  4d 6f 75 73 65 59 0d 0c  44 19 20 20 20 20 20 20  |MouseY..D.      |
00002f90  20 20 e7 20 77 69 6d 70  3e 3d 33 31 30 20 8c 0d  |  . wimp>=310 ..|
00002fa0  0c 4e 60 20 20 20 20 20  20 20 20 20 20 e7 20 c0  |.N`          . .|
00002fb0  24 4d 61 69 6e 4d 65 6e  75 54 69 74 6c 65 2c 31  |$MainMenuTitle,1|
00002fc0  29 3d 22 5c 22 20 8c 20  24 4d 61 69 6e 4d 65 6e  |)="\" . $MainMen|
00002fd0  75 54 69 74 6c 65 3d c2  24 4d 61 69 6e 4d 65 6e  |uTitle=.$MainMen|
00002fe0  75 54 69 74 6c 65 2c a9  28 24 4d 61 69 6e 4d 65  |uTitle,.($MainMe|
00002ff0  6e 75 54 69 74 6c 65 29  2d 31 29 2b bd 31 33 0d  |nuTitle)-1)+.13.|
00003000  0c 58 43 20 20 20 20 20  20 20 20 20 20 e7 20 58  |.XC          . X|
00003010  50 6f 73 69 74 69 6f 6e  3d 34 20 8c 20 24 4d 61  |Position=4 . $Ma|
00003020  69 6e 4d 65 6e 75 54 69  74 6c 65 3d 22 5c 22 2b  |inMenuTitle="\"+|
00003030  24 4d 61 69 6e 4d 65 6e  75 54 69 74 6c 65 2b bd  |$MainMenuTitle+.|
00003040  31 33 0d 0c 62 0d 20 20  20 20 20 20 20 20 cd 0d  |13..b.        ..|
00003050  0c 6c 15 20 20 20 20 20  20 20 20 f2 4d 61 6b 65  |.l.        .Make|
00003060  4d 65 6e 75 0d 0c 76 1e  20 20 20 20 20 20 7f 20  |Menu..v.      . |
00003070  3a 20 f4 20 53 65 6c 65  63 74 2c 20 41 64 6a 75  |: . Select, Adju|
00003080  73 74 0d 0c 80 15 20 20  20 20 20 20 20 20 c8 8e  |st....        ..|
00003090  20 49 63 6f 6e 20 ca 0d  0c 8a 1d 20 20 20 20 20  | Icon .....     |
000030a0  20 20 20 20 20 c9 20 33  3a f4 20 47 72 61 62 20  |     . 3:. Grab |
000030b0  74 65 78 74 0d 0c 94 1d  20 20 20 20 20 20 20 20  |text....        |
000030c0  20 20 20 20 e7 20 42 75  74 74 6f 6e 73 3c 38 20  |    . Buttons<8 |
000030d0  8c 0d 0c 9e 32 20 20 20  20 20 20 20 20 20 20 20  |....2           |
000030e0  20 20 20 c8 99 20 22 49  6e 74 65 72 66 61 63 65  |   .. "Interface|
000030f0  5f 53 6c 61 62 42 75 74  74 6f 6e 22 2c 2c 42 6c  |_SlabButton",,Bl|
00003100  6f 63 6b 0d 0c a8 20 20  20 20 20 20 20 20 20 20  |ock...          |
00003110  20 20 20 20 20 f2 47 72  61 62 54 65 78 74 53 74  |     .GrabTextSt|
00003120  61 72 74 0d 0c b2 55 20  20 20 20 20 20 20 20 20  |art...U         |
00003130  20 20 20 20 20 42 6c 6f  63 6b 21 38 3d 30 3a 42  |     Block!8=0:B|
00003140  6c 6f 63 6b 21 31 32 3d  47 72 61 62 3a 42 6c 6f  |lock!12=Grab:Blo|
00003150  63 6b 21 31 36 3d 33 3a  c8 99 20 22 49 6e 74 65  |ck!16=3:.. "Inte|
00003160  72 66 61 63 65 5f 53 6c  61 62 42 75 74 74 6f 6e  |rface_SlabButton|
00003170  22 2c 2c 42 6c 6f 63 6b  0d 0c bc 11 20 20 20 20  |",,Block....    |
00003180  20 20 20 20 20 20 20 20  cd 0d 0c c6 1f 20 20 20  |        .....   |
00003190  20 20 20 20 20 20 20 c9  20 34 3a f4 20 45 78 70  |       . 4:. Exp|
000031a0  6f 72 74 20 74 65 78 74  0d 0c d0 32 20 20 20 20  |ort text...2    |
000031b0  20 20 20 20 20 20 20 20  e7 20 28 42 75 74 74 6f  |        . (Butto|
000031c0  6e 73 3c 38 29 20 80 20  28 42 75 66 66 65 72 4c  |ns<8) . (BufferL|
000031d0  65 6e 67 74 68 3e 30 29  20 8c 0d 0c da 32 20 20  |ength>0) ....2  |
000031e0  20 20 20 20 20 20 20 20  20 20 20 20 c8 99 20 22  |            .. "|
000031f0  49 6e 74 65 72 66 61 63  65 5f 53 6c 61 62 42 75  |Interface_SlabBu|
00003200  74 74 6f 6e 22 2c 2c 42  6c 6f 63 6b 0d 0c e4 2f  |tton",,Block.../|
00003210  20 20 20 20 20 20 20 20  20 20 20 20 20 20 e7 20  |              . |
00003220  42 75 74 74 6f 6e 73 3d  31 20 8c 20 50 6f 6b 65  |Buttons=1 . Poke|
00003230  3d b9 3a 8b 20 50 6f 6b  65 3d a3 0d 0c ee 24 20  |=.:. Poke=....$ |
00003240  20 20 20 20 20 20 20 20  20 20 20 20 20 f2 54 72  |             .Tr|
00003250  61 6e 73 66 65 72 54 65  78 74 53 74 61 72 74 0d  |ansferTextStart.|
00003260  0c f8 55 20 20 20 20 20  20 20 20 20 20 20 20 20  |..U             |
00003270  20 42 6c 6f 63 6b 21 38  3d 30 3a 42 6c 6f 63 6b  | Block!8=0:Block|
00003280  21 31 32 3d 47 72 61 62  3a 42 6c 6f 63 6b 21 31  |!12=Grab:Block!1|
00003290  36 3d 34 3a c8 99 20 22  49 6e 74 65 72 66 61 63  |6=4:.. "Interfac|
000032a0  65 5f 53 6c 61 62 42 75  74 74 6f 6e 22 2c 2c 42  |e_SlabButton",,B|
000032b0  6c 6f 63 6b 0d 0d 02 11  20 20 20 20 20 20 20 20  |lock....        |
000032c0  20 20 20 20 cd 0d 0d 0c  0d 20 20 20 20 20 20 20  |    .....       |
000032d0  20 cb 0d 0d 16 09 20 20  20 20 cb 0d 0d 20 30 20  | .....    ... 0 |
000032e0  20 c9 20 4c 6f 63 20 80  20 42 75 74 74 6f 6e 73  | . Loc . Buttons|
000032f0  3c 38 3a f4 20 52 65 70  6f 73 69 74 69 6f 6e 20  |<8:. Reposition |
00003300  6d 61 69 6e 20 77 69 6e  64 6f 77 0d 0d 2a 13 20  |main window..*. |
00003310  20 20 20 e7 20 49 63 6f  6e 3e 3d 36 20 8c 0d 0d  |   . Icon>=6 ...|
00003320  34 2c 20 20 20 20 20 20  58 50 6f 73 69 74 69 6f  |4,      XPositio|
00003330  6e 3d a4 52 65 61 64 57  69 6e 64 6f 77 4c 6f 63  |n=.ReadWindowLoc|
00003340  61 74 69 6f 6e 28 22 58  22 29 0d 0d 3e 2c 20 20  |ation("X")..>,  |
00003350  20 20 20 20 59 50 6f 73  69 74 69 6f 6e 3d a4 52  |    YPosition=.R|
00003360  65 61 64 57 69 6e 64 6f  77 4c 6f 63 61 74 69 6f  |eadWindowLocatio|
00003370  6e 28 22 59 22 29 0d 0d  48 40 20 20 20 20 20 20  |n("Y")..H@      |
00003380  e7 20 a4 4f 70 65 6e 53  74 61 74 65 28 47 72 61  |. .OpenState(Gra|
00003390  62 29 20 8c 20 f2 4f 70  65 6e 28 47 72 61 62 2c  |b) . .Open(Grab,|
000033a0  a3 2c 58 50 6f 73 69 74  69 6f 6e 2c 59 50 6f 73  |.,XPosition,YPos|
000033b0  69 74 69 6f 6e 29 0d 0d  52 09 20 20 20 20 cd 0d  |ition)..R.    ..|
000033c0  0d 5c 0c 20 20 c9 20 53  61 76 65 0d 0d 66 11 20  |.\.  . Save..f. |
000033d0  20 20 20 c8 8e 20 49 63  6f 6e 20 ca 0d 0d 70 19  |   .. Icon ...p.|
000033e0  20 20 20 20 20 20 c9 20  31 3a f4 20 46 69 6c 65  |      . 1:. File|
000033f0  20 69 63 6f 6e 0d 0d 7a  1a 20 20 20 20 20 20 20  | icon..z.       |
00003400  20 e7 20 42 75 74 74 6f  6e 73 3e 3d 38 20 8c 0d  | . Buttons>=8 ..|
00003410  0d 84 1d 20 20 20 20 20  20 20 20 20 20 e7 20 44  |...          . D|
00003420  72 61 67 41 53 70 72 69  74 65 20 8c 0d 0d 8e 4f  |ragASprite ....O|
00003430  20 20 20 20 20 20 20 20  20 20 20 20 f4 20 54 68  |            . Th|
00003440  65 20 66 6f 6c 6c 6f 77  69 6e 67 20 6c 69 6e 65  |e following line|
00003450  73 20 64 65 6c 65 74 65  20 74 68 65 20 66 69 6c  |s delete the fil|
00003460  65 20 69 63 6f 6e 20 66  72 6f 6d 20 74 68 65 20  |e icon from the |
00003470  73 61 76 65 20 77 69 6e  64 6f 77 0d 0d 98 4e 20  |save window...N |
00003480  20 20 20 20 20 20 20 20  20 20 20 f4 20 67 69 76  |           . giv|
00003490  69 6e 67 20 74 68 65 20  69 6d 70 72 65 73 73 69  |ing the impressi|
000034a0  6f 6e 20 74 68 61 74 20  79 6f 75 20 61 72 65 20  |on that you are |
000034b0  61 63 74 75 61 6c 6c 79  20 64 72 61 67 67 69 6e  |actually draggin|
000034c0  67 20 69 74 20 6f 75 74  2e 0d 0d a2 3a 20 20 20  |g it out....:   |
000034d0  20 20 20 20 20 20 20 20  20 f4 20 49 74 20 77 69  |         . It wi|
000034e0  6c 6c 20 62 65 20 72 65  70 6c 61 63 65 64 20 69  |ll be replaced i|
000034f0  6e 20 50 52 4f 43 44 72  61 67 46 69 6e 69 73 68  |n PROCDragFinish|
00003500  65 64 2e 0d 0d ac 44 20  20 20 20 20 20 20 20 20  |ed....D         |
00003510  20 20 20 42 6c 6f 63 6b  21 30 3d 53 61 76 65 3a  |   Block!0=Save:|
00003520  42 6c 6f 63 6b 21 34 3d  31 3a c8 99 20 22 57 69  |Block!4=1:.. "Wi|
00003530  6d 70 5f 47 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_GetIconState"|
00003540  2c 2c 42 6c 6f 63 6b 0d  0d b6 2c 20 20 20 20 20  |,,Block...,     |
00003550  20 20 20 20 20 20 20 53  61 76 65 42 6f 78 44 72  |       SaveBoxDr|
00003560  61 67 46 69 6c 65 24 3d  24 28 42 6c 6f 63 6b 21  |agFile$=$(Block!|
00003570  33 32 29 0d 0d c0 34 20  20 20 20 20 20 20 20 20  |32)...4         |
00003580  20 20 20 42 6c 6f 63 6b  21 38 3d 30 3a 42 6c 6f  |   Block!8=0:Blo|
00003590  63 6b 21 31 32 3d 30 3a  24 28 42 6c 6f 63 6b 21  |ck!12=0:$(Block!|
000035a0  33 32 29 3d bd 31 33 0d  0d ca 2d 20 20 20 20 20  |32)=.13...-     |
000035b0  20 20 20 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |       .. "Wimp_|
000035c0  53 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 42  |SetIconState",,B|
000035d0  6c 6f 63 6b 0d 0d d4 0f  20 20 20 20 20 20 20 20  |lock....        |
000035e0  20 20 cd 0d 0d de 2d 20  20 20 20 20 20 20 20 20  |  ....-         |
000035f0  20 f2 44 72 61 67 42 6f  78 28 53 61 76 65 2c 31  | .DragBox(Save,1|
00003600  2c 35 2c 31 2c 22 66 69  6c 65 5f 66 66 66 22 29  |,5,1,"file_fff")|
00003610  0d 0d e8 0d 20 20 20 20  20 20 20 20 cd 0d 0d f2  |....        ....|
00003620  17 20 20 20 20 20 20 c9  20 33 3a f4 20 4f 4b 20  |.      . 3:. OK |
00003630  69 63 6f 6e 0d 0d fc 2a  20 20 20 20 20 20 20 20  |icon...*        |
00003640  e7 20 28 42 75 74 74 6f  6e 73 3c 38 29 20 80 20  |. (Buttons<8) . |
00003650  28 42 75 74 74 6f 6e 73  3c 3e 32 29 20 8c 0d 0e  |(Buttons<>2) ...|
00003660  06 2e 20 20 20 20 20 20  20 20 20 20 c8 99 20 22  |..          .. "|
00003670  49 6e 74 65 72 66 61 63  65 5f 53 6c 61 62 42 75  |Interface_SlabBu|
00003680  74 74 6f 6e 22 2c 2c 42  6c 6f 63 6b 0d 0e 10 35  |tton",,Block...5|
00003690  20 20 20 20 20 20 20 20  20 20 e7 20 42 75 74 74  |          . Butt|
000036a0  6f 6e 73 3c 3e 31 20 8c  20 c8 99 20 22 57 69 6d  |ons<>1 . .. "Wim|
000036b0  70 5f 43 72 65 61 74 65  4d 65 6e 75 22 2c 2c 2d  |p_CreateMenu",,-|
000036c0  31 0d 0e 1a 3c 20 20 20  20 20 20 20 20 20 20 41  |1...<          A|
000036d0  24 3d a4 52 65 61 64 49  63 6f 6e 53 74 72 28 53  |$=.ReadIconStr(S|
000036e0  61 76 65 2c 32 29 3a e7  20 41 24 3d 22 22 20 8c  |ave,2):. A$="" .|
000036f0  20 41 24 3d 22 47 72 61  62 62 65 64 22 0d 0e 24  | A$="Grabbed"..$|
00003700  24 20 20 20 20 20 20 20  20 20 20 f2 55 70 64 61  |$          .Upda|
00003710  74 65 49 63 6f 6e 28 53  61 76 65 2c 32 2c 41 24  |teIcon(Save,2,A$|
00003720  29 0d 0e 2e 98 20 20 20  20 20 20 20 20 20 20 e7  |)....          .|
00003730  20 a7 41 24 2c 22 2e 22  29 3d 30 20 8c 20 42 6c  | .A$,".")=0 . Bl|
00003740  6f 63 6b 21 38 3d 30 3a  42 6c 6f 63 6b 21 31 32  |ock!8=0:Block!12|
00003750  3d 53 61 76 65 3a 42 6c  6f 63 6b 21 31 36 3d 33  |=Save:Block!16=3|
00003760  3a c8 99 20 22 49 6e 74  65 72 66 61 63 65 5f 53  |:.. "Interface_S|
00003770  6c 61 62 42 75 74 74 6f  6e 22 2c 2c 42 6c 6f 63  |labButton",,Bloc|
00003780  6b 3a 85 20 39 39 39 39  2c 22 54 6f 20 73 61 76  |k:. 9999,"To sav|
00003790  65 2c 20 64 72 61 67 20  74 68 65 20 69 63 6f 6e  |e, drag the icon|
000037a0  20 74 6f 20 61 20 64 69  72 65 63 74 6f 72 79 20  | to a directory |
000037b0  64 69 73 70 6c 61 79 2e  22 0d 0e 38 b2 20 20 20  |display."..8.   |
000037c0  20 20 20 20 20 20 20 e7  20 ac 20 a4 53 61 76 65  |       . . .Save|
000037d0  47 72 61 62 62 65 64 54  6f 46 69 6c 65 28 41 24  |GrabbedToFile(A$|
000037e0  29 20 8c 20 f2 44 65 6c  65 74 65 57 69 6d 70 53  |) . .DeleteWimpS|
000037f0  63 72 61 70 3a 42 6c 6f  63 6b 21 38 3d 30 3a 42  |crap:Block!8=0:B|
00003800  6c 6f 63 6b 21 31 32 3d  53 61 76 65 3a 42 6c 6f  |lock!12=Save:Blo|
00003810  63 6b 21 31 36 3d 33 3a  c8 99 20 22 49 6e 74 65  |ck!16=3:.. "Inte|
00003820  72 66 61 63 65 5f 53 6c  61 62 42 75 74 74 6f 6e  |rface_SlabButton|
00003830  22 2c 2c 42 6c 6f 63 6b  3a 85 20 39 39 39 39 2c  |",,Block:. 9999,|
00003840  22 41 6e 20 65 72 72 6f  72 20 6f 63 63 75 72 72  |"An error occurr|
00003850  65 64 20 77 68 69 6c 73  74 20 73 61 76 69 6e 67  |ed whilst saving|
00003860  20 74 68 65 20 66 69 6c  65 2e 22 0d 0e 42 51 20  | the file."..BQ |
00003870  20 20 20 20 20 20 20 20  20 42 6c 6f 63 6b 21 38  |         Block!8|
00003880  3d 30 3a 42 6c 6f 63 6b  21 31 32 3d 53 61 76 65  |=0:Block!12=Save|
00003890  3a 42 6c 6f 63 6b 21 31  36 3d 33 3a c8 99 20 22  |:Block!16=3:.. "|
000038a0  49 6e 74 65 72 66 61 63  65 5f 53 6c 61 62 42 75  |Interface_SlabBu|
000038b0  74 74 6f 6e 22 2c 2c 42  6c 6f 63 6b 0d 0e 4c 0d  |tton",,Block..L.|
000038c0  20 20 20 20 20 20 20 20  cd 0d 0e 56 09 20 20 20  |        ...V.   |
000038d0  20 cb 0d 0e 60 05 cb 0d  0e 6a 05 e1 0d 0e 74 05  | ...`....j....t.|
000038e0  3a 0d 0e 7e 13 dd 20 f2  44 72 61 67 46 69 6e 69  |:..~.. .DragFini|
000038f0  73 68 65 64 0d 0e 88 13  e7 20 44 72 61 67 41 53  |shed..... DragAS|
00003900  70 72 69 74 65 20 8c 0d  0e 92 1b 20 20 c8 99 20  |prite .....  .. |
00003910  22 44 72 61 67 41 53 70  72 69 74 65 5f 53 74 6f  |"DragASprite_Sto|
00003920  70 22 0d 0e 9c 3f 20 20  f4 20 54 68 65 20 66 6f  |p"...?  . The fo|
00003930  6c 6c 6f 77 69 6e 67 20  6c 69 6e 65 73 20 72 65  |llowing lines re|
00003940  70 6c 61 63 65 20 74 68  65 20 73 70 72 69 74 65  |place the sprite|
00003950  20 69 6e 20 74 68 65 20  73 61 76 65 20 62 6f 78  | in the save box|
00003960  2e 0d 0e a6 3a 20 20 42  6c 6f 63 6b 21 30 3d 53  |....:  Block!0=S|
00003970  61 76 65 3a 42 6c 6f 63  6b 21 34 3d 31 3a c8 99  |ave:Block!4=1:..|
00003980  20 22 57 69 6d 70 5f 47  65 74 49 63 6f 6e 53 74  | "Wimp_GetIconSt|
00003990  61 74 65 22 2c 2c 42 6c  6f 63 6b 0d 0e b0 37 20  |ate",,Block...7 |
000039a0  20 42 6c 6f 63 6b 21 38  3d 30 3a 42 6c 6f 63 6b  | Block!8=0:Block|
000039b0  21 31 32 3d 30 3a 24 28  42 6c 6f 63 6b 21 33 32  |!12=0:$(Block!32|
000039c0  29 3d 53 61 76 65 42 6f  78 44 72 61 67 46 69 6c  |)=SaveBoxDragFil|
000039d0  65 24 0d 0e ba 23 20 20  c8 99 20 22 57 69 6d 70  |e$...#  .. "Wimp|
000039e0  5f 53 65 74 49 63 6f 6e  53 74 61 74 65 22 2c 2c  |_SetIconState",,|
000039f0  42 6c 6f 63 6b 0d 0e c4  05 cd 0d 0e ce 23 c8 99  |Block........#..|
00003a00  20 22 57 69 6d 70 5f 47  65 74 50 6f 69 6e 74 65  | "Wimp_GetPointe|
00003a10  72 49 6e 66 6f 22 2c 2c  42 6c 6f 63 6b 0d 0e d8  |rInfo",,Block...|
00003a20  2e e7 20 42 6c 6f 63 6b  21 31 32 3d 2d 31 20 8c  |.. Block!12=-1 .|
00003a30  20 e1 3a f4 20 44 72 61  67 67 65 64 20 74 6f 20  | .:. Dragged to |
00003a40  62 61 63 6b 67 72 6f 75  6e 64 2e 0d 0e e2 59 44  |background....YD|
00003a50  72 61 67 67 65 64 54 6f  58 3d 42 6c 6f 63 6b 21  |raggedToX=Block!|
00003a60  30 3a 44 72 61 67 67 65  64 54 6f 59 3d 42 6c 6f  |0:DraggedToY=Blo|
00003a70  63 6b 21 34 3a 44 72 61  67 67 65 64 54 6f 57 69  |ck!4:DraggedToWi|
00003a80  6e 64 6f 77 3d 42 6c 6f  63 6b 21 31 32 3a 44 72  |ndow=Block!12:Dr|
00003a90  61 67 67 65 64 54 6f 49  63 6f 6e 3d 42 6c 6f 63  |aggedToIcon=Bloc|
00003aa0  6b 21 31 36 0d 0e ec 25  f4 20 46 69 6e 64 20 6f  |k!16...%. Find o|
00003ab0  75 74 20 6c 65 61 66 20  6e 61 6d 65 20 69 6e 20  |ut leaf name in |
00003ac0  73 61 76 65 20 62 6f 78  3a 0d 0e f6 33 44 72 61  |save box:...3Dra|
00003ad0  67 67 69 6e 67 24 3d a4  52 65 61 64 49 63 6f 6e  |gging$=.ReadIcon|
00003ae0  53 74 72 28 53 61 76 65  2c 32 29 3a 6c 65 6e 3d  |Str(Save,2):len=|
00003af0  a9 28 44 72 61 67 67 69  6e 67 24 29 0d 0f 00 3e  |.(Dragging$)...>|
00003b00  4e 3d 2d 31 3a f5 3a 4e  2b 3d 31 3a fd 20 28 c1  |N=-1:.:N+=1:. (.|
00003b10  44 72 61 67 67 69 6e 67  24 2c a9 28 44 72 61 67  |Dragging$,.(Drag|
00003b20  67 69 6e 67 24 29 2d 4e  2c 31 29 3d 22 2e 22 29  |ging$)-N,1)=".")|
00003b30  20 84 20 28 4e 3d 6c 65  6e 29 0d 0f 0a 25 e7 20  | . (N=len)...%. |
00003b40  4e 3c 6c 65 6e 20 8c 20  44 72 61 67 67 69 6e 67  |N<len . Dragging|
00003b50  24 3d c2 44 72 61 67 67  69 6e 67 24 2c 4e 29 0d  |$=.Dragging$,N).|
00003b60  0f 14 46 e7 20 44 72 61  67 67 69 6e 67 24 3d 22  |..F. Dragging$="|
00003b70  22 20 8c 20 44 72 61 67  67 69 6e 67 24 3d 22 47  |" . Dragging$="G|
00003b80  72 61 62 62 65 64 22 3a  f2 55 70 64 61 74 65 49  |rabbed":.UpdateI|
00003b90  63 6f 6e 28 53 61 76 65  2c 32 2c 44 72 61 67 67  |con(Save,2,Dragg|
00003ba0  69 6e 67 24 29 0d 0f 1e  30 f4 20 4f 4b 20 2d 20  |ing$)...0. OK - |
00003bb0  4c 65 74 27 73 20 62 65  67 69 6e 20 61 6e 20 69  |Let's begin an i|
00003bc0  6e 74 65 72 2d 61 70 70  6c 69 63 61 74 69 6f 6e  |nter-application|
00003bd0  20 73 61 76 65 0d 0f 28  0b 4d 79 52 65 66 3d 30  | save..(.MyRef=0|
00003be0  0d 0f 32 34 42 6c 6f 63  6b 21 30 3d 32 35 36 3a  |..24Block!0=256:|
00003bf0  42 6c 6f 63 6b 21 31 32  3d 4d 79 52 65 66 3a 42  |Block!12=MyRef:B|
00003c00  6c 6f 63 6b 21 31 36 3d  31 3a f4 20 44 61 74 61  |lock!16=1:. Data|
00003c10  53 61 76 65 0d 0f 3c 5b  42 6c 6f 63 6b 21 32 30  |Save..<[Block!20|
00003c20  3d 44 72 61 67 67 65 64  54 6f 57 69 6e 64 6f 77  |=DraggedToWindow|
00003c30  3a 42 6c 6f 63 6b 21 32  34 3d 44 72 61 67 67 65  |:Block!24=Dragge|
00003c40  64 54 6f 49 63 6f 6e 3a  42 6c 6f 63 6b 21 32 38  |dToIcon:Block!28|
00003c50  3d 44 72 61 67 67 65 64  54 6f 58 3a 42 6c 6f 63  |=DraggedToX:Bloc|
00003c60  6b 21 33 32 3d 44 72 61  67 67 65 64 54 6f 59 0d  |k!32=DraggedToY.|
00003c70  0f 46 19 42 6c 6f 63 6b  21 33 36 3d 42 75 66 66  |.F.Block!36=Buff|
00003c80  65 72 4c 65 6e 67 74 68  0d 0f 50 24 42 6c 6f 63  |erLength..P$Bloc|
00003c90  6b 21 34 30 3d 26 46 46  46 3a f4 20 46 69 6c 65  |k!40=&FFF:. File|
00003ca0  74 79 70 65 20 6f 66 20  54 65 78 74 0d 0f 5a 1c  |type of Text..Z.|
00003cb0  24 28 42 6c 6f 63 6b 2b  34 34 29 3d 44 72 61 67  |$(Block+44)=Drag|
00003cc0  67 69 6e 67 24 2b bd 30  0d 0f 64 4d c8 99 20 22  |ging$+.0..dM.. "|
00003cd0  57 69 6d 70 5f 53 65 6e  64 4d 65 73 73 61 67 65  |Wimp_SendMessage|
00003ce0  22 2c 31 37 2c 42 6c 6f  63 6b 2c 44 72 61 67 67  |",17,Block,Dragg|
00003cf0  65 64 54 6f 57 69 6e 64  6f 77 2c 44 72 61 67 67  |edToWindow,Dragg|
00003d00  65 64 54 6f 49 63 6f 6e  20 b8 20 2c 2c 44 65 73  |edToIcon . ,,Des|
00003d10  74 54 61 73 6b 0d 0f 6e  42 f4 20 44 72 61 67 67  |tTask..nB. Dragg|
00003d20  65 64 54 6f 49 63 6f 6e  20 69 6e 63 6c 75 64 65  |edToIcon include|
00003d30  64 20 69 6e 20 63 61 73  65 20 44 72 61 67 67 65  |d in case Dragge|
00003d40  64 54 6f 57 69 6e 64 6f  77 3d 2d 32 20 28 69 63  |dToWindow=-2 (ic|
00003d50  6f 6e 20 62 61 72 29 0d  0f 78 21 54 72 61 6e 73  |on bar)..x!Trans|
00003d60  6d 69 74 3d b9 3a 54 72  61 6e 73 6d 69 74 74 65  |mit=.:Transmitte|
00003d70  64 42 79 74 65 73 3d 30  0d 0f 82 05 e1 0d 0f 8c  |dBytes=0........|
00003d80  05 3a 0d 0f 96 11 dd 20  f2 4b 65 79 50 72 65 73  |.:..... .KeyPres|
00003d90  73 65 64 0d 0f a0 32 57  69 6e 64 6f 77 3d 42 6c  |sed...2Window=Bl|
00003da0  6f 63 6b 21 30 3a 49 63  6f 6e 3d 42 6c 6f 63 6b  |ock!0:Icon=Block|
00003db0  21 34 3a 43 68 61 72 61  63 74 65 72 3d 42 6c 6f  |!4:Character=Blo|
00003dc0  63 6b 21 32 34 0d 0f aa  0f c8 8e 20 57 69 6e 64  |ck!24...... Wind|
00003dd0  6f 77 20 ca 0d 0f b4 0d  20 20 c9 20 53 61 76 65  |ow .....  . Save|
00003de0  3a 0d 0f be 18 20 20 20  20 e7 20 43 68 61 72 61  |:....    . Chara|
00003df0  63 74 65 72 3d 31 33 20  8c 0d 0f c8 4d 20 20 20  |cter=13 ....M   |
00003e00  20 20 20 42 6c 6f 63 6b  21 38 3d 34 3a 42 6c 6f  |   Block!8=4:Blo|
00003e10  63 6b 21 31 32 3d 53 61  76 65 3a 42 6c 6f 63 6b  |ck!12=Save:Block|
00003e20  21 31 36 3d 33 3a c8 99  20 22 49 6e 74 65 72 66  |!16=3:.. "Interf|
00003e30  61 63 65 5f 53 6c 61 62  42 75 74 74 6f 6e 22 2c  |ace_SlabButton",|
00003e40  2c 42 6c 6f 63 6b 0d 0f  d2 38 20 20 20 20 20 20  |,Block...8      |
00003e50  41 24 3d a4 52 65 61 64  49 63 6f 6e 53 74 72 28  |A$=.ReadIconStr(|
00003e60  53 61 76 65 2c 32 29 3a  e7 20 41 24 3d 22 22 20  |Save,2):. A$="" |
00003e70  8c 20 41 24 3d 22 47 72  61 62 62 65 64 22 0d 0f  |. A$="Grabbed"..|
00003e80  dc 20 20 20 20 20 20 20  f2 55 70 64 61 74 65 49  |.       .UpdateI|
00003e90  63 6f 6e 28 53 61 76 65  2c 32 2c 41 24 29 0d 0f  |con(Save,2,A$)..|
00003ea0  e6 94 20 20 20 20 20 20  e7 20 a7 41 24 2c 22 2e  |..      . .A$,".|
00003eb0  22 29 3d 30 20 8c 20 42  6c 6f 63 6b 21 38 3d 30  |")=0 . Block!8=0|
00003ec0  3a 42 6c 6f 63 6b 21 31  32 3d 53 61 76 65 3a 42  |:Block!12=Save:B|
00003ed0  6c 6f 63 6b 21 31 36 3d  33 3a c8 99 20 22 49 6e  |lock!16=3:.. "In|
00003ee0  74 65 72 66 61 63 65 5f  53 6c 61 62 42 75 74 74  |terface_SlabButt|
00003ef0  6f 6e 22 2c 2c 42 6c 6f  63 6b 3a 85 20 39 39 39  |on",,Block:. 999|
00003f00  39 2c 22 54 6f 20 73 61  76 65 2c 20 64 72 61 67  |9,"To save, drag|
00003f10  20 74 68 65 20 69 63 6f  6e 20 74 6f 20 61 20 64  | the icon to a d|
00003f20  69 72 65 63 74 6f 72 79  20 64 69 73 70 6c 61 79  |irectory display|
00003f30  2e 22 0d 0f f0 ae 20 20  20 20 20 20 e7 20 ac 20  |."....      . . |
00003f40  a4 53 61 76 65 47 72 61  62 62 65 64 54 6f 46 69  |.SaveGrabbedToFi|
00003f50  6c 65 28 41 24 29 20 8c  20 f2 44 65 6c 65 74 65  |le(A$) . .Delete|
00003f60  57 69 6d 70 53 63 72 61  70 3a 42 6c 6f 63 6b 21  |WimpScrap:Block!|
00003f70  38 3d 30 3a 42 6c 6f 63  6b 21 31 32 3d 53 61 76  |8=0:Block!12=Sav|
00003f80  65 3a 42 6c 6f 63 6b 21  31 36 3d 33 3a c8 99 20  |e:Block!16=3:.. |
00003f90  22 49 6e 74 65 72 66 61  63 65 5f 53 6c 61 62 42  |"Interface_SlabB|
00003fa0  75 74 74 6f 6e 22 2c 2c  42 6c 6f 63 6b 3a 85 20  |utton",,Block:. |
00003fb0  39 39 39 39 2c 22 41 6e  20 65 72 72 6f 72 20 6f  |9999,"An error o|
00003fc0  63 63 75 72 72 65 64 20  77 68 69 6c 73 74 20 73  |ccurred whilst s|
00003fd0  61 76 69 6e 67 20 74 68  65 20 66 69 6c 65 2e 22  |aving the file."|
00003fe0  0d 0f fa 4d 20 20 20 20  20 20 42 6c 6f 63 6b 21  |...M      Block!|
00003ff0  38 3d 30 3a 42 6c 6f 63  6b 21 31 32 3d 53 61 76  |8=0:Block!12=Sav|
00004000  65 3a 42 6c 6f 63 6b 21  31 36 3d 33 3a c8 99 20  |e:Block!16=3:.. |
00004010  22 49 6e 74 65 72 66 61  63 65 5f 53 6c 61 62 42  |"Interface_SlabB|
00004020  75 74 74 6f 6e 22 2c 2c  42 6c 6f 63 6b 0d 10 04  |utton",,Block...|
00004030  22 20 20 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |"      .. "Wimp_|
00004040  43 72 65 61 74 65 4d 65  6e 75 22 2c 2c 2d 31 0d  |CreateMenu",,-1.|
00004050  10 0e 09 20 20 20 20 cc  0d 10 18 28 20 20 20 20  |...    ....(    |
00004060  20 20 c8 99 20 22 57 69  6d 70 5f 50 72 6f 63 65  |  .. "Wimp_Proce|
00004070  73 73 4b 65 79 22 2c 43  68 61 72 61 63 74 65 72  |ssKey",Character|
00004080  0d 10 22 09 20 20 20 20  cd 0d 10 2c 07 20 20 7f  |..".    ...,.  .|
00004090  0d 10 36 16 20 20 20 20  c8 8e 20 43 68 61 72 61  |..6.    .. Chara|
000040a0  63 74 65 72 20 ca 0d 10  40 34 20 20 20 20 20 20  |cter ...@4      |
000040b0  c9 20 26 31 41 42 3a f4  20 3c 43 74 72 6c 2d 43  |. &1AB:. <Ctrl-C|
000040c0  6f 70 79 3e 3a 20 47 72  61 62 20 74 65 78 74 20  |opy>: Grab text |
000040d0  61 74 20 70 6f 69 6e 74  65 72 0d 10 4a 15 20 20  |at pointer..J.  |
000040e0  20 20 20 20 20 20 f2 47  72 61 62 54 65 78 74 0d  |      .GrabText.|
000040f0  10 54 2d 20 20 20 20 20  20 20 20 f2 4f 70 65 6e  |.T-        .Open|
00004100  28 47 72 61 62 2c b9 2c  58 50 6f 73 69 74 69 6f  |(Grab,.,XPositio|
00004110  6e 2c 59 50 6f 73 69 74  69 6f 6e 29 0d 10 5e 4c  |n,YPosition)..^L|
00004120  20 20 20 20 20 20 c9 20  26 31 42 42 3a f4 20 3c  |      . &1BB:. <|
00004130  43 74 72 6c 2d 53 68 69  66 74 2d 43 6f 70 79 3e  |Ctrl-Shift-Copy>|
00004140  3a 20 53 65 6e 64 20 74  65 78 74 20 61 74 20 70  |: Send text at p|
00004150  6f 69 6e 74 65 72 20 73  74 72 61 69 67 68 74 20  |ointer straight |
00004160  74 6f 20 63 61 72 65 74  0d 10 68 3d 20 20 20 20  |to caret..h=    |
00004170  20 20 20 20 f2 47 72 61  62 54 65 78 74 3a e7 20  |    .GrabText:. |
00004180  42 75 66 66 65 72 4c 65  6e 67 74 68 3e 30 20 8c  |BufferLength>0 .|
00004190  20 50 6f 6b 65 3d a3 3a  f2 54 72 61 6e 73 66 65  | Poke=.:.Transfe|
000041a0  72 54 65 78 74 0d 10 72  46 20 20 20 20 20 20 c9  |rText..rF      .|
000041b0  20 26 31 45 44 3a f4 20  3c 43 74 72 6c 2d 49 6e  | &1ED:. <Ctrl-In|
000041c0  73 65 72 74 3e 2c 20 54  72 61 6e 73 66 65 72 20  |sert>, Transfer |
000041d0  74 65 78 74 20 74 6f 20  70 6f 69 6e 74 65 72 20  |text to pointer |
000041e0  69 63 6f 6e 20 28 70 6f  6b 65 29 0d 10 7c 33 20  |icon (poke)..|3 |
000041f0  20 20 20 20 20 20 20 e7  20 42 75 66 66 65 72 4c  |       . BufferL|
00004200  65 6e 67 74 68 3e 30 20  8c 20 50 6f 6b 65 3d b9  |ength>0 . Poke=.|
00004210  3a f2 54 72 61 6e 73 66  65 72 54 65 78 74 0d 10  |:.TransferText..|
00004220  86 48 20 20 20 20 20 20  c9 20 26 31 46 44 3a f4  |.H      . &1FD:.|
00004230  20 3c 43 74 72 6c 2d 53  68 69 66 74 2d 49 6e 73  | <Ctrl-Shift-Ins|
00004240  65 72 74 3e 2c 20 54 72  61 6e 73 66 65 72 20 74  |ert>, Transfer t|
00004250  65 78 74 20 74 6f 20 63  61 72 65 74 20 28 6e 6f  |ext to caret (no|
00004260  20 70 6f 6b 65 29 0d 10  90 33 20 20 20 20 20 20  | poke)...3      |
00004270  20 20 e7 20 42 75 66 66  65 72 4c 65 6e 67 74 68  |  . BufferLength|
00004280  3e 30 20 8c 20 50 6f 6b  65 3d a3 3a f2 54 72 61  |>0 . Poke=.:.Tra|
00004290  6e 73 66 65 72 54 65 78  74 0d 10 9a 09 20 20 20  |nsferText....   |
000042a0  20 7f 0d 10 a4 28 20 20  20 20 20 20 c8 99 20 22  | ....(      .. "|
000042b0  57 69 6d 70 5f 50 72 6f  63 65 73 73 4b 65 79 22  |Wimp_ProcessKey"|
000042c0  2c 43 68 61 72 61 63 74  65 72 0d 10 ae 09 20 20  |,Character....  |
000042d0  20 20 cb 0d 10 b8 05 cb  0d 10 c2 05 e1 0d 10 cc  |  ..............|
000042e0  05 3a 0d 10 d6 11 dd 20  f2 44 65 63 6f 64 65 4d  |.:..... .DecodeM|
000042f0  65 6e 75 0d 10 e0 2a 53  75 62 30 3d 42 6c 6f 63  |enu...*Sub0=Bloc|
00004300  6b 21 30 3a 53 75 62 31  3d 42 6c 6f 63 6b 21 34  |k!0:Sub1=Block!4|
00004310  3a 53 75 62 32 3d 42 6c  6f 63 6b 21 38 0d 10 ea  |:Sub2=Block!8...|
00004320  0f 43 6c 6f 73 65 4d 65  6e 75 3d a3 0d 10 f4 0b  |.CloseMenu=.....|
00004330  c8 8e 20 4d 25 20 ca 0d  10 fe 0f 20 20 c9 20 49  |.. M% .....  . I|
00004340  42 4d 65 6e 75 3a 0d 11  08 11 20 20 20 20 c8 8e  |BMenu:....    ..|
00004350  20 53 75 62 30 20 ca 0d  11 12 0d 20 20 20 20 20  | Sub0 .....     |
00004360  20 c9 20 30 0d 11 1c 2b  20 20 20 20 20 20 20 20  | . 0...+        |
00004370  c8 99 20 22 57 69 6d 70  5f 47 65 74 50 6f 69 6e  |.. "Wimp_GetPoin|
00004380  74 65 72 49 6e 66 6f 22  2c 2c 42 6c 6f 63 6b 0d  |terInfo",,Block.|
00004390  11 26 3c 20 20 20 20 20  20 20 20 c8 99 20 22 57  |.&<        .. "W|
000043a0  69 6d 70 5f 43 72 65 61  74 65 4d 65 6e 75 22 2c  |imp_CreateMenu",|
000043b0  2c 49 6e 66 6f 2c 42 6c  6f 63 6b 21 30 2d 32 34  |,Info,Block!0-24|
000043c0  2c 42 6c 6f 63 6b 21 34  2b 32 34 0d 11 30 17 20  |,Block!4+24..0. |
000043d0  20 20 20 20 20 20 20 43  6c 6f 73 65 4d 65 6e 75  |       CloseMenu|
000043e0  3d b9 0d 11 3a 0d 20 20  20 20 20 20 c9 20 31 0d  |=...:.      . 1.|
000043f0  11 44 12 20 20 20 20 20  20 20 20 44 6f 6e 65 3d  |.D.        Done=|
00004400  b9 0d 11 4e 09 20 20 20  20 cb 0d 11 58 11 20 20  |...N.    ...X.  |
00004410  c9 20 4d 61 69 6e 4d 65  6e 75 3a 0d 11 62 11 20  |. MainMenu:..b. |
00004420  20 20 20 c8 8e 20 53 75  62 30 20 ca 0d 11 6c 0d  |   .. Sub0 ...l.|
00004430  20 20 20 20 20 20 c9 20  30 0d 11 76 2b 20 20 20  |      . 0..v+   |
00004440  20 20 20 20 20 c8 99 20  22 57 69 6d 70 5f 47 65  |     .. "Wimp_Ge|
00004450  74 50 6f 69 6e 74 65 72  49 6e 66 6f 22 2c 2c 42  |tPointerInfo",,B|
00004460  6c 6f 63 6b 0d 11 80 3c  20 20 20 20 20 20 20 20  |lock...<        |
00004470  c8 99 20 22 57 69 6d 70  5f 43 72 65 61 74 65 4d  |.. "Wimp_CreateM|
00004480  65 6e 75 22 2c 2c 49 6e  66 6f 2c 42 6c 6f 63 6b  |enu",,Info,Block|
00004490  21 30 2d 32 34 2c 42 6c  6f 63 6b 21 34 2b 32 34  |!0-24,Block!4+24|
000044a0  0d 11 8a 17 20 20 20 20  20 20 20 20 43 6c 6f 73  |....        Clos|
000044b0  65 4d 65 6e 75 3d b9 0d  11 94 0d 20 20 20 20 20  |eMenu=.....     |
000044c0  20 c9 20 31 0d 11 9e 19  20 20 20 20 20 20 20 20  | . 1....        |
000044d0  f2 52 65 73 65 74 47 72  61 62 62 65 72 0d 11 a8  |.ResetGrabber...|
000044e0  0d 20 20 20 20 20 20 c9  20 32 0d 11 b2 16 20 20  |.      . 2....  |
000044f0  20 20 20 20 20 20 e7 20  54 79 70 69 6e 67 20 8c  |      . Typing .|
00004500  0d 11 bc 2e 20 20 20 20  20 20 20 20 20 20 f2 54  |....          .T|
00004510  69 63 6b 4d 65 6e 75 28  4d 61 69 6e 4d 65 6e 75  |ickMenu(MainMenu|
00004520  2c 32 2c a3 29 3a 54 79  70 69 6e 67 3d a3 0d 11  |,2,.):Typing=...|
00004530  c6 0d 20 20 20 20 20 20  20 20 cc 0d 11 d0 3c 20  |..        ....< |
00004540  20 20 20 20 20 20 20 20  20 f2 54 69 63 6b 4d 65  |         .TickMe|
00004550  6e 75 28 4d 61 69 6e 4d  65 6e 75 2c 32 2c b9 29  |nu(MainMenu,2,.)|
00004560  3a 54 79 70 69 6e 67 3d  b9 3a 54 79 70 65 43 6f  |:Typing=.:TypeCo|
00004570  75 6e 74 65 72 3d 30 0d  11 da 0d 20 20 20 20 20  |unter=0....     |
00004580  20 20 20 cd 0d 11 e4 0d  20 20 20 20 20 20 c9 20  |   .....      . |
00004590  33 0d 11 ee 2b 20 20 20  20 20 20 20 20 c8 99 20  |3...+        .. |
000045a0  22 57 69 6d 70 5f 47 65  74 50 6f 69 6e 74 65 72  |"Wimp_GetPointer|
000045b0  49 6e 66 6f 22 2c 2c 42  6c 6f 63 6b 0d 11 f8 3b  |Info",,Block...;|
000045c0  20 20 20 20 20 20 20 20  c8 99 20 22 57 69 6d 70  |        .. "Wimp|
000045d0  5f 43 72 65 61 74 65 4d  65 6e 75 22 2c 2c 4c 6f  |_CreateMenu",,Lo|
000045e0  63 2c 42 6c 6f 63 6b 21  30 2d 32 34 2c 42 6c 6f  |c,Block!0-24,Blo|
000045f0  63 6b 21 34 2b 32 34 0d  12 02 17 20 20 20 20 20  |ck!4+24....     |
00004600  20 20 20 43 6c 6f 73 65  4d 65 6e 75 3d b9 0d 12  |   CloseMenu=...|
00004610  0c 0d 20 20 20 20 20 20  c9 20 34 0d 12 16 2b 20  |..      . 4...+ |
00004620  20 20 20 20 20 20 20 c8  99 20 22 57 69 6d 70 5f  |       .. "Wimp_|
00004630  47 65 74 50 6f 69 6e 74  65 72 49 6e 66 6f 22 2c  |GetPointerInfo",|
00004640  2c 42 6c 6f 63 6b 0d 12  20 3d 20 20 20 20 20 20  |,Block.. =      |
00004650  20 20 c8 99 20 22 57 69  6d 70 5f 43 72 65 61 74  |  .. "Wimp_Creat|
00004660  65 4d 65 6e 75 22 2c 2c  53 61 76 65 2c 42 6c 6f  |eMenu",,Save,Blo|
00004670  63 6b 21 30 2d 31 34 36  2c 42 6c 6f 63 6b 21 34  |ck!0-146,Block!4|
00004680  2b 36 30 0d 12 2a 17 20  20 20 20 20 20 20 20 43  |+60..*.        C|
00004690  6c 6f 73 65 4d 65 6e 75  3d b9 0d 12 34 0d 20 20  |loseMenu=...4.  |
000046a0  20 20 20 20 c9 20 35 0d  12 3e 5c 20 20 20 20 20  |    . 5..>\     |
000046b0  20 20 20 e7 20 ac 20 a4  53 61 76 65 53 65 74 74  |   . . .SaveSett|
000046c0  69 6e 67 73 20 8c 20 85  20 39 39 39 39 2c 22 41  |ings . . 9999,"A|
000046d0  6e 20 65 72 72 6f 72 20  6f 63 63 75 72 72 65 64  |n error occurred|
000046e0  20 77 68 69 6c 73 74 20  77 72 69 74 69 6e 67 20  | whilst writing |
000046f0  74 68 65 20 73 65 74 74  69 6e 67 73 20 66 69 6c  |the settings fil|
00004700  65 2e 22 0d 12 48 09 20  20 20 20 cb 0d 12 52 05  |e."..H.    ...R.|
00004710  cb 0d 12 5c 23 c8 99 20  22 57 69 6d 70 5f 47 65  |...\#.. "Wimp_Ge|
00004720  74 50 6f 69 6e 74 65 72  49 6e 66 6f 22 2c 2c 42  |tPointerInfo",,B|
00004730  6c 6f 63 6b 0d 12 66 33  e7 20 28 28 42 6c 6f 63  |lock..f3. ((Bloc|
00004740  6b 21 38 20 80 20 31 29  3d 31 29 20 80 20 28 ac  |k!8 . 1)=1) . (.|
00004750  20 43 6c 6f 73 65 4d 65  6e 75 29 20 8c 20 f2 4d  | CloseMenu) . .M|
00004760  61 6b 65 4d 65 6e 75 0d  12 70 05 e1 0d 12 7a 05  |akeMenu..p....z.|
00004770  3a 0d 12 84 4f f4 20 2d  2d 2d 2d 2d 2d 2d 2d 2d  |:...O. ---------|
00004780  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000047c0  0d 12 8e 13 f4 20 4d 65  6e 75 20 72 6f 75 74 69  |..... Menu routi|
000047d0  6e 65 73 0d 12 98 4f f4  20 2d 2d 2d 2d 2d 2d 2d  |nes...O. -------|
000047e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00004820  2d 2d 0d 12 a2 05 3a 0d  12 ac 11 dd 20 f2 42 75  |--....:..... .Bu|
00004830  69 6c 64 4d 65 6e 75 73  0d 12 b6 49 f4 20 54 68  |ildMenus...I. Th|
00004840  69 73 20 70 72 6f 63 65  64 75 72 65 20 73 68 6f  |is procedure sho|
00004850  75 6c 64 20 6f 6e 6c 79  20 62 65 20 76 69 73 69  |uld only be visi|
00004860  74 65 64 20 6f 6e 63 65  2c 20 73 69 6e 63 65 20  |ted once, since |
00004870  69 74 20 63 6f 6e 74 61  69 6e 73 20 44 49 4d 73  |it contains DIMs|
00004880  2e 0d 12 c0 07 20 20 3a  0d 12 ca 4f f4 20 49 6e  |.....  :...O. In|
00004890  20 74 68 65 20 6d 65 6e  75 20 74 69 74 6c 65 20  | the menu title |
000048a0  73 74 72 69 6e 67 73 20  62 65 6c 6f 77 2c 20 69  |strings below, i|
000048b0  66 20 61 20 22 7c 22 20  63 68 61 72 61 63 74 65  |f a "|" characte|
000048c0  72 20 69 73 20 70 72 65  73 65 6e 74 20 69 74 20  |r is present it |
000048d0  77 69 6c 6c 20 62 65 0d  12 d4 4f f4 20 72 65 70  |will be...O. rep|
000048e0  6c 61 63 65 64 20 62 79  20 61 20 73 70 61 63 65  |laced by a space|
000048f0  20 75 6e 64 65 72 20 52  49 53 43 20 4f 53 20 33  | under RISC OS 3|
00004900  2e 31 20 28 6f 72 20 67  72 65 61 74 65 72 29 2c  |.1 (or greater),|
00004910  20 6f 72 20 77 69 6c 6c  20 74 65 72 6d 69 6e 61  | or will termina|
00004920  74 65 20 74 68 65 0d 12  de 4f f4 20 73 74 72 69  |te the...O. stri|
00004930  6e 67 20 75 6e 64 65 72  20 65 61 72 6c 69 65 72  |ng under earlier|
00004940  20 76 65 72 73 69 6f 6e  73 20 6f 66 20 74 68 65  | versions of the|
00004950  20 77 69 6d 70 2e 20 54  68 69 73 20 61 6c 6c 6f  | wimp. This allo|
00004960  77 73 20 74 68 65 20 6e  65 77 20 69 6e 64 69 72  |ws the new indir|
00004970  65 63 74 65 64 0d 12 e8  46 f4 20 6d 65 6e 75 20  |ected...F. menu |
00004980  74 69 74 6c 65 73 20 74  6f 20 62 65 20 75 73 65  |titles to be use|
00004990  64 20 28 77 68 69 63 68  20 77 65 72 65 20 69 6e  |d (which were in|
000049a0  74 72 6f 64 75 63 65 64  20 77 69 74 68 20 52 49  |troduced with RI|
000049b0  53 43 20 4f 53 20 33 2e  31 29 2e 0d 12 f2 07 20  |SC OS 3.1)..... |
000049c0  20 3a 0d 12 fc 23 49 6e  64 69 72 65 63 74 4d 65  | :...#IndirectMe|
000049d0  6e 75 54 65 78 74 4f 66  66 73 65 74 50 6f 69 6e  |nuTextOffsetPoin|
000049e0  74 65 72 3d 30 0d 13 06  4e f4 20 54 68 69 73 20  |ter=0...N. This |
000049f0  70 6f 69 6e 74 73 20 74  6f 20 61 20 70 6f 6f 6c  |points to a pool|
00004a00  20 74 6f 20 62 65 20 75  73 65 64 20 62 79 20 61  | to be used by a|
00004a10  6c 6c 20 6d 65 6e 75 73  20 66 6f 72 20 74 68 65  |ll menus for the|
00004a20  69 72 20 69 6e 64 69 72  65 63 74 65 64 20 74 65  |ir indirected te|
00004a30  78 74 2e 0d 13 10 07 20  20 3a 0d 13 1a 0d 4d 25  |xt.....  :....M%|
00004a40  3d 49 42 4d 65 6e 75 0d  13 24 4b 54 69 74 6c 65  |=IBMenu..$KTitle|
00004a50  24 3d 22 54 65 78 74 20  47 72 61 62 62 65 72 22  |$="Text Grabber"|
00004a60  3a de 20 49 42 4d 65 6e  75 54 69 74 6c 65 20 a9  |:. IBMenuTitle .|
00004a70  28 54 69 74 6c 65 24 29  2b 31 3a 24 49 42 4d 65  |(Title$)+1:$IBMe|
00004a80  6e 75 54 69 74 6c 65 3d  54 69 74 6c 65 24 2b bd  |nuTitle=Title$+.|
00004a90  31 33 0d 13 2e 1a f2 4d  65 6e 75 49 6e 69 74 28  |13.....MenuInit(|
00004aa0  49 42 4d 65 6e 75 54 69  74 6c 65 29 0d 13 38 1c  |IBMenuTitle)..8.|
00004ab0  f2 4d 65 6e 75 49 74 65  6d 28 22 49 6e 66 6f 22  |.MenuItem("Info"|
00004ac0  2c 30 2c 49 6e 66 6f 29  0d 13 42 1c f2 4d 65 6e  |,0,Info)..B..Men|
00004ad0  75 49 74 65 6d 28 22 51  75 69 74 22 2c 31 32 38  |uItem("Quit",128|
00004ae0  2c 2d 31 29 0d 13 4c 07  20 20 3a 0d 13 56 0f 4d  |,-1)..L.  :..V.M|
00004af0  25 3d 4d 61 69 6e 4d 65  6e 75 0d 13 60 4f 54 69  |%=MainMenu..`OTi|
00004b00  74 6c 65 24 3d 22 54 65  78 74 20 47 72 61 62 62  |tle$="Text Grabb|
00004b10  65 72 22 3a de 20 4d 61  69 6e 4d 65 6e 75 54 69  |er":. MainMenuTi|
00004b20  74 6c 65 20 a9 28 54 69  74 6c 65 24 29 2b 32 3a  |tle .(Title$)+2:|
00004b30  24 4d 61 69 6e 4d 65 6e  75 54 69 74 6c 65 3d 54  |$MainMenuTitle=T|
00004b40  69 74 6c 65 24 2b bd 31  33 0d 13 6a 1c f2 4d 65  |itle$+.13..j..Me|
00004b50  6e 75 49 6e 69 74 28 4d  61 69 6e 4d 65 6e 75 54  |nuInit(MainMenuT|
00004b60  69 74 6c 65 29 0d 13 74  1c f2 4d 65 6e 75 49 74  |itle)..t..MenuIt|
00004b70  65 6d 28 22 49 6e 66 6f  22 2c 32 2c 49 6e 66 6f  |em("Info",2,Info|
00004b80  29 0d 13 7e 20 f2 4d 65  6e 75 49 74 65 6d 28 22  |)..~ .MenuItem("|
00004b90  43 6c 65 61 72 20 74 65  78 74 22 2c 30 2c 2d 31  |Clear text",0,-1|
00004ba0  29 0d 13 88 23 f2 4d 65  6e 75 49 74 65 6d 28 22  |)...#.MenuItem("|
00004bb0  54 79 70 65 20 74 65 78  74 20 6f 75 74 22 2c 30  |Type text out",0|
00004bc0  2c 2d 31 29 0d 13 92 26  f2 4d 65 6e 75 49 74 65  |,-1)...&.MenuIte|
00004bd0  6d 28 22 57 69 6e 64 6f  77 20 70 6f 73 69 74 69  |m("Window positi|
00004be0  6f 6e 22 2c 32 2c 4c 6f  63 29 0d 13 9c 21 f2 4d  |on",2,Loc)...!.M|
00004bf0  65 6e 75 49 74 65 6d 28  22 53 61 76 65 20 74 65  |enuItem("Save te|
00004c00  78 74 22 2c 30 2c 53 61  76 65 29 0d 13 a6 25 f2  |xt",0,Save)...%.|
00004c10  4d 65 6e 75 49 74 65 6d  28 22 53 61 76 65 20 73  |MenuItem("Save s|
00004c20  65 74 74 69 6e 67 73 22  2c 31 32 38 2c 2d 31 29  |ettings",128,-1)|
00004c30  0d 13 b0 05 e1 0d 13 ba  05 3a 0d 13 c4 0f dd 20  |.........:..... |
00004c40  f2 4d 61 6b 65 4d 65 6e  75 0d 13 ce 17 e7 20 4d  |.MakeMenu..... M|
00004c50  65 6e 75 58 3c 30 20 8c  20 4d 65 6e 75 58 3d 30  |enuX<0 . MenuX=0|
00004c60  0d 13 d8 2a e7 20 4d 65  6e 75 59 3c 31 38 34 20  |...*. MenuY<184 |
00004c70  8c 20 4d 65 6e 75 59 3d  31 38 34 3a f4 20 66 6f  |. MenuY=184:. fo|
00004c80  72 20 69 63 6f 6e 20 62  61 72 0d 13 e2 37 c8 99  |r icon bar...7..|
00004c90  20 22 57 69 6d 70 5f 43  72 65 61 74 65 4d 65 6e  | "Wimp_CreateMen|
00004ca0  75 22 2c 2c 4d 25 2c 4d  65 6e 75 58 2d 28 28 33  |u",,M%,MenuX-((3|
00004cb0  36 2b 4d 25 21 31 36 29  2f 32 29 2c 4d 65 6e 75  |6+M%!16)/2),Menu|
00004cc0  59 0d 13 ec 05 e1 0d 13  f6 05 3a 0d 14 00 1a dd  |Y.........:.....|
00004cd0  20 f2 4d 65 6e 75 49 6e  69 74 28 4d 65 6e 75 54  | .MenuInit(MenuT|
00004ce0  69 74 6c 65 29 0d 14 0a  11 e7 20 77 69 6d 70 3e  |itle)..... wimp>|
00004cf0  3d 33 31 30 20 8c 0d 14  14 37 20 20 41 3d a7 24  |=310 ....7  A=.$|
00004d00  4d 65 6e 75 54 69 74 6c  65 2c 22 7c 22 29 3a e7  |MenuTitle,"|"):.|
00004d10  20 41 3c 3e 30 20 8c 20  3f 28 4d 65 6e 75 54 69  | A<>0 . ?(MenuTi|
00004d20  74 6c 65 2b 28 41 2d 31  29 29 3d 33 32 0d 14 1e  |tle+(A-1))=32...|
00004d30  1b 20 20 4d 65 6e 75 4d  61 78 3d a9 28 24 4d 65  |.  MenuMax=.($Me|
00004d40  6e 75 54 69 74 6c 65 29  0d 14 28 14 20 20 4d 25  |nuTitle)..(.  M%|
00004d50  21 30 3d 4d 65 6e 75 54  69 74 6c 65 0d 14 32 05  |!0=MenuTitle..2.|
00004d60  cc 0d 14 3c 37 20 20 41  3d a7 24 4d 65 6e 75 54  |...<7  A=.$MenuT|
00004d70  69 74 6c 65 2c 22 7c 22  29 3a e7 20 41 3c 3e 30  |itle,"|"):. A<>0|
00004d80  20 8c 20 3f 28 4d 65 6e  75 54 69 74 6c 65 2b 28  | . ?(MenuTitle+(|
00004d90  41 2d 31 29 29 3d 31 33  0d 14 46 20 20 20 4d 65  |A-1))=13..F   Me|
00004da0  6e 75 4d 61 78 3d a9 28  c0 24 4d 65 6e 75 54 69  |nuMax=.(.$MenuTi|
00004db0  74 6c 65 2c 31 32 29 29  0d 14 50 19 20 20 24 4d  |tle,12))..P.  $M|
00004dc0  25 3d c0 24 4d 65 6e 75  54 69 74 6c 65 2c 31 32  |%=.$MenuTitle,12|
00004dd0  29 0d 14 5a 05 cd 0d 14  64 24 4d 25 3f 31 32 3d  |)..Z....d$M%?12=|
00004de0  37 3a 4d 25 3f 31 33 3d  32 3a 4d 25 3f 31 34 3d  |7:M%?13=2:M%?14=|
00004df0  31 31 3a 4d 25 3f 31 35  3d 30 0d 14 6e 14 4d 25  |11:M%?15=0..n.M%|
00004e00  21 31 36 3d 4d 65 6e 75  4d 61 78 2a 31 36 0d 14  |!16=MenuMax*16..|
00004e10  78 14 4d 25 21 32 30 3d  34 34 3a 4d 25 21 32 34  |x.M%!20=44:M%!24|
00004e20  3d 30 0d 14 82 0c 50 25  3d 4d 25 2b 32 38 0d 14  |=0....P%=M%+28..|
00004e30  8c 05 e1 0d 14 96 05 3a  0d 14 a0 21 dd 20 f2 4d  |.......:...!. .M|
00004e40  65 6e 75 49 74 65 6d 28  54 65 78 74 24 2c 46 6c  |enuItem(Text$,Fl|
00004e50  61 67 73 2c 4c 69 6e 6b  29 0d 14 aa 4b f4 20 46  |ags,Link)...K. F|
00004e60  6c 61 67 73 3a 20 31 2d  74 69 63 6b 65 64 2c 20  |lags: 1-ticked, |
00004e70  32 2d 64 61 73 68 65 64  20 6c 69 6e 65 2c 20 34  |2-dashed line, 4|
00004e80  2d 77 72 69 74 65 61 62  6c 65 2c 20 38 2d 6d 65  |-writeable, 8-me|
00004e90  73 73 61 67 65 2c 20 31  32 38 2d 6c 61 73 74 20  |ssage, 128-last |
00004ea0  69 74 65 6d 0d 14 b4 31  f4 20 4c 69 6e 6b 3a 20  |item...1. Link: |
00004eb0  6d 65 6e 75 20 6f 72 20  77 69 6e 64 6f 77 20 68  |menu or window h|
00004ec0  61 6e 64 6c 65 20 66 6f  72 20 73 75 62 2d 70 6f  |andle for sub-po|
00004ed0  69 6e 74 65 72 0d 14 be  18 50 25 21 30 3d 46 6c  |inter....P%!0=Fl|
00004ee0  61 67 73 3a 50 25 21 34  3d 4c 69 6e 6b 0d 14 c8  |ags:P%!4=Link...|
00004ef0  14 e7 20 a9 28 54 65 78  74 24 29 3c 3d 31 32 20  |.. .(Text$)<=12 |
00004f00  8c 0d 14 d2 25 20 20 50  25 21 38 3d 26 30 37 30  |....%  P%!8=&070|
00004f10  30 33 30 32 31 3a f4 20  4e 6f 74 20 69 6e 64 69  |03021:. Not indi|
00004f20  72 65 63 74 65 64 0d 14  dc 14 20 20 24 28 50 25  |rected....  $(P%|
00004f30  2b 31 32 29 3d 54 65 78  74 24 0d 14 e6 05 cc 0d  |+12)=Text$......|
00004f40  14 f0 21 20 20 50 25 21  38 3d 26 30 37 30 30 33  |..!  P%!8=&07003|
00004f50  31 32 31 3a f4 20 49 6e  64 69 72 65 63 74 65 64  |121:. Indirected|
00004f60  0d 14 fa 3a 20 20 50 25  21 31 32 3d 49 6e 64 69  |...:  P%!12=Indi|
00004f70  72 65 63 74 4d 65 6e 75  54 65 78 74 2b 49 6e 64  |rectMenuText+Ind|
00004f80  69 72 65 63 74 4d 65 6e  75 54 65 78 74 4f 66 66  |irectMenuTextOff|
00004f90  73 65 74 50 6f 69 6e 74  65 72 0d 15 04 15 20 20  |setPointer....  |
00004fa0  50 25 21 31 36 3d 30 3a  50 25 21 32 30 3d 30 0d  |P%!16=0:P%!20=0.|
00004fb0  15 0e 41 20 20 24 28 49  6e 64 69 72 65 63 74 4d  |..A  $(IndirectM|
00004fc0  65 6e 75 54 65 78 74 2b  49 6e 64 69 72 65 63 74  |enuText+Indirect|
00004fd0  4d 65 6e 75 54 65 78 74  4f 66 66 73 65 74 50 6f  |MenuTextOffsetPo|
00004fe0  69 6e 74 65 72 29 3d 54  65 78 74 24 2b bd 31 33  |inter)=Text$+.13|
00004ff0  0d 15 18 2f 20 20 49 6e  64 69 72 65 63 74 4d 65  |.../  IndirectMe|
00005000  6e 75 54 65 78 74 4f 66  66 73 65 74 50 6f 69 6e  |nuTextOffsetPoin|
00005010  74 65 72 2b 3d a9 28 54  65 78 74 24 29 2b 31 0d  |ter+=.(Text$)+1.|
00005020  15 22 82 20 20 e7 20 49  6e 64 69 72 65 63 74 4d  |.".  . IndirectM|
00005030  65 6e 75 54 65 78 74 4f  66 66 73 65 74 50 6f 69  |enuTextOffsetPoi|
00005040  6e 74 65 72 3e 49 6e 64  4d 65 6e 75 4d 61 78 20  |nter>IndMenuMax |
00005050  8c 20 85 20 30 2c 22 54  68 65 20 69 6e 64 69 72  |. . 0,"The indir|
00005060  65 63 74 20 6d 65 6e 75  20 74 65 78 74 20 62 75  |ect menu text bu|
00005070  66 66 65 72 20 68 61 73  20 6f 76 65 72 66 6c 6f  |ffer has overflo|
00005080  77 65 64 2e 20 50 6c 65  61 73 65 20 61 6c 6c 6f  |wed. Please allo|
00005090  63 61 74 65 20 6d 6f 72  65 20 73 70 61 63 65 2e  |cate more space.|
000050a0  22 0d 15 2c 05 cd 0d 15  36 0a 50 25 2b 3d 32 34  |"..,....6.P%+=24|
000050b0  0d 15 40 3e e7 20 4d 65  6e 75 4d 61 78 3c a9 28  |..@>. MenuMax<.(|
000050c0  54 65 78 74 24 29 20 8c  20 4d 65 6e 75 4d 61 78  |Text$) . MenuMax|
000050d0  3d a9 28 54 65 78 74 24  29 3a 4d 25 21 31 36 3d  |=.(Text$):M%!16=|
000050e0  28 4d 65 6e 75 4d 61 78  2b 31 29 2a 31 36 0d 15  |(MenuMax+1)*16..|
000050f0  4a 41 e7 20 28 46 6c 61  67 73 3d 31 32 38 29 20  |JA. (Flags=128) |
00005100  80 20 28 77 69 6d 70 3e  3d 33 31 30 29 20 8c 20  |. (wimp>=310) . |
00005110  4d 25 21 32 38 3d 28 28  28 4d 25 21 32 38 29 20  |M%!28=(((M%!28) |
00005120  80 20 ac 20 32 35 36 29  20 82 20 32 35 36 29 0d  |. . 256) . 256).|
00005130  15 54 37 20 20 f4 20 49  6e 64 69 72 65 63 74 65  |.T7  . Indirecte|
00005140  64 20 6d 65 6e 75 20 74  69 74 6c 65 73 20 66 6f  |d menu titles fo|
00005150  72 20 52 49 53 43 20 4f  53 20 33 2e 31 20 75 70  |r RISC OS 3.1 up|
00005160  77 61 72 64 73 2e 0d 15  5e 05 e1 0d 15 68 05 3a  |wards...^....h.:|
00005170  0d 15 72 4f f4 20 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |..rO. ----------|
00005180  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000051b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
000051c0  15 7c 29 f4 20 52 65 73  70 6f 6e 73 65 73 20 74  |.|). Responses t|
000051d0  6f 20 69 6e 63 6f 6d 69  6e 67 20 77 69 6d 70 20  |o incoming wimp |
000051e0  6d 65 73 73 61 67 65 73  0d 15 86 4f f4 20 2d 2d  |messages...O. --|
000051f0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00005230  2d 2d 2d 2d 2d 2d 2d 0d  15 90 05 3a 0d 15 9a 18  |-------....:....|
00005240  dd 20 f2 53 61 76 65 44  65 73 6b 74 6f 70 28 46  |. .SaveDesktop(F|
00005250  69 6c 65 29 0d 15 a4 07  ea 20 85 0d 15 ae 47 ee  |ile)..... ....G.|
00005260  20 85 20 ea 20 42 6c 6f  63 6b 21 31 32 3d 42 6c  | . . Block!12=Bl|
00005270  6f 63 6b 21 38 3a c8 99  20 22 57 69 6d 70 5f 53  |ock!8:.. "Wimp_S|
00005280  65 6e 64 4d 65 73 73 61  67 65 22 2c 31 39 2c 42  |endMessage",19,B|
00005290  6c 6f 63 6b 2c 42 6c 6f  63 6b 21 34 3a f7 20 85  |lock,Block!4:. .|
000052a0  3a e1 0d 15 b8 49 f4 20  54 68 65 20 61 62 6f 76  |:....I. The abov|
000052b0  65 20 6c 69 6e 65 20 61  63 6b 6e 6f 77 6c 65 64  |e line acknowled|
000052c0  67 65 73 20 74 68 65 20  6d 65 73 73 61 67 65 20  |ges the message |
000052d0  69 66 20 61 6e 20 65 72  72 6f 72 20 6f 63 63 75  |if an error occu|
000052e0  72 73 2c 20 74 68 65 72  65 62 79 0d 15 c2 20 f4  |rs, thereby... .|
000052f0  20 61 62 6f 72 74 69 6e  67 20 74 68 65 20 64 65  | aborting the de|
00005300  73 6b 74 6f 70 20 73 61  76 65 2e 0d 15 cc 2b d5  |sktop save....+.|
00005310  23 46 69 6c 65 2c 22 52  75 6e 20 22 2b 4f 75 72  |#File,"Run "+Our|
00005320  50 61 74 68 4e 61 6d 65  24 2b 4f 75 72 46 69 6c  |PathName$+OurFil|
00005330  65 4e 61 6d 65 24 0d 15  d6 05 e1 0d 15 e0 05 3a  |eName$.........:|
00005340  0d 15 ea 0b dd 20 f2 48  65 6c 70 0d 15 f4 34 42  |..... .Help...4B|
00005350  6c 6f 63 6b 21 31 32 3d  42 6c 6f 63 6b 21 38 3a  |lock!12=Block!8:|
00005360  42 6c 6f 63 6b 21 31 36  3d 26 35 30 33 3a 48 65  |Block!16=&503:He|
00005370  6c 70 49 6e 66 6f 3d 42  6c 6f 63 6b 2b 32 30 0d  |lpInfo=Block+20.|
00005380  15 fe 07 20 20 3a 0d 16  08 30 f4 20 42 6c 6f 63  |...  :...0. Bloc|
00005390  6b 21 33 32 20 67 69 76  65 73 20 77 69 6e 64 6f  |k!32 gives windo|
000053a0  77 2c 20 42 6c 6f 63 6b  21 33 36 20 67 69 76 65  |w, Block!36 give|
000053b0  73 20 69 63 6f 6e 0d 16  12 07 20 20 3a 0d 16 1c  |s icon....  :...|
000053c0  11 c8 8e 20 42 6c 6f 63  6b 21 33 32 20 ca 0d 16  |... Block!32 ...|
000053d0  26 32 20 20 c9 20 2d 32  3a f2 53 65 6e 64 28 22  |&2  . -2:.Send("|
000053e0  54 68 69 73 20 69 73 20  74 68 65 20 54 65 78 74  |This is the Text|
000053f0  20 47 72 61 62 62 65 72  20 69 63 6f 6e 2e 22 29  | Grabber icon.")|
00005400  0d 16 30 3d 20 20 20 20  20 20 20 20 20 20 f2 53  |..0=          .S|
00005410  65 6e 64 28 22 43 6c 69  63 6b 20 4d 45 4e 55 20  |end("Click MENU |
00005420  66 6f 72 20 69 6e 66 6f  72 6d 61 74 69 6f 6e 20  |for information |
00005430  6f 72 20 74 6f 20 71 75  69 74 2e 22 29 0d 16 3a  |or to quit.")..:|
00005440  44 20 20 20 20 20 20 20  20 20 20 f2 53 65 6e 64  |D          .Send|
00005450  28 22 43 6c 69 63 6b 20  53 45 4c 45 43 54 20 74  |("Click SELECT t|
00005460  6f 20 6f 70 65 6e 20 74  68 65 20 74 65 78 74 20  |o open the text |
00005470  67 72 61 62 62 65 72 20  77 69 6e 64 6f 77 2e 22  |grabber window."|
00005480  29 0d 16 44 0d 20 20 c9  20 47 72 61 62 3a 0d 16  |)..D.  . Grab:..|
00005490  4e 15 20 20 20 20 c8 8e  20 42 6c 6f 63 6b 21 33  |N.    .. Block!3|
000054a0  36 20 ca 0d 16 58 85 20  20 20 20 20 20 c9 20 30  |6 ...X.      . 0|
000054b0  2c 31 2c 32 3a f2 53 65  6e 64 28 22 54 68 69 73  |,1,2:.Send("This|
000054c0  20 61 72 65 61 20 64 69  73 70 6c 61 79 73 20 74  | area displays t|
000054d0  68 65 20 74 65 78 74 20  79 6f 75 20 68 61 76 65  |he text you have|
000054e0  20 67 72 61 62 62 65 64  20 6f 72 20 6c 6f 61 64  | grabbed or load|
000054f0  65 64 20 28 6f 72 20 61  73 20 6d 75 63 68 20 6f  |ed (or as much o|
00005500  66 20 69 74 20 61 73 20  77 69 6c 6c 20 66 69 74  |f it as will fit|
00005510  20 69 6e 20 74 68 65 20  64 69 73 70 6c 61 79 20  | in the display |
00005520  61 72 65 61 29 2e 22 29  0d 16 62 43 20 20 20 20  |area).")..bC    |
00005530  20 20 c9 20 33 3a f2 53  65 6e 64 28 22 43 6c 69  |  . 3:.Send("Cli|
00005540  63 6b 20 74 68 69 73 20  69 63 6f 6e 20 74 6f 20  |ck this icon to |
00005550  63 68 6f 6f 73 65 20 73  6f 6d 65 20 74 65 78 74  |choose some text|
00005560  20 74 6f 20 67 72 61 62  2e 22 29 0d 16 6c 53 20  | to grab.")..lS |
00005570  20 20 20 20 20 20 20 20  20 20 20 20 f2 53 65 6e  |            .Sen|
00005580  64 28 22 28 41 6c 74 65  72 6e 61 74 69 76 65 6c  |d("(Alternativel|
00005590  79 2c 20 70 72 65 73 73  20 74 68 65 20 68 6f 74  |y, press the hot|
000055a0  2d 6b 65 79 20 63 6f 6d  62 69 6e 61 74 69 6f 6e  |-key combination|
000055b0  20 43 54 52 4c 2d 43 4f  50 59 2e 29 22 29 0d 16  | CTRL-COPY.)")..|
000055c0  76 4f 20 20 20 20 20 20  20 20 20 20 20 20 20 f2  |vO             .|
000055d0  53 65 6e 64 28 22 55 73  69 6e 67 20 74 68 65 20  |Send("Using the |
000055e0  68 6f 74 2d 6b 65 79 20  69 73 20 74 68 65 20 6f  |hot-key is the o|
000055f0  6e 6c 79 20 77 61 79 20  74 6f 20 67 72 61 62 20  |nly way to grab |
00005600  6d 65 6e 75 20 69 74 65  6d 73 2e 22 29 0d 16 80  |menu items.")...|
00005610  5e 20 20 20 20 20 20 20  20 20 20 20 20 20 f2 53  |^             .S|
00005620  65 6e 64 28 22 43 54 52  4c 2d 53 48 49 46 54 2d  |end("CTRL-SHIFT-|
00005630  43 4f 50 59 20 73 65 6e  64 73 20 74 68 65 20 74  |COPY sends the t|
00005640  65 78 74 20 61 74 20 74  68 65 20 70 6f 69 6e 74  |ext at the point|
00005650  65 72 20 73 74 72 61 69  67 68 74 20 74 6f 20 74  |er straight to t|
00005660  68 65 20 63 61 72 65 74  2e 22 29 0d 16 8a 20 20  |he caret.")...  |
00005670  20 20 20 20 20 c9 20 34  3a e7 20 42 75 66 66 65  |     . 4:. Buffe|
00005680  72 4c 65 6e 67 74 68 3d  30 20 8c 0d 16 94 5c 20  |rLength=0 ....\ |
00005690  20 20 20 20 20 20 20 20  20 20 20 20 20 20 f2 53  |              .S|
000056a0  65 6e 64 28 22 59 6f 75  20 63 61 6e 6e 6f 74 20  |end("You cannot |
000056b0  70 72 65 73 73 20 74 68  69 73 20 62 75 74 74 6f  |press this butto|
000056c0  6e 20 62 65 63 61 75 73  65 20 74 68 65 72 65 20  |n because there |
000056d0  69 73 20 6e 6f 20 74 65  78 74 20 74 6f 20 65 78  |is no text to ex|
000056e0  70 6f 72 74 2e 22 29 0d  16 9e 12 20 20 20 20 20  |port.")....     |
000056f0  20 20 20 20 20 20 20 20  cc 0d 16 a8 47 20 20 20  |        ....G   |
00005700  20 20 20 20 20 20 20 20  20 20 20 20 f2 53 65 6e  |            .Sen|
00005710  64 28 22 43 6c 69 63 6b  20 53 45 4c 45 43 54 20  |d("Click SELECT |
00005720  74 6f 20 73 65 6e 64 20  74 68 65 20 74 65 78 74  |to send the text|
00005730  20 74 6f 20 74 68 65 20  63 61 72 65 74 2e 22 29  | to the caret.")|
00005740  0d 16 b2 5d 20 20 20 20  20 20 20 20 20 20 20 20  |...]            |
00005750  20 20 20 f2 53 65 6e 64  28 22 28 41 6c 74 65 72  |   .Send("(Alter|
00005760  6e 61 74 69 76 65 6c 79  2c 20 70 72 65 73 73 20  |natively, press |
00005770  74 68 65 20 68 6f 74 2d  6b 65 79 20 63 6f 6d 62  |the hot-key comb|
00005780  69 6e 61 74 69 6f 6e 20  43 54 52 4c 2d 53 48 49  |ination CTRL-SHI|
00005790  46 54 2d 49 4e 53 45 52  54 2e 29 22 29 0d 16 bc  |FT-INSERT.)")...|
000057a0  58 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |X               |
000057b0  f2 53 65 6e 64 28 22 43  6c 69 63 6b 20 41 44 4a  |.Send("Click ADJ|
000057c0  55 53 54 20 74 6f 20 73  65 6e 64 20 74 68 65 20  |UST to send the |
000057d0  74 65 78 74 20 74 6f 20  61 20 73 70 65 63 69 66  |text to a specif|
000057e0  69 63 20 61 72 65 61 20  28 76 69 61 20 68 61 6e  |ic area (via han|
000057f0  64 29 2e 22 29 0d 16 c6  57 20 20 20 20 20 20 20  |d).")...W       |
00005800  20 20 20 20 20 20 20 20  f2 53 65 6e 64 28 22 28  |        .Send("(|
00005810  41 6c 74 65 72 6e 61 74  69 76 65 6c 79 2c 20 70  |Alternatively, p|
00005820  72 65 73 73 20 74 68 65  20 68 6f 74 2d 6b 65 79  |ress the hot-key|
00005830  20 63 6f 6d 62 69 6e 61  74 69 6f 6e 20 43 54 52  | combination CTR|
00005840  4c 2d 49 4e 53 45 52 54  2e 29 22 29 0d 16 d0 12  |L-INSERT.)")....|
00005850  20 20 20 20 20 20 20 20  20 20 20 20 20 cd 0d 16  |             ...|
00005860  da 35 20 20 20 20 20 20  7f 3a f2 53 65 6e 64 28  |.5      .:.Send(|
00005870  22 54 68 69 73 20 69 73  20 74 68 65 20 54 65 78  |"This is the Tex|
00005880  74 20 47 72 61 62 62 65  72 20 77 69 6e 64 6f 77  |t Grabber window|
00005890  2e 22 29 0d 16 e4 3a 20  20 20 20 20 20 20 20 20  |.")...:         |
000058a0  20 20 20 20 20 20 20 f2  53 65 6e 64 28 22 43 6c  |       .Send("Cl|
000058b0  69 63 6b 20 4d 45 4e 55  20 66 6f 72 20 74 68 65  |ick MENU for the|
000058c0  20 6d 61 69 6e 20 6d 65  6e 75 2e 22 29 0d 16 ee  | main menu.")...|
000058d0  09 20 20 20 20 cb 0d 16  f8 4a 20 20 c9 20 49 6e  |.    ....J  . In|
000058e0  66 6f 3a f2 53 65 6e 64  28 22 54 68 69 73 20 77  |fo:.Send("This w|
000058f0  69 6e 64 6f 77 20 64 69  73 70 6c 61 79 73 20 69  |indow displays i|
00005900  6e 66 6f 72 6d 61 74 69  6f 6e 20 61 62 6f 75 74  |nformation about|
00005910  20 54 65 78 74 20 47 72  61 62 62 65 72 2e 22 29  | Text Grabber.")|
00005920  0d 17 02 5d 20 20 20 20  20 20 20 20 20 20 20 20  |...]            |
00005930  f2 53 65 6e 64 28 22 54  65 78 74 20 47 72 61 62  |.Send("Text Grab|
00005940  62 65 72 20 69 73 20 61  20 6d 65 6d 62 65 72 20  |ber is a member |
00005950  6f 66 20 74 68 65 20 4f  6d 6e 69 44 65 73 6b 20  |of the OmniDesk |
00005960  53 75 69 74 65 20 6f 66  20 64 65 73 6b 74 6f 70  |Suite of desktop|
00005970  20 75 74 69 6c 69 74 69  65 73 2e 22 29 0d 17 0c  | utilities.")...|
00005980  0c 20 20 c9 20 4c 6f 63  3a 0d 17 16 0d 20 20 20  |.  . Loc:....   |
00005990  c8 8e 20 b9 20 ca 0d 17  20 6d 20 20 20 20 20 c9  |.. . ... m     .|
000059a0  20 28 28 42 6c 6f 63 6b  21 33 36 29 3c 36 29 3a  | ((Block!36)<6):|
000059b0  f2 53 65 6e 64 28 22 54  68 69 73 20 77 69 6e 64  |.Send("This wind|
000059c0  6f 77 20 6c 65 74 73 20  79 6f 75 20 73 6e 61 70  |ow lets you snap|
000059d0  20 74 68 65 20 6d 61 67  6e 69 66 69 65 72 20 77  | the magnifier w|
000059e0  69 6e 64 6f 77 20 74 6f  20 61 6e 20 69 6e 76 69  |indow to an invi|
000059f0  73 62 6c 65 20 73 63 72  65 65 6e 20 67 72 69 64  |sble screen grid|
00005a00  2e 22 29 0d 17 2a 9d 20  20 20 20 20 20 20 20 20  |.")..*.         |
00005a10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00005a20  f2 53 65 6e 64 28 22 54  68 65 20 73 65 63 6f 6e  |.Send("The secon|
00005a30  64 20 70 6f 73 69 74 69  6f 6e 20 75 70 20 70 75  |d position up pu|
00005a40  74 73 20 74 68 65 20 77  69 6e 64 6f 77 20 6a 75  |ts the window ju|
00005a50  73 74 20 61 62 6f 76 65  20 74 68 65 20 69 63 6f  |st above the ico|
00005a60  6e 2d 62 61 72 2c 20 61  6e 64 20 69 73 20 74 68  |n-bar, and is th|
00005a70  65 72 65 66 6f 72 65 20  6e 6f 74 20 65 76 65 6e  |erefore not even|
00005a80  6c 79 20 73 70 61 63 65  64 20 77 69 74 68 20 74  |ly spaced with t|
00005a90  68 65 20 6f 74 68 65 72  20 72 6f 77 73 2e 22 29  |he other rows.")|
00005aa0  0d 17 34 87 20 20 20 20  20 7f 20 f2 53 65 6e 64  |..4.     . .Send|
00005ab0  28 22 43 6c 69 63 6b 20  53 45 4c 45 43 54 20 6f  |("Click SELECT o|
00005ac0  6e 20 74 68 65 20 70 6f  73 69 74 69 6f 6e 20 79  |n the position y|
00005ad0  6f 75 20 77 61 6e 74 20  74 68 65 20 77 69 6e 64  |ou want the wind|
00005ae0  6f 77 20 74 6f 20 73 6e  61 70 20 74 6f 2c 20 6f  |ow to snap to, o|
00005af0  72 20 41 44 4a 55 53 54  20 6f 6e 20 74 68 65 20  |r ADJUST on the |
00005b00  77 69 6e 64 6f 77 20 69  63 6f 6e 20 74 6f 20 74  |window icon to t|
00005b10  75 72 6e 20 74 68 65 20  73 6e 61 70 70 69 6e 67  |urn the snapping|
00005b20  20 6f 66 66 2e 22 29 0d  17 3e 75 20 20 20 20 20  | off.")..>u     |
00005b30  20 20 20 20 20 20 20 20  20 20 f2 53 65 6e 64 28  |          .Send(|
00005b40  22 49 66 20 73 6e 61 70  70 69 6e 67 20 69 73 20  |"If snapping is |
00005b50  6f 6e 2c 20 74 68 65 20  77 69 6e 64 6f 77 20 77  |on, the window w|
00005b60  69 6c 6c 20 6f 70 65 6e  20 61 74 20 74 68 65 20  |ill open at the |
00005b70  61 70 70 72 6f 70 72 69  61 74 65 20 70 6f 73 69  |appropriate posi|
00005b80  74 69 6f 6e 20 77 68 65  6e 20 79 6f 75 20 63 68  |tion when you ch|
00005b90  61 6e 67 65 20 6d 6f 64  65 2e 22 29 0d 17 48 08  |ange mode.")..H.|
00005ba0  20 20 20 cb 0d 17 52 0c  20 c9 20 53 61 76 65 3a  |   ...R. . Save:|
00005bb0  0d 17 5c 14 20 20 20 c8  8e 20 42 6c 6f 63 6b 21  |..\.   .. Block!|
00005bc0  33 36 20 ca 0d 17 66 ad  20 20 20 20 20 c9 20 30  |36 ...f.     . 0|
00005bd0  3a f2 53 65 6e 64 28 22  44 72 61 67 20 74 68 65  |:.Send("Drag the|
00005be0  20 66 69 6c 65 20 69 63  6f 6e 20 74 6f 20 61 20  | file icon to a |
00005bf0  66 69 6c 65 72 20 77 69  6e 64 6f 77 20 6f 72 20  |filer window or |
00005c00  74 6f 20 61 6e 6f 74 68  65 72 20 61 70 70 6c 69  |to another appli|
00005c10  63 61 74 69 6f 6e 20 77  68 69 63 68 20 63 61 6e  |cation which can|
00005c20  20 61 63 63 65 70 74 20  74 65 78 74 20 66 69 6c  | accept text fil|
00005c30  65 73 2c 20 6f 72 20 65  6e 74 65 72 20 61 20 66  |es, or enter a f|
00005c40  69 6c 65 6e 61 6d 65 20  61 6e 64 20 63 6c 69 63  |ilename and clic|
00005c50  6b 20 4f 4b 20 28 6f 72  20 70 72 65 73 73 20 52  |k OK (or press R|
00005c60  45 54 55 52 4e 29 20 74  6f 20 73 61 76 65 2e 22  |ETURN) to save."|
00005c70  29 0d 17 70 6d 20 20 20  20 20 c9 20 31 3a f2 53  |)..pm     . 1:.S|
00005c80  65 6e 64 28 22 44 72 61  67 20 74 68 69 73 20 69  |end("Drag this i|
00005c90  63 6f 6e 20 74 6f 20 61  20 66 69 6c 65 72 20 77  |con to a filer w|
00005ca0  69 6e 64 6f 77 20 6f 72  20 74 6f 20 61 6e 6f 74  |indow or to anot|
00005cb0  68 65 72 20 61 70 70 6c  69 63 61 74 69 6f 6e 20  |her application |
00005cc0  77 68 69 63 68 20 63 61  6e 20 61 63 63 65 70 74  |which can accept|
00005cd0  20 74 65 78 74 20 66 69  6c 65 73 2e 22 29 0d 17  | text files.")..|
00005ce0  7a b2 20 20 20 20 20 c9  20 32 3a f2 53 65 6e 64  |z.     . 2:.Send|
00005cf0  28 22 45 6e 74 65 72 20  61 20 66 69 6c 65 6e 61  |("Enter a filena|
00005d00  6d 65 20 68 65 72 65 20  61 6e 64 20 63 6c 69 63  |me here and clic|
00005d10  6b 20 4f 4b 20 28 6f 72  20 70 72 65 73 73 20 52  |k OK (or press R|
00005d20  45 54 55 52 4e 29 20 74  6f 20 73 61 76 65 2c 20  |ETURN) to save, |
00005d30  6f 72 20 64 72 61 67 20  74 68 65 20 66 69 6c 65  |or drag the file|
00005d40  20 69 63 6f 6e 20 74 6f  20 61 20 66 69 6c 65 72  | icon to a filer|
00005d50  20 77 69 6e 64 6f 77 20  6f 72 20 74 6f 20 61 6e  | window or to an|
00005d60  6f 74 68 65 72 20 61 70  70 6c 69 63 61 74 69 6f  |other applicatio|
00005d70  6e 20 77 68 69 63 68 20  63 61 6e 20 61 63 63 65  |n which can acce|
00005d80  70 74 20 74 65 78 74 20  66 69 6c 65 73 2e 22 29  |pt text files.")|
00005d90  0d 17 84 a1 20 20 20 20  20 c9 20 33 3a f2 53 65  |....     . 3:.Se|
00005da0  6e 64 28 22 43 6c 69 63  6b 20 4f 4b 20 28 6f 72  |nd("Click OK (or|
00005db0  20 70 72 65 73 73 20 52  45 54 55 52 4e 29 20 74  | press RETURN) t|
00005dc0  6f 20 73 61 76 65 20 74  68 65 20 66 69 6c 65 2c  |o save the file,|
00005dd0  20 6f 72 20 64 72 61 67  20 74 68 65 20 66 69 6c  | or drag the fil|
00005de0  65 20 69 63 6f 6e 20 74  6f 20 61 20 66 69 6c 65  |e icon to a file|
00005df0  72 20 77 69 6e 64 6f 77  20 6f 72 20 74 6f 20 61  |r window or to a|
00005e00  6e 6f 74 68 65 72 20 61  70 70 6c 69 63 61 74 69  |nother applicati|
00005e10  6f 6e 20 77 68 69 63 68  20 63 61 6e 20 61 63 63  |on which can acc|
00005e20  65 70 74 20 74 65 78 74  20 66 69 6c 65 73 2e 22  |ept text files."|
00005e30  29 0d 17 8e 2c 20 20 20  20 20 7f 20 f2 53 65 6e  |)...,     . .Sen|
00005e40  64 28 22 54 68 69 73 20  69 73 20 74 68 65 20 53  |d("This is the S|
00005e50  61 76 65 20 77 69 6e 64  6f 77 2e 22 29 0d 17 98  |ave window.")...|
00005e60  08 20 20 20 cb 0d 17 a2  05 7f 0d 17 ac 13 20 20  |.   ..........  |
00005e70  e7 20 77 69 6d 70 3e 3d  32 31 37 20 8c 0d 17 b6  |. wimp>=217 ....|
00005e80  31 20 20 20 20 4d 65 6e  75 48 65 6c 70 21 30 3d  |1    MenuHelp!0=|
00005e90  2d 31 3a 4d 65 6e 75 48  65 6c 70 21 34 3d 2d 31  |-1:MenuHelp!4=-1|
00005ea0  3a 4d 65 6e 75 48 65 6c  70 21 38 3d 2d 31 0d 17  |:MenuHelp!8=-1..|
00005eb0  c0 3b 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 47  |.;    .. "Wimp_G|
00005ec0  65 74 4d 65 6e 75 53 74  61 74 65 22 2c 31 2c 4d  |etMenuState",1,M|
00005ed0  65 6e 75 48 65 6c 70 2c  42 6c 6f 63 6b 21 33 32  |enuHelp,Block!32|
00005ee0  2c 42 6c 6f 63 6b 21 33  36 0d 17 ca 0f 20 20 20  |,Block!36....   |
00005ef0  20 c8 8e 20 4d 25 20 ca  0d 17 d4 13 20 20 20 20  | .. M% .....    |
00005f00  20 20 c9 20 49 42 4d 65  6e 75 3a 0d 17 de 1d 20  |  . IBMenu:.... |
00005f10  20 20 20 20 20 20 20 e7  20 4d 65 6e 75 48 65 6c  |       . MenuHel|
00005f20  70 21 34 3d 2d 31 20 8c  0d 17 e8 1d 20 20 20 20  |p!4=-1 .....    |
00005f30  20 20 20 20 20 20 c8 8e  20 4d 65 6e 75 48 65 6c  |      .. MenuHel|
00005f40  70 21 30 20 ca 0d 17 f2  5a 20 20 20 20 20 20 20  |p!0 ....Z       |
00005f50  20 20 20 20 20 c9 20 30  3a f2 53 65 6e 64 28 22  |     . 0:.Send("|
00005f60  4d 6f 76 65 20 74 68 65  20 70 6f 69 6e 74 65 72  |Move the pointer|
00005f70  20 72 69 67 68 74 20 74  6f 20 73 65 65 20 69 6e  | right to see in|
00005f80  66 6f 72 6d 61 74 69 6f  6e 20 61 62 6f 75 74 20  |formation about |
00005f90  54 65 78 74 20 47 72 61  62 62 65 72 2e 22 29 0d  |Text Grabber.").|
00005fa0  17 fc 3f 20 20 20 20 20  20 20 20 20 20 20 20 c9  |..?            .|
00005fb0  20 31 3a f2 53 65 6e 64  28 22 43 6c 69 63 6b 20  | 1:.Send("Click |
00005fc0  53 45 4c 45 43 54 20 74  6f 20 71 75 69 74 20 54  |SELECT to quit T|
00005fd0  65 78 74 20 47 72 61 62  62 65 72 2e 22 29 0d 18  |ext Grabber.")..|
00005fe0  06 42 20 20 20 20 20 20  20 20 20 20 20 20 7f 20  |.B            . |
00005ff0  f2 53 65 6e 64 28 22 54  68 69 73 20 69 73 20 74  |.Send("This is t|
00006000  68 65 20 54 65 78 74 20  47 72 61 62 62 65 72 20  |he Text Grabber |
00006010  69 63 6f 6e 2d 62 61 72  20 6d 65 6e 75 2e 22 29  |icon-bar menu.")|
00006020  0d 18 10 0f 20 20 20 20  20 20 20 20 20 20 cb 0d  |....          ..|
00006030  18 1a 0d 20 20 20 20 20  20 20 20 cd 0d 18 24 15  |...        ...$.|
00006040  20 20 20 20 20 20 c9 20  4d 61 69 6e 4d 65 6e 75  |      . MainMenu|
00006050  3a 0d 18 2e 57 20 20 20  20 20 20 20 20 44 69 72  |:...W        Dir|
00006060  65 63 74 69 6f 6e 24 3d  22 72 69 67 68 74 22 3a  |ection$="right":|
00006070  e7 20 77 69 6d 70 3e 3d  33 31 30 20 80 20 bd 28  |. wimp>=310 . .(|
00006080  4d 61 69 6e 4d 65 6e 75  54 69 74 6c 65 3f 30 29  |MainMenuTitle?0)|
00006090  3d 22 5c 22 20 8c 20 44  69 72 65 63 74 69 6f 6e  |="\" . Direction|
000060a0  24 3d 22 6c 65 66 74 22  0d 18 38 1b 20 20 20 20  |$="left"..8.    |
000060b0  20 20 20 20 c8 8e 20 4d  65 6e 75 48 65 6c 70 21  |    .. MenuHelp!|
000060c0  30 20 ca 0d 18 42 61 20  20 20 20 20 20 20 20 20  |0 ...Ba         |
000060d0  20 c9 20 30 3a f2 53 65  6e 64 28 22 4d 6f 76 65  | . 0:.Send("Move|
000060e0  20 74 68 65 20 70 6f 69  6e 74 65 72 20 22 2b 44  | the pointer "+D|
000060f0  69 72 65 63 74 69 6f 6e  24 2b 22 20 74 6f 20 73  |irection$+" to s|
00006100  65 65 20 69 6e 66 6f 72  6d 61 74 69 6f 6e 20 61  |ee information a|
00006110  62 6f 75 74 20 54 65 78  74 20 47 72 61 62 62 65  |bout Text Grabbe|
00006120  72 2e 22 29 0d 18 4c 2d  20 20 20 20 20 20 20 20  |r.")..L-        |
00006130  20 20 c9 20 31 3a e7 20  a4 4d 65 6e 75 53 68 61  |  . 1:. .MenuSha|
00006140  64 65 64 28 4d 61 69 6e  4d 65 6e 75 2c 31 29 20  |ded(MainMenu,1) |
00006150  8c 0d 18 56 b6 20 20 20  20 20 20 20 20 20 20 20  |...V.           |
00006160  20 20 20 20 20 20 20 20  f2 53 65 6e 64 28 22 57  |        .Send("W|
00006170  68 65 6e 20 79 6f 75 20  68 61 76 65 20 67 72 61  |hen you have gra|
00006180  62 62 65 64 20 6f 72 20  6c 6f 61 64 65 64 20 73  |bbed or loaded s|
00006190  6f 6d 65 20 74 65 78 74  2c 20 74 68 69 73 20 6f  |ome text, this o|
000061a0  70 74 69 6f 6e 20 77 69  6c 6c 20 63 6c 65 61 72  |ption will clear|
000061b0  20 69 74 20 61 6e 64 20  72 65 73 65 74 20 54 65  | it and reset Te|
000061c0  78 74 20 47 72 61 62 62  65 72 2c 20 74 68 65 72  |xt Grabber, ther|
000061d0  65 62 79 20 66 72 65 65  69 6e 67 20 61 20 73 6d  |eby freeing a sm|
000061e0  61 6c 6c 20 61 6d 6f 75  6e 74 20 6f 66 20 6d 65  |all amount of me|
000061f0  6d 6f 72 79 20 66 6f 72  20 6f 74 68 65 72 20 74  |mory for other t|
00006200  61 73 6b 73 2e 22 29 0d  18 60 16 20 20 20 20 20  |asks.")..`.     |
00006210  20 20 20 20 20 20 20 20  20 20 20 20 cc 0d 18 6a  |            ...j|
00006220  6c 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |l               |
00006230  20 20 20 20 f2 53 65 6e  64 28 22 43 6c 69 63 6b  |    .Send("Click|
00006240  20 53 45 4c 45 43 54 20  6f 72 20 41 44 4a 55 53  | SELECT or ADJUS|
00006250  54 20 74 6f 20 63 6c 65  61 72 20 6f 75 74 20 74  |T to clear out t|
00006260  68 65 20 63 75 72 72 65  6e 74 20 74 65 78 74 20  |he current text |
00006270  61 6e 64 20 72 65 73 65  74 20 54 65 78 74 20 47  |and reset Text G|
00006280  72 61 62 62 65 72 2e 22  29 0d 18 74 58 20 20 20  |rabber.")..tX   |
00006290  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000062a0  f2 53 65 6e 64 28 22 54  68 69 73 20 77 69 6c 6c  |.Send("This will|
000062b0  20 66 72 65 65 20 61 20  73 6d 61 6c 6c 20 61 6d  | free a small am|
000062c0  6f 75 6e 74 20 6f 66 20  6d 65 6d 6f 72 79 20 66  |ount of memory f|
000062d0  6f 72 20 6f 74 68 65 72  20 74 61 73 6b 73 2e 22  |or other tasks."|
000062e0  29 0d 18 7e 16 20 20 20  20 20 20 20 20 20 20 20  |)..~.           |
000062f0  20 20 20 20 20 20 cd 0d  18 88 2d 20 20 20 20 20  |      ....-     |
00006300  20 20 20 20 20 c9 20 32  3a e7 20 a4 4d 65 6e 75  |     . 2:. .Menu|
00006310  53 68 61 64 65 64 28 4d  61 69 6e 4d 65 6e 75 2c  |Shaded(MainMenu,|
00006320  32 29 20 8c 0d 18 92 8b  20 20 20 20 20 20 20 20  |2) .....        |
00006330  20 20 20 20 20 20 20 20  20 20 20 f2 53 65 6e 64  |           .Send|
00006340  28 22 57 68 65 6e 20 79  6f 75 20 68 61 76 65 20  |("When you have |
00006350  67 72 61 62 62 65 64 20  6f 72 20 6c 6f 61 64 65  |grabbed or loade|
00006360  64 20 73 6f 6d 65 20 74  65 78 74 2c 20 74 68 69  |d some text, thi|
00006370  73 20 6f 70 74 69 6f 6e  20 77 69 6c 6c 20 63 61  |s option will ca|
00006380  75 73 65 20 54 65 78 74  20 47 72 61 62 62 65 72  |use Text Grabber|
00006390  20 74 6f 20 74 79 70 65  20 69 74 20 6f 75 74 20  | to type it out |
000063a0  61 74 20 74 68 65 20 63  61 72 65 74 2e 22 29 0d  |at the caret.").|
000063b0  18 9c 16 20 20 20 20 20  20 20 20 20 20 20 20 20  |...             |
000063c0  20 20 20 20 cc 0d 18 a6  67 20 20 20 20 20 20 20  |    ....g       |
000063d0  20 20 20 20 20 20 20 20  20 20 20 20 f2 53 65 6e  |            .Sen|
000063e0  64 28 22 43 6c 69 63 6b  20 53 45 4c 45 43 54 20  |d("Click SELECT |
000063f0  6f 72 20 41 44 4a 55 53  54 20 74 6f 20 6d 61 6b  |or ADJUST to mak|
00006400  65 20 54 65 78 74 20 47  72 61 62 62 65 72 20 74  |e Text Grabber t|
00006410  79 70 65 20 74 68 65 20  74 65 78 74 20 61 74 20  |ype the text at |
00006420  74 68 65 20 63 61 72 65  74 2e 22 29 0d 18 b0 81  |the caret.")....|
00006430  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006440  20 20 20 f2 53 65 6e 64  28 22 54 68 69 73 20 69  |   .Send("This i|
00006450  73 20 75 73 65 66 75 6c  20 69 74 20 74 68 65 20  |s useful it the |
00006460  45 78 70 6f 72 74 20 62  75 74 74 6f 6e 20 64 6f  |Export button do|
00006470  65 73 6e 27 74 20 77 6f  72 6b 20 77 69 74 68 20  |esn't work with |
00006480  74 68 65 20 70 72 6f 67  72 61 6d 20 79 6f 75 20  |the program you |
00006490  61 72 65 20 74 72 79 69  6e 67 20 74 6f 20 73 65  |are trying to se|
000064a0  6e 64 20 74 65 78 74 20  74 6f 2e 22 29 0d 18 ba  |nd text to.")...|
000064b0  16 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
000064c0  20 20 cd 0d 18 c4 78 20  20 20 20 20 20 20 20 20  |  ....x         |
000064d0  20 c9 20 33 3a f2 53 65  6e 64 28 22 4d 6f 76 65  | . 3:.Send("Move|
000064e0  20 74 68 65 20 70 6f 69  6e 74 65 72 20 22 2b 44  | the pointer "+D|
000064f0  69 72 65 63 74 69 6f 6e  24 2b 22 20 74 6f 20 73  |irection$+" to s|
00006500  65 74 20 74 68 65 20 70  6f 73 69 74 69 6f 6e 20  |et the position |
00006510  6f 66 20 74 68 65 20 54  65 78 74 20 47 72 61 62  |of the Text Grab|
00006520  62 65 72 20 77 69 6e 64  6f 77 20 6f 6e 20 74 68  |ber window on th|
00006530  65 20 73 63 72 65 65 6e  2e 22 29 0d 18 ce 2d 20  |e screen.")...- |
00006540  20 20 20 20 20 20 20 20  20 c9 20 34 3a e7 20 a4  |         . 4:. .|
00006550  4d 65 6e 75 53 68 61 64  65 64 28 4d 61 69 6e 4d  |MenuShaded(MainM|
00006560  65 6e 75 2c 34 29 20 8c  0d 18 d8 8b 20 20 20 20  |enu,4) .....    |
00006570  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 f2  |               .|
00006580  53 65 6e 64 28 22 57 68  65 6e 20 79 6f 75 20 68  |Send("When you h|
00006590  61 76 65 20 67 72 61 62  62 65 64 20 6f 72 20 6c  |ave grabbed or l|
000065a0  6f 61 64 65 64 20 73 6f  6d 65 20 74 65 78 74 2c  |oaded some text,|
000065b0  20 74 68 69 73 20 6f 70  74 69 6f 6e 20 77 69 6c  | this option wil|
000065c0  6c 20 61 6c 6c 6f 77 20  79 6f 75 20 74 6f 20 73  |l allow you to s|
000065d0  61 76 65 20 69 74 20 6f  75 74 20 74 6f 20 6f 74  |ave it out to ot|
000065e0  68 65 72 20 64 65 73 74  69 6e 61 74 69 6f 6e 73  |her destinations|
000065f0  2e 22 29 0d 18 e2 16 20  20 20 20 20 20 20 20 20  |.")....         |
00006600  20 20 20 20 20 20 20 20  cc 0d 18 ec 68 20 20 20  |        ....h   |
00006610  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00006620  f2 53 65 6e 64 28 22 4d  6f 76 65 20 74 68 65 20  |.Send("Move the |
00006630  70 6f 69 6e 74 65 72 20  22 2b 44 69 72 65 63 74  |pointer "+Direct|
00006640  69 6f 6e 24 2b 22 20 74  6f 20 73 61 76 65 20 74  |ion$+" to save t|
00006650  68 65 20 67 72 61 62 62  65 64 20 74 65 78 74 20  |he grabbed text |
00006660  61 73 20 61 20 74 65 78  74 20 66 69 6c 65 2e 22  |as a text file."|
00006670  29 0d 18 f6 16 20 20 20  20 20 20 20 20 20 20 20  |)....           |
00006680  20 20 20 20 20 20 cd 0d  19 00 5b 20 20 20 20 20  |      ....[     |
00006690  20 20 20 20 20 c9 20 35  3a f2 53 65 6e 64 28 22  |     . 5:.Send("|
000066a0  43 6c 69 63 6b 20 53 45  4c 45 43 54 20 6f 72 20  |Click SELECT or |
000066b0  41 44 4a 55 53 54 20 74  6f 20 73 61 76 65 20 74  |ADJUST to save t|
000066c0  68 65 20 54 65 78 74 20  47 72 61 62 62 65 72 20  |he Text Grabber |
000066d0  77 69 6e 64 6f 77 20 70  6f 73 69 74 69 6f 6e 2e  |window position.|
000066e0  22 29 0d 19 0a 3c 20 20  20 20 20 20 20 20 20 20  |")...<          |
000066f0  7f 20 f2 53 65 6e 64 28  22 54 68 69 73 20 69 73  |. .Send("This is|
00006700  20 74 68 65 20 54 65 78  74 20 47 72 61 62 62 65  | the Text Grabbe|
00006710  72 20 6d 61 69 6e 20 6d  65 6e 75 2e 22 29 0d 19  |r main menu.")..|
00006720  14 0d 20 20 20 20 20 20  20 20 cb 0d 19 1e 09 20  |..        ..... |
00006730  20 20 20 cb 0d 19 28 07  20 20 cd 0d 19 32 05 cb  |   ...(.  ...2..|
00006740  0d 19 3c 07 20 20 3a 0d  19 46 0f 3f 48 65 6c 70  |..<.  :..F.?Help|
00006750  49 6e 66 6f 3d 30 0d 19  50 24 42 6c 6f 63 6b 21  |Info=0..P$Block!|
00006760  30 3d 28 48 65 6c 70 49  6e 66 6f 2b 34 2d 42 6c  |0=(HelpInfo+4-Bl|
00006770  6f 63 6b 29 20 80 20 ac  20 33 0d 19 5a 2a c8 99  |ock) . . 3..Z*..|
00006780  20 22 57 69 6d 70 5f 53  65 6e 64 4d 65 73 73 61  | "Wimp_SendMessa|
00006790  67 65 22 2c 31 37 2c 42  6c 6f 63 6b 2c 42 6c 6f  |ge",17,Block,Blo|
000067a0  63 6b 21 34 0d 19 64 05  e1 0d 19 6e 05 3a 0d 19  |ck!4..d....n.:..|
000067b0  78 1a dd 20 a4 4f 6d 6e  69 48 65 6c 70 4d 65 73  |x.. .OmniHelpMes|
000067c0  73 61 67 65 28 41 24 29  0d 19 82 3c e7 20 41 24  |sage(A$)...<. A$|
000067d0  3d 22 43 4c 49 43 4b 22  20 8c 20 3d c0 22 6f 70  |="CLICK" . =."op|
000067e0  65 6e 20 74 68 65 20 74  65 78 74 20 67 72 61 62  |en the text grab|
000067f0  62 65 72 20 77 69 6e 64  6f 77 2e 22 2c 37 36 29  |ber window.",76)|
00006800  2b bd 31 33 0d 19 8c 5c  e7 20 41 24 3d 22 44 52  |+.13...\. A$="DR|
00006810  41 47 22 20 8c 20 3d c0  22 44 72 61 67 20 61 20  |AG" . =."Drag a |
00006820  74 65 78 74 20 66 69 6c  65 20 68 65 72 65 20 74  |text file here t|
00006830  6f 20 6c 6f 61 64 20 69  74 20 69 6e 74 6f 20 74  |o load it into t|
00006840  68 65 20 74 65 78 74 20  67 72 61 62 62 65 72 20  |he text grabber |
00006850  77 69 6e 64 6f 77 2e 22  2c 37 36 29 2b bd 31 33  |window.",76)+.13|
00006860  0d 19 96 07 3d 22 22 0d  19 a0 05 3a 0d 19 aa 12  |....=""....:....|
00006870  dd 20 f2 53 65 6e 64 28  54 65 78 74 24 29 0d 19  |. .Send(Text$)..|
00006880  b4 18 24 48 65 6c 70 49  6e 66 6f 3d 54 65 78 74  |..$HelpInfo=Text|
00006890  24 2b 22 7c 4d 22 0d 19  be 18 48 65 6c 70 49 6e  |$+"|M"....HelpIn|
000068a0  66 6f 2b 3d a9 28 54 65  78 74 24 29 2b 32 0d 19  |fo+=.(Text$)+2..|
000068b0  c8 05 e1 0d 19 d2 05 3a  0d 19 dc 16 dd 20 f2 4f  |.......:..... .O|
000068c0  6d 6e 69 44 65 73 6b 43  61 6c 6c 69 6e 67 0d 19  |mniDeskCalling..|
000068d0  e6 14 e7 20 4f 6d 6e 69  44 65 73 6b 3d 30 20 8c  |... OmniDesk=0 .|
000068e0  20 e1 0d 19 f0 49 f4 20  54 68 69 73 20 66 69 72  | ....I. This fir|
000068f0  73 74 20 6c 69 6e 65 20  69 73 20 66 6f 72 20 69  |st line is for i|
00006900  66 20 61 20 62 72 6f 61  64 63 61 73 74 20 6d 65  |f a broadcast me|
00006910  73 73 61 67 65 20 69 73  20 72 65 63 65 69 76 65  |ssage is receive|
00006920  64 20 77 68 69 63 68 20  77 61 73 0d 19 fa 41 f4  |d which was...A.|
00006930  20 69 6e 74 65 6e 64 65  64 20 66 6f 72 20 61 20  | intended for a |
00006940  74 72 61 6e 73 69 65 6e  74 20 63 6f 70 79 20 6f  |transient copy o|
00006950  66 20 74 68 65 20 75 74  69 6c 69 74 79 2e 20 41  |f the utility. A|
00006960  20 73 74 61 6e 64 2d 61  6c 6f 6e 65 0d 1a 04 3f  | stand-alone...?|
00006970  f4 20 69 6e 73 74 61 6e  74 69 61 74 69 6f 6e 20  |. instantiation |
00006980  6f 66 20 74 68 65 20 75  74 69 6c 69 74 79 20 73  |of the utility s|
00006990  68 6f 75 6c 64 20 69 67  6e 6f 72 65 20 73 75 63  |hould ignore suc|
000069a0  68 20 6d 65 73 73 61 67  65 73 2e 0d 1a 0e 11 c8  |h messages......|
000069b0  8e 20 42 6c 6f 63 6b 21  32 30 20 ca 0d 1a 18 2b  |. Block!20 ....+|
000069c0  20 20 c9 20 34 3a f2 4f  70 65 6e 28 47 72 61 62  |  . 4:.Open(Grab|
000069d0  2c b9 2c 58 50 6f 73 69  74 69 6f 6e 2c 59 50 6f  |,.,XPosition,YPo|
000069e0  73 69 74 69 6f 6e 29 0d  1a 22 40 20 20 c9 20 32  |sition).."@  . 2|
000069f0  3a 4c 6f 61 64 46 69 6c  65 45 72 72 6f 72 3d a4  |:LoadFileError=.|
00006a00  4c 6f 61 64 46 69 6c 65  28 42 6c 6f 63 6b 21 34  |LoadFile(Block!4|
00006a10  34 2c 42 6c 6f 63 6b 21  34 38 2c 24 28 42 6c 6f  |4,Block!48,$(Blo|
00006a20  63 6b 2b 35 32 29 29 0d  1a 2c 54 20 20 20 20 20  |ck+52))..,T     |
00006a30  20 20 20 20 42 6c 6f 63  6b 21 30 3d 32 30 3a 42  |    Block!0=20:B|
00006a40  6c 6f 63 6b 21 31 36 3d  55 74 69 6c 41 63 6b 4c  |lock!16=UtilAckL|
00006a50  6f 61 64 3a c8 99 20 22  57 69 6d 70 5f 53 65 6e  |oad:.. "Wimp_Sen|
00006a60  64 4d 65 73 73 61 67 65  22 2c 31 37 2c 42 6c 6f  |dMessage",17,Blo|
00006a70  63 6b 2c 4f 6d 6e 69 44  65 73 6b 0d 1a 36 20 20  |ck,OmniDesk..6  |
00006a80  20 20 20 20 20 20 20 20  f2 43 68 65 63 6b 4c 6f  |        .CheckLo|
00006a90  61 64 46 69 6c 65 45 72  72 6f 72 0d 1a 40 43 20  |adFileError..@C |
00006aa0  20 20 20 20 20 20 20 20  f2 55 70 64 61 74 65 47  |        .UpdateG|
00006ab0  72 61 62 49 63 6f 6e 28  22 22 2c 42 75 66 66 65  |rabIcon("",Buffe|
00006ac0  72 4c 65 6e 67 74 68 2c  a3 29 3a f4 20 54 68 65  |rLength,.):. The|
00006ad0  20 46 41 4c 53 45 20 6c  65 74 73 20 75 73 0d 1a  | FALSE lets us..|
00006ae0  4a 4a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |JJ              |
00006af0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00006b10  20 20 20 20 20 f4 20 69  6e 63 6c 75 64 65 20 43  |     . include C|
00006b20  48 52 24 28 31 33 29 2e  0d 1a 54 2a 20 20 20 20  |HR$(13)...T*    |
00006b30  20 20 20 20 20 f2 55 70  64 61 74 65 49 63 6f 6e  |     .UpdateIcon|
00006b40  43 6f 6c 6f 75 72 28 47  72 61 62 2c 34 2c 37 2c  |Colour(Grab,4,7,|
00006b50  31 29 0d 1a 5e 25 20 20  20 20 20 20 20 20 20 f2  |1)..^%         .|
00006b60  53 68 61 64 65 4d 65 6e  75 28 4d 61 69 6e 4d 65  |ShadeMenu(MainMe|
00006b70  6e 75 2c 31 2c a3 29 0d  1a 68 25 20 20 20 20 20  |nu,1,.)..h%     |
00006b80  20 20 20 20 f2 53 68 61  64 65 4d 65 6e 75 28 4d  |    .ShadeMenu(M|
00006b90  61 69 6e 4d 65 6e 75 2c  32 2c a3 29 0d 1a 72 25  |ainMenu,2,.)..r%|
00006ba0  20 20 20 20 20 20 20 20  20 f2 53 68 61 64 65 4d  |         .ShadeM|
00006bb0  65 6e 75 28 4d 61 69 6e  4d 65 6e 75 2c 34 2c a3  |enu(MainMenu,4,.|
00006bc0  29 0d 1a 7c 2d 20 20 20  20 20 20 20 20 20 54 79  |)..|-         Ty|
00006bd0  70 69 6e 67 3d a3 3a f2  54 69 63 6b 4d 65 6e 75  |ping=.:.TickMenu|
00006be0  28 4d 61 69 6e 4d 65 6e  75 2c 32 2c a3 29 0d 1a  |(MainMenu,2,.)..|
00006bf0  86 45 20 20 20 20 20 20  20 20 20 e7 20 ac 20 a4  |.E         . . .|
00006c00  4f 70 65 6e 53 74 61 74  65 28 47 72 61 62 29 20  |OpenState(Grab) |
00006c10  8c 20 f2 4f 70 65 6e 28  47 72 61 62 2c b9 2c 58  |. .Open(Grab,.,X|
00006c20  50 6f 73 69 74 69 6f 6e  2c 59 50 6f 73 69 74 69  |Position,YPositi|
00006c30  6f 6e 29 0d 1a 90 05 cb  0d 1a 9a 05 e1 0d 1a a4  |on).............|
00006c40  05 3a 0d 1a ae 11 dd 20  f2 4d 6f 64 65 43 68 61  |.:..... .ModeCha|
00006c50  6e 67 65 0d 1a b8 12 44  6f 4d 6f 64 65 43 68 61  |nge....DoModeCha|
00006c60  6e 67 65 3d b9 0d 1a c2  3d e7 20 4f 6d 6e 69 44  |nge=....=. OmniD|
00006c70  65 73 6b 3d 30 20 8c 20  f2 55 70 64 61 74 65 49  |esk=0 . .UpdateI|
00006c80  63 6f 6e 46 6f 72 4d 6f  64 65 28 22 21 54 65 78  |conForMode("!Tex|
00006c90  74 47 72 61 62 22 2c 2d  32 2c 49 63 6f 6e 42 61  |tGrab",-2,IconBa|
00006ca0  72 29 0d 1a cc 05 e1 0d  1a d6 05 3a 0d 1a e0 4f  |r).........:...O|
00006cb0  f4 20 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |. --------------|
00006cc0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00006cf0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 1a ea 38 f4  |-----------...8.|
00006d00  20 47 65 6e 65 72 61 6c  20 6e 6f 6e 2d 73 70 65  | General non-spe|
00006d10  63 69 66 69 63 20 75 73  65 66 75 6c 20 72 6f 75  |cific useful rou|
00006d20  74 69 6e 65 73 20 28 6d  6f 73 74 6c 79 20 77 69  |tines (mostly wi|
00006d30  6d 70 29 0d 1a f4 4f f4  20 2d 2d 2d 2d 2d 2d 2d  |mp)...O. -------|
00006d40  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00006d80  2d 2d 0d 1a fe 05 3a 0d  1b 08 20 dd 20 f2 55 70  |--....:... . .Up|
00006d90  64 61 74 65 49 63 6f 6e  28 57 6e 64 77 2c 49 63  |dateIcon(Wndw,Ic|
00006da0  6e 2c 54 78 74 24 29 0d  1b 12 3a 42 6c 6f 63 6b  |n,Txt$)...:Block|
00006db0  21 30 3d 57 6e 64 77 3a  42 6c 6f 63 6b 21 34 3d  |!0=Wndw:Block!4=|
00006dc0  49 63 6e 3a c8 99 20 22  57 69 6d 70 5f 47 65 74  |Icn:.. "Wimp_Get|
00006dd0  49 63 6f 6e 53 74 61 74  65 22 2c 2c 42 6c 6f 63  |IconState",,Bloc|
00006de0  6b 0d 1b 1c 1c e7 20 a9  28 54 78 74 24 29 3e 28  |k..... .(Txt$)>(|
00006df0  42 6c 6f 63 6b 21 33 36  29 2d 31 20 8c 0d 1b 26  |Block!36)-1 ...&|
00006e00  26 20 20 e7 20 28 28 42  6c 6f 63 6b 21 32 34 29  |&  . ((Block!24)|
00006e10  20 80 20 28 31 3c 3c 39  29 29 3d 28 31 3c 3c 39  | . (1<<9))=(1<<9|
00006e20  29 20 8c 0d 1b 30 19 20  20 20 20 f4 20 52 69 67  |) ...0.    . Rig|
00006e30  68 74 2d 6a 75 73 74 69  66 69 65 64 0d 1b 3a 24  |ht-justified..:$|
00006e40  20 20 20 20 54 78 74 24  3d 22 88 22 2b c2 54 78  |    Txt$="."+.Tx|
00006e50  74 24 2c 28 42 6c 6f 63  6b 21 33 36 29 2d 32 29  |t$,(Block!36)-2)|
00006e60  0d 1b 44 07 20 20 cc 0d  1b 4e 23 20 20 20 20 f4  |..D.  ...N#    .|
00006e70  20 4c 65 66 74 2d 6a 75  73 74 69 66 69 65 64 20  | Left-justified |
00006e80  6f 72 20 63 65 6e 74 72  65 64 0d 1b 58 2b 20 20  |or centred..X+  |
00006e90  20 20 54 78 74 24 3d c0  54 78 74 24 2c 28 42 6c  |  Txt$=.Txt$,(Bl|
00006ea0  6f 63 6b 21 33 36 29 2d  31 29 3a c2 54 78 74 24  |ock!36)-1):.Txt$|
00006eb0  29 3d 22 89 22 0d 1b 62  07 20 20 cd 0d 1b 6c 05  |)="."..b.  ...l.|
00006ec0  cd 0d 1b 76 46 f4 20 5e  20 45 6e 73 75 72 65 73  |...vF. ^ Ensures|
00006ed0  20 74 68 65 20 74 65 78  74 20 63 61 6e 27 74 20  | the text can't |
00006ee0  6f 76 65 72 66 6c 6f 77  20 74 68 65 20 6d 61 78  |overflow the max|
00006ef0  69 6d 75 6d 20 73 70 61  63 65 20 69 6e 20 74 68  |imum space in th|
00006f00  65 20 69 63 6f 6e 2e 0d  1b 80 19 e7 20 24 28 42  |e icon...... $(B|
00006f10  6c 6f 63 6b 21 32 38 29  3c 3e 54 78 74 24 20 8c  |lock!28)<>Txt$ .|
00006f20  0d 1b 8a 2b 20 20 24 28  42 6c 6f 63 6b 21 32 38  |...+  $(Block!28|
00006f30  29 3d 54 78 74 24 3a 42  6c 6f 63 6b 21 38 3d 30  |)=Txt$:Block!8=0|
00006f40  3a 42 6c 6f 63 6b 21 31  32 3d 30 0d 1b 94 23 20  |:Block!12=0...# |
00006f50  20 c8 99 20 22 57 69 6d  70 5f 53 65 74 49 63 6f  | .. "Wimp_SetIco|
00006f60  6e 53 74 61 74 65 22 2c  2c 42 6c 6f 63 6b 0d 1b  |nState",,Block..|
00006f70  9e 05 cd 0d 1b a8 25 c8  99 20 22 57 69 6d 70 5f  |......%.. "Wimp_|
00006f80  47 65 74 43 61 72 65 74  50 6f 73 69 74 69 6f 6e  |GetCaretPosition|
00006f90  22 2c 2c 42 6c 6f 63 6b  0d 1b b2 22 e7 20 42 6c  |",,Block...". Bl|
00006fa0  6f 63 6b 21 30 3d 57 6e  64 77 20 80 20 42 6c 6f  |ock!0=Wndw . Blo|
00006fb0  63 6b 21 34 3d 49 63 6e  20 8c 0d 1b bc 3c 20 20  |ck!4=Icn ....<  |
00006fc0  f4 20 49 66 20 74 68 69  73 20 69 63 6f 6e 20 6f  |. If this icon o|
00006fd0  77 6e 73 20 74 68 65 20  63 61 72 65 74 2c 20 74  |wns the caret, t|
00006fe0  68 65 6e 20 70 75 74 20  69 74 20 61 74 20 74 68  |hen put it at th|
00006ff0  65 20 65 6e 64 2e 0d 1b  c6 38 20 20 c8 99 20 22  |e end....8  .. "|
00007000  57 69 6d 70 5f 53 65 74  43 61 72 65 74 50 6f 73  |Wimp_SetCaretPos|
00007010  69 74 69 6f 6e 22 2c 57  6e 64 77 2c 49 63 6e 2c  |ition",Wndw,Icn,|
00007020  30 2c 30 2c 2d 31 2c a9  28 54 78 74 24 29 0d 1b  |0,0,-1,.(Txt$)..|
00007030  d0 05 cd 0d 1b da 05 e1  0d 1b e4 05 3a 0d 1b ee  |............:...|
00007040  2b dd 20 f2 55 70 64 61  74 65 49 63 6f 6e 43 6f  |+. .UpdateIconCo|
00007050  6c 6f 75 72 28 57 6e 64  77 2c 49 63 6e 2c 46 43  |lour(Wndw,Icn,FC|
00007060  6f 6c 2c 42 43 6f 6c 29  0d 1b f8 1e f4 20 43 68  |ol,BCol)..... Ch|
00007070  61 6e 67 65 20 61 6e 20  69 63 6f 6e 27 73 20 63  |ange an icon's c|
00007080  6f 6c 6f 75 72 73 0d 1c  02 3a 42 6c 6f 63 6b 21  |olours...:Block!|
00007090  30 3d 57 6e 64 77 3a 42  6c 6f 63 6b 21 34 3d 49  |0=Wndw:Block!4=I|
000070a0  63 6e 3a c8 99 20 22 57  69 6d 70 5f 47 65 74 49  |cn:.. "Wimp_GetI|
000070b0  63 6f 6e 53 74 61 74 65  22 2c 2c 42 6c 6f 63 6b  |conState",,Block|
000070c0  0d 1c 0c 3b e7 20 28 28  28 42 6c 6f 63 6b 3f 32  |...;. (((Block?2|
000070d0  37 29 3e 3e 34 29 3d 42  43 6f 6c 29 20 80 20 28  |7)>>4)=BCol) . (|
000070e0  28 28 42 6c 6f 63 6b 3f  32 37 29 20 83 20 31 36  |((Block?27) . 16|
000070f0  29 3d 46 43 6f 6c 29 20  8c 20 e1 0d 1c 16 27 20  |)=FCol) . ....' |
00007100  20 f4 20 5e 20 53 61 6d  65 20 63 6f 6c 6f 75 72  | . ^ Same colour|
00007110  2c 20 73 6f 20 64 6f 6e  27 74 20 63 68 61 6e 67  |, so don't chang|
00007120  65 2e 0d 1c 20 3a 42 6c  6f 63 6b 21 31 32 3d 28  |e... :Block!12=(|
00007130  25 31 31 31 31 31 31 31  31 3c 3c 32 34 29 3a 42  |%11111111<<24):B|
00007140  6c 6f 63 6b 21 38 3d 28  42 43 6f 6c 3c 3c 32 38  |lock!8=(BCol<<28|
00007150  29 2b 28 46 43 6f 6c 3c  3c 32 34 29 0d 1c 2a 21  |)+(FCol<<24)..*!|
00007160  c8 99 20 22 57 69 6d 70  5f 53 65 74 49 63 6f 6e  |.. "Wimp_SetIcon|
00007170  53 74 61 74 65 22 2c 2c  42 6c 6f 63 6b 0d 1c 34  |State",,Block..4|
00007180  05 e1 0d 1c 3e 05 3a 0d  1c 48 29 dd 20 f2 55 70  |....>.:..H). .Up|
00007190  64 61 74 65 53 65 6c 65  63 74 65 64 46 6c 61 67  |dateSelectedFlag|
000071a0  28 57 6e 64 77 2c 49 63  6e 2c 53 74 61 74 65 29  |(Wndw,Icn,State)|
000071b0  0d 1c 52 31 f4 20 55 73  65 20 53 74 61 74 65 3d  |..R1. Use State=|
000071c0  54 52 55 45 20 74 6f 20  6d 61 6b 65 20 69 63 6f  |TRUE to make ico|
000071d0  6e 20 62 65 63 6f 6d 65  20 73 65 6c 65 63 74 65  |n become selecte|
000071e0  64 0d 1c 5c 3a 42 6c 6f  63 6b 21 30 3d 57 6e 64  |d..\:Block!0=Wnd|
000071f0  77 3a 42 6c 6f 63 6b 21  34 3d 49 63 6e 3a c8 99  |w:Block!4=Icn:..|
00007200  20 22 57 69 6d 70 5f 47  65 74 49 63 6f 6e 53 74  | "Wimp_GetIconSt|
00007210  61 74 65 22 2c 2c 42 6c  6f 63 6b 0d 1c 66 2f e7  |ate",,Block..f/.|
00007220  20 28 28 42 6c 6f 63 6b  21 32 34 29 20 80 20 28  | ((Block!24) . (|
00007230  31 3c 3c 32 31 29 29 3d  28 28 2d 53 74 61 74 65  |1<<21))=((-State|
00007240  29 3c 3c 32 31 29 20 8c  20 e1 0d 1c 70 40 42 6c  |)<<21) . ...p@Bl|
00007250  6f 63 6b 21 31 32 3d 28  31 3c 3c 32 31 29 3a e7  |ock!12=(1<<21):.|
00007260  20 53 74 61 74 65 20 8c  20 42 6c 6f 63 6b 21 38  | State . Block!8|
00007270  3d 28 31 3c 3c 32 31 29  20 8b 20 42 6c 6f 63 6b  |=(1<<21) . Block|
00007280  21 38 3d 28 30 3c 3c 32  31 29 0d 1c 7a 21 c8 99  |!8=(0<<21)..z!..|
00007290  20 22 57 69 6d 70 5f 53  65 74 49 63 6f 6e 53 74  | "Wimp_SetIconSt|
000072a0  61 74 65 22 2c 2c 42 6c  6f 63 6b 0d 1c 84 05 e1  |ate",,Block.....|
000072b0  0d 1c 8e 05 3a 0d 1c 98  27 dd 20 f2 55 70 64 61  |....:...'. .Upda|
000072c0  74 65 53 68 61 64 65 64  46 6c 61 67 28 57 6e 64  |teShadedFlag(Wnd|
000072d0  77 2c 49 63 6e 2c 53 74  61 74 65 29 0d 1c a2 2f  |w,Icn,State).../|
000072e0  f4 20 55 73 65 20 53 74  61 74 65 3d 54 52 55 45  |. Use State=TRUE|
000072f0  20 74 6f 20 6d 61 6b 65  20 69 63 6f 6e 20 62 65  | to make icon be|
00007300  63 6f 6d 65 20 73 68 61  64 65 64 0d 1c ac 3a 42  |come shaded...:B|
00007310  6c 6f 63 6b 21 30 3d 57  6e 64 77 3a 42 6c 6f 63  |lock!0=Wndw:Bloc|
00007320  6b 21 34 3d 49 63 6e 3a  c8 99 20 22 57 69 6d 70  |k!4=Icn:.. "Wimp|
00007330  5f 47 65 74 49 63 6f 6e  53 74 61 74 65 22 2c 2c  |_GetIconState",,|
00007340  42 6c 6f 63 6b 0d 1c b6  2f e7 20 28 28 42 6c 6f  |Block.../. ((Blo|
00007350  63 6b 21 32 34 29 20 80  20 28 31 3c 3c 32 32 29  |ck!24) . (1<<22)|
00007360  29 3d 28 28 2d 53 74 61  74 65 29 3c 3c 32 32 29  |)=((-State)<<22)|
00007370  20 8c 20 e1 0d 1c c0 40  42 6c 6f 63 6b 21 31 32  | . ....@Block!12|
00007380  3d 28 31 3c 3c 32 32 29  3a e7 20 53 74 61 74 65  |=(1<<22):. State|
00007390  20 8c 20 42 6c 6f 63 6b  21 38 3d 28 31 3c 3c 32  | . Block!8=(1<<2|
000073a0  32 29 20 8b 20 42 6c 6f  63 6b 21 38 3d 28 30 3c  |2) . Block!8=(0<|
000073b0  3c 32 32 29 0d 1c ca 21  c8 99 20 22 57 69 6d 70  |<22)...!.. "Wimp|
000073c0  5f 53 65 74 49 63 6f 6e  53 74 61 74 65 22 2c 2c  |_SetIconState",,|
000073d0  42 6c 6f 63 6b 0d 1c d4  05 e1 0d 1c de 05 3a 0d  |Block.........:.|
000073e0  1c e8 1e dd 20 a4 53 65  6c 65 63 74 65 64 53 74  |.... .SelectedSt|
000073f0  61 74 65 28 57 6e 64 77  2c 49 63 6e 29 0d 1c f2  |ate(Wndw,Icn)...|
00007400  3a 42 6c 6f 63 6b 21 30  3d 57 6e 64 77 3a 42 6c  |:Block!0=Wndw:Bl|
00007410  6f 63 6b 21 34 3d 49 63  6e 3a c8 99 20 22 57 69  |ock!4=Icn:.. "Wi|
00007420  6d 70 5f 47 65 74 49 63  6f 6e 53 74 61 74 65 22  |mp_GetIconState"|
00007430  2c 2c 42 6c 6f 63 6b 0d  1c fc 29 e7 20 28 28 42  |,,Block...). ((B|
00007440  6c 6f 63 6b 21 32 34 29  20 80 20 28 31 3c 3c 32  |lock!24) . (1<<2|
00007450  31 29 29 3d 28 31 3c 3c  32 31 29 20 8c 20 3d b9  |1))=(1<<21) . =.|
00007460  0d 1d 06 06 3d a3 0d 1d  10 05 3a 0d 1d 1a 1c dd  |....=.....:.....|
00007470  20 a4 53 68 61 64 65 64  53 74 61 74 65 28 57 6e  | .ShadedState(Wn|
00007480  64 77 2c 49 63 6e 29 0d  1d 24 3a 42 6c 6f 63 6b  |dw,Icn)..$:Block|
00007490  21 30 3d 57 6e 64 77 3a  42 6c 6f 63 6b 21 34 3d  |!0=Wndw:Block!4=|
000074a0  49 63 6e 3a c8 99 20 22  57 69 6d 70 5f 47 65 74  |Icn:.. "Wimp_Get|
000074b0  49 63 6f 6e 53 74 61 74  65 22 2c 2c 42 6c 6f 63  |IconState",,Bloc|
000074c0  6b 0d 1d 2e 29 e7 20 28  28 42 6c 6f 63 6b 21 32  |k...). ((Block!2|
000074d0  34 29 20 80 20 28 31 3c  3c 32 32 29 29 3d 28 31  |4) . (1<<22))=(1|
000074e0  3c 3c 32 32 29 20 8c 20  3d b9 0d 1d 38 06 3d a3  |<<22) . =...8.=.|
000074f0  0d 1d 42 05 3a 0d 1d 4c  16 dd 20 a4 4f 70 65 6e  |..B.:..L.. .Open|
00007500  53 74 61 74 65 28 57 6e  64 77 29 0d 1d 56 35 f4  |State(Wndw)..V5.|
00007510  20 52 65 74 75 72 6e 73  20 54 52 55 45 20 69 66  | Returns TRUE if|
00007520  20 77 69 6e 64 6f 77 20  69 73 20 6f 70 65 6e 3b  | window is open;|
00007530  20 66 61 6c 73 65 20 6f  74 68 65 72 77 69 73 65  | false otherwise|
00007540  0d 1d 60 30 42 6c 6f 63  6b 21 30 3d 57 6e 64 77  |..`0Block!0=Wndw|
00007550  3a c8 99 20 22 57 69 6d  70 5f 47 65 74 57 69 6e  |:.. "Wimp_GetWin|
00007560  64 6f 77 53 74 61 74 65  22 2c 2c 42 6c 6f 63 6b  |dowState",,Block|
00007570  0d 1d 6a 29 e7 20 28 28  42 6c 6f 63 6b 21 33 32  |..j). ((Block!32|
00007580  29 20 80 20 28 31 3c 3c  31 36 29 29 3d 28 31 3c  |) . (1<<16))=(1<|
00007590  3c 31 36 29 20 8c 20 3d  b9 0d 1d 74 06 3d a3 0d  |<16) . =...t.=..|
000075a0  1d 7e 05 3a 0d 1d 88 21  dd 20 f2 53 68 61 64 65  |.~.:...!. .Shade|
000075b0  4d 65 6e 75 28 4d 65 6e  75 2c 49 74 65 6d 2c 53  |Menu(Menu,Item,S|
000075c0  74 61 74 65 29 0d 1d 92  50 21 28 4d 65 6e 75 2b  |tate)...P!(Menu+|
000075d0  32 38 2b 28 32 34 2a 49  74 65 6d 29 2b 38 29 3d  |28+(24*Item)+8)=|
000075e0  28 21 28 4d 65 6e 75 2b  32 38 2b 28 32 34 2a 49  |(!(Menu+28+(24*I|
000075f0  74 65 6d 29 2b 38 29 20  80 20 ac 20 28 31 3c 3c  |tem)+8) . . (1<<|
00007600  32 32 29 29 20 82 20 28  28 2d 53 74 61 74 65 29  |22)) . ((-State)|
00007610  3c 3c 32 32 29 0d 1d 9c  05 e1 0d 1d a6 05 3a 0d  |<<22).........:.|
00007620  1d b0 20 dd 20 f2 54 69  63 6b 4d 65 6e 75 28 4d  |.. . .TickMenu(M|
00007630  65 6e 75 2c 49 74 65 6d  2c 53 74 61 74 65 29 0d  |enu,Item,State).|
00007640  1d ba 40 21 28 4d 65 6e  75 2b 32 38 2b 28 32 34  |..@!(Menu+28+(24|
00007650  2a 49 74 65 6d 29 29 3d  28 21 28 4d 65 6e 75 2b  |*Item))=(!(Menu+|
00007660  32 38 2b 28 32 34 2a 49  74 65 6d 29 29 20 80 20  |28+(24*Item)) . |
00007670  ac 20 31 29 20 82 20 28  2d 53 74 61 74 65 29 0d  |. 1) . (-State).|
00007680  1d c4 05 e1 0d 1d ce 05  3a 0d 1d d8 1c dd 20 a4  |........:..... .|
00007690  4d 65 6e 75 53 68 61 64  65 64 28 4d 65 6e 75 2c  |MenuShaded(Menu,|
000076a0  49 74 65 6d 29 0d 1d e2  35 e7 20 28 21 28 4d 65  |Item)...5. (!(Me|
000076b0  6e 75 2b 32 38 2b 28 32  34 2a 49 74 65 6d 29 2b  |nu+28+(24*Item)+|
000076c0  38 29 20 80 20 28 31 3c  3c 32 32 29 29 3d 28 31  |8) . (1<<22))=(1|
000076d0  3c 3c 32 32 29 20 8c 20  3d b9 0d 1d ec 06 3d a3  |<<22) . =.....=.|
000076e0  0d 1d f6 05 3a 0d 1e 00  1c dd 20 a4 4d 65 6e 75  |....:..... .Menu|
000076f0  54 69 63 6b 65 64 28 4d  65 6e 75 2c 49 74 65 6d  |Ticked(Menu,Item|
00007700  29 0d 1e 0a 27 e7 20 28  21 28 4d 65 6e 75 2b 32  |)...'. (!(Menu+2|
00007710  38 2b 28 32 34 2a 49 74  65 6d 29 29 20 80 20 31  |8+(24*Item)) . 1|
00007720  29 3d 31 20 8c 20 3d b9  0d 1e 14 06 3d a3 0d 1e  |)=1 . =.....=...|
00007730  1e 05 3a 0d 1e 28 19 dd  20 a4 52 65 61 64 49 63  |..:..(.. .ReadIc|
00007740  6f 6e 28 57 6e 64 77 2c  49 63 6e 29 0d 1e 32 20  |on(Wndw,Icn)..2 |
00007750  f4 20 52 65 61 64 20 6e  75 6d 65 72 69 63 20 76  |. Read numeric v|
00007760  61 6c 75 65 20 6f 66 20  69 63 6f 6e 0d 1e 3c 3a  |alue of icon..<:|
00007770  42 6c 6f 63 6b 21 30 3d  57 6e 64 77 3a 42 6c 6f  |Block!0=Wndw:Blo|
00007780  63 6b 21 34 3d 49 63 6e  3a c8 99 20 22 57 69 6d  |ck!4=Icn:.. "Wim|
00007790  70 5f 47 65 74 49 63 6f  6e 53 74 61 74 65 22 2c  |p_GetIconState",|
000077a0  2c 42 6c 6f 63 6b 0d 1e  46 13 3d bb 28 24 28 42  |,Block..F.=.($(B|
000077b0  6c 6f 63 6b 21 32 38 29  29 0d 1e 50 05 3a 0d 1e  |lock!28))..P.:..|
000077c0  5a 1c dd 20 a4 52 65 61  64 49 63 6f 6e 53 74 72  |Z.. .ReadIconStr|
000077d0  28 57 6e 64 77 2c 49 63  6e 29 0d 1e 64 1f f4 20  |(Wndw,Icn)..d.. |
000077e0  52 65 61 64 20 73 74 72  69 6e 67 20 76 61 6c 75  |Read string valu|
000077f0  65 20 6f 66 20 69 63 6f  6e 0d 1e 6e 3a 42 6c 6f  |e of icon..n:Blo|
00007800  63 6b 21 30 3d 57 6e 64  77 3a 42 6c 6f 63 6b 21  |ck!0=Wndw:Block!|
00007810  34 3d 49 63 6e 3a c8 99  20 22 57 69 6d 70 5f 47  |4=Icn:.. "Wimp_G|
00007820  65 74 49 63 6f 6e 53 74  61 74 65 22 2c 2c 42 6c  |etIconState",,Bl|
00007830  6f 63 6b 0d 1e 78 10 3d  24 28 42 6c 6f 63 6b 21  |ock..x.=$(Block!|
00007840  32 38 29 0d 1e 82 05 3a  0d 1e 8c 1a dd 20 a4 4d  |28)....:..... .M|
00007850  6f 64 65 49 6e 66 6f 28  76 61 72 24 2c 6d 6f 64  |odeInfo(var$,mod|
00007860  65 29 0d 1e 96 29 f4 20  55 73 65 20 6d 6f 64 65  |e)...). Use mode|
00007870  3d 2d 31 20 66 6f 72 20  63 75 72 72 65 6e 74 20  |=-1 for current |
00007880  73 63 72 65 65 6e 20 6d  6f 64 65 0d 1e a0 0d c8  |screen mode.....|
00007890  8e 20 76 61 72 24 20 ca  0d 1e aa 3a 20 20 c9 20  |. var$ ....:  . |
000078a0  22 58 50 69 78 65 6c 73  22 3a c8 99 20 22 4f 53  |"XPixels":.. "OS|
000078b0  5f 52 65 61 64 4d 6f 64  65 56 61 72 69 61 62 6c  |_ReadModeVariabl|
000078c0  65 22 2c 6d 6f 64 65 2c  31 31 20 b8 20 2c 2c 76  |e",mode,11 . ,,v|
000078d0  61 72 0d 1e b4 3a 20 20  c9 20 22 59 50 69 78 65  |ar...:  . "YPixe|
000078e0  6c 73 22 3a c8 99 20 22  4f 53 5f 52 65 61 64 4d  |ls":.. "OS_ReadM|
000078f0  6f 64 65 56 61 72 69 61  62 6c 65 22 2c 6d 6f 64  |odeVariable",mod|
00007900  65 2c 31 32 20 b8 20 2c  2c 76 61 72 0d 1e be 36  |e,12 . ,,var...6|
00007910  20 20 c9 20 22 4e 43 6f  6c 22 3a c8 99 20 22 4f  |  . "NCol":.. "O|
00007920  53 5f 52 65 61 64 4d 6f  64 65 56 61 72 69 61 62  |S_ReadModeVariab|
00007930  6c 65 22 2c 6d 6f 64 65  2c 33 20 b8 20 2c 2c 76  |le",mode,3 . ,,v|
00007940  61 72 0d 1e c8 3c 20 20  c9 20 22 58 45 69 67 46  |ar...<  . "XEigF|
00007950  61 63 74 6f 72 22 3a c8  99 20 22 4f 53 5f 52 65  |actor":.. "OS_Re|
00007960  61 64 4d 6f 64 65 56 61  72 69 61 62 6c 65 22 2c  |adModeVariable",|
00007970  6d 6f 64 65 2c 34 20 b8  20 2c 2c 76 61 72 0d 1e  |mode,4 . ,,var..|
00007980  d2 3c 20 20 c9 20 22 59  45 69 67 46 61 63 74 6f  |.<  . "YEigFacto|
00007990  72 22 3a c8 99 20 22 4f  53 5f 52 65 61 64 4d 6f  |r":.. "OS_ReadMo|
000079a0  64 65 56 61 72 69 61 62  6c 65 22 2c 6d 6f 64 65  |deVariable",mode|
000079b0  2c 35 20 b8 20 2c 2c 76  61 72 0d 1e dc 3f 20 20  |,5 . ,,var...?  |
000079c0  c9 20 22 42 50 50 22 3a  c8 99 20 22 4f 53 5f 52  |. "BPP":.. "OS_R|
000079d0  65 61 64 4d 6f 64 65 56  61 72 69 61 62 6c 65 22  |eadModeVariable"|
000079e0  2c 6d 6f 64 65 2c 39 20  b8 20 2c 2c 76 61 72 3a  |,mode,9 . ,,var:|
000079f0  76 61 72 3d 32 5e 76 61  72 0d 1e e6 36 20 20 7f  |var=2^var...6  .|
00007a00  20 76 61 72 3d 2d 31 3a  f4 20 46 61 6c 6c 2d 74  | var=-1:. Fall-t|
00007a10  68 72 6f 75 67 68 20 66  6f 72 20 61 20 66 61 75  |hrough for a fau|
00007a20  6c 74 79 20 69 6e 70 75  74 20 76 61 6c 75 65 0d  |lty input value.|
00007a30  1e f0 05 cb 0d 1e fa 08  3d 76 61 72 0d 1f 04 05  |........=var....|
00007a40  3a 0d 1f 0e 2b dd 20 f2  55 70 64 61 74 65 49 63  |:...+. .UpdateIc|
00007a50  6f 6e 46 6f 72 4d 6f 64  65 28 41 70 70 6e 61 6d  |onForMode(Appnam|
00007a60  65 24 2c 57 6e 64 77 2c  49 63 6e 29 0d 1f 18 4e  |e$,Wndw,Icn)...N|
00007a70  f4 20 54 68 69 73 20 70  72 6f 63 65 64 75 72 65  |. This procedure|
00007a80  20 72 65 71 75 69 72 65  73 20 74 68 61 74 20 41  | requires that A|
00007a90  4c 4c 20 74 68 65 20 69  63 6f 6e 20 73 70 72 69  |LL the icon spri|
00007aa0  74 65 73 20 61 72 65 20  64 65 66 69 6e 65 64 20  |tes are defined |
00007ab0  69 6e 20 6d 6f 64 65 20  32 30 0d 1f 22 4e f4 20  |in mode 20.."N. |
00007ac0  6f 72 20 6d 6f 64 65 20  32 37 20 28 77 68 69 63  |or mode 27 (whic|
00007ad0  68 20 69 73 20 65 71 75  69 76 61 6c 65 6e 74 29  |h is equivalent)|
00007ae0  20 77 69 74 68 20 61 20  6d 61 73 6b 20 62 75 74  | with a mask but|
00007af0  20 6e 6f 20 70 61 6c 65  74 74 65 2e 20 54 68 65  | no palette. The|
00007b00  79 20 73 68 6f 75 6c 64  0d 1f 2c 4e f4 20 73 74  |y should..,N. st|
00007b10  69 6c 6c 20 61 70 70 65  61 72 20 74 6f 20 68 61  |ill appear to ha|
00007b20  76 65 20 74 68 65 20 65  78 70 65 63 74 65 64 20  |ve the expected |
00007b30  72 65 73 6f 6c 75 74 69  6f 6e 73 20 61 6e 64 20  |resolutions and |
00007b40  6e 75 6d 62 65 72 20 6f  66 20 63 6f 6c 6f 75 72  |number of colour|
00007b50  73 2c 20 69 2e 65 0d 1f  36 4e f4 20 21 53 70 72  |s, i.e..6N. !Spr|
00007b60  69 74 65 73 32 33 3a 20  74 77 6f 20 63 6f 6c 6f  |ites23: two colo|
00007b70  75 72 73 2c 20 68 69 67  68 20 72 65 73 6f 6c 75  |urs, high resolu|
00007b80  74 69 6f 6e 2c 20 21 53  70 72 69 74 65 73 20 28  |tion, !Sprites (|
00007b90  61 63 74 75 61 6c 6c 79  20 21 53 70 72 69 74 65  |actually !Sprite|
00007ba0  73 32 34 29 0d 1f 40 4c  f4 20 61 74 20 6d 6f 64  |s24)..@L. at mod|
00007bb0  65 20 31 32 20 72 65 73  6f 6c 75 74 69 6f 6e 20  |e 12 resolution |
00007bc0  28 64 6f 75 62 6c 65 20  68 65 69 67 68 74 20 70  |(double height p|
00007bd0  69 78 65 6c 73 29 20 69  6e 20 31 36 20 63 6f 6c  |ixels) in 16 col|
00007be0  6f 75 72 73 2c 20 61 6e  64 20 6e 6f 72 6d 61 6c  |ours, and normal|
00007bf0  0d 1f 4a 4c f4 20 6d 6f  64 65 20 32 30 20 72 65  |..JL. mode 20 re|
00007c00  73 6f 6c 75 74 69 6f 6e  2c 20 31 36 20 63 6f 6c  |solution, 16 col|
00007c10  6f 75 72 73 20 66 6f 72  20 74 68 65 20 21 53 70  |ours for the !Sp|
00007c20  72 69 74 65 73 32 32 20  69 63 6f 6e 2e 20 49 66  |rites22 icon. If|
00007c30  20 74 68 69 73 20 69 73  20 6e 6f 74 0d 1f 54 49  | this is not..TI|
00007c40  f4 20 61 64 68 65 72 65  64 20 74 6f 2c 20 74 68  |. adhered to, th|
00007c50  65 6e 20 6d 65 6d 6f 72  79 20 73 68 6f 72 74 61  |en memory shorta|
00007c60  67 65 20 65 72 72 6f 72  73 20 6d 61 79 20 6f 63  |ge errors may oc|
00007c70  63 75 72 20 6f 6e 20 61  20 6d 6f 64 65 20 63 68  |cur on a mode ch|
00007c80  61 6e 67 65 2e 0d 1f 5e  13 45 78 74 65 6e 73 69  |ange...^.Extensi|
00007c90  6f 6e 24 3d 22 32 34 22  0d 1f 68 24 e7 20 a4 4d  |on$="24"..h$. .M|
00007ca0  6f 64 65 49 6e 66 6f 28  22 59 45 69 67 46 61 63  |odeInfo("YEigFac|
00007cb0  74 6f 72 22 2c 2d 31 29  3c 32 20 8c 0d 1f 72 20  |tor",-1)<2 ...r |
00007cc0  20 20 e7 20 a4 4d 6f 64  65 49 6e 66 6f 28 22 4e  |  . .ModeInfo("N|
00007cd0  43 6f 6c 22 2c 2d 31 29  3e 32 20 8c 0d 1f 7c 17  |Col",-1)>2 ...|.|
00007ce0  20 20 20 20 45 78 74 65  6e 73 69 6f 6e 24 3d 22  |    Extension$="|
00007cf0  32 32 22 0d 1f 86 07 20  20 cc 0d 1f 90 17 20 20  |22"....  .....  |
00007d00  20 20 45 78 74 65 6e 73  69 6f 6e 24 3d 22 32 33  |  Extension$="23|
00007d10  22 0d 1f 9a 07 20 20 cd  0d 1f a4 05 cd 0d 1f ae  |"....  .........|
00007d20  2a c8 99 20 22 57 69 6d  70 5f 42 61 73 65 4f 66  |*.. "Wimp_BaseOf|
00007d30  53 70 72 69 74 65 73 22  20 b8 20 2c 69 63 6f 6e  |Sprites" . ,icon|
00007d40  73 70 72 69 74 65 25 0d  1f b8 45 c8 99 20 22 4f  |sprite%...E.. "O|
00007d50  53 5f 53 70 72 69 74 65  4f 70 22 2c 32 35 36 2b  |S_SpriteOp",256+|
00007d60  32 35 2c 69 63 6f 6e 73  70 72 69 74 65 25 2c 41  |25,iconsprite%,A|
00007d70  70 70 6e 61 6d 65 24 3a  f4 20 44 65 6c 65 74 65  |ppname$:. Delete|
00007d80  20 69 63 6f 6e 20 73 70  72 69 74 65 0d 1f c2 3d  | icon sprite...=|
00007d90  f4 20 54 68 65 20 66 6f  6c 6c 6f 77 69 6e 67 20  |. The following |
00007da0  74 68 72 65 65 20 6c 69  6e 65 73 20 61 73 73 75  |three lines assu|
00007db0  6d 65 20 61 20 6d 61 73  6b 20 62 75 74 20 6e 6f  |me a mask but no|
00007dc0  20 70 61 6c 65 74 74 65  3a 0d 1f cc 62 c8 99 20  | palette:...b.. |
00007dd0  22 4f 53 5f 53 70 72 69  74 65 4f 70 22 2c 32 35  |"OS_SpriteOp",25|
00007de0  36 2b 34 30 2c 53 70 72  69 74 65 73 2c 41 70 70  |6+40,Sprites,App|
00007df0  6e 61 6d 65 24 2b 45 78  74 65 6e 73 69 6f 6e 24  |name$+Extension$|
00007e00  20 b8 20 2c 2c 2c 77 2c  68 2c 2c 6d 6f 64 65 3a  | . ,,,w,h,,mode:|
00007e10  f4 20 47 65 74 20 69 6e  66 6f 20 61 62 6f 75 74  |. Get info about|
00007e20  20 6e 65 77 20 73 70 72  69 74 65 0d 1f d6 5c c8  | new sprite...\.|
00007e30  99 20 22 4f 53 5f 53 70  72 69 74 65 4f 70 22 2c  |. "OS_SpriteOp",|
00007e40  32 35 36 2b 31 35 2c 69  63 6f 6e 73 70 72 69 74  |256+15,iconsprit|
00007e50  65 25 2c 41 70 70 6e 61  6d 65 24 2c 30 2c 77 2c  |e%,Appname$,0,w,|
00007e60  68 2c 6d 6f 64 65 3a f4  20 43 72 65 61 74 65 20  |h,mode:. Create |
00007e70  72 65 70 6c 61 63 65 6d  65 6e 74 20 69 63 6f 6e  |replacement icon|
00007e80  20 73 70 72 69 74 65 0d  1f e0 3e c8 99 20 22 4f  | sprite...>.. "O|
00007e90  53 5f 53 70 72 69 74 65  4f 70 22 2c 32 35 36 2b  |S_SpriteOp",256+|
00007ea0  32 39 2c 69 63 6f 6e 73  70 72 69 74 65 25 2c 41  |29,iconsprite%,A|
00007eb0  70 70 6e 61 6d 65 24 3a  f4 20 43 72 65 61 74 65  |ppname$:. Create|
00007ec0  20 6d 61 73 6b 0d 1f ea  07 20 20 3a 0d 1f f4 2d  | mask....  :...-|
00007ed0  f4 20 50 61 69 6e 74 20  73 70 72 69 74 65 20 6d  |. Paint sprite m|
00007ee0  61 73 6b 20 69 6e 74 6f  20 69 63 6f 6e 73 70 72  |ask into iconspr|
00007ef0  69 74 65 20 6d 61 73 6b  3a 0d 1f fe 51 c8 99 20  |ite mask:...Q.. |
00007f00  22 4f 53 5f 53 70 72 69  74 65 4f 70 22 2c 32 35  |"OS_SpriteOp",25|
00007f10  36 2b 36 31 2c 69 63 6f  6e 73 70 72 69 74 65 25  |6+61,iconsprite%|
00007f20  2c 41 70 70 6e 61 6d 65  24 2c 30 20 b8 20 72 30  |,Appname$,0 . r0|
00007f30  2c 72 31 2c 72 32 2c 72  33 3a f4 20 4f 75 74 70  |,r1,r2,r3:. Outp|
00007f40  75 74 20 74 6f 20 6d 61  73 6b 0d 20 08 55 c8 99  |ut to mask. .U..|
00007f50  20 22 4f 53 5f 53 70 72  69 74 65 4f 70 22 2c 32  | "OS_SpriteOp",2|
00007f60  35 36 2b 34 39 2c 53 70  72 69 74 65 73 2c 41 70  |56+49,Sprites,Ap|
00007f70  70 6e 61 6d 65 24 2b 45  78 74 65 6e 73 69 6f 6e  |pname$+Extension|
00007f80  24 2c 30 2c 30 3a f4 20  50 61 69 6e 74 20 6d 61  |$,0,0:. Paint ma|
00007f90  73 6b 20 66 72 6f 6d 20  53 70 72 69 74 65 73 0d  |sk from Sprites.|
00007fa0  20 12 37 e6 20 34 2c 31  32 38 3a da 3a f4 20 49  | .7. 4,128:.:. I|
00007fb0  6e 76 65 72 74 20 74 6f  20 6d 61 6b 65 20 6d 61  |nvert to make ma|
00007fc0  73 6b 20 74 68 65 20 72  69 67 68 74 20 77 61 79  |sk the right way|
00007fd0  20 72 6f 75 6e 64 0d 20  1c 36 c8 99 20 22 4f 53  | round. .6.. "OS|
00007fe0  5f 53 70 72 69 74 65 4f  70 22 2c 72 30 2c 72 31  |_SpriteOp",r0,r1|
00007ff0  2c 72 32 2c 72 33 3a f4  20 52 65 73 65 74 20 73  |,r2,r3:. Reset s|
00008000  63 72 65 65 6e 20 6f 75  74 70 75 74 0d 20 26 07  |creen output. &.|
00008010  20 20 3a 0d 20 30 23 f4  20 50 61 69 6e 74 20 73  |  :. 0#. Paint s|
00008020  70 72 69 74 65 20 69 6e  74 6f 20 69 63 6f 6e 73  |prite into icons|
00008030  70 72 69 74 65 3a 0d 20  3a 5c c8 99 20 22 4f 53  |prite:. :\.. "OS|
00008040  5f 53 70 72 69 74 65 4f  70 22 2c 32 35 36 2b 36  |_SpriteOp",256+6|
00008050  30 2c 69 63 6f 6e 73 70  72 69 74 65 25 2c 41 70  |0,iconsprite%,Ap|
00008060  70 6e 61 6d 65 24 2c 30  20 b8 20 72 30 2c 72 31  |pname$,0 . r0,r1|
00008070  2c 72 32 2c 72 33 3a f4  20 4f 75 74 70 75 74 20  |,r2,r3:. Output |
00008080  74 6f 20 6e 65 77 20 69  63 6f 6e 20 73 70 72 69  |to new icon spri|
00008090  74 65 0d 20 44 57 c8 99  20 22 4f 53 5f 53 70 72  |te. DW.. "OS_Spr|
000080a0  69 74 65 4f 70 22 2c 32  35 36 2b 33 34 2c 53 70  |iteOp",256+34,Sp|
000080b0  72 69 74 65 73 2c 41 70  70 6e 61 6d 65 24 2b 45  |rites,Appname$+E|
000080c0  78 74 65 6e 73 69 6f 6e  24 2c 30 2c 30 2c 38 3a  |xtension$,0,0,8:|
000080d0  f4 20 50 61 69 6e 74 20  63 6f 70 79 20 66 72 6f  |. Paint copy fro|
000080e0  6d 20 53 70 72 69 74 65  73 0d 20 4e 36 c8 99 20  |m Sprites. N6.. |
000080f0  22 4f 53 5f 53 70 72 69  74 65 4f 70 22 2c 72 30  |"OS_SpriteOp",r0|
00008100  2c 72 31 2c 72 32 2c 72  33 3a f4 20 52 65 73 65  |,r1,r2,r3:. Rese|
00008110  74 20 73 63 72 65 65 6e  20 6f 75 74 70 75 74 0d  |t screen output.|
00008120  20 58 3a 42 6c 6f 63 6b  21 30 3d 57 6e 64 77 3a  | X:Block!0=Wndw:|
00008130  42 6c 6f 63 6b 21 34 3d  49 63 6e 3a c8 99 20 22  |Block!4=Icn:.. "|
00008140  57 69 6d 70 5f 47 65 74  49 63 6f 6e 53 74 61 74  |Wimp_GetIconStat|
00008150  65 22 2c 2c 42 6c 6f 63  6b 0d 20 62 45 42 6c 6f  |e",,Block. bEBlo|
00008160  63 6b 21 38 3d 30 3a 42  6c 6f 63 6b 21 31 32 3d  |ck!8=0:Block!12=|
00008170  30 3a c8 99 20 22 57 69  6d 70 5f 53 65 74 49 63  |0:.. "Wimp_SetIc|
00008180  6f 6e 53 74 61 74 65 22  2c 2c 42 6c 6f 63 6b 3a  |onState",,Block:|
00008190  f4 20 52 65 2d 70 6c 6f  74 20 69 63 6f 6e 0d 20  |. Re-plot icon. |
000081a0  6c 05 e1 0d 20 76 05 3a  0d 20 80 d8 dd 20 a4 43  |l... v.:. ... .C|
000081b0  72 65 61 74 65 57 69 6e  64 6f 77 28 6d 69 6e 58  |reateWindow(minX|
000081c0  2c 6d 69 6e 59 2c 6d 61  78 58 2c 6d 61 78 59 2c  |,minY,maxX,maxY,|
000081d0  58 6f 66 66 73 65 74 2c  59 6f 66 66 73 65 74 2c  |Xoffset,Yoffset,|
000081e0  48 61 6e 64 6c 65 2c 46  6c 61 67 73 2c 54 69 74  |Handle,Flags,Tit|
000081f0  6c 65 43 6f 6c 2c 54 69  74 6c 65 42 61 63 6b 43  |leCol,TitleBackC|
00008200  6f 6c 2c 57 6f 72 6b 43  6f 6c 2c 57 6f 72 6b 42  |ol,WorkCol,WorkB|
00008210  61 63 6b 43 6f 6c 2c 53  63 72 6f 6c 6c 43 6f 6c  |ackCol,ScrollCol|
00008220  2c 53 6c 69 64 65 72 43  6f 6c 2c 49 6e 70 75 74  |,SliderCol,Input|
00008230  43 6f 6c 2c 57 6d 69 6e  58 2c 57 6d 69 6e 59 2c  |Col,WminX,WminY,|
00008240  57 6d 61 78 58 2c 57 6d  61 78 59 2c 54 69 74 6c  |WmaxX,WmaxY,Titl|
00008250  65 46 6c 61 67 73 2c 57  62 75 74 74 6f 6e 2c 53  |eFlags,Wbutton,S|
00008260  70 72 69 74 65 50 6f 69  6e 74 2c 4d 69 6e 57 2c  |pritePoint,MinW,|
00008270  4d 69 6e 48 2c 54 69 74  6c 65 44 61 74 61 24 29  |MinH,TitleData$)|
00008280  0d 20 8a 5a 42 6c 6f 63  6b 21 30 3d 6d 69 6e 58  |. .ZBlock!0=minX|
00008290  3a 42 6c 6f 63 6b 21 34  3d 6d 69 6e 59 3a 42 6c  |:Block!4=minY:Bl|
000082a0  6f 63 6b 21 38 3d 6d 61  78 58 3a 42 6c 6f 63 6b  |ock!8=maxX:Block|
000082b0  21 31 32 3d 6d 61 78 59  3a 42 6c 6f 63 6b 21 31  |!12=maxY:Block!1|
000082c0  36 3d 58 6f 66 66 73 65  74 3a 42 6c 6f 63 6b 21  |6=Xoffset:Block!|
000082d0  32 30 3d 59 6f 66 66 73  65 74 0d 20 94 22 42 6c  |20=Yoffset. ."Bl|
000082e0  6f 63 6b 21 32 34 3d 48  61 6e 64 6c 65 3a 42 6c  |ock!24=Handle:Bl|
000082f0  6f 63 6b 21 32 38 3d 46  6c 61 67 73 0d 20 9e 51  |ock!28=Flags. .Q|
00008300  42 6c 6f 63 6b 3f 33 32  3d 54 69 74 6c 65 43 6f  |Block?32=TitleCo|
00008310  6c 3a 42 6c 6f 63 6b 3f  33 33 3d 54 69 74 6c 65  |l:Block?33=Title|
00008320  42 61 63 6b 43 6f 6c 3a  42 6c 6f 63 6b 3f 33 34  |BackCol:Block?34|
00008330  3d 57 6f 72 6b 43 6f 6c  3a 42 6c 6f 63 6b 3f 33  |=WorkCol:Block?3|
00008340  35 3d 57 6f 72 6b 42 61  63 6b 43 6f 6c 0d 20 a8  |5=WorkBackCol. .|
00008350  46 42 6c 6f 63 6b 3f 33  36 3d 53 63 72 6f 6c 6c  |FBlock?36=Scroll|
00008360  43 6f 6c 3a 42 6c 6f 63  6b 3f 33 37 3d 53 6c 69  |Col:Block?37=Sli|
00008370  64 65 72 43 6f 6c 3a 42  6c 6f 63 6b 3f 33 38 3d  |derCol:Block?38=|
00008380  49 6e 70 75 74 43 6f 6c  3a 42 6c 6f 63 6b 3f 33  |InputCol:Block?3|
00008390  39 3d 30 0d 20 b2 3f 42  6c 6f 63 6b 21 34 30 3d  |9=0. .?Block!40=|
000083a0  57 6d 69 6e 58 3a 42 6c  6f 63 6b 21 34 34 3d 57  |WminX:Block!44=W|
000083b0  6d 69 6e 59 3a 42 6c 6f  63 6b 21 34 38 3d 57 6d  |minY:Block!48=Wm|
000083c0  61 78 58 3a 42 6c 6f 63  6b 21 35 32 3d 57 6d 61  |axX:Block!52=Wma|
000083d0  78 59 0d 20 bc 3d 42 6c  6f 63 6b 21 35 36 3d 54  |xY. .=Block!56=T|
000083e0  69 74 6c 65 46 6c 61 67  73 3a 42 6c 6f 63 6b 21  |itleFlags:Block!|
000083f0  36 30 3d 57 62 75 74 74  6f 6e 3a 42 6c 6f 63 6b  |60=Wbutton:Block|
00008400  21 36 34 3d 53 70 72 69  74 65 50 6f 69 6e 74 0d  |!64=SpritePoint.|
00008410  20 c6 5f 42 6c 6f 63 6b  21 36 38 3d 28 4d 69 6e  | ._Block!68=(Min|
00008420  48 3c 3c 31 35 29 2b 4d  69 6e 57 20 3a 3a 3a 3a  |H<<15)+MinW ::::|
00008430  3a 3a 3a 3a 3a 3a 3a 3a  20 f4 20 30 2c 30 20 73  |:::::::: . 0,0 s|
00008440  65 74 73 20 74 68 65 20  6d 69 6e 69 6d 75 6d 20  |ets the minimum |
00008450  77 69 6e 64 6f 77 20 77  69 74 68 20 74 6f 20 74  |window with to t|
00008460  68 65 20 74 69 74 6c 65  20 77 69 64 74 68 0d 20  |he title width. |
00008470  d0 3e 24 28 42 6c 6f 63  6b 2b 37 32 29 3d 54 69  |.>$(Block+72)=Ti|
00008480  74 6c 65 44 61 74 61 24  3a 42 6c 6f 63 6b 21 38  |tleData$:Block!8|
00008490  34 3d 30 20 3a 3a 3a 20  f4 20 4e 6f 20 69 63 6f  |4=0 ::: . No ico|
000084a0  6e 73 20 69 6e 69 74 69  61 6c 6c 79 0d 20 da 30  |ns initially. .0|
000084b0  c8 99 20 22 57 69 6d 70  5f 43 72 65 61 74 65 57  |.. "Wimp_CreateW|
000084c0  69 6e 64 6f 77 22 2c 2c  42 6c 6f 63 6b 20 b8 20  |indow",,Block . |
000084d0  57 69 6e 64 6f 77 48 61  6e 64 6c 65 0d 20 e4 11  |WindowHandle. ..|
000084e0  3d 57 69 6e 64 6f 77 48  61 6e 64 6c 65 0d 20 ee  |=WindowHandle. .|
000084f0  05 3a 0d 20 f8 11 dd 20  f2 49 6e 69 74 69 61 6c  |.:. ... .Initial|
00008500  69 73 65 0d 21 02 2d 41  70 70 53 69 7a 65 3d 93  |ise.!.-AppSize=.|
00008510  2d 26 38 30 30 30 3a 4d  69 6e 53 69 7a 65 3d 41  |-&8000:MinSize=A|
00008520  70 70 53 69 7a 65 3a 53  6c 6f 74 45 6e 64 3d 93  |ppSize:SlotEnd=.|
00008530  0d 21 0c 05 e1 0d 21 16  05 3a 0d 21 20 1f dd 20  |.!....!..:.! .. |
00008540  a4 41 6c 6c 6f 63 61 74  65 4d 65 6d 6f 72 79 28  |.AllocateMemory(|
00008550  52 65 71 75 69 72 65 64  29 0d 21 2a 1a 53 6c 6f  |Required).!*.Slo|
00008560  74 53 69 7a 65 3d a4 53  6c 6f 74 53 69 7a 65 28  |tSize=.SlotSize(|
00008570  2d 31 29 0d 21 34 92 e7  20 53 6c 6f 74 53 69 7a  |-1).!4.. SlotSiz|
00008580  65 3c 52 65 71 75 69 72  65 64 20 8c 20 4e 65 77  |e<Required . New|
00008590  53 69 7a 65 3d a4 53 6c  6f 74 53 69 7a 65 28 52  |Size=.SlotSize(R|
000085a0  65 71 75 69 72 65 64 29  3a e7 20 4e 65 77 53 69  |equired):. NewSi|
000085b0  7a 65 3c 52 65 71 75 69  72 65 64 20 8c 20 53 6c  |ze<Required . Sl|
000085c0  6f 74 53 69 7a 65 3d a4  53 6c 6f 74 53 69 7a 65  |otSize=.SlotSize|
000085d0  28 41 70 70 53 69 7a 65  29 3a 3d 30 3a f4 20 52  |(AppSize):=0:. R|
000085e0  65 74 75 72 6e 73 2c 20  69 6e 64 69 63 61 74 69  |eturns, indicati|
000085f0  6e 67 20 6d 65 6d 6f 72  79 20 6e 6f 74 20 63 6c  |ng memory not cl|
00008600  61 69 6d 65 64 0d 21 3e  36 e7 20 53 6c 6f 74 53  |aimed.!>6. SlotS|
00008610  69 7a 65 3e 52 65 71 75  69 72 65 64 20 8c 20 53  |ize>Required . S|
00008620  6c 6f 74 53 69 7a 65 3d  a4 53 6c 6f 74 53 69 7a  |lotSize=.SlotSiz|
00008630  65 28 52 65 71 75 69 72  65 64 29 0d 21 48 2a 3d  |e(Required).!H*=|
00008640  53 6c 6f 74 53 69 7a 65  3a f4 20 52 65 74 75 72  |SlotSize:. Retur|
00008650  6e 73 20 77 69 74 68 20  62 79 74 65 73 20 63 6c  |ns with bytes cl|
00008660  61 69 6d 65 64 0d 21 52  05 3a 0d 21 5c 16 dd 20  |aimed.!R.:.!\.. |
00008670  a4 53 6c 6f 74 53 69 7a  65 28 42 79 74 65 73 29  |.SlotSize(Bytes)|
00008680  0d 21 66 27 c8 99 20 22  57 69 6d 70 5f 53 6c 6f  |.!f'.. "Wimp_Slo|
00008690  74 53 69 7a 65 22 2c 42  79 74 65 73 2c 2d 31 20  |tSize",Bytes,-1 |
000086a0  b8 20 42 79 74 65 73 0d  21 70 0a 3d 42 79 74 65  |. Bytes.!p.=Byte|
000086b0  73 0d 21 7a 05 3a 0d 21  84 17 dd 20 f2 4d 69 6e  |s.!z.:.!... .Min|
000086c0  69 6d 69 73 65 57 69 6d  70 53 6c 6f 74 0d 21 8e  |imiseWimpSlot.!.|
000086d0  22 64 75 6d 6d 79 3d a4  41 6c 6c 6f 63 61 74 65  |"dummy=.Allocate|
000086e0  4d 65 6d 6f 72 79 28 4d  69 6e 53 69 7a 65 29 0d  |Memory(MinSize).|
000086f0  21 98 05 e1 0d 21 a2 05  3a 0d 21 ac 22 dd 20 f2  |!....!..:.!.". .|
00008700  43 6c 6f 73 65 46 69 6c  65 49 66 50 6f 73 73 28  |CloseFileIfPoss(|
00008710  46 69 6c 65 48 61 6e 64  6c 65 29 0d 21 b6 07 ea  |FileHandle).!...|
00008720  20 85 0d 21 c0 26 ee 20  85 20 ea 20 f7 20 85 3a  | ..!.&. . . . .:|
00008730  e1 3a f4 20 55 6e 61 62  6c 65 20 74 6f 20 63 6c  |.:. Unable to cl|
00008740  6f 73 65 20 66 69 6c 65  0d 21 ca 10 d9 23 46 69  |ose file.!...#Fi|
00008750  6c 65 48 61 6e 64 6c 65  0d 21 d4 05 e1 0d 21 de  |leHandle.!....!.|
00008760  05 3a 0d 21 e8 1e dd 20  a4 46 69 6e 64 46 69 6c  |.:.!... .FindFil|
00008770  65 53 69 7a 65 28 46 69  6c 65 4e 61 6d 65 24 29  |eSize(FileName$)|
00008780  0d 21 f2 20 e7 20 46 69  6c 65 4e 61 6d 65 24 3d  |.!. . FileName$=|
00008790  22 3c 57 69 6d 70 24 53  63 72 61 70 3e 22 20 8c  |"<Wimp$Scrap>" .|
000087a0  0d 21 fc 3a 20 20 c8 99  20 22 4f 53 5f 46 69 6c  |.!.:  .. "OS_Fil|
000087b0  65 22 2c 31 35 2c 46 69  6c 65 4e 61 6d 65 24 2c  |e",15,FileName$,|
000087c0  2c 2c 46 69 6c 65 4e 61  6d 65 24 20 b8 20 2c 2c  |,,FileName$ . ,,|
000087d0  2c 2c 46 69 6c 65 53 69  7a 65 0d 22 06 05 cc 0d  |,,FileSize."....|
000087e0  22 10 34 20 20 4e 3d 2d  31 3a f5 3a 4e 2b 3d 31  |".4  N=-1:.:N+=1|
000087f0  3a fd 20 c1 46 69 6c 65  4e 61 6d 65 24 2c a9 28  |:. .FileName$,.(|
00008800  46 69 6c 65 4e 61 6d 65  24 29 2d 4e 2c 31 29 3d  |FileName$)-N,1)=|
00008810  22 2e 22 0d 22 1a 42 20  20 50 61 74 68 4e 61 6d  |".".".B  PathNam|
00008820  65 24 3d c0 46 69 6c 65  4e 61 6d 65 24 2c a9 28  |e$=.FileName$,.(|
00008830  46 69 6c 65 4e 61 6d 65  24 29 2d 4e 29 3a 4c 65  |FileName$)-N):Le|
00008840  61 66 4e 61 6d 65 24 3d  c2 46 69 6c 65 4e 61 6d  |afName$=.FileNam|
00008850  65 24 2c 4e 29 0d 22 24  3a 20 20 c8 99 20 22 4f  |e$,N)."$:  .. "O|
00008860  53 5f 46 69 6c 65 22 2c  31 33 2c 4c 65 61 66 4e  |S_File",13,LeafN|
00008870  61 6d 65 24 2c 2c 2c 50  61 74 68 4e 61 6d 65 24  |ame$,,,PathName$|
00008880  20 b8 20 2c 2c 2c 2c 46  69 6c 65 53 69 7a 65 0d  | . ,,,,FileSize.|
00008890  22 2e 05 cd 0d 22 38 0d  3d 46 69 6c 65 53 69 7a  |"...."8.=FileSiz|
000088a0  65 0d 22 42 05 3a 0d 22  4c 10 dd 20 a4 4e 65 78  |e."B.:."L.. .Nex|
000088b0  74 45 6e 74 72 79 0d 22  56 48 f4 20 47 65 74 73  |tEntry."VH. Gets|
000088c0  20 6e 65 78 74 20 65 6e  74 72 79 20 28 63 72 65  | next entry (cre|
000088d0  61 74 65 64 20 62 79 20  42 50 55 54 23 44 61 74  |ated by BPUT#Dat|
000088e0  61 2c 41 24 29 20 66 72  6f 6d 20 61 20 66 69 6c  |a,A$) from a fil|
000088f0  65 20 61 73 20 61 20 73  74 72 69 6e 67 2e 0d 22  |e as a string.."|
00008900  60 1c f4 20 55 73 65 20  61 73 20 41 24 3d 46 4e  |`.. Use as A$=FN|
00008910  4e 65 78 74 45 6e 74 72  79 2e 0d 22 6a 07 ea 20  |NextEntry.."j.. |
00008920  85 0d 22 74 26 ee 20 85  20 ea 20 f7 20 85 3a 3d  |.."t&. . . . .:=|
00008930  22 22 3a f4 20 45 72 72  6f 72 20 72 65 61 64 69  |"":. Error readi|
00008940  6e 67 20 66 69 6c 65 0d  22 7e 0e 4e 45 24 3d be  |ng file."~.NE$=.|
00008950  23 44 61 74 61 0d 22 88  12 c8 95 20 c0 4e 45 24  |#Data.".... .NE$|
00008960  2c 31 29 3d 22 7c 22 0d  22 92 10 20 20 4e 45 24  |,1)="|"."..  NE$|
00008970  3d be 23 44 61 74 61 0d  22 9c 05 ce 0d 22 a6 08  |=.#Data."...."..|
00008980  3d 4e 45 24 0d 22 b0 05  3a 0d 22 ba 47 dd 20 f2  |=NE$."..:.".G. .|
00008990  44 72 61 67 42 6f 78 28  57 69 6e 64 6f 77 48 61  |DragBox(WindowHa|
000089a0  6e 64 6c 65 2c 49 63 6f  6e 48 61 6e 64 6c 65 2c  |ndle,IconHandle,|
000089b0  44 72 61 67 54 79 70 65  2c 53 70 72 69 74 65 41  |DragType,SpriteA|
000089c0  72 65 61 2c 53 70 72 69  74 65 4e 61 6d 65 24 29  |rea,SpriteName$)|
000089d0  0d 22 c4 38 42 6c 6f 63  6b 21 30 3d 57 69 6e 64  |.".8Block!0=Wind|
000089e0  6f 77 48 61 6e 64 6c 65  3a c8 99 20 22 57 69 6d  |owHandle:.. "Wim|
000089f0  70 5f 47 65 74 57 69 6e  64 6f 77 53 74 61 74 65  |p_GetWindowState|
00008a00  22 2c 2c 42 6c 6f 63 6b  0d 22 ce 20 77 6d 69 6e  |",,Block.". wmin|
00008a10  78 3d 42 6c 6f 63 6b 21  34 3a 77 6d 61 78 79 3d  |x=Block!4:wmaxy=|
00008a20  42 6c 6f 63 6b 21 31 36  0d 22 d8 49 42 6c 6f 63  |Block!16.".IBloc|
00008a30  6b 21 30 3d 57 69 6e 64  6f 77 48 61 6e 64 6c 65  |k!0=WindowHandle|
00008a40  3a 42 6c 6f 63 6b 21 34  3d 49 63 6f 6e 48 61 6e  |:Block!4=IconHan|
00008a50  64 6c 65 3a c8 99 20 22  57 69 6d 70 5f 47 65 74  |dle:.. "Wimp_Get|
00008a60  49 63 6f 6e 53 74 61 74  65 22 2c 2c 42 6c 6f 63  |IconState",,Bloc|
00008a70  6b 0d 22 e2 3e 69 6d 69  6e 78 3d 42 6c 6f 63 6b  |k.".>iminx=Block|
00008a80  21 38 3a 69 6d 69 6e 79  3d 42 6c 6f 63 6b 21 31  |!8:iminy=Block!1|
00008a90  32 3a 69 6d 61 78 78 3d  42 6c 6f 63 6b 21 31 36  |2:imaxx=Block!16|
00008aa0  3a 69 6d 61 78 79 3d 42  6c 6f 63 6b 21 32 30 0d  |:imaxy=Block!20.|
00008ab0  22 ec 29 42 6c 6f 63 6b  21 30 3d 57 69 6e 64 6f  |".)Block!0=Windo|
00008ac0  77 48 61 6e 64 6c 65 3a  42 6c 6f 63 6b 21 34 3d  |wHandle:Block!4=|
00008ad0  44 72 61 67 54 79 70 65  0d 22 f6 19 42 6c 6f 63  |DragType."..Bloc|
00008ae0  6b 21 38 3d 28 77 6d 69  6e 78 2b 69 6d 69 6e 78  |k!8=(wminx+iminx|
00008af0  29 0d 23 00 1a 42 6c 6f  63 6b 21 31 32 3d 28 77  |).#..Block!12=(w|
00008b00  6d 61 78 79 2b 69 6d 69  6e 79 29 0d 23 0a 1a 42  |maxy+iminy).#..B|
00008b10  6c 6f 63 6b 21 31 36 3d  28 77 6d 69 6e 78 2b 69  |lock!16=(wminx+i|
00008b20  6d 61 78 78 29 0d 23 14  1a 42 6c 6f 63 6b 21 32  |maxx).#..Block!2|
00008b30  30 3d 28 77 6d 61 78 79  2b 69 6d 61 78 79 29 0d  |0=(wmaxy+imaxy).|
00008b40  23 1e 19 42 6c 6f 63 6b  21 32 34 3d 31 3a 42 6c  |#..Block!24=1:Bl|
00008b50  6f 63 6b 21 32 38 3d 31  0d 23 28 47 42 6c 6f 63  |ock!28=1.#(GBloc|
00008b60  6b 21 33 32 3d 28 a4 4d  6f 64 65 49 6e 66 6f 28  |k!32=(.ModeInfo(|
00008b70  22 58 70 69 78 65 6c 73  22 2c 2d 31 29 2b 31 29  |"Xpixels",-1)+1)|
00008b80  2a 28 32 5e a4 4d 6f 64  65 49 6e 66 6f 28 22 58  |*(2^.ModeInfo("X|
00008b90  45 69 67 46 61 63 74 6f  72 22 2c 2d 31 29 29 0d  |EigFactor",-1)).|
00008ba0  23 32 47 42 6c 6f 63 6b  21 33 36 3d 28 a4 4d 6f  |#2GBlock!36=(.Mo|
00008bb0  64 65 49 6e 66 6f 28 22  59 70 69 78 65 6c 73 22  |deInfo("Ypixels"|
00008bc0  2c 2d 31 29 2b 31 29 2a  28 32 5e a4 4d 6f 64 65  |,-1)+1)*(2^.Mode|
00008bd0  49 6e 66 6f 28 22 59 45  69 67 46 61 63 74 6f 72  |Info("YEigFactor|
00008be0  22 2c 2d 31 29 29 0d 23  3c 13 e7 20 44 72 61 67  |",-1)).#<.. Drag|
00008bf0  41 53 70 72 69 74 65 20  8c 0d 23 46 45 20 20 c8  |ASprite ..#FE  .|
00008c00  99 20 22 44 72 61 67 41  53 70 72 69 74 65 5f 53  |. "DragASprite_S|
00008c10  74 61 72 74 22 2c 25 31  30 30 30 30 31 30 31 2c  |tart",%10000101,|
00008c20  53 70 72 69 74 65 41 72  65 61 2c 53 70 72 69 74  |SpriteArea,Sprit|
00008c30  65 4e 61 6d 65 24 2c 42  6c 6f 63 6b 2b 38 0d 23  |eName$,Block+8.#|
00008c40  50 05 cc 0d 23 5a 1e 20  20 c8 99 20 22 57 69 6d  |P...#Z.  .. "Wim|
00008c50  70 5f 44 72 61 67 42 6f  78 22 2c 2c 42 6c 6f 63  |p_DragBox",,Bloc|
00008c60  6b 0d 23 64 05 cd 0d 23  6e 05 e1 0d 23 78 05 3a  |k.#d...#n...#x.:|
00008c70  0d 23 82 4f f4 20 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.#.O. ----------|
00008c80  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00008cb0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
00008cc0  23 8c 2f f4 20 52 6f 75  74 69 6e 65 73 20 63 6f  |#./. Routines co|
00008cd0  6d 6d 6f 6e 20 74 6f 20  74 68 65 20 4f 6d 6e 69  |mmon to the Omni|
00008ce0  44 65 73 6b 20 75 74 69  6c 69 74 69 65 73 0d 23  |Desk utilities.#|
00008cf0  96 4f f4 20 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.O. ------------|
00008d00  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00008d30  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 0d 23 a0  |-------------.#.|
00008d40  05 3a 0d 23 aa 18 dd 20  f2 44 65 63 6c 61 72 65  |.:.#... .Declare|
00008d50  54 6f 4f 6d 6e 69 44 65  73 6b 0d 23 b4 2f 42 6c  |ToOmniDesk.#./Bl|
00008d60  6f 63 6b 21 30 3d 32 30  38 3a 42 6c 6f 63 6b 21  |ock!0=208:Block!|
00008d70  31 32 3d 30 3a 42 6c 6f  63 6b 21 31 36 3d 55 74  |12=0:Block!16=Ut|
00008d80  69 6c 44 65 63 6c 61 72  65 0d 23 be 11 42 6c 6f  |ilDeclare.#..Blo|
00008d90  63 6b 21 32 30 3d 54 61  73 6b 0d 23 c8 19 24 28  |ck!20=Task.#..$(|
00008da0  42 6c 6f 63 6b 2b 32 34  29 3d 54 61 73 6b 6e 61  |Block+24)=Taskna|
00008db0  6d 65 24 0d 23 d2 1c 24  28 42 6c 6f 63 6b 2b 34  |me$.#..$(Block+4|
00008dc0  34 29 3d 4f 75 72 46 69  6c 65 4e 61 6d 65 24 0d  |4)=OurFileName$.|
00008dd0  23 dc 29 24 28 42 6c 6f  63 6b 2b 35 35 29 3d a4  |#.)$(Block+55)=.|
00008de0  4f 6d 6e 69 48 65 6c 70  4d 65 73 73 61 67 65 28  |OmniHelpMessage(|
00008df0  22 43 4c 49 43 4b 22 29  0d 23 e6 29 24 28 42 6c  |"CLICK").#.)$(Bl|
00008e00  6f 63 6b 2b 31 33 32 29  3d a4 4f 6d 6e 69 48 65  |ock+132)=.OmniHe|
00008e10  6c 70 4d 65 73 73 61 67  65 28 22 44 52 41 47 22  |lpMessage("DRAG"|
00008e20  29 0d 23 f0 2b c8 99 20  22 57 69 6d 70 5f 53 65  |).#.+.. "Wimp_Se|
00008e30  6e 64 4d 65 73 73 61 67  65 22 2c 31 37 2c 42 6c  |ndMessage",17,Bl|
00008e40  6f 63 6b 2c 4f 6d 6e 69  44 65 73 6b 0d 23 fa 05  |ock,OmniDesk.#..|
00008e50  e1 0d 24 04 05 3a 0d 24  0e 11 dd 20 f2 53 61 79  |..$..:.$... .Say|
00008e60  47 6f 6f 64 62 79 65 0d  24 18 14 e7 20 4f 6d 6e  |Goodbye.$... Omn|
00008e70  69 44 65 73 6b 3d 30 20  8c 20 e1 0d 24 22 2f 42  |iDesk=0 . ..$"/B|
00008e80  6c 6f 63 6b 21 30 3d 32  34 3a 42 6c 6f 63 6b 21  |lock!0=24:Block!|
00008e90  31 32 3d 30 3a 42 6c 6f  63 6b 21 31 36 3d 55 74  |12=0:Block!16=Ut|
00008ea0  69 6c 51 75 69 74 74 69  6e 67 0d 24 2c 11 42 6c  |ilQuitting.$,.Bl|
00008eb0  6f 63 6b 21 32 30 3d 54  61 73 6b 0d 24 36 2b c8  |ock!20=Task.$6+.|
00008ec0  99 20 22 57 69 6d 70 5f  53 65 6e 64 4d 65 73 73  |. "Wimp_SendMess|
00008ed0  61 67 65 22 2c 31 37 2c  42 6c 6f 63 6b 2c 4f 6d  |age",17,Block,Om|
00008ee0  6e 69 44 65 73 6b 0d 24  40 05 e1 0d 24 4a 05 3a  |niDesk.$@...$J.:|
00008ef0  0d 24 54 18 dd 20 a4 52  65 61 64 53 74 61 72 74  |.$T.. .ReadStart|
00008f00  75 70 53 74 72 69 6e 67  0d 24 5e 4d f4 20 52 65  |upString.$^M. Re|
00008f10  74 75 72 6e 73 20 74 61  73 6b 20 68 61 6e 64 6c  |turns task handl|
00008f20  65 20 6f 66 20 4f 6d 6e  69 44 65 73 6b 20 28 77  |e of OmniDesk (w|
00008f30  68 69 63 68 20 69 73 20  70 61 73 73 65 64 20 69  |hich is passed i|
00008f40  6e 20 74 68 65 20 63 6f  6d 6d 61 6e 64 20 73 74  |n the command st|
00008f50  72 69 6e 67 29 0d 24 68  26 f4 20 6f 72 20 30 20  |ring).$h&. or 0 |
00008f60  69 66 20 6e 6f 74 20 73  74 61 72 74 65 64 20 62  |if not started b|
00008f70  79 20 4f 6d 6e 69 44 65  73 6b 2e 0d 24 72 1d c8  |y OmniDesk..$r..|
00008f80  99 20 22 4f 53 5f 47 65  74 45 6e 76 22 20 b8 20  |. "OS_GetEnv" . |
00008f90  43 6f 6d 6d 61 6e 64 24  0d 24 7c 1b 41 3d a7 43  |Command$.$|.A=.C|
00008fa0  6f 6d 6d 61 6e 64 24 2c  22 2d 53 74 61 72 74 75  |ommand$,"-Startu|
00008fb0  70 22 29 0d 24 86 16 e7  20 41 3c 3e 30 20 8c 20  |p").$... A<>0 . |
00008fc0  53 74 61 72 74 75 70 3d  b9 0d 24 90 18 41 3d a7  |Startup=..$..A=.|
00008fd0  43 6f 6d 6d 61 6e 64 24  2c 22 2d 45 78 69 74 22  |Command$,"-Exit"|
00008fe0  29 0d 24 9a 13 e7 20 41  3c 3e 30 20 8c 20 45 78  |).$... A<>0 . Ex|
00008ff0  69 74 3d b9 0d 24 a4 1c  41 3d a7 43 6f 6d 6d 61  |it=..$..A=.Comma|
00009000  6e 64 24 2c 22 2d 4f 6d  6e 69 44 65 73 6b 22 29  |nd$,"-OmniDesk")|
00009010  0d 24 ae 0e e7 20 41 3d  30 20 8c 20 3d 30 0d 24  |.$... A=0 . =0.$|
00009020  b8 16 3d bb 28 c1 43 6f  6d 6d 61 6e 64 24 2c 41  |..=.(.Command$,A|
00009030  2b 39 29 29 0d 24 c2 05  3a 0d 24 cc 20 dd 20 a4  |+9)).$..:.$. . .|
00009040  52 65 61 64 57 69 6e 64  6f 77 4c 6f 63 61 74 69  |ReadWindowLocati|
00009050  6f 6e 28 41 78 69 73 24  29 0d 24 d6 48 f4 20 52  |on(Axis$).$.H. R|
00009060  65 61 64 73 20 77 68 69  63 68 20 72 61 64 69 6f  |eads which radio|
00009070  20 69 63 6f 6e 20 28 69  66 20 61 6e 79 29 20 69  | icon (if any) i|
00009080  73 20 73 65 6c 65 63 74  65 64 20 69 6e 20 74 68  |s selected in th|
00009090  65 20 57 69 6e 64 6f 77  20 50 6f 73 69 74 69 6f  |e Window Positio|
000090a0  6e 0d 24 e0 48 f4 20 73  65 6c 65 63 74 6f 72 20  |n.$.H. selector |
000090b0  77 69 6e 64 6f 77 20 61  6e 64 20 72 65 74 75 72  |window and retur|
000090c0  6e 73 20 74 68 65 20 61  78 69 73 20 63 6f 6f 72  |ns the axis coor|
000090d0  64 69 6e 61 74 65 20 28  74 77 6f 20 63 61 6c 6c  |dinate (two call|
000090e0  73 20 6e 65 65 64 65 64  29 0d 24 ea 25 f4 20 6f  |s needed).$.%. o|
000090f0  72 20 2d 31 20 66 6f 72  20 6e 6f 20 70 6f 73 69  |r -1 for no posi|
00009100  74 69 6f 6e 20 73 65 6c  65 63 74 65 64 2e 0d 24  |tion selected..$|
00009110  f4 3f 49 63 6f 6e 3d 35  3a f5 3a 49 63 6f 6e 2b  |.?Icon=5:.:Icon+|
00009120  3d 31 3a fd 20 28 a4 53  65 6c 65 63 74 65 64 53  |=1:. (.SelectedS|
00009130  74 61 74 65 28 4c 6f 63  2c 49 63 6f 6e 29 3d b9  |tate(Loc,Icon)=.|
00009140  29 20 84 20 28 49 63 6f  6e 3d 33 31 29 0d 24 fe  |) . (Icon=31).$.|
00009150  2a e7 20 49 63 6f 6e 3d  33 31 20 8c 20 3d 2d 31  |*. Icon=31 . =-1|
00009160  3a f4 20 41 6c 6c 20 69  63 6f 6e 73 20 64 65 73  |:. All icons des|
00009170  65 6c 65 63 74 65 64 0d  25 08 34 4c 6f 63 61 74  |elected.%.4Locat|
00009180  69 6f 6e 3d 2d 31 3a 49  63 6f 6e 2d 3d 36 3a f4  |ion=-1:Icon-=6:.|
00009190  20 42 72 69 6e 67 20 69  63 6f 6e 20 69 6e 74 6f  | Bring icon into|
000091a0  20 72 61 6e 67 65 20 30  2d 31 34 0d 25 12 0e c8  | range 0-14.%...|
000091b0  8e 20 41 78 69 73 24 20  ca 0d 25 1c 21 20 20 c9  |. Axis$ ..%.!  .|
000091c0  20 22 58 22 2c 22 78 22  3a 4c 6f 63 61 74 69 6f  | "X","x":Locatio|
000091d0  6e 3d 49 63 6f 6e 20 81  20 35 0d 25 26 25 20 20  |n=Icon . 5.%&%  |
000091e0  c9 20 22 59 22 2c 22 79  22 3a 4c 6f 63 61 74 69  |. "Y","y":Locati|
000091f0  6f 6e 3d 34 2d 28 49 63  6f 6e 20 83 20 35 29 0d  |on=4-(Icon . 5).|
00009200  25 30 05 cb 0d 25 3a 0d  3d 4c 6f 63 61 74 69 6f  |%0...%:.=Locatio|
00009210  6e 0d 25 44 05 3a 0d 25  4e 17 dd 20 f2 43 6c 65  |n.%D.:.%N.. .Cle|
00009220  61 6e 55 70 4c 6f 63 57  69 6e 64 6f 77 0d 25 58  |anUpLocWindow.%X|
00009230  4f f4 20 4d 61 6b 65 73  20 73 75 72 65 20 74 68  |O. Makes sure th|
00009240  61 74 20 6e 6f 6e 65 20  6f 66 20 74 68 65 20 27  |at none of the '|
00009250  77 69 6e 64 6f 77 27 20  69 63 6f 6e 73 20 69 6e  |window' icons in|
00009260  20 74 68 65 20 4c 6f 63  20 77 69 6e 64 6f 77 20  | the Loc window |
00009270  69 73 20 73 65 6c 65 63  74 65 64 2e 0d 25 62 09  |is selected..%b.|
00009280  4e 3d 35 3a f5 0d 25 6c  27 4e 2b 3d 31 3a fd 20  |N=5:..%l'N+=1:. |
00009290  4e 3d 33 30 20 84 20 a4  53 65 6c 65 63 74 65 64  |N=30 . .Selected|
000092a0  53 74 61 74 65 28 4c 6f  63 2c 4e 29 0d 25 76 20  |State(Loc,N).%v |
000092b0  f2 55 70 64 61 74 65 53  65 6c 65 63 74 65 64 46  |.UpdateSelectedF|
000092c0  6c 61 67 28 4c 6f 63 2c  4e 2c a3 29 0d 25 80 05  |lag(Loc,N,.).%..|
000092d0  e1 0d 25 8a 05 3a 0d 25  94 4f f4 20 2d 2d 2d 2d  |..%..:.%.O. ----|
000092e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00009320  2d 2d 2d 2d 2d 0d 25 9e  2c f4 20 53 70 65 63 69  |-----.%.,. Speci|
00009330  61 6c 20 72 6f 75 74 69  6e 65 73 20 66 6f 72 20  |al routines for |
00009340  74 68 69 73 20 70 72 6f  67 72 61 6d 20 6f 6e 6c  |this program onl|
00009350  79 0d 25 a8 4f f4 20 2d  2d 2d 2d 2d 2d 2d 2d 2d  |y.%.O. ---------|
00009360  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000093a0  0d 25 b2 05 3a 0d 25 bc  2d dd 20 f2 55 70 64 61  |.%..:.%.-. .Upda|
000093b0  74 65 47 72 61 62 49 63  6f 6e 28 54 78 74 24 2c  |teGrabIcon(Txt$,|
000093c0  4c 65 6e 67 74 68 2c 49  67 6e 6f 72 65 43 54 52  |Length,IgnoreCTR|
000093d0  4c 29 0d 25 c6 4c f4 20  54 68 69 73 20 70 72 6f  |L).%.L. This pro|
000093e0  63 65 64 75 72 65 20 75  70 64 61 74 65 73 20 74  |cedure updates t|
000093f0  68 65 20 6d 61 69 6e 20  69 63 6f 6e 20 28 77 68  |he main icon (wh|
00009400  69 63 68 20 63 6f 6e 74  61 69 6e 73 20 74 68 65  |ich contains the|
00009410  20 67 72 61 62 62 65 64  20 74 65 78 74 29 0d 25  | grabbed text).%|
00009420  d0 49 f4 20 69 6e 20 74  68 65 20 54 65 78 74 20  |.I. in the Text |
00009430  47 72 61 62 62 65 72 20  77 69 6e 64 6f 77 2e 20  |Grabber window. |
00009440  57 65 20 6e 65 65 64 20  61 20 73 70 65 63 69 61  |We need a specia|
00009450  6c 20 70 72 6f 63 65 64  75 72 65 20 74 6f 20 64  |l procedure to d|
00009460  6f 20 74 68 69 73 2c 0d  25 da 49 f4 20 62 65 63  |o this,.%.I. bec|
00009470  61 75 73 65 20 74 68 65  20 42 41 53 49 43 20 73  |ause the BASIC s|
00009480  74 72 69 6e 67 20 68 61  6e 64 6c 69 6e 67 20 66  |tring handling f|
00009490  61 63 69 6c 69 74 69 65  73 20 77 6f 6e 27 74 20  |acilities won't |
000094a0  77 6f 72 6b 20 66 6f 72  20 73 74 72 69 6e 67 73  |work for strings|
000094b0  0d 25 e4 47 f4 20 77 68  69 63 68 20 61 72 65 20  |.%.G. which are |
000094c0  6c 6f 6e 67 65 72 20 74  68 61 6e 20 32 35 35 20  |longer than 255 |
000094d0  63 68 61 72 61 63 74 65  72 73 2e 20 57 65 20 61  |characters. We a|
000094e0  6c 73 6f 20 6e 65 65 64  20 74 6f 20 64 6f 20 61  |lso need to do a|
000094f0  20 62 69 74 20 6f 66 0d  25 ee 43 f4 20 70 72 6f  | bit of.%.C. pro|
00009500  63 65 73 73 69 6e 67 20  74 6f 20 6d 61 6b 65 20  |cessing to make |
00009510  74 68 65 20 74 65 78 74  20 6c 6f 6f 6b 20 74 69  |the text look ti|
00009520  64 79 20 69 66 20 69 74  20 63 61 6e 27 74 20 62  |dy if it can't b|
00009530  65 20 65 6e 74 69 72 65  6c 79 0d 25 f8 1e f4 20  |e entirely.%... |
00009540  61 63 63 6f 6d 6f 64 61  74 65 64 20 62 79 20 74  |accomodated by t|
00009550  68 65 20 69 63 6f 6e 2e  0d 26 02 05 f4 0d 26 0c  |he icon..&....&.|
00009560  4b f4 20 49 67 6e 6f 72  65 43 54 52 4c 20 77 69  |K. IgnoreCTRL wi|
00009570  6c 6c 2c 20 69 66 20 46  41 4c 53 45 2c 20 61 6c  |ll, if FALSE, al|
00009580  6c 6f 77 20 63 6f 6e 74  72 6f 6c 20 63 68 61 72  |low control char|
00009590  61 63 74 65 72 73 20 74  6f 20 61 70 70 65 61 72  |acters to appear|
000095a0  20 61 73 20 22 a6 22 2e  0d 26 16 05 f4 0d 26 20  | as "."..&....& |
000095b0  0e 55 25 3d 53 6c 6f 74  45 6e 64 0d 26 2a 38 42  |.U%=SlotEnd.&*8B|
000095c0  6c 6f 63 6b 21 30 3d 47  72 61 62 3a 42 6c 6f 63  |lock!0=Grab:Bloc|
000095d0  6b 21 34 3d 32 3a c8 99  20 22 57 69 6d 70 5f 47  |k!4=2:.. "Wimp_G|
000095e0  65 74 49 63 6f 6e 53 74  61 74 65 22 2c 2c 42 6c  |etIconState",,Bl|
000095f0  6f 63 6b 0d 26 34 20 e7  20 4c 65 6e 67 74 68 3d  |ock.&4 . Length=|
00009600  2d 31 20 8c 20 4c 65 6e  67 74 68 3d a9 28 54 78  |-1 . Length=.(Tx|
00009610  74 24 29 0d 26 3e 10 e7  20 54 78 74 24 3c 3e 22  |t$).&>.. Txt$<>"|
00009620  22 20 8c 0d 26 48 1c 20  20 24 28 42 6c 6f 63 6b  |" ..&H.  $(Block|
00009630  21 32 38 29 3d c0 54 78  74 24 2c 31 33 30 29 0d  |!28)=.Txt$,130).|
00009640  26 52 05 cc 0d 26 5c 14  20 20 e7 20 4c 65 6e 67  |&R...&\.  . Leng|
00009650  74 68 3e 31 32 39 20 8c  0d 26 66 14 20 20 20 20  |th>129 ..&f.    |
00009660  4e 3d 31 33 30 3a f5 3a  4e 2d 3d 31 0d 26 70 1f  |N=130:.:N-=1.&p.|
00009670  20 20 20 20 fd 20 28 4e  3d 30 29 20 84 20 28 bd  |    . (N=0) . (.|
00009680  28 55 25 3f 4e 29 3d 22  20 22 29 0d 26 7a 15 20  |(U%?N)=" ").&z. |
00009690  20 20 20 e7 20 4e 3d 30  20 8c 20 4e 3d 31 32 39  |   . N=0 . N=129|
000096a0  0d 26 84 0f 20 20 20 20  43 6f 75 6e 74 3d 30 0d  |.&..    Count=0.|
000096b0  26 8e 13 20 20 20 20 41  24 3d 22 22 3a 4d 3d 30  |&..    A$="":M=0|
000096c0  3a f5 0d 26 98 17 20 20  20 20 20 20 e7 20 28 55  |:..&..      . (U|
000096d0  25 3f 4d 29 3c 33 32 20  8c 0d 26 a2 1a 20 20 20  |%?M)<32 ..&..   |
000096e0  20 20 20 20 20 e7 20 49  67 6e 6f 72 65 43 54 52  |     . IgnoreCTR|
000096f0  4c 20 8c 0d 26 ac 20 20  20 20 20 20 20 20 20 20  |L ..&.          |
00009700  20 4d 3d 28 4e 2d 31 29  3a f4 20 45 6e 64 20 6c  | M=(N-1):. End l|
00009710  6f 6f 70 0d 26 b6 0d 20  20 20 20 20 20 20 20 cc  |oop.&..        .|
00009720  0d 26 c0 1e 20 20 20 20  20 20 20 20 20 20 41 24  |.&..          A$|
00009730  2b 3d 22 a6 22 3a 43 6f  75 6e 74 2b 3d 31 0d 26  |+=".":Count+=1.&|
00009740  ca 0d 20 20 20 20 20 20  20 20 cd 0d 26 d4 0b 20  |..        ..&.. |
00009750  20 20 20 20 20 cc 0d 26  de 20 20 20 20 20 20 20  |     ..&.       |
00009760  20 20 41 24 2b 3d bd 28  55 25 3f 4d 29 3a 43 6f  |  A$+=.(U%?M):Co|
00009770  75 6e 74 2b 3d 31 0d 26  e8 0b 20 20 20 20 20 20  |unt+=1.&..      |
00009780  cd 0d 26 f2 0e 20 20 20  20 20 20 4d 2b 3d 31 0d  |..&..      M+=1.|
00009790  26 fc 0d 20 20 20 20 fd  20 4d 3d 4e 0d 27 06 1c  |&..    . M=N.'..|
000097a0  20 20 20 20 e7 20 43 6f  75 6e 74 3d 4e 20 8c 20  |    . Count=N . |
000097b0  41 24 2b 3d 22 20 89 22  0d 27 10 16 20 20 20 20  |A$+=" .".'..    |
000097c0  24 28 42 6c 6f 63 6b 21  32 38 29 3d 41 24 0d 27  |$(Block!28)=A$.'|
000097d0  1a 07 20 20 cc 0d 27 24  13 20 20 20 20 41 24 3d  |..  ..'$.    A$=|
000097e0  22 22 3a 4d 3d 30 3a f5  0d 27 2e 17 20 20 20 20  |"":M=0:..'..    |
000097f0  20 20 e7 20 28 55 25 3f  4d 29 3c 33 32 20 8c 0d  |  . (U%?M)<32 ..|
00009800  27 38 1a 20 20 20 20 20  20 20 20 e7 20 49 67 6e  |'8.        . Ign|
00009810  6f 72 65 43 54 52 4c 20  8c 0d 27 42 25 20 20 20  |oreCTRL ..'B%   |
00009820  20 20 20 20 20 20 20 4d  3d 28 4c 65 6e 67 74 68  |       M=(Length|
00009830  2d 31 29 3a f4 20 45 6e  64 20 6c 6f 6f 70 0d 27  |-1):. End loop.'|
00009840  4c 0d 20 20 20 20 20 20  20 20 cc 0d 27 56 15 20  |L.        ..'V. |
00009850  20 20 20 20 20 20 20 20  20 41 24 2b 3d 22 a6 22  |         A$+="."|
00009860  0d 27 60 0d 20 20 20 20  20 20 20 20 cd 0d 27 6a  |.'`.        ..'j|
00009870  0b 20 20 20 20 20 20 cc  0d 27 74 17 20 20 20 20  |.      ..'t.    |
00009880  20 20 20 20 41 24 2b 3d  bd 28 55 25 3f 4d 29 0d  |    A$+=.(U%?M).|
00009890  27 7e 0b 20 20 20 20 20  20 cd 0d 27 88 0e 20 20  |'~.      ..'..  |
000098a0  20 20 20 20 4d 2b 3d 31  0d 27 92 12 20 20 20 20  |    M+=1.'..    |
000098b0  fd 20 4d 3d 4c 65 6e 67  74 68 0d 27 9c 16 20 20  |. M=Length.'..  |
000098c0  20 20 24 28 42 6c 6f 63  6b 21 32 38 29 3d 41 24  |  $(Block!28)=A$|
000098d0  0d 27 a6 07 20 20 cd 0d  27 b0 05 cd 0d 27 ba 18  |.'..  ..'....'..|
000098e0  42 6c 6f 63 6b 21 38 3d  30 3a 42 6c 6f 63 6b 21  |Block!8=0:Block!|
000098f0  31 32 3d 30 0d 27 c4 21  c8 99 20 22 57 69 6d 70  |12=0.'.!.. "Wimp|
00009900  5f 53 65 74 49 63 6f 6e  53 74 61 74 65 22 2c 2c  |_SetIconState",,|
00009910  42 6c 6f 63 6b 0d 27 ce  05 e1 0d 27 d8 05 3a 0d  |Block.'....'..:.|
00009920  27 e2 14 dd 20 f2 47 72  61 62 54 65 78 74 53 74  |'... .GrabTextSt|
00009930  61 72 74 0d 27 ec 2f c8  99 20 22 57 69 6d 70 5f  |art.'./.. "Wimp_|
00009940  53 70 72 69 74 65 4f 70  22 2c 33 36 2c 2c 22 70  |SpriteOp",36,,"p|
00009950  74 72 5f 67 72 61 62 68  61 6e 64 22 2c 32 2c 35  |tr_grabhand",2,5|
00009960  2c 30 0d 27 f6 19 f5 20  fd 20 28 a6 28 2d 31 30  |,0.'... . (.(-10|
00009970  29 20 84 20 a6 28 2d 31  32 29 29 0d 28 00 2a c8  |) . .(-12)).(.*.|
00009980  99 20 22 57 69 6d 70 5f  53 70 72 69 74 65 4f 70  |. "Wimp_SpriteOp|
00009990  22 2c 33 36 2c 2c 22 70  74 72 5f 64 65 66 61 75  |",36,,"ptr_defau|
000099a0  6c 74 22 2c 31 0d 28 0a  49 c8 99 20 22 4f 53 5f  |lt",1.(.I.. "OS_|
000099b0  42 79 74 65 22 2c 32 31  2c 39 3a f4 20 46 6c 75  |Byte",21,9:. Flu|
000099c0  73 68 20 6d 6f 75 73 65  20 62 75 66 66 65 72 20  |sh mouse buffer |
000099d0  69 6e 20 63 61 73 65 20  4d 45 4e 55 20 68 61 73  |in case MENU has|
000099e0  20 62 65 65 6e 20 63 6c  69 63 6b 65 64 2e 0d 28  | been clicked..(|
000099f0  14 22 47 72 61 62 62 69  6e 67 3d 32 3a f4 20 57  |."Grabbing=2:. W|
00009a00  61 69 74 20 32 20 57 69  6d 70 5f 50 6f 6c 6c 73  |ait 2 Wimp_Polls|
00009a10  0d 28 1e 05 e1 0d 28 28  05 3a 0d 28 32 4f 3a f4  |.(....((.:.(2O:.|
00009a20  20 57 65 20 63 61 6e 27  74 20 6d 61 6b 65 20 50  | We can't make P|
00009a30  52 4f 43 47 72 61 62 54  65 78 74 53 74 61 72 74  |ROCGrabTextStart|
00009a40  20 61 6e 64 20 50 52 4f  43 47 72 61 62 54 65 78  | and PROCGrabTex|
00009a50  74 20 69 6e 74 6f 20 61  20 73 69 6e 67 6c 65 20  |t into a single |
00009a60  70 72 6f 63 65 64 75 72  65 0d 28 3c 4d 3a f4 20  |procedure.(<M:. |
00009a70  62 65 63 61 75 73 65 20  32 20 57 69 6d 70 5f 50  |because 2 Wimp_P|
00009a80  6f 6c 6c 73 20 6e 65 65  64 20 74 6f 20 68 61 70  |olls need to hap|
00009a90  70 65 6e 20 62 65 66 6f  72 65 20 77 65 20 72 65  |pen before we re|
00009aa0  61 64 20 74 68 65 20 6d  6f 75 73 65 20 70 6f 73  |ad the mouse pos|
00009ab0  69 74 69 6f 6e 3a 0d 28  46 4b 3a f4 20 6f 74 68  |ition:.(FK:. oth|
00009ac0  65 72 77 69 73 65 20 77  65 20 67 65 74 20 74 68  |erwise we get th|
00009ad0  65 20 47 72 61 62 20 77  69 6e 64 6f 77 20 68 61  |e Grab window ha|
00009ae0  6e 64 6c 65 20 61 6e 64  20 27 47 72 61 62 20 74  |ndle and 'Grab t|
00009af0  65 78 74 27 20 69 63 6f  6e 20 68 61 6e 64 6c 65  |ext' icon handle|
00009b00  2e 0d 28 50 05 3a 0d 28  5a 0f dd 20 f2 47 72 61  |..(P.:.(Z.. .Gra|
00009b10  62 54 65 78 74 0d 28 64  07 ea 20 85 0d 28 6e 91  |bText.(d.. ..(n.|
00009b20  ee 20 85 20 ea 20 f7 20  85 3a 85 20 39 39 39 39  |. . . . .:. 9999|
00009b30  2c 22 41 6e 20 65 72 72  6f 72 20 6f 63 63 75 72  |,"An error occur|
00009b40  72 65 64 20 77 68 69 6c  73 74 20 74 72 79 69 6e  |red whilst tryin|
00009b50  67 20 74 6f 20 67 72 61  62 20 73 6f 6d 65 20 74  |g to grab some t|
00009b60  65 78 74 2e 20 50 6c 65  61 73 65 20 6e 6f 74 65  |ext. Please note|
00009b70  20 74 68 61 74 20 61 74  74 65 6d 70 74 73 20 74  | that attempts t|
00009b80  6f 20 67 72 61 62 20 6d  65 6e 75 20 69 74 65 6d  |o grab menu item|
00009b90  73 20 61 6e 64 20 74 69  74 6c 65 73 20 73 6f 6d  |s and titles som|
00009ba0  65 74 69 6d 65 73 20 66  61 69 6c 2e 22 0d 28 78  |etimes fail.".(x|
00009bb0  23 c8 99 20 22 57 69 6d  70 5f 47 65 74 50 6f 69  |#.. "Wimp_GetPoi|
00009bc0  6e 74 65 72 49 6e 66 6f  22 2c 2c 42 6c 6f 63 6b  |nterInfo",,Block|
00009bd0  0d 28 82 21 57 69 6e 64  6f 77 3d 42 6c 6f 63 6b  |.(.!Window=Block|
00009be0  21 31 32 3a 49 63 6f 6e  3d 42 6c 6f 63 6b 21 31  |!12:Icon=Block!1|
00009bf0  36 0d 28 8c 0f e7 20 49  63 6f 6e 3e 3d 30 20 8c  |6.(... Icon>=0 .|
00009c00  0d 28 96 3f 20 20 42 6c  6f 63 6b 21 30 3d 57 69  |.(.?  Block!0=Wi|
00009c10  6e 64 6f 77 3a 42 6c 6f  63 6b 21 34 3d 49 63 6f  |ndow:Block!4=Ico|
00009c20  6e 3a c8 99 20 22 57 69  6d 70 5f 47 65 74 49 63  |n:.. "Wimp_GetIc|
00009c30  6f 6e 53 74 61 74 65 22  2c 2c 42 6c 6f 63 6b 0d  |onState",,Block.|
00009c40  28 a0 18 20 20 49 63 6f  6e 46 6c 61 67 73 3d 42  |(..  IconFlags=B|
00009c50  6c 6f 63 6b 21 32 34 0d  28 aa 48 20 20 49 53 54  |lock!24.(.H  IST|
00009c60  3d 28 28 49 63 6f 6e 46  6c 61 67 73 20 80 20 28  |=((IconFlags . (|
00009c70  31 3c 3c 38 29 29 3e 3e  36 29 2b 28 49 63 6f 6e  |1<<8))>>6)+(Icon|
00009c80  46 6c 61 67 73 20 80 20  28 31 3c 3c 31 29 29 2b  |Flags . (1<<1))+|
00009c90  28 49 63 6f 6e 46 6c 61  67 73 20 80 20 31 29 0d  |(IconFlags . 1).|
00009ca0  28 b4 4d 20 20 e7 20 28  49 63 6f 6e 46 6c 61 67  |(.M  . (IconFlag|
00009cb0  73 20 80 20 28 31 3c 3c  38 29 29 3d 28 31 3c 3c  |s . (1<<8))=(1<<|
00009cc0  38 29 20 8c 20 42 75 66  66 65 72 4c 65 6e 67 74  |8) . BufferLengt|
00009cd0  68 3d 42 6c 6f 63 6b 21  33 36 3a 8b 20 42 75 66  |h=Block!36:. Buf|
00009ce0  66 65 72 4c 65 6e 67 74  68 3d 31 32 0d 28 b5 29  |ferLength=12.(.)|
00009cf0  20 20 e7 20 42 75 66 66  65 72 4c 65 6e 67 74 68  |  . BufferLength|
00009d00  3d 30 20 8c 20 42 75 66  66 65 72 4c 65 6e 67 74  |=0 . BufferLengt|
00009d10  68 3d 32 35 36 0d 28 be  2e 20 20 55 25 3d a4 41  |h=256.(..  U%=.A|
00009d20  6c 6c 6f 63 61 74 65 4d  65 6d 6f 72 79 28 41 70  |llocateMemory(Ap|
00009d30  70 53 69 7a 65 2b 42 75  66 66 65 72 4c 65 6e 67  |pSize+BufferLeng|
00009d40  74 68 29 0d 28 c8 47 20  20 e7 20 55 25 3d 30 20  |th).(.G  . U%=0 |
00009d50  8c 20 85 20 39 39 39 39  2c 22 55 6e 61 62 6c 65  |. . 9999,"Unable|
00009d60  20 74 6f 20 63 6c 61 69  6d 20 65 6e 6f 75 67 68  | to claim enough|
00009d70  20 6d 65 6d 6f 72 79 20  74 6f 20 67 72 61 62 20  | memory to grab |
00009d80  74 68 65 20 74 65 78 74  2e 22 0d 28 d2 10 20 20  |the text.".(..  |
00009d90  55 25 3d 53 6c 6f 74 45  6e 64 0d 28 dc 05 cd 0d  |U%=SlotEnd.(....|
00009da0  28 e6 0e e7 20 49 63 6f  6e 3c 30 20 8c 0d 28 f0  |(... Icon<0 ..(.|
00009db0  11 20 20 e7 20 49 63 6f  6e 3d 2d 34 20 8c 0d 28  |.  . Icon=-4 ..(|
00009dc0  fa 1b 20 20 20 20 f4 20  54 69 74 6c 65 20 62 61  |..    . Title ba|
00009dd0  72 20 63 6c 69 63 6b 65  64 0d 29 04 28 20 20 20  |r clicked.).(   |
00009de0  20 42 6c 6f 63 6b 21 30  3d 32 30 3a 42 6c 6f 63  | Block!0=20:Bloc|
00009df0  6b 21 31 32 3d 30 3a 42  6c 6f 63 6b 21 31 36 3d  |k!12=0:Block!16=|
00009e00  30 0d 29 0e 41 20 20 20  20 c8 99 20 22 57 69 6d  |0.).A    .. "Wim|
00009e10  70 5f 53 65 6e 64 4d 65  73 73 61 67 65 22 2c 31  |p_SendMessage",1|
00009e20  39 2c 42 6c 6f 63 6b 2c  57 69 6e 64 6f 77 2c 49  |9,Block,Window,I|
00009e30  63 6f 6e 20 b8 20 2c 2c  53 6f 75 72 63 65 54 61  |con . ,,SourceTa|
00009e40  73 6b 0d 29 18 4b 20 20  20 20 f4 20 5e 20 54 68  |sk.).K    . ^ Th|
00009e50  69 73 20 67 65 74 73 20  74 68 65 20 72 65 71 75  |is gets the requ|
00009e60  69 72 65 64 20 74 61 73  6b 6e 61 6d 65 20 77 69  |ired taskname wi|
00009e70  74 68 6f 75 74 20 73 65  6e 64 69 6e 67 20 61 20  |thout sending a |
00009e80  72 65 61 6c 20 6d 65 73  73 61 67 65 2e 0d 29 22  |real message..)"|
00009e90  09 20 20 20 20 3a 0d 29  2c 4f 20 20 20 20 f4 20  |.    :.),O    . |
00009ea0  54 68 65 20 66 6f 6c 6c  6f 77 69 6e 67 20 63 6f  |The following co|
00009eb0  6e 64 69 74 69 6f 6e 20  76 61 72 69 65 73 20 74  |ndition varies t|
00009ec0  68 65 20 61 63 74 69 6f  6e 20 64 65 70 65 6e 64  |he action depend|
00009ed0  69 6e 67 20 6f 6e 20 74  68 65 20 76 65 72 73 69  |ing on the versi|
00009ee0  6f 6e 20 6f 66 0d 29 36  45 20 20 20 20 f4 20 52  |on of.)6E    . R|
00009ef0  49 53 43 20 4f 53 20 69  6e 20 75 73 65 2e 20 52  |ISC OS in use. R|
00009f00  49 53 43 20 4f 53 20 33  20 6f 6e 77 61 72 64 73  |ISC OS 3 onwards|
00009f10  20 69 6e 63 6c 75 64 65  73 20 74 68 65 20 6e 65  | includes the ne|
00009f20  77 20 53 57 49 20 63 61  6c 6c 0d 29 40 48 20 20  |w SWI call.)@H  |
00009f30  20 20 f4 20 54 61 73 6b  4d 61 6e 61 67 65 72 5f  |  . TaskManager_|
00009f40  54 61 73 6b 4e 61 6d 65  46 72 6f 6d 48 61 6e 64  |TaskNameFromHand|
00009f50  6c 65 2c 20 77 68 69 63  68 20 6d 61 6b 65 73 20  |le, which makes |
00009f60  6c 69 66 65 20 65 61 73  69 65 72 20 61 6e 64 20  |life easier and |
00009f70  69 73 0d 29 4a 47 20 20  20 20 f4 20 73 75 70 70  |is.)JG    . supp|
00009f80  6f 73 65 64 20 74 6f 20  62 65 20 75 73 65 64 20  |osed to be used |
00009f90  69 6e 73 74 65 61 64 20  6f 66 20 74 68 65 20 54  |instead of the T|
00009fa0  61 73 6b 4e 61 6d 65 52  65 71 75 20 6d 65 73 73  |askNameRequ mess|
00009fb0  61 67 65 20 70 61 69 72  2e 0d 29 54 4e 20 20 20  |age pair..)TN   |
00009fc0  20 f4 20 48 6f 77 65 76  65 72 2c 20 74 68 69 73  | . However, this|
00009fd0  20 6d 65 73 73 61 67 65  20 70 61 69 72 20 68 61  | message pair ha|
00009fe0  73 20 62 65 65 6e 20 69  6e 63 6f 72 70 6f 72 61  |s been incorpora|
00009ff0  74 65 64 20 73 6f 20 74  68 65 20 70 72 6f 67 72  |ted so the progr|
0000a000  61 6d 20 77 69 6c 6c 0d  29 5e 22 20 20 20 20 f4  |am will.)^"    .|
0000a010  20 73 74 69 6c 6c 20 77  6f 72 6b 20 6f 6e 20 52  | still work on R|
0000a020  49 53 43 20 4f 53 20 32  2e 0d 29 68 09 20 20 20  |ISC OS 2..)h.   |
0000a030  20 3a 0d 29 72 14 20 20  20 20 e7 20 77 69 6d 70  | :.)r.    . wimp|
0000a040  3c 33 30 30 20 8c 0d 29  7c 43 20 20 20 20 20 20  |<300 ..)|C      |
0000a050  42 6c 6f 63 6b 21 30 3d  32 34 3a 42 6c 6f 63 6b  |Block!0=24:Block|
0000a060  21 31 32 3d 30 3a 42 6c  6f 63 6b 21 31 36 3d 26  |!12=0:Block!16=&|
0000a070  34 30 30 43 36 3a 42 6c  6f 63 6b 21 32 30 3d 53  |400C6:Block!20=S|
0000a080  6f 75 72 63 65 54 61 73  6b 0d 29 86 4d 20 20 20  |ourceTask.).M   |
0000a090  20 20 20 f4 20 52 65 71  75 65 73 74 20 74 61 73  |   . Request tas|
0000a0a0  6b 20 6e 61 6d 65 20 74  6f 20 73 65 65 20 69 66  |k name to see if|
0000a0b0  20 69 74 27 73 20 74 68  65 20 46 69 6c 65 72 2c  | it's the Filer,|
0000a0c0  20 61 73 20 46 69 6c 65  72 20 77 69 6e 64 6f 77  | as Filer window|
0000a0d0  73 20 73 65 65 6d 0d 29  90 46 20 20 20 20 20 20  |s seem.).F      |
0000a0e0  f4 20 74 6f 20 62 65 20  73 74 6f 72 65 64 20 64  |. to be stored d|
0000a0f0  69 66 66 65 72 65 6e 74  6c 79 20 28 74 68 65 20  |ifferently (the |
0000a100  62 75 66 66 65 72 20 6c  65 6e 67 74 68 20 69 73  |buffer length is|
0000a110  20 61 6c 77 61 79 73 20  31 34 29 2e 0d 29 9a 2a  | always 14)..).*|
0000a120  20 20 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 53  |      .. "Wimp_S|
0000a130  65 6e 64 4d 65 73 73 61  67 65 22 2c 31 37 2c 42  |endMessage",17,B|
0000a140  6c 6f 63 6b 2c 30 0d 29  a4 09 20 20 20 20 cc 0d  |lock,0.)..    ..|
0000a150  29 ae 46 20 20 20 20 20  20 c8 99 20 22 54 61 73  |).F      .. "Tas|
0000a160  6b 4d 61 6e 61 67 65 72  5f 54 61 73 6b 4e 61 6d  |kManager_TaskNam|
0000a170  65 46 72 6f 6d 48 61 6e  64 6c 65 22 2c 53 6f 75  |eFromHandle",Sou|
0000a180  72 63 65 54 61 73 6b 20  b8 20 53 6f 75 72 63 65  |rceTask . Source|
0000a190  4e 61 6d 65 24 0d 29 b8  21 20 20 20 20 20 20 e7  |Name$.).!      .|
0000a1a0  20 53 6f 75 72 63 65 4e  61 6d 65 24 3d 22 46 69  | SourceName$="Fi|
0000a1b0  6c 65 72 22 20 8c 0d 29  c2 1b 20 20 20 20 20 20  |ler" ..)..      |
0000a1c0  20 20 f2 47 72 61 62 46  69 6c 65 72 54 69 74 6c  |  .GrabFilerTitl|
0000a1d0  65 0d 29 cc 0b 20 20 20  20 20 20 cc 0d 29 d6 19  |e.)..      ..)..|
0000a1e0  20 20 20 20 20 20 20 20  f2 47 72 61 62 54 69 74  |        .GrabTit|
0000a1f0  6c 65 42 61 72 0d 29 e0  0b 20 20 20 20 20 20 cd  |leBar.)..      .|
0000a200  0d 29 ea 09 20 20 20 20  cd 0d 29 f4 07 20 20 cc  |.)..    ..)..  .|
0000a210  0d 29 fe 71 20 20 20 20  e7 20 49 63 6f 6e 3d 2d  |.).q    . Icon=-|
0000a220  31 20 8c 20 f7 20 85 3a  85 20 39 39 39 39 2c 22  |1 . . .:. 9999,"|
0000a230  54 68 65 20 6f 62 6a 65  63 74 20 79 6f 75 20 63  |The object you c|
0000a240  68 6f 73 65 20 69 73 20  6e 6f 74 20 61 20 74 72  |hose is not a tr|
0000a250  75 65 20 69 63 6f 6e 2c  20 61 6e 64 20 74 68 65  |ue icon, and the|
0000a260  72 65 66 6f 72 65 20 63  61 6e 6e 6f 74 20 62 65  |refore cannot be|
0000a270  20 68 61 6e 64 6c 65 64  2e 20 53 6f 72 72 79 2e  | handled. Sorry.|
0000a280  22 0d 2a 08 37 20 20 20  20 f4 20 41 6e 79 20 6f  |".*.7    . Any o|
0000a290  74 68 65 72 20 6e 65 67  61 74 69 76 65 20 76 61  |ther negative va|
0000a2a0  6c 75 65 20 6d 65 61 6e  73 20 61 20 77 69 6e 64  |lue means a wind|
0000a2b0  6f 77 20 74 6f 6f 6c 3a  0d 2a 12 6e 20 20 20 20  |ow tool:.*.n    |
0000a2c0  f7 20 85 3a 85 20 39 39  39 39 2c 22 59 6f 75 20  |. .:. 9999,"You |
0000a2d0  6d 61 79 20 67 72 61 62  20 74 65 78 74 20 66 72  |may grab text fr|
0000a2e0  6f 6d 20 77 69 6e 64 6f  77 20 74 69 74 6c 65 20  |om window title |
0000a2f0  62 61 72 73 2c 20 62 75  74 20 6e 6f 74 20 66 72  |bars, but not fr|
0000a300  6f 6d 20 61 6e 79 20 6f  74 68 65 72 20 70 61 72  |om any other par|
0000a310  74 73 20 6f 66 20 77 69  6e 64 6f 77 20 62 6f 72  |ts of window bor|
0000a320  64 65 72 73 2e 22 0d 2a  1c 07 20 20 cd 0d 2a 26  |ders.".*..  ..*&|
0000a330  05 cc 0d 2a 30 1b 20 20  f4 20 4e 6f 72 6d 61 6c  |...*0.  . Normal|
0000a340  20 69 63 6f 6e 20 63 6c  69 63 6b 65 64 0d 2a 3a  | icon clicked.*:|
0000a350  26 20 20 42 6c 6f 63 6b  21 30 3d 32 30 3a 42 6c  |&  Block!0=20:Bl|
0000a360  6f 63 6b 21 31 32 3d 30  3a 42 6c 6f 63 6b 21 31  |ock!12=0:Block!1|
0000a370  36 3d 30 0d 2a 44 3f 20  20 c8 99 20 22 57 69 6d  |6=0.*D?  .. "Wim|
0000a380  70 5f 53 65 6e 64 4d 65  73 73 61 67 65 22 2c 31  |p_SendMessage",1|
0000a390  39 2c 42 6c 6f 63 6b 2c  57 69 6e 64 6f 77 2c 49  |9,Block,Window,I|
0000a3a0  63 6f 6e 20 b8 20 2c 2c  53 6f 75 72 63 65 54 61  |con . ,,SourceTa|
0000a3b0  73 6b 0d 2a 4e 49 20 20  f4 20 5e 20 54 68 69 73  |sk.*NI  . ^ This|
0000a3c0  20 67 65 74 73 20 74 68  65 20 72 65 71 75 69 72  | gets the requir|
0000a3d0  65 64 20 74 61 73 6b 6e  61 6d 65 20 77 69 74 68  |ed taskname with|
0000a3e0  6f 75 74 20 73 65 6e 64  69 6e 67 20 61 20 72 65  |out sending a re|
0000a3f0  61 6c 20 6d 65 73 73 61  67 65 2e 0d 2a 58 0e 20  |al message..*X. |
0000a400  20 c8 8e 20 49 53 54 20  ca 0d 2a 62 18 20 20 20  | .. IST ..*b.   |
0000a410  20 c9 20 25 31 30 31 2c  25 31 31 31 2c 25 31 31  | . %101,%111,%11|
0000a420  30 0d 2a 6c 43 20 20 20  20 20 20 42 6c 6f 63 6b  |0.*lC      Block|
0000a430  21 30 3d 57 69 6e 64 6f  77 3a 42 6c 6f 63 6b 21  |!0=Window:Block!|
0000a440  34 3d 49 63 6f 6e 3a c8  99 20 22 57 69 6d 70 5f  |4=Icon:.. "Wimp_|
0000a450  47 65 74 49 63 6f 6e 53  74 61 74 65 22 2c 2c 42  |GetIconState",,B|
0000a460  6c 6f 63 6b 0d 2a 76 1a  20 20 20 20 20 20 e7 20  |lock.*v.      . |
0000a470  53 6f 75 72 63 65 54 61  73 6b 3d 30 20 8c 0d 2a  |SourceTask=0 ..*|
0000a480  80 33 20 20 20 20 20 20  20 20 f4 20 59 6f 75 20  |.3        . You |
0000a490  67 65 74 20 61 20 74 61  73 6b 20 68 61 6e 64 6c  |get a task handl|
0000a4a0  65 20 6f 66 20 30 20 66  6f 72 20 6d 65 6e 75 73  |e of 0 for menus|
0000a4b0  2e 0d 2a 8a 15 20 20 20  20 20 20 20 20 41 24 3d  |..*..        A$=|
0000a4c0  22 22 3a 4e 3d 30 0d 2a  94 36 20 20 20 20 20 20  |"":N=0.*.6      |
0000a4d0  20 20 c8 95 20 28 4e 3c  42 75 66 66 65 72 4c 65  |  .. (N<BufferLe|
0000a4e0  6e 67 74 68 29 20 80 20  28 3f 28 28 42 6c 6f 63  |ngth) . (?((Bloc|
0000a4f0  6b 21 32 38 29 2b 4e 29  3e 33 31 29 0d 2a 9e 24  |k!28)+N)>31).*.$|
0000a500  20 20 20 20 20 20 20 20  20 20 41 24 2b 3d bd 28  |          A$+=.(|
0000a510  3f 28 28 42 6c 6f 63 6b  21 32 38 29 2b 4e 29 29  |?((Block!28)+N))|
0000a520  0d 2a a8 12 20 20 20 20  20 20 20 20 20 20 4e 2b  |.*..          N+|
0000a530  3d 31 0d 2a b2 0d 20 20  20 20 20 20 20 20 ce 0d  |=1.*..        ..|
0000a540  2a bc 27 20 20 20 20 20  20 20 20 24 55 25 3d 41  |*.'        $U%=A|
0000a550  24 2b bd 31 30 3a 42 75  66 66 65 72 4c 65 6e 67  |$+.10:BufferLeng|
0000a560  74 68 3d 4e 2b 31 0d 2a  c6 0b 20 20 20 20 20 20  |th=N+1.*..      |
0000a570  cc 0d 2a da 4c 20 20 20  20 20 20 20 20 c8 99 20  |..*.L        .. |
0000a580  22 57 69 6d 70 5f 54 72  61 6e 73 66 65 72 42 6c  |"Wimp_TransferBl|
0000a590  6f 63 6b 22 2c 53 6f 75  72 63 65 54 61 73 6b 2c  |ock",SourceTask,|
0000a5a0  42 6c 6f 63 6b 21 32 38  2c 54 61 73 6b 2c 55 25  |Block!28,Task,U%|
0000a5b0  2c 42 75 66 66 65 72 4c  65 6e 67 74 68 0d 2a e4  |,BufferLength.*.|
0000a5c0  51 20 20 20 20 20 20 20  20 4e 3d 30 3a c8 95 20  |Q        N=0:.. |
0000a5d0  28 28 55 25 3f 4e 29 3e  33 31 29 20 80 20 28 4e  |((U%?N)>31) . (N|
0000a5e0  3c 42 75 66 66 65 72 4c  65 6e 67 74 68 29 3a 4e  |<BufferLength):N|
0000a5f0  2b 3d 31 3a ce 3a 55 25  3f 4e 3d 31 30 3a 42 75  |+=1:.:U%?N=10:Bu|
0000a600  66 66 65 72 4c 65 6e 67  74 68 3d 4e 2b 31 0d 2a  |fferLength=N+1.*|
0000a610  ee 1e 20 20 20 20 20 20  20 20 55 25 3f 42 75 66  |..        U%?Buf|
0000a620  66 65 72 4c 65 6e 67 74  68 3d 31 30 0d 2b 0c 0b  |ferLength=10.+..|
0000a630  20 20 20 20 20 20 cd 0d  2b 16 2c 20 20 20 20 20  |      ..+.,     |
0000a640  20 f2 55 70 64 61 74 65  47 72 61 62 49 63 6f 6e  | .UpdateGrabIcon|
0000a650  28 22 22 2c 42 75 66 66  65 72 4c 65 6e 67 74 68  |("",BufferLength|
0000a660  2c b9 29 0d 2b 20 27 20  20 20 20 20 20 f2 55 70  |,.).+ '      .Up|
0000a670  64 61 74 65 49 63 6f 6e  43 6f 6c 6f 75 72 28 47  |dateIconColour(G|
0000a680  72 61 62 2c 34 2c 37 2c  31 29 0d 2b 2a 22 20 20  |rab,4,7,1).+*"  |
0000a690  20 20 20 20 f2 53 68 61  64 65 4d 65 6e 75 28 4d  |    .ShadeMenu(M|
0000a6a0  61 69 6e 4d 65 6e 75 2c  31 2c a3 29 0d 2b 34 22  |ainMenu,1,.).+4"|
0000a6b0  20 20 20 20 20 20 f2 53  68 61 64 65 4d 65 6e 75  |      .ShadeMenu|
0000a6c0  28 4d 61 69 6e 4d 65 6e  75 2c 32 2c a3 29 0d 2b  |(MainMenu,2,.).+|
0000a6d0  3e 22 20 20 20 20 20 20  f2 53 68 61 64 65 4d 65  |>"      .ShadeMe|
0000a6e0  6e 75 28 4d 61 69 6e 4d  65 6e 75 2c 34 2c a3 29  |nu(MainMenu,4,.)|
0000a6f0  0d 2b 48 2a 20 20 20 20  20 20 54 79 70 69 6e 67  |.+H*      Typing|
0000a700  3d a3 3a f2 54 69 63 6b  4d 65 6e 75 28 4d 61 69  |=.:.TickMenu(Mai|
0000a710  6e 4d 65 6e 75 2c 32 2c  a3 29 0d 2b 52 18 20 20  |nMenu,2,.).+R.  |
0000a720  20 20 c9 20 25 30 30 31  2c 25 30 31 31 2c 25 30  |  . %001,%011,%0|
0000a730  31 30 0d 2b 5c 13 20 20  20 20 20 20 41 24 3d 22  |10.+\.      A$="|
0000a740  22 3a 4e 3d 30 0d 2b 66  27 20 20 20 20 20 20 c8  |":N=0.+f'      .|
0000a750  95 20 28 4e 3c 31 32 29  20 80 20 28 42 6c 6f 63  |. (N<12) . (Bloc|
0000a760  6b 3f 28 32 38 2b 4e 29  3e 33 31 29 0d 2b 70 1f  |k?(28+N)>31).+p.|
0000a770  20 20 20 20 20 20 20 20  41 24 2b 3d bd 28 42 6c  |        A$+=.(Bl|
0000a780  6f 63 6b 3f 28 32 38 2b  4e 29 29 0d 2b 7a 10 20  |ock?(28+N)).+z. |
0000a790  20 20 20 20 20 20 20 4e  2b 3d 31 0d 2b 84 0b 20  |       N+=1.+.. |
0000a7a0  20 20 20 20 20 ce 0d 2b  8e 25 20 20 20 20 20 20  |     ..+.%      |
0000a7b0  24 55 25 3d 41 24 2b bd  31 30 3a 42 75 66 66 65  |$U%=A$+.10:Buffe|
0000a7c0  72 4c 65 6e 67 74 68 3d  4e 2b 31 0d 2b 98 2c 20  |rLength=N+1.+., |
0000a7d0  20 20 20 20 20 f2 55 70  64 61 74 65 47 72 61 62  |     .UpdateGrab|
0000a7e0  49 63 6f 6e 28 22 22 2c  42 75 66 66 65 72 4c 65  |Icon("",BufferLe|
0000a7f0  6e 67 74 68 2c b9 29 0d  2b a2 27 20 20 20 20 20  |ngth,.).+.'     |
0000a800  20 f2 55 70 64 61 74 65  49 63 6f 6e 43 6f 6c 6f  | .UpdateIconColo|
0000a810  75 72 28 47 72 61 62 2c  34 2c 37 2c 31 29 0d 2b  |ur(Grab,4,7,1).+|
0000a820  ac 22 20 20 20 20 20 20  f2 53 68 61 64 65 4d 65  |."      .ShadeMe|
0000a830  6e 75 28 4d 61 69 6e 4d  65 6e 75 2c 31 2c a3 29  |nu(MainMenu,1,.)|
0000a840  0d 2b b6 22 20 20 20 20  20 20 f2 53 68 61 64 65  |.+."      .Shade|
0000a850  4d 65 6e 75 28 4d 61 69  6e 4d 65 6e 75 2c 32 2c  |Menu(MainMenu,2,|
0000a860  a3 29 0d 2b c0 22 20 20  20 20 20 20 f2 53 68 61  |.).+."      .Sha|
0000a870  64 65 4d 65 6e 75 28 4d  61 69 6e 4d 65 6e 75 2c  |deMenu(MainMenu,|
0000a880  34 2c a3 29 0d 2b ca 2a  20 20 20 20 20 20 54 79  |4,.).+.*      Ty|
0000a890  70 69 6e 67 3d a3 3a f2  54 69 63 6b 4d 65 6e 75  |ping=.:.TickMenu|
0000a8a0  28 4d 61 69 6e 4d 65 6e  75 2c 32 2c a3 29 0d 2b  |(MainMenu,2,.).+|
0000a8b0  d4 09 20 20 20 20 7f 0d  2b de 3b 20 20 20 20 20  |..    ..+.;     |
0000a8c0  20 f7 20 85 3a 85 20 39  39 39 39 2c 22 54 68 65  | . .:. 9999,"The|
0000a8d0  72 65 20 77 61 73 20 6e  6f 20 74 65 78 74 20 61  |re was no text a|
0000a8e0  76 61 69 6c 61 62 6c 65  20 74 6f 20 67 72 61 62  |vailable to grab|
0000a8f0  2e 22 0d 2b e8 07 20 20  cb 0d 2b f2 33 20 20 e7  |.".+..  ..+.3  .|
0000a900  20 42 75 66 66 65 72 4c  65 6e 67 74 68 3d 31 20  | BufferLength=1 |
0000a910  8c 20 f2 52 65 73 65 74  47 72 61 62 62 65 72 3a  |. .ResetGrabber:|
0000a920  f4 20 45 6d 70 74 79 20  67 72 61 62 0d 2b fc 05  |. Empty grab.+..|
0000a930  cd 0d 2c 06 05 e1 0d 2c  10 08 3a 20 20 20 0d 2c  |..,....,..:   .,|
0000a940  1a 13 dd 20 f2 47 72 61  62 54 69 74 6c 65 42 61  |... .GrabTitleBa|
0000a950  72 0d 2c 24 46 f4 20 41  73 6b 20 66 6f 72 20 61  |r.,$F. Ask for a|
0000a960  20 33 32 4b 20 62 6c 6f  63 6b 20 74 6f 20 68 6f  | 32K block to ho|
0000a970  6c 64 20 74 68 65 20 77  69 6e 64 6f 77 20 64 65  |ld the window de|
0000a980  66 69 6e 69 74 69 6f 6e  2c 20 61 6e 64 20 70 72  |finition, and pr|
0000a990  61 79 20 69 74 27 73 0d  2c 2e 3b f4 20 65 6e 6f  |ay it's.,.;. eno|
0000a9a0  75 67 68 2e 2e 2e 20 20  49 66 20 6e 6f 74 2c 20  |ugh...  If not, |
0000a9b0  77 65 20 6d 61 79 20 62  65 20 74 61 6c 6b 69 6e  |we may be talkin|
0000a9c0  67 20 4e 41 53 54 59 20  63 72 61 73 68 65 73 2e  |g NASTY crashes.|
0000a9d0  2e 2e 0d 2c 38 47 f4 20  49 74 27 73 20 75 6e 6c  |...,8G. It's unl|
0000a9e0  69 6b 65 6c 79 20 74 68  61 74 20 61 20 77 69 6e  |ikely that a win|
0000a9f0  64 6f 77 20 77 69 6c 6c  20 63 6f 6e 74 61 69 6e  |dow will contain|
0000aa00  20 6d 6f 72 65 20 74 68  61 6e 20 33 32 4b 27 73  | more than 32K's|
0000aa10  20 77 6f 72 74 68 20 6f  66 0d 2c 42 21 f4 20 69  | worth of.,B!. i|
0000aa20  63 6f 6e 73 3b 20 62 75  74 20 74 68 65 79 20 44  |cons; but they D|
0000aa30  4f 20 65 78 69 73 74 2e  2e 2e 0d 2c 4c 3f 42 75  |O exist....,L?Bu|
0000aa40  66 66 65 72 4c 65 6e 67  74 68 3d 33 32 37 36 38  |fferLength=32768|
0000aa50  3a 55 25 3d a4 41 6c 6c  6f 63 61 74 65 4d 65 6d  |:U%=.AllocateMem|
0000aa60  6f 72 79 28 41 70 70 53  69 7a 65 2b 42 75 66 66  |ory(AppSize+Buff|
0000aa70  65 72 4c 65 6e 67 74 68  29 0d 2c 56 45 e7 20 55  |erLength).,VE. U|
0000aa80  25 3d 30 20 8c 20 85 20  39 39 39 39 2c 22 55 6e  |%=0 . . 9999,"Un|
0000aa90  61 62 6c 65 20 74 6f 20  63 6c 61 69 6d 20 65 6e  |able to claim en|
0000aaa0  6f 75 67 68 20 6d 65 6d  6f 72 79 20 74 6f 20 67  |ough memory to g|
0000aab0  72 61 62 20 74 68 65 20  74 65 78 74 2e 22 0d 2c  |rab the text.".,|
0000aac0  60 1a 55 25 3d 53 6c 6f  74 45 6e 64 3a 55 25 21  |`.U%=SlotEnd:U%!|
0000aad0  30 3d 57 69 6e 64 6f 77  0d 2c 6a 1f c8 99 20 22  |0=Window.,j... "|
0000aae0  57 69 6d 70 5f 47 65 74  57 69 6e 64 6f 77 49 6e  |Wimp_GetWindowIn|
0000aaf0  66 6f 22 2c 2c 55 25 0d  2c 74 5a 54 69 74 6c 65  |fo",,U%.,tZTitle|
0000ab00  46 6c 61 67 73 3d 55 25  21 36 30 3a 49 53 54 3d  |Flags=U%!60:IST=|
0000ab10  28 28 54 69 74 6c 65 46  6c 61 67 73 20 80 20 28  |((TitleFlags . (|
0000ab20  31 3c 3c 38 29 29 3e 3e  36 29 2b 28 54 69 74 6c  |1<<8))>>6)+(Titl|
0000ab30  65 46 6c 61 67 73 20 80  20 28 31 3c 3c 31 29 29  |eFlags . (1<<1))|
0000ab40  2b 28 54 69 74 6c 65 46  6c 61 67 73 20 80 20 31  |+(TitleFlags . 1|
0000ab50  29 0d 2c 7e 49 e7 20 28  54 69 74 6c 65 46 6c 61  |).,~I. (TitleFla|
0000ab60  67 73 20 80 20 28 31 3c  3c 38 29 29 3d 28 31 3c  |gs . (1<<8))=(1<|
0000ab70  3c 38 29 20 8c 20 42 75  66 66 65 72 4c 65 6e 67  |<8) . BufferLeng|
0000ab80  74 68 3d 55 25 21 38 34  3a 8b 20 42 75 66 66 65  |th=U%!84:. Buffe|
0000ab90  72 4c 65 6e 67 74 68 3d  31 32 0d 2c 88 0c c8 8e  |rLength=12.,....|
0000aba0  20 49 53 54 20 ca 0d 2c  92 16 20 20 c9 20 25 31  | IST ..,..  . %1|
0000abb0  30 31 2c 25 31 31 31 2c  25 31 31 30 0d 2c 9c 45  |01,%111,%110.,.E|
0000abc0  20 20 20 20 c8 99 20 22  57 69 6d 70 5f 54 72 61  |    .. "Wimp_Tra|
0000abd0  6e 73 66 65 72 42 6c 6f  63 6b 22 2c 53 6f 75 72  |nsferBlock",Sour|
0000abe0  63 65 54 61 73 6b 2c 55  25 21 37 36 2c 54 61 73  |ceTask,U%!76,Tas|
0000abf0  6b 2c 55 25 2c 42 75 66  66 65 72 4c 65 6e 67 74  |k,U%,BufferLengt|
0000ac00  68 0d 2c a6 4d 20 20 20  20 4e 3d 30 3a c8 95 20  |h.,.M    N=0:.. |
0000ac10  28 28 55 25 3f 4e 29 3e  33 31 29 20 80 20 28 4e  |((U%?N)>31) . (N|
0000ac20  3c 42 75 66 66 65 72 4c  65 6e 67 74 68 29 3a 4e  |<BufferLength):N|
0000ac30  2b 3d 31 3a ce 3a 55 25  3f 4e 3d 31 30 3a 42 75  |+=1:.:U%?N=10:Bu|
0000ac40  66 66 65 72 4c 65 6e 67  74 68 3d 4e 2b 31 0d 2c  |fferLength=N+1.,|
0000ac50  b0 2a 20 20 20 20 f2 55  70 64 61 74 65 47 72 61  |.*    .UpdateGra|
0000ac60  62 49 63 6f 6e 28 22 22  2c 42 75 66 66 65 72 4c  |bIcon("",BufferL|
0000ac70  65 6e 67 74 68 2c b9 29  0d 2c ba 25 20 20 20 20  |ength,.).,.%    |
0000ac80  f2 55 70 64 61 74 65 49  63 6f 6e 43 6f 6c 6f 75  |.UpdateIconColou|
0000ac90  72 28 47 72 61 62 2c 34  2c 37 2c 31 29 0d 2c c4  |r(Grab,4,7,1).,.|
0000aca0  20 20 20 20 20 f2 53 68  61 64 65 4d 65 6e 75 28  |     .ShadeMenu(|
0000acb0  4d 61 69 6e 4d 65 6e 75  2c 31 2c a3 29 0d 2c ce  |MainMenu,1,.).,.|
0000acc0  20 20 20 20 20 f2 53 68  61 64 65 4d 65 6e 75 28  |     .ShadeMenu(|
0000acd0  4d 61 69 6e 4d 65 6e 75  2c 32 2c a3 29 0d 2c d8  |MainMenu,2,.).,.|
0000ace0  20 20 20 20 20 f2 53 68  61 64 65 4d 65 6e 75 28  |     .ShadeMenu(|
0000acf0  4d 61 69 6e 4d 65 6e 75  2c 34 2c a3 29 0d 2c e2  |MainMenu,4,.).,.|
0000ad00  28 20 20 20 20 54 79 70  69 6e 67 3d a3 3a f2 54  |(    Typing=.:.T|
0000ad10  69 63 6b 4d 65 6e 75 28  4d 61 69 6e 4d 65 6e 75  |ickMenu(MainMenu|
0000ad20  2c 32 2c a3 29 0d 2c ec  16 20 20 c9 20 25 30 30  |,2,.).,..  . %00|
0000ad30  31 2c 25 30 31 31 2c 25  30 31 30 0d 2c f6 11 20  |1,%011,%010.,.. |
0000ad40  20 20 20 41 24 3d 22 22  3a 4e 3d 30 0d 2d 00 22  |   A$="":N=0.-."|
0000ad50  20 20 20 20 c8 95 20 28  4e 3c 31 32 29 20 80 20  |    .. (N<12) . |
0000ad60  28 55 25 3f 28 37 36 2b  4e 29 3e 33 31 29 0d 2d  |(U%?(76+N)>31).-|
0000ad70  0a 1a 20 20 20 20 20 20  41 24 2b 3d bd 28 55 25  |..      A$+=.(U%|
0000ad80  3f 28 37 36 2b 4e 29 29  0d 2d 14 0e 20 20 20 20  |?(76+N)).-..    |
0000ad90  20 20 4e 2b 3d 31 0d 2d  1e 09 20 20 20 20 ce 0d  |  N+=1.-..    ..|
0000ada0  2d 28 23 20 20 20 20 24  55 25 3d 41 24 2b bd 31  |-(#    $U%=A$+.1|
0000adb0  30 3a 42 75 66 66 65 72  4c 65 6e 67 74 68 3d 4e  |0:BufferLength=N|
0000adc0  2b 31 0d 2d 32 2a 20 20  20 20 f2 55 70 64 61 74  |+1.-2*    .Updat|
0000add0  65 47 72 61 62 49 63 6f  6e 28 22 22 2c 42 75 66  |eGrabIcon("",Buf|
0000ade0  66 65 72 4c 65 6e 67 74  68 2c b9 29 0d 2d 3c 25  |ferLength,.).-<%|
0000adf0  20 20 20 20 f2 55 70 64  61 74 65 49 63 6f 6e 43  |    .UpdateIconC|
0000ae00  6f 6c 6f 75 72 28 47 72  61 62 2c 34 2c 37 2c 31  |olour(Grab,4,7,1|
0000ae10  29 0d 2d 46 20 20 20 20  20 f2 53 68 61 64 65 4d  |).-F     .ShadeM|
0000ae20  65 6e 75 28 4d 61 69 6e  4d 65 6e 75 2c 31 2c a3  |enu(MainMenu,1,.|
0000ae30  29 0d 2d 50 20 20 20 20  20 f2 53 68 61 64 65 4d  |).-P     .ShadeM|
0000ae40  65 6e 75 28 4d 61 69 6e  4d 65 6e 75 2c 32 2c a3  |enu(MainMenu,2,.|
0000ae50  29 0d 2d 5a 20 20 20 20  20 f2 53 68 61 64 65 4d  |).-Z     .ShadeM|
0000ae60  65 6e 75 28 4d 61 69 6e  4d 65 6e 75 2c 34 2c a3  |enu(MainMenu,4,.|
0000ae70  29 0d 2d 64 28 20 20 20  20 54 79 70 69 6e 67 3d  |).-d(    Typing=|
0000ae80  a3 3a f2 54 69 63 6b 4d  65 6e 75 28 4d 61 69 6e  |.:.TickMenu(Main|
0000ae90  4d 65 6e 75 2c 32 2c a3  29 0d 2d 6e 05 cb 0d 2d  |Menu,2,.).-n...-|
0000aea0  78 05 e1 0d 2d 82 05 3a  0d 2d 8c 15 dd 20 f2 47  |x...-..:.-... .G|
0000aeb0  72 61 62 46 69 6c 65 72  54 69 74 6c 65 0d 2d 96  |rabFilerTitle.-.|
0000aec0  4d f4 20 49 74 20 61 70  70 65 61 72 73 20 74 68  |M. It appears th|
0000aed0  61 74 20 61 6c 6c 20 46  69 6c 65 72 20 77 69 6e  |at all Filer win|
0000aee0  64 6f 77 73 20 61 72 65  20 73 74 6f 72 65 64 20  |dows are stored |
0000aef0  77 69 74 68 20 61 20 27  74 69 74 6c 65 20 74 65  |with a 'title te|
0000af00  78 74 20 62 75 66 66 65  72 27 0d 2d a0 4f f4 20  |xt buffer'.-.O. |
0000af10  6c 65 6e 67 74 68 20 6f  66 20 31 34 2c 20 72 65  |length of 14, re|
0000af20  67 61 72 64 6c 65 73 73  20 6f 66 20 68 6f 77 20  |gardless of how |
0000af30  6c 6f 6e 67 20 74 68 65  79 20 72 65 61 6c 6c 79  |long they really|
0000af40  20 61 72 65 2e 20 54 68  69 73 20 69 73 20 61 20  | are. This is a |
0000af50  6e 75 69 73 61 6e 63 65  2c 0d 2d aa 4d f4 20 61  |nuisance,.-.M. a|
0000af60  73 20 69 74 20 6d 65 61  6e 73 20 74 68 61 74 20  |s it means that |
0000af70  74 68 65 79 20 6d 75 73  74 20 62 65 20 74 72 65  |they must be tre|
0000af80  61 74 65 64 20 64 69 66  66 65 72 65 6e 74 6c 79  |ated differently|
0000af90  20 74 6f 20 61 6c 6c 20  6f 74 68 65 72 20 77 69  | to all other wi|
0000afa0  6e 64 6f 77 73 2e 0d 2d  b4 4c f4 20 54 68 69 73  |ndows..-.L. This|
0000afb0  20 70 72 6f 63 65 64 75  72 65 20 77 69 6c 6c 20  | procedure will |
0000afc0  65 78 74 72 61 63 74 20  74 68 65 20 72 65 71 75  |extract the requ|
0000afd0  69 72 65 64 20 66 69 6c  65 6e 61 6d 65 20 74 65  |ired filename te|
0000afe0  78 74 2c 20 61 6e 64 20  75 70 20 74 6f 20 31 30  |xt, and up to 10|
0000aff0  32 34 0d 2d be 4c f4 20  63 68 61 72 61 63 74 65  |24.-.L. characte|
0000b000  72 73 20 61 72 65 20 61  6c 6c 6f 77 65 64 20 66  |rs are allowed f|
0000b010  6f 72 2e 20 49 6e 20 66  61 63 74 2c 20 32 30 30  |or. In fact, 200|
0000b020  20 63 68 61 72 61 63 74  65 72 73 20 73 68 6f 75  | characters shou|
0000b030  6c 64 20 73 75 66 66 69  63 65 2c 20 61 73 0d 2d  |ld suffice, as.-|
0000b040  c8 4d f4 20 74 68 65 72  65 20 69 73 20 61 6e 20  |.M. there is an |
0000b050  75 70 70 65 72 20 6c 69  6d 69 74 20 6f 6e 20 74  |upper limit on t|
0000b060  68 65 20 6c 65 6e 67 74  68 20 6f 66 20 66 69 6c  |he length of fil|
0000b070  65 6e 61 6d 65 73 20 6f  66 20 61 62 6f 75 74 20  |enames of about |
0000b080  74 68 61 74 20 6e 75 6d  62 65 72 0d 2d d2 4f f4  |that number.-.O.|
0000b090  20 6f 66 20 63 68 61 72  61 63 74 65 72 73 2e 20  | of characters. |
0000b0a0  48 6f 77 65 76 65 72 2c  20 77 65 27 76 65 20 63  |However, we've c|
0000b0b0  6c 61 69 6d 65 64 20 70  6c 65 6e 74 79 20 6f 66  |laimed plenty of|
0000b0c0  20 6d 65 6d 6f 72 79 2c  20 73 6f 20 77 65 20 6d  | memory, so we m|
0000b0d0  61 79 20 61 73 20 77 65  6c 6c 0d 2d dc 4d f4 20  |ay as well.-.M. |
0000b0e0  63 61 74 65 72 20 66 6f  72 20 74 68 65 20 70 6f  |cater for the po|
0000b0f0  73 73 69 62 69 6c 69 74  79 20 6f 66 20 74 68 61  |ssibility of tha|
0000b100  74 20 72 65 73 74 72 69  63 74 69 6f 6e 20 62 65  |t restriction be|
0000b110  69 6e 67 20 6c 69 66 74  65 64 20 69 6e 20 66 75  |ing lifted in fu|
0000b120  74 75 72 65 2e 2e 2e 0d  2d e6 05 f4 0d 2d f0 3f  |ture....-....-.?|
0000b130  42 75 66 66 65 72 4c 65  6e 67 74 68 3d 33 32 37  |BufferLength=327|
0000b140  36 38 3a 55 25 3d a4 41  6c 6c 6f 63 61 74 65 4d  |68:U%=.AllocateM|
0000b150  65 6d 6f 72 79 28 41 70  70 53 69 7a 65 2b 42 75  |emory(AppSize+Bu|
0000b160  66 66 65 72 4c 65 6e 67  74 68 29 0d 2d fa 45 e7  |fferLength).-.E.|
0000b170  20 55 25 3d 30 20 8c 20  85 20 39 39 39 39 2c 22  | U%=0 . . 9999,"|
0000b180  55 6e 61 62 6c 65 20 74  6f 20 63 6c 61 69 6d 20  |Unable to claim |
0000b190  65 6e 6f 75 67 68 20 6d  65 6d 6f 72 79 20 74 6f  |enough memory to|
0000b1a0  20 67 72 61 62 20 74 68  65 20 74 65 78 74 2e 22  | grab the text."|
0000b1b0  0d 2e 04 1a 55 25 3d 53  6c 6f 74 45 6e 64 3a 55  |....U%=SlotEnd:U|
0000b1c0  25 21 30 3d 57 69 6e 64  6f 77 0d 2e 0e 1f c8 99  |%!0=Window......|
0000b1d0  20 22 57 69 6d 70 5f 47  65 74 57 69 6e 64 6f 77  | "Wimp_GetWindow|
0000b1e0  49 6e 66 6f 22 2c 2c 55  25 0d 2e 18 39 c8 99 20  |Info",,U%...9.. |
0000b1f0  22 57 69 6d 70 5f 54 72  61 6e 73 66 65 72 42 6c  |"Wimp_TransferBl|
0000b200  6f 63 6b 22 2c 53 6f 75  72 63 65 54 61 73 6b 2c  |ock",SourceTask,|
0000b210  55 25 21 37 36 2c 54 61  73 6b 2c 55 25 2c 31 30  |U%!76,Task,U%,10|
0000b220  32 34 0d 2e 22 15 42 75  66 66 65 72 4c 65 6e 67  |24..".BufferLeng|
0000b230  74 68 3d 2d 31 3a f5 0d  2e 2c 40 42 75 66 66 65  |th=-1:...,@Buffe|
0000b240  72 4c 65 6e 67 74 68 2b  3d 31 3a fd 20 28 28 55  |rLength+=1:. ((U|
0000b250  25 3f 42 75 66 66 65 72  4c 65 6e 67 74 68 29 3c  |%?BufferLength)<|
0000b260  33 32 29 20 84 20 42 75  66 66 65 72 4c 65 6e 67  |32) . BufferLeng|
0000b270  74 68 3d 31 30 32 34 0d  2e 36 16 55 25 3f 42 75  |th=1024..6.U%?Bu|
0000b280  66 66 65 72 4c 65 6e 67  74 68 3d 31 30 0d 2e 40  |fferLength=10..@|
0000b290  26 f2 55 70 64 61 74 65  47 72 61 62 49 63 6f 6e  |&.UpdateGrabIcon|
0000b2a0  28 22 22 2c 42 75 66 66  65 72 4c 65 6e 67 74 68  |("",BufferLength|
0000b2b0  2c b9 29 0d 2e 4a 21 f2  55 70 64 61 74 65 49 63  |,.)..J!.UpdateIc|
0000b2c0  6f 6e 43 6f 6c 6f 75 72  28 47 72 61 62 2c 34 2c  |onColour(Grab,4,|
0000b2d0  37 2c 31 29 0d 2e 54 1c  f2 53 68 61 64 65 4d 65  |7,1)..T..ShadeMe|
0000b2e0  6e 75 28 4d 61 69 6e 4d  65 6e 75 2c 31 2c a3 29  |nu(MainMenu,1,.)|
0000b2f0  0d 2e 5e 1c f2 53 68 61  64 65 4d 65 6e 75 28 4d  |..^..ShadeMenu(M|
0000b300  61 69 6e 4d 65 6e 75 2c  32 2c a3 29 0d 2e 68 1c  |ainMenu,2,.)..h.|
0000b310  f2 53 68 61 64 65 4d 65  6e 75 28 4d 61 69 6e 4d  |.ShadeMenu(MainM|
0000b320  65 6e 75 2c 34 2c a3 29  0d 2e 72 24 54 79 70 69  |enu,4,.)..r$Typi|
0000b330  6e 67 3d a3 3a f2 54 69  63 6b 4d 65 6e 75 28 4d  |ng=.:.TickMenu(M|
0000b340  61 69 6e 4d 65 6e 75 2c  32 2c a3 29 0d 2e 7c 05  |ainMenu,2,.)..|.|
0000b350  e1 0d 2e 86 05 3a 0d 2e  90 13 dd 20 f2 52 65 73  |.....:..... .Res|
0000b360  65 74 47 72 61 62 62 65  72 0d 2e 9a 24 f2 4d 69  |etGrabber...$.Mi|
0000b370  6e 69 6d 69 73 65 57 69  6d 70 53 6c 6f 74 3a 42  |nimiseWimpSlot:B|
0000b380  75 66 66 65 72 4c 65 6e  67 74 68 3d 30 0d 2e a4  |ufferLength=0...|
0000b390  26 f2 55 70 64 61 74 65  47 72 61 62 49 63 6f 6e  |&.UpdateGrabIcon|
0000b3a0  28 22 57 61 69 74 69 6e  67 2e 2e 2e 22 2c 2d 31  |("Waiting...",-1|
0000b3b0  2c b9 29 0d 2e ae 21 f2  55 70 64 61 74 65 49 63  |,.)...!.UpdateIc|
0000b3c0  6f 6e 43 6f 6c 6f 75 72  28 47 72 61 62 2c 34 2c  |onColour(Grab,4,|
0000b3d0  33 2c 31 29 0d 2e b8 1c  f2 53 68 61 64 65 4d 65  |3,1).....ShadeMe|
0000b3e0  6e 75 28 4d 61 69 6e 4d  65 6e 75 2c 31 2c b9 29  |nu(MainMenu,1,.)|
0000b3f0  0d 2e c2 1c f2 53 68 61  64 65 4d 65 6e 75 28 4d  |.....ShadeMenu(M|
0000b400  61 69 6e 4d 65 6e 75 2c  32 2c b9 29 0d 2e cc 1c  |ainMenu,2,.)....|
0000b410  f2 53 68 61 64 65 4d 65  6e 75 28 4d 61 69 6e 4d  |.ShadeMenu(MainM|
0000b420  65 6e 75 2c 34 2c b9 29  0d 2e d6 24 54 79 70 69  |enu,4,.)...$Typi|
0000b430  6e 67 3d a3 3a f2 54 69  63 6b 4d 65 6e 75 28 4d  |ng=.:.TickMenu(M|
0000b440  61 69 6e 4d 65 6e 75 2c  32 2c a3 29 0d 2e e0 05  |ainMenu,2,.)....|
0000b450  e1 0d 2e ea 05 3a 0d 2e  f4 15 dd 20 f2 54 79 70  |.....:..... .Typ|
0000b460  65 41 43 68 61 72 61 63  74 65 72 0d 2e fe 5b c8  |eACharacter...[.|
0000b470  99 20 22 57 69 6d 70 5f  47 65 74 43 61 72 65 74  |. "Wimp_GetCaret|
0000b480  50 6f 73 69 74 69 6f 6e  22 2c 2c 42 6c 6f 63 6b  |Position",,Block|
0000b490  3a e7 20 42 6c 6f 63 6b  21 30 3d 2d 31 20 8c 20  |:. Block!0=-1 . |
0000b4a0  54 79 70 69 6e 67 3d a3  3a ef 20 37 3a f2 54 69  |Typing=.:. 7:.Ti|
0000b4b0  63 6b 4d 65 6e 75 28 4d  61 69 6e 4d 65 6e 75 2c  |ckMenu(MainMenu,|
0000b4c0  32 2c a3 29 3a e1 0d 2f  08 19 e7 20 55 25 3f 54  |2,.):../... U%?T|
0000b4d0  79 70 65 43 6f 75 6e 74  65 72 3c 33 32 20 8c 0d  |ypeCounter<32 ..|
0000b4e0  2f 12 4c 20 20 e7 20 28  55 25 3f 54 79 70 65 43  |/.L  . (U%?TypeC|
0000b4f0  6f 75 6e 74 65 72 3d 31  33 29 20 84 20 28 28 55  |ounter=13) . ((U|
0000b500  25 3f 54 79 70 65 43 6f  75 6e 74 65 72 3e 3d 38  |%?TypeCounter>=8|
0000b510  29 20 80 20 28 55 25 3f  54 79 70 65 43 6f 75 6e  |) . (U%?TypeCoun|
0000b520  74 65 72 3c 3d 31 31 29  29 20 8c 0d 2f 1c 2b 20  |ter<=11)) ../.+ |
0000b530  20 20 20 c8 99 20 22 57  69 6d 70 5f 50 72 6f 63  |   .. "Wimp_Proc|
0000b540  65 73 73 4b 65 79 22 2c  55 25 3f 54 79 70 65 43  |essKey",U%?TypeC|
0000b550  6f 75 6e 74 65 72 0d 2f  26 07 20 20 cc 0d 2f 30  |ounter./&.  ../0|
0000b560  1f 20 20 20 20 c8 99 20  22 57 69 6d 70 5f 50 72  |.    .. "Wimp_Pr|
0000b570  6f 63 65 73 73 4b 65 79  22 2c 33 32 0d 2f 3a 07  |ocessKey",32./:.|
0000b580  20 20 cd 0d 2f 44 05 cc  0d 2f 4e 29 20 20 c8 99  |  ../D.../N)  ..|
0000b590  20 22 57 69 6d 70 5f 50  72 6f 63 65 73 73 4b 65  | "Wimp_ProcessKe|
0000b5a0  79 22 2c 55 25 3f 54 79  70 65 43 6f 75 6e 74 65  |y",U%?TypeCounte|
0000b5b0  72 0d 2f 58 05 cd 0d 2f  62 12 54 79 70 65 43 6f  |r./X.../b.TypeCo|
0000b5c0  75 6e 74 65 72 2b 3d 31  0d 2f 6c 42 e7 20 54 79  |unter+=1./lB. Ty|
0000b5d0  70 65 43 6f 75 6e 74 65  72 3e 3d 42 75 66 66 65  |peCounter>=Buffe|
0000b5e0  72 4c 65 6e 67 74 68 20  8c 20 54 79 70 69 6e 67  |rLength . Typing|
0000b5f0  3d a3 3a f2 54 69 63 6b  4d 65 6e 75 28 4d 61 69  |=.:.TickMenu(Mai|
0000b600  6e 4d 65 6e 75 2c 32 2c  a3 29 0d 2f 76 05 e1 0d  |nMenu,2,.)./v...|
0000b610  2f 80 05 3a 0d 2f 8a 18  dd 20 f2 54 72 61 6e 73  |/..:./... .Trans|
0000b620  66 65 72 54 65 78 74 53  74 61 72 74 0d 2f 94 0c  |ferTextStart./..|
0000b630  e7 20 50 6f 6b 65 20 8c  0d 2f 9e 48 20 20 f4 20  |. Poke ../.H  . |
0000b640  57 65 27 72 65 20 75 73  69 6e 67 20 74 68 65 20  |We're using the |
0000b650  68 61 6e 64 20 70 6f 69  6e 74 65 72 20 74 6f 20  |hand pointer to |
0000b660  70 6f 6b 65 20 74 65 78  74 20 69 6e 74 6f 20 61  |poke text into a|
0000b670  6e 20 61 72 62 69 74 72  61 72 79 20 69 63 6f 6e  |n arbitrary icon|
0000b680  0d 2f a8 31 20 20 c8 99  20 22 57 69 6d 70 5f 53  |./.1  .. "Wimp_S|
0000b690  70 72 69 74 65 4f 70 22  2c 33 36 2c 2c 22 70 74  |priteOp",36,,"pt|
0000b6a0  72 5f 67 72 61 62 68 61  6e 64 22 2c 32 2c 35 2c  |r_grabhand",2,5,|
0000b6b0  30 0d 2f b2 1b 20 20 f5  20 fd 20 28 a6 28 2d 31  |0./..  . . (.(-1|
0000b6c0  30 29 20 84 20 a6 28 2d  31 32 29 29 0d 2f bc 2c  |0) . .(-12))./.,|
0000b6d0  20 20 c8 99 20 22 57 69  6d 70 5f 53 70 72 69 74  |  .. "Wimp_Sprit|
0000b6e0  65 4f 70 22 2c 33 36 2c  2c 22 70 74 72 5f 64 65  |eOp",36,,"ptr_de|
0000b6f0  66 61 75 6c 74 22 2c 31  0d 2f c6 4b 20 20 c8 99  |fault",1./.K  ..|
0000b700  20 22 4f 53 5f 42 79 74  65 22 2c 32 31 2c 39 3a  | "OS_Byte",21,9:|
0000b710  f4 20 46 6c 75 73 68 20  6d 6f 75 73 65 20 62 75  |. Flush mouse bu|
0000b720  66 66 65 72 20 69 6e 20  63 61 73 65 20 4d 45 4e  |ffer in case MEN|
0000b730  55 20 68 61 73 20 62 65  65 6e 20 63 6c 69 63 6b  |U has been click|
0000b740  65 64 2e 0d 2f d0 28 20  20 54 72 61 6e 73 66 65  |ed../.(  Transfe|
0000b750  72 72 69 6e 67 3d 32 3a  f4 20 57 61 69 74 20 32  |rring=2:. Wait 2|
0000b760  20 57 69 6d 70 5f 50 6f  6c 6c 73 0d 2f da 05 cc  | Wimp_Polls./...|
0000b770  0d 2f e4 34 20 20 f4 20  57 65 27 72 65 20 73 65  |./.4  . We're se|
0000b780  6e 64 69 6e 67 20 74 68  65 20 74 65 78 74 20 73  |nding the text s|
0000b790  74 72 61 69 67 68 74 20  74 6f 20 74 68 65 20 63  |traight to the c|
0000b7a0  61 72 65 74 0d 2f ee 27  20 20 54 72 61 6e 73 66  |aret./.'  Transf|
0000b7b0  65 72 72 69 6e 67 3d 31  3a f4 20 57 61 69 74 20  |erring=1:. Wait |
0000b7c0  31 20 57 69 6d 70 5f 50  6f 6c 6c 0d 2f f8 05 cd  |1 Wimp_Poll./...|
0000b7d0  0d 30 02 05 e1 0d 30 0c  05 3a 0d 30 16 13 dd 20  |.0....0..:.0... |
0000b7e0  f2 54 72 61 6e 73 66 65  72 54 65 78 74 0d 30 20  |.TransferText.0 |
0000b7f0  07 ea 20 85 0d 30 2a 4c  ee 20 85 20 ea 20 f7 20  |.. ..0*L. . . . |
0000b800  85 3a 85 20 39 39 39 39  2c 22 41 6e 20 65 72 72  |.:. 9999,"An err|
0000b810  6f 72 20 6f 63 63 75 72  72 65 64 20 77 68 69 6c  |or occurred whil|
0000b820  73 74 20 74 72 79 69 6e  67 20 74 6f 20 74 72 61  |st trying to tra|
0000b830  6e 73 66 65 72 20 74 68  65 20 74 65 78 74 2e 22  |nsfer the text."|
0000b840  0d 30 34 0c e7 20 50 6f  6b 65 20 8c 0d 30 3e 25  |.04.. Poke ..0>%|
0000b850  20 20 c8 99 20 22 57 69  6d 70 5f 47 65 74 50 6f  |  .. "Wimp_GetPo|
0000b860  69 6e 74 65 72 49 6e 66  6f 22 2c 2c 42 6c 6f 63  |interInfo",,Bloc|
0000b870  6b 0d 30 48 23 20 20 57  69 6e 64 6f 77 3d 42 6c  |k.0H#  Window=Bl|
0000b880  6f 63 6b 21 31 32 3a 49  63 6f 6e 3d 42 6c 6f 63  |ock!12:Icon=Bloc|
0000b890  6b 21 31 36 0d 30 52 11  20 20 e7 20 49 63 6f 6e  |k!16.0R.  . Icon|
0000b8a0  3e 3d 30 20 8c 0d 30 5c  41 20 20 20 20 42 6c 6f  |>=0 ..0\A    Blo|
0000b8b0  63 6b 21 30 3d 57 69 6e  64 6f 77 3a 42 6c 6f 63  |ck!0=Window:Bloc|
0000b8c0  6b 21 34 3d 49 63 6f 6e  3a c8 99 20 22 57 69 6d  |k!4=Icon:.. "Wim|
0000b8d0  70 5f 47 65 74 49 63 6f  6e 53 74 61 74 65 22 2c  |p_GetIconState",|
0000b8e0  2c 42 6c 6f 63 6b 0d 30  66 24 20 20 20 20 69 6d  |,Block.0f$    im|
0000b8f0  69 6e 58 3d 42 6c 6f 63  6b 21 38 3a 69 6d 69 6e  |inX=Block!8:imin|
0000b900  59 3d 42 6c 6f 63 6b 21  31 32 0d 30 70 25 20 20  |Y=Block!12.0p%  |
0000b910  20 20 69 6d 61 78 58 3d  42 6c 6f 63 6b 21 31 36  |  imaxX=Block!16|
0000b920  3a 69 6d 61 78 59 3d 42  6c 6f 63 6b 21 32 30 0d  |:imaxY=Block!20.|
0000b930  30 7a 1a 20 20 20 20 49  63 6f 6e 46 6c 61 67 73  |0z.    IconFlags|
0000b940  3d 42 6c 6f 63 6b 21 32  34 0d 30 84 4a 20 20 20  |=Block!24.0.J   |
0000b950  20 49 53 54 3d 28 28 49  63 6f 6e 46 6c 61 67 73  | IST=((IconFlags|
0000b960  20 80 20 28 31 3c 3c 38  29 29 3e 3e 36 29 2b 28  | . (1<<8))>>6)+(|
0000b970  49 63 6f 6e 46 6c 61 67  73 20 80 20 28 31 3c 3c  |IconFlags . (1<<|
0000b980  31 29 29 2b 28 49 63 6f  6e 46 6c 61 67 73 20 80  |1))+(IconFlags .|
0000b990  20 31 29 0d 30 8e 4b 20  20 20 20 e7 20 28 49 63  | 1).0.K    . (Ic|
0000b9a0  6f 6e 46 6c 61 67 73 20  80 20 28 31 3c 3c 38 29  |onFlags . (1<<8)|
0000b9b0  29 3d 28 31 3c 3c 38 29  20 8c 20 44 65 73 74 4c  |)=(1<<8) . DestL|
0000b9c0  65 6e 67 74 68 3d 42 6c  6f 63 6b 21 33 36 3a 8b  |ength=Block!36:.|
0000b9d0  20 44 65 73 74 4c 65 6e  67 74 68 3d 31 32 0d 30  | DestLength=12.0|
0000b9e0  98 07 20 20 cd 0d 30 a2  10 20 20 e7 20 49 63 6f  |..  ..0..  . Ico|
0000b9f0  6e 3c 30 20 8c 0d 30 ac  13 20 20 20 20 e7 20 49  |n<0 ..0..    . I|
0000ba00  63 6f 6e 3d 2d 34 20 8c  0d 30 b6 1d 20 20 20 20  |con=-4 ..0..    |
0000ba10  20 20 f4 20 54 69 74 6c  65 20 62 61 72 20 63 6c  |  . Title bar cl|
0000ba20  69 63 6b 65 64 0d 30 c0  47 20 20 20 20 20 20 f7  |icked.0.G      .|
0000ba30  20 85 3a 85 20 39 39 39  39 2c 22 59 6f 75 20 63  | .:. 9999,"You c|
0000ba40  61 6e 6e 6f 74 20 74 72  61 6e 73 66 65 72 20 74  |annot transfer t|
0000ba50  65 78 74 20 69 6e 74 6f  20 74 69 74 6c 65 20 62  |ext into title b|
0000ba60  61 72 73 2e 20 53 6f 72  72 79 2e 22 0d 30 ca 09  |ars. Sorry.".0..|
0000ba70  20 20 20 20 cc 0d 30 d4  15 20 20 20 20 20 20 e7  |    ..0..      .|
0000ba80  20 49 63 6f 6e 3d 2d 31  20 8c 0d 30 de 27 20 20  | Icon=-1 ..0.'  |
0000ba90  20 20 20 20 20 20 f4 20  57 69 6e 64 6f 77 20 62  |      . Window b|
0000baa0  61 63 6b 67 72 6f 75 6e  64 20 63 6c 69 63 6b 65  |ackground clicke|
0000bab0  64 0d 30 e8 2d 20 20 20  20 20 20 20 20 c8 99 20  |d.0.-        .. |
0000bac0  22 57 69 6d 70 5f 47 65  74 43 61 72 65 74 50 6f  |"Wimp_GetCaretPo|
0000bad0  73 69 74 69 6f 6e 22 2c  2c 42 6c 6f 63 6b 0d 30  |sition",,Block.0|
0000bae0  f2 1e 20 20 20 20 20 20  20 20 e7 20 42 6c 6f 63  |..        . Bloc|
0000baf0  6b 21 30 3d 57 69 6e 64  6f 77 20 8c 0d 30 fc 48  |k!0=Window ..0.H|
0000bb00  20 20 20 20 20 20 20 20  20 20 f4 20 43 6c 69 63  |          . Clic|
0000bb10  6b 65 64 20 6f 6e 20 74  68 65 20 62 61 63 6b 67  |ked on the backg|
0000bb20  72 6f 75 6e 64 20 6f 66  20 74 68 65 20 77 69 6e  |round of the win|
0000bb30  64 6f 77 20 6f 77 6e 69  6e 67 20 74 68 65 20 63  |dow owning the c|
0000bb40  61 72 65 74 0d 31 06 24  20 20 20 20 20 20 20 20  |aret.1.$        |
0000bb50  20 20 f7 20 85 3a f2 54  72 61 6e 73 6d 69 74 54  |  . .:.TransmitT|
0000bb60  65 78 74 53 74 61 72 74  0d 31 10 0d 20 20 20 20  |extStart.1..    |
0000bb70  20 20 20 20 cc 0d 31 1a  36 20 20 20 20 20 20 20  |    ..1.6       |
0000bb80  20 20 20 f4 20 43 6c 69  63 6b 65 64 20 6f 6e 20  |   . Clicked on |
0000bb90  61 6e 6f 74 68 65 72 20  77 69 6e 64 6f 77 27 73  |another window's|
0000bba0  20 62 61 63 6b 67 72 6f  75 6e 64 0d 31 24 64 20  | background.1$d |
0000bbb0  20 20 20 20 20 20 20 20  20 f7 20 85 3a 85 20 39  |         . .:. 9|
0000bbc0  39 39 39 2c 22 59 6f 75  20 63 61 6e 6e 6f 74 20  |999,"You cannot |
0000bbd0  74 72 61 6e 73 66 65 72  20 74 65 78 74 20 74 6f  |transfer text to|
0000bbe0  20 77 69 6e 64 6f 77 20  62 61 63 6b 67 72 6f 75  | window backgrou|
0000bbf0  6e 64 73 20 75 6e 6c 65  73 73 20 74 68 65 79 20  |nds unless they |
0000bc00  6f 77 6e 20 74 68 65 20  63 61 72 65 74 2e 22 0d  |own the caret.".|
0000bc10  31 2e 0d 20 20 20 20 20  20 20 20 cd 0d 31 38 0b  |1..        ..18.|
0000bc20  20 20 20 20 20 20 cc 0d  31 42 3b 20 20 20 20 20  |      ..1B;     |
0000bc30  20 20 20 f4 20 41 6e 79  20 6f 74 68 65 72 20 6e  |   . Any other n|
0000bc40  65 67 61 74 69 76 65 20  76 61 6c 75 65 20 6d 65  |egative value me|
0000bc50  61 6e 73 20 61 20 77 69  6e 64 6f 77 20 74 6f 6f  |ans a window too|
0000bc60  6c 3a 0d 31 4c 48 20 20  20 20 20 20 20 20 f7 20  |l:.1LH        . |
0000bc70  85 3a 85 20 39 39 39 39  2c 22 59 6f 75 20 63 61  |.:. 9999,"You ca|
0000bc80  6e 6e 6f 74 20 74 72 61  6e 73 66 65 72 20 74 65  |nnot transfer te|
0000bc90  78 74 20 69 6e 74 6f 20  74 68 65 20 77 69 6e 64  |xt into the wind|
0000bca0  6f 77 20 74 6f 6f 6c 73  2e 22 0d 31 56 0b 20 20  |ow tools.".1V.  |
0000bcb0  20 20 20 20 cd 0d 31 60  09 20 20 20 20 cd 0d 31  |    ..1`.    ..1|
0000bcc0  6a 07 20 20 cc 0d 31 74  1d 20 20 20 20 f4 20 4e  |j.  ..1t.    . N|
0000bcd0  6f 72 6d 61 6c 20 69 63  6f 6e 20 63 6c 69 63 6b  |ormal icon click|
0000bce0  65 64 0d 31 7e 28 20 20  20 20 42 6c 6f 63 6b 21  |ed.1~(    Block!|
0000bcf0  30 3d 32 30 3a 42 6c 6f  63 6b 21 31 32 3d 30 3a  |0=20:Block!12=0:|
0000bd00  42 6c 6f 63 6b 21 31 36  3d 30 0d 31 88 3f 20 20  |Block!16=0.1.?  |
0000bd10  20 20 c8 99 20 22 57 69  6d 70 5f 53 65 6e 64 4d  |  .. "Wimp_SendM|
0000bd20  65 73 73 61 67 65 22 2c  31 39 2c 42 6c 6f 63 6b  |essage",19,Block|
0000bd30  2c 57 69 6e 64 6f 77 2c  49 63 6f 6e 20 b8 20 2c  |,Window,Icon . ,|
0000bd40  2c 44 65 73 74 54 61 73  6b 0d 31 92 4b 20 20 20  |,DestTask.1.K   |
0000bd50  20 f4 20 5e 20 54 68 69  73 20 67 65 74 73 20 74  | . ^ This gets t|
0000bd60  68 65 20 72 65 71 75 69  72 65 64 20 74 61 73 6b  |he required task|
0000bd70  6e 61 6d 65 20 77 69 74  68 6f 75 74 20 73 65 6e  |name without sen|
0000bd80  64 69 6e 67 20 61 20 72  65 61 6c 20 6d 65 73 73  |ding a real mess|
0000bd90  61 67 65 2e 0d 31 9c 10  20 20 20 20 c8 8e 20 49  |age..1..    .. I|
0000bda0  53 54 20 ca 0d 31 a6 1a  20 20 20 20 20 20 c9 20  |ST ..1..      . |
0000bdb0  25 31 30 31 2c 25 31 31  31 2c 25 31 31 30 0d 31  |%101,%111,%110.1|
0000bdc0  b0 45 20 20 20 20 20 20  20 20 42 6c 6f 63 6b 21  |.E        Block!|
0000bdd0  30 3d 57 69 6e 64 6f 77  3a 42 6c 6f 63 6b 21 34  |0=Window:Block!4|
0000bde0  3d 49 63 6f 6e 3a c8 99  20 22 57 69 6d 70 5f 47  |=Icon:.. "Wimp_G|
0000bdf0  65 74 49 63 6f 6e 53 74  61 74 65 22 2c 2c 42 6c  |etIconState",,Bl|
0000be00  6f 63 6b 0d 31 ba 1a 20  20 20 20 20 20 20 20 e7  |ock.1..        .|
0000be10  20 44 65 73 74 54 61 73  6b 3d 30 20 8c 0d 31 c4  | DestTask=0 ..1.|
0000be20  35 20 20 20 20 20 20 20  20 20 20 f4 20 59 6f 75  |5          . You|
0000be30  20 67 65 74 20 61 20 74  61 73 6b 20 68 61 6e 64  | get a task hand|
0000be40  6c 65 20 6f 66 20 30 20  66 6f 72 20 6d 65 6e 75  |le of 0 for menu|
0000be50  73 2e 0d 31 ce 11 20 20  20 20 20 20 20 20 20 20  |s..1..          |
0000be60  4e 3d 30 0d 31 d8 32 20  20 20 20 20 20 20 20 20  |N=0.1.2         |
0000be70  20 c8 95 20 28 4e 3c 44  65 73 74 4c 65 6e 67 74  | .. (N<DestLengt|
0000be80  68 29 20 80 20 28 4e 3c  42 75 66 66 65 72 4c 65  |h) . (N<BufferLe|
0000be90  6e 67 74 68 29 0d 31 e2  24 20 20 20 20 20 20 20  |ngth).1.$       |
0000bea0  20 20 20 20 20 3f 28 28  42 6c 6f 63 6b 21 32 38  |     ?((Block!28|
0000beb0  29 2b 4e 29 3d 55 25 3f  4e 0d 31 ec 14 20 20 20  |)+N)=U%?N.1..   |
0000bec0  20 20 20 20 20 20 20 20  20 4e 2b 3d 31 0d 31 f6  |         N+=1.1.|
0000bed0  0f 20 20 20 20 20 20 20  20 20 20 ce 0d 32 00 0d  |.          ..2..|
0000bee0  20 20 20 20 20 20 20 20  cc 0d 32 0a 41 20 20 20  |        ..2.A   |
0000bef0  20 20 20 20 20 20 20 e7  20 42 75 66 66 65 72 4c  |       . BufferL|
0000bf00  65 6e 67 74 68 3c 44 65  73 74 4c 65 6e 67 74 68  |ength<DestLength|
0000bf10  20 8c 20 44 65 73 74 4c  65 6e 67 74 68 3d 42 75  | . DestLength=Bu|
0000bf20  66 66 65 72 4c 65 6e 67  74 68 0d 32 14 4c 20 20  |fferLength.2.L  |
0000bf30  20 20 20 20 20 20 20 20  c8 99 20 22 57 69 6d 70  |        .. "Wimp|
0000bf40  5f 54 72 61 6e 73 66 65  72 42 6c 6f 63 6b 22 2c  |_TransferBlock",|
0000bf50  54 61 73 6b 2c 55 25 2c  44 65 73 74 54 61 73 6b  |Task,U%,DestTask|
0000bf60  2c 42 6c 6f 63 6b 21 32  38 2c 44 65 73 74 4c 65  |,Block!28,DestLe|
0000bf70  6e 67 74 68 2d 31 0d 32  1e 7b 20 20 20 20 20 20  |ngth-1.2.{      |
0000bf80  20 20 20 20 c8 99 20 22  57 69 6d 70 5f 54 72 61  |    .. "Wimp_Tra|
0000bf90  6e 73 66 65 72 42 6c 6f  63 6b 22 2c 54 61 73 6b  |nsferBlock",Task|
0000bfa0  2c bd 31 33 2c 44 65 73  74 54 61 73 6b 2c 28 42  |,.13,DestTask,(B|
0000bfb0  6c 6f 63 6b 21 32 38 29  2b 44 65 73 74 4c 65 6e  |lock!28)+DestLen|
0000bfc0  67 74 68 2d 31 2c 31 3a  f4 20 54 72 61 6e 73 6d  |gth-1,1:. Transm|
0000bfd0  69 74 20 61 20 74 65 72  6d 69 6e 61 74 6f 72 20  |it a terminator |
0000bfe0  74 6f 20 61 76 6f 69 64  20 63 72 61 73 68 65 73  |to avoid crashes|
0000bff0  2e 0d 32 28 2f 20 20 20  20 20 20 20 20 20 20 c8  |..2(/          .|
0000c000  99 20 22 57 69 6d 70 5f  47 65 74 43 61 72 65 74  |. "Wimp_GetCaret|
0000c010  50 6f 73 69 74 69 6f 6e  22 2c 2c 42 6c 6f 63 6b  |Position",,Block|
0000c020  0d 32 32 68 20 20 20 20  20 20 20 20 20 20 e7 20  |.22h          . |
0000c030  42 6c 6f 63 6b 21 30 3d  57 69 6e 64 6f 77 20 80  |Block!0=Window .|
0000c040  20 42 6c 6f 63 6b 21 34  3d 49 63 6f 6e 20 8c 20  | Block!4=Icon . |
0000c050  c8 99 20 22 57 69 6d 70  5f 53 65 74 43 61 72 65  |.. "Wimp_SetCare|
0000c060  74 50 6f 73 69 74 69 6f  6e 22 2c 57 69 6e 64 6f  |tPosition",Windo|
0000c070  77 2c 49 63 6f 6e 2c 2c  2c 2d 31 2c 44 65 73 74  |w,Icon,,,-1,Dest|
0000c080  4c 65 6e 67 74 68 2d 31  0d 32 3c 42 20 20 20 20  |Length-1.2<B    |
0000c090  20 20 20 20 20 20 c8 99  20 22 57 69 6d 70 5f 46  |      .. "Wimp_F|
0000c0a0  6f 72 63 65 52 65 64 72  61 77 22 2c 57 69 6e 64  |orceRedraw",Wind|
0000c0b0  6f 77 2c 69 6d 69 6e 58  2c 69 6d 69 6e 59 2c 69  |ow,iminX,iminY,i|
0000c0c0  6d 61 78 58 2c 69 6d 61  78 59 0d 32 46 0d 20 20  |maxX,imaxY.2F.  |
0000c0d0  20 20 20 20 20 20 cd 0d  32 50 1a 20 20 20 20 20  |      ..2P.     |
0000c0e0  20 c9 20 25 30 30 31 2c  25 30 31 31 2c 25 30 31  | . %001,%011,%01|
0000c0f0  30 0d 32 5a 78 20 20 20  20 20 20 20 20 f7 20 85  |0.2Zx        . .|
0000c100  3a 85 20 39 39 39 39 2c  22 49 6e 61 70 70 72 6f  |:. 9999,"Inappro|
0000c110  70 72 69 61 74 65 20 64  65 73 74 69 6e 61 74 69  |priate destinati|
0000c120  6f 6e 2e 20 59 6f 75 20  63 61 6e 6e 6f 74 20 65  |on. You cannot e|
0000c130  78 70 6f 72 74 20 74 6f  20 64 69 72 65 63 74 20  |xport to direct |
0000c140  74 65 78 74 20 28 73 68  6f 72 74 20 6c 61 62 65  |text (short labe|
0000c150  6c 73 20 65 74 63 29 20  6f 72 20 73 70 72 69 74  |ls etc) or sprit|
0000c160  65 20 69 63 6f 6e 73 2e  22 0d 32 64 0b 20 20 20  |e icons.".2d.   |
0000c170  20 20 20 7f 0d 32 6e 33  20 20 20 20 20 20 20 20  |   ..2n3        |
0000c180  f7 20 85 3a 85 20 39 39  39 39 2c 22 49 6e 61 70  |. .:. 9999,"Inap|
0000c190  70 72 6f 70 72 69 61 74  65 20 64 65 73 74 69 6e  |propriate destin|
0000c1a0  61 74 69 6f 6e 2e 22 0d  32 78 09 20 20 20 20 cb  |ation.".2x.    .|
0000c1b0  0d 32 82 07 20 20 cd 0d  32 8c 05 cc 0d 32 96 38  |.2..  ..2....2.8|
0000c1c0  20 20 f4 20 50 6f 6b 65  20 69 73 20 46 41 4c 53  |  . Poke is FALS|
0000c1d0  45 2c 20 73 6f 20 74 72  61 6e 73 6d 69 74 20 74  |E, so transmit t|
0000c1e0  68 65 20 74 65 78 74 20  74 6f 20 74 68 65 20 63  |he text to the c|
0000c1f0  61 72 65 74 0d 32 a0 1c  20 20 f7 20 85 3a f2 54  |aret.2..  . .:.T|
0000c200  72 61 6e 73 6d 69 74 54  65 78 74 53 74 61 72 74  |ransmitTextStart|
0000c210  0d 32 aa 05 cd 0d 32 b4  05 e1 0d 32 be 05 3a 0d  |.2....2....2..:.|
0000c220  32 c8 18 dd 20 f2 54 72  61 6e 73 6d 69 74 54 65  |2... .TransmitTe|
0000c230  78 74 53 74 61 72 74 0d  32 d2 4b f4 20 4e 6f 74  |xtStart.2.K. Not|
0000c240  20 70 6f 6b 69 6e 67 2c  20 73 6f 20 73 65 6e 64  | poking, so send|
0000c250  20 74 68 65 20 74 65 78  74 20 74 6f 20 74 68 65  | the text to the|
0000c260  20 63 61 72 65 74 2c 20  6f 72 20 62 65 65 70 20  | caret, or beep |
0000c270  69 66 20 74 68 65 72 65  20 69 73 6e 27 74 20 6f  |if there isn't o|
0000c280  6e 65 0d 32 dc 25 c8 99  20 22 57 69 6d 70 5f 47  |ne.2.%.. "Wimp_G|
0000c290  65 74 43 61 72 65 74 50  6f 73 69 74 69 6f 6e 22  |etCaretPosition"|
0000c2a0  2c 2c 42 6c 6f 63 6b 0d  32 e6 1f 57 69 6e 64 6f  |,,Block.2..Windo|
0000c2b0  77 3d 42 6c 6f 63 6b 21  30 3a 49 63 6f 6e 3d 42  |w=Block!0:Icon=B|
0000c2c0  6c 6f 63 6b 21 34 0d 32  f0 16 e7 20 57 69 6e 64  |lock!4.2... Wind|
0000c2d0  6f 77 3d 2d 31 20 8c 20  ef 37 3a e1 0d 32 fa 25  |ow=-1 . .7:..2.%|
0000c2e0  f4 20 46 69 6e 64 20 6f  75 74 20 6c 65 61 66 20  |. Find out leaf |
0000c2f0  6e 61 6d 65 20 69 6e 20  73 61 76 65 20 62 6f 78  |name in save box|
0000c300  3a 0d 33 04 2a 44 72 61  67 67 69 6e 67 24 3d a4  |:.3.*Dragging$=.|
0000c310  52 65 61 64 49 63 6f 6e  53 74 72 28 53 61 76 65  |ReadIconStr(Save|
0000c320  2c 32 29 3a 4d 79 52 65  66 3d 30 0d 33 0e 28 42  |,2):MyRef=0.3.(B|
0000c330  6c 6f 63 6b 21 30 3d 35  32 3a 42 6c 6f 63 6b 21  |lock!0=52:Block!|
0000c340  31 32 3d 4d 79 52 65 66  3a 42 6c 6f 63 6b 21 31  |12=MyRef:Block!1|
0000c350  36 3d 31 0d 33 18 21 42  6c 6f 63 6b 21 32 30 3d  |6=1.3.!Block!20=|
0000c360  57 69 6e 64 6f 77 3a 42  6c 6f 63 6b 21 32 34 3d  |Window:Block!24=|
0000c370  49 63 6f 6e 0d 33 22 2c  42 6c 6f 63 6b 21 32 38  |Icon.3",Block!28|
0000c380  3d a4 43 61 72 65 74 50  6f 73 69 74 69 6f 6e 54  |=.CaretPositionT|
0000c390  6f 43 6f 6f 72 64 69 6e  61 74 65 28 22 58 22 29  |oCoordinate("X")|
0000c3a0  0d 33 2c 2c 42 6c 6f 63  6b 21 33 32 3d a4 43 61  |.3,,Block!32=.Ca|
0000c3b0  72 65 74 50 6f 73 69 74  69 6f 6e 54 6f 43 6f 6f  |retPositionToCoo|
0000c3c0  72 64 69 6e 61 74 65 28  22 59 22 29 0d 33 36 40  |rdinate("Y").36@|
0000c3d0  42 6c 6f 63 6b 21 33 36  3d 42 75 66 66 65 72 4c  |Block!36=BufferL|
0000c3e0  65 6e 67 74 68 3a 42 6c  6f 63 6b 21 34 30 3d 26  |ength:Block!40=&|
0000c3f0  46 46 46 3a 24 28 42 6c  6f 63 6b 2b 34 34 29 3d  |FFF:$(Block+44)=|
0000c400  44 72 61 67 67 69 6e 67  24 2b bd 30 0d 33 40 3b  |Dragging$+.0.3@;|
0000c410  c8 99 20 22 57 69 6d 70  5f 53 65 6e 64 4d 65 73  |.. "Wimp_SendMes|
0000c420  73 61 67 65 22 2c 31 37  2c 42 6c 6f 63 6b 2c 57  |sage",17,Block,W|
0000c430  69 6e 64 6f 77 2c 49 63  6f 6e 20 b8 20 2c 2c 44  |indow,Icon . ,,D|
0000c440  65 73 74 54 61 73 6b 0d  33 4a 21 54 72 61 6e 73  |estTask.3J!Trans|
0000c450  6d 69 74 3d b9 3a 54 72  61 6e 73 6d 69 74 74 65  |mit=.:Transmitte|
0000c460  64 42 79 74 65 73 3d 30  0d 33 54 05 e1 0d 33 5e  |dBytes=0.3T...3^|
0000c470  05 3a 0d 33 68 13 dd 20  f2 54 72 61 6e 73 6d 69  |.:.3h.. .Transmi|
0000c480  74 54 65 78 74 0d 33 72  32 f4 20 57 65 20 61 72  |tText.3r2. We ar|
0000c490  65 20 65 78 70 6f 72 74  69 6e 67 20 67 72 61 62  |e exporting grab|
0000c4a0  62 65 64 20 74 65 78 74  20 74 68 72 6f 75 67 68  |bed text through|
0000c4b0  20 6d 65 6d 6f 72 79 0d  33 7c 30 f4 20 42 6c 6f  | memory.3|0. Blo|
0000c4c0  63 6b 21 32 30 20 69 73  20 74 68 65 20 61 64 64  |ck!20 is the add|
0000c4d0  72 65 73 73 20 77 65 20  61 72 65 20 77 72 69 74  |ress we are writ|
0000c4e0  69 6e 67 20 74 6f 2e 0d  33 86 3d f4 20 42 6c 6f  |ing to..3.=. Blo|
0000c4f0  63 6b 21 32 34 20 69 73  20 74 68 65 20 73 69 7a  |ck!24 is the siz|
0000c500  65 20 6f 66 20 74 68 65  20 62 75 66 66 65 72 20  |e of the buffer |
0000c510  77 65 20 61 72 65 20 77  72 69 74 69 6e 67 20 69  |we are writing i|
0000c520  6e 74 6f 2e 0d 33 90 30  54 72 61 6e 73 6d 69 74  |nto..3.0Transmit|
0000c530  3d a3 3a c8 99 20 22 57  69 6d 70 5f 43 72 65 61  |=.:.. "Wimp_Crea|
0000c540  74 65 4d 65 6e 75 22 2c  2c 2d 31 3a 4d 79 52 65  |teMenu",,-1:MyRe|
0000c550  66 3d 2d 31 0d 33 9a 46  e7 20 52 65 61 73 6f 6e  |f=-1.3.F. Reason|
0000c560  3e 31 37 20 8c 20 54 72  61 6e 73 6d 69 74 3d b9  |>17 . Transmit=.|
0000c570  3a f4 20 43 6f 6e 74 69  6e 75 65 20 69 66 20 77  |:. Continue if w|
0000c580  65 20 72 65 63 65 69 76  65 64 20 61 63 6b 6e 6f  |e received ackno|
0000c590  77 6c 65 64 67 65 6d 65  6e 74 0d 33 a4 32 e7 20  |wledgement.3.2. |
0000c5a0  28 42 75 66 66 65 72 4c  65 6e 67 74 68 2d 54 72  |(BufferLength-Tr|
0000c5b0  61 6e 73 6d 69 74 74 65  64 42 79 74 65 73 29 3e  |ansmittedBytes)>|
0000c5c0  28 42 6c 6f 63 6b 21 32  34 29 20 8c 0d 33 ae 1b  |(Block!24) ..3..|
0000c5d0  20 20 42 79 74 65 73 57  72 69 74 74 65 6e 3d 42  |  BytesWritten=B|
0000c5e0  6c 6f 63 6b 21 32 34 0d  33 b8 05 cc 0d 33 c2 30  |lock!24.3....3.0|
0000c5f0  20 20 42 79 74 65 73 57  72 69 74 74 65 6e 3d 42  |  BytesWritten=B|
0000c600  75 66 66 65 72 4c 65 6e  67 74 68 2d 54 72 61 6e  |ufferLength-Tran|
0000c610  73 6d 69 74 74 65 64 42  79 74 65 73 0d 33 cc 37  |smittedBytes.3.7|
0000c620  20 20 e7 20 54 72 61 6e  73 6d 69 74 74 65 64 42  |  . TransmittedB|
0000c630  79 74 65 73 3e 3d 42 75  66 66 65 72 4c 65 6e 67  |ytes>=BufferLeng|
0000c640  74 68 20 8c 20 42 79 74  65 73 57 72 69 74 74 65  |th . BytesWritte|
0000c650  6e 3d 30 0d 33 d6 05 cd  0d 33 e0 52 c8 99 20 22  |n=0.3....3.R.. "|
0000c660  57 69 6d 70 5f 54 72 61  6e 73 66 65 72 42 6c 6f  |Wimp_TransferBlo|
0000c670  63 6b 22 2c 54 61 73 6b  2c 55 25 2b 54 72 61 6e  |ck",Task,U%+Tran|
0000c680  73 6d 69 74 74 65 64 42  79 74 65 73 2c 42 6c 6f  |smittedBytes,Blo|
0000c690  63 6b 21 34 2c 42 6c 6f  63 6b 21 32 30 2c 42 79  |ck!4,Block!20,By|
0000c6a0  74 65 73 57 72 69 74 74  65 6e 0d 33 ea 22 54 72  |tesWritten.3."Tr|
0000c6b0  61 6e 73 6d 69 74 74 65  64 42 79 74 65 73 2b 3d  |ansmittedBytes+=|
0000c6c0  42 79 74 65 73 57 72 69  74 74 65 6e 0d 33 f4 14  |BytesWritten.3..|
0000c6d0  42 6c 6f 63 6b 21 31 32  3d 42 6c 6f 63 6b 21 38  |Block!12=Block!8|
0000c6e0  0d 33 fe 2f 42 6c 6f 63  6b 21 30 3d 32 38 3a 42  |.3./Block!0=28:B|
0000c6f0  6c 6f 63 6b 21 31 36 3d  37 3a 42 6c 6f 63 6b 21  |lock!16=7:Block!|
0000c700  32 34 3d 42 79 74 65 73  57 72 69 74 74 65 6e 0d  |24=BytesWritten.|
0000c710  34 08 1d e7 20 42 79 74  65 73 57 72 69 74 74 65  |4... BytesWritte|
0000c720  6e 3c 42 6c 6f 63 6b 21  32 34 20 8c 0d 34 12 14  |n<Block!24 ..4..|
0000c730  20 20 f4 20 4c 61 73 74  20 6d 65 73 73 61 67 65  |  . Last message|
0000c740  0d 34 1c 2c 20 20 c8 99  20 22 57 69 6d 70 5f 53  |.4.,  .. "Wimp_S|
0000c750  65 6e 64 4d 65 73 73 61  67 65 22 2c 31 37 2c 42  |endMessage",17,B|
0000c760  6c 6f 63 6b 2c 42 6c 6f  63 6b 21 34 0d 34 26 05  |lock,Block!4.4&.|
0000c770  cc 0d 34 30 2c 20 20 c8  99 20 22 57 69 6d 70 5f  |..40,  .. "Wimp_|
0000c780  53 65 6e 64 4d 65 73 73  61 67 65 22 2c 31 38 2c  |SendMessage",18,|
0000c790  42 6c 6f 63 6b 2c 42 6c  6f 63 6b 21 34 0d 34 3a  |Block,Block!4.4:|
0000c7a0  05 cd 0d 34 44 05 e1 0d  34 4e 05 3a 0d 34 58 2c  |...4D...4N.:.4X,|
0000c7b0  dd 20 a4 43 61 72 65 74  50 6f 73 69 74 69 6f 6e  |. .CaretPosition|
0000c7c0  54 6f 43 6f 6f 72 64 69  6e 61 74 65 28 44 69 72  |ToCoordinate(Dir|
0000c7d0  65 63 74 69 6f 6e 24 29  0d 34 62 25 c8 99 20 22  |ection$).4b%.. "|
0000c7e0  57 69 6d 70 5f 47 65 74  43 61 72 65 74 50 6f 73  |Wimp_GetCaretPos|
0000c7f0  69 74 69 6f 6e 22 2c 2c  43 61 72 65 74 0d 34 6c  |ition",,Caret.4l|
0000c800  17 54 65 6d 70 42 6c 6f  63 6b 21 30 3d 43 61 72  |.TempBlock!0=Car|
0000c810  65 74 21 30 0d 34 76 27  c8 99 20 22 57 69 6d 70  |et!0.4v'.. "Wimp|
0000c820  5f 47 65 74 57 69 6e 64  6f 77 53 74 61 74 65 22  |_GetWindowState"|
0000c830  2c 2c 54 65 6d 70 42 6c  6f 63 6b 0d 34 80 13 c8  |,,TempBlock.4...|
0000c840  8e 20 44 69 72 65 63 74  69 6f 6e 24 20 ca 0d 34  |. Direction$ ..4|
0000c850  8a 5e 20 20 c9 20 22 58  22 2c 22 78 22 3a 50 6f  |.^  . "X","x":Po|
0000c860  73 69 74 69 6f 6e 3d 28  54 65 6d 70 42 6c 6f 63  |sition=(TempBloc|
0000c870  6b 21 34 2b 28 43 61 72  65 74 21 38 2d 54 65 6d  |k!4+(Caret!8-Tem|
0000c880  70 42 6c 6f 63 6b 21 32  30 29 29 2b 28 32 2a 32  |pBlock!20))+(2*2|
0000c890  5e a4 4d 6f 64 65 49 6e  66 6f 28 22 58 45 69 67  |^.ModeInfo("XEig|
0000c8a0  46 61 63 74 6f 72 22 2c  2d 31 29 29 0d 34 94 5b  |Factor",-1)).4.[|
0000c8b0  20 20 c9 20 22 59 22 2c  22 79 22 3a 50 6f 73 69  |  . "Y","y":Posi|
0000c8c0  74 69 6f 6e 3d 28 54 65  6d 70 42 6c 6f 63 6b 21  |tion=(TempBlock!|
0000c8d0  31 36 2b 28 43 61 72 65  74 21 31 32 2d 54 65 6d  |16+(Caret!12-Tem|
0000c8e0  70 42 6c 6f 63 6b 21 32  34 29 29 2b 28 28 43 61  |pBlock!24))+((Ca|
0000c8f0  72 65 74 3f 31 36 2b 32  35 36 2a 43 61 72 65 74  |ret?16+256*Caret|
0000c900  3f 31 37 29 2f 32 29 0d  34 9e 13 20 20 7f 3a 50  |?17)/2).4..  .:P|
0000c910  6f 73 69 74 69 6f 6e 3d  2d 31 0d 34 a8 05 cb 0d  |osition=-1.4....|
0000c920  34 b2 0d 3d 50 6f 73 69  74 69 6f 6e 0d 34 bc 05  |4..=Position.4..|
0000c930  3a 0d 34 c6 21 dd 20 a4  53 61 76 65 47 72 61 62  |:.4.!. .SaveGrab|
0000c940  62 65 64 54 6f 46 69 6c  65 28 4f 75 74 70 75 74  |bedToFile(Output|
0000c950  24 29 0d 34 d0 07 ea 20  85 0d 34 da 25 ee 20 85  |$).4... ..4.%. .|
0000c960  20 ea 20 f7 20 85 3a 3d  a3 3a f4 20 45 72 72 6f  | . . .:=.:. Erro|
0000c970  72 20 77 72 69 74 69 6e  67 20 66 69 6c 65 0d 34  |r writing file.4|
0000c980  e4 07 20 20 3a 0d 34 ee  34 c8 99 20 22 4f 53 5f  |..  :.4.4.. "OS_|
0000c990  46 69 6c 65 22 2c 31 30  2c 4f 75 74 70 75 74 24  |File",10,Output$|
0000c9a0  2c 26 46 46 46 2c 2c 55  25 2c 55 25 2b 42 75 66  |,&FFF,,U%,U%+Buf|
0000c9b0  66 65 72 4c 65 6e 67 74  68 0d 34 f8 07 20 20 3a  |ferLength.4..  :|
0000c9c0  0d 35 02 06 3d b9 0d 35  0c 05 3a 0d 35 16 2c dd  |.5..=..5..:.5.,.|
0000c9d0  20 a4 4c 6f 61 64 46 69  6c 65 28 46 69 6c 65 53  | .LoadFile(FileS|
0000c9e0  69 7a 65 2c 46 69 6c 65  54 79 70 65 2c 46 69 6c  |ize,FileType,Fil|
0000c9f0  65 4e 61 6d 65 24 29 0d  35 20 07 ea 20 85 0d 35  |eName$).5 .. ..5|
0000ca00  2a 18 ee 20 85 20 ea 20  f7 20 85 3a 3d 31 3a f4  |*.. . . . .:=1:.|
0000ca10  20 45 72 72 6f 72 0d 35  34 2c e7 20 46 69 6c 65  | Error.54,. File|
0000ca20  54 79 70 65 3c 3e 26 46  46 46 20 8c 20 3d 32 3a  |Type<>&FFF . =2:|
0000ca30  f4 20 4e 6f 74 20 61 20  74 65 78 74 20 66 69 6c  |. Not a text fil|
0000ca40  65 2e 0d 35 3e 15 f2 4d  69 6e 69 6d 69 73 65 57  |e..5>..MinimiseW|
0000ca50  69 6d 70 53 6c 6f 74 0d  35 48 35 e7 20 46 69 6c  |impSlot.5H5. Fil|
0000ca60  65 53 69 7a 65 3d 2d 31  20 8c 20 46 69 6c 65 53  |eSize=-1 . FileS|
0000ca70  69 7a 65 3d a4 46 69 6e  64 46 69 6c 65 53 69 7a  |ize=.FindFileSiz|
0000ca80  65 28 46 69 6c 65 4e 61  6d 65 24 29 0d 35 52 15  |e(FileName$).5R.|
0000ca90  e7 20 46 69 6c 65 53 69  7a 65 3c 31 20 8c 20 3d  |. FileSize<1 . =|
0000caa0  34 0d 35 5c 19 42 75 66  66 65 72 4c 65 6e 67 74  |4.5\.BufferLengt|
0000cab0  68 3d 46 69 6c 65 53 69  7a 65 0d 35 66 2e e7 20  |h=FileSize.5f.. |
0000cac0  a4 41 6c 6c 6f 63 61 74  65 4d 65 6d 6f 72 79 28  |.AllocateMemory(|
0000cad0  46 69 6c 65 53 69 7a 65  2b 41 70 70 53 69 7a 65  |FileSize+AppSize|
0000cae0  29 3d 30 20 8c 20 3d 33  0d 35 70 27 c8 99 20 22  |)=0 . =3.5p'.. "|
0000caf0  4f 53 5f 46 69 6c 65 22  2c 31 36 2c 46 69 6c 65  |OS_File",16,File|
0000cb00  4e 61 6d 65 24 2c 53 6c  6f 74 45 6e 64 2c 30 0d  |Name$,SlotEnd,0.|
0000cb10  35 7a 06 3d 30 0d 35 84  05 3a 0d 35 8e 19 dd 20  |5z.=0.5..:.5... |
0000cb20  f2 43 68 65 63 6b 4c 6f  61 64 46 69 6c 65 45 72  |.CheckLoadFileEr|
0000cb30  72 6f 72 0d 35 98 16 c8  8e 20 4c 6f 61 64 46 69  |ror.5.... LoadFi|
0000cb40  6c 65 45 72 72 6f 72 20  ca 0d 35 a2 3d 20 20 c9  |leError ..5.=  .|
0000cb50  20 31 3a 85 20 39 39 39  39 2c 22 41 6e 20 65 72  | 1:. 9999,"An er|
0000cb60  72 6f 72 20 6f 63 63 75  72 72 65 64 20 77 68 69  |ror occurred whi|
0000cb70  6c 73 74 20 72 65 61 64  69 6e 67 20 74 68 65 20  |lst reading the |
0000cb80  66 69 6c 65 2e 22 0d 35  ac 3b 20 20 c9 20 32 3a  |file.".5.;  . 2:|
0000cb90  85 20 39 39 39 39 2c 22  54 65 78 74 20 47 72 61  |. 9999,"Text Gra|
0000cba0  62 62 65 72 20 63 61 6e  20 6f 6e 6c 79 20 68 61  |bber can only ha|
0000cbb0  6e 64 6c 65 20 74 65 78  74 20 66 69 6c 65 73 2e  |ndle text files.|
0000cbc0  22 0d 35 b6 42 20 20 c9  20 33 3a 85 20 39 39 39  |".5.B  . 3:. 999|
0000cbd0  39 2c 22 55 6e 61 62 6c  65 20 74 6f 20 63 6c 61  |9,"Unable to cla|
0000cbe0  69 6d 20 65 6e 6f 75 67  68 20 6d 65 6d 6f 72 79  |im enough memory|
0000cbf0  20 74 6f 20 6c 6f 61 64  20 74 68 65 20 66 69 6c  | to load the fil|
0000cc00  65 2e 22 0d 35 c0 3f 20  20 c9 20 34 3a 85 20 39  |e.".5.?  . 4:. 9|
0000cc10  39 39 39 2c 22 49 74 20  77 6f 75 6c 64 20 62 65  |999,"It would be|
0000cc20  20 70 6f 69 6e 74 6c 65  73 73 20 74 6f 20 6c 6f  | pointless to lo|
0000cc30  61 64 20 61 6e 20 65 6d  70 74 79 20 66 69 6c 65  |ad an empty file|
0000cc40  2e 22 0d 35 ca 18 20 20  7f 20 f4 20 57 65 27 72  |.".5..  . . We'r|
0000cc50  65 20 61 6c 72 69 67 68  74 2e 0d 35 d4 05 cb 0d  |e alright..5....|
0000cc60  35 de 05 e1 0d 35 e8 05  3a 0d 35 f2 13 dd 20 a4  |5....5..:.5... .|
0000cc70  53 61 76 65 53 65 74 74  69 6e 67 73 0d 35 fc 07  |SaveSettings.5..|
0000cc80  ea 20 85 0d 36 06 3c ee  20 85 20 ea 20 f7 20 85  |. ..6.<. . . . .|
0000cc90  3a f2 43 6c 6f 73 65 46  69 6c 65 49 66 50 6f 73  |:.CloseFileIfPos|
0000cca0  73 28 44 61 74 61 29 3a  3d a3 3a f4 20 45 72 72  |s(Data):=.:. Err|
0000ccb0  6f 72 20 77 72 69 74 69  6e 67 20 66 69 6c 65 0d  |or writing file.|
0000ccc0  36 10 07 20 20 3a 0d 36  1a 28 20 20 44 61 74 61  |6..  :.6.(  Data|
0000ccd0  3d ae 20 28 22 3c 54 65  78 74 47 72 61 62 24 44  |=. ("<TextGrab$D|
0000cce0  69 72 3e 2e 53 65 74 74  69 6e 67 73 22 29 0d 36  |ir>.Settings").6|
0000ccf0  24 41 20 20 d5 23 44 61  74 61 2c 22 7c 20 58 20  |$A  .#Data,"| X |
0000cd00  61 6e 64 20 59 20 67 72  69 64 20 63 6f 6f 72 64  |and Y grid coord|
0000cd10  69 6e 61 74 65 73 20 6f  66 20 54 65 78 74 20 47  |inates of Text G|
0000cd20  72 61 62 62 65 72 20 77  69 6e 64 6f 77 3a 22 0d  |rabber window:".|
0000cd30  36 2e 19 20 20 d5 23 44  61 74 61 2c c3 28 58 50  |6..  .#Data,.(XP|
0000cd40  6f 73 69 74 69 6f 6e 29  0d 36 38 19 20 20 d5 23  |osition).68.  .#|
0000cd50  44 61 74 61 2c c3 28 59  50 6f 73 69 74 69 6f 6e  |Data,.(YPosition|
0000cd60  29 0d 36 42 0c 20 20 d9  23 44 61 74 61 0d 36 4c  |).6B.  .#Data.6L|
0000cd70  2f 20 20 ff 28 22 53 65  74 74 79 70 65 20 3c 54  |/  .("Settype <T|
0000cd80  65 78 74 47 72 61 62 24  44 69 72 3e 2e 53 65 74  |extGrab$Dir>.Set|
0000cd90  74 69 6e 67 73 20 54 65  78 74 22 29 0d 36 56 07  |tings Text").6V.|
0000cda0  20 20 3a 0d 36 60 06 3d  b9 0d 36 6a 05 3a 0d 36  |  :.6`.=..6j.:.6|
0000cdb0  74 13 dd 20 a4 4c 6f 61  64 53 65 74 74 69 6e 67  |t.. .LoadSetting|
0000cdc0  73 0d 36 7e 07 ea 20 85  0d 36 88 4f ee 20 85 20  |s.6~.. ..6.O. . |
0000cdd0  ea 20 f7 20 85 3a f2 43  6c 6f 73 65 46 69 6c 65  |. . .:.CloseFile|
0000cde0  49 66 50 6f 73 73 28 44  61 74 61 29 3a 3d a3 3a  |IfPoss(Data):=.:|
0000cdf0  f4 20 27 53 65 74 74 69  6e 67 73 27 20 66 69 6c  |. 'Settings' fil|
0000ce00  65 20 69 73 20 64 61 6d  61 67 65 64 20 6f 72 20  |e is damaged or |
0000ce10  6d 69 73 73 69 6e 67 0d  36 92 07 20 20 3a 0d 36  |missing.6..  :.6|
0000ce20  9c 26 20 20 44 61 74 61  3d 8e 20 22 3c 54 65 78  |.&  Data=. "<Tex|
0000ce30  74 47 72 61 62 24 44 69  72 3e 2e 53 65 74 74 69  |tGrab$Dir>.Setti|
0000ce40  6e 67 73 22 0d 36 a6 1d  20 20 58 50 6f 73 69 74  |ngs".6..  XPosit|
0000ce50  69 6f 6e 3d bb 28 a4 4e  65 78 74 45 6e 74 72 79  |ion=.(.NextEntry|
0000ce60  29 0d 36 b0 1d 20 20 59  50 6f 73 69 74 69 6f 6e  |).6..  YPosition|
0000ce70  3d bb 28 a4 4e 65 78 74  45 6e 74 72 79 29 0d 36  |=.(.NextEntry).6|
0000ce80  ba 0c 20 20 d9 23 44 61  74 61 0d 36 c4 07 20 20  |..  .#Data.6..  |
0000ce90  3a 0d 36 ce 62 20 20 e7  20 58 50 6f 73 69 74 69  |:.6.b  . XPositi|
0000cea0  6f 6e 3c 3e 2d 31 20 80  20 59 50 6f 73 69 74 69  |on<>-1 . YPositi|
0000ceb0  6f 6e 3c 3e 2d 31 20 8c  20 f2 55 70 64 61 74 65  |on<>-1 . .Update|
0000cec0  53 65 6c 65 63 74 65 64  46 6c 61 67 28 4c 6f 63  |SelectedFlag(Loc|
0000ced0  2c 36 2b 28 28 35 2a 58  50 6f 73 69 74 69 6f 6e  |,6+((5*XPosition|
0000cee0  29 2b 28 34 2d 59 50 6f  73 69 74 69 6f 6e 29 29  |)+(4-YPosition))|
0000cef0  2c b9 29 0d 36 d8 07 20  20 3a 0d 36 e2 06 3d b9  |,.).6..  :.6..=.|
0000cf00  0d 36 ec 05 3a 0d 36 f6  16 dd 20 f2 44 65 66 61  |.6..:.6... .Defa|
0000cf10  75 6c 74 53 65 74 74 69  6e 67 73 0d 37 00 1b 58  |ultSettings.7..X|
0000cf20  50 6f 73 69 74 69 6f 6e  3d 33 3a 59 50 6f 73 69  |Position=3:YPosi|
0000cf30  74 69 6f 6e 3d 33 0d 37  0a 3e f2 55 70 64 61 74  |tion=3.7.>.Updat|
0000cf40  65 53 65 6c 65 63 74 65  64 46 6c 61 67 28 4c 6f  |eSelectedFlag(Lo|
0000cf50  63 2c 36 2b 28 28 35 2a  58 50 6f 73 69 74 69 6f  |c,6+((5*XPositio|
0000cf60  6e 29 2b 28 34 2d 59 50  6f 73 69 74 69 6f 6e 29  |n)+(4-YPosition)|
0000cf70  29 2c b9 29 0d 37 14 05  e1 0d ff                 |),.).7.....|
0000cf7b