home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1989-09-14 | 38.9 KB | [TEXT/KAHL] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| AMOS Picture Packer (image/amosPicturePacker)
| ext
| Supported |
1%
| dexvert
| Debian floppy split (archive/debianFloppySplit)
| ext
| Unsupported |
1%
| dexvert
| Sound Images sound sample (audio/soundImagesSoundSample)
| ext
| Unsupported |
1%
| dexvert
| DESI-III drawing (image/desiIIIDrawing)
| ext
| Unsupported |
1%
| dexvert
| MS-DOS PMODE extender executable (executable/msdosPMODEExtenderExecutable)
| ext
| Unsupported |
1%
| dexvert
| Alien Trilogytextures (other/alienTrilogyTextures)
| ext
| Unsupported |
1%
| dexvert
| APT cache data (other/aptCacheData)
| ext
| Unsupported |
1%
| dexvert
| CorelTRACE configuration (other/corelTRACEConfiguration)
| ext
| Unsupported |
1%
| dexvert
| Dreamcast Disc (other/dreamcastDisc)
| ext
| Unsupported |
1%
| dexvert
| EST flat binary (other/estFlatBinary)
| ext
| Unsupported |
1%
| dexvert
| Finale Enigma Binary Format (other/finaleEnigmaBinaryFormat)
| ext
| Unsupported |
1%
| dexvert
| Sega Genesis/Megadrive/32x ROM (other/genesisROM)
| ext
| Unsupported |
1%
| dexvert
| Myth: The Fallen Lords game archive (other/mythTheFallenLordsGameArchive)
| ext
| Unsupported |
1%
| dexvert
| Sound Images Sound Driver (other/soundImagesSoundDriver)
| ext
| Unsupported |
1%
| dexvert
| Symantec/Norton Config (other/symantecNortonConfig)
| ext
| Unsupported |
1%
| dexvert
| Vectrex ROM (other/vectrexROM)
| ext
| Unsupported |
1%
| dexvert
| BIS raP encoded format (other/bisraPEncoded)
| ext
| Unsupported |
1%
| dexvert
| Pascal Script binary (other/pascalScriptBinary)
| ext
| Unsupported |
1%
| dexvert
| 7th Level game data archive (other/seventhLevelGameDataArchive)
| ext
| Unsupported |
1%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Binary Text (image/binaryText)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary, Sat Feb 18 13:30:12 1989, modified Sat Feb 18 14:59:15 1989, creator Think C, type ASCII, 39609 bytes "TransEdit.c"
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 1
| default (weak)
| |
100%
| lsar
| MacBinary
| default
| |
100%
| gt2
| MAC Bilddatei
| default (weak)
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [KAHL] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 54 72 61 6e 73 45 | 64 69 74 2e 63 00 00 00 |..TransE|dit.c...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 9a b9 00 | 00 00 00 a0 23 66 b4 a0 |........|....#f..|
|00000060| 23 7b 93 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |#{......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000080| 2f 2a 0d 09 54 72 61 6e | 73 45 64 69 74 2e 63 20 |/*..Tran|sEdit.c |
|00000090| 76 65 72 73 69 6f 6e 20 | 32 2e 30 20 2d 20 54 72 |version |2.0 - Tr|
|000000a0| 61 6e 73 53 6b 65 6c 20 | 70 6c 75 67 2d 69 6e 20 |ansSkel |plug-in |
|000000b0| 6d 6f 64 75 6c 65 20 73 | 75 70 70 6f 72 74 69 6e |module s|upportin|
|000000c0| 67 20 61 6e 0d 09 61 72 | 62 69 74 72 61 72 79 20 |g an..ar|bitrary |
|000000d0| 6e 75 6d 62 65 72 20 6f | 66 20 67 65 6e 65 72 69 |number o|f generi|
|000000e0| 63 20 65 64 69 74 20 77 | 69 6e 64 6f 77 73 2e 20 |c edit w|indows. |
|000000f0| 20 45 61 63 68 20 77 69 | 6e 64 6f 77 20 6d 61 79 | Each wi|ndow may|
|00000100| 20 62 65 0d 09 62 6f 75 | 6e 64 20 74 6f 20 61 20 | be..bou|nd to a |
|00000110| 66 69 6c 65 2e 0d 0d 09 | 2a 2a 2a 20 52 65 71 75 |file....|*** Requ|
|00000120| 69 72 65 73 20 46 61 6b | 65 41 6c 65 72 74 2e 63 |ires Fak|eAlert.c|
|00000130| 20 66 6f 72 20 70 72 6f | 70 65 72 20 6c 69 6e 6b | for pro|per link|
|00000140| 69 6e 67 21 20 2a 2a 2a | 0d 09 0d 09 54 72 61 6e |ing! ***|....Tran|
|00000150| 73 53 6b 65 6c 20 61 6e | 64 20 54 72 61 6e 73 45 |sSkel an|d TransE|
|00000160| 64 69 74 20 61 72 65 20 | 70 75 62 6c 69 63 20 64 |dit are |public d|
|00000170| 6f 6d 61 69 6e 2c 20 61 | 6e 64 20 61 72 65 20 77 |omain, a|nd are w|
|00000180| 72 69 74 74 65 6e 20 62 | 79 3a 0d 0d 09 09 09 50 |ritten b|y:.....P|
|00000190| 61 75 6c 20 44 75 42 6f | 69 73 0d 09 09 09 57 69 |aul DuBo|is....Wi|
|000001a0| 73 63 6f 6e 73 69 6e 20 | 52 65 67 69 6f 6e 61 6c |sconsin |Regional|
|000001b0| 20 50 72 69 6d 61 74 65 | 20 52 65 73 65 61 72 63 | Primate| Researc|
|000001c0| 68 20 43 65 6e 74 65 72 | 0d 09 09 09 31 32 32 30 |h Center|....1220|
|000001d0| 20 43 61 70 69 74 6f 6c | 20 43 6f 75 72 74 0d 09 | Capitol| Court..|
|000001e0| 09 09 4d 61 64 69 73 6f | 6e 2c 20 57 49 20 20 35 |..Madiso|n, WI 5|
|000001f0| 33 37 31 35 2d 31 32 39 | 39 20 20 55 53 41 0d 0d |3715-129|9 USA..|
|00000200| 09 55 55 43 50 3a 09 7b | 68 61 72 76 61 72 64 2c |.UUCP:.{|harvard,|
|00000210| 72 75 74 67 65 72 73 2c | 75 63 62 76 61 78 7d 21 |rutgers,|ucbvax}!|
|00000220| 75 77 76 61 78 21 72 68 | 65 73 75 73 21 64 75 62 |uwvax!rh|esus!dub|
|00000230| 6f 69 73 0d 09 41 52 50 | 41 3a 09 64 75 62 6f 69 |ois..ARP|A:.duboi|
|00000240| 73 40 70 72 69 6d 61 74 | 65 2e 77 69 73 63 2e 65 |s@primat|e.wisc.e|
|00000250| 64 75 0d 0d 09 54 68 69 | 73 20 76 65 72 73 69 6f |du...Thi|s versio|
|00000260| 6e 20 6f 66 20 54 72 61 | 6e 73 45 64 69 74 20 77 |n of Tra|nsEdit w|
|00000270| 72 69 74 74 65 6e 20 66 | 6f 72 20 4c 69 67 68 74 |ritten f|or Light|
|00000280| 73 70 65 65 64 43 2e 20 | 20 4c 69 67 68 74 73 70 |speedC. | Lightsp|
|00000290| 65 65 64 43 0d 09 69 73 | 20 61 20 74 72 61 64 65 |eedC..is| a trade|
|000002a0| 6d 61 72 6b 20 6f 66 3a | 0d 09 09 09 54 48 49 4e |mark of:|....THIN|
|000002b0| 4b 20 54 65 63 68 6e 6f | 6c 6f 67 69 65 73 2c 20 |K Techno|logies, |
|000002c0| 49 6e 63 0d 09 09 09 34 | 32 30 20 42 65 64 66 6f |Inc....4|20 Bedfo|
|000002d0| 72 64 20 53 74 72 65 65 | 74 20 20 53 75 69 74 65 |rd Stree|t Suite|
|000002e0| 20 33 35 30 0d 09 09 09 | 4c 65 78 69 6e 67 74 6f | 350....|Lexingto|
|000002f0| 6e 2c 20 4d 41 20 20 30 | 32 31 37 33 20 20 55 53 |n, MA 0|2173 US|
|00000300| 41 0d 0d 20 20 48 69 73 | 74 6f 72 79 0d 20 20 30 |A.. His|tory. 0|
|00000310| 38 2f 32 35 2f 38 36 09 | 47 65 6e 65 73 69 73 2e |8/25/86.|Genesis.|
|00000320| 20 20 42 65 74 61 20 76 | 65 72 73 69 6f 6e 2e 0d | Beta v|ersion..|
|00000330| 20 20 30 39 2f 31 35 2f | 38 36 09 43 68 61 6e 67 | 09/15/|86.Chang|
|00000340| 65 64 20 74 6f 20 61 6c | 6c 6f 77 20 61 72 62 69 |ed to al|low arbi|
|00000350| 74 72 61 72 79 20 6e 75 | 6d 62 65 72 20 6f 66 20 |trary nu|mber of |
|00000360| 77 69 6e 64 6f 77 73 2e | 0d 20 20 31 31 2f 30 34 |windows.|. 11/04|
|00000370| 2f 38 36 09 41 64 64 65 | 64 20 63 6f 6e 64 69 74 |/86.Adde|d condit|
|00000380| 69 6f 6e 61 6c 20 73 74 | 75 66 66 20 74 6f 20 61 |ional st|uff to a|
|00000390| 6c 6c 6f 77 20 63 6f 6d | 70 69 6c 61 74 69 6f 6e |llow com|pilation|
|000003a0| 20 69 6e 0d 20 09 09 09 | 73 69 6e 67 6c 65 2d 20 | in. ...|single- |
|000003b0| 6f 72 20 6d 75 6c 74 69 | 70 6c 65 2d 77 69 6e 64 |or multi|ple-wind|
|000003c0| 6f 77 20 6d 6f 64 65 2e | 20 20 43 68 61 6e 67 65 |ow mode.| Change|
|000003d0| 64 20 76 65 72 73 69 6f | 6e 20 74 6f 20 31 2e 30 |d versio|n to 1.0|
|000003e0| 2e 0d 20 20 30 31 2f 31 | 37 2f 38 37 09 43 68 61 |.. 01/1|7/87.Cha|
|000003f0| 6e 67 65 64 20 76 65 72 | 73 69 6f 6e 20 6e 75 6d |nged ver|sion num|
|00000400| 62 65 72 20 74 6f 20 31 | 2e 30 31 2e 20 20 54 68 |ber to 1|.01. Th|
|00000410| 65 20 77 69 6e 64 6f 77 | 20 74 79 70 65 20 77 68 |e window| type wh|
|00000420| 65 6e 20 61 20 6e 65 77 | 0d 20 20 09 09 09 77 69 |en a new|. ...wi|
|00000430| 6e 64 6f 77 20 69 73 20 | 63 72 65 61 74 65 64 20 |ndow is |created |
|00000440| 69 73 20 64 6f 63 75 6d | 65 6e 74 50 72 6f 63 2b |is docum|entProc+|
|00000450| 38 20 6e 6f 77 2c 20 73 | 6f 20 74 68 61 74 20 74 |8 now, s|o that t|
|00000460| 68 65 20 77 69 6e 64 6f | 77 0d 20 20 09 09 09 77 |he windo|w. ...w|
|00000470| 69 6c 6c 20 68 61 76 65 | 20 61 20 7a 6f 6f 6d 20 |ill have| a zoom |
|00000480| 62 6f 78 20 6f 6e 20 61 | 20 6d 61 63 68 69 6e 65 |box on a| machine|
|00000490| 20 77 69 74 68 20 31 32 | 38 4b 20 52 4f 4d 53 2e | with 12|8K ROMS.|
|000004a0| 0d 20 20 09 09 09 44 65 | 66 61 75 6c 74 20 66 69 |. ...De|fault fi|
|000004b0| 6c 65 20 6e 61 6d 65 20 | 69 6e 20 53 61 76 65 46 |le name |in SaveF|
|000004c0| 69 6c 65 20 69 73 20 69 | 6e 69 74 69 61 6c 69 7a |ile is i|nitializ|
|000004d0| 65 64 20 61 66 74 65 72 | 0d 20 20 09 09 09 53 79 |ed after|. ...Sy|
|000004e0| 6e 63 41 6c 6c 47 6c 6f | 62 61 6c 73 20 2d 20 66 |ncAllGlo|bals - f|
|000004f0| 69 78 69 6e 67 20 62 75 | 67 20 66 6f 75 6e 64 20 |ixing bu|g found |
|00000500| 62 79 20 4f 77 65 6e 20 | 48 61 72 74 6e 65 74 74 |by Owen |Hartnett|
|00000510| 2e 0d 20 20 30 31 2f 32 | 39 2f 38 39 09 56 65 72 |.. 01/2|9/89.Ver|
|00000520| 73 69 6f 6e 20 32 2e 30 | 2e 20 20 43 6f 6e 76 65 |sion 2.0|. Conve|
|00000530| 72 74 65 64 20 74 6f 20 | 77 6f 72 6b 20 77 69 74 |rted to |work wit|
|00000540| 68 20 54 72 61 6e 73 53 | 6b 65 6c 20 32 2e 30 2e |h TransS|kel 2.0.|
|00000550| 20 20 32 2d 62 79 74 65 | 20 61 6e 64 0d 09 09 09 | 2-byte| and....|
|00000560| 34 2d 62 79 74 65 20 69 | 6e 74 65 67 65 72 20 74 |4-byte i|nteger t|
|00000570| 79 70 65 73 20 61 72 65 | 20 74 79 70 65 64 65 66 |ypes are| typedef|
|00000580| 27 65 64 20 74 6f 20 49 | 6e 74 65 67 65 72 20 61 |'ed to I|nteger a|
|00000590| 6e 64 20 4c 6f 6e 67 69 | 6e 74 20 74 6f 0d 09 09 |nd Longi|nt to...|
|000005a0| 09 65 61 73 65 20 70 6f | 72 74 69 6e 67 2e 20 20 |.ease po|rting. |
|000005b0| 41 64 64 65 64 20 53 79 | 73 74 65 6d 45 64 69 74 |Added Sy|stemEdit|
|000005c0| 20 63 68 65 63 6b 20 74 | 6f 20 45 64 69 74 20 6d | check t|o Edit m|
|000005d0| 65 6e 75 20 68 61 6e 64 | 6c 65 72 2e 0d 2a 2f 0d |enu hand|ler..*/.|
|000005e0| 0d 0d 2f 2a 0d 09 54 68 | 65 20 66 6f 6c 6c 6f 77 |../*..Th|e follow|
|000005f0| 69 6e 67 20 73 79 6d 62 | 6f 6c 20 63 6f 6e 74 72 |ing symb|ol contr|
|00000600| 6f 6c 73 20 74 68 65 20 | 63 6f 6d 70 69 6c 65 20 |ols the |compile |
|00000610| 6d 6f 64 65 2e 20 20 49 | 66 20 69 74 20 69 73 20 |mode. I|f it is |
|00000620| 23 64 65 66 69 6e 65 27 | 64 2c 0d 09 54 72 61 6e |#define'|d,..Tran|
|00000630| 73 45 64 69 74 20 61 6c | 6c 6f 77 73 20 6f 6e 6c |sEdit al|lows onl|
|00000640| 79 20 61 20 73 69 6e 67 | 6c 65 20 65 64 69 74 20 |y a sing|le edit |
|00000650| 77 69 6e 64 6f 77 2c 20 | 61 6e 64 20 67 65 6e 65 |window, |and gene|
|00000660| 72 61 74 65 73 20 6c 65 | 73 73 20 63 6f 64 65 2e |rates le|ss code.|
|00000670| 0d 09 49 66 20 69 74 20 | 69 73 20 23 75 6e 64 65 |..If it |is #unde|
|00000680| 66 27 65 64 2c 20 54 72 | 61 6e 73 45 64 69 74 20 |f'ed, Tr|ansEdit |
|00000690| 61 6c 6c 6f 77 73 20 61 | 6e 20 61 72 62 69 74 72 |allows a|n arbitr|
|000006a0| 61 72 79 20 6e 75 6d 62 | 65 72 20 6f 66 20 65 64 |ary numb|er of ed|
|000006b0| 69 74 0d 09 77 69 6e 64 | 6f 77 73 2c 20 62 75 74 |it..wind|ows, but|
|000006c0| 20 67 65 6e 65 72 61 74 | 65 73 20 6d 6f 72 65 20 | generat|es more |
|000006d0| 63 6f 64 65 2e 0d 2a 2f | 0d 0d 23 20 75 6e 64 65 |code..*/|..# unde|
|000006e0| 66 09 73 69 6e 67 6c 65 | 45 64 69 74 0d 0d 0d 23 |f.single|Edit...#|
|000006f0| 20 69 6e 63 6c 75 64 65 | 09 22 54 72 61 6e 73 45 | include|."TransE|
|00000700| 64 69 74 2e 68 22 0d 23 | 20 69 6e 63 6c 75 64 65 |dit.h".#| include|
|00000710| 09 3c 43 6f 6e 74 72 6f | 6c 4d 67 72 2e 68 3e 09 |.<Contro|lMgr.h>.|
|00000720| 2f 2a 20 69 6e 63 6c 75 | 64 65 73 20 57 69 6e 64 |/* inclu|des Wind|
|00000730| 6f 77 4d 67 72 2e 68 2c | 20 51 75 69 63 6b 44 72 |owMgr.h,| QuickDr|
|00000740| 61 77 2e 68 2c 20 4d 61 | 63 54 79 70 65 73 2e 68 |aw.h, Ma|cTypes.h|
|00000750| 20 2a 2f 0d 23 20 69 6e | 63 6c 75 64 65 09 3c 53 | */.# in|clude.<S|
|00000760| 74 64 46 69 6c 65 50 6b | 67 2e 68 3e 0d 23 20 69 |tdFilePk|g.h>.# i|
|00000770| 6e 63 6c 75 64 65 09 3c | 46 69 6c 65 4d 67 72 2e |nclude.<|FileMgr.|
|00000780| 68 3e 0d 23 20 69 6e 63 | 6c 75 64 65 09 3c 54 6f |h>.# inc|lude.<To|
|00000790| 6f 6c 42 6f 78 55 74 69 | 6c 2e 68 3e 0d 0d 0d 74 |olBoxUti|l.h>...t|
|000007a0| 79 70 65 64 65 66 09 69 | 6e 74 09 09 49 6e 74 65 |ypedef.i|nt..Inte|
|000007b0| 67 65 72 3b 09 2f 2a 20 | 63 6f 6d 70 69 6c 65 72 |ger;./* |compiler|
|000007c0| 20 32 2d 62 79 74 65 20 | 69 6e 74 65 67 65 72 20 | 2-byte |integer |
|000007d0| 74 79 70 65 20 2a 2f 0d | 74 79 70 65 64 65 66 09 |type */.|typedef.|
|000007e0| 6c 6f 6e 67 09 4c 6f 6e | 67 69 6e 74 3b 09 2f 2a |long.Lon|gint;./*|
|000007f0| 20 63 6f 6d 70 69 6c 65 | 72 20 34 2d 62 79 74 65 | compile|r 4-byte|
|00000800| 20 69 6e 74 65 67 65 72 | 20 74 79 70 65 20 2a 2f | integer| type */|
|00000810| 0d 0d 0d 2f 2a 0d 09 45 | 64 69 74 20 77 69 6e 64 |.../*..E|dit wind|
|00000820| 6f 77 20 74 79 70 65 73 | 2c 20 63 6f 6e 73 74 61 |ow types|, consta|
|00000830| 6e 74 73 2c 20 76 61 72 | 69 61 62 6c 65 73 2e 0d |nts, var|iables..|
|00000840| 2a 2f 0d 0d 0d 23 20 64 | 65 66 69 6e 65 09 65 6e |*/...# d|efine.en|
|00000850| 74 65 72 09 09 09 33 0d | 23 20 64 65 66 69 6e 65 |ter...3.|# define|
|00000860| 09 63 72 09 09 09 09 31 | 33 0d 23 20 64 65 66 69 |.cr....1|3.# defi|
|00000870| 6e 65 09 6d 6f 6e 61 63 | 6f 09 09 09 34 0d 23 20 |ne.monac|o...4.# |
|00000880| 64 65 66 69 6e 65 09 73 | 68 69 66 74 4b 65 79 09 |define.s|hiftKey.|
|00000890| 09 30 78 30 32 30 30 0d | 0d 0d 74 79 70 65 64 65 |.0x0200.|..typede|
|000008a0| 66 20 65 6e 75 6d 09 09 | 09 2f 2a 20 45 64 69 74 |f enum..|./* Edit|
|000008b0| 20 6d 65 6e 75 20 69 74 | 65 6d 20 6e 75 6d 62 65 | menu it|em numbe|
|000008c0| 72 73 20 2a 2f 0d 7b 0d | 09 75 6e 64 6f 20 3d 20 |rs */.{.|.undo = |
|000008d0| 31 2c 0d 09 2f 2a 20 2d | 2d 2d 20 2a 2f 0d 09 63 |1,../* -|-- */..c|
|000008e0| 75 74 20 3d 20 33 2c 0d | 09 63 6f 70 79 2c 0d 09 |ut = 3,.|.copy,..|
|000008f0| 70 61 73 74 65 2c 0d 09 | 63 6c 65 61 72 09 09 2f |paste,..|clear../|
|00000900| 2a 20 28 69 74 27 73 20 | 6f 6b 20 69 66 20 74 68 |* (it's |ok if th|
|00000910| 65 20 68 6f 73 74 20 64 | 6f 65 73 6e 27 74 20 68 |e host d|oesn't h|
|00000920| 61 76 65 20 74 68 69 73 | 20 69 74 65 6d 29 20 2a |ave this| item) *|
|00000930| 2f 0d 7d 3b 0d 0d 0d 2f | 2a 0d 09 44 65 66 61 75 |/.};.../|*..Defau|
|00000940| 6c 74 20 76 61 6c 75 65 | 73 20 66 6f 72 20 65 64 |lt value|s for ed|
|00000950| 69 74 20 77 69 6e 64 6f | 77 20 74 65 78 74 20 64 |it windo|w text d|
|00000960| 69 73 70 6c 61 79 20 63 | 68 61 72 61 63 74 65 72 |isplay c|haracter|
|00000970| 69 73 74 69 63 73 0d 09 | 61 6e 64 20 65 76 65 6e |istics..|and even|
|00000980| 74 20 6e 6f 74 69 66 69 | 63 61 74 69 6f 6e 20 70 |t notifi|cation p|
|00000990| 72 6f 63 65 64 75 72 65 | 73 0d 2a 2f 0d 0d 73 74 |rocedure|s.*/..st|
|000009a0| 61 74 69 63 20 49 6e 74 | 65 67 65 72 09 65 5f 66 |atic Int|eger.e_f|
|000009b0| 6f 6e 74 20 3d 20 6d 6f | 6e 61 63 6f 3b 09 2f 2a |ont = mo|naco;./*|
|000009c0| 20 64 65 66 61 75 6c 74 | 20 66 6f 6e 74 20 20 20 | default| font |
|000009d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2a 2f | | */|
|000009e0| 0d 73 74 61 74 69 63 20 | 49 6e 74 65 67 65 72 09 |.static |Integer.|
|000009f0| 65 5f 73 69 7a 65 20 3d | 20 39 3b 09 09 09 2f 2a |e_size =| 9;.../*|
|00000a00| 20 64 65 66 61 75 6c 74 | 20 70 6f 69 6e 74 73 69 | default| pointsi|
|00000a10| 7a 65 20 20 20 20 20 20 | 20 20 20 20 20 20 2a 2f |ze | */|
|00000a20| 0d 73 74 61 74 69 63 20 | 49 6e 74 65 67 65 72 09 |.static |Integer.|
|00000a30| 65 5f 77 72 61 70 20 3d | 20 30 3b 09 09 09 2f 2a |e_wrap =| 0;.../*|
|00000a40| 20 64 65 66 61 75 6c 74 | 20 77 6f 72 64 20 77 72 | default| word wr|
|00000a50| 61 70 20 28 6f 6e 29 20 | 20 20 20 20 20 20 2a 2f |ap (on) | */|
|00000a60| 0d 73 74 61 74 69 63 20 | 49 6e 74 65 67 65 72 09 |.static |Integer.|
|00000a70| 65 5f 6a 75 73 74 20 3d | 20 74 65 4a 75 73 74 4c |e_just =| teJustL|
|00000a80| 65 66 74 3b 2f 2a 20 64 | 65 66 61 75 6c 74 20 6a |eft;/* d|efault j|
|00000a90| 75 73 74 69 66 69 63 61 | 74 69 6f 6e 20 20 20 20 |ustifica|tion |
|00000aa0| 20 20 20 20 2a 2f 0d 73 | 74 61 74 69 63 20 50 72 | */.s|tatic Pr|
|00000ab0| 6f 63 50 74 72 09 65 5f | 6b 65 79 20 3d 20 6e 69 |ocPtr.e_|key = ni|
|00000ac0| 6c 3b 09 09 2f 2a 20 64 | 65 66 61 75 6c 74 20 6b |l;../* d|efault k|
|00000ad0| 65 79 20 70 72 6f 63 65 | 64 75 72 65 20 20 20 20 |ey proce|dure |
|00000ae0| 20 20 20 20 2a 2f 0d 73 | 74 61 74 69 63 20 50 72 | */.s|tatic Pr|
|00000af0| 6f 63 50 74 72 09 65 5f | 61 63 74 69 76 61 74 65 |ocPtr.e_|activate|
|00000b00| 20 3d 20 6e 69 6c 3b 09 | 2f 2a 20 64 65 66 61 75 | = nil;.|/* defau|
|00000b10| 6c 74 20 61 63 74 69 76 | 61 74 69 6f 6e 20 70 72 |lt activ|ation pr|
|00000b20| 6f 63 65 64 75 72 65 20 | 2a 2f 0d 73 74 61 74 69 |ocedure |*/.stati|
|00000b30| 63 20 50 72 6f 63 50 74 | 72 09 65 5f 63 6c 6f 73 |c ProcPt|r.e_clos|
|00000b40| 65 20 3d 20 6e 69 6c 3b | 09 09 2f 2a 20 64 65 66 |e = nil;|../* def|
|00000b50| 61 75 6c 74 20 63 6c 6f | 73 65 20 70 72 6f 63 65 |ault clo|se proce|
|00000b60| 64 75 72 65 20 20 20 20 | 20 20 2a 2f 0d 0d 0d 23 |dure | */...#|
|00000b70| 20 69 66 6e 64 65 66 09 | 73 69 6e 67 6c 65 45 64 | ifndef.|singleEd|
|00000b80| 69 74 0d 0d 2f 2a 0d 09 | 4e 65 77 28 54 79 70 65 |it../*..|New(Type|
|00000b90| 4e 61 6d 65 29 20 72 65 | 74 75 72 6e 73 20 68 61 |Name) re|turns ha|
|00000ba0| 6e 64 6c 65 20 74 6f 20 | 6e 65 77 20 6f 62 6a 65 |ndle to |new obje|
|00000bb0| 63 74 2c 20 66 6f 72 20 | 61 6e 79 20 54 79 70 65 |ct, for |any Type|
|00000bc0| 4e 61 6d 65 2e 0d 09 49 | 66 20 74 68 65 72 65 20 |Name...I|f there |
|00000bd0| 69 73 20 69 6e 73 75 66 | 66 69 63 69 65 6e 74 20 |is insuf|ficient |
|00000be0| 6d 65 6d 6f 72 79 2c 20 | 74 68 65 20 72 65 73 75 |memory, |the resu|
|00000bf0| 6c 74 20 69 73 20 6e 69 | 6c 2e 0d 2a 2f 0d 0d 23 |lt is ni|l..*/..#|
|00000c00| 20 64 65 66 69 6e 65 09 | 4e 65 77 28 78 29 09 28 | define.|New(x).(|
|00000c10| 78 20 2a 2a 29 20 4e 65 | 77 48 61 6e 64 6c 65 20 |x **) Ne|wHandle |
|00000c20| 28 28 53 69 7a 65 29 20 | 73 69 7a 65 6f 66 20 28 |((Size) |sizeof (|
|00000c30| 78 29 29 0d 0d 0d 2f 2a | 0d 09 65 77 4c 69 73 74 |x)).../*|..ewList|
|00000c40| 20 70 6f 69 6e 74 73 20 | 74 6f 20 61 20 6c 69 73 | points |to a lis|
|00000c50| 74 20 6f 66 20 73 74 72 | 75 63 74 75 72 65 73 20 |t of str|uctures |
|00000c60| 64 65 73 63 72 69 62 69 | 6e 67 20 74 68 65 20 6b |describi|ng the k|
|00000c70| 6e 6f 77 6e 20 65 64 69 | 74 0d 09 77 69 6e 64 6f |nown edi|t..windo|
|00000c80| 77 73 2e 0d 2a 2f 0d 0d | 0d 74 79 70 65 64 65 66 |ws..*/..|.typedef|
|00000c90| 20 73 74 72 75 63 74 20 | 45 64 69 74 49 6e 66 6f | struct |EditInfo|
|00000ca0| 0d 7b 0d 09 57 69 6e 64 | 6f 77 50 74 72 09 09 65 |.{..Wind|owPtr..e|
|00000cb0| 64 69 74 57 69 6e 64 3b | 09 2f 2a 20 74 68 65 20 |ditWind;|./* the |
|00000cc0| 65 64 69 74 20 77 69 6e | 64 6f 77 20 20 20 20 20 |edit win|dow |
|00000cd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2a 2f | | */|
|00000ce0| 0d 09 42 6f 6f 6c 65 61 | 6e 09 09 09 62 6f 75 6e |..Boolea|n...boun|
|00000cf0| 64 3b 09 09 2f 2a 20 77 | 68 65 74 68 65 72 20 77 |d;../* w|hether w|
|00000d00| 69 6e 64 6f 77 20 69 73 | 20 62 6f 75 6e 64 20 74 |indow is| bound t|
|00000d10| 6f 20 66 69 6c 65 20 20 | 20 2a 2f 0d 09 53 46 52 |o file | */..SFR|
|00000d20| 65 70 6c 79 09 09 09 65 | 64 69 74 46 69 6c 65 3b |eply...e|ditFile;|
|00000d30| 09 2f 2a 20 66 69 6c 65 | 20 69 74 27 73 20 62 6f |./* file| it's bo|
|00000d40| 75 6e 64 20 74 6f 2c 20 | 69 66 20 62 6f 75 6e 64 |und to, |if bound|
|00000d50| 20 74 72 75 65 20 2a 2f | 0d 09 54 45 48 61 6e 64 | true */|..TEHand|
|00000d60| 6c 65 09 09 65 64 69 74 | 54 45 3b 09 09 2f 2a 20 |le..edit|TE;../* |
|00000d70| 77 69 6e 64 6f 77 20 74 | 65 78 74 20 20 20 20 20 |window t|ext |
|00000d80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000d90| 20 20 2a 2f 0d 09 42 6f | 6f 6c 65 61 6e 09 09 09 | */..Bo|olean...|
|00000da0| 64 69 72 74 79 3b 09 09 | 2f 2a 20 77 68 65 74 68 |dirty;..|/* wheth|
|00000db0| 65 72 20 74 65 78 74 20 | 6d 6f 64 69 66 69 65 64 |er text |modified|
|00000dc0| 20 73 69 6e 63 65 20 73 | 61 76 65 20 20 2a 2f 0d | since s|ave */.|
|00000dd0| 09 43 6f 6e 74 72 6f 6c | 48 61 6e 64 6c 65 09 73 |.Control|Handle.s|
|00000de0| 63 72 6f 6c 6c 3b 09 09 | 2f 2a 20 73 63 72 6f 6c |croll;..|/* scrol|
|00000df0| 6c 20 62 61 72 20 20 20 | 20 20 20 20 20 20 20 20 |l bar | |
|00000e00| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2a 2f 0d | | */.|
|00000e10| 09 49 6e 74 65 67 65 72 | 09 09 09 76 69 73 4c 69 |.Integer|...visLi|
|00000e20| 6e 65 73 3b 09 2f 2a 20 | 23 20 6c 69 6e 65 73 20 |nes;./* |# lines |
|00000e30| 76 69 73 69 62 6c 65 20 | 69 6e 20 77 69 6e 64 6f |visible |in windo|
|00000e40| 77 2c 20 6d 61 78 20 20 | 20 20 2a 2f 0d 09 50 72 |w, max | */..Pr|
|00000e50| 6f 63 50 74 72 09 09 09 | 65 4b 65 79 3b 09 09 2f |ocPtr...|eKey;../|
|00000e60| 2a 20 6b 65 79 20 63 6c | 69 63 6b 20 6e 6f 74 69 |* key cl|ick noti|
|00000e70| 66 69 65 72 20 20 20 20 | 20 20 20 20 20 20 20 20 |fier | |
|00000e80| 20 20 20 20 2a 2f 0d 09 | 50 72 6f 63 50 74 72 09 | */..|ProcPtr.|
|00000e90| 09 09 65 41 63 74 69 76 | 61 74 65 3b 09 2f 2a 20 |..eActiv|ate;./* |
|00000ea0| 61 63 74 69 76 61 74 65 | 20 65 76 65 6e 74 20 6e |activate| event n|
|00000eb0| 6f 74 69 66 69 65 72 20 | 20 20 20 20 20 20 20 20 |otifier | |
|00000ec0| 20 20 2a 2f 0d 09 50 72 | 6f 63 50 74 72 09 09 09 | */..Pr|ocPtr...|
|00000ed0| 65 43 6c 6f 73 65 3b 09 | 09 2f 2a 20 63 6c 6f 73 |eClose;.|./* clos|
|00000ee0| 65 20 6e 6f 74 69 66 69 | 65 72 20 20 20 20 20 20 |e notifi|er |
|00000ef0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2a 2f | | */|
|00000f00| 0d 09 73 74 72 75 63 74 | 20 45 64 69 74 49 6e 66 |..struct| EditInf|
|00000f10| 6f 09 2a 2a 65 4e 65 78 | 74 3b 09 2f 2a 20 6e 65 |o.**eNex|t;./* ne|
|00000f20| 78 74 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 73 |xt infor|mation s|
|00000f30| 74 72 75 63 74 75 72 65 | 20 20 20 20 20 20 20 20 |tructure| |
|00000f40| 2a 2f 0d 7d 20 45 64 69 | 74 49 6e 66 6f 2c 20 2a |*/.} Edi|tInfo, *|
|00000f50| 45 49 50 74 72 2c 20 2a | 2a 45 49 48 61 6e 64 6c |EIPtr, *|*EIHandl|
|00000f60| 65 3b 0d 0d 0d 73 74 61 | 74 69 63 20 45 49 48 61 |e;...sta|tic EIHa|
|00000f70| 6e 64 6c 65 09 09 65 77 | 4c 69 73 74 20 3d 20 6e |ndle..ew|List = n|
|00000f80| 69 6c 3b 0d 0d 23 20 65 | 6e 64 69 66 0d 0d 0d 2f |il;..# e|ndif.../|
|00000f90| 2a 0d 09 47 6c 6f 62 61 | 6c 20 76 61 72 69 61 62 |*..Globa|l variab|
|00000fa0| 6c 65 73 20 2d 20 6d 6f | 73 74 20 6f 66 20 74 68 |les - mo|st of th|
|00000fb0| 65 73 65 20 61 72 65 20 | 61 6c 77 61 79 73 20 73 |ese are |always s|
|00000fc0| 79 6e 63 65 64 20 74 6f | 0d 09 74 68 65 20 63 75 |ynced to|..the cu|
|00000fd0| 72 72 65 6e 74 20 77 69 | 6e 64 6f 77 2e 20 20 4e |rrent wi|ndow. N|
|00000fe0| 6f 74 65 20 74 68 61 74 | 20 6e 6f 74 20 61 6c 6c |ote that| not all|
|00000ff0| 20 74 68 65 73 65 20 61 | 72 65 20 73 65 74 20 62 | these a|re set b|
|00001000| 79 0d 09 53 79 6e 63 47 | 6c 6f 62 61 6c 73 2c 20 |y..SyncG|lobals, |
|00001010| 73 69 6e 63 65 20 73 6f | 6d 65 20 61 72 65 20 6e |since so|me are n|
|00001020| 6f 74 20 6f 66 74 65 6e | 20 6e 65 65 64 65 64 2e |ot often| needed.|
|00001030| 20 20 57 68 65 6e 20 74 | 68 65 79 0d 09 61 72 65 | When t|hey..are|
|00001040| 20 61 6c 6c 20 6e 65 65 | 64 65 64 2c 20 75 73 65 | all nee|ded, use|
|00001050| 20 53 79 6e 63 41 6c 6c | 47 6c 6f 62 61 6c 73 2e | SyncAll|Globals.|
|00001060| 0d 2a 2f 0d 0d 23 20 69 | 66 6e 64 65 66 09 73 69 |.*/..# i|fndef.si|
|00001070| 6e 67 6c 65 45 64 69 74 | 0d 73 74 61 74 69 63 20 |ngleEdit|.static |
|00001080| 45 49 48 61 6e 64 6c 65 | 09 09 09 65 64 69 74 49 |EIHandle|...editI|
|00001090| 6e 66 6f 3b 09 09 2f 2a | 20 77 69 6e 64 6f 77 27 |nfo;../*| window'|
|000010a0| 73 20 69 6e 66 6f 20 73 | 74 72 75 63 74 75 72 65 |s info s|tructure|
|000010b0| 20 20 20 20 20 20 2a 2f | 0d 23 20 65 6e 64 69 66 | */|.# endif|
|000010c0| 0d 0d 73 74 61 74 69 63 | 20 57 69 6e 64 6f 77 50 |..static| WindowP|
|000010d0| 74 72 09 09 65 64 69 74 | 57 69 6e 64 20 3d 20 6e |tr..edit|Wind = n|
|000010e0| 69 6c 3b 09 2f 2a 20 74 | 68 65 20 77 69 6e 64 6f |il;./* t|he windo|
|000010f0| 77 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |w | |
|00001100| 20 20 20 20 2a 2f 0d 73 | 74 61 74 69 63 20 54 45 | */.s|tatic TE|
|00001110| 48 61 6e 64 6c 65 09 09 | 09 65 64 69 74 54 45 3b |Handle..|.editTE;|
|00001120| 09 09 09 2f 2a 20 77 69 | 6e 64 6f 77 20 74 65 78 |.../* wi|ndow tex|
|00001130| 74 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |t | |
|00001140| 20 20 20 2a 2f 0d 73 74 | 61 74 69 63 20 43 6f 6e | */.st|atic Con|
|00001150| 74 72 6f 6c 48 61 6e 64 | 6c 65 09 65 64 69 74 53 |trolHand|le.editS|
|00001160| 63 72 6f 6c 6c 3b 09 09 | 2f 2a 20 74 68 65 20 73 |croll;..|/* the s|
|00001170| 63 72 6f 6c 6c 20 62 61 | 72 20 20 20 20 20 20 20 |croll ba|r |
|00001180| 20 20 20 20 20 20 20 20 | 2a 2f 0d 73 74 61 74 69 | |*/.stati|
|00001190| 63 20 53 46 52 65 70 6c | 79 09 09 09 65 64 69 74 |c SFRepl|y...edit|
|000011a0| 46 69 6c 65 3b 09 09 2f | 2a 20 66 69 6c 65 20 69 |File;../|* file i|
|000011b0| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 20 20 20 20 20 |nformati|on |
|000011c0| 20 20 20 20 20 20 20 2a | 2f 0d 73 74 61 74 69 63 | *|/.static|
|000011d0| 20 49 6e 74 65 67 65 72 | 09 09 09 76 69 73 4c 69 | Integer|...visLi|
|000011e0| 6e 65 73 3b 09 09 2f 2a | 20 6e 75 6d 62 65 72 20 |nes;../*| number |
|000011f0| 6f 66 20 6c 69 6e 65 73 | 20 69 6e 20 77 69 6e 64 |of lines| in wind|
|00001200| 6f 77 20 20 20 20 2a 2f | 0d 73 74 61 74 69 63 20 |ow */|.static |
|00001210| 42 6f 6f 6c 65 61 6e 09 | 09 09 62 6f 75 6e 64 3b |Boolean.|..bound;|
|00001220| 09 09 09 2f 2a 20 74 72 | 75 65 20 69 66 20 77 69 |.../* tr|ue if wi|
|00001230| 6e 64 6f 77 20 62 6f 75 | 6e 64 20 74 6f 20 66 69 |ndow bou|nd to fi|
|00001240| 6c 65 20 2a 2f 0d 73 74 | 61 74 69 63 20 42 6f 6f |le */.st|atic Boo|
|00001250| 6c 65 61 6e 09 09 09 64 | 69 72 74 79 3b 09 09 09 |lean...d|irty;...|
|00001260| 2f 2a 20 77 68 65 74 68 | 65 72 20 77 69 6e 64 6f |/* wheth|er windo|
|00001270| 77 20 69 73 20 64 69 72 | 74 79 20 20 20 20 20 20 |w is dir|ty |
|00001280| 2a 2f 0d 73 74 61 74 69 | 63 20 50 72 6f 63 50 74 |*/.stati|c ProcPt|
|00001290| 72 09 09 09 65 4b 65 79 | 3b 09 09 09 2f 2a 20 6b |r...eKey|;.../* k|
|000012a0| 65 79 20 63 6c 69 63 6b | 20 6e 6f 74 69 66 69 65 |ey click| notifie|
|000012b0| 72 20 20 20 20 20 20 20 | 20 20 20 20 2a 2f 0d 73 |r | */.s|
|000012c0| 74 61 74 69 63 20 50 72 | 6f 63 50 74 72 09 09 09 |tatic Pr|ocPtr...|
|000012d0| 65 41 63 74 69 76 61 74 | 65 3b 09 09 2f 2a 20 61 |eActivat|e;../* a|
|000012e0| 63 74 69 76 61 74 65 20 | 65 76 65 6e 74 20 6e 6f |ctivate |event no|
|000012f0| 74 69 66 69 65 72 20 20 | 20 20 20 20 2a 2f 0d 73 |tifier | */.s|
|00001300| 74 61 74 69 63 20 50 72 | 6f 63 50 74 72 09 09 09 |tatic Pr|ocPtr...|
|00001310| 65 43 6c 6f 73 65 3b 09 | 09 09 2f 2a 20 63 6c 6f |eClose;.|../* clo|
|00001320| 73 65 20 6e 6f 74 69 66 | 69 65 72 20 20 20 20 20 |se notif|ier |
|00001330| 20 20 20 20 20 20 20 20 | 20 20 2a 2f 0d 0d 0d 73 | | */...s|
|00001340| 74 61 74 69 63 20 49 6e | 74 65 67 65 72 09 77 69 |tatic In|teger.wi|
|00001350| 6e 64 49 44 20 3d 20 30 | 3b 0d 73 74 61 74 69 63 |ndID = 0|;.static|
|00001360| 20 50 6f 69 6e 74 09 64 | 6c 6f 67 57 68 65 72 65 | Point.d|logWhere|
|00001370| 20 3d 20 7b 20 37 30 2c | 20 31 30 30 20 7d 3b 09 | = { 70,| 100 };.|
|00001380| 2f 2a 20 47 65 74 46 69 | 6c 65 2f 50 75 74 46 69 |/* GetFi|le/PutFi|
|00001390| 6c 65 20 6c 6f 63 61 74 | 69 6f 6e 20 2a 2f 0d 73 |le locat|ion */.s|
|000013a0| 74 61 74 69 63 20 4f 53 | 54 79 70 65 09 63 72 65 |tatic OS|Type.cre|
|000013b0| 61 74 6f 72 20 3d 20 27 | 54 45 44 54 27 3b 09 09 |ator = '|TEDT';..|
|000013c0| 09 2f 2a 20 64 65 66 61 | 75 6c 74 20 66 69 6c 65 |./* defa|ult file|
|000013d0| 20 63 72 65 61 74 6f 72 | 20 2a 2f 0d 0d 73 74 61 | creator| */..sta|
|000013e0| 74 69 63 20 52 67 6e 48 | 61 6e 64 6c 65 09 63 6c |tic RgnH|andle.cl|
|000013f0| 69 70 52 67 6e 3b 0d 0d | 0d 2f 2a 20 2d 2d 2d 2d |ipRgn;..|./* ----|
|00001400| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001410| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001420| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001430| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001440| 20 2a 2f 0d 2f 2a 09 09 | 09 09 4d 69 73 63 65 6c | */./*..|..Miscel|
|00001450| 6c 61 6e 65 6f 75 73 20 | 49 6e 74 65 72 6e 61 6c |laneous |Internal|
|00001460| 20 28 70 72 69 76 61 74 | 65 29 20 52 6f 75 74 69 | (privat|e) Routi|
|00001470| 6e 65 73 09 09 09 09 2a | 2f 0d 2f 2a 20 2d 2d 2d |nes....*|/./* ---|
|00001480| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001490| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000014a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000014b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000014c0| 2d 20 2a 2f 0d 0d 0d 2f | 2a 0d 09 53 61 76 65 20 |- */.../|*..Save |
|000014d0| 61 6e 64 20 72 65 73 74 | 6f 72 65 20 74 68 65 20 |and rest|ore the |
|000014e0| 63 75 72 72 65 6e 74 20 | 77 69 6e 64 6f 77 27 73 |current |window's|
|000014f0| 20 63 6c 69 70 20 72 65 | 67 69 6f 6e 0d 2a 2f 0d | clip re|gion.*/.|
|00001500| 0d 73 74 61 74 69 63 20 | 53 61 76 65 43 6c 69 70 |.static |SaveClip|
|00001510| 52 67 6e 20 28 29 0d 7b | 0d 09 63 6c 69 70 52 67 |Rgn ().{|..clipRg|
|00001520| 6e 20 3d 20 4e 65 77 52 | 67 6e 20 28 29 3b 0d 09 |n = NewR|gn ();..|
|00001530| 47 65 74 43 6c 69 70 20 | 28 63 6c 69 70 52 67 6e |GetClip |(clipRgn|
|00001540| 29 3b 0d 7d 0d 0d 0d 73 | 74 61 74 69 63 20 52 65 |);.}...s|tatic Re|
|00001550| 73 74 6f 72 65 43 6c 69 | 70 52 67 6e 20 28 29 0d |storeCli|pRgn ().|
|00001560| 7b 0d 09 53 65 74 43 6c | 69 70 20 28 63 6c 69 70 |{..SetCl|ip (clip|
|00001570| 52 67 6e 29 3b 0d 09 44 | 69 73 70 6f 73 65 52 67 |Rgn);..D|isposeRg|
|00001580| 6e 20 28 63 6c 69 70 52 | 67 6e 29 3b 0d 7d 0d 0d |n (clipR|gn);.}..|
|00001590| 0d 2f 2a 0d 09 44 72 61 | 77 20 67 72 6f 77 20 62 |./*..Dra|w grow b|
|000015a0| 6f 78 20 69 6e 20 6c 6f | 77 65 72 20 72 69 67 68 |ox in lo|wer righ|
|000015b0| 74 20 68 61 6e 64 20 63 | 6f 72 6e 65 72 20 6f 66 |t hand c|orner of|
|000015c0| 20 77 69 6e 64 6f 77 2e | 0d 2a 2f 0d 0d 0d 73 74 | window.|.*/...st|
|000015d0| 61 74 69 63 20 44 72 61 | 77 47 72 6f 77 42 6f 78 |atic Dra|wGrowBox|
|000015e0| 20 28 29 0d 7b 0d 52 65 | 63 74 09 72 3b 0d 0d 09 | ().{.Re|ct.r;...|
|000015f0| 53 61 76 65 43 6c 69 70 | 52 67 6e 20 28 29 3b 0d |SaveClip|Rgn ();.|
|00001600| 09 72 20 3d 20 65 64 69 | 74 57 69 6e 64 2d 3e 70 |.r = edi|tWind->p|
|00001610| 6f 72 74 52 65 63 74 3b | 0d 09 72 2e 6c 65 66 74 |ortRect;|..r.left|
|00001620| 20 3d 20 72 2e 72 69 67 | 68 74 20 2d 20 31 35 3b | = r.rig|ht - 15;|
|00001630| 09 09 2f 2a 20 64 72 61 | 77 20 6f 6e 6c 79 20 69 |../* dra|w only i|
|00001640| 6e 20 63 6f 72 6e 65 72 | 20 2a 2f 0d 09 72 2e 74 |n corner| */..r.t|
|00001650| 6f 70 20 3d 20 72 2e 62 | 6f 74 74 6f 6d 20 2d 20 |op = r.b|ottom - |
|00001660| 31 35 3b 0d 09 43 6c 69 | 70 52 65 63 74 20 28 26 |15;..Cli|pRect (&|
|00001670| 72 29 3b 0d 09 44 72 61 | 77 47 72 6f 77 49 63 6f |r);..Dra|wGrowIco|
|00001680| 6e 20 28 65 64 69 74 57 | 69 6e 64 29 3b 0d 09 52 |n (editW|ind);..R|
|00001690| 65 73 74 6f 72 65 43 6c | 69 70 52 67 6e 20 28 29 |estoreCl|ipRgn ()|
|000016a0| 3b 0d 7d 0d 0d 0d 2f 2a | 20 2d 2d 2d 2d 2d 2d 2d |;.}.../*| -------|
|000016b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000016c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000016d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000016e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 20 2a 2f |--------|----- */|
|000016f0| 0d 2f 2a 09 09 09 4c 6f | 77 65 73 74 2d 6c 65 76 |./*...Lo|west-lev|
|00001700| 65 6c 20 49 6e 74 65 72 | 6e 61 6c 20 28 50 72 69 |el Inter|nal (Pri|
|00001710| 76 61 74 65 29 20 45 64 | 69 74 20 57 69 6e 64 6f |vate) Ed|it Windo|
|00001720| 77 20 52 6f 75 74 69 6e | 65 73 09 09 2a 2f 0d 2f |w Routin|es..*/./|
|00001730| 2a 20 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |* ------|--------|
|00001740| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001750| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001760| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001770| 2d 2d 2d 2d 2d 2d 20 2a | 2f 0d 0d 0d 23 20 69 66 |------ *|/...# if|
|00001780| 6e 64 65 66 09 73 69 6e | 67 6c 65 45 64 69 74 0d |ndef.sin|gleEdit.|
|00001790| 0d 2f 2a 0d 09 47 65 74 | 20 65 64 69 74 20 77 69 |./*..Get| edit wi|
|000017a0| 6e 64 6f 77 20 69 6e 66 | 6f 20 61 73 73 6f 63 69 |ndow inf|o associ|
|000017b0| 61 74 65 64 20 77 69 74 | 68 20 77 69 6e 64 6f 77 |ated wit|h window|
|000017c0| 2e 0d 09 52 65 74 75 72 | 6e 20 6e 69 6c 20 69 66 |...Retur|n nil if|
|000017d0| 20 77 69 6e 64 6f 77 20 | 69 73 6e 27 74 20 61 20 | window |isn't a |
|000017e0| 6b 6e 6f 77 6e 20 65 64 | 69 74 20 77 69 6e 64 6f |known ed|it windo|
|000017f0| 77 2e 0d 2a 2f 0d 0d 73 | 74 61 74 69 63 20 45 49 |w..*/..s|tatic EI|
|00001800| 48 61 6e 64 6c 65 20 47 | 65 74 45 49 6e 66 6f 20 |Handle G|etEInfo |
|00001810| 28 74 68 65 57 69 6e 64 | 29 0d 57 69 6e 64 6f 77 |(theWind|).Window|
|00001820| 50 74 72 09 74 68 65 57 | 69 6e 64 3b 0d 7b 0d 72 |Ptr.theW|ind;.{.r|
|00001830| 65 67 69 73 74 65 72 20 | 45 49 48 61 6e 64 6c 65 |egister |EIHandle|
|00001840| 09 68 3b 0d 0d 09 66 6f | 72 20 28 68 20 3d 20 65 |.h;...fo|r (h = e|
|00001850| 77 4c 69 73 74 3b 20 68 | 20 21 3d 20 6e 69 6c 3b |wList; h| != nil;|
|00001860| 20 68 20 3d 20 28 2a 2a | 68 29 2e 65 4e 65 78 74 | h = (**|h).eNext|
|00001870| 29 0d 09 7b 0d 09 09 69 | 66 20 28 28 2a 2a 68 29 |)..{...i|f ((**h)|
|00001880| 2e 65 64 69 74 57 69 6e | 64 20 3d 3d 20 74 68 65 |.editWin|d == the|
|00001890| 57 69 6e 64 29 0d 09 09 | 09 72 65 74 75 72 6e 20 |Wind)...|.return |
|000018a0| 28 68 29 3b 0d 09 7d 0d | 09 72 65 74 75 72 6e 20 |(h);..}.|.return |
|000018b0| 28 6e 69 6c 29 3b 0d 7d | 0d 0d 23 20 65 6e 64 69 |(nil);.}|..# endi|
|000018c0| 66 0d 0d 0d 23 20 69 66 | 64 65 66 09 73 69 6e 67 |f...# if|def.sing|
|000018d0| 6c 65 45 64 69 74 0d 23 | 20 64 65 66 69 6e 65 09 |leEdit.#| define.|
|000018e0| 53 79 6e 63 41 6c 6c 47 | 6c 6f 62 61 6c 73 09 53 |SyncAllG|lobals.S|
|000018f0| 79 6e 63 47 6c 6f 62 61 | 6c 73 0d 23 20 65 6e 64 |yncGloba|ls.# end|
|00001900| 69 66 0d 0d 0d 2f 2a 0d | 09 53 79 6e 63 68 72 6f |if.../*.|.Synchro|
|00001910| 6e 69 7a 65 20 67 6c 6f | 62 61 6c 73 20 74 6f 20 |nize glo|bals to |
|00001920| 61 6e 20 65 64 69 74 20 | 77 69 6e 64 6f 77 20 61 |an edit |window a|
|00001930| 6e 64 20 6d 61 6b 65 20 | 69 74 20 74 68 65 0d 09 |nd make |it the..|
|00001940| 63 75 72 72 65 6e 74 20 | 70 6f 72 74 2e 20 20 74 |current |port. t|
|00001950| 68 65 57 69 6e 64 20 6d | 75 73 74 20 62 65 20 61 |heWind m|ust be a|
|00001960| 20 6c 65 67 61 6c 20 65 | 64 69 74 20 77 69 6e 64 | legal e|dit wind|
|00001970| 6f 77 2c 20 77 69 74 68 | 20 6f 6e 65 0d 09 65 78 |ow, with| one..ex|
|00001980| 63 65 70 74 69 6f 6e 3a | 20 20 69 66 20 74 68 65 |ception:| if the|
|00001990| 57 69 6e 64 20 69 73 20 | 6e 69 6c 2c 20 74 68 65 |Wind is |nil, the|
|000019a0| 20 76 61 72 69 61 62 6c | 65 73 20 61 72 65 20 73 | variabl|es are s|
|000019b0| 79 6e 63 65 64 20 74 6f | 20 74 68 65 0d 09 70 6f |ynced to| the..po|
|000019c0| 72 74 20 74 68 61 74 27 | 73 20 61 6c 72 65 61 64 |rt that'|s alread|
|000019d0| 79 20 63 75 72 72 65 6e | 74 2e 20 20 54 68 61 74 |y curren|t. That|
|000019e0| 20 69 73 20 73 61 66 65 | 20 28 61 6e 64 20 63 6f | is safe| (and co|
|000019f0| 72 72 65 63 74 29 20 62 | 65 63 61 75 73 65 3a 0d |rrect) b|ecause:.|
|00001a00| 09 28 69 29 09 20 6e 69 | 6c 20 69 73 20 6f 6e 6c |.(i). ni|l is onl|
|00001a10| 79 20 70 61 73 73 65 64 | 20 62 79 20 65 64 69 74 |y passed| by edit|
|00001a20| 20 77 69 6e 64 6f 77 20 | 68 61 6e 64 6c 65 72 20 | window |handler |
|00001a30| 70 72 6f 63 65 64 75 72 | 65 73 2c 0d 09 09 20 77 |procedur|es,... w|
|00001a40| 68 69 63 68 20 61 72 65 | 20 6f 6e 6c 79 20 61 74 |hich are| only at|
|00001a50| 74 61 63 68 65 64 20 74 | 6f 20 65 64 69 74 20 77 |tached t|o edit w|
|00001a60| 69 6e 64 6f 77 73 0d 09 | 28 69 69 29 20 46 6f 72 |indows..|(ii) For|
|00001a70| 20 74 68 6f 73 65 20 68 | 61 6e 64 6c 65 72 20 70 | those h|andler p|
|00001a80| 72 6f 63 73 20 74 68 61 | 74 20 70 61 73 73 20 6e |rocs tha|t pass n|
|00001a90| 69 6c 2c 20 54 72 61 6e | 73 53 6b 65 6c 20 65 69 |il, Tran|sSkel ei|
|00001aa0| 74 68 65 72 20 73 65 74 | 73 0d 09 09 20 74 68 65 |ther set|s... the|
|00001ab0| 20 70 6f 72 74 20 74 6f | 20 74 68 65 20 77 69 6e | port to| the win|
|00001ac0| 64 6f 77 20 62 65 66 6f | 72 65 20 63 61 6c 6c 69 |dow befo|re calli|
|00001ad0| 6e 67 20 74 68 65 20 70 | 72 6f 63 20 28 75 70 64 |ng the p|roc (upd|
|00001ae0| 61 74 65 2c 20 63 6c 6f | 62 62 65 72 2c 0d 09 09 |ate, clo|bber,...|
|00001af0| 20 69 64 6c 65 20 70 72 | 6f 63 73 29 2c 20 6f 72 | idle pr|ocs), or|
|00001b00| 20 74 68 65 20 77 69 6e | 64 6f 77 20 69 73 20 66 | the win|dow is f|
|00001b10| 72 6f 6e 74 6d 6f 73 74 | 2c 20 61 6e 64 20 73 6f |rontmost|, and so|
|00001b20| 20 77 69 6c 6c 20 62 65 | 20 74 68 65 0d 09 09 20 | will be| the... |
|00001b30| 63 75 72 72 65 6e 74 20 | 70 6f 72 74 20 61 6e 79 |current |port any|
|00001b40| 77 61 79 20 28 6d 6f 75 | 73 65 2c 20 6b 65 79 20 |way (mou|se, key |
|00001b50| 70 72 6f 63 73 29 2e 0d | 09 48 65 6e 63 65 2c 20 |procs)..|.Hence, |
|00001b60| 75 73 69 6e 67 20 74 68 | 65 20 63 75 72 72 65 6e |using th|e curren|
|00001b70| 74 20 70 6f 72 74 20 75 | 6e 64 65 72 20 74 68 65 |t port u|nder the|
|00001b80| 73 65 20 63 69 72 63 75 | 6d 73 74 61 6e 63 65 73 |se circu|mstances|
|00001b90| 20 61 6c 77 61 79 73 0d | 09 70 72 6f 64 75 63 65 | always.|.produce|
|00001ba0| 73 20 61 20 6c 65 67 61 | 6c 20 65 64 69 74 20 77 |s a lega|l edit w|
|00001bb0| 69 6e 64 6f 77 2e 0d 2a | 2f 0d 0d 73 74 61 74 69 |indow..*|/..stati|
|00001bc0| 63 20 53 79 6e 63 47 6c | 6f 62 61 6c 73 20 28 74 |c SyncGl|obals (t|
|00001bd0| 68 65 57 69 6e 64 29 0d | 57 69 6e 64 6f 77 50 74 |heWind).|WindowPt|
|00001be0| 72 09 74 68 65 57 69 6e | 64 3b 0d 7b 0d 0d 09 69 |r.theWin|d;.{...i|
|00001bf0| 66 20 28 74 68 65 57 69 | 6e 64 20 3d 3d 20 6e 69 |f (theWi|nd == ni|
|00001c00| 6c 29 09 09 09 09 09 2f | 2a 20 75 73 65 20 63 75 |l)...../|* use cu|
|00001c10| 72 72 65 6e 74 20 77 69 | 6e 64 6f 77 20 2a 2f 0d |rrent wi|ndow */.|
|00001c20| 09 09 47 65 74 50 6f 72 | 74 20 28 26 74 68 65 57 |..GetPor|t (&theW|
|00001c30| 69 6e 64 29 3b 0d 0d 09 | 53 65 74 50 6f 72 74 20 |ind);...|SetPort |
|00001c40| 28 74 68 65 57 69 6e 64 | 29 3b 0d 0d 23 20 69 66 |(theWind|);..# if|
|00001c50| 6e 64 65 66 09 73 69 6e | 67 6c 65 45 64 69 74 0d |ndef.sin|gleEdit.|
|00001c60| 0d 2f 2a 0d 09 44 6f 6e | 27 74 20 6e 65 65 64 20 |./*..Don|'t need |
|00001c70| 74 6f 20 73 65 74 20 74 | 68 65 73 65 20 69 66 20 |to set t|hese if |
|00001c80| 73 69 6e 67 6c 65 45 64 | 69 74 20 2d 20 74 68 65 |singleEd|it - the|
|00001c90| 79 20 77 69 6c 6c 20 68 | 61 76 65 20 62 65 65 6e |y will h|ave been|
|00001ca0| 20 73 65 74 0d 09 69 6e | 20 4e 65 77 45 57 69 6e | set..in| NewEWin|
|00001cb0| 64 6f 77 2e 2e 2e 0d 2a | 2f 0d 0d 09 65 64 69 74 |dow....*|/...edit|
|00001cc0| 57 69 6e 64 20 3d 20 74 | 68 65 57 69 6e 64 3b 0d |Wind = t|heWind;.|
|00001cd0| 09 65 64 69 74 49 6e 66 | 6f 20 3d 20 47 65 74 45 |.editInf|o = GetE|
|00001ce0| 49 6e 66 6f 20 28 65 64 | 69 74 57 69 6e 64 29 3b |Info (ed|itWind);|
|00001cf0| 0d 09 65 64 69 74 54 45 | 20 3d 20 28 2a 2a 65 64 |..editTE| = (**ed|
|00001d00| 69 74 49 6e 66 6f 29 2e | 65 64 69 74 54 45 3b 0d |itInfo).|editTE;.|
|00001d10| 09 65 64 69 74 53 63 72 | 6f 6c 6c 20 3d 20 28 2a |.editScr|oll = (*|
|00001d20| 2a 65 64 69 74 49 6e 66 | 6f 29 2e 73 63 72 6f 6c |*editInf|o).scrol|
|00001d30| 6c 3b 0d 09 76 69 73 4c | 69 6e 65 73 20 3d 20 28 |l;..visL|ines = (|
|00001d40| 2a 2a 65 64 69 74 49 6e | 66 6f 29 2e 76 69 73 4c |**editIn|fo).visL|
|00001d50| 69 6e 65 73 3b 0d 0d 23 | 20 65 6e 64 69 66 0d 0d |ines;..#| endif..|
|00001d60| 7d 0d 0d 0d 23 20 69 66 | 6e 64 65 66 09 73 69 6e |}...# if|ndef.sin|
|00001d70| 67 6c 65 45 64 69 74 0d | 0d 73 74 61 74 69 63 20 |gleEdit.|.static |
|00001d80| 53 79 6e 63 41 6c 6c 47 | 6c 6f 62 61 6c 73 20 28 |SyncAllG|lobals (|
|00001d90| 74 68 65 57 69 6e 64 29 | 0d 57 69 6e 64 6f 77 50 |theWind)|.WindowP|
|00001da0| 74 72 09 74 68 65 57 69 | 6e 64 3b 0d 7b 0d 0d 09 |tr.theWi|nd;.{...|
|00001db0| 53 79 6e 63 47 6c 6f 62 | 61 6c 73 20 28 74 68 65 |SyncGlob|als (the|
|00001dc0| 57 69 6e 64 29 3b 09 09 | 09 09 2f 2a 20 73 79 6e |Wind);..|../* syn|
|00001dd0| 63 20 64 69 73 70 6c 61 | 79 20 67 6c 6f 62 61 6c |c displa|y global|
|00001de0| 73 20 2a 2f 0d 09 65 64 | 69 74 46 69 6c 65 20 3d |s */..ed|itFile =|
|00001df0| 20 28 2a 2a 65 64 69 74 | 49 6e 66 6f 29 2e 65 64 | (**edit|Info).ed|
|00001e00| 69 74 46 69 6c 65 3b 09 | 2f 2a 20 73 79 6e 63 20 |itFile;.|/* sync |
|00001e10| 66 69 6c 65 2c 20 73 74 | 61 74 65 2c 20 61 6e 64 |file, st|ate, and|
|00001e20| 20 2a 2f 0d 09 62 6f 75 | 6e 64 20 3d 20 28 2a 2a | */..bou|nd = (**|
|00001e30| 65 64 69 74 49 6e 66 6f | 29 2e 62 6f 75 6e 64 3b |editInfo|).bound;|
|00001e40| 09 09 09 2f 2a 20 70 72 | 6f 63 65 64 75 72 65 20 |.../* pr|ocedure |
|00001e50| 67 6c 6f 62 61 6c 73 20 | 2a 2f 0d 09 64 69 72 74 |globals |*/..dirt|
|00001e60| 79 20 3d 20 28 2a 2a 65 | 64 69 74 49 6e 66 6f 29 |y = (**e|ditInfo)|
|00001e70| 2e 64 69 72 74 79 3b 0d | 09 65 4b 65 79 20 3d 20 |.dirty;.|.eKey = |
|00001e80| 28 2a 2a 65 64 69 74 49 | 6e 66 6f 29 2e 65 4b 65 |(**editI|nfo).eKe|
|00001e90| 79 3b 0d 09 65 41 63 74 | 69 76 61 74 65 20 3d 20 |y;..eAct|ivate = |
|00001ea0| 28 2a 2a 65 64 69 74 49 | 6e 66 6f 29 2e 65 41 63 |(**editI|nfo).eAc|
|00001eb0| 74 69 76 61 74 65 3b 0d | 09 65 43 6c 6f 73 65 20 |tivate;.|.eClose |
|00001ec0| 3d 20 28 2a 2a 65 64 69 | 74 49 6e 66 6f 29 2e 65 |= (**edi|tInfo).e|
|00001ed0| 43 6c 6f 73 65 3b 0d 7d | 0d 0d 23 20 65 6e 64 69 |Close;.}|..# endi|
|00001ee0| 66 0d 0d 0d 2f 2a 0d 09 | 53 65 74 20 64 69 72 74 |f.../*..|Set dirt|
|00001ef0| 79 20 66 6c 61 67 20 66 | 6f 72 20 63 75 72 72 65 |y flag f|or curre|
|00001f00| 6e 74 20 77 69 6e 64 6f | 77 0d 2a 2f 0d 0d 73 74 |nt windo|w.*/..st|
|00001f10| 61 74 69 63 20 53 65 74 | 44 69 72 74 79 20 28 62 |atic Set|Dirty (b|
|00001f20| 6f 6f 6c 56 61 6c 29 0d | 42 6f 6f 6c 65 61 6e 09 |oolVal).|Boolean.|
|00001f30| 62 6f 6f 6c 56 61 6c 3b | 0d 7b 0d 0d 23 20 69 66 |boolVal;|.{..# if|
|00001f40| 64 65 66 09 73 69 6e 67 | 6c 65 45 64 69 74 0d 09 |def.sing|leEdit..|
|00001f50| 64 69 72 74 79 20 3d 20 | 62 6f 6f 6c 56 61 6c 3b |dirty = |boolVal;|
|00001f60| 0d 23 20 65 6c 73 65 0d | 09 28 2a 2a 65 64 69 74 |.# else.|.(**edit|
|00001f70| 49 6e 66 6f 29 2e 64 69 | 72 74 79 20 3d 20 62 6f |Info).di|rty = bo|
|00001f80| 6f 6c 56 61 6c 3b 0d 23 | 20 65 6e 64 69 66 0d 7d |olVal;.#| endif.}|
|00001f90| 0d 0d 0d 2f 2a 20 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.../* --|--------|
|00001fa0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001fb0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001fc0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001fd0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 20 2a 2f 0d 2f 2a |--------|-- */./*|
|00001fe0| 09 09 09 09 09 49 6e 74 | 65 72 6e 61 6c 20 28 70 |.....Int|ernal (p|
|00001ff0| 72 69 76 61 74 65 29 20 | 44 69 73 70 6c 61 79 20 |rivate) |Display |
|00002000| 52 6f 75 74 69 6e 65 73 | 09 09 09 09 09 2a 2f 0d |Routines|.....*/.|
|00002010| 2f 2a 20 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |/* -----|--------|
|00002020| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002030| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002040| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00002050| 2d 2d 2d 2d 2d 2d 2d 20 | 2a 2f 0d 0d 0d 2f 2a 0d |------- |*/.../*.|
|00002060| 09 43 61 6c 63 75 6c 61 | 74 65 20 74 68 65 20 64 |.Calcula|te the d|
|00002070| 69 6d 65 6e 73 69 6f 6e | 73 20 6f 66 20 74 68 65 |imension|s of the|
|00002080| 20 65 64 69 74 69 6e 67 | 20 72 65 63 74 61 6e 67 | editing| rectang|
|00002090| 6c 65 20 66 6f 72 0d 09 | 65 64 69 74 57 69 6e 64 |le for..|editWind|
|000020a0| 20 28 77 68 69 63 68 20 | 6d 75 73 74 20 62 65 20 | (which |must be |
|000020b0| 73 65 74 20 70 72 6f 70 | 65 72 6c 79 20 61 6e 64 |set prop|erly and|
|000020c0| 20 69 73 20 61 73 73 75 | 6d 65 64 20 74 6f 20 62 | is assu|med to b|
|000020d0| 65 0d 09 74 68 65 20 63 | 75 72 72 65 6e 74 20 70 |e..the c|urrent p|
|000020e0| 6f 72 74 29 2e 20 20 28 | 54 68 65 20 76 69 65 77 |ort). (|The view|
|000020f0| 52 65 63 74 20 61 6e 64 | 20 64 65 73 74 52 65 63 |Rect and| destRec|
|00002100| 74 20 61 72 65 20 74 68 | 65 0d 09 73 61 6d 65 20 |t are th|e..same |
|00002110| 73 69 7a 65 2e 29 20 20 | 41 73 73 75 6d 65 73 20 |size.) |Assumes |
|00002120| 74 68 65 20 70 6f 72 74 | 2c 20 74 65 78 74 20 66 |the port|, text f|
|00002130| 6f 6e 74 20 61 6e 64 20 | 74 65 78 74 20 73 69 7a |ont and |text siz|
|00002140| 65 20 61 72 65 20 61 6c | 6c 0d 09 73 65 74 20 70 |e are al|l..set p|
|00002150| 72 6f 70 65 72 6c 79 2e | 20 20 54 68 65 20 76 69 |roperly.| The vi|
|00002160| 65 77 52 65 63 74 20 69 | 73 20 73 69 7a 65 64 20 |ewRect i|s sized |
|00002170| 73 6f 20 74 68 61 74 20 | 61 6e 20 69 6e 74 65 67 |so that |an integ|
|00002180| 72 61 6c 0d 09 6e 75 6d | 62 65 72 20 6f 66 20 6c |ral..num|ber of l|
|00002190| 69 6e 65 73 20 63 61 6e | 20 62 65 20 64 69 73 70 |ines can| be disp|
|000021a0| 6c 61 79 65 64 20 69 6e | 20 69 74 2c 20 69 2e 65 |layed in| it, i.e|
|000021b0| 2e 2c 20 73 6f 20 74 68 | 61 74 20 61 0d 09 70 61 |., so th|at a..pa|
|000021c0| 72 74 69 61 6c 20 6c 69 | 6e 65 20 6e 65 76 65 72 |rtial li|ne never|
|000021d0| 20 73 68 6f 77 73 20 61 | 74 20 74 68 65 20 62 6f | shows a|t the bo|
|000021e0| 74 74 6f 6d 2e 20 20 49 | 66 20 74 68 61 74 27 73 |ttom. I|f that's|
|000021f0| 20 6e 6f 74 0d 09 64 6f | 6e 65 2c 20 66 75 6e 6e | not..do|ne, funn|
|00002200| 79 20 74 68 69 6e 67 73 | 20 63 61 6e 20 68 61 70 |y things| can hap|
|00002210| 70 65 6e 20 74 6f 20 74 | 68 65 20 63 61 72 65 74 |pen to t|he caret|
|00002220| 2e 0d 2a 2f 0d 0d 73 74 | 61 74 69 63 20 47 65 74 |..*/..st|atic Get|
|00002230| 45 64 69 74 52 65 63 74 | 20 28 72 29 0d 52 65 63 |EditRect| (r).Rec|
|00002240| 74 09 2a 72 3b 0d 7b 0d | 46 6f 6e 74 49 6e 66 6f |t.*r;.{.|FontInfo|
|00002250| 09 09 66 3b 0d 72 65 67 | 69 73 74 65 72 20 49 6e |..f;.reg|ister In|
|00002260| 74 65 67 65 72 09 6c 69 | 6e 65 48 65 69 67 68 74 |teger.li|neHeight|
|00002270| 3b 0d 0d 09 47 65 74 46 | 6f 6e 74 49 6e 66 6f 20 |;...GetF|ontInfo |
|00002280| 28 26 66 29 3b 0d 09 6c | 69 6e 65 48 65 69 67 68 |(&f);..l|ineHeigh|
|00002290| 74 20 3d 20 66 2e 61 73 | 63 65 6e 74 20 2b 20 66 |t = f.as|cent + f|
|000022a0| 2e 64 65 73 63 65 6e 74 | 20 2b 20 66 2e 6c 65 61 |.descent| + f.lea|
|000022b0| 64 69 6e 67 3b 0d 09 2a | 72 20 3d 20 65 64 69 74 |ding;..*|r = edit|
|000022c0| 57 69 6e 64 2d 3e 70 6f | 72 74 52 65 63 74 3b 0d |Wind->po|rtRect;.|
|000022d0| 09 72 2d 3e 6c 65 66 74 | 20 2b 3d 20 34 3b 0d 09 |.r->left| += 4;..|
|000022e0| 72 2d 3e 72 69 67 68 74 | 20 2d 3d 20 31 37 3b 09 |r->right| -= 17;.|
|000022f0| 09 2f 2a 20 6c 65 61 76 | 65 20 72 6f 6f 6d 20 66 |./* leav|e room f|
|00002300| 6f 72 20 73 63 72 6f 6c | 6c 20 62 61 72 20 2a 2f |or scrol|l bar */|
|00002310| 0d 09 72 2d 3e 74 6f 70 | 20 2b 3d 20 32 3b 0d 09 |..r->top| += 2;..|
|00002320| 72 2d 3e 62 6f 74 74 6f | 6d 20 3d 20 72 2d 3e 74 |r->botto|m = r->t|
|00002330| 6f 70 20 2b 20 28 28 72 | 2d 3e 62 6f 74 74 6f 6d |op + ((r|->bottom|
|00002340| 20 2d 20 72 2d 3e 74 6f | 70 20 2d 20 32 29 20 2f | - r->to|p - 2) /|
|00002350| 20 6c 69 6e 65 48 65 69 | 67 68 74 29 20 2a 20 6c | lineHei|ght) * l|
|00002360| 69 6e 65 48 65 69 67 68 | 74 3b 0d 7d 0d 0d 0d 2f |ineHeigh|t;.}.../|
|00002370| 2a 0d 09 53 65 74 20 74 | 68 65 20 65 64 69 74 20 |*..Set t|he edit |
|00002380| 72 65 63 74 20 70 72 6f | 70 65 72 6c 79 2e 0d 2a |rect pro|perly..*|
|00002390| 2f 0d 0d 73 74 61 74 69 | 63 20 53 65 74 45 64 69 |/..stati|c SetEdi|
|000023a0| 74 52 65 63 74 20 28 29 | 0d 7b 0d 52 65 63 74 09 |tRect ()|.{.Rect.|
|000023b0| 72 3b 0d 0d 09 47 65 74 | 45 64 69 74 52 65 63 74 |r;...Get|EditRect|
|000023c0| 20 28 26 72 29 3b 0d 09 | 28 2a 2a 65 64 69 74 54 | (&r);..|(**editT|
|000023d0| 45 29 2e 64 65 73 74 52 | 65 63 74 2e 72 69 67 68 |E).destR|ect.righ|
|000023e0| 74 20 3d 20 72 2e 72 69 | 67 68 74 3b 0d 09 28 2a |t = r.ri|ght;..(*|
|000023f0| 2a 65 64 69 74 54 45 29 | 2e 76 69 65 77 52 65 63 |*editTE)|.viewRec|
|00002400| 74 20 3d 20 72 3b 0d 7d | 0d 0d 0d 0d 2f 2a 0d 09 |t = r;.}|..../*..|
|00002410| 43 61 6c 63 75 6c 61 74 | 65 20 74 68 65 20 64 69 |Calculat|e the di|
|00002420| 6d 65 6e 73 69 6f 6e 73 | 20 6f 66 20 74 68 65 20 |mensions| of the |
|00002430| 73 63 72 6f 6c 6c 20 62 | 61 72 20 72 65 63 74 61 |scroll b|ar recta|
|00002440| 6e 67 6c 65 20 66 6f 72 | 0d 09 65 64 69 74 57 69 |ngle for|..editWi|
|00002450| 6e 64 20 28 77 68 69 63 | 68 20 6d 75 73 74 20 62 |nd (whic|h must b|
|00002460| 65 20 73 65 74 20 70 72 | 6f 70 65 72 6c 79 29 2e |e set pr|operly).|
|00002470| 20 20 4d 61 6b 65 20 73 | 75 72 65 20 74 68 61 74 | Make s|ure that|
|00002480| 0d 09 74 68 65 20 65 64 | 67 65 73 20 6f 76 65 72 |..the ed|ges over|
|00002490| 6c 61 70 20 74 68 65 20 | 77 69 6e 64 6f 77 20 66 |lap the |window f|
|000024a0| 72 61 6d 65 20 61 6e 64 | 20 74 68 65 20 67 72 6f |rame and| the gro|
|000024b0| 77 20 62 6f 78 2e 0d 2a | 2f 0d 0d 73 74 61 74 69 |w box..*|/..stati|
|000024c0| 63 20 43 61 6c 63 53 63 | 72 6f 6c 6c 52 65 63 74 |c CalcSc|rollRect|
|000024d0| 20 28 72 29 0d 52 65 63 | 74 09 09 2a 72 3b 0d 7b | (r).Rec|t..*r;.{|
|000024e0| 0d 09 2a 72 20 3d 20 65 | 64 69 74 57 69 6e 64 2d |..*r = e|ditWind-|
|000024f0| 3e 70 6f 72 74 52 65 63 | 74 3b 0d 09 2b 2b 72 2d |>portRec|t;..++r-|
|00002500| 3e 72 69 67 68 74 3b 0d | 09 2d 2d 72 2d 3e 74 6f |>right;.|.--r->to|
|00002510| 70 3b 0d 09 72 2d 3e 6c | 65 66 74 20 3d 20 72 2d |p;..r->l|eft = r-|
|00002520| 3e 72 69 67 68 74 20 2d | 20 31 36 3b 0d 09 72 2d |>right -| 16;..r-|
|00002530| 3e 62 6f 74 74 6f 6d 20 | 2d 3d 20 31 34 3b 0d 7d |>bottom |-= 14;.}|
|00002540| 0d 0d 0d 2f 2a 0d 09 52 | 65 74 75 72 6e 20 74 72 |.../*..R|eturn tr|
|00002550| 75 65 20 69 66 20 74 68 | 65 20 6d 6f 75 73 65 20 |ue if th|e mouse |
|00002560| 69 73 20 69 6e 20 74 68 | 65 20 6e 6f 6e 2d 73 63 |is in th|e non-sc|
|00002570| 72 6f 6c 6c 62 61 72 20 | 70 61 72 74 20 6f 66 20 |rollbar |part of |
|00002580| 74 68 65 0d 09 65 64 69 | 74 20 77 69 6e 64 6f 77 |the..edi|t window|
|00002590| 2e 0d 2a 2f 0d 0d 73 74 | 61 74 69 63 20 42 6f 6f |..*/..st|atic Boo|
|000025a0| 6c 65 61 6e 20 50 74 49 | 6e 54 65 78 74 20 28 70 |lean PtI|nText (p|
|000025b0| 74 29 0d 50 6f 69 6e 74 | 09 70 74 3b 0d 7b 0d 52 |t).Point|.pt;.{.R|
|000025c0| 65 63 74 09 72 3b 0d 0d | 09 72 20 3d 20 65 64 69 |ect.r;..|.r = edi|
|000025d0| 74 57 69 6e 64 2d 3e 70 | 6f 72 74 52 65 63 74 3b |tWind->p|ortRect;|
|000025e0| 0d 09 72 2e 72 69 67 68 | 74 20 2d 3d 20 31 35 3b |..r.righ|t -= 15;|
|000025f0| 0d 09 72 65 74 75 72 6e | 20 28 50 74 49 6e 52 65 |..return| (PtInRe|
|00002600| 63 74 20 28 70 74 2c 20 | 26 72 29 29 3b 0d 7d 0d |ct (pt, |&r));.}.|
|00002610| 0d 0d 2f 2a 0d 09 53 65 | 74 20 74 68 65 20 63 75 |../*..Se|t the cu|
|00002620| 72 73 6f 72 20 61 70 70 | 72 6f 70 72 69 61 74 65 |rsor app|ropriate|
|00002630| 6c 79 2e 20 20 49 66 20 | 74 68 65 43 75 72 73 6f |ly. If |theCurso|
|00002640| 72 20 3d 3d 20 69 42 65 | 61 6d 43 75 72 73 6f 72 |r == iBe|amCursor|
|00002650| 2c 20 63 68 65 63 6b 0d | 09 74 68 61 74 20 69 74 |, check.|.that it|
|00002660| 27 73 20 72 65 61 6c 6c | 79 20 69 6e 20 74 68 65 |'s reall|y in the|
|00002670| 20 74 65 78 74 20 61 72 | 65 61 20 6f 66 20 61 6e | text ar|ea of an|
|00002680| 20 65 64 69 74 20 77 69 | 6e 64 6f 77 20 28 61 6e | edit wi|ndow (an|
|00002690| 64 20 69 66 20 6e 6f 74 | 0d 09 73 65 74 20 74 68 |d if not|..set th|
|000026a0| 65 20 63 75 72 73 6f 72 | 20 74 6f 20 61 6e 20 61 |e cursor| to an a|
|000026b0| 72 72 6f 77 20 69 6e 73 | 74 65 61 64 29 2e 20 20 |rrow ins|tead). |
|000026c0| 4f 74 68 65 72 77 69 73 | 65 2c 20 73 65 74 20 74 |Otherwis|e, set t|
|000026d0| 68 65 20 63 75 72 73 6f | 72 0d 09 74 6f 20 74 68 |he curso|r..to th|
|000026e0| 65 20 67 69 76 65 6e 20 | 74 79 70 65 20 28 75 73 |e given |type (us|
|000026f0| 75 61 6c 6c 79 20 61 20 | 77 61 74 63 68 29 2e 0d |ually a |watch)..|
|00002700| 0d 09 49 66 20 74 68 65 | 20 63 75 72 73 6f 72 20 |..If the| cursor |
|00002710| 69 73 20 73 75 70 70 6f | 73 65 64 20 74 6f 20 62 |is suppo|sed to b|
|00002720| 65 20 73 65 74 20 74 6f | 20 61 6e 20 69 2d 62 65 |e set to| an i-be|
|00002730| 61 6d 2c 20 69 74 20 69 | 73 20 61 73 73 75 6d 65 |am, it i|s assume|
|00002740| 64 0d 09 74 68 61 74 20 | 74 68 65 20 67 6c 6f 62 |d..that |the glob|
|00002750| 61 6c 73 20 61 72 65 20 | 73 79 6e 63 65 64 2c 20 |als are |synced, |
|00002760| 62 65 63 61 75 73 65 20 | 44 6f 43 75 72 73 6f 72 |because |DoCursor|
|00002770| 20 63 68 61 6e 67 65 73 | 20 74 68 65 6d 20 61 6e | changes| them an|
|00002780| 64 0d 09 73 79 6e 63 73 | 20 74 68 65 6d 20 62 61 |d..syncs| them ba|
|00002790| 63 6b 2e 0d 0d 09 50 61 | 73 73 20 2d 31 20 66 6f |ck....Pa|ss -1 fo|
|000027a0| 72 20 74 68 65 43 75 72 | 73 6f 72 20 74 6f 20 73 |r theCur|sor to s|
|000027b0| 65 74 20 74 68 65 20 63 | 75 72 73 6f 72 20 74 6f |et the c|ursor to|
|000027c0| 20 74 68 65 20 61 72 72 | 6f 77 2e 0d 2a 2f 0d 0d | the arr|ow..*/..|
|000027d0| 73 74 61 74 69 63 20 44 | 6f 43 75 72 73 6f 72 20 |static D|oCursor |
|000027e0| 28 74 68 65 43 75 72 73 | 6f 72 29 0d 49 6e 74 65 |(theCurs|or).Inte|
|000027f0| 67 65 72 09 74 68 65 43 | 75 72 73 6f 72 3b 0d 7b |ger.theC|ursor;.{|
|00002800| 0d 50 6f 69 6e 74 09 70 | 74 3b 0d 47 72 61 66 50 |.Point.p|t;.GrafP|
|00002810| 74 72 09 73 61 76 65 50 | 6f 72 74 3b 0d 0d 09 69 |tr.saveP|ort;...i|
|00002820| 66 20 28 74 68 65 43 75 | 72 73 6f 72 20 3d 3d 20 |f (theCu|rsor == |
|00002830| 69 42 65 61 6d 43 75 72 | 73 6f 72 29 09 09 09 2f |iBeamCur|sor).../|
|00002840| 2a 20 63 68 65 63 6b 20 | 77 68 65 74 68 65 72 20 |* check |whether |
|00002850| 74 68 65 72 65 27 73 20 | 61 6e 20 65 64 69 74 20 |there's |an edit |
|00002860| 2a 2f 0d 09 7b 09 09 09 | 09 09 09 09 09 09 09 2f |*/..{...|......./|
|00002870| 2a 20 77 69 6e 64 6f 77 | 20 69 6e 20 66 72 6f 6e |* window| in fron|
|00002880| 74 20 61 6e 64 20 69 66 | 20 73 6f 2c 20 20 20 20 |t and if| so, |
|00002890| 2a 2f 0d 09 09 74 68 65 | 43 75 72 73 6f 72 20 3d |*/...the|Cursor =|
|000028a0| 20 2d 31 3b 09 09 09 09 | 09 09 2f 2a 20 77 68 65 | -1;....|../* whe|
|000028b0| 74 68 65 72 20 74 68 65 | 20 63 75 72 73 6f 72 27 |ther the| cursor'|
|000028c0| 73 20 69 6e 20 69 74 73 | 20 20 20 2a 2f 0d 09 09 |s in its| */...|
|000028d0| 69 66 20 28 49 73 45 57 | 69 6e 64 6f 77 20 28 46 |if (IsEW|indow (F|
|000028e0| 72 6f 6e 74 57 69 6e 64 | 6f 77 20 28 29 29 29 09 |rontWind|ow ())).|
|000028f0| 09 2f 2a 20 74 65 78 74 | 20 61 72 65 61 20 20 20 |./* text| area |
|00002900| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00002910| 20 20 2a 2f 0d 09 09 7b | 0d 09 09 09 47 65 74 50 | */...{|....GetP|
|00002920| 6f 72 74 20 28 26 73 61 | 76 65 50 6f 72 74 29 3b |ort (&sa|vePort);|
|00002930| 0d 09 09 09 53 79 6e 63 | 47 6c 6f 62 61 6c 73 20 |....Sync|Globals |
|00002940| 28 46 72 6f 6e 74 57 69 | 6e 64 6f 77 20 28 29 29 |(FrontWi|ndow ())|
|00002950| 3b 0d 09 09 09 47 65 74 | 4d 6f 75 73 65 20 28 26 |;....Get|Mouse (&|
|00002960| 70 74 29 3b 0d 09 09 09 | 69 66 20 28 50 74 49 6e |pt);....|if (PtIn|
|00002970| 54 65 78 74 20 28 70 74 | 29 29 0d 09 09 09 09 74 |Text (pt|)).....t|
|00002980| 68 65 43 75 72 73 6f 72 | 20 3d 20 69 42 65 61 6d |heCursor| = iBeam|
|00002990| 43 75 72 73 6f 72 3b 0d | 09 09 09 53 79 6e 63 47 |Cursor;.|...SyncG|
|000029a0| 6c 6f 62 61 6c 73 20 28 | 73 61 76 65 50 6f 72 74 |lobals (|savePort|
|000029b0| 29 3b 0d 09 09 7d 0d 09 | 7d 0d 09 53 65 74 43 75 |);...}..|}..SetCu|
|000029c0| 72 73 6f 72 20 28 74 68 | 65 43 75 72 73 6f 72 20 |rsor (th|eCursor |
|000029d0| 3d 3d 20 2d 31 20 3f 20 | 26 61 72 72 6f 77 20 3a |== -1 ? |&arrow :|
|000029e0| 20 2a 47 65 74 43 75 72 | 73 6f 72 20 28 74 68 65 | *GetCur|sor (the|
|000029f0| 43 75 72 73 6f 72 29 29 | 3b 0d 7d 0d 0d 0d 2f 2a |Cursor))|;.}.../*|
|00002a00| 0d 09 43 61 6c 63 75 6c | 61 74 65 20 74 68 65 20 |..Calcul|ate the |
|00002a10| 6e 75 6d 62 65 72 20 6f | 66 20 6c 69 6e 65 73 20 |number o|f lines |
|00002a20| 63 75 72 72 65 6e 74 6c | 79 20 73 63 72 6f 6c 6c |currentl|y scroll|
|00002a30| 65 64 20 6f 66 66 0d 09 | 74 68 65 20 74 6f 70 2e |ed off..|the top.|
|00002a40| 0d 2a 2f 0d 0d 73 74 61 | 74 69 63 20 4c 69 6e 65 |.*/..sta|tic Line|
|00002a50| 73 4f 66 66 54 6f 70 20 | 28 29 0d 7b 0d 72 65 67 |sOffTop |().{.reg|
|00002a60| 69 73 74 65 72 20 54 45 | 50 74 72 09 65 50 74 72 |ister TE|Ptr.ePtr|
|00002a70| 3b 0d 0d 09 65 50 74 72 | 20 3d 20 2a 65 64 69 74 |;...ePtr| = *edit|
|00002a80| 54 45 3b 0d 09 72 65 74 | 75 72 6e 20 28 28 28 2a |TE;..ret|urn (((*|
|00002a90| 65 50 74 72 29 2e 76 69 | 65 77 52 65 63 74 2e 74 |ePtr).vi|ewRect.t|
|00002aa0| 6f 70 20 2d 20 28 2a 65 | 50 74 72 29 2e 64 65 73 |op - (*e|Ptr).des|
|00002ab0| 74 52 65 63 74 2e 74 6f | 70 29 0d 09 09 09 09 2f |tRect.to|p)...../|
|00002ac0| 20 28 2a 65 50 74 72 29 | 2e 6c 69 6e 65 48 65 69 | (*ePtr)|.lineHei|
|00002ad0| 67 68 74 29 3b 0d 7d 0d | 0d 0d 2f 2a 0d 09 52 65 |ght);.}.|../*..Re|
|00002ae0| 74 75 72 6e 20 74 68 65 | 20 6c 69 6e 65 20 6e 75 |turn the| line nu|
|00002af0| 6d 62 65 72 20 74 68 61 | 74 20 74 68 65 20 63 61 |mber tha|t the ca|
|00002b00| 72 65 74 20 28 6f 72 20 | 74 68 65 20 62 65 67 69 |ret (or |the begi|
|00002b10| 6e 6e 69 6e 67 20 6f 66 | 0d 09 74 68 65 20 63 75 |nning of|..the cu|
|00002b20| 72 72 65 6e 74 6c 79 20 | 73 65 6c 65 63 74 65 64 |rrently |selected|
|00002b30| 20 74 65 78 74 29 20 69 | 73 20 69 6e 2e 20 20 56 | text) i|s in. V|
|00002b40| 61 6c 75 65 20 72 65 74 | 75 72 6e 65 64 20 69 73 |alue ret|urned is|
|00002b50| 20 69 6e 0d 09 74 68 65 | 20 72 61 6e 67 65 20 30 | in..the| range 0|
|00002b60| 2e 2e 28 2a 2a 65 64 69 | 74 54 45 29 2e 6e 4c 69 |..(**edi|tTE).nLi|
|00002b70| 6e 65 73 2e 20 20 49 66 | 20 3d 20 28 2a 2a 65 64 |nes. If| = (**ed|
|00002b80| 69 74 54 45 29 2e 6e 4c | 69 6e 65 73 2c 20 74 68 |itTE).nL|ines, th|
|00002b90| 65 0d 09 63 61 72 65 74 | 20 69 73 20 70 61 73 74 |e..caret| is past|
|00002ba0| 20 74 68 65 20 6c 61 73 | 74 20 6c 69 6e 65 2e 20 | the las|t line. |
|00002bb0| 20 54 68 65 20 6f 6e 6c | 79 20 73 70 65 63 69 61 | The onl|y specia|
|00002bc0| 6c 20 63 61 73 65 20 74 | 6f 20 77 61 74 63 68 20 |l case t|o watch |
|00002bd0| 6f 75 74 0d 09 66 6f 72 | 20 69 73 20 77 68 65 6e |out..for| is when|
|00002be0| 20 74 68 65 20 63 61 72 | 65 74 20 69 73 20 61 74 | the car|et is at|
|00002bf0| 20 74 68 65 20 76 65 72 | 79 20 65 6e 64 20 6f 66 | the ver|y end of|
|00002c00| 20 74 68 65 20 74 65 78 | 74 2e 20 20 49 66 20 74 | the tex|t. If t|
|00002c10| 68 65 0d 09 6c 61 73 74 | 20 63 68 61 72 61 63 74 |he..last| charact|
|00002c20| 65 72 20 69 73 20 6e 6f | 74 20 61 20 63 61 72 72 |er is no|t a carr|
|00002c30| 69 61 67 65 20 72 65 74 | 75 72 6e 2c 20 74 68 65 |iage ret|urn, the|
|00002c40| 6e 20 74 68 65 20 63 61 | 72 65 74 20 69 73 20 6f |n the ca|ret is o|
|00002c50| 6e 0d 09 74 68 65 20 28 | 6e 4c 69 6e 65 73 2d 31 |n..the (|nLines-1|
|00002c60| 29 74 68 20 6c 69 6e 65 | 2c 20 6e 6f 74 20 74 68 |)th line|, not th|
|00002c70| 65 20 28 6e 4c 69 6e 65 | 73 29 74 68 20 6c 69 6e |e (nLine|s)th lin|
|00002c80| 65 2e 0d 0d 09 28 54 68 | 69 73 20 72 65 61 6c 6c |e....(Th|is reall|
|00002c90| 79 20 73 68 6f 75 6c 64 | 20 64 6f 20 61 20 62 69 |y should| do a bi|
|00002ca0| 6e 61 72 79 20 73 65 61 | 72 63 68 20 66 6f 72 20 |nary sea|rch for |
|00002cb0| 73 70 65 65 64 2e 29 0d | 2a 2f 0d 0d 73 74 61 74 |speed.).|*/..stat|
|00002cc0| 69 63 20 4c 69 6e 65 57 | 69 74 68 43 61 72 65 74 |ic LineW|ithCaret|
|00002cd0| 20 28 29 0d 7b 0d 72 65 | 67 69 73 74 65 72 20 49 | ().{.re|gister I|
|00002ce0| 6e 74 65 67 65 72 09 69 | 3b 0d 72 65 67 69 73 74 |nteger.i|;.regist|
|00002cf0| 65 72 20 49 6e 74 65 67 | 65 72 09 6e 4c 69 6e 65 |er Integ|er.nLine|
|00002d00| 73 3b 0d 72 65 67 69 73 | 74 65 72 20 49 6e 74 65 |s;.regis|ter Inte|
|00002d10| 67 65 72 09 74 65 4c 65 | 6e 67 74 68 3b 0d 72 65 |ger.teLe|ngth;.re|
|00002d20| 67 69 73 74 65 72 20 49 | 6e 74 65 67 65 72 09 73 |gister I|nteger.s|
|00002d30| 65 6c 53 74 61 72 74 3b | 0d 72 65 67 69 73 74 65 |elStart;|.registe|
|00002d40| 72 20 49 6e 74 65 67 65 | 72 09 6c 69 6e 65 53 74 |r Intege|r.lineSt|
|00002d50| 61 72 74 3b 0d 0d 09 73 | 65 6c 53 74 61 72 74 20 |art;...s|elStart |
|00002d60| 3d 20 28 2a 2a 65 64 69 | 74 54 45 29 2e 73 65 6c |= (**edi|tTE).sel|
|00002d70| 53 74 61 72 74 3b 0d 09 | 6e 4c 69 6e 65 73 20 3d |Start;..|nLines =|
|00002d80| 20 28 2a 2a 65 64 69 74 | 54 45 29 2e 6e 4c 69 6e | (**edit|TE).nLin|
|00002d90| 65 73 3b 0d 09 74 65 4c | 65 6e 67 74 68 20 3d 20 |es;..teL|ength = |
|00002da0| 28 2a 2a 65 64 69 74 54 | 45 29 2e 74 65 4c 65 6e |(**editT|E).teLen|
|00002db0| 67 74 68 3b 0d 0d 09 69 | 66 20 28 73 65 6c 53 74 |gth;...i|f (selSt|
|00002dc0| 61 72 74 20 3d 3d 20 74 | 65 4c 65 6e 67 74 68 29 |art == t|eLength)|
|00002dd0| 0d 09 7b 0d 09 09 69 66 | 20 28 74 65 4c 65 6e 67 |..{...if| (teLeng|
|00002de0| 74 68 20 21 3d 20 30 20 | 26 26 20 28 2a 28 28 2a |th != 0 |&& (*((*|
|00002df0| 2a 65 64 69 74 54 45 29 | 2e 68 54 65 78 74 29 29 |*editTE)|.hText))|
|00002e00| 5b 74 65 4c 65 6e 67 74 | 68 2d 31 5d 20 21 3d 20 |[teLengt|h-1] != |
|00002e10| 63 72 29 0d 09 09 09 72 | 65 74 75 72 6e 20 28 6e |cr)....r|eturn (n|
|00002e20| 4c 69 6e 65 73 20 2d 20 | 31 29 3b 0d 09 09 72 65 |Lines - |1);...re|
|00002e30| 74 75 72 6e 20 28 6e 4c | 69 6e 65 73 29 3b 0d 09 |turn (nL|ines);..|
|00002e40| 7d 0d 0d 09 66 6f 72 20 | 28 69 20 3d 20 30 3b 20 |}...for |(i = 0; |
|00002e50| 2f 2a 20 65 6d 70 74 79 | 20 2a 2f 3b 20 2b 2b 69 |/* empty| */; ++i|
|00002e60| 29 0d 09 7b 0d 09 09 69 | 66 20 28 28 6c 69 6e 65 |)..{...i|f ((line|
|00002e70| 53 74 61 72 74 20 3d 20 | 28 2a 2a 65 64 69 74 54 |Start = |(**editT|
|00002e80| 45 29 2e 6c 69 6e 65 53 | 74 61 72 74 73 5b 69 5d |E).lineS|tarts[i]|
|00002e90| 29 20 3e 3d 20 73 65 6c | 53 74 61 72 74 29 0d 09 |) >= sel|Start)..|
|00002ea0| 09 7b 0d 09 09 09 69 66 | 20 28 6c 69 6e 65 53 74 |.{....if| (lineSt|
|00002eb0| 61 72 74 20 21 3d 20 73 | 65 6c 53 74 61 72 74 29 |art != s|elStart)|
|00002ec0| 0d 09 09 09 09 2d 2d 69 | 3b 0d 09 09 09 72 65 74 |.....--i|;....ret|
|00002ed0| 75 72 6e 20 28 69 29 3b | 0d 09 09 7d 0d 09 7d 0d |urn (i);|...}..}.|
|00002ee0| 7d 0d 0d 0d 2f 2a 0d 09 | 52 65 74 75 72 6e 20 74 |}.../*..|Return t|
|00002ef0| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 74 68 65 |he numbe|r of the|
|00002f00| 20 6c 61 73 74 20 64 69 | 73 70 6c 61 79 61 62 6c | last di|splayabl|
|00002f10| 65 20 6c 69 6e 65 2e 20 | 20 54 68 61 74 27 73 20 |e line. | That's |
|00002f20| 6f 6e 65 0d 09 6d 6f 72 | 65 20 74 68 61 6e 20 6e |one..mor|e than n|
|00002f30| 4c 69 6e 65 73 20 69 66 | 20 74 68 65 20 74 65 78 |Lines if| the tex|
|00002f40| 74 20 69 73 20 65 6d 70 | 74 79 20 6f 72 20 74 68 |t is emp|ty or th|
|00002f50| 65 20 6c 61 73 74 20 63 | 68 61 72 61 63 74 65 72 |e last c|haracter|
|00002f60| 0d 09 69 73 20 61 20 63 | 61 72 72 69 61 67 65 20 |..is a c|arriage |
|00002f70| 72 65 74 75 72 6e 2e 0d | 2a 2f 0d 0d 73 74 61 74 |return..|*/..stat|
|00002f80| 69 63 20 4c 61 73 74 4c | 69 6e 65 20 28 29 0d 7b |ic LastL|ine ().{|
|00002f90| 0d 72 65 67 69 73 74 65 | 72 20 49 6e 74 65 67 65 |.registe|r Intege|
|00002fa0| 72 09 6e 4c 69 6e 65 73 | 3b 0d 72 65 67 69 73 74 |r.nLines|;.regist|
|00002fb0| 65 72 20 49 6e 74 65 67 | 65 72 09 74 65 4c 65 6e |er Integ|er.teLen|
|00002fc0| 67 74 68 3b 0d 0d 09 6e | 4c 69 6e 65 73 20 3d 20 |gth;...n|Lines = |
|00002fd0| 28 2a 2a 65 64 69 74 54 | 45 29 2e 6e 4c 69 6e 65 |(**editT|E).nLine|
|00002fe0| 73 3b 0d 09 74 65 4c 65 | 6e 67 74 68 20 3d 20 28 |s;..teLe|ngth = (|
|00002ff0| 2a 2a 65 64 69 74 54 45 | 29 2e 74 65 4c 65 6e 67 |**editTE|).teLeng|
|00003000| 74 68 3b 0d 0d 09 69 66 | 20 28 74 65 4c 65 6e 67 |th;...if| (teLeng|
|00003010| 74 68 20 3d 3d 20 30 20 | 7c 7c 20 28 2a 28 28 2a |th == 0 ||| (*((*|
|00003020| 2a 65 64 69 74 54 45 29 | 2e 68 54 65 78 74 29 29 |*editTE)|.hText))|
|00003030| 5b 74 65 4c 65 6e 67 74 | 68 2d 31 5d 20 3d 3d 20 |[teLengt|h-1] == |
|00003040| 63 72 29 0d 09 09 6e 4c | 69 6e 65 73 2b 2b 3b 0d |cr)...nL|ines++;.|
|00003050| 09 72 65 74 75 72 6e 20 | 28 6e 4c 69 6e 65 73 29 |.return |(nLines)|
|00003060| 3b 0d 7d 0d 0d 0d 2f 2a | 0d 09 53 65 74 20 74 68 |;.}.../*|..Set th|
|00003070| 65 20 6d 61 78 69 6d 75 | 6d 20 76 61 6c 75 65 20 |e maximu|m value |
|00003080| 6f 66 20 74 68 65 20 73 | 63 72 6f 6c 6c 20 62 61 |of the s|croll ba|
|00003090| 72 2e 20 20 49 74 27 73 | 20 73 65 74 20 73 6f 20 |r. It's| set so |
|000030a0| 74 68 61 74 20 69 66 0d | 09 74 68 65 72 65 27 73 |that if.|.there's|
|000030b0| 20 6d 6f 72 65 20 74 65 | 78 74 20 74 68 61 6e 20 | more te|xt than |
|000030c0| 66 69 74 73 20 69 6e 20 | 74 68 65 20 77 69 6e 64 |fits in |the wind|
|000030d0| 6f 77 2c 20 74 68 65 20 | 62 6f 74 74 6f 6d 20 6c |ow, the |bottom l|
|000030e0| 69 6e 65 20 63 61 6e 0d | 09 62 65 20 73 63 72 6f |ine can.|.be scro|
|000030f0| 6c 6c 65 64 20 75 70 20 | 61 74 20 6c 65 61 73 74 |lled up |at least|
|00003100| 20 61 20 6c 69 74 74 6c | 65 20 62 65 6c 6f 77 20 | a littl|e below |
|00003110| 74 68 65 20 62 6f 74 74 | 6f 6d 20 6f 66 20 74 68 |the bott|om of th|
|00003120| 65 20 77 69 6e 64 6f 77 | 2e 0d 0d 09 54 68 65 20 |e window|....The |
|00003130| 73 68 65 6e 61 6e 69 67 | 61 6e 73 20 77 69 74 68 |shenanig|ans with|
|00003140| 20 74 6f 70 4c 69 6e 65 | 73 20 61 6e 64 20 73 63 | topLine|s and sc|
|00003150| 72 6f 6c 6c 61 62 6c 65 | 4c 69 6e 65 73 20 68 61 |rollable|Lines ha|
|00003160| 76 65 20 74 6f 20 64 6f | 20 77 69 74 68 0d 09 74 |ve to do| with..t|
|00003170| 68 65 20 63 61 73 65 20 | 77 68 65 72 65 20 74 68 |he case |where th|
|00003180| 65 72 65 20 6d 61 79 20 | 62 65 20 6c 65 73 73 20 |ere may |be less |
|00003190| 74 65 78 74 20 74 68 61 | 6e 20 66 69 6c 6c 73 20 |text tha|n fills |
|000031a0| 74 68 65 20 77 69 6e 64 | 6f 77 2c 20 62 75 74 0d |the wind|ow, but.|
|000031b0| 09 6d 6f 73 74 20 6f 66 | 20 69 74 27 73 20 73 63 |.most of| it's sc|
|000031c0| 72 6f 6c 6c 65 64 20 6f | 66 66 20 74 68 65 20 74 |rolled o|ff the t|
|000031d0| 6f 70 2e 20 20 54 68 69 | 73 20 63 61 6e 20 68 61 |op. Thi|s can ha|
|000031e0| 70 70 65 6e 20 77 68 65 | 6e 20 79 6f 75 0d 09 73 |ppen whe|n you..s|
|000031f0| 63 72 6f 6c 6c 20 61 20 | 62 75 6e 63 68 20 6f 66 |croll a |bunch of|
|00003200| 20 73 74 75 66 66 20 75 | 70 2c 20 74 68 65 6e 20 | stuff u|p, then |
|00003210| 64 65 6c 65 74 65 20 65 | 76 65 72 79 74 68 69 6e |delete e|verythin|
|00003220| 67 20 76 69 73 69 62 6c | 65 20 69 6e 0d 09 74 68 |g visibl|e in..th|
|00003230| 65 20 77 69 6e 64 6f 77 | 2e 0d 2a 2f 0d 0d 73 74 |e window|..*/..st|
|00003240| 61 74 69 63 20 53 65 74 | 53 63 72 6f 6c 6c 4d 61 |atic Set|ScrollMa|
|00003250| 78 20 28 29 0d 7b 0d 72 | 65 67 69 73 74 65 72 20 |x ().{.r|egister |
|00003260| 49 6e 74 65 67 65 72 09 | 74 6f 70 4c 69 6e 65 73 |Integer.|topLines|
|00003270| 3b 0d 72 65 67 69 73 74 | 65 72 20 49 6e 74 65 67 |;.regist|er Integ|
|00003280| 65 72 09 73 63 72 6f 6c | 6c 61 62 6c 65 4c 69 6e |er.scrol|lableLin|
|00003290| 65 73 3b 0d 72 65 67 69 | 73 74 65 72 20 49 6e 74 |es;.regi|ster Int|
|000032a0| 65 67 65 72 09 6d 61 78 | 3b 0d 0d 09 74 6f 70 4c |eger.max|;...topL|
|000032b0| 69 6e 65 73 20 3d 20 4c | 69 6e 65 73 4f 66 66 54 |ines = L|inesOffT|
|000032c0| 6f 70 20 28 29 3b 0d 09 | 73 63 72 6f 6c 6c 61 62 |op ();..|scrollab|
|000032d0| 6c 65 4c 69 6e 65 73 20 | 3d 20 4c 61 73 74 4c 69 |leLines |= LastLi|
|000032e0| 6e 65 20 28 29 20 2d 20 | 76 69 73 4c 69 6e 65 73 |ne () - |visLines|
|000032f0| 3b 0d 09 6d 61 78 20 3d | 20 28 74 6f 70 4c 69 6e |;..max =| (topLin|
|00003300| 65 73 20 3e 20 73 63 72 | 6f 6c 6c 61 62 6c 65 4c |es > scr|ollableL|
|00003310| 69 6e 65 73 20 3f 20 74 | 6f 70 4c 69 6e 65 73 20 |ines ? t|opLines |
|00003320| 3a 20 73 63 72 6f 6c 6c | 61 62 6c 65 4c 69 6e 65 |: scroll|ableLine|
|00003330| 73 29 3b 0d 0d 09 69 66 | 20 28 6d 61 78 20 3c 20 |s);...if| (max < |
|00003340| 30 29 0d 09 09 6d 61 78 | 20 3d 20 30 3b 0d 0d 09 |0)...max| = 0;...|
|00003350| 69 66 20 28 6d 61 78 20 | 21 3d 20 47 65 74 43 74 |if (max |!= GetCt|
|00003360| 6c 4d 61 78 20 28 65 64 | 69 74 53 63 72 6f 6c 6c |lMax (ed|itScroll|
|00003370| 29 29 0d 09 7b 0d 09 09 | 53 65 74 43 74 6c 4d 61 |))..{...|SetCtlMa|
|00003380| 78 20 28 65 64 69 74 53 | 63 72 6f 6c 6c 2c 20 6d |x (editS|croll, m|
|00003390| 61 78 29 3b 0d 09 09 48 | 69 6c 69 74 65 43 6f 6e |ax);...H|iliteCon|
|000033a0| 74 72 6f 6c 20 28 65 64 | 69 74 53 63 72 6f 6c 6c |trol (ed|itScroll|
|000033b0| 2c 20 6d 61 78 20 3e 20 | 30 20 3f 20 30 20 3a 20 |, max > |0 ? 0 : |
|000033c0| 32 35 35 29 3b 0d 09 7d | 0d 7d 0d 0d 0d 2f 2a 0d |255);..}|.}.../*.|
|000033d0| 09 53 65 74 20 73 63 72 | 6f 6c 6c 20 62 61 72 20 |.Set scr|oll bar |
|000033e0| 63 75 72 72 65 6e 74 20 | 76 61 6c 75 65 20 28 62 |current |value (b|
|000033f0| 75 74 20 6f 6e 6c 79 20 | 69 66 20 69 74 27 73 20 |ut only |if it's |
|00003400| 64 69 66 66 65 72 65 6e | 74 20 74 68 61 6e 0d 09 |differen|t than..|
|00003410| 74 68 65 20 63 75 72 72 | 65 6e 74 20 76 61 6c 75 |the curr|ent valu|
|00003420| 65 2c 20 74 6f 20 61 76 | 6f 69 64 20 6e 65 65 64 |e, to av|oid need|
|00003430| 6c 65 73 73 20 66 6c 61 | 73 68 69 6e 67 29 2e 0d |less fla|shing)..|
|00003440| 2a 2f 0d 0d 73 74 61 74 | 69 63 20 53 65 74 53 63 |*/..stat|ic SetSc|
|00003450| 72 6f 6c 6c 56 61 6c 75 | 65 20 28 76 61 6c 75 65 |rollValu|e (value|
|00003460| 29 0d 49 6e 74 65 67 65 | 72 09 76 61 6c 75 65 3b |).Intege|r.value;|
|00003470| 0d 7b 0d 09 69 66 20 28 | 47 65 74 43 74 6c 56 61 |.{..if (|GetCtlVa|
|00003480| 6c 75 65 20 28 65 64 69 | 74 53 63 72 6f 6c 6c 29 |lue (edi|tScroll)|
|00003490| 20 21 3d 20 76 61 6c 75 | 65 29 0d 09 09 53 65 74 | != valu|e)...Set|
|000034a0| 43 74 6c 56 61 6c 75 65 | 20 28 65 64 69 74 53 63 |CtlValue| (editSc|
|000034b0| 72 6f 6c 6c 2c 20 76 61 | 6c 75 65 29 3b 0d 7d 0d |roll, va|lue);.}.|
|000034c0| 0d 0d 2f 2a 0d 20 20 20 | 20 53 63 72 6f 6c 6c 20 |../*. | Scroll |
|000034d0| 74 6f 20 74 68 65 20 63 | 6f 72 72 65 63 74 20 70 |to the c|orrect p|
|000034e0| 6f 73 69 74 69 6f 6e 2e | 20 20 6c 44 65 6c 74 61 |osition.| lDelta|
|000034f0| 20 69 73 20 74 68 65 0d | 20 20 20 20 61 6d 6f 75 | is the.| amou|
|00003500| 6e 74 20 74 6f 20 43 48 | 41 4e 47 45 20 74 68 65 |nt to CH|ANGE the|
|00003510| 20 63 75 72 72 65 6e 74 | 20 73 63 72 6f 6c 6c 20 | current| scroll |
|00003520| 73 65 74 74 69 6e 67 20 | 62 79 2e 0d 2a 2f 0d 0d |setting |by..*/..|
|00003530| 73 74 61 74 69 63 20 53 | 63 72 6f 6c 6c 54 65 78 |static S|crollTex|
|00003540| 74 20 28 6c 44 65 6c 74 | 61 29 0d 49 6e 74 65 67 |t (lDelt|a).Integ|
|00003550| 65 72 09 6c 44 65 6c 74 | 61 3b 0d 7b 0d 72 65 67 |er.lDelt|a;.{.reg|
|00003560| 69 73 74 65 72 20 49 6e | 74 65 67 65 72 09 74 6f |ister In|teger.to|
|00003570| 70 56 69 73 4c 69 6e 65 | 3b 0d 72 65 67 69 73 74 |pVisLine|;.regist|
|00003580| 65 72 20 49 6e 74 65 67 | 65 72 09 6e 65 77 54 6f |er Integ|er.newTo|
|00003590| 70 56 69 73 4c 69 6e 65 | 3b 0d 0d 09 74 6f 70 56 |pVisLine|;...topV|
|000035a0| 69 73 4c 69 6e 65 20 3d | 20 4c 69 6e 65 73 4f 66 |isLine =| LinesOf|
|000035b0| 66 54 6f 70 20 28 29 3b | 0d 20 20 20 20 6e 65 77 |fTop ();|. new|
|000035c0| 54 6f 70 56 69 73 4c 69 | 6e 65 20 3d 20 74 6f 70 |TopVisLi|ne = top|
|000035d0| 56 69 73 4c 69 6e 65 20 | 2b 20 6c 44 65 6c 74 61 |VisLine |+ lDelta|
|000035e0| 3b 0d 20 20 20 20 69 66 | 20 28 6e 65 77 54 6f 70 |;. if| (newTop|
|000035f0| 56 69 73 4c 69 6e 65 20 | 3c 20 30 29 09 09 09 09 |VisLine |< 0)....|
|00003600| 09 2f 2a 20 63 6c 69 70 | 20 74 6f 20 72 61 6e 67 |./* clip| to rang|
|00003610| 65 20 2a 2f 0d 20 20 20 | 20 09 6e 65 77 54 6f 70 |e */. | .newTop|
|00003620| 56 69 73 4c 69 6e 65 20 | 3d 20 30 3b 0d 20 20 20 |VisLine |= 0;. |
|00003630| 20 69 66 20 28 6e 65 77 | 54 6f 70 56 69 73 4c 69 | if (new|TopVisLi|
|00003640| 6e 65 20 3e 20 47 65 74 | 43 74 6c 4d 61 78 20 28 |ne > Get|CtlMax (|
|00003650| 65 64 69 74 53 63 72 6f | 6c 6c 29 29 0d 09 09 6e |editScro|ll))...n|
|00003660| 65 77 54 6f 70 56 69 73 | 4c 69 6e 65 20 3d 20 47 |ewTopVis|Line = G|
|00003670| 65 74 43 74 6c 4d 61 78 | 20 28 65 64 69 74 53 63 |etCtlMax| (editSc|
|00003680| 72 6f 6c 6c 29 3b 0d 20 | 20 20 20 53 65 74 53 63 |roll);. | SetSc|
|00003690| 72 6f 6c 6c 56 61 6c 75 | 65 20 28 6e 65 77 54 6f |rollValu|e (newTo|
|000036a0| 70 56 69 73 4c 69 6e 65 | 29 3b 0d 20 20 20 20 54 |pVisLine|);. T|
|000036b0| 45 53 63 72 6f 6c 6c 20 | 28 30 2c 20 28 74 6f 70 |EScroll |(0, (top|
|000036c0| 56 69 73 4c 69 6e 65 2d | 6e 65 77 54 6f 70 56 69 |VisLine-|newTopVi|
|000036d0| 73 4c 69 6e 65 20 29 2a | 28 2a 2a 65 64 69 74 54 |sLine )*|(**editT|
|000036e0| 45 29 2e 6c 69 6e 65 48 | 65 69 67 68 74 2c 20 65 |E).lineH|eight, e|
|000036f0| 64 69 74 54 45 29 3b 0d | 7d 0d 0d 0d 2f 2a 0d 09 |ditTE);.|}.../*..|
|00003700| 53 63 72 6f 6c 6c 20 74 | 6f 20 68 6f 6d 65 20 70 |Scroll t|o home p|
|00003710| 6f 73 69 74 69 6f 6e 20 | 77 69 74 68 6f 75 74 20 |osition |without |
|00003720| 72 65 64 72 61 77 69 6e | 67 2e 0d 2a 2f 0d 0d 73 |redrawin|g..*/..s|
|00003730| 74 61 74 69 63 20 53 63 | 72 6f 6c 6c 54 6f 48 6f |tatic Sc|rollToHo|
|00003740| 6d 65 20 28 29 0d 7b 0d | 52 65 63 74 09 09 09 09 |me ().{.|Rect....|
|00003750| 72 3b 0d 0d 09 72 20 3d | 20 28 2a 2a 65 64 69 74 |r;...r =| (**edit|
|00003760| 54 45 29 2e 64 65 73 74 | 52 65 63 74 3b 0d 09 4f |TE).dest|Rect;..O|
|00003770| 66 66 73 65 74 52 65 63 | 74 20 28 26 72 2c 20 30 |ffsetRec|t (&r, 0|
|00003780| 2c 20 32 20 2d 20 72 2e | 74 6f 70 29 3b 0d 09 28 |, 2 - r.|top);..(|
|00003790| 2a 2a 65 64 69 74 54 45 | 29 2e 64 65 73 74 52 65 |**editTE|).destRe|
|000037a0| 63 74 20 3d 20 72 3b 0d | 7d 0d 0d 2f 2a 0d 09 43 |ct = r;.|}../*..C|
|000037b0| 6c 69 6b 4c 6f 6f 70 20 | 70 72 6f 63 20 66 6f 72 |likLoop |proc for|
|000037c0| 20 61 75 74 6f 73 63 72 | 6f 6c 6c 69 6e 67 20 74 | autoscr|olling t|
|000037d0| 65 78 74 20 77 68 65 6e | 20 74 68 65 20 6d 6f 75 |ext when| the mou|
|000037e0| 73 65 20 69 73 20 64 72 | 61 67 67 65 64 20 6f 75 |se is dr|agged ou|
|000037f0| 74 0d 09 6f 66 20 74 68 | 65 20 74 65 78 74 20 76 |t..of th|e text v|
|00003800| 69 65 77 20 72 65 63 74 | 61 6e 67 6c 65 2e 0d 0d |iew rect|angle...|
|00003810| 09 54 68 65 20 63 6c 69 | 70 70 69 6e 67 20 72 65 |.The cli|pping re|
|00003820| 67 69 6f 6e 20 68 61 73 | 20 74 6f 20 62 65 20 73 |gion has| to be s|
|00003830| 65 74 20 74 6f 20 69 6e | 63 6c 75 64 65 20 74 68 |et to in|clude th|
|00003840| 65 20 73 63 72 6f 6c 6c | 20 62 61 72 2c 0d 09 62 |e scroll| bar,..b|
|00003850| 65 63 61 75 73 65 20 77 | 68 65 6e 65 76 65 72 20 |ecause w|henever |
|00003860| 74 68 69 73 20 70 72 6f | 63 20 69 73 20 63 61 6c |this pro|c is cal|
|00003870| 6c 65 64 2c 20 54 45 20 | 68 61 73 20 74 68 65 20 |led, TE |has the |
|00003880| 72 65 67 69 6f 6e 20 73 | 65 74 20 64 6f 77 6e 0d |region s|et down.|
|00003890| 09 74 6f 20 74 68 65 20 | 76 69 65 77 20 72 65 63 |.to the |view rec|
|000038a0| 74 61 6e 67 6c 65 20 2d | 20 69 66 20 69 74 27 73 |tangle -| if it's|
|000038b0| 20 6e 6f 74 20 72 65 73 | 65 74 2c 20 63 68 61 6e | not res|et, chan|
|000038c0| 67 65 73 20 74 6f 20 74 | 68 65 20 73 63 72 6f 6c |ges to t|he scrol|
|000038d0| 6c 0d 09 62 61 72 20 77 | 69 6c 6c 20 6e 6f 74 20 |l..bar w|ill not |
|000038e0| 73 68 6f 77 20 75 70 21 | 0d 2a 2f 0d 0d 73 74 61 |show up!|.*/..sta|
|000038f0| 74 69 63 20 70 61 73 63 | 61 6c 20 42 6f 6f 6c 65 |tic pasc|al Boole|
|00003900| 61 6e 20 41 75 74 6f 53 | 63 72 6f 6c 6c 20 28 29 |an AutoS|croll ()|
|00003910| 0d 7b 0d 50 6f 69 6e 74 | 09 70 3b 0d 52 65 63 74 |.{.Point|.p;.Rect|
|00003920| 09 72 3b 0d 0d 09 53 61 | 76 65 43 6c 69 70 52 67 |.r;...Sa|veClipRg|
|00003930| 6e 20 28 29 3b 0d 09 43 | 6c 69 70 52 65 63 74 20 |n ();..C|lipRect |
|00003940| 28 26 65 64 69 74 57 69 | 6e 64 2d 3e 70 6f 72 74 |(&editWi|nd->port|
|00003950| 52 65 63 74 29 3b 0d 09 | 47 65 74 4d 6f 75 73 65 |Rect);..|GetMouse|
|00003960| 20 28 26 70 29 3b 0d 09 | 72 20 3d 20 28 2a 2a 65 | (&p);..|r = (**e|
|00003970| 64 69 74 54 45 29 2e 76 | 69 65 77 52 65 63 74 3b |ditTE).v|iewRect;|
|00003980| 0d 09 69 66 20 28 70 2e | 76 20 3c 20 72 2e 74 6f |..if (p.|v < r.to|
|00003990| 70 29 0d 09 09 53 63 72 | 6f 6c 6c 54 65 78 74 20 |p)...Scr|ollText |
|000039a0| 28 2d 31 29 3b 0d 09 65 | 6c 73 65 20 69 66 20 28 |(-1);..e|lse if (|
|000039b0| 70 2e 76 20 3e 20 72 2e | 62 6f 74 74 6f 6d 29 0d |p.v > r.|bottom).|
|000039c0| 09 09 53 63 72 6f 6c 6c | 54 65 78 74 20 28 31 29 |..Scroll|Text (1)|
|000039d0| 3b 0d 09 52 65 73 74 6f | 72 65 43 6c 69 70 52 67 |;..Resto|reClipRg|
|000039e0| 6e 20 28 29 3b 0d 09 72 | 65 74 75 72 6e 20 28 74 |n ();..r|eturn (t|
|000039f0| 72 75 65 29 3b 09 09 09 | 2f 2a 20 74 72 75 65 20 |rue);...|/* true |
|00003a00| 3d 20 27 6b 65 65 70 20 | 74 72 61 63 6b 69 6e 67 |= 'keep |tracking|
|00003a10| 20 6d 6f 75 73 65 27 20 | 2a 2f 0d 7d 0d 0d 0d 2f | mouse' |*/.}.../|
|00003a20| 2a 0d 09 46 69 6c 74 65 | 72 20 70 72 6f 63 20 66 |*..Filte|r proc f|
|00003a30| 6f 72 20 74 72 61 63 6b | 69 6e 67 20 6d 6f 75 73 |or track|ing mous|
|00003a40| 65 64 6f 77 6e 20 69 6e | 20 73 63 72 6f 6c 6c 20 |edown in| scroll |
|00003a50| 62 61 72 2e 20 20 54 68 | 65 20 63 6f 64 65 20 66 |bar. Th|e code f|
|00003a60| 6f 72 0d 09 74 68 65 20 | 70 61 72 74 20 6f 72 69 |or..the |part ori|
|00003a70| 67 69 6e 61 6c 6c 79 20 | 68 69 74 20 69 73 20 73 |ginally |hit is s|
|00003a80| 68 6f 76 65 64 20 69 6e | 74 6f 20 74 68 65 20 63 |hoved in|to the c|
|00003a90| 6f 6e 74 72 6f 6c 27 73 | 20 72 65 66 65 72 65 6e |ontrol's| referen|
|00003aa0| 63 65 0d 09 76 61 6c 75 | 65 20 62 79 20 4d 6f 75 |ce..valu|e by Mou|
|00003ab0| 73 65 28 29 20 62 65 66 | 6f 72 65 20 74 68 69 73 |se() bef|ore this|
|00003ac0| 20 69 73 20 63 61 6c 6c | 65 64 2e 0d 0d 09 49 20 | is call|ed....I |
|00003ad0| 73 75 73 70 65 63 74 20 | 6f 64 64 20 73 63 72 6f |suspect |odd scro|
|00003ae0| 6c 6c 69 6e 67 20 6d 61 | 79 20 6f 63 63 75 72 20 |lling ma|y occur |
|00003af0| 66 6f 72 20 68 69 74 73 | 20 69 6e 20 70 61 67 69 |for hits| in pagi|
|00003b00| 6e 67 20 72 65 67 69 6f | 6e 73 20 69 66 0d 09 74 |ng regio|ns if..t|
|00003b10| 68 65 20 77 69 6e 64 6f | 77 20 69 73 20 61 6c 6c |he windo|w is all|
|00003b20| 6f 77 65 64 20 74 6f 20 | 73 69 7a 65 20 73 75 63 |owed to |size suc|
|00003b30| 68 20 74 68 61 74 20 6c | 65 73 73 20 74 68 61 6e |h that l|ess than|
|00003b40| 20 74 77 6f 20 6c 69 6e | 65 73 20 73 68 6f 77 2e | two lin|es show.|
|00003b50| 0d 2a 2f 0d 0d 73 74 61 | 74 69 63 20 70 61 73 63 |.*/..sta|tic pasc|
|00003b60| 61 6c 20 76 6f 69 64 20 | 54 72 61 63 6b 53 63 72 |al void |TrackScr|
|00003b70| 6f 6c 6c 20 28 74 68 65 | 53 63 72 6f 6c 6c 2c 20 |oll (the|Scroll, |
|00003b80| 70 61 72 74 43 6f 64 65 | 29 0d 43 6f 6e 74 72 6f |partCode|).Contro|
|00003b90| 6c 48 61 6e 64 6c 65 09 | 74 68 65 53 63 72 6f 6c |lHandle.|theScrol|
|00003ba0| 6c 3b 0d 49 6e 74 65 67 | 65 72 09 09 09 70 61 72 |l;.Integ|er...par|
|00003bb0| 74 43 6f 64 65 3b 0d 7b | 0d 72 65 67 69 73 74 65 |tCode;.{|.registe|
|00003bc0| 72 20 49 6e 74 65 67 65 | 72 09 6c 44 65 6c 74 61 |r Intege|r.lDelta|
|00003bd0| 3b 0d 0d 20 20 20 20 69 | 66 20 28 70 61 72 74 43 |;.. i|f (partC|
|00003be0| 6f 64 65 20 3d 3d 20 47 | 65 74 43 52 65 66 43 6f |ode == G|etCRefCo|
|00003bf0| 6e 20 28 74 68 65 53 63 | 72 6f 6c 6c 29 29 09 2f |n (theSc|roll))./|
|00003c00| 2a 20 73 74 69 6c 6c 20 | 69 6e 20 73 61 6d 65 20 |* still |in same |
|00003c10| 70 61 72 74 3f 20 2a 2f | 0d 20 20 20 20 7b 0d 20 |part? */|. {. |
|00003c20| 20 20 20 20 20 20 20 73 | 77 69 74 63 68 20 28 70 | s|witch (p|
|00003c30| 61 72 74 43 6f 64 65 29 | 0d 20 20 20 20 20 20 20 |artCode)|. |
|00003c40| 20 7b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 63 | {. | c|
|00003c50| 61 73 65 20 69 6e 55 70 | 42 75 74 74 6f 6e 3a 20 |ase inUp|Button: |
|00003c60| 6c 44 65 6c 74 61 20 3d | 20 2d 31 3b 20 62 72 65 |lDelta =| -1; bre|
|00003c70| 61 6b 3b 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |ak;. | |
|00003c80| 63 61 73 65 20 69 6e 44 | 6f 77 6e 42 75 74 74 6f |case inD|ownButto|
|00003c90| 6e 3a 20 6c 44 65 6c 74 | 61 20 3d 20 31 3b 20 62 |n: lDelt|a = 1; b|
|00003ca0| 72 65 61 6b 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |reak;. | |
|00003cb0| 20 20 63 61 73 65 20 69 | 6e 50 61 67 65 55 70 3a | case i|nPageUp:|
|00003cc0| 20 6c 44 65 6c 74 61 20 | 3d 20 2d 28 76 69 73 4c | lDelta |= -(visL|
|00003cd0| 69 6e 65 73 20 2d 20 31 | 29 3b 20 62 72 65 61 6b |ines - 1|); break|
|00003ce0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 63 61 |;. | ca|
|00003cf0| 73 65 20 69 6e 50 61 67 | 65 44 6f 77 6e 3a 20 6c |se inPag|eDown: l|
|00003d00| 44 65 6c 74 61 20 3d 20 | 76 69 73 4c 69 6e 65 73 |Delta = |visLines|
|00003d10| 20 2d 20 31 3b 20 62 72 | 65 61 6b 3b 0d 20 20 20 | - 1; br|eak;. |
|00003d20| 20 20 20 20 20 7d 0d 20 | 20 20 20 20 20 20 20 53 | }. | S|
|00003d30| 63 72 6f 6c 6c 54 65 78 | 74 20 28 6c 44 65 6c 74 |crollTex|t (lDelt|
|00003d40| 61 29 3b 0d 20 20 20 20 | 7d 0d 7d 0d 0d 0d 2f 2a |a);. |}.}.../*|
|00003d50| 0d 09 53 65 74 20 74 68 | 65 20 73 63 72 6f 6c 6c |..Set th|e scroll|
|00003d60| 20 62 61 72 20 70 72 6f | 70 65 72 6c 79 20 61 6e | bar pro|perly an|
|00003d70| 64 20 61 64 6a 75 73 74 | 20 74 68 65 20 74 65 78 |d adjust| the tex|
|00003d80| 74 20 69 6e 20 74 68 65 | 0d 09 77 69 6e 64 6f 77 |t in the|..window|
|00003d90| 20 73 6f 20 74 68 61 74 | 20 74 68 65 20 6c 69 6e | so that| the lin|
|00003da0| 65 20 63 6f 6e 74 61 69 | 6e 69 6e 67 20 74 68 65 |e contai|ning the|
|00003db0| 20 63 61 72 65 74 20 69 | 73 20 76 69 73 69 62 6c | caret i|s visibl|
|00003dc0| 65 2e 0d 09 49 66 20 74 | 68 65 20 6c 69 6e 65 20 |e...If t|he line |
|00003dd0| 77 69 74 68 20 74 68 65 | 20 63 61 72 65 74 20 69 |with the| caret i|
|00003de0| 66 20 6d 6f 72 65 20 74 | 68 61 6e 20 61 20 6c 69 |f more t|han a li|
|00003df0| 6e 65 20 6f 75 74 73 69 | 64 65 20 6f 66 0d 09 74 |ne outsi|de of..t|
|00003e00| 68 65 20 76 69 65 77 52 | 65 63 74 2c 20 74 72 79 |he viewR|ect, try|
|00003e10| 20 74 6f 20 70 6c 61 63 | 65 20 69 74 20 69 6e 20 | to plac|e it in |
|00003e20| 74 68 65 20 6d 69 64 64 | 6c 65 20 6f 66 20 74 68 |the midd|le of th|
|00003e30| 65 20 77 69 6e 64 6f 77 | 2e 0d 0d 09 59 65 73 2c |e window|....Yes,|
|00003e40| 20 69 74 20 69 73 20 6e | 65 63 65 73 73 61 72 79 | it is n|ecessary|
|00003e50| 20 74 6f 20 53 65 74 53 | 63 72 6f 6c 6c 4d 61 78 | to SetS|crollMax|
|00003e60| 20 61 74 20 74 68 65 20 | 65 6e 64 2e 0d 2a 2f 0d | at the |end..*/.|
|00003e70| 0d 73 74 61 74 69 63 20 | 41 64 6a 75 73 74 44 69 |.static |AdjustDi|
|00003e80| 73 70 6c 61 79 20 28 29 | 0d 7b 0d 72 65 67 69 73 |splay ()|.{.regis|
|00003e90| 74 65 72 20 49 6e 74 65 | 67 65 72 09 63 61 72 65 |ter Inte|ger.care|
|00003ea0| 74 4c 69 6e 65 3b 0d 72 | 65 67 69 73 74 65 72 20 |tLine;.r|egister |
|00003eb0| 49 6e 74 65 67 65 72 09 | 74 6f 70 56 69 73 4c 69 |Integer.|topVisLi|
|00003ec0| 6e 65 3b 0d 72 65 67 69 | 73 74 65 72 20 49 6e 74 |ne;.regi|ster Int|
|00003ed0| 65 67 65 72 09 64 3b 0d | 0d 09 53 65 74 53 63 72 |eger.d;.|..SetScr|
|00003ee0| 6f 6c 6c 4d 61 78 20 28 | 29 3b 0d 09 63 61 72 65 |ollMax (|);..care|
|00003ef0| 74 4c 69 6e 65 20 3d 20 | 4c 69 6e 65 57 69 74 68 |tLine = |LineWith|
|00003f00| 43 61 72 65 74 20 28 29 | 3b 0d 09 74 6f 70 56 69 |Caret ()|;..topVi|
|00003f10| 73 4c 69 6e 65 20 3d 20 | 4c 69 6e 65 73 4f 66 66 |sLine = |LinesOff|
|00003f20| 54 6f 70 20 28 29 3b 0d | 09 69 66 20 28 28 64 20 |Top ();.|.if ((d |
|00003f30| 3d 20 63 61 72 65 74 4c | 69 6e 65 20 2d 20 74 6f |= caretL|ine - to|
|00003f40| 70 56 69 73 4c 69 6e 65 | 29 20 3c 20 30 29 0d 09 |pVisLine|) < 0)..|
|00003f50| 09 53 63 72 6f 6c 6c 54 | 65 78 74 20 28 64 20 3d |.ScrollT|ext (d =|
|00003f60| 3d 20 2d 31 20 3f 20 2d | 31 20 3a 20 64 20 2d 20 |= -1 ? -|1 : d - |
|00003f70| 76 69 73 4c 69 6e 65 73 | 20 2f 20 32 29 3b 0d 09 |visLines| / 2);..|
|00003f80| 65 6c 73 65 20 69 66 20 | 28 28 20 64 20 3d 20 63 |else if |(( d = c|
|00003f90| 61 72 65 74 4c 69 6e 65 | 20 2d 20 28 74 6f 70 56 |aretLine| - (topV|
|00003fa0| 69 73 4c 69 6e 65 20 2b | 20 76 69 73 4c 69 6e 65 |isLine +| visLine|
|00003fb0| 73 20 2d 20 31 29 29 20 | 3e 20 30 29 0d 09 09 53 |s - 1)) |> 0)...S|
|00003fc0| 63 72 6f 6c 6c 54 65 78 | 74 20 28 64 20 3d 3d 20 |crollTex|t (d == |
|00003fd0| 31 20 3f 20 31 20 3a 20 | 64 20 2b 20 76 69 73 4c |1 ? 1 : |d + visL|
|00003fe0| 69 6e 65 73 20 2f 20 32 | 29 3b 0d 09 65 6c 73 65 |ines / 2|);..else|
|00003ff0| 0d 09 09 53 65 74 53 63 | 72 6f 6c 6c 56 61 6c 75 |...SetSc|rollValu|
|00004000| 65 20 28 74 6f 70 56 69 | 73 4c 69 6e 65 29 3b 0d |e (topVi|sLine);.|
|00004010| 09 53 65 74 53 63 72 6f | 6c 6c 4d 61 78 20 28 29 |.SetScro|llMax ()|
|00004020| 3b 09 2f 2a 20 6d 69 67 | 68 74 20 68 61 76 65 20 |;./* mig|ht have |
|00004030| 63 68 61 6e 67 65 64 20 | 66 72 6f 6d 20 73 63 72 |changed |from scr|
|00004040| 6f 6c 6c 69 6e 67 20 2a | 2f 0d 7d 0d 0d 0d 2f 2a |olling *|/.}.../*|
|00004050| 0d 09 4f 76 65 72 68 61 | 75 6c 20 74 68 65 20 65 |..Overha|ul the e|
|00004060| 6e 74 69 72 65 20 64 69 | 73 70 6c 61 79 2e 20 20 |ntire di|splay. |
|00004070| 54 68 69 73 20 69 73 20 | 63 61 6c 6c 65 64 20 66 |This is |called f|
|00004080| 6f 72 20 6d 61 6a 6f 72 | 0d 09 63 61 74 61 73 74 |or major|..catast|
|00004090| 72 6f 70 68 65 73 2c 20 | 73 75 63 68 20 61 73 20 |rophes, |such as |
|000040a0| 72 65 73 69 7a 69 6e 67 | 20 74 68 65 20 77 69 6e |resizing| the win|
|000040b0| 64 6f 77 2c 20 6f 72 20 | 63 68 61 6e 67 65 73 20 |dow, or |changes |
|000040c0| 74 6f 0d 09 74 68 65 20 | 77 6f 72 64 20 77 72 61 |to..the |word wra|
|000040d0| 70 20 73 74 79 6c 65 2e | 20 20 49 74 20 6d 61 6b |p style.| It mak|
|000040e0| 65 73 20 73 75 72 65 20 | 74 68 65 20 76 69 65 77 |es sure |the view|
|000040f0| 20 61 6e 64 0d 09 64 65 | 73 74 69 6e 61 74 69 6f | and..de|stinatio|
|00004100| 6e 20 72 65 63 74 61 6e | 67 6c 65 73 20 61 72 65 |n rectan|gles are|
|00004110| 20 73 69 7a 65 64 20 70 | 72 6f 70 65 72 6c 79 2c | sized p|roperly,|
|00004120| 20 61 6e 64 20 74 68 61 | 74 20 74 68 65 20 62 6f | and tha|t the bo|
|00004130| 74 74 6f 6d 0d 09 6c 69 | 6e 65 20 6f 66 20 74 65 |ttom..li|ne of te|
|00004140| 78 74 20 6e 65 76 65 72 | 20 73 63 72 6f 6c 6c 73 |xt never| scrolls|
|00004150| 20 75 70 20 70 61 73 74 | 20 74 68 65 20 62 6f 74 | up past| the bot|
|00004160| 74 6f 6d 20 6c 69 6e 65 | 20 6f 66 20 74 68 65 0d |tom line| of the.|
|00004170| 09 77 69 6e 64 6f 77 2c | 20 69 66 20 74 68 65 72 |.window,| if ther|
|00004180| 65 27 73 20 65 6e 6f 75 | 67 68 20 74 6f 20 66 69 |e's enou|gh to fi|
|00004190| 6c 6c 20 74 68 65 20 77 | 69 6e 64 6f 77 2c 20 61 |ll the w|indow, a|
|000041a0| 6e 64 20 74 68 61 74 20 | 74 68 65 0d 09 73 63 72 |nd that |the..scr|
|000041b0| 6f 6c 6c 20 62 61 72 20 | 6d 61 78 20 61 6e 64 20 |oll bar |max and |
|000041c0| 63 75 72 72 65 6e 74 20 | 76 61 6c 75 65 73 20 61 |current |values a|
|000041d0| 72 65 20 73 65 74 20 70 | 72 6f 70 65 72 6c 79 2e |re set p|roperly.|
|000041e0| 0d 0d 09 52 65 73 69 7a | 69 6e 67 20 74 68 65 20 |...Resiz|ing the |
|000041f0| 64 65 73 74 20 72 65 63 | 74 20 6a 75 73 74 20 6d |dest rec|t just m|
|00004200| 65 61 6e 73 20 72 65 73 | 65 74 74 69 6e 67 20 74 |eans res|etting t|
|00004210| 68 65 20 72 69 67 68 74 | 20 65 64 67 65 0d 09 28 |he right| edge..(|
|00004220| 74 68 65 20 74 6f 70 20 | 69 73 20 4e 4f 54 20 72 |the top |is NOT r|
|00004230| 65 73 65 74 29 2c 20 73 | 69 6e 63 65 20 74 65 78 |eset), s|ince tex|
|00004240| 74 20 6d 69 67 68 74 20 | 62 65 20 73 63 72 6f 6c |t might |be scrol|
|00004250| 6c 65 64 20 6f 66 66 20 | 74 68 65 0d 09 74 6f 70 |led off |the..top|
|00004260| 20 28 69 2e 65 2e 2c 20 | 64 65 73 74 52 65 63 74 | (i.e., |destRect|
|00004270| 2e 74 6f 70 20 21 3d 20 | 30 29 2e 0d 0d 09 44 6f |.top != |0)....Do|
|00004280| 65 73 6e 27 74 20 72 65 | 64 72 61 77 20 74 68 65 |esn't re|draw the|
|00004290| 20 63 6f 6e 74 72 6f 6c | 2c 20 74 68 6f 75 67 68 | control|, though|
|000042a0| 21 0d 2a 2f 0d 0d 73 74 | 61 74 69 63 20 4f 76 65 |!.*/..st|atic Ove|
|000042b0| 72 68 61 75 6c 44 69 73 | 70 6c 61 79 20 28 73 68 |rhaulDis|play (sh|
|000042c0| 6f 77 43 61 72 65 74 2c | 20 72 65 63 61 6c 63 29 |owCaret,| recalc)|
|000042d0| 0d 42 6f 6f 6c 65 61 6e | 09 73 68 6f 77 43 61 72 |.Boolean|.showCar|
|000042e0| 65 74 3b 0d 42 6f 6f 6c | 65 61 6e 09 72 65 63 61 |et;.Bool|ean.reca|
|000042f0| 6c 63 3b 0d 7b 0d 52 65 | 63 74 09 09 09 72 3b 0d |lc;.{.Re|ct...r;.|
|00004300| 0d 09 72 20 3d 20 28 2a | 2a 65 64 69 74 54 45 29 |..r = (*|*editTE)|
|00004310| 2e 76 69 65 77 52 65 63 | 74 3b 09 2f 2a 20 65 72 |.viewRec|t;./* er|
|00004320| 61 73 65 20 63 75 72 72 | 65 6e 74 20 76 69 65 77 |ase curr|ent view|
|00004330| 52 65 63 74 20 2a 2f 0d | 09 45 72 61 73 65 52 65 |Rect */.|.EraseRe|
|00004340| 63 74 20 28 26 72 29 3b | 0d 09 53 65 74 45 64 69 |ct (&r);|..SetEdi|
|00004350| 74 52 65 63 74 20 28 29 | 3b 09 09 09 09 2f 2a 20 |tRect ()|;..../* |
|00004360| 72 65 63 61 6c 63 75 6c | 61 74 65 20 65 64 69 74 |recalcul|ate edit|
|00004370| 69 6e 67 20 72 65 63 74 | 73 20 2a 2f 0d 09 69 66 |ing rect|s */..if|
|00004380| 20 28 72 65 63 61 6c 63 | 29 0d 09 09 54 45 43 61 | (recalc|)...TECa|
|00004390| 6c 54 65 78 74 20 28 65 | 64 69 74 54 45 29 3b 09 |lText (e|ditTE);.|
|000043a0| 09 09 2f 2a 20 72 65 63 | 61 6c 63 75 6c 61 74 65 |../* rec|alculate|
|000043b0| 20 6c 69 6e 65 20 73 74 | 61 72 74 73 20 2a 2f 0d | line st|arts */.|
|000043c0| 09 76 69 73 4c 69 6e 65 | 73 20 3d 20 28 28 2a 2a |.visLine|s = ((**|
|000043d0| 65 64 69 74 54 45 29 2e | 76 69 65 77 52 65 63 74 |editTE).|viewRect|
|000043e0| 2e 62 6f 74 74 6f 6d 20 | 2d 20 28 2a 2a 65 64 69 |.bottom |- (**edi|
|000043f0| 74 54 45 29 2e 76 69 65 | 77 52 65 63 74 2e 74 6f |tTE).vie|wRect.to|
|00004400| 70 29 0d 09 09 09 09 09 | 2f 20 28 2a 2a 65 64 69 |p)......|/ (**edi|
|00004410| 74 54 45 29 2e 6c 69 6e | 65 48 65 69 67 68 74 3b |tTE).lin|eHeight;|
|00004420| 0d 0d 23 20 69 66 6e 64 | 65 66 09 73 69 6e 67 6c |..# ifnd|ef.singl|
|00004430| 65 45 64 69 74 0d 09 28 | 2a 2a 65 64 69 74 49 6e |eEdit..(|**editIn|
|00004440| 66 6f 29 2e 76 69 73 4c | 69 6e 65 73 20 3d 20 76 |fo).visL|ines = v|
|00004450| 69 73 4c 69 6e 65 73 3b | 0d 23 20 65 6e 64 69 66 |isLines;|.# endif|
|00004460| 0d 0d 2f 2a 0d 09 49 66 | 20 74 68 65 72 65 20 69 |../*..If| there i|
|00004470| 73 20 74 65 78 74 2c 20 | 62 75 74 20 6e 6f 6e 65 |s text, |but none|
|00004480| 20 6f 66 20 69 74 20 69 | 73 20 76 69 73 69 62 6c | of it i|s visibl|
|00004490| 65 20 69 6e 20 74 68 65 | 20 77 69 6e 64 6f 77 0d |e in the| window.|
|000044a0| 09 28 69 74 27 73 20 61 | 6c 6c 20 73 63 72 6f 6c |.(it's a|ll scrol|
|000044b0| 6c 65 64 20 6f 66 66 20 | 74 68 65 20 74 6f 70 29 |led off |the top)|
|000044c0| 2c 20 70 75 6c 6c 20 73 | 6f 6d 65 20 64 6f 77 6e |, pull s|ome down|
|000044d0| 2e 0d 2a 2f 0d 0d 09 69 | 66 20 28 73 68 6f 77 43 |..*/...i|f (showC|
|000044e0| 61 72 65 74 29 0d 09 09 | 41 64 6a 75 73 74 44 69 |aret)...|AdjustDi|
|000044f0| 73 70 6c 61 79 20 28 29 | 3b 0d 09 65 6c 73 65 0d |splay ()|;..else.|
|00004500| 09 09 53 65 74 53 63 72 | 6f 6c 6c 4d 61 78 20 28 |..SetScr|ollMax (|
|00004510| 29 3b 0d 09 72 20 3d 20 | 28 2a 2a 65 64 69 74 54 |);..r = |(**editT|
|00004520| 45 29 2e 76 69 65 77 52 | 65 63 74 3b 0d 09 54 45 |E).viewR|ect;..TE|
|00004530| 55 70 64 61 74 65 20 28 | 26 72 2c 20 65 64 69 74 |Update (|&r, edit|
|00004540| 54 45 29 3b 0d 7d 0d 0d | 0d 2f 2a 20 2d 2d 2d 2d |TE);.}..|./* ----|
|00004550| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004560| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004570| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004580| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 20 2a 2f 0d |--------|---- */.|
|00004590| 2f 2a 09 09 09 09 09 09 | 57 69 6e 64 6f 77 20 48 |/*......|Window H|
|000045a0| 61 6e 64 6c 65 72 20 52 | 6f 75 74 69 6e 65 73 09 |andler R|outines.|
|000045b0| 09 09 09 09 09 2a 2f 0d | 2f 2a 20 2d 2d 2d 2d 2d |.....*/.|/* -----|
|000045c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000045d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000045e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000045f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 20 2a 2f 0d 0d |--------|--- */..|
|00004600| 0d 2f 2a 0d 09 48 61 6e | 64 6c 65 20 6d 6f 75 73 |./*..Han|dle mous|
|00004610| 65 20 63 6c 69 63 6b 73 | 20 69 6e 20 77 69 6e 64 |e clicks| in wind|
|00004620| 6f 77 2e 20 20 54 68 65 | 20 76 69 65 77 52 65 63 |ow. The| viewRec|
|00004630| 74 20 69 73 20 6e 65 76 | 65 72 20 74 65 73 74 65 |t is nev|er teste|
|00004640| 64 0d 09 64 69 72 65 63 | 74 6c 79 2c 20 62 65 63 |d..direc|tly, bec|
|00004650| 61 75 73 65 20 69 66 20 | 69 74 20 77 65 72 65 2c |ause if |it were,|
|00004660| 20 63 6c 69 63 6b 73 20 | 61 6c 6f 6e 67 20 74 68 | clicks |along th|
|00004670| 65 20 74 6f 70 2c 20 6c | 65 66 74 20 61 6e 64 0d |e top, l|eft and.|
|00004680| 09 62 6f 74 74 6f 6d 20 | 65 64 67 65 73 20 6f 66 |.bottom |edges of|
|00004690| 20 74 68 65 20 77 69 6e | 64 6f 77 20 77 6f 75 6c | the win|dow woul|
|000046a0| 64 6e 27 74 20 72 65 67 | 69 73 74 65 72 2e 0d 2a |dn't reg|ister..*|
|000046b0| 2f 0d 0d 73 74 61 74 69 | 63 20 4d 6f 75 73 65 20 |/..stati|c Mouse |
|000046c0| 28 74 68 65 50 74 2c 20 | 74 2c 20 6d 6f 64 73 29 |(thePt, |t, mods)|
|000046d0| 0d 50 6f 69 6e 74 09 74 | 68 65 50 74 3b 0d 4c 6f |.Point.t|hePt;.Lo|
|000046e0| 6e 67 69 6e 74 09 74 3b | 0d 49 6e 74 65 67 65 72 |ngint.t;|.Integer|
|000046f0| 09 6d 6f 64 73 3b 0d 7b | 0d 72 65 67 69 73 74 65 |.mods;.{|.registe|
|00004700| 72 20 49 6e 74 65 67 65 | 72 09 74 68 65 50 61 72 |r Intege|r.thePar|
|00004710| 74 3b 0d 72 65 67 69 73 | 74 65 72 20 49 6e 74 65 |t;.regis|ter Inte|
|00004720| 67 65 72 09 6f 6c 64 43 | 74 6c 56 61 6c 75 65 3b |ger.oldC|tlValue;|
|00004730| 0d 0d 09 53 79 6e 63 47 | 6c 6f 62 61 6c 73 20 28 |...SyncG|lobals (|
|00004740| 6e 69 6c 29 3b 09 09 2f | 2a 20 73 79 6e 63 20 74 |nil);../|* sync t|
|00004750| 6f 20 63 75 72 72 65 6e | 74 20 70 6f 72 74 20 2a |o curren|t port *|
|00004760| 2f 0d 0d 09 69 66 20 28 | 28 74 68 65 50 61 72 74 |/...if (|(thePart|
|00004770| 20 3d 20 54 65 73 74 43 | 6f 6e 74 72 6f 6c 20 28 | = TestC|ontrol (|
|00004780| 65 64 69 74 53 63 72 6f | 6c 6c 2c 20 74 68 65 50 |editScro|ll, theP|
|00004790| 74 29 29 20 3d 3d 20 69 | 6e 54 68 75 6d 62 29 0d |t)) == i|nThumb).|
|000047a0| 09 7b 0d 09 09 6f 6c 64 | 43 74 6c 56 61 6c 75 65 |.{...old|CtlValue|
|000047b0| 20 3d 20 47 65 74 43 74 | 6c 56 61 6c 75 65 20 28 | = GetCt|lValue (|
|000047c0| 65 64 69 74 53 63 72 6f | 6c 6c 29 3b 0d 09 09 69 |editScro|ll);...i|
|000047d0| 66 20 28 54 72 61 63 6b | 43 6f 6e 74 72 6f 6c 20 |f (Track|Control |
|000047e0| 28 65 64 69 74 53 63 72 | 6f 6c 6c 2c 20 74 68 65 |(editScr|oll, the|
|000047f0| 50 74 2c 20 6e 69 6c 29 | 20 3d 3d 20 69 6e 54 68 |Pt, nil)| == inTh|
|00004800| 75 6d 62 29 0d 09 09 09 | 53 63 72 6f 6c 6c 54 65 |umb)....|ScrollTe|
|00004810| 78 74 20 28 47 65 74 43 | 74 6c 56 61 6c 75 65 20 |xt (GetC|tlValue |
|00004820| 28 65 64 69 74 53 63 72 | 6f 6c 6c 29 20 2d 20 6f |(editScr|oll) - o|
|00004830| 6c 64 43 74 6c 56 61 6c | 75 65 29 3b 0d 09 7d 0d |ldCtlVal|ue);..}.|
|00004840| 09 65 6c 73 65 20 69 66 | 20 28 74 68 65 50 61 72 |.else if| (thePar|
|00004850| 74 20 21 3d 20 30 29 0d | 09 7b 0d 09 09 53 65 74 |t != 0).|.{...Set|
|00004860| 43 52 65 66 43 6f 6e 20 | 28 65 64 69 74 53 63 72 |CRefCon |(editScr|
|00004870| 6f 6c 6c 2c 20 28 4c 6f | 6e 67 69 6e 74 29 20 74 |oll, (Lo|ngint) t|
|00004880| 68 65 50 61 72 74 29 3b | 0d 09 09 28 76 6f 69 64 |hePart);|...(void|
|00004890| 29 20 54 72 61 63 6b 43 | 6f 6e 74 72 6f 6c 20 28 |) TrackC|ontrol (|
|000048a0| 65 64 69 74 53 63 72 6f | 6c 6c 2c 20 74 68 65 50 |editScro|ll, theP|
|000048b0| 74 2c 20 26 54 72 61 63 | 6b 53 63 72 6f 6c 6c 29 |t, &Trac|kScroll)|
|000048c0| 3b 0d 09 7d 0d 09 65 6c | 73 65 20 69 66 20 28 50 |;..}..el|se if (P|
|000048d0| 74 49 6e 54 65 78 74 20 | 28 74 68 65 50 74 29 29 |tInText |(thePt))|
|000048e0| 0d 09 7b 0d 09 09 54 45 | 43 6c 69 63 6b 20 28 74 |..{...TE|Click (t|
|000048f0| 68 65 50 74 2c 20 28 6d | 6f 64 73 20 26 20 73 68 |hePt, (m|ods & sh|
|00004900| 69 66 74 4b 65 79 29 20 | 21 3d 20 30 2c 20 65 64 |iftKey) |!= 0, ed|
|00004910| 69 74 54 45 29 3b 0d 09 | 7d 0d 0d 09 53 65 74 53 |itTE);..|}...SetS|
|00004920| 63 72 6f 6c 6c 4d 61 78 | 20 28 29 3b 0d 7d 0d 0d |crollMax| ();.}..|
|00004930| 0d 2f 2a 0d 20 20 20 20 | 48 61 6e 64 6c 65 20 6b |./*. |Handle k|
|00004940| 65 79 20 63 6c 69 63 6b | 73 20 69 6e 20 77 69 6e |ey click|s in win|
|00004950| 64 6f 77 0d 2a 2f 0d 0d | 73 74 61 74 69 63 20 4b |dow.*/..|static K|
|00004960| 65 79 20 28 63 2c 20 6d | 6f 64 73 29 0d 63 68 61 |ey (c, m|ods).cha|
|00004970| 72 09 63 3b 0d 49 6e 74 | 65 67 65 72 09 6d 6f 64 |r.c;.Int|eger.mod|
|00004980| 73 3b 0d 7b 0d 09 53 79 | 6e 63 41 6c 6c 47 6c 6f |s;.{..Sy|ncAllGlo|
|00004990| 62 61 6c 73 20 28 6e 69 | 6c 29 3b 09 09 2f 2a 20 |bals (ni|l);../* |
|000049a0| 73 79 6e 63 20 74 6f 20 | 63 75 72 72 65 6e 74 20 |sync to |current |
|000049b0| 70 6f 72 74 20 2a 2f 0d | 0d 09 69 66 20 28 63 20 |port */.|..if (c |
|000049c0| 21 3d 20 65 6e 74 65 72 | 29 0d 09 09 54 45 4b 65 |!= enter|)...TEKe|
|000049d0| 79 20 28 63 2c 20 65 64 | 69 74 54 45 29 3b 0d 09 |y (c, ed|itTE);..|
|000049e0| 41 64 6a 75 73 74 44 69 | 73 70 6c 61 79 20 28 29 |AdjustDi|splay ()|
|000049f0| 3b 0d 09 53 65 74 44 69 | 72 74 79 20 28 74 72 75 |;..SetDi|rty (tru|
|00004a00| 65 29 3b 0d 09 69 66 20 | 28 65 4b 65 79 20 21 3d |e);..if |(eKey !=|
|00004a10| 20 6e 69 6c 29 09 2f 2a | 20 72 65 70 6f 72 74 20 | nil)./*| report |
|00004a20| 65 76 65 6e 74 20 74 6f | 20 74 68 65 20 68 6f 73 |event to| the hos|
|00004a30| 74 20 2a 2f 0d 09 09 28 | 2a 65 4b 65 79 29 20 28 |t */...(|*eKey) (|
|00004a40| 29 3b 0d 7d 0d 0d 0d 2f | 2a 0d 09 57 68 65 6e 20 |);.}.../|*..When |
|00004a50| 74 68 65 20 77 69 6e 64 | 6f 77 20 63 6f 6d 65 73 |the wind|ow comes|
|00004a60| 20 61 63 74 69 76 65 2c | 20 68 69 67 68 6c 69 67 | active,| highlig|
|00004a70| 68 74 20 74 68 65 20 73 | 63 72 6f 6c 6c 20 62 61 |ht the s|croll ba|
|00004a80| 72 20 61 70 70 72 6f 70 | 72 69 61 74 65 6c 79 2e |r approp|riately.|
|00004a90| 0d 09 57 68 65 6e 20 74 | 68 65 20 77 69 6e 64 6f |..When t|he windo|
|00004aa0| 77 20 69 73 20 64 65 61 | 63 74 69 76 61 74 65 64 |w is dea|ctivated|
|00004ab0| 2c 20 75 6e 2d 68 69 67 | 68 6c 69 67 68 74 20 74 |, un-hig|hlight t|
|00004ac0| 68 65 20 73 63 72 6f 6c | 6c 20 62 61 72 2e 0d 09 |he scrol|l bar...|
|00004ad0| 52 65 64 72 61 77 20 74 | 68 65 20 67 72 6f 77 20 |Redraw t|he grow |
|00004ae0| 62 6f 78 20 69 6e 20 61 | 6e 79 20 63 61 73 65 2e |box in a|ny case.|
|00004af0| 20 20 53 65 74 20 74 68 | 65 20 63 75 72 73 6f 72 | Set th|e cursor|
|00004b00| 20 28 44 6f 43 75 72 73 | 6f 72 20 61 76 6f 69 64 | (DoCurs|or avoid|
|00004b10| 73 0d 09 63 68 61 6e 67 | 69 6e 67 20 69 74 20 66 |s..chang|ing it f|
|00004b20| 72 6f 6d 20 61 6e 20 69 | 62 65 61 6d 20 74 6f 20 |rom an i|beam to |
|00004b30| 61 6e 20 61 72 72 6f 77 | 20 62 61 63 6b 20 74 6f |an arrow| back to|
|00004b40| 20 61 6e 20 69 62 65 61 | 6d 2c 20 69 6e 20 74 68 | an ibea|m, in th|
|00004b50| 65 20 63 61 73 65 0d 09 | 77 68 65 72 65 20 6f 6e |e case..|where on|
|00004b60| 65 20 65 64 69 74 20 77 | 69 6e 64 6f 77 20 69 73 |e edit w|indow is|
|00004b70| 20 67 6f 69 6e 67 20 69 | 6e 61 63 74 69 76 65 20 | going i|nactive |
|00004b80| 61 6e 64 20 61 6e 6f 74 | 68 65 72 20 69 73 20 63 |and anot|her is c|
|00004b90| 6f 6d 69 6e 67 0d 09 61 | 63 74 69 76 65 29 2e 0d |oming..a|ctive)..|
|00004ba0| 0d 09 52 65 70 6f 72 74 | 20 74 68 65 20 65 76 65 |..Report| the eve|
|00004bb0| 6e 74 20 74 6f 20 74 68 | 65 20 68 6f 73 74 2e 0d |nt to th|e host..|
|00004bc0| 2a 2f 0d 0d 73 74 61 74 | 69 63 20 41 63 74 69 76 |*/..stat|ic Activ|
|00004bd0| 61 74 65 20 28 61 63 74 | 69 76 65 29 0d 42 6f 6f |ate (act|ive).Boo|
|00004be0| 6c 65 61 6e 09 61 63 74 | 69 76 65 3b 0d 7b 0d 09 |lean.act|ive;.{..|
|00004bf0| 53 79 6e 63 41 6c 6c 47 | 6c 6f 62 61 6c 73 20 28 |SyncAllG|lobals (|
|00004c00| 6e 69 6c 29 3b 09 09 2f | 2a 20 73 79 6e 63 20 74 |nil);../|* sync t|
|00004c10| 6f 20 63 75 72 72 65 6e | 74 20 70 6f 72 74 20 2a |o curren|t port *|
|00004c20| 2f 0d 0d 09 44 72 61 77 | 47 72 6f 77 42 6f 78 20 |/...Draw|GrowBox |
|00004c30| 28 29 3b 0d 09 69 66 20 | 28 61 63 74 69 76 65 29 |();..if |(active)|
|00004c40| 0d 09 7b 0d 09 09 54 45 | 41 63 74 69 76 61 74 65 |..{...TE|Activate|
|00004c50| 20 28 65 64 69 74 54 45 | 29 3b 0d 09 09 48 69 6c | (editTE|);...Hil|
|00004c60| 69 74 65 43 6f 6e 74 72 | 6f 6c 20 28 65 64 69 74 |iteContr|ol (edit|
|00004c70| 53 63 72 6f 6c 6c 2c 20 | 47 65 74 43 74 6c 4d 61 |Scroll, |GetCtlMa|
|00004c80| 78 20 28 65 64 69 74 53 | 63 72 6f 6c 6c 29 20 3e |x (editS|croll) >|
|00004c90| 20 30 20 3f 20 30 20 3a | 20 32 35 35 29 3b 0d 09 | 0 ? 0 :| 255);..|
|00004ca0| 7d 0d 09 65 6c 73 65 0d | 09 7b 0d 09 09 54 45 44 |}..else.|.{...TED|
|00004cb0| 65 61 63 74 69 76 61 74 | 65 20 28 65 64 69 74 54 |eactivat|e (editT|
|00004cc0| 45 29 3b 0d 09 09 48 69 | 6c 69 74 65 43 6f 6e 74 |E);...Hi|liteCont|
|00004cd0| 72 6f 6c 20 28 65 64 69 | 74 53 63 72 6f 6c 6c 2c |rol (edi|tScroll,|
|00004ce0| 20 32 35 35 29 3b 0d 09 | 7d 0d 09 44 6f 43 75 72 | 255);..|}..DoCur|
|00004cf0| 73 6f 72 20 28 69 42 65 | 61 6d 43 75 72 73 6f 72 |sor (iBe|amCursor|
|00004d00| 29 3b 0d 09 69 66 20 28 | 65 41 63 74 69 76 61 74 |);..if (|eActivat|
|00004d10| 65 20 21 3d 20 6e 69 6c | 29 09 2f 2a 20 72 65 70 |e != nil|)./* rep|
|00004d20| 6f 72 74 20 65 76 65 6e | 74 20 74 6f 20 74 68 65 |ort even|t to the|
|00004d30| 20 68 6f 73 74 20 2a 2f | 0d 09 09 28 2a 65 41 63 | host */|...(*eAc|
|00004d40| 74 69 76 61 74 65 29 20 | 28 61 63 74 69 76 65 29 |tivate) |(active)|
|00004d50| 3b 0d 7d 0d 0d 0d 2f 2a | 0d 09 43 6c 6f 73 65 20 |;.}.../*|..Close |
|00004d60| 62 6f 78 20 77 61 73 20 | 63 6c 69 63 6b 65 64 2e |box was |clicked.|
|00004d70| 20 20 49 66 20 75 73 65 | 72 20 73 70 65 63 69 66 | If use|r specif|
|00004d80| 69 65 64 20 6e 6f 74 69 | 66 79 20 70 72 6f 63 2c |ied noti|fy proc,|
|00004d90| 20 63 61 6c 6c 20 69 74 | 2e 0d 09 4f 74 68 65 72 | call it|...Other|
|00004da0| 77 69 73 65 20 64 6f 20 | 64 65 66 61 75 6c 74 20 |wise do |default |
|00004db0| 63 6c 6f 73 65 20 6f 70 | 65 72 61 74 69 6f 6e 20 |close op|eration |
|00004dc0| 28 61 73 6b 20 61 62 6f | 75 74 20 73 61 76 69 6e |(ask abo|ut savin|
|00004dd0| 67 20 69 66 20 64 69 72 | 74 79 2c 0d 09 65 74 63 |g if dir|ty,..etc|
|00004de0| 2e 29 2e 0d 2a 2f 0d 0d | 73 74 61 74 69 63 20 43 |.)..*/..|static C|
|00004df0| 6c 6f 73 65 20 28 29 0d | 7b 0d 09 53 79 6e 63 41 |lose ().|{..SyncA|
|00004e00| 6c 6c 47 6c 6f 62 61 6c | 73 20 28 6e 69 6c 29 3b |llGlobal|s (nil);|
|00004e10| 09 09 2f 2a 20 73 79 6e | 63 20 74 6f 20 63 75 72 |../* syn|c to cur|
|00004e20| 72 65 6e 74 20 70 6f 72 | 74 20 2a 2f 0d 0d 09 69 |rent por|t */...i|
|00004e30| 66 20 28 65 43 6c 6f 73 | 65 20 21 3d 20 6e 69 6c |f (eClos|e != nil|
|00004e40| 29 0d 09 09 28 2a 65 43 | 6c 6f 73 65 29 20 28 29 |)...(*eC|lose) ()|
|00004e50| 3b 0d 09 65 6c 73 65 0d | 09 09 28 76 6f 69 64 29 |;..else.|..(void)|
|00004e60| 20 45 57 69 6e 64 6f 77 | 43 6c 6f 73 65 20 28 65 | EWindow|Close (e|
|00004e70| 64 69 74 57 69 6e 64 29 | 3b 0d 7d 0d 0d 0d 2f 2a |ditWind)|;.}.../*|
|00004e80| 0d 09 55 70 64 61 74 65 | 20 77 69 6e 64 6f 77 2e |..Update| window.|
|00004e90| 20 20 54 68 65 20 75 70 | 64 61 74 65 20 65 76 65 | The up|date eve|
|00004ea0| 6e 74 20 6d 69 67 68 74 | 20 62 65 20 69 6e 20 72 |nt might| be in r|
|00004eb0| 65 73 70 6f 6e 73 65 20 | 74 6f 20 61 0d 09 77 69 |esponse |to a..wi|
|00004ec0| 6e 64 6f 77 20 72 65 73 | 69 7a 69 6e 67 2e 20 20 |ndow res|izing. |
|00004ed0| 49 66 20 73 6f 2c 20 6d | 6f 76 65 20 61 6e 64 20 |If so, m|ove and |
|00004ee0| 72 65 73 69 7a 65 20 74 | 68 65 20 73 63 72 6f 6c |resize t|he scrol|
|00004ef0| 6c 20 62 61 72 2e 0d 09 | 54 68 65 20 56 61 6c 69 |l bar...|The Vali|
|00004f00| 64 52 65 63 74 20 63 61 | 6c 6c 20 69 73 20 64 6f |dRect ca|ll is do|
|00004f10| 6e 65 20 62 65 63 61 75 | 73 65 20 74 68 65 20 48 |ne becau|se the H|
|00004f20| 69 64 65 43 6f 6e 74 72 | 6f 6c 20 61 64 64 73 20 |ideContr|ol adds |
|00004f30| 74 68 65 0d 09 63 6f 6e | 74 72 6f 6c 20 62 6f 75 |the..con|trol bou|
|00004f40| 6e 64 73 20 62 6f 78 20 | 74 6f 20 74 68 65 20 75 |nds box |to the u|
|00004f50| 70 64 61 74 65 20 72 65 | 67 69 6f 6e 20 2d 20 77 |pdate re|gion - w|
|00004f60| 68 69 63 68 20 77 6f 75 | 6c 64 20 67 65 6e 65 72 |hich wou|ld gener|
|00004f70| 61 74 65 0d 09 61 6e 6f | 74 68 65 72 20 75 70 64 |ate..ano|ther upd|
|00004f80| 61 74 65 20 65 76 65 6e | 74 21 20 20 53 69 6e 63 |ate even|t! Sinc|
|00004f90| 65 20 65 76 65 72 79 74 | 68 69 6e 67 20 67 65 74 |e everyt|hing get|
|00004fa0| 73 20 72 65 64 72 61 77 | 6e 20 62 65 6c 6f 77 2c |s redraw|n below,|
|00004fb0| 0d 09 74 68 65 20 56 61 | 6c 69 64 52 65 63 74 20 |..the Va|lidRect |
|00004fc0| 69 73 20 75 73 65 64 20 | 74 6f 20 63 61 6e 63 65 |is used |to cance|
|00004fd0| 6c 20 74 68 65 20 75 70 | 64 61 74 65 2e 0d 2a 2f |l the up|date..*/|
|00004fe0| 0d 0d 73 74 61 74 69 63 | 20 55 70 64 61 74 65 20 |..static| Update |
|00004ff0| 28 72 65 73 69 7a 65 64 | 29 0d 42 6f 6f 6c 65 61 |(resized|).Boolea|
|00005000| 6e 09 72 65 73 69 7a 65 | 64 3b 0d 7b 0d 52 65 63 |n.resize|d;.{.Rec|
|00005010| 74 09 09 09 72 3b 0d 0d | 09 53 79 6e 63 47 6c 6f |t...r;..|.SyncGlo|
|00005020| 62 61 6c 73 20 28 6e 69 | 6c 29 3b 09 09 2f 2a 20 |bals (ni|l);../* |
|00005030| 73 79 6e 63 20 74 6f 20 | 63 75 72 72 65 6e 74 20 |sync to |current |
|00005040| 70 6f 72 74 20 2a 2f 0d | 0d 09 72 20 3d 20 65 64 |port */.|..r = ed|
|00005050| 69 74 57 69 6e 64 2d 3e | 70 6f 72 74 52 65 63 74 |itWind->|portRect|
|00005060| 3b 0d 09 45 72 61 73 65 | 52 65 63 74 20 28 26 72 |;..Erase|Rect (&r|
|00005070| 29 3b 0d 09 69 66 20 28 | 72 65 73 69 7a 65 64 29 |);..if (|resized)|
|00005080| 0d 09 7b 0d 09 09 48 69 | 64 65 43 6f 6e 74 72 6f |..{...Hi|deContro|
|00005090| 6c 20 28 65 64 69 74 53 | 63 72 6f 6c 6c 29 3b 0d |l (editS|croll);.|
|000050a0| 09 09 72 20 3d 20 28 2a | 2a 65 64 69 74 53 63 72 |..r = (*|*editScr|
|000050b0| 6f 6c 6c 29 2e 63 6f 6e | 74 72 6c 52 65 63 74 3b |oll).con|trlRect;|
|000050c0| 0d 09 09 56 61 6c 69 64 | 52 65 63 74 20 28 26 72 |...Valid|Rect (&r|
|000050d0| 29 3b 0d 09 09 43 61 6c | 63 53 63 72 6f 6c 6c 52 |);...Cal|cScrollR|
|000050e0| 65 63 74 20 28 26 72 29 | 3b 0d 09 09 53 69 7a 65 |ect (&r)|;...Size|
|000050f0| 43 6f 6e 74 72 6f 6c 20 | 28 65 64 69 74 53 63 72 |Control |(editScr|
|00005100| 6f 6c 6c 2c 20 31 36 2c | 20 72 2e 62 6f 74 74 6f |oll, 16,| r.botto|
|00005110| 6d 20 2d 20 72 2e 74 6f | 70 29 3b 0d 09 09 4d 6f |m - r.to|p);...Mo|
|00005120| 76 65 43 6f 6e 74 72 6f | 6c 20 28 65 64 69 74 53 |veContro|l (editS|
|00005130| 63 72 6f 6c 6c 2c 20 72 | 2e 6c 65 66 74 2c 20 72 |croll, r|.left, r|
|00005140| 2e 74 6f 70 29 3b 0d 09 | 09 4f 76 65 72 68 61 75 |.top);..|.Overhau|
|00005150| 6c 44 69 73 70 6c 61 79 | 20 28 66 61 6c 73 65 2c |lDisplay| (false,|
|00005160| 20 28 2a 2a 65 64 69 74 | 54 45 29 2e 63 72 4f 6e | (**edit|TE).crOn|
|00005170| 6c 79 20 3e 3d 20 30 29 | 3b 0d 09 09 53 68 6f 77 |ly >= 0)|;...Show|
|00005180| 43 6f 6e 74 72 6f 6c 20 | 28 65 64 69 74 53 63 72 |Control |(editScr|
|00005190| 6f 6c 6c 29 3b 0d 09 7d | 0d 09 65 6c 73 65 0d 09 |oll);..}|..else..|
|000051a0| 7b 0d 09 09 4f 76 65 72 | 68 61 75 6c 44 69 73 70 |{...Over|haulDisp|
|000051b0| 6c 61 79 20 28 66 61 6c | 73 65 2c 20 66 61 6c 73 |lay (fal|se, fals|
|000051c0| 65 29 3b 0d 09 09 44 72 | 61 77 43 6f 6e 74 72 6f |e);...Dr|awContro|
|000051d0| 6c 73 20 28 65 64 69 74 | 57 69 6e 64 29 3b 09 2f |ls (edit|Wind);./|
|000051e0| 2a 20 72 65 64 72 61 77 | 20 73 63 72 6f 6c 6c 20 |* redraw| scroll |
|000051f0| 62 61 72 20 2a 2f 0d 09 | 7d 0d 0d 09 44 72 61 77 |bar */..|}...Draw|
|00005200| 47 72 6f 77 42 6f 78 20 | 28 29 3b 0d 7d 0d 0d 0d |GrowBox |();.}...|
|00005210| 2f 2a 0d 09 52 65 6d 6f | 76 65 20 74 68 65 20 65 |/*..Remo|ve the e|
|00005220| 64 69 74 20 77 69 6e 64 | 6f 77 20 66 72 6f 6d 20 |dit wind|ow from |
|00005230| 74 68 65 20 6c 69 73 74 | 2c 20 61 6e 64 20 64 69 |the list|, and di|
|00005240| 73 70 6f 73 65 20 6f 66 | 20 69 74 2e 0d 09 54 68 |spose of| it...Th|
|00005250| 69 73 20 69 73 20 63 61 | 6c 6c 65 64 20 62 79 20 |is is ca|lled by |
|00005260| 53 6b 65 6c 52 6d 76 65 | 57 69 6e 64 2c 20 6e 6f |SkelRmve|Wind, no|
|00005270| 74 20 64 69 72 65 63 74 | 6c 79 20 62 79 20 75 73 |t direct|ly by us|
|00005280| 65 72 20 70 72 6f 67 72 | 61 6d 2e 0d 0d 09 41 74 |er progr|am....At|
|00005290| 20 74 68 69 73 20 70 6f | 69 6e 74 20 69 74 27 73 | this po|int it's|
|000052a0| 20 74 6f 6f 20 6c 61 74 | 65 20 74 6f 20 62 61 63 | too lat|e to bac|
|000052b0| 6b 20 6f 75 74 20 69 66 | 20 61 6e 79 20 63 68 61 |k out if| any cha|
|000052c0| 6e 67 65 73 20 68 61 76 | 65 20 62 65 65 6e 0d 09 |nges hav|e been..|
|000052d0| 6d 61 64 65 20 74 6f 20 | 74 68 65 20 74 65 78 74 |made to |the text|
|000052e0| 2e 0d 0d 09 53 69 6e 63 | 65 20 74 68 65 20 63 6c |....Sinc|e the cl|
|000052f0| 6f 62 62 65 72 20 70 72 | 6f 63 65 64 75 72 65 20 |obber pr|ocedure |
|00005300| 69 73 20 6e 65 76 65 72 | 20 63 61 6c 6c 65 64 20 |is never| called |
|00005310| 65 78 63 65 70 74 20 66 | 6f 72 20 72 65 61 6c 20 |except f|or real |
|00005320| 65 64 69 74 0d 09 77 69 | 6e 64 6f 77 73 2c 20 61 |edit..wi|ndows, a|
|00005330| 6e 64 20 73 69 6e 63 65 | 20 74 68 65 20 6c 69 73 |nd since| the lis|
|00005340| 74 20 6d 75 73 74 20 74 | 68 65 72 65 66 6f 72 65 |t must t|herefore|
|00005350| 20 62 65 20 6e 6f 6e 2d | 65 6d 70 74 79 2c 20 69 | be non-|empty, i|
|00005360| 74 20 69 73 0d 09 6e 6f | 74 20 6e 65 63 65 73 73 |t is..no|t necess|
|00005370| 61 72 79 20 74 6f 20 63 | 68 65 63 6b 20 74 68 65 |ary to c|heck the|
|00005380| 20 6c 65 67 61 6c 69 74 | 79 20 6f 66 20 74 68 65 | legalit|y of the|
|00005390| 20 77 69 6e 64 6f 77 20 | 6f 72 20 74 68 61 74 20 | window |or that |
|000053a0| 74 68 65 0d 09 77 69 6e | 64 6f 77 27 73 20 69 6e |the..win|dow's in|
|000053b0| 20 74 68 65 20 6c 69 73 | 74 2e 0d 2a 2f 0d 0d 73 | the lis|t..*/..s|
|000053c0| 74 61 74 69 63 20 43 6c | 6f 62 62 65 72 20 28 29 |tatic Cl|obber ()|
|000053d0| 0d 7b 0d 23 20 69 66 6e | 64 65 66 09 73 69 6e 67 |.{.# ifn|def.sing|
|000053e0| 6c 65 45 64 69 74 0d 72 | 65 67 69 73 74 65 72 20 |leEdit.r|egister |
|000053f0| 45 49 48 61 6e 64 6c 65 | 09 68 2c 20 68 32 3b 0d |EIHandle|.h, h2;.|
|00005400| 23 20 65 6e 64 69 66 0d | 0d 09 53 79 6e 63 47 6c |# endif.|..SyncGl|
|00005410| 6f 62 61 6c 73 20 28 6e | 69 6c 29 3b 09 09 09 09 |obals (n|il);....|
|00005420| 09 2f 2a 20 73 79 6e 63 | 20 74 6f 20 63 75 72 72 |./* sync| to curr|
|00005430| 65 6e 74 20 70 6f 72 74 | 20 2a 2f 0d 0d 23 20 69 |ent port| */..# i|
|00005440| 66 6e 64 65 66 09 73 69 | 6e 67 6c 65 45 64 69 74 |fndef.si|ngleEdit|
|00005450| 0d 0d 09 69 66 20 28 28 | 2a 2a 65 77 4c 69 73 74 |...if ((|**ewList|
|00005460| 29 2e 65 64 69 74 57 69 | 6e 64 20 3d 3d 20 65 64 |).editWi|nd == ed|
|00005470| 69 74 57 69 6e 64 29 09 | 2f 2a 20 69 73 20 69 74 |itWind).|/* is it|
|00005480| 20 74 68 65 20 66 69 72 | 73 74 20 77 69 6e 64 6f | the fir|st windo|
|00005490| 77 20 69 6e 20 6c 69 73 | 74 3f 20 2a 2f 0d 09 7b |w in lis|t? */..{|
|000054a0| 0d 09 09 68 32 20 3d 20 | 65 77 4c 69 73 74 3b 0d |...h2 = |ewList;.|
|000054b0| 09 09 65 77 4c 69 73 74 | 20 3d 20 28 2a 2a 65 77 |..ewList| = (**ew|
|000054c0| 4c 69 73 74 29 2e 65 4e | 65 78 74 3b 0d 09 7d 0d |List).eN|ext;..}.|
|000054d0| 09 65 6c 73 65 0d 09 7b | 0d 09 09 66 6f 72 20 28 |.else..{|...for (|
|000054e0| 68 20 3d 20 65 77 4c 69 | 73 74 3b 20 68 20 21 3d |h = ewLi|st; h !=|
|000054f0| 20 6e 69 6c 3b 20 68 20 | 3d 20 68 32 29 0d 09 09 | nil; h |= h2)...|
|00005500| 7b 0d 09 09 09 68 32 20 | 3d 20 28 2a 2a 68 29 2e |{....h2 |= (**h).|
|00005510| 65 4e 65 78 74 3b 0d 09 | 09 09 69 66 20 28 28 2a |eNext;..|..if ((*|
|00005520| 2a 68 32 29 2e 65 64 69 | 74 57 69 6e 64 20 3d 3d |*h2).edi|tWind ==|
|00005530| 20 65 64 69 74 57 69 6e | 64 29 09 2f 2a 20 66 6f | editWin|d)./* fo|
|00005540| 75 6e 64 20 69 74 20 2a | 2f 0d 09 09 09 7b 0d 09 |und it *|/....{..|
|00005550| 09 09 09 28 2a 2a 68 29 | 2e 65 4e 65 78 74 20 3d |...(**h)|.eNext =|
|00005560| 20 28 2a 2a 68 32 29 2e | 65 4e 65 78 74 3b 0d 09 | (**h2).|eNext;..|
|00005570| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 09 7d 0d 09 |...break|;....}..|
|00005580| 09 7d 0d 09 7d 0d 09 44 | 69 73 70 6f 73 48 61 6e |.}..}..D|isposHan|
|00005590| 64 6c 65 20 28 68 32 29 | 3b 09 09 09 2f 2a 20 67 |dle (h2)|;.../* g|
|000055a0| 65 74 20 72 69 64 20 6f | 66 20 69 6e 66 6f 72 6d |et rid o|f inform|
|000055b0| 61 74 69 6f 6e 20 73 74 | 72 75 63 74 75 72 65 20 |ation st|ructure |
|000055c0| 2a 2f 0d 0d 23 20 65 6e | 64 69 66 0d 0d 09 54 45 |*/..# en|dif...TE|
|000055d0| 44 69 73 70 6f 73 65 20 | 28 65 64 69 74 54 45 29 |Dispose |(editTE)|
|000055e0| 3b 09 09 09 2f 2a 20 74 | 6f 73 73 20 74 65 78 74 |;.../* t|oss text|
|000055f0| 20 72 65 63 6f 72 64 20 | 2a 2f 0d 09 44 69 73 70 | record |*/..Disp|
|00005600| 6f 73 65 57 69 6e 64 6f | 77 20 28 65 64 69 74 57 |oseWindo|w (editW|
|00005610| 69 6e 64 29 3b 09 2f 2a | 20 64 69 73 70 6f 73 65 |ind);./*| dispose|
|00005620| 73 20 6f 66 20 73 63 72 | 6f 6c 6c 20 62 61 72 2c |s of scr|oll bar,|
|00005630| 20 74 6f 6f 20 2a 2f 0d | 09 65 64 69 74 57 69 6e | too */.|.editWin|
|00005640| 64 20 3d 20 6e 69 6c 3b | 0d 09 44 6f 43 75 72 73 |d = nil;|..DoCurs|
|00005650| 6f 72 20 28 69 42 65 61 | 6d 43 75 72 73 6f 72 29 |or (iBea|mCursor)|
|00005660| 3b 0d 7d 0d 0d 0d 2f 2a | 0d 09 42 6c 69 6e 6b 20 |;.}.../*|..Blink |
|00005670| 74 68 65 20 63 61 72 65 | 74 20 61 6e 64 20 6d 61 |the care|t and ma|
|00005680| 6b 65 20 73 75 72 65 20 | 74 68 65 20 63 75 72 73 |ke sure |the curs|
|00005690| 6f 72 27 73 20 61 6e 20 | 69 2d 62 65 61 6d 20 77 |or's an |i-beam w|
|000056a0| 68 65 6e 20 69 74 27 73 | 0d 09 69 6e 20 74 68 65 |hen it's|..in the|
|000056b0| 20 6e 6f 6e 2d 73 63 72 | 6f 6c 6c 62 61 72 20 70 | non-scr|ollbar p|
|000056c0| 61 72 74 20 6f 66 20 74 | 68 65 20 77 69 6e 64 6f |art of t|he windo|
|000056d0| 77 2e 0d 2a 2f 0d 0d 73 | 74 61 74 69 63 20 49 64 |w..*/..s|tatic Id|
|000056e0| 6c 65 20 28 29 0d 7b 0d | 0d 09 53 79 6e 63 47 6c |le ().{.|..SyncGl|
|000056f0| 6f 62 61 6c 73 20 28 6e | 69 6c 29 3b 0d 09 54 45 |obals (n|il);..TE|
|00005700| 49 64 6c 65 20 28 65 64 | 69 74 54 45 29 3b 09 09 |Idle (ed|itTE);..|
|00005710| 09 2f 2a 20 62 6c 69 6e | 6b 20 74 68 61 74 20 63 |./* blin|k that c|
|00005720| 61 72 65 74 21 20 2a 2f | 0d 09 44 6f 43 75 72 73 |aret! */|..DoCurs|
|00005730| 6f 72 20 28 69 42 65 61 | 6d 43 75 72 73 6f 72 29 |or (iBea|mCursor)|
|00005740| 3b 0d 7d 0d 0d 0d 2f 2a | 20 2d 2d 2d 2d 2d 2d 2d |;.}.../*| -------|
|00005750| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005760| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005770| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005780| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 20 2a 2f 0d 2f 2a 09 |--------|- */./*.|
|00005790| 09 09 09 09 09 49 6e 74 | 65 72 6e 61 6c 20 46 69 |.....Int|ernal Fi|
|000057a0| 6c 65 20 52 6f 75 74 69 | 6e 65 73 09 09 09 09 09 |le Routi|nes.....|
|000057b0| 09 2a 2f 0d 2f 2a 20 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.*/./* -|--------|
|000057c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000057d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000057e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000057f0| 2d 2d 2d 2d 2d 2d 2d 20 | 2a 2f 0d 0d 0d 73 74 61 |------- |*/...sta|
|00005800| 74 69 63 20 45 72 72 4d | 65 73 67 20 28 73 29 0d |tic ErrM|esg (s).|
|00005810| 53 74 72 69 6e 67 50 74 | 72 09 73 3b 0d 7b 0d 09 |StringPt|r.s;.{..|
|00005820| 28 76 6f 69 64 29 20 46 | 61 6b 65 41 6c 65 72 74 |(void) F|akeAlert|
|00005830| 20 28 73 2c 20 22 5c 70 | 22 2c 20 22 5c 70 22 2c | (s, "\p|", "\p",|
|00005840| 20 22 5c 70 22 2c 20 31 | 2c 20 31 2c 20 22 5c 70 | "\p", 1|, 1, "\p|
|00005850| 4f 4b 22 2c 20 22 5c 70 | 22 2c 20 22 5c 70 22 29 |OK", "\p|", "\p")|
|00005860| 3b 0d 7d 0d 0d 0d 2f 2a | 0d 09 53 61 76 65 20 74 |;.}.../*|..Save t|
|00005870| 68 65 20 63 6f 6e 74 65 | 6e 74 73 20 6f 66 20 74 |he conte|nts of t|
|00005880| 68 65 20 65 64 69 74 20 | 77 69 6e 64 6f 77 2e 20 |he edit |window. |
|00005890| 20 49 66 20 74 68 65 72 | 65 20 69 73 20 6e 6f 20 | If ther|e is no |
|000058a0| 66 69 6c 65 20 62 6f 75 | 6e 64 0d 09 74 6f 20 74 |file bou|nd..to t|
|000058b0| 68 65 20 77 69 6e 64 6f | 77 2c 20 61 73 6b 20 66 |he windo|w, ask f|
|000058c0| 6f 72 20 61 20 66 69 6c | 65 20 6e 61 6d 65 2e 20 |or a fil|e name. |
|000058d0| 20 49 66 20 61 73 6b 46 | 6f 72 46 69 6c 65 20 69 | If askF|orFile i|
|000058e0| 73 20 74 72 75 65 2c 20 | 61 73 6b 0d 09 66 6f 72 |s true, |ask..for|
|000058f0| 20 61 20 6e 61 6d 65 20 | 65 76 65 6e 20 69 66 20 | a name |even if |
|00005900| 74 68 65 20 77 69 6e 64 | 6f 77 20 69 73 20 63 75 |the wind|ow is cu|
|00005910| 72 72 65 6e 74 6c 79 20 | 62 6f 75 6e 64 20 74 6f |rrently |bound to|
|00005920| 20 61 20 66 69 6c 65 2e | 20 20 49 66 0d 09 62 69 | a file.| If..bi|
|00005930| 6e 64 54 6f 46 69 6c 65 | 20 69 73 20 74 72 75 65 |ndToFile| is true|
|00005940| 2c 20 62 69 6e 64 20 74 | 68 65 20 77 69 6e 64 6f |, bind t|he windo|
|00005950| 77 20 74 6f 20 74 68 65 | 20 66 69 6c 65 20 77 72 |w to the| file wr|
|00005960| 69 74 74 65 6e 20 74 6f | 20 28 69 66 0d 09 74 68 |itten to| (if..th|
|00005970| 61 74 27 73 20 64 69 66 | 66 65 72 65 6e 74 20 74 |at's dif|ferent t|
|00005980| 68 61 6e 20 74 68 65 20 | 63 75 72 72 65 6e 74 6c |han the |currentl|
|00005990| 79 20 62 6f 75 6e 64 20 | 66 69 6c 65 29 2c 20 61 |y bound |file), a|
|000059a0| 6e 64 20 63 6c 65 61 72 | 20 74 68 65 0d 09 77 69 |nd clear| the..wi|
|000059b0| 6e 64 6f 77 27 73 20 64 | 69 72 74 79 20 66 6c 61 |ndow's d|irty fla|
|000059c0| 67 2e 0d 0d 09 52 65 74 | 75 72 6e 20 74 72 75 65 |g....Ret|urn true|
|000059d0| 20 69 66 20 74 68 65 20 | 66 69 6c 65 20 77 61 73 | if the |file was|
|000059e0| 20 77 72 69 74 74 65 6e | 20 77 69 74 68 6f 75 74 | written| without|
|000059f0| 20 65 72 72 6f 72 2e 20 | 20 52 65 74 75 72 6e 20 | error. | Return |
|00005a00| 66 61 6c 73 65 0d 09 69 | 66 20 28 61 29 20 75 73 |false..i|f (a) us|
|00005a10| 65 72 20 77 61 73 20 61 | 73 6b 65 64 20 66 6f 72 |er was a|sked for|
|00005a20| 20 6e 61 6d 65 20 61 6e | 64 20 63 6c 69 63 6b 65 | name an|d clicke|
|00005a30| 64 20 43 61 6e 63 65 6c | 20 28 62 29 20 74 68 65 |d Cancel| (b) the|
|00005a40| 72 65 20 77 61 73 0d 09 | 73 6f 6d 65 20 65 72 72 |re was..|some err|
|00005a50| 6f 72 20 77 72 69 74 69 | 6e 67 20 74 68 65 20 66 |or writi|ng the f|
|00005a60| 69 6c 65 2e 20 20 49 6e | 20 74 68 65 20 6c 61 74 |ile. In| the lat|
|00005a70| 74 65 72 20 63 61 73 65 | 2c 20 74 68 65 20 77 69 |ter case|, the wi|
|00005a80| 6e 64 6f 77 20 69 73 0d | 09 6e 6f 74 20 62 6f 75 |ndow is.|.not bou|
|00005a90| 6e 64 20 74 6f 20 61 6e | 79 20 6e 65 77 20 6e 61 |nd to an|y new na|
|00005aa0| 6d 65 20 67 69 76 65 6e | 20 62 79 20 75 73 65 72 |me given| by user|
|00005ab0| 2e 0d 0d 09 41 6c 77 61 | 79 73 20 72 65 74 75 72 |....Alwa|ys retur|
|00005ac0| 6e 73 20 66 61 6c 73 65 | 20 69 66 20 74 68 65 20 |ns false| if the |
|00005ad0| 77 69 6e 64 6f 77 20 69 | 73 6e 27 74 20 61 6e 20 |window i|sn't an |
|00005ae0| 65 64 69 74 20 77 69 6e | 64 6f 77 2e 20 20 54 68 |edit win|dow. Th|
|00005af0| 69 73 0d 09 73 69 6d 70 | 6c 69 66 69 65 73 20 45 |is..simp|lifies E|
|00005b00| 57 69 6e 64 6f 77 53 61 | 76 65 2c 20 45 57 69 6e |WindowSa|ve, EWin|
|00005b10| 64 6f 77 53 61 76 65 41 | 73 2c 20 45 57 69 6e 64 |dowSaveA|s, EWind|
|00005b20| 6f 77 53 61 76 65 43 6f | 70 79 2e 20 20 28 54 68 |owSaveCo|py. (Th|
|00005b30| 65 79 0d 09 64 6f 6e 27 | 74 20 64 6f 20 74 68 65 |ey..don'|t do the|
|00005b40| 20 74 65 73 74 2e 29 0d | 2a 2f 0d 0d 73 74 61 74 | test.).|*/..stat|
|00005b50| 69 63 20 42 6f 6f 6c 65 | 61 6e 20 53 61 76 65 46 |ic Boole|an SaveF|
|00005b60| 69 6c 65 20 28 74 68 65 | 57 69 6e 64 2c 20 61 73 |ile (the|Wind, as|
|00005b70| 6b 46 6f 72 46 69 6c 65 | 2c 20 62 69 6e 64 54 6f |kForFile|, bindTo|
|00005b80| 46 69 6c 65 29 0d 57 69 | 6e 64 6f 77 50 74 72 09 |File).Wi|ndowPtr.|
|00005b90| 74 68 65 57 69 6e 64 3b | 0d 42 6f 6f 6c 65 61 6e |theWind;|.Boolean|
|00005ba0| 09 09 61 73 6b 46 6f 72 | 46 69 6c 65 3b 0d 42 6f |..askFor|File;.Bo|
|00005bb0| 6f 6c 65 61 6e 09 09 62 | 69 6e 64 54 6f 46 69 6c |olean..b|indToFil|
|00005bc0| 65 3b 0d 7b 0d 49 6e 74 | 65 67 65 72 09 66 3b 0d |e;.{.Int|eger.f;.|
|00005bd0| 46 49 6e 66 6f 09 66 6e | 64 72 49 6e 66 6f 3b 09 |FInfo.fn|drInfo;.|
|00005be0| 2f 2a 20 66 69 6e 64 65 | 72 20 69 6e 66 6f 20 2a |/* finde|r info *|
|00005bf0| 2f 0d 53 46 52 65 70 6c | 79 09 74 6d 70 46 69 6c |/.SFRepl|y.tmpFil|
|00005c00| 65 3b 0d 48 61 6e 64 6c | 65 09 68 54 65 78 74 3b |e;.Handl|e.hText;|
|00005c10| 0d 4c 6f 6e 67 69 6e 74 | 09 63 6f 75 6e 74 3b 0d |.Longint|.count;.|
|00005c20| 4f 53 45 72 72 09 72 65 | 73 75 6c 74 3b 0d 42 6f |OSErr.re|sult;.Bo|
|00005c30| 6f 6c 65 61 6e 09 68 61 | 76 65 4e 65 77 46 69 6c |olean.ha|veNewFil|
|00005c40| 65 20 3d 20 66 61 6c 73 | 65 3b 0d 0d 09 69 66 20 |e = fals|e;...if |
|00005c50| 28 21 49 73 45 57 69 6e | 64 6f 77 20 28 74 68 65 |(!IsEWin|dow (the|
|00005c60| 57 69 6e 64 29 29 0d 09 | 09 72 65 74 75 72 6e 20 |Wind))..|.return |
|00005c70| 28 66 61 6c 73 65 29 3b | 0d 0d 09 53 79 6e 63 41 |(false);|...SyncA|
|00005c80| 6c 6c 47 6c 6f 62 61 6c | 73 20 28 74 68 65 57 69 |llGlobal|s (theWi|
|00005c90| 6e 64 29 3b 0d 09 74 6d | 70 46 69 6c 65 20 3d 20 |nd);..tm|pFile = |
|00005ca0| 65 64 69 74 46 69 6c 65 | 3b 09 09 09 09 09 2f 2a |editFile|;...../*|
|00005cb0| 20 69 6e 69 74 69 61 6c | 69 7a 65 20 64 65 66 61 | initial|ize defa|
|00005cc0| 75 6c 74 20 6e 61 6d 65 | 20 2a 2f 0d 09 69 66 20 |ult name| */..if |
|00005cd0| 28 62 6f 75 6e 64 20 3d | 3d 20 66 61 6c 73 65 20 |(bound =|= false |
|00005ce0| 7c 7c 20 61 73 6b 46 6f | 72 46 69 6c 65 29 0d 09 ||| askFo|rFile)..|
|00005cf0| 7b 0d 09 09 53 46 50 75 | 74 46 69 6c 65 20 28 64 |{...SFPu|tFile (d|
|00005d00| 6c 6f 67 57 68 65 72 65 | 2c 20 22 5c 70 53 61 76 |logWhere|, "\pSav|
|00005d10| 65 20 66 69 6c 65 20 61 | 73 3a 22 2c 20 65 64 69 |e file a|s:", edi|
|00005d20| 74 46 69 6c 65 2e 66 4e | 61 6d 65 2c 0d 09 09 09 |tFile.fN|ame,....|
|00005d30| 09 09 09 6e 69 6c 2c 20 | 26 74 6d 70 46 69 6c 65 |...nil, |&tmpFile|
|00005d40| 29 3b 0d 09 09 69 66 20 | 28 21 74 6d 70 46 69 6c |);...if |(!tmpFil|
|00005d50| 65 2e 67 6f 6f 64 29 0d | 09 09 09 72 65 74 75 72 |e.good).|...retur|
|00005d60| 6e 20 28 66 61 6c 73 65 | 29 3b 0d 09 09 65 6c 73 |n (false|);...els|
|00005d70| 65 0d 09 09 7b 0d 09 09 | 09 68 61 76 65 4e 65 77 |e...{...|.haveNew|
|00005d80| 46 69 6c 65 20 3d 20 74 | 72 75 65 3b 0d 09 09 09 |File = t|rue;....|
|00005d90| 69 66 20 28 47 65 74 46 | 49 6e 66 6f 20 28 74 6d |if (GetF|Info (tm|
|00005da0| 70 46 69 6c 65 2e 66 4e | 61 6d 65 2c 20 74 6d 70 |pFile.fN|ame, tmp|
|00005db0| 46 69 6c 65 2e 76 52 65 | 66 4e 75 6d 2c 20 26 66 |File.vRe|fNum, &f|
|00005dc0| 6e 64 72 49 6e 66 6f 29 | 0d 09 09 09 09 09 3d 3d |ndrInfo)|......==|
|00005dd0| 20 6e 6f 45 72 72 29 20 | 2f 2a 20 65 78 69 73 74 | noErr) |/* exist|
|00005de0| 73 20 2a 2f 0d 09 09 09 | 7b 0d 09 09 09 09 69 66 |s */....|{.....if|
|00005df0| 20 28 66 6e 64 72 49 6e | 66 6f 2e 66 64 54 79 70 | (fndrIn|fo.fdTyp|
|00005e00| 65 20 21 3d 20 27 54 45 | 58 54 27 29 0d 09 09 09 |e != 'TE|XT')....|
|00005e10| 09 7b 0d 09 09 09 09 09 | 45 72 72 4d 65 73 67 20 |.{......|ErrMesg |
|00005e20| 28 22 5c 70 4e 6f 74 20 | 61 20 54 45 58 54 20 46 |("\pNot |a TEXT F|
|00005e30| 69 6c 65 22 29 3b 0d 09 | 09 09 09 09 72 65 74 75 |ile");..|....retu|
|00005e40| 72 6e 20 28 66 61 6c 73 | 65 29 3b 0d 09 09 09 09 |rn (fals|e);.....|
|00005e50| 7d 0d 09 09 09 7d 0d 09 | 09 09 65 6c 73 65 09 2f |}....}..|..else./|
|00005e60| 2a 20 64 6f 65 73 6e 27 | 74 20 65 78 69 73 74 2e |* doesn'|t exist.|
|00005e70| 20 20 63 72 65 61 74 65 | 20 69 74 2e 20 2a 2f 0d | create| it. */.|
|00005e80| 09 09 09 7b 0d 09 09 09 | 09 69 66 20 28 43 72 65 |...{....|.if (Cre|
|00005e90| 61 74 65 20 28 74 6d 70 | 46 69 6c 65 2e 66 4e 61 |ate (tmp|File.fNa|
|00005ea0| 6d 65 2c 20 74 6d 70 46 | 69 6c 65 2e 76 52 65 66 |me, tmpF|ile.vRef|
|00005eb0| 4e 75 6d 2c 0d 09 09 09 | 09 09 09 09 63 72 65 61 |Num,....|....crea|
|00005ec0| 74 6f 72 2c 20 27 54 45 | 58 54 27 29 20 21 3d 20 |tor, 'TE|XT') != |
|00005ed0| 6e 6f 45 72 72 29 0d 09 | 09 09 09 7b 0d 09 09 09 |noErr)..|...{....|
|00005ee0| 09 09 45 72 72 4d 65 73 | 67 20 28 22 5c 70 43 61 |..ErrMes|g ("\pCa|
|00005ef0| 6e 27 74 20 43 72 65 61 | 74 65 22 29 3b 0d 09 09 |n't Crea|te");...|
|00005f00| 09 09 09 72 65 74 75 72 | 6e 20 28 66 61 6c 73 65 |...retur|n (false|
|00005f10| 29 3b 0d 09 09 09 09 7d | 0d 09 09 09 7d 0d 09 09 |);.....}|....}...|
|00005f20| 7d 0d 09 7d 0d 09 0d 09 | 69 66 20 28 46 53 4f 70 |}..}....|if (FSOp|
|00005f30| 65 6e 20 28 74 6d 70 46 | 69 6c 65 2e 66 4e 61 6d |en (tmpF|ile.fNam|
|00005f40| 65 2c 20 74 6d 70 46 69 | 6c 65 2e 76 52 65 66 4e |e, tmpFi|le.vRefN|
|00005f50| 75 6d 2c 20 26 66 29 20 | 21 3d 20 6e 6f 45 72 72 |um, &f) |!= noErr|
|00005f60| 29 0d 09 09 45 72 72 4d | 65 73 67 20 28 22 5c 70 |)...ErrM|esg ("\p|
|00005f70| 43 61 6e 27 74 20 4f 70 | 65 6e 22 29 3b 0d 09 65 |Can't Op|en");..e|
|00005f80| 6c 73 65 0d 09 7b 0d 09 | 09 44 6f 43 75 72 73 6f |lse..{..|.DoCurso|
|00005f90| 72 20 28 77 61 74 63 68 | 43 75 72 73 6f 72 29 3b |r (watch|Cursor);|
|00005fa0| 0d 09 09 28 76 6f 69 64 | 29 20 53 65 74 46 50 6f |...(void|) SetFPo|
|00005fb0| 73 20 28 66 2c 20 66 73 | 46 72 6f 6d 53 74 61 72 |s (f, fs|FromStar|
|00005fc0| 74 2c 20 30 4c 29 3b 0d | 09 09 68 54 65 78 74 20 |t, 0L);.|..hText |
|00005fd0| 3d 20 28 2a 2a 65 64 69 | 74 54 45 29 2e 68 54 65 |= (**edi|tTE).hTe|
|00005fe0| 78 74 3b 0d 09 09 48 4c | 6f 63 6b 20 28 68 54 65 |xt;...HL|ock (hTe|
|00005ff0| 78 74 29 3b 0d 09 09 63 | 6f 75 6e 74 20 3d 20 28 |xt);...c|ount = (|
|00006000| 2a 2a 65 64 69 74 54 45 | 29 2e 74 65 4c 65 6e 67 |**editTE|).teLeng|
|00006010| 74 68 3b 0d 09 09 72 65 | 73 75 6c 74 20 3d 20 46 |th;...re|sult = F|
|00006020| 53 57 72 69 74 65 20 28 | 66 2c 20 26 63 6f 75 6e |SWrite (|f, &coun|
|00006030| 74 2c 20 2a 68 54 65 78 | 74 29 3b 0d 09 09 28 76 |t, *hTex|t);...(v|
|00006040| 6f 69 64 29 20 47 65 74 | 46 50 6f 73 20 28 66 2c |oid) Get|FPos (f,|
|00006050| 20 26 63 6f 75 6e 74 29 | 3b 0d 09 09 28 76 6f 69 | &count)|;...(voi|
|00006060| 64 29 20 53 65 74 45 4f | 46 20 28 66 2c 20 63 6f |d) SetEO|F (f, co|
|00006070| 75 6e 74 29 3b 0d 09 09 | 28 76 6f 69 64 29 20 46 |unt);...|(void) F|
|00006080| 53 43 6c 6f 73 65 20 28 | 66 29 3b 0d 09 09 28 76 |SClose (|f);...(v|
|00006090| 6f 69 64 29 20 46 6c 75 | 73 68 56 6f 6c 20 28 6e |oid) Flu|shVol (n|
|000060a0| 69 6c 2c 20 74 6d 70 46 | 69 6c 65 2e 76 52 65 66 |il, tmpF|ile.vRef|
|000060b0| 4e 75 6d 29 3b 0d 09 09 | 48 55 6e 6c 6f 63 6b 20 |Num);...|HUnlock |
|000060c0| 28 68 54 65 78 74 29 3b | 0d 09 09 44 6f 43 75 72 |(hText);|...DoCur|
|000060d0| 73 6f 72 20 28 69 42 65 | 61 6d 43 75 72 73 6f 72 |sor (iBe|amCursor|
|000060e0| 29 3b 0d 09 09 69 66 20 | 28 72 65 73 75 6c 74 20 |);...if |(result |
|000060f0| 3d 3d 20 6e 6f 45 72 72 | 29 0d 09 09 7b 0d 09 09 |== noErr|)...{...|
|00006100| 09 69 66 20 28 62 69 6e | 64 54 6f 46 69 6c 65 29 |.if (bin|dToFile)|
|00006110| 0d 09 09 09 7b 0d 09 09 | 09 09 53 65 74 44 69 72 |....{...|..SetDir|
|00006120| 74 79 20 28 66 61 6c 73 | 65 29 3b 0d 09 09 09 09 |ty (fals|e);.....|
|00006130| 69 66 20 28 68 61 76 65 | 4e 65 77 46 69 6c 65 29 |if (have|NewFile)|
|00006140| 09 2f 2a 20 6e 61 6d 65 | 20 64 69 66 66 65 72 65 |./* name| differe|
|00006150| 6e 74 20 74 68 61 6e 20 | 63 75 72 72 65 6e 74 20 |nt than |current |
|00006160| 2a 2f 0d 09 09 09 09 7b | 0d 09 09 09 09 09 53 65 |*/.....{|......Se|
|00006170| 74 57 54 69 74 6c 65 20 | 28 65 64 69 74 57 69 6e |tWTitle |(editWin|
|00006180| 64 2c 20 74 6d 70 46 69 | 6c 65 2e 66 4e 61 6d 65 |d, tmpFi|le.fName|
|00006190| 29 3b 0d 0d 23 20 69 66 | 64 65 66 09 73 69 6e 67 |);..# if|def.sing|
|000061a0| 6c 65 45 64 69 74 0d 09 | 09 09 09 09 62 6f 75 6e |leEdit..|....boun|
|000061b0| 64 20 3d 20 74 72 75 65 | 3b 0d 09 09 09 09 09 65 |d = true|;......e|
|000061c0| 64 69 74 46 69 6c 65 20 | 3d 20 74 6d 70 46 69 6c |ditFile |= tmpFil|
|000061d0| 65 3b 0d 23 20 65 6c 73 | 65 0d 09 09 09 09 09 28 |e;.# els|e......(|
|000061e0| 2a 2a 65 64 69 74 49 6e | 66 6f 29 2e 62 6f 75 6e |**editIn|fo).boun|
|000061f0| 64 20 3d 20 74 72 75 65 | 3b 0d 09 09 09 09 09 28 |d = true|;......(|
|00006200| 2a 2a 65 64 69 74 49 6e | 66 6f 29 2e 65 64 69 74 |**editIn|fo).edit|
|00006210| 46 69 6c 65 20 3d 20 74 | 6d 70 46 69 6c 65 3b 0d |File = t|mpFile;.|
|00006220| 23 20 65 6e 64 69 66 0d | 0d 09 09 09 09 7d 0d 09 |# endif.|.....}..|
|00006230| 09 09 7d 0d 09 09 09 72 | 65 74 75 72 6e 20 28 74 |..}....r|eturn (t|
|00006240| 72 75 65 29 3b 0d 09 09 | 7d 0d 09 09 45 72 72 4d |rue);...|}...ErrM|
|00006250| 65 73 67 20 28 22 5c 70 | 57 72 69 74 65 20 65 72 |esg ("\p|Write er|
|00006260| 72 6f 72 21 22 29 3b 0d | 09 7d 0d 09 72 65 74 75 |ror!");.|.}..retu|
|00006270| 72 6e 20 28 66 61 6c 73 | 65 29 3b 0d 7d 0d 0d 0d |rn (fals|e);.}...|
|00006280| 2f 2a 0d 09 52 65 76 65 | 72 74 20 74 6f 20 76 65 |/*..Reve|rt to ve|
|00006290| 72 73 69 6f 6e 20 6f 66 | 20 66 69 6c 65 20 73 61 |rsion of| file sa|
|000062a0| 76 65 64 20 6f 6e 20 64 | 69 73 6b 2e 20 20 44 6f |ved on d|isk. Do|
|000062b0| 65 73 6e 27 74 20 63 68 | 65 63 6b 20 77 68 65 74 |esn't ch|eck whet|
|000062c0| 68 65 72 0d 09 74 68 65 | 20 77 69 6e 64 6f 77 27 |her..the| window'|
|000062d0| 73 20 72 65 61 6c 6c 79 | 20 62 6f 75 6e 64 20 74 |s really| bound t|
|000062e0| 6f 20 61 20 66 69 6c 65 | 20 6f 72 20 6e 6f 74 2c |o a file| or not,|
|000062f0| 20 64 6f 65 73 6e 27 74 | 20 61 73 6b 20 77 68 65 | doesn't| ask whe|
|00006300| 74 68 65 72 0d 09 74 6f | 20 72 65 61 6c 6c 79 20 |ther..to| really |
|00006310| 72 65 76 65 72 74 20 69 | 66 20 74 68 65 20 77 69 |revert i|f the wi|
|00006320| 6e 64 6f 77 27 73 20 64 | 69 72 74 79 2c 20 64 6f |ndow's d|irty, do|
|00006330| 65 73 20 6e 6f 20 72 65 | 64 72 61 77 69 6e 67 2c |es no re|drawing,|
|00006340| 20 65 74 63 2e 0d 09 4a | 75 73 74 20 72 65 70 6f | etc...J|ust repo|
|00006350| 72 74 73 20 77 68 65 74 | 68 65 72 20 74 68 65 20 |rts whet|her the |
|00006360| 66 69 6c 65 20 77 61 73 | 20 72 65 61 64 20 69 6e |file was| read in|
|00006370| 20 73 75 63 63 65 73 73 | 66 75 6c 6c 79 2e 0d 2a | success|fully..*|
|00006380| 2f 0d 0d 73 74 61 74 69 | 63 20 42 6f 6f 6c 65 61 |/..stati|c Boolea|
|00006390| 6e 20 52 65 76 65 72 74 | 20 28 29 0d 7b 0d 42 6f |n Revert| ().{.Bo|
|000063a0| 6f 6c 65 61 6e 09 72 65 | 73 75 6c 74 20 3d 20 66 |olean.re|sult = f|
|000063b0| 61 6c 73 65 3b 0d 49 6e | 74 65 67 65 72 09 66 3b |alse;.In|teger.f;|
|000063c0| 0d 4c 6f 6e 67 69 6e 74 | 09 6c 65 6e 3b 0d 48 61 |.Longint|.len;.Ha|
|000063d0| 6e 64 6c 65 09 68 3b 0d | 0d 09 44 6f 43 75 72 73 |ndle.h;.|..DoCurs|
|000063e0| 6f 72 20 28 77 61 74 63 | 68 43 75 72 73 6f 72 29 |or (watc|hCursor)|
|000063f0| 3b 0d 09 69 66 20 28 46 | 53 4f 70 65 6e 20 28 65 |;..if (F|SOpen (e|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.