home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
You can browse this item here: lsc30p4d.hqx
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| BinHex (archive/binHex)
| magic
| Supported |
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
100%
| dexvert
| Internet Message Format (text/imf)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| Mailbox text, 1st line "From blob@Apple.COM Fri Sep 9 11:00:21 1988"
| default
| |
99%
| file
| C source, ASCII text
| default
| |
100%
| TrID
| E-Mail message (Var. 2)
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| application/mbox
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 20 62 6c 6f | 62 40 41 70 70 6c 65 2e |From blo|b@Apple.|
|00000010| 43 4f 4d 20 46 72 69 20 | 53 65 70 20 20 39 20 31 |COM Fri |Sep 9 1|
|00000020| 31 3a 30 30 3a 32 31 20 | 31 39 38 38 0a 50 61 74 |1:00:21 |1988.Pat|
|00000030| 68 3a 20 75 74 61 73 74 | 72 6f 21 63 73 2e 75 74 |h: utast|ro!cs.ut|
|00000040| 65 78 61 73 2e 65 64 75 | 21 72 75 74 67 65 72 73 |exas.edu|!rutgers|
|00000050| 21 75 63 73 64 21 61 6d | 65 73 21 6f 6c 69 76 65 |!ucsd!am|es!olive|
|00000060| 62 21 66 65 6c 69 78 21 | 64 68 77 36 38 6b 21 6d |b!felix!|dhw68k!m|
|00000070| 61 63 69 6e 74 6f 73 68 | 0a 46 72 6f 6d 3a 20 62 |acintosh|.From: b|
|00000080| 6c 6f 62 40 41 70 70 6c | 65 2e 43 4f 4d 20 28 42 |lob@Appl|e.COM (B|
|00000090| 72 69 61 6e 20 42 65 63 | 68 74 65 6c 29 0a 4e 65 |rian Bec|htel).Ne|
|000000a0| 77 73 67 72 6f 75 70 73 | 3a 20 63 6f 6d 70 2e 73 |wsgroups|: comp.s|
|000000b0| 6f 75 72 63 65 73 2e 6d | 61 63 0a 53 75 62 6a 65 |ources.m|ac.Subje|
|000000c0| 63 74 3a 20 44 69 61 6c | 6f 67 20 6d 61 6e 61 67 |ct: Dial|og manag|
|000000d0| 65 6d 65 6e 74 20 69 6e | 20 54 68 69 6e 6b 20 43 |ement in| Think C|
|000000e0| 20 33 2e 30 0a 4d 65 73 | 73 61 67 65 2d 49 44 3a | 3.0.Mes|sage-ID:|
|000000f0| 20 3c 31 31 33 39 38 40 | 64 68 77 36 38 6b 2e 63 | <11398@|dhw68k.c|
|00000100| 74 73 2e 63 6f 6d 3e 0a | 44 61 74 65 3a 20 39 20 |ts.com>.|Date: 9 |
|00000110| 53 65 70 20 38 38 20 31 | 36 3a 30 30 3a 32 31 20 |Sep 88 1|6:00:21 |
|00000120| 47 4d 54 0a 53 65 6e 64 | 65 72 3a 20 6d 61 63 69 |GMT.Send|er: maci|
|00000130| 6e 74 6f 73 68 40 64 68 | 77 36 38 6b 2e 63 74 73 |ntosh@dh|w68k.cts|
|00000140| 2e 63 6f 6d 0a 4f 72 67 | 61 6e 69 7a 61 74 69 6f |.com.Org|anizatio|
|00000150| 6e 3a 20 41 70 70 6c 65 | 20 43 6f 6d 70 75 74 65 |n: Apple| Compute|
|00000160| 72 20 49 6e 63 2e 2c 20 | 43 75 70 65 72 74 69 6e |r Inc., |Cupertin|
|00000170| 6f 2c 20 43 41 0a 4c 69 | 6e 65 73 3a 20 33 38 35 |o, CA.Li|nes: 385|
|00000180| 0a 41 70 70 72 6f 76 65 | 64 3a 20 62 79 74 65 62 |.Approve|d: byteb|
|00000190| 75 67 40 64 68 77 36 38 | 6b 2e 63 74 73 2e 63 6f |ug@dhw68|k.cts.co|
|000001a0| 6d 20 28 52 6f 67 65 72 | 20 4c 2e 20 4c 6f 6e 67 |m (Roger| L. Long|
|000001b0| 29 0a 0a 5b 44 69 61 6c | 6f 67 20 6d 61 6e 61 67 |)..[Dial|og manag|
|000001c0| 65 6d 65 6e 74 20 69 6e | 20 54 68 69 6e 6b 20 43 |ement in| Think C|
|000001d0| 20 33 2e 30 5d 0a 0a 49 | 20 70 69 63 6b 65 64 20 | 3.0]..I| picked |
|000001e0| 74 68 69 73 20 75 70 20 | 66 72 6f 6d 20 50 61 75 |this up |from Pau|
|000001f0| 6c 20 44 75 42 6f 69 73 | 27 20 42 6c 6f 62 4d 67 |l DuBois|' BlobMg|
|00000200| 72 44 65 6d 6f 20 73 6f | 75 72 63 65 20 61 20 77 |rDemo so|urce a w|
|00000210| 68 69 6c 65 20 62 61 63 | 6b 2c 20 61 6e 64 0a 73 |hile bac|k, and.s|
|00000220| 6c 69 67 68 74 6c 79 20 | 65 6e 68 61 6e 63 65 64 |lightly |enhanced|
|00000230| 20 69 74 20 74 6f 20 68 | 61 6e 64 6c 65 20 74 68 | it to h|andle th|
|00000240| 65 20 52 65 74 75 72 6e | 20 6f 72 20 45 6e 74 65 |e Return| or Ente|
|00000250| 72 20 6b 65 79 73 20 61 | 6e 64 20 74 6f 20 68 69 |r keys a|nd to hi|
|00000260| 67 68 6c 69 67 68 74 0a | 74 68 65 20 64 65 66 61 |ghlight.|the defa|
|00000270| 75 6c 74 20 4f 4b 20 62 | 75 74 74 6f 6e 2e 20 20 |ult OK b|utton. |
|00000280| 54 68 69 73 20 77 6f 72 | 6b 73 20 75 6e 64 65 72 |This wor|ks under|
|00000290| 20 54 68 69 6e 6b 27 73 | 20 4c 69 67 68 74 53 70 | Think's| LightSp|
|000002a0| 65 65 64 20 43 2e 20 20 | 49 74 27 73 0a 70 75 62 |eed C. |It's.pub|
|000002b0| 6c 69 63 20 64 6f 6d 61 | 69 6e 20 63 6f 64 65 2e |lic doma|in code.|
|000002c0| 0a 0a 2d 2d 2d 0a 20 2f | 2a 0a 20 20 20 20 50 72 |..---. /|*. Pr|
|000002d0| 65 73 65 6e 74 20 61 20 | 64 69 61 6c 6f 67 20 62 |esent a |dialog b|
|000002e0| 6f 78 20 77 69 74 68 20 | 61 20 74 65 78 74 20 72 |ox with |a text r|
|000002f0| 65 63 74 61 6e 67 6c 65 | 2c 20 61 20 73 63 72 6f |ectangle|, a scro|
|00000300| 6c 6c 20 62 61 72 2c 20 | 61 6e 64 20 61 6e 20 4f |ll bar, |and an O|
|00000310| 4b 0a 20 20 20 20 62 75 | 74 74 6f 6e 2e 20 20 54 |K. bu|tton. T|
|00000320| 68 69 73 20 63 61 6e 20 | 62 65 20 75 73 65 64 20 |his can |be used |
|00000330| 61 73 20 61 20 68 65 6c | 70 20 64 69 61 6c 6f 67 |as a hel|p dialog|
|00000340| 2e 20 20 50 61 73 73 20 | 69 6e 20 61 20 64 69 61 |. Pass |in a dia|
|00000350| 6c 6f 67 0a 20 20 20 20 | 72 65 73 6f 75 72 63 65 |log. |resource|
|00000360| 20 6e 75 6d 62 65 72 20 | 61 6e 64 20 61 20 68 61 | number |and a ha|
|00000370| 6e 64 6c 65 20 74 6f 20 | 74 68 65 20 74 65 78 74 |ndle to |the text|
|00000380| 2e 20 20 54 68 65 20 64 | 69 61 6c 6f 67 20 73 68 |. The d|ialog sh|
|00000390| 6f 75 6c 64 0a 20 20 20 | 20 68 61 76 65 20 74 68 |ould. | have th|
|000003a0| 65 20 4f 4b 20 62 75 74 | 74 6f 6e 20 61 73 20 74 |e OK but|ton as t|
|000003b0| 68 65 20 66 69 72 73 74 | 20 69 74 65 6d 2c 20 61 |he first| item, a|
|000003c0| 6e 64 20 75 73 65 72 20 | 69 74 65 6d 73 20 66 6f |nd user |items fo|
|000003d0| 72 20 74 68 65 0a 20 20 | 20 20 73 65 63 6f 6e 64 |r the. | second|
|000003e0| 20 61 6e 64 20 74 68 69 | 72 64 20 69 74 65 6d 73 | and thi|rd items|
|000003f0| 2e 20 20 54 68 65 20 73 | 65 63 6f 6e 64 20 69 73 |. The s|econd is|
|00000400| 20 74 68 65 20 72 65 63 | 74 20 69 6e 20 77 68 69 | the rec|t in whi|
|00000410| 63 68 20 74 68 65 0a 20 | 20 20 20 63 6f 6e 74 72 |ch the. | contr|
|00000420| 6f 6c 20 69 73 20 64 72 | 61 77 6e 2c 20 74 68 65 |ol is dr|awn, the|
|00000430| 20 74 68 69 72 64 20 69 | 73 20 74 68 65 20 72 65 | third i|s the re|
|00000440| 63 74 20 69 6e 20 77 68 | 69 63 68 20 74 65 78 74 |ct in wh|ich text|
|00000450| 20 69 73 20 64 72 61 77 | 6e 2e 0a 20 20 20 20 4f | is draw|n.. O|
|00000460| 6e 6c 79 20 74 68 65 20 | 4f 4b 20 62 75 74 74 6f |nly the |OK butto|
|00000470| 6e 20 73 68 6f 75 6c 64 | 20 62 65 20 65 6e 61 62 |n should| be enab|
|00000480| 6c 65 64 2e 0a 0a 20 20 | 20 20 54 68 65 20 74 65 |led... | The te|
|00000490| 78 74 20 68 61 6e 64 6c | 65 20 73 68 6f 75 6c 64 |xt handl|e should|
|000004a0| 20 62 65 20 6c 6f 63 6b | 65 64 20 62 65 66 6f 72 | be lock|ed befor|
|000004b0| 65 20 63 61 6c 6c 69 6e | 67 20 54 65 78 74 44 6c |e callin|g TextDl|
|000004c0| 6f 67 20 61 6e 64 0a 20 | 20 20 20 75 6e 6c 6f 63 |og and. | unloc|
|000004d0| 6b 65 64 20 61 66 74 65 | 72 2e 0a 0a 20 20 20 20 |ked afte|r... |
|000004e0| 4f 72 69 67 69 6e 61 6c | 20 61 75 74 68 6f 72 3a |Original| author:|
|000004f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000500| 20 20 20 20 64 75 62 6f | 69 73 40 75 77 6d 61 63 | dubo|is@uwmac|
|00000510| 63 2e 55 55 43 50 20 28 | 50 61 75 6c 20 44 75 42 |c.UUCP (|Paul DuB|
|00000520| 6f 69 73 29 0a 20 20 20 | 20 77 69 74 68 20 61 20 |ois). | with a |
|00000530| 66 65 77 20 63 68 61 6e | 67 65 73 20 26 20 63 6c |few chan|ges & cl|
|00000540| 65 61 6e 75 70 20 62 79 | 3a 20 20 20 20 62 6c 6f |eanup by|: blo|
|00000550| 62 40 61 70 70 6c 65 2e | 63 6f 6d 20 20 28 42 72 |b@apple.|com (Br|
|00000560| 69 61 6e 20 42 65 63 68 | 74 65 6c 29 0a 2a 2f 0a |ian Bech|tel).*/.|
|00000570| 0a 23 69 6e 63 6c 75 64 | 65 20 20 20 3c 45 76 65 |.#includ|e <Eve|
|00000580| 6e 74 4d 67 72 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |ntMgr.h>|.#includ|
|00000590| 65 20 20 20 3c 44 69 61 | 6c 6f 67 4d 67 72 2e 68 |e <Dia|logMgr.h|
|000005a0| 3e 0a 23 69 6e 63 6c 75 | 64 65 20 20 20 3c 43 6f |>.#inclu|de <Co|
|000005b0| 6e 74 72 6f 6c 4d 67 72 | 2e 68 3e 0a 0a 0a 23 64 |ntrolMgr|.h>...#d|
|000005c0| 65 66 69 6e 65 20 20 20 | 20 6e 69 6c 20 20 20 20 |efine | nil |
|000005d0| 20 30 4c 0a 0a 23 64 65 | 66 69 6e 65 20 45 54 58 | 0L..#de|fine ETX|
|000005e0| 20 30 33 20 20 20 20 20 | 20 2f 2a 20 45 6e 74 65 | 03 | /* Ente|
|000005f0| 72 20 6b 65 79 20 2a 2f | 0a 23 64 65 66 69 6e 65 |r key */|.#define|
|00000600| 20 43 52 20 20 31 33 20 | 20 20 20 20 20 2f 2a 20 | CR 13 | /* |
|00000610| 52 65 74 75 72 6e 20 6b | 65 79 20 2a 2f 0a 0a 65 |Return k|ey */..e|
|00000620| 6e 75 6d 20 20 20 20 20 | 20 20 20 2f 2a 20 69 74 |num | /* it|
|00000630| 65 6d 20 6e 75 6d 62 65 | 72 73 20 2a 2f 0a 7b 0a |em numbe|rs */.{.|
|00000640| 20 20 20 20 4f 4b 42 75 | 74 74 6f 6e 20 3d 20 31 | OKBu|tton = 1|
|00000650| 2c 0a 20 20 20 20 73 63 | 72 6f 6c 6c 42 61 72 55 |,. sc|rollBarU|
|00000660| 73 65 72 2c 0a 20 20 20 | 20 74 65 78 74 52 65 63 |ser,. | textRec|
|00000670| 74 55 73 65 72 0a 7d 3b | 0a 0a 73 74 61 74 69 63 |tUser.};|..static|
|00000680| 20 43 6f 6e 74 72 6f 6c | 48 61 6e 64 6c 65 20 20 | Control|Handle |
|00000690| 20 20 74 68 65 53 63 72 | 6f 6c 6c 3b 0a 73 74 61 | theScr|oll;.sta|
|000006a0| 74 69 63 20 42 6f 6f 6c | 65 61 6e 20 20 20 20 20 |tic Bool|ean |
|000006b0| 20 20 20 20 20 6e 65 65 | 64 53 63 72 6f 6c 6c 3b | nee|dScroll;|
|000006c0| 20 2f 2a 20 74 72 75 65 | 20 69 66 20 6e 65 65 64 | /* true| if need|
|000006d0| 20 73 63 72 6f 6c 6c 20 | 62 61 72 20 2a 2f 0a 73 | scroll |bar */.s|
|000006e0| 74 61 74 69 63 20 69 6e | 74 20 20 20 20 20 20 20 |tatic in|t |
|000006f0| 20 20 20 20 20 20 20 63 | 75 72 4c 69 6e 65 3b 0a | c|urLine;.|
|00000700| 73 74 61 74 69 63 20 69 | 6e 74 20 20 20 20 20 20 |static i|nt |
|00000710| 20 20 20 20 20 20 20 20 | 68 61 6c 66 50 61 67 65 | |halfPage|
|00000720| 3b 0a 73 74 61 74 69 63 | 20 54 45 48 61 6e 64 6c |;.static| TEHandl|
|00000730| 65 20 20 20 20 20 20 20 | 20 20 74 65 48 61 6e 64 |e | teHand|
|00000740| 3b 0a 0a 0a 0a 2f 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |;..../**|********|
|00000750| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000760| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000770| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000780| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 0a 20 |********|******. |
|00000790| 2a 0a 20 2a 20 20 46 75 | 6e 63 74 69 6f 6e 3a 20 |*. * Fu|nction: |
|000007a0| 20 20 20 20 20 20 48 69 | 67 68 4c 69 67 68 74 44 | Hi|ghLightD|
|000007b0| 65 66 61 75 6c 74 0a 20 | 2a 0a 20 2a 20 20 50 75 |efault. |*. * Pu|
|000007c0| 72 70 6f 73 65 3a 20 20 | 20 20 20 20 20 20 68 69 |rpose: | hi|
|000007d0| 67 68 6c 69 67 68 74 20 | 74 68 65 20 64 65 66 61 |ghlight |the defa|
|000007e0| 75 6c 74 20 62 75 74 74 | 6f 6e 20 69 6e 20 61 20 |ult butt|on in a |
|000007f0| 64 69 61 6c 6f 67 0a 20 | 2a 0a 20 2a 20 20 52 65 |dialog. |*. * Re|
|00000800| 74 75 72 6e 73 3a 20 20 | 20 20 20 20 20 20 6e 6f |turns: | no|
|00000810| 74 68 69 6e 67 0a 20 2a | 0a 20 2a 20 20 53 69 64 |thing. *|. * Sid|
|00000820| 65 20 45 66 66 65 63 74 | 73 3a 20 20 20 73 74 61 |e Effect|s: sta|
|00000830| 6e 64 61 72 64 20 62 6f | 78 20 69 73 20 64 72 61 |ndard bo|x is dra|
|00000840| 77 6e 20 61 72 6f 75 6e | 64 20 68 69 67 68 6c 69 |wn aroun|d highli|
|00000850| 67 68 74 20 62 6f 78 0a | 20 2a 0a 20 2a 20 20 44 |ght box.| *. * D|
|00000860| 65 73 63 72 69 70 74 69 | 6f 6e 3a 20 20 20 20 64 |escripti|on: d|
|00000870| 72 61 77 73 20 74 68 65 | 20 68 65 61 76 79 20 72 |raws the| heavy r|
|00000880| 6f 75 6e 64 65 64 20 62 | 6f 78 20 61 72 6f 75 6e |ounded b|ox aroun|
|00000890| 64 20 74 68 65 20 4f 4b | 20 62 75 74 74 6f 6e 2c |d the OK| button,|
|000008a0| 0a 20 2a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. * | |
|000008b0| 20 20 20 20 20 73 6f 20 | 74 68 61 74 20 74 68 65 | so |that the|
|000008c0| 20 75 73 65 72 20 6b 6e | 6f 77 73 20 74 68 61 74 | user kn|ows that|
|000008d0| 20 68 69 74 74 69 6e 67 | 20 65 6e 74 65 72 20 6f | hitting| enter o|
|000008e0| 72 20 72 65 74 75 72 6e | 0a 20 2a 20 20 20 20 20 |r return|. * |
|000008f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 69 73 20 | | is |
|00000900| 74 68 65 20 73 61 6d 65 | 20 61 73 20 70 72 65 73 |the same| as pres|
|00000910| 73 69 6e 67 20 74 68 65 | 20 4f 4b 20 62 75 74 74 |sing the| OK butt|
|00000920| 6f 6e 2e 0a 20 2a 0a 20 | 2a 2a 2a 2a 2a 2a 2a 2a |on.. *. |********|
|00000930| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000940| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000950| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000960| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000970| 2f 0a 73 74 61 74 69 63 | 20 76 6f 69 64 0a 48 69 |/.static| void.Hi|
|00000980| 67 68 4c 69 67 68 74 44 | 65 66 61 75 6c 74 28 64 |ghLightD|efault(d|
|00000990| 50 74 72 29 0a 44 69 61 | 6c 6f 67 50 74 72 20 64 |Ptr).Dia|logPtr d|
|000009a0| 50 74 72 3b 0a 7b 0a 20 | 20 20 20 69 6e 74 20 75 |Ptr;.{. | int u|
|000009b0| 6e 75 73 65 64 49 74 65 | 6d 54 79 70 65 3b 0a 20 |nusedIte|mType;. |
|000009c0| 20 20 20 48 61 6e 64 6c | 65 20 75 6e 75 73 65 64 | Handl|e unused|
|000009d0| 49 74 65 6d 48 61 6e 64 | 6c 65 3b 0a 20 20 20 20 |ItemHand|le;. |
|000009e0| 52 65 63 74 20 62 6f 78 | 3b 0a 20 20 20 20 50 65 |Rect box|;. Pe|
|000009f0| 6e 53 74 61 74 65 20 70 | 3b 0a 0a 20 20 20 20 2f |nState p|;.. /|
|00000a00| 2a 20 20 54 68 69 73 20 | 6e 65 78 74 20 6c 69 74 |* This |next lit|
|00000a10| 74 6c 65 20 70 69 65 63 | 65 20 6f 66 20 63 6f 64 |tle piec|e of cod|
|00000a20| 65 20 70 75 74 73 20 74 | 68 65 20 64 65 66 61 75 |e puts t|he defau|
|00000a30| 6c 74 20 68 65 61 76 79 | 20 72 6f 75 6e 64 65 64 |lt heavy| rounded|
|00000a40| 0a 20 20 20 20 20 20 20 | 20 62 6f 78 20 61 72 6f |. | box aro|
|00000a50| 75 6e 64 20 74 68 65 20 | 22 4f 4b 22 20 62 75 74 |und the |"OK" but|
|00000a60| 74 6f 6e 2c 20 73 6f 20 | 74 68 65 20 75 73 65 72 |ton, so |the user|
|00000a70| 20 6b 6e 6f 77 73 20 74 | 68 61 74 20 70 72 65 73 | knows t|hat pres|
|00000a80| 73 69 6e 67 0a 20 20 20 | 20 20 20 20 20 72 65 74 |sing. | ret|
|00000a90| 75 72 6e 20 69 73 20 74 | 68 65 20 73 61 6d 65 20 |urn is t|he same |
|00000aa0| 61 73 20 68 69 74 74 69 | 6e 67 20 22 4f 4b 22 0a |as hitti|ng "OK".|
|00000ab0| 20 20 20 20 2a 2f 0a 20 | 20 20 20 53 65 74 50 6f | */. | SetPo|
|00000ac0| 72 74 28 64 50 74 72 29 | 3b 20 20 20 20 20 20 2f |rt(dPtr)|; /|
|00000ad0| 2a 20 77 69 74 68 6f 75 | 74 20 74 68 69 73 2c 20 |* withou|t this, |
|00000ae0| 63 61 6e 27 74 20 68 69 | 67 68 6c 69 74 65 20 4f |can't hi|ghlite O|
|00000af0| 4b 20 2a 2f 0a 20 20 20 | 20 47 65 74 44 49 74 65 |K */. | GetDIte|
|00000b00| 6d 28 64 50 74 72 2c 20 | 4f 4b 42 75 74 74 6f 6e |m(dPtr, |OKButton|
|00000b10| 2c 20 26 75 6e 75 73 65 | 64 49 74 65 6d 54 79 70 |, &unuse|dItemTyp|
|00000b20| 65 2c 20 26 75 6e 75 73 | 65 64 49 74 65 6d 48 61 |e, &unus|edItemHa|
|00000b30| 6e 64 6c 65 2c 20 26 62 | 6f 78 29 3b 0a 20 20 20 |ndle, &b|ox);. |
|00000b40| 20 47 65 74 50 65 6e 53 | 74 61 74 65 28 26 70 29 | GetPenS|tate(&p)|
|00000b50| 3b 0a 20 20 20 20 50 65 | 6e 53 69 7a 65 28 33 2c |;. Pe|nSize(3,|
|00000b60| 33 29 3b 0a 20 20 20 20 | 49 6e 73 65 74 52 65 63 |3);. |InsetRec|
|00000b70| 74 28 26 62 6f 78 2c 20 | 2d 34 2c 20 2d 34 29 3b |t(&box, |-4, -4);|
|00000b80| 0a 20 20 20 20 46 72 61 | 6d 65 52 6f 75 6e 64 52 |. Fra|meRoundR|
|00000b90| 65 63 74 28 26 62 6f 78 | 2c 20 31 36 2c 20 31 36 |ect(&box|, 16, 16|
|00000ba0| 29 3b 0a 20 20 20 20 50 | 65 6e 53 69 7a 65 28 70 |);. P|enSize(p|
|00000bb0| 2e 70 6e 53 69 7a 65 2e | 68 2c 20 70 2e 70 6e 53 |.pnSize.|h, p.pnS|
|00000bc0| 69 7a 65 2e 76 29 3b 0a | 7d 0a 0a 2f 2a 2a 2a 2a |ize.v);.|}../****|
|00000bd0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000be0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000bf0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000c00| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000c10| 2a 2a 2a 2a 0a 20 2a 0a | 20 2a 20 20 46 75 6e 63 |****. *.| * Func|
|00000c20| 74 69 6f 6e 3a 20 20 20 | 20 20 20 20 44 72 61 77 |tion: | Draw|
|00000c30| 53 63 72 6f 6c 6c 0a 20 | 2a 0a 20 2a 20 20 50 75 |Scroll. |*. * Pu|
|00000c40| 72 70 6f 73 65 3a 20 20 | 20 20 20 20 20 20 64 72 |rpose: | dr|
|00000c50| 61 77 20 73 63 72 6f 6c | 6c 20 62 61 72 20 75 73 |aw scrol|l bar us|
|00000c60| 65 72 20 69 74 65 6d 0a | 20 2a 0a 20 2a 20 20 52 |er item.| *. * R|
|00000c70| 65 74 75 72 6e 73 3a 20 | 20 20 20 20 20 20 20 6e |eturns: | n|
|00000c80| 6f 74 68 69 6e 67 0a 20 | 2a 0a 20 2a 20 20 53 69 |othing. |*. * Si|
|00000c90| 64 65 20 45 66 66 65 63 | 74 73 3a 20 20 20 64 72 |de Effec|ts: dr|
|00000ca0| 61 77 73 20 73 63 72 6f | 6c 6c 20 62 61 72 20 75 |aws scro|ll bar u|
|00000cb0| 73 65 72 20 69 74 65 6d | 0a 20 2a 0a 20 2a 20 20 |ser item|. *. * |
|00000cc0| 44 65 73 63 72 69 70 74 | 69 6f 6e 3a 20 20 20 20 |Descript|ion: |
|00000cd0| 69 66 20 77 65 20 6e 65 | 65 64 20 74 6f 20 73 63 |if we ne|ed to sc|
|00000ce0| 72 6f 6c 6c 2c 20 73 68 | 6f 77 20 74 68 65 20 63 |roll, sh|ow the c|
|00000cf0| 6f 6e 74 72 6f 6c 2e 0a | 20 2a 0a 20 2a 2a 2a 2a |ontrol..| *. ****|
|00000d00| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000d10| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000d20| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000d30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000d40| 2a 2a 2a 2a 2f 0a 73 74 | 61 74 69 63 20 70 61 73 |****/.st|atic pas|
|00000d50| 63 61 6c 20 76 6f 69 64 | 20 44 72 61 77 53 63 72 |cal void| DrawScr|
|00000d60| 6f 6c 6c 20 28 74 68 65 | 44 69 61 6c 6f 67 2c 20 |oll (the|Dialog, |
|00000d70| 69 74 65 6d 4e 6f 29 0a | 44 69 61 6c 6f 67 50 74 |itemNo).|DialogPt|
|00000d80| 72 20 20 20 74 68 65 44 | 69 61 6c 6f 67 3b 0a 69 |r theD|ialog;.i|
|00000d90| 6e 74 20 20 20 20 20 20 | 20 20 20 69 74 65 6d 4e |nt | itemN|
|00000da0| 6f 3b 0a 7b 0a 20 20 20 | 20 69 66 20 28 6e 65 65 |o;.{. | if (nee|
|00000db0| 64 53 63 72 6f 6c 6c 29 | 0a 20 20 20 20 20 20 20 |dScroll)|. |
|00000dc0| 20 53 68 6f 77 43 6f 6e | 74 72 6f 6c 20 28 74 68 | ShowCon|trol (th|
|00000dd0| 65 53 63 72 6f 6c 6c 29 | 3b 0a 7d 0a 0a 0a 2f 2a |eScroll)|;.}.../*|
|00000de0| 0a 20 20 20 20 50 72 6f | 63 20 66 6f 72 20 64 72 |. Pro|c for dr|
|00000df0| 61 77 69 6e 67 20 74 65 | 78 74 20 64 69 73 70 6c |awing te|xt displ|
|00000e00| 61 79 20 75 73 65 72 20 | 69 74 65 6d 2e 0a 2a 2f |ay user |item..*/|
|00000e10| 0a 0a 0a 2f 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.../****|********|
|00000e20| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000e30| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000e40| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000e50| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 0a 20 2a 0a |********|****. *.|
|00000e60| 20 2a 20 20 46 75 6e 63 | 74 69 6f 6e 3a 20 20 20 | * Func|tion: |
|00000e70| 20 20 20 20 44 72 61 77 | 54 65 78 74 52 65 63 74 | Draw|TextRect|
|00000e80| 0a 20 2a 0a 20 2a 20 20 | 50 75 72 70 6f 73 65 3a |. *. * |Purpose:|
|00000e90| 20 20 20 20 20 20 20 20 | 64 72 61 77 20 74 65 78 | |draw tex|
|00000ea0| 74 20 64 69 73 70 6c 61 | 79 20 75 73 65 72 20 69 |t displa|y user i|
|00000eb0| 74 65 6d 0a 20 2a 0a 20 | 2a 20 20 52 65 74 75 72 |tem. *. |* Retur|
|00000ec0| 6e 73 3a 20 20 20 20 20 | 20 20 20 6e 6f 74 68 69 |ns: | nothi|
|00000ed0| 6e 67 0a 20 2a 0a 20 2a | 20 20 53 69 64 65 20 45 |ng. *. *| Side E|
|00000ee0| 66 66 65 63 74 73 3a 20 | 20 20 73 68 6f 77 73 20 |ffects: | shows |
|00000ef0| 74 68 65 20 74 65 78 74 | 0a 20 2a 0a 20 2a 20 20 |the text|. *. * |
|00000f00| 44 65 73 63 72 69 70 74 | 69 6f 6e 3a 20 20 20 20 |Descript|ion: |
|00000f10| 47 65 74 20 74 68 65 20 | 72 65 63 74 61 6e 67 6c |Get the |rectangl|
|00000f20| 65 20 66 6f 72 20 6f 75 | 72 20 74 65 78 74 2e 20 |e for ou|r text. |
|00000f30| 20 49 66 20 77 65 20 6e | 65 65 64 20 74 6f 20 73 | If we n|eed to s|
|00000f40| 63 72 6f 6c 6c 2c 0a 20 | 2a 20 20 20 20 20 20 20 |croll,. |* |
|00000f50| 20 20 20 20 20 20 20 20 | 20 20 20 66 72 61 6d 65 | | frame|
|00000f60| 20 74 68 65 20 72 65 63 | 74 61 6e 67 6c 65 20 73 | the rec|tangle s|
|00000f70| 6f 20 74 68 61 74 20 69 | 74 20 77 69 6c 6c 20 6c |o that i|t will l|
|00000f80| 6f 6f 6b 20 63 6f 72 72 | 65 63 74 2e 0a 20 2a 20 |ook corr|ect.. * |
|00000f90| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000fa0| 20 47 65 74 20 74 68 65 | 20 76 69 65 77 20 72 65 | Get the| view re|
|00000fb0| 63 74 61 6e 67 6c 65 20 | 6f 66 20 6f 75 72 20 74 |ctangle |of our t|
|00000fc0| 65 78 74 20 72 65 63 74 | 61 6e 67 6c 65 2c 20 61 |ext rect|angle, a|
|00000fd0| 6e 64 20 64 6f 0a 20 2a | 20 20 20 20 20 20 20 20 |nd do. *| |
|00000fe0| 20 20 20 20 20 20 20 20 | 20 20 61 20 54 45 55 70 | | a TEUp|
|00000ff0| 64 61 74 65 20 73 6f 20 | 74 68 61 74 20 74 65 78 |date so |that tex|
|00001000| 74 20 65 64 69 74 20 77 | 69 6c 6c 20 70 72 6f 70 |t edit w|ill prop|
|00001010| 65 72 6c 79 20 68 61 6e | 64 6c 65 0a 20 2a 20 20 |erly han|dle. * |
|00001020| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001030| 75 70 64 61 74 69 6e 67 | 20 74 68 65 20 72 65 63 |updating| the rec|
|00001040| 74 61 6e 67 6c 65 2e 0a | 20 2a 0a 20 2a 2a 2a 2a |tangle..| *. ****|
|00001050| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001060| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001070| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001080| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001090| 2a 2a 2a 2a 2f 0a 73 74 | 61 74 69 63 20 70 61 73 |****/.st|atic pas|
|000010a0| 63 61 6c 20 76 6f 69 64 | 20 44 72 61 77 54 65 78 |cal void| DrawTex|
|000010b0| 74 52 65 63 74 20 28 74 | 68 65 44 69 61 6c 6f 67 |tRect (t|heDialog|
|000010c0| 2c 20 69 74 65 6d 4e 6f | 29 0a 44 69 61 6c 6f 67 |, itemNo|).Dialog|
|000010d0| 50 74 72 20 20 20 74 68 | 65 44 69 61 6c 6f 67 3b |Ptr th|eDialog;|
|000010e0| 0a 69 6e 74 20 20 20 20 | 20 20 20 20 20 69 74 65 |.int | ite|
|000010f0| 6d 4e 6f 3b 0a 7b 0a 52 | 65 63 74 20 20 20 20 72 |mNo;.{.R|ect r|
|00001100| 3b 0a 69 6e 74 20 20 20 | 20 20 69 74 65 6d 54 79 |;.int | itemTy|
|00001110| 70 65 3b 0a 48 61 6e 64 | 6c 65 20 20 69 74 65 6d |pe;.Hand|le item|
|00001120| 48 61 6e 64 6c 65 3b 0a | 0a 20 20 20 20 47 65 74 |Handle;.|. Get|
|00001130| 44 49 74 65 6d 20 28 74 | 68 65 44 69 61 6c 6f 67 |DItem (t|heDialog|
|00001140| 2c 20 74 65 78 74 52 65 | 63 74 55 73 65 72 2c 20 |, textRe|ctUser, |
|00001150| 26 69 74 65 6d 54 79 70 | 65 2c 20 26 69 74 65 6d |&itemTyp|e, &item|
|00001160| 48 61 6e 64 6c 65 2c 20 | 26 72 29 3b 0a 20 20 20 |Handle, |&r);. |
|00001170| 20 69 66 20 28 6e 65 65 | 64 53 63 72 6f 6c 6c 29 | if (nee|dScroll)|
|00001180| 0a 20 20 20 20 20 20 20 | 20 46 72 61 6d 65 52 65 |. | FrameRe|
|00001190| 63 74 20 28 26 72 29 3b | 0a 20 20 20 20 72 20 3d |ct (&r);|. r =|
|000011a0| 20 28 2a 2a 74 65 48 61 | 6e 64 29 2e 76 69 65 77 | (**teHa|nd).view|
|000011b0| 52 65 63 74 3b 0a 20 20 | 20 20 54 45 55 70 64 61 |Rect;. | TEUpda|
|000011c0| 74 65 20 28 26 72 2c 20 | 74 65 48 61 6e 64 29 3b |te (&r, |teHand);|
|000011d0| 0a 7d 0a 0a 0a 2f 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.}.../**|********|
|000011e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000011f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001200| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001210| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 0a 20 |********|******. |
|00001220| 2a 0a 20 2a 20 20 46 75 | 6e 63 74 69 6f 6e 3a 20 |*. * Fu|nction: |
|00001230| 20 20 20 20 20 20 44 6f | 53 63 72 6f 6c 6c 0a 20 | Do|Scroll. |
|00001240| 2a 0a 20 2a 20 20 50 75 | 72 70 6f 73 65 3a 20 20 |*. * Pu|rpose: |
|00001250| 20 20 20 20 20 20 73 63 | 72 6f 6c 6c 20 74 6f 20 | sc|roll to |
|00001260| 63 6f 72 72 65 63 74 20 | 70 6f 73 69 74 69 6f 6e |correct |position|
|00001270| 0a 20 2a 0a 20 2a 20 20 | 52 65 74 75 72 6e 73 3a |. *. * |Returns:|
|00001280| 20 20 20 20 20 20 20 20 | 6e 6f 74 68 69 6e 67 2e | |nothing.|
|00001290| 0a 20 2a 0a 20 2a 20 20 | 53 69 64 65 20 45 66 66 |. *. * |Side Eff|
|000012a0| 65 63 74 73 3a 20 20 20 | 74 65 78 74 20 69 73 20 |ects: |text is |
|000012b0| 73 63 72 6f 6c 6c 65 64 | 20 74 6f 20 6e 65 77 20 |scrolled| to new |
|000012c0| 70 6f 73 69 74 69 6f 6e | 0a 20 2a 0a 20 2a 20 20 |position|. *. * |
|000012d0| 44 65 73 63 72 69 70 74 | 69 6f 6e 3a 0a 20 2a 20 |Descript|ion:. * |
|000012e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000012f0| 20 53 63 72 6f 6c 6c 20 | 74 6f 20 74 68 65 20 63 | Scroll |to the c|
|00001300| 6f 72 72 65 63 74 20 70 | 6f 73 69 74 69 6f 6e 2e |orrect p|osition.|
|00001310| 20 20 6c 44 65 6c 74 61 | 20 69 73 20 74 68 65 0a | lDelta| is the.|
|00001320| 20 2a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | * | |
|00001330| 20 20 20 20 61 6d 6f 75 | 6e 74 20 74 6f 20 43 48 | amou|nt to CH|
|00001340| 41 4e 47 45 20 74 68 65 | 20 63 75 72 72 65 6e 74 |ANGE the| current|
|00001350| 20 73 63 72 6f 6c 6c 20 | 73 65 74 74 69 6e 67 20 | scroll |setting |
|00001360| 62 79 2e 0a 20 2a 0a 20 | 2a 2a 2a 2a 2a 2a 2a 2a |by.. *. |********|
|00001370| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001380| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001390| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000013a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000013b0| 2f 0a 73 74 61 74 69 63 | 20 76 6f 69 64 0a 44 6f |/.static| void.Do|
|000013c0| 53 63 72 6f 6c 6c 20 28 | 6c 44 65 6c 74 61 29 0a |Scroll (|lDelta).|
|000013d0| 69 6e 74 20 20 20 20 20 | 6c 44 65 6c 74 61 3b 0a |int |lDelta;.|
|000013e0| 7b 0a 69 6e 74 20 6e 65 | 77 4c 69 6e 65 3b 0a 0a |{.int ne|wLine;..|
|000013f0| 20 20 20 20 6e 65 77 4c | 69 6e 65 20 3d 20 63 75 | newL|ine = cu|
|00001400| 72 4c 69 6e 65 20 2b 20 | 6c 44 65 6c 74 61 3b 0a |rLine + |lDelta;.|
|00001410| 20 20 20 20 69 66 20 28 | 6e 65 77 4c 69 6e 65 20 | if (|newLine |
|00001420| 3c 20 30 29 20 6e 65 77 | 4c 69 6e 65 20 3d 20 30 |< 0) new|Line = 0|
|00001430| 3b 0a 20 20 20 20 69 66 | 20 28 6e 65 77 4c 69 6e |;. if| (newLin|
|00001440| 65 20 3e 20 47 65 74 43 | 74 6c 4d 61 78 20 28 74 |e > GetC|tlMax (t|
|00001450| 68 65 53 63 72 6f 6c 6c | 29 29 20 6e 65 77 4c 69 |heScroll|)) newLi|
|00001460| 6e 65 20 3d 20 47 65 74 | 43 74 6c 4d 61 78 20 28 |ne = Get|CtlMax (|
|00001470| 74 68 65 53 63 72 6f 6c | 6c 29 3b 0a 20 20 20 20 |theScrol|l);. |
|00001480| 53 65 74 43 74 6c 56 61 | 6c 75 65 20 28 74 68 65 |SetCtlVa|lue (the|
|00001490| 53 63 72 6f 6c 6c 2c 20 | 6e 65 77 4c 69 6e 65 29 |Scroll, |newLine)|
|000014a0| 3b 0a 20 20 20 20 6c 44 | 65 6c 74 61 20 3d 20 28 |;. lD|elta = (|
|000014b0| 63 75 72 4c 69 6e 65 20 | 2d 20 6e 65 77 4c 69 6e |curLine |- newLin|
|000014c0| 65 20 29 20 2a 20 28 2a | 2a 74 65 48 61 6e 64 29 |e ) * (*|*teHand)|
|000014d0| 2e 6c 69 6e 65 48 65 69 | 67 68 74 3b 0a 20 20 20 |.lineHei|ght;. |
|000014e0| 20 54 45 53 63 72 6f 6c | 6c 20 28 30 2c 20 6c 44 | TEScrol|l (0, lD|
|000014f0| 65 6c 74 61 2c 20 74 65 | 48 61 6e 64 29 3b 0a 20 |elta, te|Hand);. |
|00001500| 20 20 20 63 75 72 4c 69 | 6e 65 20 3d 20 6e 65 77 | curLi|ne = new|
|00001510| 4c 69 6e 65 3b 0a 7d 0a | 0a 0a 0a 2f 2a 2a 2a 2a |Line;.}.|.../****|
|00001520| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001530| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001540| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001550| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001560| 2a 2a 2a 2a 0a 20 2a 0a | 20 2a 20 20 46 75 6e 63 |****. *.| * Func|
|00001570| 74 69 6f 6e 3a 20 20 20 | 20 20 20 20 5f 5f 54 72 |tion: | __Tr|
|00001580| 61 63 6b 53 63 72 6f 6c | 6c 0a 20 2a 0a 20 2a 20 |ackScrol|l. *. * |
|00001590| 20 50 75 72 70 6f 73 65 | 3a 20 20 20 20 20 20 20 | Purpose|: |
|000015a0| 20 74 72 61 63 6b 20 74 | 68 65 20 73 63 72 6f 6c | track t|he scrol|
|000015b0| 6c 69 6e 67 0a 20 2a 0a | 20 2a 20 20 52 65 74 75 |ling. *.| * Retu|
|000015c0| 72 6e 73 3a 20 20 20 20 | 20 20 20 20 6e 6f 74 68 |rns: | noth|
|000015d0| 69 6e 67 0a 20 2a 0a 20 | 2a 20 20 53 69 64 65 20 |ing. *. |* Side |
|000015e0| 45 66 66 65 63 74 73 3a | 20 20 20 73 63 72 6f 6c |Effects:| scrol|
|000015f0| 6c 69 6e 67 0a 20 2a 0a | 20 2a 20 20 44 65 73 63 |ling. *.| * Desc|
|00001600| 72 69 70 74 69 6f 6e 3a | 20 20 20 20 67 65 74 20 |ription:| get |
|00001610| 74 68 65 20 63 6f 6e 74 | 72 6f 6c 20 70 61 72 74 |the cont|rol part|
|00001620| 20 74 68 61 74 20 77 65 | 27 72 65 20 69 6e 2e 20 | that we|'re in. |
|00001630| 20 49 66 20 77 65 27 72 | 65 20 73 74 69 6c 6c 0a | If we'r|e still.|
|00001640| 20 2a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | * | |
|00001650| 20 20 20 20 69 6e 20 74 | 68 65 20 73 61 6d 65 20 | in t|he same |
|00001660| 70 61 72 74 2c 20 77 65 | 27 72 65 20 67 6f 69 6e |part, we|'re goin|
|00001670| 67 20 74 6f 20 73 63 72 | 6f 6c 6c 2e 20 20 43 68 |g to scr|oll. Ch|
|00001680| 65 63 6b 20 77 68 61 74 | 0a 20 2a 20 20 20 20 20 |eck what|. * |
|00001690| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 6b 69 6e | | kin|
|000016a0| 64 20 6f 66 20 70 61 72 | 74 20 77 65 27 72 65 20 |d of par|t we're |
|000016b0| 69 6e 2c 20 61 6e 64 20 | 73 65 74 20 6f 75 72 20 |in, and |set our |
|000016c0| 64 65 6c 74 61 20 61 63 | 63 6f 72 64 69 6e 67 6c |delta ac|cordingl|
|000016d0| 79 2e 0a 20 2a 20 20 20 | 20 20 20 20 20 20 20 20 |y.. * | |
|000016e0| 20 20 20 20 20 20 20 43 | 61 6c 6c 20 44 6f 53 63 | C|all DoSc|
|000016f0| 72 6f 6c 6c 20 74 6f 20 | 61 63 74 75 61 6c 6c 79 |roll to |actually|
|00001700| 20 68 61 6e 64 6c 65 20 | 74 68 65 20 73 63 72 6f | handle |the scro|
|00001710| 6c 6c 69 6e 67 2e 0a 20 | 2a 0a 20 2a 2a 2a 2a 2a |lling.. |*. *****|
|00001720| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001730| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001740| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001750| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001760| 2a 2a 2a 2f 0a 73 74 61 | 74 69 63 20 70 61 73 63 |***/.sta|tic pasc|
|00001770| 61 6c 20 76 6f 69 64 20 | 5f 5f 54 72 61 63 6b 53 |al void |__TrackS|
|00001780| 63 72 6f 6c 6c 20 28 74 | 68 65 53 63 72 6f 6c 6c |croll (t|heScroll|
|00001790| 2c 20 70 61 72 74 43 6f | 64 65 29 0a 43 6f 6e 74 |, partCo|de).Cont|
|000017a0| 72 6f 6c 48 61 6e 64 6c | 65 20 20 20 74 68 65 53 |rolHandl|e theS|
|000017b0| 63 72 6f 6c 6c 3b 0a 69 | 6e 74 20 20 20 20 20 20 |croll;.i|nt |
|000017c0| 20 20 20 20 20 20 20 70 | 61 72 74 43 6f 64 65 3b | p|artCode;|
|000017d0| 0a 7b 0a 69 6e 74 20 6c | 44 65 6c 74 61 3b 0a 0a |.{.int l|Delta;..|
|000017e0| 20 20 20 20 69 66 20 28 | 70 61 72 74 43 6f 64 65 | if (|partCode|
|000017f0| 20 3d 3d 20 47 65 74 43 | 52 65 66 43 6f 6e 20 28 | == GetC|RefCon (|
|00001800| 74 68 65 53 63 72 6f 6c | 6c 29 29 20 2f 2a 20 73 |theScrol|l)) /* s|
|00001810| 74 69 6c 6c 20 69 6e 20 | 73 61 6d 65 20 70 61 72 |till in |same par|
|00001820| 74 3f 20 2a 2f 0a 20 20 | 20 20 7b 0a 20 20 20 20 |t? */. | {. |
|00001830| 20 20 20 20 73 77 69 74 | 63 68 20 28 70 61 72 74 | swit|ch (part|
|00001840| 43 6f 64 65 29 0a 20 20 | 20 20 20 20 20 20 7b 0a |Code). | {.|
|00001850| 20 20 20 20 20 20 20 20 | 20 20 20 20 63 61 73 65 | | case|
|00001860| 20 69 6e 55 70 42 75 74 | 74 6f 6e 3a 20 6c 44 65 | inUpBut|ton: lDe|
|00001870| 6c 74 61 20 3d 20 2d 31 | 3b 20 62 72 65 61 6b 3b |lta = -1|; break;|
|00001880| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 63 61 73 |. | cas|
|00001890| 65 20 69 6e 44 6f 77 6e | 42 75 74 74 6f 6e 3a 20 |e inDown|Button: |
|000018a0| 6c 44 65 6c 74 61 20 3d | 20 31 3b 20 62 72 65 61 |lDelta =| 1; brea|
|000018b0| 6b 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 63 |k;. | c|
|000018c0| 61 73 65 20 69 6e 50 61 | 67 65 55 70 3a 20 6c 44 |ase inPa|geUp: lD|
|000018d0| 65 6c 74 61 20 3d 20 2d | 68 61 6c 66 50 61 67 65 |elta = -|halfPage|
|000018e0| 3b 20 62 72 65 61 6b 3b | 0a 20 20 20 20 20 20 20 |; break;|. |
|000018f0| 20 20 20 20 20 63 61 73 | 65 20 69 6e 50 61 67 65 | cas|e inPage|
|00001900| 44 6f 77 6e 3a 20 6c 44 | 65 6c 74 61 20 3d 20 68 |Down: lD|elta = h|
|00001910| 61 6c 66 50 61 67 65 3b | 20 62 72 65 61 6b 3b 0a |alfPage;| break;.|
|00001920| 20 20 20 20 20 20 20 20 | 7d 0a 20 20 20 20 20 20 | |}. |
|00001930| 20 20 44 6f 53 63 72 6f | 6c 6c 20 28 6c 44 65 6c | DoScro|ll (lDel|
|00001940| 74 61 29 3b 0a 20 20 20 | 20 7d 0a 7d 0a 0a 0a 2f |ta);. | }.}.../|
|00001950| 2a 0a 20 20 20 20 46 69 | 6c 74 65 72 20 74 6f 20 |*. Fi|lter to |
|00001960| 68 61 6e 64 6c 65 20 68 | 69 74 73 20 69 6e 20 73 |handle h|its in s|
|00001970| 63 72 6f 6c 6c 20 62 61 | 72 0a 2a 2f 0a 0a 0a 2f |croll ba|r.*/.../|
|00001980| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001990| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000019a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000019b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000019c0| 2a 2a 2a 2a 2a 2a 2a 2a | 0a 20 2a 0a 20 2a 20 20 |********|. *. * |
|000019d0| 46 75 6e 63 74 69 6f 6e | 3a 20 20 20 20 20 20 20 |Function|: |
|000019e0| 54 65 78 74 46 69 6c 74 | 65 72 0a 20 2a 0a 20 2a |TextFilt|er. *. *|
|000019f0| 20 20 50 75 72 70 6f 73 | 65 3a 20 20 20 20 20 20 | Purpos|e: |
|00001a00| 20 20 66 69 6c 74 65 72 | 20 74 6f 20 68 61 6e 64 | filter| to hand|
|00001a10| 6c 65 20 68 69 74 73 20 | 69 6e 20 73 63 72 6f 6c |le hits |in scrol|
|00001a20| 6c 20 62 61 72 0a 20 2a | 0a 20 2a 20 20 52 65 74 |l bar. *|. * Ret|
|00001a30| 75 72 6e 73 3a 20 20 20 | 20 20 20 20 20 66 61 6c |urns: | fal|
|00001a40| 73 65 20 28 69 6e 64 69 | 63 61 74 69 6e 67 20 77 |se (indi|cating w|
|00001a50| 65 20 73 68 6f 75 6c 64 | 20 63 6f 6e 74 69 6e 75 |e should| continu|
|00001a60| 65 20 77 69 74 68 69 6e | 20 6f 75 72 0a 20 2a 20 |e within| our. * |
|00001a70| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001a80| 20 6d 6f 64 61 6c 20 64 | 69 61 6c 6f 67 29 0a 20 | modal d|ialog). |
|00001a90| 2a 0a 20 2a 20 20 53 69 | 64 65 20 45 66 66 65 63 |*. * Si|de Effec|
|00001aa0| 74 73 3a 20 20 20 4d 61 | 79 20 73 63 72 6f 6c 6c |ts: Ma|y scroll|
|00001ab0| 20 74 68 65 20 74 65 78 | 74 0a 20 2a 0a 20 2a 20 | the tex|t. *. * |
|00001ac0| 20 44 65 73 63 72 69 70 | 74 69 6f 6e 3a 20 20 20 | Descrip|tion: |
|00001ad0| 20 57 65 27 72 65 20 62 | 65 69 6e 67 20 63 61 6c | We're b|eing cal|
|00001ae0| 6c 65 64 20 61 73 20 70 | 61 72 74 20 6f 66 20 61 |led as p|art of a|
|00001af0| 20 4d 6f 64 61 6c 44 69 | 61 6c 6f 67 20 63 61 6c | ModalDi|alog cal|
|00001b00| 6c 2e 0a 20 2a 20 20 20 | 20 20 20 20 20 20 20 20 |l.. * | |
|00001b10| 20 20 20 20 20 20 20 43 | 68 65 63 6b 20 77 68 61 | C|heck wha|
|00001b20| 74 20 6b 69 6e 64 20 6f | 66 20 65 76 65 6e 74 20 |t kind o|f event |
|00001b30| 61 63 74 69 76 61 74 65 | 64 20 75 73 2e 20 20 49 |activate|d us. I|
|00001b40| 66 20 69 74 20 77 61 73 | 20 61 0a 20 2a 20 20 20 |f it was| a. * |
|00001b50| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 6d | | m|
|00001b60| 6f 75 73 65 44 6f 77 6e | 2c 20 68 61 6e 64 6c 65 |ouseDown|, handle|
|00001b70| 20 69 74 2e 20 20 49 66 | 20 77 65 20 77 65 72 65 | it. If| we were|
|00001b80| 20 69 6e 20 74 68 65 20 | 74 68 75 6d 62 2c 20 74 | in the |thumb, t|
|00001b90| 72 61 63 6b 0a 20 2a 20 | 20 20 20 20 20 20 20 20 |rack. * | |
|00001ba0| 20 20 20 20 20 20 20 20 | 20 74 68 65 20 74 68 75 | | the thu|
|00001bb0| 6d 62 2c 20 6f 74 68 65 | 72 77 69 73 65 20 73 63 |mb, othe|rwise sc|
|00001bc0| 72 6f 6c 6c 20 74 68 65 | 20 69 6e 64 69 63 61 74 |roll the| indicat|
|00001bd0| 65 64 20 61 6d 6f 75 6e | 74 2e 0a 20 2a 0a 20 2a |ed amoun|t.. *. *|
|00001be0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001bf0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001c00| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001c10| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001c20| 2a 2a 2a 2a 2a 2a 2a 2f | 0a 73 74 61 74 69 63 20 |*******/|.static |
|00001c30| 70 61 73 63 61 6c 20 42 | 6f 6f 6c 65 61 6e 20 54 |pascal B|oolean T|
|00001c40| 65 78 74 46 69 6c 74 65 | 72 20 28 74 68 65 44 69 |extFilte|r (theDi|
|00001c50| 61 6c 6f 67 2c 20 74 68 | 65 45 76 65 6e 74 2c 20 |alog, th|eEvent, |
|00001c60| 69 74 65 6d 48 69 74 29 | 0a 44 69 61 6c 6f 67 50 |itemHit)|.DialogP|
|00001c70| 74 72 20 20 20 74 68 65 | 44 69 61 6c 6f 67 3b 0a |tr the|Dialog;.|
|00001c80| 45 76 65 6e 74 52 65 63 | 6f 72 64 20 2a 74 68 65 |EventRec|ord *the|
|00001c90| 45 76 65 6e 74 3b 0a 69 | 6e 74 20 20 20 20 20 20 |Event;.i|nt |
|00001ca0| 20 20 20 2a 69 74 65 6d | 48 69 74 3b 0a 7b 0a 50 | *item|Hit;.{.P|
|00001cb0| 6f 69 6e 74 20 20 20 74 | 68 65 50 6f 69 6e 74 3b |oint t|hePoint;|
|00001cc0| 0a 69 6e 74 20 20 20 20 | 20 74 68 65 50 61 72 74 |.int | thePart|
|00001cd0| 3b 0a 42 6f 6f 6c 65 61 | 6e 20 72 65 73 75 6c 74 |;.Boolea|n result|
|00001ce0| 3b 0a 0a 20 20 20 20 72 | 65 73 75 6c 74 20 3d 20 |;.. r|esult = |
|00001cf0| 66 61 6c 73 65 3b 0a 20 | 20 20 20 73 77 69 74 63 |false;. | switc|
|00001d00| 68 20 28 74 68 65 45 76 | 65 6e 74 2d 3e 77 68 61 |h (theEv|ent->wha|
|00001d10| 74 29 0a 20 20 20 20 7b | 0a 20 20 20 20 20 20 20 |t). {|. |
|00001d20| 20 63 61 73 65 20 6d 6f | 75 73 65 44 6f 77 6e 3a | case mo|useDown:|
|00001d30| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 74 68 65 |. | the|
|00001d40| 50 6f 69 6e 74 20 3d 20 | 74 68 65 45 76 65 6e 74 |Point = |theEvent|
|00001d50| 2d 3e 77 68 65 72 65 3b | 0a 20 20 20 20 20 20 20 |->where;|. |
|00001d60| 20 20 20 20 20 47 6c 6f | 62 61 6c 54 6f 4c 6f 63 | Glo|balToLoc|
|00001d70| 61 6c 20 28 26 74 68 65 | 50 6f 69 6e 74 29 3b 0a |al (&the|Point);.|
|00001d80| 20 20 20 20 20 20 20 20 | 20 20 20 20 74 68 65 50 | | theP|
|00001d90| 61 72 74 20 3d 20 54 65 | 73 74 43 6f 6e 74 72 6f |art = Te|stContro|
|00001da0| 6c 20 28 74 68 65 53 63 | 72 6f 6c 6c 2c 20 74 68 |l (theSc|roll, th|
|00001db0| 65 50 6f 69 6e 74 29 3b | 0a 20 20 20 20 20 20 20 |ePoint);|. |
|00001dc0| 20 20 20 20 20 69 66 20 | 28 74 68 65 50 61 72 74 | if |(thePart|
|00001dd0| 20 3d 3d 20 69 6e 54 68 | 75 6d 62 29 0a 20 20 20 | == inTh|umb). |
|00001de0| 20 20 20 20 20 20 20 20 | 20 7b 0a 20 20 20 20 20 | | {. |
|00001df0| 20 20 20 20 20 20 20 20 | 20 20 20 28 76 6f 69 64 | | (void|
|00001e00| 29 20 54 72 61 63 6b 43 | 6f 6e 74 72 6f 6c 20 28 |) TrackC|ontrol (|
|00001e10| 74 68 65 53 63 72 6f 6c | 6c 2c 20 74 68 65 50 6f |theScrol|l, thePo|
|00001e20| 69 6e 74 2c 20 6e 69 6c | 29 3b 0a 20 20 20 20 20 |int, nil|);. |
|00001e30| 20 20 20 20 20 20 20 20 | 20 20 20 44 6f 53 63 72 | | DoScr|
|00001e40| 6f 6c 6c 20 28 47 65 74 | 43 74 6c 56 61 6c 75 65 |oll (Get|CtlValue|
|00001e50| 20 28 74 68 65 53 63 72 | 6f 6c 6c 29 20 2d 20 63 | (theScr|oll) - c|
|00001e60| 75 72 4c 69 6e 65 29 3b | 0a 20 20 20 20 20 20 20 |urLine);|. |
|00001e70| 20 20 20 20 20 7d 0a 20 | 20 20 20 20 20 20 20 20 | }. | |
|00001e80| 20 20 20 65 6c 73 65 20 | 69 66 20 28 74 68 65 50 | else |if (theP|
|00001e90| 61 72 74 20 21 3d 20 30 | 29 0a 20 20 20 20 20 20 |art != 0|). |
|00001ea0| 20 20 20 20 20 20 7b 0a | 20 20 20 20 20 20 20 20 | {.| |
|00001eb0| 20 20 20 20 20 20 20 20 | 53 65 74 43 52 65 66 43 | |SetCRefC|
|00001ec0| 6f 6e 20 28 74 68 65 53 | 63 72 6f 6c 6c 2c 20 28 |on (theS|croll, (|
|00001ed0| 6c 6f 6e 67 29 20 74 68 | 65 50 61 72 74 29 3b 0a |long) th|ePart);.|
|00001ee0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001ef0| 28 76 6f 69 64 29 20 54 | 72 61 63 6b 43 6f 6e 74 |(void) T|rackCont|
|00001f00| 72 6f 6c 20 28 74 68 65 | 53 63 72 6f 6c 6c 2c 20 |rol (the|Scroll, |
|00001f10| 74 68 65 50 6f 69 6e 74 | 2c 20 5f 5f 54 72 61 63 |thePoint|, __Trac|
|00001f20| 6b 53 63 72 6f 6c 6c 29 | 3b 0a 20 20 20 20 20 20 |kScroll)|;. |
|00001f30| 20 20 20 20 20 20 7d 0a | 20 20 20 20 20 20 20 20 | }.| |
|00001f40| 20 20 20 20 62 72 65 61 | 6b 3b 0a 20 20 20 20 20 | brea|k;. |
|00001f50| 20 20 20 63 61 73 65 20 | 6b 65 79 44 6f 77 6e 3a | case |keyDown:|
|00001f60| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 69 66 20 |. | if |
|00001f70| 28 28 74 68 65 45 76 65 | 6e 74 2d 3e 6d 65 73 73 |((theEve|nt->mess|
|00001f80| 61 67 65 20 26 20 63 68 | 61 72 43 6f 64 65 4d 61 |age & ch|arCodeMa|
|00001f90| 73 6b 29 20 3d 3d 20 45 | 54 58 29 0a 20 20 20 20 |sk) == E|TX). |
|00001fa0| 20 20 20 20 20 20 20 20 | 7b 0a 20 20 20 20 20 20 | |{. |
|00001fb0| 20 20 20 20 20 20 20 20 | 20 20 2a 69 74 65 6d 48 | | *itemH|
|00001fc0| 69 74 20 3d 20 31 3b 0a | 20 20 20 20 20 20 20 20 |it = 1;.| |
|00001fd0| 20 20 20 20 20 20 20 20 | 72 65 73 75 6c 74 20 3d | |result =|
|00001fe0| 20 74 72 75 65 3b 0a 20 | 20 20 20 20 20 20 20 20 | true;. | |
|00001ff0| 20 20 20 7d 0a 20 20 20 | 20 20 20 20 20 20 20 20 | }. | |
|00002000| 20 69 66 20 28 28 74 68 | 65 45 76 65 6e 74 2d 3e | if ((th|eEvent->|
|00002010| 6d 65 73 73 61 67 65 20 | 26 20 63 68 61 72 43 6f |message |& charCo|
|00002020| 64 65 4d 61 73 6b 29 20 | 3d 3d 20 43 52 29 0a 20 |deMask) |== CR). |
|00002030| 20 20 20 20 20 20 20 20 | 20 20 20 7b 0a 20 20 20 | | {. |
|00002040| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2a 69 74 | | *it|
|00002050| 65 6d 48 69 74 20 3d 20 | 31 3b 0a 20 20 20 20 20 |emHit = |1;. |
|00002060| 20 20 20 20 20 20 20 20 | 20 20 20 72 65 73 75 6c | | resul|
|00002070| 74 20 3d 20 74 72 75 65 | 3b 0a 20 20 20 20 20 20 |t = true|;. |
|00002080| 20 20 20 20 20 20 7d 0a | 20 20 20 20 20 20 20 20 | }.| |
|00002090| 20 20 20 20 62 72 65 61 | 6b 3b 0a 20 20 20 20 20 | brea|k;. |
|000020a0| 20 20 20 63 61 73 65 20 | 75 70 64 61 74 65 45 76 | case |updateEv|
|000020b0| 74 3a 0a 20 20 20 20 20 | 20 20 20 63 61 73 65 20 |t:. | case |
|000020c0| 61 63 74 69 76 61 74 65 | 45 76 74 3a 0a 20 20 20 |activate|Evt:. |
|000020d0| 20 20 20 20 20 20 20 20 | 20 48 69 67 68 4c 69 67 | | HighLig|
|000020e0| 68 74 44 65 66 61 75 6c | 74 28 74 68 65 44 69 61 |htDefaul|t(theDia|
|000020f0| 6c 6f 67 29 3b 0a 20 20 | 20 20 20 20 20 20 20 20 |log);. | |
|00002100| 20 20 62 72 65 61 6b 3b | 0a 20 20 20 20 7d 0a 20 | break;|. }. |
|00002110| 20 20 20 72 65 74 75 72 | 6e 20 28 72 65 73 75 6c | retur|n (resul|
|00002120| 74 29 3b 0a 7d 0a 0a 0a | 0a 2f 2a 2a 2a 2a 2a 2a |t);.}...|./******|
|00002130| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002140| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002150| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002160| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002170| 2a 2a 0a 20 2a 0a 20 2a | 20 20 46 75 6e 63 74 69 |**. *. *| Functi|
|00002180| 6f 6e 3a 20 20 20 20 20 | 20 20 54 65 78 74 44 69 |on: | TextDi|
|00002190| 61 6c 6f 67 0a 20 2a 0a | 20 2a 20 20 50 75 72 70 |alog. *.| * Purp|
|000021a0| 6f 73 65 3a 20 20 20 20 | 20 20 20 20 70 75 74 20 |ose: | put |
|000021b0| 75 70 20 74 65 78 74 20 | 64 69 61 6c 6f 67 20 77 |up text |dialog w|
|000021c0| 69 74 68 20 6f 70 74 69 | 6f 6e 61 6c 20 73 63 72 |ith opti|onal scr|
|000021d0| 6f 6c 6c 20 62 61 72 0a | 20 2a 0a 20 2a 20 20 52 |oll bar.| *. * R|
|000021e0| 65 74 75 72 6e 73 3a 20 | 20 20 20 20 20 20 20 6e |eturns: | n|
|000021f0| 6f 74 68 69 6e 67 0a 20 | 2a 0a 20 2a 20 20 53 69 |othing. |*. * Si|
|00002200| 64 65 20 45 66 66 65 63 | 74 73 3a 20 20 20 6e 6f |de Effec|ts: no|
|00002210| 6e 65 0a 20 2a 0a 20 2a | 20 20 44 65 73 63 72 69 |ne. *. *| Descri|
|00002220| 70 74 69 6f 6e 3a 20 20 | 20 20 50 61 73 73 20 69 |ption: | Pass i|
|00002230| 6e 20 61 20 64 69 61 6c | 6f 67 20 6e 75 6d 62 65 |n a dial|og numbe|
|00002240| 72 2c 20 61 20 68 61 6e | 64 6c 65 20 74 6f 20 74 |r, a han|dle to t|
|00002250| 68 65 20 74 65 78 74 20 | 74 6f 0a 20 2a 20 20 20 |he text |to. * |
|00002260| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 64 | | d|
|00002270| 69 73 70 6c 61 79 2c 20 | 61 20 66 6f 6e 74 20 6e |isplay, |a font n|
|00002280| 75 6d 62 65 72 2c 20 66 | 6f 6e 74 20 73 69 7a 65 |umber, f|ont size|
|00002290| 2c 20 61 6e 64 20 61 20 | 62 6f 6f 6c 65 61 6e 0a |, and a |boolean.|
|000022a0| 20 2a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | * | |
|000022b0| 20 20 20 20 69 6e 64 69 | 63 61 74 69 6e 67 20 77 | indi|cating w|
|000022c0| 68 65 74 68 65 72 20 79 | 6f 75 20 77 61 6e 74 20 |hether y|ou want |
|000022d0| 74 68 65 20 74 65 78 74 | 20 74 6f 20 77 72 61 70 |the text| to wrap|
|000022e0| 20 6f 72 20 6e 6f 74 2e | 0a 20 2a 0a 20 2a 20 20 | or not.|. *. * |
|000022f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002300| 54 68 65 20 64 69 61 6c | 6f 67 20 72 65 66 65 72 |The dial|og refer|
|00002310| 65 6e 63 65 64 20 62 79 | 20 64 6c 6f 67 4e 75 6d |enced by| dlogNum|
|00002320| 20 73 68 6f 75 6c 64 20 | 68 61 76 65 20 74 68 65 | should |have the|
|00002330| 20 0a 20 2a 20 20 20 20 | 20 20 20 20 20 20 20 20 | . * | |
|00002340| 20 20 20 20 20 20 4f 4b | 20 62 75 74 74 6f 6e 20 | OK| button |
|00002350| 61 73 20 74 68 65 20 66 | 69 72 73 74 20 69 74 65 |as the f|irst ite|
|00002360| 6d 2c 20 61 6e 64 20 75 | 73 65 72 20 69 74 65 6d |m, and u|ser item|
|00002370| 73 20 66 6f 72 20 74 68 | 65 0a 20 2a 20 20 20 20 |s for th|e. * |
|00002380| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 73 65 | | se|
|00002390| 63 6f 6e 64 20 61 6e 64 | 20 74 68 69 72 64 20 69 |cond and| third i|
|000023a0| 74 65 6d 73 2e 20 20 54 | 68 65 20 73 65 63 6f 6e |tems. T|he secon|
|000023b0| 64 20 69 73 20 74 68 65 | 20 72 65 63 74 20 69 6e |d is the| rect in|
|000023c0| 0a 20 2a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. * | |
|000023d0| 20 20 20 20 20 77 68 69 | 63 68 20 74 68 65 20 63 | whi|ch the c|
|000023e0| 6f 6e 74 72 6f 6c 20 69 | 73 20 64 72 61 77 6e 2c |ontrol i|s drawn,|
|000023f0| 20 74 68 65 20 74 68 69 | 72 64 20 69 73 20 74 68 | the thi|rd is th|
|00002400| 65 20 72 65 63 74 20 69 | 6e 0a 20 2a 20 20 20 20 |e rect i|n. * |
|00002410| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 77 68 | | wh|
|00002420| 69 63 68 20 74 65 78 74 | 20 69 73 20 64 72 61 77 |ich text| is draw|
|00002430| 6e 2e 20 4f 6e 6c 79 20 | 74 68 65 20 4f 4b 20 62 |n. Only |the OK b|
|00002440| 75 74 74 6f 6e 20 73 68 | 6f 75 6c 64 20 62 65 0a |utton sh|ould be.|
|00002450| 20 2a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | * | |
|00002460| 20 20 20 20 65 6e 61 62 | 6c 65 64 2e 0a 20 2a 0a | enab|led.. *.|
|00002470| 20 2a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | * | |
|00002480| 20 20 20 20 54 68 65 20 | 74 65 78 74 20 68 61 6e | The |text han|
|00002490| 64 6c 65 20 73 68 6f 75 | 6c 64 20 62 65 20 6c 6f |dle shou|ld be lo|
|000024a0| 63 6b 65 64 20 62 65 66 | 6f 72 65 20 63 61 6c 6c |cked bef|ore call|
|000024b0| 69 6e 67 20 75 73 2c 0a | 20 2a 20 20 20 20 20 20 |ing us,.| * |
|000024c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 61 6e 64 20 | | and |
|000024d0| 75 6e 6c 6f 63 6b 65 64 | 20 61 66 74 65 72 77 61 |unlocked| afterwa|
|000024e0| 72 64 73 2e 0a 20 2a 0a | 20 2a 20 20 20 20 20 20 |rds.. *.| * |
|000024f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 4f 66 20 63 | | Of c|
|00002500| 6f 75 72 73 65 2c 20 74 | 68 65 20 66 6f 6e 74 20 |ourse, t|he font |
|00002510| 6e 75 6d 62 65 72 20 61 | 6e 64 20 73 69 7a 65 20 |number a|nd size |
|00002520| 73 68 6f 75 6c 64 20 65 | 78 69 73 74 20 69 6e 0a |should e|xist in.|
|00002530| 20 2a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | * | |
|00002540| 20 20 20 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | the |current |
|00002550| 73 79 73 74 65 6d 2c 20 | 6f 72 20 69 74 20 77 69 |system, |or it wi|
|00002560| 6c 6c 20 64 65 66 61 75 | 6c 74 20 74 6f 20 73 6f |ll defau|lt to so|
|00002570| 6d 65 74 68 69 6e 67 0a | 20 2a 20 20 20 20 20 20 |mething.| * |
|00002580| 20 20 20 20 20 20 20 20 | 20 20 20 20 75 67 6c 79 | | ugly|
|00002590| 2e 0a 20 2a 0a 20 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |.. *. **|********|
|000025a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000025b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000025c0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000025d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2f 0a |********|******/.|
|000025e0| 76 6f 69 64 0a 54 65 78 | 74 44 69 61 6c 6f 67 20 |void.Tex|tDialog |
|000025f0| 28 64 6c 6f 67 4e 75 6d | 2c 20 74 65 78 74 48 61 |(dlogNum|, textHa|
|00002600| 6e 64 6c 65 2c 20 66 6f | 6e 74 4e 75 6d 2c 20 66 |ndle, fo|ntNum, f|
|00002610| 6f 6e 74 53 69 7a 65 2c | 20 77 72 61 70 29 0a 69 |ontSize,| wrap).i|
|00002620| 6e 74 20 20 20 20 20 64 | 6c 6f 67 4e 75 6d 3b 0a |nt d|logNum;.|
|00002630| 48 61 6e 64 6c 65 20 20 | 74 65 78 74 48 61 6e 64 |Handle |textHand|
|00002640| 6c 65 3b 0a 69 6e 74 20 | 20 20 20 20 66 6f 6e 74 |le;.int | font|
|00002650| 4e 75 6d 3b 0a 69 6e 74 | 20 20 20 20 20 66 6f 6e |Num;.int| fon|
|00002660| 74 53 69 7a 65 3b 0a 42 | 6f 6f 6c 65 61 6e 20 77 |tSize;.B|oolean w|
|00002670| 72 61 70 3b 0a 7b 0a 47 | 72 61 66 50 74 72 20 20 |rap;.{.G|rafPtr |
|00002680| 20 20 20 6f 6c 64 50 6f | 72 74 3b 0a 44 69 61 6c | oldPo|rt;.Dial|
|00002690| 6f 67 50 74 72 20 20 20 | 74 68 65 44 69 61 6c 6f |ogPtr |theDialo|
|000026a0| 67 3b 0a 69 6e 74 20 20 | 20 20 20 20 20 20 20 69 |g;.int | i|
|000026b0| 74 65 6d 4e 6f 3b 0a 69 | 6e 74 20 20 20 20 20 20 |temNo;.i|nt |
|000026c0| 20 20 20 69 74 65 6d 54 | 79 70 65 3b 0a 48 61 6e | itemT|ype;.Han|
|000026d0| 64 6c 65 20 20 20 20 20 | 20 69 74 65 6d 48 61 6e |dle | itemHan|
|000026e0| 64 6c 65 3b 0a 52 65 63 | 74 20 20 20 20 20 20 20 |dle;.Rec|t |
|000026f0| 20 72 3b 0a 69 6e 74 20 | 20 20 20 20 20 20 20 20 | r;.int | |
|00002700| 73 63 72 6f 6c 6c 4c 69 | 6e 65 73 3b 0a 69 6e 74 |scrollLi|nes;.int|
|00002710| 20 20 20 20 20 20 20 20 | 20 76 69 65 77 4c 69 6e | | viewLin|
|00002720| 65 73 3b 0a 48 61 6e 64 | 6c 65 20 20 20 20 20 20 |es;.Hand|le |
|00002730| 6f 6c 64 48 54 65 78 74 | 3b 0a 50 72 6f 63 50 74 |oldHText|;.ProcPt|
|00002740| 72 20 20 20 20 20 66 69 | 6c 74 65 72 50 72 6f 63 |r fi|lterProc|
|00002750| 20 3d 20 6e 69 6c 3b 0a | 0a 20 20 20 20 47 65 74 | = nil;.|. Get|
|00002760| 50 6f 72 74 20 28 26 6f | 6c 64 50 6f 72 74 29 3b |Port (&o|ldPort);|
|00002770| 0a 20 20 20 20 74 68 65 | 44 69 61 6c 6f 67 20 3d |. the|Dialog =|
|00002780| 20 47 65 74 4e 65 77 44 | 69 61 6c 6f 67 20 28 64 | GetNewD|ialog (d|
|00002790| 6c 6f 67 4e 75 6d 2c 20 | 6e 69 6c 2c 20 2d 31 4c |logNum, |nil, -1L|
|000027a0| 29 3b 0a 0a 20 20 20 20 | 47 65 74 44 49 74 65 6d |);.. |GetDItem|
|000027b0| 20 28 74 68 65 44 69 61 | 6c 6f 67 2c 20 74 65 78 | (theDia|log, tex|
|000027c0| 74 52 65 63 74 55 73 65 | 72 2c 20 26 69 74 65 6d |tRectUse|r, &item|
|000027d0| 54 79 70 65 2c 20 26 69 | 74 65 6d 48 61 6e 64 6c |Type, &i|temHandl|
|000027e0| 65 2c 20 26 72 29 3b 0a | 20 20 20 20 53 65 74 44 |e, &r);.| SetD|
|000027f0| 49 74 65 6d 20 28 74 68 | 65 44 69 61 6c 6f 67 2c |Item (th|eDialog,|
|00002800| 20 74 65 78 74 52 65 63 | 74 55 73 65 72 2c 20 69 | textRec|tUser, i|
|00002810| 74 65 6d 54 79 70 65 2c | 20 44 72 61 77 54 65 78 |temType,| DrawTex|
|00002820| 74 52 65 63 74 2c 20 26 | 72 29 3b 0a 2f 2a 0a 20 |tRect, &|r);./*. |
|00002830| 20 20 20 69 6e 63 6f 72 | 70 6f 72 61 74 65 20 74 | incor|porate t|
|00002840| 65 78 74 20 69 6e 74 6f | 20 61 20 54 45 52 65 63 |ext into| a TERec|
|00002850| 2e 0a 2a 2f 0a 20 20 20 | 20 53 65 74 50 6f 72 74 |..*/. | SetPort|
|00002860| 20 28 74 68 65 44 69 61 | 6c 6f 67 29 3b 0a 20 20 | (theDia|log);. |
|00002870| 20 20 54 65 78 74 46 6f | 6e 74 20 28 66 6f 6e 74 | TextFo|nt (font|
|00002880| 4e 75 6d 29 3b 0a 20 20 | 20 20 54 65 78 74 53 69 |Num);. | TextSi|
|00002890| 7a 65 20 28 66 6f 6e 74 | 53 69 7a 65 29 3b 0a 0a |ze (font|Size);..|
|000028a0| 20 20 20 20 49 6e 73 65 | 74 52 65 63 74 20 28 26 | Inse|tRect (&|
|000028b0| 72 2c 20 34 2c 20 34 29 | 3b 0a 20 20 20 20 74 65 |r, 4, 4)|;. te|
|000028c0| 48 61 6e 64 20 3d 20 54 | 45 4e 65 77 20 28 26 72 |Hand = T|ENew (&r|
|000028d0| 2c 20 26 72 29 3b 0a 20 | 20 20 20 69 66 20 28 21 |, &r);. | if (!|
|000028e0| 77 72 61 70 29 0a 20 20 | 20 20 20 20 20 20 28 2a |wrap). | (*|
|000028f0| 2a 74 65 48 61 6e 64 29 | 2e 63 72 4f 6e 6c 79 20 |*teHand)|.crOnly |
|00002900| 3d 20 2d 31 3b 0a 20 20 | 20 20 6f 6c 64 48 54 65 |= -1;. | oldHTe|
|00002910| 78 74 20 3d 20 28 2a 2a | 74 65 48 61 6e 64 29 2e |xt = (**|teHand).|
|00002920| 68 54 65 78 74 3b 20 20 | 20 20 20 20 20 20 2f 2a |hText; | /*|
|00002930| 20 73 61 76 65 20 74 68 | 69 73 2e 20 20 72 65 73 | save th|is. res|
|00002940| 74 6f 72 65 20 6c 61 74 | 65 72 20 2a 2f 0a 20 20 |tore lat|er */. |
|00002950| 20 20 28 2a 2a 74 65 48 | 61 6e 64 29 2e 68 54 65 | (**teH|and).hTe|
|00002960| 78 74 20 3d 20 74 65 78 | 74 48 61 6e 64 6c 65 3b |xt = tex|tHandle;|
|00002970| 0a 20 20 20 20 54 45 43 | 61 6c 54 65 78 74 20 28 |. TEC|alText (|
|00002980| 74 65 48 61 6e 64 29 3b | 0a 20 20 20 20 76 69 65 |teHand);|. vie|
|00002990| 77 4c 69 6e 65 73 20 3d | 20 28 72 2e 62 6f 74 74 |wLines =| (r.bott|
|000029a0| 6f 6d 20 2d 20 72 2e 74 | 6f 70 29 20 2f 20 28 2a |om - r.t|op) / (*|
|000029b0| 2a 74 65 48 61 6e 64 29 | 2e 6c 69 6e 65 48 65 69 |*teHand)|.lineHei|
|000029c0| 67 68 74 3b 0a 20 20 20 | 20 73 63 72 6f 6c 6c 4c |ght;. | scrollL|
|000029d0| 69 6e 65 73 20 3d 20 28 | 2a 2a 74 65 48 61 6e 64 |ines = (|**teHand|
|000029e0| 29 2e 6e 4c 69 6e 65 73 | 20 2d 20 76 69 65 77 4c |).nLines| - viewL|
|000029f0| 69 6e 65 73 3b 0a 20 20 | 20 20 6e 65 65 64 53 63 |ines;. | needSc|
|00002a00| 72 6f 6c 6c 20 3d 20 28 | 73 63 72 6f 6c 6c 4c 69 |roll = (|scrollLi|
|00002a10| 6e 65 73 20 3e 20 30 29 | 3b 0a 20 20 20 20 47 65 |nes > 0)|;. Ge|
|00002a20| 74 44 49 74 65 6d 20 28 | 74 68 65 44 69 61 6c 6f |tDItem (|theDialo|
|00002a30| 67 2c 20 73 63 72 6f 6c | 6c 42 61 72 55 73 65 72 |g, scrol|lBarUser|
|00002a40| 2c 20 26 69 74 65 6d 54 | 79 70 65 2c 20 26 69 74 |, &itemT|ype, &it|
|00002a50| 65 6d 48 61 6e 64 6c 65 | 2c 20 26 72 29 3b 0a 20 |emHandle|, &r);. |
|00002a60| 20 20 20 53 65 74 44 49 | 74 65 6d 20 28 74 68 65 | SetDI|tem (the|
|00002a70| 44 69 61 6c 6f 67 2c 20 | 73 63 72 6f 6c 6c 42 61 |Dialog, |scrollBa|
|00002a80| 72 55 73 65 72 2c 20 69 | 74 65 6d 54 79 70 65 2c |rUser, i|temType,|
|00002a90| 20 44 72 61 77 53 63 72 | 6f 6c 6c 2c 20 26 72 29 | DrawScr|oll, &r)|
|00002aa0| 3b 0a 20 20 20 20 69 66 | 20 28 6e 65 65 64 53 63 |;. if| (needSc|
|00002ab0| 72 6f 6c 6c 29 0a 20 20 | 20 20 7b 0a 20 20 20 20 |roll). | {. |
|00002ac0| 20 20 20 20 74 68 65 53 | 63 72 6f 6c 6c 20 3d 20 | theS|croll = |
|00002ad0| 4e 65 77 43 6f 6e 74 72 | 6f 6c 20 28 74 68 65 44 |NewContr|ol (theD|
|00002ae0| 69 61 6c 6f 67 2c 20 26 | 72 2c 20 22 5c 70 22 2c |ialog, &|r, "\p",|
|00002af0| 20 66 61 6c 73 65 2c 20 | 30 2c 20 30 2c 20 30 2c | false, |0, 0, 0,|
|00002b00| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00002b10| 20 20 20 20 20 20 20 20 | 20 73 63 72 6f 6c 6c 42 | | scrollB|
|00002b20| 61 72 50 72 6f 63 2c 20 | 6e 69 6c 29 3b 0a 20 20 |arProc, |nil);. |
|00002b30| 20 20 20 20 20 20 53 65 | 74 43 74 6c 4d 61 78 20 | Se|tCtlMax |
|00002b40| 28 74 68 65 53 63 72 6f | 6c 6c 2c 20 73 63 72 6f |(theScro|ll, scro|
|00002b50| 6c 6c 4c 69 6e 65 73 29 | 3b 0a 20 20 20 20 20 20 |llLines)|;. |
|00002b60| 20 20 68 61 6c 66 50 61 | 67 65 20 3d 20 76 69 65 | halfPa|ge = vie|
|00002b70| 77 4c 69 6e 65 73 20 2f | 20 32 3b 0a 20 20 20 20 |wLines /| 2;. |
|00002b80| 20 20 20 20 63 75 72 4c | 69 6e 65 20 3d 20 30 3b | curL|ine = 0;|
|00002b90| 0a 20 20 20 20 20 20 20 | 20 66 69 6c 74 65 72 50 |. | filterP|
|00002ba0| 72 6f 63 20 3d 20 28 50 | 72 6f 63 50 74 72 29 20 |roc = (P|rocPtr) |
|00002bb0| 54 65 78 74 46 69 6c 74 | 65 72 3b 0a 20 20 20 20 |TextFilt|er;. |
|00002bc0| 7d 0a 0a 20 20 20 20 53 | 68 6f 77 57 69 6e 64 6f |}.. S|howWindo|
|00002bd0| 77 20 28 74 68 65 44 69 | 61 6c 6f 67 29 3b 0a 0a |w (theDi|alog);..|
|00002be0| 20 20 20 20 64 6f 20 7b | 0a 20 20 20 20 20 20 20 | do {|. |
|00002bf0| 20 4d 6f 64 61 6c 44 69 | 61 6c 6f 67 20 28 66 69 | ModalDi|alog (fi|
|00002c00| 6c 74 65 72 50 72 6f 63 | 2c 20 26 69 74 65 6d 4e |lterProc|, &itemN|
|00002c10| 6f 29 3b 0a 20 20 20 20 | 7d 20 77 68 69 6c 65 20 |o);. |} while |
|00002c20| 28 69 74 65 6d 4e 6f 20 | 21 3d 20 4f 4b 42 75 74 |(itemNo |!= OKBut|
|00002c30| 74 6f 6e 29 3b 0a 0a 2f | 2a 0a 20 20 20 20 72 65 |ton);../|*. re|
|00002c40| 73 74 6f 72 65 20 68 54 | 65 78 74 20 66 69 65 6c |store hT|ext fiel|
|00002c50| 64 20 6f 66 20 54 45 20 | 72 65 63 6f 72 64 20 62 |d of TE |record b|
|00002c60| 65 66 6f 72 65 20 64 69 | 73 70 6f 73 69 6e 67 20 |efore di|sposing |
|00002c70| 6f 66 20 69 74 2e 0a 2a | 2f 0a 20 20 20 20 28 2a |of it..*|/. (*|
|00002c80| 2a 74 65 48 61 6e 64 29 | 2e 68 54 65 78 74 20 3d |*teHand)|.hText =|
|00002c90| 20 6f 6c 64 48 54 65 78 | 74 3b 0a 20 20 20 20 54 | oldHTex|t;. T|
|00002ca0| 45 44 69 73 70 6f 73 65 | 20 28 74 65 48 61 6e 64 |EDispose| (teHand|
|00002cb0| 29 3b 0a 0a 20 20 20 20 | 69 66 20 28 6e 65 65 64 |);.. |if (need|
|00002cc0| 53 63 72 6f 6c 6c 29 0a | 20 20 20 20 20 20 20 20 |Scroll).| |
|00002cd0| 44 69 73 70 6f 73 65 43 | 6f 6e 74 72 6f 6c 20 28 |DisposeC|ontrol (|
|00002ce0| 74 68 65 53 63 72 6f 6c | 6c 29 3b 0a 20 20 20 20 |theScrol|l);. |
|00002cf0| 53 65 74 50 6f 72 74 20 | 28 6f 6c 64 50 6f 72 74 |SetPort |(oldPort|
|00002d00| 29 3b 0a 20 20 20 20 44 | 69 73 70 6f 73 44 69 61 |);. D|isposDia|
|00002d10| 6c 6f 67 28 74 68 65 44 | 69 61 6c 6f 67 29 3b 0a |log(theD|ialog);.|
|00002d20| 7d 0a 2d 2d 2d 0a 0a 0a | |}.---...| |
+--------+-------------------------+-------------------------+--------+--------+