home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / progrmng / transklc.sit / TransSkel.c.bin < prev    next >
MacBinary  |  1989-09-14  |  36.4 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


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

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert AMOS Picture Packer (image/amosPicturePacker) ext Supported
1% dexvert Debian floppy split (archive/debianFloppySplit) ext Unsupported
1% dexvert Sound Images sound sample (audio/soundImagesSoundSample) ext Unsupported
1% dexvert DESI-III drawing (image/desiIIIDrawing) ext Unsupported
1% dexvert MS-DOS PMODE extender executable (executable/msdosPMODEExtenderExecutable) ext Unsupported
1% dexvert Alien Trilogytextures (other/alienTrilogyTextures) ext Unsupported
1% dexvert APT cache data (other/aptCacheData) ext Unsupported
1% dexvert CorelTRACE configuration (other/corelTRACEConfiguration) ext Unsupported
1% dexvert Dreamcast Disc (other/dreamcastDisc) ext Unsupported
1% dexvert EST flat binary (other/estFlatBinary) ext Unsupported
1% dexvert Finale Enigma Binary Format (other/finaleEnigmaBinaryFormat) ext Unsupported
1% dexvert Sega Genesis/Megadrive/32x ROM (other/genesisROM) ext Unsupported
1% dexvert Myth: The Fallen Lords game archive (other/mythTheFallenLordsGameArchive) ext Unsupported
1% dexvert Sound Images Sound Driver (other/soundImagesSoundDriver) ext Unsupported
1% dexvert Symantec/Norton Config (other/symantecNortonConfig) ext Unsupported
1% dexvert Vectrex ROM (other/vectrexROM) ext Unsupported
1% dexvert BIS raP encoded format (other/bisraPEncoded) ext Unsupported
1% dexvert Pascal Script binary (other/pascalScriptBinary) ext Unsupported
1% dexvert 7th Level game data archive (other/seventhLevelGameDataArchive) ext Unsupported
1% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Binary Text (image/binaryText) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary, Thu Apr 21 17:11:02 1988, modified Thu Feb 9 14:10:56 1989, creator Think C, type ASCII, 37074 bytes "TransSkel.c" default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 1 default (weak)
100% lsar MacBinary default
100% gt2 MAC Bilddatei default (weak)


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 54 72 61 6e 73 53 | 6b 65 6c 2e 63 00 00 00 |..TransS|kel.c...|
|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 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 90 d2 00 | 00 00 00 9e 94 15 e6 a0 |........|........|
|00000060| 17 92 c0 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000080| 2f 2a 0d 09 54 72 61 6e | 73 53 6b 65 6c 20 76 65 |/*..Tran|sSkel ve|
|00000090| 72 73 69 6f 6e 20 32 2e | 30 31 20 2d 20 54 72 61 |rsion 2.|01 - Tra|
|000000a0| 6e 73 70 6f 72 74 61 62 | 6c 65 20 61 70 70 6c 69 |nsportab|le appli|
|000000b0| 63 61 74 69 6f 6e 20 73 | 6b 65 6c 65 74 6f 6e 0d |cation s|keleton.|
|000000c0| 09 0d 09 54 72 61 6e 73 | 53 6b 65 6c 20 69 73 20 |...Trans|Skel is |
|000000d0| 70 75 62 6c 69 63 20 64 | 6f 6d 61 69 6e 20 61 6e |public d|omain an|
|000000e0| 64 20 77 61 73 20 6f 72 | 69 67 69 6e 61 6c 6c 79 |d was or|iginally|
|000000f0| 20 77 72 69 74 74 65 6e | 20 62 79 3a 0d 0d 09 09 | written| by:....|
|00000100| 09 09 50 61 75 6c 20 44 | 75 42 6f 69 73 0d 09 09 |..Paul D|uBois...|
|00000110| 09 09 57 69 73 63 6f 6e | 73 69 6e 20 52 65 67 69 |..Wiscon|sin Regi|
|00000120| 6f 6e 61 6c 20 50 72 69 | 6d 61 74 65 20 52 65 73 |onal Pri|mate Res|
|00000130| 65 61 72 63 68 20 43 65 | 6e 74 65 72 0d 09 09 09 |earch Ce|nter....|
|00000140| 09 31 32 32 30 20 43 61 | 70 69 74 61 6c 20 43 6f |.1220 Ca|pital Co|
|00000150| 75 72 74 0d 09 09 09 09 | 4d 61 64 69 73 6f 6e 20 |urt.....|Madison |
|00000160| 57 49 20 20 35 33 37 31 | 35 2d 31 32 39 39 20 20 |WI 5371|5-1299 |
|00000170| 55 53 41 0d 0d 09 55 55 | 43 50 3a 09 09 7b 61 6c |USA...UU|CP:..{al|
|00000180| 6c 65 67 72 61 2c 75 75 | 6e 65 74 7d 21 75 77 76 |legra,uu|net}!uwv|
|00000190| 61 78 21 72 68 65 73 75 | 73 21 64 75 62 6f 69 73 |ax!rhesu|s!dubois|
|000001a0| 0d 09 49 6e 74 65 72 6e | 65 74 3a 09 64 75 62 6f |..Intern|et:.dubo|
|000001b0| 69 73 40 70 72 69 6d 61 | 74 65 2e 77 69 73 63 2e |is@prima|te.wisc.|
|000001c0| 65 64 75 0d 09 09 09 0d | 09 41 64 64 69 74 69 6f |edu.....|.Additio|
|000001d0| 6e 61 6c 20 63 68 61 6e | 67 65 73 20 77 65 72 65 |nal chan|ges were|
|000001e0| 20 6d 61 64 65 20 62 79 | 0d 09 09 0d 09 09 09 09 | made by|........|
|000001f0| 4f 77 65 6e 20 48 61 72 | 74 6e 65 74 74 0d 09 09 |Owen Har|tnett...|
|00000200| 09 09 4f 48 4d 20 53 6f | 66 74 77 61 72 65 20 43 |..OHM So|ftware C|
|00000210| 6f 6d 70 61 6e 79 0d 09 | 09 09 09 31 36 33 20 52 |ompany..|...163 R|
|00000220| 69 63 68 61 72 64 20 44 | 72 69 76 65 0d 09 09 09 |ichard D|rive....|
|00000230| 09 54 69 76 65 72 74 6f | 6e 2c 20 52 49 20 30 32 |.Tiverto|n, RI 02|
|00000240| 38 37 38 20 20 55 53 41 | 0d 09 09 09 0d 09 55 55 |878 USA|......UU|
|00000250| 43 50 3a 09 09 7b 61 6c | 6c 65 67 72 61 2c 75 75 |CP:..{al|legra,uu|
|00000260| 6e 65 74 7d 21 62 72 75 | 6e 69 78 21 6f 6d 68 09 |net}!bru|nix!omh.|
|00000270| 0d 09 49 6e 74 65 72 6e | 65 74 3a 09 6f 6d 68 40 |..Intern|et:.omh@|
|00000280| 63 73 2e 62 72 6f 77 6e | 2e 65 64 75 0d 09 43 53 |cs.brown|.edu..CS|
|00000290| 4e 45 54 3a 09 09 6f 6d | 68 40 63 73 2e 62 72 6f |NET:..om|h@cs.bro|
|000002a0| 77 6e 2e 65 64 75 2e 43 | 53 4e 45 54 20 09 09 0d |wn.edu.C|SNET ...|
|000002b0| 0d 09 4f 77 65 6e 20 69 | 73 20 61 6c 73 6f 20 72 |..Owen i|s also r|
|000002c0| 65 73 70 6f 6e 73 69 62 | 6c 65 20 66 6f 72 20 74 |esponsib|le for t|
|000002d0| 68 65 20 70 6f 72 74 20 | 74 6f 20 4c 69 67 68 74 |he port |to Light|
|000002e0| 73 70 65 65 64 20 50 61 | 73 63 61 6c 2e 0d 09 0d |speed Pa|scal....|
|000002f0| 09 54 68 69 73 20 76 65 | 72 73 69 6f 6e 20 6f 66 |.This ve|rsion of|
|00000300| 20 54 72 61 6e 73 53 6b | 65 6c 20 77 72 69 74 74 | TransSk|el writt|
|00000310| 65 6e 20 66 6f 72 20 4c | 69 67 68 74 73 70 65 65 |en for L|ightspee|
|00000320| 64 43 2e 20 20 4c 69 67 | 68 74 73 70 65 65 64 43 |dC. Lig|htspeedC|
|00000330| 20 69 73 20 61 0d 09 74 | 72 61 64 65 6d 61 72 6b | is a..t|rademark|
|00000340| 20 6f 66 3a 0d 09 09 09 | 54 48 49 4e 4b 20 54 65 | of:....|THINK Te|
|00000350| 63 68 6e 6f 6c 6f 67 69 | 65 73 2c 20 49 6e 63 0d |chnologi|es, Inc.|
|00000360| 09 09 09 34 32 30 20 42 | 65 64 66 6f 72 64 20 53 |...420 B|edford S|
|00000370| 74 72 65 65 74 20 20 53 | 75 69 74 65 20 33 35 30 |treet S|uite 350|
|00000380| 0d 09 09 09 4c 65 78 69 | 6e 67 74 6f 6e 2c 20 4d |....Lexi|ngton, M|
|00000390| 41 20 20 30 32 31 37 33 | 20 20 55 53 41 0d 0d 09 |A 02173| USA...|
|000003a0| 43 68 61 6e 67 65 20 68 | 69 73 74 6f 72 79 20 69 |Change h|istory i|
|000003b0| 73 20 69 6e 20 54 53 48 | 69 73 74 6f 72 79 2e 63 |s in TSH|istory.c|
|000003c0| 0d 2a 2f 0d 0d 0d 2f 2a | 0d 09 54 68 65 20 66 6f |.*/.../*|..The fo|
|000003d0| 6c 6c 6f 77 69 6e 67 20 | 73 79 6d 62 6f 6c 20 63 |llowing |symbol c|
|000003e0| 6f 6e 74 72 6f 6c 73 20 | 73 75 70 70 6f 72 74 20 |ontrols |support |
|000003f0| 66 6f 72 20 64 69 61 6c | 6f 67 73 2e 0d 09 22 23 |for dial|ogs..."#|
|00000400| 64 65 66 69 6e 65 09 73 | 75 70 70 6f 72 74 44 69 |define.s|upportDi|
|00000410| 61 6c 6f 67 73 22 20 65 | 6e 61 62 6c 65 73 20 73 |alogs" e|nables s|
|00000420| 75 70 70 6f 72 74 2e 0d | 09 22 23 75 6e 64 65 66 |upport..|."#undef|
|00000430| 09 09 73 75 70 70 6f 72 | 74 44 69 61 6c 6f 67 73 |..suppor|tDialogs|
|00000440| 22 20 64 69 73 61 62 6c | 65 73 20 73 75 70 70 6f |" disabl|es suppo|
|00000450| 72 74 2e 0d 2a 2f 0d 0d | 23 20 64 65 66 69 6e 65 |rt..*/..|# define|
|00000460| 09 73 75 70 70 6f 72 74 | 44 69 61 6c 6f 67 73 0d |.support|Dialogs.|
|00000470| 0d 0d 23 20 69 66 64 65 | 66 09 09 73 75 70 70 6f |..# ifde|f..suppo|
|00000480| 72 74 44 69 61 6c 6f 67 | 73 0d 23 09 69 6e 63 6c |rtDialog|s.#.incl|
|00000490| 75 64 65 09 3c 44 69 61 | 6c 6f 67 4d 67 72 2e 68 |ude.<Dia|logMgr.h|
|000004a0| 3e 0d 23 20 65 6c 73 65 | 0d 23 09 69 6e 63 6c 75 |>.# else|.#.inclu|
|000004b0| 64 65 09 3c 57 69 6e 64 | 6f 77 4d 67 72 2e 68 3e |de.<Wind|owMgr.h>|
|000004c0| 0d 23 20 65 6e 64 69 66 | 0d 0d 23 20 69 6e 63 6c |.# endif|..# incl|
|000004d0| 75 64 65 09 3c 45 76 65 | 6e 74 4d 67 72 2e 68 3e |ude.<Eve|ntMgr.h>|
|000004e0| 0d 23 20 69 6e 63 6c 75 | 64 65 09 3c 4d 65 6e 75 |.# inclu|de.<Menu|
|000004f0| 4d 67 72 2e 68 3e 0d 0d | 0d 2f 2a 0d 09 49 6e 74 |Mgr.h>..|./*..Int|
|00000500| 65 67 65 72 20 61 6e 64 | 20 4c 6f 6e 67 69 6e 74 |eger and| Longint|
|00000510| 20 73 68 6f 75 6c 64 20 | 62 65 20 74 79 70 65 64 | should |be typed|
|00000520| 65 66 27 64 20 74 6f 20 | 74 68 65 20 32 2d 62 79 |ef'd to |the 2-by|
|00000530| 74 65 20 61 6e 64 20 34 | 2d 62 79 74 65 0d 09 69 |te and 4|-byte..i|
|00000540| 6e 74 65 67 65 72 20 74 | 79 70 65 73 20 66 6f 72 |nteger t|ypes for|
|00000550| 20 74 68 65 20 63 6f 6d | 70 69 6c 65 72 20 62 65 | the com|piler be|
|00000560| 69 6e 67 20 75 73 65 64 | 2e 20 20 54 68 65 73 65 |ing used|. These|
|00000570| 20 61 72 65 20 69 6e 74 | 20 61 6e 64 20 6c 6f 6e | are int| and lon|
|00000580| 67 0d 09 66 6f 72 20 4c | 69 67 68 74 73 70 65 65 |g..for L|ightspee|
|00000590| 64 43 2e 0d 2a 2f 0d 0d | 74 79 70 65 64 65 66 20 |dC..*/..|typedef |
|000005a0| 69 6e 74 09 09 49 6e 74 | 65 67 65 72 3b 0d 74 79 |int..Int|eger;.ty|
|000005b0| 70 65 64 65 66 20 6c 6f | 6e 67 09 4c 6f 6e 67 69 |pedef lo|ng.Longi|
|000005c0| 6e 74 3b 0d 0d 0d 23 20 | 64 65 66 69 6e 65 09 6e |nt;...# |define.n|
|000005d0| 69 6c 09 09 09 30 4c 0d | 23 20 64 65 66 69 6e 65 |il...0L.|# define|
|000005e0| 09 6d 42 61 72 48 65 69 | 67 68 74 09 32 30 09 2f |.mBarHei|ght.20./|
|000005f0| 2a 20 6d 65 6e 75 20 62 | 61 72 20 68 65 69 67 68 |* menu b|ar heigh|
|00000600| 74 2e 20 20 41 6c 6c 20 | 77 69 6e 64 6f 77 20 73 |t. All |window s|
|00000610| 69 7a 69 6e 67 0d 09 09 | 09 09 09 09 09 20 20 20 |izing...|..... |
|00000620| 63 6f 64 65 20 74 61 6b | 65 73 20 74 68 69 73 20 |code tak|es this |
|00000630| 69 6e 74 6f 20 61 63 63 | 6f 75 6e 74 20 2a 2f 0d |into acc|ount */.|
|00000640| 0d 0d 2f 2a 0d 09 4e 65 | 77 28 54 79 70 65 4e 61 |../*..Ne|w(TypeNa|
|00000650| 6d 65 29 20 72 65 74 75 | 72 6e 73 20 68 61 6e 64 |me) retu|rns hand|
|00000660| 6c 65 20 74 6f 20 6e 65 | 77 20 6f 62 6a 65 63 74 |le to ne|w object|
|00000670| 2c 20 66 6f 72 20 61 6e | 79 20 54 79 70 65 4e 61 |, for an|y TypeNa|
|00000680| 6d 65 2e 0d 09 49 66 20 | 74 68 65 72 65 20 69 73 |me...If |there is|
|00000690| 20 69 6e 73 75 66 66 69 | 63 69 65 6e 74 20 6d 65 | insuffi|cient me|
|000006a0| 6d 6f 72 79 2c 20 74 68 | 65 20 72 65 73 75 6c 74 |mory, th|e result|
|000006b0| 20 69 73 20 6e 69 6c 2e | 0d 2a 2f 0d 0d 23 20 64 | is nil.|.*/..# d|
|000006c0| 65 66 69 6e 65 09 4e 65 | 77 28 78 29 09 28 78 20 |efine.Ne|w(x).(x |
|000006d0| 2a 2a 29 20 4e 65 77 48 | 61 6e 64 6c 65 20 28 28 |**) NewH|andle ((|
|000006e0| 53 69 7a 65 29 20 73 69 | 7a 65 6f 66 20 28 78 29 |Size) si|zeof (x)|
|000006f0| 29 0d 0d 0d 0d 2f 2a 0d | 09 57 69 6e 64 6f 77 20 |)..../*.|.Window |
|00000700| 61 6e 64 20 4d 65 6e 75 | 20 68 61 6e 64 6c 65 72 |and Menu| handler|
|00000710| 20 74 79 70 65 73 2c 20 | 63 6f 6e 73 74 61 6e 74 | types, |constant|
|00000720| 73 2c 20 76 61 72 69 61 | 62 6c 65 73 2e 0d 0d 09 |s, varia|bles....|
|00000730| 77 68 4c 69 73 74 20 61 | 6e 64 20 6d 68 4c 69 73 |whList a|nd mhLis|
|00000740| 74 20 61 72 65 20 74 68 | 65 20 6c 69 73 74 73 20 |t are th|e lists |
|00000750| 6f 66 20 77 69 6e 64 6f | 77 20 61 6e 64 20 6d 65 |of windo|w and me|
|00000760| 6e 75 20 68 61 6e 64 6c | 65 72 73 2e 0d 09 77 68 |nu handl|ers...wh|
|00000770| 43 6c 6f 62 4f 6e 52 6d | 76 65 20 61 6e 64 20 6d |ClobOnRm|ve and m|
|00000780| 68 43 6c 6f 62 4f 6e 52 | 6d 76 65 20 61 72 65 20 |hClobOnR|mve are |
|00000790| 74 72 75 65 20 69 66 20 | 74 68 65 20 68 61 6e 64 |true if |the hand|
|000007a0| 6c 65 72 20 64 69 73 70 | 6f 73 61 6c 20 70 72 6f |ler disp|osal pro|
|000007b0| 63 0d 09 69 73 20 74 6f | 20 62 65 20 63 61 6c 6c |c..is to| be call|
|000007c0| 65 64 20 77 68 65 6e 20 | 61 20 68 61 6e 64 6c 65 |ed when |a handle|
|000007d0| 72 20 69 73 20 72 65 6d | 6f 76 65 64 2e 20 20 54 |r is rem|oved. T|
|000007e0| 68 65 79 20 61 72 65 20 | 74 65 6d 70 6f 72 61 72 |hey are |temporar|
|000007f0| 69 6c 79 20 73 65 74 0d | 09 66 61 6c 73 65 20 77 |ily set.|.false w|
|00000800| 68 65 6e 20 68 61 6e 64 | 6c 65 72 73 20 61 72 65 |hen hand|lers are|
|00000810| 20 69 6e 73 74 61 6c 6c | 65 64 20 66 6f 72 20 77 | install|ed for w|
|00000820| 69 6e 64 6f 77 73 20 6f | 72 20 6d 65 6e 75 73 20 |indows o|r menus |
|00000830| 74 68 61 74 20 61 6c 72 | 65 61 64 79 0d 09 68 61 |that alr|eady..ha|
|00000840| 76 65 20 68 61 6e 64 6c | 65 72 73 20 2d 20 74 68 |ve handl|ers - th|
|00000850| 65 20 6f 6c 64 20 68 61 | 6e 64 6c 65 72 20 69 73 |e old ha|ndler is|
|00000860| 20 72 65 6d 6f 76 65 64 | 20 57 49 54 48 4f 55 54 | removed| WITHOUT|
|00000870| 20 63 61 6c 6c 69 6e 67 | 20 74 68 65 0d 09 64 69 | calling| the..di|
|00000880| 73 70 6f 73 61 6c 20 70 | 72 6f 63 2e 0d 0d 09 44 |sposal p|roc....D|
|00000890| 65 66 61 75 6c 74 20 6c | 6f 77 65 72 20 6c 69 6d |efault l|ower lim|
|000008a0| 69 74 73 20 6f 6e 20 77 | 69 6e 64 6f 77 20 73 69 |its on w|indow si|
|000008b0| 7a 69 6e 67 20 6f 66 20 | 38 30 20 70 69 78 65 6c |zing of |80 pixel|
|000008c0| 73 20 62 6f 74 68 20 64 | 69 72 65 63 74 69 6f 6e |s both d|irection|
|000008d0| 73 20 69 73 0d 09 73 75 | 66 66 69 63 69 65 6e 74 |s is..su|fficient|
|000008e0| 20 74 6f 20 61 6c 6c 6f | 77 20 74 65 78 74 20 77 | to allo|w text w|
|000008f0| 69 6e 64 6f 77 73 20 72 | 6f 6f 6d 20 74 6f 20 64 |indows r|oom to d|
|00000900| 72 61 77 20 61 20 67 72 | 6f 77 20 62 6f 78 20 61 |raw a gr|ow box a|
|00000910| 6e 64 20 73 63 72 6f 6c | 6c 0d 09 62 61 72 73 20 |nd scrol|l..bars |
|00000920| 77 69 74 68 6f 75 74 20 | 68 61 76 69 6e 67 20 74 |without |having t|
|00000930| 68 65 20 74 68 75 6d 62 | 20 61 6e 64 20 61 72 72 |he thumb| and arr|
|00000940| 6f 77 73 20 6f 76 65 72 | 6c 61 70 2e 20 20 54 68 |ows over|lap. Th|
|00000950| 65 73 65 20 76 61 6c 75 | 65 73 20 6d 61 79 0d 09 |ese valu|es may..|
|00000960| 62 65 20 63 68 61 6e 67 | 65 64 20 69 66 20 73 75 |be chang|ed if su|
|00000970| 63 68 20 61 20 63 6f 6e | 73 74 72 61 69 6e 74 20 |ch a con|straint |
|00000980| 69 73 20 75 6e 64 65 73 | 69 72 61 62 6c 65 20 77 |is undes|irable w|
|00000990| 69 74 68 20 53 6b 65 6c | 47 72 6f 77 42 6f 75 6e |ith Skel|GrowBoun|
|000009a0| 64 73 2e 0d 09 44 65 66 | 61 75 6c 74 20 75 70 70 |ds...Def|ault upp|
|000009b0| 65 72 20 6c 69 6d 69 74 | 73 20 61 72 65 20 66 6f |er limit|s are fo|
|000009c0| 72 20 74 68 65 20 4d 61 | 63 69 6e 74 6f 73 68 2c |r the Ma|cintosh,|
|000009d0| 20 6e 6f 74 20 74 68 65 | 20 4c 69 73 61 2c 20 62 | not the| Lisa, b|
|000009e0| 75 74 20 61 72 65 20 73 | 65 74 0d 09 70 65 72 20 |ut are s|et..per |
|000009f0| 6d 61 63 68 69 6e 65 20 | 69 6e 20 53 6b 65 6c 49 |machine |in SkelI|
|00000a00| 6e 69 74 2e 0d 2a 2f 0d | 0d 74 79 70 65 64 65 66 |nit..*/.|.typedef|
|00000a10| 20 73 74 72 75 63 74 20 | 57 48 61 6e 64 6c 65 72 | struct |WHandler|
|00000a20| 09 57 48 61 6e 64 6c 65 | 72 3b 0d 0d 73 74 72 75 |.WHandle|r;..stru|
|00000a30| 63 74 20 57 48 61 6e 64 | 6c 65 72 0d 7b 0d 09 57 |ct WHand|ler.{..W|
|00000a40| 69 6e 64 6f 77 50 74 72 | 09 77 68 57 69 6e 64 3b |indowPtr|.whWind;|
|00000a50| 09 09 09 2f 2a 20 77 69 | 6e 64 6f 77 2f 64 69 61 |.../* wi|ndow/dia|
|00000a60| 6c 6f 67 20 74 6f 20 62 | 65 20 68 61 6e 64 6c 65 |log to b|e handle|
|00000a70| 64 20 20 2a 2f 0d 09 50 | 72 6f 63 50 74 72 09 09 |d */..P|rocPtr..|
|00000a80| 77 68 43 6c 6f 62 62 65 | 72 3b 09 09 2f 2a 20 64 |whClobbe|r;../* d|
|00000a90| 61 74 61 20 73 74 72 75 | 63 74 75 72 65 20 64 69 |ata stru|cture di|
|00000aa0| 73 70 6f 73 61 6c 20 70 | 72 6f 63 20 2a 2f 0d 09 |sposal p|roc */..|
|00000ab0| 50 72 6f 63 50 74 72 09 | 09 77 68 4d 6f 75 73 65 |ProcPtr.|.whMouse|
|00000ac0| 3b 09 09 2f 2a 20 6d 6f | 75 73 65 2d 63 6c 69 63 |;../* mo|use-clic|
|00000ad0| 6b 20 68 61 6e 64 6c 65 | 72 20 70 72 6f 63 20 20 |k handle|r proc |
|00000ae0| 20 20 20 2a 2f 0d 09 50 | 72 6f 63 50 74 72 09 09 | */..P|rocPtr..|
|00000af0| 77 68 4b 65 79 3b 09 09 | 09 2f 2a 20 6b 65 79 2d |whKey;..|./* key-|
|00000b00| 63 6c 69 63 6b 20 68 61 | 6e 64 6c 65 72 20 70 72 |click ha|ndler pr|
|00000b10| 6f 63 20 20 20 20 20 20 | 20 2a 2f 0d 09 50 72 6f |oc | */..Pro|
|00000b20| 63 50 74 72 09 09 77 68 | 55 70 64 61 74 65 3b 09 |cPtr..wh|Update;.|
|00000b30| 09 2f 2a 20 75 70 64 61 | 74 65 20 68 61 6e 64 6c |./* upda|te handl|
|00000b40| 65 72 20 70 72 6f 63 20 | 20 20 20 20 20 20 20 20 |er proc | |
|00000b50| 20 2a 2f 0d 09 50 72 6f | 63 50 74 72 09 09 77 68 | */..Pro|cPtr..wh|
|00000b60| 41 63 74 69 76 61 74 65 | 3b 09 09 2f 2a 20 61 63 |Activate|;../* ac|
|00000b70| 74 69 76 61 74 65 20 65 | 76 65 6e 74 20 68 61 6e |tivate e|vent han|
|00000b80| 64 6c 65 72 20 70 72 6f | 63 20 20 2a 2f 0d 09 50 |dler pro|c */..P|
|00000b90| 72 6f 63 50 74 72 09 09 | 77 68 43 6c 6f 73 65 3b |rocPtr..|whClose;|
|00000ba0| 09 09 2f 2a 20 63 6c 6f | 73 65 20 22 65 76 65 6e |../* clo|se "even|
|00000bb0| 74 22 20 68 61 6e 64 6c | 65 72 20 70 72 6f 63 20 |t" handl|er proc |
|00000bc0| 20 20 2a 2f 0d 09 50 72 | 6f 63 50 74 72 09 09 77 | */..Pr|ocPtr..w|
|00000bd0| 68 49 64 6c 65 3b 09 09 | 09 2f 2a 20 6d 61 69 6e |hIdle;..|./* main|
|00000be0| 20 6c 6f 6f 70 20 70 72 | 6f 63 20 20 20 20 20 20 | loop pr|oc |
|00000bf0| 20 20 20 20 20 20 20 20 | 20 2a 2f 0d 23 20 69 66 | | */.# if|
|00000c00| 64 65 66 09 73 75 70 70 | 6f 72 74 44 69 61 6c 6f |def.supp|ortDialo|
|00000c10| 67 73 0d 09 50 72 6f 63 | 50 74 72 09 09 77 68 45 |gs..Proc|Ptr..whE|
|00000c20| 76 65 6e 74 3b 09 09 2f | 2a 20 65 76 65 6e 74 20 |vent;../|* event |
|00000c30| 70 72 6f 63 20 20 20 20 | 20 20 20 20 20 20 20 20 |proc | |
|00000c40| 20 20 20 20 20 20 20 2a | 2f 0d 23 20 65 6e 64 69 | *|/.# endi|
|00000c50| 66 0d 09 52 65 63 74 09 | 09 77 68 47 72 6f 77 3b |f..Rect.|.whGrow;|
|00000c60| 09 09 09 2f 2a 20 6c 69 | 6d 69 74 73 20 6f 6e 20 |.../* li|mits on |
|00000c70| 77 69 6e 64 6f 77 20 73 | 69 7a 69 6e 67 20 20 20 |window s|izing |
|00000c80| 20 20 20 2a 2f 0d 09 42 | 6f 6f 6c 65 61 6e 09 09 | */..B|oolean..|
|00000c90| 77 68 53 69 7a 65 64 3b | 09 09 2f 2a 20 74 72 75 |whSized;|../* tru|
|00000ca0| 65 20 3d 20 77 69 6e 64 | 6f 77 20 77 61 73 20 72 |e = wind|ow was r|
|00000cb0| 65 73 69 7a 65 64 20 20 | 20 20 2a 2f 0d 09 42 6f |esized | */..Bo|
|00000cc0| 6f 6c 65 61 6e 09 09 77 | 68 46 72 6f 6e 74 4f 6e |olean..w|hFrontOn|
|00000cd0| 6c 79 3b 09 2f 2a 20 74 | 72 75 65 20 3d 20 69 64 |ly;./* t|rue = id|
|00000ce0| 6c 65 20 6f 6e 6c 79 20 | 77 68 65 6e 20 61 63 74 |le only |when act|
|00000cf0| 69 76 65 20 2a 2f 0d 09 | 57 48 61 6e 64 6c 65 72 |ive */..|WHandler|
|00000d00| 09 2a 2a 77 68 4e 65 78 | 74 3b 09 09 2f 2a 20 6e |.**whNex|t;../* n|
|00000d10| 65 78 74 20 77 69 6e 64 | 6f 77 20 68 61 6e 64 6c |ext wind|ow handl|
|00000d20| 65 72 20 20 20 20 20 20 | 20 20 20 20 2a 2f 0d 7d |er | */.}|
|00000d30| 3b 0d 0d 73 74 61 74 69 | 63 20 57 48 61 6e 64 6c |;..stati|c WHandl|
|00000d40| 65 72 09 2a 2a 77 68 4c | 69 73 74 20 3d 20 6e 69 |er.**whL|ist = ni|
|00000d50| 6c 3b 0d 73 74 61 74 69 | 63 20 42 6f 6f 6c 65 61 |l;.stati|c Boolea|
|00000d60| 6e 09 77 68 43 6c 6f 62 | 4f 6e 52 6d 76 65 20 3d |n.whClob|OnRmve =|
|00000d70| 20 74 72 75 65 3b 0d 73 | 74 61 74 69 63 20 52 65 | true;.s|tatic Re|
|00000d80| 63 74 09 09 67 72 6f 77 | 52 65 63 74 20 3d 20 7b |ct..grow|Rect = {|
|00000d90| 20 38 30 2c 20 38 30 2c | 20 35 31 32 2c 20 33 34 | 80, 80,| 512, 34|
|00000da0| 32 20 2d 20 6d 42 61 72 | 48 65 69 67 68 74 20 7d |2 - mBar|Height }|
|00000db0| 3b 0d 0d 74 79 70 65 64 | 65 66 20 73 74 72 75 63 |;..typed|ef struc|
|00000dc0| 74 20 4d 48 61 6e 64 6c | 65 72 09 4d 48 61 6e 64 |t MHandl|er.MHand|
|00000dd0| 6c 65 72 3b 0d 0d 73 74 | 72 75 63 74 20 4d 48 61 |ler;..st|ruct MHa|
|00000de0| 6e 64 6c 65 72 0d 7b 0d | 09 49 6e 74 65 67 65 72 |ndler.{.|.Integer|
|00000df0| 09 09 6d 68 49 44 3b 09 | 09 09 2f 2a 20 6d 65 6e |..mhID;.|../* men|
|00000e00| 75 20 69 64 20 20 20 20 | 20 20 20 20 20 20 20 20 |u id | |
|00000e10| 20 20 20 20 20 20 20 20 | 20 2a 2f 0d 09 50 72 6f | | */..Pro|
|00000e20| 63 50 74 72 09 09 6d 68 | 53 65 6c 65 63 74 3b 09 |cPtr..mh|Select;.|
|00000e30| 09 2f 2a 20 69 74 65 6d | 20 73 65 6c 65 63 74 69 |./* item| selecti|
|00000e40| 6f 6e 20 68 61 6e 64 6c | 65 72 20 70 72 6f 63 20 |on handl|er proc |
|00000e50| 2a 2f 0d 09 50 72 6f 63 | 50 74 72 09 09 6d 68 43 |*/..Proc|Ptr..mhC|
|00000e60| 6c 6f 62 62 65 72 3b 09 | 09 2f 2a 20 6d 65 6e 75 |lobber;.|./* menu|
|00000e70| 20 64 69 73 70 6f 73 61 | 6c 20 68 61 6e 64 6c 65 | disposa|l handle|
|00000e80| 72 20 70 72 6f 63 20 20 | 2a 2f 0d 09 4d 48 61 6e |r proc |*/..MHan|
|00000e90| 64 6c 65 72 09 2a 2a 6d | 68 4e 65 78 74 3b 09 09 |dler.**m|hNext;..|
|00000ea0| 2f 2a 20 6e 65 78 74 20 | 6d 65 6e 75 20 68 61 6e |/* next |menu han|
|00000eb0| 64 6c 65 72 20 20 20 20 | 20 20 20 20 20 20 20 2a |dler | *|
|00000ec0| 2f 0d 7d 3b 0d 0d 0d 73 | 74 61 74 69 63 20 4d 48 |/.};...s|tatic MH|
|00000ed0| 61 6e 64 6c 65 72 09 2a | 2a 6d 68 4c 69 73 74 20 |andler.*|*mhList |
|00000ee0| 3d 20 6e 69 6c 3b 09 09 | 09 2f 2a 20 6c 69 73 74 |= nil;..|./* list|
|00000ef0| 20 6f 66 20 6d 65 6e 75 | 20 68 61 6e 64 6c 65 72 | of menu| handler|
|00000f00| 73 20 2a 2f 0d 73 74 61 | 74 69 63 20 42 6f 6f 6c |s */.sta|tic Bool|
|00000f10| 65 61 6e 09 6d 68 43 6c | 6f 62 4f 6e 52 6d 76 65 |ean.mhCl|obOnRmve|
|00000f20| 20 3d 20 74 72 75 65 3b | 0d 0d 0d 2f 2a 0d 09 56 | = true;|.../*..V|
|00000f30| 61 72 69 61 62 6c 65 73 | 20 66 6f 72 20 64 65 66 |ariables| for def|
|00000f40| 61 75 6c 74 20 41 70 70 | 6c 65 20 6d 65 6e 75 20 |ault App|le menu |
|00000f50| 68 61 6e 64 6c 65 72 2e | 20 20 61 70 70 6c 65 49 |handler.| appleI|
|00000f60| 44 20 69 73 20 73 65 74 | 20 74 6f 20 31 20 69 66 |D is set| to 1 if|
|00000f70| 0d 09 53 6b 65 6c 41 70 | 70 6c 65 20 69 73 20 63 |..SkelAp|ple is c|
|00000f80| 61 6c 6c 65 64 20 61 6e | 64 20 69 73 20 74 68 65 |alled an|d is the|
|00000f90| 20 69 64 20 6f 66 20 74 | 68 65 20 41 70 70 6c 65 | id of t|he Apple|
|00000fa0| 20 6d 65 6e 75 2c 20 61 | 70 70 6c 65 41 62 6f 75 | menu, a|ppleAbou|
|00000fb0| 74 50 72 6f 63 0d 09 69 | 73 20 74 68 65 20 70 72 |tProc..i|s the pr|
|00000fc0| 6f 63 65 64 75 72 65 20 | 74 6f 20 65 78 65 63 75 |ocedure |to execu|
|00000fd0| 74 65 20 69 66 20 74 68 | 65 72 65 20 69 73 20 61 |te if th|ere is a|
|00000fe0| 6e 20 41 62 6f 75 74 2e | 2e 2e 20 69 74 65 6d 20 |n About.|.. item |
|00000ff0| 61 6e 64 20 69 74 27 73 | 0d 09 63 68 6f 73 65 6e |and it's|..chosen|
|00001000| 20 66 72 6f 6d 20 74 68 | 65 20 41 70 70 6c 65 20 | from th|e Apple |
|00001010| 6d 65 6e 75 2e 20 20 49 | 66 20 64 6f 41 62 6f 75 |menu. I|f doAbou|
|00001020| 74 20 69 73 20 74 72 75 | 65 2c 20 74 68 65 6e 20 |t is tru|e, then |
|00001030| 74 68 65 20 6d 65 6e 75 | 0d 09 63 6f 6e 74 61 69 |the menu|..contai|
|00001040| 6e 73 20 74 68 65 20 41 | 62 6f 75 74 2e 2e 2e 20 |ns the A|bout... |
|00001050| 69 74 65 6d 2c 20 6f 74 | 68 65 72 77 69 73 65 20 |item, ot|herwise |
|00001060| 69 74 27 73 20 6a 75 73 | 74 20 64 65 73 6b 20 61 |it's jus|t desk a|
|00001070| 63 63 65 73 73 6f 72 69 | 65 73 2e 0d 2a 2f 0d 0d |ccessori|es..*/..|
|00001080| 73 74 61 74 69 63 20 4d | 65 6e 75 48 61 6e 64 6c |static M|enuHandl|
|00001090| 65 09 61 70 70 6c 65 4d | 65 6e 75 3b 0d 73 74 61 |e.appleM|enu;.sta|
|000010a0| 74 69 63 20 49 6e 74 65 | 67 65 72 09 09 61 70 70 |tic Inte|ger..app|
|000010b0| 6c 65 49 44 20 3d 20 30 | 3b 0d 73 74 61 74 69 63 |leID = 0|;.static|
|000010c0| 20 50 72 6f 63 50 74 72 | 09 09 61 70 70 6c 65 41 | ProcPtr|..appleA|
|000010d0| 62 6f 75 74 50 72 6f 63 | 20 3d 20 6e 69 6c 3b 0d |boutProc| = nil;.|
|000010e0| 73 74 61 74 69 63 20 42 | 6f 6f 6c 65 61 6e 09 09 |static B|oolean..|
|000010f0| 64 6f 41 62 6f 75 74 20 | 3d 20 66 61 6c 73 65 3b |doAbout |= false;|
|00001100| 0d 0d 0d 2f 2a 0d 09 4d | 69 73 63 65 6c 6c 61 6e |.../*..M|iscellan|
|00001110| 65 6f 75 73 0d 0d 09 73 | 63 72 65 65 6e 50 6f 72 |eous...s|creenPor|
|00001120| 74 20 70 6f 69 6e 74 73 | 20 74 6f 20 74 68 65 20 |t points| to the |
|00001130| 77 69 6e 64 6f 77 20 6d | 61 6e 61 67 65 72 20 70 |window m|anager p|
|00001140| 6f 72 74 2e 0d 0d 09 64 | 6f 6e 65 46 6c 61 67 20 |ort....d|oneFlag |
|00001150| 64 65 74 65 72 6d 69 6e | 65 73 20 77 68 65 6e 20 |determin|es when |
|00001160| 53 6b 65 6c 4d 61 69 6e | 20 72 65 74 75 72 6e 73 |SkelMain| returns|
|00001170| 2e 20 20 49 74 20 69 73 | 20 73 65 74 20 62 79 20 |. It is| set by |
|00001180| 63 61 6c 6c 69 6e 67 0d | 09 53 6b 65 6c 57 68 6f |calling.|.SkelWho|
|00001190| 61 28 29 2c 20 77 68 69 | 63 68 20 69 73 20 68 6f |a(), whi|ch is ho|
|000011a0| 77 20 74 68 65 20 68 6f | 73 74 20 72 65 71 75 65 |w the ho|st reque|
|000011b0| 73 74 73 20 61 20 68 61 | 6c 74 2e 0d 0d 09 70 42 |sts a ha|lt....pB|
|000011c0| 6b 67 6e 64 20 70 6f 69 | 6e 74 73 20 74 6f 20 61 |kgnd poi|nts to a|
|000011d0| 20 62 61 63 6b 67 72 6f | 75 6e 64 20 70 72 6f 63 | backgro|und proc|
|000011e0| 65 64 75 72 65 2c 20 74 | 6f 20 62 65 20 72 75 6e |edure, t|o be run|
|000011f0| 20 64 75 72 69 6e 67 20 | 65 76 65 6e 74 0d 09 70 | during |event..p|
|00001200| 72 6f 63 65 73 73 69 6e | 67 2e 20 20 53 65 74 20 |rocessin|g. Set |
|00001210| 69 74 20 77 69 74 68 20 | 53 6b 65 6c 42 61 63 6b |it with |SkelBack|
|00001220| 67 72 6f 75 6e 64 2e 20 | 20 49 66 20 6e 69 6c 2c |ground. | If nil,|
|00001230| 20 74 68 65 72 65 27 73 | 20 6e 6f 0d 09 70 72 6f | there's| no..pro|
|00001240| 63 65 64 75 72 65 2e 0d | 0d 09 70 45 76 65 6e 74 |cedure..|..pEvent|
|00001250| 20 70 6f 69 6e 74 73 20 | 74 6f 20 61 6e 20 65 76 | points |to an ev|
|00001260| 65 6e 74 2d 69 6e 73 70 | 65 63 74 69 6e 67 20 68 |ent-insp|ecting h|
|00001270| 6f 6f 6b 2c 20 74 6f 20 | 62 65 20 72 75 6e 20 77 |ook, to |be run w|
|00001280| 68 65 6e 65 76 65 72 20 | 61 6e 0d 09 65 76 65 6e |henever |an..even|
|00001290| 74 20 6f 63 63 75 72 73 | 2e 20 20 53 65 74 20 69 |t occurs|. Set i|
|000012a0| 74 20 77 69 74 68 20 53 | 6b 65 6c 45 76 65 6e 74 |t with S|kelEvent|
|000012b0| 48 6f 6f 6b 2e 20 20 49 | 66 20 6e 69 6c 2c 20 74 |Hook. I|f nil, t|
|000012c0| 68 65 72 65 27 73 20 6e | 6f 0d 09 70 72 6f 63 65 |here's n|o..proce|
|000012d0| 64 75 72 65 2e 0d 0d 09 | 65 76 65 6e 74 4d 61 73 |dure....|eventMas|
|000012e0| 6b 20 63 6f 6e 74 72 6f | 6c 73 20 74 68 65 20 65 |k contro|ls the e|
|000012f0| 76 65 6e 74 20 74 79 70 | 65 73 20 72 65 71 75 65 |vent typ|es reque|
|00001300| 73 74 65 64 20 69 6e 20 | 74 68 65 20 47 65 74 4e |sted in |the GetN|
|00001310| 65 78 74 45 76 65 6e 74 | 0d 09 63 61 6c 6c 20 69 |extEvent|..call i|
|00001320| 6e 20 53 6b 65 6c 4d 61 | 69 6e 2e 0d 0d 09 64 69 |n SkelMa|in....di|
|00001330| 73 6b 49 6e 69 74 50 74 | 20 69 73 20 74 68 65 20 |skInitPt| is the |
|00001340| 6c 6f 63 61 74 69 6f 6e | 20 61 74 20 77 68 69 63 |location| at whic|
|00001350| 68 20 74 68 65 20 64 69 | 73 6b 20 69 6e 69 74 69 |h the di|sk initi|
|00001360| 61 6c 69 7a 61 74 69 6f | 6e 20 64 69 61 6c 6f 67 |alizatio|n dialog|
|00001370| 0d 09 61 70 70 65 61 72 | 73 2c 20 69 66 20 61 6e |..appear|s, if an|
|00001380| 20 75 6e 69 6e 69 74 69 | 61 6c 69 7a 65 64 20 64 | uniniti|alized d|
|00001390| 69 73 6b 20 69 73 20 69 | 6e 73 65 72 74 65 64 2e |isk is i|nserted.|
|000013a0| 0d 2a 2f 0d 0d 73 74 61 | 74 69 63 20 47 72 61 66 |.*/..sta|tic Graf|
|000013b0| 50 74 72 09 73 63 72 65 | 65 6e 50 6f 72 74 3b 0d |Ptr.scre|enPort;.|
|000013c0| 73 74 61 74 69 63 20 49 | 6e 74 65 67 65 72 09 64 |static I|nteger.d|
|000013d0| 6f 6e 65 46 6c 61 67 20 | 3d 20 66 61 6c 73 65 3b |oneFlag |= false;|
|000013e0| 0d 73 74 61 74 69 63 20 | 50 72 6f 63 50 74 72 09 |.static |ProcPtr.|
|000013f0| 70 42 6b 67 6e 64 20 3d | 20 6e 69 6c 3b 0d 73 74 |pBkgnd =| nil;.st|
|00001400| 61 74 69 63 20 42 6f 6f | 6c 65 61 6e 09 28 2a 70 |atic Boo|lean.(*p|
|00001410| 45 76 65 6e 74 29 28 29 | 20 3d 20 6e 69 6c 3b 0d |Event)()| = nil;.|
|00001420| 73 74 61 74 69 63 20 49 | 6e 74 65 67 65 72 09 65 |static I|nteger.e|
|00001430| 76 65 6e 74 4d 61 73 6b | 20 3d 20 65 76 65 72 79 |ventMask| = every|
|00001440| 45 76 65 6e 74 3b 0d 73 | 74 61 74 69 63 20 50 6f |Event;.s|tatic Po|
|00001450| 69 6e 74 09 64 69 73 6b | 49 6e 69 74 50 74 20 3d |int.disk|InitPt =|
|00001460| 20 7b 20 2f 2a 20 76 20 | 3d 20 2a 2f 20 31 32 30 | { /* v |= */ 120|
|00001470| 2c 20 2f 2a 20 68 20 3d | 20 2a 2f 20 31 30 30 20 |, /* h =| */ 100 |
|00001480| 7d 3b 0d 0d 73 74 61 74 | 69 63 20 57 69 6e 64 6f |};..stat|ic Windo|
|00001490| 77 50 74 72 09 6f 6c 64 | 57 69 6e 64 6f 77 20 3d |wPtr.old|Window =|
|000014a0| 20 6e 69 6c 3b 20 09 0d | 73 74 61 74 69 63 20 57 | nil; ..|static W|
|000014b0| 48 61 6e 64 6c 65 72 09 | 09 2a 2a 6f 6c 64 57 44 |Handler.|.**oldWD|
|000014c0| 48 61 6e 64 6c 65 72 20 | 3d 20 6e 69 6c 3b 0d 09 |Handler |= nil;..|
|000014d0| 0d 0d 23 20 69 66 64 65 | 66 09 73 75 70 70 6f 72 |..# ifde|f.suppor|
|000014e0| 74 44 69 61 6c 6f 67 73 | 0d 0d 2f 2a 0d 09 64 6c |tDialogs|../*..dl|
|000014f0| 6f 67 45 76 65 6e 74 4d | 61 73 6b 20 73 70 65 63 |ogEventM|ask spec|
|00001500| 69 66 69 65 73 20 65 76 | 65 6e 74 73 20 74 68 61 |ifies ev|ents tha|
|00001510| 74 20 61 72 65 20 70 61 | 73 73 65 64 20 74 6f 20 |t are pa|ssed to |
|00001520| 64 69 61 6c 6f 67 73 2e | 0d 09 4f 74 68 65 72 73 |dialogs.|..Others|
|00001530| 20 61 72 65 20 69 67 6e | 6f 72 65 64 2e 20 20 53 | are ign|ored. S|
|00001540| 74 61 6e 64 61 72 64 20 | 6d 61 73 6b 20 70 61 73 |tandard |mask pas|
|00001550| 73 65 73 2c 20 6d 6f 75 | 73 65 64 6f 77 6e 2c 20 |ses, mou|sedown, |
|00001560| 6b 65 79 64 6f 77 6e 2c | 0d 09 61 75 74 6f 6b 65 |keydown,|..autoke|
|00001570| 79 2c 20 75 70 64 61 74 | 65 2c 20 61 63 74 69 76 |y, updat|e, activ|
|00001580| 61 74 65 20 61 6e 64 20 | 6e 75 6c 6c 20 65 76 65 |ate and |null eve|
|00001590| 6e 74 73 2e 20 20 4e 75 | 6c 6c 20 65 76 65 6e 74 |nts. Nu|ll event|
|000015a0| 73 20 61 72 65 0d 09 63 | 6f 6e 74 72 6f 6c 6c 65 |s are..c|ontrolle|
|000015b0| 64 20 62 79 20 62 69 74 | 20 30 20 28 61 6c 77 61 |d by bit| 0 (alwa|
|000015c0| 79 73 20 66 6f 72 63 65 | 64 20 6f 6e 29 2e 0d 2a |ys force|d on)..*|
|000015d0| 2f 0d 0d 73 74 61 74 69 | 63 20 49 6e 74 65 67 65 |/..stati|c Intege|
|000015e0| 72 09 64 6c 6f 67 45 76 | 65 6e 74 4d 61 73 6b 20 |r.dlogEv|entMask |
|000015f0| 3d 20 30 78 31 36 62 3b | 0d 0d 23 20 65 6e 64 69 |= 0x16b;|..# endi|
|00001600| 66 0d 0d 0d 2f 2a 20 2d | 2d 2d 2d 2d 2d 2d 2d 2d |f.../* -|--------|
|00001610| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001620| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001630| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001640| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 20 2a 2f 0d 2f |--------|--- */./|
|00001650| 2a 09 09 09 09 09 09 49 | 6e 74 65 72 6e 61 6c 20 |*......I|nternal |
|00001660| 28 70 72 69 76 61 74 65 | 29 20 52 6f 75 74 69 6e |(private|) Routin|
|00001670| 65 73 09 09 09 09 09 09 | 2a 2f 0d 2f 2a 20 2d 2d |es......|*/./* --|
|00001680| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001690| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000016a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000016b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000016c0| 2d 2d 20 2a 2f 0d 0d 0d | 2f 2a 0d 09 47 65 74 20 |-- */...|/*..Get |
|000016d0| 68 61 6e 64 6c 65 72 20 | 61 73 73 6f 63 69 61 74 |handler |associat|
|000016e0| 65 64 20 77 69 74 68 20 | 75 73 65 72 20 6f 72 20 |ed with |user or |
|000016f0| 64 69 61 6c 6f 67 20 77 | 69 6e 64 6f 77 2e 0d 09 |dialog w|indow...|
|00001700| 52 65 74 75 72 6e 20 6e | 69 6c 20 69 66 20 77 69 |Return n|il if wi|
|00001710| 6e 64 6f 77 20 64 6f 65 | 73 6e 27 74 20 62 65 6c |ndow doe|sn't bel|
|00001720| 6f 6e 67 20 74 6f 20 61 | 6e 79 20 6b 6e 6f 77 6e |ong to a|ny known|
|00001730| 20 68 61 6e 64 6c 65 72 | 2e 0d 09 54 68 69 73 20 | handler|...This |
|00001740| 72 6f 75 74 69 6e 65 20 | 69 73 20 61 62 73 6f 6c |routine |is absol|
|00001750| 75 74 65 6c 79 20 66 75 | 6e 64 61 6d 65 6e 74 61 |utely fu|ndamenta|
|00001760| 6c 20 74 6f 20 54 72 61 | 6e 73 53 6b 65 6c 2e 0d |l to Tra|nsSkel..|
|00001770| 2a 2f 0d 0d 0d 73 74 61 | 74 69 63 20 57 48 61 6e |*/...sta|tic WHan|
|00001780| 64 6c 65 72 20 2a 2a 47 | 65 74 57 44 48 61 6e 64 |dler **G|etWDHand|
|00001790| 6c 65 72 20 28 74 68 65 | 57 69 6e 64 29 0d 57 69 |ler (the|Wind).Wi|
|000017a0| 6e 64 6f 77 50 74 72 09 | 74 68 65 57 69 6e 64 3b |ndowPtr.|theWind;|
|000017b0| 0d 7b 0d 72 65 67 69 73 | 74 65 72 20 57 48 61 6e |.{.regis|ter WHan|
|000017c0| 64 6c 65 72 09 2a 2a 68 | 3b 0d 0d 09 69 66 20 28 |dler.**h|;...if (|
|000017d0| 74 68 65 57 69 6e 64 20 | 3d 3d 20 6f 6c 64 57 69 |theWind |== oldWi|
|000017e0| 6e 64 6f 77 29 20 0d 09 | 09 72 65 74 75 72 6e 28 |ndow) ..|.return(|
|000017f0| 6f 6c 64 57 44 48 61 6e | 64 6c 65 72 29 3b 09 09 |oldWDHan|dler);..|
|00001800| 2f 2a 20 72 65 74 75 72 | 6e 20 68 61 6e 64 6c 65 |/* retur|n handle|
|00001810| 72 20 6f 66 20 63 61 63 | 68 65 64 20 77 69 6e 64 |r of cac|hed wind|
|00001820| 6f 77 20 2a 2f 0d 0d 09 | 66 6f 72 20 28 68 20 3d |ow */...|for (h =|
|00001830| 20 77 68 4c 69 73 74 3b | 20 68 20 21 3d 20 6e 69 | whList;| h != ni|
|00001840| 6c 3b 20 68 20 3d 20 28 | 2a 2a 68 29 2e 77 68 4e |l; h = (|**h).whN|
|00001850| 65 78 74 29 0d 09 7b 0d | 09 09 69 66 20 28 28 2a |ext)..{.|..if ((*|
|00001860| 2a 68 29 2e 77 68 57 69 | 6e 64 20 3d 3d 20 74 68 |*h).whWi|nd == th|
|00001870| 65 57 69 6e 64 29 0d 09 | 09 7b 0d 09 09 09 6f 6c |eWind)..|.{....ol|
|00001880| 64 57 69 6e 64 6f 77 20 | 3d 20 74 68 65 57 69 6e |dWindow |= theWin|
|00001890| 64 3b 09 2f 2a 20 73 65 | 74 20 63 61 63 68 65 64 |d;./* se|t cached|
|000018a0| 20 77 69 6e 64 6f 77 20 | 61 6e 64 20 68 61 6e 64 | window |and hand|
|000018b0| 6c 65 72 20 2a 2f 0d 09 | 09 09 6f 6c 64 57 44 48 |ler */..|..oldWDH|
|000018c0| 61 6e 64 6c 65 72 20 3d | 20 68 3b 0d 09 09 09 72 |andler =| h;....r|
|000018d0| 65 74 75 72 6e 20 28 68 | 29 3b 0d 09 09 7d 0d 09 |eturn (h|);...}..|
|000018e0| 7d 0d 09 72 65 74 75 72 | 6e 20 28 6e 69 6c 29 3b |}..retur|n (nil);|
|000018f0| 0d 7d 0d 0d 0d 2f 2a 0d | 09 47 65 74 20 68 61 6e |.}.../*.|.Get han|
|00001900| 64 6c 65 72 20 61 73 73 | 6f 63 69 61 74 65 64 20 |dler ass|ociated |
|00001910| 77 69 74 68 20 75 73 65 | 72 20 77 69 6e 64 6f 77 |with use|r window|
|00001920| 2e 0d 09 52 65 74 75 72 | 6e 20 6e 69 6c 20 69 66 |...Retur|n nil if|
|00001930| 20 77 69 6e 64 6f 77 20 | 64 6f 65 73 6e 27 74 20 | window |doesn't |
|00001940| 62 65 6c 6f 6e 67 20 74 | 6f 20 61 6e 79 20 6b 6e |belong t|o any kn|
|00001950| 6f 77 6e 20 68 61 6e 64 | 6c 65 72 2e 0d 09 54 68 |own hand|ler...Th|
|00001960| 65 20 6f 72 64 65 72 20 | 6f 66 20 74 68 65 20 74 |e order |of the t|
|00001970| 77 6f 20 74 65 73 74 73 | 20 69 73 20 63 72 69 74 |wo tests| is crit|
|00001980| 69 63 61 6c 3a 20 20 74 | 68 65 57 69 6e 64 20 6d |ical: t|heWind m|
|00001990| 69 67 68 74 20 62 65 20 | 6e 69 6c 2e 0d 2a 2f 0d |ight be |nil..*/.|
|000019a0| 0d 73 74 61 74 69 63 20 | 57 48 61 6e 64 6c 65 72 |.static |WHandler|
|000019b0| 20 2a 2a 47 65 74 57 48 | 61 6e 64 6c 65 72 20 28 | **GetWH|andler (|
|000019c0| 74 68 65 57 69 6e 64 29 | 0d 57 69 6e 64 6f 77 50 |theWind)|.WindowP|
|000019d0| 74 72 09 74 68 65 57 69 | 6e 64 3b 0d 7b 0d 72 65 |tr.theWi|nd;.{.re|
|000019e0| 67 69 73 74 65 72 20 57 | 48 61 6e 64 6c 65 72 09 |gister W|Handler.|
|000019f0| 2a 2a 68 3b 0d 0d 09 69 | 66 20 28 28 68 20 3d 20 |**h;...i|f ((h = |
|00001a00| 47 65 74 57 44 48 61 6e | 64 6c 65 72 20 28 74 68 |GetWDHan|dler (th|
|00001a10| 65 57 69 6e 64 29 29 20 | 21 3d 20 6e 69 6c 0d 09 |eWind)) |!= nil..|
|00001a20| 09 26 26 20 28 28 57 69 | 6e 64 6f 77 50 65 65 6b |.&& ((Wi|ndowPeek|
|00001a30| 29 20 74 68 65 57 69 6e | 64 29 2d 3e 77 69 6e 64 |) theWin|d)->wind|
|00001a40| 6f 77 4b 69 6e 64 20 21 | 3d 20 64 69 61 6c 6f 67 |owKind !|= dialog|
|00001a50| 4b 69 6e 64 29 0d 09 7b | 0d 09 09 09 72 65 74 75 |Kind)..{|....retu|
|00001a60| 72 6e 20 28 68 29 3b 0d | 09 7d 0d 09 72 65 74 75 |rn (h);.|.}..retu|
|00001a70| 72 6e 20 28 6e 69 6c 29 | 3b 0d 7d 0d 0d 0d 23 20 |rn (nil)|;.}...# |
|00001a80| 69 66 64 65 66 09 73 75 | 70 70 6f 72 74 44 69 61 |ifdef.su|pportDia|
|00001a90| 6c 6f 67 73 0d 0d 2f 2a | 0d 09 47 65 74 20 68 61 |logs../*|..Get ha|
|00001aa0| 6e 64 6c 65 72 20 61 73 | 73 6f 63 69 61 74 65 64 |ndler as|sociated|
|00001ab0| 20 77 69 74 68 20 64 69 | 61 6c 6f 67 20 77 69 6e | with di|alog win|
|00001ac0| 64 6f 77 2e 0d 09 52 65 | 74 75 72 6e 20 6e 69 6c |dow...Re|turn nil|
|00001ad0| 20 69 66 20 77 69 6e 64 | 6f 77 20 64 6f 65 73 6e | if wind|ow doesn|
|00001ae0| 27 74 20 62 65 6c 6f 6e | 67 20 74 6f 20 61 6e 79 |'t belon|g to any|
|00001af0| 20 6b 6e 6f 77 6e 20 68 | 61 6e 64 6c 65 72 2e 0d | known h|andler..|
|00001b00| 09 54 68 65 20 6f 72 64 | 65 72 20 6f 66 20 74 68 |.The ord|er of th|
|00001b10| 65 20 74 77 6f 20 74 65 | 73 74 73 20 69 73 20 63 |e two te|sts is c|
|00001b20| 72 69 74 69 63 61 6c 3a | 20 20 74 68 65 44 69 61 |ritical:| theDia|
|00001b30| 6c 6f 67 20 6d 69 67 68 | 74 20 62 65 20 6e 69 6c |log migh|t be nil|
|00001b40| 2e 0d 2a 2f 0d 0d 73 74 | 61 74 69 63 20 57 48 61 |..*/..st|atic WHa|
|00001b50| 6e 64 6c 65 72 20 2a 2a | 47 65 74 44 48 61 6e 64 |ndler **|GetDHand|
|00001b60| 6c 65 72 20 28 74 68 65 | 44 69 61 6c 6f 67 29 0d |ler (the|Dialog).|
|00001b70| 44 69 61 6c 6f 67 50 74 | 72 09 74 68 65 44 69 61 |DialogPt|r.theDia|
|00001b80| 6c 6f 67 3b 0d 7b 0d 72 | 65 67 69 73 74 65 72 20 |log;.{.r|egister |
|00001b90| 57 48 61 6e 64 6c 65 72 | 09 2a 2a 68 3b 0d 0d 09 |WHandler|.**h;...|
|00001ba0| 69 66 20 28 28 68 20 3d | 20 47 65 74 57 44 48 61 |if ((h =| GetWDHa|
|00001bb0| 6e 64 6c 65 72 20 28 74 | 68 65 44 69 61 6c 6f 67 |ndler (t|heDialog|
|00001bc0| 29 29 20 21 3d 20 6e 69 | 6c 0d 09 09 26 26 20 28 |)) != ni|l...&& (|
|00001bd0| 28 57 69 6e 64 6f 77 50 | 65 65 6b 29 20 74 68 65 |(WindowP|eek) the|
|00001be0| 44 69 61 6c 6f 67 29 2d | 3e 77 69 6e 64 6f 77 4b |Dialog)-|>windowK|
|00001bf0| 69 6e 64 20 3d 3d 20 64 | 69 61 6c 6f 67 4b 69 6e |ind == d|ialogKin|
|00001c00| 64 29 0d 09 7b 0d 09 09 | 09 72 65 74 75 72 6e 20 |d)..{...|.return |
|00001c10| 28 68 29 3b 0d 09 7d 0d | 09 72 65 74 75 72 6e 20 |(h);..}.|.return |
|00001c20| 28 6e 69 6c 29 3b 0d 7d | 0d 0d 23 20 65 6e 64 69 |(nil);.}|..# endi|
|00001c30| 66 0d 0d 0d 2f 2a 0d 09 | 47 65 6e 65 72 61 6c 20 |f.../*..|General |
|00001c40| 6d 65 6e 75 2d 68 61 6e | 64 6c 65 72 2e 20 20 4a |menu-han|dler. J|
|00001c50| 75 73 74 20 70 61 73 73 | 65 73 20 73 65 6c 65 63 |ust pass|es selec|
|00001c60| 74 69 6f 6e 20 74 6f 20 | 74 68 65 20 68 61 6e 64 |tion to |the hand|
|00001c70| 6c 65 72 27 73 0d 09 73 | 65 6c 65 63 74 20 72 6f |ler's..s|elect ro|
|00001c80| 75 74 69 6e 65 2e 20 20 | 49 66 20 74 68 65 20 73 |utine. |If the s|
|00001c90| 65 6c 65 63 74 20 72 6f | 75 74 69 6e 65 20 69 73 |elect ro|utine is|
|00001ca0| 20 6e 69 6c 2c 20 73 65 | 6c 65 63 74 69 6e 67 20 | nil, se|lecting |
|00001cb0| 69 74 65 6d 73 20 66 72 | 6f 6d 0d 09 74 68 65 20 |items fr|om..the |
|00001cc0| 6d 65 6e 75 20 69 73 20 | 61 20 6e 6f 70 2e 0d 2a |menu is |a nop..*|
|00001cd0| 2f 0d 0d 73 74 61 74 69 | 63 20 44 6f 4d 65 6e 75 |/..stati|c DoMenu|
|00001ce0| 43 6f 6d 6d 61 6e 64 20 | 28 63 6f 6d 6d 61 6e 64 |Command |(command|
|00001cf0| 29 0d 4c 6f 6e 67 69 6e | 74 09 09 63 6f 6d 6d 61 |).Longin|t..comma|
|00001d00| 6e 64 3b 0d 7b 0d 72 65 | 67 69 73 74 65 72 20 49 |nd;.{.re|gister I|
|00001d10| 6e 74 65 67 65 72 09 6d | 65 6e 75 3b 0d 72 65 67 |nteger.m|enu;.reg|
|00001d20| 69 73 74 65 72 20 49 6e | 74 65 67 65 72 09 69 74 |ister In|teger.it|
|00001d30| 65 6d 3b 0d 72 65 67 69 | 73 74 65 72 20 4d 48 61 |em;.regi|ster MHa|
|00001d40| 6e 64 6c 65 72 09 2a 2a | 6d 68 3b 0d 72 65 67 69 |ndler.**|mh;.regi|
|00001d50| 73 74 65 72 20 50 72 6f | 63 50 74 72 09 70 3b 0d |ster Pro|cPtr.p;.|
|00001d60| 0d 09 6d 65 6e 75 20 3d | 20 48 69 57 6f 72 64 20 |..menu =| HiWord |
|00001d70| 28 63 6f 6d 6d 61 6e 64 | 29 3b 0d 09 69 74 65 6d |(command|);..item|
|00001d80| 20 3d 20 4c 6f 57 6f 72 | 64 20 28 63 6f 6d 6d 61 | = LoWor|d (comma|
|00001d90| 6e 64 29 3b 0d 09 66 6f | 72 20 28 6d 68 20 3d 20 |nd);..fo|r (mh = |
|00001da0| 6d 68 4c 69 73 74 3b 20 | 6d 68 20 21 3d 20 6e 69 |mhList; |mh != ni|
|00001db0| 6c 3b 20 6d 68 20 3d 20 | 28 2a 2a 6d 68 29 2e 6d |l; mh = |(**mh).m|
|00001dc0| 68 4e 65 78 74 29 0d 09 | 7b 0d 09 09 69 66 20 28 |hNext)..|{...if (|
|00001dd0| 28 6d 65 6e 75 20 3d 3d | 20 28 2a 2a 6d 68 29 2e |(menu ==| (**mh).|
|00001de0| 6d 68 49 44 29 20 26 26 | 20 28 28 70 20 3d 20 28 |mhID) &&| ((p = (|
|00001df0| 2a 2a 6d 68 29 2e 6d 68 | 53 65 6c 65 63 74 29 20 |**mh).mh|Select) |
|00001e00| 21 3d 20 6e 69 6c 29 29 | 0d 09 09 7b 0d 09 09 09 |!= nil))|...{....|
|00001e10| 28 2a 70 29 20 28 69 74 | 65 6d 29 3b 0d 09 09 09 |(*p) (it|em);....|
|00001e20| 62 72 65 61 6b 3b 0d 09 | 09 7d 0d 09 7d 0d 09 48 |break;..|.}..}..H|
|00001e30| 69 6c 69 74 65 4d 65 6e | 75 20 28 30 29 3b 09 09 |iliteMen|u (0);..|
|00001e40| 2f 2a 20 63 6f 6d 6d 61 | 6e 64 20 64 6f 6e 65 2c |/* comma|nd done,|
|00001e50| 20 74 75 72 6e 20 6f 66 | 66 20 6d 65 6e 75 20 68 | turn of|f menu h|
|00001e60| 69 6c 69 74 69 6e 67 20 | 2a 2f 0d 7d 0d 0d 0d 2f |iliting |*/.}.../|
|00001e70| 2a 0d 09 41 70 70 6c 65 | 20 6d 65 6e 75 20 68 61 |*..Apple| menu ha|
|00001e80| 6e 64 6c 65 72 0d 09 0d | 09 44 6f 41 70 70 6c 65 |ndler...|.DoApple|
|00001e90| 49 74 65 6d 3a 20 20 49 | 66 20 74 68 65 20 66 69 |Item: I|f the fi|
|00001ea0| 72 73 74 20 69 74 65 6d | 20 77 61 73 20 63 68 6f |rst item| was cho|
|00001eb0| 73 65 6e 2c 20 61 6e 64 | 20 74 68 65 72 65 27 73 |sen, and| there's|
|00001ec0| 20 61 6e 20 22 41 62 6f | 75 74 2e 2e 2e 22 0d 09 | an "Abo|ut..."..|
|00001ed0| 69 74 65 6d 2c 20 63 61 | 6c 6c 20 74 68 65 20 70 |item, ca|ll the p|
|00001ee0| 72 6f 63 65 64 75 72 65 | 20 61 73 73 6f 63 69 61 |rocedure| associa|
|00001ef0| 74 65 64 20 77 69 74 68 | 20 69 74 20 28 69 66 20 |ted with| it (if |
|00001f00| 6e 6f 74 20 6e 69 6c 29 | 2e 20 20 49 66 20 74 68 |not nil)|. If th|
|00001f10| 65 72 65 0d 09 69 73 20 | 6e 6f 20 22 41 62 6f 75 |ere..is |no "Abou|
|00001f20| 74 2e 2e 2e 22 20 69 74 | 65 6d 20 6f 72 20 74 68 |t..." it|em or th|
|00001f30| 65 20 69 74 65 6d 20 77 | 61 73 20 6e 6f 74 20 74 |e item w|as not t|
|00001f40| 68 65 20 66 69 72 73 74 | 20 6f 6e 65 2c 20 74 68 |he first| one, th|
|00001f50| 65 6e 20 6f 70 65 6e 0d | 09 74 68 65 20 61 73 73 |en open.|.the ass|
|00001f60| 6f 63 69 61 74 65 64 20 | 64 65 73 6b 20 61 63 63 |ociated |desk acc|
|00001f70| 65 73 73 6f 72 79 2e 20 | 20 54 68 65 20 70 6f 72 |essory. | The por|
|00001f80| 74 20 69 73 20 73 61 76 | 65 64 20 61 6e 64 20 72 |t is sav|ed and r|
|00001f90| 65 73 74 6f 72 65 64 0d | 09 62 65 63 61 75 73 65 |estored.|.because|
|00001fa0| 20 4f 70 65 6e 44 65 73 | 6b 41 63 63 20 64 6f 65 | OpenDes|kAcc doe|
|00001fb0| 73 20 6e 6f 74 20 61 6c | 77 61 79 73 20 70 72 65 |s not al|ways pre|
|00001fc0| 73 65 72 76 65 20 69 74 | 20 63 6f 72 72 65 63 74 |serve it| correct|
|00001fd0| 6c 79 2e 0d 09 0d 09 44 | 6f 41 70 70 6c 65 43 6c |ly.....D|oAppleCl|
|00001fe0| 6f 62 62 65 72 20 64 69 | 73 70 6f 73 65 73 20 6f |obber di|sposes o|
|00001ff0| 66 20 74 68 65 20 41 70 | 70 6c 65 20 6d 65 6e 75 |f the Ap|ple menu|
|00002000| 2e 0d 2a 2f 0d 0d 0d 73 | 74 61 74 69 63 20 44 6f |..*/...s|tatic Do|
|00002010| 41 70 70 6c 65 49 74 65 | 6d 20 28 69 74 65 6d 29 |AppleIte|m (item)|
|00002020| 0d 49 6e 74 65 67 65 72 | 09 69 74 65 6d 3b 0d 7b |.Integer|.item;.{|
|00002030| 0d 47 72 61 66 50 74 72 | 09 63 75 72 50 6f 72 74 |.GrafPtr|.curPort|
|00002040| 3b 0d 53 74 72 32 35 35 | 09 73 74 72 3b 0d 48 61 |;.Str255|.str;.Ha|
|00002050| 6e 64 6c 65 09 68 3b 0d | 0d 09 69 66 20 28 64 6f |ndle.h;.|..if (do|
|00002060| 41 62 6f 75 74 20 26 26 | 20 69 74 65 6d 20 3d 3d |About &&| item ==|
|00002070| 20 31 29 0d 09 7b 0d 09 | 09 69 66 20 28 61 70 70 | 1)..{..|.if (app|
|00002080| 6c 65 41 62 6f 75 74 50 | 72 6f 63 20 21 3d 20 6e |leAboutP|roc != n|
|00002090| 69 6c 29 0d 09 09 09 28 | 2a 61 70 70 6c 65 41 62 |il)....(|*appleAb|
|000020a0| 6f 75 74 50 72 6f 63 29 | 20 28 29 3b 0d 09 7d 0d |outProc)| ();..}.|
|000020b0| 09 65 6c 73 65 0d 09 7b | 0d 09 09 47 65 74 50 6f |.else..{|...GetPo|
|000020c0| 72 74 20 28 26 63 75 72 | 50 6f 72 74 29 3b 0d 09 |rt (&cur|Port);..|
|000020d0| 09 47 65 74 49 74 65 6d | 20 28 61 70 70 6c 65 4d |.GetItem| (appleM|
|000020e0| 65 6e 75 2c 20 69 74 65 | 6d 2c 20 73 74 72 29 3b |enu, ite|m, str);|
|000020f0| 09 09 2f 2a 20 67 65 74 | 20 44 41 20 6e 61 6d 65 |../* get| DA name|
|00002100| 20 2a 2f 0d 09 09 53 65 | 74 52 65 73 4c 6f 61 64 | */...Se|tResLoad|
|00002110| 20 28 66 61 6c 73 65 29 | 3b 0d 09 09 68 20 3d 20 | (false)|;...h = |
|00002120| 47 65 74 4e 61 6d 65 64 | 52 65 73 6f 75 72 63 65 |GetNamed|Resource|
|00002130| 20 28 27 44 52 56 52 27 | 2c 20 73 74 72 29 3b 0d | ('DRVR'|, str);.|
|00002140| 09 09 53 65 74 52 65 73 | 4c 6f 61 64 20 28 74 72 |..SetRes|Load (tr|
|00002150| 75 65 29 3b 0d 09 09 69 | 66 20 28 68 20 21 3d 20 |ue);...i|f (h != |
|00002160| 6e 69 6c 29 0d 09 09 7b | 0d 09 09 09 52 65 73 72 |nil)...{|....Resr|
|00002170| 76 4d 65 6d 20 28 53 69 | 7a 65 52 65 73 6f 75 72 |vMem (Si|zeResour|
|00002180| 63 65 20 28 68 29 20 2b | 20 30 78 31 30 30 30 29 |ce (h) +| 0x1000)|
|00002190| 3b 0d 09 09 09 28 76 6f | 69 64 29 20 4f 70 65 6e |;....(vo|id) Open|
|000021a0| 44 65 73 6b 41 63 63 20 | 28 73 74 72 29 3b 09 09 |DeskAcc |(str);..|
|000021b0| 09 2f 2a 20 6f 70 65 6e | 20 69 74 20 2a 2f 0d 09 |./* open| it */..|
|000021c0| 09 7d 0d 09 09 53 65 74 | 50 6f 72 74 20 28 63 75 |.}...Set|Port (cu|
|000021d0| 72 50 6f 72 74 29 3b 0d | 09 7d 0d 7d 0d 0d 73 74 |rPort);.|.}.}..st|
|000021e0| 61 74 69 63 20 44 6f 41 | 70 70 6c 65 43 6c 6f 62 |atic DoA|ppleClob|
|000021f0| 62 65 72 20 28 29 20 7b | 20 44 69 73 70 6f 73 65 |ber () {| Dispose|
|00002200| 4d 65 6e 75 20 28 61 70 | 70 6c 65 4d 65 6e 75 29 |Menu (ap|pleMenu)|
|00002210| 3b 20 7d 0d 0d 0d 2f 2a | 20 2d 2d 2d 2d 2d 2d 2d |; }.../*| -------|
|00002220| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002230| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002240| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002250| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 20 2a 2f |--------|----- */|
|00002260| 0d 2f 2a 09 09 09 09 09 | 09 57 69 6e 64 6f 77 2d |./*.....|.Window-|
|00002270| 68 61 6e 64 6c 65 72 20 | 72 6f 75 74 69 6e 67 20 |handler |routing |
|00002280| 72 6f 75 74 69 6e 65 73 | 09 09 09 09 09 2a 2f 0d |routines|.....*/.|
|00002290| 2f 2a 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |/*......|........|
|000022a0| 09 09 09 09 2a 2f 0d 2f | 2a 09 53 65 65 20 6d 61 |....*/./|*.See ma|
|000022b0| 6e 75 61 6c 20 66 6f 72 | 20 64 69 73 63 75 73 73 |nual for| discuss|
|000022c0| 69 6f 6e 20 6f 66 20 70 | 6f 72 74 2d 73 65 74 74 |ion of p|ort-sett|
|000022d0| 69 6e 67 20 62 65 68 61 | 76 69 6f 72 2e 20 20 49 |ing beha|vior. I|
|000022e0| 6e 20 67 65 6e 65 72 61 | 6c 2c 09 2a 2f 0d 2f 2a |n genera|l,.*/./*|
|000022f0| 09 74 68 65 20 63 75 72 | 72 65 6e 74 20 70 6f 72 |.the cur|rent por|
|00002300| 74 20 69 73 20 6d 61 64 | 65 20 74 6f 20 61 73 73 |t is mad|e to ass|
|00002310| 6f 63 69 61 74 65 20 77 | 69 74 68 20 74 68 65 20 |ociate w|ith the |
|00002320| 61 63 74 69 76 65 20 77 | 69 6e 64 6f 77 2e 09 09 |active w|indow...|
|00002330| 2a 2f 0d 2f 2a 09 54 68 | 69 73 20 69 73 20 64 6f |*/./*.Th|is is do|
|00002340| 6e 65 20 69 6e 20 44 6f | 41 63 74 69 76 61 74 65 |ne in Do|Activate|
|00002350| 20 66 6f 72 20 6e 6f 6e | 2d 64 69 61 6c 6f 67 20 | for non|-dialog |
|00002360| 77 69 6e 64 6f 77 73 2c | 20 69 6e 20 44 6f 44 69 |windows,| in DoDi|
|00002370| 61 6c 6f 67 09 09 2a 2f | 0d 2f 2a 09 66 6f 72 20 |alog..*/|./*.for |
|00002380| 64 69 61 6c 6f 67 20 77 | 69 6e 64 6f 77 73 2e 09 |dialog w|indows..|
|00002390| 09 09 09 09 09 09 09 09 | 09 09 09 09 2a 2f 0d 2f |........|....*/./|
|000023a0| 2a 20 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |* ------|--------|
|000023b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000023c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000023d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000023e0| 2d 2d 2d 2d 2d 2d 20 2a | 2f 0d 0d 0d 2f 2a 0d 09 |------ *|/.../*..|
|000023f0| 50 61 73 73 20 6c 6f 63 | 61 6c 20 6d 6f 75 73 65 |Pass loc|al mouse|
|00002400| 20 63 6f 6f 72 64 69 6e | 61 74 65 73 2c 20 63 6c | coordin|ates, cl|
|00002410| 69 63 6b 20 74 69 6d 65 | 2c 20 61 6e 64 20 74 68 |ick time|, and th|
|00002420| 65 20 6d 6f 64 69 66 69 | 65 72 73 20 66 6c 61 67 |e modifi|ers flag|
|00002430| 0d 09 77 6f 72 64 20 74 | 6f 20 74 68 65 20 68 61 |..word t|o the ha|
|00002440| 6e 64 6c 65 72 2e 20 20 | 53 68 6f 75 6c 64 20 6e |ndler. |Should n|
|00002450| 6f 74 20 62 65 20 6e 65 | 63 65 73 73 61 72 79 20 |ot be ne|cessary |
|00002460| 74 6f 20 73 65 74 20 74 | 68 65 20 70 6f 72 74 2c |to set t|he port,|
|00002470| 20 61 73 0d 09 74 68 65 | 20 63 6c 69 63 6b 20 69 | as..the| click i|
|00002480| 73 20 70 61 73 73 65 64 | 20 74 6f 20 74 68 65 20 |s passed| to the |
|00002490| 61 63 74 69 76 65 20 77 | 69 6e 64 6f 77 27 73 20 |active w|indow's |
|000024a0| 68 61 6e 64 6c 65 72 2e | 0d 2a 2f 0d 0d 73 74 61 |handler.|.*/..sta|
|000024b0| 74 69 63 20 44 6f 4d 6f | 75 73 65 20 28 68 2c 20 |tic DoMo|use (h, |
|000024c0| 74 68 65 45 76 65 6e 74 | 29 0d 57 48 61 6e 64 6c |theEvent|).WHandl|
|000024d0| 65 72 09 2a 2a 68 3b 0d | 45 76 65 6e 74 52 65 63 |er.**h;.|EventRec|
|000024e0| 6f 72 64 09 2a 74 68 65 | 45 76 65 6e 74 3b 0d 7b |ord.*the|Event;.{|
|000024f0| 0d 72 65 67 69 73 74 65 | 72 20 50 72 6f 63 50 74 |.registe|r ProcPt|
|00002500| 72 09 70 3b 0d 50 6f 69 | 6e 74 09 09 09 09 74 68 |r.p;.Poi|nt....th|
|00002510| 65 50 74 3b 0d 0d 09 69 | 66 20 28 68 20 21 3d 20 |ePt;...i|f (h != |
|00002520| 6e 69 6c 29 0d 09 7b 0d | 09 09 69 66 20 28 28 70 |nil)..{.|..if ((p|
|00002530| 20 3d 20 28 2a 2a 68 29 | 2e 77 68 4d 6f 75 73 65 | = (**h)|.whMouse|
|00002540| 29 20 21 3d 20 6e 69 6c | 29 0d 09 09 7b 0d 09 09 |) != nil|)...{...|
|00002550| 09 74 68 65 50 74 20 3d | 20 74 68 65 45 76 65 6e |.thePt =| theEven|
|00002560| 74 2d 3e 77 68 65 72 65 | 3b 09 2f 2a 20 6d 61 6b |t->where|;./* mak|
|00002570| 65 20 6c 6f 63 61 6c 20 | 63 6f 70 79 20 2a 2f 0d |e local |copy */.|
|00002580| 09 09 09 47 6c 6f 62 61 | 6c 54 6f 4c 6f 63 61 6c |...Globa|lToLocal|
|00002590| 20 28 26 74 68 65 50 74 | 29 3b 0d 09 09 09 28 2a | (&thePt|);....(*|
|000025a0| 70 29 20 28 74 68 65 50 | 74 2c 20 74 68 65 45 76 |p) (theP|t, theEv|
|000025b0| 65 6e 74 2d 3e 77 68 65 | 6e 2c 20 74 68 65 45 76 |ent->whe|n, theEv|
|000025c0| 65 6e 74 2d 3e 6d 6f 64 | 69 66 69 65 72 73 29 3b |ent->mod|ifiers);|
|000025d0| 0d 09 09 7d 0d 09 7d 0d | 7d 0d 0d 0d 2f 2a 0d 09 |...}..}.|}.../*..|
|000025e0| 50 61 73 73 20 74 68 65 | 20 63 68 61 72 61 63 74 |Pass the| charact|
|000025f0| 65 72 20 61 6e 64 20 74 | 68 65 20 6d 6f 64 69 66 |er and t|he modif|
|00002600| 69 65 72 73 20 66 6c 61 | 67 20 77 6f 72 64 20 74 |iers fla|g word t|
|00002610| 6f 20 74 68 65 20 68 61 | 6e 64 6c 65 72 2e 0d 09 |o the ha|ndler...|
|00002620| 53 68 6f 75 6c 64 20 6e | 6f 74 20 62 65 20 6e 65 |Should n|ot be ne|
|00002630| 63 65 73 73 61 72 79 20 | 74 6f 20 73 65 74 20 74 |cessary |to set t|
|00002640| 68 65 20 70 6f 72 74 2c | 20 61 73 20 74 68 65 20 |he port,| as the |
|00002650| 63 6c 69 63 6b 20 69 73 | 20 70 61 73 73 65 64 0d |click is| passed.|
|00002660| 09 74 6f 20 74 68 65 20 | 61 63 74 69 76 65 20 77 |.to the |active w|
|00002670| 69 6e 64 6f 77 27 73 20 | 68 61 6e 64 6c 65 72 2e |indow's |handler.|
|00002680| 0d 2a 2f 0d 0d 73 74 61 | 74 69 63 20 44 6f 4b 65 |.*/..sta|tic DoKe|
|00002690| 79 20 28 68 2c 20 63 68 | 2c 20 6d 6f 64 73 29 0d |y (h, ch|, mods).|
|000026a0| 57 48 61 6e 64 6c 65 72 | 09 2a 2a 68 3b 0d 63 68 |WHandler|.**h;.ch|
|000026b0| 61 72 09 09 63 68 3b 0d | 49 6e 74 65 67 65 72 09 |ar..ch;.|Integer.|
|000026c0| 09 6d 6f 64 73 3b 0d 7b | 0d 72 65 67 69 73 74 65 |.mods;.{|.registe|
|000026d0| 72 20 50 72 6f 63 50 74 | 72 09 70 3b 0d 0d 09 69 |r ProcPt|r.p;...i|
|000026e0| 66 20 28 68 20 21 3d 20 | 6e 69 6c 29 0d 09 7b 0d |f (h != |nil)..{.|
|000026f0| 09 09 69 66 20 28 28 70 | 20 3d 20 28 2a 2a 68 29 |..if ((p| = (**h)|
|00002700| 2e 77 68 4b 65 79 29 20 | 21 3d 20 6e 69 6c 29 0d |.whKey) |!= nil).|
|00002710| 09 09 09 28 2a 70 29 20 | 28 63 68 2c 20 6d 6f 64 |...(*p) |(ch, mod|
|00002720| 73 29 3b 0d 09 7d 0d 7d | 0d 0d 0d 2f 2a 0d 09 43 |s);..}.}|.../*..C|
|00002730| 61 6c 6c 20 74 68 65 20 | 77 69 6e 64 6f 77 20 75 |all the |window u|
|00002740| 70 64 61 74 69 6e 67 20 | 70 72 6f 63 65 64 75 72 |pdating |procedur|
|00002750| 65 2c 20 70 61 73 73 69 | 6e 67 20 74 6f 20 69 74 |e, passi|ng to it|
|00002760| 20 61 6e 20 69 6e 64 69 | 63 61 74 6f 72 20 77 68 | an indi|cator wh|
|00002770| 65 74 68 65 72 0d 09 74 | 68 65 20 77 69 6e 64 6f |ether..t|he windo|
|00002780| 77 20 68 61 73 20 62 65 | 65 6e 20 72 65 73 69 7a |w has be|en resiz|
|00002790| 65 64 20 6f 72 20 6e 6f | 74 2e 20 20 54 68 65 6e |ed or no|t. Then|
|000027a0| 20 63 6c 65 61 72 20 74 | 68 65 20 66 6c 61 67 2c | clear t|he flag,|
|000027b0| 20 61 73 73 75 6d 69 6e | 67 0d 09 74 68 65 20 75 | assumin|g..the u|
|000027c0| 70 64 61 74 65 20 70 72 | 6f 63 20 74 6f 6f 6b 20 |pdate pr|oc took |
|000027d0| 77 68 61 74 65 76 65 72 | 20 61 63 74 69 6f 6e 20 |whatever| action |
|000027e0| 77 61 73 20 6e 65 63 65 | 73 73 61 72 79 20 74 6f |was nece|ssary to|
|000027f0| 20 72 65 73 70 6f 6e 64 | 20 74 6f 0d 09 72 65 73 | respond| to..res|
|00002800| 69 7a 69 6e 67 2e 0d 0d | 09 49 66 20 74 68 65 20 |izing...|.If the |
|00002810| 68 61 6e 64 6c 65 72 20 | 64 6f 65 73 6e 27 74 20 |handler |doesn't |
|00002820| 68 61 76 65 20 61 6e 79 | 20 75 70 64 61 74 65 20 |have any| update |
|00002830| 70 72 6f 63 2c 20 74 68 | 65 20 42 65 67 69 6e 2f |proc, th|e Begin/|
|00002840| 45 6e 64 55 70 64 61 74 | 65 0d 09 73 74 75 66 66 |EndUpdat|e..stuff|
|00002850| 20 69 73 20 73 74 69 6c | 6c 20 64 6f 6e 65 2c 20 | is stil|l done, |
|00002860| 74 6f 20 63 6c 65 61 72 | 20 74 68 65 20 75 70 64 |to clear| the upd|
|00002870| 61 74 65 20 72 65 67 69 | 6f 6e 2e 20 20 4f 74 68 |ate regi|on. Oth|
|00002880| 65 72 77 69 73 65 20 74 | 68 65 0d 09 57 69 6e 64 |erwise t|he..Wind|
|00002890| 6f 77 20 4d 61 6e 61 67 | 65 72 20 77 69 6c 6c 20 |ow Manag|er will |
|000028a0| 6b 65 65 70 20 67 65 6e | 65 72 61 74 69 6e 67 20 |keep gen|erating |
|000028b0| 75 70 64 61 74 65 20 65 | 76 65 6e 74 73 20 66 6f |update e|vents fo|
|000028c0| 72 20 74 68 65 20 77 69 | 6e 64 6f 77 2c 0d 09 73 |r the wi|ndow,..s|
|000028d0| 74 61 6c 6c 69 6e 67 20 | 75 70 64 61 74 65 73 20 |talling |updates |
|000028e0| 6f 66 20 6f 74 68 65 72 | 20 77 69 6e 64 6f 77 73 |of other| windows|
|000028f0| 2e 0d 0d 09 4d 61 6b 65 | 20 73 75 72 65 20 74 6f |....Make| sure to|
|00002900| 20 73 61 76 65 20 61 6e | 64 20 72 65 73 74 6f 72 | save an|d restor|
|00002910| 65 20 74 68 65 20 70 6f | 72 74 2c 20 61 73 20 69 |e the po|rt, as i|
|00002920| 74 27 73 20 6e 6f 74 20 | 61 6c 77 61 79 73 20 74 |t's not |always t|
|00002930| 68 65 0d 09 61 63 74 69 | 76 65 20 77 69 6e 64 6f |he..acti|ve windo|
|00002940| 77 20 74 68 61 74 20 69 | 73 20 75 70 64 61 74 65 |w that i|s update|
|00002950| 64 2e 0d 2a 2f 0d 0d 73 | 74 61 74 69 63 20 44 6f |d..*/..s|tatic Do|
|00002960| 55 70 64 61 74 65 20 28 | 68 29 0d 57 48 61 6e 64 |Update (|h).WHand|
|00002970| 6c 65 72 09 2a 2a 68 3b | 0d 7b 0d 72 65 67 69 73 |ler.**h;|.{.regis|
|00002980| 74 65 72 20 57 48 61 6e | 64 6c 65 72 09 2a 2a 72 |ter WHan|dler.**r|
|00002990| 68 3b 0d 72 65 67 69 73 | 74 65 72 20 50 72 6f 63 |h;.regis|ter Proc|
|000029a0| 50 74 72 09 70 3b 0d 72 | 65 67 69 73 74 65 72 20 |Ptr.p;.r|egister |
|000029b0| 47 72 61 66 50 74 72 09 | 75 70 64 50 6f 72 74 3b |GrafPtr.|updPort;|
|000029c0| 0d 47 72 61 66 50 74 72 | 09 09 09 09 74 6d 70 50 |.GrafPtr|....tmpP|
|000029d0| 6f 72 74 3b 0d 0d 09 69 | 66 20 28 28 72 68 20 3d |ort;...i|f ((rh =|
|000029e0| 20 68 29 20 21 3d 20 6e | 69 6c 29 0d 09 7b 0d 09 | h) != n|il)..{..|
|000029f0| 09 47 65 74 50 6f 72 74 | 20 28 26 74 6d 70 50 6f |.GetPort| (&tmpPo|
|00002a00| 72 74 29 3b 0d 09 09 53 | 65 74 50 6f 72 74 20 28 |rt);...S|etPort (|
|00002a10| 75 70 64 50 6f 72 74 20 | 3d 20 28 2a 2a 72 68 29 |updPort |= (**rh)|
|00002a20| 2e 77 68 57 69 6e 64 29 | 3b 0d 09 09 42 65 67 69 |.whWind)|;...Begi|
|00002a30| 6e 55 70 64 61 74 65 20 | 28 75 70 64 50 6f 72 74 |nUpdate |(updPort|
|00002a40| 29 3b 0d 09 09 69 66 20 | 28 28 70 20 3d 20 28 2a |);...if |((p = (*|
|00002a50| 2a 72 68 29 2e 77 68 55 | 70 64 61 74 65 29 20 21 |*rh).whU|pdate) !|
|00002a60| 3d 20 6e 69 6c 29 0d 09 | 09 7b 0d 09 09 09 28 2a |= nil)..|.{....(*|
|00002a70| 70 29 20 28 28 2a 2a 72 | 68 29 2e 77 68 53 69 7a |p) ((**r|h).whSiz|
|00002a80| 65 64 29 3b 0d 09 09 09 | 28 2a 2a 72 68 29 2e 77 |ed);....|(**rh).w|
|00002a90| 68 53 69 7a 65 64 20 3d | 20 66 61 6c 73 65 3b 0d |hSized =| false;.|
|00002aa0| 09 09 7d 0d 09 09 45 6e | 64 55 70 64 61 74 65 20 |..}...En|dUpdate |
|00002ab0| 28 75 70 64 50 6f 72 74 | 29 3b 0d 09 09 53 65 74 |(updPort|);...Set|
|00002ac0| 50 6f 72 74 20 28 74 6d | 70 50 6f 72 74 29 3b 0d |Port (tm|pPort);.|
|00002ad0| 09 7d 0d 7d 0d 0d 0d 2f | 2a 0d 09 50 61 73 73 20 |.}.}.../|*..Pass |
|00002ae0| 61 63 74 69 76 61 74 65 | 2f 64 65 61 63 74 69 76 |activate|/deactiv|
|00002af0| 61 74 65 20 6e 6f 74 69 | 66 69 63 61 74 69 6f 6e |ate noti|fication|
|00002b00| 20 74 6f 20 68 61 6e 64 | 6c 65 72 2e 20 20 4f 6e | to hand|ler. On|
|00002b10| 20 61 63 74 69 76 61 74 | 65 2c 0d 09 73 65 74 20 | activat|e,..set |
|00002b20| 74 68 65 20 70 6f 72 74 | 20 74 6f 20 74 68 65 20 |the port| to the |
|00002b30| 77 69 6e 64 6f 77 20 63 | 6f 6d 69 6e 67 20 61 63 |window c|oming ac|
|00002b40| 74 69 76 65 2e 20 20 4e | 6f 72 6d 61 6c 6c 79 20 |tive. N|ormally |
|00002b50| 74 68 69 73 20 69 73 20 | 64 6f 6e 65 20 62 79 0d |this is |done by.|
|00002b60| 09 74 68 65 20 75 73 65 | 72 20 63 6c 69 63 6b 69 |.the use|r clicki|
|00002b70| 6e 67 20 69 6e 20 61 20 | 77 69 6e 64 6f 77 2e 0d |ng in a |window..|
|00002b80| 0d 09 2a 2a 2a 20 42 55 | 54 20 2a 2a 2a 0d 09 55 |..*** BU|T ***..U|
|00002b90| 6e 64 65 72 20 63 65 72 | 74 61 69 6e 20 63 6f 6e |nder cer|tain con|
|00002ba0| 64 69 74 69 6f 6e 73 2c | 20 61 20 64 65 61 63 74 |ditions,| a deact|
|00002bb0| 69 76 61 74 65 20 6d 61 | 79 20 62 65 20 67 65 6e |ivate ma|y be gen|
|00002bc0| 65 72 61 74 65 64 20 66 | 6f 72 20 61 20 77 69 6e |erated f|or a win|
|00002bd0| 64 6f 77 0d 09 74 68 61 | 74 20 68 61 73 20 6e 6f |dow..tha|t has no|
|00002be0| 74 20 68 61 64 20 74 68 | 65 20 70 6f 72 74 20 73 |t had th|e port s|
|00002bf0| 65 74 20 74 6f 20 69 74 | 20 62 79 20 61 20 70 72 |et to it| by a pr|
|00002c00| 65 63 65 64 69 6e 67 20 | 61 63 74 69 76 61 74 65 |eceding |activate|
|00002c10| 2e 20 20 49 66 20 61 6e | 0d 09 61 70 70 6c 69 63 |. If an|..applic|
|00002c20| 61 74 69 6f 6e 20 70 75 | 74 73 20 75 70 20 77 69 |ation pu|ts up wi|
|00002c30| 6e 64 6f 77 20 41 2c 20 | 74 68 65 6e 20 77 69 6e |ndow A, |then win|
|00002c40| 64 6f 77 20 42 20 69 6e | 20 66 72 6f 6e 74 20 6f |dow B in| front o|
|00002c50| 66 20 41 2c 20 74 68 65 | 6e 0d 09 73 74 61 72 74 |f A, the|n..start|
|00002c60| 73 20 70 72 6f 63 65 73 | 73 69 6e 67 20 65 76 65 |s proces|sing eve|
|00002c70| 6e 74 73 2c 20 74 68 65 | 20 66 69 72 73 74 20 65 |nts, the| first e|
|00002c80| 76 65 6e 74 73 20 77 69 | 6c 6c 20 62 65 20 61 20 |vents wi|ll be a |
|00002c90| 64 65 61 63 74 69 76 61 | 74 65 20 66 6f 72 20 41 |deactiva|te for A|
|00002ca0| 0d 09 61 6e 64 20 61 6e | 20 61 63 74 69 76 61 74 |..and an| activat|
|00002cb0| 65 20 66 6f 72 20 42 2e | 20 20 53 69 6e 63 65 20 |e for B.| Since |
|00002cc0| 69 74 20 74 68 65 72 65 | 66 6f 72 65 20 63 61 6e |it there|fore can|
|00002cd0| 27 74 20 62 65 20 61 73 | 73 75 6d 65 64 20 74 68 |'t be as|sumed th|
|00002ce0| 65 20 70 6f 72 74 0d 09 | 77 61 73 20 73 65 74 20 |e port..|was set |
|00002cf0| 74 6f 20 41 20 62 79 20 | 61 6e 20 61 63 74 69 76 |to A by |an activ|
|00002d00| 61 74 65 2c 20 74 68 65 | 20 70 6f 72 74 20 6e 65 |ate, the| port ne|
|00002d10| 65 64 73 20 74 6f 20 62 | 65 20 73 65 74 20 66 6f |eds to b|e set fo|
|00002d20| 72 20 64 65 61 63 74 69 | 76 61 74 65 73 0d 09 61 |r deacti|vates..a|
|00002d30| 73 20 77 65 6c 6c 2e 0d | 0d 09 54 68 69 73 20 6d |s well..|..This m|
|00002d40| 61 74 74 65 72 73 20 6e | 6f 74 20 61 20 77 68 69 |atters n|ot a whi|
|00002d50| 74 20 66 6f 72 20 74 68 | 65 20 6d 6f 72 65 20 75 |t for th|e more u|
|00002d60| 73 75 61 6c 20 63 61 73 | 65 73 20 74 68 61 74 20 |sual cas|es that |
|00002d70| 6f 63 63 75 72 2e 20 20 | 49 66 20 61 0d 09 64 65 |occur. |If a..de|
|00002d80| 61 63 74 69 76 61 74 65 | 20 66 6f 72 20 6f 6e 65 |activate| for one|
|00002d90| 20 77 69 6e 64 6f 77 20 | 69 73 20 66 6f 6c 6c 6f | window |is follo|
|00002da0| 77 65 64 20 62 79 20 61 | 6e 20 61 63 74 69 76 61 |wed by a|n activa|
|00002db0| 74 65 20 66 6f 72 20 61 | 6e 6f 74 68 65 72 2c 20 |te for a|nother, |
|00002dc0| 74 68 65 0d 09 70 6f 72 | 74 20 77 69 6c 6c 20 73 |the..por|t will s|
|00002dd0| 74 69 6c 6c 20 62 65 20 | 73 77 69 74 63 68 65 64 |till be |switched|
|00002de0| 20 70 72 6f 70 65 72 6c | 79 20 74 6f 20 74 68 65 | properl|y to the|
|00002df0| 20 6e 65 77 6c 79 20 61 | 63 74 69 76 65 20 77 69 | newly a|ctive wi|
|00002e00| 6e 64 6f 77 2e 20 20 49 | 66 0d 09 6e 6f 20 61 63 |ndow. I|f..no ac|
|00002e10| 74 69 76 61 74 65 20 66 | 6f 6c 6c 6f 77 73 20 74 |tivate f|ollows t|
|00002e20| 68 65 20 64 65 61 63 74 | 69 76 61 74 65 2c 20 74 |he deact|ivate, t|
|00002e30| 68 65 20 64 65 61 63 74 | 69 76 61 74 65 64 20 77 |he deact|ivated w|
|00002e40| 69 6e 64 6f 77 20 69 73 | 20 74 68 65 20 6c 61 73 |indow is| the las|
|00002e50| 74 0d 09 6f 6e 65 2c 20 | 61 6e 64 20 69 74 20 64 |t..one, |and it d|
|00002e60| 6f 65 73 6e 27 74 20 6d | 61 74 74 65 72 20 77 68 |oesn't m|atter wh|
|00002e70| 61 74 20 74 68 65 20 70 | 6f 72 74 20 65 6e 64 73 |at the p|ort ends|
|00002e80| 20 75 70 20 73 65 74 20 | 74 6f 2c 20 61 6e 79 77 | up set |to, anyw|
|00002e90| 61 79 2e 0d 2a 2f 0d 0d | 73 74 61 74 69 63 20 44 |ay..*/..|static D|
|00002ea0| 6f 41 63 74 69 76 61 74 | 65 20 28 68 2c 20 61 63 |oActivat|e (h, ac|
|00002eb0| 74 69 76 65 29 0d 57 48 | 61 6e 64 6c 65 72 09 2a |tive).WH|andler.*|
|00002ec0| 2a 68 3b 0d 42 6f 6f 6c | 65 61 6e 09 09 61 63 74 |*h;.Bool|ean..act|
|00002ed0| 69 76 65 3b 0d 7b 0d 72 | 65 67 69 73 74 65 72 20 |ive;.{.r|egister |
|00002ee0| 50 72 6f 63 50 74 72 09 | 70 3b 0d 0d 09 69 66 20 |ProcPtr.|p;...if |
|00002ef0| 28 68 20 21 3d 20 6e 69 | 6c 29 0d 09 7b 0d 09 09 |(h != ni|l)..{...|
|00002f00| 53 65 74 50 6f 72 74 20 | 28 28 2a 2a 68 29 2e 77 |SetPort |((**h).w|
|00002f10| 68 57 69 6e 64 29 3b 0d | 09 09 69 66 20 28 28 70 |hWind);.|..if ((p|
|00002f20| 20 3d 20 28 2a 2a 68 29 | 2e 77 68 41 63 74 69 76 | = (**h)|.whActiv|
|00002f30| 61 74 65 29 20 21 3d 20 | 6e 69 6c 29 0d 09 09 09 |ate) != |nil)....|
|00002f40| 28 2a 70 29 20 28 61 63 | 74 69 76 65 29 3b 0d 09 |(*p) (ac|tive);..|
|00002f50| 7d 0d 7d 0d 0d 0d 2f 2a | 0d 09 45 78 65 63 75 74 |}.}.../*|..Execut|
|00002f60| 65 20 61 20 77 69 6e 64 | 6f 77 20 68 61 6e 64 6c |e a wind|ow handl|
|00002f70| 65 72 27 73 20 63 6c 6f | 73 65 20 62 6f 78 20 70 |er's clo|se box p|
|00002f80| 72 6f 63 2e 20 20 54 68 | 65 20 63 6c 6f 73 65 20 |roc. Th|e close |
|00002f90| 70 72 6f 63 20 66 6f 72 | 0d 09 68 61 6e 64 6c 65 |proc for|..handle|
|00002fa0| 72 73 20 66 6f 72 20 74 | 65 6d 70 20 77 69 6e 64 |rs for t|emp wind|
|00002fb0| 6f 77 73 20 74 68 61 74 | 20 77 61 6e 74 20 74 6f |ows that| want to|
|00002fc0| 20 72 65 6d 6f 76 65 20 | 74 68 65 6d 73 65 6c 76 | remove |themselv|
|00002fd0| 65 73 20 77 68 65 6e 20 | 74 68 65 0d 09 77 69 6e |es when |the..win|
|00002fe0| 64 6f 77 20 69 73 20 63 | 6c 6f 73 65 64 20 63 61 |dow is c|losed ca|
|00002ff0| 6e 20 63 61 6c 6c 20 53 | 6b 65 6c 52 6d 76 65 57 |n call S|kelRmveW|
|00003000| 69 6e 64 20 74 6f 20 64 | 69 73 70 6f 73 65 20 6f |ind to d|ispose o|
|00003010| 66 20 74 68 65 20 77 69 | 6e 64 6f 77 0d 09 61 6e |f the wi|ndow..an|
|00003020| 64 20 72 65 6d 6f 76 65 | 20 74 68 65 20 68 61 6e |d remove| the han|
|00003030| 64 6c 65 72 20 66 72 6f | 6d 20 74 68 65 20 77 69 |dler fro|m the wi|
|00003040| 6e 64 6f 77 20 68 61 6e | 64 6c 65 72 20 6c 69 73 |ndow han|dler lis|
|00003050| 74 2e 20 20 54 68 75 73 | 2c 20 77 69 6e 64 6f 77 |t. Thus|, window|
|00003060| 73 0d 09 6d 61 79 20 62 | 65 20 64 79 6e 61 6d 69 |s..may b|e dynami|
|00003070| 63 61 6c 6c 79 20 63 72 | 65 61 74 65 64 20 61 6e |cally cr|eated an|
|00003080| 64 20 64 65 73 74 72 6f | 79 65 64 20 77 69 74 68 |d destro|yed with|
|00003090| 6f 75 74 20 66 69 6c 6c | 69 6e 67 20 75 70 20 74 |out fill|ing up t|
|000030a0| 68 65 0d 09 68 61 6e 64 | 6c 65 72 20 6c 69 73 74 |he..hand|ler list|
|000030b0| 20 77 69 74 68 20 61 20 | 62 75 6e 63 68 20 6f 66 | with a |bunch of|
|000030c0| 20 69 6e 76 61 6c 69 64 | 20 68 61 6e 64 6c 65 72 | invalid| handler|
|000030d0| 73 2e 0d 09 0d 09 49 66 | 20 74 68 65 20 68 61 6e |s.....If| the han|
|000030e0| 64 6c 65 72 20 64 6f 65 | 73 6e 27 74 20 68 61 76 |dler doe|sn't hav|
|000030f0| 65 20 61 20 63 6c 6f 73 | 65 20 70 72 6f 63 2c 20 |e a clos|e proc, |
|00003100| 6a 75 73 74 20 68 69 64 | 65 20 74 68 65 20 77 69 |just hid|e the wi|
|00003110| 6e 64 6f 77 2e 0d 09 54 | 68 65 20 68 6f 73 74 20 |ndow...T|he host |
|00003120| 73 68 6f 75 6c 64 20 70 | 72 6f 76 69 64 65 20 73 |should p|rovide s|
|00003130| 6f 6d 65 20 77 61 79 20 | 6f 66 20 72 65 6f 70 65 |ome way |of reope|
|00003140| 6e 69 6e 67 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |ning the| window |
|00003150| 28 70 65 72 68 61 70 73 | 0d 09 61 20 6d 65 6e 75 |(perhaps|..a menu|
|00003160| 20 73 65 6c 65 63 74 69 | 6f 6e 29 2e 20 20 4f 74 | selecti|on). Ot|
|00003170| 68 65 72 77 69 73 65 20 | 74 68 65 20 77 69 6e 64 |herwise |the wind|
|00003180| 6f 77 20 77 69 6c 6c 20 | 62 65 20 6c 6f 73 74 20 |ow will |be lost |
|00003190| 66 72 6f 6d 20 75 73 65 | 72 0d 09 63 6f 6e 74 72 |from use|r..contr|
|000031a0| 6f 6c 20 69 66 20 69 74 | 20 69 73 20 68 69 64 64 |ol if it| is hidd|
|000031b0| 65 6e 2c 20 73 69 6e 63 | 65 20 69 74 20 77 6f 6e |en, sinc|e it won|
|000031c0| 27 74 20 72 65 63 65 69 | 76 65 20 75 73 65 72 2d |'t recei|ve user-|
|000031d0| 69 6e 69 74 69 61 74 65 | 64 0d 09 65 76 65 6e 74 |initiate|d..event|
|000031e0| 73 2e 0d 0d 09 54 68 69 | 73 20 69 73 20 63 61 6c |s....Thi|s is cal|
|000031f0| 6c 65 64 20 62 6f 74 68 | 20 66 6f 72 20 72 65 67 |led both| for reg|
|00003200| 75 6c 61 72 20 61 6e 64 | 20 64 69 61 6c 6f 67 20 |ular and| dialog |
|00003210| 77 69 6e 64 6f 77 73 2e | 0d 0d 09 53 69 6e 63 65 |windows.|...Since|
|00003220| 20 74 68 65 20 63 6c 6f | 73 65 20 62 6f 78 20 6f | the clo|se box o|
|00003230| 66 20 6f 6e 6c 79 20 74 | 68 65 20 61 63 74 69 76 |f only t|he activ|
|00003240| 65 20 77 69 6e 64 6f 77 | 20 6d 61 79 20 62 65 20 |e window| may be |
|00003250| 63 6c 69 63 6b 65 64 2c | 20 69 74 0d 09 69 73 20 |clicked,| it..is |
|00003260| 6e 6f 74 20 6e 65 63 65 | 73 73 61 72 79 20 74 6f |not nece|ssary to|
|00003270| 20 73 65 74 20 74 68 65 | 20 70 6f 72 74 2e 0d 2a | set the| port..*|
|00003280| 2f 0d 0d 73 74 61 74 69 | 63 20 44 6f 43 6c 6f 73 |/..stati|c DoClos|
|00003290| 65 20 28 68 29 0d 57 48 | 61 6e 64 6c 65 72 09 2a |e (h).WH|andler.*|
|000032a0| 2a 68 3b 0d 7b 0d 72 65 | 67 69 73 74 65 72 20 57 |*h;.{.re|gister W|
|000032b0| 48 61 6e 64 6c 65 72 09 | 2a 2a 72 68 3b 0d 72 65 |Handler.|**rh;.re|
|000032c0| 67 69 73 74 65 72 20 50 | 72 6f 63 50 74 72 09 70 |gister P|rocPtr.p|
|000032d0| 3b 0d 0d 09 69 66 20 28 | 28 72 68 20 3d 20 68 29 |;...if (|(rh = h)|
|000032e0| 20 21 3d 20 6e 69 6c 29 | 0d 09 7b 0d 09 09 69 66 | != nil)|..{...if|
|000032f0| 20 28 28 70 20 3d 20 28 | 2a 2a 72 68 29 2e 77 68 | ((p = (|**rh).wh|
|00003300| 43 6c 6f 73 65 29 20 21 | 3d 20 6e 69 6c 29 0d 09 |Close) !|= nil)..|
|00003310| 09 09 28 2a 70 29 20 28 | 29 3b 0d 09 09 65 6c 73 |..(*p) (|);...els|
|00003320| 65 0d 09 09 09 48 69 64 | 65 57 69 6e 64 6f 77 20 |e....Hid|eWindow |
|00003330| 28 28 2a 2a 72 68 29 2e | 77 68 57 69 6e 64 29 3b |((**rh).|whWind);|
|00003340| 0d 09 7d 0d 7d 0d 0d 0d | 2f 2a 0d 09 45 78 65 63 |..}.}...|/*..Exec|
|00003350| 75 74 65 20 61 20 77 69 | 6e 64 6f 77 20 68 61 6e |ute a wi|ndow han|
|00003360| 64 6c 65 72 27 73 20 63 | 6c 6f 62 62 65 72 20 70 |dler's c|lobber p|
|00003370| 72 6f 63 2e 20 20 54 68 | 69 73 20 69 73 20 63 61 |roc. Th|is is ca|
|00003380| 6c 6c 65 64 20 62 6f 74 | 68 0d 09 66 6f 72 20 72 |lled bot|h..for r|
|00003390| 65 67 75 6c 61 72 20 61 | 6e 64 20 64 69 61 6c 6f |egular a|nd dialo|
|000033a0| 67 20 77 69 6e 64 6f 77 | 73 2e 0d 0d 09 4d 75 73 |g window|s....Mus|
|000033b0| 74 20 73 61 76 65 2c 20 | 73 65 74 20 61 6e 64 20 |t save, |set and |
|000033c0| 72 65 73 74 6f 72 65 20 | 70 6f 72 74 2c 20 73 69 |restore |port, si|
|000033d0| 6e 63 65 20 61 6e 79 20 | 77 69 6e 64 6f 77 20 28 |nce any |window (|
|000033e0| 6e 6f 74 20 6a 75 73 74 | 20 61 63 74 69 76 65 0d |not just| active.|
|000033f0| 09 6f 6e 65 29 20 6d 61 | 79 20 62 65 20 63 6c 6f |.one) ma|y be clo|
|00003400| 62 62 65 72 65 64 20 61 | 74 20 61 6e 79 20 74 69 |bbered a|t any ti|
|00003410| 6d 65 2e 0d 0d 09 44 6f | 6e 27 74 20 6e 65 65 64 |me....Do|n't need|
|00003420| 20 74 6f 20 63 68 65 63 | 6b 20 77 68 65 74 68 65 | to chec|k whethe|
|00003430| 72 20 68 61 6e 64 6c 65 | 72 20 69 73 20 6e 69 6c |r handle|r is nil|
|00003440| 2c 20 61 73 20 69 6e 20 | 6f 74 68 65 72 20 68 61 |, as in |other ha|
|00003450| 6e 64 6c 65 72 0d 09 70 | 72 6f 63 65 64 75 72 65 |ndler..p|rocedure|
|00003460| 73 2c 20 73 69 6e 63 65 | 20 74 68 69 73 20 69 73 |s, since| this is|
|00003470| 20 6f 6e 6c 79 20 63 61 | 6c 6c 65 64 20 62 79 20 | only ca|lled by |
|00003480| 53 6b 65 6c 52 6d 76 65 | 57 69 6e 64 20 77 69 74 |SkelRmve|Wind wit|
|00003490| 68 20 61 0d 09 6b 6e 6f | 77 6e 2d 76 61 6c 69 64 |h a..kno|wn-valid|
|000034a0| 20 68 61 6e 64 6c 65 72 | 2e 0d 2a 2f 0d 0d 73 74 | handler|..*/..st|
|000034b0| 61 74 69 63 20 44 6f 43 | 6c 6f 62 62 65 72 20 28 |atic DoC|lobber (|
|000034c0| 68 29 0d 57 48 61 6e 64 | 6c 65 72 09 2a 2a 68 3b |h).WHand|ler.**h;|
|000034d0| 0d 7b 0d 72 65 67 69 73 | 74 65 72 20 50 72 6f 63 |.{.regis|ter Proc|
|000034e0| 50 74 72 09 70 3b 0d 47 | 72 61 66 50 74 72 09 09 |Ptr.p;.G|rafPtr..|
|000034f0| 09 09 74 6d 70 50 6f 72 | 74 3b 0d 0d 09 47 65 74 |..tmpPor|t;...Get|
|00003500| 50 6f 72 74 20 28 26 74 | 6d 70 50 6f 72 74 29 3b |Port (&t|mpPort);|
|00003510| 0d 09 53 65 74 50 6f 72 | 74 20 28 28 2a 2a 68 29 |..SetPor|t ((**h)|
|00003520| 2e 77 68 57 69 6e 64 29 | 3b 0d 09 69 66 20 28 28 |.whWind)|;..if ((|
|00003530| 70 20 3d 20 28 2a 2a 68 | 29 2e 77 68 43 6c 6f 62 |p = (**h|).whClob|
|00003540| 62 65 72 29 20 21 3d 20 | 6e 69 6c 29 0d 09 09 28 |ber) != |nil)...(|
|00003550| 2a 70 29 20 28 29 3b 0d | 09 53 65 74 50 6f 72 74 |*p) ();.|.SetPort|
|00003560| 20 28 74 6d 70 50 6f 72 | 74 29 3b 0d 7d 0d 0d 0d | (tmpPor|t);.}...|
|00003570| 23 20 69 66 64 65 66 09 | 73 75 70 70 6f 72 74 44 |# ifdef.|supportD|
|00003580| 69 61 6c 6f 67 73 0d 0d | 2f 2a 20 2d 2d 2d 2d 2d |ialogs..|/* -----|
|00003590| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000035a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000035b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000035c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 20 |--------|------- |
|000035d0| 2a 2f 0d 2f 2a 09 09 09 | 09 09 09 09 44 69 61 6c |*/./*...|....Dial|
|000035e0| 6f 67 2d 68 61 6e 64 6c | 69 6e 67 20 72 6f 75 74 |og-handl|ing rout|
|000035f0| 69 6e 65 73 09 09 09 09 | 09 2a 2f 0d 2f 2a 20 2d |ines....|.*/./* -|
|00003600| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003610| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003620| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003630| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003640| 2d 2d 2d 20 2a 2f 0d 0d | 0d 2f 2a 0d 09 48 61 6e |--- */..|./*..Han|
|00003650| 64 6c 65 20 65 76 65 6e | 74 20 69 66 20 69 74 27 |dle even|t if it'|
|00003660| 73 20 66 6f 72 20 61 20 | 28 6d 6f 64 65 6c 65 73 |s for a |(modeles|
|00003670| 73 29 20 64 69 61 6c 6f | 67 2e 20 20 54 68 65 20 |s) dialo|g. The |
|00003680| 65 76 65 6e 74 20 6d 75 | 73 74 20 62 65 20 6f 6e |event mu|st be on|
|00003690| 65 0d 09 6f 66 20 74 68 | 6f 73 65 20 74 68 61 74 |e..of th|ose that|
|000036a0| 20 69 73 20 70 61 73 73 | 65 64 20 74 6f 20 64 69 | is pass|ed to di|
|000036b0| 61 6c 6f 67 73 20 61 63 | 63 6f 72 64 69 6e 67 20 |alogs ac|cording |
|000036c0| 74 6f 20 64 6c 6f 67 45 | 76 65 6e 74 4d 61 73 6b |to dlogE|ventMask|
|000036d0| 2e 0d 09 54 68 69 73 20 | 6d 61 73 6b 20 63 61 6e |...This |mask can|
|000036e0| 20 62 65 20 73 65 74 20 | 73 6f 20 74 68 61 74 20 | be set |so that |
|000036f0| 64 69 73 6b 2d 69 6e 73 | 65 72 74 73 2c 20 66 6f |disk-ins|erts, fo|
|00003700| 72 20 69 6e 73 74 61 6e | 63 65 2c 20 64 6f 6e 27 |r instan|ce, don'|
|00003710| 74 0d 09 67 65 74 20 65 | 61 74 65 6e 20 75 70 2e |t..get e|aten up.|
|00003720| 0d 0d 09 45 78 61 6d 69 | 6e 65 20 65 76 65 6e 74 |...Exami|ne event|
|00003730| 20 61 6e 64 20 73 65 74 | 20 70 6f 72 74 20 69 66 | and set| port if|
|00003740| 20 64 69 61 6c 6f 67 20 | 77 69 6e 64 6f 77 20 69 | dialog |window i|
|00003750| 73 20 63 6f 6d 69 6e 67 | 20 61 63 74 69 76 65 20 |s coming| active |
|00003760| 28 66 6f 72 0d 09 6e 6f | 72 6d 61 6c 20 77 69 6e |(for..no|rmal win|
|00003770| 64 6f 77 73 2c 20 44 6f | 41 63 74 69 76 61 74 65 |dows, Do|Activate|
|00003780| 20 73 65 74 73 20 74 68 | 65 20 70 6f 72 74 3b 20 | sets th|e port; |
|00003790| 74 68 65 72 65 27 73 20 | 6e 6f 20 73 75 63 68 20 |there's |no such |
|000037a0| 74 68 69 6e 67 0d 09 66 | 6f 72 20 64 69 61 6c 6f |thing..f|or dialo|
|000037b0| 67 73 2c 20 73 6f 20 69 | 74 27 73 20 64 6f 6e 65 |gs, so i|t's done|
|000037c0| 20 68 65 72 65 2e 29 20 | 20 57 68 65 6e 20 74 68 | here.) | When th|
|000037d0| 69 73 20 69 73 20 64 6f | 6e 65 2c 20 74 68 65 20 |is is do|ne, the |
|000037e0| 74 72 69 6f 0d 09 6f 66 | 20 47 65 74 50 6f 72 74 |trio..of| GetPort|
|000037f0| 2f 53 65 74 50 6f 72 74 | 2f 53 65 74 50 6f 72 74 |/SetPort|/SetPort|
|00003800| 20 63 61 6c 6c 73 20 63 | 6f 6d 6d 65 6e 74 65 64 | calls c|ommented|
|00003810| 20 6f 75 74 20 62 65 6c | 6f 77 20 64 6f 65 73 6e | out bel|ow doesn|
|00003820| 27 74 20 61 70 70 65 61 | 72 0d 09 74 6f 20 62 65 |'t appea|r..to be|
|00003830| 20 6e 65 63 65 73 73 61 | 72 79 20 61 6e 79 20 6c | necessa|ry any l|
|00003840| 6f 6e 67 65 72 2e 20 20 | 49 66 20 79 6f 75 20 77 |onger. |If you w|
|00003850| 61 6e 74 20 74 6f 20 62 | 65 20 63 61 75 74 69 6f |ant to b|e cautio|
|00003860| 75 73 2c 20 69 74 20 64 | 6f 65 73 6e 27 74 0d 09 |us, it d|oesn't..|
|00003870| 68 75 72 74 20 74 6f 20 | 75 6e 63 6f 6d 6d 65 6e |hurt to |uncommen|
|00003880| 74 20 74 68 65 6d 2e 2e | 2e 0d 2a 2f 0d 0d 73 74 |t them..|..*/..st|
|00003890| 61 74 69 63 20 44 6f 44 | 69 61 6c 6f 67 20 28 74 |atic DoD|ialog (t|
|000038a0| 68 65 45 76 65 6e 74 29 | 0d 72 65 67 69 73 74 65 |heEvent)|.registe|
|000038b0| 72 20 45 76 65 6e 74 52 | 65 63 6f 72 64 09 2a 74 |r EventR|ecord.*t|
|000038c0| 68 65 45 76 65 6e 74 3b | 0d 7b 0d 72 65 67 69 73 |heEvent;|.{.regis|
|000038d0| 74 65 72 20 57 48 61 6e | 64 6c 65 72 09 2a 2a 64 |ter WHan|dler.**d|
|000038e0| 68 3b 0d 44 69 61 6c 6f | 67 50 74 72 09 09 09 74 |h;.Dialo|gPtr...t|
|000038f0| 68 65 44 69 61 6c 6f 67 | 3b 0d 72 65 67 69 73 74 |heDialog|;.regist|
|00003900| 65 72 20 49 6e 74 65 67 | 65 72 09 77 68 61 74 3b |er Integ|er.what;|
|00003910| 0d 49 6e 74 65 67 65 72 | 09 09 09 09 69 74 65 6d |.Integer|....item|
|00003920| 3b 0d 47 72 61 66 50 74 | 72 09 09 09 09 74 6d 70 |;.GrafPt|r....tmp|
|00003930| 50 6f 72 74 3b 0d 57 69 | 6e 64 6f 77 50 65 65 6b |Port;.Wi|ndowPeek|
|00003940| 09 09 09 77 3b 0d 0d 2f | 2a 0d 09 68 61 6e 64 6c |...w;../|*..handl|
|00003950| 65 20 63 6f 6d 6d 61 6e | 64 20 6b 65 79 73 20 62 |e comman|d keys b|
|00003960| 65 66 6f 72 65 20 74 68 | 65 79 20 67 65 74 20 74 |efore th|ey get t|
|00003970| 6f 20 49 73 44 69 61 6c | 6f 67 45 76 65 6e 74 0d |o IsDial|ogEvent.|
|00003980| 2a 2f 0d 0d 09 77 68 61 | 74 20 3d 20 74 68 65 45 |*/...wha|t = theE|
|00003990| 76 65 6e 74 2d 3e 77 68 | 61 74 3b 0d 09 69 66 28 |vent->wh|at;..if(|
|000039a0| 28 77 68 61 74 20 3d 3d | 20 6b 65 79 44 6f 77 6e |(what ==| keyDown|
|000039b0| 20 7c 7c 20 77 68 61 74 | 20 3d 3d 20 61 75 74 6f | || what| == auto|
|000039c0| 4b 65 79 29 20 26 26 20 | 28 74 68 65 45 76 65 6e |Key) && |(theEven|
|000039d0| 74 2d 3e 6d 6f 64 69 66 | 69 65 72 73 20 26 20 63 |t->modif|iers & c|
|000039e0| 6d 64 4b 65 79 29 29 0d | 09 7b 0d 09 20 20 20 09 |mdKey)).|.{.. .|
|000039f0| 44 6f 4d 65 6e 75 43 6f | 6d 6d 61 6e 64 20 28 4d |DoMenuCo|mmand (M|
|00003a00| 65 6e 75 4b 65 79 20 28 | 74 68 65 45 76 65 6e 74 |enuKey (|theEvent|
|00003a10| 2d 3e 6d 65 73 73 61 67 | 65 20 26 20 63 68 61 72 |->messag|e & char|
|00003a20| 43 6f 64 65 4d 61 73 6b | 29 29 3b 0d 09 20 20 20 |CodeMask|));.. |
|00003a30| 09 72 65 74 75 72 6e 20 | 28 74 72 75 65 29 3b 0d |.return |(true);.|
|00003a40| 09 7d 0d 09 0d 09 69 66 | 20 28 28 28 31 20 3c 3c |.}....if| (((1 <<|
|00003a50| 20 77 68 61 74 29 20 26 | 20 64 6c 6f 67 45 76 65 | what) &| dlogEve|
|00003a60| 6e 74 4d 61 73 6b 29 20 | 26 26 20 49 73 44 69 61 |ntMask) |&& IsDia|
|00003a70| 6c 6f 67 45 76 65 6e 74 | 20 28 74 68 65 45 76 65 |logEvent| (theEve|
|00003a80| 6e 74 29 29 0d 09 7b 0d | 09 09 2f 2a 20 75 67 6c |nt))..{.|../* ugl|
|00003a90| 79 20 70 72 6f 67 72 61 | 6d 6d 69 6e 67 20 61 77 |y progra|mming aw|
|00003aa0| 61 72 64 20 73 65 6d 69 | 2d 66 69 6e 61 6c 69 73 |ard semi|-finalis|
|00003ab0| 74 20 66 6f 6c 6c 6f 77 | 73 20 2a 2f 0d 09 09 69 |t follow|s */...i|
|00003ac0| 66 20 28 74 68 65 45 76 | 65 6e 74 2d 3e 77 68 61 |f (theEv|ent->wha|
|00003ad0| 74 20 3d 3d 20 61 63 74 | 69 76 61 74 65 45 76 74 |t == act|ivateEvt|
|00003ae0| 09 09 09 2f 2a 20 69 66 | 20 61 63 74 69 76 61 74 |.../* if| activat|
|00003af0| 65 20 2a 2f 0d 09 09 09 | 26 26 20 28 74 68 65 45 |e */....|&& (theE|
|00003b00| 76 65 6e 74 2d 3e 6d 6f | 64 69 66 69 65 72 73 20 |vent->mo|difiers |
|00003b10| 26 20 61 63 74 69 76 65 | 46 6c 61 67 29 09 2f 2a |& active|Flag)./*|
|00003b20| 20 61 6e 64 20 63 6f 6d | 69 6e 67 20 61 63 74 69 | and com|ing acti|
|00003b30| 76 65 20 2a 2f 0d 09 09 | 09 26 26 20 28 77 3d 28 |ve */...|.&& (w=(|
|00003b40| 57 69 6e 64 6f 77 50 65 | 65 6b 29 20 74 68 65 45 |WindowPe|ek) theE|
|00003b50| 76 65 6e 74 2d 3e 6d 65 | 73 73 61 67 65 29 2d 3e |vent->me|ssage)->|
|00003b60| 77 69 6e 64 6f 77 4b 69 | 6e 64 0d 09 09 09 09 09 |windowKi|nd......|
|00003b70| 3d 3d 20 64 69 61 6c 6f | 67 4b 69 6e 64 29 0d 09 |== dialo|gKind)..|
|00003b80| 09 7b 0d 09 09 09 53 65 | 74 50 6f 72 74 20 28 28 |.{....Se|tPort ((|
|00003b90| 47 72 61 66 50 74 72 29 | 20 77 29 3b 0d 09 09 7d |GrafPtr)| w);...}|
|00003ba0| 0d 09 09 69 66 20 28 44 | 69 61 6c 6f 67 53 65 6c |...if (D|ialogSel|
|00003bb0| 65 63 74 20 28 74 68 65 | 45 76 65 6e 74 2c 20 26 |ect (the|Event, &|
|00003bc0| 74 68 65 44 69 61 6c 6f | 67 2c 20 26 69 74 65 6d |theDialo|g, &item|
|00003bd0| 29 0d 09 09 20 20 20 26 | 26 20 28 64 68 20 3d 20 |)... &|& (dh = |
|00003be0| 47 65 74 44 48 61 6e 64 | 6c 65 72 20 28 74 68 65 |GetDHand|ler (the|
|00003bf0| 44 69 61 6c 6f 67 29 29 | 20 21 3d 20 6e 69 6c 0d |Dialog))| != nil.|
|00003c00| 09 09 20 20 20 26 26 20 | 28 2a 2a 64 68 29 2e 77 |.. && |(**dh).w|
|00003c10| 68 45 76 65 6e 74 20 21 | 3d 20 6e 69 6c 29 0d 09 |hEvent !|= nil)..|
|00003c20| 09 7b 0d 09 09 09 2f 2a | 47 65 74 50 6f 72 74 20 |.{..../*|GetPort |
|00003c30| 28 26 74 6d 70 50 6f 72 | 74 29 3b 2a 2f 0d 09 09 |(&tmpPor|t);*/...|
|00003c40| 09 2f 2a 53 65 74 50 6f | 72 74 20 28 74 68 65 44 |./*SetPo|rt (theD|
|00003c50| 69 61 6c 6f 67 29 3b 2a | 2f 0d 09 09 09 28 2a 28 |ialog);*|/....(*(|
|00003c60| 2a 2a 64 68 29 2e 77 68 | 45 76 65 6e 74 29 20 28 |**dh).wh|Event) (|
|00003c70| 69 74 65 6d 2c 20 74 68 | 65 45 76 65 6e 74 29 3b |item, th|eEvent);|
|00003c80| 0d 09 09 09 2f 2a 53 65 | 74 50 6f 72 74 20 28 74 |..../*Se|tPort (t|
|00003c90| 6d 70 50 6f 72 74 29 3b | 2a 2f 0d 09 09 7d 0d 09 |mpPort);|*/...}..|
|00003ca0| 09 72 65 74 75 72 6e 20 | 28 74 72 75 65 29 3b 0d |.return |(true);.|
|00003cb0| 09 7d 0d 09 72 65 74 75 | 72 6e 20 28 66 61 6c 73 |.}..retu|rn (fals|
|00003cc0| 65 29 3b 0d 7d 0d 0d 23 | 20 65 6e 64 69 66 0d 0d |e);.}..#| endif..|
|00003cd0| 0d 2f 2a 20 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |./* ----|--------|
|00003ce0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003cf0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003d00| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003d10| 2d 2d 2d 2d 2d 2d 2d 2d | 20 2a 2f 0d 2f 2a 09 09 |--------| */./*..|
|00003d20| 09 09 09 09 09 45 76 65 | 6e 74 2d 68 61 6e 64 6c |.....Eve|nt-handl|
|00003d30| 69 6e 67 20 72 6f 75 74 | 69 6e 65 73 09 09 09 09 |ing rout|ines....|
|00003d40| 09 09 2a 2f 0d 2f 2a 20 | 2d 2d 2d 2d 2d 2d 2d 2d |..*/./* |--------|
|00003d50| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003d60| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003d70| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003d80| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 20 2a 2f 0d |--------|---- */.|
|00003d90| 0d 0d 2f 2a 0d 09 48 61 | 76 65 20 65 69 74 68 65 |../*..Ha|ve eithe|
|00003da0| 72 20 7a 6f 6f 6d 65 64 | 20 61 20 77 69 6e 64 6f |r zoomed| a windo|
|00003db0| 77 20 6f 72 20 73 69 7a | 65 64 20 69 74 20 6d 61 |w or siz|ed it ma|
|00003dc0| 6e 75 61 6c 6c 79 2e 20 | 20 49 6e 76 61 6c 69 64 |nually. | Invalid|
|00003dd0| 61 74 65 0d 09 69 74 20 | 74 6f 20 66 6f 72 63 65 |ate..it |to force|
|00003de0| 20 61 6e 20 75 70 64 61 | 74 65 20 61 6e 64 20 73 | an upda|te and s|
|00003df0| 65 74 20 74 68 65 20 27 | 72 65 73 69 7a 65 64 27 |et the '|resized'|
|00003e00| 20 66 6c 61 67 20 69 6e | 20 74 68 65 20 77 69 6e | flag in| the win|
|00003e10| 64 6f 77 0d 09 68 61 6e | 64 6c 65 72 20 74 72 75 |dow..han|dler tru|
|00003e20| 65 2e 20 20 54 68 65 20 | 70 6f 72 74 20 69 73 20 |e. The |port is |
|00003e30| 61 73 73 75 6d 65 64 20 | 74 6f 20 62 65 20 73 65 |assumed |to be se|
|00003e40| 74 20 74 6f 20 74 68 65 | 20 70 6f 72 74 20 74 68 |t to the| port th|
|00003e50| 61 74 20 63 68 61 6e 67 | 65 64 0d 09 73 69 7a 65 |at chang|ed..size|
|00003e60| 2e 0d 2a 2f 0d 0d 73 74 | 61 74 69 63 20 54 72 69 |..*/..st|atic Tri|
|00003e70| 67 67 65 72 55 70 64 61 | 74 65 20 28 68 2c 20 67 |ggerUpda|te (h, g|
|00003e80| 72 6f 77 6e 50 6f 72 74 | 29 0d 57 48 61 6e 64 6c |rownPort|).WHandl|
|00003e90| 65 72 09 2a 2a 68 3b 0d | 47 72 61 66 50 74 72 09 |er.**h;.|GrafPtr.|
|00003ea0| 09 67 72 6f 77 6e 50 6f | 72 74 3b 0d 7b 0d 09 49 |.grownPo|rt;.{..I|
|00003eb0| 6e 76 61 6c 52 65 63 74 | 20 28 26 67 72 6f 77 6e |nvalRect| (&grown|
|00003ec0| 50 6f 72 74 2d 3e 70 6f | 72 74 52 65 63 74 29 3b |Port->po|rtRect);|
|00003ed0| 0d 09 69 66 20 28 68 20 | 21 3d 20 6e 69 6c 29 0d |..if (h |!= nil).|
|00003ee0| 09 09 28 2a 2a 68 29 2e | 77 68 53 69 7a 65 64 20 |..(**h).|whSized |
|00003ef0| 3d 20 74 72 75 65 3b 0d | 7d 0d 0d 0d 2f 2a 0d 09 |= true;.|}.../*..|
|00003f00| 53 69 7a 65 20 61 20 77 | 69 6e 64 6f 77 2e 20 20 |Size a w|indow. |
|00003f10| 49 66 20 74 68 65 20 77 | 69 6e 64 6f 77 20 68 61 |If the w|indow ha|
|00003f20| 73 20 61 20 68 61 6e 64 | 6c 65 72 2c 20 75 73 65 |s a hand|ler, use|
|00003f30| 20 74 68 65 20 67 72 6f | 77 20 6c 69 6d 69 74 73 | the gro|w limits|
|00003f40| 0d 09 69 6e 20 74 68 65 | 20 68 61 6e 64 6c 65 72 |..in the| handler|
|00003f50| 20 72 65 63 6f 72 64 2c | 20 6f 74 68 65 72 77 69 | record,| otherwi|
|00003f60| 73 65 20 75 73 65 20 74 | 68 65 20 64 65 66 61 75 |se use t|he defau|
|00003f70| 6c 74 73 2e 0d 0d 09 54 | 68 65 20 70 6f 72 74 52 |lts....T|he portR|
|00003f80| 65 63 74 20 69 73 20 69 | 6e 76 61 6c 69 64 61 74 |ect is i|nvalidat|
|00003f90| 65 64 20 74 6f 20 66 6f | 72 63 65 20 61 6e 20 75 |ed to fo|rce an u|
|00003fa0| 70 64 61 74 65 20 65 76 | 65 6e 74 2e 20 20 54 68 |pdate ev|ent. Th|
|00003fb0| 65 20 68 61 6e 64 6c 65 | 72 27 73 0d 09 75 70 64 |e handle|r's..upd|
|00003fc0| 61 74 65 20 70 72 6f 63 | 65 64 75 72 65 20 73 68 |ate proc|edure sh|
|00003fd0| 6f 75 6c 64 20 63 68 65 | 63 6b 20 74 68 65 20 70 |ould che|ck the p|
|00003fe0| 61 72 61 6d 65 74 65 72 | 20 70 61 73 73 65 64 20 |arameter| passed |
|00003ff0| 74 6f 20 69 74 20 74 6f | 20 63 68 65 63 6b 0d 09 |to it to| check..|
|00004000| 77 68 65 74 68 65 72 20 | 74 68 65 20 77 69 6e 64 |whether |the wind|
|00004010| 6f 77 20 68 61 73 20 63 | 68 61 6e 67 65 64 20 73 |ow has c|hanged s|
|00004020| 69 7a 65 2c 20 69 66 20 | 69 74 20 6e 65 65 64 73 |ize, if |it needs|
|00004030| 20 74 6f 20 61 64 6a 75 | 73 74 20 69 74 73 65 6c | to adju|st itsel|
|00004040| 66 20 74 6f 0d 09 74 68 | 65 20 6e 65 77 20 73 69 |f to..th|e new si|
|00004050| 7a 65 2e 20 20 54 48 49 | 53 20 49 53 20 41 20 43 |ze. THI|S IS A C|
|00004060| 4f 4e 56 45 4e 54 49 4f | 4e 2e 20 20 55 70 64 61 |ONVENTIO|N. Upda|
|00004070| 74 65 20 70 72 6f 63 73 | 20 6d 75 73 74 20 6e 6f |te procs| must no|
|00004080| 74 69 63 65 20 67 72 6f | 77 0d 09 22 65 76 65 6e |tice gro|w.."even|
|00004090| 74 73 22 2c 20 74 68 65 | 72 65 20 69 73 20 6e 6f |ts", the|re is no|
|000040a0| 20 70 72 6f 63 65 64 75 | 72 65 20 73 70 65 63 69 | procedu|re speci|
|000040b0| 66 69 63 61 6c 6c 79 20 | 66 6f 72 20 73 75 63 68 |fically |for such|
|000040c0| 20 65 76 65 6e 74 73 2e | 0d 09 0d 09 54 68 65 20 | events.|....The |
|000040d0| 63 6c 69 70 70 69 6e 67 | 20 72 65 63 74 61 6e 67 |clipping| rectang|
|000040e0| 6c 65 20 69 73 20 6e 6f | 74 20 72 65 73 65 74 2e |le is no|t reset.|
|000040f0| 20 20 49 66 20 74 68 65 | 20 68 6f 73 74 20 61 70 | If the| host ap|
|00004100| 70 6c 69 63 61 74 69 6f | 6e 0d 09 6b 65 65 70 73 |plicatio|n..keeps|
|00004110| 20 74 68 65 20 63 6c 69 | 70 70 69 6e 67 20 73 65 | the cli|pping se|
|00004120| 74 20 65 71 75 61 6c 20 | 74 6f 20 74 68 65 20 70 |t equal |to the p|
|00004130| 6f 72 74 52 65 63 74 20 | 6f 72 20 73 6f 6d 65 74 |ortRect |or somet|
|00004140| 68 69 6e 67 20 73 69 6d | 69 6c 61 72 2c 0d 09 74 |hing sim|ilar,..t|
|00004150| 68 65 6e 20 69 74 20 77 | 69 6c 6c 20 68 61 76 65 |hen it w|ill have|
|00004160| 20 74 6f 20 61 72 72 61 | 6e 67 65 20 74 6f 20 74 | to arra|nge to t|
|00004170| 72 65 61 74 20 77 69 6e | 64 6f 77 20 67 72 6f 77 |reat win|dow grow|
|00004180| 69 6e 67 20 77 69 74 68 | 20 6d 6f 72 65 0d 09 63 |ing with| more..c|
|00004190| 61 72 65 2e 0d 0d 09 53 | 69 6e 63 65 20 74 68 65 |are....S|ince the|
|000041a0| 20 67 72 6f 77 20 72 65 | 67 69 6f 6e 20 6f 66 20 | grow re|gion of |
|000041b0| 6f 6e 6c 79 20 74 68 65 | 20 61 63 74 69 76 65 20 |only the| active |
|000041c0| 77 69 6e 64 6f 77 20 6d | 61 79 20 62 65 20 63 6c |window m|ay be cl|
|000041d0| 69 63 6b 65 64 2c 0d 09 | 69 74 20 73 68 6f 75 6c |icked,..|it shoul|
|000041e0| 64 20 6e 6f 74 20 62 65 | 20 6e 65 63 65 73 73 61 |d not be| necessa|
|000041f0| 72 79 20 74 6f 20 73 65 | 74 20 74 68 65 20 70 6f |ry to se|t the po|
|00004200| 72 74 2e 0d 2a 2f 0d 0d | 73 74 61 74 69 63 20 44 |rt..*/..|static D|
|00004210| 6f 47 72 6f 77 20 28 68 | 2c 20 67 72 6f 77 50 6f |oGrow (h|, growPo|
|00004220| 72 74 2c 20 73 74 61 72 | 74 50 74 29 0d 57 48 61 |rt, star|tPt).WHa|
|00004230| 6e 64 6c 65 72 09 2a 2a | 68 3b 0d 47 72 61 66 50 |ndler.**|h;.GrafP|
|00004240| 74 72 09 09 67 72 6f 77 | 50 6f 72 74 3b 0d 50 6f |tr..grow|Port;.Po|
|00004250| 69 6e 74 09 09 73 74 61 | 72 74 50 74 3b 0d 7b 0d |int..sta|rtPt;.{.|
|00004260| 52 65 63 74 09 09 09 09 | 72 3b 0d 72 65 67 69 73 |Rect....|r;.regis|
|00004270| 74 65 72 20 4c 6f 6e 67 | 69 6e 74 09 67 72 6f 77 |ter Long|int.grow|
|00004280| 52 65 73 3b 0d 0d 09 69 | 66 20 28 68 20 21 3d 20 |Res;...i|f (h != |
|00004290| 6e 69 6c 29 0d 09 09 72 | 20 3d 20 28 2a 2a 68 29 |nil)...r| = (**h)|
|000042a0| 2e 77 68 47 72 6f 77 3b | 0d 09 65 6c 73 65 0d 09 |.whGrow;|..else..|
|000042b0| 09 72 20 3d 20 67 72 6f | 77 52 65 63 74 3b 09 2f |.r = gro|wRect;./|
|000042c0| 2a 20 75 73 65 20 64 65 | 66 61 75 6c 74 20 2a 2f |* use de|fault */|
|000042d0| 0d 0d 09 2f 2a 20 67 72 | 6f 77 20 72 65 73 75 6c |.../* gr|ow resul|
|000042e0| 74 20 6e 6f 6e 2d 7a 65 | 72 6f 20 69 66 20 73 69 |t non-ze|ro if si|
|000042f0| 7a 65 20 63 68 61 6e 67 | 65 09 2a 2f 0d 0d 09 69 |ze chang|e.*/...i|
|00004300| 66 20 28 67 72 6f 77 52 | 65 73 20 3d 20 47 72 6f |f (growR|es = Gro|
|00004310| 77 57 69 6e 64 6f 77 20 | 28 67 72 6f 77 50 6f 72 |wWindow |(growPor|
|00004320| 74 2c 20 73 74 61 72 74 | 50 74 2c 20 26 72 29 29 |t, start|Pt, &r))|
|00004330| 0d 09 7b 0d 09 09 53 69 | 7a 65 57 69 6e 64 6f 77 |..{...Si|zeWindow|
|00004340| 20 28 67 72 6f 77 50 6f | 72 74 2c 20 4c 6f 57 6f | (growPo|rt, LoWo|
|00004350| 72 64 20 28 67 72 6f 77 | 52 65 73 29 2c 20 48 69 |rd (grow|Res), Hi|
|00004360| 57 6f 72 64 20 28 67 72 | 6f 77 52 65 73 29 2c 20 |Word (gr|owRes), |
|00004370| 66 61 6c 73 65 29 3b 0d | 09 09 54 72 69 67 67 65 |false);.|..Trigge|
|00004380| 72 55 70 64 61 74 65 20 | 28 68 2c 20 67 72 6f 77 |rUpdate |(h, grow|
|00004390| 50 6f 72 74 29 3b 0d 09 | 7d 0d 7d 0d 0d 0d 2f 2a |Port);..|}.}.../*|
|000043a0| 0d 09 5a 6f 6f 6d 20 74 | 68 65 20 63 75 72 72 65 |..Zoom t|he curre|
|000043b0| 6e 74 20 77 69 6e 64 6f | 77 2e 20 20 56 65 72 79 |nt windo|w. Very|
|000043c0| 20 73 69 6d 69 6c 61 72 | 20 74 6f 20 44 6f 47 72 | similar| to DoGr|
|000043d0| 6f 77 0d 0d 09 53 69 6e | 63 65 20 74 68 65 20 7a |ow...Sin|ce the z|
|000043e0| 6f 6f 6d 62 6f 78 20 6f | 66 20 6f 6e 6c 79 20 74 |oombox o|f only t|
|000043f0| 68 65 20 61 63 74 69 76 | 65 20 77 69 6e 64 6f 77 |he activ|e window|
|00004400| 20 6d 61 79 20 62 65 20 | 63 6c 69 63 6b 65 64 2c | may be |clicked,|
|00004410| 0d 09 69 74 20 73 68 6f | 75 6c 64 20 6e 6f 74 20 |..it sho|uld not |
|00004420| 62 65 20 6e 65 63 65 73 | 73 61 72 79 20 74 6f 20 |be neces|sary to |
|00004430| 73 65 74 20 74 68 65 20 | 70 6f 72 74 2e 0d 2a 2f |set the |port..*/|
|00004440| 0d 0d 73 74 61 74 69 63 | 20 44 6f 5a 6f 6f 6d 20 |..static| DoZoom |
|00004450| 28 68 2c 20 7a 6f 6f 6d | 50 6f 72 74 2c 20 70 61 |(h, zoom|Port, pa|
|00004460| 72 74 43 6f 64 65 29 0d | 72 65 67 69 73 74 65 72 |rtCode).|register|
|00004470| 20 57 48 61 6e 64 6c 65 | 72 09 2a 2a 68 3b 0d 47 | WHandle|r.**h;.G|
|00004480| 72 61 66 50 74 72 09 09 | 09 09 7a 6f 6f 6d 50 6f |rafPtr..|..zoomPo|
|00004490| 72 74 3b 0d 73 68 6f 72 | 74 09 09 09 09 70 61 72 |rt;.shor|t....par|
|000044a0| 74 43 6f 64 65 3b 0d 7b | 0d 09 5a 6f 6f 6d 57 69 |tCode;.{|..ZoomWi|
|000044b0| 6e 64 6f 77 20 28 7a 6f | 6f 6d 50 6f 72 74 2c 20 |ndow (zo|omPort, |
|000044c0| 70 61 72 74 43 6f 64 65 | 2c 20 30 29 3b 0d 09 54 |partCode|, 0);..T|
|000044d0| 72 69 67 67 65 72 55 70 | 64 61 74 65 20 28 68 2c |riggerUp|date (h,|
|000044e0| 20 7a 6f 6f 6d 50 6f 72 | 74 29 3b 0d 7d 0d 0d 0d | zoomPor|t);.}...|
|000044f0| 2f 2a 0d 09 47 65 6e 65 | 72 61 6c 20 65 76 65 6e |/*..Gene|ral even|
|00004500| 74 20 68 61 6e 64 6c 65 | 72 0d 2a 2f 0d 0d 73 74 |t handle|r.*/..st|
|00004510| 61 74 69 63 20 44 6f 45 | 76 65 6e 74 20 28 74 68 |atic DoE|vent (th|
|00004520| 65 45 76 65 6e 74 29 0d | 72 65 67 69 73 74 65 72 |eEvent).|register|
|00004530| 20 45 76 65 6e 74 52 65 | 63 6f 72 64 09 2a 74 68 | EventRe|cord.*th|
|00004540| 65 45 76 65 6e 74 3b 0d | 0d 7b 0d 50 6f 69 6e 74 |eEvent;.|.{.Point|
|00004550| 09 09 09 09 65 76 74 50 | 74 3b 0d 47 72 61 66 50 |....evtP|t;.GrafP|
|00004560| 74 72 09 09 09 09 65 76 | 74 50 6f 72 74 3b 0d 72 |tr....ev|tPort;.r|
|00004570| 65 67 69 73 74 65 72 20 | 49 6e 74 65 67 65 72 09 |egister |Integer.|
|00004580| 65 76 74 50 61 72 74 3b | 0d 72 65 67 69 73 74 65 |evtPart;|.registe|
|00004590| 72 20 63 68 61 72 09 09 | 65 76 74 43 68 61 72 3b |r char..|evtChar;|
|000045a0| 0d 72 65 67 69 73 74 65 | 72 20 49 6e 74 65 67 65 |.registe|r Intege|
|000045b0| 72 09 65 76 74 4d 6f 64 | 73 3b 0d 72 65 67 69 73 |r.evtMod|s;.regis|
|000045c0| 74 65 72 20 4c 6f 6e 67 | 69 6e 74 09 65 76 74 4d |ter Long|int.evtM|
|000045d0| 73 67 65 3b 0d 72 65 67 | 69 73 74 65 72 20 57 48 |sge;.reg|ister WH|
|000045e0| 61 6e 64 6c 65 72 09 2a | 2a 68 3b 0d 52 65 63 74 |andler.*|*h;.Rect|
|000045f0| 09 09 09 09 72 3b 0d 0d | 23 20 69 66 64 65 66 09 |....r;..|# ifdef.|
|00004600| 73 75 70 70 6f 72 74 44 | 69 61 6c 6f 67 73 0d 0d |supportD|ialogs..|
|00004610| 09 69 66 28 44 6f 44 69 | 61 6c 6f 67 20 28 74 68 |.if(DoDi|alog (th|
|00004620| 65 45 76 65 6e 74 29 29 | 0d 09 09 72 65 74 75 72 |eEvent))|...retur|
|00004630| 6e 3b 0d 0d 23 20 65 6e | 64 69 66 0d 0d 09 65 76 |n;..# en|dif...ev|
|00004640| 74 50 74 20 3d 20 74 68 | 65 45 76 65 6e 74 2d 3e |tPt = th|eEvent->|
|00004650| 77 68 65 72 65 3b 0d 09 | 65 76 74 4d 6f 64 73 20 |where;..|evtMods |
|00004660| 3d 20 74 68 65 45 76 65 | 6e 74 2d 3e 6d 6f 64 69 |= theEve|nt->modi|
|00004670| 66 69 65 72 73 3b 0d 09 | 65 76 74 4d 73 67 65 20 |fiers;..|evtMsge |
|00004680| 3d 20 74 68 65 45 76 65 | 6e 74 2d 3e 6d 65 73 73 |= theEve|nt->mess|
|00004690| 61 67 65 3b 0d 0d 09 73 | 77 69 74 63 68 20 28 74 |age;...s|witch (t|
|000046a0| 68 65 45 76 65 6e 74 2d | 3e 77 68 61 74 29 0d 09 |heEvent-|>what)..|
|000046b0| 7b 0d 0d 09 09 2f 2a 63 | 61 73 65 20 6e 75 6c 6c |{..../*c|ase null|
|000046c0| 45 76 65 6e 74 3a 0d 09 | 09 09 62 72 65 61 6b 3b |Event:..|..break;|
|000046d0| 2a 2f 0d 2f 2a 0d 09 4d | 6f 75 73 65 20 63 6c 69 |*/./*..M|ouse cli|
|000046e0| 63 6b 2e 20 20 47 65 74 | 20 74 68 65 20 77 69 6e |ck. Get| the win|
|000046f0| 64 6f 77 20 74 68 61 74 | 20 74 68 65 20 63 6c 69 |dow that| the cli|
|00004700| 63 6b 20 6f 63 63 75 72 | 72 65 64 20 69 6e 2c 20 |ck occur|red in, |
|00004710| 61 6e 64 20 74 68 65 0d | 09 70 61 72 74 20 6f 66 |and the.|.part of|
|00004720| 20 74 68 65 20 77 69 6e | 64 6f 77 2e 20 20 47 65 | the win|dow. Ge|
|00004730| 74 57 44 48 61 6e 64 6c | 65 72 20 69 73 20 63 61 |tWDHandl|er is ca|
|00004740| 6c 6c 65 64 20 68 65 72 | 65 2c 20 6e 6f 74 20 47 |lled her|e, not G|
|00004750| 65 74 57 48 61 6e 64 6c | 65 72 2c 20 73 69 6e 63 |etWHandl|er, sinc|
|00004760| 65 0d 09 77 65 20 6e 65 | 65 64 20 74 68 65 20 68 |e..we ne|ed the h|
|00004770| 61 6e 64 6c 65 72 20 66 | 6f 72 20 61 20 77 69 6e |andler f|or a win|
|00004780| 64 6f 77 20 77 68 69 63 | 68 20 6d 69 67 68 74 20 |dow whic|h might |
|00004790| 74 75 72 6e 20 6f 75 74 | 20 74 6f 20 62 65 20 61 |turn out| to be a|
|000047a0| 20 64 69 61 6c 6f 67 0d | 09 77 69 6e 64 6f 77 2c | dialog.|.window,|
|000047b0| 20 65 2e 67 2e 2c 20 69 | 66 20 74 68 65 20 63 6c | e.g., i|f the cl|
|000047c0| 69 63 6b 20 69 73 20 69 | 6e 20 61 20 63 6c 6f 73 |ick is i|n a clos|
|000047d0| 65 20 62 6f 78 2e 0d 2a | 2f 0d 09 09 63 61 73 65 |e box..*|/...case|
|000047e0| 20 6d 6f 75 73 65 44 6f | 77 6e 3a 0d 09 09 7b 0d | mouseDo|wn:...{.|
|000047f0| 09 09 09 65 76 74 50 61 | 72 74 20 3d 20 46 69 6e |...evtPa|rt = Fin|
|00004800| 64 57 69 6e 64 6f 77 20 | 28 65 76 74 50 74 2c 20 |dWindow |(evtPt, |
|00004810| 26 65 76 74 50 6f 72 74 | 29 3b 0d 09 09 09 68 20 |&evtPort|);....h |
|00004820| 3d 20 47 65 74 57 44 48 | 61 6e 64 6c 65 72 20 28 |= GetWDH|andler (|
|00004830| 65 76 74 50 6f 72 74 29 | 3b 0d 0d 09 09 09 73 77 |evtPort)|;.....sw|
|00004840| 69 74 63 68 20 28 65 76 | 74 50 61 72 74 29 0d 09 |itch (ev|tPart)..|
|00004850| 09 09 7b 0d 2f 2a 0d 09 | 43 6c 69 63 6b 20 69 6e |..{./*..|Click in|
|00004860| 20 61 20 64 65 73 6b 20 | 61 63 63 65 73 73 6f 72 | a desk |accessor|
|00004870| 79 20 77 69 6e 64 6f 77 | 2e 20 20 50 61 73 73 20 |y window|. Pass |
|00004880| 62 61 63 6b 20 74 6f 20 | 74 68 65 20 73 79 73 74 |back to |the syst|
|00004890| 65 6d 2e 0d 2a 2f 0d 09 | 09 09 09 63 61 73 65 20 |em..*/..|...case |
|000048a0| 69 6e 53 79 73 57 69 6e | 64 6f 77 3a 0d 09 09 09 |inSysWin|dow:....|
|000048b0| 09 7b 0d 09 09 09 09 09 | 53 79 73 74 65 6d 43 6c |.{......|SystemCl|
|000048c0| 69 63 6b 20 28 74 68 65 | 45 76 65 6e 74 2c 20 65 |ick (the|Event, e|
|000048d0| 76 74 50 6f 72 74 29 3b | 0d 09 09 09 09 09 62 72 |vtPort);|......br|
|000048e0| 65 61 6b 3b 0d 09 09 09 | 09 7d 0d 2f 2a 0d 09 43 |eak;....|.}./*..C|
|000048f0| 6c 69 63 6b 20 69 6e 20 | 6d 65 6e 75 20 62 61 72 |lick in |menu bar|
|00004900| 2e 20 20 54 72 61 63 6b | 20 74 68 65 20 6d 6f 75 |. Track| the mou|
|00004910| 73 65 20 61 6e 64 20 65 | 78 65 63 75 74 65 20 73 |se and e|xecute s|
|00004920| 65 6c 65 63 74 65 64 20 | 63 6f 6d 6d 61 6e 64 2c |elected |command,|
|00004930| 0d 09 69 66 20 61 6e 79 | 2e 0d 2a 2f 0d 09 09 09 |..if any|..*/....|
|00004940| 09 63 61 73 65 20 69 6e | 4d 65 6e 75 42 61 72 3a |.case in|MenuBar:|
|00004950| 0d 09 09 09 09 7b 0d 09 | 09 09 09 09 44 6f 4d 65 |.....{..|....DoMe|
|00004960| 6e 75 43 6f 6d 6d 61 6e | 64 20 28 4d 65 6e 75 53 |nuComman|d (MenuS|
|00004970| 65 6c 65 63 74 20 28 65 | 76 74 50 74 29 29 3b 0d |elect (e|vtPt));.|
|00004980| 09 09 09 09 09 62 72 65 | 61 6b 3b 0d 09 09 09 09 |.....bre|ak;.....|
|00004990| 7d 0d 2f 2a 0d 09 43 6c | 69 63 6b 20 69 6e 20 67 |}./*..Cl|ick in g|
|000049a0| 72 6f 77 20 62 6f 78 2e | 20 20 52 65 73 69 7a 65 |row box.| Resize|
|000049b0| 20 77 69 6e 64 6f 77 2e | 0d 2a 2f 0d 09 09 09 09 | window.|.*/.....|
|000049c0| 63 61 73 65 20 69 6e 47 | 72 6f 77 3a 0d 09 09 09 |case inG|row:....|
|000049d0| 09 7b 0d 09 09 09 09 09 | 44 6f 47 72 6f 77 20 28 |.{......|DoGrow (|
|000049e0| 68 2c 20 65 76 74 50 6f | 72 74 2c 20 65 76 74 50 |h, evtPo|rt, evtP|
|000049f0| 74 29 3b 0d 09 09 09 09 | 09 62 72 65 61 6b 3b 0d |t);.....|.break;.|
|00004a00| 09 09 09 09 7d 0d 2f 2a | 0d 09 43 6c 69 63 6b 20 |....}./*|..Click |
|00004a10| 69 6e 20 74 69 74 6c 65 | 20 62 61 72 2e 20 20 44 |in title| bar. D|
|00004a20| 72 61 67 20 74 68 65 20 | 77 69 6e 64 6f 77 20 61 |rag the |window a|
|00004a30| 72 6f 75 6e 64 2e 20 20 | 4c 65 61 76 65 20 61 74 |round. |Leave at|
|00004a40| 20 6c 65 61 73 74 0d 09 | 34 20 70 69 78 65 6c 73 | least..|4 pixels|
|00004a50| 20 76 69 73 69 62 6c 65 | 20 69 6e 20 62 6f 74 68 | visible| in both|
|00004a60| 20 64 69 72 65 63 74 69 | 6f 6e 73 2e 0d 09 42 75 | directi|ons...Bu|
|00004a70| 67 20 66 69 78 3a 20 20 | 54 68 65 20 77 69 6e 64 |g fix: |The wind|
|00004a80| 6f 77 20 69 73 20 73 65 | 6c 65 63 74 65 64 20 66 |ow is se|lected f|
|00004a90| 69 72 73 74 20 74 6f 20 | 6d 61 6b 65 20 73 75 72 |irst to |make sur|
|00004aa0| 65 20 69 74 27 73 20 61 | 74 20 6c 65 61 73 74 0d |e it's a|t least.|
|00004ab0| 09 61 63 74 69 76 61 74 | 65 64 20 28 75 6e 6c 65 |.activat|ed (unle|
|00004ac0| 73 73 20 74 68 65 20 63 | 6f 6d 6d 61 6e 64 20 6b |ss the c|ommand k|
|00004ad0| 65 79 20 69 73 20 64 6f | 77 6e 2d 73 65 65 20 49 |ey is do|wn-see I|
|00004ae0| 6e 73 69 64 65 20 4d 61 | 63 69 6e 74 6f 73 68 29 |nside Ma|cintosh)|
|00004af0| 2e 0d 09 44 72 61 67 57 | 69 6e 64 6f 77 20 73 65 |...DragW|indow se|
|00004b00| 65 6d 73 20 74 6f 20 63 | 61 6c 6c 20 53 74 69 6c |ems to c|all Stil|
|00004b10| 6c 44 6f 77 6e 20 66 69 | 72 73 74 2c 20 73 6f 20 |lDown fi|rst, so |
|00004b20| 74 68 61 74 20 63 6c 69 | 63 6b 73 20 69 6e 20 64 |that cli|cks in d|
|00004b30| 72 61 67 0d 09 72 65 67 | 69 6f 6e 73 20 77 68 69 |rag..reg|ions whi|
|00004b40| 6c 65 20 6d 61 63 68 69 | 6e 65 20 69 73 20 62 75 |le machi|ne is bu|
|00004b50| 73 79 20 64 6f 6e 27 74 | 20 6f 74 68 65 72 77 69 |sy don't| otherwi|
|00004b60| 73 65 20 62 72 69 6e 67 | 20 77 69 6e 64 6f 77 20 |se bring| window |
|00004b70| 74 6f 20 66 72 6f 6e 74 | 20 69 66 0d 09 74 68 65 |to front| if..the|
|00004b80| 20 6d 6f 75 73 65 20 69 | 73 20 61 6c 72 65 61 64 | mouse i|s alread|
|00004b90| 79 20 75 70 20 62 79 20 | 74 68 65 20 74 69 6d 65 |y up by |the time|
|00004ba0| 20 44 72 61 67 57 69 6e | 64 6f 77 20 69 73 20 63 | DragWin|dow is c|
|00004bb0| 61 6c 6c 65 64 2e 0d 2a | 2f 0d 09 09 09 09 63 61 |alled..*|/.....ca|
|00004bc0| 73 65 20 69 6e 44 72 61 | 67 3a 0d 09 09 09 09 7b |se inDra|g:.....{|
|00004bd0| 0d 09 09 09 09 09 69 66 | 20 28 65 76 74 50 6f 72 |......if| (evtPor|
|00004be0| 74 20 21 3d 20 46 72 6f | 6e 74 57 69 6e 64 6f 77 |t != Fro|ntWindow|
|00004bf0| 20 28 29 20 26 26 20 28 | 65 76 74 4d 6f 64 73 20 | () && (|evtMods |
|00004c00| 26 20 63 6d 64 4b 65 79 | 29 20 3d 3d 20 30 29 0d |& cmdKey|) == 0).|
|00004c10| 09 09 09 09 09 09 53 65 | 6c 65 63 74 57 69 6e 64 |......Se|lectWind|
|00004c20| 6f 77 20 28 65 76 74 50 | 6f 72 74 29 3b 0d 09 09 |ow (evtP|ort);...|
|00004c30| 09 09 09 72 20 3d 20 73 | 63 72 65 65 6e 50 6f 72 |...r = s|creenPor|
|00004c40| 74 2d 3e 70 6f 72 74 52 | 65 63 74 3b 0d 09 09 09 |t->portR|ect;....|
|00004c50| 09 09 72 2e 74 6f 70 20 | 2b 3d 20 6d 42 61 72 48 |..r.top |+= mBarH|
|00004c60| 65 69 67 68 74 3b 09 09 | 09 2f 2a 20 73 6b 69 70 |eight;..|./* skip|
|00004c70| 20 64 6f 77 6e 20 70 61 | 73 74 20 6d 65 6e 75 20 | down pa|st menu |
|00004c80| 62 61 72 20 2a 2f 0d 09 | 09 09 09 09 49 6e 73 65 |bar */..|....Inse|
|00004c90| 74 52 65 63 74 20 28 26 | 72 2c 20 34 2c 20 34 29 |tRect (&|r, 4, 4)|
|00004ca0| 3b 0d 09 09 09 09 09 44 | 72 61 67 57 69 6e 64 6f |;......D|ragWindo|
|00004cb0| 77 20 28 65 76 74 50 6f | 72 74 2c 20 65 76 74 50 |w (evtPo|rt, evtP|
|00004cc0| 74 2c 20 26 72 29 3b 0d | 09 09 09 09 09 62 72 65 |t, &r);.|.....bre|
|00004cd0| 61 6b 3b 0d 09 09 09 09 | 7d 0d 2f 2a 0d 09 43 6c |ak;.....|}./*..Cl|
|00004ce0| 69 63 6b 20 69 6e 20 63 | 6c 6f 73 65 20 62 6f 78 |ick in c|lose box|
|00004cf0| 2e 20 20 43 61 6c 6c 20 | 74 68 65 20 63 6c 6f 73 |. Call |the clos|
|00004d00| 65 20 70 72 6f 63 20 69 | 66 20 74 68 65 20 77 69 |e proc i|f the wi|
|00004d10| 6e 64 6f 77 20 68 61 73 | 20 6f 6e 65 2e 0d 2a 2f |ndow has| one..*/|
|00004d20| 0d 09 09 09 09 63 61 73 | 65 20 69 6e 47 6f 41 77 |.....cas|e inGoAw|
|00004d30| 61 79 3a 0d 09 09 09 09 | 7b 0d 09 09 09 09 09 69 |ay:.....|{......i|
|00004d40| 66 20 28 54 72 61 63 6b | 47 6f 41 77 61 79 20 28 |f (Track|GoAway (|
|00004d50| 65 76 74 50 6f 72 74 2c | 20 65 76 74 50 74 29 29 |evtPort,| evtPt))|
|00004d60| 0d 09 09 09 09 09 09 44 | 6f 43 6c 6f 73 65 20 28 |.......D|oClose (|
|00004d70| 68 29 3b 0d 09 09 09 09 | 09 62 72 65 61 6b 3b 0d |h);.....|.break;.|
|00004d80| 09 09 09 09 7d 0d 0d 2f | 2a 0d 09 43 6c 69 63 6b |....}../|*..Click|
|00004d90| 20 69 6e 20 7a 6f 6f 6d | 20 62 6f 78 2e 20 20 54 | in zoom| box. T|
|00004da0| 72 61 63 6b 20 74 68 65 | 20 63 6c 69 63 6b 20 61 |rack the| click a|
|00004db0| 6e 64 20 74 68 65 6e 20 | 7a 6f 6f 6d 20 74 68 65 |nd then |zoom the|
|00004dc0| 20 77 69 6e 64 6f 77 20 | 69 66 0d 09 6e 65 63 65 | window |if..nece|
|00004dd0| 73 73 61 72 79 0d 2a 2f | 0d 09 09 09 09 63 61 73 |ssary.*/|.....cas|
|00004de0| 65 20 69 6e 5a 6f 6f 6d | 49 6e 3a 0d 09 09 09 09 |e inZoom|In:.....|
|00004df0| 63 61 73 65 20 69 6e 5a | 6f 6f 6d 4f 75 74 3a 0d |case inZ|oomOut:.|
|00004e00| 09 09 09 09 7b 0d 09 09 | 09 09 09 69 66 20 28 54 |....{...|...if (T|
|00004e10| 72 61 63 6b 42 6f 78 20 | 28 65 76 74 50 6f 72 74 |rackBox |(evtPort|
|00004e20| 2c 20 65 76 74 50 74 2c | 20 65 76 74 50 61 72 74 |, evtPt,| evtPart|
|00004e30| 29 29 0d 09 09 09 09 09 | 09 44 6f 5a 6f 6f 6d 20 |))......|.DoZoom |
|00004e40| 28 68 2c 20 65 76 74 50 | 6f 72 74 2c 20 65 76 74 |(h, evtP|ort, evt|
|00004e50| 50 61 72 74 29 3b 0d 09 | 09 09 09 09 62 72 65 61 |Part);..|....brea|
|00004e60| 6b 3b 0d 09 09 09 09 7d | 0d 2f 2a 0d 09 43 6c 69 |k;.....}|./*..Cli|
|00004e70| 63 6b 20 69 6e 20 63 6f | 6e 74 65 6e 74 20 72 65 |ck in co|ntent re|
|00004e80| 67 69 6f 6e 2e 20 20 49 | 66 20 74 68 65 20 77 69 |gion. I|f the wi|
|00004e90| 6e 64 6f 77 20 77 61 73 | 6e 27 74 20 66 72 6f 6e |ndow was|n't fron|
|00004ea0| 74 6d 6f 73 74 20 28 61 | 63 74 69 76 65 29 2c 0d |tmost (a|ctive),.|
|00004eb0| 09 6a 75 73 74 20 73 65 | 6c 65 63 74 20 69 74 2c |.just se|lect it,|
|00004ec0| 20 6f 74 68 65 72 77 69 | 73 65 20 70 61 73 73 20 | otherwi|se pass |
|00004ed0| 74 68 65 20 63 6c 69 63 | 6b 20 74 6f 20 74 68 65 |the clic|k to the|
|00004ee0| 20 77 69 6e 64 6f 77 27 | 73 20 6d 6f 75 73 65 0d | window'|s mouse.|
|00004ef0| 09 63 6c 69 63 6b 20 68 | 61 6e 64 6c 65 72 2e 0d |.click h|andler..|
|00004f00| 2a 2f 0d 09 09 09 09 63 | 61 73 65 20 69 6e 43 6f |*/.....c|ase inCo|
|00004f10| 6e 74 65 6e 74 3a 0d 09 | 09 09 09 7b 0d 09 09 09 |ntent:..|...{....|
|00004f20| 09 09 69 66 20 28 65 76 | 74 50 6f 72 74 20 21 3d |..if (ev|tPort !=|
|00004f30| 20 46 72 6f 6e 74 57 69 | 6e 64 6f 77 20 28 29 29 | FrontWi|ndow ())|
|00004f40| 0d 09 09 09 09 09 09 53 | 65 6c 65 63 74 57 69 6e |.......S|electWin|
|00004f50| 64 6f 77 20 28 65 76 74 | 50 6f 72 74 29 3b 0d 09 |dow (evt|Port);..|
|00004f60| 09 09 09 09 65 6c 73 65 | 0d 09 09 09 09 09 09 44 |....else|.......D|
|00004f70| 6f 4d 6f 75 73 65 20 28 | 68 2c 20 74 68 65 45 76 |oMouse (|h, theEv|
|00004f80| 65 6e 74 29 3b 0d 09 09 | 09 09 09 62 72 65 61 6b |ent);...|...break|
|00004f90| 3b 0d 09 09 09 09 7d 0d | 0d 09 09 09 7d 0d 09 09 |;.....}.|....}...|
|00004fa0| 09 62 72 65 61 6b 3b 09 | 2f 2a 20 6d 6f 75 73 65 |.break;.|/* mouse|
|00004fb0| 44 6f 77 6e 20 2a 2f 0d | 09 09 7d 0d 2f 2a 0d 09 |Down */.|..}./*..|
|00004fc0| 4b 65 79 20 65 76 65 6e | 74 2e 20 20 49 66 20 74 |Key even|t. If t|
|00004fd0| 68 65 20 63 6f 6d 6d 61 | 6e 64 20 6b 65 79 20 77 |he comma|nd key w|
|00004fe0| 61 73 20 64 6f 77 6e 2c | 20 70 72 6f 63 65 73 73 |as down,| process|
|00004ff0| 20 61 73 20 6d 65 6e 75 | 20 69 74 65 6d 0d 09 73 | as menu| item..s|
|00005000| 65 6c 65 63 74 69 6f 6e | 2c 20 6f 74 68 65 72 77 |election|, otherw|
|00005010| 69 73 65 20 70 61 73 73 | 20 74 68 65 20 63 68 61 |ise pass| the cha|
|00005020| 72 61 63 74 65 72 20 61 | 6e 64 20 74 68 65 20 6d |racter a|nd the m|
|00005030| 6f 64 69 66 69 65 72 73 | 20 66 6c 61 67 73 0d 09 |odifiers| flags..|
|00005040| 74 6f 20 74 68 65 20 61 | 63 74 69 76 65 20 77 69 |to the a|ctive wi|
|00005050| 6e 64 6f 77 27 73 20 6b | 65 79 20 68 61 6e 64 6c |ndow's k|ey handl|
|00005060| 65 72 2e 0d 0d 09 49 66 | 20 64 69 61 6c 6f 67 73 |er....If| dialogs|
|00005070| 20 61 72 65 20 73 75 70 | 70 6f 72 74 65 64 2c 20 | are sup|ported, |
|00005080| 74 68 65 72 65 27 73 20 | 6e 6f 20 63 68 65 63 6b |there's |no check|
|00005090| 20 66 6f 72 20 63 6f 6d | 6d 61 6e 64 2d 6b 65 79 | for com|mand-key|
|000050a0| 0d 09 65 71 75 69 76 61 | 6c 65 6e 74 73 2c 20 73 |..equiva|lents, s|
|000050b0| 69 6e 63 65 20 74 68 61 | 74 20 77 6f 75 6c 64 20 |ince tha|t would |
|000050c0| 68 61 76 65 20 62 65 65 | 6e 20 63 68 65 63 6b 65 |have bee|n checke|
|000050d0| 64 20 69 6e 20 44 6f 44 | 69 61 6c 6f 67 2e 0d 2a |d in DoD|ialog..*|
|000050e0| 2f 0d 09 09 63 61 73 65 | 20 6b 65 79 44 6f 77 6e |/...case| keyDown|
|000050f0| 3a 0d 09 09 63 61 73 65 | 20 61 75 74 6f 4b 65 79 |:...case| autoKey|
|00005100| 3a 0d 09 09 7b 0d 09 09 | 09 65 76 74 43 68 61 72 |:...{...|.evtChar|
|00005110| 20 3d 20 65 76 74 4d 73 | 67 65 20 26 20 63 68 61 | = evtMs|ge & cha|
|00005120| 72 43 6f 64 65 4d 61 73 | 6b 3b 0d 0d 23 20 69 66 |rCodeMas|k;..# if|
|00005130| 6e 64 65 66 09 73 75 70 | 70 6f 72 74 44 69 61 6c |ndef.sup|portDial|
|00005140| 6f 67 73 0d 0d 09 09 09 | 69 66 20 28 65 76 74 4d |ogs.....|if (evtM|
|00005150| 6f 64 73 20 26 20 63 6d | 64 4b 65 79 29 09 09 2f |ods & cm|dKey)../|
|00005160| 2a 20 74 72 79 20 6d 65 | 6e 75 20 65 71 75 69 76 |* try me|nu equiv|
|00005170| 61 6c 65 6e 74 20 2a 2f | 0d 09 09 09 7b 0d 09 09 |alent */|....{...|
|00005180| 09 09 44 6f 4d 65 6e 75 | 43 6f 6d 6d 61 6e 64 20 |..DoMenu|Command |
|00005190| 28 4d 65 6e 75 4b 65 79 | 20 28 65 76 74 43 68 61 |(MenuKey| (evtCha|
|000051a0| 72 29 29 3b 0d 09 09 09 | 09 62 72 65 61 6b 3b 0d |r));....|.break;.|
|000051b0| 09 09 09 7d 0d 0d 23 20 | 65 6e 64 69 66 0d 0d 09 |...}..# |endif...|
|000051c0| 09 09 44 6f 4b 65 79 20 | 28 47 65 74 57 48 61 6e |..DoKey |(GetWHan|
|000051d0| 64 6c 65 72 20 28 46 72 | 6f 6e 74 57 69 6e 64 6f |dler (Fr|ontWindo|
|000051e0| 77 20 28 29 29 2c 20 65 | 76 74 43 68 61 72 2c 20 |w ()), e|vtChar, |
|000051f0| 65 76 74 4d 6f 64 73 29 | 3b 0d 09 09 09 62 72 65 |evtMods)|;....bre|
|00005200| 61 6b 3b 0d 09 09 7d 0d | 2f 2a 0d 09 55 70 64 61 |ak;...}.|/*..Upda|
|00005210| 74 65 20 61 20 77 69 6e | 64 6f 77 2e 0d 2a 2f 0d |te a win|dow..*/.|
|00005220| 09 09 63 61 73 65 20 75 | 70 64 61 74 65 45 76 74 |..case u|pdateEvt|
|00005230| 3a 0d 09 09 7b 0d 09 09 | 09 44 6f 55 70 64 61 74 |:...{...|.DoUpdat|
|00005240| 65 20 28 47 65 74 57 48 | 61 6e 64 6c 65 72 20 28 |e (GetWH|andler (|
|00005250| 28 57 69 6e 64 6f 77 50 | 74 72 29 20 65 76 74 4d |(WindowP|tr) evtM|
|00005260| 73 67 65 29 29 3b 0d 09 | 09 09 62 72 65 61 6b 3b |sge));..|..break;|
|00005270| 0d 09 09 7d 0d 2f 2a 0d | 09 41 63 74 69 76 61 74 |...}./*.|.Activat|
|00005280| 65 20 6f 72 20 64 65 61 | 63 74 69 76 61 74 65 20 |e or dea|ctivate |
|00005290| 61 20 77 69 6e 64 6f 77 | 2e 0d 2a 2f 0d 09 09 63 |a window|..*/...c|
|000052a0| 61 73 65 20 61 63 74 69 | 76 61 74 65 45 76 74 3a |ase acti|vateEvt:|
|000052b0| 0d 09 09 7b 0d 09 09 09 | 44 6f 41 63 74 69 76 61 |...{....|DoActiva|
|000052c0| 74 65 20 28 47 65 74 57 | 48 61 6e 64 6c 65 72 20 |te (GetW|Handler |
|000052d0| 28 28 57 69 6e 64 6f 77 | 50 74 72 29 20 65 76 74 |((Window|Ptr) evt|
|000052e0| 4d 73 67 65 29 2c 0d 09 | 09 09 09 09 09 28 28 65 |Msge),..|.....((e|
|000052f0| 76 74 4d 6f 64 73 20 26 | 20 61 63 74 69 76 65 46 |vtMods &| activeF|
|00005300| 6c 61 67 29 20 21 3d 20 | 30 29 29 3b 0d 09 09 09 |lag) != |0));....|
|00005310| 62 72 65 61 6b 3b 0d 09 | 09 7d 0d 2f 2a 0d 09 68 |break;..|.}./*..h|
|00005320| 61 6e 64 6c 65 20 69 6e | 73 65 72 74 73 20 6f 66 |andle in|serts of|
|00005330| 20 75 6e 69 6e 69 74 69 | 61 6c 69 7a 65 64 20 64 | uniniti|alized d|
|00005340| 69 73 6b 73 0d 2a 2f 0d | 09 09 63 61 73 65 20 64 |isks.*/.|..case d|
|00005350| 69 73 6b 45 76 74 3a 0d | 09 09 7b 0d 09 09 09 69 |iskEvt:.|..{....i|
|00005360| 66 20 28 48 69 57 6f 72 | 64 20 28 65 76 74 4d 73 |f (HiWor|d (evtMs|
|00005370| 67 65 29 20 21 3d 20 6e | 6f 45 72 72 29 0d 09 09 |ge) != n|oErr)...|
|00005380| 09 7b 0d 09 09 09 09 44 | 49 4c 6f 61 64 20 28 29 |.{.....D|ILoad ()|
|00005390| 3b 0d 09 09 09 09 28 76 | 6f 69 64 29 20 44 49 42 |;.....(v|oid) DIB|
|000053a0| 61 64 4d 6f 75 6e 74 20 | 28 64 69 73 6b 49 6e 69 |adMount |(diskIni|
|000053b0| 74 50 74 2c 20 65 76 74 | 4d 73 67 65 29 3b 0d 09 |tPt, evt|Msge);..|
|000053c0| 09 09 09 44 49 55 6e 6c | 6f 61 64 20 28 29 3b 0d |...DIUnl|oad ();.|
|000053d0| 09 09 09 7d 0d 09 09 09 | 62 72 65 61 6b 3b 0d 09 |...}....|break;..|
|000053e0| 09 7d 0d 09 7d 0d 7d 0d | 0d 0d 2f 2a 20 2d 2d 2d |.}..}.}.|../* ---|
|000053f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005400| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005410| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005420| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005430| 2d 20 2a 2f 0d 2f 2a 09 | 09 09 09 09 09 49 6e 74 |- */./*.|.....Int|
|00005440| 65 72 66 61 63 65 20 28 | 70 75 62 6c 69 63 29 20 |erface (|public) |
|00005450| 52 6f 75 74 69 6e 65 73 | 09 09 09 09 09 09 2a 2f |Routines|......*/|
|00005460| 0d 2f 2a 20 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |./* ----|--------|
|00005470| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005480| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005490| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000054a0| 2d 2d 2d 2d 2d 2d 2d 2d | 20 2a 2f 0d 0d 0d 2f 2a |--------| */.../*|
|000054b0| 0d 09 49 6e 69 74 69 61 | 6c 69 7a 65 20 74 68 65 |..Initia|lize the|
|000054c0| 20 76 61 72 69 6f 75 73 | 20 4d 61 63 69 6e 74 6f | various| Macinto|
|000054d0| 73 68 20 4d 61 6e 61 67 | 65 72 73 2e 0d 09 53 65 |sh Manag|ers...Se|
|000054e0| 74 20 64 65 66 61 75 6c | 74 20 75 70 70 65 72 20 |t defaul|t upper |
|000054f0| 6c 69 6d 69 74 73 20 6f | 6e 20 77 69 6e 64 6f 77 |limits o|n window|
|00005500| 20 73 69 7a 69 6e 67 2e | 0d 09 46 6c 75 73 68 45 | sizing.|..FlushE|
|00005510| 76 65 6e 74 73 20 64 6f | 65 73 20 4e 4f 54 20 74 |vents do|es NOT t|
|00005520| 6f 73 73 20 64 69 73 6b | 20 69 6e 73 65 72 74 20 |oss disk| insert |
|00005530| 65 76 65 6e 74 73 2c 20 | 73 6f 20 74 68 61 74 20 |events, |so that |
|00005540| 64 69 73 6b 73 0d 09 69 | 6e 73 65 72 74 65 64 20 |disks..i|nserted |
|00005550| 77 68 69 6c 65 20 74 68 | 65 20 61 70 70 6c 69 63 |while th|e applic|
|00005560| 61 74 69 6f 6e 20 69 73 | 20 73 74 61 72 74 69 6e |ation is| startin|
|00005570| 67 20 75 70 20 64 6f 6e | 27 74 20 72 65 73 75 6c |g up don|'t resul|
|00005580| 74 0d 09 69 6e 20 64 65 | 61 64 20 64 72 69 76 65 |t..in de|ad drive|
|00005590| 73 2e 0d 0d 09 6e 6f 4d | 61 73 74 65 72 73 20 69 |s....noM|asters i|
|000055a0| 73 20 74 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |s the nu|mber of |
|000055b0| 74 69 6d 65 73 20 74 6f | 20 63 61 6c 6c 20 4d 6f |times to| call Mo|
|000055c0| 72 65 4d 61 73 74 65 72 | 73 2e 20 20 67 7a 50 72 |reMaster|s. gzPr|
|000055d0| 6f 63 20 69 73 0d 09 74 | 68 65 20 61 64 64 72 65 |oc is..t|he addre|
|000055e0| 73 73 20 6f 66 20 61 20 | 67 72 6f 77 20 7a 6f 6e |ss of a |grow zon|
|000055f0| 65 20 70 72 6f 63 65 64 | 75 72 65 20 74 6f 20 63 |e proced|ure to c|
|00005600| 61 6c 6c 20 69 66 20 6d | 65 6d 6f 72 79 20 61 6c |all if m|emory al|
|00005610| 6c 6f 63 61 74 69 6f 6e | 0d 09 70 72 6f 62 6c 65 |location|..proble|
|00005620| 6d 73 20 6f 63 63 75 72 | 2e 20 20 50 61 73 73 20 |ms occur|. Pass |
|00005630| 6e 69 6c 20 69 66 20 6e | 6f 6e 65 20 74 6f 20 62 |nil if n|one to b|
|00005640| 65 20 75 73 65 64 2e 0d | 2a 2f 0d 0d 53 6b 65 6c |e used..|*/..Skel|
|00005650| 49 6e 69 74 20 28 6e 6f | 4d 61 73 74 65 72 73 2c |Init (no|Masters,|
|00005660| 20 67 7a 50 72 6f 63 29 | 0d 69 6e 74 09 09 6e 6f | gzProc)|.int..no|
|00005670| 4d 61 73 74 65 72 73 3b | 0d 50 72 6f 63 50 74 72 |Masters;|.ProcPtr|
|00005680| 09 67 7a 50 72 6f 63 3b | 0d 7b 0d 09 77 68 69 6c |.gzProc;|.{..whil|
|00005690| 65 20 28 6e 6f 4d 61 73 | 74 65 72 73 2d 2d 20 3e |e (noMas|ters-- >|
|000056a0| 20 30 29 0d 09 09 4d 6f | 72 65 4d 61 73 74 65 72 | 0)...Mo|reMaster|
|000056b0| 73 20 28 29 3b 0d 0d 09 | 69 66 20 28 67 7a 50 72 |s ();...|if (gzPr|
|000056c0| 6f 63 20 21 3d 20 6e 69 | 6c 29 0d 09 09 53 65 74 |oc != ni|l)...Set|
|000056d0| 47 72 6f 77 5a 6f 6e 65 | 20 28 67 7a 50 72 6f 63 |GrowZone| (gzProc|
|000056e0| 29 3b 0d 0d 09 4d 61 78 | 41 70 70 6c 5a 6f 6e 65 |);...Max|ApplZone|
|000056f0| 20 28 29 3b 0d 09 46 6c | 75 73 68 45 76 65 6e 74 | ();..Fl|ushEvent|
|00005700| 73 20 28 65 76 65 72 79 | 45 76 65 6e 74 20 2d 20 |s (every|Event - |
|00005710| 64 69 73 6b 4d 61 73 6b | 2c 20 30 20 29 3b 0d 09 |diskMask|, 0 );..|
|00005720| 49 6e 69 74 47 72 61 66 | 20 28 26 74 68 65 50 6f |InitGraf| (&thePo|
|00005730| 72 74 29 3b 0d 09 49 6e | 69 74 46 6f 6e 74 73 20 |rt);..In|itFonts |
|00005740| 28 29 3b 0d 09 49 6e 69 | 74 57 69 6e 64 6f 77 73 |();..Ini|tWindows|
|00005750| 20 28 29 3b 0d 09 49 6e | 69 74 4d 65 6e 75 73 20 | ();..In|itMenus |
|00005760| 28 29 3b 0d 09 54 45 49 | 6e 69 74 20 28 29 3b 0d |();..TEI|nit ();.|
|00005770| 09 49 6e 69 74 44 69 61 | 6c 6f 67 73 20 28 6e 69 |.InitDia|logs (ni|
|00005780| 6c 29 3b 09 09 2f 2a 20 | 6e 6f 20 72 65 73 74 61 |l);../* |no resta|
|00005790| 72 74 20 70 72 6f 63 20 | 2a 2f 0d 09 49 6e 69 74 |rt proc |*/..Init|
|000057a0| 43 75 72 73 6f 72 20 28 | 29 3b 0d 2f 2a 0d 09 53 |Cursor (|);./*..S|
|000057b0| 65 74 20 75 70 70 65 72 | 20 6c 69 6d 69 74 73 20 |et upper| limits |
|000057c0| 6f 66 20 77 69 6e 64 6f | 77 20 73 69 7a 69 6e 67 |of windo|w sizing|
|000057d0| 20 74 6f 20 6d 61 63 68 | 69 6e 65 20 73 63 72 65 | to mach|ine scre|
|000057e0| 65 6e 20 73 69 7a 65 2e | 20 20 41 6c 6c 6f 77 0d |en size.| Allow.|
|000057f0| 09 66 6f 72 20 74 68 65 | 20 6d 65 6e 75 20 62 61 |.for the| menu ba|
|00005800| 72 2e 0d 2a 2f 0d 09 47 | 65 74 57 4d 67 72 50 6f |r..*/..G|etWMgrPo|
|00005810| 72 74 20 28 26 73 63 72 | 65 65 6e 50 6f 72 74 29 |rt (&scr|eenPort)|
|00005820| 3b 0d 09 67 72 6f 77 52 | 65 63 74 2e 72 69 67 68 |;..growR|ect.righ|
|00005830| 74 20 3d 20 73 63 72 65 | 65 6e 50 6f 72 74 2d 3e |t = scre|enPort->|
|00005840| 70 6f 72 74 52 65 63 74 | 2e 72 69 67 68 74 3b 0d |portRect|.right;.|
|00005850| 09 67 72 6f 77 52 65 63 | 74 2e 62 6f 74 74 6f 6d |.growRec|t.bottom|
|00005860| 20 3d 20 73 63 72 65 65 | 6e 50 6f 72 74 2d 3e 70 | = scree|nPort->p|
|00005870| 6f 72 74 52 65 63 74 2e | 62 6f 74 74 6f 6d 20 2d |ortRect.|bottom -|
|00005880| 20 6d 42 61 72 48 65 69 | 67 68 74 3b 0d 7d 0d 0d | mBarHei|ght;.}..|
|00005890| 0d 2f 2a 0d 09 4d 61 69 | 6e 20 6c 6f 6f 70 2e 0d |./*..Mai|n loop..|
|000058a0| 0d 09 54 61 73 6b 20 63 | 61 72 65 20 6f 66 20 44 |..Task c|are of D|
|000058b0| 41 27 73 20 77 69 74 68 | 20 53 79 73 74 65 6d 54 |A's with| SystemT|
|000058c0| 61 73 6b 2e 0d 09 52 75 | 6e 20 62 61 63 6b 67 72 |ask...Ru|n backgr|
|000058d0| 6f 75 6e 64 20 74 61 73 | 6b 20 69 66 20 74 68 65 |ound tas|k if the|
|000058e0| 72 65 20 69 73 20 6f 6e | 65 2e 0d 09 49 66 20 74 |re is on|e...If t|
|000058f0| 68 65 72 65 20 69 73 20 | 61 6e 20 65 76 65 6e 74 |here is |an event|
|00005900| 2c 20 63 68 65 63 6b 20 | 66 6f 72 20 61 6e 20 65 |, check |for an e|
|00005910| 76 65 6e 74 20 68 6f 6f | 6b 2e 20 20 49 66 20 74 |vent hoo|k. If t|
|00005920| 68 65 72 65 20 69 73 6e | 27 74 0d 09 6f 6e 65 20 |here isn|'t..one |
|00005930| 64 65 66 69 6e 65 64 2c | 20 6f 72 20 69 66 20 74 |defined,| or if t|
|00005940| 68 65 72 65 20 69 73 20 | 62 75 74 20 69 74 20 72 |here is |but it r|
|00005950| 65 74 75 72 6e 73 20 66 | 61 6c 73 65 2c 20 63 61 |eturns f|alse, ca|
|00005960| 6c 6c 20 74 68 65 0d 09 | 67 65 6e 65 72 61 6c 20 |ll the..|general |
|00005970| 65 76 65 6e 74 20 68 61 | 6e 64 6c 65 72 2e 20 20 |event ha|ndler. |
|00005980| 28 48 6f 6f 6b 20 72 65 | 74 75 72 6e 73 20 74 72 |(Hook re|turns tr|
|00005990| 75 65 20 69 66 20 54 72 | 61 6e 73 53 6b 65 6c 20 |ue if Tr|ansSkel |
|000059a0| 73 68 6f 75 6c 64 0d 09 | 69 67 6e 6f 72 65 20 74 |should..|ignore t|
|000059b0| 68 65 20 65 76 65 6e 74 | 2e 29 0d 09 49 66 20 6e |he event|.)..If n|
|000059c0| 6f 20 65 76 65 6e 74 2c | 20 63 61 6c 6c 20 74 68 |o event,| call th|
|000059d0| 65 20 22 6e 6f 2d 65 76 | 65 6e 74 22 20 68 61 6e |e "no-ev|ent" han|
|000059e0| 64 6c 65 72 20 66 6f 72 | 20 74 68 65 20 66 72 6f |dler for| the fro|
|000059f0| 6e 74 20 77 69 6e 64 6f | 77 20 61 6e 64 20 66 6f |nt windo|w and fo|
|00005a00| 72 0d 09 61 6e 79 20 6f | 74 68 65 72 20 77 69 6e |r..any o|ther win|
|00005a10| 64 6f 77 73 20 77 69 74 | 68 20 69 64 6c 65 20 70 |dows wit|h idle p|
|00005a20| 72 6f 63 65 64 75 72 65 | 73 20 74 68 61 74 20 61 |rocedure|s that a|
|00005a30| 72 65 20 61 6c 77 61 79 | 73 20 73 75 70 70 6f 73 |re alway|s suppos|
|00005a40| 65 64 0d 09 74 6f 20 72 | 75 6e 2e 20 20 54 68 69 |ed..to r|un. Thi|
|00005a50| 73 20 69 73 20 64 6f 6e | 65 20 69 6e 20 73 75 63 |s is don|e in suc|
|00005a60| 68 20 61 20 77 61 79 20 | 74 68 61 74 20 69 74 20 |h a way |that it |
|00005a70| 69 73 20 73 61 66 65 20 | 66 6f 72 20 69 64 6c 65 |is safe |for idle|
|00005a80| 20 70 72 6f 63 73 0d 09 | 74 6f 20 72 65 6d 6f 76 | procs..|to remov|
|00005a90| 65 20 74 68 65 20 68 61 | 6e 64 6c 65 72 20 66 6f |e the ha|ndler fo|
|00005aa0| 72 20 74 68 65 69 72 20 | 6f 77 6e 20 77 69 6e 64 |r their |own wind|
|00005ab0| 6f 77 20 69 66 20 74 68 | 65 79 20 77 61 6e 74 20 |ow if th|ey want |
|00005ac0| 28 75 6e 6c 69 6b 65 6c | 79 2c 0d 09 62 75 74 2e |(unlikel|y,..but.|
|00005ad0| 2e 2e 29 20 20 54 68 69 | 73 20 6c 6f 6f 70 20 64 |..) Thi|s loop d|
|00005ae0| 6f 65 73 6e 27 74 20 63 | 68 65 63 6b 20 77 68 65 |oesn't c|heck whe|
|00005af0| 74 68 65 72 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |ther the| window |
|00005b00| 69 73 20 72 65 61 6c 6c | 79 0d 09 61 20 64 69 61 |is reall|y..a dia|
|00005b10| 6c 6f 67 20 77 69 6e 64 | 6f 77 20 6f 72 20 6e 6f |log wind|ow or no|
|00005b20| 74 2c 20 62 75 74 20 69 | 74 20 64 6f 65 73 6e 27 |t, but i|t doesn'|
|00005b30| 74 20 68 61 76 65 20 74 | 6f 2c 20 62 65 63 61 75 |t have t|o, becau|
|00005b40| 73 65 20 73 75 63 68 0d | 09 74 68 69 6e 67 73 20 |se such.|.things |
|00005b50| 61 6c 77 61 79 73 20 68 | 61 76 65 20 61 20 6e 69 |always h|ave a ni|
|00005b60| 6c 20 69 64 6c 65 20 70 | 72 6f 63 2e 0d 09 0d 09 |l idle p|roc.....|
|00005b70| 64 6f 6e 65 46 6c 61 67 | 20 69 73 20 72 65 73 65 |doneFlag| is rese|
|00005b80| 74 20 75 70 6f 6e 20 65 | 78 69 74 2e 20 20 54 68 |t upon e|xit. Th|
|00005b90| 69 73 20 61 6c 6c 6f 77 | 73 20 53 6b 65 6c 4d 61 |is allow|s SkelMa|
|00005ba0| 69 6e 20 74 6f 20 62 65 | 20 63 61 6c 6c 65 64 0d |in to be| called.|
|00005bb0| 09 72 65 70 65 61 74 65 | 64 6c 79 2c 20 6f 72 20 |.repeate|dly, or |
|00005bc0| 72 65 63 75 72 73 69 76 | 65 6c 79 2e 0d 0d 09 4e |recursiv|ely....N|
|00005bd0| 75 6c 6c 20 65 76 65 6e | 74 73 20 61 72 65 20 65 |ull even|ts are e|
|00005be0| 78 61 6d 69 6e 65 64 20 | 28 69 6e 20 53 6b 65 6c |xamined |(in Skel|
|00005bf0| 4d 61 69 6e 29 20 61 6e | 64 20 70 61 73 73 65 64 |Main) an|d passed|
|00005c00| 20 74 6f 20 74 68 65 20 | 65 76 65 6e 74 0d 09 68 | to the |event..h|
|00005c10| 61 6e 64 6c 65 72 2e 20 | 20 54 68 69 73 20 69 73 |andler. | This is|
|00005c20| 20 6e 65 63 65 73 73 61 | 72 79 20 74 6f 20 6d 61 | necessa|ry to ma|
|00005c30| 6b 65 20 73 75 72 65 2c | 20 69 66 20 64 69 61 6c |ke sure,| if dial|
|00005c40| 6f 67 73 20 61 72 65 20 | 73 75 70 70 6f 72 74 65 |ogs are |supporte|
|00005c50| 64 2c 0d 09 74 68 61 74 | 20 44 69 61 6c 6f 67 53 |d,..that| DialogS|
|00005c60| 65 6c 65 63 74 20 67 65 | 74 73 20 63 61 6c 6c 65 |elect ge|ts calle|
|00005c70| 64 20 72 65 70 65 61 74 | 65 64 6c 79 2c 20 6f 72 |d repeat|edly, or|
|00005c80| 20 74 68 65 20 63 61 72 | 65 74 20 77 6f 6e 27 74 | the car|et won't|
|00005c90| 20 62 6c 69 6e 6b 0d 09 | 69 66 20 61 20 64 69 61 | blink..|if a dia|
|00005ca0| 6c 6f 67 20 68 61 73 20 | 61 6e 79 20 65 64 69 74 |log has |any edit|
|00005cb0| 54 65 78 74 20 69 74 65 | 6d 73 2e 0d 0d 09 4e 75 |Text ite|ms....Nu|
|00005cc0| 6c 6c 20 65 76 65 6e 74 | 73 20 61 72 65 20 6e 6f |ll event|s are no|
|00005cd0| 74 20 70 61 73 73 65 64 | 20 74 6f 20 61 6e 79 20 |t passed| to any |
|00005ce0| 65 76 65 6e 74 2d 69 6e | 73 70 65 63 74 69 6e 67 |event-in|specting|
|00005cf0| 20 68 6f 6f 6b 20 74 68 | 61 74 20 6d 61 79 0d 09 | hook th|at may..|
|00005d00| 62 65 20 69 6e 73 74 61 | 6c 6c 65 64 2e 0d 2a 2f |be insta|lled..*/|
|00005d10| 0d 0d 53 6b 65 6c 4d 61 | 69 6e 20 28 29 0d 7b 0d |..SkelMa|in ().{.|
|00005d20| 45 76 65 6e 74 52 65 63 | 6f 72 64 09 09 09 74 68 |EventRec|ord...th|
|00005d30| 65 45 76 65 6e 74 3b 0d | 72 65 67 69 73 74 65 72 |eEvent;.|register|
|00005d40| 20 57 48 61 6e 64 6c 65 | 72 09 2a 2a 77 68 2c 20 | WHandle|r.**wh, |
|00005d50| 2a 2a 77 68 32 3b 0d 72 | 65 67 69 73 74 65 72 20 |**wh2;.r|egister |
|00005d60| 57 69 6e 64 6f 77 50 74 | 72 09 77 3b 0d 42 6f 6f |WindowPt|r.w;.Boo|
|00005d70| 6c 65 61 6e 09 09 09 09 | 68 61 76 65 45 76 65 6e |lean....|haveEven|
|00005d80| 74 3b 0d 47 72 61 66 50 | 74 72 09 09 09 09 74 6d |t;.GrafP|tr....tm|
|00005d90| 70 50 6f 72 74 3b 0d 72 | 65 67 69 73 74 65 72 20 |pPort;.r|egister |
|00005da0| 50 72 6f 63 50 74 72 09 | 70 3b 0d 0d 09 77 68 69 |ProcPtr.|p;...whi|
|00005db0| 6c 65 20 28 21 64 6f 6e | 65 46 6c 61 67 29 0d 09 |le (!don|eFlag)..|
|00005dc0| 7b 09 0d 09 09 53 79 73 | 74 65 6d 54 61 73 6b 20 |{....Sys|temTask |
|00005dd0| 28 29 3b 0d 09 09 69 66 | 20 28 70 42 6b 67 6e 64 |();...if| (pBkgnd|
|00005de0| 20 21 3d 20 6e 69 6c 29 | 0d 09 09 09 28 2a 70 42 | != nil)|....(*pB|
|00005df0| 6b 67 6e 64 29 20 28 29 | 3b 0d 0d 2f 2a 0d 09 4e |kgnd) ()|;../*..N|
|00005e00| 6f 77 20 77 61 74 63 68 | 20 63 61 72 65 66 75 6c |ow watch| careful|
|00005e10| 6c 79 2e 20 20 47 65 74 | 4e 65 78 74 45 76 65 6e |ly. Get|NextEven|
|00005e20| 74 20 63 61 6c 6c 73 20 | 53 79 73 74 65 6d 45 76 |t calls |SystemEv|
|00005e30| 65 6e 74 20 74 6f 20 68 | 61 6e 64 6c 65 20 73 6f |ent to h|andle so|
|00005e40| 6d 65 0d 09 44 41 20 65 | 76 65 6e 74 73 2c 20 61 |me..DA e|vents, a|
|00005e50| 6e 64 20 72 65 74 75 72 | 6e 73 20 66 61 6c 73 65 |nd retur|ns false|
|00005e60| 20 69 66 20 74 68 65 20 | 65 76 65 6e 74 20 77 61 | if the |event wa|
|00005e70| 73 20 68 61 6e 64 6c 65 | 64 2e 20 20 48 6f 77 65 |s handle|d. Howe|
|00005e80| 76 65 72 2c 20 69 6e 0d | 09 73 75 63 68 20 63 61 |ver, in.|.such ca|
|00005e90| 73 65 73 20 74 68 65 20 | 65 76 65 6e 74 20 72 65 |ses the |event re|
|00005ea0| 63 6f 72 64 20 77 69 6c | 6c 20 73 74 69 6c 6c 20 |cord wil|l still |
|00005eb0| 68 61 76 65 20 74 68 65 | 20 65 76 65 6e 74 20 74 |have the| event t|
|00005ec0| 68 61 74 20 6f 63 63 75 | 72 72 65 64 2c 0d 09 2a |hat occu|rred,..*|
|00005ed0| 6e 6f 74 2a 20 61 20 6e | 75 6c 6c 20 65 76 65 6e |not* a n|ull even|
|00005ee0| 74 2c 20 61 73 20 79 6f | 75 20 6d 69 67 68 74 20 |t, as yo|u might |
|00005ef0| 72 65 61 73 6f 6e 61 62 | 6c 79 20 65 78 70 65 63 |reasonab|ly expec|
|00005f00| 74 2e 20 20 53 6f 20 69 | 74 27 73 20 6e 6f 74 0d |t. So i|t's not.|
|00005f10| 09 65 6e 6f 75 67 68 20 | 74 6f 20 6c 6f 6f 6b 20 |.enough |to look |
|00005f20| 61 74 20 68 61 76 65 45 | 76 65 6e 74 2e 0d 0d 09 |at haveE|vent....|
|00005f30| 50 72 65 76 69 6f 75 73 | 20 76 65 72 73 69 6f 6e |Previous| version|
|00005f40| 73 20 66 69 67 75 72 65 | 64 20 28 77 72 6f 6e 67 |s figure|d (wrong|
|00005f50| 6c 79 29 20 74 68 61 74 | 20 68 61 76 65 45 76 65 |ly) that| haveEve|
|00005f60| 6e 74 3d 3d 66 61 6c 73 | 65 20 6d 65 61 6e 74 20 |nt==fals|e meant |
|00005f70| 61 20 6e 75 6c 6c 0d 09 | 65 76 65 6e 74 20 68 61 |a null..|event ha|
|00005f80| 64 20 6f 63 63 75 72 72 | 65 64 2c 20 61 6e 64 20 |d occurr|ed, and |
|00005f90| 70 61 73 73 65 64 20 69 | 74 20 74 68 72 6f 75 67 |passed i|t throug|
|00005fa0| 68 20 74 6f 20 44 6f 45 | 76 65 6e 74 20 61 6e 64 |h to DoE|vent and|
|00005fb0| 20 44 6f 44 69 61 6c 6f | 67 2c 20 73 6f 0d 09 74 | DoDialo|g, so..t|
|00005fc0| 68 61 74 20 63 61 72 65 | 74 2d 62 6c 69 6e 6b 69 |hat care|t-blinki|
|00005fd0| 6e 67 20 69 6e 20 64 69 | 61 6c 6f 67 20 54 65 78 |ng in di|alog Tex|
|00005fe0| 74 45 64 69 74 20 69 74 | 65 6d 73 20 77 6f 75 6c |tEdit it|ems woul|
|00005ff0| 64 20 6f 63 63 75 72 2e | 20 20 42 75 74 20 63 6d |d occur.| But cm|
|00006000| 64 2d 6b 65 79 0d 09 65 | 71 75 69 76 61 6c 65 6e |d-key..e|quivalen|
|00006010| 74 73 20 77 68 69 6c 65 | 20 44 41 20 77 69 6e 64 |ts while| DA wind|
|00006020| 6f 77 73 20 77 65 72 65 | 20 69 6e 20 66 72 6f 6e |ows were| in fron|
|00006030| 74 2c 20 69 6e 20 70 61 | 72 74 69 63 75 6c 61 72 |t, in pa|rticular|
|00006040| 2c 20 61 6c 6c 6f 77 65 | 64 0d 09 61 6c 72 65 61 |, allowe|d..alrea|
|00006050| 64 79 2d 70 72 6f 63 65 | 73 73 65 64 20 44 41 20 |dy-proce|ssed DA |
|00006060| 65 76 65 6e 74 73 20 74 | 6f 20 67 65 74 20 69 6e |events t|o get in|
|00006070| 74 6f 20 44 6f 45 76 65 | 6e 74 20 28 62 65 63 61 |to DoEve|nt (beca|
|00006080| 75 73 65 20 68 61 76 65 | 45 76 65 6e 74 0d 09 77 |use have|Event..w|
|00006090| 61 73 20 66 61 6c 73 65 | 29 2c 20 61 6e 64 20 74 |as false|), and t|
|000060a0| 68 65 79 20 67 6f 74 20 | 68 61 6e 64 6c 65 64 20 |hey got |handled |
|000060b0| 74 77 69 63 65 20 62 65 | 63 61 75 73 65 20 77 68 |twice be|cause wh|
|000060c0| 65 6e 20 74 68 65 20 65 | 76 65 6e 74 20 72 65 63 |en the e|vent rec|
|000060d0| 6f 72 64 0d 09 77 61 73 | 20 65 78 61 6d 69 6e 65 |ord..was| examine|
|000060e0| 64 2c 20 6c 6f 20 61 6e | 64 20 62 65 68 6f 6c 64 |d, lo an|d behold|
|000060f0| 2c 20 69 74 20 68 61 64 | 20 61 20 63 6d 64 2d 6b |, it had| a cmd-k|
|00006100| 65 79 20 65 76 65 6e 74 | 21 20 20 53 6f 20 6e 6f |ey event|! So no|
|00006110| 77 20 74 68 69 73 0d 09 | 6c 6f 67 69 63 20 69 73 |w this..|logic is|
|00006120| 20 75 73 65 64 3a 0d 0d | 09 49 66 20 68 61 76 65 | used:..|.If have|
|00006130| 20 61 20 72 65 61 6c 20 | 65 76 65 6e 74 2c 20 61 | a real |event, a|
|00006140| 6e 64 20 74 68 65 72 65 | 27 73 20 6e 6f 20 65 76 |nd there|'s no ev|
|00006150| 65 6e 74 20 68 6f 6f 6b | 20 6f 72 20 74 68 65 72 |ent hook| or ther|
|00006160| 65 20 69 73 20 62 75 74 | 20 69 74 0d 09 64 6f 65 |e is but| it..doe|
|00006170| 73 6e 27 74 20 68 61 6e | 64 6c 65 20 74 68 65 20 |sn't han|dle the |
|00006180| 65 76 65 6e 74 2c 20 4f | 52 20 69 66 20 74 68 65 |event, O|R if the|
|00006190| 20 22 6e 6f 6e 2d 65 76 | 65 6e 74 22 20 69 73 20 | "non-ev|ent" is |
|000061a0| 61 20 74 72 75 65 20 6e | 75 6c 6c 45 76 65 6e 74 |a true n|ullEvent|
|000061b0| 2c 0d 09 74 68 65 6e 20 | 70 72 6f 63 65 73 73 20 |,..then |process |
|000061c0| 69 74 2e 0d 2a 2f 0d 09 | 09 09 0d 09 09 68 61 76 |it..*/..|.....hav|
|000061d0| 65 45 76 65 6e 74 20 3d | 20 47 65 74 4e 65 78 74 |eEvent =| GetNext|
|000061e0| 45 76 65 6e 74 20 28 65 | 76 65 6e 74 4d 61 73 6b |Event (e|ventMask|
|000061f0| 2c 20 26 74 68 65 45 76 | 65 6e 74 29 3b 0d 0d 09 |, &theEv|ent);...|
|00006200| 09 69 66 20 28 28 68 61 | 76 65 45 76 65 6e 74 20 |.if ((ha|veEvent |
|00006210| 26 26 20 28 70 45 76 65 | 6e 74 20 3d 3d 20 6e 69 |&& (pEve|nt == ni|
|00006220| 6c 20 7c 7c 20 28 2a 70 | 45 76 65 6e 74 29 28 26 |l || (*p|Event)(&|
|00006230| 74 68 65 45 76 65 6e 74 | 29 20 3d 3d 20 66 61 6c |theEvent|) == fal|
|00006240| 73 65 29 29 0d 09 09 09 | 09 7c 7c 20 74 68 65 45 |se))....|.|| theE|
|00006250| 76 65 6e 74 2e 77 68 61 | 74 20 3d 3d 20 6e 75 6c |vent.wha|t == nul|
|00006260| 6c 45 76 65 6e 74 29 0d | 09 09 09 44 6f 45 76 65 |lEvent).|...DoEve|
|00006270| 6e 74 28 26 74 68 65 45 | 76 65 6e 74 29 3b 0d 0d |nt(&theE|vent);..|
|00006280| 2f 2a 0d 09 52 75 6e 20 | 61 70 70 6c 69 63 61 62 |/*..Run |applicab|
|00006290| 6c 65 20 69 64 6c 65 20 | 70 72 6f 63 73 2e 20 20 |le idle |procs. |
|000062a0| 4d 61 6b 65 20 73 75 72 | 65 20 74 6f 20 73 61 76 |Make sur|e to sav|
|000062b0| 65 20 61 6e 64 20 72 65 | 73 74 6f 72 65 20 74 68 |e and re|store th|
|000062c0| 65 20 70 6f 72 74 2c 0d | 09 73 69 6e 63 65 20 69 |e port,.|.since i|
|000062d0| 64 6c 65 20 70 72 6f 63 | 73 20 66 6f 72 20 74 68 |dle proc|s for th|
|000062e0| 65 20 6e 6f 6e 2d 61 63 | 74 69 76 65 20 77 69 6e |e non-ac|tive win|
|000062f0| 64 6f 77 20 6d 61 79 20 | 62 65 20 72 75 6e 2e 0d |dow may |be run..|
|00006300| 2a 2f 0d 0d 09 09 69 66 | 20 28 21 68 61 76 65 45 |*/....if| (!haveE|
|00006310| 76 65 6e 74 29 0d 09 09 | 7b 0d 09 09 09 47 65 74 |vent)...|{....Get|
|00006320| 50 6f 72 74 20 28 26 74 | 6d 70 50 6f 72 74 29 3b |Port (&t|mpPort);|
|00006330| 0d 09 09 09 66 6f 72 20 | 28 77 68 20 3d 20 77 68 |....for |(wh = wh|
|00006340| 4c 69 73 74 3b 20 77 68 | 20 21 3d 20 6e 69 6c 3b |List; wh| != nil;|
|00006350| 20 77 68 20 3d 20 77 68 | 32 29 0d 09 09 09 7b 0d | wh = wh|2)....{.|
|00006360| 09 09 09 09 77 68 32 20 | 3d 20 28 2a 2a 77 68 29 |....wh2 |= (**wh)|
|00006370| 2e 77 68 4e 65 78 74 3b | 0d 09 09 09 09 77 20 3d |.whNext;|.....w =|
|00006380| 20 28 2a 2a 77 68 29 2e | 77 68 57 69 6e 64 3b 0d | (**wh).|whWind;.|
|00006390| 09 09 09 09 69 66 20 28 | 20 28 77 20 3d 3d 20 46 |....if (| (w == F|
|000063a0| 72 6f 6e 74 57 69 6e 64 | 6f 77 20 28 29 20 7c 7c |rontWind|ow () |||
|000063b0| 20 21 28 2a 2a 77 68 29 | 2e 77 68 46 72 6f 6e 74 | !(**wh)|.whFront|
|000063c0| 4f 6e 6c 79 20 29 20 29 | 0d 09 09 09 09 7b 0d 09 |Only ) )|.....{..|
|000063d0| 09 09 09 09 53 79 73 74 | 65 6d 54 61 73 6b 20 28 |....Syst|emTask (|
|000063e0| 29 3b 0d 09 09 09 09 09 | 69 66 20 28 28 70 20 3d |);......|if ((p =|
|000063f0| 20 28 2a 2a 77 68 29 2e | 77 68 49 64 6c 65 29 20 | (**wh).|whIdle) |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.