home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 January / macpower199701.bin / AMUG / Programming_10 / ICPAppSource+ICprogKit / ICAppSourceKit 1.3.sit / ICAppSourceKit1.3 / ICWindows.p < prev    next >
MacBinary  |  1996-07-20  |  24.9 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: ICWindows.p

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert ZX81 Sinclair BASIC (image/sinclairBASIC) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Applause Picture (image/applausePicture) ext Unsupported
1% dexvert bsdiff patch (other/bsdiffPatch) ext Unsupported
1% dexvert imgdiff patch (other/imgdiffPatch) ext Unsupported
1% dexvert MATLAB p-code (other/matlabPCode) ext Unsupported
1% dexvert WSUS Patch Storage File (other/wsusPatchStorageFile) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sat Jul 20 15:34:00 1996, modified Sat Jul 20 15:34:00 1996, creator 'CWIE', type ASCII, 24725 bytes "ICWindows.p" , at 0x6115 410 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 49 43 57 69 6e 64 | 6f 77 73 2e 70 00 00 00 |..ICWind|ows.p...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 60 95 00 | 00 01 9a ae 16 e5 28 ae |.....`..|......(.|
|00000060| 16 e5 28 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..(.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 28 d1 00 00 |........|....(...|
|00000080| 75 6e 69 74 20 49 43 57 | 69 6e 64 6f 77 73 3b 0d |unit ICW|indows;.|
|00000090| 0d 69 6e 74 65 72 66 61 | 63 65 0d 0d 09 75 73 65 |.interfa|ce...use|
|000000a0| 73 0d 09 09 49 43 57 69 | 6e 64 6f 77 47 6c 6f 62 |s...ICWi|ndowGlob|
|000000b0| 61 6c 73 3b 0d 0d 09 66 | 75 6e 63 74 69 6f 6e 20 |als;...f|unction |
|000000c0| 49 6e 69 74 49 43 57 69 | 6e 64 6f 77 73 3a 20 4f |InitICWi|ndows: O|
|000000d0| 53 45 72 72 3b 0d 0d 09 | 66 75 6e 63 74 69 6f 6e |SErr;...|function|
|000000e0| 20 57 69 6e 64 6f 77 73 | 4f 70 65 6e 20 28 77 74 | Windows|Open (wt|
|000000f0| 3a 20 57 69 6e 64 6f 77 | 54 79 70 65 29 3a 20 4f |: Window|Type): O|
|00000100| 53 45 72 72 3b 0d 09 66 | 75 6e 63 74 69 6f 6e 20 |SErr;..f|unction |
|00000110| 57 69 6e 64 6f 77 73 43 | 6c 6f 73 65 20 28 77 70 |WindowsC|lose (wp|
|00000120| 3a 20 57 69 6e 64 6f 77 | 50 74 72 29 3a 20 4f 53 |: Window|Ptr): OS|
|00000130| 45 72 72 3b 0d 09 66 75 | 6e 63 74 69 6f 6e 20 57 |Err;..fu|nction W|
|00000140| 69 6e 64 6f 77 73 46 6c | 75 73 68 41 6c 6c 3a 20 |indowsFl|ushAll: |
|00000150| 4f 53 45 72 72 3b 09 28 | 2a 20 63 6c 6f 73 65 20 |OSErr;.(|* close |
|00000160| 61 6c 6c 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |all info|rmation |
|00000170| 77 69 6e 64 6f 77 73 20 | 2a 29 0d 09 66 75 6e 63 |windows |*)..func|
|00000180| 74 69 6f 6e 20 57 69 6e | 64 6f 77 73 43 6c 6f 73 |tion Win|dowsClos|
|00000190| 65 41 6c 6c 3a 20 4f 53 | 45 72 72 3b 09 28 2a 20 |eAll: OS|Err;.(* |
|000001a0| 63 6c 6f 73 65 20 61 6c | 6c 20 69 6e 66 6f 72 6d |close al|l inform|
|000001b0| 61 74 69 6f 6e 20 77 69 | 6e 64 6f 77 73 20 2a 29 |ation wi|ndows *)|
|000001c0| 0d 0d 09 70 72 6f 63 65 | 64 75 72 65 20 57 69 6e |...proce|dure Win|
|000001d0| 64 6f 77 73 53 65 74 54 | 69 74 6c 65 20 28 77 74 |dowsSetT|itle (wt|
|000001e0| 3a 20 57 69 6e 64 6f 77 | 54 79 70 65 3b 20 74 69 |: Window|Type; ti|
|000001f0| 74 6c 65 3a 20 53 74 72 | 32 35 35 29 3b 0d 09 70 |tle: Str|255);..p|
|00000200| 72 6f 63 65 64 75 72 65 | 20 57 69 6e 64 6f 77 73 |rocedure| Windows|
|00000210| 49 64 6c 65 3b 0d 09 70 | 72 6f 63 65 64 75 72 65 |Idle;..p|rocedure|
|00000220| 20 57 69 6e 64 6f 77 41 | 63 74 69 76 61 74 65 44 | WindowA|ctivateD|
|00000230| 65 61 63 74 69 76 61 74 | 65 20 28 77 69 6e 64 6f |eactivat|e (windo|
|00000240| 77 3a 20 57 69 6e 64 6f | 77 50 74 72 3b 20 61 63 |w: Windo|wPtr; ac|
|00000250| 74 69 76 61 74 65 3a 20 | 62 6f 6f 6c 65 61 6e 29 |tivate: |boolean)|
|00000260| 3b 0d 09 70 72 6f 63 65 | 64 75 72 65 20 57 69 6e |;..proce|dure Win|
|00000270| 64 6f 77 49 74 65 6d 57 | 68 65 72 65 20 28 77 69 |dowItemW|here (wi|
|00000280| 6e 64 6f 77 3a 20 57 69 | 6e 64 6f 77 50 74 72 3b |ndow: Wi|ndowPtr;|
|00000290| 20 65 72 3a 20 45 76 65 | 6e 74 52 65 63 6f 72 64 | er: Eve|ntRecord|
|000002a0| 3b 20 69 74 65 6d 3a 20 | 69 6e 74 65 67 65 72 29 |; item: |integer)|
|000002b0| 3b 0d 09 70 72 6f 63 65 | 64 75 72 65 20 57 69 6e |;..proce|dure Win|
|000002c0| 64 6f 77 73 44 6f 4b 65 | 79 20 28 65 72 3a 20 45 |dowsDoKe|y (er: E|
|000002d0| 76 65 6e 74 52 65 63 6f | 72 64 29 3b 0d 09 66 75 |ventReco|rd);..fu|
|000002e0| 6e 63 74 69 6f 6e 20 57 | 69 6e 64 6f 77 73 45 61 |nction W|indowsEa|
|000002f0| 72 6c 79 48 61 6e 64 6c | 65 45 76 65 6e 74 20 28 |rlyHandl|eEvent (|
|00000300| 65 72 3a 20 45 76 65 6e | 74 52 65 63 6f 72 64 29 |er: Even|tRecord)|
|00000310| 3a 20 62 6f 6f 6c 65 61 | 6e 3b 0d 09 66 75 6e 63 |: boolea|n;..func|
|00000320| 74 69 6f 6e 20 57 69 6e | 64 6f 77 73 45 61 72 6c |tion Win|dowsEarl|
|00000330| 79 48 61 6e 64 6c 65 4b | 65 79 20 28 65 72 3a 20 |yHandleK|ey (er: |
|00000340| 45 76 65 6e 74 52 65 63 | 6f 72 64 29 3a 20 62 6f |EventRec|ord): bo|
|00000350| 6f 6c 65 61 6e 3b 0d 09 | 70 72 6f 63 65 64 75 72 |olean;..|procedur|
|00000360| 65 20 57 69 6e 64 6f 77 | 73 41 64 6a 75 73 74 4d |e Window|sAdjustM|
|00000370| 65 6e 75 73 3b 0d 09 70 | 72 6f 63 65 64 75 72 65 |enus;..p|rocedure|
|00000380| 20 57 69 6e 64 6f 77 73 | 44 6f 45 64 69 74 4d 65 | Windows|DoEditMe|
|00000390| 6e 75 20 28 69 74 65 6d | 3a 20 69 6e 74 65 67 65 |nu (item|: intege|
|000003a0| 72 29 3b 0d 0d 09 70 72 | 6f 63 65 64 75 72 65 20 |r);...pr|ocedure |
|000003b0| 57 69 6e 64 6f 77 73 52 | 65 73 74 6f 72 65 50 6f |WindowsR|estorePo|
|000003c0| 73 69 74 69 6f 6e 73 3b | 0d 09 70 72 6f 63 65 64 |sitions;|..proced|
|000003d0| 75 72 65 20 57 69 6e 64 | 6f 77 73 53 61 76 65 50 |ure Wind|owsSaveP|
|000003e0| 6f 73 69 74 69 6f 6e 73 | 3b 0d 09 70 72 6f 63 65 |ositions|;..proce|
|000003f0| 64 75 72 65 20 57 69 6e | 64 6f 77 73 52 65 73 65 |dure Win|dowsRese|
|00000400| 74 50 6f 73 69 74 69 6f | 6e 73 3b 0d 0d 09 66 75 |tPositio|ns;...fu|
|00000410| 6e 63 74 69 6f 6e 20 47 | 65 74 57 69 6e 64 6f 77 |nction G|etWindow|
|00000420| 50 74 72 20 28 77 74 3a | 20 57 69 6e 64 6f 77 54 |Ptr (wt:| WindowT|
|00000430| 79 70 65 29 3a 20 57 69 | 6e 64 6f 77 50 74 72 3b |ype): Wi|ndowPtr;|
|00000440| 0d 0d 09 66 75 6e 63 74 | 69 6f 6e 20 45 64 69 74 |...funct|ion Edit|
|00000450| 43 75 72 72 65 6e 74 50 | 72 65 66 65 72 65 6e 63 |CurrentP|referenc|
|00000460| 65 20 28 76 61 72 20 6b | 65 79 3a 20 53 74 72 32 |e (var k|ey: Str2|
|00000470| 35 35 29 3a 20 4f 53 45 | 72 72 3b 0d 0d 69 6d 70 |55): OSE|rr;..imp|
|00000480| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 0d 0d 09 75 73 |lementat|ion...us|
|00000490| 65 73 0d 09 09 49 63 6f | 6e 73 2c 20 51 75 69 63 |es...Ico|ns, Quic|
|000004a0| 6b 64 72 61 77 2c 20 52 | 65 73 6f 75 72 63 65 73 |kdraw, R|esources|
|000004b0| 2c 20 54 6f 6f 6c 55 74 | 69 6c 73 2c 20 44 69 61 |, ToolUt|ils, Dia|
|000004c0| 6c 6f 67 73 2c 0d 0d 09 | 09 49 43 4d 69 73 63 53 |logs,...|.ICMiscS|
|000004d0| 75 62 73 2c 20 49 43 53 | 75 62 73 2c 20 49 43 54 |ubs, ICS|ubs, ICT|
|000004e0| 79 70 65 73 2c 20 49 43 | 41 50 49 2c 20 49 43 44 |ypes, IC|API, ICD|
|000004f0| 69 61 6c 6f 67 73 2c 20 | 49 43 54 65 78 74 2c 20 |ialogs, |ICText, |
|00000500| 49 43 47 6c 6f 62 61 6c | 73 2c 20 20 49 43 4b 65 |ICGlobal|s, ICKe|
|00000510| 79 73 2c 0d 0d 09 09 49 | 43 53 6f 75 6e 64 50 6f |ys,....I|CSoundPo|
|00000520| 70 75 70 57 68 61 74 73 | 2c 20 49 43 52 47 42 43 |pupWhats|, ICRGBC|
|00000530| 6f 6c 6f 75 72 57 68 61 | 74 73 2c 20 49 43 47 72 |olourWha|ts, ICGr|
|00000540| 65 79 42 6f 78 57 68 61 | 74 73 2c 20 49 43 43 68 |eyBoxWha|ts, ICCh|
|00000550| 65 63 6b 62 6f 78 57 68 | 61 74 73 2c 20 49 43 54 |eckboxWh|ats, ICT|
|00000560| 65 78 74 57 68 61 74 73 | 2c 20 49 43 50 6f 70 75 |extWhats|, ICPopu|
|00000570| 70 57 68 61 74 73 2c 20 | 49 43 46 6f 6e 74 57 68 |pWhats, |ICFontWh|
|00000580| 61 74 73 2c 0d 09 09 09 | 09 09 49 43 46 53 53 70 |ats,....|..ICFSSp|
|00000590| 65 63 57 68 61 74 73 2c | 20 49 43 46 69 6c 65 4d |ecWhats,| ICFileM|
|000005a0| 61 70 57 68 61 74 2c 20 | 49 43 48 65 6c 70 65 72 |apWhat, |ICHelper|
|000005b0| 57 68 61 74 2c 20 49 43 | 42 75 74 74 6f 6e 57 68 |What, IC|ButtonWh|
|000005c0| 61 74 2c 20 0d 0d 09 09 | 49 43 44 6f 63 75 6d 65 |at, ....|ICDocume|
|000005d0| 6e 74 20 7b 58 7d 3b 0d | 0d 09 63 6f 6e 73 74 0d |nt {X};.|..const.|
|000005e0| 09 09 4f 75 72 57 69 6e | 64 6f 77 50 6f 73 69 74 |..OurWin|dowPosit|
|000005f0| 69 6f 6e 73 4b 65 79 20 | 3d 20 27 34 39 34 33 34 |ionsKey |= '49434|
|00000600| 31 37 30 a5 57 69 6e 64 | 6f 77 50 6f 73 69 74 69 |170.Wind|owPositi|
|00000610| 6f 6e 73 27 3b 0d 09 09 | 0d 09 66 75 6e 63 74 69 |ons';...|..functi|
|00000620| 6f 6e 20 43 61 6c 6c 57 | 68 61 74 4f 70 65 6e 20 |on CallW|hatOpen |
|00000630| 28 77 74 3a 20 57 69 6e | 64 6f 77 54 79 70 65 3b |(wt: Win|dowType;|
|00000640| 20 69 74 65 6d 3a 20 69 | 6e 74 65 67 65 72 3b 20 | item: i|nteger; |
|00000650| 6f 70 65 6e 3a 20 50 72 | 6f 63 50 74 72 29 3a 20 |open: Pr|ocPtr): |
|00000660| 4f 53 45 72 72 3b 0d 09 | 69 6e 6c 69 6e 65 0d 09 |OSErr;..|inline..|
|00000670| 09 24 32 30 35 46 2c 20 | 24 34 45 39 30 3b 0d 0d |.$205F, |$4E90;..|
|00000680| 09 66 75 6e 63 74 69 6f | 6e 20 43 61 6c 6c 57 68 |.functio|n CallWh|
|00000690| 61 74 43 6c 6f 73 65 20 | 28 77 74 3a 20 57 69 6e |atClose |(wt: Win|
|000006a0| 64 6f 77 54 79 70 65 3b | 20 69 74 65 6d 3a 20 69 |dowType;| item: i|
|000006b0| 6e 74 65 67 65 72 3b 20 | 63 6c 6f 73 65 3a 20 50 |nteger; |close: P|
|000006c0| 72 6f 63 50 74 72 29 3a | 20 4f 53 45 72 72 3b 0d |rocPtr):| OSErr;.|
|000006d0| 09 69 6e 6c 69 6e 65 0d | 09 09 24 32 30 35 46 2c |.inline.|..$205F,|
|000006e0| 20 24 34 45 39 30 3b 0d | 0d 09 66 75 6e 63 74 69 | $4E90;.|..functi|
|000006f0| 6f 6e 20 43 61 6c 6c 57 | 68 61 74 46 6c 75 73 68 |on CallW|hatFlush|
|00000700| 20 28 77 74 3a 20 57 69 | 6e 64 6f 77 54 79 70 65 | (wt: Wi|ndowType|
|00000710| 3b 20 69 74 65 6d 3a 20 | 69 6e 74 65 67 65 72 3b |; item: |integer;|
|00000720| 20 63 6c 6f 73 65 3a 20 | 50 72 6f 63 50 74 72 29 | close: |ProcPtr)|
|00000730| 3a 20 4f 53 45 72 72 3b | 0d 09 69 6e 6c 69 6e 65 |: OSErr;|..inline|
|00000740| 0d 09 09 24 32 30 35 46 | 2c 20 24 34 45 39 30 3b |...$205F|, $4E90;|
|00000750| 0d 0d 09 66 75 6e 63 74 | 69 6f 6e 20 43 61 6c 6c |...funct|ion Call|
|00000760| 57 68 61 74 43 6c 69 63 | 6b 20 28 77 74 3a 20 57 |WhatClic|k (wt: W|
|00000770| 69 6e 64 6f 77 54 79 70 | 65 3b 20 69 74 65 6d 3a |indowTyp|e; item:|
|00000780| 20 69 6e 74 65 67 65 72 | 3b 20 65 72 3a 20 65 76 | integer|; er: ev|
|00000790| 65 6e 74 52 65 63 6f 72 | 64 3b 20 63 6c 6f 73 65 |entRecor|d; close|
|000007a0| 3a 20 50 72 6f 63 50 74 | 72 29 3a 20 4f 53 45 72 |: ProcPt|r): OSEr|
|000007b0| 72 3b 0d 09 69 6e 6c 69 | 6e 65 0d 09 09 24 32 30 |r;..inli|ne...$20|
|000007c0| 35 46 2c 20 24 34 45 39 | 30 3b 0d 0d 09 66 75 6e |5F, $4E9|0;...fun|
|000007d0| 63 74 69 6f 6e 20 43 61 | 6c 6c 57 68 61 74 4b 65 |ction Ca|llWhatKe|
|000007e0| 79 20 28 77 74 3a 20 57 | 69 6e 64 6f 77 54 79 70 |y (wt: W|indowTyp|
|000007f0| 65 3b 20 69 74 65 6d 3a | 20 69 6e 74 65 67 65 72 |e; item:| integer|
|00000800| 3b 20 65 72 3a 20 65 76 | 65 6e 74 52 65 63 6f 72 |; er: ev|entRecor|
|00000810| 64 3b 20 6b 65 79 3a 20 | 50 72 6f 63 50 74 72 29 |d; key: |ProcPtr)|
|00000820| 3a 20 4f 53 45 72 72 3b | 0d 09 69 6e 6c 69 6e 65 |: OSErr;|..inline|
|00000830| 0d 09 09 24 32 30 35 46 | 2c 20 24 34 45 39 30 3b |...$205F|, $4E90;|
|00000840| 0d 0d 09 66 75 6e 63 74 | 69 6f 6e 20 43 61 6c 6c |...funct|ion Call|
|00000850| 57 68 61 74 41 63 74 69 | 76 61 74 65 20 28 77 74 |WhatActi|vate (wt|
|00000860| 3a 20 57 69 6e 64 6f 77 | 54 79 70 65 3b 20 69 74 |: Window|Type; it|
|00000870| 65 6d 3a 20 69 6e 74 65 | 67 65 72 3b 20 61 63 74 |em: inte|ger; act|
|00000880| 69 76 61 74 65 3a 20 62 | 6f 6f 6c 65 61 6e 3b 20 |ivate: b|oolean; |
|00000890| 61 63 74 70 72 6f 63 3a | 20 50 72 6f 63 50 74 72 |actproc:| ProcPtr|
|000008a0| 29 3a 20 4f 53 45 72 72 | 3b 0d 09 69 6e 6c 69 6e |): OSErr|;..inlin|
|000008b0| 65 0d 09 09 24 32 30 35 | 46 2c 20 24 34 45 39 30 |e...$205|F, $4E90|
|000008c0| 3b 0d 0d 09 66 75 6e 63 | 74 69 6f 6e 20 43 61 6c |;...func|tion Cal|
|000008d0| 6c 57 68 61 74 49 64 6c | 65 20 28 77 74 3a 20 57 |lWhatIdl|e (wt: W|
|000008e0| 69 6e 64 6f 77 54 79 70 | 65 3b 20 69 74 65 6d 3a |indowTyp|e; item:|
|000008f0| 20 69 6e 74 65 67 65 72 | 3b 20 69 64 6c 65 70 72 | integer|; idlepr|
|00000900| 6f 63 3a 20 50 72 6f 63 | 50 74 72 29 3a 20 4f 53 |oc: Proc|Ptr): OS|
|00000910| 45 72 72 3b 0d 09 69 6e | 6c 69 6e 65 0d 09 09 24 |Err;..in|line...$|
|00000920| 32 30 35 46 2c 20 24 34 | 45 39 30 3b 0d 0d 09 66 |205F, $4|E90;...f|
|00000930| 75 6e 63 74 69 6f 6e 20 | 43 61 6c 6c 57 68 61 74 |unction |CallWhat|
|00000940| 43 75 72 73 6f 72 20 28 | 77 74 3a 20 57 69 6e 64 |Cursor (|wt: Wind|
|00000950| 6f 77 54 79 70 65 3b 20 | 69 74 65 6d 3a 20 69 6e |owType; |item: in|
|00000960| 74 65 67 65 72 3b 20 70 | 74 3a 20 50 6f 69 6e 74 |teger; p|t: Point|
|00000970| 3b 20 63 75 72 73 6f 72 | 69 64 3a 20 69 6e 74 65 |; cursor|id: inte|
|00000980| 67 65 72 3b 20 63 75 72 | 73 6f 72 70 72 6f 63 3a |ger; cur|sorproc:|
|00000990| 20 50 72 6f 63 50 74 72 | 29 3a 20 4f 53 45 72 72 | ProcPtr|): OSErr|
|000009a0| 3b 0d 09 69 6e 6c 69 6e | 65 0d 09 09 24 32 30 35 |;..inlin|e...$205|
|000009b0| 46 2c 20 24 34 45 39 30 | 3b 0d 0d 09 66 75 6e 63 |F, $4E90|;...func|
|000009c0| 74 69 6f 6e 20 54 79 70 | 65 54 6f 57 68 61 74 20 |tion Typ|eToWhat |
|000009d0| 28 74 79 70 3a 20 4f 53 | 54 79 70 65 29 3a 20 69 |(typ: OS|Type): i|
|000009e0| 6e 74 65 67 65 72 3b 0d | 09 09 76 61 72 0d 09 09 |nteger;.|..var...|
|000009f0| 09 69 3a 20 69 6e 74 65 | 67 65 72 3b 0d 09 62 65 |.i: inte|ger;..be|
|00000a00| 67 69 6e 0d 09 09 54 79 | 70 65 54 6f 57 68 61 74 |gin...Ty|peToWhat|
|00000a10| 20 3a 3d 20 31 3b 0d 09 | 09 66 6f 72 20 69 20 3a | := 1;..|.for i :|
|00000a20| 3d 20 31 20 74 6f 20 77 | 68 61 74 73 5f 6d 61 78 |= 1 to w|hats_max|
|00000a30| 20 64 6f 20 62 65 67 69 | 6e 0d 09 09 09 69 66 20 | do begi|n....if |
|00000a40| 77 68 61 74 69 6e 66 6f | 5b 69 5d 2e 74 79 70 20 |whatinfo|[i].typ |
|00000a50| 3d 20 74 79 70 20 74 68 | 65 6e 20 62 65 67 69 6e |= typ th|en begin|
|00000a60| 0d 09 09 09 09 54 79 70 | 65 54 6f 57 68 61 74 20 |.....Typ|eToWhat |
|00000a70| 3a 3d 20 69 3b 0d 09 09 | 09 09 6c 65 61 76 65 3b |:= i;...|..leave;|
|00000a80| 0d 09 09 09 65 6e 64 3b | 0d 09 09 65 6e 64 3b 0d |....end;|...end;.|
|00000a90| 09 65 6e 64 3b 0d 0d 09 | 66 75 6e 63 74 69 6f 6e |.end;...|function|
|00000aa0| 20 47 65 74 57 68 61 74 | 54 79 70 65 20 28 77 74 | GetWhat|Type (wt|
|00000ab0| 3a 20 57 69 6e 64 6f 77 | 54 79 70 65 3b 20 69 74 |: Window|Type; it|
|00000ac0| 65 6d 3a 20 69 6e 74 65 | 67 65 72 29 3a 20 4f 53 |em: inte|ger): OS|
|00000ad0| 54 79 70 65 3b 0d 09 09 | 76 61 72 0d 09 09 09 77 |Type;...|var....w|
|00000ae0| 72 70 3a 20 57 68 61 74 | 52 65 63 6f 72 64 50 74 |rp: What|RecordPt|
|00000af0| 72 3b 0d 09 62 65 67 69 | 6e 0d 09 09 77 72 70 20 |r;..begi|n...wrp |
|00000b00| 3a 3d 20 77 69 6e 64 6f | 77 69 6e 66 6f 5b 77 74 |:= windo|winfo[wt|
|00000b10| 5d 2e 69 74 65 6d 73 5b | 69 74 65 6d 5d 3b 0d 09 |].items[|item];..|
|00000b20| 09 69 66 20 77 72 70 20 | 3d 20 6e 69 6c 20 74 68 |.if wrp |= nil th|
|00000b30| 65 6e 20 62 65 67 69 6e | 0d 09 09 09 47 65 74 57 |en begin|....GetW|
|00000b40| 68 61 74 54 79 70 65 20 | 3a 3d 20 27 4e 55 4c 4c |hatType |:= 'NULL|
|00000b50| 27 3b 0d 09 09 65 6e 64 | 20 65 6c 73 65 20 62 65 |';...end| else be|
|00000b60| 67 69 6e 0d 09 09 09 47 | 65 74 57 68 61 74 54 79 |gin....G|etWhatTy|
|00000b70| 70 65 20 3a 3d 20 77 72 | 70 5e 2e 74 79 70 3b 0d |pe := wr|p^.typ;.|
|00000b80| 09 09 65 6e 64 3b 0d 09 | 65 6e 64 3b 0d 0d 09 66 |..end;..|end;...f|
|00000b90| 75 6e 63 74 69 6f 6e 20 | 47 65 74 57 69 6e 64 6f |unction |GetWindo|
|00000ba0| 77 50 74 72 20 28 77 74 | 3a 20 57 69 6e 64 6f 77 |wPtr (wt|: Window|
|00000bb0| 54 79 70 65 29 3a 20 57 | 69 6e 64 6f 77 50 74 72 |Type): W|indowPtr|
|00000bc0| 3b 0d 09 62 65 67 69 6e | 0d 09 09 47 65 74 57 69 |;..begin|...GetWi|
|00000bd0| 6e 64 6f 77 50 74 72 20 | 3a 3d 20 77 69 6e 64 6f |ndowPtr |:= windo|
|00000be0| 77 69 6e 66 6f 5b 77 74 | 5d 2e 77 69 6e 64 6f 77 |winfo[wt|].window|
|00000bf0| 3b 0d 09 65 6e 64 3b 0d | 0d 09 66 75 6e 63 74 69 |;..end;.|..functi|
|00000c00| 6f 6e 20 4f 75 72 57 69 | 6e 64 6f 77 20 28 77 70 |on OurWi|ndow (wp|
|00000c10| 3a 20 57 69 6e 64 6f 77 | 50 74 72 29 3a 20 62 6f |: Window|Ptr): bo|
|00000c20| 6f 6c 65 61 6e 3b 0d 09 | 62 65 67 69 6e 0d 09 09 |olean;..|begin...|
|00000c30| 4f 75 72 57 69 6e 64 6f | 77 20 3a 3d 20 47 65 74 |OurWindo|w := Get|
|00000c40| 57 69 6e 64 6f 77 54 79 | 70 65 28 77 70 29 20 3c |WindowTy|pe(wp) <|
|00000c50| 3e 20 57 54 5f 4e 6f 6e | 65 3b 0d 09 65 6e 64 3b |> WT_Non|e;..end;|
|00000c60| 0d 0d 09 66 75 6e 63 74 | 69 6f 6e 20 57 68 61 74 |...funct|ion What|
|00000c70| 49 64 6c 65 54 65 78 74 | 20 28 77 74 3a 20 57 69 |IdleText| (wt: Wi|
|00000c80| 6e 64 6f 77 54 79 70 65 | 3b 20 69 74 65 6d 3a 20 |ndowType|; item: |
|00000c90| 69 6e 74 65 67 65 72 3b | 20 76 61 72 20 63 75 72 |integer;| var cur|
|00000ca0| 73 6f 72 3a 20 69 6e 74 | 65 67 65 72 29 3a 20 4f |sor: int|eger): O|
|00000cb0| 53 45 72 72 3b 0d 09 09 | 76 61 72 0d 09 09 09 72 |SErr;...|var....r|
|00000cc0| 3a 20 72 65 63 74 3b 0d | 09 09 09 70 74 3a 20 50 |: rect;.|...pt: P|
|00000cd0| 6f 69 6e 74 3b 0d 09 62 | 65 67 69 6e 0d 09 09 47 |oint;..b|egin...G|
|00000ce0| 65 74 44 49 74 65 6d 52 | 65 63 74 28 77 69 6e 64 |etDItemR|ect(wind|
|00000cf0| 6f 77 69 6e 66 6f 5b 77 | 74 5d 2e 77 69 6e 64 6f |owinfo[w|t].windo|
|00000d00| 77 2c 20 69 74 65 6d 2c | 20 72 29 3b 0d 09 09 47 |w, item,| r);...G|
|00000d10| 65 74 4d 6f 75 73 65 28 | 70 74 29 3b 0d 09 09 69 |etMouse(|pt);...i|
|00000d20| 66 20 50 74 49 6e 52 65 | 63 74 28 70 74 2c 20 72 |f PtInRe|ct(pt, r|
|00000d30| 29 20 74 68 65 6e 20 62 | 65 67 69 6e 0d 09 09 09 |) then b|egin....|
|00000d40| 63 75 72 73 6f 72 20 3a | 3d 20 69 42 65 61 6d 43 |cursor :|= iBeamC|
|00000d50| 75 72 73 6f 72 3b 0d 09 | 09 65 6e 64 3b 0d 09 09 |ursor;..|.end;...|
|00000d60| 57 68 61 74 49 64 6c 65 | 54 65 78 74 20 3a 3d 20 |WhatIdle|Text := |
|00000d70| 6e 6f 45 72 72 3b 0d 09 | 65 6e 64 3b 0d 0d 09 70 |noErr;..|end;...p|
|00000d80| 72 6f 63 65 64 75 72 65 | 20 44 6f 57 69 6e 64 6f |rocedure| DoWindo|
|00000d90| 77 49 64 6c 65 20 28 77 | 69 6e 64 6f 77 3a 20 57 |wIdle (w|indow: W|
|00000da0| 69 6e 64 6f 77 50 74 72 | 29 3b 0d 09 09 76 61 72 |indowPtr|);...var|
|00000db0| 0d 09 09 09 73 65 6c 65 | 63 74 65 64 5f 69 74 65 |....sele|cted_ite|
|00000dc0| 6d 2c 20 69 3a 20 69 6e | 74 65 67 65 72 3b 0d 09 |m, i: in|teger;..|
|00000dd0| 09 09 77 68 61 74 3a 20 | 57 68 61 74 52 65 63 6f |..what: |WhatReco|
|00000de0| 72 64 50 74 72 3b 0d 09 | 09 09 77 74 3a 20 57 69 |rdPtr;..|..wt: Wi|
|00000df0| 6e 64 6f 77 54 79 70 65 | 3b 0d 09 09 09 63 75 72 |ndowType|;....cur|
|00000e00| 73 6f 72 69 64 3a 20 69 | 6e 74 65 67 65 72 3b 0d |sorid: i|nteger;.|
|00000e10| 09 09 09 72 3a 20 72 65 | 63 74 3b 0d 09 09 09 70 |...r: re|ct;....p|
|00000e20| 74 3a 20 50 6f 69 6e 74 | 3b 0d 09 09 09 63 75 72 |t: Point|;....cur|
|00000e30| 73 6f 72 3a 20 50 72 6f | 63 50 74 72 3b 0d 09 09 |sor: Pro|cPtr;...|
|00000e40| 09 6a 75 6e 6b 3a 20 4f | 53 45 72 72 3b 0d 09 09 |.junk: O|SErr;...|
|00000e50| 09 63 75 72 73 6f 72 5f | 73 65 74 3a 20 62 6f 6f |.cursor_|set: boo|
|00000e60| 6c 65 61 6e 3b 0d 09 62 | 65 67 69 6e 0d 09 09 53 |lean;..b|egin...S|
|00000e70| 65 74 50 6f 72 74 28 77 | 69 6e 64 6f 77 29 3b 0d |etPort(w|indow);.|
|00000e80| 09 09 77 74 20 3a 3d 20 | 47 65 74 57 69 6e 64 6f |..wt := |GetWindo|
|00000e90| 77 54 79 70 65 28 77 69 | 6e 64 6f 77 29 3b 0d 09 |wType(wi|ndow);..|
|00000ea0| 09 73 65 6c 65 63 74 65 | 64 5f 69 74 65 6d 20 3a |.selecte|d_item :|
|00000eb0| 3d 20 47 65 74 53 65 6c | 65 63 74 65 64 49 74 65 |= GetSel|ectedIte|
|00000ec0| 6d 28 47 65 74 57 69 6e | 64 6f 77 54 79 70 65 28 |m(GetWin|dowType(|
|00000ed0| 77 69 6e 64 6f 77 29 29 | 3b 0d 09 09 69 66 20 73 |window))|;...if s|
|00000ee0| 65 6c 65 63 74 65 64 5f | 69 74 65 6d 20 3e 20 30 |elected_|item > 0|
|00000ef0| 20 74 68 65 6e 20 62 65 | 67 69 6e 0d 09 09 09 54 | then be|gin....T|
|00000f00| 65 78 74 49 64 6c 65 28 | 77 69 6e 64 6f 77 69 6e |extIdle(|windowin|
|00000f10| 66 6f 5b 47 65 74 57 69 | 6e 64 6f 77 54 79 70 65 |fo[GetWi|ndowType|
|00000f20| 28 77 69 6e 64 6f 77 29 | 5d 2e 69 74 65 6d 73 5b |(window)|].items[|
|00000f30| 73 65 6c 65 63 74 65 64 | 5f 69 74 65 6d 5d 5e 2e |selected|_item]^.|
|00000f40| 64 61 74 61 29 3b 0d 09 | 09 65 6e 64 3b 0d 09 09 |data);..|.end;...|
|00000f50| 69 66 20 28 77 69 6e 64 | 6f 77 20 3d 20 46 72 6f |if (wind|ow = Fro|
|00000f60| 6e 74 57 69 6e 64 6f 77 | 29 20 26 20 49 6e 46 6f |ntWindow|) & InFo|
|00000f70| 72 65 67 72 6f 75 6e 64 | 20 74 68 65 6e 20 62 65 |reground| then be|
|00000f80| 67 69 6e 0d 09 09 09 47 | 65 74 4d 6f 75 73 65 28 |gin....G|etMouse(|
|00000f90| 70 74 29 3b 0d 09 09 09 | 63 75 72 73 6f 72 5f 73 |pt);....|cursor_s|
|00000fa0| 65 74 20 3a 3d 20 66 61 | 6c 73 65 3b 0d 09 09 09 |et := fa|lse;....|
|00000fb0| 66 6f 72 20 69 20 3a 3d | 20 31 20 74 6f 20 69 74 |for i :=| 1 to it|
|00000fc0| 65 6d 5f 6d 61 78 20 64 | 6f 20 62 65 67 69 6e 0d |em_max d|o begin.|
|00000fd0| 09 09 09 09 77 68 61 74 | 20 3a 3d 20 77 69 6e 64 |....what| := wind|
|00000fe0| 6f 77 69 6e 66 6f 5b 77 | 74 5d 2e 69 74 65 6d 73 |owinfo[w|t].items|
|00000ff0| 5b 69 5d 3b 0d 09 09 09 | 09 69 66 20 77 68 61 74 |[i];....|.if what|
|00001000| 20 3c 3e 20 6e 69 6c 20 | 74 68 65 6e 20 62 65 67 | <> nil |then beg|
|00001010| 69 6e 0d 09 09 09 09 09 | 47 65 74 44 49 74 65 6d |in......|GetDItem|
|00001020| 52 65 63 74 28 77 69 6e | 64 6f 77 2c 20 69 2c 20 |Rect(win|dow, i, |
|00001030| 72 29 3b 0d 09 09 09 09 | 09 69 66 20 50 74 49 6e |r);.....|.if PtIn|
|00001040| 52 65 63 74 28 70 74 2c | 20 72 29 20 74 68 65 6e |Rect(pt,| r) then|
|00001050| 20 62 65 67 69 6e 0d 09 | 09 09 09 09 09 63 75 72 | begin..|.....cur|
|00001060| 73 6f 72 5f 73 65 74 20 | 3a 3d 20 74 72 75 65 3b |sor_set |:= true;|
|00001070| 0d 09 09 09 09 09 09 63 | 75 72 73 6f 72 69 64 20 |.......c|ursorid |
|00001080| 3a 3d 20 77 68 61 74 69 | 6e 66 6f 5b 54 79 70 65 |:= whati|nfo[Type|
|00001090| 54 6f 57 68 61 74 28 77 | 68 61 74 5e 2e 74 79 70 |ToWhat(w|hat^.typ|
|000010a0| 29 5d 2e 63 75 72 73 6f | 72 69 64 3b 0d 09 09 09 |)].curso|rid;....|
|000010b0| 09 09 09 63 75 72 73 6f | 72 20 3a 3d 20 77 68 61 |...curso|r := wha|
|000010c0| 74 69 6e 66 6f 5b 54 79 | 70 65 54 6f 57 68 61 74 |tinfo[Ty|peToWhat|
|000010d0| 28 77 68 61 74 5e 2e 74 | 79 70 29 5d 2e 63 75 72 |(what^.t|yp)].cur|
|000010e0| 73 6f 72 3b 0d 09 09 09 | 09 09 09 69 66 20 63 75 |sor;....|...if cu|
|000010f0| 72 73 6f 72 20 3d 20 6e | 69 6c 20 74 68 65 6e 20 |rsor = n|il then |
|00001100| 62 65 67 69 6e 0d 09 09 | 09 09 09 09 09 69 66 20 |begin...|.....if |
|00001110| 63 75 72 73 6f 72 69 64 | 20 3d 20 30 20 74 68 65 |cursorid| = 0 the|
|00001120| 6e 20 62 65 67 69 6e 0d | 09 09 09 09 09 09 09 09 |n begin.|........|
|00001130| 49 6e 69 74 43 75 72 73 | 6f 72 3b 0d 09 09 09 09 |InitCurs|or;.....|
|00001140| 09 09 09 65 6e 64 20 65 | 6c 73 65 20 62 65 67 69 |...end e|lse begi|
|00001150| 6e 0d 09 09 09 09 09 09 | 09 09 53 65 74 43 75 72 |n.......|..SetCur|
|00001160| 73 6f 72 28 47 65 74 43 | 75 72 73 6f 72 28 63 75 |sor(GetC|ursor(cu|
|00001170| 72 73 6f 72 69 64 29 5e | 5e 29 3b 0d 09 09 09 09 |rsorid)^|^);.....|
|00001180| 09 09 09 65 6e 64 3b 0d | 09 09 09 09 09 09 65 6e |...end;.|......en|
|00001190| 64 20 65 6c 73 65 20 62 | 65 67 69 6e 0d 09 09 09 |d else b|egin....|
|000011a0| 09 09 09 09 6a 75 6e 6b | 20 3a 3d 20 43 61 6c 6c |....junk| := Call|
|000011b0| 57 68 61 74 43 75 72 73 | 6f 72 28 77 74 2c 20 69 |WhatCurs|or(wt, i|
|000011c0| 2c 20 70 74 2c 20 63 75 | 72 73 6f 72 69 64 2c 20 |, pt, cu|rsorid, |
|000011d0| 63 75 72 73 6f 72 29 3b | 0d 09 09 09 09 09 09 65 |cursor);|.......e|
|000011e0| 6e 64 3b 20 28 2a 20 69 | 66 20 2a 29 0d 09 09 09 |nd; (* i|f *)....|
|000011f0| 09 09 65 6e 64 3b 0d 09 | 09 09 09 65 6e 64 3b 20 |..end;..|...end; |
|00001200| 28 2a 20 69 66 20 2a 29 | 0d 09 09 09 65 6e 64 3b |(* if *)|....end;|
|00001210| 20 28 2a 20 66 6f 72 20 | 2a 29 0d 09 09 09 69 66 | (* for |*)....if|
|00001220| 20 6e 6f 74 20 63 75 72 | 73 6f 72 5f 73 65 74 20 | not cur|sor_set |
|00001230| 74 68 65 6e 20 62 65 67 | 69 6e 0d 09 09 09 09 49 |then beg|in.....I|
|00001240| 6e 69 74 43 75 72 73 6f | 72 3b 0d 09 09 09 65 6e |nitCurso|r;....en|
|00001250| 64 3b 20 28 2a 20 69 66 | 20 2a 29 0d 09 09 65 6e |d; (* if| *)...en|
|00001260| 64 3b 0d 09 65 6e 64 3b | 0d 0d 09 70 72 6f 63 65 |d;..end;|...proce|
|00001270| 64 75 72 65 20 57 69 6e | 64 6f 77 44 6f 4b 65 79 |dure Win|dowDoKey|
|00001280| 20 28 77 69 6e 64 6f 77 | 3a 20 57 69 6e 64 6f 77 | (window|: Window|
|00001290| 50 74 72 3b 20 65 72 3a | 20 45 76 65 6e 74 52 65 |Ptr; er:| EventRe|
|000012a0| 63 6f 72 64 29 3b 0d 09 | 09 76 61 72 0d 09 09 09 |cord);..|.var....|
|000012b0| 73 65 6c 65 63 74 65 64 | 5f 69 74 65 6d 3a 20 69 |selected|_item: i|
|000012c0| 6e 74 65 67 65 72 3b 0d | 09 09 09 6b 65 79 3a 20 |nteger;.|...key: |
|000012d0| 50 72 6f 63 50 74 72 3b | 0d 09 62 65 67 69 6e 0d |ProcPtr;|..begin.|
|000012e0| 09 09 73 65 6c 65 63 74 | 65 64 5f 69 74 65 6d 20 |..select|ed_item |
|000012f0| 3a 3d 20 77 69 6e 64 6f | 77 69 6e 66 6f 5b 47 65 |:= windo|winfo[Ge|
|00001300| 74 57 69 6e 64 6f 77 54 | 79 70 65 28 77 69 6e 64 |tWindowT|ype(wind|
|00001310| 6f 77 29 5d 2e 73 65 6c | 65 63 74 65 64 5f 69 74 |ow)].sel|ected_it|
|00001320| 65 6d 3b 0d 09 09 69 66 | 20 73 65 6c 65 63 74 65 |em;...if| selecte|
|00001330| 64 5f 69 74 65 6d 20 3e | 20 30 20 74 68 65 6e 20 |d_item >| 0 then |
|00001340| 62 65 67 69 6e 0d 09 09 | 09 6b 65 79 20 3a 3d 20 |begin...|.key := |
|00001350| 77 68 61 74 69 6e 66 6f | 5b 54 79 70 65 54 6f 57 |whatinfo|[TypeToW|
|00001360| 68 61 74 28 47 65 74 57 | 68 61 74 54 79 70 65 28 |hat(GetW|hatType(|
|00001370| 47 65 74 57 69 6e 64 6f | 77 54 79 70 65 28 77 69 |GetWindo|wType(wi|
|00001380| 6e 64 6f 77 29 2c 20 73 | 65 6c 65 63 74 65 64 5f |ndow), s|elected_|
|00001390| 69 74 65 6d 29 29 5d 2e | 6b 65 79 3b 0d 09 09 09 |item))].|key;....|
|000013a0| 69 66 20 6b 65 79 20 3c | 3e 20 6e 69 6c 20 74 68 |if key <|> nil th|
|000013b0| 65 6e 20 62 65 67 69 6e | 0d 09 09 09 09 53 65 74 |en begin|.....Set|
|000013c0| 50 6f 72 74 28 77 69 6e | 64 6f 77 29 3b 0d 09 09 |Port(win|dow);...|
|000013d0| 09 09 44 69 73 70 6c 61 | 79 45 72 72 6f 72 28 61 |..Displa|yError(a|
|000013e0| 63 44 6f 54 68 69 73 2c | 20 43 61 6c 6c 57 68 61 |cDoThis,| CallWha|
|000013f0| 74 4b 65 79 28 47 65 74 | 57 69 6e 64 6f 77 54 79 |tKey(Get|WindowTy|
|00001400| 70 65 28 77 69 6e 64 6f | 77 29 2c 20 73 65 6c 65 |pe(windo|w), sele|
|00001410| 63 74 65 64 5f 69 74 65 | 6d 2c 20 65 72 2c 20 6b |cted_ite|m, er, k|
|00001420| 65 79 29 29 3b 0d 09 09 | 09 65 6e 64 3b 20 28 2a |ey));...|.end; (*|
|00001430| 20 69 66 20 2a 29 0d 09 | 09 65 6e 64 3b 0d 09 65 | if *)..|.end;..e|
|00001440| 6e 64 3b 0d 0d 09 70 72 | 6f 63 65 64 75 72 65 20 |nd;...pr|ocedure |
|00001450| 57 69 6e 64 6f 77 41 63 | 74 69 76 61 74 65 44 65 |WindowAc|tivateDe|
|00001460| 61 63 74 69 76 61 74 65 | 20 28 77 69 6e 64 6f 77 |activate| (window|
|00001470| 3a 20 57 69 6e 64 6f 77 | 50 74 72 3b 20 61 63 74 |: Window|Ptr; act|
|00001480| 69 76 61 74 65 3a 20 62 | 6f 6f 6c 65 61 6e 29 3b |ivate: b|oolean);|
|00001490| 0d 09 09 76 61 72 0d 09 | 09 09 77 74 3a 20 57 69 |...var..|..wt: Wi|
|000014a0| 6e 64 6f 77 54 79 70 65 | 3b 0d 09 09 09 69 74 65 |ndowType|;....ite|
|000014b0| 6d 3a 20 69 6e 74 65 67 | 65 72 3b 0d 09 09 09 69 |m: integ|er;....i|
|000014c0| 3a 20 69 6e 74 65 67 65 | 72 3b 0d 09 09 09 61 63 |: intege|r;....ac|
|000014d0| 74 70 72 6f 63 3a 20 50 | 72 6f 63 50 74 72 3b 0d |tproc: P|rocPtr;.|
|000014e0| 09 09 09 77 68 61 74 3a | 20 57 68 61 74 52 65 63 |...what:| WhatRec|
|000014f0| 6f 72 64 50 74 72 3b 0d | 09 09 09 65 72 72 3a 20 |ordPtr;.|...err: |
|00001500| 4f 53 45 72 72 3b 0d 09 | 62 65 67 69 6e 0d 09 09 |OSErr;..|begin...|
|00001510| 77 74 20 3a 3d 20 47 65 | 74 57 69 6e 64 6f 77 54 |wt := Ge|tWindowT|
|00001520| 79 70 65 28 77 69 6e 64 | 6f 77 29 3b 0d 09 09 69 |ype(wind|ow);...i|
|00001530| 66 20 77 74 20 3c 3e 20 | 57 54 5f 4e 6f 6e 65 20 |f wt <> |WT_None |
|00001540| 74 68 65 6e 20 62 65 67 | 69 6e 0d 09 09 09 53 65 |then beg|in....Se|
|00001550| 74 50 6f 72 74 28 77 69 | 6e 64 6f 77 29 3b 0d 09 |tPort(wi|ndow);..|
|00001560| 09 09 69 74 65 6d 20 3a | 3d 20 47 65 74 53 65 6c |..item :|= GetSel|
|00001570| 65 63 74 65 64 49 74 65 | 6d 28 77 74 29 3b 0d 09 |ectedIte|m(wt);..|
|00001580| 09 09 69 66 20 69 74 65 | 6d 20 3e 20 30 20 74 68 |..if ite|m > 0 th|
|00001590| 65 6e 20 62 65 67 69 6e | 0d 09 09 09 09 54 65 78 |en begin|.....Tex|
|000015a0| 74 41 63 74 69 76 61 74 | 65 28 77 69 6e 64 6f 77 |tActivat|e(window|
|000015b0| 69 6e 66 6f 5b 77 74 5d | 2e 69 74 65 6d 73 5b 69 |info[wt]|.items[i|
|000015c0| 74 65 6d 5d 5e 2e 64 61 | 74 61 2c 20 61 63 74 69 |tem]^.da|ta, acti|
|000015d0| 76 61 74 65 29 3b 0d 09 | 09 09 65 6e 64 3b 20 28 |vate);..|..end; (|
|000015e0| 2a 20 69 66 20 2a 29 0d | 09 09 09 66 6f 72 20 69 |* if *).|...for i|
|000015f0| 20 3a 3d 20 31 20 74 6f | 20 69 74 65 6d 5f 6d 61 | := 1 to| item_ma|
|00001600| 78 20 64 6f 20 62 65 67 | 69 6e 0d 09 09 09 09 77 |x do beg|in.....w|
|00001610| 68 61 74 20 3a 3d 20 77 | 69 6e 64 6f 77 69 6e 66 |hat := w|indowinf|
|00001620| 6f 5b 77 74 5d 2e 69 74 | 65 6d 73 5b 69 5d 3b 0d |o[wt].it|ems[i];.|
|00001630| 09 09 09 09 69 66 20 77 | 68 61 74 20 3c 3e 20 6e |....if w|hat <> n|
|00001640| 69 6c 20 74 68 65 6e 20 | 62 65 67 69 6e 0d 09 09 |il then |begin...|
|00001650| 09 09 09 61 63 74 70 72 | 6f 63 20 3a 3d 20 77 68 |...actpr|oc := wh|
|00001660| 61 74 69 6e 66 6f 5b 54 | 79 70 65 54 6f 57 68 61 |atinfo[T|ypeToWha|
|00001670| 74 28 77 68 61 74 5e 2e | 74 79 70 29 5d 2e 61 63 |t(what^.|typ)].ac|
|00001680| 74 69 76 61 74 65 3b 0d | 09 09 09 09 09 69 66 20 |tivate;.|.....if |
|00001690| 61 63 74 70 72 6f 63 20 | 3c 3e 20 6e 69 6c 20 74 |actproc |<> nil t|
|000016a0| 68 65 6e 20 62 65 67 69 | 6e 0d 09 09 09 09 09 09 |hen begi|n.......|
|000016b0| 65 72 72 20 3a 3d 20 43 | 61 6c 6c 57 68 61 74 41 |err := C|allWhatA|
|000016c0| 63 74 69 76 61 74 65 28 | 77 74 2c 20 69 2c 20 61 |ctivate(|wt, i, a|
|000016d0| 63 74 69 76 61 74 65 2c | 20 61 63 74 70 72 6f 63 |ctivate,| actproc|
|000016e0| 29 3b 0d 09 09 09 09 09 | 09 69 66 20 28 65 72 72 |);......|.if (err|
|000016f0| 20 3c 3e 20 6e 6f 45 72 | 72 29 20 61 6e 64 20 28 | <> noEr|r) and (|
|00001700| 65 72 72 20 3c 3e 20 75 | 73 65 72 43 61 6e 63 65 |err <> u|serCance|
|00001710| 6c 65 64 45 72 72 29 20 | 74 68 65 6e 20 62 65 67 |ledErr) |then beg|
|00001720| 69 6e 0d 09 09 09 09 09 | 09 09 53 79 73 42 65 65 |in......|..SysBee|
|00001730| 70 28 31 30 29 3b 0d 09 | 09 09 09 09 09 65 6e 64 |p(10);..|.....end|
|00001740| 3b 20 28 2a 20 69 66 20 | 2a 29 0d 09 09 09 09 09 |; (* if |*)......|
|00001750| 65 6e 64 3b 0d 09 09 09 | 09 65 6e 64 3b 20 28 2a |end;....|.end; (*|
|00001760| 20 69 66 20 2a 29 0d 09 | 09 09 65 6e 64 3b 20 28 | if *)..|..end; (|
|00001770| 2a 20 66 6f 72 20 2a 29 | 0d 09 09 65 6e 64 3b 20 |* for *)|...end; |
|00001780| 28 2a 20 69 66 20 2a 29 | 0d 09 65 6e 64 3b 0d 0d |(* if *)|..end;..|
|00001790| 09 66 75 6e 63 74 69 6f | 6e 20 4c 61 75 6e 63 68 |.functio|n Launch|
|000017a0| 53 6f 6d 65 53 69 6c 6c | 79 55 52 4c 28 75 72 6c |SomeSill|yURL(url|
|000017b0| 3a 20 53 74 72 32 35 35 | 29 3a 20 49 43 45 72 72 |: Str255|): ICErr|
|000017c0| 6f 72 3b 0d 09 09 76 61 | 72 0d 09 09 09 65 72 72 |or;...va|r....err|
|000017d0| 20 3a 20 49 43 45 72 72 | 6f 72 3b 0d 09 09 09 73 | : ICErr|or;....s|
|000017e0| 74 61 72 74 2c 20 66 69 | 6e 3a 20 6c 6f 6e 67 69 |tart, fi|n: longi|
|000017f0| 6e 74 3b 0d 09 09 09 6a | 75 6e 6b 20 3a 20 69 6e |nt;....j|unk : in|
|00001800| 74 65 67 65 72 3b 0d 09 | 09 09 75 72 6c 5f 73 63 |teger;..|..url_sc|
|00001810| 68 65 6d 65 20 3a 20 53 | 74 72 32 35 35 3b 0d 09 |heme : S|tr255;..|
|00001820| 09 09 61 6c 65 72 74 5f | 69 64 20 3a 20 69 6e 74 |..alert_|id : int|
|00001830| 65 67 65 72 3b 0d 09 62 | 65 67 69 6e 0d 09 09 73 |eger;..b|egin...s|
|00001840| 74 61 72 74 20 3a 3d 20 | 6c 65 6e 67 74 68 28 75 |tart := |length(u|
|00001850| 72 6c 29 20 64 69 76 20 | 32 3b 0d 09 09 66 69 6e |rl) div |2;...fin|
|00001860| 20 3a 3d 73 74 61 72 74 | 3b 0d 09 09 65 72 72 20 | :=start|;...err |
|00001870| 3a 3d 20 49 43 4c 61 75 | 6e 63 68 55 52 4c 28 47 |:= ICLau|nchURL(G|
|00001880| 65 74 49 6e 73 74 61 6e | 63 65 2c 20 27 27 2c 20 |etInstan|ce, '', |
|00001890| 40 75 72 6c 5b 31 5d 2c | 20 6c 65 6e 67 74 68 28 |@url[1],| length(|
|000018a0| 75 72 6c 29 2c 20 73 74 | 61 72 74 2c 20 66 69 6e |url), st|art, fin|
|000018b0| 29 3b 0d 09 09 69 66 20 | 28 65 72 72 20 3d 20 69 |);...if |(err = i|
|000018c0| 63 50 72 65 66 4e 6f 74 | 46 6f 75 6e 64 45 72 72 |cPrefNot|FoundErr|
|000018d0| 29 20 6f 72 20 28 65 72 | 72 20 3d 20 61 66 70 49 |) or (er|r = afpI|
|000018e0| 74 65 6d 4e 6f 74 46 6f | 75 6e 64 29 20 74 68 65 |temNotFo|und) the|
|000018f0| 6e 20 62 65 67 69 6e 0d | 09 09 09 64 65 6c 65 74 |n begin.|...delet|
|00001900| 65 28 75 72 6c 2c 20 31 | 2c 20 70 6f 73 28 27 3c |e(url, 1|, pos('<|
|00001910| 27 2c 20 75 72 6c 29 29 | 3b 0d 09 09 09 75 72 6c |', url))|;....url|
|00001920| 5f 73 63 68 65 6d 65 20 | 3a 3d 20 63 6f 70 79 28 |_scheme |:= copy(|
|00001930| 75 72 6c 2c 20 31 2c 20 | 70 6f 73 28 27 3a 27 2c |url, 1, |pos(':',|
|00001940| 20 75 72 6c 29 20 2d 20 | 31 29 3b 0d 09 09 09 50 | url) - |1);....P|
|00001950| 61 72 61 6d 54 65 78 74 | 28 75 72 6c 5f 73 63 68 |aramText|(url_sch|
|00001960| 65 6d 65 2c 20 27 27 2c | 20 27 27 2c 20 27 27 29 |eme, '',| '', '')|
|00001970| 3b 0d 09 09 09 69 66 20 | 65 72 72 20 3d 20 69 63 |;....if |err = ic|
|00001980| 50 72 65 66 4e 6f 74 46 | 6f 75 6e 64 45 72 72 20 |PrefNotF|oundErr |
|00001990| 74 68 65 6e 20 62 65 67 | 69 6e 0d 09 09 09 09 61 |then beg|in.....a|
|000019a0| 6c 65 72 74 5f 69 64 20 | 3a 3d 20 31 34 37 3b 0d |lert_id |:= 147;.|
|000019b0| 09 09 09 65 6e 64 20 65 | 6c 73 65 20 62 65 67 69 |...end e|lse begi|
|000019c0| 6e 0d 09 09 09 09 61 6c | 65 72 74 5f 69 64 20 3a |n.....al|ert_id :|
|000019d0| 3d 20 31 34 38 3b 0d 09 | 09 09 65 6e 64 3b 20 28 |= 148;..|..end; (|
|000019e0| 2a 20 69 66 20 2a 29 0d | 09 09 09 6a 75 6e 6b 20 |* if *).|...junk |
|000019f0| 3a 3d 20 53 74 6f 70 41 | 6c 65 72 74 28 61 6c 65 |:= StopA|lert(ale|
|00001a00| 72 74 5f 69 64 2c 20 40 | 4f 4b 4d 6f 64 61 6c 46 |rt_id, @|OKModalF|
|00001a10| 69 6c 74 65 72 29 3b 0d | 09 09 09 65 72 72 20 3a |ilter);.|...err :|
|00001a20| 3d 20 6e 6f 45 72 72 3b | 0d 09 09 65 6e 64 3b 20 |= noErr;|...end; |
|00001a30| 28 2a 20 69 66 20 2a 29 | 0d 09 09 4c 61 75 6e 63 |(* if *)|...Launc|
|00001a40| 68 53 6f 6d 65 53 69 6c | 6c 79 55 52 4c 20 3a 3d |hSomeSil|lyURL :=|
|00001a50| 20 65 72 72 3b 0d 09 65 | 6e 64 3b 20 28 2a 20 4c | err;..e|nd; (* L|
|00001a60| 61 75 6e 63 68 53 6f 6d | 65 53 69 6c 6c 79 55 52 |aunchSom|eSillyUR|
|00001a70| 4c 20 2a 29 0d 09 0d 09 | 70 72 6f 63 65 64 75 72 |L *)....|procedur|
|00001a80| 65 20 44 6f 41 62 6f 75 | 74 43 6c 69 63 6b 28 77 |e DoAbou|tClick(w|
|00001a90| 69 6e 64 6f 77 3a 20 57 | 69 6e 64 6f 77 50 74 72 |indow: W|indowPtr|
|00001aa0| 3b 20 69 74 65 6d 3a 20 | 69 6e 74 65 67 65 72 29 |; item: |integer)|
|00001ab0| 3b 0d 09 09 76 61 72 0d | 09 09 09 61 3a 69 6e 74 |;...var.|...a:int|
|00001ac0| 65 67 65 72 3b 0d 09 09 | 09 73 3a 53 74 72 32 35 |eger;...|.s:Str25|
|00001ad0| 35 3b 0d 09 62 65 67 69 | 6e 0d 09 09 69 66 20 54 |5;..begi|n...if T|
|00001ae0| 72 61 63 6b 49 74 65 6d | 73 28 77 69 6e 64 6f 77 |rackItem|s(window|
|00001af0| 2c 20 69 74 65 6d 2c 20 | 30 2c 20 30 29 20 74 68 |, item, |0, 0) th|
|00001b00| 65 6e 20 62 65 67 69 6e | 0d 09 09 09 69 66 20 69 |en begin|....if i|
|00001b10| 74 65 6d 20 3d 20 36 20 | 74 68 65 6e 20 62 65 67 |tem = 6 |then beg|
|00001b20| 69 6e 0d 09 09 09 09 61 | 20 3a 3d 20 4e 6f 74 65 |in.....a| := Note|
|00001b30| 41 6c 65 72 74 28 31 36 | 37 2c 20 40 43 61 6e 63 |Alert(16|7, @Canc|
|00001b40| 65 6c 4d 6f 64 61 6c 46 | 69 6c 74 65 72 29 3b 0d |elModalF|ilter);.|
|00001b50| 09 09 09 09 63 61 73 65 | 20 61 20 6f 66 0d 09 09 |....case| a of...|
|00001b60| 09 09 09 31 3a 20 62 65 | 67 69 6e 0d 09 09 09 09 |...1: be|gin.....|
|00001b70| 09 09 69 74 65 6d 20 3a | 3d 20 37 3b 0d 09 09 09 |..item :|= 7;....|
|00001b80| 09 09 65 6e 64 3b 0d 09 | 09 09 09 09 32 3a 20 62 |..end;..|....2: b|
|00001b90| 65 67 69 6e 0d 09 09 09 | 09 09 09 69 74 65 6d 20 |egin....|...item |
|00001ba0| 3a 3d 20 30 3b 0d 09 09 | 09 09 09 65 6e 64 3b 0d |:= 0;...|...end;.|
|00001bb0| 09 09 09 09 09 33 3a 20 | 62 65 67 69 6e 0d 09 09 |.....3: |begin...|
|00001bc0| 09 09 09 09 69 74 65 6d | 20 3a 3d 20 36 3b 0d 09 |....item| := 6;..|
|00001bd0| 09 09 09 09 65 6e 64 3b | 0d 09 09 09 09 65 6e 64 |....end;|.....end|
|00001be0| 3b 0d 09 09 09 65 6e 64 | 3b 0d 09 09 09 69 66 20 |;....end|;....if |
|00001bf0| 69 74 65 6d 20 3c 3e 20 | 30 20 74 68 65 6e 20 62 |item <> |0 then b|
|00001c00| 65 67 69 6e 0d 09 09 09 | 09 47 65 74 49 6e 64 53 |egin....|.GetIndS|
|00001c10| 74 72 69 6e 67 28 73 2c | 20 31 32 39 2c 20 69 74 |tring(s,| 129, it|
|00001c20| 65 6d 29 3b 0d 09 09 09 | 09 44 69 73 70 6c 61 79 |em);....|.Display|
|00001c30| 45 72 72 6f 72 28 61 63 | 44 6f 54 68 69 73 2c 20 |Error(ac|DoThis, |
|00001c40| 4c 61 75 6e 63 68 53 6f | 6d 65 53 69 6c 6c 79 55 |LaunchSo|meSillyU|
|00001c50| 52 4c 28 73 29 29 3b 0d | 09 09 09 65 6e 64 3b 0d |RL(s));.|...end;.|
|00001c60| 09 09 65 6e 64 3b 0d 09 | 65 6e 64 3b 0d 09 0d 09 |..end;..|end;....|
|00001c70| 70 72 6f 63 65 64 75 72 | 65 20 57 69 6e 64 6f 77 |procedur|e Window|
|00001c80| 49 74 65 6d 57 68 65 72 | 65 20 28 77 69 6e 64 6f |ItemWher|e (windo|
|00001c90| 77 3a 20 57 69 6e 64 6f | 77 50 74 72 3b 20 65 72 |w: Windo|wPtr; er|
|00001ca0| 3a 20 45 76 65 6e 74 52 | 65 63 6f 72 64 3b 20 69 |: EventR|ecord; i|
|00001cb0| 74 65 6d 3a 20 69 6e 74 | 65 67 65 72 29 3b 0d 09 |tem: int|eger);..|
|00001cc0| 09 76 61 72 0d 09 09 09 | 63 6c 69 63 6b 3a 20 50 |.var....|click: P|
|00001cd0| 72 6f 63 50 74 72 3b 0d | 09 62 65 67 69 6e 0d 09 |rocPtr;.|.begin..|
|00001ce0| 09 63 61 73 65 20 47 65 | 74 57 69 6e 64 6f 77 54 |.case Ge|tWindowT|
|00001cf0| 79 70 65 28 77 69 6e 64 | 6f 77 29 20 6f 66 0d 09 |ype(wind|ow) of..|
|00001d00| 09 09 57 54 5f 41 62 6f | 75 74 3a 20 20 62 65 67 |..WT_Abo|ut: beg|
|00001d10| 69 6e 0d 09 09 09 09 44 | 6f 41 62 6f 75 74 43 6c |in.....D|oAboutCl|
|00001d20| 69 63 6b 28 77 69 6e 64 | 6f 77 2c 20 69 74 65 6d |ick(wind|ow, item|
|00001d30| 29 3b 0d 09 09 09 65 6e | 64 3b 0d 09 09 09 6f 74 |);....en|d;....ot|
|00001d40| 68 65 72 77 69 73 65 20 | 62 65 67 69 6e 0d 09 09 |herwise |begin...|
|00001d50| 09 09 63 6c 69 63 6b 20 | 3a 3d 20 77 68 61 74 69 |..click |:= whati|
|00001d60| 6e 66 6f 5b 54 79 70 65 | 54 6f 57 68 61 74 28 47 |nfo[Type|ToWhat(G|
|00001d70| 65 74 57 68 61 74 54 79 | 70 65 28 47 65 74 57 69 |etWhatTy|pe(GetWi|
|00001d80| 6e 64 6f 77 54 79 70 65 | 28 77 69 6e 64 6f 77 29 |ndowType|(window)|
|00001d90| 2c 20 69 74 65 6d 29 29 | 5d 2e 63 6c 69 63 6b 3b |, item))|].click;|
|00001da0| 0d 09 09 09 09 69 66 20 | 63 6c 69 63 6b 20 3c 3e |.....if |click <>|
|00001db0| 20 6e 69 6c 20 74 68 65 | 6e 20 62 65 67 69 6e 0d | nil the|n begin.|
|00001dc0| 09 09 09 09 09 53 65 74 | 50 6f 72 74 28 77 69 6e |.....Set|Port(win|
|00001dd0| 64 6f 77 29 3b 0d 09 09 | 09 09 09 44 69 73 70 6c |dow);...|...Displ|
|00001de0| 61 79 45 72 72 6f 72 28 | 61 63 44 6f 54 68 69 73 |ayError(|acDoThis|
|00001df0| 2c 20 43 61 6c 6c 57 68 | 61 74 43 6c 69 63 6b 28 |, CallWh|atClick(|
|00001e00| 47 65 74 57 69 6e 64 6f | 77 54 79 70 65 28 77 69 |GetWindo|wType(wi|
|00001e10| 6e 64 6f 77 29 2c 20 69 | 74 65 6d 2c 20 65 72 2c |ndow), i|tem, er,|
|00001e20| 20 63 6c 69 63 6b 29 29 | 3b 0d 09 09 09 09 65 6e | click))|;.....en|
|00001e30| 64 3b 20 28 2a 20 69 66 | 20 2a 29 0d 09 09 09 65 |d; (* if| *)....e|
|00001e40| 6e 64 3b 0d 09 09 65 6e | 64 3b 0d 09 65 6e 64 3b |nd;...en|d;..end;|
|00001e50| 0d 0d 09 66 75 6e 63 74 | 69 6f 6e 20 57 69 6e 64 |...funct|ion Wind|
|00001e60| 6f 77 45 61 72 6c 79 48 | 61 6e 64 6c 65 45 76 65 |owEarlyH|andleEve|
|00001e70| 6e 74 20 28 77 69 6e 64 | 6f 77 3a 20 57 69 6e 64 |nt (wind|ow: Wind|
|00001e80| 6f 77 50 74 72 3b 20 65 | 72 3a 20 45 76 65 6e 74 |owPtr; e|r: Event|
|00001e90| 52 65 63 6f 72 64 29 3a | 20 62 6f 6f 6c 65 61 6e |Record):| boolean|
|00001ea0| 3b 0d 09 62 65 67 69 6e | 0d 09 09 77 69 6e 64 6f |;..begin|...windo|
|00001eb0| 77 20 3a 3d 20 77 69 6e | 64 6f 77 3b 20 7b 20 55 |w := win|dow; { U|
|00001ec0| 6e 75 73 65 64 20 7d 0d | 09 09 65 72 20 3a 3d 20 |nused }.|..er := |
|00001ed0| 65 72 3b 20 7b 20 55 6e | 75 73 65 64 20 7d 0d 09 |er; { Un|used }..|
|00001ee0| 09 57 69 6e 64 6f 77 45 | 61 72 6c 79 48 61 6e 64 |.WindowE|arlyHand|
|00001ef0| 6c 65 45 76 65 6e 74 20 | 3a 3d 20 66 61 6c 73 65 |leEvent |:= false|
|00001f00| 3b 0d 09 65 6e 64 3b 0d | 0d 09 70 72 6f 63 65 64 |;..end;.|..proced|
|00001f10| 75 72 65 20 57 69 6e 64 | 6f 77 54 61 62 20 28 77 |ure Wind|owTab (w|
|00001f20| 69 6e 64 6f 77 3a 20 57 | 69 6e 64 6f 77 50 74 72 |indow: W|indowPtr|
|00001f30| 3b 20 73 68 69 66 74 3a | 20 62 6f 6f 6c 65 61 6e |; shift:| boolean|
|00001f40| 29 3b 0d 09 09 76 61 72 | 0d 09 09 09 6f 72 67 69 |);...var|....orgi|
|00001f50| 74 65 6d 2c 20 72 6f 72 | 67 69 74 65 6d 2c 20 69 |tem, ror|gitem, i|
|00001f60| 3a 20 69 6e 74 65 67 65 | 72 3b 0d 09 09 09 64 69 |: intege|r;....di|
|00001f70| 72 6e 3a 20 69 6e 74 65 | 67 65 72 3b 0d 09 09 09 |rn: inte|ger;....|
|00001f80| 73 65 6c 69 74 65 6d 3a | 20 69 6e 74 65 67 65 72 |selitem:| integer|
|00001f90| 3b 0d 09 09 09 74 3a 20 | 4f 53 54 79 70 65 3b 0d |;....t: |OSType;.|
|00001fa0| 09 62 65 67 69 6e 0d 09 | 09 73 65 6c 69 74 65 6d |.begin..|.selitem|
|00001fb0| 20 3a 3d 20 2d 31 3b 0d | 09 09 6f 72 67 69 74 65 | := -1;.|..orgite|
|00001fc0| 6d 20 3a 3d 20 47 65 74 | 53 65 6c 65 63 74 65 64 |m := Get|Selected|
|00001fd0| 49 74 65 6d 28 47 65 74 | 57 69 6e 64 6f 77 54 79 |Item(Get|WindowTy|
|00001fe0| 70 65 28 77 69 6e 64 6f | 77 29 29 3b 0d 09 09 72 |pe(windo|w));...r|
|00001ff0| 6f 72 67 69 74 65 6d 20 | 3a 3d 20 6f 72 67 69 74 |orgitem |:= orgit|
|00002000| 65 6d 3b 0d 09 09 69 66 | 20 6f 72 67 69 74 65 6d |em;...if| orgitem|
|00002010| 20 3c 3d 20 30 20 74 68 | 65 6e 20 62 65 67 69 6e | <= 0 th|en begin|
|00002020| 0d 09 09 09 69 66 20 73 | 68 69 66 74 20 74 68 65 |....if s|hift the|
|00002030| 6e 20 62 65 67 69 6e 0d | 09 09 09 09 6f 72 67 69 |n begin.|....orgi|
|00002040| 74 65 6d 20 3a 3d 20 31 | 3b 0d 09 09 09 65 6e 64 |tem := 1|;....end|
|00002050| 20 65 6c 73 65 20 62 65 | 67 69 6e 0d 09 09 09 09 | else be|gin.....|
|00002060| 6f 72 67 69 74 65 6d 20 | 3a 3d 20 69 74 65 6d 5f |orgitem |:= item_|
|00002070| 6d 61 78 3b 0d 09 09 09 | 65 6e 64 3b 0d 09 09 65 |max;....|end;...e|
|00002080| 6e 64 3b 0d 09 09 64 69 | 72 6e 20 3a 3d 20 69 74 |nd;...di|rn := it|
|00002090| 65 6d 5f 6d 61 78 20 2d | 20 32 20 2a 20 6f 72 64 |em_max -| 2 * ord|
|000020a0| 28 73 68 69 66 74 29 3b | 0d 09 09 69 20 3a 3d 20 |(shift);|...i := |
|000020b0| 6f 72 67 69 74 65 6d 3b | 0d 09 09 72 65 70 65 61 |orgitem;|...repea|
|000020c0| 74 0d 09 09 09 69 20 3a | 3d 20 28 69 20 2b 20 64 |t....i :|= (i + d|
|000020d0| 69 72 6e 29 20 6d 6f 64 | 20 69 74 65 6d 5f 6d 61 |irn) mod| item_ma|
|000020e0| 78 20 2b 20 31 3b 0d 09 | 09 09 74 20 3a 3d 20 47 |x + 1;..|..t := G|
|000020f0| 65 74 57 68 61 74 54 79 | 70 65 28 47 65 74 57 69 |etWhatTy|pe(GetWi|
|00002100| 6e 64 6f 77 54 79 70 65 | 28 77 69 6e 64 6f 77 29 |ndowType|(window)|
|00002110| 2c 20 69 29 3b 0d 09 09 | 09 69 66 20 74 20 3d 20 |, i);...|.if t = |
|00002120| 27 54 45 58 54 27 20 74 | 68 65 6e 20 62 65 67 69 |'TEXT' t|hen begi|
|00002130| 6e 0d 09 09 09 09 73 65 | 6c 69 74 65 6d 20 3a 3d |n.....se|litem :=|
|00002140| 20 69 3b 0d 09 09 09 09 | 6c 65 61 76 65 3b 0d 09 | i;.....|leave;..|
|00002150| 09 09 65 6e 64 3b 0d 09 | 09 75 6e 74 69 6c 20 28 |..end;..|.until (|
|00002160| 69 20 3d 20 6f 72 67 69 | 74 65 6d 29 3b 0d 09 09 |i = orgi|tem);...|
|00002170| 69 66 20 73 65 6c 69 74 | 65 6d 20 3e 20 30 20 74 |if selit|em > 0 t|
|00002180| 68 65 6e 20 62 65 67 69 | 6e 0d 09 09 09 53 65 6c |hen begi|n....Sel|
|00002190| 65 63 74 54 65 78 74 49 | 74 65 6d 28 47 65 74 57 |ectTextI|tem(GetW|
|000021a0| 69 6e 64 6f 77 54 79 70 | 65 28 77 69 6e 64 6f 77 |indowTyp|e(window|
|000021b0| 29 2c 20 73 65 6c 69 74 | 65 6d 29 3b 0d 09 09 65 |), selit|em);...e|
|000021c0| 6e 64 3b 0d 09 65 6e 64 | 3b 0d 0d 09 66 75 6e 63 |nd;..end|;...func|
|000021d0| 74 69 6f 6e 20 57 69 6e | 64 6f 77 45 61 72 6c 79 |tion Win|dowEarly|
|000021e0| 48 61 6e 64 6c 65 4b 65 | 79 20 28 77 69 6e 64 6f |HandleKe|y (windo|
|000021f0| 77 3a 20 57 69 6e 64 6f | 77 50 74 72 3b 20 65 72 |w: Windo|wPtr; er|
|00002200| 3a 20 45 76 65 6e 74 52 | 65 63 6f 72 64 29 3a 20 |: EventR|ecord): |
|00002210| 62 6f 6f 6c 65 61 6e 3b | 0d 09 09 76 61 72 0d 09 |boolean;|...var..|
|00002220| 09 09 62 3a 20 62 6f 6f | 6c 65 61 6e 3b 0d 09 09 |..b: boo|lean;...|
|00002230| 09 63 68 3a 20 69 6e 74 | 65 67 65 72 3b 0d 09 09 |.ch: int|eger;...|
|00002240| 09 77 74 3a 20 57 69 6e | 64 6f 77 54 79 70 65 3b |.wt: Win|dowType;|
|00002250| 0d 09 62 65 67 69 6e 0d | 09 09 62 20 3a 3d 20 66 |..begin.|..b := f|
|00002260| 61 6c 73 65 3b 0d 09 09 | 77 74 20 3a 3d 20 47 65 |alse;...|wt := Ge|
|00002270| 74 57 69 6e 64 6f 77 54 | 79 70 65 28 77 69 6e 64 |tWindowT|ype(wind|
|00002280| 6f 77 29 3b 0d 09 09 69 | 66 20 6e 6f 74 20 77 69 |ow);...i|f not wi|
|00002290| 6e 64 6f 77 69 6e 66 6f | 5b 77 74 5d 2e 77 69 6e |ndowinfo|[wt].win|
|000022a0| 64 6f 77 5f 6b 65 79 5f | 6e 65 65 64 73 5f 74 61 |dow_key_|needs_ta|
|000022b0| 62 73 20 74 68 65 6e 20 | 62 65 67 69 6e 0d 09 09 |bs then |begin...|
|000022c0| 09 63 68 20 3a 3d 20 42 | 41 4e 44 28 65 72 2e 6d |.ch := B|AND(er.m|
|000022d0| 65 73 73 61 67 65 2c 20 | 24 46 46 29 3b 0d 09 09 |essage, |$FF);...|
|000022e0| 09 69 66 20 63 68 20 3d | 20 39 20 74 68 65 6e 20 |.if ch =| 9 then |
|000022f0| 62 65 67 69 6e 0d 09 09 | 09 09 57 69 6e 64 6f 77 |begin...|..Window|
|00002300| 54 61 62 28 77 69 6e 64 | 6f 77 2c 20 42 41 4e 44 |Tab(wind|ow, BAND|
|00002310| 28 65 72 2e 6d 6f 64 69 | 66 69 65 72 73 2c 20 73 |(er.modi|fiers, s|
|00002320| 68 69 66 74 4b 65 79 29 | 20 3c 3e 20 30 29 3b 0d |hiftKey)| <> 0);.|
|00002330| 09 09 09 09 62 20 3a 3d | 20 74 72 75 65 3b 0d 09 |....b :=| true;..|
|00002340| 09 09 65 6e 64 3b 0d 09 | 09 65 6e 64 3b 0d 09 09 |..end;..|.end;...|
|00002350| 57 69 6e 64 6f 77 45 61 | 72 6c 79 48 61 6e 64 6c |WindowEa|rlyHandl|
|00002360| 65 4b 65 79 20 3a 3d 20 | 62 3b 0d 09 65 6e 64 3b |eKey := |b;..end;|
|00002370| 0d 0d 09 66 75 6e 63 74 | 69 6f 6e 20 46 6c 75 73 |...funct|ion Flus|
|00002380| 68 57 69 6e 64 6f 77 54 | 79 70 65 20 28 77 70 3a |hWindowT|ype (wp:|
|00002390| 20 57 69 6e 64 6f 77 50 | 74 72 3b 20 77 74 3a 20 | WindowP|tr; wt: |
|000023a0| 57 69 6e 64 6f 77 54 79 | 70 65 29 3a 20 4f 53 45 |WindowTy|pe): OSE|
|000023b0| 72 72 3b 0d 09 09 76 61 | 72 0d 09 09 09 69 3a 20 |rr;...va|r....i: |
|000023c0| 69 6e 74 65 67 65 72 3b | 0d 09 09 09 66 69 72 73 |integer;|....firs|
|000023d0| 74 5f 65 72 72 2c 20 65 | 72 72 3a 20 4f 53 45 72 |t_err, e|rr: OSEr|
|000023e0| 72 3b 0d 09 09 09 66 6c | 75 73 68 3a 20 50 72 6f |r;....fl|ush: Pro|
|000023f0| 63 50 74 72 3b 0d 09 09 | 09 77 68 61 74 3a 20 57 |cPtr;...|.what: W|
|00002400| 68 61 74 52 65 63 6f 72 | 64 50 74 72 3b 0d 09 09 |hatRecor|dPtr;...|
|00002410| 09 70 6f 72 74 72 65 63 | 74 3a 20 52 65 63 74 3b |.portrec|t: Rect;|
|00002420| 0d 09 62 65 67 69 6e 0d | 09 09 66 69 72 73 74 5f |..begin.|..first_|
|00002430| 65 72 72 20 3a 3d 20 6e | 6f 45 72 72 3b 0d 09 09 |err := n|oErr;...|
|00002440| 53 65 74 50 6f 72 74 28 | 77 70 29 3b 0d 09 09 47 |SetPort(|wp);...G|
|00002450| 65 74 57 69 6e 64 6f 77 | 52 65 63 74 28 77 70 2c |etWindow|Rect(wp,|
|00002460| 20 70 6f 72 74 72 65 63 | 74 29 3b 0d 09 09 77 69 | portrec|t);...wi|
|00002470| 6e 64 6f 77 69 6e 66 6f | 5b 77 74 5d 2e 70 6f 73 |ndowinfo|[wt].pos|
|00002480| 69 74 69 6f 6e 20 3a 3d | 20 70 6f 72 74 72 65 63 |ition :=| portrec|
|00002490| 74 2e 74 6f 70 4c 65 66 | 74 3b 0d 09 09 66 6f 72 |t.topLef|t;...for|
|000024a0| 20 69 20 3a 3d 20 31 20 | 74 6f 20 69 74 65 6d 5f | i := 1 |to item_|
|000024b0| 6d 61 78 20 64 6f 20 62 | 65 67 69 6e 0d 09 09 09 |max do b|egin....|
|000024c0| 77 68 61 74 20 3a 3d 20 | 77 69 6e 64 6f 77 69 6e |what := |windowin|
|000024d0| 66 6f 5b 77 74 5d 2e 69 | 74 65 6d 73 5b 69 5d 3b |fo[wt].i|tems[i];|
|000024e0| 0d 09 09 09 69 66 20 77 | 68 61 74 20 3c 3e 20 6e |....if w|hat <> n|
|000024f0| 69 6c 20 74 68 65 6e 20 | 62 65 67 69 6e 0d 09 09 |il then |begin...|
|00002500| 09 09 66 6c 75 73 68 20 | 3a 3d 20 77 68 61 74 69 |..flush |:= whati|
|00002510| 6e 66 6f 5b 54 79 70 65 | 54 6f 57 68 61 74 28 77 |nfo[Type|ToWhat(w|
|00002520| 68 61 74 5e 2e 74 79 70 | 29 5d 2e 66 6c 75 73 68 |hat^.typ|)].flush|
|00002530| 3b 0d 09 09 09 09 69 66 | 20 66 6c 75 73 68 20 3c |;.....if| flush <|
|00002540| 3e 20 6e 69 6c 20 74 68 | 65 6e 20 62 65 67 69 6e |> nil th|en begin|
|00002550| 0d 09 09 09 09 09 65 72 | 72 20 3a 3d 20 43 61 6c |......er|r := Cal|
|00002560| 6c 57 68 61 74 46 6c 75 | 73 68 28 77 74 2c 20 69 |lWhatFlu|sh(wt, i|
|00002570| 2c 20 66 6c 75 73 68 29 | 3b 0d 09 09 09 09 09 69 |, flush)|;......i|
|00002580| 66 20 66 69 72 73 74 5f | 65 72 72 20 3d 20 6e 6f |f first_|err = no|
|00002590| 45 72 72 20 74 68 65 6e | 20 62 65 67 69 6e 0d 09 |Err then| begin..|
|000025a0| 09 09 09 09 09 66 69 72 | 73 74 5f 65 72 72 20 3a |.....fir|st_err :|
|000025b0| 3d 20 65 72 72 3b 0d 09 | 09 09 09 09 65 6e 64 3b |= err;..|....end;|
|000025c0| 20 28 2a 20 69 66 20 2a | 29 0d 09 09 09 09 65 6e | (* if *|).....en|
|000025d0| 64 3b 0d 09 09 09 65 6e | 64 3b 20 28 2a 20 69 66 |d;....en|d; (* if|
|000025e0| 20 2a 29 0d 09 09 65 6e | 64 3b 0d 09 09 46 6c 75 | *)...en|d;...Flu|
|000025f0| 73 68 57 69 6e 64 6f 77 | 54 79 70 65 20 3a 3d 20 |shWindow|Type := |
|00002600| 66 69 72 73 74 5f 65 72 | 72 3b 0d 09 65 6e 64 3b |first_er|r;..end;|
|00002610| 20 28 2a 20 46 6c 75 73 | 68 57 69 6e 64 6f 77 54 | (* Flus|hWindowT|
|00002620| 79 70 65 20 2a 29 0d 0d | 09 66 75 6e 63 74 69 6f |ype *)..|.functio|
|00002630| 6e 20 44 69 73 70 6f 73 | 65 57 69 6e 64 6f 77 54 |n Dispos|eWindowT|
|00002640| 79 70 65 20 28 77 70 3a | 20 57 69 6e 64 6f 77 50 |ype (wp:| WindowP|
|00002650| 74 72 3b 20 77 74 3a 20 | 57 69 6e 64 6f 77 54 79 |tr; wt: |WindowTy|
|00002660| 70 65 29 3a 20 4f 53 45 | 72 72 3b 0d 09 09 76 61 |pe): OSE|rr;...va|
|00002670| 72 0d 09 09 09 69 3a 20 | 69 6e 74 65 67 65 72 3b |r....i: |integer;|
|00002680| 0d 09 09 09 66 69 72 73 | 74 5f 65 72 72 2c 20 65 |....firs|t_err, e|
|00002690| 72 72 3a 20 4f 53 45 72 | 72 3b 0d 09 09 09 63 6c |rr: OSEr|r;....cl|
|000026a0| 6f 73 65 3a 20 50 72 6f | 63 50 74 72 3b 0d 09 09 |ose: Pro|cPtr;...|
|000026b0| 09 77 68 61 74 3a 20 57 | 68 61 74 52 65 63 6f 72 |.what: W|hatRecor|
|000026c0| 64 50 74 72 3b 0d 09 62 | 65 67 69 6e 0d 09 09 66 |dPtr;..b|egin...f|
|000026d0| 69 72 73 74 5f 65 72 72 | 20 3a 3d 20 6e 6f 45 72 |irst_err| := noEr|
|000026e0| 72 3b 0d 09 09 53 65 74 | 50 6f 72 74 28 77 70 29 |r;...Set|Port(wp)|
|000026f0| 3b 0d 09 09 66 6f 72 20 | 69 20 3a 3d 20 31 20 74 |;...for |i := 1 t|
|00002700| 6f 20 69 74 65 6d 5f 6d | 61 78 20 64 6f 20 62 65 |o item_m|ax do be|
|00002710| 67 69 6e 0d 09 09 09 77 | 68 61 74 20 3a 3d 20 77 |gin....w|hat := w|
|00002720| 69 6e 64 6f 77 69 6e 66 | 6f 5b 77 74 5d 2e 69 74 |indowinf|o[wt].it|
|00002730| 65 6d 73 5b 69 5d 3b 0d | 09 09 09 69 66 20 77 68 |ems[i];.|...if wh|
|00002740| 61 74 20 3c 3e 20 6e 69 | 6c 20 74 68 65 6e 20 62 |at <> ni|l then b|
|00002750| 65 67 69 6e 0d 09 09 09 | 09 63 6c 6f 73 65 20 3a |egin....|.close :|
|00002760| 3d 20 77 68 61 74 69 6e | 66 6f 5b 54 79 70 65 54 |= whatin|fo[TypeT|
|00002770| 6f 57 68 61 74 28 77 68 | 61 74 5e 2e 74 79 70 29 |oWhat(wh|at^.typ)|
|00002780| 5d 2e 63 6c 6f 73 65 3b | 0d 09 09 09 09 69 66 20 |].close;|.....if |
|00002790| 63 6c 6f 73 65 20 3c 3e | 20 6e 69 6c 20 74 68 65 |close <>| nil the|
|000027a0| 6e 20 62 65 67 69 6e 0d | 09 09 09 09 09 65 72 72 |n begin.|.....err|
|000027b0| 20 3a 3d 20 43 61 6c 6c | 57 68 61 74 43 6c 6f 73 | := Call|WhatClos|
|000027c0| 65 28 77 74 2c 20 69 2c | 20 63 6c 6f 73 65 29 3b |e(wt, i,| close);|
|000027d0| 0d 09 09 09 09 09 69 66 | 20 66 69 72 73 74 5f 65 |......if| first_e|
|000027e0| 72 72 20 3d 20 6e 6f 45 | 72 72 20 74 68 65 6e 20 |rr = noE|rr then |
|000027f0| 62 65 67 69 6e 0d 09 09 | 09 09 09 09 66 69 72 73 |begin...|....firs|
|00002800| 74 5f 65 72 72 20 3a 3d | 20 65 72 72 3b 0d 09 09 |t_err :=| err;...|
|00002810| 09 09 09 65 6e 64 3b 20 | 28 2a 20 69 66 20 2a 29 |...end; |(* if *)|
|00002820| 0d 09 09 09 09 65 6e 64 | 3b 0d 09 09 09 09 77 69 |.....end|;.....wi|
|00002830| 6e 64 6f 77 69 6e 66 6f | 5b 77 74 5d 2e 69 74 65 |ndowinfo|[wt].ite|
|00002840| 6d 73 5b 69 5d 20 3a 3d | 20 6e 69 6c 3b 0d 09 09 |ms[i] :=| nil;...|
|00002850| 09 09 44 69 73 70 6f 73 | 65 50 74 72 28 50 74 72 |..Dispos|ePtr(Ptr|
|00002860| 28 77 68 61 74 29 29 3b | 0d 09 09 09 65 6e 64 3b |(what));|....end;|
|00002870| 20 28 2a 20 69 66 20 2a | 29 0d 09 09 65 6e 64 3b | (* if *|)...end;|
|00002880| 0d 09 09 77 69 6e 64 6f | 77 69 6e 66 6f 5b 77 74 |...windo|winfo[wt|
|00002890| 5d 2e 77 69 6e 64 6f 77 | 20 3a 3d 20 6e 69 6c 3b |].window| := nil;|
|000028a0| 0d 09 09 44 69 73 70 6f | 73 65 44 69 61 6c 6f 67 |...Dispo|seDialog|
|000028b0| 28 77 70 29 3b 0d 09 09 | 44 69 73 70 6f 73 65 57 |(wp);...|DisposeW|
|000028c0| 69 6e 64 6f 77 54 79 70 | 65 20 3a 3d 20 66 69 72 |indowTyp|e := fir|
|000028d0| 73 74 5f 65 72 72 3b 0d | 09 65 6e 64 3b 20 28 2a |st_err;.|.end; (*|
|000028e0| 20 44 69 73 70 6f 73 65 | 57 69 6e 64 6f 77 54 79 | Dispose|WindowTy|
|000028f0| 70 65 20 2a 29 0d 0d 09 | 66 75 6e 63 74 69 6f 6e |pe *)...|function|
|00002900| 20 43 6c 6f 73 65 57 69 | 6e 64 6f 77 54 79 70 65 | CloseWi|ndowType|
|00002910| 20 28 77 70 3a 20 57 69 | 6e 64 6f 77 50 74 72 3b | (wp: Wi|ndowPtr;|
|00002920| 20 77 74 3a 20 57 69 6e | 64 6f 77 54 79 70 65 29 | wt: Win|dowType)|
|00002930| 3a 20 4f 53 45 72 72 3b | 0d 09 09 76 61 72 0d 09 |: OSErr;|...var..|
|00002940| 09 09 65 72 72 3a 20 4f | 53 45 72 72 3b 0d 09 09 |..err: O|SErr;...|
|00002950| 09 65 72 72 32 3a 20 4f | 53 45 72 72 3b 0d 09 09 |.err2: O|SErr;...|
|00002960| 09 6f 70 65 6e 65 64 3a | 20 62 6f 6f 6c 65 61 6e |.opened:| boolean|
|00002970| 3b 0d 09 62 65 67 69 6e | 0d 09 09 6f 70 65 6e 65 |;..begin|...opene|
|00002980| 64 20 3a 3d 20 66 61 6c | 73 65 3b 0d 09 09 65 72 |d := fal|se;...er|
|00002990| 72 20 3a 3d 20 49 43 4d | 61 70 45 72 72 28 49 43 |r := ICM|apErr(IC|
|000029a0| 42 65 67 69 6e 28 47 65 | 74 49 6e 73 74 61 6e 63 |Begin(Ge|tInstanc|
|000029b0| 65 2c 20 69 63 52 65 61 | 64 57 72 69 74 65 50 65 |e, icRea|dWritePe|
|000029c0| 72 6d 29 29 3b 0d 09 09 | 69 66 20 65 72 72 20 3d |rm));...|if err =|
|000029d0| 20 6e 6f 45 72 72 20 74 | 68 65 6e 20 62 65 67 69 | noErr t|hen begi|
|000029e0| 6e 0d 09 09 09 6f 70 65 | 6e 65 64 20 3a 3d 20 74 |n....ope|ned := t|
|000029f0| 72 75 65 3b 0d 09 09 09 | 65 72 72 20 3a 3d 20 46 |rue;....|err := F|
|00002a00| 6c 75 73 68 57 69 6e 64 | 6f 77 54 79 70 65 28 77 |lushWind|owType(w|
|00002a10| 70 2c 20 77 74 29 3b 0d | 09 09 65 6e 64 3b 20 28 |p, wt);.|..end; (|
|00002a20| 2a 20 69 66 20 2a 29 0d | 09 09 65 72 72 32 20 3a |* if *).|..err2 :|
|00002a30| 3d 20 44 69 73 70 6f 73 | 65 57 69 6e 64 6f 77 54 |= Dispos|eWindowT|
|00002a40| 79 70 65 28 77 70 2c 20 | 77 74 29 3b 0d 09 09 69 |ype(wp, |wt);...i|
|00002a50| 66 20 65 72 72 20 3d 20 | 6e 6f 45 72 72 20 74 68 |f err = |noErr th|
|00002a60| 65 6e 20 62 65 67 69 6e | 0d 09 09 09 65 72 72 20 |en begin|....err |
|00002a70| 3a 3d 20 65 72 72 32 3b | 0d 09 09 65 6e 64 3b 20 |:= err2;|...end; |
|00002a80| 28 2a 20 69 66 20 2a 29 | 0d 09 09 69 66 20 6f 70 |(* if *)|...if op|
|00002a90| 65 6e 65 64 20 74 68 65 | 6e 20 62 65 67 69 6e 0d |ened the|n begin.|
|00002aa0| 09 09 09 65 72 72 32 20 | 3a 3d 20 49 43 4d 61 70 |...err2 |:= ICMap|
|00002ab0| 45 72 72 28 49 43 45 6e | 64 28 47 65 74 49 6e 73 |Err(ICEn|d(GetIns|
|00002ac0| 74 61 6e 63 65 29 29 3b | 0d 09 09 09 69 66 20 65 |tance));|....if e|
|00002ad0| 72 72 20 3d 20 6e 6f 45 | 72 72 20 74 68 65 6e 20 |rr = noE|rr then |
|00002ae0| 62 65 67 69 6e 0d 09 09 | 09 09 65 72 72 20 3a 3d |begin...|..err :=|
|00002af0| 20 65 72 72 32 3b 0d 09 | 09 09 65 6e 64 3b 20 28 | err2;..|..end; (|
|00002b00| 2a 20 69 66 20 2a 29 0d | 09 09 65 6e 64 3b 20 28 |* if *).|..end; (|
|00002b10| 2a 20 69 66 20 2a 29 0d | 09 09 43 6c 6f 73 65 57 |* if *).|..CloseW|
|00002b20| 69 6e 64 6f 77 54 79 70 | 65 20 3a 3d 20 65 72 72 |indowTyp|e := err|
|00002b30| 3b 0d 09 65 6e 64 3b 20 | 28 2a 20 43 6c 6f 73 65 |;..end; |(* Close|
|00002b40| 57 69 6e 64 6f 77 54 79 | 70 65 20 2a 29 0d 0d 09 |WindowTy|pe *)...|
|00002b50| 66 75 6e 63 74 69 6f 6e | 20 57 69 6e 64 6f 77 73 |function| Windows|
|00002b60| 45 61 72 6c 79 48 61 6e | 64 6c 65 45 76 65 6e 74 |EarlyHan|dleEvent|
|00002b70| 20 28 65 72 3a 20 45 76 | 65 6e 74 52 65 63 6f 72 | (er: Ev|entRecor|
|00002b80| 64 29 3a 20 62 6f 6f 6c | 65 61 6e 3b 0d 09 62 65 |d): bool|ean;..be|
|00002b90| 67 69 6e 0d 09 09 57 69 | 6e 64 6f 77 73 45 61 72 |gin...Wi|ndowsEar|
|00002ba0| 6c 79 48 61 6e 64 6c 65 | 45 76 65 6e 74 20 3a 3d |lyHandle|Event :=|
|00002bb0| 20 66 61 6c 73 65 3b 0d | 09 09 69 66 20 47 65 74 | false;.|..if Get|
|00002bc0| 57 69 6e 64 6f 77 54 79 | 70 65 28 46 72 6f 6e 74 |WindowTy|pe(Front|
|00002bd0| 57 69 6e 64 6f 77 29 20 | 3c 3e 20 57 54 5f 4e 6f |Window) |<> WT_No|
|00002be0| 6e 65 20 74 68 65 6e 20 | 62 65 67 69 6e 0d 09 09 |ne then |begin...|
|00002bf0| 09 57 69 6e 64 6f 77 73 | 45 61 72 6c 79 48 61 6e |.Windows|EarlyHan|
|00002c00| 64 6c 65 45 76 65 6e 74 | 20 3a 3d 20 57 69 6e 64 |dleEvent| := Wind|
|00002c10| 6f 77 45 61 72 6c 79 48 | 61 6e 64 6c 65 45 76 65 |owEarlyH|andleEve|
|00002c20| 6e 74 28 46 72 6f 6e 74 | 57 69 6e 64 6f 77 2c 20 |nt(Front|Window, |
|00002c30| 65 72 29 3b 0d 09 09 65 | 6e 64 3b 0d 09 65 6e 64 |er);...e|nd;..end|
|00002c40| 3b 0d 0d 09 66 75 6e 63 | 74 69 6f 6e 20 57 69 6e |;...func|tion Win|
|00002c50| 64 6f 77 73 45 61 72 6c | 79 48 61 6e 64 6c 65 4b |dowsEarl|yHandleK|
|00002c60| 65 79 20 28 65 72 3a 20 | 45 76 65 6e 74 52 65 63 |ey (er: |EventRec|
|00002c70| 6f 72 64 29 3a 20 62 6f | 6f 6c 65 61 6e 3b 0d 09 |ord): bo|olean;..|
|00002c80| 62 65 67 69 6e 0d 09 09 | 57 69 6e 64 6f 77 73 45 |begin...|WindowsE|
|00002c90| 61 72 6c 79 48 61 6e 64 | 6c 65 4b 65 79 20 3a 3d |arlyHand|leKey :=|
|00002ca0| 20 66 61 6c 73 65 3b 0d | 09 09 69 66 20 47 65 74 | false;.|..if Get|
|00002cb0| 57 69 6e 64 6f 77 54 79 | 70 65 28 46 72 6f 6e 74 |WindowTy|pe(Front|
|00002cc0| 57 69 6e 64 6f 77 29 20 | 3c 3e 20 57 54 5f 4e 6f |Window) |<> WT_No|
|00002cd0| 6e 65 20 74 68 65 6e 20 | 62 65 67 69 6e 0d 09 09 |ne then |begin...|
|00002ce0| 09 57 69 6e 64 6f 77 73 | 45 61 72 6c 79 48 61 6e |.Windows|EarlyHan|
|00002cf0| 64 6c 65 4b 65 79 20 3a | 3d 20 57 69 6e 64 6f 77 |dleKey :|= Window|
|00002d00| 45 61 72 6c 79 48 61 6e | 64 6c 65 4b 65 79 28 46 |EarlyHan|dleKey(F|
|00002d10| 72 6f 6e 74 57 69 6e 64 | 6f 77 2c 20 65 72 29 3b |rontWind|ow, er);|
|00002d20| 0d 09 09 65 6e 64 3b 0d | 09 65 6e 64 3b 0d 0d 09 |...end;.|.end;...|
|00002d30| 70 72 6f 63 65 64 75 72 | 65 20 57 69 6e 64 6f 77 |procedur|e Window|
|00002d40| 73 44 6f 4b 65 79 20 28 | 65 72 3a 20 45 76 65 6e |sDoKey (|er: Even|
|00002d50| 74 52 65 63 6f 72 64 29 | 3b 0d 09 62 65 67 69 6e |tRecord)|;..begin|
|00002d60| 0d 09 09 69 66 20 47 65 | 74 57 69 6e 64 6f 77 54 |...if Ge|tWindowT|
|00002d70| 79 70 65 28 46 72 6f 6e | 74 57 69 6e 64 6f 77 29 |ype(Fron|tWindow)|
|00002d80| 20 3c 3e 20 57 54 5f 4e | 6f 6e 65 20 74 68 65 6e | <> WT_N|one then|
|00002d90| 20 62 65 67 69 6e 0d 09 | 09 09 57 69 6e 64 6f 77 | begin..|..Window|
|00002da0| 44 6f 4b 65 79 28 46 72 | 6f 6e 74 57 69 6e 64 6f |DoKey(Fr|ontWindo|
|00002db0| 77 2c 20 65 72 29 3b 0d | 09 09 65 6e 64 3b 0d 09 |w, er);.|..end;..|
|00002dc0| 65 6e 64 3b 0d 0d 09 70 | 72 6f 63 65 64 75 72 65 |end;...p|rocedure|
|00002dd0| 20 57 69 6e 64 6f 77 73 | 49 64 6c 65 3b 0d 09 09 | Windows|Idle;...|
|00002de0| 76 61 72 0d 09 09 09 77 | 74 3a 20 57 69 6e 64 6f |var....w|t: Windo|
|00002df0| 77 54 79 70 65 3b 0d 09 | 62 65 67 69 6e 0d 09 09 |wType;..|begin...|
|00002e00| 66 6f 72 20 77 74 20 3a | 3d 20 57 54 5f 4e 6f 6e |for wt :|= WT_Non|
|00002e10| 65 20 74 6f 20 57 54 5f | 4c 61 73 74 20 64 6f 20 |e to WT_|Last do |
|00002e20| 62 65 67 69 6e 0d 09 09 | 09 69 66 20 77 69 6e 64 |begin...|.if wind|
|00002e30| 6f 77 69 6e 66 6f 5b 77 | 74 5d 2e 77 69 6e 64 6f |owinfo[w|t].windo|
|00002e40| 77 20 3c 3e 20 6e 69 6c | 20 74 68 65 6e 20 62 65 |w <> nil| then be|
|00002e50| 67 69 6e 0d 09 09 09 09 | 44 6f 57 69 6e 64 6f 77 |gin.....|DoWindow|
|00002e60| 49 64 6c 65 28 77 69 6e | 64 6f 77 69 6e 66 6f 5b |Idle(win|dowinfo[|
|00002e70| 77 74 5d 2e 77 69 6e 64 | 6f 77 29 3b 0d 09 09 09 |wt].wind|ow);....|
|00002e80| 65 6e 64 3b 0d 09 09 65 | 6e 64 3b 0d 09 65 6e 64 |end;...e|nd;..end|
|00002e90| 3b 0d 0d 09 70 72 6f 63 | 65 64 75 72 65 20 57 69 |;...proc|edure Wi|
|00002ea0| 6e 64 6f 77 73 53 65 74 | 54 69 74 6c 65 20 28 77 |ndowsSet|Title (w|
|00002eb0| 74 3a 20 57 69 6e 64 6f | 77 54 79 70 65 3b 20 74 |t: Windo|wType; t|
|00002ec0| 69 74 6c 65 3a 20 53 74 | 72 32 35 35 29 3b 0d 09 |itle: St|r255);..|
|00002ed0| 62 65 67 69 6e 0d 09 09 | 69 66 20 77 69 6e 64 6f |begin...|if windo|
|00002ee0| 77 69 6e 66 6f 5b 77 74 | 5d 2e 77 69 6e 64 6f 77 |winfo[wt|].window|
|00002ef0| 20 3c 3e 20 6e 69 6c 20 | 74 68 65 6e 20 62 65 67 | <> nil |then beg|
|00002f00| 69 6e 0d 09 09 09 53 65 | 74 57 54 69 74 6c 65 28 |in....Se|tWTitle(|
|00002f10| 77 69 6e 64 6f 77 69 6e | 66 6f 5b 77 74 5d 2e 77 |windowin|fo[wt].w|
|00002f20| 69 6e 64 6f 77 2c 20 74 | 69 74 6c 65 29 3b 0d 09 |indow, t|itle);..|
|00002f30| 09 65 6e 64 3b 20 28 2a | 20 69 66 20 2a 29 0d 09 |.end; (*| if *)..|
|00002f40| 65 6e 64 3b 20 28 2a 20 | 57 69 6e 64 6f 77 73 53 |end; (* |WindowsS|
|00002f50| 65 74 54 69 74 6c 65 20 | 2a 29 0d 0d 09 70 72 6f |etTitle |*)...pro|
|00002f60| 63 65 64 75 72 65 20 57 | 69 6e 64 6f 77 73 41 64 |cedure W|indowsAd|
|00002f70| 6a 75 73 74 4d 65 6e 75 | 73 3b 0d 09 09 76 61 72 |justMenu|s;...var|
|00002f80| 0d 09 09 09 77 74 3a 20 | 57 69 6e 64 6f 77 54 79 |....wt: |WindowTy|
|00002f90| 70 65 3b 0d 09 62 65 67 | 69 6e 0d 09 09 77 74 20 |pe;..beg|in...wt |
|00002fa0| 3a 3d 20 47 65 74 57 69 | 6e 64 6f 77 54 79 70 65 |:= GetWi|ndowType|
|00002fb0| 28 46 72 6f 6e 74 57 69 | 6e 64 6f 77 29 3b 0d 09 |(FrontWi|ndow);..|
|00002fc0| 09 41 64 6a 75 73 74 54 | 65 78 74 4d 65 6e 75 28 |.AdjustT|extMenu(|
|00002fd0| 77 74 29 3b 0d 09 65 6e | 64 3b 0d 0d 09 70 72 6f |wt);..en|d;...pro|
|00002fe0| 63 65 64 75 72 65 20 57 | 69 6e 64 6f 77 73 44 6f |cedure W|indowsDo|
|00002ff0| 45 64 69 74 4d 65 6e 75 | 20 28 69 74 65 6d 3a 20 |EditMenu| (item: |
|00003000| 69 6e 74 65 67 65 72 29 | 3b 0d 09 09 76 61 72 0d |integer)|;...var.|
|00003010| 09 09 09 77 74 3a 20 57 | 69 6e 64 6f 77 54 79 70 |...wt: W|indowTyp|
|00003020| 65 3b 0d 09 62 65 67 69 | 6e 0d 09 09 77 74 20 3a |e;..begi|n...wt :|
|00003030| 3d 20 47 65 74 57 69 6e | 64 6f 77 54 79 70 65 28 |= GetWin|dowType(|
|00003040| 46 72 6f 6e 74 57 69 6e | 64 6f 77 29 3b 0d 09 09 |FrontWin|dow);...|
|00003050| 69 66 20 77 74 20 3c 3e | 20 57 54 5f 4e 6f 6e 65 |if wt <>| WT_None|
|00003060| 20 74 68 65 6e 20 62 65 | 67 69 6e 0d 09 09 09 44 | then be|gin....D|
|00003070| 6f 54 65 78 74 4d 65 6e | 75 28 77 74 2c 20 69 74 |oTextMen|u(wt, it|
|00003080| 65 6d 29 3b 0d 09 09 65 | 6e 64 3b 20 28 2a 20 69 |em);...e|nd; (* i|
|00003090| 66 20 2a 29 0d 09 65 6e | 64 3b 0d 0d 09 74 79 70 |f *)..en|d;...typ|
|000030a0| 65 0d 09 09 57 68 61 74 | 54 65 6d 70 6c 61 74 65 |e...What|Template|
|000030b0| 52 65 63 6f 72 64 20 3d | 20 72 65 63 6f 72 64 0d |Record =| record.|
|000030c0| 09 09 09 09 6b 65 79 3a | 20 73 74 72 33 31 3b 0d |....key:| str31;.|
|000030d0| 09 09 09 09 74 79 70 3a | 20 4f 53 54 79 70 65 3b |....typ:| OSType;|
|000030e0| 0d 09 09 09 09 66 6c 61 | 67 73 3a 20 6c 6f 6e 67 |.....fla|gs: long|
|000030f0| 49 6e 74 3b 0d 09 09 09 | 65 6e 64 3b 0d 09 09 57 |Int;....|end;...W|
|00003100| 68 61 74 54 65 6d 70 6c | 61 74 65 41 72 72 61 79 |hatTempl|ateArray|
|00003110| 20 3d 20 61 72 72 61 79 | 5b 31 2e 2e 69 74 65 6d | = array|[1..item|
|00003120| 5f 6d 61 78 5d 20 6f 66 | 20 57 68 61 74 54 65 6d |_max] of| WhatTem|
|00003130| 70 6c 61 74 65 52 65 63 | 6f 72 64 3b 0d 09 09 57 |plateRec|ord;...W|
|00003140| 68 61 74 54 65 6d 70 6c | 61 74 65 41 72 72 61 79 |hatTempl|ateArray|
|00003150| 50 74 72 20 3d 20 5e 57 | 68 61 74 54 65 6d 70 6c |Ptr = ^W|hatTempl|
|00003160| 61 74 65 41 72 72 61 79 | 3b 0d 09 09 57 68 61 74 |ateArray|;...What|
|00003170| 54 65 6d 70 6c 61 74 65 | 41 72 72 61 79 48 61 6e |Template|ArrayHan|
|00003180| 64 6c 65 20 3d 20 5e 57 | 68 61 74 54 65 6d 70 6c |dle = ^W|hatTempl|
|00003190| 61 74 65 41 72 72 61 79 | 50 74 72 3b 0d 0d 09 66 |ateArray|Ptr;...f|
|000031a0| 75 6e 63 74 69 6f 6e 20 | 50 61 72 73 65 57 68 61 |unction |ParseWha|
|000031b0| 74 20 28 77 74 3a 20 57 | 69 6e 64 6f 77 54 79 70 |t (wt: W|indowTyp|
|000031c0| 65 29 3a 20 4f 53 45 72 | 72 3b 0d 09 09 76 61 72 |e): OSEr|r;...var|
|000031d0| 0d 09 09 09 77 68 61 74 | 3a 20 57 68 61 74 54 65 |....what|: WhatTe|
|000031e0| 6d 70 6c 61 74 65 41 72 | 72 61 79 48 61 6e 64 6c |mplateAr|rayHandl|
|000031f0| 65 3b 0d 09 09 09 69 3a | 20 69 6e 74 65 67 65 72 |e;....i:| integer|
|00003200| 3b 0d 09 09 09 65 72 72 | 3a 20 4f 53 45 72 72 3b |;....err|: OSErr;|
|00003210| 0d 09 62 65 67 69 6e 0d | 09 09 65 72 72 20 3a 3d |..begin.|..err :=|
|00003220| 20 6e 6f 45 72 72 3b 0d | 09 09 66 6f 72 20 69 20 | noErr;.|..for i |
|00003230| 3a 3d 20 31 20 74 6f 20 | 69 74 65 6d 5f 6d 61 78 |:= 1 to |item_max|
|00003240| 20 64 6f 20 62 65 67 69 | 6e 0d 09 09 09 77 69 6e | do begi|n....win|
|00003250| 64 6f 77 69 6e 66 6f 5b | 77 74 5d 2e 69 74 65 6d |dowinfo[|wt].item|
|00003260| 73 5b 69 5d 20 3a 3d 20 | 6e 69 6c 3b 0d 09 09 65 |s[i] := |nil;...e|
|00003270| 6e 64 3b 0d 09 09 77 68 | 61 74 20 3a 3d 20 57 68 |nd;...wh|at := Wh|
|00003280| 61 74 54 65 6d 70 6c 61 | 74 65 41 72 72 61 79 48 |atTempla|teArrayH|
|00003290| 61 6e 64 6c 65 28 47 65 | 74 52 65 73 6f 75 72 63 |andle(Ge|tResourc|
|000032a0| 65 28 27 57 48 41 54 27 | 2c 20 77 69 6e 64 6f 77 |e('WHAT'|, window|
|000032b0| 69 6e 66 6f 5b 77 74 5d | 2e 69 64 29 29 3b 0d 09 |info[wt]|.id));..|
|000032c0| 09 69 66 20 77 68 61 74 | 20 3c 3e 20 6e 69 6c 20 |.if what| <> nil |
|000032d0| 74 68 65 6e 20 62 65 67 | 69 6e 0d 09 09 09 48 4c |then beg|in....HL|
|000032e0| 6f 63 6b 28 68 61 6e 64 | 6c 65 28 77 68 61 74 29 |ock(hand|le(what)|
|000032f0| 29 3b 0d 09 09 09 66 6f | 72 20 69 20 3a 3d 20 31 |);....fo|r i := 1|
|00003300| 20 74 6f 20 47 65 74 48 | 61 6e 64 6c 65 53 69 7a | to GetH|andleSiz|
|00003310| 65 28 68 61 6e 64 6c 65 | 28 77 68 61 74 29 29 20 |e(handle|(what)) |
|00003320| 64 69 76 20 53 69 7a 65 | 4f 66 28 57 68 61 74 54 |div Size|Of(WhatT|
|00003330| 65 6d 70 6c 61 74 65 52 | 65 63 6f 72 64 29 20 64 |emplateR|ecord) d|
|00003340| 6f 20 62 65 67 69 6e 0d | 09 09 09 09 69 66 20 77 |o begin.|....if w|
|00003350| 68 61 74 5e 5e 5b 69 5d | 2e 74 79 70 20 3c 3e 20 |hat^^[i]|.typ <> |
|00003360| 27 4e 55 4c 4c 27 20 74 | 68 65 6e 20 62 65 67 69 |'NULL' t|hen begi|
|00003370| 6e 0d 09 09 09 09 09 77 | 69 6e 64 6f 77 69 6e 66 |n......w|indowinf|
|00003380| 6f 5b 77 74 5d 2e 69 74 | 65 6d 73 5b 69 5d 20 3a |o[wt].it|ems[i] :|
|00003390| 3d 20 57 68 61 74 52 65 | 63 6f 72 64 50 74 72 28 |= WhatRe|cordPtr(|
|000033a0| 4e 65 77 50 74 72 28 53 | 69 7a 65 4f 66 28 57 68 |NewPtr(S|izeOf(Wh|
|000033b0| 61 74 52 65 63 6f 72 64 | 29 29 29 3b 0d 09 09 09 |atRecord|)));....|
|000033c0| 09 09 65 72 72 20 3a 3d | 20 4d 65 6d 45 72 72 6f |..err :=| MemErro|
|000033d0| 72 3b 0d 09 09 09 09 09 | 69 66 20 65 72 72 20 3c |r;......|if err <|
|000033e0| 3e 20 6e 6f 45 72 72 20 | 74 68 65 6e 20 62 65 67 |> noErr |then beg|
|000033f0| 69 6e 0d 09 09 09 09 09 | 09 6c 65 61 76 65 3b 0d |in......|.leave;.|
|00003400| 09 09 09 09 09 65 6e 64 | 3b 20 28 2a 20 69 66 20 |.....end|; (* if |
|00003410| 2a 29 0d 09 09 09 09 09 | 77 69 74 68 20 77 69 6e |*)......|with win|
|00003420| 64 6f 77 69 6e 66 6f 5b | 77 74 5d 2e 69 74 65 6d |dowinfo[|wt].item|
|00003430| 73 5b 69 5d 5e 20 64 6f | 20 62 65 67 69 6e 0d 09 |s[i]^ do| begin..|
|00003440| 09 09 09 09 09 6b 65 79 | 20 3a 3d 20 77 68 61 74 |.....key| := what|
|00003450| 5e 5e 5b 69 5d 2e 6b 65 | 79 3b 0d 09 09 09 09 09 |^^[i].ke|y;......|
|00003460| 09 74 79 70 20 3a 3d 20 | 77 68 61 74 5e 5e 5b 69 |.typ := |what^^[i|
|00003470| 5d 2e 74 79 70 3b 0d 09 | 09 09 09 09 09 66 6c 61 |].typ;..|.....fla|
|00003480| 67 73 20 3a 3d 20 77 68 | 61 74 5e 5e 5b 69 5d 2e |gs := wh|at^^[i].|
|00003490| 66 6c 61 67 73 3b 0d 09 | 09 09 09 09 65 6e 64 3b |flags;..|....end;|
|000034a0| 20 28 2a 20 77 69 74 68 | 20 2a 29 0d 09 09 09 09 | (* with| *).....|
|000034b0| 65 6e 64 3b 20 28 2a 20 | 69 66 20 2a 29 0d 09 09 |end; (* |if *)...|
|000034c0| 09 65 6e 64 3b 20 28 2a | 20 66 6f 72 20 2a 29 0d |.end; (*| for *).|
|000034d0| 09 09 09 48 55 6e 6c 6f | 63 6b 28 68 61 6e 64 6c |...HUnlo|ck(handl|
|000034e0| 65 28 77 68 61 74 29 29 | 3b 0d 09 09 65 6e 64 3b |e(what))|;...end;|
|000034f0| 20 28 2a 20 69 66 20 2a | 29 0d 09 09 50 61 72 73 | (* if *|)...Pars|
|00003500| 65 57 68 61 74 20 3a 3d | 20 65 72 72 3b 0d 09 65 |eWhat :=| err;..e|
|00003510| 6e 64 3b 20 28 2a 20 50 | 61 72 73 65 57 68 61 74 |nd; (* P|arseWhat|
|00003520| 20 2a 29 0d 0d 09 66 75 | 6e 63 74 69 6f 6e 20 47 | *)...fu|nction G|
|00003530| 65 74 57 69 6e 64 6f 77 | 49 44 20 28 77 74 3a 20 |etWindow|ID (wt: |
|00003540| 57 69 6e 64 6f 77 54 79 | 70 65 29 3a 20 69 6e 74 |WindowTy|pe): int|
|00003550| 65 67 65 72 3b 0d 09 62 | 65 67 69 6e 0d 09 09 69 |eger;..b|egin...i|
|00003560| 66 20 77 74 20 3d 20 57 | 54 5f 41 62 6f 75 74 20 |f wt = W|T_About |
|00003570| 74 68 65 6e 20 62 65 67 | 69 6e 0d 09 09 09 47 65 |then beg|in....Ge|
|00003580| 74 57 69 6e 64 6f 77 49 | 44 20 3a 3d 20 31 32 38 |tWindowI|D := 128|
|00003590| 3b 0d 09 09 65 6e 64 20 | 65 6c 73 65 20 62 65 67 |;...end |else beg|
|000035a0| 69 6e 0d 09 09 09 47 65 | 74 57 69 6e 64 6f 77 49 |in....Ge|tWindowI|
|000035b0| 44 20 3a 3d 20 32 30 30 | 20 2b 20 6f 72 64 28 77 |D := 200| + ord(w|
|000035c0| 74 29 20 2d 20 6f 72 64 | 28 57 54 5f 4d 61 69 6e |t) - ord|(WT_Main|
|000035d0| 29 3b 0d 09 09 65 6e 64 | 3b 0d 09 65 6e 64 3b 0d |);...end|;..end;.|
|000035e0| 0d 09 66 75 6e 63 74 69 | 6f 6e 20 49 73 50 72 65 |..functi|on IsPre|
|000035f0| 66 69 78 28 76 61 72 20 | 73 3a 53 74 72 32 35 35 |fix(var |s:Str255|
|00003600| 3b 20 6b 65 79 3a 53 74 | 72 32 35 35 29 3a 42 6f |; key:St|r255):Bo|
|00003610| 6f 6c 65 61 6e 3b 0d 09 | 62 65 67 69 6e 0d 09 09 |olean;..|begin...|
|00003620| 49 73 50 72 65 66 69 78 | 20 3a 3d 20 66 61 6c 73 |IsPrefix| := fals|
|00003630| 65 3b 0d 09 09 69 66 20 | 49 55 45 71 75 61 6c 53 |e;...if |IUEqualS|
|00003640| 74 72 69 6e 67 28 54 50 | 43 6f 70 79 28 73 2c 20 |tring(TP|Copy(s, |
|00003650| 31 2c 20 6c 65 6e 67 74 | 68 28 6b 65 79 29 29 2c |1, lengt|h(key)),|
|00003660| 6b 65 79 29 20 3d 20 30 | 20 74 68 65 6e 20 62 65 |key) = 0| then be|
|00003670| 67 69 6e 0d 09 09 09 73 | 20 3a 3d 20 54 50 43 6f |gin....s| := TPCo|
|00003680| 70 79 28 73 2c 20 6c 65 | 6e 67 74 68 28 6b 65 79 |py(s, le|ngth(key|
|00003690| 29 2b 31 2c 20 32 35 35 | 29 3b 0d 09 09 09 49 73 |)+1, 255|);....Is|
|000036a0| 50 72 65 66 69 78 20 3a | 3d 20 74 72 75 65 3b 0d |Prefix :|= true;.|
|000036b0| 09 09 65 6e 64 3b 0d 09 | 65 6e 64 3b 0d 09 0d 09 |..end;..|end;....|
|000036c0| 66 75 6e 63 74 69 6f 6e | 20 45 64 69 74 43 75 72 |function| EditCur|
|000036d0| 72 65 6e 74 50 72 65 66 | 65 72 65 6e 63 65 20 28 |rentPref|erence (|
|000036e0| 76 61 72 20 6b 65 79 3a | 20 53 74 72 32 35 35 29 |var key:| Str255)|
|000036f0| 3a 20 4f 53 45 72 72 3b | 0d 09 09 76 61 72 0d 09 |: OSErr;|...var..|
|00003700| 09 09 77 74 3a 20 57 69 | 6e 64 6f 77 54 79 70 65 |..wt: Wi|ndowType|
|00003710| 3b 0d 09 09 09 77 68 61 | 74 3a 20 57 68 61 74 54 |;....wha|t: WhatT|
|00003720| 65 6d 70 6c 61 74 65 41 | 72 72 61 79 48 61 6e 64 |emplateA|rrayHand|
|00003730| 6c 65 3b 0d 09 09 09 65 | 72 72 3a 20 4f 53 45 72 |le;....e|rr: OSEr|
|00003740| 72 3b 0d 09 09 09 69 3a | 20 69 6e 74 65 67 65 72 |r;....i:| integer|
|00003750| 3b 0d 09 09 09 69 64 3a | 20 69 6e 74 65 67 65 72 |;....id:| integer|
|00003760| 3b 0d 09 62 65 67 69 6e | 0d 09 09 65 72 72 20 3a |;..begin|...err :|
|00003770| 3d 20 2d 31 3b 0d 09 09 | 69 66 20 49 73 50 72 65 |= -1;...|if IsPre|
|00003780| 66 69 78 28 6b 65 79 2c | 20 63 6f 6e 63 61 74 28 |fix(key,| concat(|
|00003790| 6b 49 43 4d 61 70 70 69 | 6e 67 2c 27 a5 27 29 29 |kICMappi|ng,'.'))|
|000037a0| 20 74 68 65 6e 20 62 65 | 67 69 6e 0d 09 09 09 65 | then be|gin....e|
|000037b0| 72 72 20 3a 3d 20 57 69 | 6e 64 6f 77 73 4f 70 65 |rr := Wi|ndowsOpe|
|000037c0| 6e 28 57 54 5f 46 69 6c | 65 4d 61 70 70 69 6e 67 |n(WT_Fil|eMapping|
|000037d0| 29 3b 0d 09 09 09 69 66 | 20 65 72 72 20 3d 20 6e |);....if| err = n|
|000037e0| 6f 45 72 72 20 74 68 65 | 6e 20 62 65 67 69 6e 0d |oErr the|n begin.|
|000037f0| 09 09 09 09 4d 61 70 70 | 69 6e 67 53 65 74 53 65 |....Mapp|ingSetSe|
|00003800| 6c 65 63 74 69 6f 6e 28 | 6b 65 79 29 3b 0d 09 09 |lection(|key);...|
|00003810| 09 65 6e 64 3b 0d 09 09 | 65 6e 64 20 65 6c 73 65 |.end;...|end else|
|00003820| 20 69 66 20 49 73 50 72 | 65 66 69 78 28 6b 65 79 | if IsPr|efix(key|
|00003830| 2c 20 6b 49 43 48 65 6c | 70 65 72 29 20 74 68 65 |, kICHel|per) the|
|00003840| 6e 20 62 65 67 69 6e 0d | 09 09 09 65 72 72 20 3a |n begin.|...err :|
|00003850| 3d 20 57 69 6e 64 6f 77 | 73 4f 70 65 6e 28 57 54 |= Window|sOpen(WT|
|00003860| 5f 48 65 6c 70 65 72 29 | 3b 0d 09 09 09 69 66 20 |_Helper)|;....if |
|00003870| 65 72 72 20 3d 20 6e 6f | 45 72 72 20 74 68 65 6e |err = no|Err then|
|00003880| 20 62 65 67 69 6e 0d 09 | 09 09 09 48 65 6c 70 65 | begin..|...Helpe|
|00003890| 72 53 65 74 53 65 6c 65 | 63 74 69 6f 6e 28 6b 65 |rSetSele|ction(ke|
|000038a0| 79 29 3b 0d 09 09 09 65 | 6e 64 3b 0d 09 09 65 6e |y);....e|nd;...en|
|000038b0| 64 20 65 6c 73 65 20 62 | 65 67 69 6e 0d 09 09 09 |d else b|egin....|
|000038c0| 66 6f 72 20 77 74 20 3a | 3d 20 57 54 5f 4e 6f 6e |for wt :|= WT_Non|
|000038d0| 65 20 74 6f 20 57 54 5f | 4c 61 73 74 20 64 6f 20 |e to WT_|Last do |
|000038e0| 62 65 67 69 6e 0d 09 09 | 09 09 69 66 20 28 57 54 |begin...|..if (WT|
|000038f0| 5f 50 65 72 73 6f 6e 61 | 6c 20 3c 3d 20 77 74 29 |_Persona|l <= wt)|
|00003900| 20 26 20 28 77 74 20 3c | 3d 20 57 54 5f 4c 61 73 | & (wt <|= WT_Las|
|00003910| 74 29 20 74 68 65 6e 20 | 62 65 67 69 6e 0d 09 09 |t) then |begin...|
|00003920| 09 09 09 69 64 20 3a 3d | 20 47 65 74 57 69 6e 64 |...id :=| GetWind|
|00003930| 6f 77 49 44 28 77 74 29 | 3b 0d 09 09 09 09 09 77 |owID(wt)|;......w|
|00003940| 68 61 74 20 3a 3d 20 57 | 68 61 74 54 65 6d 70 6c |hat := W|hatTempl|
|00003950| 61 74 65 41 72 72 61 79 | 48 61 6e 64 6c 65 28 47 |ateArray|Handle(G|
|00003960| 65 74 52 65 73 6f 75 72 | 63 65 28 27 57 48 41 54 |etResour|ce('WHAT|
|00003970| 27 2c 20 69 64 29 29 3b | 0d 09 09 09 09 09 69 66 |', id));|......if|
|00003980| 20 77 68 61 74 20 3c 3e | 20 6e 69 6c 20 74 68 65 | what <>| nil the|
|00003990| 6e 20 62 65 67 69 6e 0d | 09 09 09 09 09 09 48 4c |n begin.|......HL|
|000039a0| 6f 63 6b 28 68 61 6e 64 | 6c 65 28 77 68 61 74 29 |ock(hand|le(what)|
|000039b0| 29 3b 0d 09 09 09 09 09 | 09 66 6f 72 20 69 20 3a |);......|.for i :|
|000039c0| 3d 20 31 20 74 6f 20 47 | 65 74 48 61 6e 64 6c 65 |= 1 to G|etHandle|
|000039d0| 53 69 7a 65 28 68 61 6e | 64 6c 65 28 77 68 61 74 |Size(han|dle(what|
|000039e0| 29 29 20 64 69 76 20 53 | 69 7a 65 4f 66 28 57 68 |)) div S|izeOf(Wh|
|000039f0| 61 74 54 65 6d 70 6c 61 | 74 65 52 65 63 6f 72 64 |atTempla|teRecord|
|00003a00| 29 20 64 6f 20 62 65 67 | 69 6e 0d 09 09 09 09 09 |) do beg|in......|
|00003a10| 09 09 69 66 20 49 55 45 | 71 75 61 6c 53 74 72 69 |..if IUE|qualStri|
|00003a20| 6e 67 28 6b 65 79 2c 20 | 77 68 61 74 5e 5e 5b 69 |ng(key, |what^^[i|
|00003a30| 5d 2e 6b 65 79 29 20 3d | 20 30 20 74 68 65 6e 20 |].key) =| 0 then |
|00003a40| 62 65 67 69 6e 0d 09 09 | 09 09 09 09 09 09 65 72 |begin...|......er|
|00003a50| 72 20 3a 3d 20 57 69 6e | 64 6f 77 73 4f 70 65 6e |r := Win|dowsOpen|
|00003a60| 28 77 74 29 3b 0d 09 09 | 09 09 09 09 09 09 69 66 |(wt);...|......if|
|00003a70| 20 28 77 68 61 74 5e 5e | 5b 69 5d 2e 74 79 70 20 | (what^^|[i].typ |
|00003a80| 3d 20 27 54 45 58 54 27 | 29 20 74 68 65 6e 20 62 |= 'TEXT'|) then b|
|00003a90| 65 67 69 6e 0d 09 09 09 | 09 09 09 09 09 09 53 65 |egin....|......Se|
|00003aa0| 6c 65 63 74 54 65 78 74 | 49 74 65 6d 28 77 74 2c |lectText|Item(wt,|
|00003ab0| 20 69 29 3b 0d 09 09 09 | 09 09 09 09 09 65 6e 64 | i);....|.....end|
|00003ac0| 3b 0d 09 09 09 09 09 09 | 09 65 6e 64 3b 0d 09 09 |;.......|.end;...|
|00003ad0| 09 09 09 09 65 6e 64 3b | 0d 09 09 09 09 09 09 48 |....end;|.......H|
|00003ae0| 55 6e 6c 6f 63 6b 28 68 | 61 6e 64 6c 65 28 77 68 |Unlock(h|andle(wh|
|00003af0| 61 74 29 29 3b 0d 09 09 | 09 09 09 65 6e 64 3b 0d |at));...|...end;.|
|00003b00| 09 09 09 09 65 6e 64 3b | 0d 09 09 09 65 6e 64 3b |....end;|....end;|
|00003b10| 0d 09 09 65 6e 64 3b 0d | 09 09 45 64 69 74 43 75 |...end;.|..EditCu|
|00003b20| 72 72 65 6e 74 50 72 65 | 66 65 72 65 6e 63 65 20 |rrentPre|ference |
|00003b30| 3a 3d 20 65 72 72 3b 0d | 09 65 6e 64 3b 0d 0d 09 |:= err;.|.end;...|
|00003b40| 66 75 6e 63 74 69 6f 6e | 20 50 72 65 70 57 69 6e |function| PrepWin|
|00003b50| 64 6f 77 20 28 77 74 3a | 20 57 69 6e 64 6f 77 54 |dow (wt:| WindowT|
|00003b60| 79 70 65 3b 20 69 64 3a | 20 69 6e 74 65 67 65 72 |ype; id:| integer|
|00003b70| 3b 20 77 70 3a 20 57 69 | 6e 64 6f 77 50 74 72 29 |; wp: Wi|ndowPtr)|
|00003b80| 3a 20 4f 53 45 72 72 3b | 0d 09 09 76 61 72 0d 09 |: OSErr;|...var..|
|00003b90| 09 09 77 68 61 74 2c 20 | 69 3a 20 69 6e 74 65 67 |..what, |i: integ|
|00003ba0| 65 72 3b 0d 09 09 09 65 | 72 72 3a 20 4f 53 45 72 |er;....e|rr: OSEr|
|00003bb0| 72 3b 0d 09 09 09 66 69 | 72 73 74 5f 65 72 72 3a |r;....fi|rst_err:|
|00003bc0| 20 4f 53 45 72 72 3b 0d | 09 62 65 67 69 6e 0d 09 | OSErr;.|.begin..|
|00003bd0| 09 53 65 74 50 6f 72 74 | 28 77 70 29 3b 0d 09 09 |.SetPort|(wp);...|
|00003be0| 77 69 6e 64 6f 77 69 6e | 66 6f 5b 77 74 5d 2e 77 |windowin|fo[wt].w|
|00003bf0| 69 6e 64 6f 77 20 3a 3d | 20 77 70 3b 0d 09 09 77 |indow :=| wp;...w|
|00003c00| 69 6e 64 6f 77 69 6e 66 | 6f 5b 77 74 5d 2e 69 64 |indowinf|o[wt].id|
|00003c10| 20 3a 3d 20 69 64 3b 0d | 09 09 77 69 6e 64 6f 77 | := id;.|..window|
|00003c20| 69 6e 66 6f 5b 77 74 5d | 2e 73 65 6c 65 63 74 65 |info[wt]|.selecte|
|00003c30| 64 5f 69 74 65 6d 20 3a | 3d 20 2d 31 3b 0d 09 09 |d_item :|= -1;...|
|00003c40| 77 69 6e 64 6f 77 69 6e | 66 6f 5b 77 74 5d 2e 77 |windowin|fo[wt].w|
|00003c50| 69 6e 64 6f 77 5f 6b 65 | 79 5f 6e 65 65 64 73 5f |indow_ke|y_needs_|
|00003c60| 74 61 62 73 20 3a 3d 20 | 74 72 75 65 3b 0d 09 09 |tabs := |true;...|
|00003c70| 66 69 72 73 74 5f 65 72 | 72 20 3a 3d 20 50 61 72 |first_er|r := Par|
|00003c80| 73 65 57 68 61 74 28 77 | 74 29 3b 0d 09 09 69 66 |seWhat(w|t);...if|
|00003c90| 20 66 69 72 73 74 5f 65 | 72 72 20 3d 20 6e 6f 45 | first_e|rr = noE|
|00003ca0| 72 72 20 74 68 65 6e 20 | 62 65 67 69 6e 0d 09 09 |rr then |begin...|
|00003cb0| 09 66 6f 72 20 69 20 3a | 3d 20 31 20 74 6f 20 69 |.for i :|= 1 to i|
|00003cc0| 74 65 6d 5f 6d 61 78 20 | 64 6f 20 62 65 67 69 6e |tem_max |do begin|
|00003cd0| 0d 09 09 09 09 69 66 20 | 77 69 6e 64 6f 77 69 6e |.....if |windowin|
|00003ce0| 66 6f 5b 77 74 5d 2e 69 | 74 65 6d 73 5b 69 5d 20 |fo[wt].i|tems[i] |
|00003cf0| 3c 3e 20 6e 69 6c 20 74 | 68 65 6e 20 62 65 67 69 |<> nil t|hen begi|
|00003d00| 6e 0d 09 09 09 09 09 77 | 69 74 68 20 77 69 6e 64 |n......w|ith wind|
|00003d10| 6f 77 69 6e 66 6f 5b 77 | 74 5d 2e 69 74 65 6d 73 |owinfo[w|t].items|
|00003d20| 5b 69 5d 5e 20 64 6f 20 | 62 65 67 69 6e 0d 09 09 |[i]^ do |begin...|
|00003d30| 09 09 09 09 69 66 20 74 | 79 70 20 3d 20 27 54 45 |....if t|yp = 'TE|
|00003d40| 58 54 27 20 74 68 65 6e | 20 62 65 67 69 6e 0d 09 |XT' then| begin..|
|00003d50| 09 09 09 09 09 09 77 69 | 6e 64 6f 77 69 6e 66 6f |......wi|ndowinfo|
|00003d60| 5b 77 74 5d 2e 77 69 6e | 64 6f 77 5f 6b 65 79 5f |[wt].win|dow_key_|
|00003d70| 6e 65 65 64 73 5f 74 61 | 62 73 20 3a 3d 20 66 61 |needs_ta|bs := fa|
|00003d80| 6c 73 65 3b 0d 09 09 09 | 09 09 09 65 6e 64 3b 0d |lse;....|...end;.|
|00003d90| 09 09 09 09 09 09 77 68 | 61 74 20 3a 3d 20 54 79 |......wh|at := Ty|
|00003da0| 70 65 54 6f 57 68 61 74 | 28 74 79 70 29 3b 0d 09 |peToWhat|(typ);..|
|00003db0| 09 09 09 09 09 69 66 20 | 77 68 61 74 69 6e 66 6f |.....if |whatinfo|
|00003dc0| 5b 77 68 61 74 5d 2e 6f | 70 65 6e 20 3c 3e 20 6e |[what].o|pen <> n|
|00003dd0| 69 6c 20 74 68 65 6e 20 | 62 65 67 69 6e 0d 09 09 |il then |begin...|
|00003de0| 09 09 09 09 09 65 72 72 | 20 3a 3d 20 43 61 6c 6c |.....err| := Call|
|00003df0| 57 68 61 74 4f 70 65 6e | 28 77 74 2c 20 69 2c 20 |WhatOpen|(wt, i, |
|00003e00| 77 68 61 74 69 6e 66 6f | 5b 77 68 61 74 5d 2e 6f |whatinfo|[what].o|
|00003e10| 70 65 6e 29 3b 0d 09 09 | 09 09 09 09 09 69 66 20 |pen);...|.....if |
|00003e20| 66 69 72 73 74 5f 65 72 | 72 20 3d 20 6e 6f 45 72 |first_er|r = noEr|
|00003e30| 72 20 74 68 65 6e 20 62 | 65 67 69 6e 0d 09 09 09 |r then b|egin....|
|00003e40| 09 09 09 09 09 66 69 72 | 73 74 5f 65 72 72 20 3a |.....fir|st_err :|
|00003e50| 3d 20 65 72 72 3b 0d 09 | 09 09 09 09 09 09 65 6e |= err;..|......en|
|00003e60| 64 3b 20 28 2a 20 69 66 | 20 2a 29 0d 09 09 09 09 |d; (* if| *).....|
|00003e70| 09 09 65 6e 64 3b 0d 09 | 09 09 09 09 65 6e 64 3b |..end;..|....end;|
|00003e80| 20 28 2a 20 77 69 74 68 | 20 2a 29 0d 09 09 09 09 | (* with| *).....|
|00003e90| 65 6e 64 3b 0d 09 09 09 | 65 6e 64 3b 20 28 2a 20 |end;....|end; (* |
|00003ea0| 66 6f 72 20 2a 29 0d 09 | 09 65 6e 64 3b 20 28 2a |for *)..|.end; (*|
|00003eb0| 20 69 66 20 2a 29 0d 09 | 09 69 66 20 66 69 72 73 | if *)..|.if firs|
|00003ec0| 74 5f 65 72 72 20 3d 20 | 6e 6f 45 72 72 20 74 68 |t_err = |noErr th|
|00003ed0| 65 6e 20 62 65 67 69 6e | 0d 09 09 09 69 66 20 77 |en begin|....if w|
|00003ee0| 69 6e 64 6f 77 69 6e 66 | 6f 5b 77 74 5d 2e 73 65 |indowinf|o[wt].se|
|00003ef0| 6c 65 63 74 65 64 5f 69 | 74 65 6d 20 3d 20 2d 31 |lected_i|tem = -1|
|00003f00| 20 74 68 65 6e 20 62 65 | 67 69 6e 0d 09 09 09 09 | then be|gin.....|
|00003f10| 57 69 6e 64 6f 77 54 61 | 62 28 77 69 6e 64 6f 77 |WindowTa|b(window|
|00003f20| 69 6e 66 6f 5b 77 74 5d | 2e 77 69 6e 64 6f 77 2c |info[wt]|.window,|
|00003f30| 20 66 61 6c 73 65 29 3b | 0d 09 09 09 65 6e 64 3b | false);|....end;|
|00003f40| 20 28 2a 20 69 66 20 2a | 29 0d 09 09 65 6e 64 3b | (* if *|)...end;|
|00003f50| 20 28 2a 20 69 66 20 2a | 29 0d 09 09 50 72 65 70 | (* if *|)...Prep|
|00003f60| 57 69 6e 64 6f 77 20 3a | 3d 20 66 69 72 73 74 5f |Window :|= first_|
|00003f70| 65 72 72 3b 0d 09 65 6e | 64 3b 20 28 2a 20 50 72 |err;..en|d; (* Pr|
|00003f80| 65 70 57 69 6e 64 6f 77 | 20 2a 29 0d 0d 09 66 75 |epWindow| *)...fu|
|00003f90| 6e 63 74 69 6f 6e 20 4e | 65 77 57 69 6e 64 6f 77 |nction N|ewWindow|
|00003fa0| 20 28 77 74 3a 20 57 69 | 6e 64 6f 77 54 79 70 65 | (wt: Wi|ndowType|
|00003fb0| 29 3a 20 4f 53 45 72 72 | 3b 0d 09 09 76 61 72 0d |): OSErr|;...var.|
|00003fc0| 09 09 09 77 70 3a 20 57 | 69 6e 64 6f 77 50 74 72 |...wp: W|indowPtr|
|00003fd0| 3b 0d 09 09 09 6a 75 6e | 6b 3a 20 4f 53 45 72 72 |;....jun|k: OSErr|
|00003fe0| 3b 0d 09 09 09 70 6f 73 | 69 74 69 6f 6e 3a 20 50 |;....pos|ition: P|
|00003ff0| 6f 69 6e 74 3b 0d 09 09 | 09 6f 72 69 67 69 6e 61 |oint;...|.origina|
|00004000| 6c 5f 70 6f 73 69 74 69 | 6f 6e 3a 20 52 65 63 74 |l_positi|on: Rect|
|00004010| 3b 0d 09 09 09 65 72 72 | 3a 20 4f 53 45 72 72 3b |;....err|: OSErr;|
|00004020| 0d 09 09 09 65 72 72 32 | 3a 20 4f 53 45 72 72 3b |....err2|: OSErr;|
|00004030| 0d 09 09 09 69 64 2c 20 | 64 6c 67 5f 69 64 3a 20 |....id, |dlg_id: |
|00004040| 69 6e 74 65 67 65 72 3b | 0d 09 62 65 67 69 6e 0d |integer;|..begin.|
|00004050| 09 09 69 64 20 3a 3d 20 | 47 65 74 57 69 6e 64 6f |..id := |GetWindo|
|00004060| 77 49 44 28 77 74 29 3b | 0d 09 09 77 70 20 3a 3d |wID(wt);|...wp :=|
|00004070| 20 6e 69 6c 3b 0d 09 09 | 65 72 72 20 3a 3d 20 49 | nil;...|err := I|
|00004080| 43 4d 61 70 45 72 72 28 | 49 43 42 65 67 69 6e 28 |CMapErr(|ICBegin(|
|00004090| 47 65 74 49 6e 73 74 61 | 6e 63 65 2c 20 69 63 52 |GetInsta|nce, icR|
|000040a0| 65 61 64 57 72 69 74 65 | 50 65 72 6d 29 29 3b 0d |eadWrite|Perm));.|
|000040b0| 09 09 69 66 20 65 72 72 | 20 3d 20 6e 6f 45 72 72 |..if err| = noErr|
|000040c0| 20 74 68 65 6e 20 62 65 | 67 69 6e 0d 09 09 09 64 | then be|gin....d|
|000040d0| 6c 67 5f 69 64 20 3a 3d | 20 69 64 3b 0d 09 09 09 |lg_id :=| id;....|
|000040e0| 69 66 20 28 77 74 20 3d | 20 57 54 5f 46 6f 6e 74 |if (wt =| WT_Font|
|000040f0| 29 20 74 68 65 6e 20 62 | 65 67 69 6e 0d 09 09 09 |) then b|egin....|
|00004100| 09 69 66 20 6e 6f 74 20 | 73 79 73 74 65 6d 37 20 |.if not |system7 |
|00004110| 74 68 65 6e 20 62 65 67 | 69 6e 0d 09 09 09 09 09 |then beg|in......|
|00004120| 64 6c 67 5f 69 64 20 3a | 3d 20 32 39 30 3b 0d 09 |dlg_id :|= 290;..|
|00004130| 09 09 09 65 6e 64 3b 20 | 28 2a 20 69 66 20 2a 29 |...end; |(* if *)|
|00004140| 0d 09 09 09 09 28 2a 20 | 53 77 69 74 63 68 20 74 |.....(* |Switch t|
|00004150| 6f 20 77 61 74 63 68 20 | 63 75 72 73 6f 72 20 77 |o watch |cursor w|
|00004160| 68 65 6e 20 62 72 69 6e | 67 69 6e 67 20 75 70 20 |hen brin|ging up |
|00004170| 46 6f 6e 74 20 77 69 6e | 64 6f 77 2c 20 27 63 61 |Font win|dow, 'ca|
|00004180| 75 73 65 20 69 74 20 6f | 66 74 65 6e 20 74 61 6b |use it o|ften tak|
|00004190| 65 73 20 61 20 77 68 69 | 6c 65 2e 20 2a 29 0d 09 |es a whi|le. *)..|
|000041a0| 09 09 09 53 65 74 43 75 | 72 73 6f 72 28 47 65 74 |...SetCu|rsor(Get|
|000041b0| 43 75 72 73 6f 72 28 77 | 61 74 63 68 43 75 72 73 |Cursor(w|atchCurs|
|000041c0| 6f 72 29 5e 5e 29 3b 09 | 0d 09 09 09 65 6e 64 3b |or)^^);.|....end;|
|000041d0| 0d 09 09 09 77 70 20 3a | 3d 20 47 65 74 4e 65 77 |....wp :|= GetNew|
|000041e0| 44 69 61 6c 6f 67 28 64 | 6c 67 5f 69 64 2c 20 6e |Dialog(d|lg_id, n|
|000041f0| 69 6c 2c 20 50 4f 49 4e | 54 45 52 28 2d 31 29 29 |il, POIN|TER(-1))|
|00004200| 3b 0d 09 09 09 69 66 20 | 77 70 20 3d 20 6e 69 6c |;....if |wp = nil|
|00004210| 20 74 68 65 6e 20 62 65 | 67 69 6e 0d 09 09 09 09 | then be|gin.....|
|00004220| 65 72 72 20 3a 3d 20 6d | 65 6d 46 75 6c 6c 45 72 |err := m|emFullEr|
|00004230| 72 3b 0d 09 09 09 65 6e | 64 3b 20 28 2a 20 69 66 |r;....en|d; (* if|
|00004240| 20 2a 29 0d 09 09 09 69 | 66 20 65 72 72 20 3d 20 | *)....i|f err = |
|00004250| 6e 6f 45 72 72 20 74 68 | 65 6e 20 62 65 67 69 6e |noErr th|en begin|
|00004260| 0d 09 09 09 09 65 72 72 | 20 3a 3d 20 50 72 65 70 |.....err| := Prep|
|00004270| 57 69 6e 64 6f 77 28 77 | 74 2c 20 69 64 2c 20 77 |Window(w|t, id, w|
|00004280| 70 29 3b 0d 09 09 09 65 | 6e 64 3b 20 28 2a 20 69 |p);....e|nd; (* i|
|00004290| 66 20 2a 29 0d 09 09 09 | 69 66 20 65 72 72 20 3d |f *)....|if err =|
|000042a0| 20 6e 6f 45 72 72 20 74 | 68 65 6e 20 62 65 67 69 | noErr t|hen begi|
|000042b0| 6e 0d 09 09 09 09 70 6f | 73 69 74 69 6f 6e 20 3a |n.....po|sition :|
|000042c0| 3d 20 77 69 6e 64 6f 77 | 69 6e 66 6f 5b 77 74 5d |= window|info[wt]|
|000042d0| 2e 70 6f 73 69 74 69 6f | 6e 3b 0d 09 09 09 09 69 |.positio|n;.....i|
|000042e0| 66 20 28 70 6f 73 69 74 | 69 6f 6e 2e 68 20 3c 3e |f (posit|ion.h <>|
|000042f0| 20 30 29 20 6f 72 20 28 | 70 6f 73 69 74 69 6f 6e | 0) or (|position|
|00004300| 2e 76 20 3c 3e 20 30 29 | 20 74 68 65 6e 20 62 65 |.v <> 0)| then be|
|00004310| 67 69 6e 0d 09 09 09 09 | 09 47 65 74 57 69 6e 64 |gin.....|.GetWind|
|00004320| 6f 77 52 65 63 74 28 77 | 70 2c 20 6f 72 69 67 69 |owRect(w|p, origi|
|00004330| 6e 61 6c 5f 70 6f 73 69 | 74 69 6f 6e 29 3b 0d 09 |nal_posi|tion);..|
|00004340| 09 09 09 09 4d 6f 76 65 | 57 69 6e 64 6f 77 28 77 |....Move|Window(w|
|00004350| 70 2c 20 70 6f 73 69 74 | 69 6f 6e 2e 68 2c 20 70 |p, posit|ion.h, p|
|00004360| 6f 73 69 74 69 6f 6e 2e | 76 2c 20 66 61 6c 73 65 |osition.|v, false|
|00004370| 29 3b 0d 09 09 09 09 09 | 53 68 6f 77 57 69 6e 64 |);......|ShowWind|
|00004380| 6f 77 28 77 70 29 3b 09 | 09 09 28 2a 20 62 65 63 |ow(wp);.|..(* bec|
|00004390| 61 75 73 65 20 54 69 74 | 6c 65 42 61 72 4f 6e 53 |ause Tit|leBarOnS|
|000043a0| 63 72 65 65 6e 20 72 65 | 71 75 69 72 65 73 20 77 |creen re|quires w|
|000043b0| 69 6e 64 6f 77 20 74 6f | 20 62 65 20 73 68 6f 77 |indow to| be show|
|000043c0| 6e 20 2a 29 0d 09 09 09 | 09 09 69 66 20 6e 6f 74 |n *)....|..if not|
|000043d0| 20 54 69 74 6c 65 42 61 | 72 4f 6e 53 63 72 65 65 | TitleBa|rOnScree|
|000043e0| 6e 28 77 70 29 20 74 68 | 65 6e 20 62 65 67 69 6e |n(wp) th|en begin|
|000043f0| 0d 09 09 09 09 09 09 4d | 6f 76 65 57 69 6e 64 6f |.......M|oveWindo|
|00004400| 77 28 77 70 2c 20 6f 72 | 69 67 69 6e 61 6c 5f 70 |w(wp, or|iginal_p|
|00004410| 6f 73 69 74 69 6f 6e 2e | 6c 65 66 74 2c 20 6f 72 |osition.|left, or|
|00004420| 69 67 69 6e 61 6c 5f 70 | 6f 73 69 74 69 6f 6e 2e |iginal_p|osition.|
|00004430| 74 6f 70 2c 20 66 61 6c | 73 65 29 3b 0d 09 09 09 |top, fal|se);....|
|00004440| 09 09 65 6e 64 3b 20 28 | 2a 20 69 66 20 2a 29 0d |..end; (|* if *).|
|00004450| 09 09 09 09 65 6e 64 3b | 20 28 2a 20 69 66 20 2a |....end;| (* if *|
|00004460| 29 0d 09 09 09 09 53 68 | 6f 77 57 69 6e 64 6f 77 |).....Sh|owWindow|
|00004470| 28 77 70 29 3b 0d 09 09 | 09 09 28 2a 20 55 6e 69 |(wp);...|..(* Uni|
|00004480| 6c 61 74 65 72 61 6c 6c | 79 20 73 77 69 74 63 68 |laterall|y switch|
|00004490| 20 62 61 63 6b 20 74 6f | 20 61 72 72 6f 77 20 63 | back to| arrow c|
|000044a0| 75 72 73 6f 72 2e 20 2a | 29 0d 09 09 09 09 49 6e |ursor. *|).....In|
|000044b0| 69 74 43 75 72 73 6f 72 | 3b 0d 09 09 09 65 6e 64 |itCursor|;....end|
|000044c0| 3b 0d 09 09 09 65 72 72 | 32 20 3a 3d 20 49 43 4d |;....err|2 := ICM|
|000044d0| 61 70 45 72 72 28 49 43 | 45 6e 64 28 47 65 74 49 |apErr(IC|End(GetI|
|000044e0| 6e 73 74 61 6e 63 65 29 | 29 3b 0d 09 09 09 69 66 |nstance)|);....if|
|000044f0| 20 65 72 72 20 3d 20 6e | 6f 45 72 72 20 74 68 65 | err = n|oErr the|
|00004500| 6e 20 62 65 67 69 6e 0d | 09 09 09 09 65 72 72 20 |n begin.|....err |
|00004510| 3a 3d 20 65 72 72 32 3b | 0d 09 09 09 65 6e 64 3b |:= err2;|....end;|
|00004520| 20 28 2a 20 69 66 20 2a | 29 0d 09 09 65 6e 64 3b | (* if *|)...end;|
|00004530| 20 28 2a 20 69 66 20 2a | 29 0d 09 09 28 2a 20 74 | (* if *|)...(* t|
|00004540| 69 64 79 20 75 70 20 63 | 6f 64 65 20 2a 29 0d 09 |idy up c|ode *)..|
|00004550| 09 69 66 20 65 72 72 20 | 3c 3e 20 6e 6f 45 72 72 |.if err |<> noErr|
|00004560| 20 74 68 65 6e 20 62 65 | 67 69 6e 0d 09 09 09 69 | then be|gin....i|
|00004570| 66 20 77 70 20 3c 3e 20 | 6e 69 6c 20 74 68 65 6e |f wp <> |nil then|
|00004580| 20 62 65 67 69 6e 0d 09 | 09 09 09 6a 75 6e 6b 20 | begin..|...junk |
|00004590| 3a 3d 20 44 69 73 70 6f | 73 65 57 69 6e 64 6f 77 |:= Dispo|seWindow|
|000045a0| 54 79 70 65 28 77 70 2c | 20 77 74 29 3b 0d 09 09 |Type(wp,| wt);...|
|000045b0| 09 65 6e 64 3b 20 28 2a | 20 69 66 20 2a 29 0d 09 |.end; (*| if *)..|
|000045c0| 09 65 6e 64 3b 20 28 2a | 20 69 66 20 2a 29 0d 09 |.end; (*| if *)..|
|000045d0| 09 4e 65 77 57 69 6e 64 | 6f 77 20 3a 3d 20 65 72 |.NewWind|ow := er|
|000045e0| 72 3b 0d 09 65 6e 64 3b | 20 28 2a 20 4e 65 77 57 |r;..end;| (* NewW|
|000045f0| 69 6e 64 6f 77 20 2a 29 | 0d 0d 09 66 75 6e 63 74 |indow *)|...funct|
|00004600| 69 6f 6e 20 57 69 6e 64 | 6f 77 73 4f 70 65 6e 20 |ion Wind|owsOpen |
|00004610| 28 77 74 3a 20 57 69 6e | 64 6f 77 54 79 70 65 29 |(wt: Win|dowType)|
|00004620| 3a 20 4f 53 45 72 72 3b | 0d 09 62 65 67 69 6e 0d |: OSErr;|..begin.|
|00004630| 09 09 69 66 20 77 69 6e | 64 6f 77 69 6e 66 6f 5b |..if win|dowinfo[|
|00004640| 77 74 5d 2e 77 69 6e 64 | 6f 77 20 3c 3e 20 6e 69 |wt].wind|ow <> ni|
|00004650| 6c 20 74 68 65 6e 20 62 | 65 67 69 6e 0d 09 09 09 |l then b|egin....|
|00004660| 53 68 6f 77 57 69 6e 64 | 6f 77 28 77 69 6e 64 6f |ShowWind|ow(windo|
|00004670| 77 69 6e 66 6f 5b 77 74 | 5d 2e 77 69 6e 64 6f 77 |winfo[wt|].window|
|00004680| 29 3b 0d 09 09 09 53 65 | 6c 65 63 74 57 69 6e 64 |);....Se|lectWind|
|00004690| 6f 77 28 77 69 6e 64 6f | 77 69 6e 66 6f 5b 77 74 |ow(windo|winfo[wt|
|000046a0| 5d 2e 77 69 6e 64 6f 77 | 29 3b 0d 09 09 09 57 69 |].window|);....Wi|
|000046b0| 6e 64 6f 77 73 4f 70 65 | 6e 20 3a 3d 20 6e 6f 45 |ndowsOpe|n := noE|
|000046c0| 72 72 3b 0d 09 09 65 6e | 64 20 65 6c 73 65 20 62 |rr;...en|d else b|
|000046d0| 65 67 69 6e 0d 09 09 09 | 57 69 6e 64 6f 77 73 4f |egin....|WindowsO|
|000046e0| 70 65 6e 20 3a 3d 20 4e | 65 77 57 69 6e 64 6f 77 |pen := N|ewWindow|
|000046f0| 28 77 74 29 3b 0d 09 09 | 65 6e 64 3b 0d 09 65 6e |(wt);...|end;..en|
|00004700| 64 3b 20 28 2a 20 57 69 | 6e 64 6f 77 73 4f 70 65 |d; (* Wi|ndowsOpe|
|00004710| 6e 20 2a 29 0d 0d 09 66 | 75 6e 63 74 69 6f 6e 20 |n *)...f|unction |
|00004720| 57 69 6e 64 6f 77 73 43 | 6c 6f 73 65 20 28 77 70 |WindowsC|lose (wp|
|00004730| 3a 20 57 69 6e 64 6f 77 | 50 74 72 29 3a 20 4f 53 |: Window|Ptr): OS|
|00004740| 45 72 72 3b 0d 09 09 76 | 61 72 0d 09 09 09 77 74 |Err;...v|ar....wt|
|00004750| 3a 20 57 69 6e 64 6f 77 | 54 79 70 65 3b 0d 09 62 |: Window|Type;..b|
|00004760| 65 67 69 6e 0d 09 09 57 | 69 6e 64 6f 77 73 43 6c |egin...W|indowsCl|
|00004770| 6f 73 65 20 3a 3d 20 6e | 6f 45 72 72 3b 0d 09 09 |ose := n|oErr;...|
|00004780| 77 74 20 3a 3d 20 47 65 | 74 57 69 6e 64 6f 77 54 |wt := Ge|tWindowT|
|00004790| 79 70 65 28 77 70 29 3b | 0d 09 09 69 66 20 77 74 |ype(wp);|...if wt|
|000047a0| 20 3c 3e 20 57 54 5f 4e | 6f 6e 65 20 74 68 65 6e | <> WT_N|one then|
|000047b0| 20 62 65 67 69 6e 0d 09 | 09 09 57 69 6e 64 6f 77 | begin..|..Window|
|000047c0| 73 43 6c 6f 73 65 20 3a | 3d 20 43 6c 6f 73 65 57 |sClose :|= CloseW|
|000047d0| 69 6e 64 6f 77 54 79 70 | 65 28 77 70 2c 20 77 74 |indowTyp|e(wp, wt|
|000047e0| 29 3b 0d 09 09 65 6e 64 | 3b 20 28 2a 20 69 66 20 |);...end|; (* if |
|000047f0| 2a 29 0d 09 65 6e 64 3b | 20 28 2a 20 57 69 6e 64 |*)..end;| (* Wind|
|00004800| 6f 77 73 43 6c 6f 73 65 | 20 2a 29 0d 0d 09 74 79 |owsClose| *)...ty|
|00004810| 70 65 0d 09 09 70 6f 69 | 6e 74 41 72 72 61 79 20 |pe...poi|ntArray |
|00004820| 3d 20 61 72 72 61 79 5b | 57 54 5f 4d 61 69 6e 2e |= array[|WT_Main.|
|00004830| 2e 57 54 5f 4c 61 73 74 | 5d 20 6f 66 20 50 6f 69 |.WT_Last|] of Poi|
|00004840| 6e 74 3b 0d 0d 09 70 72 | 6f 63 65 64 75 72 65 20 |nt;...pr|ocedure |
|00004850| 57 69 6e 64 6f 77 73 52 | 65 73 65 74 50 6f 73 69 |WindowsR|esetPosi|
|00004860| 74 69 6f 6e 73 3b 0d 09 | 09 76 61 72 0d 09 09 09 |tions;..|.var....|
|00004870| 77 74 3a 20 57 69 6e 64 | 6f 77 54 79 70 65 3b 0d |wt: Wind|owType;.|
|00004880| 09 09 09 70 6f 73 3a 20 | 50 6f 69 6e 74 3b 0d 09 |...pos: |Point;..|
|00004890| 62 65 67 69 6e 0d 09 09 | 70 6f 73 2e 68 20 3a 3d |begin...|pos.h :=|
|000048a0| 20 32 3b 0d 09 09 70 6f | 73 2e 76 20 3a 3d 20 34 | 2;...po|s.v := 4|
|000048b0| 32 3b 0d 09 09 66 6f 72 | 20 77 74 20 3a 3d 20 57 |2;...for| wt := W|
|000048c0| 54 5f 4d 61 69 6e 20 74 | 6f 20 70 72 65 64 28 57 |T_Main t|o pred(W|
|000048d0| 54 5f 4c 61 73 74 29 20 | 64 6f 20 62 65 67 69 6e |T_Last) |do begin|
|000048e0| 0d 09 09 09 77 69 6e 64 | 6f 77 69 6e 66 6f 5b 77 |....wind|owinfo[w|
|000048f0| 74 5d 2e 70 6f 73 69 74 | 69 6f 6e 20 3a 3d 20 70 |t].posit|ion := p|
|00004900| 6f 73 3b 0d 09 09 09 70 | 6f 73 2e 68 20 3a 3d 20 |os;....p|os.h := |
|00004910| 70 6f 73 2e 68 20 2b 20 | 32 30 20 2a 20 6f 72 64 |pos.h + |20 * ord|
|00004920| 28 71 64 2e 73 63 72 65 | 65 6e 62 69 74 73 2e 62 |(qd.scre|enbits.b|
|00004930| 6f 75 6e 64 73 2e 72 69 | 67 68 74 20 3e 20 35 31 |ounds.ri|ght > 51|
|00004940| 32 29 3b 0d 09 09 09 70 | 6f 73 2e 76 20 3a 3d 20 |2);....p|os.v := |
|00004950| 70 6f 73 2e 76 20 2b 20 | 31 30 20 2a 20 6f 72 64 |pos.v + |10 * ord|
|00004960| 28 71 64 2e 73 63 72 65 | 65 6e 62 69 74 73 2e 62 |(qd.scre|enbits.b|
|00004970| 6f 75 6e 64 73 2e 62 6f | 74 74 6f 6d 20 3e 3d 20 |ounds.bo|ttom >= |
|00004980| 34 30 30 29 20 2b 20 38 | 20 2a 20 6f 72 64 28 71 |400) + 8| * ord(q|
|00004990| 64 2e 73 63 72 65 65 6e | 62 69 74 73 2e 62 6f 75 |d.screen|bits.bou|
|000049a0| 6e 64 73 2e 62 6f 74 74 | 6f 6d 20 3e 3d 20 34 38 |nds.bott|om >= 48|
|000049b0| 30 29 3b 0d 09 09 65 6e | 64 3b 20 28 2a 20 66 6f |0);...en|d; (* fo|
|000049c0| 72 20 2a 29 0d 09 65 6e | 64 3b 0d 0d 09 70 72 6f |r *)..en|d;...pro|
|000049d0| 63 65 64 75 72 65 20 57 | 69 6e 64 6f 77 73 52 65 |cedure W|indowsRe|
|000049e0| 73 74 6f 72 65 50 6f 73 | 69 74 69 6f 6e 73 3b 0d |storePos|itions;.|
|000049f0| 09 09 76 61 72 0d 09 09 | 09 65 72 72 2c 20 65 72 |..var...|.err, er|
|00004a00| 72 32 3a 20 4f 53 45 72 | 72 3b 0d 09 09 09 61 74 |r2: OSEr|r;....at|
|00004a10| 74 72 3a 20 6c 6f 6e 67 | 69 6e 74 3b 0d 09 09 09 |tr: long|int;....|
|00004a20| 77 69 6e 64 6f 77 5f 70 | 6f 73 69 74 69 6f 6e 73 |window_p|ositions|
|00004a30| 3a 20 70 6f 69 6e 74 41 | 72 72 61 79 3b 0d 09 09 |: pointA|rray;...|
|00004a40| 09 73 69 7a 65 3a 20 6c | 6f 6e 67 69 6e 74 3b 0d |.size: l|ongint;.|
|00004a50| 09 09 09 77 74 3a 20 57 | 69 6e 64 6f 77 54 79 70 |...wt: W|indowTyp|
|00004a60| 65 3b 0d 09 62 65 67 69 | 6e 0d 09 09 65 72 72 20 |e;..begi|n...err |
|00004a70| 3a 3d 20 49 43 4d 61 70 | 45 72 72 28 49 43 42 65 |:= ICMap|Err(ICBe|
|00004a80| 67 69 6e 28 47 65 74 49 | 6e 73 74 61 6e 63 65 2c |gin(GetI|nstance,|
|00004a90| 20 69 63 52 65 61 64 4f | 6e 6c 79 50 65 72 6d 29 | icReadO|nlyPerm)|
|00004aa0| 29 3b 0d 09 09 69 66 20 | 65 72 72 20 3d 20 6e 6f |);...if |err = no|
|00004ab0| 45 72 72 20 74 68 65 6e | 20 62 65 67 69 6e 0d 09 |Err then| begin..|
|00004ac0| 09 09 73 69 7a 65 20 3a | 3d 20 73 69 7a 65 6f 66 |..size :|= sizeof|
|00004ad0| 28 77 69 6e 64 6f 77 5f | 70 6f 73 69 74 69 6f 6e |(window_|position|
|00004ae0| 73 29 3b 0d 09 09 09 65 | 72 72 20 3a 3d 20 49 43 |s);....e|rr := IC|
|00004af0| 47 65 74 50 72 65 66 28 | 47 65 74 49 6e 73 74 61 |GetPref(|GetInsta|
|00004b00| 6e 63 65 2c 20 4f 75 72 | 57 69 6e 64 6f 77 50 6f |nce, Our|WindowPo|
|00004b10| 73 69 74 69 6f 6e 73 4b | 65 79 2c 20 61 74 74 72 |sitionsK|ey, attr|
|00004b20| 2c 20 40 77 69 6e 64 6f | 77 5f 70 6f 73 69 74 69 |, @windo|w_positi|
|00004b30| 6f 6e 73 2c 20 73 69 7a | 65 29 3b 0d 09 09 09 69 |ons, siz|e);....i|
|00004b40| 66 20 28 65 72 72 20 3d | 20 6e 6f 45 72 72 29 20 |f (err =| noErr) |
|00004b50| 61 6e 64 20 28 73 69 7a | 65 20 3c 3e 20 73 69 7a |and (siz|e <> siz|
|00004b60| 65 6f 66 28 77 69 6e 64 | 6f 77 5f 70 6f 73 69 74 |eof(wind|ow_posit|
|00004b70| 69 6f 6e 73 29 29 20 74 | 68 65 6e 20 62 65 67 69 |ions)) t|hen begi|
|00004b80| 6e 0d 09 09 09 09 65 72 | 72 20 3a 3d 20 2d 31 3b |n.....er|r := -1;|
|00004b90| 0d 09 09 09 65 6e 64 3b | 20 28 2a 20 69 66 20 2a |....end;| (* if *|
|00004ba0| 29 0d 09 09 09 65 72 72 | 32 20 3a 3d 20 49 43 4d |)....err|2 := ICM|
|00004bb0| 61 70 45 72 72 28 49 43 | 45 6e 64 28 47 65 74 49 |apErr(IC|End(GetI|
|00004bc0| 6e 73 74 61 6e 63 65 29 | 29 3b 0d 09 09 09 69 66 |nstance)|);....if|
|00004bd0| 20 65 72 72 20 3d 20 6e | 6f 45 72 72 20 74 68 65 | err = n|oErr the|
|00004be0| 6e 20 62 65 67 69 6e 0d | 09 09 09 09 65 72 72 20 |n begin.|....err |
|00004bf0| 3a 3d 20 65 72 72 32 3b | 0d 09 09 09 65 6e 64 3b |:= err2;|....end;|
|00004c00| 20 28 2a 20 69 66 20 2a | 29 0d 09 09 65 6e 64 3b | (* if *|)...end;|
|00004c10| 20 28 2a 20 69 66 20 2a | 29 0d 09 09 69 66 20 65 | (* if *|)...if e|
|00004c20| 72 72 20 3d 20 6e 6f 45 | 72 72 20 74 68 65 6e 20 |rr = noE|rr then |
|00004c30| 62 65 67 69 6e 0d 09 09 | 09 66 6f 72 20 77 74 20 |begin...|.for wt |
|00004c40| 3a 3d 20 57 54 5f 4d 61 | 69 6e 20 74 6f 20 57 54 |:= WT_Ma|in to WT|
|00004c50| 5f 4c 61 73 74 20 64 6f | 20 62 65 67 69 6e 0d 09 |_Last do| begin..|
|00004c60| 09 09 09 77 69 6e 64 6f | 77 69 6e 66 6f 5b 77 74 |...windo|winfo[wt|
|00004c70| 5d 2e 70 6f 73 69 74 69 | 6f 6e 20 3a 3d 20 77 69 |].positi|on := wi|
|00004c80| 6e 64 6f 77 5f 70 6f 73 | 69 74 69 6f 6e 73 5b 77 |ndow_pos|itions[w|
|00004c90| 74 5d 3b 0d 09 09 09 65 | 6e 64 3b 20 28 2a 20 66 |t];....e|nd; (* f|
|00004ca0| 6f 72 20 2a 29 0d 09 09 | 65 6e 64 20 65 6c 73 65 |or *)...|end else|
|00004cb0| 20 62 65 67 69 6e 0d 09 | 09 09 57 69 6e 64 6f 77 | begin..|..Window|
|00004cc0| 73 52 65 73 65 74 50 6f | 73 69 74 69 6f 6e 73 3b |sResetPo|sitions;|
|00004cd0| 0d 09 09 65 6e 64 3b 20 | 28 2a 20 69 66 20 2a 29 |...end; |(* if *)|
|00004ce0| 0d 09 65 6e 64 3b 20 28 | 2a 20 57 69 6e 64 6f 77 |..end; (|* Window|
|00004cf0| 73 52 65 73 74 6f 72 65 | 50 6f 73 69 74 69 6f 6e |sRestore|Position|
|00004d00| 73 20 2a 29 0d 0d 09 70 | 72 6f 63 65 64 75 72 65 |s *)...p|rocedure|
|00004d10| 20 57 69 6e 64 6f 77 73 | 53 61 76 65 50 6f 73 69 | Windows|SavePosi|
|00004d20| 74 69 6f 6e 73 3b 0d 09 | 09 76 61 72 0d 09 09 09 |tions;..|.var....|
|00004d30| 65 72 72 2c 20 65 72 72 | 32 3a 20 4f 53 45 72 72 |err, err|2: OSErr|
|00004d40| 3b 0d 09 09 09 77 74 3a | 20 57 69 6e 64 6f 77 54 |;....wt:| WindowT|
|00004d50| 79 70 65 3b 0d 09 09 09 | 77 69 6e 64 6f 77 5f 70 |ype;....|window_p|
|00004d60| 6f 73 69 74 69 6f 6e 73 | 3a 20 70 6f 69 6e 74 41 |ositions|: pointA|
|00004d70| 72 72 61 79 3b 0d 09 62 | 65 67 69 6e 0d 09 09 66 |rray;..b|egin...f|
|00004d80| 6f 72 20 77 74 20 3a 3d | 20 57 54 5f 4d 61 69 6e |or wt :=| WT_Main|
|00004d90| 20 74 6f 20 57 54 5f 4c | 61 73 74 20 64 6f 20 62 | to WT_L|ast do b|
|00004da0| 65 67 69 6e 0d 09 09 09 | 77 69 6e 64 6f 77 5f 70 |egin....|window_p|
|00004db0| 6f 73 69 74 69 6f 6e 73 | 5b 77 74 5d 20 3a 3d 20 |ositions|[wt] := |
|00004dc0| 77 69 6e 64 6f 77 69 6e | 66 6f 5b 77 74 5d 2e 70 |windowin|fo[wt].p|
|00004dd0| 6f 73 69 74 69 6f 6e 3b | 0d 09 09 65 6e 64 3b 20 |osition;|...end; |
|00004de0| 28 2a 20 66 6f 72 20 2a | 29 0d 09 09 65 72 72 20 |(* for *|)...err |
|00004df0| 3a 3d 20 49 43 4d 61 70 | 45 72 72 28 49 43 42 65 |:= ICMap|Err(ICBe|
|00004e00| 67 69 6e 28 47 65 74 49 | 6e 73 74 61 6e 63 65 2c |gin(GetI|nstance,|
|00004e10| 20 69 63 52 65 61 64 57 | 72 69 74 65 50 65 72 6d | icReadW|ritePerm|
|00004e20| 29 29 3b 0d 09 09 69 66 | 20 65 72 72 20 3d 20 6e |));...if| err = n|
|00004e30| 6f 45 72 72 20 74 68 65 | 6e 20 62 65 67 69 6e 0d |oErr the|n begin.|
|00004e40| 09 09 09 65 72 72 20 3a | 3d 20 49 43 53 65 74 50 |...err :|= ICSetP|
|00004e50| 72 65 66 28 47 65 74 49 | 6e 73 74 61 6e 63 65 2c |ref(GetI|nstance,|
|00004e60| 20 4f 75 72 57 69 6e 64 | 6f 77 50 6f 73 69 74 69 | OurWind|owPositi|
|00004e70| 6f 6e 73 4b 65 79 2c 20 | 49 43 61 74 74 72 5f 6e |onsKey, |ICattr_n|
|00004e80| 6f 5f 63 68 61 6e 67 65 | 2c 20 40 77 69 6e 64 6f |o_change|, @windo|
|00004e90| 77 5f 70 6f 73 69 74 69 | 6f 6e 73 2c 20 73 69 7a |w_positi|ons, siz|
|00004ea0| 65 6f 66 28 77 69 6e 64 | 6f 77 5f 70 6f 73 69 74 |eof(wind|ow_posit|
|00004eb0| 69 6f 6e 73 29 29 3b 0d | 09 09 09 65 72 72 32 20 |ions));.|...err2 |
|00004ec0| 3a 3d 20 49 43 4d 61 70 | 45 72 72 28 49 43 45 6e |:= ICMap|Err(ICEn|
|00004ed0| 64 28 47 65 74 49 6e 73 | 74 61 6e 63 65 29 29 3b |d(GetIns|tance));|
|00004ee0| 0d 09 09 09 69 66 20 65 | 72 72 20 3d 20 6e 6f 45 |....if e|rr = noE|
|00004ef0| 72 72 20 74 68 65 6e 20 | 62 65 67 69 6e 0d 09 09 |rr then |begin...|
|00004f00| 09 09 65 72 72 20 3a 3d | 20 65 72 72 32 3b 0d 09 |..err :=| err2;..|
|00004f10| 09 09 65 6e 64 3b 20 28 | 2a 20 69 66 20 2a 29 0d |..end; (|* if *).|
|00004f20| 09 09 65 6e 64 3b 20 28 | 2a 20 69 66 20 2a 29 0d |..end; (|* if *).|
|00004f30| 09 65 6e 64 3b 20 28 2a | 20 57 69 6e 64 6f 77 73 |.end; (*| Windows|
|00004f40| 53 61 76 65 50 6f 73 69 | 74 69 6f 6e 73 20 2a 29 |SavePosi|tions *)|
|00004f50| 0d 0d 09 66 75 6e 63 74 | 69 6f 6e 20 57 69 6e 64 |...funct|ion Wind|
|00004f60| 6f 77 73 46 6c 75 73 68 | 41 6c 6c 3a 20 4f 53 45 |owsFlush|All: OSE|
|00004f70| 72 72 3b 09 28 2a 20 66 | 6c 75 73 68 20 61 6c 6c |rr;.(* f|lush all|
|00004f80| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 20 77 69 6e | informa|tion win|
|00004f90| 64 6f 77 73 20 2a 29 0d | 09 09 76 61 72 0d 09 09 |dows *).|..var...|
|00004fa0| 09 77 74 3a 20 57 69 6e | 64 6f 77 54 79 70 65 3b |.wt: Win|dowType;|
|00004fb0| 0d 09 09 09 66 69 72 73 | 74 5f 65 72 72 2c 20 65 |....firs|t_err, e|
|00004fc0| 72 72 3a 20 4f 53 45 72 | 72 3b 0d 09 62 65 67 69 |rr: OSEr|r;..begi|
|00004fd0| 6e 0d 09 09 66 69 72 73 | 74 5f 65 72 72 20 3a 3d |n...firs|t_err :=|
|00004fe0| 20 49 43 4d 61 70 45 72 | 72 28 49 43 42 65 67 69 | ICMapEr|r(ICBegi|
|00004ff0| 6e 28 47 65 74 49 6e 73 | 74 61 6e 63 65 2c 20 69 |n(GetIns|tance, i|
|00005000| 63 52 65 61 64 57 72 69 | 74 65 50 65 72 6d 29 29 |cReadWri|tePerm))|
|00005010| 3b 0d 09 09 69 66 20 66 | 69 72 73 74 5f 65 72 72 |;...if f|irst_err|
|00005020| 20 3d 20 6e 6f 45 72 72 | 20 74 68 65 6e 20 62 65 | = noErr| then be|
|00005030| 67 69 6e 0d 09 09 09 66 | 6f 72 20 77 74 20 3a 3d |gin....f|or wt :=|
|00005040| 20 57 54 5f 4d 61 69 6e | 20 74 6f 20 57 54 5f 4c | WT_Main| to WT_L|
|00005050| 61 73 74 20 64 6f 20 62 | 65 67 69 6e 0d 09 09 09 |ast do b|egin....|
|00005060| 09 69 66 20 77 69 6e 64 | 6f 77 69 6e 66 6f 5b 77 |.if wind|owinfo[w|
|00005070| 74 5d 2e 77 69 6e 64 6f | 77 20 3c 3e 20 6e 69 6c |t].windo|w <> nil|
|00005080| 20 74 68 65 6e 20 62 65 | 67 69 6e 0d 09 09 09 09 | then be|gin.....|
|00005090| 09 53 65 74 50 6f 72 74 | 28 77 69 6e 64 6f 77 69 |.SetPort|(windowi|
|000050a0| 6e 66 6f 5b 77 74 5d 2e | 77 69 6e 64 6f 77 29 3b |nfo[wt].|window);|
|000050b0| 0d 09 09 09 09 09 65 72 | 72 20 3a 3d 20 46 6c 75 |......er|r := Flu|
|000050c0| 73 68 57 69 6e 64 6f 77 | 54 79 70 65 28 77 69 6e |shWindow|Type(win|
|000050d0| 64 6f 77 69 6e 66 6f 5b | 77 74 5d 2e 77 69 6e 64 |dowinfo[|wt].wind|
|000050e0| 6f 77 2c 20 77 74 29 3b | 0d 09 09 09 09 09 69 66 |ow, wt);|......if|
|000050f0| 20 66 69 72 73 74 5f 65 | 72 72 20 3d 20 6e 6f 45 | first_e|rr = noE|
|00005100| 72 72 20 74 68 65 6e 20 | 62 65 67 69 6e 0d 09 09 |rr then |begin...|
|00005110| 09 09 09 09 66 69 72 73 | 74 5f 65 72 72 20 3a 3d |....firs|t_err :=|
|00005120| 20 65 72 72 3b 0d 09 09 | 09 09 09 65 6e 64 3b 20 | err;...|...end; |
|00005130| 28 2a 20 69 66 20 2a 29 | 0d 09 09 09 09 65 6e 64 |(* if *)|.....end|
|00005140| 3b 20 28 2a 20 69 66 20 | 2a 29 0d 09 09 09 65 6e |; (* if |*)....en|
|00005150| 64 3b 20 28 2a 20 66 6f | 72 20 2a 29 0d 09 09 09 |d; (* fo|r *)....|
|00005160| 65 72 72 20 3a 3d 20 49 | 43 4d 61 70 45 72 72 28 |err := I|CMapErr(|
|00005170| 49 43 45 6e 64 28 47 65 | 74 49 6e 73 74 61 6e 63 |ICEnd(Ge|tInstanc|
|00005180| 65 29 29 3b 0d 09 09 09 | 69 66 20 66 69 72 73 74 |e));....|if first|
|00005190| 5f 65 72 72 20 3d 20 6e | 6f 45 72 72 20 74 68 65 |_err = n|oErr the|
|000051a0| 6e 20 62 65 67 69 6e 0d | 09 09 09 09 66 69 72 73 |n begin.|....firs|
|000051b0| 74 5f 65 72 72 20 3a 3d | 20 65 72 72 3b 0d 09 09 |t_err :=| err;...|
|000051c0| 09 65 6e 64 3b 20 28 2a | 20 69 66 20 2a 29 0d 09 |.end; (*| if *)..|
|000051d0| 09 65 6e 64 3b 20 28 2a | 20 69 66 20 2a 29 0d 09 |.end; (*| if *)..|
|000051e0| 09 57 69 6e 64 6f 77 73 | 46 6c 75 73 68 41 6c 6c |.Windows|FlushAll|
|000051f0| 20 3a 3d 20 66 69 72 73 | 74 5f 65 72 72 3b 0d 09 | := firs|t_err;..|
|00005200| 65 6e 64 3b 20 28 2a 20 | 57 69 6e 64 6f 77 73 46 |end; (* |WindowsF|
|00005210| 6c 75 73 68 41 6c 6c 20 | 2a 29 0d 0d 09 66 75 6e |lushAll |*)...fun|
|00005220| 63 74 69 6f 6e 20 57 69 | 6e 64 6f 77 73 43 6c 6f |ction Wi|ndowsClo|
|00005230| 73 65 41 6c 6c 3a 20 4f | 53 45 72 72 3b 09 28 2a |seAll: O|SErr;.(*|
|00005240| 20 63 6c 6f 73 65 20 61 | 6c 6c 20 69 6e 66 6f 72 | close a|ll infor|
|00005250| 6d 61 74 69 6f 6e 20 77 | 69 6e 64 6f 77 73 20 2a |mation w|indows *|
|00005260| 29 0d 09 09 76 61 72 0d | 09 09 09 77 74 3a 20 57 |)...var.|...wt: W|
|00005270| 69 6e 64 6f 77 54 79 70 | 65 3b 0d 09 09 09 65 72 |indowTyp|e;....er|
|00005280| 72 2c 20 66 69 72 73 74 | 5f 65 72 72 3a 20 4f 53 |r, first|_err: OS|
|00005290| 45 72 72 3b 0d 09 62 65 | 67 69 6e 0d 09 09 66 69 |Err;..be|gin...fi|
|000052a0| 72 73 74 5f 65 72 72 20 | 3a 3d 20 6e 6f 45 72 72 |rst_err |:= noErr|
|000052b0| 3b 0d 09 09 66 6f 72 20 | 77 74 20 3a 3d 20 57 54 |;...for |wt := WT|
|000052c0| 5f 50 65 72 73 6f 6e 61 | 6c 20 74 6f 20 57 54 5f |_Persona|l to WT_|
|000052d0| 4c 61 73 74 20 64 6f 20 | 62 65 67 69 6e 0d 09 09 |Last do |begin...|
|000052e0| 09 69 66 20 77 69 6e 64 | 6f 77 69 6e 66 6f 5b 77 |.if wind|owinfo[w|
|000052f0| 74 5d 2e 77 69 6e 64 6f | 77 20 3c 3e 20 6e 69 6c |t].windo|w <> nil|
|00005300| 20 74 68 65 6e 20 62 65 | 67 69 6e 0d 09 09 09 09 | then be|gin.....|
|00005310| 65 72 72 20 3a 3d 20 43 | 6c 6f 73 65 57 69 6e 64 |err := C|loseWind|
|00005320| 6f 77 54 79 70 65 28 77 | 69 6e 64 6f 77 69 6e 66 |owType(w|indowinf|
|00005330| 6f 5b 77 74 5d 2e 77 69 | 6e 64 6f 77 2c 20 77 74 |o[wt].wi|ndow, wt|
|00005340| 29 3b 0d 09 09 09 09 69 | 66 20 66 69 72 73 74 5f |);.....i|f first_|
|00005350| 65 72 72 20 3d 20 6e 6f | 45 72 72 20 74 68 65 6e |err = no|Err then|
|00005360| 20 62 65 67 69 6e 0d 09 | 09 09 09 09 66 69 72 73 | begin..|....firs|
|00005370| 74 5f 65 72 72 20 3a 3d | 20 65 72 72 3b 0d 09 09 |t_err :=| err;...|
|00005380| 09 09 65 6e 64 3b 20 28 | 2a 20 69 66 20 2a 29 0d |..end; (|* if *).|
|00005390| 09 09 09 65 6e 64 3b 0d | 09 09 65 6e 64 3b 20 28 |...end;.|..end; (|
|000053a0| 2a 20 66 6f 72 20 2a 29 | 0d 09 09 57 69 6e 64 6f |* for *)|...Windo|
|000053b0| 77 73 43 6c 6f 73 65 41 | 6c 6c 20 3a 3d 20 66 69 |wsCloseA|ll := fi|
|000053c0| 72 73 74 5f 65 72 72 3b | 0d 09 65 6e 64 3b 20 28 |rst_err;|..end; (|
|000053d0| 2a 20 57 69 6e 64 6f 77 | 73 43 6c 6f 73 65 41 6c |* Window|sCloseAl|
|000053e0| 6c 20 2a 29 0d 0d 09 70 | 72 6f 63 65 64 75 72 65 |l *)...p|rocedure|
|000053f0| 20 49 6e 69 74 57 68 61 | 74 73 3b 0d 09 09 70 72 | InitWha|ts;...pr|
|00005400| 6f 63 65 64 75 72 65 20 | 57 20 28 77 68 61 74 3a |ocedure |W (what:|
|00005410| 20 69 6e 74 65 67 65 72 | 3b 20 78 74 79 70 3a 20 | integer|; xtyp: |
|00005420| 4f 53 54 79 70 65 3b 20 | 78 6f 70 65 6e 2c 20 78 |OSType; |xopen, x|
|00005430| 6b 65 79 2c 20 78 63 6c | 69 63 6b 2c 20 78 69 64 |key, xcl|ick, xid|
|00005440| 6c 65 2c 20 78 66 6c 75 | 73 68 2c 20 78 63 6c 6f |le, xflu|sh, xclo|
|00005450| 73 65 2c 20 78 61 63 74 | 69 76 61 74 65 2c 20 78 |se, xact|ivate, x|
|00005460| 63 75 72 73 6f 72 3a 20 | 50 72 6f 63 50 74 72 3b |cursor: |ProcPtr;|
|00005470| 20 78 63 75 72 73 6f 72 | 69 64 3a 20 69 6e 74 65 | xcursor|id: inte|
|00005480| 67 65 72 29 3b 0d 09 09 | 62 65 67 69 6e 0d 09 09 |ger);...|begin...|
|00005490| 09 77 69 74 68 20 77 68 | 61 74 69 6e 66 6f 5b 77 |.with wh|atinfo[w|
|000054a0| 68 61 74 5d 20 64 6f 20 | 62 65 67 69 6e 0d 09 09 |hat] do |begin...|
|000054b0| 09 09 74 79 70 20 3a 3d | 20 78 74 79 70 3b 0d 09 |..typ :=| xtyp;..|
|000054c0| 09 09 09 6f 70 65 6e 20 | 3a 3d 20 78 6f 70 65 6e |...open |:= xopen|
|000054d0| 3b 0d 09 09 09 09 6b 65 | 79 20 3a 3d 20 78 6b 65 |;.....ke|y := xke|
|000054e0| 79 3b 0d 09 09 09 09 63 | 6c 69 63 6b 20 3a 3d 20 |y;.....c|lick := |
|000054f0| 78 63 6c 69 63 6b 3b 0d | 09 09 09 09 66 6c 75 73 |xclick;.|....flus|
|00005500| 68 20 3a 3d 20 78 66 6c | 75 73 68 3b 0d 09 09 09 |h := xfl|ush;....|
|00005510| 09 63 6c 6f 73 65 20 3a | 3d 20 78 63 6c 6f 73 65 |.close :|= xclose|
|00005520| 3b 0d 09 09 09 09 61 63 | 74 69 76 61 74 65 20 3a |;.....ac|tivate :|
|00005530| 3d 20 78 61 63 74 69 76 | 61 74 65 3b 0d 09 09 09 |= xactiv|ate;....|
|00005540| 09 69 64 6c 65 20 3a 3d | 20 78 69 64 6c 65 3b 0d |.idle :=| xidle;.|
|00005550| 09 09 09 09 63 75 72 73 | 6f 72 20 3a 3d 20 78 63 |....curs|or := xc|
|00005560| 75 72 73 6f 72 3b 0d 09 | 09 09 09 63 75 72 73 6f |ursor;..|...curso|
|00005570| 72 69 64 20 3a 3d 20 78 | 63 75 72 73 6f 72 69 64 |rid := x|cursorid|
|00005580| 3b 0d 09 09 09 65 6e 64 | 3b 0d 09 09 65 6e 64 3b |;....end|;...end;|
|00005590| 0d 09 62 65 67 69 6e 0d | 09 09 57 28 31 2c 20 27 |..begin.|..W(1, '|
|000055a0| 4e 55 4c 4c 27 2c 20 6e | 69 6c 2c 20 6e 69 6c 2c |NULL', n|il, nil,|
|000055b0| 20 6e 69 6c 2c 20 6e 69 | 6c 2c 20 6e 69 6c 2c 20 | nil, ni|l, nil, |
|000055c0| 6e 69 6c 2c 20 6e 69 6c | 2c 20 6e 69 6c 2c 20 30 |nil, nil|, nil, 0|
|000055d0| 29 3b 0d 09 09 57 28 32 | 2c 20 27 54 45 58 54 27 |);...W(2|, 'TEXT'|
|000055e0| 2c 20 40 57 68 61 74 4f | 70 65 6e 54 65 78 74 2c |, @WhatO|penText,|
|000055f0| 20 40 57 68 61 74 4b 65 | 79 54 65 78 74 2c 20 40 | @WhatKe|yText, @|
|00005600| 57 68 61 74 43 6c 69 63 | 6b 54 65 78 74 2c 20 6e |WhatClic|kText, n|
|00005610| 69 6c 2c 20 40 57 68 61 | 74 46 6c 75 73 68 54 65 |il, @Wha|tFlushTe|
|00005620| 78 74 2c 20 40 57 68 61 | 74 43 6c 6f 73 65 54 65 |xt, @Wha|tCloseTe|
|00005630| 78 74 2c 20 6e 69 6c 2c | 20 6e 69 6c 2c 20 69 42 |xt, nil,| nil, iB|
|00005640| 65 61 6d 43 75 72 73 6f | 72 29 3b 0d 09 09 57 28 |eamCurso|r);...W(|
|00005650| 33 2c 20 27 53 50 4f 50 | 27 2c 20 40 57 68 61 74 |3, 'SPOP|', @What|
|00005660| 4f 70 65 6e 50 6f 70 75 | 70 2c 20 6e 69 6c 2c 20 |OpenPopu|p, nil, |
|00005670| 40 57 68 61 74 43 6c 69 | 63 6b 50 6f 70 75 70 2c |@WhatCli|ckPopup,|
|00005680| 20 6e 69 6c 2c 20 40 57 | 68 61 74 46 6c 75 73 68 | nil, @W|hatFlush|
|00005690| 50 6f 70 75 70 2c 20 40 | 57 68 61 74 43 6c 6f 73 |Popup, @|WhatClos|
|000056a0| 65 50 6f 70 75 70 2c 20 | 6e 69 6c 2c 20 6e 69 6c |ePopup, |nil, nil|
|000056b0| 2c 20 30 29 3b 0d 09 09 | 57 28 34 2c 20 27 46 46 |, 0);...|W(4, 'FF|
|000056c0| 53 50 27 2c 20 40 57 68 | 61 74 4f 70 65 6e 46 53 |SP', @Wh|atOpenFS|
|000056d0| 53 70 65 63 2c 20 6e 69 | 6c 2c 20 40 57 68 61 74 |Spec, ni|l, @What|
|000056e0| 43 6c 69 63 6b 46 53 53 | 70 65 63 2c 20 6e 69 6c |ClickFSS|pec, nil|
|000056f0| 2c 20 40 57 68 61 74 46 | 6c 75 73 68 46 53 53 70 |, @WhatF|lushFSSp|
|00005700| 65 63 2c 20 6e 69 6c 2c | 20 6e 69 6c 2c 20 6e 69 |ec, nil,| nil, ni|
|00005710| 6c 2c 20 30 29 3b 0d 09 | 09 57 28 35 2c 20 27 46 |l, 0);..|.W(5, 'F|
|00005720| 50 4f 50 27 2c 20 40 57 | 68 61 74 4f 70 65 6e 46 |POP', @W|hatOpenF|
|00005730| 6f 6e 74 2c 20 6e 69 6c | 2c 20 40 57 68 61 74 43 |ont, nil|, @WhatC|
|00005740| 6c 69 63 6b 46 6f 6e 74 | 2c 20 6e 69 6c 2c 20 40 |lickFont|, nil, @|
|00005750| 57 68 61 74 46 6c 75 73 | 68 46 6f 6e 74 2c 20 6e |WhatFlus|hFont, n|
|00005760| 69 6c 2c 20 6e 69 6c 2c | 20 6e 69 6c 2c 20 30 29 |il, nil,| nil, 0)|
|00005770| 3b 0d 09 09 57 28 36 2c | 20 27 46 4d 41 50 27 2c |;...W(6,| 'FMAP',|
|00005780| 20 40 57 68 61 74 4f 70 | 65 6e 46 69 6c 65 4d 61 | @WhatOp|enFileMa|
|00005790| 70 2c 20 40 57 68 61 74 | 4b 65 79 46 69 6c 65 4d |p, @What|KeyFileM|
|000057a0| 61 70 2c 20 40 57 68 61 | 74 43 6c 69 63 6b 46 69 |ap, @Wha|tClickFi|
|000057b0| 6c 65 4d 61 70 2c 20 6e | 69 6c 2c 20 40 57 68 61 |leMap, n|il, @Wha|
|000057c0| 74 46 6c 75 73 68 46 69 | 6c 65 4d 61 70 2c 20 40 |tFlushFi|leMap, @|
|000057d0| 57 68 61 74 43 6c 6f 73 | 65 46 69 6c 65 4d 61 70 |WhatClos|eFileMap|
|000057e0| 2c 20 40 57 68 61 74 41 | 63 74 69 76 61 74 65 46 |, @WhatA|ctivateF|
|000057f0| 69 6c 65 4d 61 70 2c 20 | 40 57 68 61 74 43 75 72 |ileMap, |@WhatCur|
|00005800| 73 6f 72 46 69 6c 65 4d | 61 70 2c 20 70 6c 75 73 |sorFileM|ap, plus|
|00005810| 43 75 72 73 6f 72 29 3b | 0d 09 09 57 28 37 2c 20 |Cursor);|...W(7, |
|00005820| 27 46 42 55 54 27 2c 20 | 6e 69 6c 2c 20 6e 69 6c |'FBUT', |nil, nil|
|00005830| 2c 20 40 57 68 61 74 43 | 6c 69 63 6b 46 69 6c 65 |, @WhatC|lickFile|
|00005840| 4d 61 70 2c 20 6e 69 6c | 2c 20 6e 69 6c 2c 20 6e |Map, nil|, nil, n|
|00005850| 69 6c 2c 20 6e 69 6c 2c | 20 6e 69 6c 2c 20 30 29 |il, nil,| nil, 0)|
|00005860| 3b 0d 09 09 57 28 38 2c | 20 27 48 4d 41 50 27 2c |;...W(8,| 'HMAP',|
|00005870| 20 40 57 68 61 74 4f 70 | 65 6e 48 65 6c 70 65 72 | @WhatOp|enHelper|
|00005880| 2c 20 40 57 68 61 74 4b | 65 79 48 65 6c 70 65 72 |, @WhatK|eyHelper|
|00005890| 2c 20 40 57 68 61 74 43 | 6c 69 63 6b 48 65 6c 70 |, @WhatC|lickHelp|
|000058a0| 65 72 2c 20 6e 69 6c 2c | 20 40 57 68 61 74 46 6c |er, nil,| @WhatFl|
|000058b0| 75 73 68 48 65 6c 70 65 | 72 2c 20 40 57 68 61 74 |ushHelpe|r, @What|
|000058c0| 43 6c 6f 73 65 48 65 6c | 70 65 72 2c 20 40 57 68 |CloseHel|per, @Wh|
|000058d0| 61 74 41 63 74 69 76 61 | 74 65 48 65 6c 70 65 72 |atActiva|teHelper|
|000058e0| 2c 20 40 57 68 61 74 43 | 75 72 73 6f 72 48 65 6c |, @WhatC|ursorHel|
|000058f0| 70 65 72 2c 20 70 6c 75 | 73 43 75 72 73 6f 72 29 |per, plu|sCursor)|
|00005900| 3b 0d 09 09 57 28 39 2c | 20 27 48 42 55 54 27 2c |;...W(9,| 'HBUT',|
|00005910| 20 6e 69 6c 2c 20 6e 69 | 6c 2c 20 40 57 68 61 74 | nil, ni|l, @What|
|00005920| 43 6c 69 63 6b 48 65 6c | 70 65 72 2c 20 6e 69 6c |ClickHel|per, nil|
|00005930| 2c 20 6e 69 6c 2c 20 6e | 69 6c 2c 20 6e 69 6c 2c |, nil, n|il, nil,|
|00005940| 20 6e 69 6c 2c 20 30 29 | 3b 0d 09 09 57 28 31 30 | nil, 0)|;...W(10|
|00005950| 2c 20 27 42 55 54 4e 27 | 2c 20 40 57 68 61 74 4f |, 'BUTN'|, @WhatO|
|00005960| 70 65 6e 42 75 74 74 6f | 6e 2c 20 6e 69 6c 2c 20 |penButto|n, nil, |
|00005970| 40 57 68 61 74 43 6c 69 | 63 6b 42 75 74 74 6f 6e |@WhatCli|ckButton|
|00005980| 2c 20 6e 69 6c 2c 20 6e | 69 6c 2c 20 6e 69 6c 2c |, nil, n|il, nil,|
|00005990| 20 6e 69 6c 2c 20 6e 69 | 6c 2c 20 30 29 3b 0d 09 | nil, ni|l, 0);..|
|000059a0| 09 57 28 31 31 2c 20 27 | 46 53 49 5a 27 2c 20 6e |.W(11, '|FSIZ', n|
|000059b0| 69 6c 2c 20 6e 69 6c 2c | 20 40 57 68 61 74 43 6c |il, nil,| @WhatCl|
|000059c0| 69 63 6b 46 6f 6e 74 53 | 69 7a 65 2c 20 6e 69 6c |ickFontS|ize, nil|
|000059d0| 2c 20 6e 69 6c 2c 20 6e | 69 6c 2c 20 6e 69 6c 2c |, nil, n|il, nil,|
|000059e0| 20 6e 69 6c 2c 20 30 29 | 3b 0d 09 09 57 28 31 32 | nil, 0)|;...W(12|
|000059f0| 2c 20 27 43 48 4b 42 27 | 2c 20 40 57 68 61 74 4f |, 'CHKB'|, @WhatO|
|00005a00| 70 65 6e 43 68 65 63 6b | 62 6f 78 2c 20 6e 69 6c |penCheck|box, nil|
|00005a10| 2c 20 40 57 68 61 74 43 | 6c 69 63 6b 43 68 65 63 |, @WhatC|lickChec|
|00005a20| 6b 62 6f 78 2c 20 6e 69 | 6c 2c 20 40 57 68 61 74 |kbox, ni|l, @What|
|00005a30| 46 6c 75 73 68 43 68 65 | 63 6b 62 6f 78 2c 20 6e |FlushChe|ckbox, n|
|00005a40| 69 6c 2c 20 6e 69 6c 2c | 20 6e 69 6c 2c 20 30 29 |il, nil,| nil, 0)|
|00005a50| 3b 0d 09 09 57 28 31 33 | 2c 20 27 47 52 45 59 27 |;...W(13|, 'GREY'|
|00005a60| 2c 20 40 57 68 61 74 4f | 70 65 6e 47 72 65 79 42 |, @WhatO|penGreyB|
|00005a70| 6f 78 2c 20 6e 69 6c 2c | 20 6e 69 6c 2c 20 6e 69 |ox, nil,| nil, ni|
|00005a80| 6c 2c 20 6e 69 6c 2c 20 | 6e 69 6c 2c 20 6e 69 6c |l, nil, |nil, nil|
|00005a90| 2c 20 6e 69 6c 2c 20 30 | 29 3b 0d 09 09 57 28 31 |, nil, 0|);...W(1|
|00005aa0| 34 2c 20 27 52 47 42 43 | 27 2c 20 40 57 68 61 74 |4, 'RGBC|', @What|
|00005ab0| 4f 70 65 6e 52 47 42 43 | 6f 6c 6f 75 72 2c 20 6e |OpenRGBC|olour, n|
|00005ac0| 69 6c 2c 20 40 57 68 61 | 74 43 6c 69 63 6b 52 47 |il, @Wha|tClickRG|
|00005ad0| 42 43 6f 6c 6f 75 72 2c | 20 6e 69 6c 2c 20 40 57 |BColour,| nil, @W|
|00005ae0| 68 61 74 46 6c 75 73 68 | 52 47 42 43 6f 6c 6f 75 |hatFlush|RGBColou|
|00005af0| 72 2c 20 40 57 68 61 74 | 43 6c 6f 73 65 52 47 42 |r, @What|CloseRGB|
|00005b00| 43 6f 6c 6f 75 72 2c 20 | 6e 69 6c 2c 20 6e 69 6c |Colour, |nil, nil|
|00005b10| 2c 20 30 29 3b 0d 09 09 | 57 28 31 35 2c 20 27 53 |, 0);...|W(15, 'S|
|00005b20| 4e 44 50 27 2c 20 40 57 | 68 61 74 4f 70 65 6e 53 |NDP', @W|hatOpenS|
|00005b30| 6f 75 6e 64 50 6f 70 75 | 70 2c 20 6e 69 6c 2c 20 |oundPopu|p, nil, |
|00005b40| 40 57 68 61 74 43 6c 69 | 63 6b 53 6f 75 6e 64 50 |@WhatCli|ckSoundP|
|00005b50| 6f 70 75 70 2c 20 6e 69 | 6c 2c 20 40 57 68 61 74 |opup, ni|l, @What|
|00005b60| 46 6c 75 73 68 53 6f 75 | 6e 64 50 6f 70 75 70 2c |FlushSou|ndPopup,|
|00005b70| 20 6e 69 6c 2c 20 6e 69 | 6c 2c 20 6e 69 6c 2c 20 | nil, ni|l, nil, |
|00005b80| 30 29 3b 0d 09 65 6e 64 | 3b 0d 0d 09 70 72 6f 63 |0);..end|;...proc|
|00005b90| 65 64 75 72 65 20 41 62 | 6f 75 74 42 6f 78 55 70 |edure Ab|outBoxUp|
|00005ba0| 64 61 74 65 20 28 64 6c | 67 3a 20 44 69 61 6c 6f |date (dl|g: Dialo|
|00005bb0| 67 50 74 72 3b 20 69 74 | 65 6d 3a 20 69 6e 74 65 |gPtr; it|em: inte|
|00005bc0| 67 65 72 29 3b 0d 09 09 | 76 61 72 0d 09 09 09 72 |ger);...|var....r|
|00005bd0| 3a 20 52 65 63 74 3b 0d | 09 62 65 67 69 6e 0d 09 |: Rect;.|.begin..|
|00005be0| 09 47 65 74 44 49 74 65 | 6d 52 65 63 74 28 64 6c |.GetDIte|mRect(dl|
|00005bf0| 67 2c 20 69 74 65 6d 2c | 20 72 29 3b 0d 09 09 69 |g, item,| r);...i|
|00005c00| 66 20 69 74 65 6d 3d 36 | 20 74 68 65 6e 20 62 65 |f item=6| then be|
|00005c10| 67 69 6e 0d 09 09 09 72 | 20 3a 3d 20 72 3b 0d 09 |gin....r| := r;..|
|00005c20| 09 65 6e 64 3b 0d 09 09 | 63 61 73 65 20 69 74 65 |.end;...|case ite|
|00005c30| 6d 20 6f 66 0d 09 09 09 | 31 3a 20 0d 09 09 09 09 |m of....|1: .....|
|00005c40| 44 72 61 77 49 63 6f 6e | 28 31 32 38 2c 20 72 2c |DrawIcon|(128, r,|
|00005c50| 20 66 61 6c 73 65 29 3b | 0d 09 09 09 33 3a 20 0d | false);|....3: .|
|00005c60| 09 09 09 09 44 69 73 70 | 6c 61 79 53 74 79 6c 65 |....Disp|layStyle|
|00005c70| 64 53 74 72 69 6e 67 28 | 64 6c 67 2c 20 69 74 65 |dString(|dlg, ite|
|00005c80| 6d 2c 20 63 6f 6e 63 61 | 74 28 47 65 74 41 53 74 |m, conca|t(GetASt|
|00005c90| 72 69 6e 67 28 31 32 39 | 2c 20 69 74 65 6d 29 2c |ring(129|, item),|
|00005ca0| 20 61 70 70 5f 76 65 72 | 73 69 6f 6e 2e 73 68 6f | app_ver|sion.sho|
|00005cb0| 72 74 56 65 72 73 69 6f | 6e 29 29 3b 0d 09 09 09 |rtVersio|n));....|
|00005cc0| 6f 74 68 65 72 77 69 73 | 65 0d 09 09 09 09 44 69 |otherwis|e.....Di|
|00005cd0| 73 70 6c 61 79 53 74 79 | 6c 65 64 53 74 72 69 6e |splaySty|ledStrin|
|00005ce0| 67 28 64 6c 67 2c 20 69 | 74 65 6d 2c 20 47 65 74 |g(dlg, i|tem, Get|
|00005cf0| 41 53 74 72 69 6e 67 28 | 31 32 39 2c 20 69 74 65 |AString(|129, ite|
|00005d00| 6d 29 29 3b 0d 09 09 65 | 6e 64 3b 20 28 2a 20 63 |m));...e|nd; (* c|
|00005d10| 61 73 65 20 2a 29 0d 09 | 65 6e 64 3b 20 28 2a 20 |ase *)..|end; (* |
|00005d20| 41 62 6f 75 74 42 6f 78 | 55 70 64 61 74 65 20 2a |AboutBox|Update *|
|00005d30| 29 0d 0d 09 66 75 6e 63 | 74 69 6f 6e 20 49 6e 69 |)...func|tion Ini|
|00005d40| 74 49 43 57 69 6e 64 6f | 77 73 3a 20 4f 53 45 72 |tICWindo|ws: OSEr|
|00005d50| 72 3b 0d 09 09 76 61 72 | 0d 09 09 09 77 74 3a 20 |r;...var|....wt: |
|00005d60| 57 69 6e 64 6f 77 54 79 | 70 65 3b 0d 09 09 09 69 |WindowTy|pe;....i|
|00005d70| 3a 20 69 6e 74 65 67 65 | 72 3b 0d 09 09 09 77 70 |: intege|r;....wp|
|00005d80| 3a 20 57 69 6e 64 6f 77 | 50 74 72 3b 0d 09 09 09 |: Window|Ptr;....|
|00005d90| 6b 69 6e 64 3a 20 69 6e | 74 65 67 65 72 3b 0d 09 |kind: in|teger;..|
|00005da0| 09 09 65 72 72 3a 20 4f | 53 45 72 72 3b 0d 09 62 |..err: O|SErr;..b|
|00005db0| 65 67 69 6e 0d 09 09 49 | 6e 69 74 49 43 57 69 6e |egin...I|nitICWin|
|00005dc0| 64 6f 77 47 6c 6f 62 61 | 6c 73 3b 0d 09 09 49 6e |dowGloba|ls;...In|
|00005dd0| 69 74 57 68 61 74 73 3b | 0d 09 09 66 6f 72 20 77 |itWhats;|...for w|
|00005de0| 74 20 3a 3d 20 57 54 5f | 4e 6f 6e 65 20 74 6f 20 |t := WT_|None to |
|00005df0| 57 54 5f 4c 61 73 74 20 | 64 6f 20 62 65 67 69 6e |WT_Last |do begin|
|00005e00| 0d 09 09 09 77 69 6e 64 | 6f 77 69 6e 66 6f 5b 77 |....wind|owinfo[w|
|00005e10| 74 5d 2e 77 69 6e 64 6f | 77 20 3a 3d 20 6e 69 6c |t].windo|w := nil|
|00005e20| 3b 0d 09 09 09 77 69 6e | 64 6f 77 69 6e 66 6f 5b |;....win|dowinfo[|
|00005e30| 77 74 5d 2e 77 69 6e 64 | 6f 77 5f 6b 65 79 5f 6e |wt].wind|ow_key_n|
|00005e40| 65 65 64 73 5f 74 61 62 | 73 20 3a 3d 20 66 61 6c |eeds_tab|s := fal|
|00005e50| 73 65 3b 0d 09 09 09 77 | 69 6e 64 6f 77 69 6e 66 |se;....w|indowinf|
|00005e60| 6f 5b 77 74 5d 2e 70 6f | 73 69 74 69 6f 6e 2e 68 |o[wt].po|sition.h|
|00005e70| 20 3a 3d 20 30 3b 0d 09 | 09 09 77 69 6e 64 6f 77 | := 0;..|..window|
|00005e80| 69 6e 66 6f 5b 77 74 5d | 2e 70 6f 73 69 74 69 6f |info[wt]|.positio|
|00005e90| 6e 2e 76 20 3a 3d 20 30 | 3b 0d 09 09 65 6e 64 3b |n.v := 0|;...end;|
|00005ea0| 0d 09 09 57 69 6e 64 6f | 77 73 52 65 73 65 74 50 |...Windo|wsResetP|
|00005eb0| 6f 73 69 74 69 6f 6e 73 | 3b 0d 09 09 28 2a 20 62 |ositions|;...(* b|
|00005ec0| 72 69 6e 67 20 74 68 65 | 20 61 62 6f 75 74 20 62 |ring the| about b|
|00005ed0| 6f 78 20 75 70 20 68 69 | 64 64 65 6e 20 61 6e 64 |ox up hi|dden and|
|00005ee0| 20 6c 65 61 76 65 20 69 | 74 20 74 68 65 72 65 20 | leave i|t there |
|00005ef0| 2a 29 0d 09 09 65 72 72 | 20 3a 3d 20 6e 6f 45 72 |*)...err| := noEr|
|00005f00| 72 3b 0d 09 09 77 70 20 | 3a 3d 20 47 65 74 4e 65 |r;...wp |:= GetNe|
|00005f10| 77 44 69 61 6c 6f 67 28 | 31 32 38 2c 20 6e 69 6c |wDialog(|128, nil|
|00005f20| 2c 20 57 69 6e 64 6f 77 | 50 74 72 28 2d 31 29 29 |, Window|Ptr(-1))|
|00005f30| 3b 0d 09 09 77 69 6e 64 | 6f 77 69 6e 66 6f 5b 57 |;...wind|owinfo[W|
|00005f40| 54 5f 41 62 6f 75 74 5d | 2e 77 69 6e 64 6f 77 20 |T_About]|.window |
|00005f50| 3a 3d 20 77 70 3b 0d 09 | 09 69 66 20 77 70 20 3d |:= wp;..|.if wp =|
|00005f60| 20 6e 69 6c 20 74 68 65 | 6e 20 62 65 67 69 6e 0d | nil the|n begin.|
|00005f70| 09 09 09 65 72 72 20 3a | 3d 20 6d 65 6d 46 75 6c |...err :|= memFul|
|00005f80| 6c 45 72 72 3b 0d 09 09 | 65 6e 64 3b 20 28 2a 20 |lErr;...|end; (* |
|00005f90| 69 66 20 2a 29 0d 09 09 | 69 66 20 65 72 72 20 3d |if *)...|if err =|
|00005fa0| 20 6e 6f 45 72 72 20 74 | 68 65 6e 20 62 65 67 69 | noErr t|hen begi|
|00005fb0| 6e 0d 09 09 09 65 72 72 | 20 3a 3d 20 50 72 65 70 |n....err| := Prep|
|00005fc0| 57 69 6e 64 6f 77 28 57 | 54 5f 41 62 6f 75 74 2c |Window(W|T_About,|
|00005fd0| 20 31 32 38 2c 20 77 70 | 29 3b 0d 09 09 65 6e 64 | 128, wp|);...end|
|00005fe0| 3b 20 28 2a 20 69 66 20 | 2a 29 0d 09 09 69 66 20 |; (* if |*)...if |
|00005ff0| 65 72 72 20 3d 20 6e 6f | 45 72 72 20 74 68 65 6e |err = no|Err then|
|00006000| 20 62 65 67 69 6e 0d 09 | 09 09 66 6f 72 20 69 20 | begin..|..for i |
|00006010| 3a 3d 20 31 20 74 6f 20 | 43 6f 75 6e 74 44 49 74 |:= 1 to |CountDIt|
|00006020| 65 6d 73 28 77 70 29 20 | 64 6f 20 62 65 67 69 6e |ems(wp) |do begin|
|00006030| 0d 09 09 09 09 47 65 74 | 44 49 74 65 6d 4b 69 6e |.....Get|DItemKin|
|00006040| 64 28 77 70 2c 20 69 2c | 20 6b 69 6e 64 29 3b 0d |d(wp, i,| kind);.|
|00006050| 09 09 09 09 69 66 20 62 | 61 6e 64 28 6b 69 6e 64 |....if b|and(kind|
|00006060| 2c 20 24 37 66 29 20 3d | 20 75 73 65 72 49 74 65 |, $7f) =| userIte|
|00006070| 6d 20 74 68 65 6e 20 62 | 65 67 69 6e 0d 09 09 09 |m then b|egin....|
|00006080| 09 09 53 65 74 44 49 74 | 65 6d 48 61 6e 64 6c 65 |..SetDIt|emHandle|
|00006090| 28 77 70 2c 20 69 2c 20 | 40 41 62 6f 75 74 42 6f |(wp, i, |@AboutBo|
|000060a0| 78 55 70 64 61 74 65 29 | 3b 0d 09 09 09 09 65 6e |xUpdate)|;.....en|
|000060b0| 64 3b 20 28 2a 20 69 66 | 20 2a 29 0d 09 09 09 65 |d; (* if| *)....e|
|000060c0| 6e 64 3b 20 28 2a 20 66 | 6f 72 20 2a 29 0d 09 09 |nd; (* f|or *)...|
|000060d0| 65 6e 64 3b 20 28 2a 20 | 69 66 20 2a 29 0d 09 09 |end; (* |if *)...|
|000060e0| 49 6e 69 74 49 43 57 69 | 6e 64 6f 77 73 20 3a 3d |InitICWi|ndows :=|
|000060f0| 20 65 72 72 3b 0d 09 65 | 6e 64 3b 20 28 2a 20 49 | err;..e|nd; (* I|
|00006100| 6e 69 74 49 43 57 69 6e | 64 6f 77 73 20 2a 29 0d |nitICWin|dows *).|
|00006110| 0d 65 6e 64 2e 00 00 00 | 00 00 00 00 00 00 00 00 |.end....|........|
|00006120| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006180| 00 00 01 00 00 00 01 54 | 00 00 00 54 00 00 00 46 |.......T|...T...F|
|00006190| 4f 53 45 72 72 3b 0d 09 | 09 76 61 72 0d 09 09 09 |OSErr;..|.var....|
|000061a0| 65 72 72 3a 20 4f 53 45 | 72 72 3b 0d 09 09 09 73 |err: OSE|rr;....s|
|000061b0| 0b 49 43 57 69 6e 64 6f | 77 73 2e 70 02 00 00 00 |.ICWindo|ws.p....|
|000061c0| 54 45 58 54 43 57 49 45 | 00 00 01 38 01 00 00 00 |TEXTCWIE|...8....|
|000061d0| 00 00 54 45 58 54 43 57 | 49 45 00 00 01 38 01 00 |..TEXTCW|IE...8..|
|000061e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000061f0| 00 00 aa 84 1a 3d 00 00 | 60 95 00 00 01 9a 65 72 |.....=..|`.....er|
|00006200| 72 20 3a 3d 20 44 6f 53 | 61 76 65 41 73 3b 0d 09 |r := DoS|aveAs;..|
|00006210| 09 65 6e 64 0d 09 09 65 | 6c 73 65 20 62 65 67 69 |.end...e|lse begi|
|00006220| 6e 0d 09 09 09 43 75 72 | 72 65 6e 74 53 65 65 64 |n....Cur|rentSeed|
|00006230| 28 73 65 65 64 29 3b 0d | 09 09 09 61 20 3a 3d 20 |(seed);.|...a := |
|00006240| 6f 6b 3b 0d 09 09 09 69 | 66 20 6e 6f 74 20 53 61 |ok;....i|f not Sa|
|00006250| 6d 65 53 65 65 64 28 73 | 65 65 64 2c 20 63 75 72 |meSeed(s|eed, cur|
|00006260| 72 65 6e 74 5f 73 65 65 | 64 29 20 74 68 65 6e 20 |rent_see|d) then |
|00006270| 62 65 67 69 6e 0d 09 09 | 09 09 61 20 3a 3d 20 43 |begin...|..a := C|
|00006280| 00 00 00 48 00 09 47 65 | 6e 65 76 61 00 00 00 00 |...H..Ge|neva....|
|00006290| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000062a0| 00 00 00 00 00 00 00 03 | 00 02 00 40 00 04 01 cd |........|...@....|
|000062b0| 02 63 00 40 00 04 01 cd | 02 63 ae 16 af 27 00 00 |.c.@....|.c...'..|
|000062c0| 19 85 00 00 19 85 00 00 | 16 e7 01 00 00 00 00 04 |........|........|
|000062d0| 00 01 00 01 00 00 01 00 | 00 00 01 54 00 00 00 54 |........|...T...T|
|000062e0| 00 00 00 46 00 5c be d4 | 13 1a 00 00 00 1c 00 46 |...F.\..|.......F|
|000062f0| 00 01 4d 50 53 52 00 00 | 00 12 4d 57 42 42 00 00 |..MPSR..|..MWBB..|
|00006300| 00 1e 03 ed ff ff 00 00 | 00 00 00 00 00 00 03 f0 |........|........|
|00006310| ff ff 00 00 00 4c 00 00 | 00 00 00 00 00 00 00 00 |.....L..|........|
|00006320| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00006370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+