home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / source / luschsrc.sit / text.c.bin < prev    next >
MacBinary  |  1990-05-23  |  11.6 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

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

You can browse this item here: text.c.bin

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


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 06 74 65 78 74 2e 63 | 00 00 00 00 00 00 00 00 |..text.c|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 2d ea 00 | 00 00 00 a0 0c 8d 7a a1 |.....-..|......z.|
|00000060| 8e d8 98 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000080| 2f 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |/*******|********|
|00000090| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000000d0| 2a 0d 20 2a 09 74 65 78 | 74 2e 63 0d 20 2a 0d 20 |*. *.tex|t.c. *. |
|000000e0| 2a 09 54 65 78 74 20 57 | 69 6e 64 6f 77 20 4d 61 |*.Text W|indow Ma|
|000000f0| 6e 61 67 65 6d 65 6e 74 | 20 50 61 63 6b 61 67 65 |nagement| Package|
|00000100| 0d 20 2a 0d 20 2a 09 a9 | 31 39 38 39 2c 20 4d 6f |. *. *..|1989, Mo|
|00000110| 74 6f 72 6f 6c 61 20 49 | 6e 63 2e 20 20 41 6c 6c |torola I|nc. All|
|00000120| 20 72 69 67 68 74 73 20 | 72 65 73 65 72 76 65 64 | rights |reserved|
|00000130| 2e 0d 20 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.. *****|********|
|00000140| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000150| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000160| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000170| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000180| 2a 2a 2a 2f 0d 0d 0d 23 | 69 6e 63 6c 75 64 65 20 |***/...#|include |
|00000190| 22 61 70 70 6c 69 63 2e | 68 22 0d 23 69 6e 63 6c |"applic.|h".#incl|
|000001a0| 75 64 65 20 22 77 69 6e | 64 6f 77 2e 68 22 0d 23 |ude "win|dow.h".#|
|000001b0| 69 6e 63 6c 75 64 65 20 | 22 74 65 78 74 2e 68 22 |include |"text.h"|
|000001c0| 0d 0d 0d 2f 2a 20 43 72 | 65 61 74 65 20 61 20 77 |.../* Cr|eate a w|
|000001d0| 69 6e 64 6f 77 20 69 6e | 66 6f 20 68 61 6e 64 6c |indow in|fo handl|
|000001e0| 65 20 77 69 74 68 20 61 | 20 74 65 78 74 20 69 74 |e with a| text it|
|000001f0| 65 6d 0d 20 2a 2f 0d 57 | 69 6e 64 6f 77 50 74 72 |em. */.W|indowPtr|
|00000200| 0d 54 65 78 74 57 69 6e | 64 6f 77 20 28 77 69 6e |.TextWin|dow (win|
|00000210| 64 49 44 2c 20 74 6f 70 | 2c 20 6c 65 66 74 2c 20 |dID, top|, left, |
|00000220| 69 73 41 63 74 69 76 65 | 29 0d 09 72 65 67 69 73 |isActive|)..regis|
|00000230| 74 65 72 20 57 4f 52 44 | 20 77 69 6e 64 49 44 3b |ter WORD| windID;|
|00000240| 0d 09 72 65 67 69 73 74 | 65 72 20 57 4f 52 44 20 |..regist|er WORD |
|00000250| 74 6f 70 2c 20 6c 65 66 | 74 3b 0d 09 72 65 67 69 |top, lef|t;..regi|
|00000260| 73 74 65 72 20 42 6f 6f | 6c 65 61 6e 20 69 73 41 |ster Boo|lean isA|
|00000270| 63 74 69 76 65 3b 0d 7b | 0d 09 72 65 67 69 73 74 |ctive;.{|..regist|
|00000280| 65 72 20 57 69 6e 64 6f | 77 50 74 72 20 74 68 65 |er Windo|wPtr the|
|00000290| 57 69 6e 64 6f 77 3b 0d | 09 72 65 67 69 73 74 65 |Window;.|.registe|
|000002a0| 72 20 49 6e 66 6f 50 74 | 72 20 69 6e 66 6f 50 74 |r InfoPt|r infoPt|
|000002b0| 72 3b 0d 09 52 65 63 74 | 20 64 65 73 74 52 65 63 |r;..Rect| destRec|
|000002c0| 74 2c 20 76 69 65 77 52 | 65 63 74 3b 0d 09 47 72 |t, viewR|ect;..Gr|
|000002d0| 61 66 50 74 72 20 73 61 | 76 65 50 6f 72 74 3b 0d |afPtr sa|vePort;.|
|000002e0| 0d 09 69 66 20 28 74 68 | 65 57 69 6e 64 6f 77 20 |..if (th|eWindow |
|000002f0| 3d 20 57 69 6e 64 41 6c | 6c 6f 63 61 74 65 28 77 |= WindAl|locate(w|
|00000300| 69 6e 64 49 44 2c 20 69 | 73 41 63 74 69 76 65 29 |indID, i|sActive)|
|00000310| 29 20 7b 0d 09 09 47 65 | 74 50 6f 72 74 28 26 73 |) {...Ge|tPort(&s|
|00000320| 61 76 65 50 6f 72 74 29 | 3b 0d 09 09 53 65 74 50 |avePort)|;...SetP|
|00000330| 6f 72 74 28 74 68 65 57 | 69 6e 64 6f 77 29 3b 0d |ort(theW|indow);.|
|00000340| 09 0d 09 09 2f 2a 20 53 | 65 74 75 70 20 74 68 65 |..../* S|etup the|
|00000350| 20 77 69 6e 64 6f 77 20 | 67 72 61 66 20 70 6f 72 | window |graf por|
|00000360| 74 0d 09 09 20 2a 2f 0d | 09 09 69 6e 66 6f 50 74 |t... */.|..infoPt|
|00000370| 72 20 3d 20 28 49 6e 66 | 6f 50 74 72 29 20 47 65 |r = (Inf|oPtr) Ge|
|00000380| 74 57 52 65 66 43 6f 6e | 28 74 68 65 57 69 6e 64 |tWRefCon|(theWind|
|00000390| 6f 77 29 3b 0d 09 09 53 | 65 74 52 65 63 74 28 26 |ow);...S|etRect(&|
|000003a0| 28 69 6e 66 6f 50 74 72 | 2d 3e 6f 66 66 73 65 74 |(infoPtr|->offset|
|000003b0| 29 2c 20 74 6f 70 2c 20 | 6c 65 66 74 2c 20 31 30 |), top, |left, 10|
|000003c0| 30 2c 20 31 30 30 29 3b | 0d 09 09 69 6e 66 6f 50 |0, 100);|...infoP|
|000003d0| 74 72 2d 3e 6b 69 6e 64 | 20 3d 20 77 6b 54 65 78 |tr->kind| = wkTex|
|000003e0| 74 3b 0d 09 09 09 0d 09 | 09 54 65 78 74 46 6f 6e |t;......|.TextFon|
|000003f0| 74 28 46 4f 4e 54 4e 55 | 4d 29 3b 0d 09 09 54 65 |t(FONTNU|M);...Te|
|00000400| 78 74 53 69 7a 65 28 46 | 4f 4e 54 53 49 5a 45 29 |xtSize(F|ONTSIZE)|
|00000410| 3b 0d 09 09 09 0d 09 09 | 2f 2a 20 43 72 65 61 74 |;.......|/* Creat|
|00000420| 65 20 74 68 65 20 54 45 | 20 61 6e 64 20 74 68 65 |e the TE| and the|
|00000430| 20 73 63 72 6f 6c 6c 62 | 61 72 0d 09 09 20 2a 2f | scrollb|ar... */|
|00000440| 0d 09 09 76 69 65 77 52 | 65 63 74 20 3d 20 64 65 |...viewR|ect = de|
|00000450| 73 74 52 65 63 74 20 3d | 20 74 68 65 57 69 6e 64 |stRect =| theWind|
|00000460| 6f 77 2d 3e 70 6f 72 74 | 52 65 63 74 3b 0d 09 09 |ow->port|Rect;...|
|00000470| 69 6e 66 6f 50 74 72 2d | 3e 69 74 65 6d 2e 74 65 |infoPtr-|>item.te|
|00000480| 78 74 2e 74 65 48 64 6c | 20 3d 20 54 45 4e 65 77 |xt.teHdl| = TENew|
|00000490| 28 26 64 65 73 74 52 65 | 63 74 2c 20 26 76 69 65 |(&destRe|ct, &vie|
|000004a0| 77 52 65 63 74 29 3b 0d | 09 20 09 69 6e 66 6f 50 |wRect);.|. .infoP|
|000004b0| 74 72 2d 3e 69 74 65 6d | 2e 74 65 78 74 2e 73 63 |tr->item|.text.sc|
|000004c0| 72 6f 6c 6c 20 3d 09 4e | 65 77 43 6f 6e 74 72 6f |roll =.N|ewContro|
|000004d0| 6c 28 74 68 65 57 69 6e | 64 6f 77 2c 20 26 76 69 |l(theWin|dow, &vi|
|000004e0| 65 77 52 65 63 74 2c 20 | 22 5c 70 56 22 2c 20 46 |ewRect, |"\pV", F|
|000004f0| 41 4c 53 45 2c 20 30 2c | 20 30 2c 20 30 2c 20 73 |ALSE, 0,| 0, 0, s|
|00000500| 63 72 6f 6c 6c 42 61 72 | 50 72 6f 63 2c 20 4e 55 |crollBar|Proc, NU|
|00000510| 4c 4c 29 3b 0d 0d 09 09 | 2f 2a 20 46 69 74 20 69 |LL);....|/* Fit i|
|00000520| 6e 74 6f 20 74 68 65 20 | 77 69 6e 64 6f 77 0d 09 |nto the |window..|
|00000530| 09 20 2a 2f 0d 09 09 54 | 65 78 74 41 64 6a 75 73 |. */...T|extAdjus|
|00000540| 74 28 74 68 65 57 69 6e | 64 6f 77 29 3b 0d 09 09 |t(theWin|dow);...|
|00000550| 54 65 78 74 57 69 6e 64 | 52 65 73 65 74 28 74 68 |TextWind|Reset(th|
|00000560| 65 57 69 6e 64 6f 77 29 | 3b 0d 09 09 54 65 78 74 |eWindow)|;...Text|
|00000570| 41 63 74 69 76 61 74 65 | 28 69 73 41 63 74 69 76 |Activate|(isActiv|
|00000580| 65 2c 20 74 68 65 57 69 | 6e 64 6f 77 29 3b 0d 0d |e, theWi|ndow);..|
|00000590| 09 09 53 65 74 50 6f 72 | 74 28 73 61 76 65 50 6f |..SetPor|t(savePo|
|000005a0| 72 74 29 3b 0d 09 7d 0d | 0d 09 72 65 74 75 72 6e |rt);..}.|..return|
|000005b0| 20 74 68 65 57 69 6e 64 | 6f 77 3b 0d 7d 0d 0d 0d | theWind|ow;.}...|
|000005c0| 2f 2a 20 52 65 73 69 7a | 65 20 74 68 65 20 74 65 |/* Resiz|e the te|
|000005d0| 78 74 20 65 64 69 74 20 | 76 69 65 77 20 72 65 63 |xt edit |view rec|
|000005e0| 74 20 61 6e 64 20 73 63 | 72 6f 6c 6c 20 62 61 72 |t and sc|roll bar|
|000005f0| 73 20 66 6f 72 20 61 20 | 74 65 78 74 20 77 69 6e |s for a |text win|
|00000600| 64 6f 77 0d 20 2a 2f 0d | 76 6f 69 64 0d 54 65 78 |dow. */.|void.Tex|
|00000610| 74 41 64 6a 75 73 74 20 | 28 74 68 65 57 69 6e 64 |tAdjust |(theWind|
|00000620| 6f 77 29 0d 09 72 65 67 | 69 73 74 65 72 20 57 69 |ow)..reg|ister Wi|
|00000630| 6e 64 6f 77 50 74 72 20 | 74 68 65 57 69 6e 64 6f |ndowPtr |theWindo|
|00000640| 77 3b 0d 7b 0d 09 72 65 | 67 69 73 74 65 72 20 49 |w;.{..re|gister I|
|00000650| 6e 66 6f 50 74 72 20 69 | 6e 66 6f 50 74 72 20 3d |nfoPtr i|nfoPtr =|
|00000660| 20 28 49 6e 66 6f 50 74 | 72 29 20 47 65 74 57 52 | (InfoPt|r) GetWR|
|00000670| 65 66 43 6f 6e 28 74 68 | 65 57 69 6e 64 6f 77 29 |efCon(th|eWindow)|
|00000680| 3b 0d 09 72 65 67 69 73 | 74 65 72 20 54 45 48 61 |;..regis|ter TEHa|
|00000690| 6e 64 6c 65 20 74 65 48 | 64 6c 20 3d 20 69 6e 66 |ndle teH|dl = inf|
|000006a0| 6f 50 74 72 2d 3e 69 74 | 65 6d 2e 74 65 78 74 2e |oPtr->it|em.text.|
|000006b0| 74 65 48 64 6c 3b 0d 09 | 72 65 67 69 73 74 65 72 |teHdl;..|register|
|000006c0| 20 43 6f 6e 74 72 6f 6c | 48 61 6e 64 6c 65 20 73 | Control|Handle s|
|000006d0| 63 72 6f 6c 6c 48 64 6c | 20 3d 20 69 6e 66 6f 50 |crollHdl| = infoP|
|000006e0| 74 72 2d 3e 69 74 65 6d | 2e 74 65 78 74 2e 73 63 |tr->item|.text.sc|
|000006f0| 72 6f 6c 6c 3b 0d 09 72 | 65 67 69 73 74 65 72 20 |roll;..r|egister |
|00000700| 57 4f 52 44 20 73 63 72 | 6f 6c 6c 48 65 69 67 68 |WORD scr|ollHeigh|
|00000710| 74 2c 20 76 69 65 77 4c | 69 6e 65 73 3b 0d 09 52 |t, viewL|ines;..R|
|00000720| 65 63 74 20 76 69 65 77 | 52 65 63 74 2c 20 77 69 |ect view|Rect, wi|
|00000730| 6e 64 52 65 63 74 3b 0d | 09 47 72 61 66 50 74 72 |ndRect;.|.GrafPtr|
|00000740| 20 73 61 76 65 50 6f 72 | 74 3b 0d 09 0d 09 47 65 | savePor|t;....Ge|
|00000750| 74 50 6f 72 74 28 26 73 | 61 76 65 50 6f 72 74 29 |tPort(&s|avePort)|
|00000760| 3b 0d 09 53 65 74 50 6f | 72 74 28 74 68 65 57 69 |;..SetPo|rt(theWi|
|00000770| 6e 64 6f 77 29 3b 0d 0d | 09 2f 2a 20 52 65 73 69 |ndow);..|./* Resi|
|00000780| 7a 65 20 74 68 65 20 74 | 65 78 74 20 76 69 65 77 |ze the t|ext view|
|00000790| 20 72 65 63 74 61 6e 67 | 6c 65 0d 09 20 2a 2f 0d | rectang|le.. */.|
|000007a0| 09 76 69 65 77 52 65 63 | 74 20 3d 20 74 68 65 57 |.viewRec|t = theW|
|000007b0| 69 6e 64 6f 77 2d 3e 70 | 6f 72 74 52 65 63 74 3b |indow->p|ortRect;|
|000007c0| 0d 0d 09 76 69 65 77 52 | 65 63 74 2e 6c 65 66 74 |...viewR|ect.left|
|000007d0| 20 2b 3d 20 69 6e 66 6f | 50 74 72 2d 3e 6f 66 66 | += info|Ptr->off|
|000007e0| 73 65 74 2e 6c 65 66 74 | 3b 0d 09 76 69 65 77 52 |set.left|;..viewR|
|000007f0| 65 63 74 2e 74 6f 70 20 | 2b 3d 20 69 6e 66 6f 50 |ect.top |+= infoP|
|00000800| 74 72 2d 3e 6f 66 66 73 | 65 74 2e 74 6f 70 3b 0d |tr->offs|et.top;.|
|00000810| 09 76 69 65 77 52 65 63 | 74 2e 72 69 67 68 74 20 |.viewRec|t.right |
|00000820| 2d 3d 20 53 42 41 52 5f | 57 49 44 54 48 3b 0d 0d |-= SBAR_|WIDTH;..|
|00000830| 09 76 69 65 77 4c 69 6e | 65 73 20 3d 20 28 76 69 |.viewLin|es = (vi|
|00000840| 65 77 52 65 63 74 2e 62 | 6f 74 74 6f 6d 20 2d 20 |ewRect.b|ottom - |
|00000850| 76 69 65 77 52 65 63 74 | 2e 74 6f 70 29 20 2f 20 |viewRect|.top) / |
|00000860| 28 2a 74 65 48 64 6c 29 | 2d 3e 6c 69 6e 65 48 65 |(*teHdl)|->lineHe|
|00000870| 69 67 68 74 3b 0d 09 76 | 69 65 77 52 65 63 74 2e |ight;..v|iewRect.|
|00000880| 62 6f 74 74 6f 6d 20 3d | 20 76 69 65 77 52 65 63 |bottom =| viewRec|
|00000890| 74 2e 74 6f 70 20 2b 20 | 28 76 69 65 77 4c 69 6e |t.top + |(viewLin|
|000008a0| 65 73 20 2a 20 28 2a 74 | 65 48 64 6c 29 2d 3e 6c |es * (*t|eHdl)->l|
|000008b0| 69 6e 65 48 65 69 67 68 | 74 29 3b 0d 09 28 2a 74 |ineHeigh|t);..(*t|
|000008c0| 65 48 64 6c 29 2d 3e 76 | 69 65 77 52 65 63 74 20 |eHdl)->v|iewRect |
|000008d0| 3d 20 76 69 65 77 52 65 | 63 74 3b 0d 0d 09 2f 2a |= viewRe|ct;.../*|
|000008e0| 20 52 65 73 69 7a 65 20 | 74 68 65 20 74 65 78 74 | Resize |the text|
|000008f0| 20 64 65 73 74 69 6e 61 | 74 69 6f 6e 20 72 65 63 | destina|tion rec|
|00000900| 74 61 6e 67 6c 65 0d 09 | 20 2a 2f 0d 09 28 2a 74 |tangle..| */..(*t|
|00000910| 65 48 64 6c 29 2d 3e 64 | 65 73 74 52 65 63 74 2e |eHdl)->d|estRect.|
|00000920| 72 69 67 68 74 20 3d 20 | 76 69 65 77 52 65 63 74 |right = |viewRect|
|00000930| 2e 72 69 67 68 74 3b 0d | 09 54 45 43 61 6c 54 65 |.right;.|.TECalTe|
|00000940| 78 74 28 74 65 48 64 6c | 29 3b 0d 0d 09 2f 2a 20 |xt(teHdl|);.../* |
|00000950| 52 65 73 69 7a 65 20 74 | 68 65 20 73 63 72 6f 6c |Resize t|he scrol|
|00000960| 6c 20 62 61 72 73 0d 09 | 20 2a 2f 0d 09 77 69 6e |l bars..| */..win|
|00000970| 64 52 65 63 74 20 3d 20 | 74 68 65 57 69 6e 64 6f |dRect = |theWindo|
|00000980| 77 2d 3e 70 6f 72 74 52 | 65 63 74 3b 0d 09 73 63 |w->portR|ect;..sc|
|00000990| 72 6f 6c 6c 48 65 69 67 | 68 74 20 3d 20 77 69 6e |rollHeig|ht = win|
|000009a0| 64 52 65 63 74 2e 62 6f | 74 74 6f 6d 20 2d 20 77 |dRect.bo|ttom - w|
|000009b0| 69 6e 64 52 65 63 74 2e | 74 6f 70 20 2b 20 33 3b |indRect.|top + 3;|
|000009c0| 0d 0d 09 48 69 64 65 43 | 6f 6e 74 72 6f 6c 28 73 |...HideC|ontrol(s|
|000009d0| 63 72 6f 6c 6c 48 64 6c | 29 3b 0d 09 4d 6f 76 65 |crollHdl|);..Move|
|000009e0| 43 6f 6e 74 72 6f 6c 28 | 73 63 72 6f 6c 6c 48 64 |Control(|scrollHd|
|000009f0| 6c 2c 20 77 69 6e 64 52 | 65 63 74 2e 72 69 67 68 |l, windR|ect.righ|
|00000a00| 74 20 2d 20 28 53 42 41 | 52 5f 57 49 44 54 48 20 |t - (SBA|R_WIDTH |
|00000a10| 2d 20 31 29 2c 20 77 69 | 6e 64 52 65 63 74 2e 74 |- 1), wi|ndRect.t|
|00000a20| 6f 70 20 2d 20 31 29 3b | 0d 0d 09 53 69 7a 65 43 |op - 1);|...SizeC|
|00000a30| 6f 6e 74 72 6f 6c 28 73 | 63 72 6f 6c 6c 48 64 6c |ontrol(s|crollHdl|
|00000a40| 2c 20 53 42 41 52 5f 57 | 49 44 54 48 2c 20 73 63 |, SBAR_W|IDTH, sc|
|00000a50| 72 6f 6c 6c 48 65 69 67 | 68 74 29 3b 0d 09 53 68 |rollHeig|ht);..Sh|
|00000a60| 6f 77 43 6f 6e 74 72 6f | 6c 28 73 63 72 6f 6c 6c |owContro|l(scroll|
|00000a70| 48 64 6c 29 3b 0d 0d 09 | 2f 2a 20 52 65 63 61 6c |Hdl);...|/* Recal|
|00000a80| 63 75 6c 61 74 65 20 61 | 6e 64 20 67 6f 0d 09 20 |culate a|nd go.. |
|00000a90| 2a 2f 0d 09 54 65 78 74 | 43 61 6c 63 53 63 72 6f |*/..Text|CalcScro|
|00000aa0| 6c 6c 28 74 68 65 57 69 | 6e 64 6f 77 29 3b 0d 09 |ll(theWi|ndow);..|
|00000ab0| 53 65 74 50 6f 72 74 28 | 73 61 76 65 50 6f 72 74 |SetPort(|savePort|
|00000ac0| 29 3b 0d 7d 0d 0d 0d 2f | 2a 20 43 6c 65 61 72 20 |);.}.../|* Clear |
|00000ad0| 61 20 74 65 78 74 20 77 | 69 6e 64 6f 77 0d 20 2a |a text w|indow. *|
|00000ae0| 2f 0d 76 6f 69 64 0d 54 | 65 78 74 57 69 6e 64 52 |/.void.T|extWindR|
|00000af0| 65 73 65 74 20 28 74 68 | 65 57 69 6e 64 6f 77 29 |eset (th|eWindow)|
|00000b00| 0d 09 72 65 67 69 73 74 | 65 72 20 57 69 6e 64 6f |..regist|er Windo|
|00000b10| 77 50 74 72 20 74 68 65 | 57 69 6e 64 6f 77 3b 0d |wPtr the|Window;.|
|00000b20| 7b 0d 09 72 65 67 69 73 | 74 65 72 20 49 6e 66 6f |{..regis|ter Info|
|00000b30| 50 74 72 20 69 6e 66 6f | 50 74 72 20 3d 20 28 49 |Ptr info|Ptr = (I|
|00000b40| 6e 66 6f 50 74 72 29 20 | 47 65 74 57 52 65 66 43 |nfoPtr) |GetWRefC|
|00000b50| 6f 6e 28 74 68 65 57 69 | 6e 64 6f 77 29 3b 0d 09 |on(theWi|ndow);..|
|00000b60| 72 65 67 69 73 74 65 72 | 20 54 45 48 61 6e 64 6c |register| TEHandl|
|00000b70| 65 20 74 65 48 64 6c 20 | 3d 20 69 6e 66 6f 50 74 |e teHdl |= infoPt|
|00000b80| 72 2d 3e 69 74 65 6d 2e | 74 65 78 74 2e 74 65 48 |r->item.|text.teH|
|00000b90| 64 6c 3b 0d 09 72 65 67 | 69 73 74 65 72 20 52 65 |dl;..reg|ister Re|
|00000ba0| 63 74 20 64 65 73 74 52 | 65 63 74 3b 0d 09 47 72 |ct destR|ect;..Gr|
|00000bb0| 61 66 50 74 72 20 73 61 | 76 65 50 6f 72 74 3b 0d |afPtr sa|vePort;.|
|00000bc0| 09 0d 09 47 65 74 50 6f | 72 74 28 26 73 61 76 65 |...GetPo|rt(&save|
|00000bd0| 50 6f 72 74 29 3b 0d 09 | 53 65 74 50 6f 72 74 28 |Port);..|SetPort(|
|00000be0| 74 68 65 57 69 6e 64 6f | 77 29 3b 0d 0d 09 2f 2a |theWindo|w);.../*|
|00000bf0| 20 43 6c 65 61 72 20 74 | 68 65 20 74 65 78 74 20 | Clear t|he text |
|00000c00| 68 61 6e 64 6c 65 20 61 | 6e 64 20 73 65 6c 65 63 |handle a|nd selec|
|00000c10| 74 69 6f 6e 0d 09 20 2a | 2f 0d 09 54 45 53 65 74 |tion.. *|/..TESet|
|00000c20| 54 65 78 74 28 22 5c 30 | 22 2c 20 28 6c 6f 6e 67 |Text("\0|", (long|
|00000c30| 29 20 30 4c 2c 20 74 65 | 48 64 6c 29 3b 0d 09 54 |) 0L, te|Hdl);..T|
|00000c40| 45 53 65 74 53 65 6c 65 | 63 74 28 30 4c 2c 20 30 |ESetSele|ct(0L, 0|
|00000c50| 4c 2c 20 74 65 48 64 6c | 29 3b 0d 0d 09 2f 2a 20 |L, teHdl|);.../* |
|00000c60| 45 72 61 73 65 20 74 68 | 65 20 64 69 73 70 6c 61 |Erase th|e displa|
|00000c70| 79 0d 09 20 2a 2f 0d 09 | 45 72 61 73 65 52 65 63 |y.. */..|EraseRec|
|00000c80| 74 28 26 28 28 2a 74 65 | 48 64 6c 29 2d 3e 76 69 |t(&((*te|Hdl)->vi|
|00000c90| 65 77 52 65 63 74 29 29 | 3b 0d 09 49 6e 76 61 6c |ewRect))|;..Inval|
|00000ca0| 52 65 63 74 28 26 28 28 | 2a 74 65 48 64 6c 29 2d |Rect(&((|*teHdl)-|
|00000cb0| 3e 76 69 65 77 52 65 63 | 74 29 29 3b 0d 0d 09 2f |>viewRec|t));.../|
|00000cc0| 2a 20 52 65 69 6e 69 74 | 69 61 6c 69 7a 65 20 74 |* Reinit|ialize t|
|00000cd0| 68 65 20 74 65 78 74 20 | 64 65 73 74 69 6e 61 74 |he text |destinat|
|00000ce0| 69 6f 6e 20 72 65 63 74 | 61 6e 67 6c 65 2c 20 72 |ion rect|angle, r|
|00000cf0| 65 63 61 6c 63 20 61 6e | 64 20 67 6f 0d 09 20 2a |ecalc an|d go.. *|
|00000d00| 2f 0d 09 28 2a 74 65 48 | 64 6c 29 2d 3e 64 65 73 |/..(*teH|dl)->des|
|00000d10| 74 52 65 63 74 20 3d 20 | 28 2a 74 65 48 64 6c 29 |tRect = |(*teHdl)|
|00000d20| 2d 3e 76 69 65 77 52 65 | 63 74 3b 0d 09 54 45 43 |->viewRe|ct;..TEC|
|00000d30| 61 6c 54 65 78 74 28 74 | 65 48 64 6c 29 3b 0d 09 |alText(t|eHdl);..|
|00000d40| 54 65 78 74 43 61 6c 63 | 53 63 72 6f 6c 6c 28 74 |TextCalc|Scroll(t|
|00000d50| 68 65 57 69 6e 64 6f 77 | 29 3b 0d 09 53 65 74 50 |heWindow|);..SetP|
|00000d60| 6f 72 74 28 73 61 76 65 | 50 6f 72 74 29 3b 0d 7d |ort(save|Port);.}|
|00000d70| 0d 0d 0d 2f 2a 20 54 65 | 78 74 41 63 74 69 76 61 |.../* Te|xtActiva|
|00000d80| 74 65 20 73 68 6f 75 6c | 64 20 62 65 20 63 61 6c |te shoul|d be cal|
|00000d90| 6c 65 64 20 69 6e 20 72 | 65 73 70 6f 6e 73 65 20 |led in r|esponse |
|00000da0| 74 6f 20 61 6e 20 61 63 | 74 69 76 61 74 65 20 6f |to an ac|tivate o|
|00000db0| 72 20 64 65 61 63 74 69 | 76 61 74 65 20 65 76 65 |r deacti|vate eve|
|00000dc0| 6e 74 2c 0d 20 2a 20 61 | 6e 64 20 69 73 41 63 74 |nt,. * a|nd isAct|
|00000dd0| 69 76 65 20 69 73 20 70 | 61 73 73 65 64 20 69 6e |ive is p|assed in|
|00000de0| 20 74 6f 20 64 65 74 65 | 72 6d 69 6e 65 20 77 68 | to dete|rmine wh|
|00000df0| 69 63 68 20 6f 66 20 74 | 68 65 73 65 0d 20 2a 2f |ich of t|hese. */|
|00000e00| 0d 76 6f 69 64 0d 54 65 | 78 74 41 63 74 69 76 61 |.void.Te|xtActiva|
|00000e10| 74 65 20 28 69 73 41 63 | 74 69 76 65 2c 20 74 68 |te (isAc|tive, th|
|00000e20| 65 57 69 6e 64 6f 77 29 | 0d 09 72 65 67 69 73 74 |eWindow)|..regist|
|00000e30| 65 72 20 42 6f 6f 6c 65 | 61 6e 20 69 73 41 63 74 |er Boole|an isAct|
|00000e40| 69 76 65 3b 0d 09 72 65 | 67 69 73 74 65 72 20 57 |ive;..re|gister W|
|00000e50| 69 6e 64 6f 77 50 74 72 | 20 74 68 65 57 69 6e 64 |indowPtr| theWind|
|00000e60| 6f 77 3b 0d 7b 0d 09 72 | 65 67 69 73 74 65 72 20 |ow;.{..r|egister |
|00000e70| 49 6e 66 6f 50 74 72 20 | 69 6e 66 6f 50 74 72 20 |InfoPtr |infoPtr |
|00000e80| 3d 20 28 49 6e 66 6f 50 | 74 72 29 20 47 65 74 57 |= (InfoP|tr) GetW|
|00000e90| 52 65 66 43 6f 6e 28 74 | 68 65 57 69 6e 64 6f 77 |RefCon(t|heWindow|
|00000ea0| 29 3b 0d 09 72 65 67 69 | 73 74 65 72 20 54 45 48 |);..regi|ster TEH|
|00000eb0| 61 6e 64 6c 65 20 74 65 | 48 64 6c 20 3d 20 69 6e |andle te|Hdl = in|
|00000ec0| 66 6f 50 74 72 2d 3e 69 | 74 65 6d 2e 74 65 78 74 |foPtr->i|tem.text|
|00000ed0| 2e 74 65 48 64 6c 3b 0d | 09 47 72 61 66 50 74 72 |.teHdl;.|.GrafPtr|
|00000ee0| 20 73 61 76 65 50 6f 72 | 74 3b 0d 09 0d 09 47 65 | savePor|t;....Ge|
|00000ef0| 74 50 6f 72 74 28 26 73 | 61 76 65 50 6f 72 74 29 |tPort(&s|avePort)|
|00000f00| 3b 0d 09 53 65 74 50 6f | 72 74 28 74 68 65 57 69 |;..SetPo|rt(theWi|
|00000f10| 6e 64 6f 77 29 3b 0d 0d | 09 69 66 20 28 69 73 41 |ndow);..|.if (isA|
|00000f20| 63 74 69 76 65 29 20 7b | 0d 09 09 69 66 20 28 74 |ctive) {|...if (t|
|00000f30| 65 48 64 6c 20 21 3d 20 | 4e 55 4c 4c 29 20 7b 0d |eHdl != |NULL) {.|
|00000f40| 09 09 09 54 45 41 63 74 | 69 76 61 74 65 28 74 65 |...TEAct|ivate(te|
|00000f50| 48 64 6c 29 3b 0d 0d 09 | 09 09 69 66 20 28 28 2a |Hdl);...|..if ((*|
|00000f60| 74 65 48 64 6c 29 2d 3e | 6e 4c 69 6e 65 73 20 3e |teHdl)->|nLines >|
|00000f70| 20 47 65 74 43 52 65 66 | 43 6f 6e 28 69 6e 66 6f | GetCRef|Con(info|
|00000f80| 50 74 72 2d 3e 69 74 65 | 6d 2e 74 65 78 74 2e 73 |Ptr->ite|m.text.s|
|00000f90| 63 72 6f 6c 6c 29 29 0d | 09 09 09 09 48 69 6c 69 |croll)).|....Hili|
|00000fa0| 74 65 43 6f 6e 74 72 6f | 6c 28 69 6e 66 6f 50 74 |teContro|l(infoPt|
|00000fb0| 72 2d 3e 69 74 65 6d 2e | 74 65 78 74 2e 73 63 72 |r->item.|text.scr|
|00000fc0| 6f 6c 6c 2c 20 30 29 3b | 0d 09 09 7d 0d 09 7d 0d |oll, 0);|...}..}.|
|00000fd0| 09 65 6c 73 65 20 7b 0d | 09 09 69 66 20 28 74 65 |.else {.|..if (te|
|00000fe0| 48 64 6c 20 21 3d 20 4e | 55 4c 4c 29 0d 09 09 09 |Hdl != N|ULL)....|
|00000ff0| 54 45 44 65 61 63 74 69 | 76 61 74 65 28 74 65 48 |TEDeacti|vate(teH|
|00001000| 64 6c 29 3b 0d 0d 09 09 | 48 69 6c 69 74 65 43 6f |dl);....|HiliteCo|
|00001010| 6e 74 72 6f 6c 28 69 6e | 66 6f 50 74 72 2d 3e 69 |ntrol(in|foPtr->i|
|00001020| 74 65 6d 2e 74 65 78 74 | 2e 73 63 72 6f 6c 6c 2c |tem.text|.scroll,|
|00001030| 20 32 35 35 29 3b 0d 09 | 7d 0d 09 0d 09 53 65 74 | 255);..|}....Set|
|00001040| 50 6f 72 74 28 73 61 76 | 65 50 6f 72 74 29 3b 0d |Port(sav|ePort);.|
|00001050| 7d 0d 0d 0d 2f 2a 20 54 | 65 78 74 55 70 64 61 74 |}.../* T|extUpdat|
|00001060| 65 20 73 68 6f 75 6c 64 | 20 62 65 20 63 61 6c 6c |e should| be call|
|00001070| 65 64 20 69 6e 20 72 65 | 73 70 6f 6e 73 65 20 74 |ed in re|sponse t|
|00001080| 6f 20 61 6e 20 75 70 64 | 61 74 65 20 65 76 65 6e |o an upd|ate even|
|00001090| 74 2e 0d 20 2a 2f 0d 76 | 6f 69 64 0d 54 65 78 74 |t.. */.v|oid.Text|
|000010a0| 55 70 64 61 74 65 20 28 | 74 68 65 57 69 6e 64 6f |Update (|theWindo|
|000010b0| 77 29 0d 09 72 65 67 69 | 73 74 65 72 20 57 69 6e |w)..regi|ster Win|
|000010c0| 64 6f 77 50 74 72 20 74 | 68 65 57 69 6e 64 6f 77 |dowPtr t|heWindow|
|000010d0| 3b 0d 7b 0d 09 72 65 67 | 69 73 74 65 72 20 49 6e |;.{..reg|ister In|
|000010e0| 66 6f 50 74 72 20 69 6e | 66 6f 50 74 72 20 3d 20 |foPtr in|foPtr = |
|000010f0| 28 49 6e 66 6f 50 74 72 | 29 20 47 65 74 57 52 65 |(InfoPtr|) GetWRe|
|00001100| 66 43 6f 6e 28 74 68 65 | 57 69 6e 64 6f 77 29 3b |fCon(the|Window);|
|00001110| 0d 09 72 65 67 69 73 74 | 65 72 20 54 45 48 61 6e |..regist|er TEHan|
|00001120| 64 6c 65 20 74 65 48 64 | 6c 20 3d 20 69 6e 66 6f |dle teHd|l = info|
|00001130| 50 74 72 2d 3e 69 74 65 | 6d 2e 74 65 78 74 2e 74 |Ptr->ite|m.text.t|
|00001140| 65 48 64 6c 3b 0d 09 72 | 65 67 69 73 74 65 72 20 |eHdl;..r|egister |
|00001150| 43 6f 6e 74 72 6f 6c 48 | 61 6e 64 6c 65 20 73 63 |ControlH|andle sc|
|00001160| 72 6f 6c 6c 48 64 6c 20 | 3d 20 69 6e 66 6f 50 74 |rollHdl |= infoPt|
|00001170| 72 2d 3e 69 74 65 6d 2e | 74 65 78 74 2e 73 63 72 |r->item.|text.scr|
|00001180| 6f 6c 6c 3b 0d 09 72 65 | 67 69 73 74 65 72 20 57 |oll;..re|gister W|
|00001190| 4f 52 44 20 6c 69 6e 65 | 73 49 6e 74 6f 20 3d 20 |ORD line|sInto = |
|000011a0| 47 65 74 43 74 6c 56 61 | 6c 75 65 28 73 63 72 6f |GetCtlVa|lue(scro|
|000011b0| 6c 6c 48 64 6c 29 3b 0d | 09 72 65 67 69 73 74 65 |llHdl);.|.registe|
|000011c0| 72 20 57 4f 52 44 20 73 | 63 72 6f 6c 6c 4d 61 78 |r WORD s|crollMax|
|000011d0| 20 3d 20 47 65 74 43 74 | 6c 4d 61 78 28 73 63 72 | = GetCt|lMax(scr|
|000011e0| 6f 6c 6c 48 64 6c 29 3b | 0d 09 52 65 63 74 20 76 |ollHdl);|..Rect v|
|000011f0| 69 65 77 52 65 63 74 20 | 3d 20 28 2a 74 65 48 64 |iewRect |= (*teHd|
|00001200| 6c 29 2d 3e 76 69 65 77 | 52 65 63 74 3b 0d 09 47 |l)->view|Rect;..G|
|00001210| 72 61 66 50 74 72 20 73 | 61 76 65 50 6f 72 74 3b |rafPtr s|avePort;|
|00001220| 0d 09 0d 09 47 65 74 50 | 6f 72 74 28 26 73 61 76 |....GetP|ort(&sav|
|00001230| 65 50 6f 72 74 29 3b 0d | 09 53 65 74 50 6f 72 74 |ePort);.|.SetPort|
|00001240| 28 74 68 65 57 69 6e 64 | 6f 77 29 3b 0d 0d 09 2f |(theWind|ow);.../|
|00001250| 2a 20 54 45 55 70 64 61 | 74 65 20 73 63 72 65 77 |* TEUpda|te screw|
|00001260| 73 20 75 70 20 74 68 65 | 20 6c 61 73 74 20 6c 69 |s up the| last li|
|00001270| 6e 65 20 69 66 20 69 74 | 20 69 73 20 6f 6e 6c 79 |ne if it| is only|
|00001280| 20 61 20 63 61 72 72 69 | 61 67 65 20 72 65 74 75 | a carri|age retu|
|00001290| 72 6e 2e 2e 2e 0d 09 20 | 2a 20 73 6f 20 77 65 20 |rn..... |* so we |
|000012a0| 67 65 74 20 74 6f 20 65 | 72 61 73 65 20 74 68 65 |get to e|rase the|
|000012b0| 20 6c 61 73 74 20 6c 69 | 6e 65 20 62 65 66 6f 72 | last li|ne befor|
|000012c0| 65 20 74 68 65 20 75 70 | 64 61 74 65 2e 0d 09 20 |e the up|date... |
|000012d0| 2a 2f 0d 09 69 66 20 28 | 6c 69 6e 65 73 49 6e 74 |*/..if (|linesInt|
|000012e0| 6f 20 3d 3d 20 73 63 72 | 6f 6c 6c 4d 61 78 29 20 |o == scr|ollMax) |
|000012f0| 7b 0d 09 09 76 69 65 77 | 52 65 63 74 2e 74 6f 70 |{...view|Rect.top|
|00001300| 20 3d 20 76 69 65 77 52 | 65 63 74 2e 62 6f 74 74 | = viewR|ect.bott|
|00001310| 6f 6d 20 2d 20 28 32 20 | 2a 20 28 2a 74 65 48 64 |om - (2 |* (*teHd|
|00001320| 6c 29 2d 3e 6c 69 6e 65 | 48 65 69 67 68 74 29 3b |l)->line|Height);|
|00001330| 0d 09 09 45 72 61 73 65 | 52 65 63 74 28 26 76 69 |...Erase|Rect(&vi|
|00001340| 65 77 52 65 63 74 29 3b | 0d 09 7d 0d 0d 09 54 45 |ewRect);|..}...TE|
|00001350| 55 70 64 61 74 65 28 26 | 74 68 65 57 69 6e 64 6f |Update(&|theWindo|
|00001360| 77 2d 3e 70 6f 72 74 52 | 65 63 74 2c 20 74 65 48 |w->portR|ect, teH|
|00001370| 64 6c 29 3b 0d 0d 09 69 | 66 20 28 74 68 65 57 69 |dl);...i|f (theWi|
|00001380| 6e 64 6f 77 20 3d 3d 20 | 46 72 6f 6e 74 57 69 6e |ndow == |FrontWin|
|00001390| 64 6f 77 28 29 29 0d 09 | 09 54 45 41 63 74 69 76 |dow())..|.TEActiv|
|000013a0| 61 74 65 28 74 65 48 64 | 6c 29 3b 0d 09 65 6c 73 |ate(teHd|l);..els|
|000013b0| 65 0d 09 09 54 45 44 65 | 61 63 74 69 76 61 74 65 |e...TEDe|activate|
|000013c0| 28 74 65 48 64 6c 29 3b | 0d 09 0d 09 53 65 74 50 |(teHdl);|....SetP|
|000013d0| 6f 72 74 28 73 61 76 65 | 50 6f 72 74 29 3b 0d 7d |ort(save|Port);.}|
|000013e0| 0d 0d 0d 2f 2a 20 57 72 | 69 74 65 20 74 65 78 74 |.../* Wr|ite text|
|000013f0| 20 69 6e 74 6f 20 74 68 | 65 20 64 65 73 69 72 65 | into th|e desire|
|00001400| 64 20 64 65 62 75 67 20 | 77 69 6e 64 6f 77 0d 20 |d debug |window. |
|00001410| 2a 2f 0d 76 6f 69 64 20 | 0d 54 65 78 74 50 75 74 |*/.void |.TextPut|
|00001420| 54 65 78 74 20 28 74 68 | 65 54 65 78 74 2c 20 74 |Text (th|eText, t|
|00001430| 68 65 4c 65 6e 2c 20 74 | 68 65 57 69 6e 64 6f 77 |heLen, t|heWindow|
|00001440| 29 0d 09 72 65 67 69 73 | 74 65 72 20 63 68 61 72 |)..regis|ter char|
|00001450| 20 2a 74 68 65 54 65 78 | 74 3b 0d 09 72 65 67 69 | *theTex|t;..regi|
|00001460| 73 74 65 72 20 4c 4f 4e | 47 20 74 68 65 4c 65 6e |ster LON|G theLen|
|00001470| 3b 0d 09 72 65 67 69 73 | 74 65 72 20 57 69 6e 64 |;..regis|ter Wind|
|00001480| 6f 77 50 74 72 20 74 68 | 65 57 69 6e 64 6f 77 3b |owPtr th|eWindow;|
|00001490| 0d 7b 0d 09 72 65 67 69 | 73 74 65 72 20 49 6e 66 |.{..regi|ster Inf|
|000014a0| 6f 50 74 72 20 69 6e 66 | 6f 50 74 72 20 3d 20 28 |oPtr inf|oPtr = (|
|000014b0| 49 6e 66 6f 50 74 72 29 | 20 47 65 74 57 52 65 66 |InfoPtr)| GetWRef|
|000014c0| 43 6f 6e 28 74 68 65 57 | 69 6e 64 6f 77 29 3b 0d |Con(theW|indow);.|
|000014d0| 09 72 65 67 69 73 74 65 | 72 20 54 45 48 61 6e 64 |.registe|r TEHand|
|000014e0| 6c 65 20 74 65 48 64 6c | 20 3d 20 69 6e 66 6f 50 |le teHdl| = infoP|
|000014f0| 74 72 2d 3e 69 74 65 6d | 2e 74 65 78 74 2e 74 65 |tr->item|.text.te|
|00001500| 48 64 6c 3b 0d 09 47 72 | 61 66 50 74 72 20 73 61 |Hdl;..Gr|afPtr sa|
|00001510| 76 65 50 6f 72 74 3b 0d | 09 0d 09 47 65 74 50 6f |vePort;.|...GetPo|
|00001520| 72 74 28 26 73 61 76 65 | 50 6f 72 74 29 3b 0d 09 |rt(&save|Port);..|
|00001530| 53 65 74 50 6f 72 74 28 | 74 68 65 57 69 6e 64 6f |SetPort(|theWindo|
|00001540| 77 29 3b 0d 0d 09 54 45 | 49 6e 73 65 72 74 28 74 |w);...TE|Insert(t|
|00001550| 68 65 54 65 78 74 2c 20 | 74 68 65 4c 65 6e 2c 20 |heText, |theLen, |
|00001560| 74 65 48 64 6c 29 3b 0d | 09 54 65 78 74 43 61 6c |teHdl);.|.TextCal|
|00001570| 63 53 63 72 6f 6c 6c 28 | 74 68 65 57 69 6e 64 6f |cScroll(|theWindo|
|00001580| 77 29 3b 0d 0d 09 53 65 | 74 50 6f 72 74 28 73 61 |w);...Se|tPort(sa|
|00001590| 76 65 50 6f 72 74 29 3b | 0d 7d 0d 0d 0d 2f 2a 20 |vePort);|.}.../* |
|000015a0| 44 65 63 69 64 65 20 68 | 6f 77 20 74 6f 20 68 61 |Decide h|ow to ha|
|000015b0| 6e 64 6c 65 20 61 20 6d | 6f 75 73 65 20 63 6c 69 |ndle a m|ouse cli|
|000015c0| 63 6b 20 69 6e 20 74 68 | 65 20 63 6f 6e 74 65 6e |ck in th|e conten|
|000015d0| 74 20 6f 66 20 61 20 74 | 65 78 74 20 77 69 6e 64 |t of a t|ext wind|
|000015e0| 6f 77 0d 20 2a 2f 0d 76 | 6f 69 64 0d 54 65 78 74 |ow. */.v|oid.Text|
|000015f0| 43 6f 6e 74 65 6e 74 20 | 28 74 68 65 57 69 6e 64 |Content |(theWind|
|00001600| 6f 77 2c 20 74 68 65 4d | 6f 64 73 2c 20 74 68 65 |ow, theM|ods, the|
|00001610| 50 6f 69 6e 74 29 0d 09 | 72 65 67 69 73 74 65 72 |Point)..|register|
|00001620| 20 57 69 6e 64 6f 77 50 | 74 72 20 74 68 65 57 69 | WindowP|tr theWi|
|00001630| 6e 64 6f 77 3b 0d 09 72 | 65 67 69 73 74 65 72 20 |ndow;..r|egister |
|00001640| 57 4f 52 44 20 74 68 65 | 4d 6f 64 73 3b 0d 09 72 |WORD the|Mods;..r|
|00001650| 65 67 69 73 74 65 72 20 | 50 6f 69 6e 74 20 74 68 |egister |Point th|
|00001660| 65 50 6f 69 6e 74 3b 0d | 7b 0d 09 72 65 67 69 73 |ePoint;.|{..regis|
|00001670| 74 65 72 20 49 6e 66 6f | 50 74 72 20 69 6e 66 6f |ter Info|Ptr info|
|00001680| 50 74 72 20 3d 20 28 49 | 6e 66 6f 50 74 72 29 20 |Ptr = (I|nfoPtr) |
|00001690| 47 65 74 57 52 65 66 43 | 6f 6e 28 74 68 65 57 69 |GetWRefC|on(theWi|
|000016a0| 6e 64 6f 77 29 3b 0d 09 | 72 65 67 69 73 74 65 72 |ndow);..|register|
|000016b0| 20 54 45 48 61 6e 64 6c | 65 20 74 65 48 64 6c 20 | TEHandl|e teHdl |
|000016c0| 3d 20 69 6e 66 6f 50 74 | 72 2d 3e 69 74 65 6d 2e |= infoPt|r->item.|
|000016d0| 74 65 78 74 2e 74 65 48 | 64 6c 3b 0d 09 72 65 67 |text.teH|dl;..reg|
|000016e0| 69 73 74 65 72 20 57 4f | 52 44 20 74 68 65 50 61 |ister WO|RD thePa|
|000016f0| 72 74 3b 0d 09 72 65 67 | 69 73 74 65 72 20 42 6f |rt;..reg|ister Bo|
|00001700| 6f 6c 65 61 6e 20 69 73 | 53 68 69 66 74 20 3d 20 |olean is|Shift = |
|00001710| 46 41 4c 53 45 3b 0d 09 | 43 6f 6e 74 72 6f 6c 48 |FALSE;..|ControlH|
|00001720| 61 6e 64 6c 65 20 74 68 | 65 43 6f 6e 74 72 6f 6c |andle th|eControl|
|00001730| 3b 0d 0d 09 2f 2a 20 44 | 65 74 65 72 6d 69 6e 65 |;.../* D|etermine|
|00001740| 20 69 66 20 74 68 65 20 | 70 6f 69 6e 74 20 69 73 | if the |point is|
|00001750| 20 69 6e 20 74 68 65 20 | 74 65 78 74 20 65 64 69 | in the |text edi|
|00001760| 74 20 76 69 65 77 20 72 | 65 63 74 0d 09 20 2a 2f |t view r|ect.. */|
|00001770| 0d 09 74 68 65 50 61 72 | 74 20 3d 20 46 69 6e 64 |..thePar|t = Find|
|00001780| 43 6f 6e 74 72 6f 6c 28 | 74 68 65 50 6f 69 6e 74 |Control(|thePoint|
|00001790| 2c 20 74 68 65 57 69 6e | 64 6f 77 2c 20 26 74 68 |, theWin|dow, &th|
|000017a0| 65 43 6f 6e 74 72 6f 6c | 29 3b 0d 0d 09 73 77 69 |eControl|);...swi|
|000017b0| 74 63 68 20 28 74 68 65 | 50 61 72 74 29 20 7b 0d |tch (the|Part) {.|
|000017c0| 09 63 61 73 65 20 30 3a | 09 09 09 2f 2a 20 6e 6f |.case 0:|.../* no|
|000017d0| 20 63 6f 6e 74 72 6f 6c | 20 70 61 72 74 20 68 69 | control| part hi|
|000017e0| 74 20 2a 2f 0d 09 09 69 | 66 20 28 28 74 68 65 4d |t */...i|f ((theM|
|000017f0| 6f 64 73 20 3e 3e 20 34 | 29 20 26 20 73 68 69 66 |ods >> 4|) & shif|
|00001800| 74 4b 65 79 29 20 0d 09 | 09 09 69 73 53 68 69 66 |tKey) ..|..isShif|
|00001810| 74 20 3d 20 54 52 55 45 | 3b 0d 0d 09 09 54 45 43 |t = TRUE|;....TEC|
|00001820| 6c 69 63 6b 28 74 68 65 | 50 6f 69 6e 74 2c 20 69 |lick(the|Point, i|
|00001830| 73 53 68 69 66 74 2c 20 | 74 65 48 64 6c 29 3b 0d |sShift, |teHdl);.|
|00001840| 09 09 62 72 65 61 6b 3b | 0d 0d 09 63 61 73 65 20 |..break;|...case |
|00001850| 69 6e 55 70 42 75 74 74 | 6f 6e 3a 0d 09 63 61 73 |inUpButt|on:..cas|
|00001860| 65 20 69 6e 44 6f 77 6e | 42 75 74 74 6f 6e 3a 0d |e inDown|Button:.|
|00001870| 09 63 61 73 65 20 69 6e | 50 61 67 65 55 70 3a 0d |.case in|PageUp:.|
|00001880| 09 63 61 73 65 20 69 6e | 50 61 67 65 44 6f 77 6e |.case in|PageDown|
|00001890| 3a 0d 09 63 61 73 65 20 | 69 6e 54 68 75 6d 62 3a |:..case |inThumb:|
|000018a0| 0d 09 09 54 65 78 74 44 | 6f 53 63 72 6f 6c 6c 28 |...TextD|oScroll(|
|000018b0| 74 68 65 57 69 6e 64 6f | 77 2c 20 74 68 65 43 6f |theWindo|w, theCo|
|000018c0| 6e 74 72 6f 6c 2c 20 74 | 68 65 50 61 72 74 2c 20 |ntrol, t|hePart, |
|000018d0| 74 68 65 50 6f 69 6e 74 | 29 3b 0d 09 09 62 72 65 |thePoint|);...bre|
|000018e0| 61 6b 3b 0d 0d 09 64 65 | 66 61 75 6c 74 3a 0d 09 |ak;...de|fault:..|
|000018f0| 09 54 72 61 63 6b 43 6f | 6e 74 72 6f 6c 28 74 68 |.TrackCo|ntrol(th|
|00001900| 65 43 6f 6e 74 72 6f 6c | 2c 20 74 68 65 50 6f 69 |eControl|, thePoi|
|00001910| 6e 74 2c 20 28 50 72 6f | 63 50 74 72 29 20 28 2d |nt, (Pro|cPtr) (-|
|00001920| 31 29 29 3b 0d 09 7d 0d | 7d 0d 0d 0d 2f 2a 20 48 |1));..}.|}.../* H|
|00001930| 61 6e 64 6c 65 20 61 20 | 6d 6f 75 73 65 20 69 6e |andle a |mouse in|
|00001940| 20 61 20 77 69 6e 64 6f | 77 d5 73 20 73 63 72 6f | a windo|w.s scro|
|00001950| 6c 6c 62 61 72 0d 20 2a | 2f 0d 76 6f 69 64 0d 54 |llbar. *|/.void.T|
|00001960| 65 78 74 44 6f 53 63 72 | 6f 6c 6c 20 28 74 68 65 |extDoScr|oll (the|
|00001970| 57 69 6e 64 6f 77 2c 20 | 74 68 65 43 6f 6e 74 72 |Window, |theContr|
|00001980| 6f 6c 2c 20 74 68 65 50 | 61 72 74 2c 20 74 68 65 |ol, theP|art, the|
|00001990| 50 6f 69 6e 74 29 0d 09 | 72 65 67 69 73 74 65 72 |Point)..|register|
|000019a0| 20 57 69 6e 64 6f 77 50 | 74 72 20 74 68 65 57 69 | WindowP|tr theWi|
|000019b0| 6e 64 6f 77 3b 0d 09 72 | 65 67 69 73 74 65 72 20 |ndow;..r|egister |
|000019c0| 43 6f 6e 74 72 6f 6c 48 | 61 6e 64 6c 65 20 74 68 |ControlH|andle th|
|000019d0| 65 43 6f 6e 74 72 6f 6c | 3b 0d 09 72 65 67 69 73 |eControl|;..regis|
|000019e0| 74 65 72 20 57 4f 52 44 | 20 74 68 65 50 61 72 74 |ter WORD| thePart|
|000019f0| 3b 0d 09 72 65 67 69 73 | 74 65 72 20 50 6f 69 6e |;..regis|ter Poin|
|00001a00| 74 20 74 68 65 50 6f 69 | 6e 74 3b 0d 7b 0d 09 72 |t thePoi|nt;.{..r|
|00001a10| 65 67 69 73 74 65 72 20 | 49 6e 66 6f 50 74 72 20 |egister |InfoPtr |
|00001a20| 69 6e 66 6f 50 74 72 20 | 3d 20 28 49 6e 66 6f 50 |infoPtr |= (InfoP|
|00001a30| 74 72 29 20 47 65 74 57 | 52 65 66 43 6f 6e 28 74 |tr) GetW|RefCon(t|
|00001a40| 68 65 57 69 6e 64 6f 77 | 29 3b 0d 09 72 65 67 69 |heWindow|);..regi|
|00001a50| 73 74 65 72 20 57 4f 52 | 44 20 6c 61 73 74 56 61 |ster WOR|D lastVa|
|00001a60| 6c 2c 20 64 65 6c 74 61 | 56 61 6c 3b 0d 0d 09 69 |l, delta|Val;...i|
|00001a70| 66 20 28 74 68 65 50 61 | 72 74 20 3d 3d 20 69 6e |f (thePa|rt == in|
|00001a80| 54 68 75 6d 62 29 20 7b | 0d 09 09 6c 61 73 74 56 |Thumb) {|...lastV|
|00001a90| 61 6c 20 3d 20 47 65 74 | 43 74 6c 56 61 6c 75 65 |al = Get|CtlValue|
|00001aa0| 28 74 68 65 43 6f 6e 74 | 72 6f 6c 29 3b 0d 09 09 |(theCont|rol);...|
|00001ab0| 74 68 65 50 61 72 74 20 | 3d 20 54 72 61 63 6b 43 |thePart |= TrackC|
|00001ac0| 6f 6e 74 72 6f 6c 28 74 | 68 65 43 6f 6e 74 72 6f |ontrol(t|heContro|
|00001ad0| 6c 2c 20 74 68 65 50 6f | 69 6e 74 2c 20 4e 55 4c |l, thePo|int, NUL|
|00001ae0| 4c 29 3b 0d 09 09 64 65 | 6c 74 61 56 61 6c 20 3d |L);...de|ltaVal =|
|00001af0| 20 6c 61 73 74 56 61 6c | 20 2d 20 47 65 74 43 74 | lastVal| - GetCt|
|00001b00| 6c 56 61 6c 75 65 28 74 | 68 65 43 6f 6e 74 72 6f |lValue(t|heContro|
|00001b10| 6c 29 3b 0d 0d 09 09 2f | 2a 20 49 66 20 61 20 63 |l);..../|* If a c|
|00001b20| 68 61 6e 67 65 20 69 6e | 20 73 63 72 6f 6c 6c 20 |hange in| scroll |
|00001b30| 76 61 6c 75 65 73 20 65 | 78 69 73 74 73 2c 20 73 |values e|xists, s|
|00001b40| 63 72 6f 6c 6c 20 74 68 | 61 74 20 61 6d 6f 75 6e |croll th|at amoun|
|00001b50| 74 0d 09 09 20 2a 2f 0d | 09 09 69 66 20 28 64 65 |t... */.|..if (de|
|00001b60| 6c 74 61 56 61 6c 20 21 | 3d 20 30 29 0d 09 09 09 |ltaVal !|= 0)....|
|00001b70| 54 65 78 74 53 63 72 6f | 6c 6c 28 30 2c 20 64 65 |TextScro|ll(0, de|
|00001b80| 6c 74 61 56 61 6c 2c 20 | 69 6e 66 6f 50 74 72 2d |ltaVal, |infoPtr-|
|00001b90| 3e 69 74 65 6d 2e 74 65 | 78 74 2e 74 65 48 64 6c |>item.te|xt.teHdl|
|00001ba0| 29 3b 0d 09 7d 0d 09 65 | 6c 73 65 0d 09 09 54 72 |);..}..e|lse...Tr|
|00001bb0| 61 63 6b 43 6f 6e 74 72 | 6f 6c 28 74 68 65 43 6f |ackContr|ol(theCo|
|00001bc0| 6e 74 72 6f 6c 2c 20 74 | 68 65 50 6f 69 6e 74 2c |ntrol, t|hePoint,|
|00001bd0| 20 28 50 72 6f 63 50 74 | 72 29 20 54 65 78 74 53 | (ProcPt|r) TextS|
|00001be0| 63 72 6f 6c 6c 50 72 6f | 63 29 3b 0d 7d 0d 0d 0d |crollPro|c);.}...|
|00001bf0| 2f 2a 20 43 61 6c 6c 65 | 64 20 62 79 20 54 72 61 |/* Calle|d by Tra|
|00001c00| 63 6b 43 6f 6e 74 72 6f | 6c 20 66 6f 72 20 73 63 |ckContro|l for sc|
|00001c10| 72 6f 6c 6c 62 61 72 20 | 65 76 65 6e 74 73 0d 20 |rollbar |events. |
|00001c20| 2a 2f 0d 70 61 73 63 61 | 6c 20 76 6f 69 64 20 0d |*/.pasca|l void .|
|00001c30| 54 65 78 74 53 63 72 6f | 6c 6c 50 72 6f 63 20 28 |TextScro|llProc (|
|00001c40| 74 68 65 43 6f 6e 74 72 | 6f 6c 2c 20 74 68 65 50 |theContr|ol, theP|
|00001c50| 61 72 74 29 0d 09 72 65 | 67 69 73 74 65 72 20 43 |art)..re|gister C|
|00001c60| 6f 6e 74 72 6f 6c 48 61 | 6e 64 6c 65 20 74 68 65 |ontrolHa|ndle the|
|00001c70| 43 6f 6e 74 72 6f 6c 3b | 0d 09 72 65 67 69 73 74 |Control;|..regist|
|00001c80| 65 72 20 57 4f 52 44 20 | 74 68 65 50 61 72 74 3b |er WORD |thePart;|
|00001c90| 0d 7b 0d 09 72 65 67 69 | 73 74 65 72 20 57 69 6e |.{..regi|ster Win|
|00001ca0| 64 6f 77 50 74 72 20 74 | 68 65 57 69 6e 64 6f 77 |dowPtr t|heWindow|
|00001cb0| 20 3d 20 28 2a 74 68 65 | 43 6f 6e 74 72 6f 6c 29 | = (*the|Control)|
|00001cc0| 2d 3e 63 6f 6e 74 72 6c | 4f 77 6e 65 72 3b 0d 09 |->contrl|Owner;..|
|00001cd0| 72 65 67 69 73 74 65 72 | 20 49 6e 66 6f 50 74 72 |register| InfoPtr|
|00001ce0| 20 69 6e 66 6f 50 74 72 | 20 3d 20 28 49 6e 66 6f | infoPtr| = (Info|
|00001cf0| 50 74 72 29 20 47 65 74 | 57 52 65 66 43 6f 6e 28 |Ptr) Get|WRefCon(|
|00001d00| 74 68 65 57 69 6e 64 6f | 77 29 3b 0d 09 72 65 67 |theWindo|w);..reg|
|00001d10| 69 73 74 65 72 20 57 4f | 52 44 20 63 75 72 5f 76 |ister WO|RD cur_v|
|00001d20| 61 6c 75 65 2c 20 63 75 | 72 5f 6d 61 78 2c 20 63 |alue, cu|r_max, c|
|00001d30| 75 72 5f 6d 69 6e 2c 20 | 63 75 72 5f 64 65 6c 74 |ur_min, |cur_delt|
|00001d40| 61 3b 0d 0d 09 69 66 20 | 28 74 68 65 50 61 72 74 |a;...if |(thePart|
|00001d50| 20 21 3d 20 30 29 20 7b | 0d 09 09 2f 2a 20 49 66 | != 0) {|.../* If|
|00001d60| 20 69 74 20 77 61 73 20 | 61 63 74 75 61 6c 6c 79 | it was |actually|
|00001d70| 20 69 6e 20 74 68 65 20 | 63 6f 6e 74 72 6f 6c 0d | in the |control.|
|00001d80| 09 09 20 2a 2f 0d 09 09 | 73 77 69 74 63 68 20 28 |.. */...|switch (|
|00001d90| 74 68 65 50 61 72 74 29 | 20 7b 0d 09 09 63 61 73 |thePart)| {...cas|
|00001da0| 65 20 69 6e 55 70 42 75 | 74 74 6f 6e 3a 0d 09 09 |e inUpBu|tton:...|
|00001db0| 63 61 73 65 20 69 6e 44 | 6f 77 6e 42 75 74 74 6f |case inD|ownButto|
|00001dc0| 6e 3a 0d 09 09 09 2f 2a | 20 6f 6e 65 20 6c 69 6e |n:..../*| one lin|
|00001dd0| 65 20 2a 2f 0d 09 09 09 | 63 75 72 5f 64 65 6c 74 |e */....|cur_delt|
|00001de0| 61 20 3d 20 31 3b 0d 09 | 09 09 62 72 65 61 6b 3b |a = 1;..|..break;|
|00001df0| 0d 0d 09 09 63 61 73 65 | 20 69 6e 50 61 67 65 55 |....case| inPageU|
|00001e00| 70 3a 0d 09 09 63 61 73 | 65 20 69 6e 50 61 67 65 |p:...cas|e inPage|
|00001e10| 44 6f 77 6e 3a 0d 09 09 | 09 2f 2a 20 6f 6e 65 20 |Down:...|./* one |
|00001e20| 70 61 67 65 20 2a 2f 0d | 09 09 09 63 75 72 5f 64 |page */.|...cur_d|
|00001e30| 65 6c 74 61 20 3d 20 47 | 65 74 43 52 65 66 43 6f |elta = G|etCRefCo|
|00001e40| 6e 28 74 68 65 43 6f 6e | 74 72 6f 6c 29 3b 0d 09 |n(theCon|trol);..|
|00001e50| 09 09 62 72 65 61 6b 3b | 0d 09 09 7d 0d 0d 09 09 |..break;|...}....|
|00001e60| 69 66 20 28 28 74 68 65 | 50 61 72 74 20 3d 3d 20 |if ((the|Part == |
|00001e70| 69 6e 44 6f 77 6e 42 75 | 74 74 6f 6e 29 20 7c 7c |inDownBu|tton) |||
|00001e80| 20 28 74 68 65 50 61 72 | 74 20 3d 3d 20 69 6e 50 | (thePar|t == inP|
|00001e90| 61 67 65 44 6f 77 6e 29 | 29 0d 09 09 09 63 75 72 |ageDown)|)....cur|
|00001ea0| 5f 64 65 6c 74 61 20 3d | 20 2d 63 75 72 5f 64 65 |_delta =| -cur_de|
|00001eb0| 6c 74 61 3b 0d 0d 09 09 | 2f 2a 20 47 65 74 20 76 |lta;....|/* Get v|
|00001ec0| 61 6c 75 65 2c 20 6d 61 | 78 20 61 6e 64 20 6d 69 |alue, ma|x and mi|
|00001ed0| 6e 0d 09 09 20 2a 2f 0d | 09 09 63 75 72 5f 6d 61 |n... */.|..cur_ma|
|00001ee0| 78 20 3d 20 47 65 74 43 | 74 6c 4d 61 78 28 74 68 |x = GetC|tlMax(th|
|00001ef0| 65 43 6f 6e 74 72 6f 6c | 29 3b 0d 09 09 63 75 72 |eControl|);...cur|
|00001f00| 5f 6d 69 6e 20 3d 20 47 | 65 74 43 74 6c 4d 69 6e |_min = G|etCtlMin|
|00001f10| 28 74 68 65 43 6f 6e 74 | 72 6f 6c 29 3b 0d 0d 09 |(theCont|rol);...|
|00001f20| 09 63 75 72 5f 76 61 6c | 75 65 20 3d 20 47 65 74 |.cur_val|ue = Get|
|00001f30| 43 74 6c 56 61 6c 75 65 | 28 74 68 65 43 6f 6e 74 |CtlValue|(theCont|
|00001f40| 72 6f 6c 29 3b 0d 09 09 | 63 75 72 5f 64 65 6c 74 |rol);...|cur_delt|
|00001f50| 61 20 3d 20 63 75 72 5f | 76 61 6c 75 65 20 2d 20 |a = cur_|value - |
|00001f60| 63 75 72 5f 64 65 6c 74 | 61 3b 0d 09 09 0d 09 09 |cur_delt|a;......|
|00001f70| 69 66 20 28 63 75 72 5f | 64 65 6c 74 61 20 3c 20 |if (cur_|delta < |
|00001f80| 30 29 0d 09 09 09 63 75 | 72 5f 64 65 6c 74 61 20 |0)....cu|r_delta |
|00001f90| 3d 20 30 3b 0d 09 09 65 | 6c 73 65 20 69 66 20 28 |= 0;...e|lse if (|
|00001fa0| 63 75 72 5f 64 65 6c 74 | 61 20 3e 20 63 75 72 5f |cur_delt|a > cur_|
|00001fb0| 6d 61 78 29 0d 09 09 09 | 63 75 72 5f 64 65 6c 74 |max)....|cur_delt|
|00001fc0| 61 20 3d 20 63 75 72 5f | 6d 61 78 3b 0d 09 09 09 |a = cur_|max;....|
|00001fd0| 0d 09 09 53 65 74 43 74 | 6c 56 61 6c 75 65 28 74 |...SetCt|lValue(t|
|00001fe0| 68 65 43 6f 6e 74 72 6f | 6c 2c 20 63 75 72 5f 64 |heContro|l, cur_d|
|00001ff0| 65 6c 74 61 29 3b 0d 0d | 09 09 2f 2a 20 43 61 6c |elta);..|../* Cal|
|00002000| 63 75 6c 61 74 65 20 74 | 68 65 20 72 65 61 6c 20 |culate t|he real |
|00002010| 63 68 61 6e 67 65 0d 09 | 09 20 2a 2f 0d 09 09 63 |change..|. */...c|
|00002020| 75 72 5f 64 65 6c 74 61 | 20 3d 20 63 75 72 5f 76 |ur_delta| = cur_v|
|00002030| 61 6c 75 65 20 2d 20 63 | 75 72 5f 64 65 6c 74 61 |alue - c|ur_delta|
|00002040| 3b 09 20 20 0d 0d 09 09 | 69 66 20 28 63 75 72 5f |;. ....|if (cur_|
|00002050| 64 65 6c 74 61 20 21 3d | 20 30 29 0d 09 09 09 54 |delta !=| 0)....T|
|00002060| 65 78 74 53 63 72 6f 6c | 6c 28 30 2c 20 63 75 72 |extScrol|l(0, cur|
|00002070| 5f 64 65 6c 74 61 2c 20 | 69 6e 66 6f 50 74 72 2d |_delta, |infoPtr-|
|00002080| 3e 69 74 65 6d 2e 74 65 | 78 74 2e 74 65 48 64 6c |>item.te|xt.teHdl|
|00002090| 29 3b 0d 09 7d 0d 7d 0d | 0d 0d 2f 2a 20 52 65 63 |);..}.}.|../* Rec|
|000020a0| 61 6c 63 75 6c 61 74 65 | 20 73 63 72 6f 6c 6c 62 |alculate| scrollb|
|000020b0| 61 72 20 76 61 6c 75 65 | 73 20 26 20 73 74 61 74 |ar value|s & stat|
|000020c0| 65 0d 20 2a 2f 0d 76 6f | 69 64 20 0d 54 65 78 74 |e. */.vo|id .Text|
|000020d0| 43 61 6c 63 53 63 72 6f | 6c 6c 20 28 74 68 65 57 |CalcScro|ll (theW|
|000020e0| 69 6e 64 6f 77 29 0d 09 | 72 65 67 69 73 74 65 72 |indow)..|register|
|000020f0| 20 57 69 6e 64 6f 77 50 | 74 72 20 74 68 65 57 69 | WindowP|tr theWi|
|00002100| 6e 64 6f 77 3b 0d 7b 0d | 09 72 65 67 69 73 74 65 |ndow;.{.|.registe|
|00002110| 72 20 49 6e 66 6f 50 74 | 72 20 69 6e 66 6f 50 74 |r InfoPt|r infoPt|
|00002120| 72 20 3d 20 28 49 6e 66 | 6f 50 74 72 29 20 47 65 |r = (Inf|oPtr) Ge|
|00002130| 74 57 52 65 66 43 6f 6e | 28 74 68 65 57 69 6e 64 |tWRefCon|(theWind|
|00002140| 6f 77 29 3b 0d 09 72 65 | 67 69 73 74 65 72 20 54 |ow);..re|gister T|
|00002150| 45 48 61 6e 64 6c 65 20 | 74 65 48 64 6c 20 3d 20 |EHandle |teHdl = |
|00002160| 69 6e 66 6f 50 74 72 2d | 3e 69 74 65 6d 2e 74 65 |infoPtr-|>item.te|
|00002170| 78 74 2e 74 65 48 64 6c | 3b 0d 09 72 65 67 69 73 |xt.teHdl|;..regis|
|00002180| 74 65 72 20 43 6f 6e 74 | 72 6f 6c 48 61 6e 64 6c |ter Cont|rolHandl|
|00002190| 65 20 73 63 72 6f 6c 6c | 48 64 6c 20 3d 20 69 6e |e scroll|Hdl = in|
|000021a0| 66 6f 50 74 72 2d 3e 69 | 74 65 6d 2e 74 65 78 74 |foPtr->i|tem.text|
|000021b0| 2e 73 63 72 6f 6c 6c 3b | 0d 09 72 65 67 69 73 74 |.scroll;|..regist|
|000021c0| 65 72 20 57 4f 52 44 20 | 6c 69 6e 65 73 49 6e 74 |er WORD |linesInt|
|000021d0| 6f 2c 20 73 63 72 6f 6c | 6c 4d 61 78 2c 20 64 65 |o, scrol|lMax, de|
|000021e0| 6c 74 61 2c 20 6f 6c 64 | 56 61 6c 3b 0d 09 72 65 |lta, old|Val;..re|
|000021f0| 67 69 73 74 65 72 20 4c | 4f 4e 47 20 76 69 65 77 |gister L|ONG view|
|00002200| 4c 69 6e 65 73 3b 0d 09 | 72 65 67 69 73 74 65 72 |Lines;..|register|
|00002210| 20 52 65 63 74 20 76 69 | 65 77 52 65 63 74 3b 0d | Rect vi|ewRect;.|
|00002220| 09 47 72 61 66 50 74 72 | 20 73 61 76 65 50 6f 72 |.GrafPtr| savePor|
|00002230| 74 3b 0d 09 0d 09 47 65 | 74 50 6f 72 74 28 26 73 |t;....Ge|tPort(&s|
|00002240| 61 76 65 50 6f 72 74 29 | 3b 0d 09 53 65 74 50 6f |avePort)|;..SetPo|
|00002250| 72 74 28 74 68 65 57 69 | 6e 64 6f 77 29 3b 0d 0d |rt(theWi|ndow);..|
|00002260| 09 2f 2a 20 41 64 6a 75 | 73 74 20 74 68 65 20 76 |./* Adju|st the v|
|00002270| 69 65 77 6c 69 6e 65 73 | 0d 09 20 2a 2f 0d 09 76 |iewlines|.. */..v|
|00002280| 69 65 77 52 65 63 74 20 | 3d 20 28 2a 74 65 48 64 |iewRect |= (*teHd|
|00002290| 6c 29 2d 3e 76 69 65 77 | 52 65 63 74 3b 0d 20 09 |l)->view|Rect;. .|
|000022a0| 76 69 65 77 4c 69 6e 65 | 73 20 3d 20 28 76 69 65 |viewLine|s = (vie|
|000022b0| 77 52 65 63 74 2e 62 6f | 74 74 6f 6d 20 2d 20 76 |wRect.bo|ttom - v|
|000022c0| 69 65 77 52 65 63 74 2e | 74 6f 70 29 20 2f 20 28 |iewRect.|top) / (|
|000022d0| 2a 74 65 48 64 6c 29 2d | 3e 6c 69 6e 65 48 65 69 |*teHdl)-|>lineHei|
|000022e0| 67 68 74 3b 0d 09 53 65 | 74 43 52 65 66 43 6f 6e |ght;..Se|tCRefCon|
|000022f0| 28 73 63 72 6f 6c 6c 48 | 64 6c 2c 20 76 69 65 77 |(scrollH|dl, view|
|00002300| 4c 69 6e 65 73 29 3b 0d | 0d 09 2f 2a 20 41 64 6a |Lines);.|../* Adj|
|00002310| 75 73 74 20 74 68 65 20 | 6d 69 6e 20 26 20 6d 61 |ust the |min & ma|
|00002320| 78 0d 09 20 2a 2f 0d 09 | 73 63 72 6f 6c 6c 4d 61 |x.. */..|scrollMa|
|00002330| 78 20 3d 20 28 2a 74 65 | 48 64 6c 29 2d 3e 6e 4c |x = (*te|Hdl)->nL|
|00002340| 69 6e 65 73 20 2b 20 31 | 20 2d 20 76 69 65 77 4c |ines + 1| - viewL|
|00002350| 69 6e 65 73 3b 0d 0d 09 | 69 66 20 28 73 63 72 6f |ines;...|if (scro|
|00002360| 6c 6c 4d 61 78 20 3c 20 | 30 29 0d 09 09 73 63 72 |llMax < |0)...scr|
|00002370| 6f 6c 6c 4d 61 78 20 3d | 20 30 3b 0d 0d 09 53 65 |ollMax =| 0;...Se|
|00002380| 74 43 74 6c 4d 69 6e 28 | 73 63 72 6f 6c 6c 48 64 |tCtlMin(|scrollHd|
|00002390| 6c 2c 20 30 29 3b 0d 09 | 53 65 74 43 74 6c 4d 61 |l, 0);..|SetCtlMa|
|000023a0| 78 28 73 63 72 6f 6c 6c | 48 64 6c 2c 20 73 63 72 |x(scroll|Hdl, scr|
|000023b0| 6f 6c 6c 4d 61 78 29 3b | 0d 0d 09 2f 2a 20 4d 61 |ollMax);|.../* Ma|
|000023c0| 6b 65 20 74 68 65 20 74 | 65 78 74 20 73 74 69 63 |ke the t|ext stic|
|000023d0| 6b 79 20 74 6f 20 74 68 | 65 20 62 6f 74 74 6f 6d |ky to th|e bottom|
|000023e0| 20 6f 66 20 74 68 65 20 | 76 69 65 77 52 65 63 74 | of the |viewRect|
|000023f0| 0d 09 20 2a 2f 0d 09 6c | 69 6e 65 73 49 6e 74 6f |.. */..l|inesInto|
|00002400| 20 3d 20 28 76 69 65 77 | 52 65 63 74 2e 74 6f 70 | = (view|Rect.top|
|00002410| 20 2d 20 28 2a 74 65 48 | 64 6c 29 2d 3e 64 65 73 | - (*teH|dl)->des|
|00002420| 74 52 65 63 74 2e 74 6f | 70 29 20 2f 20 28 2a 74 |tRect.to|p) / (*t|
|00002430| 65 48 64 6c 29 2d 3e 6c | 69 6e 65 48 65 69 67 68 |eHdl)->l|ineHeigh|
|00002440| 74 3b 0d 09 64 65 6c 74 | 61 20 3d 20 6c 69 6e 65 |t;..delt|a = line|
|00002450| 73 49 6e 74 6f 20 2d 20 | 73 63 72 6f 6c 6c 4d 61 |sInto - |scrollMa|
|00002460| 78 3b 0d 09 0d 09 69 66 | 20 28 28 64 65 6c 74 61 |x;....if| ((delta|
|00002470| 20 3e 20 30 29 20 7c 7c | 20 28 73 63 72 6f 6c 6c | > 0) ||| (scroll|
|00002480| 4d 61 78 20 3d 3d 20 30 | 29 29 20 7b 0d 09 09 6c |Max == 0|)) {...l|
|00002490| 69 6e 65 73 49 6e 74 6f | 20 3d 20 73 63 72 6f 6c |inesInto| = scrol|
|000024a0| 6c 4d 61 78 3b 0d 09 09 | 6f 6c 64 56 61 6c 20 3d |lMax;...|oldVal =|
|000024b0| 20 28 2a 74 65 48 64 6c | 29 2d 3e 64 65 73 74 52 | (*teHdl|)->destR|
|000024c0| 65 63 74 2e 74 6f 70 3b | 0d 09 09 28 2a 74 65 48 |ect.top;|...(*teH|
|000024d0| 64 6c 29 2d 3e 64 65 73 | 74 52 65 63 74 2e 74 6f |dl)->des|tRect.to|
|000024e0| 70 20 3d 20 28 2a 74 65 | 48 64 6c 29 2d 3e 76 69 |p = (*te|Hdl)->vi|
|000024f0| 65 77 52 65 63 74 2e 74 | 6f 70 20 2d 20 28 6c 69 |ewRect.t|op - (li|
|00002500| 6e 65 73 49 6e 74 6f 20 | 2a 20 28 2a 74 65 48 64 |nesInto |* (*teHd|
|00002510| 6c 29 2d 3e 6c 69 6e 65 | 48 65 69 67 68 74 29 3b |l)->line|Height);|
|00002520| 0d 09 09 54 45 43 61 6c | 54 65 78 74 28 74 65 48 |...TECal|Text(teH|
|00002530| 64 6c 29 3b 0d 09 09 0d | 09 09 69 66 20 28 6f 6c |dl);....|..if (ol|
|00002540| 64 56 61 6c 20 21 3d 20 | 28 2a 74 65 48 64 6c 29 |dVal != |(*teHdl)|
|00002550| 2d 3e 64 65 73 74 52 65 | 63 74 2e 74 6f 70 29 0d |->destRe|ct.top).|
|00002560| 09 09 09 54 65 78 74 55 | 70 64 61 74 65 28 74 68 |...TextU|pdate(th|
|00002570| 65 57 69 6e 64 6f 77 29 | 3b 0d 09 7d 0d 0d 09 53 |eWindow)|;..}...S|
|00002580| 65 74 43 74 6c 56 61 6c | 75 65 28 73 63 72 6f 6c |etCtlVal|ue(scrol|
|00002590| 6c 48 64 6c 2c 20 6c 69 | 6e 65 73 49 6e 74 6f 29 |lHdl, li|nesInto)|
|000025a0| 3b 0d 0d 09 2f 2a 20 41 | 64 6a 75 73 74 20 74 68 |;.../* A|djust th|
|000025b0| 65 20 68 69 6c 69 74 65 | 0d 09 20 2a 2f 0d 09 69 |e hilite|.. */..i|
|000025c0| 66 20 28 74 68 65 57 69 | 6e 64 6f 77 20 3d 3d 20 |f (theWi|ndow == |
|000025d0| 46 72 6f 6e 74 57 69 6e | 64 6f 77 28 29 29 20 7b |FrontWin|dow()) {|
|000025e0| 0d 09 09 69 66 20 28 73 | 63 72 6f 6c 6c 4d 61 78 |...if (s|crollMax|
|000025f0| 20 3e 20 30 29 0d 09 09 | 09 48 69 6c 69 74 65 43 | > 0)...|.HiliteC|
|00002600| 6f 6e 74 72 6f 6c 28 73 | 63 72 6f 6c 6c 48 64 6c |ontrol(s|crollHdl|
|00002610| 2c 20 30 29 3b 0d 09 09 | 65 6c 73 65 0d 09 09 09 |, 0);...|else....|
|00002620| 48 69 6c 69 74 65 43 6f | 6e 74 72 6f 6c 28 73 63 |HiliteCo|ntrol(sc|
|00002630| 72 6f 6c 6c 48 64 6c 2c | 20 32 35 35 29 3b 0d 09 |rollHdl,| 255);..|
|00002640| 7d 0d 7d 0d 0d 0d 2f 2a | 20 53 63 72 6f 6c 6c 20 |}.}.../*| Scroll |
|00002650| 74 68 65 20 74 65 78 74 | 20 6d 61 6e 75 61 6c 6c |the text| manuall|
|00002660| 79 0d 20 2a 2f 0d 76 6f | 69 64 0d 54 65 78 74 53 |y. */.vo|id.TextS|
|00002670| 63 72 6f 6c 6c 20 28 64 | 68 2c 20 64 76 2c 20 74 |croll (d|h, dv, t|
|00002680| 65 48 64 6c 29 0d 09 72 | 65 67 69 73 74 65 72 20 |eHdl)..r|egister |
|00002690| 57 4f 52 44 20 64 68 3b | 0d 09 72 65 67 69 73 74 |WORD dh;|..regist|
|000026a0| 65 72 20 57 4f 52 44 20 | 64 76 3b 0d 09 72 65 67 |er WORD |dv;..reg|
|000026b0| 69 73 74 65 72 20 54 45 | 48 61 6e 64 6c 65 20 74 |ister TE|Handle t|
|000026c0| 65 48 64 6c 3b 0d 7b 0d | 09 2f 2a 20 43 61 6c 63 |eHdl;.{.|./* Calc|
|000026d0| 75 6c 61 74 65 20 74 68 | 65 20 6c 69 6e 65 48 65 |ulate th|e lineHe|
|000026e0| 69 67 68 74 0d 09 20 2a | 2f 0d 09 64 76 20 2a 3d |ight.. *|/..dv *=|
|000026f0| 20 28 2a 74 65 48 64 6c | 29 2d 3e 6c 69 6e 65 48 | (*teHdl|)->lineH|
|00002700| 65 69 67 68 74 3b 0d 0d | 09 2f 2a 20 41 64 6a 75 |eight;..|./* Adju|
|00002710| 73 74 20 74 68 65 20 64 | 65 73 74 69 6e 61 74 69 |st the d|estinati|
|00002720| 6f 6e 20 72 65 63 74 61 | 6e 67 6c 65 0d 09 20 2a |on recta|ngle.. *|
|00002730| 2f 0d 09 28 2a 74 65 48 | 64 6c 29 2d 3e 64 65 73 |/..(*teH|dl)->des|
|00002740| 74 52 65 63 74 2e 6c 65 | 66 74 20 2b 3d 20 64 68 |tRect.le|ft += dh|
|00002750| 3b 0d 09 28 2a 74 65 48 | 64 6c 29 2d 3e 64 65 73 |;..(*teH|dl)->des|
|00002760| 74 52 65 63 74 2e 72 69 | 67 68 74 20 2b 3d 20 64 |tRect.ri|ght += d|
|00002770| 68 3b 0d 0d 09 28 2a 74 | 65 48 64 6c 29 2d 3e 64 |h;...(*t|eHdl)->d|
|00002780| 65 73 74 52 65 63 74 2e | 74 6f 70 20 2b 3d 20 64 |estRect.|top += d|
|00002790| 76 3b 0d 09 28 2a 74 65 | 48 64 6c 29 2d 3e 64 65 |v;..(*te|Hdl)->de|
|000027a0| 73 74 52 65 63 74 2e 62 | 6f 74 74 6f 6d 20 2b 3d |stRect.b|ottom +=|
|000027b0| 20 64 76 3b 0d 09 0d 09 | 2f 2a 20 52 65 64 72 61 | dv;....|/* Redra|
|000027c0| 77 20 74 68 65 20 74 65 | 78 74 0d 09 20 2a 2f 0d |w the te|xt.. */.|
|000027d0| 09 54 65 78 74 55 70 64 | 61 74 65 28 28 2a 74 65 |.TextUpd|ate((*te|
|000027e0| 48 64 6c 29 2d 3e 69 6e | 50 6f 72 74 29 3b 0d 7d |Hdl)->in|Port);.}|
|000027f0| 0d 0d 0d 2f 2a 20 53 63 | 72 6f 6c 6c 20 74 68 65 |.../* Sc|roll the|
|00002800| 20 74 65 78 74 20 77 69 | 6e 64 6f 77 20 74 6f 20 | text wi|ndow to |
|00002810| 61 20 73 70 65 63 69 66 | 69 63 20 6c 6f 63 61 74 |a specif|ic locat|
|00002820| 69 6f 6e 3b 20 63 68 61 | 6e 67 65 73 20 74 68 65 |ion; cha|nges the|
|00002830| 20 73 63 72 6f 6c 6c 20 | 62 61 72 73 0d 20 2a 20 | scroll |bars. * |
|00002840| 61 73 20 77 65 6c 6c 2e | 0d 20 2a 2f 0d 76 6f 69 |as well.|. */.voi|
|00002850| 64 0d 54 65 78 74 53 63 | 72 6f 6c 6c 54 6f 20 28 |d.TextSc|rollTo (|
|00002860| 68 2c 20 76 2c 20 74 68 | 65 57 69 6e 64 6f 77 29 |h, v, th|eWindow)|
|00002870| 0d 09 72 65 67 69 73 74 | 65 72 20 57 4f 52 44 20 |..regist|er WORD |
|00002880| 68 3b 0d 09 72 65 67 69 | 73 74 65 72 20 57 4f 52 |h;..regi|ster WOR|
|00002890| 44 20 76 3b 0d 09 72 65 | 67 69 73 74 65 72 20 57 |D v;..re|gister W|
|000028a0| 69 6e 64 6f 77 50 74 72 | 20 74 68 65 57 69 6e 64 |indowPtr| theWind|
|000028b0| 6f 77 3b 0d 7b 0d 09 72 | 65 67 69 73 74 65 72 20 |ow;.{..r|egister |
|000028c0| 49 6e 66 6f 50 74 72 20 | 69 6e 66 6f 50 74 72 20 |InfoPtr |infoPtr |
|000028d0| 3d 20 28 49 6e 66 6f 50 | 74 72 29 20 47 65 74 57 |= (InfoP|tr) GetW|
|000028e0| 52 65 66 43 6f 6e 28 74 | 68 65 57 69 6e 64 6f 77 |RefCon(t|heWindow|
|000028f0| 29 3b 0d 09 72 65 67 69 | 73 74 65 72 20 54 45 48 |);..regi|ster TEH|
|00002900| 61 6e 64 6c 65 20 74 65 | 48 64 6c 20 3d 20 69 6e |andle te|Hdl = in|
|00002910| 66 6f 50 74 72 2d 3e 69 | 74 65 6d 2e 74 65 78 74 |foPtr->i|tem.text|
|00002920| 2e 74 65 48 64 6c 3b 0d | 09 72 65 67 69 73 74 65 |.teHdl;.|.registe|
|00002930| 72 20 43 6f 6e 74 72 6f | 6c 48 61 6e 64 6c 65 20 |r Contro|lHandle |
|00002940| 73 63 72 6f 6c 6c 48 64 | 6c 20 3d 20 69 6e 66 6f |scrollHd|l = info|
|00002950| 50 74 72 2d 3e 69 74 65 | 6d 2e 74 65 78 74 2e 73 |Ptr->ite|m.text.s|
|00002960| 63 72 6f 6c 6c 3b 0d 09 | 72 65 67 69 73 74 65 72 |croll;..|register|
|00002970| 20 57 4f 52 44 20 73 63 | 72 6f 6c 6c 4d 61 78 20 | WORD sc|rollMax |
|00002980| 3d 20 47 65 74 43 74 6c | 4d 61 78 28 73 63 72 6f |= GetCtl|Max(scro|
|00002990| 6c 6c 48 64 6c 29 3b 0d | 0d 09 2f 2a 20 50 69 6e |llHdl);.|../* Pin|
|000029a0| 20 74 68 65 20 6d 61 78 | 20 76 65 72 74 69 63 61 | the max| vertica|
|000029b0| 6c 0d 09 20 2a 2f 0d 09 | 69 66 20 28 76 20 3e 20 |l.. */..|if (v > |
|000029c0| 73 63 72 6f 6c 6c 4d 61 | 78 29 0d 09 09 76 20 3d |scrollMa|x)...v =|
|000029d0| 20 73 63 72 6f 6c 6c 4d | 61 78 3b 0d 0d 09 2f 2a | scrollM|ax;.../*|
|000029e0| 20 41 64 6a 75 73 74 20 | 74 68 65 20 64 65 73 74 | Adjust |the dest|
|000029f0| 69 6e 61 74 69 6f 6e 20 | 72 65 63 74 61 6e 67 6c |ination |rectangl|
|00002a00| 65 0d 09 20 2a 2f 0d 09 | 28 2a 74 65 48 64 6c 29 |e.. */..|(*teHdl)|
|00002a10| 2d 3e 64 65 73 74 52 65 | 63 74 2e 6c 65 66 74 20 |->destRe|ct.left |
|00002a20| 3d 20 28 2a 74 65 48 64 | 6c 29 2d 3e 76 69 65 77 |= (*teHd|l)->view|
|00002a30| 52 65 63 74 2e 6c 65 66 | 74 20 2d 20 68 3b 0d 09 |Rect.lef|t - h;..|
|00002a40| 28 2a 74 65 48 64 6c 29 | 2d 3e 64 65 73 74 52 65 |(*teHdl)|->destRe|
|00002a50| 63 74 2e 74 6f 70 20 3d | 20 28 2a 74 65 48 64 6c |ct.top =| (*teHdl|
|00002a60| 29 2d 3e 76 69 65 77 52 | 65 63 74 2e 74 6f 70 20 |)->viewR|ect.top |
|00002a70| 2d 20 28 76 20 2a 20 28 | 2a 74 65 48 64 6c 29 2d |- (v * (|*teHdl)-|
|00002a80| 3e 6c 69 6e 65 48 65 69 | 67 68 74 29 3b 0d 0d 09 |>lineHei|ght);...|
|00002a90| 2f 2a 20 52 65 73 65 74 | 20 74 68 65 20 73 63 72 |/* Reset| the scr|
|00002aa0| 6f 6c 6c 20 62 61 72 20 | 76 61 6c 75 65 73 20 61 |oll bar |values a|
|00002ab0| 6e 64 20 72 65 64 72 61 | 77 20 74 68 65 20 74 65 |nd redra|w the te|
|00002ac0| 78 74 0d 09 20 2a 2f 0d | 09 53 65 74 43 74 6c 56 |xt.. */.|.SetCtlV|
|00002ad0| 61 6c 75 65 28 73 63 72 | 6f 6c 6c 48 64 6c 2c 20 |alue(scr|ollHdl, |
|00002ae0| 76 29 3b 0d 09 54 65 78 | 74 55 70 64 61 74 65 28 |v);..Tex|tUpdate(|
|00002af0| 74 68 65 57 69 6e 64 6f | 77 29 3b 0d 7d 0d 0d 0d |theWindo|w);.}...|
|00002b00| 2f 2a 20 53 63 72 6f 6c | 6c 20 74 68 65 20 65 6e |/* Scrol|l the en|
|00002b10| 64 20 6f 66 20 74 68 65 | 20 73 65 6c 65 63 74 69 |d of the| selecti|
|00002b20| 6f 6e 20 72 61 6e 67 65 | 20 69 6e 74 6f 20 74 68 |on range| into th|
|00002b30| 65 20 76 69 65 77 20 72 | 65 63 74 61 6e 67 6c 65 |e view r|ectangle|
|00002b40| 0d 20 2a 2f 0d 76 6f 69 | 64 0d 54 65 78 74 53 65 |. */.voi|d.TextSe|
|00002b50| 6c 56 69 65 77 20 28 74 | 68 65 57 69 6e 64 6f 77 |lView (t|heWindow|
|00002b60| 29 0d 09 72 65 67 69 73 | 74 65 72 20 57 69 6e 64 |)..regis|ter Wind|
|00002b70| 6f 77 50 74 72 20 74 68 | 65 57 69 6e 64 6f 77 3b |owPtr th|eWindow;|
|00002b80| 0d 7b 0d 09 72 65 67 69 | 73 74 65 72 20 49 6e 66 |.{..regi|ster Inf|
|00002b90| 6f 50 74 72 20 69 6e 66 | 6f 50 74 72 20 3d 20 28 |oPtr inf|oPtr = (|
|00002ba0| 49 6e 66 6f 50 74 72 29 | 20 47 65 74 57 52 65 66 |InfoPtr)| GetWRef|
|00002bb0| 43 6f 6e 28 74 68 65 57 | 69 6e 64 6f 77 29 3b 0d |Con(theW|indow);.|
|00002bc0| 09 72 65 67 69 73 74 65 | 72 20 54 45 48 61 6e 64 |.registe|r TEHand|
|00002bd0| 6c 65 20 74 65 48 64 6c | 20 3d 20 69 6e 66 6f 50 |le teHdl| = infoP|
|00002be0| 74 72 2d 3e 69 74 65 6d | 2e 74 65 78 74 2e 74 65 |tr->item|.text.te|
|00002bf0| 48 64 6c 3b 0d 09 72 65 | 67 69 73 74 65 72 20 43 |Hdl;..re|gister C|
|00002c00| 6f 6e 74 72 6f 6c 48 61 | 6e 64 6c 65 20 73 63 72 |ontrolHa|ndle scr|
|00002c10| 6f 6c 6c 48 64 6c 20 3d | 20 69 6e 66 6f 50 74 72 |ollHdl =| infoPtr|
|00002c20| 2d 3e 69 74 65 6d 2e 74 | 65 78 74 2e 73 63 72 6f |->item.t|ext.scro|
|00002c30| 6c 6c 3b 0d 09 72 65 67 | 69 73 74 65 72 20 57 4f |ll;..reg|ister WO|
|00002c40| 52 44 20 74 68 65 4c 69 | 6e 65 2c 20 6c 69 6e 65 |RD theLi|ne, line|
|00002c50| 73 49 6e 74 6f 2c 20 76 | 69 65 77 4c 69 6e 65 73 |sInto, v|iewLines|
|00002c60| 3b 0d 0d 09 2f 2a 20 46 | 69 6e 64 20 74 68 65 20 |;.../* F|ind the |
|00002c70| 6c 69 6e 65 20 6e 75 6d | 62 65 72 20 6f 66 20 74 |line num|ber of t|
|00002c80| 68 65 20 65 6e 64 20 6f | 66 20 73 65 6c 65 63 74 |he end o|f select|
|00002c90| 69 6f 6e 20 72 61 6e 67 | 65 0d 09 20 2a 2f 0d 09 |ion rang|e.. */..|
|00002ca0| 66 6f 72 20 28 74 68 65 | 4c 69 6e 65 20 3d 20 28 |for (the|Line = (|
|00002cb0| 2a 74 65 48 64 6c 29 2d | 3e 6e 4c 69 6e 65 73 3b |*teHdl)-|>nLines;|
|00002cc0| 20 74 68 65 4c 69 6e 65 | 2d 2d 20 3e 20 30 3b 20 | theLine|-- > 0; |
|00002cd0| 29 20 7b 0d 09 09 69 66 | 20 28 28 2a 74 65 48 64 |) {...if| ((*teHd|
|00002ce0| 6c 29 2d 3e 73 65 6c 45 | 6e 64 20 3e 3d 20 28 2a |l)->selE|nd >= (*|
|00002cf0| 74 65 48 64 6c 29 2d 3e | 6c 69 6e 65 53 74 61 72 |teHdl)->|lineStar|
|00002d00| 74 73 5b 74 68 65 4c 69 | 6e 65 5d 29 20 7b 0d 09 |ts[theLi|ne]) {..|
|00002d10| 09 09 2f 2a 20 53 65 65 | 20 69 66 20 74 68 65 20 |../* See| if the |
|00002d20| 6c 69 6e 65 20 69 73 20 | 69 6e 20 76 69 65 77 0d |line is |in view.|
|00002d30| 09 09 09 20 2a 2f 0d 09 | 09 09 6c 69 6e 65 73 49 |... */..|..linesI|
|00002d40| 6e 74 6f 20 3d 20 47 65 | 74 43 74 6c 56 61 6c 75 |nto = Ge|tCtlValu|
|00002d50| 65 28 73 63 72 6f 6c 6c | 48 64 6c 29 3b 0d 09 09 |e(scroll|Hdl);...|
|00002d60| 09 76 69 65 77 4c 69 6e | 65 73 20 3d 20 47 65 74 |.viewLin|es = Get|
|00002d70| 43 52 65 66 43 6f 6e 28 | 73 63 72 6f 6c 6c 48 64 |CRefCon(|scrollHd|
|00002d80| 6c 29 3b 0d 09 09 09 0d | 09 09 09 2f 2a 20 49 66 |l);.....|.../* If|
|00002d90| 20 6e 6f 74 2c 20 74 68 | 65 6e 20 6c 65 74 27 73 | not, th|en let's|
|00002da0| 20 74 61 6b 65 20 61 20 | 6c 69 74 74 6c 65 20 6c | take a |little l|
|00002db0| 6f 6f 6b 2d 73 65 65 20 | 61 74 20 69 74 0d 09 09 |ook-see |at it...|
|00002dc0| 09 20 2a 2f 0d 09 09 09 | 69 66 20 28 28 74 68 65 |. */....|if ((the|
|00002dd0| 4c 69 6e 65 20 3c 20 6c | 69 6e 65 73 49 6e 74 6f |Line < l|inesInto|
|00002de0| 29 20 7c 7c 20 28 74 68 | 65 4c 69 6e 65 20 3e 3d |) || (th|eLine >=|
|00002df0| 20 28 6c 69 6e 65 73 49 | 6e 74 6f 20 2b 20 76 69 | (linesI|nto + vi|
|00002e00| 65 77 4c 69 6e 65 73 29 | 29 29 0d 09 09 09 09 54 |ewLines)|)).....T|
|00002e10| 65 78 74 53 63 72 6f 6c | 6c 54 6f 28 30 2c 20 74 |extScrol|lTo(0, t|
|00002e20| 68 65 4c 69 6e 65 2c 20 | 74 68 65 57 69 6e 64 6f |heLine, |theWindo|
|00002e30| 77 29 3b 0d 09 09 09 0d | 09 09 09 54 65 78 74 43 |w);.....|...TextC|
|00002e40| 61 6c 63 53 63 72 6f 6c | 6c 28 74 68 65 57 69 6e |alcScrol|l(theWin|
|00002e50| 64 6f 77 29 3b 0d 09 09 | 09 72 65 74 75 72 6e 3b |dow);...|.return;|
|00002e60| 0d 09 09 7d 0d 09 7d 0d | 7d 0d 00 00 00 00 00 00 |...}..}.|}.......|
|00002e70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+