home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 …ember: Reference Library / Apple Developer Reference Library (December 1999) (Disk 1).iso / mac / Technical Documentation / Develop / develop Issue 23 / develop Issue 23 code / Multipane Dialogs Code.sea / Multipane Dialogs Code / Utilities.c < prev    next >
MacBinary  |  1995-06-17  |  27.0 KB  |  [TEXT/MMCC]

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 Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sat Jun 17 21:37:03 1995, modified Sat Jun 17 21:37:03 1995, creator 'MMCC', type ASCII, 27002 bytes "Utilities.c" magic text fragment for file(1) cmd, 1st line "#include "Utilities.h"", 2nd line "", 3rd line "short%09gQDVersion;%09%09%09%09/* major QD version #; 0 for original,", 4th line "%09%09%09%09%09%09%09%09%09%09%091 for color QD, 2 for 32-bit QD */", 5th line "short%09gInitMPDUtils = 0;", at 0x69fa 410 bytes resource magic text fragment for file(1) cmd, 1st line "#include "Utilities.h"", 2nd line "", 3rd line "short%09gQDVersion;%09%09%09%09/* major QD version #; 0 for original,", 4th line "%09%09%09%09%09%09%09%09%09%09%091 for color QD, 2 for 32-bit QD */", 5th line "short%09gInitMPDUtils = 0;" default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MMCC]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 55 74 69 6c 69 74 | 69 65 73 2e 63 00 00 00 |..Utilit|ies.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 4d 4d 43 | 43 01 00 00 00 00 00 00 |.TEXTMMC|C.......|
|00000050| 00 00 00 00 00 69 7a 00 | 00 01 9a ac 09 33 bf ac |.....iz.|.....3..|
|00000060| 09 33 bf 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.3......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 4e b3 00 00 |........|....N...|
|00000080| 23 69 6e 63 6c 75 64 65 | 20 22 55 74 69 6c 69 74 |#include| "Utilit|
|00000090| 69 65 73 2e 68 22 0d 0d | 73 68 6f 72 74 09 67 51 |ies.h"..|short.gQ|
|000000a0| 44 56 65 72 73 69 6f 6e | 3b 09 09 09 09 2f 2a 20 |DVersion|;..../* |
|000000b0| 6d 61 6a 6f 72 20 51 44 | 20 76 65 72 73 69 6f 6e |major QD| version|
|000000c0| 20 23 3b 20 30 20 66 6f | 72 20 6f 72 69 67 69 6e | #; 0 fo|r origin|
|000000d0| 61 6c 2c 0d 09 09 09 09 | 09 09 09 09 09 09 09 31 |al,.....|.......1|
|000000e0| 20 66 6f 72 20 63 6f 6c | 6f 72 20 51 44 2c 20 32 | for col|or QD, 2|
|000000f0| 20 66 6f 72 20 33 32 2d | 62 69 74 20 51 44 20 2a | for 32-|bit QD *|
|00000100| 2f 0d 73 68 6f 72 74 09 | 67 49 6e 69 74 4d 50 44 |/.short.|gInitMPD|
|00000110| 55 74 69 6c 73 20 3d 20 | 30 3b 0d 73 74 61 74 69 |Utils = |0;.stati|
|00000120| 63 20 52 65 63 74 09 09 | 67 57 69 6e 64 6f 77 50 |c Rect..|gWindowP|
|00000130| 6c 61 63 65 6d 65 6e 74 | 52 65 63 74 3b 0d 73 74 |lacement|Rect;.st|
|00000140| 61 74 69 63 20 73 68 6f | 72 74 09 67 53 79 73 74 |atic sho|rt.gSyst|
|00000150| 65 6d 56 65 72 73 69 6f | 6e 3b 09 09 09 2f 2a 20 |emVersio|n;.../* |
|00000160| 53 79 73 74 65 6d 20 76 | 65 72 73 69 6f 6e 20 6e |System v|ersion n|
|00000170| 75 6d 62 65 72 20 2a 2f | 0d 73 74 61 74 69 63 20 |umber */|.static |
|00000180| 73 68 6f 72 74 20 09 67 | 41 70 70 52 65 73 52 65 |short .g|AppResRe|
|00000190| 66 3b 0d 0d 2f 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |f;../***|********|
|000001a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000001b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000001c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000001d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000001e0| 2a 2a 2a 2a 2a 0d 20 2a | 0d 20 2a 20 42 6f 72 72 |*****. *|. * Borr|
|000001f0| 6f 77 65 64 20 66 72 6f | 6d 20 44 54 53 20 4c 69 |owed fro|m DTS Li|
|00000200| 62 0d 20 2a 0d 20 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |b. *. **|********|
|00000210| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000220| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000230| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000240| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000250| 2a 2a 2a 2a 2a 2a 2f 0d | 0d 23 64 65 66 69 6e 65 |******/.|.#define|
|00000260| 20 54 6f 70 4c 65 66 74 | 28 72 29 09 09 28 2a 20 | TopLeft|(r)..(* |
|00000270| 28 50 6f 69 6e 74 20 2a | 29 20 26 28 72 29 2e 74 |(Point *|) &(r).t|
|00000280| 6f 70 29 0d 23 64 65 66 | 69 6e 65 20 42 6f 74 52 |op).#def|ine BotR|
|00000290| 69 67 68 74 28 72 29 09 | 09 28 2a 20 28 50 6f 69 |ight(r).|.(* (Poi|
|000002a0| 6e 74 20 2a 29 20 26 28 | 72 29 2e 62 6f 74 74 6f |nt *) &(|r).botto|
|000002b0| 6d 29 0d 65 6e 75 6d 20 | 7b 20 6b 51 44 4f 72 69 |m).enum |{ kQDOri|
|000002c0| 67 69 6e 61 6c 20 3d 20 | 30 2c 20 6b 51 44 38 42 |ginal = |0, kQD8B|
|000002d0| 69 74 2c 20 6b 51 44 33 | 32 42 69 74 20 7d 3b 09 |it, kQD3|2Bit };.|
|000002e0| 2f 2a 20 46 6f 72 20 75 | 73 65 20 77 69 74 68 20 |/* For u|se with |
|000002f0| 67 51 44 56 65 72 73 69 | 6f 6e 20 2a 2f 0d 23 64 |gQDVersi|on */.#d|
|00000300| 65 66 69 6e 65 20 6f 66 | 66 73 65 74 6f 66 28 73 |efine of|fsetof(s|
|00000310| 74 72 75 63 74 75 72 65 | 2c 66 69 65 6c 64 29 20 |tructure|,field) |
|00000320| 28 28 75 6e 73 69 67 6e | 65 64 20 6c 6f 6e 67 29 |((unsign|ed long)|
|00000330| 26 28 28 73 74 72 75 63 | 74 75 72 65 20 2a 29 20 |&((struc|ture *) |
|00000340| 30 29 2d 3e 66 69 65 6c | 64 29 0d 0d 74 79 70 65 |0)->fiel|d)..type|
|00000350| 64 65 66 20 42 6f 6f 6c | 65 61 6e 09 28 2a 54 72 |def Bool|ean.(*Tr|
|00000360| 61 63 6b 43 6f 6e 74 72 | 6f 6c 50 72 6f 63 50 74 |ackContr|olProcPt|
|00000370| 72 29 28 43 6f 6e 74 72 | 6f 6c 48 61 6e 64 6c 65 |r)(Contr|olHandle|
|00000380| 20 63 74 6c 2c 20 73 68 | 6f 72 74 20 70 61 72 74 | ctl, sh|ort part|
|00000390| 2c 20 45 76 65 6e 74 52 | 65 63 6f 72 64 20 2a 65 |, EventR|ecord *e|
|000003a0| 76 65 6e 74 29 3b 0d 74 | 79 70 65 64 65 66 20 76 |vent);.t|ypedef v|
|000003b0| 6f 69 64 09 28 2a 53 63 | 72 6f 6c 6c 50 72 6f 63 |oid.(*Sc|rollProc|
|000003c0| 50 74 72 29 28 43 6f 6e | 74 72 6f 6c 48 61 6e 64 |Ptr)(Con|trolHand|
|000003d0| 6c 65 20 63 74 6c 2c 20 | 73 68 6f 72 74 20 70 61 |le ctl, |short pa|
|000003e0| 72 74 2c 20 73 68 6f 72 | 74 20 6f 6c 64 56 61 6c |rt, shor|t oldVal|
|000003f0| 2c 20 73 68 6f 72 74 20 | 6e 65 77 56 61 6c 29 3b |, short |newVal);|
|00000400| 0d 74 79 70 65 64 65 66 | 20 76 6f 69 64 09 28 2a |.typedef| void.(*|
|00000410| 44 72 61 77 43 6f 6e 74 | 72 6f 6c 50 72 6f 63 50 |DrawCont|rolProcP|
|00000420| 74 72 29 28 43 6f 6e 74 | 72 6f 6c 48 61 6e 64 6c |tr)(Cont|rolHandl|
|00000430| 65 20 63 74 6c 29 3b 0d | 0d 74 79 70 65 64 65 66 |e ctl);.|.typedef|
|00000440| 20 73 74 72 75 63 74 20 | 43 6f 6e 74 72 6f 6c 53 | struct |ControlS|
|00000450| 74 79 6c 65 49 6e 66 6f | 20 7b 0d 09 73 68 6f 72 |tyleInfo| {..shor|
|00000460| 74 09 09 09 09 63 74 6c | 49 44 3b 0d 09 54 72 61 |t....ctl|ID;..Tra|
|00000470| 63 6b 43 6f 6e 74 72 6f | 6c 50 72 6f 63 50 74 72 |ckContro|lProcPtr|
|00000480| 09 74 72 61 63 6b 50 72 | 6f 63 3b 0d 09 53 63 72 |.trackPr|oc;..Scr|
|00000490| 6f 6c 6c 50 72 6f 63 50 | 74 72 09 09 73 63 72 6f |ollProcP|tr..scro|
|000004a0| 6c 6c 50 72 6f 63 3b 0d | 09 73 68 6f 72 74 09 09 |llProc;.|.short..|
|000004b0| 09 09 68 41 72 72 6f 77 | 56 61 6c 3b 0d 09 73 68 |..hArrow|Val;..sh|
|000004c0| 6f 72 74 09 09 09 09 76 | 41 72 72 6f 77 56 61 6c |ort....v|ArrowVal|
|000004d0| 3b 0d 09 73 68 6f 72 74 | 09 09 09 09 68 50 61 67 |;..short|....hPag|
|000004e0| 65 56 61 6c 3b 0d 09 73 | 68 6f 72 74 09 09 09 09 |eVal;..s|hort....|
|000004f0| 76 50 61 67 65 56 61 6c | 3b 0d 09 44 72 61 77 43 |vPageVal|;..DrawC|
|00000500| 6f 6e 74 72 6f 6c 50 72 | 6f 63 50 74 72 09 64 72 |ontrolPr|ocPtr.dr|
|00000510| 61 77 43 6f 6e 74 72 6f | 6c 3b 0d 09 73 68 6f 72 |awContro|l;..shor|
|00000520| 74 09 09 09 09 66 6f 6e | 74 53 69 7a 65 3b 0d 09 |t....fon|tSize;..|
|00000530| 53 74 79 6c 65 09 09 09 | 09 66 6f 6e 74 53 74 79 |Style...|.fontSty|
|00000540| 6c 65 3b 0d 09 53 74 72 | 33 32 09 09 09 09 66 6f |le;..Str|32....fo|
|00000550| 6e 74 3b 0d 09 53 74 72 | 36 33 09 09 09 09 6b 65 |nt;..Str|63....ke|
|00000560| 79 45 71 75 69 76 73 3b | 0d 09 53 74 72 32 35 35 |yEquivs;|..Str255|
|00000570| 09 09 09 09 62 61 6c 6c | 6f 6f 6e 48 65 6c 70 3b |....ball|oonHelp;|
|00000580| 0d 7d 20 43 6f 6e 74 72 | 6f 6c 53 74 79 6c 65 49 |.} Contr|olStyleI|
|00000590| 6e 66 6f 3b 0d 74 79 70 | 65 64 65 66 20 43 6f 6e |nfo;.typ|edef Con|
|000005a0| 74 72 6f 6c 53 74 79 6c | 65 49 6e 66 6f 20 2a 43 |trolStyl|eInfo *C|
|000005b0| 6f 6e 74 72 6f 6c 53 74 | 79 6c 65 49 6e 66 6f 50 |ontrolSt|yleInfoP|
|000005c0| 74 72 3b 0d 0d 73 74 61 | 74 69 63 20 44 72 61 77 |tr;..sta|tic Draw|
|000005d0| 43 6f 6e 74 72 6f 6c 50 | 72 6f 63 50 74 72 20 67 |ControlP|rocPtr g|
|000005e0| 44 72 61 77 43 6f 6e 74 | 72 6f 6c 3b 0d 73 74 61 |DrawCont|rol;.sta|
|000005f0| 74 69 63 20 48 61 6e 64 | 6c 65 09 09 09 67 53 63 |tic Hand|le...gSc|
|00000600| 72 6f 6c 6c 50 72 6f 63 | 3b 0d 73 74 61 74 69 63 |rollProc|;.static|
|00000610| 20 48 61 6e 64 6c 65 20 | 09 09 09 67 50 6f 70 75 | Handle |...gPopu|
|00000620| 70 50 72 6f 63 3b 0d 73 | 74 61 74 69 63 20 48 61 |pProc;.s|tatic Ha|
|00000630| 6e 64 6c 65 09 09 09 67 | 42 75 74 74 6f 6e 50 72 |ndle...g|ButtonPr|
|00000640| 6f 63 73 5b 72 61 64 69 | 6f 42 75 74 50 72 6f 63 |ocs[radi|oButProc|
|00000650| 20 2b 20 70 6f 70 75 70 | 55 73 65 57 46 6f 6e 74 | + popup|UseWFont|
|00000660| 20 2b 20 31 5d 3b 0d 73 | 74 61 74 69 63 20 43 6f | + 1];.s|tatic Co|
|00000670| 6e 74 72 6f 6c 48 61 6e | 64 6c 65 09 67 57 68 69 |ntrolHan|dle.gWhi|
|00000680| 63 68 43 74 6c 48 69 74 | 3b 0d 73 74 61 74 69 63 |chCtlHit|;.static|
|00000690| 20 6c 6f 6e 67 09 09 09 | 09 67 57 68 69 63 68 43 | long...|.gWhichC|
|000006a0| 74 6c 57 68 65 6e 3b 0d | 73 74 61 74 69 63 20 42 |tlWhen;.|static B|
|000006b0| 6f 6f 6c 65 61 6e 09 09 | 09 67 57 68 69 63 68 43 |oolean..|.gWhichC|
|000006c0| 74 6c 44 62 6c 3b 0d 73 | 74 61 74 69 63 20 42 6f |tlDbl;.s|tatic Bo|
|000006d0| 6f 6c 65 61 6e 09 09 09 | 67 57 68 69 63 68 43 74 |olean...|gWhichCt|
|000006e0| 6c 54 72 61 63 6b 69 6e | 67 3b 0d 0d 42 6f 6f 6c |lTrackin|g;..Bool|
|000006f0| 65 61 6e 20 47 65 74 43 | 68 65 63 6b 4f 72 52 61 |ean GetC|heckOrRa|
|00000700| 64 69 6f 28 44 69 61 6c | 6f 67 50 74 72 20 64 6c |dio(Dial|ogPtr dl|
|00000710| 67 50 74 72 2c 20 73 68 | 6f 72 74 20 69 74 65 6d |gPtr, sh|ort item|
|00000720| 4e 6f 29 0d 7b 0d 09 73 | 68 6f 72 74 09 69 4b 69 |No).{..s|hort.iKi|
|00000730| 6e 64 3b 0d 09 48 61 6e | 64 6c 65 09 69 48 61 6e |nd;..Han|dle.iHan|
|00000740| 64 6c 65 3b 0d 09 52 65 | 63 74 09 69 52 65 63 74 |dle;..Re|ct.iRect|
|00000750| 3b 0d 0d 09 47 65 74 44 | 69 61 6c 6f 67 49 74 65 |;...GetD|ialogIte|
|00000760| 6d 28 64 6c 67 50 74 72 | 2c 20 69 74 65 6d 4e 6f |m(dlgPtr|, itemNo|
|00000770| 2c 20 26 69 4b 69 6e 64 | 2c 20 26 69 48 61 6e 64 |, &iKind|, &iHand|
|00000780| 6c 65 2c 20 26 69 52 65 | 63 74 29 3b 0d 09 72 65 |le, &iRe|ct);..re|
|00000790| 74 75 72 6e 28 47 65 74 | 43 6f 6e 74 72 6f 6c 56 |turn(Get|ControlV|
|000007a0| 61 6c 75 65 28 28 43 6f | 6e 74 72 6f 6c 48 61 6e |alue((Co|ntrolHan|
|000007b0| 64 6c 65 29 69 48 61 6e | 64 6c 65 29 20 21 3d 20 |dle)iHan|dle) != |
|000007c0| 30 29 3b 0d 7d 0d 0d 76 | 6f 69 64 09 54 6f 67 67 |0);.}..v|oid.Togg|
|000007d0| 6c 65 43 68 65 63 6b 28 | 44 69 61 6c 6f 67 50 74 |leCheck(|DialogPt|
|000007e0| 72 20 64 6c 67 50 74 72 | 2c 20 73 68 6f 72 74 20 |r dlgPtr|, short |
|000007f0| 63 68 6b 49 74 65 6d 29 | 0d 7b 0d 09 73 68 6f 72 |chkItem)|.{..shor|
|00000800| 74 09 69 4b 69 6e 64 3b | 0d 09 48 61 6e 64 6c 65 |t.iKind;|..Handle|
|00000810| 09 69 48 61 6e 64 6c 65 | 3b 0d 09 52 65 63 74 09 |.iHandle|;..Rect.|
|00000820| 69 52 65 63 74 3b 0d 0d | 09 47 65 74 44 69 61 6c |iRect;..|.GetDial|
|00000830| 6f 67 49 74 65 6d 28 64 | 6c 67 50 74 72 2c 20 63 |ogItem(d|lgPtr, c|
|00000840| 68 6b 49 74 65 6d 2c 20 | 26 69 4b 69 6e 64 2c 20 |hkItem, |&iKind, |
|00000850| 26 69 48 61 6e 64 6c 65 | 2c 20 26 69 52 65 63 74 |&iHandle|, &iRect|
|00000860| 29 3b 0d 09 53 65 74 43 | 6f 6e 74 72 6f 6c 56 61 |);..SetC|ontrolVa|
|00000870| 6c 75 65 28 28 43 6f 6e | 74 72 6f 6c 48 61 6e 64 |lue((Con|trolHand|
|00000880| 6c 65 29 20 69 48 61 6e | 64 6c 65 2c 20 21 47 65 |le) iHan|dle, !Ge|
|00000890| 74 43 6f 6e 74 72 6f 6c | 56 61 6c 75 65 28 28 43 |tControl|Value((C|
|000008a0| 6f 6e 74 72 6f 6c 48 61 | 6e 64 6c 65 29 69 48 61 |ontrolHa|ndle)iHa|
|000008b0| 6e 64 6c 65 29 29 3b 0d | 7d 0d 0d 76 6f 69 64 09 |ndle));.|}..void.|
|000008c0| 53 65 74 43 68 65 63 6b | 4f 72 52 61 64 69 6f 42 |SetCheck|OrRadioB|
|000008d0| 75 74 74 6f 6e 28 44 69 | 61 6c 6f 67 50 74 72 20 |utton(Di|alogPtr |
|000008e0| 64 6c 67 50 74 72 2c 20 | 73 68 6f 72 74 20 69 74 |dlgPtr, |short it|
|000008f0| 65 6d 4e 6f 2c 20 73 68 | 6f 72 74 20 73 74 61 74 |emNo, sh|ort stat|
|00000900| 65 29 0d 7b 0d 09 73 68 | 6f 72 74 09 69 4b 69 6e |e).{..sh|ort.iKin|
|00000910| 64 3b 0d 09 48 61 6e 64 | 6c 65 09 69 48 61 6e 64 |d;..Hand|le.iHand|
|00000920| 6c 65 3b 0d 09 52 65 63 | 74 09 69 52 65 63 74 3b |le;..Rec|t.iRect;|
|00000930| 0d 0d 09 47 65 74 44 69 | 61 6c 6f 67 49 74 65 6d |...GetDi|alogItem|
|00000940| 28 64 6c 67 50 74 72 2c | 20 69 74 65 6d 4e 6f 2c |(dlgPtr,| itemNo,|
|00000950| 20 26 69 4b 69 6e 64 2c | 20 26 69 48 61 6e 64 6c | &iKind,| &iHandl|
|00000960| 65 2c 20 26 69 52 65 63 | 74 29 3b 0d 09 53 65 74 |e, &iRec|t);..Set|
|00000970| 43 6f 6e 74 72 6f 6c 56 | 61 6c 75 65 28 28 43 6f |ControlV|alue((Co|
|00000980| 6e 74 72 6f 6c 48 61 6e | 64 6c 65 29 69 48 61 6e |ntrolHan|dle)iHan|
|00000990| 64 6c 65 2c 20 73 74 61 | 74 65 29 3b 0d 7d 0d 0d |dle, sta|te);.}..|
|000009a0| 63 68 61 72 09 4c 6f 63 | 6b 48 61 6e 64 6c 65 48 |char.Loc|kHandleH|
|000009b0| 69 67 68 28 48 61 6e 64 | 6c 65 20 74 68 65 48 61 |igh(Hand|le theHa|
|000009c0| 6e 64 6c 65 29 0d 7b 0d | 09 63 68 61 72 09 68 73 |ndle).{.|.char.hs|
|000009d0| 74 61 74 65 3b 0d 0d 09 | 68 73 74 61 74 65 20 3d |tate;...|hstate =|
|000009e0| 20 48 47 65 74 53 74 61 | 74 65 28 74 68 65 48 61 | HGetSta|te(theHa|
|000009f0| 6e 64 6c 65 29 3b 0d 09 | 4d 6f 76 65 48 48 69 28 |ndle);..|MoveHHi(|
|00000a00| 74 68 65 48 61 6e 64 6c | 65 29 3b 0d 09 48 4c 6f |theHandl|e);..HLo|
|00000a10| 63 6b 28 74 68 65 48 61 | 6e 64 6c 65 29 3b 0d 09 |ck(theHa|ndle);..|
|00000a20| 72 65 74 75 72 6e 28 68 | 73 74 61 74 65 29 3b 0d |return(h|state);.|
|00000a30| 7d 0d 0d 73 68 6f 72 74 | 09 47 65 74 48 65 78 42 |}..short|.GetHexB|
|00000a40| 79 74 65 28 63 68 61 72 | 20 2a 63 70 74 72 29 0d |yte(char| *cptr).|
|00000a50| 7b 0d 09 73 68 6f 72 74 | 09 76 61 6c 2c 20 69 2c |{..short|.val, i,|
|00000a60| 20 63 68 72 3b 0d 0d 09 | 66 6f 72 20 28 76 61 6c | chr;...|for (val|
|00000a70| 20 3d 20 30 2c 20 69 20 | 3d 20 30 3b 20 69 20 3c | = 0, i |= 0; i <|
|00000a80| 20 32 3b 20 2b 2b 69 29 | 20 7b 0d 09 09 63 68 72 | 2; ++i)| {...chr|
|00000a90| 20 3d 20 63 70 74 72 5b | 69 5d 3b 0d 09 09 69 66 | = cptr[|i];...if|
|00000aa0| 20 28 63 68 72 20 3d 3d | 20 27 3d 27 29 20 72 65 | (chr ==| '=') re|
|00000ab0| 74 75 72 6e 28 63 70 74 | 72 5b 2b 2b 69 5d 29 3b |turn(cpt|r[++i]);|
|00000ac0| 0d 09 09 69 66 20 28 63 | 68 72 20 3d 3d 20 27 c5 |...if (c|hr == '.|
|00000ad0| 27 29 20 7b 0d 09 09 09 | 63 68 72 20 3d 20 63 70 |') {....|chr = cp|
|00000ae0| 74 72 5b 2b 2b 69 5d 3b | 0d 09 09 09 69 66 20 28 |tr[++i];|....if (|
|00000af0| 28 63 68 72 20 3e 3d 20 | 27 61 27 29 20 26 26 20 |(chr >= |'a') && |
|00000b00| 28 63 68 72 20 3c 3d 20 | 27 7a 27 29 29 20 63 68 |(chr <= |'z')) ch|
|00000b10| 72 20 2d 3d 20 33 32 3b | 0d 09 09 09 72 65 74 75 |r -= 32;|....retu|
|00000b20| 72 6e 28 63 68 72 29 3b | 0d 09 09 7d 0d 09 09 69 |rn(chr);|...}...i|
|00000b30| 66 20 28 63 68 72 20 3e | 20 27 46 27 29 0d 09 09 |f (chr >| 'F')...|
|00000b40| 09 63 68 72 20 2d 3d 20 | 30 78 32 30 3b 0d 09 09 |.chr -= |0x20;...|
|00000b50| 69 66 20 28 63 68 72 20 | 3e 20 27 39 27 29 0d 09 |if (chr |> '9')..|
|00000b60| 09 09 63 68 72 20 2d 3d | 20 28 27 41 27 20 2d 20 |..chr -=| ('A' - |
|00000b70| 27 39 27 20 2d 20 31 29 | 3b 0d 09 09 76 61 6c 20 |'9' - 1)|;...val |
|00000b80| 3d 20 28 76 61 6c 20 3c | 3c 20 34 29 20 2b 20 63 |= (val <|< 4) + c|
|00000b90| 68 72 20 2d 20 27 30 27 | 3b 0d 09 7d 0d 09 72 65 |hr - '0'|;..}..re|
|00000ba0| 74 75 72 6e 28 76 61 6c | 29 3b 0d 7d 0d 0d 76 6f |turn(val|);.}..vo|
|00000bb0| 69 64 09 4f 75 74 6c 69 | 6e 65 44 69 61 6c 6f 67 |id.Outli|neDialog|
|00000bc0| 49 74 65 6d 28 44 69 61 | 6c 6f 67 50 74 72 20 64 |Item(Dia|logPtr d|
|00000bd0| 6c 67 50 74 72 2c 20 73 | 68 6f 72 74 20 69 74 65 |lgPtr, s|hort ite|
|00000be0| 6d 29 0d 7b 0d 09 73 68 | 6f 72 74 09 69 4b 69 6e |m).{..sh|ort.iKin|
|00000bf0| 64 3b 0d 09 48 61 6e 64 | 6c 65 09 69 48 61 6e 64 |d;..Hand|le.iHand|
|00000c00| 6c 65 3b 0d 09 52 65 63 | 74 09 69 52 65 63 74 3b |le;..Rec|t.iRect;|
|00000c10| 0d 0d 09 47 65 74 44 69 | 61 6c 6f 67 49 74 65 6d |...GetDi|alogItem|
|00000c20| 28 64 6c 67 50 74 72 2c | 20 69 74 65 6d 2c 20 26 |(dlgPtr,| item, &|
|00000c30| 69 4b 69 6e 64 2c 20 26 | 69 48 61 6e 64 6c 65 2c |iKind, &|iHandle,|
|00000c40| 20 26 69 52 65 63 74 29 | 3b 0d 09 4f 75 74 6c 69 | &iRect)|;..Outli|
|00000c50| 6e 65 43 6f 6e 74 72 6f | 6c 28 28 43 6f 6e 74 72 |neContro|l((Contr|
|00000c60| 6f 6c 48 61 6e 64 6c 65 | 29 20 69 48 61 6e 64 6c |olHandle|) iHandl|
|00000c70| 65 29 3b 0d 7d 0d 0d 2f | 2a 20 47 69 76 65 6e 20 |e);.}../|* Given |
|00000c80| 61 6e 79 20 63 6f 6e 74 | 72 6f 6c 20 68 61 6e 64 |any cont|rol hand|
|00000c90| 6c 65 2c 20 74 68 69 73 | 20 77 69 6c 6c 20 64 72 |le, this| will dr|
|00000ca0| 61 77 20 61 6e 20 6f 75 | 74 6c 69 6e 65 20 61 72 |aw an ou|tline ar|
|00000cb0| 6f 75 6e 64 20 69 74 2e | 20 20 54 68 69 73 20 69 |ound it.| This i|
|00000cc0| 73 20 75 73 65 64 0d 2a | 2a 20 66 6f 72 20 74 68 |s used.*|* for th|
|00000cd0| 65 20 64 65 66 61 75 6c | 74 20 62 75 74 74 6f 6e |e defaul|t button|
|00000ce0| 20 6f 66 20 61 20 77 69 | 6e 64 6f 77 2e 20 20 54 | of a wi|ndow. T|
|00000cf0| 68 65 20 65 78 74 72 61 | 20 6e 69 63 65 20 66 65 |he extra| nice fe|
|00000d00| 61 74 75 72 65 20 68 65 | 72 65 20 69 73 20 74 68 |ature he|re is th|
|00000d10| 61 74 0d 2a 2a 20 49 d5 | 6c 6c 20 65 72 61 73 65 |at.** I.|ll erase|
|00000d20| 20 74 68 65 20 6f 75 74 | 6c 69 6e 65 20 66 6f 72 | the out|line for|
|00000d30| 20 62 75 74 74 6f 6e 73 | 20 74 68 61 74 20 61 72 | buttons| that ar|
|00000d40| 65 20 69 6e 61 63 74 69 | 76 65 2e 20 20 53 65 65 |e inacti|ve. See|
|00000d50| 6d 73 20 6c 69 6b 65 20 | 74 68 65 72 65 0d 2a 2a |ms like |there.**|
|00000d60| 20 73 68 6f 75 6c 64 20 | 62 65 20 61 20 54 6f 6f | should |be a Too|
|00000d70| 6c 62 6f 78 20 63 61 6c | 6c 20 66 6f 72 20 67 65 |lbox cal|l for ge|
|00000d80| 74 74 69 6e 67 20 61 20 | 63 6f 6e 74 72 6f 6c d5 |tting a |control.|
|00000d90| 73 20 68 69 6c 69 74 65 | 20 73 74 61 74 65 2e 20 |s hilite| state. |
|00000da0| 20 53 69 6e 63 65 20 74 | 68 65 72 65 0d 2a 2a 20 | Since t|here.** |
|00000db0| 69 73 6e d5 74 2c 20 49 | 20 68 61 76 65 20 74 6f |isn.t, I| have to|
|00000dc0| 20 6c 6f 6f 6b 20 69 6e | 74 6f 20 74 68 65 20 63 | look in|to the c|
|00000dd0| 6f 6e 74 72 6f 6c 20 72 | 65 63 6f 72 64 20 6d 79 |ontrol r|ecord my|
|00000de0| 73 65 6c 66 2e 20 20 54 | 68 69 73 20 73 68 6f 75 |self. T|his shou|
|00000df0| 6c 64 20 62 65 20 63 61 | 6c 6c 65 64 0d 2a 2a 20 |ld be ca|lled.** |
|00000e00| 66 6f 72 20 75 70 64 61 | 74 65 20 61 6e 64 20 61 |for upda|te and a|
|00000e10| 63 74 69 76 61 74 65 20 | 65 76 65 6e 74 73 2e 0d |ctivate |events..|
|00000e20| 2a 2a 0d 2a 2a 20 54 68 | 65 20 6d 65 74 68 6f 64 |**.** Th|e method|
|00000e30| 20 66 6f 72 20 64 65 74 | 65 72 6d 69 6e 69 6e 67 | for det|ermining|
|00000e40| 20 74 68 65 20 6f 76 61 | 6c 20 64 69 61 6d 65 74 | the ova|l diamet|
|00000e50| 65 72 73 20 66 6f 72 20 | 74 68 65 20 72 6f 75 6e |ers for |the roun|
|00000e60| 64 72 65 63 74 20 69 73 | 20 61 20 6c 69 74 74 6c |drect is| a littl|
|00000e70| 65 0d 2a 2a 20 64 69 66 | 66 65 72 65 6e 74 20 74 |e.** dif|ferent t|
|00000e80| 68 61 6e 20 74 68 61 74 | 20 72 65 63 6f 6d 6d 65 |han that| recomme|
|00000e90| 6e 64 65 64 20 62 79 20 | 49 6e 73 69 64 65 20 4d |nded by |Inside M|
|00000ea0| 61 63 2e 20 49 4d 20 49 | 2d 34 30 37 20 73 75 67 |ac. IM I|-407 sug|
|00000eb0| 67 65 73 74 73 20 74 68 | 61 74 20 79 6f 75 0d 2a |gests th|at you.*|
|00000ec0| 2a 20 75 73 65 20 61 20 | 68 61 72 64 63 6f 64 65 |* use a |hardcode|
|00000ed0| 64 20 28 31 36 2c 31 36 | 29 20 66 6f 72 20 74 68 |d (16,16|) for th|
|00000ee0| 65 20 64 69 61 6d 65 74 | 65 72 73 2e 20 20 48 6f |e diamet|ers. Ho|
|00000ef0| 77 65 76 65 72 2c 20 74 | 68 69 73 20 6f 6e 6c 79 |wever, t|his only|
|00000f00| 20 6c 6f 6f 6b 73 20 67 | 6f 6f 64 0d 2a 2a 20 66 | looks g|ood.** f|
|00000f10| 6f 72 20 73 6d 61 6c 6c | 20 72 6f 75 6e 64 72 65 |or small| roundre|
|00000f20| 63 74 73 2e 20 20 46 6f | 72 20 6c 61 72 67 65 72 |cts. Fo|r larger|
|00000f30| 20 6f 6e 65 73 2c 20 74 | 68 65 20 6f 75 74 6c 69 | ones, t|he outli|
|00000f40| 6e 65 20 64 6f 65 73 6e | d5 74 20 66 6f 6c 6c 6f |ne doesn|.t follo|
|00000f50| 77 20 74 68 65 20 69 6e | 6e 65 72 0d 2a 2a 20 72 |w the in|ner.** r|
|00000f60| 6f 75 6e 64 72 65 63 74 | 20 62 65 63 61 75 73 65 |oundrect| because|
|00000f70| 20 74 68 65 20 43 44 45 | 46 20 66 6f 72 20 73 69 | the CDE|F for si|
|00000f80| 6d 70 6c 65 20 62 75 74 | 74 6f 6e 73 20 64 6f 65 |mple but|tons doe|
|00000f90| 73 6e d5 74 20 75 73 65 | 20 28 31 36 2c 31 36 29 |sn.t use| (16,16)|
|00000fa0| 2e 20 20 49 6e 73 74 65 | 61 64 2c 0d 2a 2a 20 69 |. Inste|ad,.** i|
|00000fb0| 74 20 75 73 65 73 20 68 | 61 6c 66 20 74 68 65 20 |t uses h|alf the |
|00000fc0| 68 65 69 67 68 74 20 6f | 66 20 74 68 65 20 62 75 |height o|f the bu|
|00000fd0| 74 74 6f 6e 20 61 73 20 | 74 68 65 20 64 69 61 6d |tton as |the diam|
|00000fe0| 65 74 65 72 2e 20 20 42 | 79 20 75 73 69 6e 67 20 |eter. B|y using |
|00000ff0| 74 68 69 73 0d 2a 2a 20 | 66 6f 72 6d 75 6c 61 2c |this.** |formula,|
|00001000| 20 74 6f 6f 2c 20 6f 75 | 72 20 6f 75 74 6c 69 6e | too, ou|r outlin|
|00001010| 65 73 20 6c 6f 6f 6b 20 | 62 65 74 74 65 72 2e 20 |es look |better. |
|00001020| 2a 2f 0d 0d 76 6f 69 64 | 09 4f 75 74 6c 69 6e 65 |*/..void|.Outline|
|00001030| 43 6f 6e 74 72 6f 6c 28 | 43 6f 6e 74 72 6f 6c 48 |Control(|ControlH|
|00001040| 61 6e 64 6c 65 20 62 75 | 74 74 6f 6e 29 0d 7b 0d |andle bu|tton).{.|
|00001050| 09 57 69 6e 64 6f 77 50 | 74 72 09 6f 6c 64 50 6f |.WindowP|tr.oldPo|
|00001060| 72 74 3b 0d 09 52 65 63 | 74 09 09 74 68 65 52 65 |rt;..Rec|t..theRe|
|00001070| 63 74 3b 0d 09 50 65 6e | 53 74 61 74 65 09 63 75 |ct;..Pen|State.cu|
|00001080| 72 50 65 6e 3b 0d 09 73 | 68 6f 72 74 09 09 62 75 |rPen;..s|hort..bu|
|00001090| 74 74 6f 6e 4f 76 61 6c | 3b 0d 09 52 67 6e 48 61 |ttonOval|;..RgnHa|
|000010a0| 6e 64 6c 65 09 6f 6c 64 | 43 6c 69 70 2c 20 6e 65 |ndle.old|Clip, ne|
|000010b0| 77 43 6c 69 70 3b 0d 09 | 52 47 42 43 6f 6c 6f 72 |wClip;..|RGBColor|
|000010c0| 09 6f 6c 64 72 67 62 3b | 0d 0d 09 73 74 61 74 69 |.oldrgb;|...stati|
|000010d0| 63 20 52 47 42 43 6f 6c | 6f 72 09 77 68 69 74 65 |c RGBCol|or.white|
|000010e0| 72 67 62 20 3d 20 7b 30 | 78 46 46 46 46 2c 20 30 |rgb = {0|xFFFF, 0|
|000010f0| 78 46 46 46 46 2c 20 30 | 78 46 46 46 46 7d 3b 0d |xFFFF, 0|xFFFF};.|
|00001100| 09 73 74 61 74 69 63 20 | 52 47 42 43 6f 6c 6f 72 |.static |RGBColor|
|00001110| 09 67 72 61 79 72 67 62 | 20 20 3d 20 7b 30 78 38 |.grayrgb| = {0x8|
|00001120| 30 30 30 2c 20 30 78 38 | 30 30 30 2c 20 30 78 38 |000, 0x8|000, 0x8|
|00001130| 30 30 30 7d 3b 0d 09 73 | 74 61 74 69 63 20 52 47 |000};..s|tatic RG|
|00001140| 42 43 6f 6c 6f 72 09 62 | 6c 61 63 6b 72 67 62 20 |BColor.b|lackrgb |
|00001150| 3d 20 7b 30 78 30 30 30 | 30 2c 20 30 78 30 30 30 |= {0x000|0, 0x000|
|00001160| 30 2c 20 30 78 30 30 30 | 30 7d 3b 0d 0d 09 69 66 |0, 0x000|0};...if|
|00001170| 20 28 62 75 74 74 6f 6e | 29 20 7b 0d 09 09 69 66 | (button|) {...if|
|00001180| 20 28 28 2a 62 75 74 74 | 6f 6e 29 2d 3e 63 6f 6e | ((*butt|on)->con|
|00001190| 74 72 6c 56 69 73 29 20 | 7b 0d 09 09 09 47 65 74 |trlVis) |{....Get|
|000011a0| 50 6f 72 74 28 26 6f 6c | 64 50 6f 72 74 29 3b 0d |Port(&ol|dPort);.|
|000011b0| 09 09 09 53 65 74 50 6f | 72 74 28 28 2a 62 75 74 |...SetPo|rt((*but|
|000011c0| 74 6f 6e 29 2d 3e 63 6f | 6e 74 72 6c 4f 77 6e 65 |ton)->co|ntrlOwne|
|000011d0| 72 29 3b 0d 09 09 09 47 | 65 74 50 65 6e 53 74 61 |r);....G|etPenSta|
|000011e0| 74 65 28 26 63 75 72 50 | 65 6e 29 3b 0d 09 09 09 |te(&curP|en);....|
|000011f0| 50 65 6e 4e 6f 72 6d 61 | 6c 28 29 3b 0d 09 09 09 |PenNorma|l();....|
|00001200| 50 65 6e 53 69 7a 65 28 | 6b 42 75 74 74 6f 6e 46 |PenSize(|kButtonF|
|00001210| 72 61 6d 65 53 69 7a 65 | 2c 20 6b 42 75 74 74 6f |rameSize|, kButto|
|00001220| 6e 46 72 61 6d 65 53 69 | 7a 65 29 3b 0d 0d 09 09 |nFrameSi|ze);....|
|00001230| 09 74 68 65 52 65 63 74 | 20 3d 20 28 2a 62 75 74 |.theRect| = (*but|
|00001240| 74 6f 6e 29 2d 3e 63 6f | 6e 74 72 6c 52 65 63 74 |ton)->co|ntrlRect|
|00001250| 3b 0d 09 09 09 49 6e 73 | 65 74 52 65 63 74 28 26 |;....Ins|etRect(&|
|00001260| 74 68 65 52 65 63 74 2c | 20 6b 42 75 74 74 6f 6e |theRect,| kButton|
|00001270| 46 72 61 6d 65 49 6e 73 | 65 74 2c 20 6b 42 75 74 |FrameIns|et, kBut|
|00001280| 74 6f 6e 46 72 61 6d 65 | 49 6e 73 65 74 29 3b 0d |tonFrame|Inset);.|
|00001290| 09 09 09 62 75 74 74 6f | 6e 4f 76 61 6c 20 3d 20 |...butto|nOval = |
|000012a0| 28 74 68 65 52 65 63 74 | 2e 62 6f 74 74 6f 6d 20 |(theRect|.bottom |
|000012b0| 2d 20 74 68 65 52 65 63 | 74 2e 74 6f 70 29 20 2f |- theRec|t.top) /|
|000012c0| 20 32 20 2b 20 32 3b 0d | 0d 09 09 09 47 65 74 43 | 2 + 2;.|....GetC|
|000012d0| 6c 69 70 28 6f 6c 64 43 | 6c 69 70 20 3d 20 4e 65 |lip(oldC|lip = Ne|
|000012e0| 77 52 67 6e 28 29 29 3b | 0d 09 09 09 6e 65 77 43 |wRgn());|....newC|
|000012f0| 6c 69 70 20 3d 20 4c 6f | 63 61 6c 53 63 72 65 65 |lip = Lo|calScree|
|00001300| 6e 44 65 70 74 68 52 65 | 67 69 6f 6e 28 34 29 3b |nDepthRe|gion(4);|
|00001310| 0d 09 09 09 53 65 63 74 | 52 67 6e 28 6f 6c 64 43 |....Sect|Rgn(oldC|
|00001320| 6c 69 70 2c 20 6e 65 77 | 43 6c 69 70 2c 20 6e 65 |lip, new|Clip, ne|
|00001330| 77 43 6c 69 70 29 3b 0d | 09 09 09 53 65 74 43 6c |wClip);.|...SetCl|
|00001340| 69 70 28 6e 65 77 43 6c | 69 70 29 3b 0d 0d 09 09 |ip(newCl|ip);....|
|00001350| 09 69 66 20 28 21 45 6d | 70 74 79 52 67 6e 28 6e |.if (!Em|ptyRgn(n|
|00001360| 65 77 43 6c 69 70 29 29 | 20 7b 0d 09 09 09 09 47 |ewClip))| {.....G|
|00001370| 65 74 46 6f 72 65 43 6f | 6c 6f 72 28 26 6f 6c 64 |etForeCo|lor(&old|
|00001380| 72 67 62 29 3b 0d 09 09 | 09 09 73 77 69 74 63 68 |rgb);...|..switch|
|00001390| 20 28 28 2a 62 75 74 74 | 6f 6e 29 2d 3e 63 6f 6e | ((*butt|on)->con|
|000013a0| 74 72 6c 48 69 6c 69 74 | 65 29 20 7b 0d 09 09 09 |trlHilit|e) {....|
|000013b0| 09 09 63 61 73 65 20 6b | 43 6e 74 6c 41 63 74 69 |..case k|CntlActi|
|000013c0| 76 61 74 65 3a 0d 09 09 | 09 09 09 09 52 47 42 46 |vate:...|....RGBF|
|000013d0| 6f 72 65 43 6f 6c 6f 72 | 28 26 62 6c 61 63 6b 72 |oreColor|(&blackr|
|000013e0| 67 62 29 3b 0d 09 09 09 | 09 09 09 62 72 65 61 6b |gb);....|...break|
|000013f0| 3b 0d 09 09 09 09 09 63 | 61 73 65 20 6b 43 6e 74 |;......c|ase kCnt|
|00001400| 6c 44 65 61 63 74 69 76 | 61 74 65 3a 0d 09 09 09 |lDeactiv|ate:....|
|00001410| 09 09 09 52 47 42 46 6f | 72 65 43 6f 6c 6f 72 28 |...RGBFo|reColor(|
|00001420| 26 67 72 61 79 72 67 62 | 29 3b 0d 09 09 09 09 09 |&grayrgb|);......|
|00001430| 09 62 72 65 61 6b 3b 0d | 09 09 09 09 09 64 65 66 |.break;.|.....def|
|00001440| 61 75 6c 74 3a 0d 09 09 | 09 09 09 09 52 47 42 46 |ault:...|....RGBF|
|00001450| 6f 72 65 43 6f 6c 6f 72 | 28 26 77 68 69 74 65 72 |oreColor|(&whiter|
|00001460| 67 62 29 3b 0d 09 09 09 | 09 09 09 62 72 65 61 6b |gb);....|...break|
|00001470| 3b 0d 09 09 09 09 7d 0d | 09 09 09 09 46 72 61 6d |;.....}.|....Fram|
|00001480| 65 52 6f 75 6e 64 52 65 | 63 74 28 26 74 68 65 52 |eRoundRe|ct(&theR|
|00001490| 65 63 74 2c 20 62 75 74 | 74 6f 6e 4f 76 61 6c 2c |ect, but|tonOval,|
|000014a0| 20 62 75 74 74 6f 6e 4f | 76 61 6c 29 3b 0d 09 09 | buttonO|val);...|
|000014b0| 09 09 52 47 42 46 6f 72 | 65 43 6f 6c 6f 72 28 26 |..RGBFor|eColor(&|
|000014c0| 6f 6c 64 72 67 62 29 3b | 0d 09 09 09 7d 0d 0d 09 |oldrgb);|....}...|
|000014d0| 09 09 44 69 66 66 52 67 | 6e 28 6f 6c 64 43 6c 69 |..DiffRg|n(oldCli|
|000014e0| 70 2c 20 6e 65 77 43 6c | 69 70 2c 20 6e 65 77 43 |p, newCl|ip, newC|
|000014f0| 6c 69 70 29 3b 0d 09 09 | 09 53 65 74 43 6c 69 70 |lip);...|.SetClip|
|00001500| 28 6e 65 77 43 6c 69 70 | 29 3b 0d 09 09 09 69 66 |(newClip|);....if|
|00001510| 20 28 21 45 6d 70 74 79 | 52 67 6e 28 6e 65 77 43 | (!Empty|Rgn(newC|
|00001520| 6c 69 70 29 29 20 7b 0d | 09 09 09 09 73 77 69 74 |lip)) {.|....swit|
|00001530| 63 68 20 28 28 2a 62 75 | 74 74 6f 6e 29 2d 3e 63 |ch ((*bu|tton)->c|
|00001540| 6f 6e 74 72 6c 48 69 6c | 69 74 65 29 20 7b 0d 09 |ontrlHil|ite) {..|
|00001550| 09 09 09 09 63 61 73 65 | 20 6b 43 6e 74 6c 41 63 |....case| kCntlAc|
|00001560| 74 69 76 61 74 65 3a 0d | 09 09 09 09 09 09 50 65 |tivate:.|......Pe|
|00001570| 6e 50 61 74 28 28 43 6f | 6e 73 74 50 61 74 74 65 |nPat((Co|nstPatte|
|00001580| 72 6e 50 61 72 61 6d 29 | 26 71 64 2e 62 6c 61 63 |rnParam)|&qd.blac|
|00001590| 6b 29 3b 0d 09 09 09 09 | 09 09 62 72 65 61 6b 3b |k);.....|..break;|
|000015a0| 0d 09 09 09 09 09 63 61 | 73 65 20 6b 43 6e 74 6c |......ca|se kCntl|
|000015b0| 44 65 61 63 74 69 76 61 | 74 65 3a 0d 09 09 09 09 |Deactiva|te:.....|
|000015c0| 09 09 50 65 6e 50 61 74 | 28 28 43 6f 6e 73 74 50 |..PenPat|((ConstP|
|000015d0| 61 74 74 65 72 6e 50 61 | 72 61 6d 29 26 71 64 2e |atternPa|ram)&qd.|
|000015e0| 67 72 61 79 29 3b 0d 09 | 09 09 09 09 09 62 72 65 |gray);..|.....bre|
|000015f0| 61 6b 3b 0d 09 09 09 09 | 09 64 65 66 61 75 6c 74 |ak;.....|.default|
|00001600| 3a 0d 09 09 09 09 09 09 | 50 65 6e 50 61 74 28 28 |:.......|PenPat((|
|00001610| 43 6f 6e 73 74 50 61 74 | 74 65 72 6e 50 61 72 61 |ConstPat|ternPara|
|00001620| 6d 29 26 71 64 2e 77 68 | 69 74 65 29 3b 0d 09 09 |m)&qd.wh|ite);...|
|00001630| 09 09 09 09 62 72 65 61 | 6b 3b 0d 09 09 09 09 7d |....brea|k;.....}|
|00001640| 0d 09 09 09 09 46 72 61 | 6d 65 52 6f 75 6e 64 52 |.....Fra|meRoundR|
|00001650| 65 63 74 28 26 74 68 65 | 52 65 63 74 2c 20 62 75 |ect(&the|Rect, bu|
|00001660| 74 74 6f 6e 4f 76 61 6c | 2c 20 62 75 74 74 6f 6e |ttonOval|, button|
|00001670| 4f 76 61 6c 29 3b 0d 09 | 09 09 7d 0d 0d 09 09 09 |Oval);..|..}.....|
|00001680| 53 65 74 43 6c 69 70 28 | 6f 6c 64 43 6c 69 70 29 |SetClip(|oldClip)|
|00001690| 3b 0d 09 09 09 44 69 73 | 70 6f 73 65 52 67 6e 28 |;....Dis|poseRgn(|
|000016a0| 6f 6c 64 43 6c 69 70 29 | 3b 0d 09 09 09 44 69 73 |oldClip)|;....Dis|
|000016b0| 70 6f 73 65 52 67 6e 28 | 6e 65 77 43 6c 69 70 29 |poseRgn(|newClip)|
|000016c0| 3b 0d 0d 09 09 09 53 65 | 74 50 65 6e 53 74 61 74 |;.....Se|tPenStat|
|000016d0| 65 28 26 63 75 72 50 65 | 6e 29 3b 0d 09 09 09 53 |e(&curPe|n);....S|
|000016e0| 65 74 50 6f 72 74 28 6f | 6c 64 50 6f 72 74 29 3b |etPort(o|ldPort);|
|000016f0| 0d 09 09 7d 0d 09 7d 0d | 7d 0d 0d 2f 2a 20 47 69 |...}..}.|}../* Gi|
|00001700| 76 65 6e 20 61 20 64 69 | 61 6c 6f 67 20 49 44 20 |ven a di|alog ID |
|00001710| 61 6e 64 20 61 20 77 69 | 6e 64 6f 77 20 70 6f 69 |and a wi|ndow poi|
|00001720| 6e 74 65 72 20 74 68 65 | 20 64 69 61 6c 6f 67 20 |nter the| dialog |
|00001730| 72 65 6c 61 74 65 73 20 | 74 6f 2c 20 74 68 69 73 |relates |to, this|
|00001740| 20 66 75 6e 63 74 69 6f | 6e 0d 2a 2a 20 77 69 6c | functio|n.** wil|
|00001750| 6c 20 63 65 6e 74 65 72 | 20 74 68 65 20 64 69 61 |l center| the dia|
|00001760| 6c 6f 67 d5 73 20 72 65 | 63 74 61 6e 67 6c 65 20 |log.s re|ctangle |
|00001770| 62 65 66 6f 72 65 20 73 | 68 6f 77 69 6e 67 20 69 |before s|howing i|
|00001780| 74 20 6f 6e 20 74 68 65 | 20 70 72 6f 70 65 72 20 |t on the| proper |
|00001790| 73 63 72 65 65 6e 2e 0d | 2a 2a 20 54 68 69 73 20 |screen..|** This |
|000017a0| 66 6f 6c 6c 6f 77 73 20 | 74 68 65 20 41 70 70 6c |follows |the Appl|
|000017b0| 65 20 48 75 6d 61 6e 20 | 49 6e 74 65 72 66 61 63 |e Human |Interfac|
|000017c0| 65 20 47 75 69 64 65 6c | 69 6e 65 73 20 66 6f 72 |e Guidel|ines for|
|000017d0| 20 77 68 65 72 65 20 74 | 6f 20 70 6c 61 63 65 20 | where t|o place |
|000017e0| 61 0d 2a 2a 20 63 65 6e | 74 65 72 65 64 20 77 69 |a.** cen|tered wi|
|000017f0| 6e 64 6f 77 20 6f 6e 20 | 74 68 65 20 73 63 72 65 |ndow on |the scre|
|00001800| 65 6e 2e 20 20 49 66 20 | 74 68 65 20 64 69 61 6c |en. If |the dial|
|00001810| 6f 67 20 69 73 20 6e 6f | 74 20 63 6c 6f 73 65 6c |og is no|t closel|
|00001820| 79 20 61 73 73 6f 63 69 | 61 74 65 64 20 77 69 74 |y associ|ated wit|
|00001830| 68 0d 2a 2a 20 61 6e 6f | 74 68 65 72 20 77 69 6e |h.** ano|ther win|
|00001840| 64 6f 77 2c 20 70 61 73 | 73 20 61 20 6e 69 6c 20 |dow, pas|s a nil |
|00001850| 66 6f 72 20 74 68 65 20 | 77 69 6e 64 6f 77 20 70 |for the |window p|
|00001860| 6f 69 6e 74 65 72 20 6f | 66 20 74 68 65 20 72 65 |ointer o|f the re|
|00001870| 6c 61 74 65 64 20 77 69 | 6e 64 6f 77 2e 20 20 49 |lated wi|ndow. I|
|00001880| 66 0d 2a 2a 20 79 6f 75 | 20 70 61 73 73 20 61 20 |f.** you| pass a |
|00001890| 6e 69 6c 2c 20 74 68 65 | 20 64 69 61 6c 6f 67 20 |nil, the| dialog |
|000018a0| 69 73 20 73 69 6d 70 6c | 79 20 64 69 73 70 6c 61 |is simpl|y displa|
|000018b0| 79 65 64 20 77 68 65 72 | 65 20 74 68 65 20 72 65 |yed wher|e the re|
|000018c0| 73 6f 75 72 63 65 0d 2a | 2a 20 77 6f 75 6c 64 20 |source.*|* would |
|000018d0| 69 6e 64 69 63 61 74 65 | 2e 20 2a 2f 0d 0d 44 69 |indicate|. */..Di|
|000018e0| 61 6c 6f 67 50 74 72 09 | 47 65 74 43 65 6e 74 65 |alogPtr.|GetCente|
|000018f0| 72 65 64 44 69 61 6c 6f | 67 28 73 68 6f 72 74 20 |redDialo|g(short |
|00001900| 69 64 2c 20 44 69 61 6c | 6f 67 50 74 72 20 73 74 |id, Dial|ogPtr st|
|00001910| 6f 72 61 67 65 2c 20 57 | 69 6e 64 6f 77 50 74 72 |orage, W|indowPtr|
|00001920| 20 72 65 6c 61 74 65 64 | 57 69 6e 64 6f 77 2c 20 | related|Window, |
|00001930| 57 69 6e 64 6f 77 50 74 | 72 20 62 65 68 69 6e 64 |WindowPt|r behind|
|00001940| 29 0d 7b 0d 09 44 69 61 | 6c 6f 67 54 48 6e 64 6c |).{..Dia|logTHndl|
|00001950| 09 64 6c 6f 67 52 65 73 | 6f 75 72 63 65 3b 0d 09 |.dlogRes|ource;..|
|00001960| 44 69 61 6c 6f 67 50 74 | 72 09 64 69 61 6c 6f 67 |DialogPt|r.dialog|
|00001970| 3b 0d 09 42 6f 6f 6c 65 | 61 6e 09 09 6f 6c 64 56 |;..Boole|an..oldV|
|00001980| 69 73 3b 0d 09 63 68 61 | 72 09 09 68 73 74 61 74 |is;..cha|r..hstat|
|00001990| 65 3b 0d 09 4f 53 45 72 | 72 09 09 65 72 72 3b 0d |e;..OSEr|r..err;.|
|000019a0| 09 52 65 63 74 09 09 73 | 69 7a 65 49 6e 66 6f 3b |.Rect..s|izeInfo;|
|000019b0| 0d 0d 09 64 69 61 6c 6f | 67 20 3d 20 6e 69 6c 3b |...dialo|g = nil;|
|000019c0| 0d 09 69 66 20 28 21 53 | 69 6d 70 6c 65 43 61 6e |..if (!S|impleCan|
|000019d0| 44 69 61 6c 6f 67 28 29 | 29 20 7b 0d 09 09 64 6c |Dialog()|) {...dl|
|000019e0| 6f 67 52 65 73 6f 75 72 | 63 65 20 3d 20 28 44 69 |ogResour|ce = (Di|
|000019f0| 61 6c 6f 67 54 48 6e 64 | 6c 29 47 65 74 41 70 70 |alogTHnd|l)GetApp|
|00001a00| 52 65 73 6f 75 72 63 65 | 28 27 44 4c 4f 47 27 2c |Resource|('DLOG',|
|00001a10| 20 69 64 2c 20 26 65 72 | 72 29 3b 0d 09 09 69 66 | id, &er|r);...if|
|00001a20| 20 28 64 6c 6f 67 52 65 | 73 6f 75 72 63 65 29 20 | (dlogRe|source) |
|00001a30| 7b 0d 09 09 09 68 73 74 | 61 74 65 20 3d 20 4c 6f |{....hst|ate = Lo|
|00001a40| 63 6b 48 61 6e 64 6c 65 | 48 69 67 68 28 28 48 61 |ckHandle|High((Ha|
|00001a50| 6e 64 6c 65 29 64 6c 6f | 67 52 65 73 6f 75 72 63 |ndle)dlo|gResourc|
|00001a60| 65 29 3b 0d 09 09 09 6f | 6c 64 56 69 73 20 3d 20 |e);....o|ldVis = |
|00001a70| 28 2a 64 6c 6f 67 52 65 | 73 6f 75 72 63 65 29 2d |(*dlogRe|source)-|
|00001a80| 3e 76 69 73 69 62 6c 65 | 3b 0d 09 09 09 28 2a 64 |>visible|;....(*d|
|00001a90| 6c 6f 67 52 65 73 6f 75 | 72 63 65 29 2d 3e 76 69 |logResou|rce)->vi|
|00001aa0| 73 69 62 6c 65 20 3d 20 | 66 61 6c 73 65 3b 0d 09 |sible = |false;..|
|00001ab0| 09 09 64 69 61 6c 6f 67 | 20 3d 20 47 65 74 4e 65 |..dialog| = GetNe|
|00001ac0| 77 44 69 61 6c 6f 67 28 | 69 64 2c 20 73 74 6f 72 |wDialog(|id, stor|
|00001ad0| 61 67 65 2c 20 62 65 68 | 69 6e 64 29 3b 0d 09 09 |age, beh|ind);...|
|00001ae0| 09 69 66 20 28 64 69 61 | 6c 6f 67 29 20 7b 0d 09 |.if (dia|log) {..|
|00001af0| 09 09 09 53 65 74 52 65 | 63 74 28 26 73 69 7a 65 |...SetRe|ct(&size|
|00001b00| 49 6e 66 6f 2c 20 30 2c | 20 30 2c 20 30 2c 20 30 |Info, 0,| 0, 0, 0|
|00001b10| 29 3b 0d 09 09 09 09 43 | 65 6e 74 65 72 57 69 6e |);.....C|enterWin|
|00001b20| 64 6f 77 28 64 69 61 6c | 6f 67 2c 20 72 65 6c 61 |dow(dial|og, rela|
|00001b30| 74 65 64 57 69 6e 64 6f | 77 2c 20 73 69 7a 65 49 |tedWindo|w, sizeI|
|00001b40| 6e 66 6f 29 3b 0d 09 09 | 09 09 69 66 20 28 6f 6c |nfo);...|..if (ol|
|00001b50| 64 56 69 73 29 0d 09 09 | 09 09 09 53 68 6f 77 57 |dVis)...|...ShowW|
|00001b60| 69 6e 64 6f 77 28 64 69 | 61 6c 6f 67 29 3b 0d 09 |indow(di|alog);..|
|00001b70| 09 09 7d 0d 09 09 09 64 | 6c 6f 67 52 65 73 6f 75 |..}....d|logResou|
|00001b80| 72 63 65 20 3d 20 28 44 | 69 61 6c 6f 67 54 48 6e |rce = (D|ialogTHn|
|00001b90| 64 6c 29 47 65 74 41 70 | 70 52 65 73 6f 75 72 63 |dl)GetAp|pResourc|
|00001ba0| 65 28 27 44 4c 4f 47 27 | 2c 20 69 64 2c 20 26 65 |e('DLOG'|, id, &e|
|00001bb0| 72 72 29 3b 0d 09 09 09 | 69 66 20 28 64 6c 6f 67 |rr);....|if (dlog|
|00001bc0| 52 65 73 6f 75 72 63 65 | 29 20 7b 0d 09 09 09 09 |Resource|) {.....|
|00001bd0| 28 2a 64 6c 6f 67 52 65 | 73 6f 75 72 63 65 29 2d |(*dlogRe|source)-|
|00001be0| 3e 76 69 73 69 62 6c 65 | 20 3d 20 6f 6c 64 56 69 |>visible| = oldVi|
|00001bf0| 73 3b 0d 09 09 09 09 48 | 53 65 74 53 74 61 74 65 |s;.....H|SetState|
|00001c00| 28 28 48 61 6e 64 6c 65 | 29 64 6c 6f 67 52 65 73 |((Handle|)dlogRes|
|00001c10| 6f 75 72 63 65 2c 20 68 | 73 74 61 74 65 29 3b 0d |ource, h|state);.|
|00001c20| 09 09 09 7d 0d 09 09 7d | 0d 09 7d 0d 09 72 65 74 |...}...}|..}..ret|
|00001c30| 75 72 6e 28 64 69 61 6c | 6f 67 29 3b 0d 7d 0d 0d |urn(dial|og);.}..|
|00001c40| 2f 2a 20 43 65 6e 74 65 | 72 20 61 20 77 69 6e 64 |/* Cente|r a wind|
|00001c50| 6f 77 20 77 69 74 68 69 | 6e 20 61 20 70 61 72 74 |ow withi|n a part|
|00001c60| 69 63 75 6c 61 72 20 64 | 65 76 69 63 65 2e 20 20 |icular d|evice. |
|00001c70| 54 68 65 20 64 65 76 69 | 63 65 20 74 6f 20 63 65 |The devi|ce to ce|
|00001c80| 6e 74 65 72 20 74 68 65 | 20 77 69 6e 64 6f 77 0d |nter the| window.|
|00001c90| 2a 2a 20 77 69 74 68 69 | 6e 20 69 73 20 64 65 74 |** withi|n is det|
|00001ca0| 65 72 6d 69 6e 65 64 20 | 62 79 20 70 61 73 73 69 |ermined |by passi|
|00001cb0| 6e 67 20 61 20 72 65 6c | 61 74 65 64 20 77 69 6e |ng a rel|ated win|
|00001cc0| 64 6f 77 2e 20 20 54 68 | 69 73 20 61 6c 6c 6f 77 |dow. Th|is allow|
|00001cd0| 73 20 72 65 6c 61 74 65 | 64 0d 2a 2a 20 77 69 6e |s relate|d.** win|
|00001ce0| 64 6f 77 73 20 74 6f 20 | 62 65 20 6b 65 70 74 20 |dows to |be kept |
|00001cf0| 6f 6e 20 74 68 65 20 73 | 61 6d 65 20 64 65 76 69 |on the s|ame devi|
|00001d00| 63 65 2e 20 20 54 68 69 | 73 20 69 73 20 75 73 65 |ce. Thi|s is use|
|00001d10| 66 75 6c 20 69 66 20 61 | 6e 20 61 6c 65 72 74 20 |ful if a|n alert |
|00001d20| 69 73 20 72 65 6c 61 74 | 65 64 0d 2a 2a 20 74 6f |is relat|ed.** to|
|00001d30| 20 61 20 73 70 65 63 69 | 66 69 63 20 77 69 6e 64 | a speci|fic wind|
|00001d40| 6f 77 2c 20 66 6f 72 20 | 65 78 61 6d 70 6c 65 2e |ow, for |example.|
|00001d50| 20 2a 2f 0d 0d 52 65 63 | 74 09 43 65 6e 74 65 72 | */..Rec|t.Center|
|00001d60| 57 69 6e 64 6f 77 28 57 | 69 6e 64 6f 77 50 74 72 |Window(W|indowPtr|
|00001d70| 20 77 69 6e 64 6f 77 2c | 20 57 69 6e 64 6f 77 50 | window,| WindowP|
|00001d80| 74 72 20 72 65 6c 61 74 | 65 64 57 69 6e 64 6f 77 |tr relat|edWindow|
|00001d90| 2c 20 52 65 63 74 20 73 | 69 7a 65 49 6e 66 6f 29 |, Rect s|izeInfo)|
|00001da0| 0d 7b 0d 09 57 69 6e 64 | 6f 77 50 74 72 09 77 68 |.{..Wind|owPtr.wh|
|00001db0| 69 63 68 44 65 76 69 63 | 65 3b 0d 09 52 65 63 74 |ichDevic|e;..Rect|
|00001dc0| 09 09 64 65 76 69 63 65 | 52 65 63 74 2c 20 6f 6c |..device|Rect, ol|
|00001dd0| 64 57 69 6e 64 6f 77 52 | 65 63 74 2c 20 6e 65 77 |dWindowR|ect, new|
|00001de0| 57 69 6e 64 6f 77 52 65 | 63 74 2c 20 63 6f 6e 74 |WindowRe|ct, cont|
|00001df0| 65 6e 74 52 65 63 74 3b | 0d 09 73 68 6f 72 74 09 |entRect;|..short.|
|00001e00| 09 68 2c 20 76 2c 20 68 | 68 2c 20 76 76 3b 0d 0d |.h, v, h|h, vv;..|
|00001e10| 09 69 66 20 28 21 28 77 | 68 69 63 68 44 65 76 69 |.if (!(w|hichDevi|
|00001e20| 63 65 20 3d 20 72 65 6c | 61 74 65 64 57 69 6e 64 |ce = rel|atedWind|
|00001e30| 6f 77 29 29 0d 09 09 77 | 68 69 63 68 44 65 76 69 |ow))...w|hichDevi|
|00001e40| 63 65 20 3d 20 77 69 6e | 64 6f 77 3b 0d 09 09 09 |ce = win|dow;....|
|00001e50| 2f 2a 20 49 66 20 77 65 | 20 68 61 76 65 20 61 20 |/* If we| have a |
|00001e60| 77 69 6e 64 6f 77 20 74 | 6f 20 63 65 6e 74 65 72 |window t|o center|
|00001e70| 20 61 67 61 69 6e 73 74 | 2c 20 75 73 65 20 74 68 | against|, use th|
|00001e80| 65 20 64 65 76 69 63 65 | 20 66 6f 72 20 74 68 61 |e device| for tha|
|00001e90| 74 20 77 69 6e 64 6f 77 | 2c 0d 09 09 09 2a 2a 20 |t window|,....** |
|00001ea0| 65 6c 73 65 20 75 73 65 | 20 74 68 65 20 64 65 76 |else use| the dev|
|00001eb0| 69 63 65 20 66 6f 72 20 | 74 68 65 20 77 69 6e 64 |ice for |the wind|
|00001ec0| 6f 77 20 74 68 61 74 20 | 69 73 20 67 65 74 74 69 |ow that |is getti|
|00001ed0| 6e 67 20 63 65 6e 74 65 | 72 65 64 2e 20 2a 2f 0d |ng cente|red. */.|
|00001ee0| 0d 09 64 65 76 69 63 65 | 52 65 63 74 20 3d 20 47 |..device|Rect = G|
|00001ef0| 65 74 57 69 6e 64 6f 77 | 44 65 76 69 63 65 52 65 |etWindow|DeviceRe|
|00001f00| 63 74 4e 4d 42 28 77 68 | 69 63 68 44 65 76 69 63 |ctNMB(wh|ichDevic|
|00001f10| 65 29 3b 0d 09 09 2f 2a | 20 57 65 20 6e 6f 77 20 |e);.../*| We now |
|00001f20| 68 61 76 65 20 74 68 65 | 20 72 65 63 74 61 6e 67 |have the| rectang|
|00001f30| 6c 65 20 6f 66 20 74 68 | 65 20 64 65 76 69 63 65 |le of th|e device|
|00001f40| 20 77 65 20 77 61 6e 74 | 20 74 6f 20 63 65 6e 74 | we want| to cent|
|00001f50| 65 72 20 77 69 74 68 69 | 6e 2e 20 2a 2f 0d 0d 09 |er withi|n. */...|
|00001f60| 69 66 20 28 21 45 6d 70 | 74 79 52 65 63 74 28 26 |if (!Emp|tyRect(&|
|00001f70| 67 57 69 6e 64 6f 77 50 | 6c 61 63 65 6d 65 6e 74 |gWindowP|lacement|
|00001f80| 52 65 63 74 29 29 0d 09 | 09 64 65 76 69 63 65 52 |Rect))..|.deviceR|
|00001f90| 65 63 74 20 3d 20 67 57 | 69 6e 64 6f 77 50 6c 61 |ect = gW|indowPla|
|00001fa0| 63 65 6d 65 6e 74 52 65 | 63 74 3b 0d 0d 09 63 6f |cementRe|ct;...co|
|00001fb0| 6e 74 65 6e 74 52 65 63 | 74 20 3d 20 47 65 74 57 |ntentRec|t = GetW|
|00001fc0| 69 6e 64 6f 77 43 6f 6e | 74 65 6e 74 52 65 63 74 |indowCon|tentRect|
|00001fd0| 28 77 69 6e 64 6f 77 29 | 3b 09 09 2f 2a 20 47 65 |(window)|;../* Ge|
|00001fe0| 74 20 77 68 65 72 65 20 | 74 68 65 20 77 69 6e 64 |t where |the wind|
|00001ff0| 6f 77 20 69 73 20 6e 6f | 77 2e 20 2a 2f 0d 09 68 |ow is no|w. */..h|
|00002000| 20 3d 20 68 68 20 3d 20 | 63 6f 6e 74 65 6e 74 52 | = hh = |contentR|
|00002010| 65 63 74 2e 72 69 67 68 | 74 20 20 2d 20 63 6f 6e |ect.righ|t - con|
|00002020| 74 65 6e 74 52 65 63 74 | 2e 6c 65 66 74 3b 0d 09 |tentRect|.left;..|
|00002030| 76 20 3d 20 76 76 20 3d | 20 63 6f 6e 74 65 6e 74 |v = vv =| content|
|00002040| 52 65 63 74 2e 62 6f 74 | 74 6f 6d 20 2d 20 63 6f |Rect.bot|tom - co|
|00002050| 6e 74 65 6e 74 52 65 63 | 74 2e 74 6f 70 3b 0d 09 |ntentRec|t.top;..|
|00002060| 69 66 20 28 73 69 7a 65 | 49 6e 66 6f 2e 6c 65 66 |if (size|Info.lef|
|00002070| 74 29 0d 09 09 69 66 20 | 28 68 20 3c 20 73 69 7a |t)...if |(h < siz|
|00002080| 65 49 6e 66 6f 2e 6c 65 | 66 74 29 0d 09 09 09 68 |eInfo.le|ft)....h|
|00002090| 20 3d 20 73 69 7a 65 49 | 6e 66 6f 2e 6c 65 66 74 | = sizeI|nfo.left|
|000020a0| 3b 0d 09 69 66 20 28 73 | 69 7a 65 49 6e 66 6f 2e |;..if (s|izeInfo.|
|000020b0| 72 69 67 68 74 29 0d 09 | 09 69 66 20 28 68 20 3e |right)..|.if (h >|
|000020c0| 20 73 69 7a 65 49 6e 66 | 6f 2e 72 69 67 68 74 29 | sizeInf|o.right)|
|000020d0| 0d 09 09 09 68 20 3d 20 | 73 69 7a 65 49 6e 66 6f |....h = |sizeInfo|
|000020e0| 2e 72 69 67 68 74 3b 0d | 09 69 66 20 28 73 69 7a |.right;.|.if (siz|
|000020f0| 65 49 6e 66 6f 2e 74 6f | 70 29 0d 09 09 69 66 20 |eInfo.to|p)...if |
|00002100| 28 76 20 3c 20 73 69 7a | 65 49 6e 66 6f 2e 74 6f |(v < siz|eInfo.to|
|00002110| 70 29 0d 09 09 09 76 20 | 3d 20 73 69 7a 65 49 6e |p)....v |= sizeIn|
|00002120| 66 6f 2e 74 6f 70 3b 0d | 09 69 66 20 28 73 69 7a |fo.top;.|.if (siz|
|00002130| 65 49 6e 66 6f 2e 62 6f | 74 74 6f 6d 29 0d 09 09 |eInfo.bo|ttom)...|
|00002140| 69 66 20 28 76 20 3e 20 | 73 69 7a 65 49 6e 66 6f |if (v > |sizeInfo|
|00002150| 2e 62 6f 74 74 6f 6d 29 | 0d 09 09 09 76 20 3d 20 |.bottom)|....v = |
|00002160| 73 69 7a 65 49 6e 66 6f | 2e 62 6f 74 74 6f 6d 3b |sizeInfo|.bottom;|
|00002170| 0d 09 63 6f 6e 74 65 6e | 74 52 65 63 74 2e 72 69 |..conten|tRect.ri|
|00002180| 67 68 74 20 20 3d 20 63 | 6f 6e 74 65 6e 74 52 65 |ght = c|ontentRe|
|00002190| 63 74 2e 6c 65 66 74 20 | 2b 20 68 3b 0d 09 63 6f |ct.left |+ h;..co|
|000021a0| 6e 74 65 6e 74 52 65 63 | 74 2e 62 6f 74 74 6f 6d |ntentRec|t.bottom|
|000021b0| 20 3d 20 63 6f 6e 74 65 | 6e 74 52 65 63 74 2e 74 | = conte|ntRect.t|
|000021c0| 6f 70 20 20 2b 20 76 3b | 0d 0d 09 6f 6c 64 57 69 |op + v;|...oldWi|
|000021d0| 6e 64 6f 77 52 65 63 74 | 20 3d 20 47 65 74 57 69 |ndowRect| = GetWi|
|000021e0| 6e 64 6f 77 53 74 72 75 | 63 74 75 72 65 52 65 63 |ndowStru|ctureRec|
|000021f0| 74 28 77 69 6e 64 6f 77 | 29 3b 0d 09 6f 6c 64 57 |t(window|);..oldW|
|00002200| 69 6e 64 6f 77 52 65 63 | 74 2e 72 69 67 68 74 20 |indowRec|t.right |
|00002210| 20 2b 3d 20 28 68 20 2d | 20 68 68 29 3b 0d 09 6f | += (h -| hh);..o|
|00002220| 6c 64 57 69 6e 64 6f 77 | 52 65 63 74 2e 62 6f 74 |ldWindow|Rect.bot|
|00002230| 74 6f 6d 20 2b 3d 20 28 | 76 20 2d 20 76 76 29 3b |tom += (|v - vv);|
|00002240| 0d 09 6e 65 77 57 69 6e | 64 6f 77 52 65 63 74 20 |..newWin|dowRect |
|00002250| 3d 20 6f 6c 64 57 69 6e | 64 6f 77 52 65 63 74 3b |= oldWin|dowRect;|
|00002260| 0d 0d 09 50 6f 73 69 74 | 69 6f 6e 52 65 63 74 49 |...Posit|ionRectI|
|00002270| 6e 52 65 63 74 28 64 65 | 76 69 63 65 52 65 63 74 |nRect(de|viceRect|
|00002280| 2c 20 26 6e 65 77 57 69 | 6e 64 6f 77 52 65 63 74 |, &newWi|ndowRect|
|00002290| 2c 20 46 69 78 52 61 74 | 69 6f 28 31 2c 20 32 29 |, FixRat|io(1, 2)|
|000022a0| 2c 20 46 69 78 52 61 74 | 69 6f 28 31 2c 20 33 29 |, FixRat|io(1, 3)|
|000022b0| 29 3b 0d 09 09 2f 2a 20 | 46 69 67 75 72 65 20 6f |);.../* |Figure o|
|000022c0| 75 74 20 74 68 65 20 6e | 65 77 20 77 69 6e 64 6f |ut the n|ew windo|
|000022d0| 77 20 73 74 72 75 63 52 | 65 63 74 20 73 6f 20 77 |w strucR|ect so w|
|000022e0| 65 20 63 61 6e 20 63 6f | 6d 70 61 72 65 20 69 74 |e can co|mpare it|
|000022f0| 20 61 67 61 69 6e 73 74 | 0d 09 09 2a 2a 20 74 68 | against|...** th|
|00002300| 65 20 6f 6c 64 20 73 74 | 72 75 63 52 65 63 74 2e |e old st|rucRect.|
|00002310| 20 20 54 68 69 73 20 77 | 69 6c 6c 20 74 65 6c 6c | This w|ill tell|
|00002320| 20 75 73 20 68 6f 77 20 | 6d 75 63 68 20 74 6f 20 | us how |much to |
|00002330| 6d 6f 76 65 20 74 68 65 | 20 77 69 6e 64 6f 77 2e |move the| window.|
|00002340| 20 2a 2f 0d 0d 09 4f 66 | 66 73 65 74 52 65 63 74 | */...Of|fsetRect|
|00002350| 28 26 63 6f 6e 74 65 6e | 74 52 65 63 74 2c 20 6e |(&conten|tRect, n|
|00002360| 65 77 57 69 6e 64 6f 77 | 52 65 63 74 2e 6c 65 66 |ewWindow|Rect.lef|
|00002370| 74 20 2d 20 6f 6c 64 57 | 69 6e 64 6f 77 52 65 63 |t - oldW|indowRec|
|00002380| 74 2e 6c 65 66 74 2c 0d | 09 09 09 09 09 09 09 6e |t.left,.|.......n|
|00002390| 65 77 57 69 6e 64 6f 77 | 52 65 63 74 2e 74 6f 70 |ewWindow|Rect.top|
|000023a0| 20 20 2d 20 6f 6c 64 57 | 69 6e 64 6f 77 52 65 63 | - oldW|indowRec|
|000023b0| 74 2e 74 6f 70 29 3b 0d | 09 09 2f 2a 20 43 61 6c |t.top);.|../* Cal|
|000023c0| 63 75 6c 61 74 65 20 74 | 68 65 20 6e 65 77 20 63 |culate t|he new c|
|000023d0| 6f 6e 74 65 6e 74 20 72 | 65 63 74 2e 20 2a 2f 0d |ontent r|ect. */.|
|000023e0| 0d 09 4d 6f 76 65 57 69 | 6e 64 6f 77 28 77 69 6e |..MoveWi|ndow(win|
|000023f0| 64 6f 77 2c 20 63 6f 6e | 74 65 6e 74 52 65 63 74 |dow, con|tentRect|
|00002400| 2e 6c 65 66 74 2c 20 63 | 6f 6e 74 65 6e 74 52 65 |.left, c|ontentRe|
|00002410| 63 74 2e 74 6f 70 2c 20 | 66 61 6c 73 65 29 3b 0d |ct.top, |false);.|
|00002420| 09 09 2f 2a 20 4d 6f 76 | 65 20 74 68 65 20 77 69 |../* Mov|e the wi|
|00002430| 6e 64 6f 77 20 74 6f 20 | 74 68 65 20 6e 65 77 20 |ndow to |the new |
|00002440| 6c 6f 63 61 74 69 6f 6e | 2e 20 2a 2f 0d 0d 09 72 |location|. */...r|
|00002450| 65 74 75 72 6e 28 63 6f | 6e 74 65 6e 74 52 65 63 |eturn(co|ntentRec|
|00002460| 74 29 3b 0d 7d 0d 0d 2f | 2a 20 47 69 76 65 6e 20 |t);.}../|* Given |
|00002470| 74 77 6f 20 72 65 63 74 | 61 6e 67 6c 65 73 2c 20 |two rect|angles, |
|00002480| 74 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 70 6f |this fun|ction po|
|00002490| 73 69 74 69 6f 6e 73 20 | 74 68 65 20 73 65 63 6f |sitions |the seco|
|000024a0| 6e 64 20 77 69 74 68 69 | 6e 20 74 68 65 20 66 69 |nd withi|n the fi|
|000024b0| 72 73 74 0d 2a 2a 20 6f | 6e 65 20 73 6f 20 74 68 |rst.** o|ne so th|
|000024c0| 61 74 20 69 74 20 6d 61 | 69 6e 74 61 69 6e 73 20 |at it ma|intains |
|000024d0| 74 68 65 20 73 70 61 63 | 69 6e 67 20 73 70 65 63 |the spac|ing spec|
|000024e0| 69 66 69 65 64 20 62 79 | 20 74 68 65 20 68 6f 72 |ified by| the hor|
|000024f0| 7a 52 61 74 69 6f 20 61 | 6e 64 0d 2a 2a 20 76 65 |zRatio a|nd.** ve|
|00002500| 72 74 52 61 74 69 6f 20 | 70 61 72 61 6d 65 74 65 |rtRatio |paramete|
|00002510| 72 73 2e 20 20 49 6e 20 | 6f 74 68 65 72 20 77 6f |rs. In |other wo|
|00002520| 72 64 73 2c 20 74 6f 20 | 63 65 6e 74 65 72 20 61 |rds, to |center a|
|00002530| 6e 20 69 6e 6e 65 72 20 | 72 65 63 74 61 6e 67 6c |n inner |rectangl|
|00002540| 65 0d 2a 2a 20 68 6f 69 | 7a 6f 6e 74 61 6c 6c 79 |e.** hoi|zontally|
|00002550| 2c 20 62 75 74 20 68 61 | 76 65 20 69 74 73 20 63 |, but ha|ve its c|
|00002560| 65 6e 74 65 72 20 62 65 | 20 31 2f 33 20 66 72 6f |enter be| 1/3 fro|
|00002570| 6d 20 74 68 65 20 74 6f | 70 20 6f 66 20 74 68 65 |m the to|p of the|
|00002580| 20 6f 75 74 65 72 20 72 | 65 63 74 61 6e 67 6c 65 | outer r|ectangle|
|00002590| 2c 0d 2a 2a 20 63 61 6c | 6c 20 74 68 69 73 20 66 |,.** cal|l this f|
|000025a0| 75 6e 63 74 69 6f 6e 20 | 77 69 74 68 20 68 6f 72 |unction |with hor|
|000025b0| 7a 52 61 74 69 6f 20 3d | 20 46 69 78 52 61 74 69 |zRatio =| FixRati|
|000025c0| 6f 28 31 2c 20 32 29 2c | 20 76 65 72 74 52 61 74 |o(1, 2),| vertRat|
|000025d0| 69 6f 20 3d 0d 2a 2a 20 | 46 69 78 52 61 74 69 6f |io =.** |FixRatio|
|000025e0| 28 31 2c 20 33 29 2e 20 | 20 57 65 20 75 73 65 20 |(1, 3). | We use |
|000025f0| 46 69 78 65 64 20 72 61 | 74 68 65 72 20 74 68 61 |Fixed ra|ther tha|
|00002600| 6e 20 66 6c 6f 61 74 69 | 6e 67 20 70 6f 69 6e 74 |n floati|ng point|
|00002610| 20 74 6f 20 61 76 6f 69 | 64 0d 2a 2a 20 63 6f 6d | to avoi|d.** com|
|00002620| 70 6c 69 63 61 74 69 6f | 6e 73 20 77 68 65 6e 20 |plicatio|ns when |
|00002630| 6d 69 78 69 6e 67 20 4d | 43 36 38 38 38 31 2f 6e |mixing M|C68881/n|
|00002640| 6f 6e 2d 4d 43 36 38 38 | 38 31 20 76 65 72 73 69 |on-MC688|81 versi|
|00002650| 6f 6e 73 20 6f 66 20 55 | 74 69 6c 69 74 69 65 73 |ons of U|tilities|
|00002660| 2e 20 2a 2f 0d 0d 76 6f | 69 64 09 50 6f 73 69 74 |. */..vo|id.Posit|
|00002670| 69 6f 6e 52 65 63 74 49 | 6e 52 65 63 74 28 52 65 |ionRectI|nRect(Re|
|00002680| 63 74 20 6f 75 74 65 72 | 52 65 63 74 2c 20 52 65 |ct outer|Rect, Re|
|00002690| 63 74 20 2a 69 6e 6e 65 | 72 52 65 63 74 2c 20 46 |ct *inne|rRect, F|
|000026a0| 69 78 65 64 20 68 6f 72 | 7a 52 61 74 69 6f 2c 20 |ixed hor|zRatio, |
|000026b0| 46 69 78 65 64 20 76 65 | 72 74 52 61 74 69 6f 29 |Fixed ve|rtRatio)|
|000026c0| 0d 7b 0d 09 73 68 6f 72 | 74 09 6f 75 74 65 72 52 |.{..shor|t.outerR|
|000026d0| 65 63 74 48 65 69 67 68 | 74 3b 0d 09 73 68 6f 72 |ectHeigh|t;..shor|
|000026e0| 74 09 6f 75 74 65 72 52 | 65 63 74 57 69 64 74 68 |t.outerR|ectWidth|
|000026f0| 3b 0d 09 73 68 6f 72 74 | 09 69 6e 6e 65 72 52 65 |;..short|.innerRe|
|00002700| 63 74 48 65 69 67 68 74 | 3b 0d 09 73 68 6f 72 74 |ctHeight|;..short|
|00002710| 09 69 6e 6e 65 72 52 65 | 63 74 57 69 64 74 68 3b |.innerRe|ctWidth;|
|00002720| 0d 09 73 68 6f 72 74 09 | 79 4c 6f 63 61 74 69 6f |..short.|yLocatio|
|00002730| 6e 3b 0d 09 73 68 6f 72 | 74 09 78 4c 6f 63 61 74 |n;..shor|t.xLocat|
|00002740| 69 6f 6e 3b 0d 0d 09 6f | 75 74 65 72 52 65 63 74 |ion;...o|uterRect|
|00002750| 48 65 69 67 68 74 20 3d | 20 6f 75 74 65 72 52 65 |Height =| outerRe|
|00002760| 63 74 2e 62 6f 74 74 6f | 6d 20 2d 20 6f 75 74 65 |ct.botto|m - oute|
|00002770| 72 52 65 63 74 2e 74 6f | 70 3b 0d 09 6f 75 74 65 |rRect.to|p;..oute|
|00002780| 72 52 65 63 74 57 69 64 | 74 68 20 3d 20 6f 75 74 |rRectWid|th = out|
|00002790| 65 72 52 65 63 74 2e 72 | 69 67 68 74 20 2d 20 6f |erRect.r|ight - o|
|000027a0| 75 74 65 72 52 65 63 74 | 2e 6c 65 66 74 3b 0d 0d |uterRect|.left;..|
|000027b0| 09 69 6e 6e 65 72 52 65 | 63 74 48 65 69 67 68 74 |.innerRe|ctHeight|
|000027c0| 20 3d 20 69 6e 6e 65 72 | 52 65 63 74 2d 3e 62 6f | = inner|Rect->bo|
|000027d0| 74 74 6f 6d 20 2d 20 69 | 6e 6e 65 72 52 65 63 74 |ttom - i|nnerRect|
|000027e0| 2d 3e 74 6f 70 3b 0d 09 | 69 6e 6e 65 72 52 65 63 |->top;..|innerRec|
|000027f0| 74 57 69 64 74 68 20 3d | 20 69 6e 6e 65 72 52 65 |tWidth =| innerRe|
|00002800| 63 74 2d 3e 72 69 67 68 | 74 20 2d 20 69 6e 6e 65 |ct->righ|t - inne|
|00002810| 72 52 65 63 74 2d 3e 6c | 65 66 74 3b 0d 09 09 79 |rRect->l|eft;...y|
|00002820| 4c 6f 63 61 74 69 6f 6e | 20 3d 20 46 69 78 32 4c |Location| = Fix2L|
|00002830| 6f 6e 67 28 46 69 78 4d | 75 6c 28 4c 6f 6e 67 32 |ong(FixM|ul(Long2|
|00002840| 46 69 78 28 6f 75 74 65 | 72 52 65 63 74 48 65 69 |Fix(oute|rRectHei|
|00002850| 67 68 74 20 2d 20 69 6e | 6e 65 72 52 65 63 74 48 |ght - in|nerRectH|
|00002860| 65 69 67 68 74 29 2c 20 | 76 65 72 74 52 61 74 69 |eight), |vertRati|
|00002870| 6f 29 29 0d 09 09 09 2b | 20 6f 75 74 65 72 52 65 |o))....+| outerRe|
|00002880| 63 74 2e 74 6f 70 3b 0d | 09 09 78 4c 6f 63 61 74 |ct.top;.|..xLocat|
|00002890| 69 6f 6e 20 3d 20 46 69 | 78 32 4c 6f 6e 67 28 46 |ion = Fi|x2Long(F|
|000028a0| 69 78 4d 75 6c 28 4c 6f | 6e 67 32 46 69 78 28 6f |ixMul(Lo|ng2Fix(o|
|000028b0| 75 74 65 72 52 65 63 74 | 57 69 64 74 68 20 2d 20 |uterRect|Width - |
|000028c0| 69 6e 6e 65 72 52 65 63 | 74 57 69 64 74 68 29 2c |innerRec|tWidth),|
|000028d0| 20 68 6f 72 7a 52 61 74 | 69 6f 29 29 0d 09 09 09 | horzRat|io))....|
|000028e0| 2b 20 6f 75 74 65 72 52 | 65 63 74 2e 6c 65 66 74 |+ outerR|ect.left|
|000028f0| 3b 0d 0d 09 69 6e 6e 65 | 72 52 65 63 74 2d 3e 74 |;...inne|rRect->t|
|00002900| 6f 70 20 3d 20 79 4c 6f | 63 61 74 69 6f 6e 3b 0d |op = yLo|cation;.|
|00002910| 09 69 6e 6e 65 72 52 65 | 63 74 2d 3e 6c 65 66 74 |.innerRe|ct->left|
|00002920| 20 3d 20 78 4c 6f 63 61 | 74 69 6f 6e 3b 0d 09 69 | = xLoca|tion;..i|
|00002930| 6e 6e 65 72 52 65 63 74 | 2d 3e 62 6f 74 74 6f 6d |nnerRect|->bottom|
|00002940| 20 3d 20 79 4c 6f 63 61 | 74 69 6f 6e 20 2b 20 69 | = yLoca|tion + i|
|00002950| 6e 6e 65 72 52 65 63 74 | 48 65 69 67 68 74 3b 0d |nnerRect|Height;.|
|00002960| 09 69 6e 6e 65 72 52 65 | 63 74 2d 3e 72 69 67 68 |.innerRe|ct->righ|
|00002970| 74 20 3d 20 78 4c 6f 63 | 61 74 69 6f 6e 20 2b 20 |t = xLoc|ation + |
|00002980| 69 6e 6e 65 72 52 65 63 | 74 57 69 64 74 68 3b 0d |innerRec|tWidth;.|
|00002990| 7d 0d 0d 2f 2a 20 47 69 | 76 65 6e 20 61 20 77 69 |}../* Gi|ven a wi|
|000029a0| 6e 64 6f 77 20 70 6f 69 | 6e 74 65 72 2c 20 72 65 |ndow poi|nter, re|
|000029b0| 74 75 72 6e 20 74 68 65 | 20 67 6c 6f 62 61 6c 20 |turn the| global |
|000029c0| 72 65 63 74 61 6e 67 6c | 65 20 74 68 61 74 20 65 |rectangl|e that e|
|000029d0| 6e 63 6c 6f 73 65 73 20 | 74 68 65 0d 2a 2a 20 63 |ncloses |the.** c|
|000029e0| 6f 6e 74 65 6e 74 20 61 | 72 65 61 20 6f 66 20 74 |ontent a|rea of t|
|000029f0| 68 65 20 77 69 6e 64 6f | 77 2e 20 2a 2f 0d 0d 52 |he windo|w. */..R|
|00002a00| 65 63 74 09 47 65 74 57 | 69 6e 64 6f 77 43 6f 6e |ect.GetW|indowCon|
|00002a10| 74 65 6e 74 52 65 63 74 | 28 57 69 6e 64 6f 77 50 |tentRect|(WindowP|
|00002a20| 74 72 20 77 69 6e 64 6f | 77 29 0d 7b 0d 09 57 69 |tr windo|w).{..Wi|
|00002a30| 6e 64 6f 77 50 74 72 09 | 6f 6c 64 50 6f 72 74 3b |ndowPtr.|oldPort;|
|00002a40| 0d 09 52 65 63 74 09 09 | 63 6f 6e 74 65 6e 74 52 |..Rect..|contentR|
|00002a50| 65 63 74 3b 0d 0d 09 53 | 65 74 52 65 63 74 28 26 |ect;...S|etRect(&|
|00002a60| 63 6f 6e 74 65 6e 74 52 | 65 63 74 2c 20 30 2c 20 |contentR|ect, 0, |
|00002a70| 30 2c 20 30 2c 20 30 29 | 3b 0d 09 69 66 20 28 77 |0, 0, 0)|;..if (w|
|00002a80| 69 6e 64 6f 77 29 20 7b | 0d 09 09 47 65 74 50 6f |indow) {|...GetPo|
|00002a90| 72 74 28 26 6f 6c 64 50 | 6f 72 74 29 3b 0d 09 09 |rt(&oldP|ort);...|
|00002aa0| 53 65 74 50 6f 72 74 28 | 77 69 6e 64 6f 77 29 3b |SetPort(|window);|
|00002ab0| 0d 09 09 63 6f 6e 74 65 | 6e 74 52 65 63 74 20 3d |...conte|ntRect =|
|00002ac0| 20 77 69 6e 64 6f 77 2d | 3e 70 6f 72 74 52 65 63 | window-|>portRec|
|00002ad0| 74 3b 0d 09 09 4c 6f 63 | 61 6c 54 6f 47 6c 6f 62 |t;...Loc|alToGlob|
|00002ae0| 61 6c 52 65 63 74 28 26 | 63 6f 6e 74 65 6e 74 52 |alRect(&|contentR|
|00002af0| 65 63 74 29 3b 0d 09 09 | 53 65 74 50 6f 72 74 28 |ect);...|SetPort(|
|00002b00| 6f 6c 64 50 6f 72 74 29 | 3b 0d 09 7d 0d 0d 09 72 |oldPort)|;..}...r|
|00002b10| 65 74 75 72 6e 28 63 6f | 6e 74 65 6e 74 52 65 63 |eturn(co|ntentRec|
|00002b20| 74 29 3b 0d 7d 0d 0d 2f | 2a 20 54 68 69 73 20 70 |t);.}../|* This p|
|00002b30| 72 6f 63 65 64 75 72 65 | 20 69 73 20 75 73 65 64 |rocedure| is used|
|00002b40| 20 74 6f 20 67 65 74 20 | 74 68 65 20 72 65 63 74 | to get |the rect|
|00002b50| 61 6e 67 6c 65 20 74 68 | 61 74 20 73 75 72 72 6f |angle th|at surro|
|00002b60| 75 6e 64 73 20 74 68 65 | 20 65 6e 74 69 72 65 0d |unds the| entire.|
|00002b70| 2a 2a 20 73 74 72 75 63 | 74 75 72 65 20 6f 66 20 |** struc|ture of |
|00002b80| 61 20 77 69 6e 64 6f 77 | 2e 20 20 54 68 69 73 20 |a window|. This |
|00002b90| 69 73 20 74 72 75 65 20 | 77 68 65 74 68 65 72 20 |is true |whether |
|00002ba0| 6f 72 20 6e 6f 74 20 74 | 68 65 20 77 69 6e 64 6f |or not t|he windo|
|00002bb0| 77 20 69 73 20 76 69 73 | 69 62 6c 65 2e 0d 2a 2a |w is vis|ible..**|
|00002bc0| 20 49 66 20 74 68 65 20 | 77 69 6e 64 6f 77 20 69 | If the |window i|
|00002bd0| 73 20 76 69 73 69 62 6c | 65 2c 20 74 68 65 6e 20 |s visibl|e, then |
|00002be0| 69 74 20 69 73 20 61 20 | 73 69 6d 70 6c 65 20 6d |it is a |simple m|
|00002bf0| 61 74 74 65 72 20 6f 66 | 20 75 73 69 6e 67 20 74 |atter of| using t|
|00002c00| 68 65 20 62 6f 75 6e 64 | 69 6e 67 0d 2a 2a 20 72 |he bound|ing.** r|
|00002c10| 65 63 74 61 6e 67 6c 65 | 20 6f 66 20 74 68 65 20 |ectangle| of the |
|00002c20| 73 74 72 75 63 74 75 72 | 65 20 72 65 67 69 6f 6e |structur|e region|
|00002c30| 2e 20 20 49 66 20 74 68 | 65 20 77 69 6e 64 6f 77 |. If th|e window|
|00002c40| 20 69 73 20 69 6e 76 69 | 73 69 62 6c 65 2c 20 74 | is invi|sible, t|
|00002c50| 68 65 6e 20 74 68 65 0d | 2a 2a 20 73 74 72 75 63 |hen the.|** struc|
|00002c60| 52 67 6e 20 69 73 20 6e | 6f 74 20 63 6f 72 72 65 |Rgn is n|ot corre|
|00002c70| 63 74 2e 20 20 54 6f 20 | 6d 61 6b 65 20 69 74 20 |ct. To |make it |
|00002c80| 63 6f 72 72 65 63 74 2c | 20 74 68 65 6e 20 77 69 |correct,| then wi|
|00002c90| 6e 64 6f 77 20 68 61 73 | 20 74 6f 20 62 65 20 6d |ndow has| to be m|
|00002ca0| 6f 76 65 64 0d 2a 2a 20 | 77 61 79 20 6f 66 66 20 |oved.** |way off |
|00002cb0| 74 68 65 20 73 63 72 65 | 65 6e 20 61 6e 64 20 74 |the scre|en and t|
|00002cc0| 68 65 6e 20 6d 61 64 65 | 20 76 69 73 69 62 6c 65 |hen made| visible|
|00002cd0| 2e 20 20 54 68 69 73 20 | 67 65 6e 65 72 61 74 65 |. This |generate|
|00002ce0| 73 20 61 20 76 61 6c 69 | 64 20 73 74 72 75 63 52 |s a vali|d strucR|
|00002cf0| 67 6e 2c 0d 2a 2a 20 61 | 6c 74 68 6f 75 67 68 20 |gn,.** a|lthough |
|00002d00| 69 74 20 69 73 20 76 61 | 6c 69 64 20 66 6f 72 20 |it is va|lid for |
|00002d10| 74 68 65 20 70 6f 73 69 | 74 69 6f 6e 20 74 68 61 |the posi|tion tha|
|00002d20| 74 20 69 73 20 77 61 79 | 20 6f 66 66 20 74 68 65 |t is way| off the|
|00002d30| 20 73 63 72 65 65 6e 2e | 20 20 49 74 20 73 74 69 | screen.| It sti|
|00002d40| 6c 6c 0d 2a 2a 20 6e 65 | 65 64 73 20 74 6f 20 62 |ll.** ne|eds to b|
|00002d50| 65 20 6f 66 66 73 65 74 | 20 62 61 63 6b 20 69 6e |e offset| back in|
|00002d60| 74 6f 20 74 68 65 20 6f | 72 69 67 69 6e 61 6c 20 |to the o|riginal |
|00002d70| 70 6f 73 69 74 69 6f 6e | 2e 20 20 4f 6e 63 65 20 |position|. Once |
|00002d80| 74 68 65 20 62 6f 75 6e | 64 69 6e 67 0d 2a 2a 20 |the boun|ding.** |
|00002d90| 72 65 63 74 61 6e 67 6c | 65 20 66 6f 72 20 74 68 |rectangl|e for th|
|00002da0| 65 20 73 74 72 75 63 52 | 67 6e 20 69 73 20 6f 62 |e strucR|gn is ob|
|00002db0| 74 61 69 6e 65 64 2c 20 | 74 68 65 20 77 69 6e 64 |tained, |the wind|
|00002dc0| 6f 77 20 63 61 6e 20 74 | 68 65 6e 20 62 65 20 68 |ow can t|hen be h|
|00002dd0| 69 64 64 65 6e 20 61 67 | 61 69 6e 0d 2a 2a 20 61 |idden ag|ain.** a|
|00002de0| 6e 64 20 6d 6f 76 65 64 | 20 62 61 63 6b 20 74 6f |nd moved| back to|
|00002df0| 20 69 74 73 20 63 6f 72 | 72 65 63 74 20 6c 6f 63 | its cor|rect loc|
|00002e00| 61 74 69 6f 6e 2e 20 20 | 4e 6f 74 65 20 74 68 61 |ation. |Note tha|
|00002e10| 74 20 53 68 6f 77 48 69 | 64 65 20 69 73 20 75 73 |t ShowHi|de is us|
|00002e20| 65 64 2c 0d 2a 2a 20 69 | 6e 73 74 65 61 64 20 6f |ed,.** i|nstead o|
|00002e30| 66 20 53 68 6f 77 57 69 | 6e 64 6f 77 20 61 6e 64 |f ShowWi|ndow and|
|00002e40| 20 48 69 64 65 57 69 6e | 64 6f 77 2e 20 20 48 69 | HideWin|dow. Hi|
|00002e50| 64 65 57 69 6e 64 6f 77 | 20 63 61 6e 20 63 68 61 |deWindow| can cha|
|00002e60| 6e 67 65 20 74 68 65 20 | 70 6c 61 6e 65 20 6f 66 |nge the |plane of|
|00002e70| 0d 2a 2a 20 74 68 65 20 | 77 69 6e 64 6f 77 2e 20 |.** the |window. |
|00002e80| 20 41 6c 73 6f 2c 20 53 | 68 6f 77 48 69 64 65 20 | Also, S|howHide |
|00002e90| 64 6f 65 73 20 6e 6f 74 | 20 61 66 66 65 63 74 20 |does not| affect |
|00002ea0| 74 68 65 20 68 69 6c 69 | 74 69 6e 67 20 6f 66 20 |the hili|ting of |
|00002eb0| 77 69 6e 64 6f 77 73 2e | 0d 2a 2a 20 4e 6f 74 65 |windows.|.** Note|
|00002ec0| 20 74 68 61 74 20 75 73 | 69 6e 67 20 53 68 6f 77 | that us|ing Show|
|00002ed0| 48 69 64 65 20 74 6f 20 | 6d 61 6b 65 20 74 68 65 |Hide to |make the|
|00002ee0| 20 77 69 6e 64 6f 77 20 | 76 69 73 69 62 6c 65 20 | window |visible |
|00002ef0| 68 61 73 20 74 68 65 20 | 75 6e 66 6f 72 74 75 6e |has the |unfortun|
|00002f00| 61 74 65 0d 2a 2a 20 73 | 69 64 65 2d 65 66 66 65 |ate.** s|ide-effe|
|00002f10| 63 74 20 6f 66 20 63 68 | 61 6e 67 69 6e 67 20 74 |ct of ch|anging t|
|00002f20| 68 65 20 75 73 65 72 53 | 74 61 74 65 20 72 65 63 |he userS|tate rec|
|00002f30| 74 2e 20 20 53 69 6e 63 | 65 20 77 65 20 6d 61 6b |t. Sinc|e we mak|
|00002f40| 65 20 74 68 65 20 77 69 | 6e 64 6f 77 0d 2a 2a 20 |e the wi|ndow.** |
|00002f50| 69 6e 76 69 73 69 62 6c | 65 20 70 72 69 6f 72 20 |invisibl|e prior |
|00002f60| 74 6f 20 6d 6f 76 69 6e | 67 20 69 74 20 62 61 63 |to movin|g it bac|
|00002f70| 6b 2c 20 75 73 65 72 53 | 74 61 74 65 20 67 65 74 |k, userS|tate get|
|00002f80| 73 20 6c 65 66 74 20 66 | 75 6e 6b 79 2e 20 20 44 |s left f|unky. D|
|00002f90| 75 65 20 74 6f 20 74 68 | 69 73 2c 0d 2a 2a 20 77 |ue to th|is,.** w|
|00002fa0| 65 20 68 61 76 65 20 74 | 6f 20 63 61 63 68 65 20 |e have t|o cache |
|00002fb0| 69 74 20 70 72 69 6f 72 | 20 74 6f 20 64 6f 69 6e |it prior| to doin|
|00002fc0| 67 20 74 68 65 20 53 68 | 6f 77 48 69 64 65 20 67 |g the Sh|owHide g|
|00002fd0| 61 6d 65 73 2e 20 2a 2f | 0d 0d 52 65 63 74 09 47 |ames. */|..Rect.G|
|00002fe0| 65 74 57 69 6e 64 6f 77 | 53 74 72 75 63 74 75 72 |etWindow|Structur|
|00002ff0| 65 52 65 63 74 28 57 69 | 6e 64 6f 77 50 74 72 20 |eRect(Wi|ndowPtr |
|00003000| 77 69 6e 64 6f 77 29 0d | 7b 0d 23 64 65 66 69 6e |window).|{.#defin|
|00003010| 65 20 6b 4f 66 66 73 63 | 72 65 65 6e 4c 6f 63 20 |e kOffsc|reenLoc |
|00003020| 30 78 34 30 30 30 0d 0d | 09 47 72 61 66 50 74 72 |0x4000..|.GrafPtr|
|00003030| 09 6f 6c 64 50 6f 72 74 | 3b 0d 09 52 65 63 74 09 |.oldPort|;..Rect.|
|00003040| 73 74 72 75 63 74 75 72 | 65 52 65 63 74 2c 20 75 |structur|eRect, u|
|00003050| 73 65 72 53 74 61 74 65 | 3b 0d 09 50 6f 69 6e 74 |serState|;..Point|
|00003060| 09 77 69 6e 64 6f 77 4c | 6f 63 3b 0d 0d 09 53 65 |.windowL|oc;...Se|
|00003070| 74 52 65 63 74 28 26 73 | 74 72 75 63 74 75 72 65 |tRect(&s|tructure|
|00003080| 52 65 63 74 2c 20 30 2c | 20 30 2c 20 30 2c 20 30 |Rect, 0,| 0, 0, 0|
|00003090| 29 3b 0d 0d 09 69 66 20 | 28 77 69 6e 64 6f 77 29 |);...if |(window)|
|000030a0| 20 7b 0d 0d 09 09 69 66 | 20 28 28 28 57 69 6e 64 | {....if| (((Wind|
|000030b0| 6f 77 50 65 65 6b 29 77 | 69 6e 64 6f 77 29 2d 3e |owPeek)w|indow)->|
|000030c0| 76 69 73 69 62 6c 65 29 | 0d 09 09 09 73 74 72 75 |visible)|....stru|
|000030d0| 63 74 75 72 65 52 65 63 | 74 20 3d 20 28 2a 28 28 |ctureRec|t = (*((|
|000030e0| 28 57 69 6e 64 6f 77 50 | 65 65 6b 29 77 69 6e 64 |(WindowP|eek)wind|
|000030f0| 6f 77 29 2d 3e 73 74 72 | 75 63 52 67 6e 29 29 2d |ow)->str|ucRgn))-|
|00003100| 3e 72 67 6e 42 42 6f 78 | 3b 0d 0d 09 09 65 6c 73 |>rgnBBox|;....els|
|00003110| 65 20 7b 0d 09 09 09 47 | 65 74 50 6f 72 74 28 26 |e {....G|etPort(&|
|00003120| 6f 6c 64 50 6f 72 74 29 | 3b 0d 09 09 09 53 65 74 |oldPort)|;....Set|
|00003130| 50 6f 72 74 28 77 69 6e | 64 6f 77 29 3b 0d 09 09 |Port(win|dow);...|
|00003140| 09 77 69 6e 64 6f 77 4c | 6f 63 20 20 3d 20 47 65 |.windowL|oc = Ge|
|00003150| 74 47 6c 6f 62 61 6c 54 | 6f 70 4c 65 66 74 28 77 |tGlobalT|opLeft(w|
|00003160| 69 6e 64 6f 77 29 3b 0d | 09 09 09 69 66 20 28 28 |indow);.|...if ((|
|00003170| 28 57 69 6e 64 6f 77 50 | 65 65 6b 29 77 69 6e 64 |(WindowP|eek)wind|
|00003180| 6f 77 29 2d 3e 73 70 61 | 72 65 46 6c 61 67 29 0d |ow)->spa|reFlag).|
|00003190| 09 09 09 09 75 73 65 72 | 53 74 61 74 65 20 3d 20 |....user|State = |
|000031a0| 28 2a 28 57 53 74 61 74 | 65 44 61 74 61 48 61 6e |(*(WStat|eDataHan|
|000031b0| 64 6c 65 29 28 28 28 57 | 69 6e 64 6f 77 50 65 65 |dle)(((W|indowPee|
|000031c0| 6b 29 77 69 6e 64 6f 77 | 29 2d 3e 64 61 74 61 48 |k)window|)->dataH|
|000031d0| 61 6e 64 6c 65 29 29 2d | 3e 75 73 65 72 53 74 61 |andle))-|>userSta|
|000031e0| 74 65 3b 0d 09 09 09 4d | 6f 76 65 57 69 6e 64 6f |te;....M|oveWindo|
|000031f0| 77 28 77 69 6e 64 6f 77 | 2c 20 6b 4f 66 66 73 63 |w(window|, kOffsc|
|00003200| 72 65 65 6e 4c 6f 63 2c | 20 6b 4f 66 66 73 63 72 |reenLoc,| kOffscr|
|00003210| 65 65 6e 4c 6f 63 2c 20 | 66 61 6c 73 65 29 3b 0d |eenLoc, |false);.|
|00003220| 09 09 09 53 68 6f 77 48 | 69 64 65 28 77 69 6e 64 |...ShowH|ide(wind|
|00003230| 6f 77 2c 20 74 72 75 65 | 29 3b 0d 09 09 09 73 74 |ow, true|);....st|
|00003240| 72 75 63 74 75 72 65 52 | 65 63 74 20 3d 20 28 2a |ructureR|ect = (*|
|00003250| 28 28 28 57 69 6e 64 6f | 77 50 65 65 6b 29 77 69 |(((Windo|wPeek)wi|
|00003260| 6e 64 6f 77 29 2d 3e 73 | 74 72 75 63 52 67 6e 29 |ndow)->s|trucRgn)|
|00003270| 29 2d 3e 72 67 6e 42 42 | 6f 78 3b 0d 09 09 09 53 |)->rgnBB|ox;....S|
|00003280| 68 6f 77 48 69 64 65 28 | 77 69 6e 64 6f 77 2c 20 |howHide(|window, |
|00003290| 66 61 6c 73 65 29 3b 0d | 09 09 09 4d 6f 76 65 57 |false);.|...MoveW|
|000032a0| 69 6e 64 6f 77 28 77 69 | 6e 64 6f 77 2c 20 77 69 |indow(wi|ndow, wi|
|000032b0| 6e 64 6f 77 4c 6f 63 2e | 68 2c 20 77 69 6e 64 6f |ndowLoc.|h, windo|
|000032c0| 77 4c 6f 63 2e 76 2c 20 | 66 61 6c 73 65 29 3b 0d |wLoc.v, |false);.|
|000032d0| 09 09 09 69 66 20 28 28 | 28 57 69 6e 64 6f 77 50 |...if ((|(WindowP|
|000032e0| 65 65 6b 29 77 69 6e 64 | 6f 77 29 2d 3e 73 70 61 |eek)wind|ow)->spa|
|000032f0| 72 65 46 6c 61 67 29 0d | 09 09 09 09 28 2a 28 57 |reFlag).|....(*(W|
|00003300| 53 74 61 74 65 44 61 74 | 61 48 61 6e 64 6c 65 29 |StateDat|aHandle)|
|00003310| 28 28 28 57 69 6e 64 6f | 77 50 65 65 6b 29 77 69 |(((Windo|wPeek)wi|
|00003320| 6e 64 6f 77 29 2d 3e 64 | 61 74 61 48 61 6e 64 6c |ndow)->d|ataHandl|
|00003330| 65 29 29 2d 3e 75 73 65 | 72 53 74 61 74 65 20 3d |e))->use|rState =|
|00003340| 20 75 73 65 72 53 74 61 | 74 65 3b 0d 09 09 09 53 | userSta|te;....S|
|00003350| 65 74 50 6f 72 74 28 6f | 6c 64 50 6f 72 74 29 3b |etPort(o|ldPort);|
|00003360| 0d 09 09 09 4f 66 66 73 | 65 74 52 65 63 74 28 26 |....Offs|etRect(&|
|00003370| 73 74 72 75 63 74 75 72 | 65 52 65 63 74 2c 20 77 |structur|eRect, w|
|00003380| 69 6e 64 6f 77 4c 6f 63 | 2e 68 20 2d 20 6b 4f 66 |indowLoc|.h - kOf|
|00003390| 66 73 63 72 65 65 6e 4c | 6f 63 2c 20 77 69 6e 64 |fscreenL|oc, wind|
|000033a0| 6f 77 4c 6f 63 2e 76 20 | 2d 20 6b 4f 66 66 73 63 |owLoc.v |- kOffsc|
|000033b0| 72 65 65 6e 4c 6f 63 29 | 3b 0d 09 09 7d 0d 09 7d |reenLoc)|;...}..}|
|000033c0| 0d 0d 09 72 65 74 75 72 | 6e 28 73 74 72 75 63 74 |...retur|n(struct|
|000033d0| 75 72 65 52 65 63 74 29 | 3b 0d 7d 0d 0d 2f 2a 20 |ureRect)|;.}../* |
|000033e0| 47 69 76 65 6e 20 61 20 | 77 69 6e 64 6f 77 2c 20 |Given a |window, |
|000033f0| 74 68 69 73 20 77 69 6c | 6c 20 72 65 74 75 72 6e |this wil|l return|
|00003400| 20 74 68 65 20 74 6f 70 | 20 6c 65 66 74 20 70 6f | the top| left po|
|00003410| 69 6e 74 20 6f 66 20 74 | 68 65 20 77 69 6e 64 6f |int of t|he windo|
|00003420| 77 d5 73 20 70 6f 72 74 | 20 69 6e 0d 2a 2a 20 67 |w.s port| in.** g|
|00003430| 6c 6f 62 61 6c 20 63 6f | 6f 72 64 69 6e 61 74 65 |lobal co|ordinate|
|00003440| 73 2e 20 20 53 6f 6d 65 | 74 68 69 6e 67 20 74 68 |s. Some|thing th|
|00003450| 69 73 20 64 6f 65 73 6e | d5 74 20 69 6e 63 6c 75 |is doesn|.t inclu|
|00003460| 64 65 20 69 73 20 74 68 | 65 20 77 69 6e 64 6f 77 |de is th|e window|
|00003470| d5 73 20 64 72 61 67 0d | 2a 2a 20 72 65 67 69 6f |.s drag.|** regio|
|00003480| 6e 20 28 6f 72 20 74 69 | 74 6c 65 20 62 61 72 29 |n (or ti|tle bar)|
|00003490| 2e 20 20 54 68 69 73 20 | 72 65 74 75 72 6e 73 20 |. This |returns |
|000034a0| 74 68 65 20 74 6f 70 20 | 6c 65 66 74 20 70 6f 69 |the top |left poi|
|000034b0| 6e 74 20 6f 66 20 74 68 | 65 20 77 69 6e 64 6f 77 |nt of th|e window|
|000034c0| d5 73 0d 2a 2a 20 63 6f | 6e 74 65 6e 74 20 61 72 |.s.** co|ntent ar|
|000034d0| 65 61 20 6f 6e 6c 79 2e | 20 2a 2f 0d 0d 50 6f 69 |ea only.| */..Poi|
|000034e0| 6e 74 09 47 65 74 47 6c | 6f 62 61 6c 54 6f 70 4c |nt.GetGl|obalTopL|
|000034f0| 65 66 74 28 57 69 6e 64 | 6f 77 50 74 72 20 77 69 |eft(Wind|owPtr wi|
|00003500| 6e 64 6f 77 29 0d 7b 0d | 09 47 72 61 66 50 74 72 |ndow).{.|.GrafPtr|
|00003510| 09 6f 6c 64 50 6f 72 74 | 3b 0d 09 50 6f 69 6e 74 |.oldPort|;..Point|
|00003520| 09 67 6c 6f 62 61 6c 50 | 74 3b 0d 0d 09 47 65 74 |.globalP|t;...Get|
|00003530| 50 6f 72 74 28 26 6f 6c | 64 50 6f 72 74 29 3b 0d |Port(&ol|dPort);.|
|00003540| 09 53 65 74 50 6f 72 74 | 28 77 69 6e 64 6f 77 29 |.SetPort|(window)|
|00003550| 3b 0d 09 67 6c 6f 62 61 | 6c 50 74 20 3d 20 54 6f |;..globa|lPt = To|
|00003560| 70 4c 65 66 74 28 77 69 | 6e 64 6f 77 2d 3e 70 6f |pLeft(wi|ndow->po|
|00003570| 72 74 52 65 63 74 29 3b | 0d 09 4c 6f 63 61 6c 54 |rtRect);|..LocalT|
|00003580| 6f 47 6c 6f 62 61 6c 28 | 26 67 6c 6f 62 61 6c 50 |oGlobal(|&globalP|
|00003590| 74 29 3b 0d 09 53 65 74 | 50 6f 72 74 28 6f 6c 64 |t);..Set|Port(old|
|000035a0| 50 6f 72 74 29 3b 0d 09 | 72 65 74 75 72 6e 28 67 |Port);..|return(g|
|000035b0| 6c 6f 62 61 6c 50 74 29 | 3b 0d 7d 0d 0d 76 6f 69 |lobalPt)|;.}..voi|
|000035c0| 64 09 4c 6f 63 61 6c 54 | 6f 47 6c 6f 62 61 6c 52 |d.LocalT|oGlobalR|
|000035d0| 65 63 74 28 52 65 63 74 | 20 2a 61 52 65 63 74 29 |ect(Rect| *aRect)|
|000035e0| 0d 7b 0d 09 4c 6f 63 61 | 6c 54 6f 47 6c 6f 62 61 |.{..Loca|lToGloba|
|000035f0| 6c 28 26 54 6f 70 4c 65 | 66 74 28 2a 61 52 65 63 |l(&TopLe|ft(*aRec|
|00003600| 74 29 29 3b 0d 09 4c 6f | 63 61 6c 54 6f 47 6c 6f |t));..Lo|calToGlo|
|00003610| 62 61 6c 28 26 42 6f 74 | 52 69 67 68 74 28 2a 61 |bal(&Bot|Right(*a|
|00003620| 52 65 63 74 29 29 3b 0d | 7d 0d 0d 4f 53 45 72 72 |Rect));.|}..OSErr|
|00003630| 09 53 69 6d 70 6c 65 43 | 61 6e 44 69 61 6c 6f 67 |.SimpleC|anDialog|
|00003640| 28 76 6f 69 64 29 0d 7b | 0d 09 4f 53 45 72 72 09 |(void).{|..OSErr.|
|00003650| 09 09 09 65 72 72 3b 0d | 09 50 72 6f 63 65 73 73 |...err;.|.Process|
|00003660| 53 65 72 69 61 6c 4e 75 | 6d 62 65 72 09 63 70 73 |SerialNu|mber.cps|
|00003670| 6e 2c 20 66 70 73 6e 3b | 0d 09 42 6f 6f 6c 65 61 |n, fpsn;|..Boolea|
|00003680| 6e 09 09 09 09 70 72 6f | 63 73 53 61 6d 65 3b 0d |n....pro|csSame;.|
|00003690| 0d 09 65 72 72 20 3d 20 | 6e 6f 45 72 72 3b 0d 09 |..err = |noErr;..|
|000036a0| 69 66 20 28 67 53 79 73 | 74 65 6d 56 65 72 73 69 |if (gSys|temVersi|
|000036b0| 6f 6e 20 3e 3d 20 30 78 | 30 37 30 30 29 20 7b 0d |on >= 0x|0700) {.|
|000036c0| 09 09 65 72 72 20 3d 20 | 41 45 49 6e 74 65 72 61 |..err = |AEIntera|
|000036d0| 63 74 57 69 74 68 55 73 | 65 72 28 6b 41 45 44 65 |ctWithUs|er(kAEDe|
|000036e0| 66 61 75 6c 74 54 69 6d | 65 6f 75 74 2c 20 6e 69 |faultTim|eout, ni|
|000036f0| 6c 2c 20 6e 69 6c 29 3b | 0d 09 09 09 2f 2a 20 41 |l, nil);|..../* A|
|00003700| 73 6b 20 74 68 65 20 41 | 70 70 6c 65 45 76 65 6e |sk the A|ppleEven|
|00003710| 74 20 4d 61 6e 61 67 65 | 72 20 69 66 20 77 65 20 |t Manage|r if we |
|00003720| 63 61 6e 20 63 6f 6d 65 | 20 66 6f 72 77 61 72 64 |can come| forward|
|00003730| 20 2a 2f 0d 09 09 47 65 | 74 43 75 72 72 65 6e 74 | */...Ge|tCurrent|
|00003740| 50 72 6f 63 65 73 73 28 | 26 63 70 73 6e 29 3b 09 |Process(|&cpsn);.|
|00003750| 09 2f 2a 20 57 65 20 6d | 61 79 20 68 61 76 65 20 |./* We m|ay have |
|00003760| 62 65 65 6e 20 6d 6f 76 | 65 64 20 74 6f 20 74 68 |been mov|ed to th|
|00003770| 65 20 66 72 6f 6e 74 2e | 20 2a 2f 0d 09 09 47 65 |e front.| */...Ge|
|00003780| 74 46 72 6f 6e 74 50 72 | 6f 63 65 73 73 28 26 66 |tFrontPr|ocess(&f|
|00003790| 70 73 6e 29 3b 0d 09 09 | 53 61 6d 65 50 72 6f 63 |psn);...|SameProc|
|000037a0| 65 73 73 28 26 63 70 73 | 6e 2c 20 26 66 70 73 6e |ess(&cps|n, &fpsn|
|000037b0| 2c 20 26 70 72 6f 63 73 | 53 61 6d 65 29 3b 0d 09 |, &procs|Same);..|
|000037c0| 7d 0d 0d 09 72 65 74 75 | 72 6e 28 65 72 72 29 3b |}...retu|rn(err);|
|000037d0| 0d 7d 0d 0d 2f 2a 20 47 | 65 74 41 70 70 52 65 73 |.}../* G|etAppRes|
|000037e0| 6f 75 72 63 65 20 67 65 | 74 73 20 61 20 72 65 73 |ource ge|ts a res|
|000037f0| 6f 75 72 63 65 20 66 72 | 6f 6d 20 74 68 65 20 61 |ource fr|om the a|
|00003800| 70 70 6c 69 63 61 74 69 | 6f 6e 27 73 20 72 65 73 |pplicati|on's res|
|00003810| 6f 75 72 63 65 20 66 69 | 6c 65 20 62 79 0d 2a 2a |ource fi|le by.**|
|00003820| 20 72 65 73 6f 75 72 63 | 65 20 49 44 2e 20 2a 2f | resourc|e ID. */|
|00003830| 0d 0d 48 61 6e 64 6c 65 | 09 47 65 74 41 70 70 52 |..Handle|.GetAppR|
|00003840| 65 73 6f 75 72 63 65 28 | 52 65 73 54 79 70 65 20 |esource(|ResType |
|00003850| 74 68 65 54 79 70 65 2c | 20 73 68 6f 72 74 20 74 |theType,| short t|
|00003860| 68 65 49 44 2c 20 4f 53 | 45 72 72 20 2a 65 72 72 |heID, OS|Err *err|
|00003870| 29 0d 7b 0d 09 73 68 6f | 72 74 09 73 61 76 65 64 |).{..sho|rt.saved|
|00003880| 52 65 73 46 69 6c 65 3b | 0d 09 48 61 6e 64 6c 65 |ResFile;|..Handle|
|00003890| 09 72 65 74 75 72 6e 48 | 61 6e 64 6c 65 3b 0d 0d |.returnH|andle;..|
|000038a0| 09 73 61 76 65 64 52 65 | 73 46 69 6c 65 20 3d 20 |.savedRe|sFile = |
|000038b0| 43 75 72 52 65 73 46 69 | 6c 65 28 29 3b 0d 09 55 |CurResFi|le();..U|
|000038c0| 73 65 52 65 73 46 69 6c | 65 28 67 41 70 70 52 65 |seResFil|e(gAppRe|
|000038d0| 73 52 65 66 29 3b 0d 09 | 72 65 74 75 72 6e 48 61 |sRef);..|returnHa|
|000038e0| 6e 64 6c 65 20 3d 20 47 | 65 74 31 52 65 73 6f 75 |ndle = G|et1Resou|
|000038f0| 72 63 65 28 74 68 65 54 | 79 70 65 2c 20 74 68 65 |rce(theT|ype, the|
|00003900| 49 44 29 3b 0d 09 69 66 | 20 28 65 72 72 29 20 2a |ID);..if| (err) *|
|00003910| 65 72 72 20 3d 20 52 65 | 73 45 72 72 6f 72 28 29 |err = Re|sError()|
|00003920| 3b 0d 09 55 73 65 52 65 | 73 46 69 6c 65 28 73 61 |;..UseRe|sFile(sa|
|00003930| 76 65 64 52 65 73 46 69 | 6c 65 29 3b 0d 09 72 65 |vedResFi|le);..re|
|00003940| 74 75 72 6e 28 72 65 74 | 75 72 6e 48 61 6e 64 6c |turn(ret|urnHandl|
|00003950| 65 29 3b 0d 7d 0d 0d 52 | 67 6e 48 61 6e 64 6c 65 |e);.}..R|gnHandle|
|00003960| 09 4c 6f 63 61 6c 53 63 | 72 65 65 6e 44 65 70 74 |.LocalSc|reenDept|
|00003970| 68 52 65 67 69 6f 6e 28 | 73 68 6f 72 74 20 64 65 |hRegion(|short de|
|00003980| 70 74 68 29 0d 7b 0d 09 | 52 67 6e 48 61 6e 64 6c |pth).{..|RgnHandl|
|00003990| 65 09 72 65 74 52 67 6e | 3b 0d 09 50 6f 69 6e 74 |e.retRgn|;..Point|
|000039a0| 09 09 70 74 3b 0d 0d 09 | 72 65 74 52 67 6e 20 3d |..pt;...|retRgn =|
|000039b0| 20 53 63 72 65 65 6e 44 | 65 70 74 68 52 65 67 69 | ScreenD|epthRegi|
|000039c0| 6f 6e 28 64 65 70 74 68 | 29 3b 0d 0d 09 70 74 2e |on(depth|);...pt.|
|000039d0| 68 20 3d 20 70 74 2e 76 | 20 3d 20 30 3b 0d 09 47 |h = pt.v| = 0;..G|
|000039e0| 6c 6f 62 61 6c 54 6f 4c | 6f 63 61 6c 28 26 70 74 |lobalToL|ocal(&pt|
|000039f0| 29 3b 0d 09 4f 66 66 73 | 65 74 52 67 6e 28 72 65 |);..Offs|etRgn(re|
|00003a00| 74 52 67 6e 2c 20 70 74 | 2e 68 2c 20 70 74 2e 76 |tRgn, pt|.h, pt.v|
|00003a10| 29 3b 0d 0d 09 72 65 74 | 75 72 6e 28 72 65 74 52 |);...ret|urn(retR|
|00003a20| 67 6e 29 3b 0d 7d 0d 0d | 52 67 6e 48 61 6e 64 6c |gn);.}..|RgnHandl|
|00003a30| 65 09 53 63 72 65 65 6e | 44 65 70 74 68 52 65 67 |e.Screen|DepthReg|
|00003a40| 69 6f 6e 28 73 68 6f 72 | 74 20 64 65 70 74 68 29 |ion(shor|t depth)|
|00003a50| 0d 7b 0d 09 52 67 6e 48 | 61 6e 64 6c 65 09 09 72 |.{..RgnH|andle..r|
|00003a60| 65 74 52 67 6e 2c 20 74 | 6d 70 52 67 6e 3b 0d 09 |etRgn, t|mpRgn;..|
|00003a70| 47 44 48 61 6e 64 6c 65 | 09 09 64 65 76 69 63 65 |GDHandle|..device|
|00003a80| 3b 0d 09 50 69 78 4d 61 | 70 48 61 6e 64 6c 65 09 |;..PixMa|pHandle.|
|00003a90| 70 6d 61 70 3b 0d 09 52 | 65 63 74 09 09 09 72 63 |pmap;..R|ect...rc|
|00003aa0| 74 3b 0d 09 47 72 61 66 | 50 74 72 09 09 09 6d 61 |t;..Graf|Ptr...ma|
|00003ab0| 69 6e 50 6f 72 74 3b 0d | 0d 09 72 65 74 52 67 6e |inPort;.|..retRgn|
|00003ac0| 20 3d 20 4e 65 77 52 67 | 6e 28 29 3b 0d 0d 09 69 | = NewRg|n();...i|
|00003ad0| 66 20 28 67 51 44 56 65 | 72 73 69 6f 6e 20 3d 3d |f (gQDVe|rsion ==|
|00003ae0| 20 6b 51 44 4f 72 69 67 | 69 6e 61 6c 29 20 7b 0d | kQDOrig|inal) {.|
|00003af0| 09 09 69 66 20 28 64 65 | 70 74 68 20 3d 3d 20 31 |..if (de|pth == 1|
|00003b00| 29 20 7b 0d 09 09 09 47 | 65 74 57 4d 67 72 50 6f |) {....G|etWMgrPo|
|00003b10| 72 74 28 26 6d 61 69 6e | 50 6f 72 74 29 3b 0d 09 |rt(&main|Port);..|
|00003b20| 09 09 72 63 74 20 3d 20 | 6d 61 69 6e 50 6f 72 74 |..rct = |mainPort|
|00003b30| 2d 3e 70 6f 72 74 52 65 | 63 74 3b 0d 09 09 09 52 |->portRe|ct;....R|
|00003b40| 65 63 74 52 67 6e 28 72 | 65 74 52 67 6e 2c 20 26 |ectRgn(r|etRgn, &|
|00003b50| 72 63 74 29 3b 0d 09 09 | 7d 0d 09 7d 0d 09 65 6c |rct);...|}..}..el|
|00003b60| 73 65 20 7b 0d 09 09 74 | 6d 70 52 67 6e 20 3d 20 |se {...t|mpRgn = |
|00003b70| 4e 65 77 52 67 6e 28 29 | 3b 0d 09 09 66 6f 72 20 |NewRgn()|;...for |
|00003b80| 28 64 65 76 69 63 65 20 | 3d 20 47 65 74 44 65 76 |(device |= GetDev|
|00003b90| 69 63 65 4c 69 73 74 28 | 29 3b 20 64 65 76 69 63 |iceList(|); devic|
|00003ba0| 65 3b 20 64 65 76 69 63 | 65 20 3d 20 47 65 74 4e |e; devic|e = GetN|
|00003bb0| 65 78 74 44 65 76 69 63 | 65 28 64 65 76 69 63 65 |extDevic|e(device|
|00003bc0| 29 29 20 7b 0d 09 09 09 | 69 66 20 28 0d 09 09 09 |)) {....|if (....|
|00003bd0| 09 28 54 65 73 74 44 65 | 76 69 63 65 41 74 74 72 |.(TestDe|viceAttr|
|00003be0| 69 62 75 74 65 28 64 65 | 76 69 63 65 2c 20 73 63 |ibute(de|vice, sc|
|00003bf0| 72 65 65 6e 44 65 76 69 | 63 65 29 29 20 26 26 0d |reenDevi|ce)) &&.|
|00003c00| 09 09 09 09 28 54 65 73 | 74 44 65 76 69 63 65 41 |....(Tes|tDeviceA|
|00003c10| 74 74 72 69 62 75 74 65 | 28 64 65 76 69 63 65 2c |ttribute|(device,|
|00003c20| 20 73 63 72 65 65 6e 41 | 63 74 69 76 65 29 29 0d | screenA|ctive)).|
|00003c30| 09 09 09 29 20 7b 0d 09 | 09 09 09 70 6d 61 70 20 |...) {..|...pmap |
|00003c40| 3d 20 28 2a 64 65 76 69 | 63 65 29 2d 3e 67 64 50 |= (*devi|ce)->gdP|
|00003c50| 4d 61 70 3b 0d 09 09 09 | 09 69 66 20 28 28 2a 70 |Map;....|.if ((*p|
|00003c60| 6d 61 70 29 2d 3e 70 69 | 78 65 6c 53 69 7a 65 20 |map)->pi|xelSize |
|00003c70| 3e 3d 20 64 65 70 74 68 | 29 20 7b 0d 09 09 09 09 |>= depth|) {.....|
|00003c80| 09 72 63 74 20 3d 20 28 | 2a 64 65 76 69 63 65 29 |.rct = (|*device)|
|00003c90| 2d 3e 67 64 52 65 63 74 | 3b 0d 09 09 09 09 09 52 |->gdRect|;......R|
|00003ca0| 65 63 74 52 67 6e 28 74 | 6d 70 52 67 6e 2c 20 26 |ectRgn(t|mpRgn, &|
|00003cb0| 72 63 74 29 3b 0d 09 09 | 09 09 09 55 6e 69 6f 6e |rct);...|...Union|
|00003cc0| 52 67 6e 28 72 65 74 52 | 67 6e 2c 20 74 6d 70 52 |Rgn(retR|gn, tmpR|
|00003cd0| 67 6e 2c 20 72 65 74 52 | 67 6e 29 3b 0d 09 09 09 |gn, retR|gn);....|
|00003ce0| 09 7d 0d 09 09 09 7d 0d | 09 09 7d 0d 09 09 44 69 |.}....}.|..}...Di|
|00003cf0| 73 70 6f 73 65 52 67 6e | 28 74 6d 70 52 67 6e 29 |sposeRgn|(tmpRgn)|
|00003d00| 3b 0d 09 7d 0d 0d 09 72 | 65 74 75 72 6e 28 72 65 |;..}...r|eturn(re|
|00003d10| 74 52 67 6e 29 3b 0d 7d | 0d 0d 2f 2a 20 47 69 76 |tRgn);.}|../* Giv|
|00003d20| 65 6e 20 61 20 77 69 6e | 64 6f 77 20 70 6f 69 6e |en a win|dow poin|
|00003d30| 74 65 72 2c 20 66 69 6e | 64 20 74 68 65 20 64 65 |ter, fin|d the de|
|00003d40| 76 69 63 65 20 74 68 61 | 74 20 63 6f 6e 74 61 69 |vice tha|t contai|
|00003d50| 6e 73 20 6d 6f 73 74 20 | 6f 66 20 74 68 65 20 77 |ns most |of the w|
|00003d60| 69 6e 64 6f 77 0d 2a 2a | 20 61 6e 64 20 72 65 74 |indow.**| and ret|
|00003d70| 75 72 6e 20 74 68 65 20 | 64 65 76 69 63 65 27 73 |urn the |device's|
|00003d80| 20 62 6f 75 6e 64 69 6e | 67 20 72 65 63 74 61 6e | boundin|g rectan|
|00003d90| 67 6c 65 2e 20 20 49 66 | 20 74 68 69 73 20 64 65 |gle. If| this de|
|00003da0| 76 69 63 65 20 69 73 20 | 74 68 65 20 6d 61 69 6e |vice is |the main|
|00003db0| 0d 2a 2a 20 64 65 76 69 | 63 65 2c 20 74 68 65 6e |.** devi|ce, then|
|00003dc0| 20 72 65 6d 6f 76 65 20 | 74 68 65 20 6d 65 6e 75 | remove |the menu|
|00003dd0| 62 61 72 20 61 72 65 61 | 20 66 72 6f 6d 20 74 68 |bar area| from th|
|00003de0| 65 20 72 65 63 74 61 6e | 67 6c 65 2e 20 2a 2f 0d |e rectan|gle. */.|
|00003df0| 0d 52 65 63 74 09 47 65 | 74 57 69 6e 64 6f 77 44 |.Rect.Ge|tWindowD|
|00003e00| 65 76 69 63 65 52 65 63 | 74 4e 4d 42 28 57 69 6e |eviceRec|tNMB(Win|
|00003e10| 64 6f 77 50 74 72 20 77 | 69 6e 64 6f 77 29 0d 7b |dowPtr w|indow).{|
|00003e20| 0d 09 52 65 63 74 09 64 | 65 76 69 63 65 52 65 63 |..Rect.d|eviceRec|
|00003e30| 74 2c 20 74 65 6d 70 52 | 65 63 74 3b 0d 0d 09 53 |t, tempR|ect;...S|
|00003e40| 65 74 52 65 63 74 28 26 | 64 65 76 69 63 65 52 65 |etRect(&|deviceRe|
|00003e50| 63 74 2c 20 30 2c 20 30 | 2c 20 30 2c 20 30 29 3b |ct, 0, 0|, 0, 0);|
|00003e60| 0d 0d 09 69 66 20 28 77 | 69 6e 64 6f 77 29 20 7b |...if (w|indow) {|
|00003e70| 0d 09 09 64 65 76 69 63 | 65 52 65 63 74 20 3d 20 |...devic|eRect = |
|00003e80| 47 65 74 57 69 6e 64 6f | 77 44 65 76 69 63 65 52 |GetWindo|wDeviceR|
|00003e90| 65 63 74 28 77 69 6e 64 | 6f 77 29 3b 0d 09 09 74 |ect(wind|ow);...t|
|00003ea0| 65 6d 70 52 65 63 74 20 | 3d 20 47 65 74 4d 61 69 |empRect |= GetMai|
|00003eb0| 6e 53 63 72 65 65 6e 52 | 65 63 74 28 29 3b 0d 09 |nScreenR|ect();..|
|00003ec0| 09 69 66 20 28 45 71 75 | 61 6c 52 65 63 74 28 26 |.if (Equ|alRect(&|
|00003ed0| 64 65 76 69 63 65 52 65 | 63 74 2c 20 26 74 65 6d |deviceRe|ct, &tem|
|00003ee0| 70 52 65 63 74 29 29 0d | 09 09 09 64 65 76 69 63 |pRect)).|...devic|
|00003ef0| 65 52 65 63 74 2e 74 6f | 70 20 2b 3d 20 47 65 74 |eRect.to|p += Get|
|00003f00| 4d 42 61 72 48 65 69 67 | 68 74 28 29 3b 0d 09 7d |MBarHeig|ht();..}|
|00003f10| 0d 0d 09 72 65 74 75 72 | 6e 28 64 65 76 69 63 65 |...retur|n(device|
|00003f20| 52 65 63 74 29 3b 0d 7d | 0d 0d 52 65 63 74 09 47 |Rect);.}|..Rect.G|
|00003f30| 65 74 4d 61 69 6e 53 63 | 72 65 65 6e 52 65 63 74 |etMainSc|reenRect|
|00003f40| 28 76 6f 69 64 29 0d 7b | 0d 09 47 44 48 61 6e 64 |(void).{|..GDHand|
|00003f50| 6c 65 09 6d 61 69 6e 44 | 65 76 69 63 65 3b 0d 09 |le.mainD|evice;..|
|00003f60| 47 72 61 66 50 74 72 09 | 09 6d 61 69 6e 50 6f 72 |GrafPtr.|.mainPor|
|00003f70| 74 3b 0d 0d 09 69 66 20 | 28 67 51 44 56 65 72 73 |t;...if |(gQDVers|
|00003f80| 69 6f 6e 20 3e 20 6b 51 | 44 4f 72 69 67 69 6e 61 |ion > kQ|DOrigina|
|00003f90| 6c 29 20 7b 0d 09 09 6d | 61 69 6e 44 65 76 69 63 |l) {...m|ainDevic|
|00003fa0| 65 20 3d 20 47 65 74 4d | 61 69 6e 44 65 76 69 63 |e = GetM|ainDevic|
|00003fb0| 65 28 29 3b 0d 09 09 72 | 65 74 75 72 6e 28 28 2a |e();...r|eturn((*|
|00003fc0| 6d 61 69 6e 44 65 76 69 | 63 65 29 2d 3e 67 64 52 |mainDevi|ce)->gdR|
|00003fd0| 65 63 74 29 3b 0d 09 7d | 0d 09 65 6c 73 65 20 7b |ect);..}|..else {|
|00003fe0| 0d 09 09 47 65 74 57 4d | 67 72 50 6f 72 74 28 26 |...GetWM|grPort(&|
|00003ff0| 6d 61 69 6e 50 6f 72 74 | 29 3b 0d 09 09 72 65 74 |mainPort|);...ret|
|00004000| 75 72 6e 28 6d 61 69 6e | 50 6f 72 74 2d 3e 70 6f |urn(main|Port->po|
|00004010| 72 74 52 65 63 74 29 3b | 0d 09 7d 0d 7d 0d 0d 2f |rtRect);|..}.}../|
|00004020| 2a 20 47 69 76 65 6e 20 | 61 20 77 69 6e 64 6f 77 |* Given |a window|
|00004030| 20 70 6f 69 6e 74 65 72 | 2c 20 66 69 6e 64 20 74 | pointer|, find t|
|00004040| 68 65 20 64 65 76 69 63 | 65 20 74 68 61 74 20 63 |he devic|e that c|
|00004050| 6f 6e 74 61 69 6e 73 20 | 6d 6f 73 74 20 6f 66 20 |ontains |most of |
|00004060| 74 68 65 20 77 69 6e 64 | 6f 77 0d 2a 2a 20 61 6e |the wind|ow.** an|
|00004070| 64 20 72 65 74 75 72 6e | 20 74 68 65 20 64 65 76 |d return| the dev|
|00004080| 69 63 65 27 73 20 62 6f | 75 6e 64 69 6e 67 20 72 |ice's bo|unding r|
|00004090| 65 63 74 61 6e 67 6c 65 | 2e 20 2a 2f 0d 0d 52 65 |ectangle|. */..Re|
|000040a0| 63 74 09 47 65 74 57 69 | 6e 64 6f 77 44 65 76 69 |ct.GetWi|ndowDevi|
|000040b0| 63 65 52 65 63 74 28 57 | 69 6e 64 6f 77 50 74 72 |ceRect(W|indowPtr|
|000040c0| 20 77 69 6e 64 6f 77 29 | 0d 7b 0d 09 69 66 20 28 | window)|.{..if (|
|000040d0| 67 51 44 56 65 72 73 69 | 6f 6e 20 3e 20 6b 51 44 |gQDVersi|on > kQD|
|000040e0| 4f 72 69 67 69 6e 61 6c | 29 20 7b 0d 09 09 47 44 |Original|) {...GD|
|000040f0| 48 61 6e 64 6c 65 20 57 | 69 6e 64 6f 77 44 65 76 |Handle W|indowDev|
|00004100| 69 63 65 48 61 6e 64 6c | 65 20 3d 20 47 65 74 52 |iceHandl|e = GetR|
|00004110| 65 63 74 44 65 76 69 63 | 65 28 47 65 74 57 69 6e |ectDevic|e(GetWin|
|00004120| 64 6f 77 53 74 72 75 63 | 74 75 72 65 52 65 63 74 |dowStruc|tureRect|
|00004130| 28 77 69 6e 64 6f 77 29 | 29 3b 0d 09 09 72 65 74 |(window)|);...ret|
|00004140| 75 72 6e 28 28 2a 57 69 | 6e 64 6f 77 44 65 76 69 |urn((*Wi|ndowDevi|
|00004150| 63 65 48 61 6e 64 6c 65 | 29 2d 3e 67 64 52 65 63 |ceHandle|)->gdRec|
|00004160| 74 29 3b 0d 09 7d 20 65 | 6c 73 65 20 7b 0d 09 09 |t);..} e|lse {...|
|00004170| 72 65 74 75 72 6e 28 47 | 65 74 4d 61 69 6e 53 63 |return(G|etMainSc|
|00004180| 72 65 65 6e 52 65 63 74 | 28 29 29 3b 0d 09 7d 0d |reenRect|());..}.|
|00004190| 7d 0d 0d 2f 2a 20 46 69 | 6e 64 20 74 68 65 20 67 |}../* Fi|nd the g|
|000041a0| 72 65 61 74 65 73 74 20 | 6f 76 65 72 6c 61 70 20 |reatest |overlap |
|000041b0| 64 65 76 69 63 65 20 66 | 6f 72 20 74 68 65 20 67 |device f|or the g|
|000041c0| 69 76 65 6e 20 67 6c 6f | 62 61 6c 20 72 65 63 74 |iven glo|bal rect|
|000041d0| 61 6e 67 6c 65 2e 20 2a | 2f 0d 0d 47 44 48 61 6e |angle. *|/..GDHan|
|000041e0| 64 6c 65 09 47 65 74 52 | 65 63 74 44 65 76 69 63 |dle.GetR|ectDevic|
|000041f0| 65 28 52 65 63 74 20 67 | 6c 6f 62 61 6c 52 65 63 |e(Rect g|lobalRec|
|00004200| 74 29 0d 7b 0d 09 6c 6f | 6e 67 09 09 61 72 65 61 |t).{..lo|ng..area|
|00004210| 2c 20 6d 61 78 41 72 65 | 61 3b 0d 09 47 44 48 61 |, maxAre|a;..GDHa|
|00004220| 6e 64 6c 65 09 64 65 76 | 69 63 65 2c 20 64 65 76 |ndle.dev|ice, dev|
|00004230| 69 63 65 54 6f 52 65 74 | 75 72 6e 3b 0d 09 52 65 |iceToRet|urn;..Re|
|00004240| 63 74 09 09 69 6e 74 65 | 72 73 65 63 74 69 6f 6e |ct..inte|rsection|
|00004250| 3b 0d 0d 09 64 65 76 69 | 63 65 54 6f 52 65 74 75 |;...devi|ceToRetu|
|00004260| 72 6e 20 3d 20 47 65 74 | 4d 61 69 6e 44 65 76 69 |rn = Get|MainDevi|
|00004270| 63 65 28 29 3b 09 09 09 | 2f 2a 20 55 73 65 20 61 |ce();...|/* Use a|
|00004280| 73 20 64 65 66 61 75 6c | 74 20 63 68 6f 69 63 65 |s defaul|t choice|
|00004290| 2e 20 2a 2f 0d 09 6d 61 | 78 41 72 65 61 20 3d 20 |. */..ma|xArea = |
|000042a0| 30 3b 0d 0d 09 66 6f 72 | 20 28 64 65 76 69 63 65 |0;...for| (device|
|000042b0| 20 3d 20 47 65 74 44 65 | 76 69 63 65 4c 69 73 74 | = GetDe|viceList|
|000042c0| 28 29 3b 20 64 65 76 69 | 63 65 3b 20 64 65 76 69 |(); devi|ce; devi|
|000042d0| 63 65 20 3d 20 47 65 74 | 4e 65 78 74 44 65 76 69 |ce = Get|NextDevi|
|000042e0| 63 65 28 64 65 76 69 63 | 65 29 29 20 7b 0d 09 09 |ce(devic|e)) {...|
|000042f0| 69 66 20 28 54 65 73 74 | 44 65 76 69 63 65 41 74 |if (Test|DeviceAt|
|00004300| 74 72 69 62 75 74 65 28 | 64 65 76 69 63 65 2c 20 |tribute(|device, |
|00004310| 73 63 72 65 65 6e 44 65 | 76 69 63 65 29 0d 09 09 |screenDe|vice)...|
|00004320| 20 20 26 26 20 54 65 73 | 74 44 65 76 69 63 65 41 | && Tes|tDeviceA|
|00004330| 74 74 72 69 62 75 74 65 | 28 64 65 76 69 63 65 2c |ttribute|(device,|
|00004340| 20 73 63 72 65 65 6e 41 | 63 74 69 76 65 29 0d 09 | screenA|ctive)..|
|00004350| 09 20 20 26 26 20 53 65 | 63 74 52 65 63 74 28 26 |. && Se|ctRect(&|
|00004360| 67 6c 6f 62 61 6c 52 65 | 63 74 2c 20 26 28 28 2a |globalRe|ct, &((*|
|00004370| 64 65 76 69 63 65 29 2d | 3e 67 64 52 65 63 74 29 |device)-|>gdRect)|
|00004380| 2c 20 26 69 6e 74 65 72 | 73 65 63 74 69 6f 6e 29 |, &inter|section)|
|00004390| 29 20 7b 0d 09 09 09 61 | 72 65 61 20 3d 20 28 28 |) {....a|rea = ((|
|000043a0| 6c 6f 6e 67 29 28 69 6e | 74 65 72 73 65 63 74 69 |long)(in|tersecti|
|000043b0| 6f 6e 2e 72 69 67 68 74 | 20 2d 20 69 6e 74 65 72 |on.right| - inter|
|000043c0| 73 65 63 74 69 6f 6e 2e | 6c 65 66 74 29 29 20 2a |section.|left)) *|
|000043d0| 0d 09 09 09 09 20 20 20 | 28 28 6c 6f 6e 67 29 28 |..... |((long)(|
|000043e0| 69 6e 74 65 72 73 65 63 | 74 69 6f 6e 2e 62 6f 74 |intersec|tion.bot|
|000043f0| 74 6f 6d 20 2d 20 69 6e | 74 65 72 73 65 63 74 69 |tom - in|tersecti|
|00004400| 6f 6e 2e 74 6f 70 29 29 | 3b 0d 09 09 09 69 66 20 |on.top))|;....if |
|00004410| 28 61 72 65 61 20 3e 20 | 6d 61 78 41 72 65 61 29 |(area > |maxArea)|
|00004420| 20 7b 0d 09 09 09 09 64 | 65 76 69 63 65 54 6f 52 | {.....d|eviceToR|
|00004430| 65 74 75 72 6e 20 3d 20 | 64 65 76 69 63 65 3b 0d |eturn = |device;.|
|00004440| 09 09 09 09 6d 61 78 41 | 72 65 61 20 3d 20 61 72 |....maxA|rea = ar|
|00004450| 65 61 3b 0d 09 09 09 7d | 0d 09 09 7d 0d 09 7d 0d |ea;....}|...}..}.|
|00004460| 09 72 65 74 75 72 6e 28 | 64 65 76 69 63 65 54 6f |.return(|deviceTo|
|00004470| 52 65 74 75 72 6e 29 3b | 0d 7d 0d 0d 76 6f 69 64 |Return);|.}..void|
|00004480| 09 44 6f 44 72 61 77 31 | 43 6f 6e 74 72 6f 6c 28 |.DoDraw1|Control(|
|00004490| 43 6f 6e 74 72 6f 6c 48 | 61 6e 64 6c 65 20 63 74 |ControlH|andle ct|
|000044a0| 6c 2c 20 42 6f 6f 6c 65 | 61 6e 20 73 63 72 6f 6c |l, Boole|an scrol|
|000044b0| 6c 42 61 72 73 4f 6e 6c | 79 29 0d 7b 0d 09 57 69 |lBarsOnl|y).{..Wi|
|000044c0| 6e 64 6f 77 50 74 72 09 | 77 69 6e 64 6f 77 2c 20 |ndowPtr.|window, |
|000044d0| 6f 6c 64 50 6f 72 74 3b | 0d 09 52 65 63 74 09 09 |oldPort;|..Rect..|
|000044e0| 72 63 74 2c 20 73 72 63 | 74 3b 0d 09 50 6f 69 6e |rct, src|t;..Poin|
|000044f0| 74 09 09 6f 72 67 3b 0d | 09 52 67 6e 48 61 6e 64 |t..org;.|.RgnHand|
|00004500| 6c 65 09 6f 6c 64 43 6c | 69 70 2c 20 6e 65 77 43 |le.oldCl|ip, newC|
|00004510| 6c 69 70 3b 0d 09 42 6f | 6f 6c 65 61 6e 09 09 64 |lip;..Bo|olean..d|
|00004520| 69 64 50 6f 70 75 70 3b | 0d 0d 09 77 69 6e 64 6f |idPopup;|...windo|
|00004530| 77 20 3d 20 28 2a 63 74 | 6c 29 2d 3e 63 6f 6e 74 |w = (*ct|l)->cont|
|00004540| 72 6c 4f 77 6e 65 72 3b | 0d 09 72 63 74 20 20 3d |rlOwner;|..rct =|
|00004550| 20 28 2a 28 77 69 6e 64 | 6f 77 2d 3e 76 69 73 52 | (*(wind|ow->visR|
|00004560| 67 6e 29 29 2d 3e 72 67 | 6e 42 42 6f 78 3b 0d 09 |gn))->rg|nBBox;..|
|00004570| 73 72 63 74 20 3d 20 28 | 2a 28 77 69 6e 64 6f 77 |srct = (|*(window|
|00004580| 2d 3e 63 6c 69 70 52 67 | 6e 29 29 2d 3e 72 67 6e |->clipRg|n))->rgn|
|00004590| 42 42 6f 78 3b 0d 09 53 | 65 63 74 52 65 63 74 28 |BBox;..S|ectRect(|
|000045a0| 26 72 63 74 2c 20 26 73 | 72 63 74 2c 20 26 73 72 |&rct, &s|rct, &sr|
|000045b0| 63 74 29 3b 0d 0d 09 72 | 63 74 20 3d 20 28 2a 63 |ct);...r|ct = (*c|
|000045c0| 74 6c 29 2d 3e 63 6f 6e | 74 72 6c 52 65 63 74 3b |tl)->con|trlRect;|
|000045d0| 0d 09 49 6e 73 65 74 52 | 65 63 74 28 26 72 63 74 |..InsetR|ect(&rct|
|000045e0| 2c 20 2d 34 2c 20 2d 34 | 29 3b 09 2f 2a 20 45 6e |, -4, -4|);./* En|
|000045f0| 63 6c 6f 73 65 20 70 6f | 73 73 69 62 6c 65 20 63 |close po|ssible c|
|00004600| 6f 6e 74 72 6f 6c 20 61 | 64 6f 72 6e 6d 65 6e 74 |ontrol a|dornment|
|00004610| 73 2e 20 2a 2f 0d 09 53 | 65 63 74 52 65 63 74 28 |s. */..S|ectRect(|
|00004620| 26 72 63 74 2c 20 26 73 | 72 63 74 2c 20 26 73 72 |&rct, &s|rct, &sr|
|00004630| 63 74 29 3b 0d 09 69 66 | 20 28 45 6d 70 74 79 52 |ct);..if| (EmptyR|
|00004640| 65 63 74 28 26 73 72 63 | 74 29 29 0d 09 09 69 66 |ect(&src|t))...if|
|00004650| 20 28 21 28 77 69 6e 64 | 6f 77 2d 3e 70 69 63 53 | (!(wind|ow->picS|
|00004660| 61 76 65 29 29 0d 09 09 | 09 72 65 74 75 72 6e 3b |ave))...|.return;|
|00004670| 0d 0d 09 69 66 20 28 49 | 73 53 63 72 6f 6c 6c 42 |...if (I|sScrollB|
|00004680| 61 72 28 63 74 6c 29 29 | 20 7b 0d 09 09 69 66 20 |ar(ctl))| {...if |
|00004690| 28 28 28 57 69 6e 64 6f | 77 50 65 65 6b 29 77 69 |(((Windo|wPeek)wi|
|000046a0| 6e 64 6f 77 29 2d 3e 68 | 69 6c 69 74 65 64 29 0d |ndow)->h|ilited).|
|000046b0| 09 09 09 44 72 61 77 31 | 43 6f 6e 74 72 6f 6c 28 |...Draw1|Control(|
|000046c0| 63 74 6c 29 3b 0d 09 09 | 65 6c 73 65 20 7b 0d 09 |ctl);...|else {..|
|000046d0| 09 09 69 66 20 28 28 2a | 63 74 6c 29 2d 3e 63 6f |..if ((*|ctl)->co|
|000046e0| 6e 74 72 6c 56 69 73 29 | 20 7b 0d 09 09 09 09 47 |ntrlVis)| {.....G|
|000046f0| 65 74 50 6f 72 74 28 26 | 6f 6c 64 50 6f 72 74 29 |etPort(&|oldPort)|
|00004700| 3b 0d 09 09 09 09 53 65 | 74 50 6f 72 74 28 77 69 |;.....Se|tPort(wi|
|00004710| 6e 64 6f 77 29 3b 0d 09 | 09 09 09 72 63 74 20 3d |ndow);..|...rct =|
|00004720| 20 28 2a 63 74 6c 29 2d | 3e 63 6f 6e 74 72 6c 52 | (*ctl)-|>contrlR|
|00004730| 65 63 74 3b 0d 09 09 09 | 09 46 72 61 6d 65 52 65 |ect;....|.FrameRe|
|00004740| 63 74 28 26 72 63 74 29 | 3b 0d 09 09 09 09 49 6e |ct(&rct)|;.....In|
|00004750| 73 65 74 52 65 63 74 28 | 26 72 63 74 2c 20 31 2c |setRect(|&rct, 1,|
|00004760| 20 31 29 3b 0d 09 09 09 | 09 45 72 61 73 65 52 65 | 1);....|.EraseRe|
|00004770| 63 74 28 26 72 63 74 29 | 3b 0d 09 09 09 09 53 65 |ct(&rct)|;.....Se|
|00004780| 74 50 6f 72 74 28 6f 6c | 64 50 6f 72 74 29 3b 0d |tPort(ol|dPort);.|
|00004790| 09 09 09 7d 0d 09 09 7d | 0d 09 7d 0d 09 65 6c 73 |...}...}|..}..els|
|000047a0| 65 20 7b 0d 09 09 69 66 | 20 28 21 73 63 72 6f 6c |e {...if| (!scrol|
|000047b0| 6c 42 61 72 73 4f 6e 6c | 79 29 20 7b 0d 09 09 09 |lBarsOnl|y) {....|
|000047c0| 55 73 65 43 6f 6e 74 72 | 6f 6c 53 74 79 6c 65 28 |UseContr|olStyle(|
|000047d0| 63 74 6c 29 3b 0d 09 09 | 09 64 69 64 50 6f 70 75 |ctl);...|.didPopu|
|000047e0| 70 20 3d 20 66 61 6c 73 | 65 3b 0d 09 09 09 69 66 |p = fals|e;....if|
|000047f0| 20 28 67 50 6f 70 75 70 | 50 72 6f 63 29 20 7b 09 | (gPopup|Proc) {.|
|00004800| 09 2f 2a 20 54 68 65 20 | 70 6f 70 75 70 20 63 6f |./* The |popup co|
|00004810| 6e 74 72 6f 6c 20 64 6f | 65 73 20 6e 6f 74 20 68 |ntrol do|es not h|
|00004820| 61 6e 64 6c 65 20 6e 65 | 67 61 74 69 76 65 20 63 |andle ne|gative c|
|00004830| 6f 6f 72 64 73 2e 20 2a | 2f 0d 09 09 09 09 69 66 |oords. *|/.....if|
|00004840| 20 28 53 74 72 69 70 41 | 64 64 72 65 73 73 28 28 | (StripA|ddress((|
|00004850| 2a 63 74 6c 29 2d 3e 63 | 6f 6e 74 72 6c 44 65 66 |*ctl)->c|ontrlDef|
|00004860| 50 72 6f 63 29 20 3d 3d | 20 53 74 72 69 70 41 64 |Proc) ==| StripAd|
|00004870| 64 72 65 73 73 28 67 50 | 6f 70 75 70 50 72 6f 63 |dress(gP|opupProc|
|00004880| 29 29 20 7b 0d 09 09 09 | 09 09 64 69 64 50 6f 70 |)) {....|..didPop|
|00004890| 75 70 20 3d 20 74 72 75 | 65 3b 0d 09 09 09 09 09 |up = tru|e;......|
|000048a0| 47 65 74 50 6f 72 74 28 | 26 6f 6c 64 50 6f 72 74 |GetPort(|&oldPort|
|000048b0| 29 3b 0d 09 09 09 09 09 | 53 65 74 50 6f 72 74 28 |);......|SetPort(|
|000048c0| 77 69 6e 64 6f 77 29 3b | 0d 09 09 09 09 09 47 65 |window);|......Ge|
|000048d0| 74 43 6c 69 70 28 6f 6c | 64 43 6c 69 70 20 3d 20 |tClip(ol|dClip = |
|000048e0| 4e 65 77 52 67 6e 28 29 | 29 3b 09 2f 2a 20 57 65 |NewRgn()|);./* We|
|000048f0| 20 64 72 61 77 20 69 74 | 20 6f 6e 63 65 2c 20 73 | draw it| once, s|
|00004900| 6f 20 74 68 61 74 20 69 | 6e 74 65 72 6e 61 6c 73 |o that i|nternals|
|00004910| 20 20 20 2a 2f 0d 09 09 | 09 09 09 53 65 74 52 65 | */...|...SetRe|
|00004920| 63 74 28 26 73 72 63 74 | 2c 20 30 2c 20 30 2c 20 |ct(&srct|, 0, 0, |
|00004930| 30 2c 20 30 29 3b 09 09 | 2f 2a 20 61 72 65 20 66 |0, 0);..|/* are f|
|00004940| 69 78 65 64 20 75 70 2e | 20 20 57 65 20 64 6f 6e |ixed up.| We don|
|00004950| 27 74 20 77 61 6e 74 20 | 74 6f 20 73 68 6f 77 20 |'t want |to show |
|00004960| 2a 2f 0d 09 09 09 09 09 | 43 6c 69 70 52 65 63 74 |*/......|ClipRect|
|00004970| 28 26 73 72 63 74 29 3b | 09 09 09 09 2f 2a 20 61 |(&srct);|..../* a|
|00004980| 20 66 6c 61 73 68 20 74 | 68 6f 75 67 68 2e 20 2a | flash t|hough. *|
|00004990| 2f 0d 0d 09 09 09 09 09 | 52 65 63 74 52 67 6e 28 |/.......|RectRgn(|
|000049a0| 6e 65 77 43 6c 69 70 20 | 3d 20 4e 65 77 52 67 6e |newClip |= NewRgn|
|000049b0| 28 29 2c 20 26 28 77 69 | 6e 64 6f 77 2d 3e 70 6f |(), &(wi|ndow->po|
|000049c0| 72 74 52 65 63 74 29 29 | 3b 0d 09 09 09 09 09 6f |rtRect))|;......o|
|000049d0| 72 67 2e 68 20 3d 20 77 | 69 6e 64 6f 77 2d 3e 70 |rg.h = w|indow->p|
|000049e0| 6f 72 74 52 65 63 74 2e | 6c 65 66 74 3b 0d 09 09 |ortRect.|left;...|
|000049f0| 09 09 09 6f 72 67 2e 76 | 20 3d 20 77 69 6e 64 6f |...org.v| = windo|
|00004a00| 77 2d 3e 70 6f 72 74 52 | 65 63 74 2e 74 6f 70 3b |w->portR|ect.top;|
|00004a10| 0d 09 09 09 09 09 53 65 | 74 4f 72 69 67 69 6e 28 |......Se|tOrigin(|
|00004a20| 30 2c 20 30 29 3b 0d 0d | 09 09 09 09 09 4f 66 66 |0, 0);..|.....Off|
|00004a30| 73 65 74 52 65 63 74 28 | 26 28 28 2a 63 74 6c 29 |setRect(|&((*ctl)|
|00004a40| 2d 3e 63 6f 6e 74 72 6c | 52 65 63 74 29 2c 20 2d |->contrl|Rect), -|
|00004a50| 6f 72 67 2e 68 2c 20 2d | 6f 72 67 2e 76 29 3b 09 |org.h, -|org.v);.|
|00004a60| 2f 2a 20 43 6f 6d 70 6c | 65 74 65 6c 79 20 63 6c |/* Compl|etely cl|
|00004a70| 69 70 70 65 64 20 6f 75 | 74 2e 20 2a 2f 0d 09 09 |ipped ou|t. */...|
|00004a80| 09 09 09 44 72 61 77 31 | 43 6f 6e 74 72 6f 6c 28 |...Draw1|Control(|
|00004a90| 63 74 6c 29 3b 09 09 09 | 09 09 09 09 09 09 2f 2a |ctl);...|....../*|
|00004aa0| 20 4a 75 73 74 20 74 6f | 20 66 69 78 20 69 6e 74 | Just to| fix int|
|00004ab0| 65 72 6e 61 6c 73 2e 20 | 20 2a 2f 0d 0d 09 09 09 |ernals. | */.....|
|00004ac0| 09 09 53 65 63 74 52 67 | 6e 28 6e 65 77 43 6c 69 |..SectRg|n(newCli|
|00004ad0| 70 2c 20 6f 6c 64 43 6c | 69 70 2c 20 6e 65 77 43 |p, oldCl|ip, newC|
|00004ae0| 6c 69 70 29 3b 0d 09 09 | 09 09 09 4f 66 66 73 65 |lip);...|...Offse|
|00004af0| 74 52 67 6e 28 6e 65 77 | 43 6c 69 70 2c 20 2d 6f |tRgn(new|Clip, -o|
|00004b00| 72 67 2e 68 2c 20 2d 6f | 72 67 2e 76 29 3b 0d 09 |rg.h, -o|rg.v);..|
|00004b10| 09 09 09 09 53 65 74 43 | 6c 69 70 28 6e 65 77 43 |....SetC|lip(newC|
|00004b20| 6c 69 70 29 3b 0d 09 09 | 09 09 09 44 72 61 77 31 |lip);...|...Draw1|
|00004b30| 43 6f 6e 74 72 6f 6c 28 | 63 74 6c 29 3b 09 09 09 |Control(|ctl);...|
|00004b40| 09 2f 2a 20 4e 6f 77 20 | 72 65 61 6c 6c 79 20 64 |./* Now |really d|
|00004b50| 72 61 77 20 69 74 2e 20 | 2a 2f 0d 0d 09 09 09 09 |raw it. |*/......|
|00004b60| 09 4f 66 66 73 65 74 52 | 65 63 74 28 26 28 28 2a |.OffsetR|ect(&((*|
|00004b70| 63 74 6c 29 2d 3e 63 6f | 6e 74 72 6c 52 65 63 74 |ctl)->co|ntrlRect|
|00004b80| 29 2c 20 6f 72 67 2e 68 | 2c 20 6f 72 67 2e 76 29 |), org.h|, org.v)|
|00004b90| 3b 0d 09 09 09 09 09 53 | 65 74 4f 72 69 67 69 6e |;......S|etOrigin|
|00004ba0| 28 6f 72 67 2e 68 2c 20 | 6f 72 67 2e 76 29 3b 0d |(org.h, |org.v);.|
|00004bb0| 09 09 09 09 09 53 65 74 | 43 6c 69 70 28 6f 6c 64 |.....Set|Clip(old|
|00004bc0| 43 6c 69 70 29 3b 0d 09 | 09 09 09 09 44 69 73 70 |Clip);..|....Disp|
|00004bd0| 6f 73 65 52 67 6e 28 6e | 65 77 43 6c 69 70 29 3b |oseRgn(n|ewClip);|
|00004be0| 0d 09 09 09 09 09 44 69 | 73 70 6f 73 65 52 67 6e |......Di|sposeRgn|
|00004bf0| 28 6f 6c 64 43 6c 69 70 | 29 3b 0d 0d 09 09 09 09 |(oldClip|);......|
|00004c00| 09 53 65 74 50 6f 72 74 | 28 6f 6c 64 50 6f 72 74 |.SetPort|(oldPort|
|00004c10| 29 3b 0d 09 09 09 09 7d | 0d 09 09 09 7d 0d 09 09 |);.....}|....}...|
|00004c20| 09 69 66 20 28 21 64 69 | 64 50 6f 70 75 70 29 20 |.if (!di|dPopup) |
|00004c30| 7b 0d 09 09 09 09 69 66 | 20 28 28 2a 63 74 6c 29 |{.....if| ((*ctl)|
|00004c40| 2d 3e 63 6f 6e 74 72 6c | 56 69 73 29 20 7b 0d 09 |->contrl|Vis) {..|
|00004c50| 09 09 09 09 69 66 20 28 | 67 44 72 61 77 43 6f 6e |....if (|gDrawCon|
|00004c60| 74 72 6f 6c 29 0d 09 09 | 09 09 09 09 28 2a 67 44 |trol)...|....(*gD|
|00004c70| 72 61 77 43 6f 6e 74 72 | 6f 6c 29 28 63 74 6c 29 |rawContr|ol)(ctl)|
|00004c80| 3b 0d 09 09 09 09 09 65 | 6c 73 65 0d 09 09 09 09 |;......e|lse.....|
|00004c90| 09 09 44 72 61 77 31 43 | 6f 6e 74 72 6f 6c 28 63 |..Draw1C|ontrol(c|
|00004ca0| 74 6c 29 3b 0d 09 09 09 | 09 7d 0d 09 09 09 7d 0d |tl);....|.}....}.|
|00004cb0| 09 09 09 55 73 65 43 6f | 6e 74 72 6f 6c 53 74 79 |...UseCo|ntrolSty|
|00004cc0| 6c 65 28 6e 69 6c 29 3b | 0d 09 09 09 69 66 20 28 |le(nil);|....if (|
|00004cd0| 47 65 74 43 6f 6e 74 72 | 6f 6c 56 61 6c 75 65 28 |GetContr|olValue(|
|00004ce0| 63 74 6c 29 20 3d 3d 20 | 31 29 20 7b 0d 09 09 09 |ctl) == |1) {....|
|00004cf0| 09 69 66 20 28 47 65 74 | 42 75 74 74 6f 6e 56 61 |.if (Get|ButtonVa|
|00004d00| 72 69 61 6e 74 28 63 74 | 6c 29 20 3d 3d 20 70 75 |riant(ct|l) == pu|
|00004d10| 73 68 42 75 74 50 72 6f | 63 29 0d 09 09 09 09 09 |shButPro|c)......|
|00004d20| 4f 75 74 6c 69 6e 65 43 | 6f 6e 74 72 6f 6c 28 63 |OutlineC|ontrol(c|
|00004d30| 74 6c 29 3b 0d 09 09 09 | 7d 0d 09 09 7d 0d 09 7d |tl);....|}...}..}|
|00004d40| 0d 7d 0d 0d 76 6f 69 64 | 09 53 68 6f 77 53 74 79 |.}..void|.ShowSty|
|00004d50| 6c 65 64 43 6f 6e 74 72 | 6f 6c 28 43 6f 6e 74 72 |ledContr|ol(Contr|
|00004d60| 6f 6c 48 61 6e 64 6c 65 | 20 63 74 6c 29 0d 7b 0d |olHandle| ctl).{.|
|00004d70| 09 42 6f 6f 6c 65 61 6e | 09 09 64 69 64 50 6f 70 |.Boolean|..didPop|
|00004d80| 75 70 3b 0d 09 57 69 6e | 64 6f 77 50 74 72 09 6f |up;..Win|dowPtr.o|
|00004d90| 6c 64 50 6f 72 74 2c 20 | 77 69 6e 64 6f 77 3b 0d |ldPort, |window;.|
|00004da0| 09 52 67 6e 48 61 6e 64 | 6c 65 09 6f 6c 64 43 6c |.RgnHand|le.oldCl|
|00004db0| 69 70 2c 20 6e 65 77 43 | 6c 69 70 3b 0d 09 50 6f |ip, newC|lip;..Po|
|00004dc0| 69 6e 74 09 09 6f 72 67 | 3b 0d 09 52 65 63 74 09 |int..org|;..Rect.|
|00004dd0| 09 73 72 63 74 3b 0d 0d | 09 69 66 20 28 21 28 2a |.srct;..|.if (!(*|
|00004de0| 63 74 6c 29 2d 3e 63 6f | 6e 74 72 6c 56 69 73 29 |ctl)->co|ntrlVis)|
|00004df0| 20 7b 0d 0d 09 09 64 69 | 64 50 6f 70 75 70 20 3d | {....di|dPopup =|
|00004e00| 20 66 61 6c 73 65 3b 0d | 09 09 69 66 20 28 67 50 | false;.|..if (gP|
|00004e10| 6f 70 75 70 50 72 6f 63 | 29 20 7b 09 09 2f 2a 20 |opupProc|) {../* |
|00004e20| 54 68 65 20 70 6f 70 75 | 70 20 63 6f 6e 74 72 6f |The popu|p contro|
|00004e30| 6c 20 64 6f 65 73 20 6e | 6f 74 20 68 61 6e 64 6c |l does n|ot handl|
|00004e40| 65 20 6e 65 67 61 74 69 | 76 65 20 63 6f 6f 72 64 |e negati|ve coord|
|00004e50| 73 2e 20 2a 2f 0d 09 09 | 09 69 66 20 28 53 74 72 |s. */...|.if (Str|
|00004e60| 69 70 41 64 64 72 65 73 | 73 28 28 2a 63 74 6c 29 |ipAddres|s((*ctl)|
|00004e70| 2d 3e 63 6f 6e 74 72 6c | 44 65 66 50 72 6f 63 29 |->contrl|DefProc)|
|00004e80| 20 3d 3d 20 53 74 72 69 | 70 41 64 64 72 65 73 73 | == Stri|pAddress|
|00004e90| 28 67 50 6f 70 75 70 50 | 72 6f 63 29 29 20 7b 0d |(gPopupP|roc)) {.|
|00004ea0| 09 09 09 09 64 69 64 50 | 6f 70 75 70 20 3d 20 74 |....didP|opup = t|
|00004eb0| 72 75 65 3b 0d 09 09 09 | 09 47 65 74 50 6f 72 74 |rue;....|.GetPort|
|00004ec0| 28 26 6f 6c 64 50 6f 72 | 74 29 3b 0d 09 09 09 09 |(&oldPor|t);.....|
|00004ed0| 53 65 74 50 6f 72 74 28 | 77 69 6e 64 6f 77 20 3d |SetPort(|window =|
|00004ee0| 20 28 2a 63 74 6c 29 2d | 3e 63 6f 6e 74 72 6c 4f | (*ctl)-|>contrlO|
|00004ef0| 77 6e 65 72 29 3b 0d 09 | 09 09 09 47 65 74 43 6c |wner);..|...GetCl|
|00004f00| 69 70 28 6f 6c 64 43 6c | 69 70 20 3d 20 4e 65 77 |ip(oldCl|ip = New|
|00004f10| 52 67 6e 28 29 29 3b 09 | 2f 2a 20 57 65 20 64 72 |Rgn());.|/* We dr|
|00004f20| 61 77 20 69 74 20 6f 6e | 63 65 2c 20 73 6f 20 74 |aw it on|ce, so t|
|00004f30| 68 61 74 20 69 6e 74 65 | 72 6e 61 6c 73 20 20 20 |hat inte|rnals |
|00004f40| 2a 2f 0d 09 09 09 09 53 | 65 74 52 65 63 74 28 26 |*/.....S|etRect(&|
|00004f50| 73 72 63 74 2c 20 30 2c | 20 30 2c 20 30 2c 20 30 |srct, 0,| 0, 0, 0|
|00004f60| 29 3b 09 09 2f 2a 20 61 | 72 65 20 66 69 78 65 64 |);../* a|re fixed|
|00004f70| 20 75 70 2e 20 20 57 65 | 20 64 6f 6e 27 74 20 77 | up. We| don't w|
|00004f80| 61 6e 74 20 74 6f 20 73 | 68 6f 77 20 2a 2f 0d 09 |ant to s|how */..|
|00004f90| 09 09 09 43 6c 69 70 52 | 65 63 74 28 26 73 72 63 |...ClipR|ect(&src|
|00004fa0| 74 29 3b 09 09 09 09 2f | 2a 20 61 20 66 6c 61 73 |t);..../|* a flas|
|00004fb0| 68 20 74 68 6f 75 67 68 | 2e 20 2a 2f 0d 0d 09 09 |h though|. */....|
|00004fc0| 09 09 52 65 63 74 52 67 | 6e 28 6e 65 77 43 6c 69 |..RectRg|n(newCli|
|00004fd0| 70 20 3d 20 4e 65 77 52 | 67 6e 28 29 2c 20 26 28 |p = NewR|gn(), &(|
|00004fe0| 77 69 6e 64 6f 77 2d 3e | 70 6f 72 74 52 65 63 74 |window->|portRect|
|00004ff0| 29 29 3b 0d 09 09 09 09 | 6f 72 67 2e 68 20 3d 20 |));.....|org.h = |
|00005000| 77 69 6e 64 6f 77 2d 3e | 70 6f 72 74 52 65 63 74 |window->|portRect|
|00005010| 2e 6c 65 66 74 3b 0d 09 | 09 09 09 6f 72 67 2e 76 |.left;..|...org.v|
|00005020| 20 3d 20 77 69 6e 64 6f | 77 2d 3e 70 6f 72 74 52 | = windo|w->portR|
|00005030| 65 63 74 2e 74 6f 70 3b | 0d 09 09 09 09 53 65 74 |ect.top;|.....Set|
|00005040| 4f 72 69 67 69 6e 28 30 | 2c 20 30 29 3b 0d 0d 09 |Origin(0|, 0);...|
|00005050| 09 09 09 55 73 65 43 6f | 6e 74 72 6f 6c 53 74 79 |...UseCo|ntrolSty|
|00005060| 6c 65 28 63 74 6c 29 3b | 0d 09 09 09 09 4f 66 66 |le(ctl);|.....Off|
|00005070| 73 65 74 52 65 63 74 28 | 26 28 28 2a 63 74 6c 29 |setRect(|&((*ctl)|
|00005080| 2d 3e 63 6f 6e 74 72 6c | 52 65 63 74 29 2c 20 2d |->contrl|Rect), -|
|00005090| 6f 72 67 2e 68 2c 20 2d | 6f 72 67 2e 76 29 3b 09 |org.h, -|org.v);.|
|000050a0| 2f 2a 20 43 6f 6d 70 6c | 65 74 65 6c 79 20 63 6c |/* Compl|etely cl|
|000050b0| 69 70 70 65 64 20 6f 75 | 74 2e 20 2a 2f 0d 09 09 |ipped ou|t. */...|
|000050c0| 09 09 53 68 6f 77 43 6f | 6e 74 72 6f 6c 28 63 74 |..ShowCo|ntrol(ct|
|000050d0| 6c 29 3b 09 09 09 09 09 | 09 09 09 09 2f 2a 20 4a |l);.....|..../* J|
|000050e0| 75 73 74 20 74 6f 20 66 | 69 78 20 69 6e 74 65 72 |ust to f|ix inter|
|000050f0| 6e 61 6c 73 2e 20 20 2a | 2f 0d 09 09 09 09 44 72 |nals. *|/.....Dr|
|00005100| 61 77 31 43 6f 6e 74 72 | 6f 6c 28 63 74 6c 29 3b |aw1Contr|ol(ctl);|
|00005110| 0d 0d 09 09 09 09 53 65 | 63 74 52 67 6e 28 6e 65 |......Se|ctRgn(ne|
|00005120| 77 43 6c 69 70 2c 20 6f | 6c 64 43 6c 69 70 2c 20 |wClip, o|ldClip, |
|00005130| 6e 65 77 43 6c 69 70 29 | 3b 0d 09 09 09 09 4f 66 |newClip)|;.....Of|
|00005140| 66 73 65 74 52 67 6e 28 | 6e 65 77 43 6c 69 70 2c |fsetRgn(|newClip,|
|00005150| 20 2d 6f 72 67 2e 68 2c | 20 2d 6f 72 67 2e 76 29 | -org.h,| -org.v)|
|00005160| 3b 0d 09 09 09 09 53 65 | 74 43 6c 69 70 28 6e 65 |;.....Se|tClip(ne|
|00005170| 77 43 6c 69 70 29 3b 0d | 09 09 09 09 44 72 61 77 |wClip);.|....Draw|
|00005180| 31 43 6f 6e 74 72 6f 6c | 28 63 74 6c 29 3b 09 09 |1Control|(ctl);..|
|00005190| 09 09 2f 2a 20 4e 6f 77 | 20 72 65 61 6c 6c 79 20 |../* Now| really |
|000051a0| 73 68 6f 77 20 69 74 2e | 20 2a 2f 0d 09 09 09 09 |show it.| */.....|
|000051b0| 55 73 65 43 6f 6e 74 72 | 6f 6c 53 74 79 6c 65 28 |UseContr|olStyle(|
|000051c0| 6e 69 6c 29 3b 0d 0d 09 | 09 09 09 4f 66 66 73 65 |nil);...|...Offse|
|000051d0| 74 52 65 63 74 28 26 28 | 28 2a 63 74 6c 29 2d 3e |tRect(&(|(*ctl)->|
|000051e0| 63 6f 6e 74 72 6c 52 65 | 63 74 29 2c 20 6f 72 67 |contrlRe|ct), org|
|000051f0| 2e 68 2c 20 6f 72 67 2e | 76 29 3b 0d 09 09 09 09 |.h, org.|v);.....|
|00005200| 53 65 74 4f 72 69 67 69 | 6e 28 6f 72 67 2e 68 2c |SetOrigi|n(org.h,|
|00005210| 20 6f 72 67 2e 76 29 3b | 0d 09 09 09 09 53 65 74 | org.v);|.....Set|
|00005220| 43 6c 69 70 28 6f 6c 64 | 43 6c 69 70 29 3b 0d 09 |Clip(old|Clip);..|
|00005230| 09 09 09 44 69 73 70 6f | 73 65 52 67 6e 28 6e 65 |...Dispo|seRgn(ne|
|00005240| 77 43 6c 69 70 29 3b 0d | 09 09 09 09 44 69 73 70 |wClip);.|....Disp|
|00005250| 6f 73 65 52 67 6e 28 6f | 6c 64 43 6c 69 70 29 3b |oseRgn(o|ldClip);|
|00005260| 0d 0d 09 09 09 09 53 65 | 74 50 6f 72 74 28 6f 6c |......Se|tPort(ol|
|00005270| 64 50 6f 72 74 29 3b 0d | 09 09 09 7d 0d 09 09 7d |dPort);.|...}...}|
|00005280| 0d 0d 09 09 69 66 20 28 | 21 64 69 64 50 6f 70 75 |....if (|!didPopu|
|00005290| 70 29 20 7b 0d 09 09 09 | 28 2a 63 74 6c 29 2d 3e |p) {....|(*ctl)->|
|000052a0| 63 6f 6e 74 72 6c 56 69 | 73 20 3d 20 32 35 35 3b |contrlVi|s = 255;|
|000052b0| 0d 09 09 09 44 6f 44 72 | 61 77 31 43 6f 6e 74 72 |....DoDr|aw1Contr|
|000052c0| 6f 6c 28 63 74 6c 2c 20 | 66 61 6c 73 65 29 3b 0d |ol(ctl, |false);.|
|000052d0| 09 09 7d 0d 09 7d 0d 7d | 0d 0d 76 6f 69 64 09 55 |..}..}.}|..void.U|
|000052e0| 73 65 43 6f 6e 74 72 6f | 6c 53 74 79 6c 65 28 43 |seContro|lStyle(C|
|000052f0| 6f 6e 74 72 6f 6c 48 61 | 6e 64 6c 65 20 63 74 6c |ontrolHa|ndle ctl|
|00005300| 29 0d 7b 0d 09 57 69 6e | 64 6f 77 50 74 72 09 09 |).{..Win|dowPtr..|
|00005310| 09 6f 6c 64 50 6f 72 74 | 3b 0d 09 73 68 6f 72 74 |.oldPort|;..short|
|00005320| 09 09 09 09 66 6e 75 6d | 3b 0d 09 43 6f 6e 74 72 |....fnum|;..Contr|
|00005330| 6f 6c 53 74 79 6c 65 49 | 6e 66 6f 09 63 69 6e 66 |olStyleI|nfo.cinf|
|00005340| 6f 3b 0d 09 73 74 61 74 | 69 63 20 73 68 6f 72 74 |o;..stat|ic short|
|00005350| 09 09 74 78 46 6f 6e 74 | 2c 20 74 78 53 69 7a 65 |..txFont|, txSize|
|00005360| 3b 0d 09 73 74 61 74 69 | 63 20 53 74 79 6c 65 09 |;..stati|c Style.|
|00005370| 09 74 78 46 61 63 65 3b | 0d 09 73 74 61 74 69 63 |.txFace;|..static|
|00005380| 20 57 69 6e 64 6f 77 50 | 74 72 09 63 74 6c 57 69 | WindowP|tr.ctlWi|
|00005390| 6e 64 6f 77 3b 0d 0d 09 | 69 66 20 28 21 63 74 6c |ndow;...|if (!ctl|
|000053a0| 29 20 7b 0d 09 09 67 44 | 72 61 77 43 6f 6e 74 72 |) {...gD|rawContr|
|000053b0| 6f 6c 20 3d 20 6e 69 6c | 3b 0d 09 09 69 66 20 28 |ol = nil|;...if (|
|000053c0| 63 74 6c 57 69 6e 64 6f | 77 29 20 7b 0d 09 09 09 |ctlWindo|w) {....|
|000053d0| 47 65 74 50 6f 72 74 28 | 26 6f 6c 64 50 6f 72 74 |GetPort(|&oldPort|
|000053e0| 29 3b 0d 09 09 09 53 65 | 74 50 6f 72 74 28 63 74 |);....Se|tPort(ct|
|000053f0| 6c 57 69 6e 64 6f 77 29 | 3b 0d 09 09 09 54 65 78 |lWindow)|;....Tex|
|00005400| 74 46 6f 6e 74 28 74 78 | 46 6f 6e 74 29 3b 0d 09 |tFont(tx|Font);..|
|00005410| 09 09 54 65 78 74 53 69 | 7a 65 28 74 78 53 69 7a |..TextSi|ze(txSiz|
|00005420| 65 29 3b 0d 09 09 09 54 | 65 78 74 46 61 63 65 28 |e);....T|extFace(|
|00005430| 74 78 46 61 63 65 29 3b | 0d 09 09 09 53 65 74 50 |txFace);|....SetP|
|00005440| 6f 72 74 28 6f 6c 64 50 | 6f 72 74 29 3b 0d 09 09 |ort(oldP|ort);...|
|00005450| 7d 0d 09 09 72 65 74 75 | 72 6e 3b 0d 09 7d 0d 0d |}...retu|rn;..}..|
|00005460| 09 63 74 6c 57 69 6e 64 | 6f 77 20 3d 20 6e 69 6c |.ctlWind|ow = nil|
|00005470| 3b 0d 09 69 66 20 28 47 | 65 74 43 6f 6e 74 72 6f |;..if (G|etContro|
|00005480| 6c 53 74 79 6c 65 28 63 | 74 6c 2c 20 26 63 69 6e |lStyle(c|tl, &cin|
|00005490| 66 6f 29 29 20 7b 0d 09 | 09 67 44 72 61 77 43 6f |fo)) {..|.gDrawCo|
|000054a0| 6e 74 72 6f 6c 20 3d 20 | 63 69 6e 66 6f 2e 64 72 |ntrol = |cinfo.dr|
|000054b0| 61 77 43 6f 6e 74 72 6f | 6c 3b 0d 09 09 69 66 20 |awContro|l;...if |
|000054c0| 28 47 65 74 43 6f 6e 74 | 72 6f 6c 56 61 72 69 61 |(GetCont|rolVaria|
|000054d0| 6e 74 28 63 74 6c 29 20 | 26 20 70 6f 70 75 70 55 |nt(ctl) |& popupU|
|000054e0| 73 65 57 46 6f 6e 74 29 | 20 7b 0d 09 09 09 47 65 |seWFont)| {....Ge|
|000054f0| 74 50 6f 72 74 28 26 6f | 6c 64 50 6f 72 74 29 3b |tPort(&o|ldPort);|
|00005500| 0d 09 09 09 53 65 74 50 | 6f 72 74 28 63 74 6c 57 |....SetP|ort(ctlW|
|00005510| 69 6e 64 6f 77 20 3d 20 | 28 2a 63 74 6c 29 2d 3e |indow = |(*ctl)->|
|00005520| 63 6f 6e 74 72 6c 4f 77 | 6e 65 72 29 3b 0d 09 09 |contrlOw|ner);...|
|00005530| 09 74 78 46 6f 6e 74 20 | 3d 20 63 74 6c 57 69 6e |.txFont |= ctlWin|
|00005540| 64 6f 77 2d 3e 74 78 46 | 6f 6e 74 3b 0d 09 09 09 |dow->txF|ont;....|
|00005550| 74 78 53 69 7a 65 20 3d | 20 63 74 6c 57 69 6e 64 |txSize =| ctlWind|
|00005560| 6f 77 2d 3e 74 78 53 69 | 7a 65 3b 0d 09 09 09 74 |ow->txSi|ze;....t|
|00005570| 78 46 61 63 65 20 3d 20 | 63 74 6c 57 69 6e 64 6f |xFace = |ctlWindo|
|00005580| 77 2d 3e 74 78 46 61 63 | 65 3b 0d 09 09 09 54 65 |w->txFac|e;....Te|
|00005590| 78 74 46 61 63 65 28 63 | 69 6e 66 6f 2e 66 6f 6e |xtFace(c|info.fon|
|000055a0| 74 53 74 79 6c 65 29 3b | 0d 09 09 09 66 6e 75 6d |tStyle);|....fnum|
|000055b0| 20 3d 20 73 79 73 74 65 | 6d 46 6f 6e 74 3b 0d 09 | = syste|mFont;..|
|000055c0| 09 09 69 66 20 28 63 69 | 6e 66 6f 2e 66 6f 6e 74 |..if (ci|nfo.font|
|000055d0| 5b 30 5d 29 0d 09 09 09 | 09 47 65 74 46 4e 75 6d |[0])....|.GetFNum|
|000055e0| 28 63 69 6e 66 6f 2e 66 | 6f 6e 74 2c 20 26 66 6e |(cinfo.f|ont, &fn|
|000055f0| 75 6d 29 3b 0d 09 09 09 | 54 65 78 74 46 6f 6e 74 |um);....|TextFont|
|00005600| 28 66 6e 75 6d 29 3b 0d | 09 09 09 54 65 78 74 53 |(fnum);.|...TextS|
|00005610| 69 7a 65 28 63 69 6e 66 | 6f 2e 66 6f 6e 74 53 69 |ize(cinf|o.fontSi|
|00005620| 7a 65 29 3b 0d 09 09 09 | 53 65 74 50 6f 72 74 28 |ze);....|SetPort(|
|00005630| 6f 6c 64 50 6f 72 74 29 | 3b 0d 09 09 7d 0d 09 7d |oldPort)|;...}..}|
|00005640| 0d 7d 0d 0d 42 6f 6f 6c | 65 61 6e 09 47 65 74 43 |.}..Bool|ean.GetC|
|00005650| 6f 6e 74 72 6f 6c 53 74 | 79 6c 65 28 43 6f 6e 74 |ontrolSt|yle(Cont|
|00005660| 72 6f 6c 48 61 6e 64 6c | 65 20 63 74 6c 2c 20 76 |rolHandl|e ctl, v|
|00005670| 6f 69 64 20 2a 63 69 6e | 66 6f 29 0d 7b 0d 09 73 |oid *cin|fo).{..s|
|00005680| 68 6f 72 74 09 63 6c 65 | 6e 2c 20 74 6c 65 6e 2c |hort.cle|n, tlen,|
|00005690| 20 6f 66 73 74 2c 20 6f | 66 73 74 32 2c 20 6f 66 | ofst, o|fst2, of|
|000056a0| 73 74 33 3b 0d 09 50 74 | 72 09 09 70 74 72 3b 0d |st3;..Pt|r..ptr;.|
|000056b0| 0d 09 63 6c 65 6e 20 3d | 20 47 65 74 48 61 6e 64 |..clen =| GetHand|
|000056c0| 6c 65 53 69 7a 65 28 28 | 48 61 6e 64 6c 65 29 63 |leSize((|Handle)c|
|000056d0| 74 6c 29 3b 0d 09 74 6c | 65 6e 20 3d 20 28 2a 63 |tl);..tl|en = (*c|
|000056e0| 74 6c 29 2d 3e 63 6f 6e | 74 72 6c 54 69 74 6c 65 |tl)->con|trlTitle|
|000056f0| 5b 30 5d 3b 0d 09 6f 66 | 73 74 20 3d 20 6f 66 66 |[0];..of|st = off|
|00005700| 73 65 74 6f 66 28 43 6f | 6e 74 72 6f 6c 52 65 63 |setof(Co|ntrolRec|
|00005710| 6f 72 64 2c 63 6f 6e 74 | 72 6c 54 69 74 6c 65 29 |ord,cont|rlTitle)|
|00005720| 20 2b 20 74 6c 65 6e 20 | 2b 20 31 3b 0d 09 69 66 | + tlen |+ 1;..if|
|00005730| 20 28 63 6c 65 6e 20 3c | 20 6f 66 73 74 20 2b 20 | (clen <| ofst + |
|00005740| 73 69 7a 65 6f 66 28 73 | 68 6f 72 74 29 29 20 72 |sizeof(s|hort)) r|
|00005750| 65 74 75 72 6e 28 66 61 | 6c 73 65 29 3b 0d 0d 09 |eturn(fa|lse);...|
|00005760| 69 66 20 28 63 69 6e 66 | 6f 29 20 7b 0d 09 09 70 |if (cinf|o) {...p|
|00005770| 74 72 20 3d 20 28 50 74 | 72 29 2a 63 74 6c 3b 0d |tr = (Pt|r)*ctl;.|
|00005780| 09 09 42 6c 6f 63 6b 4d | 6f 76 65 28 70 74 72 20 |..BlockM|ove(ptr |
|00005790| 2b 20 6f 66 73 74 2c 20 | 28 50 74 72 29 63 69 6e |+ ofst, |(Ptr)cin|
|000057a0| 66 6f 2c 20 63 6c 65 6e | 20 2d 20 6f 66 73 74 29 |fo, clen| - ofst)|
|000057b0| 3b 0d 09 09 70 74 72 20 | 20 20 3d 20 28 50 74 72 |;...ptr | = (Ptr|
|000057c0| 29 63 69 6e 66 6f 3b 0d | 09 09 6f 66 73 74 20 20 |)cinfo;.|..ofst |
|000057d0| 3d 20 6f 66 66 73 65 74 | 6f 66 28 43 6f 6e 74 72 |= offset|of(Contr|
|000057e0| 6f 6c 53 74 79 6c 65 49 | 6e 66 6f 2c 66 6f 6e 74 |olStyleI|nfo,font|
|000057f0| 29 3b 09 09 2f 2a 20 66 | 6f 6e 74 20 2a 2f 0d 09 |);../* f|ont */..|
|00005800| 09 6f 66 73 74 32 20 3d | 20 6f 66 73 74 20 20 2b |.ofst2 =| ofst +|
|00005810| 20 70 74 72 5b 6f 66 73 | 74 5d 20 20 2b 20 31 3b | ptr[ofs|t] + 1;|
|00005820| 09 09 09 09 09 2f 2a 20 | 6b 65 79 45 71 75 69 76 |...../* |keyEquiv|
|00005830| 73 20 2a 2f 0d 09 09 6f | 66 73 74 33 20 3d 20 6f |s */...o|fst3 = o|
|00005840| 66 73 74 32 20 2b 20 70 | 74 72 5b 6f 66 73 74 32 |fst2 + p|tr[ofst2|
|00005850| 5d 20 2b 20 31 3b 09 09 | 09 09 09 2f 2a 20 62 61 |] + 1;..|.../* ba|
|00005860| 6c 6c 6f 6f 6e 48 65 6c | 70 20 2a 2f 0d 09 09 42 |lloonHel|p */...B|
|00005870| 6c 6f 63 6b 4d 6f 76 65 | 28 70 74 72 20 2b 20 6f |lockMove|(ptr + o|
|00005880| 66 73 74 33 2c 20 70 74 | 72 20 2b 20 6f 66 66 73 |fst3, pt|r + offs|
|00005890| 65 74 6f 66 28 43 6f 6e | 74 72 6f 6c 53 74 79 6c |etof(Con|trolStyl|
|000058a0| 65 49 6e 66 6f 2c 62 61 | 6c 6c 6f 6f 6e 48 65 6c |eInfo,ba|lloonHel|
|000058b0| 70 29 2c 20 70 74 72 5b | 6f 66 73 74 33 5d 20 2b |p), ptr[|ofst3] +|
|000058c0| 20 31 29 3b 0d 09 09 42 | 6c 6f 63 6b 4d 6f 76 65 | 1);...B|lockMove|
|000058d0| 28 70 74 72 20 2b 20 6f | 66 73 74 32 2c 20 70 74 |(ptr + o|fst2, pt|
|000058e0| 72 20 2b 20 6f 66 66 73 | 65 74 6f 66 28 43 6f 6e |r + offs|etof(Con|
|000058f0| 74 72 6f 6c 53 74 79 6c | 65 49 6e 66 6f 2c 6b 65 |trolStyl|eInfo,ke|
|00005900| 79 45 71 75 69 76 73 29 | 2c 20 20 20 70 74 72 5b |yEquivs)|, ptr[|
|00005910| 6f 66 73 74 32 5d 20 2b | 20 31 29 3b 0d 09 7d 0d |ofst2] +| 1);..}.|
|00005920| 0d 09 72 65 74 75 72 6e | 28 74 72 75 65 29 3b 0d |..return|(true);.|
|00005930| 7d 0d 0d 42 6f 6f 6c 65 | 61 6e 09 49 73 53 63 72 |}..Boole|an.IsScr|
|00005940| 6f 6c 6c 42 61 72 28 43 | 6f 6e 74 72 6f 6c 48 61 |ollBar(C|ontrolHa|
|00005950| 6e 64 6c 65 20 63 74 6c | 29 0d 7b 0d 09 52 65 63 |ndle ctl|).{..Rec|
|00005960| 74 09 09 09 64 75 6d 6d | 79 3b 0d 09 43 6f 6e 74 |t...dumm|y;..Cont|
|00005970| 72 6f 6c 48 61 6e 64 6c | 65 09 64 75 6d 6d 79 43 |rolHandl|e.dummyC|
|00005980| 74 6c 3b 0d 0d 09 69 66 | 20 28 21 63 74 6c 29 20 |tl;...if| (!ctl) |
|00005990| 72 65 74 75 72 6e 28 66 | 61 6c 73 65 29 3b 0d 0d |return(f|alse);..|
|000059a0| 09 69 66 20 28 21 67 53 | 63 72 6f 6c 6c 50 72 6f |.if (!gS|crollPro|
|000059b0| 63 29 20 7b 0d 09 09 53 | 65 74 52 65 63 74 28 26 |c) {...S|etRect(&|
|000059c0| 64 75 6d 6d 79 2c 20 30 | 2c 20 30 2c 20 31 36 2c |dummy, 0|, 0, 16,|
|000059d0| 20 31 30 30 29 3b 0d 09 | 09 64 75 6d 6d 79 43 74 | 100);..|.dummyCt|
|000059e0| 6c 20 3d 20 4e 65 77 43 | 6f 6e 74 72 6f 6c 28 28 |l = NewC|ontrol((|
|000059f0| 2a 63 74 6c 29 2d 3e 63 | 6f 6e 74 72 6c 4f 77 6e |*ctl)->c|ontrlOwn|
|00005a00| 65 72 2c 20 26 64 75 6d | 6d 79 2c 20 28 43 6f 6e |er, &dum|my, (Con|
|00005a10| 73 74 53 74 72 32 35 35 | 50 61 72 61 6d 29 22 5c |stStr255|Param)"\|
|00005a20| 70 22 2c 0d 09 09 09 09 | 09 09 09 20 20 66 61 6c |p",.....|... fal|
|00005a30| 73 65 2c 20 31 2c 20 30 | 2c 20 31 2c 20 73 63 72 |se, 1, 0|, 1, scr|
|00005a40| 6f 6c 6c 42 61 72 50 72 | 6f 63 2c 20 30 4c 29 3b |ollBarPr|oc, 0L);|
|00005a50| 0d 09 09 69 66 20 28 64 | 75 6d 6d 79 43 74 6c 29 |...if (d|ummyCtl)|
|00005a60| 20 7b 0d 09 09 09 67 53 | 63 72 6f 6c 6c 50 72 6f | {....gS|crollPro|
|00005a70| 63 20 3d 20 28 2a 64 75 | 6d 6d 79 43 74 6c 29 2d |c = (*du|mmyCtl)-|
|00005a80| 3e 63 6f 6e 74 72 6c 44 | 65 66 50 72 6f 63 3b 0d |>contrlD|efProc;.|
|00005a90| 09 09 09 44 69 73 70 6f | 73 65 43 6f 6e 74 72 6f |...Dispo|seContro|
|00005aa0| 6c 28 64 75 6d 6d 79 43 | 74 6c 29 3b 0d 09 09 7d |l(dummyC|tl);...}|
|00005ab0| 0d 09 7d 0d 0d 09 72 65 | 74 75 72 6e 28 53 74 72 |..}...re|turn(Str|
|00005ac0| 69 70 41 64 64 72 65 73 | 73 28 28 2a 63 74 6c 29 |ipAddres|s((*ctl)|
|00005ad0| 2d 3e 63 6f 6e 74 72 6c | 44 65 66 50 72 6f 63 29 |->contrl|DefProc)|
|00005ae0| 20 3d 3d 20 53 74 72 69 | 70 41 64 64 72 65 73 73 | == Stri|pAddress|
|00005af0| 28 67 53 63 72 6f 6c 6c | 50 72 6f 63 29 29 3b 0d |(gScroll|Proc));.|
|00005b00| 09 09 2f 2a 20 54 68 65 | 20 68 61 6e 64 6c 65 20 |../* The| handle |
|00005b10| 6d 61 79 20 62 65 20 6c | 6f 63 6b 65 64 2c 20 77 |may be l|ocked, w|
|00005b20| 68 69 63 68 20 6d 65 61 | 6e 73 20 74 68 61 74 20 |hich mea|ns that |
|00005b30| 74 68 65 20 68 69 2d 62 | 69 74 0d 09 09 2a 2a 20 |the hi-b|it...** |
|00005b40| 6d 61 79 20 62 65 20 6f | 6e 2c 20 74 68 75 73 20 |may be o|n, thus |
|00005b50| 69 6e 76 61 6c 69 64 61 | 74 69 6e 67 20 74 68 65 |invalida|ting the|
|00005b60| 20 63 6f 6d 70 61 72 65 | 2e 20 20 44 65 72 65 66 | compare|. Deref|
|00005b70| 65 72 65 6e 63 65 20 74 | 68 65 0d 09 09 2a 2a 20 |erence t|he...** |
|00005b80| 68 61 6e 64 6c 65 73 20 | 74 6f 20 67 65 74 20 72 |handles |to get r|
|00005b90| 69 64 20 6f 66 20 74 68 | 69 73 20 70 6f 73 73 69 |id of th|is possi|
|00005ba0| 62 69 6c 69 74 79 2e 20 | 2a 2f 0d 7d 0d 0d 2f 2a |bility. |*/.}../*|
|00005bb0| 20 54 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 72 | This fu|nction r|
|00005bc0| 65 74 75 72 6e 73 20 77 | 68 69 63 68 20 6b 69 6e |eturns w|hich kin|
|00005bd0| 64 20 6f 66 20 62 75 74 | 74 6f 6e 20 74 68 65 20 |d of but|ton the |
|00005be0| 63 6f 6e 74 72 6f 6c 20 | 69 73 2e 20 20 54 68 69 |control |is. Thi|
|00005bf0| 73 20 64 6f 65 73 20 6d | 6f 72 65 0d 2a 2a 20 74 |s does m|ore.** t|
|00005c00| 68 61 6e 20 47 65 74 43 | 56 61 72 69 61 6e 74 20 |han GetC|Variant |
|00005c10| 69 6e 20 74 68 61 74 20 | 69 74 20 6d 61 6b 65 73 |in that |it makes|
|00005c20| 20 73 75 72 65 20 74 68 | 61 74 20 74 68 65 20 63 | sure th|at the c|
|00005c30| 6f 6e 74 72 6f 6c 20 69 | 73 20 61 63 74 75 61 6c |ontrol i|s actual|
|00005c40| 6c 79 20 61 0d 2a 2a 20 | 62 75 74 74 6f 6e 2e 20 |ly a.** |button. |
|00005c50| 20 49 74 20 64 6f 65 73 | 20 74 68 69 73 20 62 79 | It does| this by|
|00005c60| 20 63 6f 6d 70 61 72 69 | 6e 67 20 74 68 65 20 64 | compari|ng the d|
|00005c70| 65 66 50 72 6f 63 20 61 | 67 61 69 6e 73 74 20 74 |efProc a|gainst t|
|00005c80| 68 65 20 6b 6e 6f 77 6e | 20 64 65 66 50 72 6f 63 |he known| defProc|
|00005c90| 0d 2a 2a 20 66 6f 72 20 | 74 68 65 20 76 61 72 69 |.** for |the vari|
|00005ca0| 6f 75 73 20 62 75 74 74 | 6f 6e 20 74 79 70 65 73 |ous butt|on types|
|00005cb0| 2e 20 20 46 6f 72 20 37 | 2e 30 2c 20 74 68 65 72 |. For 7|.0, ther|
|00005cc0| 65 20 69 73 20 6f 6e 6c | 79 20 6f 6e 65 20 64 65 |e is onl|y one de|
|00005cd0| 66 50 72 6f 63 20 66 6f | 72 20 61 6c 6c 0d 2a 2a |fProc fo|r all.**|
|00005ce0| 20 76 61 72 69 61 6e 74 | 73 2c 20 62 75 74 20 66 | variant|s, but f|
|00005cf0| 6f 72 20 70 72 65 2d 37 | 2e 30 2c 20 74 68 65 72 |or pre-7|.0, ther|
|00005d00| 65 20 69 73 20 6f 6e 65 | 20 64 65 66 50 72 6f 63 |e is one| defProc|
|00005d10| 20 76 61 6c 75 65 20 66 | 6f 72 20 65 61 63 68 20 | value f|or each |
|00005d20| 76 61 72 69 61 6e 74 2e | 0d 2a 2a 20 54 68 65 20 |variant.|.** The |
|00005d30| 6d 65 74 68 6f 64 20 62 | 65 6c 6f 77 20 68 61 6e |method b|elow han|
|00005d40| 64 6c 65 73 20 65 69 74 | 68 65 72 20 63 61 73 65 |dles eit|her case|
|00005d50| 2e 20 2a 2f 0d 0d 73 68 | 6f 72 74 09 47 65 74 42 |. */..sh|ort.GetB|
|00005d60| 75 74 74 6f 6e 56 61 72 | 69 61 6e 74 28 43 6f 6e |uttonVar|iant(Con|
|00005d70| 74 72 6f 6c 48 61 6e 64 | 6c 65 20 63 74 6c 29 0d |trolHand|le ctl).|
|00005d80| 7b 0d 09 73 68 6f 72 74 | 09 09 09 69 3b 0d 09 52 |{..short|...i;..R|
|00005d90| 65 63 74 09 09 09 64 75 | 6d 6d 79 3b 0d 09 43 6f |ect...du|mmy;..Co|
|00005da0| 6e 74 72 6f 6c 48 61 6e | 64 6c 65 09 64 75 6d 6d |ntrolHan|dle.dumm|
|00005db0| 79 43 74 6c 3b 0d 0d 09 | 69 66 20 28 63 74 6c 29 |yCtl;...|if (ctl)|
|00005dc0| 20 7b 0d 0d 2f 2a 0d 09 | 09 69 66 20 28 67 47 65 | {../*..|.if (gGe|
|00005dd0| 74 42 75 74 74 6f 6e 56 | 61 72 69 61 6e 74 29 20 |tButtonV|ariant) |
|00005de0| 7b 0d 09 09 09 73 74 6f | 70 20 3d 20 66 61 6c 73 |{....sto|p = fals|
|00005df0| 65 3b 0d 09 09 09 69 20 | 3d 20 28 2a 67 47 65 74 |e;....i |= (*gGet|
|00005e00| 42 75 74 74 6f 6e 56 61 | 72 69 61 6e 74 29 28 63 |ButtonVa|riant)(c|
|00005e10| 74 6c 2c 20 26 73 74 6f | 70 29 3b 0d 09 09 09 69 |tl, &sto|p);....i|
|00005e20| 66 20 28 69 20 3e 3d 20 | 30 29 20 72 65 74 75 72 |f (i >= |0) retur|
|00005e30| 6e 28 69 29 3b 0d 09 09 | 09 69 66 20 28 73 74 6f |n(i);...|.if (sto|
|00005e40| 70 29 20 20 20 72 65 74 | 75 72 6e 28 2d 31 29 3b |p) ret|urn(-1);|
|00005e50| 0d 09 09 7d 0d 2a 2f 0d | 0d 09 09 66 6f 72 20 28 |...}.*/.|...for (|
|00005e60| 69 20 3d 20 70 75 73 68 | 42 75 74 50 72 6f 63 3b |i = push|ButProc;|
|00005e70| 20 69 20 3c 3d 20 72 61 | 64 69 6f 42 75 74 50 72 | i <= ra|dioButPr|
|00005e80| 6f 63 20 2b 20 70 6f 70 | 75 70 55 73 65 57 46 6f |oc + pop|upUseWFo|
|00005e90| 6e 74 3b 20 2b 2b 69 29 | 20 7b 0d 09 09 09 69 66 |nt; ++i)| {....if|
|00005ea0| 20 28 69 20 3d 3d 20 72 | 61 64 69 6f 42 75 74 50 | (i == r|adioButP|
|00005eb0| 72 6f 63 20 2b 20 31 29 | 0d 09 09 09 09 69 20 3d |roc + 1)|.....i =|
|00005ec0| 20 70 75 73 68 42 75 74 | 50 72 6f 63 20 2b 20 70 | pushBut|Proc + p|
|00005ed0| 6f 70 75 70 55 73 65 57 | 46 6f 6e 74 3b 0d 09 09 |opupUseW|Font;...|
|00005ee0| 09 69 66 20 28 21 67 42 | 75 74 74 6f 6e 50 72 6f |.if (!gB|uttonPro|
|00005ef0| 63 73 5b 69 5d 29 20 7b | 0d 09 09 09 09 53 65 74 |cs[i]) {|.....Set|
|00005f00| 52 65 63 74 28 26 64 75 | 6d 6d 79 2c 20 30 2c 20 |Rect(&du|mmy, 0, |
|00005f10| 30 2c 20 30 2c 20 30 29 | 3b 0d 09 09 09 09 64 75 |0, 0, 0)|;.....du|
|00005f20| 6d 6d 79 43 74 6c 20 3d | 20 4e 65 77 43 6f 6e 74 |mmyCtl =| NewCont|
|00005f30| 72 6f 6c 28 28 2a 63 74 | 6c 29 2d 3e 63 6f 6e 74 |rol((*ct|l)->cont|
|00005f40| 72 6c 4f 77 6e 65 72 2c | 20 26 64 75 6d 6d 79 2c |rlOwner,| &dummy,|
|00005f50| 20 28 43 6f 6e 73 74 53 | 74 72 32 35 35 50 61 72 | (ConstS|tr255Par|
|00005f60| 61 6d 29 22 5c 70 22 2c | 0d 09 09 09 09 09 09 09 |am)"\p",|........|
|00005f70| 09 09 20 20 66 61 6c 73 | 65 2c 20 31 2c 20 30 2c |.. fals|e, 1, 0,|
|00005f80| 20 31 2c 20 69 2c 20 30 | 4c 29 3b 0d 09 09 09 09 | 1, i, 0|L);.....|
|00005f90| 69 66 20 28 64 75 6d 6d | 79 43 74 6c 29 20 7b 0d |if (dumm|yCtl) {.|
|00005fa0| 09 09 09 09 09 67 42 75 | 74 74 6f 6e 50 72 6f 63 |.....gBu|ttonProc|
|00005fb0| 73 5b 69 5d 20 3d 20 28 | 2a 64 75 6d 6d 79 43 74 |s[i] = (|*dummyCt|
|00005fc0| 6c 29 2d 3e 63 6f 6e 74 | 72 6c 44 65 66 50 72 6f |l)->cont|rlDefPro|
|00005fd0| 63 3b 0d 09 09 09 09 09 | 44 69 73 70 6f 73 65 43 |c;......|DisposeC|
|00005fe0| 6f 6e 74 72 6f 6c 28 64 | 75 6d 6d 79 43 74 6c 29 |ontrol(d|ummyCtl)|
|00005ff0| 3b 0d 09 09 09 09 7d 0d | 09 09 09 7d 0d 09 09 09 |;.....}.|...}....|
|00006000| 69 66 20 28 53 74 72 69 | 70 41 64 64 72 65 73 73 |if (Stri|pAddress|
|00006010| 28 28 2a 63 74 6c 29 2d | 3e 63 6f 6e 74 72 6c 44 |((*ctl)-|>contrlD|
|00006020| 65 66 50 72 6f 63 29 20 | 3d 3d 20 53 74 72 69 70 |efProc) |== Strip|
|00006030| 41 64 64 72 65 73 73 28 | 67 42 75 74 74 6f 6e 50 |Address(|gButtonP|
|00006040| 72 6f 63 73 5b 69 5d 29 | 29 0d 09 09 09 09 72 65 |rocs[i])|).....re|
|00006050| 74 75 72 6e 28 47 65 74 | 43 6f 6e 74 72 6f 6c 56 |turn(Get|ControlV|
|00006060| 61 72 69 61 6e 74 28 63 | 74 6c 29 20 26 20 28 30 |ariant(c|tl) & (0|
|00006070| 78 46 46 46 46 20 2d 20 | 70 6f 70 75 70 55 73 65 |xFFFF - |popupUse|
|00006080| 57 46 6f 6e 74 29 29 3b | 0d 09 09 09 09 09 2f 2a |WFont));|....../*|
|00006090| 20 54 68 65 20 68 61 6e | 64 6c 65 20 6d 61 79 20 | The han|dle may |
|000060a0| 62 65 20 6c 6f 63 6b 65 | 64 2c 20 77 68 69 63 68 |be locke|d, which|
|000060b0| 20 6d 65 61 6e 73 20 74 | 68 61 74 20 74 68 65 20 | means t|hat the |
|000060c0| 68 69 2d 62 69 74 0d 09 | 09 09 09 09 2a 2a 20 6d |hi-bit..|....** m|
|000060d0| 61 79 20 62 65 20 6f 6e | 2c 20 74 68 75 73 20 69 |ay be on|, thus i|
|000060e0| 6e 76 61 6c 69 64 61 74 | 69 6e 67 20 74 68 65 20 |nvalidat|ing the |
|000060f0| 63 6f 6d 70 61 72 65 2e | 20 20 44 65 72 65 66 65 |compare.| Derefe|
|00006100| 72 65 6e 63 65 20 74 68 | 65 0d 09 09 09 09 09 2a |rence th|e......*|
|00006110| 2a 20 68 61 6e 64 6c 65 | 73 20 74 6f 20 67 65 74 |* handle|s to get|
|00006120| 20 72 69 64 20 6f 66 20 | 74 68 69 73 20 70 6f 73 | rid of |this pos|
|00006130| 73 69 62 69 6c 69 74 79 | 2e 20 2a 2f 0d 09 09 7d |sibility|. */...}|
|00006140| 0d 09 7d 0d 0d 09 72 65 | 74 75 72 6e 28 2d 31 29 |..}...re|turn(-1)|
|00006150| 3b 0d 7d 0d 0d 42 6f 6f | 6c 65 61 6e 09 57 68 69 |;.}..Boo|lean.Whi|
|00006160| 63 68 43 6f 6e 74 72 6f | 6c 28 50 6f 69 6e 74 20 |chContro|l(Point |
|00006170| 6d 6f 75 73 65 4c 6f 63 | 2c 20 6c 6f 6e 67 20 77 |mouseLoc|, long w|
|00006180| 68 65 6e 2c 20 57 69 6e | 64 6f 77 50 74 72 20 77 |hen, Win|dowPtr w|
|00006190| 69 6e 64 6f 77 2c 20 43 | 6f 6e 74 72 6f 6c 48 61 |indow, C|ontrolHa|
|000061a0| 6e 64 6c 65 20 2a 63 74 | 6c 48 69 74 29 0d 7b 0d |ndle *ct|lHit).{.|
|000061b0| 09 42 6f 6f 6c 65 61 6e | 09 09 09 09 09 66 6f 75 |.Boolean|.....fou|
|000061c0| 6e 64 3b 0d 09 52 65 63 | 74 09 09 09 09 09 72 63 |nd;..Rec|t.....rc|
|000061d0| 74 3b 0d 09 43 6f 6e 74 | 72 6f 6c 48 61 6e 64 6c |t;..Cont|rolHandl|
|000061e0| 65 09 09 09 63 74 6c 2c | 20 6c 61 73 74 43 74 6c |e...ctl,| lastCtl|
|000061f0| 3b 0d 09 73 74 61 74 69 | 63 20 43 6f 6e 74 72 6f |;..stati|c Contro|
|00006200| 6c 48 61 6e 64 6c 65 09 | 6c 61 73 74 57 68 65 6e |lHandle.|lastWhen|
|00006210| 43 74 6c 3b 0d 0d 09 67 | 57 68 69 63 68 43 74 6c |Ctl;...g|WhichCtl|
|00006220| 54 72 61 63 6b 69 6e 67 | 20 3d 20 66 61 6c 73 65 |Tracking| = false|
|00006230| 3b 0d 0d 09 66 6f 75 6e | 64 20 20 20 3d 20 66 61 |;...foun|d = fa|
|00006240| 6c 73 65 3b 0d 09 6c 61 | 73 74 43 74 6c 20 3d 20 |lse;..la|stCtl = |
|00006250| 6e 69 6c 3b 0d 0d 09 69 | 66 20 28 63 74 6c 48 69 |nil;...i|f (ctlHi|
|00006260| 74 29 0d 09 09 2a 63 74 | 6c 48 69 74 20 3d 20 6e |t)...*ct|lHit = n|
|00006270| 69 6c 3b 0d 0d 09 69 66 | 20 28 77 69 6e 64 6f 77 |il;...if| (window|
|00006280| 29 20 7b 0d 09 09 63 74 | 6c 20 3d 20 28 28 57 69 |) {...ct|l = ((Wi|
|00006290| 6e 64 6f 77 50 65 65 6b | 29 77 69 6e 64 6f 77 29 |ndowPeek|)window)|
|000062a0| 2d 3e 63 6f 6e 74 72 6f | 6c 4c 69 73 74 3b 0d 09 |->contro|lList;..|
|000062b0| 09 77 68 69 6c 65 20 28 | 63 74 6c 29 20 7b 0d 09 |.while (|ctl) {..|
|000062c0| 09 09 69 66 20 28 28 2a | 63 74 6c 29 2d 3e 63 6f |..if ((*|ctl)->co|
|000062d0| 6e 74 72 6c 56 69 73 29 | 20 7b 0d 09 09 09 09 72 |ntrlVis)| {.....r|
|000062e0| 63 74 20 3d 20 28 2a 63 | 74 6c 29 2d 3e 63 6f 6e |ct = (*c|tl)->con|
|000062f0| 74 72 6c 52 65 63 74 3b | 0d 09 09 09 09 69 66 20 |trlRect;|.....if |
|00006300| 28 50 74 49 6e 52 65 63 | 74 28 6d 6f 75 73 65 4c |(PtInRec|t(mouseL|
|00006310| 6f 63 2c 20 26 72 63 74 | 29 29 20 7b 0d 09 09 09 |oc, &rct|)) {....|
|00006320| 09 09 66 6f 75 6e 64 20 | 3d 20 74 72 75 65 3b 09 |..found |= true;.|
|00006330| 09 09 2f 2a 20 52 65 74 | 75 72 6e 20 74 68 65 20 |../* Ret|urn the |
|00006340| 6c 61 73 74 20 68 69 74 | 20 69 6e 20 74 68 65 20 |last hit| in the |
|00006350| 6c 69 6e 6b 65 64 20 6c | 69 73 74 2c 20 61 73 20 |linked l|ist, as |
|00006360| 2a 2f 0d 09 09 09 09 09 | 6c 61 73 74 43 74 6c 20 |*/......|lastCtl |
|00006370| 3d 20 63 74 6c 3b 09 09 | 09 2f 2a 20 69 74 20 69 |= ctl;..|./* it i|
|00006380| 73 20 64 72 61 77 6e 20 | 6c 61 73 74 2c 20 61 6e |s drawn |last, an|
|00006390| 64 20 74 68 65 72 65 66 | 6f 72 65 20 6f 6e 20 74 |d theref|ore on t|
|000063a0| 6f 70 2e 20 20 20 20 2a | 2f 0d 09 09 09 09 7d 0d |op. *|/.....}.|
|000063b0| 09 09 09 7d 0d 09 09 09 | 63 74 6c 20 3d 20 28 2a |...}....|ctl = (*|
|000063c0| 63 74 6c 29 2d 3e 6e 65 | 78 74 43 6f 6e 74 72 6f |ctl)->ne|xtContro|
|000063d0| 6c 3b 0d 09 09 7d 0d 09 | 7d 0d 0d 09 69 66 20 28 |l;...}..|}...if (|
|000063e0| 63 74 6c 48 69 74 29 0d | 09 09 2a 63 74 6c 48 69 |ctlHit).|..*ctlHi|
|000063f0| 74 20 3d 20 6c 61 73 74 | 43 74 6c 3b 0d 0d 09 67 |t = last|Ctl;...g|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.