home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / B-C / CPStyleText.sit / CPStyleText.c < prev    next >
MacBinary  |  1994-03-16  |  130.9 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: CPStyleText.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Wed Mar 16 12:06:11 1994, modified Wed Mar 16 12:06:11 1994, creator Think C, type ASCII, 133162 bytes "CPStyleText.c" , at 0x208aa 534 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0d 43 50 53 74 79 6c | 65 54 65 78 74 2e 63 00 |..CPStyl|eText.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 02 08 2a 00 | 00 02 16 a9 ac ed 03 a9 |......*.|........|
|00000060| ac ed 03 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 95 3f 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 0d |********|*******.|
|000000d0| 20 43 50 53 74 79 6c 65 | 54 65 78 74 2e 63 0d 20 | CPStyle|Text.c. |
|000000e0| 0d 09 20 09 09 09 09 09 | 09 20 20 54 68 65 20 50 |.. .....|. The P|
|000000f0| 53 74 79 6c 65 54 65 78 | 74 20 43 6c 61 73 73 0d |StyleTex|t Class.|
|00000100| 09 09 09 09 09 09 09 20 | 09 09 20 20 20 62 79 3a |....... |.. by:|
|00000110| 0d 09 09 09 09 09 09 09 | 09 4a 6f 68 6e 20 41 2e |........|.John A.|
|00000120| 20 4c 6f 76 65 2c 20 49 | 49 49 0d 09 09 09 09 09 | Love, I|II......|
|00000130| 09 09 09 0d 09 09 09 09 | 09 09 09 4e 4f 20 43 6f |........|...NO Co|
|00000140| 70 79 72 69 67 68 74 20 | d1 20 69 74 27 73 20 66 |pyright |. it's f|
|00000150| 72 65 65 21 0d 09 09 09 | 20 20 20 28 6d 65 6e 74 |ree!....| (ment|
|00000160| 69 6f 6e 69 6e 67 20 6d | 79 20 6e 61 6d 65 20 77 |ioning m|y name w|
|00000170| 6f 75 6c 64 20 62 65 20 | 56 45 52 59 20 4d 55 43 |ould be |VERY MUC|
|00000180| 48 20 61 70 70 72 65 63 | 69 61 74 65 64 29 0d 20 |H apprec|iated). |
|00000190| 09 0d 20 09 0d 09 09 09 | 09 09 09 09 20 53 55 50 |.. .....|.... SUP|
|000001a0| 45 52 43 4c 41 53 53 20 | 3d 20 43 50 45 64 69 74 |ERCLASS |= CPEdit|
|000001b0| 54 65 78 74 0d 09 09 09 | 09 09 09 09 20 09 09 20 |Text....|.... .. |
|000001c0| 20 20 62 79 3a 0d 09 09 | 09 09 09 09 09 20 20 43 | by:...|..... C|
|000001d0| 68 72 69 73 74 6f 70 68 | 65 72 20 52 2e 20 57 79 |hristoph|er R. Wy|
|000001e0| 73 6f 63 6b 69 0d 09 09 | 09 09 09 20 20 43 6f 70 |socki...|... Cop|
|000001f0| 79 72 69 67 68 74 20 a9 | 20 31 39 39 32 2c 20 41 |yright .| 1992, A|
|00000200| 6c 6c 20 52 69 67 68 74 | 73 20 52 65 73 65 72 76 |ll Right|s Reserv|
|00000210| 65 64 0d 0d 0d 0d 09 20 | 20 20 20 20 20 20 20 20 |ed..... | |
|00000220| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000230| 2d 2d 2d 2d 20 44 45 53 | 43 52 49 50 54 49 4f 4e |---- DES|CRIPTION|
|00000240| 20 2d 2d 2d 2d 0d 20 0d | 09 43 50 53 74 79 6c 65 | ----. .|.CPStyle|
|00000250| 54 65 78 74 20 69 73 20 | 61 20 63 6c 61 73 73 20 |Text is |a class |
|00000260| 66 6f 72 20 76 65 72 73 | 69 6f 6e 20 31 2e 31 2e |for vers|ion 1.1.|
|00000270| 78 20 6f 66 20 53 79 6d | 61 6e 74 65 63 27 73 20 |x of Sym|antec's |
|00000280| 54 48 49 4e 4b 20 43 6c | 61 73 73 0d 09 4c 69 62 |THINK Cl|ass..Lib|
|00000290| 72 61 72 79 20 74 68 61 | 74 20 69 6d 70 6c 65 6d |rary tha|t implem|
|000002a0| 65 6e 74 73 20 61 20 73 | 74 79 6c 65 64 20 74 65 |ents a s|tyled te|
|000002b0| 78 74 20 65 64 69 74 69 | 6e 67 20 70 61 6e 65 2e |xt editi|ng pane.|
|000002c0| 20 20 49 74 20 63 61 6e | 20 62 65 20 75 73 65 64 | It can| be used|
|000002d0| 0d 09 61 73 20 61 20 64 | 69 72 65 63 74 20 72 65 |..as a d|irect re|
|000002e0| 70 6c 61 63 65 6d 65 6e | 74 20 66 6f 72 20 74 68 |placemen|t for th|
|000002f0| 65 20 73 74 61 6e 64 61 | 72 64 20 54 43 4c 20 43 |e standa|rd TCL C|
|00000300| 53 74 79 6c 65 54 65 78 | 74 20 63 6c 61 73 73 20 |StyleTex|t class |
|00000310| 77 69 74 68 6f 75 74 0d | 09 54 65 78 74 45 64 69 |without.|.TextEdi|
|00000320| 74 27 73 20 6c 69 6d 69 | 74 61 74 69 6f 6e 20 74 |t's limi|tation t|
|00000330| 6f 20 61 20 6d 61 78 69 | 6d 75 6d 20 33 32 6b 20 |o a maxi|mum 32k |
|00000340| 6f 66 20 74 65 78 74 2e | 0d 09 0d 09 0d 09 20 20 |of text.|...... |
|00000350| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000360| 20 20 20 20 20 2d 2d 2d | 2d 20 56 45 52 53 49 4f | ---|- VERSIO|
|00000370| 4e 20 48 49 53 54 4f 52 | 59 20 2d 2d 2d 2d 0d 09 |N HISTOR|Y ----..|
|00000380| 0d 09 09 a5 20 31 2e 33 | 62 31 20 28 32 35 20 53 |.... 1.3|b1 (25 S|
|00000390| 65 70 74 65 6d 62 65 72 | 20 31 39 39 33 29 0d 09 |eptember| 1993)..|
|000003a0| 09 09 2d 20 53 74 61 72 | 74 65 64 20 77 6f 72 6b |..- Star|ted work|
|000003b0| 69 6e 67 20 61 6e 64 20 | 77 6f 72 6b 69 6e 67 20 |ing and |working |
|000003c0| 61 6e 64 20 77 6f 72 6b | 69 6e 67 20 61 6e 64 20 |and work|ing and |
|000003d0| 2e 2e 2e 0d 09 0d 09 09 | a5 20 31 2e 33 62 32 20 |........|. 1.3b2 |
|000003e0| 28 32 38 20 44 65 63 65 | 6d 62 65 72 20 31 39 39 |(28 Dece|mber 199|
|000003f0| 33 29 0d 09 09 09 2d 20 | 49 6e 74 72 6f 64 75 63 |3)....- |Introduc|
|00000400| 65 64 20 6c 65 66 74 20 | 61 6e 64 20 72 69 67 68 |ed left |and righ|
|00000410| 74 20 6d 61 72 67 69 6e | 73 0d 09 09 09 2d 20 52 |t margin|s....- R|
|00000420| 65 69 6e 73 65 72 74 65 | 64 20 63 65 6e 74 65 72 |einserte|d center|
|00000430| 20 61 6e 64 20 72 69 67 | 68 74 20 74 65 78 74 20 | and rig|ht text |
|00000440| 61 6c 69 67 6e 6d 65 6e | 74 0d 09 09 09 20 20 28 |alignmen|t.... (|
|00000450| 20 43 68 72 69 73 20 64 | 72 6f 70 70 65 64 20 74 | Chris d|ropped t|
|00000460| 68 65 73 65 20 69 6e 20 | 68 69 73 20 76 65 72 73 |hese in |his vers|
|00000470| 69 6f 6e 20 31 2e 32 20 | 6f 66 20 43 50 45 64 69 |ion 1.2 |of CPEdi|
|00000480| 74 54 65 78 74 20 29 0d | 09 09 09 2d 20 49 6e 74 |tText ).|...- Int|
|00000490| 72 6f 64 75 63 65 64 20 | 77 6f 72 64 2d 77 72 61 |roduced |word-wra|
|000004a0| 70 3a 0d 09 09 09 20 20 | 28 61 29 20 74 6f 20 77 |p:.... |(a) to w|
|000004b0| 69 6e 64 6f 77 20 77 69 | 64 74 68 0d 09 09 09 20 |indow wi|dth.... |
|000004c0| 20 28 62 29 20 74 6f 20 | 6c 69 6e 65 20 77 69 64 | (b) to |line wid|
|000004d0| 74 68 0d 09 09 09 20 20 | 28 63 29 20 74 6f 20 6c |th.... |(c) to l|
|000004e0| 65 66 74 20 61 6e 64 20 | 72 69 67 68 74 20 6d 61 |eft and |right ma|
|000004f0| 72 67 69 6e 73 0d 09 0d | 09 09 a5 20 31 2e 33 62 |rgins...|... 1.3b|
|00000500| 33 20 28 20 36 20 4a 61 | 6e 75 61 72 79 20 31 39 |3 ( 6 Ja|nuary 19|
|00000510| 39 34 29 0d 09 09 09 2d | 20 49 6e 74 72 6f 64 75 |94)....-| Introdu|
|00000520| 63 65 64 20 66 75 6c 6c | 20 6a 75 73 74 69 66 79 |ced full| justify|
|00000530| 20 74 65 78 74 20 61 6c | 69 67 6e 6d 65 6e 74 2e | text al|ignment.|
|00000540| 20 20 43 72 65 61 74 65 | 64 0d 09 09 09 20 20 61 | Create|d.... a|
|00000550| 20 43 53 74 79 6c 65 50 | 53 74 79 6c 65 54 61 73 | CStyleP|StyleTas|
|00000560| 6b 20 63 6c 61 73 73 20 | 74 6f 20 68 65 6c 70 20 |k class |to help |
|00000570| 65 66 66 65 63 74 20 74 | 68 69 73 2e 0d 09 0d 09 |effect t|his.....|
|00000580| 09 a5 20 31 2e 33 62 34 | 20 28 31 33 20 4a 61 6e |.. 1.3b4| (13 Jan|
|00000590| 75 61 72 79 20 31 39 39 | 34 29 0d 09 09 09 2d 20 |uary 199|4)....- |
|000005a0| 4d 6f 64 69 66 69 65 64 | 20 43 68 72 69 73 27 20 |Modified| Chris' |
|000005b0| 53 63 72 6f 6c 6c 54 6f | 53 65 6c 65 63 74 69 6f |ScrollTo|Selectio|
|000005c0| 6e 20 61 6e 64 20 53 63 | 72 6f 6c 6c 54 6f 4f 66 |n and Sc|rollToOf|
|000005d0| 66 73 65 74 20 6d 65 74 | 68 6f 64 73 0d 09 09 09 |fset met|hods....|
|000005e0| 2d 20 43 68 61 6e 67 65 | 64 20 6d 79 20 57 72 61 |- Change|d my Wra|
|000005f0| 70 4c 69 6e 65 53 74 61 | 72 74 73 20 6d 65 74 68 |pLineSta|rts meth|
|00000600| 6f 64 20 74 6f 0d 09 09 | 09 20 20 61 63 63 6f 6d |od to...|. accom|
|00000610| 6f 64 61 74 65 20 62 72 | 65 61 6b 69 6e 67 20 53 |odate br|eaking S|
|00000620| 55 50 45 52 20 6c 6f 6e | 67 20 77 6f 72 64 73 0d |UPER lon|g words.|
|00000630| 09 0d 09 09 a5 20 31 2e | 33 62 35 20 28 32 38 20 |..... 1.|3b5 (28 |
|00000640| 4a 61 6e 75 61 72 79 20 | 31 39 39 34 29 0d 09 09 |January |1994)...|
|00000650| 09 2d 20 41 64 64 65 64 | 20 61 6e 20 61 75 74 6f |.- Added| an auto|
|00000660| 73 63 72 6f 6c 6c 20 63 | 61 70 61 62 69 6c 69 74 |scroll c|apabilit|
|00000670| 79 20 77 68 65 6e 20 74 | 68 65 20 75 73 65 72 20 |y when t|he user |
|00000680| 70 72 65 73 73 65 73 20 | 74 68 65 0d 09 09 09 20 |presses |the.... |
|00000690| 20 3c 4f 70 74 69 6f 6e | 3e 20 6b 65 79 20 77 68 | <Option|> key wh|
|000006a0| 69 6c 65 20 63 6c 69 63 | 6b 69 6e 67 20 74 68 65 |ile clic|king the|
|000006b0| 20 6d 6f 75 73 65 20 69 | 6e 20 74 68 65 20 74 65 | mouse i|n the te|
|000006c0| 78 74 20 70 61 6e 65 2e | 0d 09 09 09 20 20 49 64 |xt pane.|.... Id|
|000006d0| 65 61 20 63 61 6d 65 20 | 66 72 6f 6d 20 6d 79 20 |ea came |from my |
|000006e0| 75 73 65 20 6f 66 20 53 | 79 6d 61 6e 74 65 63 27 |use of S|ymantec'|
|000006f0| 73 20 22 54 48 49 4e 4b | 20 52 65 66 65 72 65 6e |s "THINK| Referen|
|00000700| 63 65 22 20 61 70 70 2e | 0d 09 09 09 20 20 54 68 |ce" app.|.... Th|
|00000710| 69 73 20 61 75 74 6f 73 | 63 72 6f 6c 6c 69 6e 67 |is autos|crolling|
|00000720| 20 73 63 72 6f 6c 6c 73 | 20 6a 75 73 74 20 6f 6e | scrolls| just on|
|00000730| 65 20 6c 69 6e 65 20 61 | 74 20 61 20 74 69 6d 65 |e line a|t a time|
|00000740| 2e 0d 09 0d 09 09 a5 20 | 31 2e 33 62 36 20 28 20 |....... |1.3b6 ( |
|00000750| 36 20 46 65 62 72 75 61 | 72 79 20 31 39 39 34 29 |6 Februa|ry 1994)|
|00000760| 0d 09 09 09 2d 20 41 64 | 64 65 64 20 61 6e 6f 74 |....- Ad|ded anot|
|00000770| 68 65 72 20 61 75 74 6f | 73 63 72 6f 6c 6c 20 63 |her auto|scroll c|
|00000780| 61 70 61 62 69 6c 69 74 | 79 20 65 66 66 65 63 74 |apabilit|y effect|
|00000790| 65 64 20 77 68 65 6e 20 | 74 68 65 0d 09 09 09 20 |ed when |the.... |
|000007a0| 20 75 73 65 72 20 70 72 | 65 73 73 65 73 20 74 68 | user pr|esses th|
|000007b0| 65 20 3c 4f 70 74 69 6f | 6e 3e 20 6b 65 79 20 77 |e <Optio|n> key w|
|000007c0| 68 69 6c 65 20 64 72 61 | 67 67 69 6e 67 20 74 68 |hile dra|gging th|
|000007d0| 65 20 74 68 75 6d 62 0d | 09 09 09 20 20 69 6e 20 |e thumb.|... in |
|000007e0| 65 69 74 68 65 72 20 73 | 63 72 6f 6c 6c 20 62 61 |either s|croll ba|
|000007f0| 72 2e 20 20 43 72 65 61 | 74 65 64 20 74 68 65 20 |r. Crea|ted the |
|00000800| 43 50 53 74 79 6c 65 53 | 63 72 6f 6c 6c 50 61 6e |CPStyleS|crollPan|
|00000810| 65 20 61 6e 64 0d 09 09 | 09 20 20 43 50 53 74 79 |e and...|. CPSty|
|00000820| 6c 65 53 63 72 6f 6c 6c | 42 61 72 20 63 6c 61 73 |leScroll|Bar clas|
|00000830| 73 65 73 20 74 6f 20 6d | 61 6b 65 20 74 68 69 73 |ses to m|ake this|
|00000840| 20 68 61 70 70 65 6e 2e | 20 20 49 64 65 61 20 63 | happen.| Idea c|
|00000850| 61 6d 65 0d 09 09 09 20 | 20 66 72 6f 6d 20 6d 79 |ame.... | from my|
|00000860| 20 75 73 65 20 6f 66 20 | 4a 65 72 73 65 79 20 53 | use of |Jersey S|
|00000870| 63 69 65 6e 74 69 66 69 | 63 27 73 20 22 43 4d 61 |cientifi|c's "CMa|
|00000880| 73 74 65 72 22 2e 20 20 | 54 68 65 20 75 73 65 72 |ster". |The user|
|00000890| 0d 09 09 09 20 20 77 6f | 75 6c 64 20 69 6d 70 6c |.... wo|uld impl|
|000008a0| 65 6d 65 6e 74 20 74 68 | 69 73 20 74 79 70 65 20 |ement th|is type |
|000008b0| 6f 66 20 61 75 74 6f 73 | 63 72 6f 6c 6c 69 6e 67 |of autos|crolling|
|000008c0| 20 77 68 65 6e 20 73 2f | 68 65 0d 09 09 09 20 20 | when s/|he.... |
|000008d0| 77 69 73 68 65 73 20 74 | 6f 20 73 63 72 6f 6c 6c |wishes t|o scroll|
|000008e0| 20 56 45 52 59 20 66 61 | 73 74 20 73 69 6e 63 65 | VERY fa|st since|
|000008f0| 20 74 68 65 20 73 63 72 | 6f 6c 6c 69 6e 67 20 73 | the scr|olling s|
|00000900| 70 65 65 64 20 69 73 0d | 09 09 09 20 20 6c 69 6d |peed is.|... lim|
|00000910| 69 74 65 64 20 6f 6e 6c | 79 20 62 79 20 74 68 65 |ited onl|y by the|
|00000920| 20 73 70 65 65 64 20 6f | 66 20 74 68 65 20 6d 6f | speed o|f the mo|
|00000930| 75 73 65 20 6d 6f 76 65 | 6d 65 6e 74 2e 0d 09 0d |use move|ment....|
|00000940| 09 09 a5 20 31 2e 33 62 | 37 20 28 31 30 20 46 65 |... 1.3b|7 (10 Fe|
|00000950| 62 72 75 61 72 79 20 31 | 39 39 34 29 0d 09 09 09 |bruary 1|994)....|
|00000960| 2d 20 4d 6f 64 69 66 69 | 65 64 20 43 68 72 69 73 |- Modifi|ed Chris|
|00000970| 27 20 44 72 61 77 43 61 | 72 65 74 20 6d 65 74 68 |' DrawCa|ret meth|
|00000980| 6f 64 20 66 6f 72 20 64 | 72 61 77 69 6e 67 20 74 |od for d|rawing t|
|00000990| 68 65 20 63 61 72 65 74 | 0d 09 09 09 20 20 61 74 |he caret|.... at|
|000009a0| 20 74 68 65 20 65 6e 64 | 20 6f 66 20 61 20 22 73 | the end| of a "s|
|000009b0| 75 62 2d 6c 69 6e 65 22 | 20 6f 66 20 61 20 77 6f |ub-line"| of a wo|
|000009c0| 72 64 2d 77 72 61 70 70 | 65 64 20 6c 69 6e 65 2e |rd-wrapp|ed line.|
|000009d0| 0d 09 09 09 20 20 43 68 | 72 69 73 27 20 44 72 61 |.... Ch|ris' Dra|
|000009e0| 77 43 61 72 65 74 20 6d | 65 74 68 6f 64 20 69 73 |wCaret m|ethod is|
|000009f0| 20 64 65 63 6c 61 72 65 | 64 20 4e 4f 4e 2d 76 69 | declare|d NON-vi|
|00000a00| 72 74 75 61 6c 20 77 69 | 74 68 69 6e 0d 09 09 09 |rtual wi|thin....|
|00000a10| 20 20 68 69 73 20 22 43 | 50 45 64 69 74 54 65 78 | his "C|PEditTex|
|00000a20| 74 2e 68 22 20 69 6e 74 | 65 72 66 61 63 65 20 66 |t.h" int|erface f|
|00000a30| 69 6c 65 2e 20 20 53 6f | 20 74 68 65 20 6d 6f 73 |ile. So| the mos|
|00000a40| 74 20 73 69 6d 70 6c 65 | 21 0d 09 09 09 20 20 77 |t simple|!.... w|
|00000a50| 61 79 20 49 20 63 61 6e | 20 6f 76 65 72 72 69 64 |ay I can| overrid|
|00000a60| 65 20 69 74 20 66 6f 72 | 20 62 6f 74 68 20 54 48 |e it for| both TH|
|00000a70| 49 4e 4b 20 43 20 61 6e | 64 20 53 79 6d 61 6e 74 |INK C an|d Symant|
|00000a80| 65 63 20 43 2b 2b 0d 09 | 09 09 20 20 69 73 20 74 |ec C++..|.. is t|
|00000a90| 6f 20 64 65 63 6c 61 72 | 65 20 43 68 72 69 73 27 |o declar|e Chris'|
|00000aa0| 20 44 72 61 77 43 61 72 | 65 74 20 61 20 76 69 72 | DrawCar|et a vir|
|00000ab0| 74 75 61 6c 20 6d 65 74 | 68 6f 64 20 77 69 74 68 |tual met|hod with|
|00000ac0| 69 6e 0d 09 09 09 20 20 | 74 68 61 74 20 69 6e 74 |in.... |that int|
|00000ad0| 65 72 66 61 63 65 20 66 | 69 6c 65 2e 0d 09 0d 09 |erface f|ile.....|
|00000ae0| 09 a5 20 31 2e 33 09 28 | 32 36 20 46 65 62 72 75 |.. 1.3.(|26 Febru|
|00000af0| 61 72 79 20 31 39 39 34 | 29 0d 09 09 09 2d 20 53 |ary 1994|)....- S|
|00000b00| 74 61 72 74 65 64 20 74 | 68 65 20 27 6d 6f 74 68 |tarted t|he 'moth|
|00000b10| 65 72 27 20 6f 66 20 61 | 6c 6c 20 61 64 64 69 74 |er' of a|ll addit|
|00000b20| 69 6f 6e 73 20 2e 2e 2e | 20 73 74 79 6c 65 20 69 |ions ...| style i|
|00000b30| 6e 66 6f 20 2e 2e 2e 0d | 09 09 09 20 20 42 65 66 |nfo ....|... Bef|
|00000b40| 6f 72 65 20 74 68 69 73 | 20 61 64 64 69 74 69 6f |ore this| additio|
|00000b50| 6e 20 69 73 20 66 69 6e | 69 73 68 65 64 2c 20 69 |n is fin|ished, i|
|00000b60| 74 27 6c 6c 20 63 68 61 | 6e 67 65 20 6d 61 6e 79 |t'll cha|nge many|
|00000b70| 2c 20 6d 61 6e 79 0d 09 | 09 09 20 20 74 69 6d 65 |, many..|.. time|
|00000b80| 73 2e 20 20 46 6f 72 20 | 74 68 65 20 6d 6f 6d 65 |s. For |the mome|
|00000b90| 6e 74 2c 20 49 20 68 61 | 76 65 20 70 72 65 73 65 |nt, I ha|ve prese|
|00000ba0| 6e 74 65 64 20 6a 75 73 | 74 20 61 20 73 68 65 6c |nted jus|t a shel|
|00000bb0| 6c 20 66 6f 72 0d 09 09 | 09 20 20 75 73 20 74 6f |l for...|. us to|
|00000bc0| 20 63 68 65 77 20 6f 6e | 2e 0d 09 0d 09 09 a5 20 | chew on|....... |
|00000bd0| 31 2e 34 62 31 09 28 3f | 3f 3f 3f 3f 29 0d 09 09 |1.4b1.(?|????)...|
|00000be0| 09 2d 20 41 6e 6f 74 68 | 65 72 20 42 49 47 20 63 |.- Anoth|er BIG c|
|00000bf0| 68 61 6c 6c 65 6e 67 65 | 20 69 73 20 74 6f 20 73 |hallenge| is to s|
|00000c00| 69 67 6e 69 66 69 63 61 | 6e 74 6c 79 20 73 70 65 |ignifica|ntly spe|
|00000c10| 65 64 20 74 68 69 6e 67 | 73 0d 09 09 09 20 20 75 |ed thing|s.... u|
|00000c20| 70 20 66 6f 72 20 73 75 | 70 65 72 20 6c 61 72 67 |p for su|per larg|
|00000c30| 65 20 66 69 6c 65 73 20 | 28 3e 20 31 30 30 6b 29 |e files |(> 100k)|
|00000c40| 2c 20 66 6f 72 20 65 78 | 61 6d 70 6c 65 2c 20 72 |, for ex|ample, r|
|00000c50| 65 61 64 69 6e 67 0d 09 | 09 09 20 20 74 68 65 6d |eading..|.. them|
|00000c60| 20 69 6e 2c 20 64 69 73 | 70 6c 61 79 69 6e 67 20 | in, dis|playing |
|00000c70| 74 68 65 6d 2c 20 77 6f | 72 64 2d 77 72 61 70 2c |them, wo|rd-wrap,|
|00000c80| 20 73 63 72 6f 6c 6c 69 | 6e 67 2c 20 65 74 63 2e | scrolli|ng, etc.|
|00000c90| 0d 09 09 09 0d 0d 09 20 | 20 20 20 20 20 20 20 20 |....... | |
|00000ca0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2d 2d 2d | | ---|
|00000cb0| 2d 20 4c 49 43 45 4e 53 | 45 20 41 47 52 45 45 4d |- LICENS|E AGREEM|
|00000cc0| 45 4e 54 20 2d 2d 2d 2d | 0d 09 0d 09 54 68 65 20 |ENT ----|....The |
|00000cd0| 73 6f 75 72 63 65 20 63 | 6f 64 65 20 75 6e 69 71 |source c|ode uniq|
|00000ce0| 75 65 20 74 6f 20 43 50 | 53 74 79 6c 65 54 65 78 |ue to CP|StyleTex|
|00000cf0| 74 20 77 61 73 20 77 72 | 69 74 74 65 6e 20 62 79 |t was wr|itten by|
|00000d00| 20 61 6e 64 20 69 73 20 | 74 68 65 20 70 72 6f 70 | and is |the prop|
|00000d10| 65 72 74 79 0d 09 6f 66 | 20 4a 6f 68 6e 20 41 2e |erty..of| John A.|
|00000d20| 20 4c 6f 76 65 2c 20 49 | 49 49 2e 20 20 41 6e 79 | Love, I|II. Any|
|00000d30| 20 75 73 65 72 73 20 6f | 66 20 43 50 53 74 79 6c | users o|f CPStyl|
|00000d40| 65 54 65 78 74 20 61 72 | 65 20 6c 65 67 61 6c 6c |eText ar|e legall|
|00000d50| 79 20 62 6f 75 6e 64 20 | 62 79 20 74 68 65 0d 09 |y bound |by the..|
|00000d60| 4c 49 43 45 4e 53 45 20 | 41 47 52 45 45 4d 45 4e |LICENSE |AGREEMEN|
|00000d70| 54 20 61 75 74 68 6f 72 | 65 64 20 62 79 20 43 68 |T author|ed by Ch|
|00000d80| 72 69 73 74 6f 70 68 65 | 72 20 52 2e 20 57 79 73 |ristophe|r R. Wys|
|00000d90| 6f 63 6b 69 2e 20 20 4e | 6f 20 6f 74 68 65 72 20 |ocki. N|o other |
|00000da0| 43 6f 70 79 72 69 67 68 | 74 0d 09 69 73 20 73 74 |Copyrigh|t..is st|
|00000db0| 61 74 65 64 20 6f 72 20 | 69 6d 70 6c 69 65 64 2e |ated or |implied.|
|00000dc0| 0d 09 0d 09 20 20 20 20 | 20 20 20 20 20 20 20 20 |.... | |
|00000dd0| 20 20 20 20 20 20 2d 2d | 2d 2d 20 45 4c 45 43 54 | --|-- ELECT|
|00000de0| 52 4f 4e 49 43 20 4d 41 | 49 4c 20 41 44 44 52 45 |RONIC MA|IL ADDRE|
|00000df0| 53 53 45 53 20 2d 2d 2d | 2d 0d 09 0d 09 09 41 6d |SSES ---|-.....Am|
|00000e00| 65 72 69 63 61 20 4f 6e | 6c 69 6e 65 3a 09 09 4a |erica On|line:..J|
|00000e10| 6f 68 6e 20 4c 6f 76 65 | 0d 0d 09 20 20 20 20 20 |ohn Love|... |
|00000e20| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 09 09 20 | | .. |
|00000e30| 2d 2d 2d 2d 20 4f 54 48 | 45 52 20 49 4e 46 4f 20 |---- OTH|ER INFO |
|00000e40| 2d 2d 2d 2d 0d 09 0d 09 | 09 54 65 6c 65 70 68 6f |----....|.Telepho|
|00000e50| 6e 65 3a 09 09 09 28 37 | 30 33 29 20 35 36 39 2d |ne:...(7|03) 569-|
|00000e60| 32 32 39 34 09 09 3c 79 | 6f 75 72 20 6e 69 63 6b |2294..<y|our nick|
|00000e70| 65 6c 3e 0d 09 09 0d 09 | 09 4c 65 74 74 65 72 3a |el>.....|.Letter:|
|00000e80| 09 09 09 09 36 34 31 33 | 20 57 79 6e 67 61 74 65 |....6413| Wyngate|
|00000e90| 20 44 72 69 76 65 0d 09 | 09 09 09 09 09 09 53 70 | Drive..|......Sp|
|00000ea0| 72 69 6e 67 66 69 65 6c | 64 2c 20 56 69 72 67 69 |ringfiel|d, Virgi|
|00000eb0| 6e 69 61 20 20 20 32 32 | 31 35 32 0d 20 2a 2a 2a |nia 22|152. ***|
|00000ec0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000ed0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000ee0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000ef0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000f00| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2f 0d 0d 0d 0d |********|***/....|
|00000f10| 0d 2f 2a 2a 20 49 6e 63 | 6c 75 64 65 73 20 2a 2a |./** Inc|ludes **|
|00000f20| 2f 0d 0d 23 69 6e 63 6c | 75 64 65 20 3c 43 6f 6d |/..#incl|ude <Com|
|00000f30| 6d 61 6e 64 73 2e 68 3e | 0d 23 69 6e 63 6c 75 64 |mands.h>|.#includ|
|00000f40| 65 20 3c 43 6f 6e 73 74 | 61 6e 74 73 2e 68 3e 0d |e <Const|ants.h>.|
|00000f50| 23 69 6e 63 6c 75 64 65 | 20 3c 43 42 61 72 74 65 |#include| <CBarte|
|00000f60| 6e 64 65 72 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |nder.h>.|#include|
|00000f70| 20 3c 43 43 6c 69 70 62 | 6f 61 72 64 2e 68 3e 0d | <CClipb|oard.h>.|
|00000f80| 23 69 6e 63 6c 75 64 65 | 20 3c 43 53 69 7a 65 42 |#include| <CSizeB|
|00000f90| 6f 78 2e 68 3e 0d 23 69 | 6e 63 6c 75 64 65 20 3c |ox.h>.#i|nclude <|
|00000fa0| 4f 53 43 68 65 63 6b 73 | 2e 68 3e 0d 23 69 6e 63 |OSChecks|.h>.#inc|
|00000fb0| 6c 75 64 65 20 3c 53 63 | 72 69 70 74 2e 68 3e 0d |lude <Sc|ript.h>.|
|00000fc0| 23 69 6e 63 6c 75 64 65 | 20 3c 54 42 55 74 69 6c |#include| <TBUtil|
|00000fd0| 69 74 69 65 73 2e 68 3e | 0d 23 69 6e 63 6c 75 64 |ities.h>|.#includ|
|00000fe0| 65 20 3c 54 43 4c 55 74 | 69 6c 69 74 69 65 73 2e |e <TCLUt|ilities.|
|00000ff0| 68 3e 0d 0d 23 69 6e 63 | 6c 75 64 65 20 22 43 50 |h>..#inc|lude "CP|
|00001000| 45 64 69 74 53 63 72 6f | 6c 6c 50 61 6e 65 2e 68 |EditScro|llPane.h|
|00001010| 22 0d 23 69 6e 63 6c 75 | 64 65 20 22 43 50 53 74 |".#inclu|de "CPSt|
|00001020| 79 6c 65 54 65 78 74 2e | 68 22 0d 0d 0d 2f 2a 2a |yleText.|h".../**|
|00001030| 20 54 43 4c 20 47 6c 6f | 62 61 6c 20 56 61 72 69 | TCL Glo|bal Vari|
|00001040| 61 62 6c 65 73 20 2a 2a | 2f 0d 0d 65 78 74 65 72 |ables **|/..exter|
|00001050| 6e 20 43 42 61 72 74 65 | 6e 64 65 72 09 2a 67 42 |n CBarte|nder.*gB|
|00001060| 61 72 74 65 6e 64 65 72 | 3b 0d 65 78 74 65 72 6e |artender|;.extern|
|00001070| 20 43 43 6c 69 70 62 6f | 61 72 64 09 2a 67 43 6c | CClipbo|ard.*gCl|
|00001080| 69 70 62 6f 61 72 64 3b | 0d 65 78 74 65 72 6e 20 |ipboard;|.extern |
|00001090| 73 68 6f 72 74 09 09 67 | 43 6c 69 63 6b 73 3b 0d |short..g|Clicks;.|
|000010a0| 0d 0d 2f 2a 2a 09 09 09 | 09 41 64 64 65 64 20 43 |../**...|.Added C|
|000010b0| 6f 6e 73 74 61 6e 74 09 | 09 09 09 09 20 2a 2a 2f |onstant.|.... **/|
|000010c0| 0d 2f 2a 2a 09 09 09 09 | 09 09 09 09 09 09 09 09 |./**....|........|
|000010d0| 20 2a 2a 2f 0d 2f 2a 2a | 20 4e 65 77 20 72 65 73 | **/./**| New res|
|000010e0| 6f 75 72 63 65 73 20 69 | 6e 20 6d 79 20 22 43 50 |ources i|n my "CP|
|000010f0| 53 74 79 6c 65 54 65 78 | 74 2e 72 73 72 63 22 20 |StyleTex|t.rsrc" |
|00001100| 66 69 6c 65 2e 20 2a 2a | 2f 0d 2f 2a 2a 20 27 43 |file. **|/./** 'C|
|00001110| 55 52 53 27 20 61 6e 64 | 20 27 63 72 73 72 27 20 |URS' and| 'crsr' |
|00001120| 72 65 73 6f 75 72 63 65 | 73 20 61 64 61 70 74 65 |resource|s adapte|
|00001130| 64 20 66 72 6f 6d 09 20 | 2a 2a 2f 0d 2f 2a 2a 20 |d from. |**/./** |
|00001140| 53 79 6d 61 6e 74 65 63 | 27 73 20 22 54 48 49 4e |Symantec|'s "THIN|
|00001150| 4b 20 52 65 66 65 72 65 | 6e 63 65 22 20 61 70 70 |K Refere|nce" app|
|00001160| 6c 69 63 61 74 69 6f 6e | 2e 09 20 2a 2a 2f 0d 0d |lication|.. **/..|
|00001170| 23 64 65 66 69 6e 65 20 | 72 41 75 74 6f 53 63 72 |#define |rAutoScr|
|00001180| 6f 6c 6c 43 75 72 73 6f | 72 09 34 30 30 30 0d 0d |ollCurso|r.4000..|
|00001190| 0d 2f 2a 2a 09 09 09 20 | 53 70 65 61 6b 69 6e 67 |./**... |Speaking|
|000011a0| 20 6f 66 20 72 65 73 6f | 75 72 63 65 73 20 2e 2e | of reso|urces ..|
|000011b0| 2e 09 09 09 09 09 09 20 | 20 20 2a 2a 2f 0d 2f 2a |....... | **/./*|
|000011c0| 2a 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 09 |*.......|........|
|000011d0| 20 20 20 2a 2a 2f 0d 2f | 2a 2a 20 54 68 69 73 20 | **/./|** This |
|000011e0| 69 73 20 74 68 65 20 49 | 44 20 6f 66 20 6d 79 20 |is the I|D of my |
|000011f0| 27 45 73 74 72 27 20 72 | 65 73 6f 75 72 63 65 20 |'Estr' r|esource |
|00001200| 74 68 61 74 20 74 68 65 | 20 54 43 4c 20 75 73 65 |that the| TCL use|
|00001210| 73 09 20 20 20 2a 2a 2f | 0d 2f 2a 2a 20 66 6f 72 |s. **/|./** for|
|00001220| 20 45 72 72 6f 72 20 48 | 61 6e 64 6c 69 6e 67 20 | Error H|andling |
|00001230| 77 68 65 6e 20 79 6f 75 | 20 63 61 6c 6c 3a 09 09 |when you| call:..|
|00001240| 09 09 09 09 20 20 20 2a | 2a 2f 0d 2f 2a 2a 09 09 |.... *|*/./**..|
|00001250| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 20 20 20 |........|..... |
|00001260| 2a 2a 2f 0d 2f 2a 2a 20 | 69 66 20 28 20 4d 65 6d |**/./** |if ( Mem|
|00001270| 45 72 72 6f 72 28 29 20 | 29 09 09 09 09 09 09 09 |Error() |).......|
|00001280| 09 09 09 20 20 20 2a 2a | 2f 0d 2f 2a 2a 20 09 46 |... **|/./** .F|
|00001290| 61 69 6c 4f 53 45 72 72 | 28 20 46 69 6c 65 54 6f |ailOSErr|( FileTo|
|000012a0| 6f 42 69 67 20 29 09 09 | 09 09 09 09 09 09 20 20 |oBig )..|...... |
|000012b0| 20 2a 2a 2f 0d 2f 2a 2a | 09 09 09 09 09 09 09 09 | **/./**|........|
|000012c0| 09 09 09 09 09 09 09 20 | 20 20 2a 2a 2f 0d 2f 2a |....... | **/./*|
|000012d0| 2a 20 54 68 69 73 20 69 | 73 20 63 6c 65 61 72 6c |* This i|s clearl|
|000012e0| 79 20 6d 6f 72 65 20 73 | 70 65 63 69 66 69 63 20 |y more s|pecific |
|000012f0| 74 68 61 6e 20 63 61 6c | 6c 69 6e 67 3a 09 09 09 |than cal|ling:...|
|00001300| 09 20 20 20 2a 2a 2f 0d | 2f 2a 2a 09 09 09 09 09 |. **/.|/**.....|
|00001310| 09 09 09 09 09 09 09 09 | 09 09 20 20 20 2a 2a 2f |........|.. **/|
|00001320| 0d 2f 2a 2a 09 09 46 61 | 69 6c 4d 65 6d 45 72 72 |./**..Fa|ilMemErr|
|00001330| 6f 72 28 29 3b 09 09 09 | 09 09 09 09 09 09 09 20 |or();...|....... |
|00001340| 20 20 2a 2a 2f 0d 2f 2a | 2a 09 09 09 09 09 09 09 | **/./*|*.......|
|00001350| 09 09 09 09 09 09 09 09 | 20 20 20 2a 2a 2f 0d 2f |........| **/./|
|00001360| 2a 2a 20 4e 6f 74 20 6f | 6e 6c 79 20 64 6f 65 73 |** Not o|nly does|
|00001370| 20 74 68 69 73 20 69 73 | 6f 6c 61 74 65 20 74 68 | this is|olate th|
|00001380| 65 20 70 72 6f 62 6c 65 | 6d 20 66 6f 72 20 74 68 |e proble|m for th|
|00001390| 65 20 70 72 6f 67 72 61 | 6d 6d 65 72 2c 20 2a 2a |e progra|mmer, **|
|000013a0| 2f 0d 2f 2a 2a 20 62 75 | 74 20 69 74 20 61 6c 73 |/./** bu|t it als|
|000013b0| 6f 20 67 69 76 65 73 20 | 74 68 65 20 75 73 65 72 |o gives |the user|
|000013c0| 20 73 70 65 63 69 66 69 | 63 20 69 6e 66 6f 72 6d | specifi|c inform|
|000013d0| 61 74 69 6f 6e 20 72 61 | 74 68 65 72 09 20 20 20 |ation ra|ther. |
|000013e0| 2a 2a 2f 0d 2f 2a 2a 20 | 74 68 61 6e 20 74 68 65 |**/./** |than the|
|000013f0| 20 73 74 61 74 65 6d 65 | 6e 74 20 74 68 61 74 20 | stateme|nt that |
|00001400| 22 74 68 65 72 65 20 77 | 61 73 20 6e 6f 74 20 65 |"there w|as not e|
|00001410| 6e 6f 75 67 68 20 6d 65 | 6d 6f 72 79 22 2e 09 20 |nough me|mory".. |
|00001420| 20 20 2a 2a 2f 0d 2f 2a | 2a 09 09 09 09 09 09 09 | **/./*|*.......|
|00001430| 09 09 09 09 09 09 09 09 | 20 20 20 2a 2a 2f 0d 2f |........| **/./|
|00001440| 2a 2a 20 54 68 69 73 20 | 72 65 73 6f 75 72 63 65 |** This |resource|
|00001450| 20 69 73 20 69 6e 63 6c | 75 64 65 64 20 77 69 74 | is incl|uded wit|
|00001460| 68 69 6e 20 22 43 50 53 | 74 79 6c 65 54 65 78 74 |hin "CPS|tyleText|
|00001470| 2e 72 73 72 63 22 20 61 | 6e 64 09 20 20 20 2a 2a |.rsrc" a|nd. **|
|00001480| 2f 0d 2f 2a 2a 20 68 61 | 73 20 74 68 65 20 66 6f |/./** ha|s the fo|
|00001490| 6c 6c 6f 77 69 6e 67 20 | 22 54 48 49 4e 4b 20 52 |llowing |"THINK R|
|000014a0| 65 7a 22 20 73 6f 75 72 | 63 65 3a 09 09 09 09 09 |ez" sour|ce:.....|
|000014b0| 20 20 20 2a 2a 2f 0d 2f | 2a 2a 09 09 09 09 09 09 | **/./|**......|
|000014c0| 09 09 09 09 09 09 09 09 | 09 20 20 20 2a 2a 2f 0d |........|. **/.|
|000014d0| 2f 2a 2a 20 72 65 73 6f | 75 72 63 65 09 27 45 73 |/** reso|urce.'Es|
|000014e0| 74 72 27 09 28 2d 32 36 | 30 30 30 2c 20 22 54 65 |tr'.(-26|000, "Te|
|000014f0| 78 74 20 53 69 7a 65 20 | 45 72 72 6f 72 22 2c 20 |xt Size |Error", |
|00001500| 70 75 72 67 65 61 62 6c | 65 29 20 2a 2a 2f 0d 2f |purgeabl|e) **/./|
|00001510| 2a 2a 20 7b 09 09 09 09 | 09 09 09 09 09 09 09 09 |** {....|........|
|00001520| 09 09 20 20 20 2a 2a 2f | 0d 2f 2a 2a 09 09 22 74 |.. **/|./**.."t|
|00001530| 68 65 20 66 69 6c 65 20 | 69 73 20 74 6f 6f 20 62 |he file |is too b|
|00001540| 69 67 20 2d 2d 20 31 35 | 36 2c 30 30 30 20 62 79 |ig -- 15|6,000 by|
|00001550| 74 65 73 20 6d 61 78 69 | 6d 75 6d 22 09 09 20 20 |tes maxi|mum".. |
|00001560| 20 2a 2a 2f 0d 2f 2a 2a | 20 7d 09 09 09 09 09 09 | **/./**| }......|
|00001570| 09 09 09 09 09 09 09 09 | 20 20 20 2a 2a 2f 0d 0d |........| **/..|
|00001580| 65 6e 75 6d 0d 7b 0d 09 | 46 69 6c 65 54 6f 6f 42 |enum.{..|FileTooB|
|00001590| 69 67 20 3d 20 2d 32 36 | 30 30 30 0d 7d 3b 0d 0d |ig = -26|000.};..|
|000015a0| 0d 2f 2a 0d 09 49 6e 69 | 74 69 61 6c 69 7a 65 20 |./*..Ini|tialize |
|000015b0| 74 68 65 20 43 6c 61 73 | 73 20 56 61 72 69 61 62 |the Clas|s Variab|
|000015c0| 6c 65 73 3a 0d 09 0d 09 | 49 64 65 61 20 66 6f 72 |les:....|Idea for|
|000015d0| 20 63 75 72 73 6f 72 73 | 20 67 65 6e 65 72 61 74 | cursors| generat|
|000015e0| 65 64 20 62 79 20 6d 79 | 20 75 73 65 20 6f 66 0d |ed by my| use of.|
|000015f0| 09 53 79 6d 61 6e 74 65 | 63 27 73 20 22 54 48 49 |.Symante|c's "THI|
|00001600| 4e 4b 20 52 65 66 65 72 | 65 6e 63 65 22 20 61 70 |NK Refer|ence" ap|
|00001610| 70 6c 69 63 61 74 69 6f | 6e 2e 0d 2a 2f 0d 0d 43 |plicatio|n..*/..C|
|00001620| 75 72 73 48 61 6e 64 6c | 65 09 09 43 50 53 74 79 |ursHandl|e..CPSty|
|00001630| 6c 65 54 65 78 74 3a 3a | 63 41 75 74 6f 53 63 72 |leText::|cAutoScr|
|00001640| 6f 6c 6c 43 75 72 73 6f | 72 20 3d 20 4e 55 4c 4c |ollCurso|r = NULL|
|00001650| 3b 0d 43 43 72 73 72 48 | 61 6e 64 6c 65 09 09 43 |;.CCrsrH|andle..C|
|00001660| 50 53 74 79 6c 65 54 65 | 78 74 3a 3a 63 41 75 74 |PStyleTe|xt::cAut|
|00001670| 6f 53 63 72 6f 6c 6c 43 | 52 53 52 20 20 20 3d 20 |oScrollC|RSR = |
|00001680| 4e 55 4c 4c 3b 0d 42 6f | 6f 6c 65 61 6e 09 09 09 |NULL;.Bo|olean...|
|00001690| 43 50 53 74 79 6c 65 54 | 65 78 74 3a 3a 63 48 61 |CPStyleT|ext::cHa|
|000016a0| 73 54 72 75 65 54 79 70 | 65 09 20 20 20 3d 20 54 |sTrueTyp|e. = T|
|000016b0| 72 61 70 41 76 61 69 6c | 61 62 6c 65 28 20 30 78 |rapAvail|able( 0x|
|000016c0| 41 38 35 34 20 29 3b 0d | 0d 0d 0d 2f 2a 2a 2a 2a |A854 );.|.../****|
|000016d0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000016e0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000016f0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001700| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001710| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 0d 20 49 73 57 6f |********|**. IsWo|
|00001720| 72 64 42 72 65 61 6b 43 | 68 61 72 0d 0d 09 09 4d |rdBreakC|har....M|
|00001730| 65 74 68 6f 64 20 74 6f | 20 64 65 74 65 72 6d 69 |ethod to| determi|
|00001740| 6e 65 20 69 66 20 61 20 | 63 68 61 72 61 63 74 65 |ne if a |characte|
|00001750| 72 20 69 73 20 61 20 77 | 6f 72 64 2d 62 72 65 61 |r is a w|ord-brea|
|00001760| 6b 20 63 68 61 72 61 63 | 74 65 72 2e 0d 20 2a 2a |k charac|ter.. **|
|00001770| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001780| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00001790| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000017a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000017b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2f 0d 0d 09 |********|****/...|
|000017c0| 73 74 61 74 69 63 20 6c | 6f 6e 67 09 09 77 6f 72 |static l|ong..wor|
|000017d0| 64 42 72 65 61 6b 46 6c | 61 67 73 5b 38 5d 20 3d |dBreakFl|ags[8] =|
|000017e0| 0d 09 7b 0d 09 09 2f 2a | 0d 09 09 09 50 61 63 6b |..{.../*|....Pack|
|000017f0| 65 64 20 42 6f 6f 6c 65 | 61 6e 20 66 6c 61 67 73 |ed Boole|an flags|
|00001800| 20 66 72 6f 6d 20 43 68 | 72 69 73 27 20 57 6f 72 | from Ch|ris' Wor|
|00001810| 64 42 72 65 61 6b 48 6f | 6f 6b 20 6d 65 74 68 6f |dBreakHo|ok metho|
|00001820| 64 2e 0d 09 09 09 4e 6f | 74 65 20 74 68 61 74 20 |d.....No|te that |
|00001830| 69 66 20 61 20 63 68 61 | 72 61 63 74 65 72 20 69 |if a cha|racter i|
|00001840| 73 20 72 65 70 72 65 73 | 65 6e 74 65 64 20 68 65 |s repres|ented he|
|00001850| 72 65 2c 20 69 74 20 69 | 73 0d 09 09 09 4e 4f 54 |re, it i|s....NOT|
|00001860| 20 61 20 77 6f 72 64 2d | 62 72 65 61 6b 20 63 68 | a word-|break ch|
|00001870| 61 72 61 63 74 65 72 2e | 20 20 43 6f 6e 76 65 72 |aracter.| Conver|
|00001880| 73 65 6c 79 2c 20 69 66 | 20 61 20 63 68 61 72 61 |sely, if| a chara|
|00001890| 63 74 65 72 0d 09 09 09 | 69 73 20 4e 4f 54 20 68 |cter....|is NOT h|
|000018a0| 65 72 65 2c 20 69 74 20 | 49 53 20 61 20 77 6f 72 |ere, it |IS a wor|
|000018b0| 64 2d 62 72 65 61 6b 20 | 63 68 61 72 61 63 74 65 |d-break |characte|
|000018c0| 72 2e 0d 09 09 2a 2f 0d | 09 09 0d 09 09 30 78 30 |r....*/.|.....0x0|
|000018d0| 30 30 30 30 30 30 30 2c | 20 30 78 30 30 30 30 46 |0000000,| 0x0000F|
|000018e0| 46 43 30 2c 0d 09 09 30 | 78 37 46 46 46 46 46 45 |FC0,...0|x7FFFFFE|
|000018f0| 31 2c 20 30 78 37 46 46 | 46 46 46 45 30 2c 0d 09 |1, 0x7FF|FFFE0,..|
|00001900| 09 30 78 30 30 30 30 30 | 30 30 30 2c 20 30 78 30 |.0x00000|000, 0x0|
|00001910| 30 30 30 30 30 30 30 2c | 0d 09 09 30 78 30 30 30 |0000000,|...0x000|
|00001920| 30 30 30 30 30 2c 20 30 | 78 30 30 30 30 30 30 30 |00000, 0|x0000000|
|00001930| 30 0d 09 7d 3b 0d 09 0d | 09 0d 09 0d 09 73 74 61 |0..};...|.....sta|
|00001940| 74 69 63 20 42 6f 6f 6c | 65 61 6e 09 09 49 73 57 |tic Bool|ean..IsW|
|00001950| 6f 72 64 42 72 65 61 6b | 43 68 61 72 20 28 75 6e |ordBreak|Char (un|
|00001960| 73 69 67 6e 65 64 20 63 | 68 61 72 20 63 68 29 0d |signed c|har ch).|
|00001970| 09 7b 0d 09 09 2f 2a 0d | 09 09 09 4e 6f 74 65 20 |.{.../*.|...Note |
|00001980| 74 68 65 20 4e 4f 54 20 | 74 72 61 6e 73 70 6f 73 |the NOT |transpos|
|00001990| 69 74 69 6f 6e 2e 20 20 | 52 65 6d 65 6d 62 65 72 |ition. |Remember|
|000019a0| 2c 20 69 66 20 61 0d 09 | 09 09 63 68 61 72 61 63 |, if a..|..charac|
|000019b0| 74 65 72 20 69 73 20 4e | 4f 54 20 69 6e 20 74 68 |ter is N|OT in th|
|000019c0| 65 20 61 62 6f 76 65 20 | 70 61 63 6b 65 64 20 42 |e above |packed B|
|000019d0| 6f 6f 6c 65 61 6e 0d 09 | 09 09 61 72 72 61 79 2c |oolean..|..array,|
|000019e0| 20 69 74 20 49 53 20 61 | 20 77 6f 72 64 2d 62 72 | it IS a| word-br|
|000019f0| 65 61 6b 20 63 68 61 72 | 61 63 74 65 72 2e 0d 09 |eak char|acter...|
|00001a00| 09 2a 2f 0d 09 09 09 0d | 09 09 0d 09 09 72 65 74 |.*/.....|.....ret|
|00001a10| 75 72 6e 09 28 0d 09 09 | 09 09 20 20 21 28 0d 09 |urn.(...|.. !(..|
|00001a20| 09 09 09 09 20 20 28 28 | 6c 6f 6e 67 2a 29 20 77 |.... ((|long*) w|
|00001a30| 6f 72 64 42 72 65 61 6b | 46 6c 61 67 73 29 5b 63 |ordBreak|Flags)[c|
|00001a40| 68 20 3e 3e 20 35 5d 20 | 26 20 28 30 78 38 30 30 |h >> 5] |& (0x800|
|00001a50| 30 30 30 30 30 55 20 3e | 3e 20 28 63 68 20 26 20 |00000U >|> (ch & |
|00001a60| 30 78 31 46 29 29 0d 09 | 09 09 09 20 20 20 29 0d |0x1F))..|... ).|
|00001a70| 09 09 09 09 29 3b 0d 0d | 09 7d 09 2f 2a 20 49 73 |....);..|.}./* Is|
|00001a80| 57 6f 72 64 42 72 65 61 | 6b 43 68 61 72 20 2a 2f |WordBrea|kChar */|
|00001a90| 0d 0d 0d 0d 2f 2a 2a 2a | 2a 20 43 20 4f 20 4e 20 |..../***|* C O N |
|00001aa0| 53 20 54 20 52 20 55 20 | 43 20 54 20 49 20 4f 20 |S T R U |C T I O |
|00001ab0| 4e 20 2f 20 44 20 45 20 | 53 20 54 20 52 20 55 20 |N / D E |S T R U |
|00001ac0| 43 20 54 20 49 20 4f 20 | 4e 20 20 20 4d 20 45 20 |C T I O |N M E |
|00001ad0| 54 20 48 20 4f 20 44 20 | 53 20 2a 2a 2a 2a 2f 0d |T H O D |S ****/.|
|00001ae0| 0d 0d 76 6f 69 64 09 43 | 50 53 74 79 6c 65 54 65 |..void.C|PStyleTe|
|00001af0| 78 74 3a 3a 49 50 53 74 | 79 6c 65 54 65 78 74 20 |xt::IPSt|yleText |
|00001b00| 28 43 56 69 65 77 20 2a | 61 6e 45 6e 63 6c 6f 73 |(CView *|anEnclos|
|00001b10| 75 72 65 2c 20 43 42 75 | 72 65 61 75 63 72 61 74 |ure, CBu|reaucrat|
|00001b20| 20 2a 61 53 75 70 65 72 | 76 69 73 6f 72 2c 0d 09 | *aSuper|visor,..|
|00001b30| 09 09 09 09 09 09 09 20 | 20 73 68 6f 72 74 20 61 |....... | short a|
|00001b40| 57 69 64 74 68 2c 20 73 | 68 6f 72 74 20 61 48 65 |Width, s|hort aHe|
|00001b50| 69 67 68 74 2c 0d 09 09 | 09 09 09 09 09 09 20 20 |ight,...|...... |
|00001b60| 73 68 6f 72 74 20 61 48 | 45 6e 63 6c 2c 20 73 68 |short aH|Encl, sh|
|00001b70| 6f 72 74 20 61 56 45 6e | 63 6c 2c 0d 09 09 09 09 |ort aVEn|cl,.....|
|00001b80| 09 09 09 09 20 20 53 69 | 7a 69 6e 67 4f 70 74 69 |.... Si|zingOpti|
|00001b90| 6f 6e 20 61 48 53 69 7a | 69 6e 67 2c 20 53 69 7a |on aHSiz|ing, Siz|
|00001ba0| 69 6e 67 4f 70 74 69 6f | 6e 20 61 56 53 69 7a 69 |ingOptio|n aVSizi|
|00001bb0| 6e 67 2c 0d 09 09 09 09 | 09 09 09 09 20 20 73 68 |ng,.....|.... sh|
|00001bc0| 6f 72 74 20 61 4c 69 6e | 65 57 69 64 74 68 29 0d |ort aLin|eWidth).|
|00001bd0| 7b 0d 0d 09 43 50 45 64 | 69 74 54 65 78 74 3a 3a |{...CPEd|itText::|
|00001be0| 49 50 45 64 69 74 54 65 | 78 74 28 20 61 6e 45 6e |IPEditTe|xt( anEn|
|00001bf0| 63 6c 6f 73 75 72 65 2c | 20 61 53 75 70 65 72 76 |closure,| aSuperv|
|00001c00| 69 73 6f 72 2c 0d 09 09 | 09 09 09 09 09 61 57 69 |isor,...|.....aWi|
|00001c10| 64 74 68 2c 20 61 48 65 | 69 67 68 74 2c 20 61 48 |dth, aHe|ight, aH|
|00001c20| 45 6e 63 6c 2c 20 61 56 | 45 6e 63 6c 2c 0d 09 09 |Encl, aV|Encl,...|
|00001c30| 09 09 09 09 09 61 48 53 | 69 7a 69 6e 67 2c 20 61 |.....aHS|izing, a|
|00001c40| 56 53 69 7a 69 6e 67 20 | 29 3b 0d 0d 09 2f 2a 0d |VSizing |);.../*.|
|00001c50| 09 09 55 6e 66 6f 72 74 | 75 6e 61 74 65 6c 79 2c |..Unfort|unately,|
|00001c60| 20 49 50 45 64 69 74 54 | 65 78 74 20 64 6f 65 73 | IPEditT|ext does|
|00001c70| 20 6e 6f 74 20 61 63 63 | 65 70 74 20 61 20 70 61 | not acc|ept a pa|
|00001c80| 73 73 65 64 0d 09 09 6c | 69 6e 65 20 77 69 64 74 |ssed...l|ine widt|
|00001c90| 68 20 61 73 20 49 41 62 | 73 74 72 61 63 74 54 65 |h as IAb|stractTe|
|00001ca0| 78 74 20 64 6f 65 73 20 | 2e 2e 2e 20 61 20 73 68 |xt does |... a sh|
|00001cb0| 61 6d 65 20 62 65 63 61 | 75 73 65 0d 09 09 43 41 |ame beca|use...CA|
|00001cc0| 62 73 74 72 61 63 74 54 | 65 78 74 20 69 73 20 43 |bstractT|ext is C|
|00001cd0| 50 45 64 69 74 54 65 78 | 74 27 73 20 73 75 70 65 |PEditTex|t's supe|
|00001ce0| 72 63 6c 61 73 73 20 2e | 2e 2e 20 62 75 74 0d 09 |rclass .|.. but..|
|00001cf0| 09 74 68 69 73 20 49 53 | 20 63 6f 6e 73 69 73 74 |.this IS| consist|
|00001d00| 65 6e 74 20 77 69 74 68 | 20 76 65 72 73 69 6f 6e |ent with| version|
|00001d10| 20 31 2e 32 20 6f 66 20 | 43 68 72 69 73 27 0d 09 | 1.2 of |Chris'..|
|00001d20| 09 43 50 45 64 69 74 54 | 65 78 74 20 77 68 69 63 |.CPEditT|ext whic|
|00001d30| 68 20 64 6f 65 73 20 4e | 4f 54 20 73 75 70 70 6f |h does N|OT suppo|
|00001d40| 72 74 20 77 6f 72 64 2d | 77 72 61 70 70 69 6e 67 |rt word-|wrapping|
|00001d50| 2e 0d 09 09 53 6f 20 43 | 68 72 69 73 20 6a 75 73 |....So C|hris jus|
|00001d60| 74 20 70 61 73 73 65 73 | 3a 0d 09 09 0d 09 09 09 |t passes|:.......|
|00001d70| 61 4c 69 6e 65 57 69 64 | 74 68 20 3d 20 6b 44 65 |aLineWid|th = kDe|
|00001d80| 66 61 75 6c 74 42 6f 75 | 6e 64 73 57 69 64 74 68 |faultBou|ndsWidth|
|00001d90| 0d 09 09 09 0d 09 09 74 | 6f 20 49 41 62 73 74 72 |.......t|o IAbstr|
|00001da0| 61 63 74 54 65 78 74 20 | 77 69 74 68 69 6e 20 68 |actText |within h|
|00001db0| 69 73 20 49 50 45 64 69 | 74 54 65 78 74 20 6d 65 |is IPEdi|tText me|
|00001dc0| 74 68 6f 64 2e 0d 09 09 | 0d 09 09 4f 66 20 63 6f |thod....|...Of co|
|00001dd0| 75 72 73 65 2c 20 69 66 | 20 61 6c 6c 20 74 68 69 |urse, if| all thi|
|00001de0| 73 20 77 65 72 65 20 66 | 61 6c 73 65 2c 20 74 68 |s were f|alse, th|
|00001df0| 65 6e 20 74 68 65 0d 09 | 09 66 6f 6c 6c 6f 77 69 |en the..|.followi|
|00001e00| 6e 67 20 73 74 61 74 65 | 6d 65 6e 74 20 77 6f 75 |ng state|ment wou|
|00001e10| 6c 64 20 4e 4f 54 20 62 | 65 20 72 65 71 75 69 72 |ld NOT b|e requir|
|00001e20| 65 64 0d 09 09 62 65 63 | 61 75 73 65 20 49 41 62 |ed...bec|ause IAb|
|00001e30| 73 74 72 61 63 74 54 65 | 78 74 20 77 6f 75 6c 64 |stractTe|xt would|
|00001e40| 20 64 6f 20 69 74 20 66 | 6f 72 20 75 73 2e 0d 09 | do it f|or us...|
|00001e50| 2a 2f 0d 09 6c 69 6e 65 | 57 69 64 74 68 20 3d 20 |*/..line|Width = |
|00001e60| 61 4c 69 6e 65 57 69 64 | 74 68 3b 0d 0d 09 49 50 |aLineWid|th;...IP|
|00001e70| 53 74 79 6c 65 54 65 78 | 74 58 28 29 3b 0d 09 09 |StyleTex|tX();...|
|00001e80| 09 09 09 09 09 09 09 09 | 09 09 0d 7d 09 2f 2a 20 |........|...}./* |
|00001e90| 49 50 53 74 79 6c 65 54 | 65 78 74 20 2a 2f 0d 0d |IPStyleT|ext */..|
|00001ea0| 0d 0d 2f 2a 20 4f 56 45 | 52 52 49 44 45 3a 20 2a |../* OVE|RRIDE: *|
|00001eb0| 2f 0d 76 6f 69 64 09 43 | 50 53 74 79 6c 65 54 65 |/.void.C|PStyleTe|
|00001ec0| 78 74 3a 3a 49 56 69 65 | 77 54 65 6d 70 20 28 43 |xt::IVie|wTemp (C|
|00001ed0| 56 69 65 77 20 2a 61 6e | 45 6e 63 6c 6f 73 75 72 |View *an|Enclosur|
|00001ee0| 65 2c 20 43 42 75 72 65 | 61 75 63 72 61 74 20 2a |e, CBure|aucrat *|
|00001ef0| 61 53 75 70 65 72 76 69 | 73 6f 72 2c 0d 09 09 09 |aSupervi|sor,....|
|00001f00| 09 09 09 09 09 50 74 72 | 20 76 69 65 77 44 61 74 |.....Ptr| viewDat|
|00001f10| 61 29 0d 7b 0d 0d 09 43 | 50 45 64 69 74 54 65 78 |a).{...C|PEditTex|
|00001f20| 74 3a 3a 49 56 69 65 77 | 54 65 6d 70 28 20 61 6e |t::IView|Temp( an|
|00001f30| 45 6e 63 6c 6f 73 75 72 | 65 2c 20 61 53 75 70 65 |Enclosur|e, aSupe|
|00001f40| 72 76 69 73 6f 72 2c 20 | 76 69 65 77 44 61 74 61 |rvisor, |viewData|
|00001f50| 20 29 3b 0d 09 0d 20 2f | 2a 0d 09 49 56 69 65 77 | );... /|*..IView|
|00001f60| 54 65 6d 70 20 72 65 61 | 64 73 20 74 68 65 20 6c |Temp rea|ds the l|
|00001f70| 69 6e 65 20 77 69 64 74 | 68 0d 09 66 72 6f 6d 20 |ine widt|h..from |
|00001f80| 74 68 65 20 76 69 65 77 | 44 61 74 61 20 74 65 6d |the view|Data tem|
|00001f90| 70 6c 61 74 65 3a 0d 09 | 0d 09 6c 69 6e 65 57 69 |plate:..|..lineWi|
|00001fa0| 64 74 68 20 3d 20 61 4c | 69 6e 65 57 69 64 74 68 |dth = aL|ineWidth|
|00001fb0| 3b 0d 20 2a 2f 0d 0d 09 | 49 50 53 74 79 6c 65 54 |;. */...|IPStyleT|
|00001fc0| 65 78 74 58 28 29 3b 0d | 09 09 09 09 09 09 09 09 |extX();.|........|
|00001fd0| 09 09 09 09 0d 7d 09 2f | 2a 20 49 56 69 65 77 54 |.....}./|* IViewT|
|00001fe0| 65 6d 70 20 2a 2f 0d 0d | 0d 0d 76 6f 69 64 09 43 |emp */..|..void.C|
|00001ff0| 50 53 74 79 6c 65 54 65 | 78 74 3a 3a 49 50 53 74 |PStyleTe|xt::IPSt|
|00002000| 79 6c 65 54 65 78 74 58 | 20 28 76 6f 69 64 29 0d |yleTextX| (void).|
|00002010| 7b 0d 09 09 4c 6f 6e 67 | 52 65 63 74 09 74 68 65 |{...Long|Rect.the|
|00002020| 49 6e 74 65 72 69 6f 72 | 3b 0d 09 09 43 57 69 6e |Interior|;...CWin|
|00002030| 64 6f 77 09 09 2a 74 68 | 65 57 69 6e 64 6f 77 3b |dow..*th|eWindow;|
|00002040| 0d 09 09 42 6f 6f 6c 65 | 61 6e 09 09 73 61 76 65 |...Boole|an..save|
|00002050| 64 41 6c 6c 6f 63 3b 0d | 09 09 43 41 72 72 61 79 |dAlloc;.|..CArray|
|00002060| 09 09 2a 74 68 65 4c 69 | 6e 65 73 20 3d 20 4e 55 |..*theLi|nes = NU|
|00002070| 4c 4c 3b 0d 09 09 0d 09 | 0d 20 2f 2a 20 43 50 45 |LL;.....|. /* CPE|
|00002080| 64 69 74 54 65 78 74 3a | 3a 49 50 45 64 69 74 54 |ditText:|:IPEditT|
|00002090| 65 78 74 58 28 29 3b 20 | 20 2d 2d 20 20 61 6c 72 |extX(); | -- alr|
|000020a0| 65 61 64 79 20 63 61 6c | 6c 65 64 20 62 79 20 49 |eady cal|led by I|
|000020b0| 50 45 64 69 74 54 65 78 | 74 20 6f 72 20 62 79 20 |PEditTex|t or by |
|000020c0| 49 56 69 65 77 54 65 6d | 70 2e 20 2a 2f 0d 20 0d |IViewTem|p. */. .|
|000020d0| 09 61 75 74 6f 52 65 66 | 72 65 73 68 20 3d 20 66 |.autoRef|resh = f|
|000020e0| 57 6f 72 64 57 72 61 70 | 20 3d 20 6c 69 6e 65 57 |WordWrap| = lineW|
|000020f0| 69 64 74 68 20 3c 3d 20 | 30 3b 09 2f 2a 20 45 78 |idth <= |0;./* Ex|
|00002100| 61 6d 69 6e 65 20 49 45 | 64 69 74 54 65 78 74 58 |amine IE|ditTextX|
|00002110| 20 2e 2e 2e 09 09 20 20 | 2a 2f 0d 09 09 09 09 09 | ..... |*/......|
|00002120| 09 09 09 09 09 09 09 2f | 2a 20 43 68 61 6e 67 65 |......./|* Change|
|00002130| 64 20 6c 61 74 65 72 20 | 62 79 20 53 65 74 57 6f |d later |by SetWo|
|00002140| 72 64 57 72 61 70 2e 20 | 20 2a 2f 0d 09 09 09 09 |rdWrap. | */.....|
|00002150| 09 09 09 09 09 09 09 09 | 0d 20 2f 2a 20 43 68 61 |........|. /* Cha|
|00002160| 6e 67 65 20 43 41 62 73 | 74 72 61 63 74 54 65 78 |nge CAbs|tractTex|
|00002170| 74 27 73 20 69 6e 73 74 | 61 6e 63 65 20 76 61 72 |t's inst|ance var|
|00002180| 69 61 62 6c 65 3a 20 2a | 2f 0d 20 0d 09 66 69 78 |iable: *|/. ..fix|
|00002190| 65 64 4c 69 6e 65 48 65 | 69 67 68 74 73 20 3d 20 |edLineHe|ights = |
|000021a0| 46 41 4c 53 45 3b 0d 09 | 2f 2a 0d 09 09 42 65 63 |FALSE;..|/*...Bec|
|000021b0| 61 75 73 65 20 77 65 20 | 63 68 61 6e 67 65 20 66 |ause we |change f|
|000021c0| 69 78 65 64 4c 69 6e 65 | 48 65 69 67 68 74 73 2c |ixedLine|Heights,|
|000021d0| 20 77 65 20 6e 65 65 64 | 20 74 6f 20 72 65 2d 63 | we need| to re-c|
|000021e0| 61 6c 6c 0d 09 09 53 65 | 74 57 68 6f 6c 65 4c 69 |all...Se|tWholeLi|
|000021f0| 6e 65 73 20 77 68 6f 73 | 65 20 72 65 73 70 6f 6e |nes whos|e respon|
|00002200| 73 65 20 69 73 20 61 20 | 66 75 6e 63 74 69 6f 6e |se is a |function|
|00002210| 20 6f 66 20 66 69 78 65 | 64 4c 69 6e 65 48 65 69 | of fixe|dLineHei|
|00002220| 67 68 74 73 3a 0d 09 2a | 2f 0d 20 2f 2a 20 77 68 |ghts:..*|/. /* wh|
|00002230| 6f 6c 65 4c 69 6e 65 73 | 20 3d 20 54 52 55 45 3b |oleLines| = TRUE;|
|00002240| 09 09 09 2d 2d 20 20 73 | 65 74 20 62 79 20 49 50 |...-- s|et by IP|
|00002250| 45 64 69 74 54 65 78 74 | 58 2e 09 09 09 09 09 09 |EditText|X.......|
|00002260| 09 20 20 2a 2f 0d 09 53 | 65 74 57 68 6f 6c 65 4c |. */..S|etWholeL|
|00002270| 69 6e 65 73 28 20 77 68 | 6f 6c 65 4c 69 6e 65 73 |ines( wh|oleLines|
|00002280| 20 29 3b 0d 09 0d 20 2f | 2a 20 43 68 61 6e 67 65 | );... /|* Change|
|00002290| 20 61 20 63 6f 75 70 6c | 65 20 6f 66 20 43 68 72 | a coupl|e of Chr|
|000022a0| 69 73 27 20 69 6e 73 74 | 61 6e 63 65 20 76 61 72 |is' inst|ance var|
|000022b0| 69 61 62 6c 65 73 3a 20 | 2a 2f 0d 20 0d 09 66 4f |iables: |*/. ..fO|
|000022c0| 75 74 6c 69 6e 65 48 69 | 6c 69 74 65 20 3d 20 54 |utlineHi|lite = T|
|000022d0| 52 55 45 3b 0d 09 66 55 | 73 65 49 74 61 6c 69 63 |RUE;..fU|seItalic|
|000022e0| 43 61 72 65 74 20 3d 20 | 54 52 55 45 3b 0d 09 20 |Caret = |TRUE;.. |
|000022f0| 0d 20 2f 2a 20 49 6e 69 | 74 69 61 6c 69 7a 65 20 |. /* Ini|tialize |
|00002300| 6d 79 20 61 64 64 65 64 | 20 69 6e 73 74 61 6e 63 |my added| instanc|
|00002310| 65 20 76 61 72 69 61 62 | 6c 65 73 3a 20 2a 2f 0d |e variab|les: */.|
|00002320| 0d 09 69 74 73 41 6c 69 | 67 6e 43 6d 64 20 3d 20 |..itsAli|gnCmd = |
|00002330| 63 6d 64 41 6c 69 67 6e | 4c 65 66 74 3b 0d 09 69 |cmdAlign|Left;..i|
|00002340| 74 73 4c 65 66 74 4d 61 | 72 67 69 6e 20 3d 20 30 |tsLeftMa|rgin = 0|
|00002350| 4c 3b 0d 09 69 74 73 52 | 69 67 68 74 4d 61 72 67 |L;..itsR|ightMarg|
|00002360| 69 6e 20 3d 20 4d 41 58 | 49 4e 54 3b 0d 09 69 74 |in = MAX|INT;..it|
|00002370| 73 56 69 65 77 52 65 63 | 74 20 3d 20 61 70 65 72 |sViewRec|t = aper|
|00002380| 74 75 72 65 3b 0d 09 47 | 65 74 49 6e 74 65 72 69 |ture;..G|etInteri|
|00002390| 6f 72 28 20 26 74 68 65 | 49 6e 74 65 72 69 6f 72 |or( &the|Interior|
|000023a0| 20 29 3b 0d 09 69 74 73 | 44 65 73 74 52 65 63 74 | );..its|DestRect|
|000023b0| 20 3d 20 74 68 65 49 6e | 74 65 72 69 6f 72 3b 0d | = theIn|terior;.|
|000023c0| 09 69 74 73 44 65 73 74 | 52 65 63 74 2e 62 6f 74 |.itsDest|Rect.bot|
|000023d0| 74 6f 6d 20 3d 20 28 6c | 6f 6e 67 29 20 4d 41 58 |tom = (l|ong) MAX|
|000023e0| 49 4e 54 3b 09 09 09 2f | 2a 20 57 69 6c 6c 20 4e |INT;.../|* Will N|
|000023f0| 45 56 45 52 20 63 68 61 | 6e 67 65 20 2d 2d 09 09 |EVER cha|nge --..|
|00002400| 09 20 20 2a 2f 0d 09 09 | 09 09 09 09 09 09 09 09 |. */...|........|
|00002410| 09 09 2f 2a 20 4f 4e 4c | 59 20 74 68 65 20 62 6f |../* ONL|Y the bo|
|00002420| 75 6e 64 73 20 77 69 6c | 6c 09 09 09 20 20 2a 2f |unds wil|l... */|
|00002430| 0d 09 66 4f 6c 64 45 6e | 64 57 72 61 70 4c 69 6e |..fOldEn|dWrapLin|
|00002440| 65 43 61 72 65 74 20 3d | 20 46 41 4c 53 45 3b 0d |eCaret =| FALSE;.|
|00002450| 09 66 4e 65 77 45 6e 64 | 57 72 61 70 4c 69 6e 65 |.fNewEnd|WrapLine|
|00002460| 43 61 72 65 74 20 3d 20 | 46 41 4c 53 45 3b 0d 09 |Caret = |FALSE;..|
|00002470| 2f 2a 0d 09 09 54 68 65 | 20 70 61 72 65 6e 74 20 |/*...The| parent |
|00002480| 43 50 61 6e 65 20 6f 66 | 20 6d 79 20 43 50 53 74 |CPane of| my CPSt|
|00002490| 79 6c 65 54 65 78 74 20 | 6d 61 79 0d 09 09 73 69 |yleText |may...si|
|000024a0| 6d 70 6c 79 20 73 63 72 | 6f 6c 6c 20 74 6f 20 68 |mply scr|oll to h|
|000024b0| 6f 6d 65 20 76 69 61 3a | 0d 09 09 0d 09 09 09 47 |ome via:|.......G|
|000024c0| 65 74 48 6f 6d 65 50 6f | 73 69 74 69 6f 6e 28 20 |etHomePo|sition( |
|000024d0| 26 68 6f 6d 65 50 6f 73 | 20 29 3b 0d 09 09 09 53 |&homePos| );....S|
|000024e0| 63 72 6f 6c 6c 54 6f 28 | 20 26 68 6f 6d 65 50 6f |crollTo(| &homePo|
|000024f0| 73 2c 20 54 52 55 45 20 | 29 3b 0d 09 09 0d 09 09 |s, TRUE |);......|
|00002500| 72 61 74 68 65 72 20 74 | 68 61 6e 20 63 61 6c 6c |rather t|han call|
|00002510| 3a 0d 09 09 09 0d 09 09 | 09 53 65 74 53 65 6c 65 |:.......|.SetSele|
|00002520| 63 74 69 6f 6e 20 28 30 | 4c 2c 20 30 4c 2c 20 54 |ction (0|L, 0L, T|
|00002530| 52 55 45 29 3b 0d 09 09 | 09 53 63 72 6f 6c 6c 54 |RUE);...|.ScrollT|
|00002540| 6f 53 65 6c 65 63 74 69 | 6f 6e 28 29 3b 0d 09 09 |oSelecti|on();...|
|00002550| 09 0d 09 09 53 65 74 53 | 65 6c 65 63 74 69 6f 6e |....SetS|election|
|00002560| 20 69 73 20 77 68 65 72 | 65 20 49 20 73 65 74 20 | is wher|e I set |
|00002570| 6d 79 20 63 61 72 65 74 | 0d 09 09 66 6c 61 67 20 |my caret|...flag |
|00002580| 3d 20 66 45 6e 64 57 72 | 61 70 4c 69 6e 65 2e 20 |= fEndWr|apLine. |
|00002590| 20 54 68 65 72 65 66 6f | 72 65 2c 20 49 0d 09 09 | Therefo|re, I...|
|000025a0| 62 65 74 74 65 72 20 74 | 75 72 6e 20 69 74 20 6f |better t|urn it o|
|000025b0| 66 66 20 68 65 72 65 20 | 69 6e 20 63 61 73 65 0d |ff here |in case.|
|000025c0| 09 09 53 65 74 53 65 6c | 65 63 74 69 6f 6e 20 69 |..SetSel|ection i|
|000025d0| 73 20 4e 4f 54 20 63 61 | 6c 6c 65 64 20 61 73 20 |s NOT ca|lled as |
|000025e0| 49 20 68 61 76 65 0d 09 | 09 6a 75 73 74 20 64 65 |I have..|.just de|
|000025f0| 73 63 72 69 62 65 64 2e | 0d 09 2a 2f 0d 09 66 45 |scribed.|..*/..fE|
|00002600| 6e 64 57 72 61 70 4c 69 | 6e 65 20 3d 20 46 41 4c |ndWrapLi|ne = FAL|
|00002610| 53 45 3b 0d 09 0d 09 2f | 2a 0d 09 09 57 6f 72 64 |SE;..../|*...Word|
|00002620| 2d 77 72 61 70 20 62 65 | 63 6f 6d 65 73 20 61 20 |-wrap be|comes a |
|00002630| 76 65 72 79 20 73 6c 6f | 77 20 70 72 6f 63 65 73 |very slo|w proces|
|00002640| 73 20 66 6f 72 20 6c 6f | 6e 67 20 64 6f 63 73 0d |s for lo|ng docs.|
|00002650| 09 09 69 66 20 74 68 65 | 20 77 72 61 70 20 77 69 |..if the| wrap wi|
|00002660| 64 74 68 20 62 65 63 6f | 6d 65 73 20 74 6f 6f 20 |dth beco|mes too |
|00002670| 6e 61 72 72 6f 77 2e 20 | 20 54 68 65 72 65 66 6f |narrow. | Therefo|
|00002680| 72 65 2c 0d 09 09 6f 76 | 65 72 72 69 64 65 20 74 |re,...ov|erride t|
|00002690| 68 65 20 54 43 4c 27 73 | 20 64 65 66 61 75 6c 74 |he TCL's| default|
|000026a0| 20 76 61 6c 75 65 20 6f | 66 20 31 30 30 20 70 69 | value o|f 100 pi|
|000026b0| 78 65 6c 73 3a 0d 09 2a | 2f 0d 09 0d 09 74 68 65 |xels:..*|/....the|
|000026c0| 57 69 6e 64 6f 77 20 3d | 20 47 65 74 57 69 6e 64 |Window =| GetWind|
|000026d0| 6f 77 28 29 3b 0d 09 74 | 68 65 57 69 6e 64 6f 77 |ow();..t|heWindow|
|000026e0| 2d 3e 73 69 7a 65 52 65 | 63 74 2e 6c 65 66 74 20 |->sizeRe|ct.left |
|000026f0| 3d 20 4d 61 78 28 20 74 | 68 65 57 69 6e 64 6f 77 |= Max( t|heWindow|
|00002700| 2d 3e 73 69 7a 65 52 65 | 63 74 2e 6c 65 66 74 20 |->sizeRe|ct.left |
|00002710| 2b 20 28 73 68 6f 72 74 | 29 69 74 73 4c 65 66 74 |+ (short|)itsLeft|
|00002720| 4d 61 72 67 69 6e 2c 0d | 09 09 09 09 09 09 09 09 |Margin,.|........|
|00002730| 09 4d 49 4e 5f 57 49 4e | 44 4f 57 5f 57 49 44 54 |.MIN_WIN|DOW_WIDT|
|00002740| 48 20 29 3b 0d 0d 09 2f | 2a 20 54 68 65 20 42 49 |H );.../|* The BI|
|00002750| 47 47 45 45 20 21 21 21 | 20 2a 2f 0d 09 0d 09 74 |GGEE !!!| */....t|
|00002760| 68 65 4c 69 6e 65 73 20 | 3d 20 6e 65 77 20 28 43 |heLines |= new (C|
|00002770| 41 72 72 61 79 29 3b 0d | 09 74 68 65 4c 69 6e 65 |Array);.|.theLine|
|00002780| 73 2d 3e 49 41 72 72 61 | 79 28 20 73 69 7a 65 6f |s->IArra|y( sizeo|
|00002790| 66 28 4c 69 6e 65 52 65 | 63 6f 72 64 29 20 29 3b |f(LineRe|cord) );|
|000027a0| 0d 09 69 74 73 4c 69 6e | 65 49 6e 66 6f 20 3d 20 |..itsLin|eInfo = |
|000027b0| 74 68 65 4c 69 6e 65 73 | 3b 0d 09 41 64 64 4c 69 |theLines|;..AddLi|
|000027c0| 6e 65 28 20 61 74 45 6e | 64 20 29 3b 0d 09 0d 09 |ne( atEn|d );....|
|000027d0| 2f 2a 20 56 61 72 69 6f | 75 73 20 43 6c 61 73 73 |/* Vario|us Class|
|000027e0| 20 56 61 72 69 61 62 6c | 65 73 20 2e 2e 2e 20 2a | Variabl|es ... *|
|000027f0| 2f 0d 09 0d 09 69 66 20 | 28 21 67 53 79 73 74 65 |/....if |(!gSyste|
|00002800| 6d 2e 68 61 73 43 6f 6c | 6f 72 51 44 29 0d 09 7b |m.hasCol|orQD)..{|
|00002810| 0d 09 09 69 66 20 28 63 | 41 75 74 6f 53 63 72 6f |...if (c|AutoScro|
|00002820| 6c 6c 43 75 72 73 6f 72 | 20 3d 3d 20 4e 55 4c 4c |llCursor| == NULL|
|00002830| 29 0d 09 09 7b 0d 09 09 | 09 73 61 76 65 64 41 6c |)...{...|.savedAl|
|00002840| 6c 6f 63 20 3d 20 53 65 | 74 41 6c 6c 6f 63 61 74 |loc = Se|tAllocat|
|00002850| 69 6f 6e 28 20 6b 41 6c | 6c 6f 63 43 61 6e 46 61 |ion( kAl|locCanFa|
|00002860| 69 6c 20 29 3b 0d 09 09 | 09 63 41 75 74 6f 53 63 |il );...|.cAutoSc|
|00002870| 72 6f 6c 6c 43 75 72 73 | 6f 72 20 3d 20 47 65 74 |rollCurs|or = Get|
|00002880| 43 75 72 73 6f 72 28 20 | 72 41 75 74 6f 53 63 72 |Cursor( |rAutoScr|
|00002890| 6f 6c 6c 43 75 72 73 6f | 72 20 29 3b 0d 09 09 09 |ollCurso|r );....|
|000028a0| 53 65 74 41 6c 6c 6f 63 | 61 74 69 6f 6e 28 20 73 |SetAlloc|ation( s|
|000028b0| 61 76 65 64 41 6c 6c 6f | 63 20 29 3b 0d 09 09 09 |avedAllo|c );....|
|000028c0| 46 61 69 6c 4e 49 4c 52 | 65 73 28 20 63 41 75 74 |FailNILR|es( cAut|
|000028d0| 6f 53 63 72 6f 6c 6c 43 | 75 72 73 6f 72 20 29 3b |oScrollC|ursor );|
|000028e0| 0d 09 09 09 48 4e 6f 50 | 75 72 67 65 28 20 28 48 |....HNoP|urge( (H|
|000028f0| 61 6e 64 6c 65 29 63 41 | 75 74 6f 53 63 72 6f 6c |andle)cA|utoScrol|
|00002900| 6c 43 75 72 73 6f 72 20 | 29 3b 0d 09 09 09 3b 0d |lCursor |);....;.|
|00002910| 09 09 09 63 41 75 74 6f | 53 63 72 6f 6c 6c 43 52 |...cAuto|ScrollCR|
|00002920| 53 52 20 3d 20 4e 55 4c | 4c 3b 0d 09 09 09 0d 09 |SR = NUL|L;......|
|00002930| 09 7d 09 2f 2a 20 4e 4f | 54 20 70 72 65 76 69 6f |.}./* NO|T previo|
|00002940| 75 73 6c 79 20 69 6e 69 | 74 69 61 6c 69 7a 65 64 |usly ini|tialized|
|00002950| 20 2a 2f 0d 09 09 0d 09 | 7d 09 2f 2a 20 22 59 75 | */.....|}./* "Yu|
|00002960| 63 6b 79 22 20 62 6c 61 | 63 6b 2d 61 6e 64 2d 77 |cky" bla|ck-and-w|
|00002970| 68 69 74 65 20 2a 2f 0d | 09 0d 09 65 6c 73 65 0d |hite */.|...else.|
|00002980| 09 7b 0d 09 09 69 66 20 | 28 63 41 75 74 6f 53 63 |.{...if |(cAutoSc|
|00002990| 72 6f 6c 6c 43 52 53 52 | 20 3d 3d 20 4e 55 4c 4c |rollCRSR| == NULL|
|000029a0| 29 0d 09 09 7b 0d 09 09 | 09 73 61 76 65 64 41 6c |)...{...|.savedAl|
|000029b0| 6c 6f 63 20 3d 20 53 65 | 74 41 6c 6c 6f 63 61 74 |loc = Se|tAllocat|
|000029c0| 69 6f 6e 28 20 6b 41 6c | 6c 6f 63 43 61 6e 46 61 |ion( kAl|locCanFa|
|000029d0| 69 6c 20 29 3b 0d 09 09 | 09 63 41 75 74 6f 53 63 |il );...|.cAutoSc|
|000029e0| 72 6f 6c 6c 43 52 53 52 | 20 3d 20 47 65 74 43 43 |rollCRSR| = GetCC|
|000029f0| 75 72 73 6f 72 28 20 72 | 41 75 74 6f 53 63 72 6f |ursor( r|AutoScro|
|00002a00| 6c 6c 43 75 72 73 6f 72 | 20 29 3b 0d 09 09 09 53 |llCursor| );....S|
|00002a10| 65 74 41 6c 6c 6f 63 61 | 74 69 6f 6e 28 20 73 61 |etAlloca|tion( sa|
|00002a20| 76 65 64 41 6c 6c 6f 63 | 20 29 3b 0d 09 09 09 46 |vedAlloc| );....F|
|00002a30| 61 69 6c 4e 49 4c 52 65 | 73 28 20 63 41 75 74 6f |ailNILRe|s( cAuto|
|00002a40| 53 63 72 6f 6c 6c 43 52 | 53 52 20 29 3b 0d 09 09 |ScrollCR|SR );...|
|00002a50| 09 48 50 75 72 67 65 28 | 20 28 48 61 6e 64 6c 65 |.HPurge(| (Handle|
|00002a60| 29 63 41 75 74 6f 53 63 | 72 6f 6c 6c 43 52 53 52 |)cAutoSc|rollCRSR|
|00002a70| 20 29 3b 09 09 09 2f 2a | 20 53 65 65 20 49 4d 20 | );.../*| See IM |
|00002a80| 35 2e 20 2a 2f 0d 09 09 | 09 3b 0d 09 09 09 63 41 |5. */...|.;....cA|
|00002a90| 75 74 6f 53 63 72 6f 6c | 6c 43 75 72 73 6f 72 20 |utoScrol|lCursor |
|00002aa0| 3d 20 4e 55 4c 4c 3b 0d | 09 09 09 0d 09 09 7d 09 |= NULL;.|......}.|
|00002ab0| 2f 2a 20 4e 4f 54 20 70 | 72 65 76 69 6f 75 73 6c |/* NOT p|reviousl|
|00002ac0| 79 20 69 6e 69 74 69 61 | 6c 69 7a 65 64 20 2a 2f |y initia|lized */|
|00002ad0| 0d 09 09 0d 09 7d 09 2f | 2a 20 63 6f 6c 6f 72 20 |.....}./|* color |
|00002ae0| 51 75 69 63 6b 64 72 61 | 77 20 2a 2f 0d 09 09 0d |Quickdra|w */....|
|00002af0| 7d 09 2f 2a 20 49 50 53 | 74 79 6c 65 54 65 78 74 |}./* IPS|tyleText|
|00002b00| 58 20 2a 2f 0d 0d 0d 0d | 2f 2a 20 4f 56 45 52 52 |X */....|/* OVERR|
|00002b10| 49 44 45 3a 20 2a 2f 0d | 76 6f 69 64 09 43 50 53 |IDE: */.|void.CPS|
|00002b20| 74 79 6c 65 54 65 78 74 | 3a 3a 44 69 73 70 6f 73 |tyleText|::Dispos|
|00002b30| 65 20 28 76 6f 69 64 29 | 0d 7b 0d 09 09 72 65 67 |e (void)|.{...reg|
|00002b40| 69 73 74 65 72 20 6c 6f | 6e 67 09 6c 69 6e 65 2c |ister lo|ng.line,|
|00002b50| 20 6e 75 6d 4c 69 6e 65 | 73 3b 0d 09 09 4c 69 6e | numLine|s;...Lin|
|00002b60| 65 52 65 63 6f 72 64 09 | 09 6c 69 6e 65 49 6e 66 |eRecord.|.lineInf|
|00002b70| 6f 3b 0d 09 09 0d 09 09 | 0d 09 2f 2a 0d 09 09 4e |o;......|../*...N|
|00002b80| 65 65 64 20 74 6f 20 64 | 75 6d 70 20 65 61 63 68 |eed to d|ump each|
|00002b90| 20 6c 69 6e 65 27 73 20 | 63 6f 6d 70 6f 6e 65 6e | line's |componen|
|00002ba0| 74 20 53 74 79 6c 65 52 | 65 63 6f 72 64 0d 09 09 |t StyleR|ecord...|
|00002bb0| 43 41 72 72 61 79 20 62 | 65 66 6f 72 65 20 77 65 |CArray b|efore we|
|00002bc0| 20 64 69 73 70 6f 73 65 | 20 6f 66 20 74 68 65 20 | dispose| of the |
|00002bd0| 6d 61 73 74 65 72 20 4c | 69 6e 65 52 65 63 6f 72 |master L|ineRecor|
|00002be0| 64 3a 0d 09 2a 2f 0d 09 | 0d 09 6e 75 6d 4c 69 6e |d:..*/..|..numLin|
|00002bf0| 65 73 20 3d 20 69 74 73 | 4c 69 6e 65 49 6e 66 6f |es = its|LineInfo|
|00002c00| 2d 3e 47 65 74 4e 75 6d | 49 74 65 6d 73 28 29 3b |->GetNum|Items();|
|00002c10| 0d 09 3b 0d 09 66 6f 72 | 20 28 6c 69 6e 65 20 3d |..;..for| (line =|
|00002c20| 20 31 3b 20 6c 69 6e 65 | 20 3c 3d 20 6e 75 6d 4c | 1; line| <= numL|
|00002c30| 69 6e 65 73 3b 20 2b 2b | 6c 69 6e 65 29 0d 09 7b |ines; ++|line)..{|
|00002c40| 0d 09 09 69 74 73 4c 69 | 6e 65 49 6e 66 6f 2d 3e |...itsLi|neInfo->|
|00002c50| 47 65 74 49 74 65 6d 28 | 20 26 6c 69 6e 65 49 6e |GetItem(| &lineIn|
|00002c60| 66 6f 2c 20 6c 69 6e 65 | 20 29 3b 09 09 2f 2a 20 |fo, line| );../* |
|00002c70| 31 2d 62 61 73 65 64 20 | 2a 2f 0d 09 09 46 6f 72 |1-based |*/...For|
|00002c80| 67 65 74 4f 62 6a 65 63 | 74 28 20 6c 69 6e 65 49 |getObjec|t( lineI|
|00002c90| 6e 66 6f 2e 6c 53 74 79 | 6c 65 73 20 29 3b 0d 09 |nfo.lSty|les );..|
|00002ca0| 7d 0d 09 3b 0d 09 46 6f | 72 67 65 74 4f 62 6a 65 |}..;..Fo|rgetObje|
|00002cb0| 63 74 28 20 69 74 73 4c | 69 6e 65 49 6e 66 6f 20 |ct( itsL|ineInfo |
|00002cc0| 29 3b 0d 09 0d 09 43 50 | 45 64 69 74 54 65 78 74 |);....CP|EditText|
|00002cd0| 3a 3a 44 69 73 70 6f 73 | 65 28 29 3b 0d 09 0d 7d |::Dispos|e();...}|
|00002ce0| 09 2f 2a 20 44 69 73 70 | 6f 73 65 20 2a 2f 0d 0d |./* Disp|ose */..|
|00002cf0| 0d 0d 2f 2a 2a 2a 2a 20 | 44 20 49 20 53 20 50 20 |../**** |D I S P |
|00002d00| 4c 20 41 20 59 20 20 20 | 4d 20 45 20 54 20 48 20 |L A Y |M E T H |
|00002d10| 4f 20 44 20 53 20 2a 2a | 2a 2a 2f 0d 0d 0d 2f 2a |O D S **|**/.../*|
|00002d20| 20 4f 56 45 52 52 49 44 | 45 3a 20 2a 2f 0d 76 6f | OVERRID|E: */.vo|
|00002d30| 69 64 09 43 50 53 74 79 | 6c 65 54 65 78 74 3a 3a |id.CPSty|leText::|
|00002d40| 44 72 61 77 20 28 52 65 | 63 74 20 2a 61 72 65 61 |Draw (Re|ct *area|
|00002d50| 29 0d 7b 0d 09 09 4c 6f | 6e 67 52 65 63 74 09 09 |).{...Lo|ngRect..|
|00002d60| 6c 6f 6e 67 41 72 65 61 | 3b 0d 09 09 72 65 67 69 |longArea|;...regi|
|00002d70| 73 74 65 72 20 6c 6f 6e | 67 09 6e 75 6d 4c 69 6e |ster lon|g.numLin|
|00002d80| 65 73 20 20 3d 20 69 74 | 73 4e 75 6d 4c 69 6e 65 |es = it|sNumLine|
|00002d90| 73 3b 0d 09 09 72 65 67 | 69 73 74 65 72 20 6c 6f |s;...reg|ister lo|
|00002da0| 6e 67 09 73 74 61 72 74 | 50 6f 69 6e 74 48 74 2c |ng.start|PointHt,|
|00002db0| 20 65 6e 64 50 6f 69 6e | 74 48 74 3b 0d 09 09 72 | endPoin|tHt;...r|
|00002dc0| 65 67 69 73 74 65 72 20 | 6c 6f 6e 67 09 63 75 6d |egister |long.cum|
|00002dd0| 4c 69 6e 65 48 74 3b 0d | 09 09 72 65 67 69 73 74 |LineHt;.|..regist|
|00002de0| 65 72 20 6c 6f 6e 67 09 | 73 74 61 72 74 4c 69 6e |er long.|startLin|
|00002df0| 65 2c 20 65 6e 64 4c 69 | 6e 65 2c 0d 09 09 09 09 |e, endLi|ne,.....|
|00002e00| 09 09 76 65 72 74 49 6e | 73 65 74 20 3d 20 56 65 |..vertIn|set = Ve|
|00002e10| 72 74 54 6f 70 49 6e 73 | 65 74 28 29 3b 0d 09 0d |rtTopIns|et();...|
|00002e20| 09 0d 09 09 2f 2a 0d 09 | 09 09 43 6f 6d 70 75 74 |..../*..|..Comput|
|00002e30| 65 20 61 6e 64 20 64 72 | 61 77 20 74 68 65 20 76 |e and dr|aw the v|
|00002e40| 69 73 69 62 6c 65 20 74 | 65 78 74 20 6c 69 6e 65 |isible t|ext line|
|00002e50| 73 2e 20 20 41 64 64 65 | 64 0d 09 09 09 66 6f 72 |s. Adde|d....for|
|00002e60| 2d 6c 6f 6f 70 73 20 66 | 6f 72 20 65 76 65 6e 74 |-loops f|or event|
|00002e70| 75 61 6c 20 69 6e 63 6f | 72 70 6f 72 61 74 69 6f |ual inco|rporatio|
|00002e80| 6e 20 6f 66 20 73 74 79 | 6c 65 64 0d 09 09 09 74 |n of sty|led....t|
|00002e90| 65 78 74 20 77 68 65 72 | 65 69 6e 20 65 61 63 68 |ext wher|ein each|
|00002ea0| 20 6c 69 6e 65 20 63 61 | 6e 20 68 61 76 65 20 61 | line ca|n have a|
|00002eb0| 20 75 6e 69 71 75 65 20 | 68 65 69 67 68 74 2e 0d | unique |height..|
|00002ec0| 09 09 2a 2f 0d 09 0d 09 | 51 44 54 6f 46 72 61 6d |..*/....|QDToFram|
|00002ed0| 65 52 28 20 61 72 65 61 | 2c 20 26 6c 6f 6e 67 41 |eR( area|, &longA|
|00002ee0| 72 65 61 20 29 3b 0d 09 | 3b 0d 09 63 75 6d 4c 69 |rea );..|;..cumLi|
|00002ef0| 6e 65 48 74 20 3d 20 30 | 3b 0d 09 73 74 61 72 74 |neHt = 0|;..start|
|00002f00| 50 6f 69 6e 74 48 74 20 | 3d 20 6c 6f 6e 67 41 72 |PointHt |= longAr|
|00002f10| 65 61 2e 74 6f 70 20 2d | 20 76 65 72 74 49 6e 73 |ea.top -| vertIns|
|00002f20| 65 74 3b 0d 09 66 6f 72 | 20 28 73 74 61 72 74 4c |et;..for| (startL|
|00002f30| 69 6e 65 20 3d 20 30 3b | 20 73 74 61 72 74 4c 69 |ine = 0;| startLi|
|00002f40| 6e 65 20 3c 20 6e 75 6d | 4c 69 6e 65 73 3b 20 73 |ne < num|Lines; s|
|00002f50| 74 61 72 74 4c 69 6e 65 | 2b 2b 29 0d 09 7b 0d 09 |tartLine|++)..{..|
|00002f60| 20 2f 2a 0d 09 09 42 65 | 63 61 75 73 65 20 74 68 | /*...Be|cause th|
|00002f70| 69 73 20 66 6f 72 2d 6c | 6f 6f 70 20 63 6f 6e 73 |is for-l|oop cons|
|00002f80| 75 6d 65 73 20 61 20 6c | 6f 74 20 6f 66 20 74 69 |umes a l|ot of ti|
|00002f90| 6d 65 2c 0d 09 09 65 76 | 65 72 79 20 74 69 6d 65 |me,...ev|ery time|
|00002fa0| 2d 73 61 76 69 6e 67 73 | 20 68 65 6c 70 73 2e 20 |-savings| helps. |
|00002fb0| 20 43 61 6c 6c 69 6e 67 | 20 47 65 74 31 48 65 69 | Calling| Get1Hei|
|00002fc0| 67 68 74 0d 09 09 6a 75 | 73 74 20 63 61 6c 6c 73 |ght...ju|st calls|
|00002fd0| 20 47 65 74 48 65 69 67 | 68 74 20 77 69 74 68 20 | GetHeig|ht with |
|00002fe0| 69 64 65 6e 74 69 63 61 | 6c 20 6c 69 6e 65 73 3a |identica|l lines:|
|00002ff0| 0d 0d 09 09 63 75 6d 4c | 69 6e 65 48 74 20 2b 3d |....cumL|ineHt +=|
|00003000| 20 47 65 74 31 48 65 69 | 67 68 74 28 20 73 74 61 | Get1Hei|ght( sta|
|00003010| 72 74 4c 69 6e 65 20 29 | 3b 0d 09 20 2a 2f 0d 09 |rtLine )|;.. */..|
|00003020| 09 0d 09 09 63 75 6d 4c | 69 6e 65 48 74 20 2b 3d |....cumL|ineHt +=|
|00003030| 20 47 65 74 48 65 69 67 | 68 74 28 20 73 74 61 72 | GetHeig|ht( star|
|00003040| 74 4c 69 6e 65 2c 20 73 | 74 61 72 74 4c 69 6e 65 |tLine, s|tartLine|
|00003050| 20 29 3b 0d 09 09 69 66 | 20 28 63 75 6d 4c 69 6e | );...if| (cumLin|
|00003060| 65 48 74 20 3e 20 73 74 | 61 72 74 50 6f 69 6e 74 |eHt > st|artPoint|
|00003070| 48 74 29 0d 09 09 09 62 | 72 65 61 6b 3b 0d 09 7d |Ht)....b|reak;..}|
|00003080| 0d 09 73 74 61 72 74 4c | 69 6e 65 20 3d 20 4d 69 |..startL|ine = Mi|
|00003090| 6e 28 20 73 74 61 72 74 | 4c 69 6e 65 2c 20 6e 75 |n( start|Line, nu|
|000030a0| 6d 4c 69 6e 65 73 20 2d | 20 31 20 29 3b 0d 09 3b |mLines -| 1 );..;|
|000030b0| 0d 20 2f 2a 20 63 75 6d | 4c 69 6e 65 48 74 20 3d |. /* cum|LineHt =|
|000030c0| 20 30 3b 20 20 2d 2d 20 | 20 73 74 61 72 74 20 77 | 0; -- | start w|
|000030d0| 68 65 72 65 20 79 6f 75 | 20 6c 65 66 74 20 6f 66 |here you| left of|
|000030e0| 66 20 2a 2f 0d 09 65 6e | 64 50 6f 69 6e 74 48 74 |f */..en|dPointHt|
|000030f0| 20 3d 20 6c 6f 6e 67 41 | 72 65 61 2e 62 6f 74 74 | = longA|rea.bott|
|00003100| 6f 6d 20 2d 20 76 65 72 | 74 49 6e 73 65 74 3b 0d |om - ver|tInset;.|
|00003110| 09 66 6f 72 20 28 65 6e | 64 4c 69 6e 65 20 3d 20 |.for (en|dLine = |
|00003120| 73 74 61 72 74 4c 69 6e | 65 20 2b 20 31 3b 20 65 |startLin|e + 1; e|
|00003130| 6e 64 4c 69 6e 65 20 3c | 20 6e 75 6d 4c 69 6e 65 |ndLine <| numLine|
|00003140| 73 3b 20 65 6e 64 4c 69 | 6e 65 2b 2b 29 0d 09 7b |s; endLi|ne++)..{|
|00003150| 0d 09 09 2f 2a 0d 09 09 | 09 63 75 6d 4c 69 6e 65 |.../*...|.cumLine|
|00003160| 48 74 20 61 62 6f 76 65 | 20 69 6e 63 6c 75 64 65 |Ht above| include|
|00003170| 73 20 74 68 65 20 6c 69 | 6e 65 0d 09 09 09 68 65 |s the li|ne....he|
|00003180| 69 67 68 74 20 6f 66 20 | 73 74 61 72 74 4c 69 6e |ight of |startLin|
|00003190| 65 2c 20 73 6f 20 73 74 | 61 72 74 20 74 68 69 73 |e, so st|art this|
|000031a0| 0d 09 09 09 32 6e 64 20 | 66 6f 72 2d 6c 6f 6f 70 |....2nd |for-loop|
|000031b0| 20 61 74 20 73 74 61 72 | 74 4c 69 6e 65 20 2b 20 | at star|tLine + |
|000031c0| 31 2e 0d 09 09 2a 2f 0d | 09 09 0d 09 09 63 75 6d |1....*/.|.....cum|
|000031d0| 4c 69 6e 65 48 74 20 2b | 3d 20 47 65 74 48 65 69 |LineHt +|= GetHei|
|000031e0| 67 68 74 28 20 65 6e 64 | 4c 69 6e 65 2c 20 65 6e |ght( end|Line, en|
|000031f0| 64 4c 69 6e 65 20 29 3b | 0d 09 09 69 66 20 28 63 |dLine );|...if (c|
|00003200| 75 6d 4c 69 6e 65 48 74 | 20 3e 3d 20 65 6e 64 50 |umLineHt| >= endP|
|00003210| 6f 69 6e 74 48 74 29 0d | 09 09 09 62 72 65 61 6b |ointHt).|...break|
|00003220| 3b 0d 09 7d 0d 09 65 6e | 64 4c 69 6e 65 20 3d 20 |;..}..en|dLine = |
|00003230| 4d 69 6e 28 20 65 6e 64 | 4c 69 6e 65 2c 20 6e 75 |Min( end|Line, nu|
|00003240| 6d 4c 69 6e 65 73 20 2d | 20 31 20 29 3b 0d 09 0d |mLines -| 1 );...|
|00003250| 09 44 72 61 77 4c 69 6e | 65 52 61 6e 67 65 28 20 |.DrawLin|eRange( |
|00003260| 73 74 61 72 74 4c 69 6e | 65 2c 20 65 6e 64 4c 69 |startLin|e, endLi|
|00003270| 6e 65 2c 20 30 2c 20 6b | 44 6f 6e 74 45 72 61 73 |ne, 0, k|DontEras|
|00003280| 65 54 65 78 74 20 29 3b | 0d 09 0d 09 09 2f 2a 0d |eText );|...../*.|
|00003290| 09 09 09 49 66 20 70 72 | 69 6e 74 69 6e 67 20 69 |...If pr|inting i|
|000032a0| 73 20 6e 6f 74 20 69 6e | 20 70 72 6f 67 72 65 73 |s not in| progres|
|000032b0| 73 2c 20 68 69 67 68 6c | 69 67 68 74 20 74 68 65 |s, highl|ight the|
|000032c0| 20 63 75 72 72 65 6e 74 | 0d 09 09 09 73 65 6c 65 | current|....sele|
|000032d0| 63 74 69 6f 6e 20 6f 72 | 20 64 72 61 77 20 74 68 |ction or| draw th|
|000032e0| 65 20 69 6e 73 65 72 74 | 69 6f 6e 20 63 61 72 65 |e insert|ion care|
|000032f0| 74 2c 20 61 73 20 61 70 | 70 72 6f 70 72 69 61 74 |t, as ap|propriat|
|00003300| 65 0d 09 09 2a 2f 0d 09 | 69 66 20 28 0d 09 09 20 |e...*/..|if (... |
|00003310| 21 74 68 69 73 2d 3e 70 | 72 69 6e 74 69 6e 67 09 |!this->p|rinting.|
|00003320| 09 09 09 09 09 26 26 0d | 09 09 20 74 68 69 73 2d |.....&&.|.. this-|
|00003330| 3e 77 61 6e 74 73 43 6c | 69 63 6b 73 09 09 09 09 |>wantsCl|icks....|
|00003340| 09 09 26 26 0d 09 09 20 | 28 66 52 65 61 6c 6c 79 |..&&... |(fReally|
|00003350| 41 63 74 69 76 65 20 7c | 7c 20 66 4f 75 74 6c 69 |Active ||| fOutli|
|00003360| 6e 65 48 69 6c 69 74 65 | 29 0d 09 20 20 20 29 0d |neHilite|).. ).|
|00003370| 09 7b 0d 09 09 69 66 20 | 28 69 74 73 53 65 6c 53 |.{...if |(itsSelS|
|00003380| 74 61 72 74 20 21 3d 20 | 69 74 73 53 65 6c 45 6e |tart != |itsSelEn|
|00003390| 64 29 0d 09 09 09 48 69 | 6c 69 74 65 54 65 78 74 |d)....Hi|liteText|
|000033a0| 52 61 6e 67 65 28 20 69 | 74 73 53 65 6c 53 74 61 |Range( i|tsSelSta|
|000033b0| 72 74 2c 20 69 74 73 53 | 65 6c 45 6e 64 20 29 3b |rt, itsS|elEnd );|
|000033c0| 0d 09 09 65 6c 73 65 20 | 69 66 20 28 66 43 61 72 |...else |if (fCar|
|000033d0| 65 74 56 69 73 69 62 6c | 65 29 0d 09 09 09 44 72 |etVisibl|e)....Dr|
|000033e0| 61 77 43 61 72 65 74 28 | 29 3b 0d 09 7d 0d 09 0d |awCaret(|);..}...|
|000033f0| 7d 09 2f 2a 20 44 72 61 | 77 20 2a 2f 0d 0d 0d 0d |}./* Dra|w */....|
|00003400| 2f 2a 20 4f 56 45 52 52 | 49 44 45 3a 20 2a 2f 0d |/* OVERR|IDE: */.|
|00003410| 76 6f 69 64 09 43 50 53 | 74 79 6c 65 54 65 78 74 |void.CPS|tyleText|
|00003420| 3a 3a 53 65 74 53 65 6c | 65 63 74 69 6f 6e 20 28 |::SetSel|ection (|
|00003430| 6c 6f 6e 67 20 73 65 6c | 53 74 61 72 74 2c 20 6c |long sel|Start, l|
|00003440| 6f 6e 67 20 73 65 6c 45 | 6e 64 2c 20 42 6f 6f 6c |ong selE|nd, Bool|
|00003450| 65 61 6e 20 66 52 65 64 | 72 61 77 29 0d 7b 0d 09 |ean fRed|raw).{..|
|00003460| 2f 2a 0d 09 09 4f 76 65 | 72 72 69 64 64 65 6e 20 |/*...Ove|rridden |
|00003470| 66 6f 72 20 73 70 65 63 | 69 61 6c 20 63 61 72 65 |for spec|ial care|
|00003480| 74 20 70 6c 61 63 65 6d | 65 6e 74 20 61 74 20 74 |t placem|ent at t|
|00003490| 68 65 20 65 6e 64 0d 09 | 09 6f 66 20 61 20 22 73 |he end..|.of a "s|
|000034a0| 75 62 2d 6c 69 6e 65 22 | 20 6f 66 20 61 20 6c 6f |ub-line"| of a lo|
|000034b0| 6e 67 65 72 20 77 6f 72 | 64 2d 77 72 61 70 70 65 |nger wor|d-wrappe|
|000034c0| 64 20 6c 69 6e 65 3a 0d | 09 2a 2f 0d 09 0d 09 09 |d line:.|.*/.....|
|000034d0| 65 6e 75 6d 0d 09 09 7b | 0d 09 09 09 2f 2a 0d 09 |enum...{|..../*..|
|000034e0| 09 09 09 54 68 65 73 65 | 20 64 75 64 65 73 20 61 |...These| dudes a|
|000034f0| 72 65 20 69 6e 20 43 68 | 72 69 73 27 20 22 43 50 |re in Ch|ris' "CP|
|00003500| 45 64 69 74 54 65 78 74 | 2e 63 22 0d 09 09 09 09 |EditText|.c".....|
|00003510| 61 6e 64 20 73 6f 20 6d | 75 73 74 20 62 65 20 72 |and so m|ust be r|
|00003520| 65 70 65 61 74 65 64 20 | 68 65 72 65 3a 0d 09 09 |epeated |here:...|
|00003530| 09 2a 2f 0d 09 09 09 0d | 09 09 09 6b 55 6e 68 69 |.*/.....|...kUnhi|
|00003540| 64 65 53 65 6c 65 63 74 | 69 6f 6e 20 3d 20 46 41 |deSelect|ion = FA|
|00003550| 4c 53 45 2c 0d 09 09 09 | 6b 48 69 64 65 53 65 6c |LSE,....|kHideSel|
|00003560| 65 63 74 69 6f 6e 09 20 | 3d 20 54 52 55 45 0d 09 |ection. |= TRUE..|
|00003570| 09 7d 3b 0d 0d 09 0d 09 | 73 65 6c 53 74 61 72 74 |.};.....|selStart|
|00003580| 20 3d 20 4d 61 78 28 20 | 73 65 6c 53 74 61 72 74 | = Max( |selStart|
|00003590| 2c 20 30 20 29 3b 09 09 | 09 09 2f 2a 20 45 6e 73 |, 0 );..|../* Ens|
|000035a0| 75 72 65 20 70 6f 73 69 | 74 69 6f 6e 73 20 61 72 |ure posi|tions ar|
|000035b0| 65 20 76 61 6c 69 64 20 | 2e 2e 2e 20 20 2a 2f 0d |e valid |... */.|
|000035c0| 09 73 65 6c 53 74 61 72 | 74 20 3d 20 4d 69 6e 28 |.selStar|t = Min(|
|000035d0| 20 73 65 6c 53 74 61 72 | 74 2c 20 69 74 73 54 65 | selStar|t, itsTe|
|000035e0| 78 74 4c 65 6e 67 74 68 | 20 29 3b 0d 09 73 65 6c |xtLength| );..sel|
|000035f0| 45 6e 64 20 3d 20 4d 61 | 78 28 20 73 65 6c 45 6e |End = Ma|x( selEn|
|00003600| 64 2c 20 30 20 29 3b 0d | 09 73 65 6c 45 6e 64 20 |d, 0 );.|.selEnd |
|00003610| 3d 20 4d 69 6e 28 20 73 | 65 6c 45 6e 64 2c 20 69 |= Min( s|elEnd, i|
|00003620| 74 73 54 65 78 74 4c 65 | 6e 67 74 68 20 29 3b 0d |tsTextLe|ngth );.|
|00003630| 09 73 65 6c 45 6e 64 20 | 3d 20 4d 61 78 28 20 73 |.selEnd |= Max( s|
|00003640| 65 6c 45 6e 64 2c 20 73 | 65 6c 53 74 61 72 74 20 |elEnd, s|elStart |
|00003650| 29 3b 0d 09 09 09 0d 09 | 2f 2a 0d 09 09 55 6e 6c |);......|/*...Unl|
|00003660| 69 6b 65 20 43 68 72 69 | 73 2c 20 49 20 64 6f 20 |ike Chri|s, I do |
|00003670| 4e 4f 54 20 74 61 6b 65 | 20 61 20 71 75 69 63 6b |NOT take| a quick|
|00003680| 20 65 78 69 74 20 69 66 | 20 74 68 65 0d 09 09 73 | exit if| the...s|
|00003690| 65 6c 65 63 74 69 6f 6e | 20 72 61 6e 67 65 20 68 |election| range h|
|000036a0| 61 73 20 73 74 61 79 65 | 64 20 74 68 65 20 73 61 |as staye|d the sa|
|000036b0| 6d 65 2e 20 20 54 68 65 | 20 72 65 61 73 6f 6e 0d |me. The| reason.|
|000036c0| 09 09 69 73 20 74 68 61 | 74 20 74 68 65 20 73 65 |..is tha|t the se|
|000036d0| 6c 65 63 74 69 6f 6e 20 | 61 74 20 74 68 65 20 65 |lection |at the e|
|000036e0| 6e 64 20 6f 66 20 61 20 | 22 73 75 62 2d 6c 69 6e |nd of a |"sub-lin|
|000036f0| 65 22 0d 09 09 6f 66 20 | 61 20 6c 6f 6e 67 65 72 |e"...of |a longer|
|00003700| 20 77 6f 72 64 2d 77 72 | 61 70 70 65 64 20 6c 69 | word-wr|apped li|
|00003710| 6e 65 20 69 73 20 61 63 | 74 75 61 6c 6c 79 20 74 |ne is ac|tually t|
|00003720| 68 65 0d 09 09 62 65 67 | 69 6e 6e 69 6e 67 20 6f |he...beg|inning o|
|00003730| 66 20 74 68 65 20 6e 65 | 78 74 20 22 73 75 62 2d |f the ne|xt "sub-|
|00003740| 6c 69 6e 65 22 2e 0d 09 | 09 0d 09 09 49 20 75 73 |line"...|....I us|
|00003750| 65 20 74 68 69 73 20 6f | 76 65 72 72 69 64 64 65 |e this o|verridde|
|00003760| 6e 20 53 65 74 53 65 6c | 65 63 74 69 6f 6e 20 66 |n SetSel|ection f|
|00003770| 6f 72 20 73 70 65 63 69 | 61 6c 0d 09 09 63 61 72 |or speci|al...car|
|00003780| 65 74 20 70 6c 61 63 65 | 6d 65 6e 74 2e 20 20 43 |et place|ment. C|
|00003790| 6c 69 63 6b 69 6e 67 20 | 61 74 20 74 68 65 20 65 |licking |at the e|
|000037a0| 6e 64 20 6f 66 20 61 0d | 09 09 22 73 75 62 2d 6c |nd of a.|.."sub-l|
|000037b0| 69 6e 65 22 20 64 65 6d | 61 6e 64 73 20 64 69 66 |ine" dem|ands dif|
|000037c0| 66 65 72 65 6e 74 20 63 | 61 72 65 74 20 70 6c 61 |ferent c|aret pla|
|000037d0| 63 65 6d 65 6e 74 0d 09 | 09 74 68 61 6e 20 63 6c |cement..|.than cl|
|000037e0| 69 63 6b 69 6e 67 20 61 | 74 20 74 68 65 20 66 61 |icking a|t the fa|
|000037f0| 72 20 6c 65 66 74 20 6f | 66 20 74 68 65 20 6e 65 |r left o|f the ne|
|00003800| 78 74 0d 09 09 22 73 75 | 62 2d 6c 69 6e 65 22 2c |xt..."su|b-line",|
|00003810| 20 65 76 65 6e 20 74 68 | 6f 60 20 74 68 65 20 73 | even th|o` the s|
|00003820| 65 6c 65 63 74 69 6f 6e | 20 69 73 20 69 64 65 6e |election| is iden|
|00003830| 74 69 63 61 6c 2e 0d 09 | 2a 2f 0d 09 0d 09 09 2f |tical...|*/...../|
|00003840| 2a 20 55 6e 68 69 6c 69 | 74 65 20 74 68 65 20 6f |* Unhili|te the o|
|00003850| 6c 64 20 73 65 6c 65 63 | 74 69 6f 6e 20 72 61 6e |ld selec|tion ran|
|00003860| 67 65 3a 20 2a 2f 0d 09 | 09 0d 09 66 45 6e 64 57 |ge: */..|...fEndW|
|00003870| 72 61 70 4c 69 6e 65 20 | 3d 20 66 4f 6c 64 45 6e |rapLine |= fOldEn|
|00003880| 64 57 72 61 70 4c 69 6e | 65 43 61 72 65 74 3b 0d |dWrapLin|eCaret;.|
|00003890| 09 48 69 64 65 53 65 6c | 65 63 74 69 6f 6e 28 20 |.HideSel|ection( |
|000038a0| 6b 48 69 64 65 53 65 6c | 65 63 74 69 6f 6e 2c 20 |kHideSel|ection, |
|000038b0| 66 52 65 64 72 61 77 20 | 29 3b 0d 09 09 2f 2a 0d |fRedraw |);.../*.|
|000038c0| 09 09 09 4f 6e 63 65 20 | 79 6f 75 27 76 65 20 65 |...Once |you've e|
|000038d0| 72 61 73 65 64 20 74 68 | 65 20 6f 6c 64 20 63 61 |rased th|e old ca|
|000038e0| 72 65 74 2c 20 79 6f 75 | 27 72 65 20 64 6f 6e 65 |ret, you|'re done|
|000038f0| 20 77 69 74 68 0d 09 09 | 09 69 74 20 75 6e 74 69 | with...|.it unti|
|00003900| 6c 20 79 6f 75 20 63 6c | 69 63 6b 20 73 6f 6d 65 |l you cl|ick some|
|00003910| 77 68 65 72 65 20 65 6c | 73 65 20 6f 72 20 70 72 |where el|se or pr|
|00003920| 65 73 73 20 61 20 6b 65 | 79 3a 0d 09 09 2a 2f 0d |ess a ke|y:...*/.|
|00003930| 09 66 4f 6c 64 45 6e 64 | 57 72 61 70 4c 69 6e 65 |.fOldEnd|WrapLine|
|00003940| 43 61 72 65 74 20 3d 20 | 46 41 4c 53 45 3b 0d 09 |Caret = |FALSE;..|
|00003950| 09 09 0d 09 69 74 73 53 | 65 6c 53 74 61 72 74 20 |....itsS|elStart |
|00003960| 3d 20 73 65 6c 53 74 61 | 72 74 3b 09 09 09 09 09 |= selSta|rt;.....|
|00003970| 2f 2a 20 55 70 64 61 74 | 65 20 6f 75 72 20 69 6e |/* Updat|e our in|
|00003980| 73 74 61 6e 63 65 20 76 | 61 72 69 61 62 6c 65 73 |stance v|ariables|
|00003990| 20 2e 2e 2e 20 20 20 2a | 2f 0d 09 69 74 73 53 65 | ... *|/..itsSe|
|000039a0| 6c 45 6e 64 20 3d 20 73 | 65 6c 45 6e 64 3b 0d 09 |lEnd = s|elEnd;..|
|000039b0| 66 55 70 44 6f 77 6e 41 | 72 72 6f 77 20 3d 20 46 |fUpDownA|rrow = F|
|000039c0| 41 4c 53 45 3b 0d 09 0d | 09 09 2f 2a 20 45 6e 73 |ALSE;...|../* Ens|
|000039d0| 75 72 65 20 74 68 61 74 | 20 74 68 65 20 61 6e 63 |ure that| the anc|
|000039e0| 68 6f 72 20 70 6f 69 6e | 74 20 69 73 20 6f 6e 65 |hor poin|t is one|
|000039f0| 20 6f 66 20 74 68 65 20 | 73 65 6c 65 63 74 69 6f | of the |selectio|
|00003a00| 6e 20 65 6e 64 70 6f 69 | 6e 74 73 3a 20 2a 2f 0d |n endpoi|nts: */.|
|00003a10| 09 09 0d 09 69 66 20 28 | 20 28 69 74 73 53 65 6c |....if (| (itsSel|
|00003a20| 41 6e 63 68 6f 72 20 21 | 3d 20 73 65 6c 53 74 61 |Anchor !|= selSta|
|00003a30| 72 74 29 20 26 26 20 28 | 69 74 73 53 65 6c 41 6e |rt) && (|itsSelAn|
|00003a40| 63 68 6f 72 20 21 3d 20 | 73 65 6c 45 6e 64 29 20 |chor != |selEnd) |
|00003a50| 29 0d 09 09 69 74 73 53 | 65 6c 41 6e 63 68 6f 72 |)...itsS|elAnchor|
|00003a60| 20 3d 20 73 65 6c 53 74 | 61 72 74 3b 0d 09 09 0d | = selSt|art;....|
|00003a70| 09 09 2f 2a 20 48 69 6c | 69 74 65 20 74 68 65 20 |../* Hil|ite the |
|00003a80| 6e 65 77 20 73 65 6c 65 | 63 74 69 6f 6e 20 72 61 |new sele|ction ra|
|00003a90| 6e 67 65 3a 20 2a 2f 0d | 09 09 0d 09 69 66 20 28 |nge: */.|....if (|
|00003aa0| 20 65 64 69 74 61 62 6c | 65 20 7c 7c 20 28 73 65 | editabl|e || (se|
|00003ab0| 6c 53 74 61 72 74 20 21 | 3d 20 73 65 6c 45 6e 64 |lStart !|= selEnd|
|00003ac0| 29 20 29 0d 09 7b 0d 09 | 09 66 45 6e 64 57 72 61 |) )..{..|.fEndWra|
|00003ad0| 70 4c 69 6e 65 20 3d 20 | 66 4e 65 77 45 6e 64 57 |pLine = |fNewEndW|
|00003ae0| 72 61 70 4c 69 6e 65 43 | 61 72 65 74 3b 0d 09 09 |rapLineC|aret;...|
|00003af0| 48 69 64 65 53 65 6c 65 | 63 74 69 6f 6e 28 20 6b |HideSele|ction( k|
|00003b00| 55 6e 68 69 64 65 53 65 | 6c 65 63 74 69 6f 6e 2c |UnhideSe|lection,|
|00003b10| 20 66 52 65 64 72 61 77 | 20 29 3b 0d 09 7d 0d 09 | fRedraw| );..}..|
|00003b20| 0d 7d 09 2f 2a 20 53 65 | 74 53 65 6c 65 63 74 69 |.}./* Se|tSelecti|
|00003b30| 6f 6e 20 2a 2f 0d 0d 0d | 0d 2f 2a 2a 2a 2a 20 43 |on */...|./**** C|
|00003b40| 20 41 20 4c 20 49 20 42 | 20 52 20 41 20 54 20 49 | A L I B| R A T I|
|00003b50| 20 4f 20 4e 20 20 20 4d | 20 45 20 54 20 48 20 4f | O N M| E T H O|
|00003b60| 20 44 20 53 20 2a 2a 2a | 2a 2f 0d 0d 0d 2f 2a 20 | D S ***|*/.../* |
|00003b70| 4f 56 45 52 52 49 44 45 | 3a 20 2a 2f 0d 76 6f 69 |OVERRIDE|: */.voi|
|00003b80| 64 09 43 50 53 74 79 6c | 65 54 65 78 74 3a 3a 55 |d.CPStyl|eText::U|
|00003b90| 70 64 61 74 65 4d 65 6e | 75 73 20 28 76 6f 69 64 |pdateMen|us (void|
|00003ba0| 29 0d 7b 0d 09 2f 2a 0d | 09 09 49 66 20 77 72 61 |).{../*.|..If wra|
|00003bb0| 70 70 69 6e 67 20 74 6f | 20 74 68 65 20 77 69 6e |pping to| the win|
|00003bc0| 64 6f 77 20 77 69 64 74 | 68 2c 20 74 68 65 20 76 |dow widt|h, the v|
|00003bd0| 61 72 69 6f 75 73 0d 09 | 09 61 6c 69 67 6e 6d 65 |arious..|.alignme|
|00003be0| 6e 74 73 20 64 6f 20 4e | 4f 54 20 6d 61 6b 65 20 |nts do N|OT make |
|00003bf0| 6d 75 63 68 20 73 65 6e | 73 65 2e 0d 0d 09 09 57 |much sen|se.....W|
|00003c00| 69 74 68 69 6e 20 79 6f | 75 72 20 43 41 70 70 6c |ithin yo|ur CAppl|
|00003c10| 69 63 61 74 69 6f 6e 3a | 3a 53 65 74 55 70 4d 65 |ication:|:SetUpMe|
|00003c20| 6e 75 73 20 6d 65 74 68 | 6f 64 2c 0d 09 09 79 6f |nus meth|od,...yo|
|00003c30| 75 20 63 6f 75 6c 64 20 | 64 65 73 69 67 6e 61 74 |u could |designat|
|00003c40| 65 20 61 6c 6c 20 74 68 | 65 20 61 6c 69 67 6e 6d |e all th|e alignm|
|00003c50| 65 6e 74 73 20 61 73 0d | 09 09 69 74 65 6d 73 20 |ents as.|..items |
|00003c60| 6f 66 20 74 68 65 20 6d | 61 69 6e 20 4d 45 4e 55 |of the m|ain MENU|
|00003c70| 2c 20 69 6e 20 77 68 69 | 63 68 20 63 61 73 65 20 |, in whi|ch case |
|00003c80| 74 68 65 0d 09 09 22 65 | 6c 73 65 22 20 63 6c 61 |the..."e|lse" cla|
|00003c90| 75 73 65 20 74 6f 20 66 | 6f 6c 6c 6f 77 20 69 73 |use to f|ollow is|
|00003ca0| 20 4e 4f 54 20 72 65 71 | 75 69 72 65 64 2e 0d 09 | NOT req|uired...|
|00003cb0| 09 48 6f 77 65 76 65 72 | 2c 20 69 66 20 79 6f 75 |.However|, if you|
|00003cc0| 20 64 65 73 69 67 6e 61 | 74 65 64 20 74 68 65 73 | designa|ted thes|
|00003cd0| 65 20 61 6c 69 67 6e 6d | 65 6e 74 73 0d 09 09 61 |e alignm|ents...a|
|00003ce0| 73 20 69 74 65 6d 73 20 | 6f 66 20 61 20 68 69 65 |s items |of a hie|
|00003cf0| 72 61 72 63 68 69 63 61 | 6c 20 4d 45 4e 55 2c 20 |rarchica|l MENU, |
|00003d00| 79 6f 75 20 77 6f 75 6c | 64 0d 09 09 70 72 6f 62 |you woul|d...prob|
|00003d10| 61 62 6c 79 20 73 70 65 | 63 69 66 79 20 22 64 69 |ably spe|cify "di|
|00003d20| 6d 4e 4f 4e 45 22 20 61 | 73 20 74 68 65 20 64 69 |mNONE" a|s the di|
|00003d30| 6d 6d 69 6e 67 0d 09 09 | 6f 70 74 69 6f 6e 20 66 |mming...|option f|
|00003d40| 6f 72 20 74 68 65 20 70 | 61 72 65 6e 74 20 4d 45 |or the p|arent ME|
|00003d50| 4e 55 20 69 74 65 6d 2e | 20 20 49 6e 20 74 68 69 |NU item.| In thi|
|00003d60| 73 0d 09 09 6c 61 73 74 | 20 69 6e 73 74 61 6e 63 |s...last| instanc|
|00003d70| 65 2c 20 22 69 66 2d 65 | 6c 73 65 22 20 61 72 65 |e, "if-e|lse" are|
|00003d80| 20 72 65 71 75 69 72 65 | 64 2e 0d 09 2a 2f 0d 09 | require|d...*/..|
|00003d90| 09 0d 0d 09 43 50 45 64 | 69 74 54 65 78 74 3a 3a |....CPEd|itText::|
|00003da0| 55 70 64 61 74 65 4d 65 | 6e 75 73 28 29 3b 0d 09 |UpdateMe|nus();..|
|00003db0| 0d 09 69 66 20 28 6c 69 | 6e 65 57 69 64 74 68 20 |..if (li|neWidth |
|00003dc0| 21 3d 20 2d 31 29 0d 09 | 7b 0d 09 09 67 42 61 72 |!= -1)..|{...gBar|
|00003dd0| 74 65 6e 64 65 72 2d 3e | 45 6e 61 62 6c 65 43 6d |tender->|EnableCm|
|00003de0| 64 28 20 63 6d 64 41 6c | 69 67 6e 4c 65 66 74 20 |d( cmdAl|ignLeft |
|00003df0| 29 3b 0d 09 09 67 42 61 | 72 74 65 6e 64 65 72 2d |);...gBa|rtender-|
|00003e00| 3e 45 6e 61 62 6c 65 43 | 6d 64 28 20 63 6d 64 41 |>EnableC|md( cmdA|
|00003e10| 6c 69 67 6e 43 65 6e 74 | 65 72 20 29 3b 0d 09 09 |lignCent|er );...|
|00003e20| 67 42 61 72 74 65 6e 64 | 65 72 2d 3e 45 6e 61 62 |gBartend|er->Enab|
|00003e30| 6c 65 43 6d 64 28 20 63 | 6d 64 41 6c 69 67 6e 52 |leCmd( c|mdAlignR|
|00003e40| 69 67 68 74 20 29 3b 0d | 09 09 67 42 61 72 74 65 |ight );.|..gBarte|
|00003e50| 6e 64 65 72 2d 3e 45 6e | 61 62 6c 65 43 6d 64 28 |nder->En|ableCmd(|
|00003e60| 20 63 6d 64 4a 75 73 74 | 69 66 79 20 29 3b 0d 09 | cmdJust|ify );..|
|00003e70| 7d 0d 09 65 6c 73 65 0d | 09 7b 0d 09 09 67 42 61 |}..else.|.{...gBa|
|00003e80| 72 74 65 6e 64 65 72 2d | 3e 44 69 73 61 62 6c 65 |rtender-|>Disable|
|00003e90| 43 6d 64 28 20 63 6d 64 | 41 6c 69 67 6e 4c 65 66 |Cmd( cmd|AlignLef|
|00003ea0| 74 20 29 3b 0d 09 09 67 | 42 61 72 74 65 6e 64 65 |t );...g|Bartende|
|00003eb0| 72 2d 3e 44 69 73 61 62 | 6c 65 43 6d 64 28 20 63 |r->Disab|leCmd( c|
|00003ec0| 6d 64 41 6c 69 67 6e 43 | 65 6e 74 65 72 20 29 3b |mdAlignC|enter );|
|00003ed0| 0d 09 09 67 42 61 72 74 | 65 6e 64 65 72 2d 3e 44 |...gBart|ender->D|
|00003ee0| 69 73 61 62 6c 65 43 6d | 64 28 20 63 6d 64 41 6c |isableCm|d( cmdAl|
|00003ef0| 69 67 6e 52 69 67 68 74 | 20 29 3b 0d 09 09 67 42 |ignRight| );...gB|
|00003f00| 61 72 74 65 6e 64 65 72 | 2d 3e 44 69 73 61 62 6c |artender|->Disabl|
|00003f10| 65 43 6d 64 28 20 63 6d | 64 4a 75 73 74 69 66 79 |eCmd( cm|dJustify|
|00003f20| 20 29 3b 0d 09 7d 0d 09 | 0d 7d 09 2f 2a 20 55 70 | );..}..|.}./* Up|
|00003f30| 64 61 74 65 4d 65 6e 75 | 73 20 2a 2f 0d 0d 0d 0d |dateMenu|s */....|
|00003f40| 2f 2a 20 4f 56 45 52 52 | 49 44 45 3a 20 2a 2f 0d |/* OVERR|IDE: */.|
|00003f50| 76 6f 69 64 09 43 50 53 | 74 79 6c 65 54 65 78 74 |void.CPS|tyleText|
|00003f60| 3a 3a 52 65 73 69 7a 65 | 46 72 61 6d 65 20 28 52 |::Resize|Frame (R|
|00003f70| 65 63 74 20 2a 64 65 6c | 74 61 29 0d 7b 09 09 0d |ect *del|ta).{...|
|00003f80| 09 0d 09 43 50 45 64 69 | 74 54 65 78 74 3a 3a 52 |...CPEdi|tText::R|
|00003f90| 65 73 69 7a 65 46 72 61 | 6d 65 28 20 64 65 6c 74 |esizeFra|me( delt|
|00003fa0| 61 20 29 3b 09 09 09 2f | 2a 20 43 61 6c 6c 73 20 |a );.../|* Calls |
|00003fb0| 46 6f 72 63 65 4e 65 78 | 74 50 72 65 70 61 72 65 |ForceNex|tPrepare|
|00003fc0| 28 29 20 2a 2f 0d 09 0d | 09 69 74 73 44 65 73 74 |() */...|.itsDest|
|00003fd0| 52 65 63 74 2e 6c 65 66 | 74 20 2b 3d 20 64 65 6c |Rect.lef|t += del|
|00003fe0| 74 61 2d 3e 6c 65 66 74 | 3b 0d 09 69 74 73 44 65 |ta->left|;..itsDe|
|00003ff0| 73 74 52 65 63 74 2e 74 | 6f 70 20 2b 3d 20 64 65 |stRect.t|op += de|
|00004000| 6c 74 61 2d 3e 74 6f 70 | 3b 0d 0d 09 43 61 6c 63 |lta->top|;...Calc|
|00004010| 50 45 52 65 63 74 73 28 | 29 3b 0d 09 0d 09 2f 2a |PERects(|);..../*|
|00004020| 0d 09 09 49 66 20 77 72 | 61 70 70 69 6e 67 20 62 |...If wr|apping b|
|00004030| 79 20 74 68 65 20 77 69 | 6e 64 6f 77 20 77 69 64 |y the wi|ndow wid|
|00004040| 74 68 2c 20 72 65 63 61 | 6c 63 75 6c 61 74 65 20 |th, reca|lculate |
|00004050| 6c 69 6e 65 20 73 74 61 | 72 74 73 2e 0d 09 09 52 |line sta|rts....R|
|00004060| 65 63 61 6c 63 4c 69 6e | 65 53 74 61 72 74 73 20 |ecalcLin|eStarts |
|00004070| 63 61 6c 6c 73 20 57 72 | 61 70 4c 69 6e 65 53 74 |calls Wr|apLineSt|
|00004080| 61 72 74 73 20 61 6e 64 | 20 41 64 6a 75 73 74 42 |arts and| AdjustB|
|00004090| 6f 75 6e 64 73 28 29 2e | 0d 09 09 54 68 65 20 6c |ounds().|...The l|
|000040a0| 61 74 74 65 72 20 73 65 | 74 73 20 74 68 65 20 62 |atter se|ts the b|
|000040b0| 6f 75 6e 64 73 20 77 69 | 64 74 68 20 6f 66 20 74 |ounds wi|dth of t|
|000040c0| 68 65 20 43 50 61 6e 6f | 72 61 6d 61 20 74 6f 20 |he CPano|rama to |
|000040d0| 74 68 65 0d 09 09 77 69 | 64 74 68 20 6f 66 20 69 |the...wi|dth of i|
|000040e0| 74 73 44 65 73 74 52 65 | 63 74 20 61 6e 64 20 74 |tsDestRe|ct and t|
|000040f0| 68 65 20 62 6f 75 6e 64 | 73 20 68 65 69 67 68 74 |he bound|s height|
|00004100| 20 74 6f 20 69 74 73 4e | 75 6d 4c 69 6e 65 73 3a | to itsN|umLines:|
|00004110| 0d 09 2a 2f 0d 09 69 66 | 20 28 6c 69 6e 65 57 69 |..*/..if| (lineWi|
|00004120| 64 74 68 20 3d 3d 20 2d | 31 29 0d 09 09 69 66 20 |dth == -|1)...if |
|00004130| 28 64 65 6c 74 61 2d 3e | 6c 65 66 74 20 7c 7c 20 |(delta->|left || |
|00004140| 64 65 6c 74 61 2d 3e 72 | 69 67 68 74 29 0d 09 09 |delta->r|ight)...|
|00004150| 7b 0d 09 09 09 2f 2a 20 | 52 65 63 61 6c 63 75 6c |{..../* |Recalcul|
|00004160| 61 74 65 20 4f 4e 4c 59 | 20 77 69 74 68 20 68 6f |ate ONLY| with ho|
|00004170| 72 69 7a 6f 6e 74 61 6c | 20 63 68 61 6e 67 65 73 |rizontal| changes|
|00004180| 3a 20 2a 2f 0d 09 09 09 | 0d 09 09 09 52 65 63 61 |: */....|....Reca|
|00004190| 6c 63 4c 69 6e 65 53 74 | 61 72 74 73 28 29 3b 0d |lcLineSt|arts();.|
|000041a0| 09 09 7d 0d 09 0d 7d 09 | 2f 2a 20 52 65 73 69 7a |..}...}.|/* Resiz|
|000041b0| 65 46 72 61 6d 65 20 2a | 2f 0d 0d 0d 0d 2f 2a 20 |eFrame *|/..../* |
|000041c0| 4f 56 45 52 52 49 44 45 | 3a 20 2a 2f 0d 76 6f 69 |OVERRIDE|: */.voi|
|000041d0| 64 09 43 50 53 74 79 6c | 65 54 65 78 74 3a 3a 53 |d.CPStyl|eText::S|
|000041e0| 65 74 57 68 6f 6c 65 4c | 69 6e 65 73 20 28 42 6f |etWholeL|ines (Bo|
|000041f0| 6f 6c 65 61 6e 20 61 57 | 68 6f 6c 65 4c 69 6e 65 |olean aW|holeLine|
|00004200| 73 29 0d 7b 0d 09 2f 2a | 0d 09 09 4f 76 65 72 72 |s).{../*|...Overr|
|00004210| 69 64 64 65 6e 20 74 6f | 20 4f 4e 4c 59 20 63 68 |idden to| ONLY ch|
|00004220| 61 6e 67 65 20 74 68 65 | 20 66 72 61 6d 65 20 73 |ange the| frame s|
|00004230| 69 7a 65 20 77 68 65 6e | 0d 09 09 74 68 65 72 65 |ize when|...there|
|00004240| 20 61 72 65 20 6d 6f 72 | 65 20 6c 69 6e 65 73 20 | are mor|e lines |
|00004250| 74 68 61 6e 20 66 72 61 | 6d 65 20 74 6f 20 64 72 |than fra|me to dr|
|00004260| 61 77 20 74 68 65 6d 20 | 69 6e 2e 0d 09 2a 2f 0d |aw them |in...*/.|
|00004270| 09 0d 09 09 4c 6f 6e 67 | 50 74 09 09 63 68 61 72 |....Long|Pt..char|
|00004280| 50 6f 73 3b 0d 09 09 6c | 6f 6e 67 09 09 63 68 61 |Pos;...l|ong..cha|
|00004290| 72 4f 66 66 73 65 74 2c | 20 74 6f 70 4c 69 6e 65 |rOffset,| topLine|
|000042a0| 2c 20 62 6f 74 74 6f 6d | 4c 69 6e 65 2c 20 74 6f |, bottom|Line, to|
|000042b0| 74 61 6c 48 65 69 67 68 | 74 3b 0d 09 09 0d 09 09 |talHeigh|t;......|
|000042c0| 0d 09 66 72 61 6d 65 2e | 62 6f 74 74 6f 6d 20 3d |..frame.|bottom =|
|000042d0| 20 66 72 61 6d 65 2e 74 | 6f 70 20 2b 20 68 65 69 | frame.t|op + hei|
|000042e0| 67 68 74 3b 0d 0d 09 77 | 68 6f 6c 65 4c 69 6e 65 |ght;...w|holeLine|
|000042f0| 73 20 3d 20 61 57 68 6f | 6c 65 4c 69 6e 65 73 3b |s = aWho|leLines;|
|00004300| 0d 0d 09 69 66 20 28 77 | 68 6f 6c 65 4c 69 6e 65 |...if (w|holeLine|
|00004310| 73 29 0d 09 7b 0d 09 09 | 69 66 20 28 66 69 78 65 |s)..{...|if (fixe|
|00004320| 64 4c 69 6e 65 48 65 69 | 67 68 74 73 29 0d 09 09 |dLineHei|ghts)...|
|00004330| 7b 0d 09 09 09 2f 2a 20 | 55 73 65 20 74 68 65 20 |{..../* |Use the |
|00004340| 68 65 69 67 68 74 20 6f | 66 20 74 68 65 20 66 69 |height o|f the fi|
|00004350| 72 73 74 20 6c 69 6e 65 | 20 61 73 20 74 68 65 20 |rst line| as the |
|00004360| 73 74 61 6e 64 61 72 64 | 20 68 65 69 67 68 74 3a |standard| height:|
|00004370| 20 2a 2f 0d 09 09 09 0d | 09 09 09 09 73 68 6f 72 | */.....|....shor|
|00004380| 74 20 6c 69 6e 65 48 65 | 69 67 68 74 20 3d 20 47 |t lineHe|ight = G|
|00004390| 65 74 48 65 69 67 68 74 | 28 20 31 2c 20 31 20 29 |etHeight|( 1, 1 )|
|000043a0| 3b 09 0d 09 09 09 0d 09 | 09 09 69 66 20 28 6c 69 |;.......|..if (li|
|000043b0| 6e 65 48 65 69 67 68 74 | 20 3e 20 30 29 0d 09 09 |neHeight| > 0)...|
|000043c0| 09 09 66 72 61 6d 65 2e | 62 6f 74 74 6f 6d 20 3d |..frame.|bottom =|
|000043d0| 20 66 72 61 6d 65 2e 74 | 6f 70 20 2b 20 6c 69 6e | frame.t|op + lin|
|000043e0| 65 48 65 69 67 68 74 20 | 2a 20 28 68 65 69 67 68 |eHeight |* (heigh|
|000043f0| 74 20 2f 20 6c 69 6e 65 | 48 65 69 67 68 74 29 3b |t / line|Height);|
|00004400| 0d 09 09 7d 0d 09 09 65 | 6c 73 65 0d 09 09 7b 0d |...}...e|lse...{.|
|00004410| 09 09 09 2f 2a 20 46 69 | 6e 64 20 74 68 65 20 6c |.../* Fi|nd the l|
|00004420| 69 6e 65 20 61 74 20 74 | 6f 70 20 6f 66 20 66 72 |ine at t|op of fr|
|00004430| 61 6d 65 3a 20 2a 2f 0d | 09 09 09 0d 09 09 09 53 |ame: */.|.......S|
|00004440| 65 74 4c 6f 6e 67 50 74 | 28 20 26 63 68 61 72 50 |etLongPt|( &charP|
|00004450| 6f 73 2c 20 20 66 72 61 | 6d 65 2e 6c 65 66 74 20 |os, fra|me.left |
|00004460| 2b 20 31 2c 20 66 72 61 | 6d 65 2e 74 6f 70 20 2b |+ 1, fra|me.top +|
|00004470| 20 31 20 29 3b 0d 09 09 | 09 63 68 61 72 4f 66 66 | 1 );...|.charOff|
|00004480| 73 65 74 20 3d 20 47 65 | 74 43 68 61 72 4f 66 66 |set = Ge|tCharOff|
|00004490| 73 65 74 28 20 26 63 68 | 61 72 50 6f 73 20 29 3b |set( &ch|arPos );|
|000044a0| 0d 09 09 09 74 6f 70 4c | 69 6e 65 20 3d 20 46 69 |....topL|ine = Fi|
|000044b0| 6e 64 4c 69 6e 65 28 20 | 63 68 61 72 4f 66 66 73 |ndLine( |charOffs|
|000044c0| 65 74 20 29 20 3b 0d 09 | 09 09 0d 09 09 09 2f 2a |et ) ;..|....../*|
|000044d0| 20 46 69 6e 64 20 74 68 | 65 20 6c 69 6e 65 20 61 | Find th|e line a|
|000044e0| 74 20 62 6f 74 74 6f 6d | 20 6f 66 20 66 72 61 6d |t bottom| of fram|
|000044f0| 65 3a 20 2a 2f 0d 09 09 | 09 0d 09 09 09 53 65 74 |e: */...|.....Set|
|00004500| 4c 6f 6e 67 50 74 28 20 | 26 63 68 61 72 50 6f 73 |LongPt( |&charPos|
|00004510| 2c 20 66 72 61 6d 65 2e | 6c 65 66 74 20 2b 20 31 |, frame.|left + 1|
|00004520| 2c 20 66 72 61 6d 65 2e | 74 6f 70 20 2b 20 68 65 |, frame.|top + he|
|00004530| 69 67 68 74 20 2d 20 31 | 20 29 3b 0d 09 09 09 63 |ight - 1| );....c|
|00004540| 68 61 72 4f 66 66 73 65 | 74 20 3d 20 47 65 74 43 |harOffse|t = GetC|
|00004550| 68 61 72 4f 66 66 73 65 | 74 28 20 26 63 68 61 72 |harOffse|t( &char|
|00004560| 50 6f 73 20 29 3b 0d 09 | 09 09 0d 09 09 20 2f 2a |Pos );..|..... /*|
|00004570| 0d 09 09 09 43 68 72 69 | 73 27 20 3c 65 76 65 6e |....Chri|s' <even|
|00004580| 20 43 45 64 69 74 54 65 | 78 74 27 73 3e 20 46 69 | CEditTe|xt's> Fi|
|00004590| 6e 64 4c 69 6e 65 20 61 | 64 64 72 65 73 73 65 73 |ndLine a|ddresses|
|000045a0| 0d 09 09 09 74 68 65 20 | 63 61 73 65 20 63 68 61 |....the |case cha|
|000045b0| 72 4f 66 66 73 65 74 20 | 3d 20 30 2e 20 20 42 65 |rOffset |= 0. Be|
|000045c0| 73 69 64 65 73 2c 20 74 | 68 65 20 22 65 6c 73 65 |sides, t|he "else|
|000045d0| 22 0d 09 09 09 63 6c 61 | 75 73 65 20 73 68 6f 75 |"....cla|use shou|
|000045e0| 6c 64 20 72 65 61 64 3a | 0d 09 09 09 0d 09 09 09 |ld read:|........|
|000045f0| 09 62 6f 74 74 6f 6d 4c | 69 6e 65 20 3d 20 47 65 |.bottomL|ine = Ge|
|00004600| 74 4e 75 6d 4c 69 6e 65 | 73 28 29 20 2d 20 31 3b |tNumLine|s() - 1;|
|00004610| 0d 09 09 20 0d 09 09 09 | 69 66 20 28 63 68 61 72 |... ....|if (char|
|00004620| 4f 66 66 73 65 74 20 3e | 20 30 29 0d 09 09 09 09 |Offset >| 0).....|
|00004630| 62 6f 74 74 6f 6d 4c 69 | 6e 65 20 3d 20 46 69 6e |bottomLi|ne = Fin|
|00004640| 64 4c 69 6e 65 28 20 63 | 68 61 72 4f 66 66 73 65 |dLine( c|harOffse|
|00004650| 74 20 29 3b 09 0d 09 09 | 09 65 6c 73 65 0d 09 09 |t );....|.else...|
|00004660| 09 09 62 6f 74 74 6f 6d | 4c 69 6e 65 20 3d 20 47 |..bottom|Line = G|
|00004670| 65 74 4e 75 6d 4c 69 6e | 65 73 28 29 3b 0d 09 09 |etNumLin|es();...|
|00004680| 20 2a 2f 0d 09 09 09 09 | 0d 09 09 09 62 6f 74 74 | */.....|....bott|
|00004690| 6f 6d 4c 69 6e 65 20 3d | 20 46 69 6e 64 4c 69 6e |omLine =| FindLin|
|000046a0| 65 28 20 63 68 61 72 4f | 66 66 73 65 74 20 29 3b |e( charO|ffset );|
|000046b0| 09 0d 0d 09 09 09 69 66 | 20 28 62 6f 74 74 6f 6d |......if| (bottom|
|000046c0| 4c 69 6e 65 20 3e 20 74 | 6f 70 4c 69 6e 65 29 0d |Line > t|opLine).|
|000046d0| 09 09 09 7b 0d 09 09 09 | 09 74 6f 74 61 6c 48 65 |...{....|.totalHe|
|000046e0| 69 67 68 74 20 3d 20 47 | 65 74 48 65 69 67 68 74 |ight = G|etHeight|
|000046f0| 28 20 74 6f 70 4c 69 6e | 65 2c 20 62 6f 74 74 6f |( topLin|e, botto|
|00004700| 6d 4c 69 6e 65 20 2b 20 | 31 20 29 3b 0d 09 09 09 |mLine + |1 );....|
|00004710| 09 0d 09 09 09 09 69 66 | 20 28 74 6f 74 61 6c 48 |......if| (totalH|
|00004720| 65 69 67 68 74 20 3e 20 | 68 65 69 67 68 74 29 0d |eight > |height).|
|00004730| 09 09 09 09 7b 0d 09 09 | 09 09 09 2f 2a 0d 09 09 |....{...|.../*...|
|00004740| 09 09 09 09 4d 65 73 73 | 20 77 69 74 68 20 74 68 |....Mess| with th|
|00004750| 65 20 66 72 61 6d 65 20 | 73 69 7a 65 20 4f 4e 4c |e frame |size ONL|
|00004760| 59 20 77 68 65 6e 20 74 | 68 65 72 65 0d 09 09 09 |Y when t|here....|
|00004770| 09 09 09 61 72 65 20 6d | 6f 72 65 20 6c 69 6e 65 |...are m|ore line|
|00004780| 73 20 74 68 61 6e 20 66 | 72 61 6d 65 20 74 6f 20 |s than f|rame to |
|00004790| 64 72 61 77 20 74 68 65 | 6d 20 69 6e 2e 0d 09 09 |draw the|m in....|
|000047a0| 09 09 09 09 49 6e 20 74 | 68 69 73 20 77 61 79 2c |....In t|his way,|
|000047b0| 20 74 68 65 20 66 72 61 | 6d 65 20 73 74 61 79 73 | the fra|me stays|
|000047c0| 20 70 75 74 20 69 66 20 | 77 65 27 76 65 0d 09 09 | put if |we've...|
|000047d0| 09 09 09 09 6f 6e 6c 79 | 20 67 6f 74 20 61 20 66 |....only| got a f|
|000047e0| 65 77 20 6c 69 6e 65 73 | 20 6f 66 20 74 65 78 74 |ew lines| of text|
|000047f0| 2e 0d 09 09 09 09 09 09 | 0d 09 09 09 09 09 09 41 |........|.......A|
|00004800| 6c 73 6f 2c 20 69 66 20 | 74 68 65 20 66 72 61 6d |lso, if |the fram|
|00004810| 65 20 73 74 61 79 73 20 | 70 75 74 2c 20 74 68 65 |e stays |put, the|
|00004820| 20 63 75 72 73 6f 72 0d | 09 09 09 09 09 09 77 6f | cursor.|......wo|
|00004830| 6e 27 74 20 63 68 61 6e | 67 65 20 66 72 6f 6d 20 |n't chan|ge from |
|00004840| 74 68 65 20 49 2d 62 65 | 61 6d 20 61 73 20 6c 6f |the I-be|am as lo|
|00004850| 6e 67 20 61 73 0d 09 09 | 09 09 09 09 74 68 65 20 |ng as...|....the |
|00004860| 4d 6f 75 73 65 20 69 73 | 20 69 6e 73 69 64 65 20 |Mouse is| inside |
|00004870| 74 68 65 20 74 65 78 74 | 20 61 72 65 61 2e 20 20 |the text| area. |
|00004880| 42 65 66 6f 72 65 2c 0d | 09 09 09 09 09 09 69 74 |Before,.|......it|
|00004890| 20 63 68 61 6e 67 65 64 | 20 74 6f 20 61 6e 20 41 | changed| to an A|
|000048a0| 72 72 6f 77 20 69 6e 20 | 74 68 65 20 62 6f 74 74 |rrow in |the bott|
|000048b0| 6f 6d 20 70 61 72 74 0d | 09 09 09 09 09 09 6f 66 |om part.|......of|
|000048c0| 20 74 68 65 20 74 65 78 | 74 20 61 72 65 61 20 62 | the tex|t area b|
|000048d0| 65 63 61 75 73 65 20 77 | 69 74 68 20 6a 75 73 74 |ecause w|ith just|
|000048e0| 20 61 20 66 65 77 0d 09 | 09 09 09 09 09 6c 69 6e | a few..|.....lin|
|000048f0| 65 73 20 6f 66 20 74 65 | 78 74 2c 20 74 68 65 20 |es of te|xt, the |
|00004900| 66 72 61 6d 65 27 73 20 | 62 6f 74 74 6f 6d 20 77 |frame's |bottom w|
|00004910| 61 73 20 76 65 72 79 0d | 09 09 09 09 09 09 63 6c |as very.|......cl|
|00004920| 6f 73 65 20 74 6f 20 74 | 68 65 20 77 69 6e 64 6f |ose to t|he windo|
|00004930| 77 27 73 20 74 6f 70 2e | 0d 09 09 09 09 09 2a 2f |w's top.|......*/|
|00004940| 0d 09 09 09 09 09 0d 09 | 09 09 09 09 77 68 69 6c |........|....whil|
|00004950| 65 20 28 20 28 74 6f 74 | 61 6c 48 65 69 67 68 74 |e ( (tot|alHeight|
|00004960| 20 3e 20 68 65 69 67 68 | 74 29 20 26 26 20 28 62 | > heigh|t) && (b|
|00004970| 6f 74 74 6f 6d 4c 69 6e | 65 20 3e 20 74 6f 70 4c |ottomLin|e > topL|
|00004980| 69 6e 65 29 20 29 09 09 | 0d 09 09 09 09 09 7b 0d |ine) )..|......{.|
|00004990| 09 09 09 09 09 09 74 6f | 74 61 6c 48 65 69 67 68 |......to|talHeigh|
|000049a0| 74 20 3d 20 47 65 74 48 | 65 69 67 68 74 28 20 74 |t = GetH|eight( t|
|000049b0| 6f 70 4c 69 6e 65 2c 20 | 62 6f 74 74 6f 6d 4c 69 |opLine, |bottomLi|
|000049c0| 6e 65 2d 2d 20 29 3b 0d | 09 09 09 09 09 7d 0d 09 |ne-- );.|.....}..|
|000049d0| 09 0d 09 09 09 09 09 2f | 2a 0d 09 09 09 09 09 09 |......./|*.......|
|000049e0| 57 65 20 6e 6f 77 20 6b | 6e 6f 77 20 68 6f 77 20 |We now k|now how |
|000049f0| 6d 61 6e 79 20 66 75 6c | 6c 20 6c 69 6e 65 73 20 |many ful|l lines |
|00004a00| 77 69 6c 6c 20 66 69 74 | 2e 20 20 52 65 73 69 7a |will fit|. Resiz|
|00004a10| 65 20 66 72 61 6d 65 2c | 0d 09 09 09 09 09 09 77 |e frame,|.......w|
|00004a20| 68 69 6c 65 20 65 6e 73 | 75 72 69 6e 67 20 74 68 |hile ens|uring th|
|00004a30| 61 74 20 61 74 20 6c 65 | 61 73 74 20 6f 6e 65 20 |at at le|ast one |
|00004a40| 6c 69 6e 65 20 69 73 20 | 76 69 73 69 62 6c 65 3a |line is |visible:|
|00004a50| 0d 09 09 09 09 09 2a 2f | 0d 09 0d 09 09 09 09 09 |......*/|........|
|00004a60| 69 66 20 28 74 6f 74 61 | 6c 48 65 69 67 68 74 20 |if (tota|lHeight |
|00004a70| 3c 20 68 65 69 67 68 74 | 29 0d 09 09 09 09 09 7b |< height|)......{|
|00004a80| 0d 09 09 09 09 09 09 66 | 72 61 6d 65 2e 62 6f 74 |.......f|rame.bot|
|00004a90| 74 6f 6d 20 3d 20 66 72 | 61 6d 65 2e 74 6f 70 20 |tom = fr|ame.top |
|00004aa0| 2b 20 74 6f 74 61 6c 48 | 65 69 67 68 74 3b 0d 09 |+ totalH|eight;..|
|00004ab0| 09 09 09 09 7d 0d 09 09 | 09 09 09 0d 09 09 09 09 |....}...|........|
|00004ac0| 7d 09 2f 2a 20 6d 6f 72 | 65 20 6c 69 6e 65 73 20 |}./* mor|e lines |
|00004ad0| 74 68 61 6e 20 66 72 61 | 6d 65 20 2a 2f 0d 09 09 |than fra|me */...|
|00004ae0| 09 09 0d 09 09 09 7d 09 | 2f 2a 20 62 6f 74 74 6f |......}.|/* botto|
|00004af0| 6d 4c 69 6e 65 20 3e 20 | 74 6f 70 4c 69 6e 65 20 |mLine > |topLine |
|00004b00| 2a 2f 0d 09 09 09 0d 09 | 09 7d 09 2f 2a 20 4e 4f |*/......|.}./* NO|
|00004b10| 54 20 66 69 78 65 64 4c | 69 6e 65 48 65 69 67 68 |T fixedL|ineHeigh|
|00004b20| 74 73 20 2a 2f 0d 09 09 | 0d 09 7d 09 2f 2a 20 69 |ts */...|..}./* i|
|00004b30| 66 20 28 77 68 6f 6c 65 | 4c 69 6e 65 73 29 20 2a |f (whole|Lines) *|
|00004b40| 2f 0d 0d 09 43 61 6c 63 | 41 70 65 72 74 75 72 65 |/...Calc|Aperture|
|00004b50| 28 29 3b 09 0d 0d 7d 09 | 2f 2a 20 53 65 74 57 68 |();...}.|/* SetWh|
|00004b60| 6f 6c 65 4c 69 6e 65 73 | 20 2a 2f 0d 0d 0d 0d 2f |oleLines| */..../|
|00004b70| 2a 2a 2a 2a 20 41 20 43 | 20 43 20 45 20 53 20 53 |**** A C| C E S S|
|00004b80| 20 49 20 4e 20 47 20 20 | 20 4d 20 45 20 54 20 48 | I N G | M E T H|
|00004b90| 20 4f 20 44 20 53 20 2a | 2a 2a 2a 2f 0d 0d 0d 2f | O D S *|***/.../|
|00004ba0| 2a 20 4f 56 45 52 52 49 | 44 45 3a 20 2a 2f 0d 76 |* OVERRI|DE: */.v|
|00004bb0| 6f 69 64 09 43 50 53 74 | 79 6c 65 54 65 78 74 3a |oid.CPSt|yleText:|
|00004bc0| 3a 53 65 74 42 6f 75 6e | 64 73 20 28 4c 6f 6e 67 |:SetBoun|ds (Long|
|00004bd0| 52 65 63 74 20 2a 61 42 | 6f 75 6e 64 73 29 0d 7b |Rect *aB|ounds).{|
|00004be0| 0d 09 2f 2a 0d 09 09 43 | 50 45 64 69 74 54 65 78 |../*...C|PEditTex|
|00004bf0| 74 27 73 20 53 65 74 42 | 6f 75 6e 64 73 20 64 6f |t's SetB|ounds do|
|00004c00| 65 73 20 73 6f 6d 65 20 | 70 72 65 6c 69 6d 69 6e |es some |prelimin|
|00004c10| 61 72 79 20 73 63 72 6f | 6c 6c 69 6e 67 0d 09 09 |ary scro|lling...|
|00004c20| 77 68 69 63 68 20 67 65 | 6e 65 72 61 74 65 73 20 |which ge|nerates |
|00004c30| 61 6e 20 75 70 64 61 74 | 65 20 45 76 65 6e 74 2e |an updat|e Event.|
|00004c40| 20 20 53 65 74 42 6f 75 | 6e 64 73 20 69 73 20 63 | SetBou|nds is c|
|00004c50| 61 6c 6c 65 64 0d 09 09 | 62 79 20 41 64 6a 75 73 |alled...|by Adjus|
|00004c60| 74 42 6f 75 6e 64 73 20 | 77 68 69 63 68 2c 20 69 |tBounds |which, i|
|00004c70| 6e 20 74 75 72 6e 2c 20 | 69 73 20 63 61 6c 6c 65 |n turn, |is calle|
|00004c80| 64 20 62 79 20 61 20 62 | 75 6e 63 68 0d 09 09 6f |d by a b|unch...o|
|00004c90| 66 20 6d 65 74 68 6f 64 | 73 2c 20 6d 6f 73 74 20 |f method|s, most |
|00004ca0| 6e 6f 74 61 62 6c 79 2c | 20 52 65 73 69 7a 65 46 |notably,| ResizeF|
|00004cb0| 72 61 6d 65 2e 20 20 43 | 68 72 69 73 27 20 75 70 |rame. C|hris' up|
|00004cc0| 64 61 74 65 0d 09 09 61 | 6d 6f 75 6e 74 73 20 74 |date...a|mounts t|
|00004cd0| 6f 20 61 20 53 45 43 4f | 4e 44 20 75 70 64 61 74 |o a SECO|ND updat|
|00004ce0| 65 20 69 6e 20 61 64 64 | 69 74 69 6f 6e 20 74 6f |e in add|ition to|
|00004cf0| 20 74 68 65 20 6f 6e 65 | 20 74 6f 20 62 65 0d 09 | the one| to be..|
|00004d00| 09 67 65 6e 65 72 61 74 | 65 64 20 61 66 74 65 72 |.generat|ed after|
|00004d10| 20 43 50 61 6e 6f 72 61 | 6d 61 27 73 20 43 68 61 | CPanora|ma's Cha|
|00004d20| 6e 67 65 53 69 7a 65 20 | 63 61 6c 6c 73 20 52 65 |ngeSize |calls Re|
|00004d30| 73 69 7a 65 46 72 61 6d | 65 2e 0d 09 09 42 65 63 |sizeFram|e....Bec|
|00004d40| 61 75 73 65 20 6f 66 20 | 74 68 69 73 20 64 75 70 |ause of |this dup|
|00004d50| 6c 69 63 61 74 69 6f 6e | 2c 20 74 68 65 20 73 63 |lication|, the sc|
|00004d60| 72 65 65 6e 20 66 6c 61 | 73 68 65 73 2e 0d 09 09 |reen fla|shes....|
|00004d70| 0d 09 09 49 6e 20 61 64 | 64 69 74 69 6f 6e 2c 20 |...In ad|dition, |
|00004d80| 43 50 61 6e 6f 72 61 6d | 61 27 73 20 53 65 74 42 |CPanoram|a's SetB|
|00004d90| 6f 75 6e 64 73 20 63 61 | 6c 6c 73 3a 0d 09 09 0d |ounds ca|lls:....|
|00004da0| 09 09 09 41 53 53 45 52 | 54 28 20 70 6f 73 69 74 |...ASSER|T( posit|
|00004db0| 69 6f 6e 2e 76 20 3c 3d | 20 62 6f 75 6e 64 73 2e |ion.v <=| bounds.|
|00004dc0| 62 6f 74 74 6f 6d 20 29 | 3b 0d 0d 09 09 77 68 69 |bottom )|;....whi|
|00004dd0| 63 68 20 70 72 65 73 65 | 6e 74 73 20 61 20 70 72 |ch prese|nts a pr|
|00004de0| 6f 62 6c 65 6d 20 77 68 | 69 6c 65 20 79 6f 75 20 |oblem wh|ile you |
|00004df0| 61 72 65 20 63 61 6c 6c | 69 6e 67 20 43 50 61 6e |are call|ing CPan|
|00004e00| 65 27 73 0d 09 09 43 68 | 61 6e 67 65 53 69 7a 65 |e's...Ch|angeSize|
|00004e10| 20 66 6f 72 20 70 6f 73 | 69 74 69 6f 6e 69 6e 67 | for pos|itioning|
|00004e20| 20 79 6f 75 72 20 76 61 | 72 69 6f 75 73 20 43 50 | your va|rious CP|
|00004e30| 61 6e 65 73 20 77 69 74 | 68 69 6e 0d 09 09 79 6f |anes wit|hin...yo|
|00004e40| 75 72 20 43 44 6f 63 75 | 6d 65 6e 74 27 73 20 42 |ur CDocu|ment's B|
|00004e50| 75 69 6c 64 57 69 6e 64 | 6f 77 20 6d 65 74 68 6f |uildWind|ow metho|
|00004e60| 64 2e 20 20 54 68 69 73 | 20 69 73 20 77 68 79 0d |d. This| is why.|
|00004e70| 09 09 43 68 72 69 73 20 | 64 69 64 20 74 68 65 20 |..Chris |did the |
|00004e80| 70 72 65 6c 69 6d 69 6e | 61 72 79 20 73 63 72 6f |prelimin|ary scro|
|00004e90| 6c 6c 69 6e 67 2e 0d 09 | 09 0d 09 09 4e 6f 74 65 |lling...|....Note|
|00004ea0| 20 74 68 61 74 20 43 45 | 64 69 74 54 65 78 74 20 | that CE|ditText |
|00004eb0| 28 6e 6f 20 22 50 22 29 | 20 64 6f 65 73 20 6e 6f |(no "P")| does no|
|00004ec0| 74 20 6f 76 65 72 72 69 | 64 65 20 43 50 61 6e 6f |t overri|de CPano|
|00004ed0| 72 61 6d 61 27 73 0d 09 | 09 53 65 74 42 6f 75 6e |rama's..|.SetBoun|
|00004ee0| 64 73 20 61 6e 64 20 64 | 6f 65 73 20 6e 6f 74 20 |ds and d|oes not |
|00004ef0| 63 61 6c 6c 20 69 74 2e | 20 20 49 6e 73 74 65 61 |call it.| Instea|
|00004f00| 64 2c 20 43 45 64 69 74 | 54 65 78 74 27 73 0d 09 |d, CEdit|Text's..|
|00004f10| 09 41 64 6a 75 73 74 42 | 6f 75 6e 64 73 20 64 6f |.AdjustB|ounds do|
|00004f20| 65 73 20 65 76 65 72 79 | 74 68 69 6e 67 20 74 68 |es every|thing th|
|00004f30| 61 74 20 43 50 61 6e 6f | 72 61 6d 61 27 73 20 53 |at CPano|rama's S|
|00004f40| 65 74 42 6f 75 6e 64 73 | 0d 09 09 64 6f 65 73 2c |etBounds|...does,|
|00004f50| 20 62 75 74 20 77 69 74 | 68 4f 55 54 20 74 68 65 | but wit|hOUT the|
|00004f60| 20 61 62 6f 76 65 20 61 | 73 73 65 72 74 69 6f 6e | above a|ssertion|
|00004f70| 20 63 68 65 63 6b 2e 0d | 09 09 0d 09 09 53 6f 2c | check..|.....So,|
|00004f80| 20 64 6f 20 74 68 65 20 | 73 61 6d 65 20 68 65 72 | do the |same her|
|00004f90| 65 20 62 79 20 64 75 70 | 6c 69 63 61 74 69 6e 67 |e by dup|licating|
|00004fa0| 20 43 50 61 6e 6f 72 61 | 6d 61 27 73 20 53 65 74 | CPanora|ma's Set|
|00004fb0| 42 6f 75 6e 64 73 2c 0d | 09 09 62 75 74 20 77 69 |Bounds,.|..but wi|
|00004fc0| 74 68 4f 55 54 20 74 68 | 69 73 20 63 68 65 63 6b |thOUT th|is check|
|00004fd0| 2e 0d 09 2a 2f 0d 0d 0d | 09 62 6f 75 6e 64 73 20 |...*/...|.bounds |
|00004fe0| 3d 20 2a 61 42 6f 75 6e | 64 73 3b 0d 09 0d 09 69 |= *aBoun|ds;....i|
|00004ff0| 66 20 28 69 74 73 53 63 | 72 6f 6c 6c 50 61 6e 65 |f (itsSc|rollPane|
|00005000| 20 21 3d 20 4e 55 4c 4c | 29 0d 09 09 69 74 73 53 | != NULL|)...itsS|
|00005010| 63 72 6f 6c 6c 50 61 6e | 65 2d 3e 41 64 6a 75 73 |crollPan|e->Adjus|
|00005020| 74 53 63 72 6f 6c 6c 4d | 61 78 28 29 3b 0d 09 0d |tScrollM|ax();...|
|00005030| 7d 09 2f 2a 20 53 65 74 | 42 6f 75 6e 64 73 20 2a |}./* Set|Bounds *|
|00005040| 2f 0d 0d 0d 0d 2f 2a 20 | 4f 56 45 52 52 49 44 45 |/..../* |OVERRIDE|
|00005050| 3a 20 2a 2f 0d 6c 6f 6e | 67 09 43 50 53 74 79 6c |: */.lon|g.CPStyl|
|00005060| 65 54 65 78 74 3a 3a 47 | 65 74 48 65 69 67 68 74 |eText::G|etHeight|
|00005070| 20 28 6c 6f 6e 67 20 73 | 74 61 72 74 4c 69 6e 65 | (long s|tartLine|
|00005080| 2c 20 6c 6f 6e 67 20 65 | 6e 64 4c 69 6e 65 29 0d |, long e|ndLine).|
|00005090| 7b 0d 09 2f 2a 0d 09 09 | 57 69 6c 6c 20 65 76 65 |{../*...|Will eve|
|000050a0| 6e 74 75 61 6c 6c 79 20 | 69 6e 63 6f 72 70 6f 72 |ntually |incorpor|
|000050b0| 61 74 65 20 73 74 79 6c | 65 64 20 74 65 78 74 0d |ate styl|ed text.|
|000050c0| 09 09 77 68 65 72 65 69 | 6e 20 65 61 63 68 20 6c |..wherei|n each l|
|000050d0| 69 6e 65 20 63 61 6e 20 | 68 61 76 65 20 61 20 75 |ine can |have a u|
|000050e0| 6e 69 71 75 65 20 68 65 | 69 67 68 74 2e 0d 09 09 |nique he|ight....|
|000050f0| 0d 09 09 49 20 75 73 65 | 64 20 74 6f 20 68 61 76 |...I use|d to hav|
|00005100| 65 20 72 61 6e 67 65 20 | 63 68 65 63 6b 69 6e 67 |e range |checking|
|00005110| 20 68 65 72 65 2c 20 73 | 75 63 68 20 61 73 3a 0d | here, s|uch as:.|
|00005120| 09 09 0d 09 09 09 30 20 | 3d 3e 20 73 74 61 72 74 |......0 |=> start|
|00005130| 4c 69 6e 65 2c 20 65 6e | 64 4c 69 6e 65 20 3c 3d |Line, en|dLine <=|
|00005140| 20 69 74 73 4e 75 6d 4c | 69 6e 65 73 20 2d 20 31 | itsNumL|ines - 1|
|00005150| 0d 09 09 09 0d 09 09 48 | 6f 77 65 76 65 72 2c 20 |.......H|owever, |
|00005160| 61 6c 6c 20 74 68 65 20 | 6d 65 74 68 6f 64 73 20 |all the |methods |
|00005170| 77 68 69 63 68 20 63 61 | 6c 6c 20 47 65 74 48 65 |which ca|ll GetHe|
|00005180| 69 67 68 74 0d 09 09 61 | 63 63 6f 6d 70 6c 69 73 |ight...a|ccomplis|
|00005190| 68 20 74 68 65 69 72 20 | 6f 77 6e 20 72 61 6e 67 |h their |own rang|
|000051a0| 65 20 63 68 65 63 6b 69 | 6e 67 20 62 65 66 6f 72 |e checki|ng befor|
|000051b0| 65 68 61 6e 64 2c 0d 09 | 09 73 6f 20 49 20 6a 75 |ehand,..|.so I ju|
|000051c0| 73 74 20 63 61 6c 6c 20 | 74 68 65 20 69 6e 68 65 |st call |the inhe|
|000051d0| 72 69 74 65 64 20 6d 65 | 74 68 6f 64 20 28 73 6f |rited me|thod (so|
|000051e0| 20 66 61 72 21 29 2e 0d | 09 2a 2f 0d 09 0d 09 0d | far!)..|.*/.....|
|000051f0| 09 72 65 74 75 72 6e 09 | 28 20 43 50 45 64 69 74 |.return.|( CPEdit|
|00005200| 54 65 78 74 3a 3a 47 65 | 74 48 65 69 67 68 74 28 |Text::Ge|tHeight(|
|00005210| 73 74 61 72 74 4c 69 6e | 65 2c 20 65 6e 64 4c 69 |startLin|e, endLi|
|00005220| 6e 65 29 20 29 3b 0d 09 | 09 0d 7d 09 2f 2a 20 47 |ne) );..|..}./* G|
|00005230| 65 74 48 65 69 67 68 74 | 20 2a 2f 0d 0d 0d 0d 2f |etHeight| */..../|
|00005240| 2a 20 4f 56 45 52 52 49 | 44 45 3a 20 2a 2f 0d 6c |* OVERRI|DE: */.l|
|00005250| 6f 6e 67 09 43 50 53 74 | 79 6c 65 54 65 78 74 3a |ong.CPSt|yleText:|
|00005260| 3a 47 65 74 43 68 61 72 | 4f 66 66 73 65 74 20 28 |:GetChar|Offset (|
|00005270| 4c 6f 6e 67 50 74 20 2a | 61 50 74 29 0d 7b 0d 09 |LongPt *|aPt).{..|
|00005280| 09 72 65 67 69 73 74 65 | 72 20 6c 6f 6e 67 09 09 |.registe|r long..|
|00005290| 6e 75 6d 4c 69 6e 65 73 | 20 3d 20 69 74 73 4e 75 |numLines| = itsNu|
|000052a0| 6d 4c 69 6e 65 73 3b 0d | 09 09 72 65 67 69 73 74 |mLines;.|..regist|
|000052b0| 65 72 20 6c 6f 6e 67 09 | 09 6c 69 6e 65 2c 20 63 |er long.|.line, c|
|000052c0| 75 6d 4c 69 6e 65 48 74 | 2c 20 70 6f 69 6e 74 48 |umLineHt|, pointH|
|000052d0| 74 3b 0d 09 09 72 65 67 | 69 73 74 65 72 20 73 68 |t;...reg|ister sh|
|000052e0| 6f 72 74 09 09 6f 66 66 | 73 65 74 3b 0d 09 09 72 |ort..off|set;...r|
|000052f0| 65 67 69 73 74 65 72 20 | 73 68 6f 72 74 09 09 6c |egister |short..l|
|00005300| 69 6e 65 4c 65 6e 3b 0d | 09 09 72 65 67 69 73 74 |ineLen;.|..regist|
|00005310| 65 72 20 73 68 6f 72 74 | 09 09 77 69 64 74 68 2c |er short|..width,|
|00005320| 20 6c 61 73 74 57 69 64 | 74 68 3b 0d 09 09 72 65 | lastWid|th;...re|
|00005330| 67 69 73 74 65 72 20 73 | 68 6f 72 74 09 09 68 6f |gister s|hort..ho|
|00005340| 72 69 7a 3b 0d 09 09 72 | 65 67 69 73 74 65 72 20 |riz;...r|egister |
|00005350| 73 68 6f 72 74 09 09 2a | 77 69 64 74 68 73 50 3b |short..*|widthsP;|
|00005360| 0d 09 09 53 68 6f 72 74 | 48 61 6e 64 6c 65 09 09 |...Short|Handle..|
|00005370| 09 77 69 64 74 68 73 48 | 3b 0d 09 0d 09 0d 09 50 |.widthsH|;......P|
|00005380| 72 65 70 61 72 65 28 29 | 3b 0d 09 0d 09 2f 2a 0d |repare()|;..../*.|
|00005390| 09 09 49 6e 69 74 69 61 | 6c 69 7a 65 20 61 74 20 |..Initia|lize at |
|000053a0| 74 68 65 20 62 65 67 69 | 6e 6e 69 6e 67 20 6a 75 |the begi|nning ju|
|000053b0| 73 74 20 69 6e 20 63 61 | 73 65 20 77 65 0d 09 09 |st in ca|se we...|
|000053c0| 65 6e 63 6f 75 6e 74 65 | 72 20 61 6e 79 20 6f 66 |encounte|r any of|
|000053d0| 20 74 68 65 20 73 70 65 | 63 69 61 6c 20 63 61 73 | the spe|cial cas|
|000053e0| 65 73 20 74 6f 20 66 6f | 6c 6c 6f 77 2e 0d 09 2a |es to fo|llow...*|
|000053f0| 2f 0d 09 0d 09 66 4e 65 | 77 45 6e 64 57 72 61 70 |/....fNe|wEndWrap|
|00005400| 4c 69 6e 65 43 61 72 65 | 74 20 3d 20 46 41 4c 53 |LineCare|t = FALS|
|00005410| 45 3b 0d 0d 09 09 2f 2a | 0d 09 09 09 44 65 74 65 |E;..../*|....Dete|
|00005420| 72 6d 69 6e 65 20 77 68 | 69 63 68 20 6c 69 6e 65 |rmine wh|ich line|
|00005430| 20 74 68 65 20 70 6f 69 | 6e 74 20 6c 69 65 73 20 | the poi|nt lies |
|00005440| 6f 6e 2e 0d 09 09 09 49 | 6d 70 6c 65 6d 65 6e 74 |on.....I|mplement|
|00005450| 65 64 20 66 6f 72 2d 6c | 6f 6f 70 20 74 6f 20 66 |ed for-l|oop to f|
|00005460| 69 6e 64 20 6c 69 6e 65 | 20 6e 75 6d 62 65 72 0d |ind line| number.|
|00005470| 09 09 09 62 65 63 61 75 | 73 65 20 65 76 65 6e 74 |...becau|se event|
|00005480| 75 61 6c 6c 79 20 49 20 | 77 69 6c 6c 20 69 6e 63 |ually I |will inc|
|00005490| 6f 72 70 6f 72 61 74 65 | 0d 09 09 09 73 74 79 6c |orporate|....styl|
|000054a0| 65 64 20 74 65 78 74 20 | 77 68 65 72 65 69 6e 20 |ed text |wherein |
|000054b0| 65 61 63 68 20 6c 69 6e | 65 20 77 69 6c 6c 20 68 |each lin|e will h|
|000054c0| 61 76 65 0d 09 09 09 61 | 20 75 6e 69 71 75 65 20 |ave....a| unique |
|000054d0| 68 65 69 67 68 74 2e 0d | 09 09 2a 2f 0d 09 09 0d |height..|..*/....|
|000054e0| 09 70 6f 69 6e 74 48 74 | 20 3d 20 61 50 74 2d 3e |.pointHt| = aPt->|
|000054f0| 76 20 2d 20 56 65 72 74 | 54 6f 70 49 6e 73 65 74 |v - Vert|TopInset|
|00005500| 28 29 3b 0d 09 69 66 20 | 28 70 6f 69 6e 74 48 74 |();..if |(pointHt|
|00005510| 20 3c 20 30 4c 29 09 09 | 09 09 2f 2a 20 48 61 6e | < 0L)..|../* Han|
|00005520| 64 6c 65 20 73 70 65 63 | 69 61 6c 20 63 61 73 65 |dle spec|ial case|
|00005530| 20 6f 66 20 61 62 6f 76 | 65 20 74 68 65 20 66 69 | of abov|e the fi|
|00005540| 72 73 74 20 6c 69 6e 65 | 2e 20 2a 2f 0d 09 09 72 |rst line|. */...r|
|00005550| 65 74 75 72 6e 09 28 30 | 4c 29 3b 0d 09 3b 0d 09 |eturn.(0|L);..;..|
|00005560| 63 75 6d 4c 69 6e 65 48 | 74 20 3d 20 30 3b 0d 09 |cumLineH|t = 0;..|
|00005570| 66 6f 72 20 28 6c 69 6e | 65 20 3d 20 30 3b 20 6c |for (lin|e = 0; l|
|00005580| 69 6e 65 20 3c 20 6e 75 | 6d 4c 69 6e 65 73 3b 20 |ine < nu|mLines; |
|00005590| 6c 69 6e 65 2b 2b 29 0d | 09 7b 0d 09 09 2f 2a 20 |line++).|.{.../* |
|000055a0| 53 65 65 20 63 6f 6d 6d | 65 6e 74 73 20 77 69 74 |See comm|ents wit|
|000055b0| 68 69 6e 20 44 72 61 77 | 20 6d 65 74 68 6f 64 3a |hin Draw| method:|
|000055c0| 20 2a 2f 0d 09 09 0d 09 | 09 63 75 6d 4c 69 6e 65 | */.....|.cumLine|
|000055d0| 48 74 20 2b 3d 20 47 65 | 74 48 65 69 67 68 74 28 |Ht += Ge|tHeight(|
|000055e0| 20 6c 69 6e 65 2c 20 6c | 69 6e 65 20 29 3b 0d 09 | line, l|ine );..|
|000055f0| 09 69 66 20 28 63 75 6d | 4c 69 6e 65 48 74 20 3e |.if (cum|LineHt >|
|00005600| 20 70 6f 69 6e 74 48 74 | 29 0d 09 09 09 62 72 65 | pointHt|)....bre|
|00005610| 61 6b 3b 0d 09 7d 0d 09 | 69 66 20 28 6c 69 6e 65 |ak;..}..|if (line|
|00005620| 20 3e 20 6e 75 6d 4c 69 | 6e 65 73 20 2d 20 31 29 | > numLi|nes - 1)|
|00005630| 09 09 2f 2a 20 48 61 6e | 64 6c 65 20 73 70 65 63 |../* Han|dle spec|
|00005640| 69 61 6c 20 63 61 73 65 | 20 6f 66 20 62 65 6c 6f |ial case| of belo|
|00005650| 77 20 74 68 65 20 6c 61 | 73 74 20 6c 69 6e 65 2e |w the la|st line.|
|00005660| 20 2a 2f 0d 09 09 72 65 | 74 75 72 6e 09 28 69 74 | */...re|turn.(it|
|00005670| 73 54 65 78 74 4c 65 6e | 67 74 68 29 3b 0d 09 0d |sTextLen|gth);...|
|00005680| 09 09 2f 2a 20 47 65 74 | 20 74 68 65 20 6e 75 6d |../* Get| the num|
|00005690| 62 65 72 20 6f 66 20 63 | 68 61 72 61 63 74 65 72 |ber of c|haracter|
|000056a0| 73 20 69 6e 20 74 68 65 | 20 6c 69 6e 65 20 2a 2f |s in the| line */|
|000056b0| 0d 09 09 0d 09 6c 69 6e | 65 4c 65 6e 20 3d 20 47 |.....lin|eLen = G|
|000056c0| 65 74 4c 69 6e 65 4c 65 | 6e 67 74 68 28 20 6c 69 |etLineLe|ngth( li|
|000056d0| 6e 65 20 29 20 3b 0d 09 | 0d 09 09 2f 2a 0d 09 09 |ne ) ;..|.../*...|
|000056e0| 09 44 65 74 65 72 6d 69 | 6e 65 20 70 69 78 65 6c |.Determi|ne pixel|
|000056f0| 20 77 69 64 74 68 20 74 | 68 61 74 20 69 73 20 61 | width t|hat is a|
|00005700| 76 61 69 6c 61 62 6c 65 | 20 66 6f 72 20 74 65 78 |vailable| for tex|
|00005710| 74 2e 0d 09 09 09 54 68 | 69 73 20 61 76 61 69 6c |t.....Th|is avail|
|00005720| 61 62 6c 65 20 73 70 61 | 63 65 20 61 70 70 65 61 |able spa|ce appea|
|00005730| 72 73 20 41 46 54 45 52 | 20 74 68 65 20 6c 65 66 |rs AFTER| the lef|
|00005740| 74 20 6d 61 72 67 69 6e | 0d 09 09 09 61 6e 64 20 |t margin|....and |
|00005750| 67 6f 65 73 20 6f 75 74 | 20 74 6f 20 74 68 65 20 |goes out| to the |
|00005760| 70 61 73 73 65 64 20 70 | 6f 69 6e 74 20 3d 20 74 |passed p|oint = t|
|00005770| 68 65 20 70 6f 69 6e 74 | 20 77 68 65 72 65 0d 09 |he point| where..|
|00005780| 09 09 74 68 65 20 75 73 | 65 72 20 63 6c 69 63 6b |..the us|er click|
|00005790| 65 64 20 28 69 6e 20 66 | 72 61 6d 65 20 63 6f 6f |ed (in f|rame coo|
|000057a0| 72 64 69 6e 61 74 65 73 | 29 3a 0d 09 09 2a 2f 0d |rdinates|):...*/.|
|000057b0| 09 0d 09 68 6f 72 69 7a | 20 3d 20 61 50 74 2d 3e |...horiz| = aPt->|
|000057c0| 68 20 2d 20 48 6f 72 69 | 7a 4c 65 66 74 49 6e 73 |h - Hori|zLeftIns|
|000057d0| 65 74 28 29 3b 0d 09 0d | 09 09 2f 2a 20 43 61 6c |et();...|../* Cal|
|000057e0| 63 75 6c 61 74 65 20 63 | 68 61 72 61 63 74 65 72 |culate c|haracter|
|000057f0| 20 70 69 78 65 6c 20 6f | 66 66 73 65 74 73 20 66 | pixel o|ffsets f|
|00005800| 6f 72 20 74 68 65 20 67 | 69 76 65 6e 20 6c 69 6e |or the g|iven lin|
|00005810| 65 3a 20 2a 2f 0d 09 09 | 0d 09 69 66 20 28 68 6f |e: */...|..if (ho|
|00005820| 72 69 7a 20 3c 3d 20 69 | 74 73 4c 65 66 74 4d 61 |riz <= i|tsLeftMa|
|00005830| 72 67 69 6e 29 09 09 6f | 66 66 73 65 74 20 3d 20 |rgin)..o|ffset = |
|00005840| 30 3b 09 0d 09 65 6c 73 | 65 0d 09 7b 0d 09 09 77 |0;...els|e..{...w|
|00005850| 69 64 74 68 73 48 20 3d | 20 4d 65 61 73 75 72 65 |idthsH =| Measure|
|00005860| 4c 69 6e 65 57 69 64 74 | 68 73 28 20 6c 69 6e 65 |LineWidt|hs( line|
|00005870| 20 29 3b 0d 09 09 77 69 | 64 74 68 73 50 20 3d 20 | );...wi|dthsP = |
|00005880| 2a 77 69 64 74 68 73 48 | 3b 0d 09 09 0d 09 09 09 |*widthsH|;.......|
|00005890| 2f 2a 0d 09 09 09 09 4e | 4f 4e 2d 6c 65 66 74 20 |/*.....N|ON-left |
|000058a0| 74 65 78 74 20 61 6c 69 | 67 6e 6d 65 6e 74 73 20 |text ali|gnments |
|000058b0| 65 6c 69 6d 69 6e 61 74 | 65 64 20 66 72 6f 6d 20 |eliminat|ed from |
|000058c0| 76 65 72 73 69 6f 6e 20 | 31 2e 32 3a 0d 09 09 09 |version |1.2:....|
|000058d0| 09 0d 09 09 09 09 46 6f | 72 20 61 6c 6c 20 74 65 |......Fo|r all te|
|000058e0| 78 74 20 61 6c 69 67 6e | 6d 65 6e 74 73 2c 20 64 |xt align|ments, d|
|000058f0| 65 63 72 65 61 73 65 20 | 74 68 65 20 61 76 61 69 |ecrease |the avai|
|00005900| 6c 61 62 6c 65 0d 09 09 | 09 09 77 69 64 74 68 2e |lable...|..width.|
|00005910| 20 20 54 68 69 73 20 64 | 65 63 72 65 61 73 65 20 | This d|ecrease |
|00005920| 73 68 6f 75 6c 64 20 6d | 61 74 63 68 20 74 68 65 |should m|atch the|
|00005930| 20 63 6f 72 72 65 73 70 | 6f 6e 64 69 6e 67 0d 09 | corresp|onding..|
|00005940| 09 09 09 69 6e 63 72 65 | 61 73 65 20 62 79 20 47 |...incre|ase by G|
|00005950| 65 74 43 68 61 72 50 6f | 69 6e 74 28 2e 2e 2e 29 |etCharPo|int(...)|
|00005960| 2e 20 20 41 73 20 73 74 | 61 74 65 64 20 61 62 6f |. As st|ated abo|
|00005970| 76 65 2c 0d 09 09 09 09 | 74 68 69 73 20 77 69 64 |ve,.....|this wid|
|00005980| 74 68 20 61 70 70 65 61 | 72 73 20 41 46 54 45 52 |th appea|rs AFTER|
|00005990| 20 74 68 65 20 6c 65 66 | 74 20 6d 61 72 67 69 6e | the lef|t margin|
|000059a0| 2e 0d 09 09 09 2a 2f 0d | 09 09 0d 09 09 69 66 20 |.....*/.|.....if |
|000059b0| 28 69 74 73 41 6c 69 67 | 6e 43 6d 64 20 3d 3d 20 |(itsAlig|nCmd == |
|000059c0| 63 6d 64 41 6c 69 67 6e | 4c 65 66 74 29 0d 09 09 |cmdAlign|Left)...|
|000059d0| 09 68 6f 72 69 7a 20 2d | 3d 20 69 74 73 4c 65 66 |.horiz -|= itsLef|
|000059e0| 74 4d 61 72 67 69 6e 3b | 0d 09 09 65 6c 73 65 20 |tMargin;|...else |
|000059f0| 69 66 20 28 69 74 73 41 | 6c 69 67 6e 43 6d 64 20 |if (itsA|lignCmd |
|00005a00| 3d 3d 20 63 6d 64 41 6c | 69 67 6e 52 69 67 68 74 |== cmdAl|ignRight|
|00005a10| 29 0d 09 09 09 68 6f 72 | 69 7a 20 2d 3d 20 48 6f |)....hor|iz -= Ho|
|00005a20| 72 69 7a 50 69 78 65 6c | 45 78 74 65 6e 74 28 29 |rizPixel|Extent()|
|00005a30| 20 2d 20 77 69 64 74 68 | 73 50 5b 6c 69 6e 65 4c | - width|sP[lineL|
|00005a40| 65 6e 5d 3b 0d 09 09 65 | 6c 73 65 20 69 66 20 28 |en];...e|lse if (|
|00005a50| 69 74 73 41 6c 69 67 6e | 43 6d 64 20 3d 3d 20 63 |itsAlign|Cmd == c|
|00005a60| 6d 64 41 6c 69 67 6e 43 | 65 6e 74 65 72 29 0d 09 |mdAlignC|enter)..|
|00005a70| 09 09 2f 2a 0d 09 09 09 | 09 43 65 6e 74 65 72 20 |../*....|.Center |
|00005a80| 62 65 74 77 65 65 6e 20 | 6c 65 66 74 20 6d 61 72 |between |left mar|
|00005a90| 67 69 6e 20 61 6e 64 20 | 62 6f 75 6e 64 73 27 20 |gin and |bounds' |
|00005aa0| 72 69 67 68 74 20 65 64 | 67 65 3a 0d 09 09 09 2a |right ed|ge:....*|
|00005ab0| 2f 0d 09 09 09 68 6f 72 | 69 7a 20 2d 3d 20 69 74 |/....hor|iz -= it|
|00005ac0| 73 4c 65 66 74 4d 61 72 | 67 69 6e 20 2b 0d 09 09 |sLeftMar|gin +...|
|00005ad0| 09 09 09 09 28 48 6f 72 | 69 7a 50 69 78 65 6c 45 |....(Hor|izPixelE|
|00005ae0| 78 74 65 6e 74 28 29 20 | 2d 20 69 74 73 4c 65 66 |xtent() |- itsLef|
|00005af0| 74 4d 61 72 67 69 6e 20 | 2d 20 77 69 64 74 68 73 |tMargin |- widths|
|00005b00| 50 5b 6c 69 6e 65 4c 65 | 6e 5d 29 20 2f 20 32 3b |P[lineLe|n]) / 2;|
|00005b10| 0d 09 09 65 6c 73 65 0d | 09 09 7b 0d 09 09 09 09 |...else.|..{.....|
|00005b20| 2f 2a 0d 09 09 09 09 09 | 46 6f 72 20 66 75 6c 6c |/*......|For full|
|00005b30| 20 6a 75 73 74 69 66 79 | 20 61 6c 69 67 6e 6d 65 | justify| alignme|
|00005b40| 6e 74 2c 20 74 68 65 20 | 22 77 69 64 74 68 73 48 |nt, the |"widthsH|
|00005b50| 22 0d 09 09 09 09 09 48 | 61 6e 64 6c 65 20 61 64 |"......H|andle ad|
|00005b60| 64 72 65 73 73 65 73 20 | 74 68 65 20 70 6f 69 6e |dresses |the poin|
|00005b70| 74 20 64 69 73 70 6c 61 | 63 65 6d 65 6e 74 3a 0d |t displa|cement:.|
|00005b80| 09 09 09 09 2a 2f 0d 09 | 09 09 0d 09 09 09 68 6f |....*/..|......ho|
|00005b90| 72 69 7a 20 2d 3d 20 69 | 74 73 4c 65 66 74 4d 61 |riz -= i|tsLeftMa|
|00005ba0| 72 67 69 6e 3b 0d 09 09 | 7d 0d 09 09 0d 09 09 6f |rgin;...|}......o|
|00005bb0| 66 66 73 65 74 20 3d 20 | 6c 61 73 74 57 69 64 74 |ffset = |lastWidt|
|00005bc0| 68 20 3d 20 30 3b 0d 09 | 09 0d 09 09 77 68 69 6c |h = 0;..|....whil|
|00005bd0| 65 20 28 0d 09 09 09 09 | 28 6f 66 66 73 65 74 09 |e (.....|(offset.|
|00005be0| 09 09 09 20 20 3c 20 6c | 69 6e 65 4c 65 6e 29 09 |... < l|ineLen).|
|00005bf0| 26 26 0d 09 09 09 09 28 | 28 77 69 64 74 68 20 3d |&&.....(|(width =|
|00005c00| 20 2a 2b 2b 77 69 64 74 | 68 73 50 29 20 3c 20 68 | *++widt|hsP) < h|
|00005c10| 6f 72 69 7a 20 20 29 0d | 09 09 09 20 20 29 0d 09 |oriz ).|... )..|
|00005c20| 09 7b 0d 09 09 09 6c 61 | 73 74 57 69 64 74 68 20 |.{....la|stWidth |
|00005c30| 3d 20 77 69 64 74 68 3b | 0d 09 09 09 2b 2b 6f 66 |= width;|....++of|
|00005c40| 66 73 65 74 3b 0d 09 09 | 7d 0d 09 09 0d 09 09 44 |fset;...|}......D|
|00005c50| 69 73 70 6f 73 48 61 6e | 64 6c 65 28 20 28 48 61 |isposHan|dle( (Ha|
|00005c60| 6e 64 6c 65 29 77 69 64 | 74 68 73 48 20 29 3b 0d |ndle)wid|thsH );.|
|00005c70| 09 09 0d 09 09 69 66 20 | 28 6f 66 66 73 65 74 20 |.....if |(offset |
|00005c80| 3c 20 6c 69 6e 65 4c 65 | 6e 29 0d 09 09 7b 0d 09 |< lineLe|n)...{..|
|00005c90| 09 09 2f 2a 0d 09 09 09 | 09 49 66 20 77 65 20 63 |../*....|.If we c|
|00005ca0| 6c 69 63 6b 65 64 20 73 | 6f 6d 65 77 68 65 72 65 |licked s|omewhere|
|00005cb0| 20 4f 4e 20 61 20 63 68 | 61 72 61 63 74 65 72 2c | ON a ch|aracter,|
|00005cc0| 20 63 68 65 63 6b 0d 09 | 09 09 09 77 68 65 74 68 | check..|...wheth|
|00005cd0| 65 72 20 6f 6e 20 69 74 | 73 20 66 69 72 73 74 20 |er on it|s first |
|00005ce0| 6f 72 20 6c 61 73 74 20 | 68 61 6c 66 2e 20 20 49 |or last |half. I|
|00005cf0| 66 20 74 68 65 20 6c 61 | 73 74 0d 09 09 09 09 68 |f the la|st.....h|
|00005d00| 61 6c 66 2c 20 74 68 65 | 6e 20 62 75 6d 70 20 74 |alf, the|n bump t|
|00005d10| 68 65 20 6f 66 66 73 65 | 74 20 74 6f 20 74 68 65 |he offse|t to the|
|00005d20| 20 4e 45 58 54 20 63 68 | 61 72 61 63 74 65 72 2e | NEXT ch|aracter.|
|00005d30| 0d 09 09 09 09 0d 09 09 | 09 09 44 6f 20 74 68 69 |........|..Do thi|
|00005d40| 73 20 66 69 72 73 74 20 | 69 6e 20 63 61 73 65 20 |s first |in case |
|00005d50| 74 68 65 20 6f 66 66 73 | 65 74 20 69 73 20 62 75 |the offs|et is bu|
|00005d60| 6d 70 65 64 20 62 65 79 | 6f 6e 64 0d 09 09 09 09 |mped bey|ond.....|
|00005d70| 61 20 77 6f 72 64 2d 62 | 72 65 61 6b 20 63 68 61 |a word-b|reak cha|
|00005d80| 72 61 63 74 65 72 3a 0d | 09 09 09 2a 2f 0d 09 09 |racter:.|...*/...|
|00005d90| 09 0d 09 09 09 69 66 20 | 28 77 69 64 74 68 20 3e |.....if |(width >|
|00005da0| 20 6c 61 73 74 57 69 64 | 74 68 29 0d 09 09 09 09 | lastWid|th).....|
|00005db0| 69 66 20 28 68 6f 72 69 | 7a 20 3e 20 28 6c 61 73 |if (hori|z > (las|
|00005dc0| 74 57 69 64 74 68 20 2b | 20 77 69 64 74 68 29 20 |tWidth +| width) |
|00005dd0| 2f 20 32 29 0d 09 09 09 | 09 09 2b 2b 6f 66 66 73 |/ 2)....|..++offs|
|00005de0| 65 74 3b 0d 09 09 09 09 | 09 0d 09 09 7d 09 2f 2a |et;.....|....}./*|
|00005df0| 20 6f 66 66 73 65 74 20 | 3c 20 6c 69 6e 65 4c 65 | offset |< lineLe|
|00005e00| 6e 20 2a 2f 0d 09 09 0d | 09 09 69 66 20 28 6f 66 |n */....|..if (of|
|00005e10| 66 73 65 74 20 3d 3d 20 | 6c 69 6e 65 4c 65 6e 29 |fset == |lineLen)|
|00005e20| 0d 09 09 7b 0d 09 09 09 | 2f 2a 20 57 65 20 68 61 |...{....|/* We ha|
|00005e30| 76 65 20 63 6c 69 63 6b | 65 64 20 74 6f 20 74 68 |ve click|ed to th|
|00005e40| 65 20 46 41 52 20 72 69 | 67 68 74 20 6f 66 20 74 |e FAR ri|ght of t|
|00005e50| 68 65 20 6c 69 6e 65 27 | 73 20 65 6e 64 3a 20 2a |he line'|s end: *|
|00005e60| 2f 0d 09 09 09 0d 09 09 | 09 09 6c 6f 6e 67 09 09 |/.......|..long..|
|00005e70| 65 6e 64 4f 66 4c 69 6e | 65 20 3d 20 28 2a 69 74 |endOfLin|e = (*it|
|00005e80| 73 4c 69 6e 65 53 74 61 | 72 74 73 29 5b 6c 69 6e |sLineSta|rts)[lin|
|00005e90| 65 5d 20 2b 20 6c 69 6e | 65 4c 65 6e 3b 0d 09 09 |e] + lin|eLen;...|
|00005ea0| 09 09 74 43 68 61 72 42 | 75 66 09 74 68 65 43 68 |..tCharB|uf.theCh|
|00005eb0| 61 72 3b 0d 09 09 09 09 | 0d 09 09 09 47 65 74 43 |ar;.....|....GetC|
|00005ec0| 68 61 72 42 65 66 6f 72 | 65 28 20 26 65 6e 64 4f |harBefor|e( &endO|
|00005ed0| 66 4c 69 6e 65 2c 20 74 | 68 65 43 68 61 72 20 29 |fLine, t|heChar )|
|00005ee0| 3b 0d 09 09 09 69 66 20 | 28 20 74 68 65 43 68 61 |;....if |( theCha|
|00005ef0| 72 5b 30 5d 20 29 0d 09 | 09 09 7b 0d 09 09 09 09 |r[0] )..|..{.....|
|00005f00| 09 72 65 67 69 73 74 65 | 72 20 42 79 74 65 09 63 |.registe|r Byte.c|
|00005f10| 68 20 3d 20 74 68 65 43 | 68 61 72 5b 31 5d 3b 0d |h = theC|har[1];.|
|00005f20| 09 09 09 09 09 0d 09 09 | 09 09 69 66 20 28 63 68 |........|..if (ch|
|00005f30| 20 3d 3d 20 6b 52 65 74 | 75 72 6e 29 0d 09 09 09 | == kRet|urn)....|
|00005f40| 09 7b 0d 09 09 09 09 09 | 2d 2d 6f 66 66 73 65 74 |.{......|--offset|
|00005f50| 3b 0d 09 09 09 09 09 2f | 2a 0d 09 09 09 09 09 09 |;....../|*.......|
|00005f60| 53 70 65 63 69 61 6c 20 | 63 61 73 65 20 77 68 65 |Special |case whe|
|00005f70| 72 65 20 77 65 20 63 6c | 69 63 6b 20 74 6f 20 74 |re we cl|ick to t|
|00005f80| 68 65 20 66 61 72 20 72 | 69 67 68 74 0d 09 09 09 |he far r|ight....|
|00005f90| 09 09 09 6f 66 20 74 68 | 65 20 6c 61 73 74 20 6c |...of th|e last l|
|00005fa0| 69 6e 65 20 77 68 69 63 | 68 20 69 73 20 65 6d 70 |ine whic|h is emp|
|00005fb0| 74 79 2c 20 69 2e 65 2e | 2c 20 74 68 65 0d 09 09 |ty, i.e.|, the...|
|00005fc0| 09 09 09 09 75 73 65 72 | 20 70 72 65 73 73 65 64 |....user| pressed|
|00005fd0| 20 3c 43 52 3e 20 61 66 | 74 65 72 20 74 68 65 20 | <CR> af|ter the |
|00005fe0| 6c 61 73 74 20 66 75 6c | 6c 20 6c 69 6e 65 0d 09 |last ful|l line..|
|00005ff0| 09 09 09 09 09 61 6e 64 | 20 73 74 6f 70 70 65 64 |.....and| stopped|
|00006000| 20 74 79 70 69 6e 67 2e | 0d 09 09 09 09 09 2a 2f | typing.|......*/|
|00006010| 0d 09 09 09 09 09 6f 66 | 66 73 65 74 20 3d 20 4d |......of|fset = M|
|00006020| 61 78 28 20 6f 66 66 73 | 65 74 2c 20 30 20 29 3b |ax( offs|et, 0 );|
|00006030| 0d 09 09 09 09 7d 0d 09 | 09 09 09 65 6c 73 65 0d |.....}..|...else.|
|00006040| 09 09 09 09 09 66 4e 65 | 77 45 6e 64 57 72 61 70 |.....fNe|wEndWrap|
|00006050| 4c 69 6e 65 43 61 72 65 | 74 20 3d 20 49 73 57 6f |LineCare|t = IsWo|
|00006060| 72 64 42 72 65 61 6b 43 | 68 61 72 28 20 63 68 20 |rdBreakC|har( ch |
|00006070| 29 3b 0d 09 09 09 7d 0d | 09 09 09 0d 09 09 7d 09 |);....}.|......}.|
|00006080| 2f 2a 20 6f 66 66 73 65 | 74 20 3d 20 6c 69 6e 65 |/* offse|t = line|
|00006090| 4c 65 6e 20 2a 2f 0d 09 | 09 0d 09 7d 09 2f 2a 20 |Len */..|...}./* |
|000060a0| 68 6f 72 69 7a 20 3e 20 | 69 74 73 4c 65 66 74 4d |horiz > |itsLeftM|
|000060b0| 61 72 67 69 6e 20 2a 2f | 0d 0d 09 72 65 74 75 72 |argin */|...retur|
|000060c0| 6e 09 28 20 28 2a 69 74 | 73 4c 69 6e 65 53 74 61 |n.( (*it|sLineSta|
|000060d0| 72 74 73 29 5b 6c 69 6e | 65 5d 20 2b 20 6f 66 66 |rts)[lin|e] + off|
|000060e0| 73 65 74 20 29 3b 0d 09 | 0d 7d 09 2f 2a 20 47 65 |set );..|.}./* Ge|
|000060f0| 74 43 68 61 72 4f 66 66 | 73 65 74 20 2a 2f 0d 0d |tCharOff|set */..|
|00006100| 0d 0d 2f 2a 20 4f 56 45 | 52 52 49 44 45 3a 20 2a |../* OVE|RRIDE: *|
|00006110| 2f 0d 76 6f 69 64 09 43 | 50 53 74 79 6c 65 54 65 |/.void.C|PStyleTe|
|00006120| 78 74 3a 3a 47 65 74 43 | 68 61 72 50 6f 69 6e 74 |xt::GetC|harPoint|
|00006130| 20 28 6c 6f 6e 67 20 63 | 68 61 72 4f 66 66 73 65 | (long c|harOffse|
|00006140| 74 2c 20 4c 6f 6e 67 50 | 74 20 2a 61 50 74 29 0d |t, LongP|t *aPt).|
|00006150| 7b 0d 09 09 6c 6f 6e 67 | 09 09 09 6c 69 6e 65 3b |{...long|...line;|
|00006160| 0d 09 09 53 68 6f 72 74 | 48 61 6e 64 6c 65 09 09 |...Short|Handle..|
|00006170| 77 69 64 74 68 73 48 3b | 0d 09 0d 09 0d 09 09 2f |widthsH;|......./|
|00006180| 2a 20 45 6e 73 75 72 65 | 20 74 68 61 74 20 74 68 |* Ensure| that th|
|00006190| 65 20 6f 66 66 73 65 74 | 20 69 73 20 77 69 74 68 |e offset| is with|
|000061a0| 69 6e 20 62 6f 75 6e 64 | 73 3a 20 2a 2f 0d 09 0d |in bound|s: */...|
|000061b0| 09 63 68 61 72 4f 66 66 | 73 65 74 20 3d 20 4d 61 |.charOff|set = Ma|
|000061c0| 78 28 20 63 68 61 72 4f | 66 66 73 65 74 2c 20 30 |x( charO|ffset, 0|
|000061d0| 20 29 3b 0d 09 63 68 61 | 72 4f 66 66 73 65 74 20 | );..cha|rOffset |
|000061e0| 3d 20 4d 69 6e 28 20 63 | 68 61 72 4f 66 66 73 65 |= Min( c|harOffse|
|000061f0| 74 2c 20 69 74 73 54 65 | 78 74 4c 65 6e 67 74 68 |t, itsTe|xtLength|
|00006200| 20 29 3b 0d 09 09 0d 09 | 09 2f 2a 0d 09 09 09 44 | );.....|./*....D|
|00006210| 65 74 65 72 6d 69 6e 65 | 20 77 68 69 63 68 20 6c |etermine| which l|
|00006220| 69 6e 65 20 74 68 65 20 | 67 69 76 65 6e 20 63 68 |ine the |given ch|
|00006230| 61 72 61 63 74 65 72 20 | 6f 66 66 73 65 74 20 69 |aracter |offset i|
|00006240| 73 0d 09 09 09 6f 6e 20 | 61 6e 64 20 63 61 6c 63 |s....on |and calc|
|00006250| 75 6c 61 74 65 20 74 68 | 65 20 70 69 78 65 6c 20 |ulate th|e pixel |
|00006260| 77 69 64 74 68 73 20 66 | 6f 72 20 74 68 61 74 20 |widths f|or that |
|00006270| 6c 69 6e 65 3a 0d 09 09 | 2a 2f 0d 09 0d 09 6c 69 |line:...|*/....li|
|00006280| 6e 65 20 3d 20 46 69 6e | 64 4c 69 6e 65 28 20 63 |ne = Fin|dLine( c|
|00006290| 68 61 72 4f 66 66 73 65 | 74 20 29 3b 0d 09 77 69 |harOffse|t );..wi|
|000062a0| 64 74 68 73 48 20 3d 20 | 4d 65 61 73 75 72 65 4c |dthsH = |MeasureL|
|000062b0| 69 6e 65 57 69 64 74 68 | 73 28 20 6c 69 6e 65 20 |ineWidth|s( line |
|000062c0| 29 3b 0d 09 0d 09 09 2f | 2a 20 43 6f 6d 70 75 74 |);...../|* Comput|
|000062d0| 65 20 74 68 65 20 70 69 | 78 65 6c 20 63 6f 6f 72 |e the pi|xel coor|
|000062e0| 64 69 6e 61 74 65 73 20 | 66 6f 72 20 74 68 65 20 |dinates |for the |
|000062f0| 63 68 61 72 61 63 74 65 | 72 3a 20 2a 2f 0d 09 0d |characte|r: */...|
|00006300| 09 61 50 74 2d 3e 76 20 | 3d 20 56 65 72 74 54 6f |.aPt->v |= VertTo|
|00006310| 70 49 6e 73 65 74 28 29 | 20 2b 20 47 65 74 48 65 |pInset()| + GetHe|
|00006320| 69 67 68 74 28 20 30 2c | 20 6c 69 6e 65 20 2d 20 |ight( 0,| line - |
|00006330| 31 20 29 20 2b 20 69 74 | 73 46 6f 6e 74 41 73 63 |1 ) + it|sFontAsc|
|00006340| 65 6e 74 3b 0d 09 61 50 | 74 2d 3e 68 20 3d 20 48 |ent;..aP|t->h = H|
|00006350| 6f 72 69 7a 4c 65 66 74 | 49 6e 73 65 74 28 29 20 |orizLeft|Inset() |
|00006360| 2b 20 28 2a 77 69 64 74 | 68 73 48 29 5b 63 68 61 |+ (*widt|hsH)[cha|
|00006370| 72 4f 66 66 73 65 74 20 | 2d 20 28 2a 69 74 73 4c |rOffset |- (*itsL|
|00006380| 69 6e 65 53 74 61 72 74 | 73 29 5b 6c 69 6e 65 5d |ineStart|s)[line]|
|00006390| 5d 3b 0d 09 09 0d 09 09 | 2f 2a 0d 09 09 09 4e 4f |];......|/*....NO|
|000063a0| 4e 2d 6c 65 66 74 20 74 | 65 78 74 20 61 6c 69 67 |N-left t|ext alig|
|000063b0| 6e 6d 65 6e 74 73 20 65 | 6c 69 6d 69 6e 61 74 65 |nments e|liminate|
|000063c0| 64 20 66 72 6f 6d 20 76 | 65 72 73 69 6f 6e 20 31 |d from v|ersion 1|
|000063d0| 2e 32 3a 0d 09 09 09 09 | 0d 09 09 09 46 6f 72 20 |.2:.....|....For |
|000063e0| 61 6c 6c 20 74 65 78 74 | 20 61 6c 69 67 6e 6d 65 |all text| alignme|
|000063f0| 6e 74 73 2c 20 69 6e 63 | 72 65 61 73 65 20 68 6f |nts, inc|rease ho|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.