home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / demo / simpleto.sit / SimpleTools2.c < prev   
MacBinary  |  1987-04-21  |  50.3 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

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

You can browse this item here: SimpleTools2.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Tue Apr 21 21:40:51 1987, modified Tue Apr 21 21:40:51 1987, creator Think C, type ASCII, 50835 bytes "SimpleTools2.c" , at 0xc713 348 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0e 53 69 6d 70 6c 65 | 54 6f 6f 6c 73 32 2e 63 |..Simple|Tools2.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 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 c6 93 00 | 00 01 5c 9c b1 d0 23 9c |........|..\...#.|
|00000060| b1 d0 23 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..#.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 a6 c7 00 00 |........|........|
|00000080| 0d 0d 2f 2a 0d 09 54 69 | 74 6c 65 09 3a 20 53 69 |../*..Ti|tle.: Si|
|00000090| 6d 70 6c 65 54 6f 6f 6c | 73 32 2e 63 0d 09 41 75 |mpleTool|s2.c..Au|
|000000a0| 74 68 6f 72 09 3a 20 45 | 72 69 6b 20 4b 69 6c 6b |thor.: E|rik Kilk|
|000000b0| 20 20 43 6f 70 79 72 69 | 67 68 74 20 31 39 38 35 | Copyri|ght 1985|
|000000c0| 2c 20 31 39 38 37 0d 09 | 44 61 74 65 73 09 3a 20 |, 1987..|Dates.: |
|000000d0| 4a 75 6e 65 20 37 2c 20 | 31 39 38 35 2c 20 4a 75 |June 7, |1985, Ju|
|000000e0| 6e 65 20 33 2c 20 31 39 | 38 36 2c 20 4e 6f 76 65 |ne 3, 19|86, Nove|
|000000f0| 6d 62 65 72 20 38 2c 20 | 31 39 38 36 0d 09 09 20 |mber 8, |1986... |
|00000100| 20 4e 6f 76 65 6d 62 65 | 72 20 32 38 2c 20 31 39 | Novembe|r 28, 19|
|00000110| 38 36 2c 20 41 70 72 69 | 6c 20 31 37 2c 20 31 39 |86, Apri|l 17, 19|
|00000120| 38 37 2c 20 41 70 72 69 | 6c 20 32 31 2c 20 31 39 |87, Apri|l 21, 19|
|00000130| 38 37 2e 0d 09 0d 09 53 | 69 6d 70 6c 65 54 6f 6f |87.....S|impleToo|
|00000140| 6c 73 20 69 73 20 61 20 | 63 6f 6c 6c 65 63 74 69 |ls is a |collecti|
|00000150| 6f 6e 20 6f 66 20 72 6f | 75 74 69 6e 65 73 20 74 |on of ro|utines t|
|00000160| 6f 20 61 69 64 20 70 72 | 6f 67 72 61 6d 6d 69 6e |o aid pr|ogrammin|
|00000170| 67 0d 09 73 69 6d 70 6c | 65 20 22 4d 61 63 69 6e |g..simpl|e "Macin|
|00000180| 74 6f 73 68 20 6c 6f 6f | 6b 69 6e 67 22 20 70 72 |tosh loo|king" pr|
|00000190| 6f 67 72 61 6d 73 2e 20 | 20 53 69 6d 70 6c 65 54 |ograms. | SimpleT|
|000001a0| 6f 6f 6c 73 20 69 6e 69 | 74 69 61 6c 69 7a 65 73 |ools ini|tializes|
|000001b0| 0d 09 74 68 65 20 74 6f | 6f 6c 62 6f 78 2c 20 6d |..the to|olbox, m|
|000001c0| 6f 6e 69 74 6f 72 73 20 | 26 20 61 63 74 73 20 75 |onitors |& acts u|
|000001d0| 70 6f 6e 20 65 76 65 6e | 74 73 2c 20 61 6e 64 20 |pon even|ts, and |
|000001e0| 70 72 6f 76 69 64 65 73 | 20 67 65 6e 65 72 69 63 |provides| generic|
|000001f0| 0d 09 69 2f 6f 20 72 6f | 75 74 69 6e 65 73 20 66 |..i/o ro|utines f|
|00000200| 6f 72 20 79 6f 75 72 20 | 61 70 70 6c 69 63 61 74 |or your |applicat|
|00000210| 69 6f 6e 2e 20 20 59 6f | 75 20 69 6e 69 74 69 61 |ion. Yo|u initia|
|00000220| 6c 69 7a 65 20 79 6f 75 | 72 20 70 72 6f 67 72 61 |lize you|r progra|
|00000230| 6d 0d 09 62 79 20 6c 65 | 74 74 69 6e 67 20 53 69 |m..by le|tting Si|
|00000240| 6d 70 6c 65 54 6f 6f 6c | 73 20 6b 6e 6f 77 20 77 |mpleTool|s know w|
|00000250| 68 61 74 20 77 69 6e 64 | 6f 77 73 20 61 6e 64 20 |hat wind|ows and |
|00000260| 6d 65 6e 75 73 20 79 6f | 75 20 77 61 6e 74 20 61 |menus yo|u want a|
|00000270| 6c 6f 6e 67 0d 09 77 69 | 74 68 20 77 68 61 74 20 |long..wi|th what |
|00000280| 66 75 6e 63 74 69 6f 6e | 73 20 53 69 6d 70 6c 65 |function|s Simple|
|00000290| 54 6f 6f 6c 73 20 73 68 | 6f 75 6c 64 20 63 61 6c |Tools sh|ould cal|
|000002a0| 6c 20 77 68 65 6e 20 74 | 68 65 79 20 61 72 65 0d |l when t|hey are.|
|000002b0| 09 73 65 6c 65 63 74 65 | 64 2e 0d 09 0d 09 54 68 |.selecte|d.....Th|
|000002c0| 65 20 70 75 72 70 6f 73 | 65 20 6f 66 20 53 69 6d |e purpos|e of Sim|
|000002d0| 70 6c 65 54 6f 6f 6c 73 | 20 69 73 20 74 6f 20 65 |pleTools| is to e|
|000002e0| 6e 63 6f 75 72 61 67 65 | 20 79 6f 75 20 74 6f 20 |ncourage| you to |
|000002f0| 70 72 6f 67 72 61 6d 20 | 74 68 6f 73 65 0d 09 73 |program |those..s|
|00000300| 69 6d 70 6c 65 20 70 72 | 6f 67 72 61 6d 73 20 6f |imple pr|ograms o|
|00000310| 72 20 74 6f 20 70 69 6c | 6f 74 20 6c 61 72 67 65 |r to pil|ot large|
|00000320| 72 20 70 72 6f 67 72 61 | 6d 73 20 77 68 69 63 68 |r progra|ms which|
|00000330| 20 79 6f 75 20 6d 61 79 | 20 6e 6f 74 0d 09 64 6f | you may| not..do|
|00000340| 20 64 75 65 20 74 6f 20 | 74 68 65 20 65 6e 6f 72 | due to |the enor|
|00000350| 6d 6f 75 73 20 65 66 66 | 6f 72 74 20 72 65 71 75 |mous eff|ort requ|
|00000360| 69 72 65 64 20 74 6f 20 | 75 73 65 20 74 68 65 20 |ired to |use the |
|00000370| 4d 61 63 69 6e 74 6f 73 | 68 0d 09 74 6f 6f 6c 62 |Macintos|h..toolb|
|00000380| 6f 78 2e 20 20 4d 79 20 | 67 6f 61 6c 20 77 61 73 |ox. My |goal was|
|00000390| 20 74 6f 20 73 74 75 64 | 79 20 49 6e 73 69 64 65 | to stud|y Inside|
|000003a0| 20 4d 61 63 69 6e 74 6f | 73 68 20 6f 6e 63 65 20 | Macinto|sh once |
|000003b0| 74 6f 0d 09 43 72 65 61 | 74 65 20 53 69 6d 70 6c |to..Crea|te Simpl|
|000003c0| 65 54 6f 6f 6c 73 20 61 | 6e 64 20 74 68 65 6e 20 |eTools a|nd then |
|000003d0| 62 65 20 61 62 6c 65 20 | 74 6f 20 66 6f 72 67 65 |be able |to forge|
|000003e0| 74 20 6d 6f 73 74 20 6f | 66 20 74 68 65 20 75 73 |t most o|f the us|
|000003f0| 61 67 65 73 0d 09 6f 66 | 20 74 68 65 20 54 6f 6f |ages..of| the Too|
|00000400| 6c 62 6f 78 20 72 6f 75 | 74 69 6e 65 73 2e 20 20 |lbox rou|tines. |
|00000410| 49 6e 73 74 65 61 64 20 | 6f 66 20 74 68 75 6d 62 |Instead |of thumb|
|00000420| 69 6e 67 20 74 68 72 6f | 75 67 68 20 68 75 6e 64 |ing thro|ugh hund|
|00000430| 72 65 64 73 20 6f 66 0d | 09 70 61 67 65 73 20 6f |reds of.|.pages o|
|00000440| 66 20 49 6e 73 69 64 65 | 20 4d 61 63 69 6e 74 6f |f Inside| Macinto|
|00000450| 73 68 20 6a 75 73 74 20 | 74 6f 20 67 65 74 20 73 |sh just |to get s|
|00000460| 6f 6d 65 74 68 69 6e 67 | 20 75 70 20 61 6e 64 20 |omething| up and |
|00000470| 72 75 6e 6e 69 6e 67 2c | 0d 09 6f 6e 65 20 6e 65 |running,|..one ne|
|00000480| 65 64 20 6f 6e 6c 79 20 | 72 65 6d 65 6d 62 65 72 |ed only |remember|
|00000490| 20 61 20 64 6f 7a 65 6e | 20 67 65 6e 65 72 69 63 | a dozen| generic|
|000004a0| 20 63 61 6c 6c 73 2e 0d | 0d 09 53 69 6d 70 6c 65 | calls..|..Simple|
|000004b0| 54 6f 6f 6c 73 20 69 73 | 20 76 65 72 79 20 70 6f |Tools is| very po|
|000004c0| 77 65 72 66 75 6c 2c 20 | 79 65 74 20 61 6c 73 6f |werful, |yet also|
|000004d0| 20 76 65 72 79 20 73 69 | 6d 70 6c 65 20 74 6f 20 | very si|mple to |
|000004e0| 75 73 65 2e 20 20 4f 6e | 65 0d 09 63 61 6e 20 67 |use. On|e..can g|
|000004f0| 65 74 20 61 20 70 72 6f | 67 72 61 6d 20 75 70 20 |et a pro|gram up |
|00000500| 61 6e 64 20 72 75 6e 6e | 69 6e 67 20 77 69 74 68 |and runn|ing with|
|00000510| 20 64 65 73 6b 20 61 63 | 63 65 73 73 6f 72 69 65 | desk ac|cessorie|
|00000520| 73 2c 20 77 69 6e 64 6f | 77 73 2c 0d 09 61 6e 64 |s, windo|ws,..and|
|00000530| 20 6d 65 6e 75 73 20 69 | 6e 20 6f 6e 6c 79 20 61 | menus i|n only a|
|00000540| 20 66 65 77 20 6d 69 6e | 75 74 65 73 2e 20 20 41 | few min|utes. A|
|00000550| 64 76 61 6e 63 65 20 66 | 65 61 74 75 72 65 73 20 |dvance f|eatures |
|00000560| 6f 66 20 53 69 6d 70 6c | 65 54 6f 6f 6c 73 0d 09 |of Simpl|eTools..|
|00000570| 61 6c 6c 6f 77 20 79 6f | 75 20 74 6f 20 72 65 74 |allow yo|u to ret|
|00000580| 72 69 65 76 65 20 65 6e | 6f 75 67 68 20 69 6e 66 |rieve en|ough inf|
|00000590| 6f 72 6d 61 74 69 6f 6e | 20 66 72 6f 6d 20 53 69 |ormation| from Si|
|000005a0| 6d 70 6c 65 54 6f 6f 6c | 73 20 74 6f 20 63 61 6c |mpleTool|s to cal|
|000005b0| 6c 0d 09 61 6e 79 20 6f | 66 20 74 68 65 20 74 6f |l..any o|f the to|
|000005c0| 6f 6c 62 6f 78 20 72 6f | 75 74 69 6e 65 73 20 6d |olbox ro|utines m|
|000005d0| 61 6e 75 61 6c 6c 79 20 | 69 66 20 6e 65 65 64 20 |anually |if need |
|000005e0| 62 65 2e 20 20 0d 09 0d | 09 0d 3d 3d 3d 3d 3d 3d |be. ...|..======|
|000005f0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000600| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000610| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000620| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000630| 3d 3d 3d 0d 0d 09 59 6f | 75 20 6d 61 79 20 75 73 |===...Yo|u may us|
|00000640| 65 2c 20 73 74 75 64 79 | 2c 20 63 6f 70 79 2c 20 |e, study|, copy, |
|00000650| 61 6e 64 20 66 72 65 65 | 6c 79 20 64 69 73 74 72 |and free|ly distr|
|00000660| 69 62 75 74 65 20 53 69 | 6d 70 6c 65 54 6f 6f 6c |ibute Si|mpleTool|
|00000670| 73 20 69 66 3a 0d 09 09 | 31 29 20 20 59 6f 75 20 |s if:...|1) You |
|00000680| 6d 65 6e 74 69 6f 6e 20 | 22 50 72 6f 67 72 61 6d |mention |"Program|
|00000690| 6d 65 64 20 77 69 74 68 | 20 74 68 65 20 61 69 64 |med with| the aid|
|000006a0| 20 6f 66 20 53 69 6d 70 | 6c 65 54 6f 6f 6c 73 0d | of Simp|leTools.|
|000006b0| 09 09 20 20 20 20 28 63 | 29 20 45 72 69 6b 20 4b |.. (c|) Erik K|
|000006c0| 69 6c 6b 20 31 39 38 36 | 22 20 69 6e 20 79 6f 75 |ilk 1986|" in you|
|000006d0| 72 20 41 62 6f 75 74 2e | 2e 2e 20 77 69 6e 64 6f |r About.|.. windo|
|000006e0| 77 20 6f 66 20 61 6c 6c | 0d 09 09 20 20 20 20 70 |w of all|... p|
|000006f0| 72 6f 67 72 61 6d 73 20 | 64 69 73 74 72 69 62 75 |rograms |distribu|
|00000700| 74 65 64 20 66 72 65 65 | 2c 20 73 68 61 72 65 2c |ted free|, share,|
|00000710| 20 6f 72 20 6d 61 72 6b | 65 74 74 65 64 2e 0d 09 | or mark|etted...|
|00000720| 09 32 29 20 20 59 6f 75 | 20 72 65 67 69 73 74 65 |.2) You| registe|
|00000730| 72 20 62 79 20 73 65 6e | 64 69 6e 67 20 24 32 30 |r by sen|ding $20|
|00000740| 20 6f 72 20 6d 6f 72 65 | 20 74 6f 3a 0d 09 09 09 | or more| to:....|
|00000750| 45 72 69 6b 20 4b 69 6c | 6b 0d 09 09 09 34 39 34 |Erik Kil|k....494|
|00000760| 39 20 53 6e 79 64 65 72 | 20 4c 61 6e 65 2c 20 23 |9 Snyder| Lane, #|
|00000770| 32 34 37 0d 09 09 09 52 | 6f 68 6e 65 72 74 20 50 |247....R|ohnert P|
|00000780| 61 72 6b 2c 20 43 41 20 | 20 39 34 39 32 38 0d 09 |ark, CA | 94928..|
|00000790| 09 09 28 37 30 37 29 20 | 37 39 34 2d 32 34 32 34 |..(707) |794-2424|
|000007a0| 20 77 65 65 6b 64 61 79 | 20 61 66 74 65 72 6e 6f | weekday| afterno|
|000007b0| 6f 6e 73 0d 09 09 20 20 | 20 20 74 6f 20 65 6e 63 |ons... | to enc|
|000007c0| 6f 75 72 61 67 65 20 6d | 65 20 74 6f 20 6d 61 69 |ourage m|e to mai|
|000007d0| 6e 74 61 69 6e 20 61 6e | 64 20 69 6d 70 72 6f 76 |ntain an|d improv|
|000007e0| 65 20 53 69 6d 70 6c 65 | 54 6f 6f 6c 73 2e 0d 09 |e Simple|Tools...|
|000007f0| 09 20 20 20 20 0d 3d 3d | 3e 09 46 6f 72 20 61 20 |. .==|>.For a |
|00000800| 64 69 73 6b 65 74 74 65 | 20 69 6e 63 6c 75 64 69 |diskette| includi|
|00000810| 6e 67 20 74 68 65 20 6d | 6f 73 74 20 72 65 63 65 |ng the m|ost rece|
|00000820| 6e 74 20 76 65 72 73 69 | 6f 6e 20 6f 66 20 53 69 |nt versi|on of Si|
|00000830| 6d 70 6c 65 54 6f 6f 6c | 73 2c 20 0d 09 73 65 76 |mpleTool|s, ..sev|
|00000840| 65 72 61 6c 20 64 65 74 | 61 69 6c 65 64 20 65 78 |eral det|ailed ex|
|00000850| 61 6d 70 6c 65 73 20 6f | 66 20 75 73 69 6e 67 20 |amples o|f using |
|00000860| 53 69 6d 70 6c 65 54 6f | 6f 6c 73 2c 20 61 6e 64 |SimpleTo|ols, and|
|00000870| 20 61 20 4d 61 63 57 72 | 69 74 65 20 66 69 6c 65 | a MacWr|ite file|
|00000880| 0d 09 64 65 73 63 72 69 | 62 69 6e 67 20 53 69 6d |..descri|bing Sim|
|00000890| 70 6c 65 54 6f 6f 6c 73 | 20 61 6e 64 20 69 74 73 |pleTools| and its|
|000008a0| 20 75 73 65 20 69 6e 20 | 6d 6f 72 65 20 64 65 74 | use in |more det|
|000008b0| 61 69 6c 2c 20 73 65 6e | 64 20 6d 65 20 61 0d 09 |ail, sen|d me a..|
|000008c0| 64 69 73 6b 65 74 74 65 | 20 77 69 74 68 20 65 6e |diskette| with en|
|000008d0| 6f 75 67 68 20 73 74 61 | 6d 70 73 20 74 6f 20 6d |ough sta|mps to m|
|000008e0| 61 69 6c 20 69 74 20 62 | 61 63 6b 20 74 6f 20 79 |ail it b|ack to y|
|000008f0| 6f 75 2e 20 20 4d 61 6b | 65 20 73 75 72 65 20 79 |ou. Mak|e sure y|
|00000900| 6f 75 0d 09 68 61 76 65 | 20 72 65 67 69 73 74 65 |ou..have| registe|
|00000910| 72 65 64 20 61 73 20 73 | 74 61 74 65 64 20 61 62 |red as s|tated ab|
|00000920| 6f 76 65 2e 0d 09 09 0d | 09 54 68 69 73 20 69 73 |ove.....|.This is|
|00000930| 20 31 32 38 6b 2c 20 4d | 46 53 2c 20 48 46 53 2c | 128k, M|FS, HFS,|
|00000940| 20 6f 6c 64 20 52 4f 4d | 2c 20 6e 65 77 20 52 4f | old ROM|, new RO|
|00000950| 4d 2c 20 4d 61 63 2b 2c | 20 26 20 54 4d 4f 4e 20 |M, Mac+,| & TMON |
|00000960| 63 6f 6d 70 61 74 69 62 | 6c 65 2e 0d 09 54 68 69 |compatib|le...Thi|
|00000970| 73 20 66 69 6c 65 20 63 | 6f 6d 70 69 6c 65 73 20 |s file c|ompiles |
|00000980| 61 6e 64 20 65 78 65 63 | 75 74 65 73 20 77 69 74 |and exec|utes wit|
|00000990| 68 20 4d 65 67 61 6d 61 | 78 20 33 2e 30 20 62 65 |h Megama|x 3.0 be|
|000009a0| 74 61 20 61 6e 64 0d 09 | 4c 69 67 68 74 53 70 65 |ta and..|LightSpe|
|000009b0| 65 64 20 32 2e 31 2e 20 | 20 41 64 6a 75 73 74 20 |ed 2.1. | Adjust |
|000009c0| 74 68 65 20 64 65 66 69 | 6e 69 74 69 6f 6e 20 69 |the defi|nition i|
|000009d0| 6e 20 73 69 6d 70 6c 65 | 2e 68 20 66 6f 72 20 79 |n simple|.h for y|
|000009e0| 6f 75 72 0d 09 63 6f 6d | 70 69 6c 65 72 2e 20 20 |our..com|piler. |
|000009f0| 57 68 65 6e 20 70 6f 72 | 74 69 6e 67 20 74 6f 20 |When por|ting to |
|00000a00| 6f 74 68 65 72 20 63 6f | 6d 70 69 6c 65 72 73 2c |other co|mpilers,|
|00000a10| 20 70 61 79 20 70 61 72 | 74 69 63 75 6c 61 72 0d | pay par|ticular.|
|00000a20| 09 61 74 74 65 6e 74 69 | 6f 6e 20 74 6f 20 77 68 |.attenti|on to wh|
|00000a30| 65 72 65 20 74 68 65 20 | 4c 69 67 68 74 73 70 65 |ere the |Lightspe|
|00000a40| 65 64 20 61 6e 64 20 4d | 65 67 61 6d 61 78 20 63 |ed and M|egamax c|
|00000a50| 6f 64 65 20 69 73 20 73 | 70 65 63 69 66 69 65 64 |ode is s|pecified|
|00000a60| 0d 09 73 69 6e 63 65 20 | 74 68 65 73 65 20 70 6c |..since |these pl|
|00000a70| 61 63 65 73 20 61 72 65 | 20 74 68 65 20 6c 69 6b |aces are| the lik|
|00000a80| 65 6c 79 20 70 72 6f 62 | 6c 65 6d 20 61 72 65 61 |ely prob|lem area|
|00000a90| 73 2e 0d 09 0d 09 4c 49 | 47 48 54 53 50 45 45 44 |s.....LI|GHTSPEED|
|00000aa0| 20 4e 4f 54 45 3a 0d 09 | 0d 09 44 72 61 67 20 53 | NOTE:..|..Drag S|
|00000ab0| 69 6d 70 6c 65 54 6f 6f | 6c 73 20 6f 75 74 20 6f |impleToo|ls out o|
|00000ac0| 66 20 74 68 65 20 6d 61 | 69 6e 20 73 65 67 6d 65 |f the ma|in segme|
|00000ad0| 6e 74 20 69 6e 20 79 6f | 75 72 20 70 72 6f 6a 65 |nt in yo|ur proje|
|00000ae0| 63 74 20 77 69 6e 64 6f | 77 2e 0d 09 59 6f 75 20 |ct windo|w...You |
|00000af0| 64 6f 20 74 68 69 73 20 | 62 79 20 64 72 61 67 67 |do this |by dragg|
|00000b00| 69 6e 67 20 69 74 20 62 | 65 6c 6f 77 20 74 68 65 |ing it b|elow the|
|00000b10| 20 64 6f 74 74 65 64 20 | 68 6f 72 69 7a 6f 6e 74 | dotted |horizont|
|00000b20| 61 6c 20 4c 69 6e 65 20 | 69 6e 20 74 68 65 0d 09 |al Line |in the..|
|00000b30| 70 72 6f 6a 65 63 74 20 | 77 69 6e 64 6f 77 2e 0d |project |window..|
|00000b40| 09 0d 09 53 69 6d 70 6c | 65 54 6f 6f 6c 73 20 72 |...Simpl|eTools r|
|00000b50| 65 71 75 69 72 65 73 20 | 74 68 65 20 4d 61 63 54 |equires |the MacT|
|00000b60| 72 61 70 73 20 6c 69 62 | 72 61 72 79 20 61 6e 64 |raps lib|rary and|
|00000b70| 20 73 74 72 69 6e 67 73 | 61 73 6d 2e 63 20 6f 72 | strings|asm.c or|
|00000b80| 0d 09 73 74 72 69 6e 67 | 73 2e 63 2e 20 20 49 66 |..string|s.c. If|
|00000b90| 20 79 6f 75 20 6c 6f 61 | 64 20 74 68 65 20 75 6e | you loa|d the un|
|00000ba0| 69 78 20 6c 69 62 72 61 | 72 79 2c 20 79 6f 75 72 |ix libra|ry, your|
|00000bb0| 20 70 72 6f 6a 65 63 74 | 20 77 69 6c 6c 20 62 65 | project| will be|
|00000bc0| 0d 09 6c 61 72 67 65 72 | 20 74 68 61 6e 20 6e 65 |..larger| than ne|
|00000bd0| 65 64 65 64 20 28 75 6e | 6c 65 73 73 20 79 6f 75 |eded (un|less you|
|00000be0| 20 6e 65 65 64 20 75 6e | 69 78 20 66 6f 72 20 79 | need un|ix for y|
|00000bf0| 6f 75 72 20 6f 77 6e 20 | 70 72 6f 67 72 61 6d 2e |our own |program.|
|00000c00| 29 0d 09 0d 09 4d 45 47 | 41 4d 41 58 20 4e 4f 54 |)....MEG|AMAX NOT|
|00000c10| 45 3a 0d 09 0d 09 55 73 | 65 20 4d 65 67 61 6d 61 |E:....Us|e Megama|
|00000c20| 78 27 73 20 63 6f 6e 76 | 65 72 74 20 75 74 69 6c |x's conv|ert util|
|00000c30| 69 74 79 20 74 6f 20 63 | 6f 6e 76 65 72 74 20 61 |ity to c|onvert a|
|00000c40| 6c 6c 20 4d 61 63 20 6e | 61 6d 65 73 20 74 6f 20 |ll Mac n|ames to |
|00000c50| 61 6c 6c 0d 09 6c 6f 77 | 65 72 20 63 61 73 65 2e |all..low|er case.|
|00000c60| 20 20 49 66 20 79 6f 75 | 20 73 65 6e 64 20 6d 65 | If you| send me|
|00000c70| 20 73 75 67 67 65 73 74 | 69 6f 6e 73 20 61 6e 64 | suggest|ions and|
|00000c80| 2f 6f 72 20 6e 65 77 20 | 63 6f 64 65 20 66 6f 72 |/or new |code for|
|00000c90| 0d 09 53 69 6d 70 6c 65 | 54 6f 6f 6c 73 2c 20 70 |..Simple|Tools, p|
|00000ca0| 6c 65 61 73 65 20 63 6f | 6e 76 65 72 74 20 62 61 |lease co|nvert ba|
|00000cb0| 63 6b 20 74 6f 20 6d 69 | 78 65 64 20 63 61 73 65 |ck to mi|xed case|
|00000cc0| 20 66 69 72 73 74 2e 0d | 09 0d 3d 3d 3d 3d 3d 3d | first..|..======|
|00000cd0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000ce0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000cf0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000d00| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000d10| 3d 3d 3d 0d 09 0d 09 53 | 69 6d 70 6c 65 54 6f 6f |===....S|impleToo|
|00000d20| 6c 73 20 70 72 6f 76 69 | 64 65 73 20 74 68 65 20 |ls provi|des the |
|00000d30| 66 6f 6c 6c 6f 77 69 6e | 67 20 66 75 6e 63 74 69 |followin|g functi|
|00000d40| 6f 6e 73 20 66 6f 72 20 | 79 6f 75 72 20 61 70 70 |ons for |your app|
|00000d50| 6c 69 63 61 74 69 6f 6e | 0d 09 74 6f 20 63 61 6c |lication|..to cal|
|00000d60| 6c 2e 20 20 4e 6f 74 65 | 20 74 68 61 74 20 79 6f |l. Note| that yo|
|00000d70| 75 72 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 6e |ur appli|cation n|
|00000d80| 65 65 64 20 6e 6f 74 20 | 63 61 6c 6c 20 61 6e 79 |eed not |call any|
|00000d90| 20 54 6f 6f 6c 62 6f 78 | 0d 09 72 6f 75 74 69 6e | Toolbox|..routin|
|00000da0| 65 73 20 64 69 72 65 63 | 74 6c 79 2e 20 20 54 68 |es direc|tly. Th|
|00000db0| 65 20 65 6e 74 69 72 65 | 20 43 20 70 72 6f 67 72 |e entire| C progr|
|00000dc0| 61 6d 20 28 69 6e 63 6c | 75 64 69 6e 67 20 74 68 |am (incl|uding th|
|00000dd0| 65 20 73 74 61 6e 64 61 | 72 64 0d 09 64 65 73 6b |e standa|rd..desk|
|00000de0| 20 61 63 63 65 73 73 6f | 72 79 20 73 75 70 70 6f | accesso|ry suppo|
|00000df0| 72 74 29 3a 0d 09 0d 09 | 09 09 6d 61 69 6e 20 28 |rt):....|..main (|
|00000e00| 29 0d 09 09 09 7b 0d 09 | 09 09 09 73 69 6d 70 6c |)....{..|...simpl|
|00000e10| 65 74 6f 6f 6c 73 20 28 | 22 53 6b 65 6c 22 29 3b |etools (|"Skel");|
|00000e20| 0d 09 09 09 09 73 69 6d | 70 6c 65 71 75 69 74 73 |.....sim|plequits|
|00000e30| 20 28 29 3b 0d 09 09 09 | 09 72 75 6e 73 69 6d 70 | ();....|.runsimp|
|00000e40| 6c 65 74 6f 6f 6c 73 20 | 28 29 3b 0d 09 09 09 7d |letools |();....}|
|00000e50| 0d 09 09 09 0d 09 77 69 | 6c 6c 20 65 78 65 63 75 |......wi|ll execu|
|00000e60| 74 65 20 61 73 20 61 20 | 4d 61 63 69 6e 74 6f 73 |te as a |Macintos|
|00000e70| 68 20 70 72 6f 67 72 61 | 6d 2c 20 74 65 72 6d 69 |h progra|m, termi|
|00000e80| 6e 61 74 69 6e 67 20 75 | 70 6f 6e 20 74 68 65 20 |nating u|pon the |
|00000e90| 75 73 65 72 0d 09 73 65 | 6c 65 63 74 69 6e 67 20 |user..se|lecting |
|00000ea0| 51 75 69 74 2e 20 20 53 | 69 6d 70 6c 65 54 6f 6f |Quit. S|impleToo|
|00000eb0| 6c 73 20 69 6e 63 6c 75 | 64 65 73 3a 0d 09 0d 09 |ls inclu|des:....|
|00000ec0| 09 73 69 6d 70 6c 65 74 | 6f 6f 6c 73 20 28 29 09 |.simplet|ools ().|
|00000ed0| 09 2d 20 69 6e 69 74 20 | 54 6f 6f 6c 62 6f 78 20 |.- init |Toolbox |
|00000ee0| 61 6e 64 20 53 69 6d 70 | 6c 65 54 6f 6f 6c 73 0d |and Simp|leTools.|
|00000ef0| 09 09 73 69 6d 70 6c 65 | 71 75 69 74 73 20 28 29 |..simple|quits ()|
|00000f00| 09 09 2d 20 61 64 64 20 | 54 72 61 6e 73 66 65 72 |..- add |Transfer|
|00000f10| 20 26 20 51 75 69 74 20 | 6d 65 6e 75 73 0d 09 09 | & Quit |menus...|
|00000f20| 73 69 6d 70 6c 65 65 76 | 65 6e 74 73 20 28 29 09 |simpleev|ents ().|
|00000f30| 09 2d 20 70 72 6f 63 65 | 73 73 20 6e 65 78 74 20 |.- proce|ss next |
|00000f40| 4d 61 63 20 65 76 65 6e | 74 0d 09 09 72 75 6e 73 |Mac even|t...runs|
|00000f50| 69 6d 70 6c 65 74 6f 6f | 6c 73 20 28 29 09 2d 20 |impletoo|ls ().- |
|00000f60| 63 6f 6e 74 69 6e 75 6f | 75 73 6c 79 20 70 72 6f |continuo|usly pro|
|00000f70| 63 65 73 73 20 65 76 65 | 6e 74 73 0d 09 09 0d 09 |cess eve|nts.....|
|00000f80| 09 6d 65 6e 75 20 28 22 | 46 69 6c 65 22 2c 22 4e |.menu ("|File","N|
|00000f90| 65 77 22 2c 6e 65 77 29 | 20 2d 20 69 6e 73 74 61 |ew",new)| - insta|
|00000fa0| 6c 6c 20 61 20 6d 65 6e | 75 0d 09 09 77 69 6e 64 |ll a men|u...wind|
|00000fb0| 6f 77 20 28 22 4d 79 20 | 57 69 6e 64 6f 77 22 2c |ow ("My |Window",|
|00000fc0| 2e 2e 29 09 2d 20 69 6e | 73 74 61 6c 6c 20 61 20 |..).- in|stall a |
|00000fd0| 77 69 6e 64 6f 77 0d 09 | 09 09 09 09 0d 09 09 72 |window..|.......r|
|00000fe0| 75 6e 20 28 66 75 6e 63 | 74 69 6f 6e 29 09 09 2d |un (func|tion)..-|
|00000ff0| 20 69 6e 73 74 61 6c 6c | 20 61 20 70 65 72 69 6f | install| a perio|
|00001000| 64 69 63 20 66 75 6e 63 | 74 69 6f 6e 0d 09 09 73 |dic func|tion...s|
|00001010| 74 6f 70 20 28 66 75 6e | 63 74 69 6f 6e 29 09 09 |top (fun|ction)..|
|00001020| 2d 20 72 65 6d 6f 76 65 | 20 61 20 70 65 72 69 6f |- remove| a perio|
|00001030| 64 69 63 20 66 75 6e 63 | 74 69 6f 6e 0d 09 09 0d |dic func|tion....|
|00001040| 09 09 68 61 76 65 6e 65 | 77 72 6f 6d 20 28 29 09 |..havene|wrom ().|
|00001050| 09 2d 20 74 65 73 74 20 | 66 6f 72 20 6e 65 77 20 |.- test |for new |
|00001060| 31 32 38 6b 20 52 4f 4d | 0d 09 09 77 69 74 68 77 |128k ROM|...withw|
|00001070| 69 6e 64 6f 77 28 22 4d | 79 20 57 69 6e 64 6f 77 |indow("M|y Window|
|00001080| 22 29 09 2d 20 73 65 74 | 20 6f 75 74 70 75 74 20 |").- set| output |
|00001090| 74 6f 20 61 20 77 69 6e | 64 6f 77 0d 09 09 0d 09 |to a win|dow.....|
|000010a0| 09 73 74 67 6f 74 6f 78 | 79 20 28 78 2c 20 79 29 |.stgotox|y (x, y)|
|000010b0| 09 09 2d 20 73 65 74 20 | 70 65 6e 20 74 6f 20 74 |..- set |pen to t|
|000010c0| 65 78 74 20 70 6f 73 69 | 74 69 6f 6e 20 78 2c 20 |ext posi|tion x, |
|000010d0| 79 0d 09 09 68 6f 6d 65 | 20 28 29 09 09 09 2d 20 |y...home| ()...- |
|000010e0| 63 6c 65 61 72 20 77 69 | 6e 64 6f 77 2c 20 73 65 |clear wi|ndow, se|
|000010f0| 74 20 70 65 6e 20 74 6f | 20 68 6f 6d 65 0d 09 09 |t pen to| home...|
|00001100| 67 65 74 6c 69 6e 65 20 | 28 64 65 66 6c 74 2c 20 |getline |(deflt, |
|00001110| 64 65 73 74 29 09 2d 20 | 77 69 74 68 20 54 45 20 |dest).- |with TE |
|00001120| 65 64 69 74 69 6e 67 2c | 20 67 65 74 20 61 20 4c |editing,| get a L|
|00001130| 69 6e 65 0d 09 09 70 72 | 6f 6d 70 74 20 28 71 75 |ine...pr|ompt (qu|
|00001140| 65 73 74 69 6f 6e 2c 20 | 64 65 73 74 29 09 2d 20 |estion, |dest).- |
|00001150| 77 69 74 68 20 64 69 61 | 6c 6f 67 20 62 6f 78 20 |with dia|log box |
|00001160| 26 20 54 45 2c 20 67 65 | 74 20 61 20 4c 69 6e 65 |& TE, ge|t a Line|
|00001170| 0d 09 09 6d 65 73 73 61 | 67 65 20 28 73 74 72 69 |...messa|ge (stri|
|00001180| 6e 67 29 09 2d 20 77 69 | 74 68 20 64 69 61 6c 6f |ng).- wi|th dialo|
|00001190| 67 20 62 6f 78 2c 20 70 | 72 69 6e 74 20 61 20 73 |g box, p|rint a s|
|000011a0| 74 72 69 6e 67 0d 09 09 | 67 65 74 66 69 6c 65 20 |tring...|getfile |
|000011b0| 28 22 54 45 58 54 22 2c | 20 6e 61 6d 65 29 09 2d |("TEXT",| name).-|
|000011c0| 20 77 69 74 68 20 6c 69 | 73 74 2c 20 73 65 6c 65 | with li|st, sele|
|000011d0| 63 74 20 61 20 66 69 6c | 65 6e 61 6d 65 0d 09 09 |ct a fil|ename...|
|000011e0| 70 75 74 66 69 6c 65 20 | 28 6f 72 69 67 2c 20 6e |putfile |(orig, n|
|000011f0| 61 6d 65 29 09 2d 20 77 | 69 74 68 20 6c 69 73 74 |ame).- w|ith list|
|00001200| 2c 20 73 65 6c 65 63 74 | 20 61 20 66 69 6c 65 6e |, select| a filen|
|00001210| 61 6d 65 0d 09 09 0d 09 | 0d 09 41 20 63 6f 6d 70 |ame.....|..A comp|
|00001220| 6c 65 74 65 20 4d 61 63 | 69 6e 74 6f 73 68 20 53 |lete Mac|intosh S|
|00001230| 74 79 6c 65 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |tyle app|lication|
|00001240| 20 28 69 6e 63 6c 75 64 | 69 6e 67 20 77 69 6e 64 | (includ|ing wind|
|00001250| 6f 77 69 6e 67 20 61 6e | 64 20 0d 09 6d 65 6e 75 |owing an|d ..menu|
|00001260| 73 29 20 69 73 20 67 69 | 76 65 6e 20 69 6e 20 74 |s) is gi|ven in t|
|00001270| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 74 72 69 |he follo|wing tri|
|00001280| 76 69 61 6c 20 65 78 61 | 6d 70 6c 65 2e 2e 2e 0d |vial exa|mple....|
|00001290| 09 0d 09 09 23 69 6e 63 | 6c 75 64 65 20 3c 73 69 |....#inc|lude <si|
|000012a0| 6d 70 6c 65 2e 68 3e 0d | 09 09 0d 09 09 63 68 61 |mple.h>.|.....cha|
|000012b0| 72 20 6e 61 6d 65 5b 35 | 30 5d 3b 0d 09 09 0d 09 |r name[5|0];.....|
|000012c0| 09 67 6f 74 5f 62 65 65 | 70 28 29 09 09 0d 09 09 |.got_bee|p().....|
|000012d0| 7b 0d 09 09 09 53 79 73 | 42 65 65 70 20 28 31 30 |{....Sys|Beep (10|
|000012e0| 29 3b 0d 09 09 7d 0d 09 | 09 0d 09 09 67 6f 74 5f |);...}..|....got_|
|000012f0| 67 65 74 6e 61 6d 65 28 | 29 0d 09 09 7b 0d 09 09 |getname(|)...{...|
|00001300| 09 63 68 61 72 20 6e 65 | 77 6e 61 6d 65 5b 35 30 |.char ne|wname[50|
|00001310| 5d 3b 0d 09 09 09 2a 6e | 65 77 6e 61 6d 65 20 3d |];....*n|ewname =|
|00001320| 20 30 3b 0d 09 09 09 69 | 66 20 28 70 72 6f 6d 70 | 0;....i|f (promp|
|00001330| 74 20 28 22 57 68 61 74 | 20 69 73 20 79 6f 75 72 |t ("What| is your|
|00001340| 20 6e 61 6d 65 3f 22 2c | 20 6e 65 77 6e 61 6d 65 | name?",| newname|
|00001350| 29 29 20 7b 0d 09 09 09 | 09 73 74 72 63 70 79 20 |)) {....|.strcpy |
|00001360| 28 6e 61 6d 65 2c 20 6e | 65 77 6e 61 6d 65 29 3b |(name, n|ewname);|
|00001370| 0d 09 09 09 09 77 69 74 | 68 77 69 6e 64 6f 77 20 |.....wit|hwindow |
|00001380| 28 22 4d 79 20 57 69 6e | 64 6f 77 22 29 3b 0d 09 |("My Win|dow");..|
|00001390| 09 09 09 68 6f 6d 65 28 | 29 3b 0d 09 09 09 09 75 |...home(|);.....u|
|000013a0| 70 64 61 74 65 28 29 3b | 0d 09 09 09 7d 0d 09 09 |pdate();|....}...|
|000013b0| 7d 0d 09 09 0d 09 09 69 | 6e 5f 63 6f 6e 74 65 6e |}......i|n_conten|
|000013c0| 74 28 78 2c 20 79 29 0d | 09 09 69 6e 74 20 78 2c |t(x, y).|..int x,|
|000013d0| 20 79 3b 0d 09 09 7b 0d | 09 09 09 4d 6f 76 65 54 | y;...{.|...MoveT|
|000013e0| 6f 20 28 78 2c 20 79 29 | 3b 20 4c 69 6e 65 54 6f |o (x, y)|; LineTo|
|000013f0| 20 28 78 2c 20 79 29 3b | 0d 09 09 7d 0d 09 09 0d | (x, y);|...}....|
|00001400| 09 09 75 70 64 61 74 65 | 28 29 0d 09 09 7b 0d 09 |..update|()...{..|
|00001410| 09 09 63 68 61 72 20 6f | 75 74 73 74 72 69 6e 67 |..char o|utstring|
|00001420| 5b 31 30 30 5d 3b 0d 09 | 09 09 73 74 67 6f 74 6f |[100];..|..stgoto|
|00001430| 78 79 20 28 31 2c 20 35 | 29 3b 0d 09 09 09 73 70 |xy (1, 5|);....sp|
|00001440| 72 69 6e 74 66 20 28 6f | 75 74 73 74 72 69 6e 67 |rintf (o|utstring|
|00001450| 2c 22 48 65 6c 6c 6f 2c | 20 25 73 22 2c 20 6e 61 |,"Hello,| %s", na|
|00001460| 6d 65 29 3b 0d 09 09 09 | 23 69 66 6e 64 65 66 20 |me);....|#ifndef |
|00001470| 4d 45 47 41 4d 41 58 0d | 09 09 09 20 20 43 74 6f |MEGAMAX.|... Cto|
|00001480| 50 73 74 72 20 28 6f 75 | 74 73 74 72 69 6e 67 29 |Pstr (ou|tstring)|
|00001490| 3b 0d 09 09 09 23 65 6e | 64 69 66 0d 09 09 09 44 |;....#en|dif....D|
|000014a0| 72 61 77 53 74 72 69 6e | 67 20 28 6f 75 74 73 74 |rawStrin|g (outst|
|000014b0| 72 69 6e 67 29 3b 0d 09 | 09 7d 0d 09 09 0d 09 09 |ring);..|.}......|
|000014c0| 6d 61 69 6e 20 28 29 0d | 09 09 7b 0d 09 09 09 73 |main ().|..{....s|
|000014d0| 69 6d 70 6c 65 74 6f 6f | 6c 73 20 28 22 53 61 6d |impletoo|ls ("Sam|
|000014e0| 70 6c 65 20 50 72 6f 67 | 72 61 6d 22 29 3b 0d 09 |ple Prog|ram");..|
|000014f0| 09 09 73 69 6d 70 6c 65 | 71 75 69 74 73 20 28 29 |..simple|quits ()|
|00001500| 3b 0d 09 09 09 6d 65 6e | 75 20 28 22 43 6f 6d 6d |;....men|u ("Comm|
|00001510| 61 6e 64 73 22 2c 20 22 | 42 65 65 70 22 2c 20 67 |ands", "|Beep", g|
|00001520| 6f 74 5f 62 65 65 70 29 | 3b 0d 09 09 09 6d 65 6e |ot_beep)|;....men|
|00001530| 75 20 28 22 43 6f 6d 6d | 61 6e 64 73 22 2c 20 22 |u ("Comm|ands", "|
|00001540| 47 65 74 20 4e 61 6d 65 | 22 2c 20 67 6f 74 5f 67 |Get Name|", got_g|
|00001550| 65 74 6e 61 6d 65 29 3b | 0d 09 09 09 73 74 72 63 |etname);|....strc|
|00001560| 70 79 20 28 6e 61 6d 65 | 2c 20 22 57 6f 72 6c 64 |py (name|, "World|
|00001570| 22 29 3b 0d 09 09 09 77 | 69 6e 64 6f 77 20 28 22 |");....w|indow ("|
|00001580| 4d 79 20 57 69 6e 64 6f | 77 22 2c 30 2c 30 2c 30 |My Windo|w",0,0,0|
|00001590| 2c 30 2c 30 4c 2c 30 4c | 2c 75 70 64 61 74 65 2c |,0,0L,0L|,update,|
|000015a0| 0d 09 09 09 09 69 6e 5f | 63 6f 6e 74 65 6e 74 29 |.....in_|content)|
|000015b0| 3b 0d 09 09 09 72 75 6e | 73 69 6d 70 6c 65 74 6f |;....run|simpleto|
|000015c0| 6f 6c 73 20 28 29 3b 0d | 09 09 7d 0d 09 09 0d 3d |ols ();.|..}....=|
|000015d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000015e0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000015f0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001600| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001610| 3d 3d 3d 3d 3d 3d 3d 3d | 0d 0d 09 52 4f 55 54 49 |========|...ROUTI|
|00001620| 4e 45 53 20 59 4f 55 52 | 20 41 50 50 4c 49 43 41 |NES YOUR| APPLICA|
|00001630| 54 49 4f 4e 20 4d 41 59 | 20 43 41 4c 4c 3a 0d 09 |TION MAY| CALL:..|
|00001640| 0d 09 0d 09 73 69 6d 70 | 6c 65 65 76 65 6e 74 73 |....simp|leevents|
|00001650| 20 28 29 0d 09 0d 09 54 | 6f 20 62 65 20 63 61 6c | ()....T|o be cal|
|00001660| 6c 65 64 20 72 65 70 65 | 61 74 65 64 6c 79 20 62 |led repe|atedly b|
|00001670| 79 20 79 6f 75 72 20 70 | 72 6f 67 72 61 6d 27 73 |y your p|rogram's|
|00001680| 20 6d 61 69 6e 20 72 6f | 75 74 69 6e 65 2e 20 20 | main ro|utine. |
|00001690| 49 6e 0d 09 6d 6f 73 74 | 20 53 69 6d 70 6c 65 54 |In..most| SimpleT|
|000016a0| 6f 6f 6c 73 20 70 72 6f | 67 72 61 6d 73 2c 20 79 |ools pro|grams, y|
|000016b0| 6f 75 72 20 6d 61 69 6e | 20 72 6f 75 74 69 6e 65 |our main| routine|
|000016c0| 20 77 69 6c 6c 20 69 6e | 69 74 69 61 6c 69 7a 65 | will in|itialize|
|000016d0| 0d 09 61 6e 64 20 69 6e | 73 74 61 6c 6c 20 53 69 |..and in|stall Si|
|000016e0| 6d 70 6c 65 54 6f 6f 6c | 73 20 66 6f 6c 6c 6f 77 |mpleTool|s follow|
|000016f0| 65 64 20 62 79 20 61 6e | 20 6c 6f 6f 70 20 73 75 |ed by an| loop su|
|00001700| 63 68 20 61 73 3a 0d 09 | 0d 09 09 66 6f 72 20 28 |ch as:..|...for (|
|00001710| 3b 3b 29 20 73 69 6d 70 | 6c 65 65 76 65 6e 74 73 |;;) simp|leevents|
|00001720| 28 29 3b 0d 09 09 0d 09 | 54 68 69 73 20 72 6f 75 |();.....|This rou|
|00001730| 74 69 6e 65 20 68 61 6e | 64 6c 65 73 20 61 6c 6c |tine han|dles all|
|00001740| 20 77 69 6e 64 6f 77 20 | 63 68 61 6e 67 65 73 2c | window |changes,|
|00001750| 20 6d 65 6e 75 20 72 65 | 71 75 65 73 74 73 2c 20 | menu re|quests, |
|00001760| 61 6e 64 0d 09 6f 74 68 | 65 72 20 4d 61 63 69 6e |and..oth|er Macin|
|00001770| 74 6f 73 68 20 65 76 65 | 6e 74 73 2e 20 20 54 68 |tosh eve|nts. Th|
|00001780| 65 72 65 20 69 73 20 61 | 6c 73 6f 20 61 20 72 6f |ere is a|lso a ro|
|00001790| 75 74 69 6e 65 20 63 61 | 6c 6c 65 64 20 77 69 74 |utine ca|lled wit|
|000017a0| 68 0d 09 72 75 6e 73 69 | 6d 70 6c 65 74 6f 6f 6c |h..runsi|mpletool|
|000017b0| 73 28 29 20 77 68 69 63 | 68 20 64 6f 65 73 20 6e |s() whic|h does n|
|000017c0| 6f 74 20 72 65 74 75 72 | 6e 2e 20 20 49 74 20 73 |ot retur|n. It s|
|000017d0| 69 6d 70 6c 79 20 70 65 | 72 66 6f 72 6d 73 20 74 |imply pe|rforms t|
|000017e0| 68 65 0d 09 61 62 6f 76 | 65 20 6c 6f 6f 70 2e 20 |he..abov|e loop. |
|000017f0| 20 50 72 6f 67 72 61 6d | 20 65 78 69 74 20 69 73 | Program| exit is|
|00001800| 20 61 63 63 6f 6d 70 6c | 69 73 68 65 64 20 62 79 | accompl|ished by|
|00001810| 20 61 73 73 69 67 6e 69 | 6e 67 20 61 6e 0d 09 65 | assigni|ng an..e|
|00001820| 78 69 74 69 6e 67 20 72 | 6f 75 74 69 6e 65 20 74 |xiting r|outine t|
|00001830| 6f 20 61 20 6d 65 6e 75 | 2c 20 75 73 75 61 6c 6c |o a menu|, usuall|
|00001840| 79 20 74 68 69 73 20 69 | 73 20 46 69 6c 65 2f 51 |y this i|s File/Q|
|00001850| 75 69 74 2e 0d 09 09 0d | 09 0d 09 73 69 6d 70 6c |uit.....|...simpl|
|00001860| 65 74 6f 6f 6c 73 20 28 | 61 62 6f 75 74 5f 73 74 |etools (|about_st|
|00001870| 72 69 6e 67 29 0d 09 63 | 68 61 72 20 2a 61 62 6f |ring)..c|har *abo|
|00001880| 75 74 5f 73 74 72 69 6e | 67 3b 0d 09 0d 09 54 6f |ut_strin|g;....To|
|00001890| 20 62 65 20 63 61 6c 6c | 65 64 20 6f 6e 63 65 20 | be call|ed once |
|000018a0| 61 74 20 74 68 65 20 76 | 65 72 79 20 62 65 67 69 |at the v|ery begi|
|000018b0| 6e 6e 69 6e 67 20 6f 66 | 20 79 6f 75 72 20 6d 61 |nning of| your ma|
|000018c0| 69 6e 20 72 6f 75 74 69 | 6e 65 2e 0d 09 54 68 69 |in routi|ne...Thi|
|000018d0| 73 20 72 6f 75 74 69 6e | 65 20 69 6e 69 74 69 61 |s routin|e initia|
|000018e0| 6c 69 7a 65 73 20 61 6c | 6c 20 74 68 65 20 4d 61 |lizes al|l the Ma|
|000018f0| 63 69 6e 74 6f 73 68 20 | 73 6f 66 74 77 61 72 65 |cintosh |software|
|00001900| 20 6d 61 6e 61 67 65 72 | 73 0d 09 61 6e 64 20 69 | manager|s..and i|
|00001910| 6e 73 74 61 6c 6c 73 20 | 74 68 65 20 62 61 73 69 |nstalls |the basi|
|00001920| 63 20 41 70 70 6c 65 2c | 20 46 69 6c 65 2c 20 61 |c Apple,| File, a|
|00001930| 6e 64 20 45 64 69 74 20 | 6d 65 6e 75 73 2e 20 20 |nd Edit |menus. |
|00001940| 54 68 65 20 0d 09 61 62 | 6f 75 74 5f 73 74 72 69 |The ..ab|out_stri|
|00001950| 6e 67 20 69 73 20 74 68 | 65 20 6e 61 6d 65 20 6f |ng is th|e name o|
|00001960| 66 20 74 68 65 20 6d 65 | 6e 75 20 49 74 65 6d 20 |f the me|nu Item |
|00001970| 74 6f 20 61 70 70 65 61 | 72 20 66 69 72 73 74 20 |to appea|r first |
|00001980| 75 6e 64 65 72 0d 09 74 | 68 65 20 41 70 70 6c 65 |under..t|he Apple|
|00001990| 20 6d 65 6e 75 2e 0d 09 | 0d 09 0d 09 73 69 6d 70 | menu...|....simp|
|000019a0| 6c 65 71 75 69 74 73 20 | 28 29 0d 09 0d 09 49 6e |lequits |()....In|
|000019b0| 73 74 61 6c 6c 73 20 61 | 20 73 69 6d 70 6c 65 20 |stalls a| simple |
|000019c0| 46 69 6c 65 2f 51 75 69 | 74 20 61 6e 64 20 46 69 |File/Qui|t and Fi|
|000019d0| 6c 65 2f 54 72 61 6e 73 | 66 65 72 20 6d 65 6e 75 |le/Trans|fer menu|
|000019e0| 2e 20 20 59 6f 75 20 6f | 6e 6c 79 0d 09 77 61 6e |. You o|nly..wan|
|000019f0| 74 20 74 6f 20 69 6e 73 | 74 61 6c 6c 73 20 74 68 |t to ins|talls th|
|00001a00| 65 73 65 20 69 66 20 6e | 6f 20 61 70 70 6c 69 63 |ese if n|o applic|
|00001a10| 61 74 69 6f 6e 20 64 65 | 70 65 6e 64 65 6e 74 20 |ation de|pendent |
|00001a20| 70 72 6f 63 65 73 73 69 | 6e 67 0d 09 6d 75 73 74 |processi|ng..must|
|00001a30| 20 62 65 20 64 6f 6e 65 | 20 77 68 65 6e 20 74 68 | be done| when th|
|00001a40| 65 20 75 73 65 72 20 73 | 65 6c 65 63 74 73 20 51 |e user s|elects Q|
|00001a50| 75 69 74 20 6f 72 20 54 | 72 61 6e 73 66 65 72 2e |uit or T|ransfer.|
|00001a60| 0d 09 0d 09 0d 09 6d 65 | 6e 75 20 28 6e 61 6d 65 |......me|nu (name|
|00001a70| 2c 20 49 74 65 6d 2c 20 | 72 6f 75 74 69 6e 65 29 |, Item, |routine)|
|00001a80| 0d 09 63 68 61 72 20 09 | 2a 6e 61 6d 65 3b 0d 09 |..char .|*name;..|
|00001a90| 63 68 61 72 20 09 2a 49 | 74 65 6d 3b 0d 09 50 72 |char .*I|tem;..Pr|
|00001aa0| 6f 63 50 74 72 09 72 6f | 75 74 69 6e 65 3b 0d 09 |ocPtr.ro|utine;..|
|00001ab0| 0d 09 54 6f 20 62 65 20 | 63 61 6c 6c 65 64 20 77 |..To be |called w|
|00001ac0| 68 65 6e 20 61 20 6e 65 | 77 20 6d 65 6e 75 20 69 |hen a ne|w menu i|
|00001ad0| 73 20 74 6f 20 62 65 20 | 69 6e 73 74 61 6c 6c 65 |s to be |installe|
|00001ae0| 64 20 6f 6e 20 74 68 65 | 20 6d 65 6e 75 20 62 61 |d on the| menu ba|
|00001af0| 72 0d 09 6f 72 20 77 68 | 65 6e 20 74 68 65 20 63 |r..or wh|en the c|
|00001b00| 68 61 72 61 63 74 65 72 | 69 73 74 69 63 73 20 6f |haracter|istics o|
|00001b10| 66 20 74 68 61 74 20 6d | 65 6e 75 20 61 72 65 20 |f that m|enu are |
|00001b20| 74 6f 20 62 65 20 6d 6f | 64 69 66 69 65 64 2e 0d |to be mo|dified..|
|00001b30| 09 4e 61 6d 65 20 69 73 | 20 74 68 65 20 6e 61 6d |.Name is| the nam|
|00001b40| 65 20 6f 66 20 74 68 65 | 20 6d 65 6e 75 20 74 6f |e of the| menu to|
|00001b50| 20 61 70 70 65 61 72 20 | 6f 6e 20 74 68 65 20 6d | appear |on the m|
|00001b60| 65 6e 75 20 62 61 72 2e | 20 20 49 74 65 6d 0d 09 |enu bar.| Item..|
|00001b70| 69 73 20 74 68 65 20 6e | 61 6d 65 20 6f 66 20 74 |is the n|ame of t|
|00001b80| 68 65 20 49 74 65 6d 20 | 74 6f 20 61 70 70 65 61 |he Item |to appea|
|00001b90| 72 20 75 6e 64 65 72 20 | 74 68 65 20 6d 65 6e 75 |r under |the menu|
|00001ba0| 20 6e 61 6d 65 2e 20 20 | 52 6f 75 74 69 6e 65 0d | name. |Routine.|
|00001bb0| 09 69 73 20 74 68 65 20 | 6e 61 6d 65 20 6f 66 20 |.is the |name of |
|00001bc0| 74 68 65 20 72 6f 75 74 | 69 6e 65 20 74 6f 20 62 |the rout|ine to b|
|00001bd0| 65 20 65 78 65 63 75 74 | 65 64 20 77 68 65 6e 20 |e execut|ed when |
|00001be0| 74 68 65 20 73 74 61 74 | 65 64 20 6d 65 6e 75 2f |the stat|ed menu/|
|00001bf0| 49 74 65 6d 0d 09 68 61 | 73 20 62 65 65 6e 20 73 |Item..ha|s been s|
|00001c00| 65 6c 65 63 74 65 64 2e | 20 20 54 68 65 20 63 68 |elected.| The ch|
|00001c10| 61 72 61 63 74 65 72 69 | 73 74 69 63 73 20 6f 66 |aracteri|stics of|
|00001c20| 20 74 68 65 20 6d 65 6e | 75 20 6d 61 79 20 62 65 | the men|u may be|
|00001c30| 20 63 68 61 6e 67 65 64 | 0d 09 62 79 20 70 61 73 | changed|..by pas|
|00001c40| 73 69 6e 67 20 6f 6e 65 | 20 6f 66 20 74 68 65 20 |sing one| of the |
|00001c50| 63 6f 6e 73 74 61 6e 74 | 73 20 69 74 65 6d 64 69 |constant|s itemdi|
|00001c60| 73 61 62 6c 65 2c 20 69 | 74 65 6d 65 6e 61 62 6c |sable, i|temenabl|
|00001c70| 65 2c 20 69 74 65 6d 63 | 68 65 63 6b 2c 0d 09 6f |e, itemc|heck,..o|
|00001c80| 72 20 69 74 65 6d 75 6e | 63 68 65 63 6b 20 69 6e |r itemun|check in|
|00001c90| 20 70 6c 61 63 65 20 6f | 66 20 74 68 65 20 72 6f | place o|f the ro|
|00001ca0| 75 74 69 6e 65 2e 0d 09 | 0d 09 0d 09 77 69 6e 64 |utine...|....wind|
|00001cb0| 6f 77 20 28 6e 61 6d 65 | 2c 20 78 74 6f 70 2c 20 |ow (name|, xtop, |
|00001cc0| 79 74 6f 70 2c 20 78 62 | 6f 74 2c 20 79 62 6f 74 |ytop, xb|ot, ybot|
|00001cd0| 2c 20 61 63 74 2c 20 64 | 65 61 63 74 2c 20 75 70 |, act, d|eact, up|
|00001ce0| 64 61 74 65 2c 20 63 6f | 6e 74 65 6e 74 29 0d 09 |date, co|ntent)..|
|00001cf0| 63 68 61 72 20 09 2a 6e | 61 6d 65 3b 0d 09 69 6e |char .*n|ame;..in|
|00001d00| 74 20 20 09 78 74 6f 70 | 2c 20 79 74 6f 70 3b 0d |t .xtop|, ytop;.|
|00001d10| 09 69 6e 74 20 20 09 78 | 62 6f 74 2c 20 79 62 6f |.int .x|bot, ybo|
|00001d20| 74 3b 0d 09 50 72 6f 63 | 50 74 72 09 61 63 74 2c |t;..Proc|Ptr.act,|
|00001d30| 20 64 65 61 63 74 2c 20 | 75 70 64 61 74 65 2c 20 | deact, |update, |
|00001d40| 63 6f 6e 74 65 6e 74 3b | 0d 09 0d 09 54 6f 20 62 |content;|....To b|
|00001d50| 65 20 63 61 6c 6c 65 64 | 20 77 68 65 6e 20 61 20 |e called| when a |
|00001d60| 6e 65 77 20 77 69 6e 64 | 6f 77 20 69 73 20 74 6f |new wind|ow is to|
|00001d70| 20 62 65 20 69 6e 73 74 | 61 6c 6c 65 64 20 6f 6e | be inst|alled on|
|00001d80| 20 74 68 65 20 73 63 72 | 65 65 6e 0d 09 6f 72 20 | the scr|een..or |
|00001d90| 77 68 65 6e 20 74 68 65 | 20 63 68 61 72 61 63 74 |when the| charact|
|00001da0| 65 72 69 73 74 69 63 73 | 20 6f 66 20 74 68 61 74 |eristics| of that|
|00001db0| 20 77 69 6e 64 6f 77 20 | 61 72 65 20 74 6f 20 62 | window |are to b|
|00001dc0| 65 20 6d 6f 64 69 66 69 | 65 64 2e 0d 09 4e 61 6d |e modifi|ed...Nam|
|00001dd0| 65 20 69 73 20 74 68 65 | 20 6e 61 6d 65 20 6f 66 |e is the| name of|
|00001de0| 20 74 68 65 20 77 69 6e | 64 6f 77 2e 20 20 58 74 | the win|dow. Xt|
|00001df0| 6f 70 2c 20 79 74 6f 70 | 2c 20 78 62 6f 74 2c 20 |op, ytop|, xbot, |
|00001e00| 61 6e 64 20 79 62 6f 74 | 20 61 72 65 0d 09 74 68 |and ybot| are..th|
|00001e10| 65 20 69 6e 69 74 69 61 | 6c 20 63 6f 6f 72 64 69 |e initia|l coordi|
|00001e20| 6e 61 74 65 73 20 6f 66 | 20 74 68 65 20 6e 65 77 |nates of| the new|
|00001e30| 20 77 69 6e 64 6f 77 2e | 20 20 41 63 74 20 69 73 | window.| Act is|
|00001e40| 20 74 68 65 20 6e 61 6d | 65 20 6f 66 0d 09 74 68 | the nam|e of..th|
|00001e50| 65 20 70 72 6f 63 65 64 | 75 72 65 20 74 6f 20 65 |e proced|ure to e|
|00001e60| 78 65 63 75 74 65 20 77 | 68 65 6e 20 74 68 65 20 |xecute w|hen the |
|00001e70| 77 69 6e 64 6f 77 20 62 | 65 63 6f 6d 65 73 20 74 |window b|ecomes t|
|00001e80| 68 65 20 74 6f 70 20 6f | 72 0d 09 61 63 74 69 76 |he top o|r..activ|
|00001e90| 65 20 77 69 6e 64 6f 77 | 2e 20 20 44 65 61 63 74 |e window|. Deact|
|00001ea0| 20 69 73 20 74 68 65 20 | 6e 61 6d 65 20 6f 66 20 | is the |name of |
|00001eb0| 74 68 65 20 70 72 6f 63 | 65 64 75 72 65 20 74 6f |the proc|edure to|
|00001ec0| 20 65 78 65 63 75 74 65 | 20 77 68 65 6e 0d 09 74 | execute| when..t|
|00001ed0| 68 65 20 77 69 6e 64 6f | 77 20 63 65 61 73 65 73 |he windo|w ceases|
|00001ee0| 20 62 65 69 6e 67 20 74 | 68 65 20 74 6f 70 20 77 | being t|he top w|
|00001ef0| 69 6e 64 6f 77 20 61 6e | 64 20 64 65 61 63 74 69 |indow an|d deacti|
|00001f00| 76 61 74 65 73 2e 20 20 | 55 70 64 61 74 65 0d 09 |vates. |Update..|
|00001f10| 69 73 20 74 68 65 20 6e | 61 6d 65 20 6f 66 20 74 |is the n|ame of t|
|00001f20| 68 65 20 70 72 6f 63 65 | 64 75 72 65 20 63 61 6c |he proce|dure cal|
|00001f30| 6c 65 64 20 77 68 65 6e | 20 74 68 65 20 4d 61 63 |led when| the Mac|
|00001f40| 69 6e 74 6f 73 68 20 6e | 65 65 64 73 20 74 6f 0d |intosh n|eeds to.|
|00001f50| 09 72 65 64 72 61 77 20 | 74 68 65 20 77 69 6e 64 |.redraw |the wind|
|00001f60| 6f 77 27 73 20 63 6f 6e | 74 65 6e 74 73 2e 20 20 |ow's con|tents. |
|00001f70| 43 6f 6e 74 65 6e 74 20 | 69 73 20 74 68 65 20 6e |Content |is the n|
|00001f80| 61 6d 65 20 6f 66 20 74 | 68 65 20 70 72 6f 63 65 |ame of t|he proce|
|00001f90| 64 75 72 65 0d 09 63 61 | 6c 6c 65 64 20 77 68 65 |dure..ca|lled whe|
|00001fa0| 6e 20 74 68 65 20 6d 6f | 75 73 65 20 69 73 20 70 |n the mo|use is p|
|00001fb0| 72 65 73 73 65 64 20 77 | 69 74 68 69 6e 20 74 68 |ressed w|ithin th|
|00001fc0| 65 20 77 69 6e 64 6f 77 | 2e 20 20 54 68 65 20 70 |e window|. The p|
|00001fd0| 72 6f 63 65 64 75 72 65 | 0d 09 73 70 65 63 69 66 |rocedure|..specif|
|00001fe0| 69 65 64 20 61 73 20 63 | 6f 6e 74 65 6e 74 20 77 |ied as c|ontent w|
|00001ff0| 69 6c 6c 20 62 65 20 70 | 61 73 73 65 64 20 61 6e |ill be p|assed an|
|00002000| 20 78 20 61 6e 64 20 79 | 20 69 6e 74 65 67 65 72 | x and y| integer|
|00002010| 20 76 61 6c 75 65 0d 09 | 72 65 70 72 65 73 65 6e | value..|represen|
|00002020| 74 69 6e 67 20 74 68 65 | 20 6c 6f 63 61 6c 20 6d |ting the| local m|
|00002030| 6f 75 73 65 20 63 6f 6f | 72 64 69 6e 61 74 65 73 |ouse coo|rdinates|
|00002040| 2e 0d 09 0d 09 0d 09 77 | 69 74 68 77 69 6e 64 6f |.......w|ithwindo|
|00002050| 77 20 28 6e 61 6d 65 29 | 0d 09 63 68 61 72 20 2a |w (name)|..char *|
|00002060| 6e 61 6d 65 3b 0d 09 0d | 09 54 6f 20 62 65 20 63 |name;...|.To be c|
|00002070| 61 6c 6c 65 64 20 77 68 | 65 6e 20 79 6f 75 20 77 |alled wh|en you w|
|00002080| 61 6e 74 20 74 6f 20 73 | 65 6c 65 63 74 20 77 68 |ant to s|elect wh|
|00002090| 69 63 68 20 77 69 6e 64 | 6f 77 20 77 69 6c 6c 20 |ich wind|ow will |
|000020a0| 72 65 63 65 69 76 65 0d | 09 6f 75 74 70 75 74 20 |receive.|.output |
|000020b0| 61 6e 64 20 64 72 61 77 | 69 6e 67 73 2e 20 20 49 |and draw|ings. I|
|000020c0| 6e 20 6d 6f 73 74 20 63 | 61 73 65 73 2c 20 53 69 |n most c|ases, Si|
|000020d0| 6d 70 6c 65 54 6f 6f 6c | 73 20 77 69 6c 6c 20 73 |mpleTool|s will s|
|000020e0| 65 6c 65 63 74 20 74 68 | 65 0d 09 61 70 70 72 6f |elect th|e..appro|
|000020f0| 70 72 69 61 74 65 20 77 | 69 6e 64 6f 77 20 62 65 |priate w|indow be|
|00002100| 66 6f 72 65 20 63 61 6c | 6c 69 6e 67 20 79 6f 75 |fore cal|ling you|
|00002110| 72 20 73 70 65 63 69 66 | 69 65 64 20 61 63 74 2c |r specif|ied act,|
|00002120| 20 64 65 61 63 74 2c 0d | 09 75 70 64 61 74 65 2c | deact,.|.update,|
|00002130| 20 6f 72 20 63 6f 6e 74 | 65 6e 74 20 70 72 6f 63 | or cont|ent proc|
|00002140| 65 64 75 72 65 73 2e 20 | 20 55 73 65 20 74 68 69 |edures. | Use thi|
|00002150| 73 20 61 74 20 6f 74 68 | 65 72 20 74 69 6d 65 73 |s at oth|er times|
|00002160| 2e 0d 09 0d 09 0d 09 72 | 75 6e 20 28 72 6f 75 74 |.......r|un (rout|
|00002170| 69 6e 65 29 0d 09 50 72 | 6f 63 50 74 72 09 72 6f |ine)..Pr|ocPtr.ro|
|00002180| 75 74 69 6e 65 3b 0d 09 | 0d 09 54 6f 20 62 65 20 |utine;..|..To be |
|00002190| 63 61 6c 6c 65 64 20 77 | 68 65 6e 20 79 6f 75 20 |called w|hen you |
|000021a0| 77 61 6e 74 20 61 20 72 | 6f 75 74 69 6e 65 20 74 |want a r|outine t|
|000021b0| 6f 20 62 65 20 63 6f 6e | 74 69 6e 75 6f 75 73 6c |o be con|tinuousl|
|000021c0| 79 20 65 78 65 63 75 74 | 65 64 0d 09 6f 6e 63 65 |y execut|ed..once|
|000021d0| 20 65 61 63 68 20 74 69 | 6d 65 20 73 69 6d 70 6c | each ti|me simpl|
|000021e0| 65 65 76 65 6e 74 73 28 | 29 20 69 73 20 63 61 6c |eevents(|) is cal|
|000021f0| 6c 65 64 2e 20 20 53 6d | 61 6c 6c 2c 20 71 75 69 |led. Sm|all, qui|
|00002200| 63 6b 6c 79 20 72 75 6e | 6e 69 6e 67 0d 09 72 6f |ckly run|ning..ro|
|00002210| 75 74 69 6e 65 73 20 73 | 68 6f 75 6c 64 20 62 65 |utines s|hould be|
|00002220| 20 75 73 65 64 20 73 6f | 20 61 73 20 6e 6f 74 20 | used so| as not |
|00002230| 74 6f 20 44 65 6c 61 79 | 20 74 68 65 20 6e 65 78 |to Delay| the nex|
|00002240| 74 20 65 76 65 6e 74 0d | 09 70 72 6f 63 65 73 73 |t event.|.process|
|00002250| 69 6e 67 2e 20 20 50 73 | 65 75 64 6f 20 6d 75 6c |ing. Ps|eudo mul|
|00002260| 74 69 70 72 6f 63 65 73 | 73 69 6e 67 20 77 69 74 |tiproces|sing wit|
|00002270| 68 20 65 61 63 68 20 72 | 6f 75 74 69 6e 65 20 72 |h each r|outine r|
|00002280| 75 6e 6e 69 6e 67 20 69 | 6e 0d 09 69 74 73 20 6f |unning i|n..its o|
|00002290| 77 6e 20 77 69 6e 64 6f | 77 20 63 61 6e 20 62 65 |wn windo|w can be|
|000022a0| 20 61 63 63 6f 6d 70 6c | 69 73 68 65 64 20 62 79 | accompl|ished by|
|000022b0| 20 6d 61 6b 69 6e 67 20 | 73 75 72 65 20 61 20 72 | making |sure a r|
|000022c0| 75 6e 20 72 6f 75 74 69 | 6e 65 0d 09 75 73 65 73 |un routi|ne..uses|
|000022d0| 20 77 69 74 68 77 69 6e | 64 6f 77 28 29 20 74 6f | withwin|dow() to|
|000022e0| 20 64 69 72 65 63 74 20 | 69 74 73 20 6f 75 74 70 | direct |its outp|
|000022f0| 75 74 20 74 6f 20 74 68 | 65 20 70 72 6f 70 65 72 |ut to th|e proper|
|00002300| 20 77 69 6e 64 6f 77 2e | 0d 09 0d 09 0d 09 73 74 | window.|......st|
|00002310| 6f 70 20 28 72 6f 75 74 | 69 6e 65 29 0d 09 50 72 |op (rout|ine)..Pr|
|00002320| 6f 63 50 74 72 20 72 6f | 75 74 69 6e 65 3b 0d 09 |ocPtr ro|utine;..|
|00002330| 0d 09 54 6f 20 62 65 20 | 63 61 6c 6c 65 64 20 77 |..To be |called w|
|00002340| 68 65 6e 20 79 6f 75 20 | 77 61 6e 74 20 74 6f 20 |hen you |want to |
|00002350| 72 65 6d 6f 76 65 20 61 | 20 70 72 65 76 69 6f 75 |remove a| previou|
|00002360| 73 6c 79 20 72 75 6e 28 | 29 20 72 6f 75 74 69 6e |sly run(|) routin|
|00002370| 65 0d 09 66 72 6f 6d 20 | 74 68 65 20 6c 69 73 74 |e..from |the list|
|00002380| 20 6f 66 20 72 6f 75 74 | 69 6e 65 73 20 74 6f 20 | of rout|ines to |
|00002390| 72 75 6e 2e 20 20 35 30 | 20 72 6f 75 74 69 6e 65 |run. 50| routine|
|000023a0| 73 20 63 61 6e 20 66 69 | 74 20 69 6e 74 6f 20 74 |s can fi|t into t|
|000023b0| 68 65 0d 09 72 75 6e 20 | 6c 69 73 74 2e 0d 09 0d |he..run |list....|
|000023c0| 09 0d 09 68 6f 6d 65 20 | 28 29 0d 09 0d 09 43 6c |...home |()....Cl|
|000023d0| 65 61 72 73 20 74 68 65 | 20 63 75 72 72 65 6e 74 |ears the| current|
|000023e0| 20 77 69 6e 64 6f 77 20 | 61 6e 64 20 70 6f 73 69 | window |and posi|
|000023f0| 74 69 6f 6e 73 20 74 68 | 65 20 70 65 6e 20 73 75 |tions th|e pen su|
|00002400| 63 68 20 74 68 61 74 20 | 61 6e 79 0d 09 66 6f 6c |ch that |any..fol|
|00002410| 6c 6f 77 69 6e 67 20 74 | 65 78 74 20 77 69 6c 6c |lowing t|ext will|
|00002420| 20 61 70 70 65 61 72 20 | 69 6e 20 74 68 65 20 75 | appear |in the u|
|00002430| 70 70 65 72 20 6c 65 66 | 74 20 63 6f 72 6e 65 72 |pper lef|t corner|
|00002440| 20 6f 66 20 74 68 65 0d | 09 77 69 6e 64 6f 77 2e | of the.|.window.|
|00002450| 0d 09 0d 09 0d 09 73 74 | 67 6f 74 6f 78 79 20 28 |......st|gotoxy (|
|00002460| 63 6f 6c 75 6d 6e 2c 20 | 72 6f 77 29 0d 09 69 6e |column, |row)..in|
|00002470| 74 20 63 6f 6c 75 6d 6e | 2c 20 72 6f 77 3b 0d 09 |t column|, row;..|
|00002480| 0d 09 50 6f 73 69 74 69 | 6f 6e 73 20 74 68 65 20 |..Positi|ons the |
|00002490| 70 65 6e 20 69 6e 20 74 | 68 65 20 63 75 72 72 65 |pen in t|he curre|
|000024a0| 6e 74 20 77 69 6e 64 6f | 77 20 73 6f 20 74 68 61 |nt windo|w so tha|
|000024b0| 74 20 74 68 65 20 6e 65 | 78 74 20 74 65 78 74 0d |t the ne|xt text.|
|000024c0| 09 6f 75 74 70 75 74 20 | 77 69 6c 6c 20 61 70 70 |.output |will app|
|000024d0| 65 61 72 20 69 6e 20 74 | 65 78 74 20 72 6f 77 20 |ear in t|ext row |
|000024e0| 61 6e 64 20 63 6f 6c 75 | 6d 6e 2e 20 20 54 68 69 |and colu|mn. Thi|
|000024f0| 73 20 69 73 20 63 6f 6d | 70 61 74 69 62 6c 65 0d |s is com|patible.|
|00002500| 09 77 69 74 68 20 73 6f | 6d 65 20 6f 6c 64 20 74 |.with so|me old t|
|00002510| 65 78 74 20 6f 6e 6c 79 | 20 74 65 72 6d 69 6e 61 |ext only| termina|
|00002520| 6c 73 2e 20 20 73 74 67 | 6f 74 6f 78 79 20 28 31 |ls. stg|otoxy (1|
|00002530| 2c 20 31 29 20 70 6f 73 | 69 74 69 6f 6e 73 20 74 |, 1) pos|itions t|
|00002540| 68 65 0d 09 70 65 6e 20 | 69 6e 20 74 68 65 20 75 |he..pen |in the u|
|00002550| 70 70 65 72 20 6c 65 66 | 74 20 63 6f 72 6e 65 72 |pper lef|t corner|
|00002560| 2e 20 20 41 6e 79 20 6e | 65 67 61 74 69 76 65 20 |. Any n|egative |
|00002570| 63 6f 6f 72 64 69 6e 61 | 74 65 20 6c 65 61 76 65 |coordina|te leave|
|00002580| 73 0d 09 74 68 61 74 20 | 61 78 69 73 20 6f 66 20 |s..that |axis of |
|00002590| 74 68 65 20 70 65 6e 20 | 77 68 65 72 65 20 69 74 |the pen |where it|
|000025a0| 20 63 75 72 72 65 6e 74 | 6c 79 20 69 73 2e 0d 09 | current|ly is...|
|000025b0| 0d 09 0d 09 67 65 74 6c | 69 6e 65 20 28 64 65 66 |....getl|ine (def|
|000025c0| 61 75 6c 74 2c 20 64 65 | 73 74 69 6e 61 74 69 6f |ault, de|stinatio|
|000025d0| 6e 29 0d 09 63 68 61 72 | 20 2a 64 65 66 61 75 6c |n)..char| *defaul|
|000025e0| 74 3b 0d 09 63 68 61 72 | 20 2a 64 65 73 74 69 6e |t;..char| *destin|
|000025f0| 61 74 69 6f 6e 3b 0d 09 | 0d 09 43 61 6c 6c 69 6e |ation;..|..Callin|
|00002600| 67 20 74 68 69 73 20 72 | 6f 75 74 69 6e 65 20 62 |g this r|outine b|
|00002610| 65 67 69 6e 73 20 61 20 | 22 6d 6f 64 61 6c 22 20 |egins a |"modal" |
|00002620| 6d 6f 64 65 20 77 68 65 | 72 65 20 74 68 65 20 75 |mode whe|re the u|
|00002630| 73 65 72 20 69 73 0d 09 | 72 65 71 75 69 72 65 64 |ser is..|required|
|00002640| 20 74 6f 20 65 6e 74 65 | 72 20 61 20 4c 69 6e 65 | to ente|r a Line|
|00002650| 20 6f 66 20 74 65 78 74 | 2e 20 20 54 68 69 73 20 | of text|. This |
|00002660| 77 6f 75 6c 64 20 62 65 | 20 73 69 6d 69 6c 61 72 |would be| similar|
|00002670| 20 74 6f 0d 09 75 73 69 | 6e 67 20 73 63 61 6e 66 | to..usi|ng scanf|
|00002680| 28 29 20 6f 6e 20 22 6e | 6f 6e 2d 4d 61 63 22 2c |() on "n|on-Mac",|
|00002690| 20 74 65 78 74 2d 6f 6e | 6c 79 20 74 65 72 6d 69 | text-on|ly termi|
|000026a0| 6e 61 6c 73 2e 20 20 54 | 68 69 73 20 72 6f 75 74 |nals. T|his rout|
|000026b0| 69 6e 65 0d 09 75 73 65 | 73 20 74 68 65 20 4d 61 |ine..use|s the Ma|
|000026c0| 63 69 6e 74 6f 73 68 65 | 73 20 62 75 69 6c 74 20 |cintoshe|s built |
|000026d0| 69 6e 20 54 65 78 74 2d | 45 64 69 74 20 72 6f 75 |in Text-|Edit rou|
|000026e0| 74 69 6e 65 73 20 61 6c | 6c 6f 77 69 6e 67 20 74 |tines al|lowing t|
|000026f0| 68 65 0d 09 75 73 65 72 | 20 74 6f 20 65 64 69 74 |he..user| to edit|
|00002700| 20 68 69 73 20 4c 69 6e | 65 20 75 6e 74 69 6c 20 | his Lin|e until |
|00002710| 3c 52 45 54 55 52 4e 3e | 20 69 73 20 70 72 65 73 |<RETURN>| is pres|
|00002720| 73 65 64 2e 20 20 54 68 | 65 20 66 6c 61 73 68 69 |sed. Th|e flashi|
|00002730| 6e 67 0d 09 62 61 72 20 | 43 75 72 73 6f 72 20 69 |ng..bar |Cursor i|
|00002740| 73 20 70 6f 73 69 74 69 | 6f 6e 65 64 20 61 74 20 |s positi|oned at |
|00002750| 74 68 65 20 63 75 72 72 | 65 6e 74 20 70 65 6e 20 |the curr|ent pen |
|00002760| 6c 6f 63 61 74 69 6f 6e | 2e 20 20 54 68 65 20 0d |location|. The .|
|00002770| 09 72 65 73 75 6c 74 69 | 6e 67 20 73 74 72 69 6e |.resulti|ng strin|
|00002780| 67 20 69 73 20 70 6c 61 | 63 65 64 20 69 6e 74 6f |g is pla|ced into|
|00002790| 20 64 65 73 74 69 6e 61 | 74 69 6f 6e 2e 20 20 44 | destina|tion. D|
|000027a0| 65 66 61 75 6c 74 20 63 | 6f 6e 74 61 69 6e 73 0d |efault c|ontains.|
|000027b0| 09 74 68 65 20 69 6e 69 | 74 69 61 6c 20 76 61 6c |.the ini|tial val|
|000027c0| 75 65 20 74 6f 20 62 65 | 20 64 69 73 70 6c 61 79 |ue to be| display|
|000027d0| 65 64 20 6f 6e 20 74 68 | 65 20 73 63 72 65 65 6e |ed on th|e screen|
|000027e0| 2e 20 20 59 6f 75 20 6d | 61 79 20 75 73 65 0d 09 |. You m|ay use..|
|000027f0| 74 68 65 20 6e 75 6c 6c | 20 73 74 72 69 6e 67 20 |the null| string |
|00002800| 22 22 20 66 6f 72 20 64 | 65 66 61 75 6c 74 2e 0d |"" for d|efault..|
|00002810| 09 0d 09 0d 09 70 72 6f | 6d 70 74 20 28 71 75 65 |.....pro|mpt (que|
|00002820| 73 74 69 6f 6e 2c 20 61 | 6e 73 77 65 72 29 0d 09 |stion, a|nswer)..|
|00002830| 63 68 61 72 20 2a 71 75 | 65 73 74 69 6f 6e 3b 0d |char *qu|estion;.|
|00002840| 09 63 68 61 72 20 2a 61 | 6e 73 77 65 72 3b 0d 09 |.char *a|nswer;..|
|00002850| 0d 09 54 68 69 73 20 72 | 6f 75 74 69 6e 65 20 70 |..This r|outine p|
|00002860| 6c 61 63 65 73 20 61 20 | 73 6d 61 6c 6c 20 33 2d |laces a |small 3-|
|00002870| 6c 69 6e 65 64 20 4d 61 | 63 69 6e 74 6f 73 68 20 |lined Ma|cintosh |
|00002880| 53 74 79 6c 65 20 64 69 | 61 6c 6f 67 20 77 69 6e |Style di|alog win|
|00002890| 64 6f 77 0d 09 70 72 6f | 6d 70 74 69 6e 67 20 74 |dow..pro|mpting t|
|000028a0| 68 65 20 75 73 65 72 20 | 77 69 74 68 20 71 75 65 |he user |with que|
|000028b0| 73 74 69 6f 6e 20 61 6e | 64 20 67 65 74 74 69 6e |stion an|d gettin|
|000028c0| 67 20 74 68 65 20 61 6e | 73 77 65 72 20 69 6e 20 |g the an|swer in |
|000028d0| 61 0d 09 62 6f 78 65 64 | 20 54 65 78 74 2d 45 64 |a..boxed| Text-Ed|
|000028e0| 69 74 20 61 72 65 61 2e | 20 20 54 77 6f 20 62 75 |it area.| Two bu|
|000028f0| 74 74 6f 6e 73 20 61 72 | 65 20 64 69 73 70 6c 61 |ttons ar|e displa|
|00002900| 79 65 64 20 74 6f 20 74 | 65 72 6d 69 6e 61 74 65 |yed to t|erminate|
|00002910| 20 74 68 65 0d 09 75 73 | 65 72 20 65 6e 74 72 79 | the..us|er entry|
|00002920| 2e 20 20 49 66 20 43 61 | 6e 63 65 6c 20 69 73 20 |. If Ca|ncel is |
|00002930| 63 6c 69 63 6b 65 64 20 | 75 70 6f 6e 2c 20 46 41 |clicked |upon, FA|
|00002940| 4c 53 45 20 69 73 20 72 | 65 74 75 72 6e 65 64 2e |LSE is r|eturned.|
|00002950| 20 20 49 66 0d 09 6f 6b | 61 79 20 69 73 20 63 6c | If..ok|ay is cl|
|00002960| 69 63 6b 65 64 20 75 70 | 6f 6e 2c 20 54 52 55 45 |icked up|on, TRUE|
|00002970| 20 69 73 20 72 65 74 75 | 72 6e 65 64 2e 20 20 41 | is retu|rned. A|
|00002980| 6e 73 77 65 72 20 6d 75 | 73 74 20 62 65 20 73 65 |nswer mu|st be se|
|00002990| 74 20 74 6f 0d 09 61 20 | 64 65 66 61 75 6c 74 20 |t to..a |default |
|000029a0| 76 61 6c 75 65 2c 20 22 | 22 20 69 73 20 6f 6b 61 |value, "|" is oka|
|000029b0| 79 2e 0d 09 0d 09 0d 09 | 6d 65 73 73 61 67 65 20 |y.......|message |
|000029c0| 28 6d 65 73 73 61 67 65 | 29 0d 09 63 68 61 72 20 |(message|)..char |
|000029d0| 2a 6d 65 73 73 61 67 65 | 3b 0d 09 0d 09 54 68 69 |*message|;....Thi|
|000029e0| 73 20 72 6f 75 74 69 6e | 65 20 69 73 20 73 69 6d |s routin|e is sim|
|000029f0| 69 6c 61 72 20 74 6f 20 | 70 72 6f 6d 70 74 20 65 |ilar to |prompt e|
|00002a00| 78 63 65 70 74 20 6e 6f | 20 74 65 78 74 75 61 6c |xcept no| textual|
|00002a10| 20 72 65 73 70 6f 6e 73 | 65 20 69 73 0d 09 61 73 | respons|e is..as|
|00002a20| 6b 65 64 20 66 72 6f 6d | 20 74 68 65 20 75 73 65 |ked from| the use|
|00002a30| 72 2e 20 20 54 68 69 73 | 20 69 73 20 6c 69 6b 65 |r. This| is like|
|00002a40| 20 61 6e 20 41 6c 65 72 | 74 20 64 69 61 6c 6f 67 | an Aler|t dialog|
|00002a50| 2e 20 20 4a 75 73 74 20 | 6c 69 6b 65 0d 09 70 72 |. Just |like..pr|
|00002a60| 6f 6d 70 74 2c 20 54 52 | 55 45 20 6f 72 20 46 41 |ompt, TR|UE or FA|
|00002a70| 4c 53 45 20 69 73 20 72 | 65 74 75 72 6e 65 64 20 |LSE is r|eturned |
|00002a80| 64 65 70 65 6e 64 69 6e | 67 20 75 70 6f 6e 20 77 |dependin|g upon w|
|00002a90| 68 69 63 68 20 42 75 74 | 74 6f 6e 20 74 68 65 0d |hich But|ton the.|
|00002aa0| 09 75 73 65 72 20 70 72 | 65 73 73 65 73 2e 0d 09 |.user pr|esses...|
|00002ab0| 0d 09 0d 09 67 65 74 66 | 69 6c 65 20 28 66 69 6c |....getf|ile (fil|
|00002ac0| 65 5f 74 79 70 65 2c 20 | 72 65 70 6c 79 29 0d 09 |e_type, |reply)..|
|00002ad0| 63 68 61 72 20 2a 66 69 | 6c 65 5f 74 79 70 65 3b |char *fi|le_type;|
|00002ae0| 0d 09 63 68 61 72 20 2a | 72 65 70 6c 61 79 3b 0d |..char *|replay;.|
|00002af0| 09 0d 09 54 68 69 73 20 | 72 6f 75 74 69 6e 65 20 |...This |routine |
|00002b00| 70 6c 61 63 65 73 20 74 | 68 65 20 73 74 61 6e 64 |places t|he stand|
|00002b10| 61 72 64 20 4d 61 63 69 | 6e 74 6f 73 68 20 53 46 |ard Maci|ntosh SF|
|00002b20| 47 65 74 46 69 6c 65 28 | 29 20 77 69 6e 64 6f 77 |GetFile(|) window|
|00002b30| 0d 09 75 70 20 77 69 74 | 68 20 61 20 6c 69 73 74 |..up wit|h a list|
|00002b40| 20 6f 66 20 66 69 6c 65 | 73 20 6f 66 20 66 69 6c | of file|s of fil|
|00002b50| 65 5f 74 79 70 65 2e 20 | 20 4f 6e 63 65 20 74 68 |e_type. | Once th|
|00002b60| 65 20 75 73 65 72 20 73 | 65 6c 65 63 74 73 20 61 |e user s|elects a|
|00002b70| 0d 09 66 69 6c 65 2c 20 | 74 68 65 20 61 6e 73 77 |..file, |the answ|
|00002b80| 65 72 20 69 73 20 72 65 | 74 75 72 6e 65 64 20 69 |er is re|turned i|
|00002b90| 6e 20 74 68 65 20 73 74 | 72 69 6e 67 20 72 65 70 |n the st|ring rep|
|00002ba0| 6c 79 2e 20 20 41 6c 73 | 6f 2c 20 61 6e 64 0d 09 |ly. Als|o, and..|
|00002bb0| 76 65 72 79 20 69 6d 70 | 6f 72 74 61 6e 74 20 66 |very imp|ortant f|
|00002bc0| 6f 72 20 48 46 53 2c 20 | 74 68 65 20 77 6f 72 6b |or HFS, |the work|
|00002bd0| 69 6e 67 20 76 6f 6c 75 | 6d 65 2f 66 6f 6c 64 65 |ing volu|me/folde|
|00002be0| 72 20 69 73 20 73 65 74 | 20 73 6f 20 74 68 61 74 |r is set| so that|
|00002bf0| 0d 09 61 6e 79 20 73 75 | 62 73 65 71 75 65 6e 74 |..any su|bsequent|
|00002c00| 20 6f 70 65 6e 28 29 20 | 77 69 74 68 20 72 65 70 | open() |with rep|
|00002c10| 6c 79 20 61 73 20 74 68 | 65 20 66 69 6c 65 20 6e |ly as th|e file n|
|00002c20| 61 6d 65 20 77 69 6c 6c | 20 6f 70 65 6e 20 74 68 |ame will| open th|
|00002c30| 65 0d 09 63 6f 72 72 65 | 63 74 20 73 65 6c 65 63 |e..corre|ct selec|
|00002c40| 74 65 64 20 66 69 6c 65 | 2e 20 20 54 68 65 20 6f |ted file|. The o|
|00002c50| 70 65 6e 28 29 20 73 68 | 6f 75 6c 64 20 62 65 20 |pen() sh|ould be |
|00002c60| 64 6f 6e 65 20 62 65 66 | 6f 72 65 20 73 6f 6d 65 |done bef|ore some|
|00002c70| 6f 6e 65 0d 09 68 61 73 | 20 61 20 63 68 61 6e 63 |one..has| a chanc|
|00002c80| 65 20 74 6f 20 63 68 61 | 6e 67 65 20 74 68 65 20 |e to cha|nge the |
|00002c90| 77 6f 72 6b 69 6e 67 20 | 76 6f 6c 75 6d 65 2e 20 |working |volume. |
|00002ca0| 20 54 68 69 73 20 72 6f | 75 74 69 6e 65 20 77 69 | This ro|utine wi|
|00002cb0| 6c 6c 20 0d 09 72 65 74 | 75 72 6e 20 46 41 4c 53 |ll ..ret|urn FALS|
|00002cc0| 45 20 69 66 20 74 68 65 | 20 75 73 65 72 20 73 65 |E if the| user se|
|00002cd0| 6c 65 63 74 73 20 74 68 | 65 20 43 41 4e 43 45 4c |lects th|e CANCEL|
|00002ce0| 20 42 75 74 74 6f 6e 2e | 0d 09 0d 09 0d 09 70 75 | Button.|......pu|
|00002cf0| 74 66 69 6c 65 20 28 6f | 72 69 67 6e 61 6d 65 2c |tfile (o|rigname,|
|00002d00| 20 72 65 70 6c 79 29 0d | 09 63 68 61 72 20 2a 6f | reply).|.char *o|
|00002d10| 72 69 67 6e 61 6d 65 3b | 0d 09 63 68 61 72 20 2a |rigname;|..char *|
|00002d20| 72 65 70 6c 79 3b 0d 09 | 0d 09 54 68 69 73 20 72 |reply;..|..This r|
|00002d30| 6f 75 74 69 6e 65 20 69 | 73 20 6c 69 6b 65 20 67 |outine i|s like g|
|00002d40| 65 74 66 69 6c 65 2c 20 | 65 78 63 65 70 74 20 74 |etfile, |except t|
|00002d50| 68 65 20 73 74 61 6e 64 | 61 72 64 20 70 75 74 66 |he stand|ard putf|
|00002d60| 69 6c 65 20 77 69 6e 64 | 6f 77 0d 09 69 73 20 64 |ile wind|ow..is d|
|00002d70| 69 73 70 6c 61 79 65 64 | 20 77 69 74 68 20 6f 72 |isplayed| with or|
|00002d80| 69 67 6e 61 6d 65 20 61 | 73 20 74 68 65 20 64 65 |igname a|s the de|
|00002d90| 66 61 75 6c 74 20 6e 61 | 6d 65 20 74 6f 20 73 61 |fault na|me to sa|
|00002da0| 76 65 20 61 20 66 69 6c | 65 20 61 73 2e 0d 09 54 |ve a fil|e as...T|
|00002db0| 68 65 20 61 63 74 75 61 | 6c 20 6e 61 6d 65 20 73 |he actua|l name s|
|00002dc0| 65 6c 65 63 74 65 64 20 | 62 79 20 74 68 65 20 75 |elected |by the u|
|00002dd0| 73 65 72 20 69 73 20 72 | 65 74 75 72 6e 65 64 20 |ser is r|eturned |
|00002de0| 69 6e 20 72 65 70 6c 79 | 2e 20 20 41 73 0d 09 67 |in reply|. As..g|
|00002df0| 65 74 66 69 6c 65 2c 20 | 74 68 65 20 77 6f 72 6b |etfile, |the work|
|00002e00| 69 6e 67 20 76 6f 6c 75 | 6d 65 2f 66 6f 6c 64 65 |ing volu|me/folde|
|00002e10| 72 20 69 73 20 73 65 74 | 20 70 72 6f 70 65 72 6c |r is set| properl|
|00002e20| 79 20 66 6f 72 20 74 68 | 65 20 6e 65 78 74 0d 09 |y for th|e next..|
|00002e30| 6f 70 65 6e 28 29 20 63 | 61 6c 6c 2e 0d 0d 3d 3d |open() c|all...==|
|00002e40| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00002e50| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00002e60| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00002e70| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00002e80| 3d 3d 3d 3d 3d 3d 3d 0d | 0d 09 54 48 45 20 46 4f |=======.|..THE FO|
|00002e90| 4c 4c 4f 57 49 4e 47 20 | 49 53 20 54 48 45 20 46 |LLOWING |IS THE F|
|00002ea0| 49 4c 45 20 73 69 6d 70 | 6c 65 2e 68 2e 20 20 59 |ILE simp|le.h. Y|
|00002eb0| 4f 55 20 53 48 4f 55 4c | 44 20 43 4f 50 59 20 54 |OU SHOUL|D COPY T|
|00002ec0| 48 49 53 20 50 4f 52 54 | 49 4f 4e 0d 09 49 4e 54 |HIS PORT|ION..INT|
|00002ed0| 4f 20 41 20 4e 45 57 20 | 46 49 4c 45 20 4e 41 4d |O A NEW |FILE NAM|
|00002ee0| 45 44 20 73 69 6d 70 6c | 65 2e 68 20 53 4f 20 59 |ED simpl|e.h SO Y|
|00002ef0| 4f 55 20 43 41 4e 20 23 | 69 6e 63 6c 75 64 65 20 |OU CAN #|include |
|00002f00| 49 54 20 49 4e 54 4f 20 | 59 4f 55 52 0d 09 53 4f |IT INTO |YOUR..SO|
|00002f10| 55 52 43 45 20 46 49 4c | 45 53 2e 0d 09 0d 3d 3d |URCE FIL|ES....==|
|00002f20| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00002f30| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00002f40| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00002f50| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00002f60| 3d 3d 3d 3d 3d 3d 3d 0d | 0d 23 64 65 66 69 6e 65 |=======.|.#define|
|00002f70| 20 4c 49 47 48 54 53 50 | 45 45 44 09 7b 64 65 66 | LIGHTSP|EED.{def|
|00002f80| 69 6e 65 20 65 69 74 68 | 65 72 20 4c 49 47 48 54 |ine eith|er LIGHT|
|00002f90| 53 50 45 45 44 20 6f 72 | 20 4d 45 47 41 4d 41 58 |SPEED or| MEGAMAX|
|00002fa0| 20 6f 72 20 79 6f 75 72 | 20 6f 77 6e 7d 0d 0d 23 | or your| own}..#|
|00002fb0| 69 6e 63 6c 75 64 65 20 | 3c 73 74 64 69 6f 2e 68 |include |<stdio.h|
|00002fc0| 3e 0d 0d 23 69 66 64 65 | 66 20 4d 45 47 41 4d 41 |>..#ifde|f MEGAMA|
|00002fd0| 58 0d 20 20 23 69 6e 63 | 6c 75 64 65 20 3c 6d 65 |X. #inc|lude <me|
|00002fe0| 6e 75 2e 68 3e 0d 20 20 | 23 69 6e 63 6c 75 64 65 |nu.h>. |#include|
|00002ff0| 20 3c 77 69 6e 2e 68 3e | 0d 23 65 6e 64 69 66 0d | <win.h>|.#endif.|
|00003000| 0d 23 69 66 64 65 66 20 | 4c 49 47 48 54 53 50 45 |.#ifdef |LIGHTSPE|
|00003010| 45 44 0d 20 20 23 69 6e | 63 6c 75 64 65 20 3c 4d |ED. #in|clude <M|
|00003020| 65 6e 75 4d 67 72 2e 68 | 3e 0d 20 20 23 69 6e 63 |enuMgr.h|>. #inc|
|00003030| 6c 75 64 65 20 3c 57 69 | 6e 64 6f 77 4d 67 72 2e |lude <Wi|ndowMgr.|
|00003040| 68 3e 0d 23 65 6e 64 69 | 66 0d 0d 23 64 65 66 69 |h>.#endi|f..#defi|
|00003050| 6e 65 20 69 74 65 6d 64 | 69 73 61 62 6c 65 09 30 |ne itemd|isable.0|
|00003060| 4c 09 09 0d 23 64 65 66 | 69 6e 65 20 69 74 65 6d |L...#def|ine item|
|00003070| 65 6e 61 62 6c 65 09 31 | 4c 0d 23 64 65 66 69 6e |enable.1|L.#defin|
|00003080| 65 20 69 74 65 6d 63 68 | 65 63 6b 09 32 4c 0d 23 |e itemch|eck.2L.#|
|00003090| 64 65 66 69 6e 65 20 69 | 74 65 6d 75 6e 63 68 65 |define i|temunche|
|000030a0| 63 6b 09 33 4c 0d 0d 65 | 78 74 65 72 6e 20 63 68 |ck.3L..e|xtern ch|
|000030b0| 61 72 20 09 09 61 70 70 | 6c 65 73 74 72 69 6e 67 |ar ..app|lestring|
|000030c0| 5b 5d 3b 0d 65 78 74 65 | 72 6e 20 57 69 6e 64 6f |[];.exte|rn Windo|
|000030d0| 77 50 74 72 20 09 77 69 | 6e 64 6f 77 70 6f 69 6e |wPtr .wi|ndowpoin|
|000030e0| 74 28 29 3b 0d 65 78 74 | 65 72 6e 20 4d 65 6e 75 |t();.ext|ern Menu|
|000030f0| 48 61 6e 64 6c 65 20 09 | 6d 68 61 6e 64 28 29 3b |Handle .|mhand();|
|00003100| 0d 65 78 74 65 72 6e 20 | 69 6e 74 20 09 09 77 69 |.extern |int ..wi|
|00003110| 6e 64 6d 65 6e 75 3b 0d | 65 78 74 65 72 6e 20 69 |ndmenu;.|extern i|
|00003120| 6e 74 20 09 09 64 6f 67 | 6f 61 77 61 79 3b 09 09 |nt ..dog|oaway;..|
|00003130| 0d 65 78 74 65 72 6e 20 | 69 6e 74 20 09 09 77 70 |.extern |int ..wp|
|00003140| 72 6f 63 69 64 3b 09 09 | 0d 65 78 74 65 72 6e 20 |rocid;..|.extern |
|00003150| 69 6e 74 09 09 73 68 6f | 77 5f 6e 65 77 5f 77 69 |int..sho|w_new_wi|
|00003160| 6e 64 6f 77 3b 0d 65 78 | 74 65 72 6e 20 69 6e 74 |ndow;.ex|tern int|
|00003170| 20 09 09 73 69 7a 65 72 | 65 64 72 61 77 3b 0d 65 | ..sizer|edraw;.e|
|00003180| 78 74 65 72 6e 20 69 6e | 74 09 09 67 65 74 6c 69 |xtern in|t..getli|
|00003190| 6e 65 63 61 70 73 3b 0d | 65 78 74 65 72 6e 20 50 |necaps;.|extern P|
|000031a0| 72 6f 63 50 74 72 20 09 | 09 6b 65 79 64 6f 77 6e |rocPtr .|.keydown|
|000031b0| 70 72 6f 63 3b 0d 65 78 | 74 65 72 6e 20 50 72 6f |proc;.ex|tern Pro|
|000031c0| 63 50 74 72 20 09 09 61 | 75 74 6f 6b 65 79 70 72 |cPtr ..a|utokeypr|
|000031d0| 6f 63 3b 0d 65 78 74 65 | 72 6e 20 76 6f 69 64 09 |oc;.exte|rn void.|
|000031e0| 09 68 6f 6d 65 28 29 3b | 0d 65 78 74 65 72 6e 20 |.home();|.extern |
|000031f0| 76 6f 69 64 09 09 73 74 | 6e 6f 70 28 29 3b 0d 3d |void..st|nop();.=|
|00003200| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00003210| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00003220| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00003230| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00003240| 3d 3d 3d 3d 3d 3d 3d 3d | 0d 0d 09 09 48 65 72 65 |========|....Here|
|00003250| 20 62 65 67 69 6e 73 20 | 53 69 6d 70 6c 65 54 6f | begins |SimpleTo|
|00003260| 6f 6c 73 2e 63 0d 09 09 | 5f 5f 5f 5f 5f 5f 5f 5f |ols.c...|________|
|00003270| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00003280| 5f 0d 2a 2f 0d 0d 23 69 | 6e 63 6c 75 64 65 20 22 |_.*/..#i|nclude "|
|00003290| 73 69 6d 70 6c 65 2e 68 | 22 09 09 09 2f 2a 20 64 |simple.h|".../* d|
|000032a0| 65 66 69 6e 65 20 63 6f | 6d 70 69 6c 65 72 20 69 |efine co|mpiler i|
|000032b0| 6e 20 68 65 72 65 09 2a | 2f 0d 0d 23 69 66 64 65 |n here.*|/..#ifde|
|000032c0| 66 20 4d 45 47 41 4d 41 | 58 09 09 09 09 09 09 09 |f MEGAMA|X.......|
|000032d0| 0d 20 20 20 20 20 20 20 | 20 6f 76 65 72 6c 61 79 |. | overlay|
|000032e0| 20 22 73 69 6d 70 6c 65 | 74 6f 6f 6c 73 22 09 09 | "simple|tools"..|
|000032f0| 2f 2a 20 63 6f 6d 70 69 | 6c 65 72 20 64 65 70 65 |/* compi|ler depe|
|00003300| 6e 64 65 6e 74 09 09 2a | 2f 0d 0d 09 23 69 6e 63 |ndent..*|/...#inc|
|00003310| 6c 75 64 65 20 3c 6d 65 | 6d 2e 68 3e 0d 09 23 69 |lude <me|m.h>..#i|
|00003320| 6e 63 6c 75 64 65 20 3c | 71 64 2e 68 3e 0d 09 23 |nclude <|qd.h>..#|
|00003330| 69 6e 63 6c 75 64 65 20 | 3c 71 64 76 61 72 73 2e |include |<qdvars.|
|00003340| 68 3e 0d 09 23 69 6e 63 | 6c 75 64 65 20 3c 6d 69 |h>..#inc|lude <mi|
|00003350| 73 63 2e 68 3e 0d 09 23 | 69 6e 63 6c 75 64 65 20 |sc.h>..#|include |
|00003360| 3c 65 76 65 6e 74 2e 68 | 3e 0d 09 23 69 6e 63 6c |<event.h|>..#incl|
|00003370| 75 64 65 20 3c 72 65 73 | 2e 68 3e 0d 09 23 69 6e |ude <res|.h>..#in|
|00003380| 63 6c 75 64 65 20 3c 77 | 69 6e 2e 68 3e 0d 09 23 |clude <w|in.h>..#|
|00003390| 69 6e 63 6c 75 64 65 20 | 3c 64 69 61 6c 6f 67 2e |include |<dialog.|
|000033a0| 68 3e 0d 09 23 69 6e 63 | 6c 75 64 65 20 3c 6d 65 |h>..#inc|lude <me|
|000033b0| 6e 75 2e 68 3e 0d 09 23 | 69 6e 63 6c 75 64 65 20 |nu.h>..#|include |
|000033c0| 3c 73 74 72 69 6e 67 2e | 68 3e 0d 09 23 69 6e 63 |<string.|h>..#inc|
|000033d0| 6c 75 64 65 20 3c 73 74 | 64 69 6f 2e 68 3e 0d 09 |lude <st|dio.h>..|
|000033e0| 23 69 6e 63 6c 75 64 65 | 20 3c 70 61 63 6b 2e 68 |#include| <pack.h|
|000033f0| 3e 0d 09 23 69 6e 63 6c | 75 64 65 20 3c 74 65 2e |>..#incl|ude <te.|
|00003400| 68 3e 0d 09 23 69 6e 63 | 6c 75 64 65 20 3c 74 6f |h>..#inc|lude <to|
|00003410| 6f 6c 62 6f 78 2e 68 3e | 0d 09 0d 09 23 64 65 66 |olbox.h>|....#def|
|00003420| 69 6e 65 20 20 5a 5a 09 | 26 0d 23 65 6c 73 65 0d |ine ZZ.|&.#else.|
|00003430| 09 23 69 6e 63 6c 75 64 | 65 20 3c 4d 65 6d 6f 72 |.#includ|e <Memor|
|00003440| 79 4d 67 72 2e 68 3e 0d | 09 23 69 6e 63 6c 75 64 |yMgr.h>.|.#includ|
|00003450| 65 20 3c 51 75 69 63 6b | 64 72 61 77 2e 68 3e 0d |e <Quick|draw.h>.|
|00003460| 09 23 69 6e 63 6c 75 64 | 65 20 3c 45 76 65 6e 74 |.#includ|e <Event|
|00003470| 4d 67 72 2e 68 3e 0d 09 | 23 69 6e 63 6c 75 64 65 |Mgr.h>..|#include|
|00003480| 20 3c 52 65 73 6f 75 72 | 63 65 4d 67 72 2e 68 3e | <Resour|ceMgr.h>|
|00003490| 0d 09 23 69 6e 63 6c 75 | 64 65 20 3c 57 69 6e 64 |..#inclu|de <Wind|
|000034a0| 6f 77 4d 67 72 2e 68 3e | 0d 09 23 69 6e 63 6c 75 |owMgr.h>|..#inclu|
|000034b0| 64 65 20 3c 54 65 78 74 | 45 64 69 74 2e 68 3e 0d |de <Text|Edit.h>.|
|000034c0| 09 23 69 6e 63 6c 75 64 | 65 20 3c 44 69 61 6c 6f |.#includ|e <Dialo|
|000034d0| 67 4d 67 72 2e 68 3e 0d | 09 23 69 6e 63 6c 75 64 |gMgr.h>.|.#includ|
|000034e0| 65 20 3c 4d 65 6e 75 4d | 67 72 2e 68 3e 0d 09 23 |e <MenuM|gr.h>..#|
|000034f0| 69 6e 63 6c 75 64 65 20 | 3c 73 74 72 69 6e 67 73 |include |<strings|
|00003500| 2e 68 3e 0d 09 23 69 6e | 63 6c 75 64 65 20 3c 73 |.h>..#in|clude <s|
|00003510| 74 64 69 6f 2e 68 3e 0d | 09 23 69 6e 63 6c 75 64 |tdio.h>.|.#includ|
|00003520| 65 20 3c 50 61 63 6b 61 | 67 65 4d 67 72 2e 68 3e |e <Packa|geMgr.h>|
|00003530| 0d 09 23 69 6e 63 6c 75 | 64 65 20 3c 54 6f 6f 6c |..#inclu|de <Tool|
|00003540| 62 6f 78 55 74 69 6c 2e | 68 3e 0d 09 23 69 6e 63 |boxUtil.|h>..#inc|
|00003550| 6c 75 64 65 20 3c 53 74 | 64 46 69 6c 65 50 6b 67 |lude <St|dFilePkg|
|00003560| 2e 68 3e 0d 09 23 69 6e | 63 6c 75 64 65 20 3c 70 |.h>..#in|clude <p|
|00003570| 61 73 63 61 6c 2e 68 3e | 0d 09 0d 09 23 64 65 66 |ascal.h>|....#def|
|00003580| 69 6e 65 20 20 5a 5a 09 | 0d 23 65 6e 64 69 66 0d |ine ZZ.|.#endif.|
|00003590| 0d 23 64 65 66 69 6e 65 | 20 54 52 55 45 20 28 2d |.#define| TRUE (-|
|000035a0| 31 29 09 09 2f 2a 20 6c | 6f 63 61 6c 20 64 65 66 |1)../* l|ocal def|
|000035b0| 69 6e 69 74 69 6f 6e 73 | 20 09 09 09 2a 2f 0d 23 |initions| ...*/.#|
|000035c0| 64 65 66 69 6e 65 20 46 | 41 4c 53 45 20 30 0d 23 |define F|ALSE 0.#|
|000035d0| 64 65 66 69 6e 65 20 6d | 61 78 73 72 75 6e 73 20 |define m|axsruns |
|000035e0| 35 30 09 09 2f 2a 20 70 | 72 6f 63 65 64 75 72 65 |50../* p|rocedure|
|000035f0| 20 74 61 62 6c 65 20 73 | 69 7a 65 09 09 09 2a 2f | table s|ize...*/|
|00003600| 0d 23 64 65 66 69 6e 65 | 20 4d 45 53 53 4e 20 33 |.#define| MESSN 3|
|00003610| 30 09 09 2f 2a 20 61 72 | 72 61 79 20 73 69 7a 65 |0../* ar|ray size|
|00003620| 20 66 6f 72 20 6d 65 73 | 73 61 67 65 20 64 69 61 | for mes|sage dia|
|00003630| 6c 6f 67 20 69 74 65 6d | 73 09 2a 2f 0d 23 64 65 |log item|s.*/.#de|
|00003640| 66 69 6e 65 20 51 55 45 | 53 4e 20 34 30 09 09 2f |fine QUE|SN 40../|
|00003650| 2a 20 61 72 72 61 79 20 | 73 69 7a 65 20 66 6f 72 |* array |size for|
|00003660| 20 70 72 6f 6d 70 74 20 | 64 69 61 6c 6f 67 20 69 | prompt |dialog i|
|00003670| 74 65 6d 73 09 2a 2f 0d | 23 64 65 66 69 6e 65 20 |tems.*/.|#define |
|00003680| 52 4f 4d 38 35 20 20 20 | 30 78 32 38 45 09 09 2f |ROM85 |0x28E../|
|00003690| 2a 20 6e 65 77 20 72 6f | 6d 20 73 74 75 66 66 20 |* new ro|m stuff |
|000036a0| 09 09 09 2a 2f 0d 23 64 | 65 66 69 6e 65 20 4e 45 |...*/.#d|efine NE|
|000036b0| 57 52 4f 4d 20 20 30 78 | 37 46 46 46 0d 23 64 65 |WROM 0x|7FFF.#de|
|000036c0| 66 69 6e 65 20 69 6e 7a | 6f 6f 6d 6f 75 74 20 38 |fine inz|oomout 8|
|000036d0| 0d 23 64 65 66 69 6e 65 | 20 69 6e 7a 6f 6f 6d 69 |.#define| inzoomi|
|000036e0| 6e 20 20 37 0d 23 64 65 | 66 69 6e 65 20 7a 6f 6f |n 7.#de|fine zoo|
|000036f0| 6d 70 72 6f 63 20 20 38 | 0d 0d 74 79 70 65 64 65 |mproc 8|..typede|
|00003700| 66 20 73 74 72 75 63 74 | 20 7b 09 09 09 2f 2a 20 |f struct| {.../* |
|00003710| 73 74 72 75 63 74 75 72 | 65 20 66 6f 72 20 61 6e |structur|e for an|
|00003720| 20 49 74 65 6d 09 2a 2f | 0d 09 63 68 61 72 09 09 | Item.*/|..char..|
|00003730| 69 74 65 6d 6e 61 6d 65 | 5b 34 30 5d 3b 0d 09 69 |itemname|[40];..i|
|00003740| 6e 74 09 09 69 74 65 6d | 6e 6f 3b 09 09 2f 2a 20 |nt..item|no;../* |
|00003750| 49 74 65 6d 20 6e 75 6d | 62 65 72 20 77 69 74 68 |Item num|ber with|
|00003760| 69 6e 20 6d 65 6e 75 20 | 09 2a 2f 0d 09 69 6e 74 |in menu |.*/..int|
|00003770| 09 09 6d 65 6e 75 49 64 | 3b 09 09 2f 2a 20 6d 65 |..menuId|;../* me|
|00003780| 6e 75 20 69 64 09 09 09 | 2a 2f 0d 09 4d 65 6e 75 |nu id...|*/..Menu|
|00003790| 48 61 6e 64 6c 65 09 6d | 65 6e 75 68 61 6e 64 3b |Handle.m|enuhand;|
|000037a0| 09 2f 2a 20 49 74 65 6d | 27 73 20 6d 65 6e 75 27 |./* Item|'s menu'|
|000037b0| 73 20 48 61 6e 64 6c 65 | 20 09 09 09 09 2a 2f 0d |s Handle| ....*/.|
|000037c0| 09 50 72 6f 63 50 74 72 | 09 09 6d 65 6e 75 72 75 |.ProcPtr|..menuru|
|000037d0| 6e 3b 09 2f 2a 20 70 72 | 6f 63 65 64 75 72 65 20 |n;./* pr|ocedure |
|000037e0| 74 6f 20 72 75 6e 20 09 | 09 2a 2f 0d 09 50 74 72 |to run .|.*/..Ptr|
|000037f0| 09 09 6e 65 78 74 3b 09 | 09 2f 2a 20 70 6f 69 6e |..next;.|./* poin|
|00003800| 74 65 72 20 74 6f 20 74 | 68 65 20 6e 65 78 74 20 |ter to t|he next |
|00003810| 49 74 65 6d 20 09 2a 2f | 0d 7d 20 69 74 65 6d 64 |Item .*/|.} itemd|
|00003820| 61 74 75 6d 3b 0d 0d 74 | 79 70 65 64 65 66 20 73 |atum;..t|ypedef s|
|00003830| 74 72 75 63 74 20 7b 09 | 09 09 2f 2a 20 73 74 72 |truct {.|../* str|
|00003840| 75 63 74 75 72 65 20 66 | 6f 72 20 61 20 6d 65 6e |ucture f|or a men|
|00003850| 75 20 09 2a 2f 0d 09 63 | 68 61 72 20 09 09 6d 65 |u .*/..c|har ..me|
|00003860| 6e 75 6e 61 6d 65 5b 32 | 30 5d 3b 09 2f 2a 20 74 |nuname[2|0];./* t|
|00003870| 6f 20 61 6c 6c 6f 77 20 | 72 65 66 65 72 65 6e 63 |o allow |referenc|
|00003880| 65 20 62 79 20 6e 61 6d | 65 20 09 2a 2f 0d 09 69 |e by nam|e .*/..i|
|00003890| 6e 74 20 09 09 6d 65 6e | 75 49 64 3b 09 09 2f 2a |nt ..men|uId;../*|
|000038a0| 20 6d 65 6e 75 20 69 64 | 20 09 09 09 2a 2f 0d 09 | menu id| ...*/..|
|000038b0| 4d 65 6e 75 48 61 6e 64 | 6c 65 09 6d 65 6e 75 68 |MenuHand|le.menuh|
|000038c0| 61 6e 64 3b 09 2f 2a 20 | 6d 65 6e 75 20 48 61 6e |and;./* |menu Han|
|000038d0| 64 6c 65 20 74 6f 20 72 | 65 66 65 72 65 6e 63 65 |dle to r|eference|
|000038e0| 20 6d 65 6e 75 2a 2f 0d | 09 69 74 65 6d 64 61 74 | menu*/.|.itemdat|
|000038f0| 75 6d 09 2a 2a 69 74 65 | 6d 6c 69 73 74 3b 09 2f |um.**ite|mlist;./|
|00003900| 2a 20 70 6f 69 6e 74 65 | 72 20 74 6f 20 74 68 65 |* pointe|r to the|
|00003910| 20 6c 69 73 74 20 6f 66 | 20 69 74 65 6d 73 20 2a | list of| items *|
|00003920| 2f 0d 09 50 74 72 20 09 | 09 6e 65 78 74 3b 09 09 |/..Ptr .|.next;..|
|00003930| 2f 2a 20 70 6f 69 6e 74 | 65 72 20 74 6f 20 74 68 |/* point|er to th|
|00003940| 65 20 6e 65 78 74 20 6d | 65 6e 75 20 09 2a 2f 0d |e next m|enu .*/.|
|00003950| 7d 20 6d 65 6e 75 64 61 | 74 75 6d 3b 0d 0d 74 79 |} menuda|tum;..ty|
|00003960| 70 65 64 65 66 20 73 74 | 72 75 63 74 20 7b 09 09 |pedef st|ruct {..|
|00003970| 09 2f 2a 20 73 74 72 75 | 63 74 75 72 65 20 66 6f |./* stru|cture fo|
|00003980| 72 20 61 20 77 69 6e 64 | 6f 77 20 09 2a 2f 0d 09 |r a wind|ow .*/..|
|00003990| 63 68 61 72 09 09 77 69 | 6e 64 6e 61 6d 65 5b 38 |char..wi|ndname[8|
|000039a0| 30 5d 3b 09 2f 2a 20 77 | 69 6e 64 6f 77 27 73 20 |0];./* w|indow's |
|000039b0| 6e 61 6d 65 20 61 6e 64 | 20 72 65 66 65 72 65 6e |name and| referen|
|000039c0| 63 65 20 09 2a 2f 0d 09 | 57 69 6e 64 6f 77 50 74 |ce .*/..|WindowPt|
|000039d0| 72 09 77 70 74 72 3b 09 | 09 2f 2a 20 77 69 6e 64 |r.wptr;.|./* wind|
|000039e0| 6f 77 27 73 20 70 6f 69 | 6e 74 65 72 20 72 65 66 |ow's poi|nter ref|
|000039f0| 65 72 65 6e 63 65 20 09 | 2a 2f 0d 09 50 72 6f 63 |erence .|*/..Proc|
|00003a00| 50 74 72 09 77 61 63 74 | 3b 09 09 09 2f 2a 20 74 |Ptr.wact|;.../* t|
|00003a10| 68 65 20 61 63 74 69 76 | 61 74 65 20 70 72 6f 63 |he activ|ate proc|
|00003a20| 65 64 75 72 65 20 09 2a | 2f 0d 09 50 72 6f 63 50 |edure .*|/..ProcP|
|00003a30| 74 72 09 77 64 65 61 63 | 74 3b 09 09 09 2f 2a 20 |tr.wdeac|t;.../* |
|00003a40| 74 68 65 20 64 65 61 63 | 74 69 76 61 74 65 20 70 |the deac|tivate p|
|00003a50| 72 6f 63 65 64 75 72 65 | 20 09 2a 2f 0d 09 50 72 |rocedure| .*/..Pr|
|00003a60| 6f 63 50 74 72 09 77 75 | 70 64 61 74 65 3b 09 09 |ocPtr.wu|pdate;..|
|00003a70| 2f 2a 20 74 68 65 20 75 | 70 64 61 74 65 20 70 72 |/* the u|pdate pr|
|00003a80| 6f 63 65 64 75 72 65 20 | 09 2a 2f 0d 09 50 72 6f |ocedure |.*/..Pro|
|00003a90| 63 50 74 72 09 77 63 6f | 6e 74 65 6e 74 3b 09 09 |cPtr.wco|ntent;..|
|00003aa0| 2f 2a 20 74 68 65 20 63 | 6f 6e 74 65 6e 74 20 70 |/* the c|ontent p|
|00003ab0| 72 6f 63 65 64 75 72 65 | 20 09 2a 2f 0d 09 50 74 |rocedure| .*/..Pt|
|00003ac0| 72 09 09 6e 65 78 74 3b | 09 09 2f 2a 20 70 6f 69 |r..next;|../* poi|
|00003ad0| 6e 74 65 72 20 74 6f 20 | 74 68 65 20 6e 65 78 74 |nter to |the next|
|00003ae0| 20 77 69 6e 64 6f 77 20 | 09 2a 2f 0d 7d 20 77 69 | window |.*/.} wi|
|00003af0| 6e 64 64 61 74 75 6d 3b | 0d 0d 23 69 66 64 65 66 |nddatum;|..#ifdef|
|00003b00| 20 4c 49 47 48 54 53 50 | 45 45 44 0d 20 20 70 61 | LIGHTSP|EED. pa|
|00003b10| 73 63 61 6c 20 42 6f 6f | 6c 65 61 6e 20 09 2a 54 |scal Boo|lean .*T|
|00003b20| 72 61 63 6b 42 6f 78 28 | 29 20 3d 20 30 78 41 38 |rackBox(|) = 0xA8|
|00003b30| 33 42 3b 20 0d 20 20 70 | 61 73 63 61 6c 20 76 6f |3B; . p|ascal vo|
|00003b40| 69 64 20 09 09 2a 5a 6f | 6f 6d 57 69 6e 64 6f 77 |id ..*Zo|omWindow|
|00003b50| 28 29 20 3d 20 30 78 41 | 38 33 41 3b 0d 23 65 6e |() = 0xA|83A;.#en|
|00003b60| 64 69 66 0d 0d 57 69 6e | 64 6f 77 50 74 72 20 77 |dif..Win|dowPtr w|
|00003b70| 69 6e 64 6f 77 70 6f 69 | 6e 74 28 29 3b 0d 0d 2f |indowpoi|nt();../|
|00003b80| 2a 20 4c 6f 63 61 6c 20 | 76 61 72 69 61 62 6c 65 |* Local |variable|
|00003b90| 73 20 2a 2f 0d 0d 6d 65 | 6e 75 64 61 74 75 6d 20 |s */..me|nudatum |
|00003ba0| 09 2a 2a 73 69 6d 70 6c | 65 6d 65 6e 75 73 3b 09 |.**simpl|emenus;.|
|00003bb0| 09 2f 2a 20 48 61 6e 64 | 6c 65 20 74 6f 20 6d 65 |./* Hand|le to me|
|00003bc0| 6e 75 20 64 61 74 61 20 | 09 09 2a 2f 0d 63 68 61 |nu data |..*/.cha|
|00003bd0| 72 20 09 09 61 63 63 6e | 61 6d 65 5b 38 30 5d 3b |r ..accn|ame[80];|
|00003be0| 09 09 2f 2a 20 64 65 73 | 6b 20 61 63 63 65 73 73 |../* des|k access|
|00003bf0| 6f 72 79 20 6e 61 6d 65 | 20 74 6f 20 6f 70 65 6e |ory name| to open|
|00003c00| 20 09 2a 2f 0d 52 65 63 | 74 20 09 09 64 72 61 67 | .*/.Rec|t ..drag|
|00003c10| 72 65 63 74 2c 20 73 69 | 7a 65 72 65 63 74 3b 09 |rect, si|zerect;.|
|00003c20| 2f 2a 20 6c 69 6d 69 74 | 73 20 66 6f 72 20 6d 6f |/* limit|s for mo|
|00003c30| 76 69 6e 67 20 77 69 6e | 64 6f 77 73 20 09 2a 2f |ving win|dows .*/|
|00003c40| 0d 52 65 63 74 20 09 09 | 73 77 68 6f 6c 65 73 63 |.Rect ..|swholesc|
|00003c50| 72 65 65 6e 3b 0d 77 69 | 6e 64 64 61 74 75 6d 09 |reen;.wi|nddatum.|
|00003c60| 2a 2a 73 69 6d 70 6c 65 | 77 69 6e 64 73 3b 09 09 |**simple|winds;..|
|00003c70| 2f 2a 20 48 61 6e 64 6c | 65 20 74 6f 20 77 69 6e |/* Handl|e to win|
|00003c80| 64 6f 77 20 64 61 74 61 | 20 09 2a 2f 0d 69 6e 74 |dow data| .*/.int|
|00003c90| 09 09 66 69 72 73 74 77 | 69 6e 64 3b 09 09 2f 2a |..firstw|ind;../*|
|00003ca0| 20 69 66 20 6e 6f 20 77 | 69 6e 64 6f 77 73 20 68 | if no w|indows h|
|00003cb0| 61 76 65 20 62 65 65 6e | 20 6d 61 64 65 09 2a 2f |ave been| made.*/|
|00003cc0| 0d 50 72 6f 63 50 74 72 | 20 09 73 69 6d 70 6c 65 |.ProcPtr| .simple|
|00003cd0| 72 75 6e 73 5b 6d 61 78 | 73 72 75 6e 73 5d 3b 09 |runs[max|sruns];.|
|00003ce0| 2f 2a 20 6c 69 73 74 20 | 6f 66 20 70 72 6f 63 65 |/* list |of proce|
|00003cf0| 64 75 72 65 73 20 74 6f | 20 72 75 6e 20 09 2a 2f |dures to| run .*/|
|00003d00| 0d 57 69 6e 64 6f 77 50 | 74 72 09 64 65 62 75 67 |.WindowP|tr.debug|
|00003d10| 77 3b 09 09 09 2f 2a 20 | 77 69 6e 64 6f 77 20 70 |w;.../* |window p|
|00003d20| 6f 69 6e 74 65 72 20 66 | 6f 72 20 64 65 62 75 67 |ointer f|or debug|
|00003d30| 67 69 6e 67 20 2a 2f 0d | 69 6e 74 09 09 73 6e 65 |ging */.|int..sne|
|00003d40| 77 72 6f 6d 3b 0d 69 6e | 74 09 09 67 65 74 6c 69 |wrom;.in|t..getli|
|00003d50| 6e 65 63 61 70 73 20 3d | 20 46 41 4c 53 45 3b 0d |necaps =| FALSE;.|
|00003d60| 0d 2f 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |./******|********|
|00003d70| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003d80| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003d90| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003da0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2f 0d 2f 2a 20 47 |********|**/./* G|
|00003db0| 4c 4f 42 41 4c 20 55 53 | 45 52 20 4d 4f 44 49 46 |LOBAL US|ER MODIF|
|00003dc0| 49 41 42 4c 45 20 56 41 | 52 49 41 42 4c 45 53 20 |IABLE VA|RIABLES |
|00003dd0| 09 09 09 09 09 2a 2f 0d | 2f 2a 20 54 68 65 73 65 |.....*/.|/* These|
|00003de0| 20 61 72 65 20 76 61 72 | 69 61 62 6c 65 73 20 74 | are var|iables t|
|00003df0| 68 61 74 20 79 6f 75 20 | 63 61 6e 20 64 65 63 6c |hat you |can decl|
|00003e00| 61 72 65 20 65 78 74 65 | 72 6e 20 73 6f 20 74 68 |are exte|rn so th|
|00003e10| 61 74 20 79 6f 75 20 63 | 61 6e 20 75 73 65 09 2a |at you c|an use.*|
|00003e20| 2f 0d 2f 2a 20 74 68 65 | 6d 20 74 6f 20 63 68 61 |/./* the|m to cha|
|00003e30| 6e 67 65 20 74 68 65 20 | 53 69 6d 70 6c 65 54 6f |nge the |SimpleTo|
|00003e40| 6f 6c 73 20 64 65 66 61 | 75 6c 74 73 09 09 09 09 |ols defa|ults....|
|00003e50| 2a 2f 0d 2f 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |*/./****|********|
|00003e60| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003e70| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003e80| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00003e90| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2f 0d 0d 2f |********|****/../|
|00003ea0| 2a 20 77 70 72 6f 63 69 | 64 20 3d 20 74 79 70 65 |* wproci|d = type|
|00003eb0| 20 6f 66 20 77 69 6e 64 | 6f 77 20 74 6f 20 43 72 | of wind|ow to Cr|
|00003ec0| 65 61 74 65 20 6f 6e 20 | 6e 65 78 74 20 77 69 6e |eate on |next win|
|00003ed0| 64 6f 77 28 29 20 63 61 | 6c 6c 09 09 2a 2f 0d 2f |dow() ca|ll..*/./|
|00003ee0| 2a 20 46 6f 72 20 4c 69 | 67 68 74 53 70 65 65 64 |* For Li|ghtSpeed|
|00003ef0| 20 43 2c 20 75 73 65 20 | 61 20 6c 6f 77 65 72 20 | C, use |a lower |
|00003f00| 63 61 73 65 20 64 20 61 | 6e 64 20 75 70 70 65 72 |case d a|nd upper|
|00003f10| 20 63 61 73 65 20 50 20 | 66 6f 72 20 09 09 2a 2f | case P |for ..*/|
|00003f20| 0d 2f 2a 20 09 44 6f 63 | 75 6d 65 6e 74 50 72 6f |./* .Doc|umentPro|
|00003f30| 63 2e 20 20 4d 65 67 61 | 6d 61 78 20 63 6f 6e 76 |c. Mega|max conv|
|00003f40| 65 72 73 69 6f 6e 20 70 | 72 6f 67 72 61 6d 20 64 |ersion p|rogram d|
|00003f50| 6f 65 73 20 74 68 69 73 | 20 77 72 6f 6e 67 2e 09 |oes this| wrong..|
|00003f60| 2a 2f 0d 0d 69 6e 74 20 | 09 09 77 70 72 6f 63 69 |*/..int |..wproci|
|00003f70| 64 20 3d 20 64 6f 63 75 | 6d 65 6e 74 50 72 6f 63 |d = docu|mentProc|
|00003f80| 3b 09 0d 0d 2f 2a 20 64 | 6f 67 6f 61 77 61 79 20 |;.../* d|ogoaway |
|00003f90| 3d 20 69 73 20 74 68 65 | 20 6e 65 78 74 20 63 72 |= is the| next cr|
|00003fa0| 65 61 74 65 64 20 77 69 | 6e 64 6f 77 20 74 6f 20 |eated wi|ndow to |
|00003fb0| 68 61 76 65 20 61 20 67 | 6f 2d 61 77 61 79 20 62 |have a g|o-away b|
|00003fc0| 6f 78 09 09 2a 2f 0d 0d | 69 6e 74 20 09 09 64 6f |ox..*/..|int ..do|
|00003fd0| 67 6f 61 77 61 79 20 3d | 20 54 52 55 45 3b 09 0d |goaway =| TRUE;..|
|00003fe0| 0d 2f 2a 20 6b 65 79 64 | 6f 77 6e 70 72 6f 63 20 |./* keyd|ownproc |
|00003ff0| 3d 20 74 68 65 20 70 72 | 6f 63 65 64 75 72 65 20 |= the pr|ocedure |
|00004000| 74 6f 20 62 65 20 63 61 | 6c 6c 65 64 20 77 68 65 |to be ca|lled whe|
|00004010| 6e 20 6b 65 79 44 6f 77 | 6e 20 69 73 20 64 65 74 |n keyDow|n is det|
|00004020| 65 63 74 65 64 09 2a 2f | 0d 2f 2a 20 61 75 74 6f |ected.*/|./* auto|
|00004030| 6b 65 79 70 72 6f 63 20 | 3d 20 74 68 65 20 70 72 |keyproc |= the pr|
|00004040| 6f 63 65 64 75 72 65 20 | 74 6f 20 62 65 20 63 61 |ocedure |to be ca|
|00004050| 6c 6c 65 64 20 77 68 65 | 6e 20 61 75 74 6f 4b 65 |lled whe|n autoKe|
|00004060| 79 20 69 73 20 64 65 74 | 65 63 74 65 64 09 2a 2f |y is det|ected.*/|
|00004070| 0d 2f 2a 20 42 4f 54 48 | 20 4f 46 20 54 48 45 53 |./* BOTH| OF THES|
|00004080| 45 20 41 52 45 20 50 41 | 53 53 45 44 20 54 48 45 |E ARE PA|SSED THE|
|00004090| 20 45 56 45 4e 54 52 45 | 43 4f 52 44 20 53 4f 20 | EVENTRE|CORD SO |
|000040a0| 54 48 45 20 4b 45 59 20 | 43 41 4e 20 42 45 20 46 |THE KEY |CAN BE F|
|000040b0| 4f 55 4e 44 09 2a 2f 0d | 0d 50 72 6f 63 50 74 72 |OUND.*/.|.ProcPtr|
|000040c0| 20 09 6b 65 79 64 6f 77 | 6e 70 72 6f 63 2c 0d 20 | .keydow|nproc,. |
|000040d0| 20 09 09 61 75 74 6f 6b | 65 79 70 72 6f 63 3b 20 | ..autok|eyproc; |
|000040e0| 09 09 0d 09 09 0d 2f 2a | 20 61 70 70 6c 65 73 74 |....../*| applest|
|000040f0| 72 69 6e 67 20 3d 20 61 | 20 73 74 72 69 6e 67 20 |ring = a| string |
|00004100| 63 6f 6e 74 61 69 6e 69 | 6e 67 20 74 68 65 20 41 |containi|ng the A|
|00004110| 70 70 6c 65 20 66 6f 72 | 20 6d 65 6e 75 20 72 65 |pple for| menu re|
|00004120| 66 65 72 65 6e 63 65 09 | 2a 2f 0d 0d 63 68 61 72 |ference.|*/..char|
|00004130| 20 09 09 61 70 70 6c 65 | 73 74 72 69 6e 67 5b 32 | ..apple|string[2|
|00004140| 5d 20 0d 20 20 09 09 3d | 20 7b 27 5c 30 32 34 27 |] . ..=| {'\024'|
|00004150| 2c 20 27 5c 30 27 7d 3b | 20 09 0d 0d 2f 2a 20 77 |, '\0'};| .../* w|
|00004160| 69 6e 64 6d 65 6e 75 20 | 3d 20 64 6f 65 73 20 74 |indmenu |= does t|
|00004170| 68 65 20 6e 65 78 74 20 | 77 69 6e 64 6f 77 20 63 |he next |window c|
|00004180| 72 65 61 74 65 64 20 67 | 65 74 20 61 20 63 68 6f |reated g|et a cho|
|00004190| 69 63 65 20 75 6e 64 65 | 72 20 74 68 65 0d 20 20 |ice unde|r the. |
|000041a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 77 69 6e 64 | | wind|
|000041b0| 6f 77 20 6d 65 6e 75 20 | 28 73 6f 20 61 20 63 6c |ow menu |(so a cl|
|000041c0| 6f 73 65 64 20 77 69 6e | 64 6f 77 20 63 61 6e 20 |osed win|dow can |
|000041d0| 62 65 20 62 72 6f 75 67 | 68 74 20 62 61 63 6b 09 |be broug|ht back.|
|000041e0| 2a 2f 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |*/. | |
|000041f0| 20 0d 69 6e 74 20 09 09 | 77 69 6e 64 6d 65 6e 75 | .int ..|windmenu|
|00004200| 20 3d 20 54 52 55 45 3b | 09 0d 0d 2f 2a 20 73 69 | = TRUE;|.../* si|
|00004210| 7a 65 72 65 64 72 61 77 | 20 3d 20 69 73 20 74 68 |zeredraw| = is th|
|00004220| 65 20 77 69 6e 64 6f 77 | 27 73 20 63 6f 6e 74 65 |e window|'s conte|
|00004230| 6e 74 20 61 72 65 61 20 | 65 72 61 73 65 64 20 61 |nt area |erased a|
|00004240| 6e 64 20 6d 61 64 65 0d | 20 20 20 20 20 20 20 20 |nd made.| |
|00004250| 20 20 20 20 20 20 20 20 | 75 70 64 61 74 65 61 62 | |updateab|
|00004260| 6c 65 20 75 70 6f 6e 20 | 62 65 69 6e 67 20 72 65 |le upon |being re|
|00004270| 73 69 7a 65 64 09 09 09 | 09 2a 2f 0d 20 20 20 20 |sized...|.*/. |
|00004280| 20 20 20 20 20 20 20 20 | 20 20 20 20 0d 69 6e 74 | | .int|
|00004290| 09 09 73 69 7a 65 72 65 | 64 72 61 77 20 3d 20 46 |..sizere|draw = F|
|000042a0| 41 4c 53 45 3b 09 0d 0d | 2f 2a 20 73 68 6f 77 5f |ALSE;...|/* show_|
|000042b0| 6e 65 77 5f 77 69 6e 64 | 6f 77 20 3d 20 64 6f 65 |new_wind|ow = doe|
|000042c0| 73 20 74 68 65 20 63 72 | 65 61 74 65 64 20 77 69 |s the cr|eated wi|
|000042d0| 6e 64 6f 77 20 67 65 74 | 20 64 69 73 70 6c 61 79 |ndow get| display|
|000042e0| 65 64 20 72 69 67 68 74 | 20 61 77 61 79 0d 09 09 |ed right| away...|
|000042f0| 6f 6e 20 74 68 65 20 73 | 63 72 65 65 6e 2c 20 69 |on the s|creen, i|
|00004300| 66 20 6e 6f 74 2c 20 74 | 68 65 6e 20 69 74 20 69 |f not, t|hen it i|
|00004310| 73 20 68 69 64 64 65 6e | 09 09 2a 2f 0d 09 09 0d |s hidden|..*/....|
|00004320| 69 6e 74 09 09 73 68 6f | 77 5f 6e 65 77 5f 77 69 |int..sho|w_new_wi|
|00004330| 6e 64 6f 77 20 3d 20 54 | 52 55 45 3b 0d 0d 0d 2f |ndow = T|RUE;.../|
|00004340| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004350| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004360| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004370| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004380| 2a 2a 2f 0d 2f 2a 20 44 | 69 61 6c 6f 67 20 6c 69 |**/./* D|ialog li|
|00004390| 73 74 73 2e 20 20 54 68 | 65 73 65 20 77 65 72 65 |sts. Th|ese were|
|000043a0| 20 63 61 6c 63 75 6c 61 | 74 65 64 20 62 79 20 75 | calcula|ted by u|
|000043b0| 73 69 6e 67 20 74 68 65 | 20 6e 65 77 20 72 65 73 |sing the| new res|
|000043c0| 6f 75 72 63 65 20 2a 2f | 0d 2f 2a 20 65 64 69 74 |ource */|./* edit|
|000043d0| 6f 72 20 74 6f 20 6d 61 | 6b 65 20 61 20 74 65 6d |or to ma|ke a tem|
|000043e0| 70 6c 61 74 65 20 66 6f | 72 20 61 20 64 69 61 6c |plate fo|r a dial|
|000043f0| 6f 67 20 61 6e 64 20 74 | 68 65 6e 20 75 73 69 6e |og and t|hen usin|
|00004400| 67 20 66 65 64 69 74 20 | 74 6f 20 2a 2f 0d 2f 2a |g fedit |to */./*|
|00004410| 20 6c 69 73 74 20 74 68 | 65 20 68 65 78 20 6c 69 | list th|e hex li|
|00004420| 73 74 69 6e 67 20 6f 66 | 20 74 68 65 20 49 74 65 |sting of| the Ite|
|00004430| 6d 20 6c 69 73 74 20 66 | 6f 72 20 74 68 65 20 64 |m list f|or the d|
|00004440| 69 61 6c 6f 67 2e 09 20 | 20 2a 2f 0d 2f 2a 2a 2a |ialog.. | */./***|
|00004450| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004460| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004470| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004480| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2f |********|*******/|
|00004490| 0d 0d 69 6e 74 20 6d 65 | 73 73 64 5b 4d 45 53 53 |..int me|ssd[MESS|
|000044a0| 4e 5d 20 3d 20 7b 32 2c | 30 2c 30 2c 30 78 33 38 |N] = {2,|0,0,0x38|
|000044b0| 2c 30 78 66 31 2c 30 78 | 34 63 2c 30 78 31 32 64 |,0xf1,0x|4c,0x12d|
|000044c0| 2c 30 78 34 30 32 2c 30 | 78 34 66 34 62 2c 30 2c |,0x402,0|x4f4b,0,|
|000044d0| 30 2c 35 2c 35 2c 0d 09 | 09 30 78 33 36 2c 30 78 |0,5,5,..|.0x36,0x|
|000044e0| 31 32 64 2c 30 78 38 30 | 30 2c 30 2c 30 2c 30 78 |12d,0x80|0,0,0,0x|
|000044f0| 33 38 2c 30 78 61 63 2c | 30 78 34 63 2c 30 78 65 |38,0xac,|0x4c,0xe|
|00004500| 38 2c 30 78 34 30 36 2c | 0d 09 09 30 78 34 33 36 |8,0x406,|...0x436|
|00004510| 31 2c 30 78 36 65 36 33 | 2c 30 78 36 35 36 63 7d |1,0x6e63|,0x656c}|
|00004520| 3b 0d 69 6e 74 20 71 75 | 65 73 64 5b 51 55 45 53 |;.int qu|esd[QUES|
|00004530| 4e 5d 20 3d 20 7b 33 2c | 30 2c 30 2c 30 78 32 31 |N] = {3,|0,0,0x21|
|00004540| 2c 30 78 66 30 2c 30 78 | 33 35 2c 30 78 31 32 63 |,0xf0,0x|35,0x12c|
|00004550| 2c 30 78 34 30 32 2c 30 | 78 34 66 34 62 2c 30 2c |,0x402,0|x4f4b,0,|
|00004560| 30 2c 38 2c 38 2c 0d 09 | 09 30 78 32 38 2c 30 78 |0,8,8,..|.0x28,0x|
|00004570| 65 38 2c 30 78 38 30 30 | 2c 30 2c 30 2c 30 78 32 |e8,0x800|,0,0,0x2|
|00004580| 62 2c 38 2c 30 78 34 62 | 2c 30 78 65 38 2c 30 78 |b,8,0x4b|,0xe8,0x|
|00004590| 31 30 30 30 2c 30 2c 30 | 2c 0d 09 09 38 2c 30 78 |1000,0,0|,...8,0x|
|000045a0| 66 30 2c 30 78 31 63 2c | 30 78 31 32 63 2c 30 78 |f0,0x1c,|0x12c,0x|
|000045b0| 34 30 36 2c 30 78 34 33 | 36 31 2c 30 78 36 65 36 |406,0x43|61,0x6e6|
|000045c0| 33 2c 30 78 36 35 36 63 | 7d 3b 0d 09 09 0d 09 09 |3,0x656c|};......|
|000045d0| 0d 2f 2a 20 4c 6f 63 61 | 6c 20 70 72 6f 63 65 64 |./* Loca|l proced|
|000045e0| 75 72 65 20 2a 2f 0d 0d | 76 6f 69 64 20 73 74 6e |ure */..|void stn|
|000045f0| 6f 70 28 29 09 09 09 09 | 2f 2a 20 61 20 6e 6f 20 |op()....|/* a no |
|00004600| 6f 70 20 70 72 6f 63 65 | 64 75 72 65 20 66 6f 72 |op proce|dure for|
|00004610| 20 64 65 66 61 75 6c 74 | 73 20 2a 2f 0d 7b 0d 7d | default|s */.{.}|
|00004620| 0d 0d 63 68 61 72 20 2a | 70 74 6f 63 28 73 29 0d |..char *|ptoc(s).|
|00004630| 63 68 61 72 20 2a 73 3b | 0d 7b 0d 09 23 69 66 6e |char *s;|.{..#ifn|
|00004640| 64 65 66 20 4d 45 47 41 | 4d 41 58 0d 09 09 72 65 |def MEGA|MAX...re|
|00004650| 74 75 72 6e 20 28 50 74 | 6f 43 73 74 72 28 73 29 |turn (Pt|oCstr(s)|
|00004660| 29 3b 0d 09 23 65 6c 73 | 65 0d 09 09 72 65 74 75 |);..#els|e...retu|
|00004670| 72 6e 20 28 73 29 3b 0d | 09 23 65 6e 64 69 66 0d |rn (s);.|.#endif.|
|00004680| 7d 0d 0d 63 68 61 72 20 | 2a 63 74 6f 70 28 73 29 |}..char |*ctop(s)|
|00004690| 0d 63 68 61 72 20 2a 73 | 3b 0d 7b 0d 09 23 69 66 |.char *s|;.{..#if|
|000046a0| 6e 64 65 66 20 4d 45 47 | 41 4d 41 58 0d 09 09 72 |ndef MEG|AMAX...r|
|000046b0| 65 74 75 72 6e 20 28 43 | 74 6f 50 73 74 72 28 73 |eturn (C|toPstr(s|
|000046c0| 29 29 3b 0d 09 23 65 6c | 73 65 0d 09 09 72 65 74 |));..#el|se...ret|
|000046d0| 75 72 6e 20 28 73 29 3b | 0d 09 23 65 6e 64 69 66 |urn (s);|..#endif|
|000046e0| 0d 7d 0d 0d 2f 2a 20 47 | 69 76 65 6e 20 61 20 6d |.}../* G|iven a m|
|000046f0| 65 6e 75 20 6e 61 6d 65 | 2c 20 66 69 6e 64 20 6f |enu name|, find o|
|00004700| 75 72 20 64 61 74 61 20 | 73 74 72 75 63 74 75 72 |ur data |structur|
|00004710| 65 20 66 6f 72 20 69 74 | 2e 20 20 52 65 74 75 72 |e for it|. Retur|
|00004720| 6e 20 61 20 48 61 6e 64 | 6c 65 0d 20 20 20 74 6f |n a Hand|le. to|
|00004730| 20 74 68 69 73 20 73 74 | 72 75 63 74 75 72 65 2e | this st|ructure.|
|00004740| 20 20 54 68 69 73 20 69 | 73 20 61 20 6c 6f 63 61 | This i|s a loca|
|00004750| 6c 20 70 72 6f 63 65 64 | 75 72 65 20 66 6f 72 20 |l proced|ure for |
|00004760| 53 69 6d 70 6c 65 54 6f | 6f 6c 73 20 75 73 65 2e |SimpleTo|ols use.|
|00004770| 0d 2a 2f 0d 0d 2f 2a 20 | 6c 6f 63 61 6c 20 70 72 |.*/../* |local pr|
|00004780| 6f 63 65 64 75 72 65 20 | 2a 2f 0d 0d 6d 65 6e 75 |ocedure |*/..menu|
|00004790| 64 61 74 75 6d 20 2a 2a | 67 65 74 6f 75 72 6d 65 |datum **|getourme|
|000047a0| 6e 75 68 61 6e 64 6c 65 | 20 28 6e 61 6d 65 29 0d |nuhandle| (name).|
|000047b0| 63 68 61 72 20 2a 6e 61 | 6d 65 3b 09 09 09 09 2f |char *na|me;..../|
|000047c0| 2a 20 6e 61 6d 65 20 6f | 66 20 6d 65 6e 75 20 62 |* name o|f menu b|
|000047d0| 61 72 20 6d 65 6e 75 20 | 2a 2f 0d 7b 0d 09 6d 65 |ar menu |*/.{..me|
|000047e0| 6e 75 64 61 74 75 6d 20 | 2a 2a 68 65 72 65 2c 20 |nudatum |**here, |
|000047f0| 2a 2a 74 65 6d 70 3b 09 | 2f 2a 20 68 61 6e 64 20 |**temp;.|/* hand |
|00004800| 74 6f 20 6d 65 6e 75 20 | 73 74 72 75 63 74 75 72 |to menu |structur|
|00004810| 65 2a 2f 0d 09 68 65 72 | 65 20 3d 20 73 69 6d 70 |e*/..her|e = simp|
|00004820| 6c 65 6d 65 6e 75 73 3b | 0d 0d 09 2f 2a 20 66 69 |lemenus;|.../* fi|
|00004830| 6e 64 20 74 68 65 20 6d | 65 6e 75 20 6e 61 6d 65 |nd the m|enu name|
|00004840| 20 6f 72 20 74 68 65 20 | 65 6e 64 20 6f 66 20 6f | or the |end of o|
|00004850| 75 74 20 6d 65 6e 75 20 | 6c 69 73 74 20 2a 2f 0d |ut menu |list */.|
|00004860| 09 48 4c 6f 63 6b 20 28 | 68 65 72 65 29 3b 0d 09 |.HLock (|here);..|
|00004870| 77 68 69 6c 65 20 28 73 | 74 72 63 6d 70 28 6e 61 |while (s|trcmp(na|
|00004880| 6d 65 2c 28 2a 2a 68 65 | 72 65 29 2e 6d 65 6e 75 |me,(**he|re).menu|
|00004890| 6e 61 6d 65 29 20 26 26 | 20 28 2a 2a 68 65 72 65 |name) &&| (**here|
|000048a0| 29 2e 6e 65 78 74 20 29 | 20 20 7b 0d 09 09 74 65 |).next )| {...te|
|000048b0| 6d 70 20 3d 20 68 65 72 | 65 3b 0d 09 09 68 65 72 |mp = her|e;...her|
|000048c0| 65 20 3d 20 28 6d 65 6e | 75 64 61 74 75 6d 20 2a |e = (men|udatum *|
|000048d0| 2a 29 28 2a 2a 68 65 72 | 65 29 2e 6e 65 78 74 3b |*)(**her|e).next;|
|000048e0| 0d 09 09 48 55 6e 6c 6f | 63 6b 20 28 74 65 6d 70 |...HUnlo|ck (temp|
|000048f0| 29 3b 0d 09 09 48 4c 6f | 63 6b 20 28 68 65 72 65 |);...HLo|ck (here|
|00004900| 29 3b 0d 09 7d 0d 09 09 | 0d 09 2f 2a 20 73 65 65 |);..}...|../* see|
|00004910| 20 69 66 20 77 65 20 66 | 6f 75 6e 64 20 69 74 20 | if we f|ound it |
|00004920| 6f 72 20 6a 75 73 74 20 | 74 68 65 20 65 6e 64 20 |or just |the end |
|00004930| 6f 66 20 74 68 65 20 6c | 69 73 74 20 2a 2f 0d 09 |of the l|ist */..|
|00004940| 69 66 20 28 21 73 74 72 | 63 6d 70 28 6e 61 6d 65 |if (!str|cmp(name|
|00004950| 2c 28 2a 2a 68 65 72 65 | 29 2e 6d 65 6e 75 6e 61 |,(**here|).menuna|
|00004960| 6d 65 29 29 20 7b 0d 09 | 09 48 55 6e 6c 6f 63 6b |me)) {..|.HUnlock|
|00004970| 20 28 68 65 72 65 29 3b | 0d 09 09 72 65 74 75 72 | (here);|...retur|
|00004980| 6e 20 28 68 65 72 65 29 | 3b 0d 09 7d 20 65 6c 73 |n (here)|;..} els|
|00004990| 65 20 7b 0d 09 09 48 55 | 6e 6c 6f 63 6b 20 28 68 |e {...HU|nlock (h|
|000049a0| 65 72 65 29 3b 0d 09 09 | 72 65 74 75 72 6e 20 28 |ere);...|return (|
|000049b0| 28 6d 65 6e 75 64 61 74 | 75 6d 20 2a 2a 29 30 4c |(menudat|um **)0L|
|000049c0| 29 3b 09 09 0d 09 7d 0d | 7d 0d 0d 2f 2a 20 54 68 |);....}.|}../* Th|
|000049d0| 69 73 20 74 61 6b 65 73 | 20 61 20 48 61 6e 64 6c |is takes| a Handl|
|000049e0| 65 20 74 6f 20 6f 75 72 | 20 70 65 72 73 6f 6e 61 |e to our| persona|
|000049f0| 6c 20 49 74 65 6d 20 72 | 65 63 6f 72 64 20 61 6e |l Item r|ecord an|
|00004a00| 64 20 65 69 74 68 65 72 | 20 61 20 0d 20 20 20 70 |d either| a . p|
|00004a10| 72 6f 63 65 64 75 72 65 | 20 6e 61 6d 65 20 6f 72 |rocedure| name or|
|00004a20| 20 61 20 6d 6f 64 69 66 | 69 65 72 20 63 6f 64 65 | a modif|ier code|
|00004a30| 2e 20 20 49 66 20 69 74 | 20 67 6f 74 20 61 20 70 |. If it| got a p|
|00004a40| 72 6f 63 65 64 75 72 65 | 20 6e 61 6d 65 2c 0d 20 |rocedure| name,. |
|00004a50| 20 20 69 74 20 73 65 74 | 73 20 69 74 20 74 6f 20 | it set|s it to |
|00004a60| 74 68 65 20 49 74 65 6d | 27 73 20 70 72 6f 63 65 |the Item|'s proce|
|00004a70| 64 75 72 65 20 74 6f 20 | 72 75 6e 20 77 68 65 6e |dure to |run when|
|00004a80| 20 74 68 65 20 49 74 65 | 6d 20 69 73 20 63 68 6f | the Ite|m is cho|
|00004a90| 73 65 6e 2e 0d 20 20 20 | 49 66 20 69 74 20 67 6f |sen.. |If it go|
|00004aa0| 74 20 61 20 6d 6f 64 69 | 66 69 65 72 20 63 6f 64 |t a modi|fier cod|
|00004ab0| 65 2c 20 69 74 20 63 68 | 61 6e 67 65 73 20 74 68 |e, it ch|anges th|
|00004ac0| 65 20 73 74 61 74 65 20 | 6f 66 20 74 68 65 20 6d |e state |of the m|
|00004ad0| 65 6e 75 27 73 20 49 74 | 65 6d 0d 20 20 20 74 6f |enu's It|em. to|
|00004ae0| 20 63 68 65 63 6b 65 64 | 2c 20 75 6e 63 68 65 63 | checked|, unchec|
|00004af0| 6b 65 64 2c 20 65 6e 61 | 62 6c 65 64 2c 20 6f 72 |ked, ena|bled, or|
|00004b00| 20 64 69 73 61 62 6c 65 | 64 2e 20 20 49 74 20 65 | disable|d. It e|
|00004b10| 73 70 65 63 69 61 6c 6c | 79 20 6b 65 65 70 73 20 |speciall|y keeps |
|00004b20| 0d 20 20 20 74 72 61 63 | 6b 20 6f 66 20 74 68 65 |. trac|k of the|
|00004b30| 20 73 74 61 6e 64 61 72 | 64 20 45 64 69 74 20 6d | standar|d Edit m|
|00004b40| 65 6e 75 20 69 74 65 6d | 73 20 73 6f 20 77 65 20 |enu item|s so we |
|00004b50| 63 61 6e 20 72 65 73 74 | 6f 72 65 20 74 68 65 6d |can rest|ore them|
|00004b60| 20 61 66 74 65 72 0d 20 | 20 20 61 20 64 65 73 6b | after. | a desk|
|00004b70| 20 61 63 63 65 73 73 6f | 72 79 20 69 73 20 66 69 | accesso|ry is fi|
|00004b80| 6e 69 73 68 65 64 2e 0d | 2a 2f 0d 0d 2f 2a 20 4c |nished..|*/../* L|
|00004b90| 6f 63 61 6c 20 70 72 6f | 63 65 64 75 72 65 20 2a |ocal pro|cedure *|
|00004ba0| 2f 0d 0d 73 65 74 69 74 | 65 6d 73 20 28 20 69 74 |/..setit|ems ( it|
|00004bb0| 65 6d 73 2c 20 72 6f 75 | 74 69 6e 65 29 09 2f 2a |ems, rou|tine)./*|
|00004bc0| 20 73 65 74 20 61 20 6d | 65 6e 75 20 49 74 65 6d | set a m|enu Item|
|00004bd0| 27 73 20 72 6f 75 74 69 | 6e 65 20 6f 72 20 64 69 |'s routi|ne or di|
|00004be0| 73 70 6c 61 79 20 2a 2f | 0d 69 74 65 6d 64 61 74 |splay */|.itemdat|
|00004bf0| 75 6d 09 2a 2a 69 74 65 | 6d 73 3b 09 2f 2a 20 69 |um.**ite|ms;./* i|
|00004c00| 66 20 69 74 65 6d 73 20 | 69 73 20 6e 65 67 2c 20 |f items |is neg, |
|00004c10| 74 68 65 6e 20 77 68 6f | 6c 65 20 6d 65 6e 75 20 |then who|le menu |
|00004c20| 09 2a 2f 0d 50 72 6f 63 | 50 74 72 09 72 6f 75 74 |.*/.Proc|Ptr.rout|
|00004c30| 69 6e 65 3b 0d 7b 0d 09 | 69 6e 74 09 09 09 69 6e |ine;.{..|int...in|
|00004c40| 75 6d 62 65 72 3b 0d 09 | 4d 65 6e 75 48 61 6e 64 |umber;..|MenuHand|
|00004c50| 6c 65 09 09 6d 68 61 6e | 64 3b 0d 09 0d 09 2f 2a |le..mhan|d;..../*|
|00004c60| 20 63 68 65 63 6b 20 74 | 6f 20 73 65 65 20 69 66 | check t|o see if|
|00004c70| 20 61 20 70 72 6f 63 65 | 64 75 72 65 20 70 6f 69 | a proce|dure poi|
|00004c80| 6e 74 65 72 20 77 61 73 | 20 67 69 76 65 6e 20 74 |nter was| given t|
|00004c90| 6f 20 75 73 20 2a 2f 0d | 09 69 66 20 28 20 28 28 |o us */.|.if ( ((|
|00004ca0| 28 6c 6f 6e 67 29 69 74 | 65 6d 73 29 3e 30 4c 29 |(long)it|ems)>0L)|
|00004cb0| 20 26 26 20 28 72 6f 75 | 74 69 6e 65 20 3e 20 28 | && (rou|tine > (|
|00004cc0| 50 72 6f 63 50 74 72 29 | 30 78 31 30 30 30 4c 29 |ProcPtr)|0x1000L)|
|00004cd0| 29 20 7b 20 20 0d 09 09 | 09 09 09 09 2f 2a 20 67 |) { ...|..../* g|
|00004ce0| 6f 6f 64 20 70 72 6f 63 | 65 64 75 72 65 20 76 61 |ood proc|edure va|
|00004cf0| 6c 75 65 20 2a 2f 0d 09 | 09 28 2a 2a 69 74 65 6d |lue */..|.(**item|
|00004d00| 73 29 2e 6d 65 6e 75 72 | 75 6e 20 3d 20 72 6f 75 |s).menur|un = rou|
|00004d10| 74 69 6e 65 3b 0d 09 09 | 72 65 74 75 72 6e 3b 0d |tine;...|return;.|
|00004d20| 09 7d 0d 09 0d 09 2f 2a | 20 43 61 6c 63 75 6c 61 |.}..../*| Calcula|
|00004d30| 74 65 20 77 68 69 63 68 | 20 49 74 65 6d 20 6e 75 |te which| Item nu|
|00004d40| 6d 62 65 72 20 77 65 20 | 61 72 65 20 67 6f 69 6e |mber we |are goin|
|00004d50| 67 20 74 6f 20 6d 6f 64 | 69 66 79 20 2a 2f 0d 09 |g to mod|ify */..|
|00004d60| 69 66 20 28 20 28 6c 6f | 6e 67 29 69 74 65 6d 73 |if ( (lo|ng)items|
|00004d70| 20 3c 20 30 4c 29 20 7b | 09 09 2f 2a 20 74 68 65 | < 0L) {|../* the|
|00004d80| 20 77 68 6f 6c 65 20 6d | 65 6e 75 20 09 2a 2f 0d | whole m|enu .*/.|
|00004d90| 09 09 6d 68 61 6e 64 20 | 3d 20 28 4d 65 6e 75 48 |..mhand |= (MenuH|
|00004da0| 61 6e 64 6c 65 29 20 28 | 30 4c 20 2d 20 28 6c 6f |andle) (|0L - (lo|
|00004db0| 6e 67 29 69 74 65 6d 73 | 29 3b 0d 09 09 69 6e 75 |ng)items|);...inu|
|00004dc0| 6d 62 65 72 20 3d 20 30 | 3b 0d 09 7d 20 65 6c 73 |mber = 0|;..} els|
|00004dd0| 65 20 7b 09 09 09 09 2f | 2a 20 6a 75 73 74 20 6f |e {..../|* just o|
|00004de0| 6e 65 20 49 74 65 6d 20 | 09 2a 2f 0d 09 09 6d 68 |ne Item |.*/...mh|
|00004df0| 61 6e 64 20 3d 20 28 2a | 2a 69 74 65 6d 73 29 2e |and = (*|*items).|
|00004e00| 6d 65 6e 75 68 61 6e 64 | 3b 0d 09 09 69 6e 75 6d |menuhand|;...inum|
|00004e10| 62 65 72 20 3d 20 28 2a | 2a 69 74 65 6d 73 29 2e |ber = (*|*items).|
|00004e20| 69 74 65 6d 6e 6f 3b 0d | 09 7d 0d 0d 09 2f 2a 20 |itemno;.|.}.../* |
|00004e30| 49 66 20 61 20 4e 55 4c | 4c 20 70 72 6f 63 65 64 |If a NUL|L proced|
|00004e40| 75 72 65 20 70 6f 69 6e | 74 65 72 2c 20 74 68 65 |ure poin|ter, the|
|00004e50| 6e 20 73 65 74 20 74 6f | 20 61 20 6e 6f 5f 6f 70 |n set to| a no_op|
|00004e60| 20 72 6f 75 74 69 6e 65 | 20 2a 2f 0d 09 69 66 20 | routine| */..if |
|00004e70| 28 20 28 69 6e 75 6d 62 | 65 72 20 3e 20 30 29 20 |( (inumb|er > 0) |
|00004e80| 26 26 20 28 28 2a 2a 69 | 74 65 6d 73 29 2e 6d 65 |&& ((**i|tems).me|
|00004e90| 6e 75 72 75 6e 20 3d 3d | 20 28 50 72 6f 63 50 74 |nurun ==| (ProcPt|
|00004ea0| 72 29 30 4c 29 20 29 0d | 09 09 28 2a 2a 69 74 65 |r)0L) ).|..(**ite|
|00004eb0| 6d 73 29 2e 6d 65 6e 75 | 72 75 6e 20 3d 20 28 50 |ms).menu|run = (P|
|00004ec0| 72 6f 63 50 74 72 29 20 | 73 74 6e 6f 70 3b 0d 0d |rocPtr) |stnop;..|
|00004ed0| 09 2f 2a 20 4e 6f 77 20 | 63 68 61 6e 67 65 20 74 |./* Now |change t|
|00004ee0| 68 65 20 73 74 61 74 65 | 20 6f 66 20 61 20 6d 65 |he state| of a me|
|00004ef0| 6e 75 20 49 74 65 6d 20 | 2a 2f 0d 09 73 77 69 74 |nu Item |*/..swit|
|00004f00| 63 68 20 28 28 69 6e 74 | 29 72 6f 75 74 69 6e 65 |ch ((int|)routine|
|00004f10| 29 20 7b 0d 09 09 63 61 | 73 65 20 69 74 65 6d 64 |) {...ca|se itemd|
|00004f20| 69 73 61 62 6c 65 3a 20 | 0d 09 09 09 44 69 73 61 |isable: |....Disa|
|00004f30| 62 6c 65 49 74 65 6d 28 | 6d 68 61 6e 64 2c 69 6e |bleItem(|mhand,in|
|00004f40| 75 6d 62 65 72 29 3b 20 | 62 72 65 61 6b 3b 0d 09 |umber); |break;..|
|00004f50| 09 63 61 73 65 20 69 74 | 65 6d 65 6e 61 62 6c 65 |.case it|emenable|
|00004f60| 3a 0d 09 09 09 45 6e 61 | 62 6c 65 49 74 65 6d 28 |:....Ena|bleItem(|
|00004f70| 6d 68 61 6e 64 2c 20 69 | 6e 75 6d 62 65 72 29 3b |mhand, i|number);|
|00004f80| 20 62 72 65 61 6b 3b 0d | 09 09 63 61 73 65 20 69 | break;.|..case i|
|00004f90| 74 65 6d 63 68 65 63 6b | 3a 0d 09 09 09 43 68 65 |temcheck|:....Che|
|00004fa0| 63 6b 49 74 65 6d 28 6d | 68 61 6e 64 2c 20 69 6e |ckItem(m|hand, in|
|00004fb0| 75 6d 62 65 72 2c 20 54 | 52 55 45 29 3b 20 62 72 |umber, T|RUE); br|
|00004fc0| 65 61 6b 3b 0d 09 09 63 | 61 73 65 20 69 74 65 6d |eak;...c|ase item|
|00004fd0| 75 6e 63 68 65 63 6b 3a | 0d 09 09 09 43 68 65 63 |uncheck:|....Chec|
|00004fe0| 6b 49 74 65 6d 28 6d 68 | 61 6e 64 2c 20 69 6e 75 |kItem(mh|and, inu|
|00004ff0| 6d 62 65 72 2c 20 46 41 | 4c 53 45 29 3b 20 62 72 |mber, FA|LSE); br|
|00005000| 65 61 6b 3b 0d 09 7d 0d | 09 69 66 20 28 69 6e 75 |eak;..}.|.if (inu|
|00005010| 6d 62 65 72 20 3d 3d 20 | 30 29 20 44 72 61 77 4d |mber == |0) DrawM|
|00005020| 65 6e 75 42 61 72 28 29 | 3b 20 20 2f 2a 20 69 66 |enuBar()|; /* if|
|00005030| 20 6d 61 69 6e 20 6d 65 | 6e 75 20 77 61 73 20 63 | main me|nu was c|
|00005040| 68 61 6e 67 65 64 20 09 | 2a 2f 0d 09 0d 7d 0d 0d |hanged .|*/...}..|
|00005050| 2f 2a 20 54 68 69 73 20 | 72 6f 75 74 69 6e 65 20 |/* This |routine |
|00005060| 69 73 20 63 61 6c 6c 65 | 64 20 62 79 20 74 68 65 |is calle|d by the|
|00005070| 20 73 69 6d 70 6c 65 74 | 6f 6f 6c 73 28 29 20 69 | simplet|ools() i|
|00005080| 6e 69 74 69 61 6c 20 72 | 6f 75 74 69 6e 65 2e 20 |nitial r|outine. |
|00005090| 20 49 74 20 67 65 74 73 | 0d 20 20 20 74 68 65 20 | It gets|. the |
|000050a0| 70 6f 69 6e 74 65 72 20 | 6c 69 73 74 20 6f 66 20 |pointer |list of |
|000050b0| 6d 65 6e 75 73 20 73 74 | 61 72 74 65 64 2c 20 6c |menus st|arted, l|
|000050c0| 6f 61 64 73 20 74 68 65 | 20 64 65 73 6b 20 61 63 |oads the| desk ac|
|000050d0| 63 65 73 73 6f 72 69 65 | 73 20 69 6e 74 6f 0d 20 |cessorie|s into. |
|000050e0| 20 20 74 68 65 20 41 70 | 70 6c 65 20 6d 65 6e 75 | the Ap|ple menu|
|000050f0| 2c 20 61 6e 64 20 6c 6f | 61 64 73 20 75 70 20 73 |, and lo|ads up s|
|00005100| 6f 6d 65 20 73 74 61 6e | 64 61 72 64 20 6d 65 6e |ome stan|dard men|
|00005110| 75 20 65 6e 74 72 69 65 | 73 2e 20 20 54 68 65 20 |u entrie|s. The |
|00005120| 72 65 61 73 6f 6e 0d 20 | 20 20 6d 65 6e 75 20 46 |reason. | menu F|
|00005130| 69 6c 65 20 68 61 73 20 | 61 20 4e 65 77 20 65 6e |ile has |a New en|
|00005140| 74 72 79 2c 20 61 6e 64 | 20 6e 6f 6e 65 20 6f 74 |try, and| none ot|
|00005150| 68 65 72 73 2c 20 69 73 | 20 62 65 63 61 75 73 65 |hers, is| because|
|00005160| 20 61 73 20 74 68 69 73 | 20 63 6f 64 65 0d 20 20 | as this| code. |
|00005170| 20 63 75 72 72 65 6e 74 | 6c 79 20 73 74 61 6e 64 | current|ly stand|
|00005180| 73 2c 20 61 20 6d 65 6e | 75 20 6d 75 73 74 20 68 |s, a men|u must h|
|00005190| 61 76 65 20 61 74 20 6c | 65 61 73 74 20 6f 6e 65 |ave at l|east one|
|000051a0| 20 49 74 65 6d 2e 20 20 | 41 6e 64 20 73 69 6e 63 | Item. |And sinc|
|000051b0| 65 20 77 65 0d 20 20 20 | 77 61 6e 74 20 46 69 6c |e we. |want Fil|
|000051c0| 65 20 62 65 66 6f 72 65 | 20 45 64 69 74 2c 20 49 |e before| Edit, I|
|000051d0| 20 68 61 64 20 74 6f 20 | 6d 61 6b 65 20 61 6e 20 | had to |make an |
|000051e0| 65 6e 74 72 79 2e 20 20 | 54 68 65 20 6d 6f 73 74 |entry. |The most|
|000051f0| 20 63 6f 6d 6d 6f 6e 6c | 79 20 75 73 65 64 0d 20 | commonl|y used. |
|00005200| 20 20 49 74 65 6d 20 75 | 6e 64 65 72 20 46 69 6c | Item u|nder Fil|
|00005210| 65 20 69 73 20 51 75 69 | 74 2e 20 20 42 75 74 20 |e is Qui|t. But |
|00005220| 77 65 20 6c 69 6b 65 20 | 71 75 69 74 20 74 6f 20 |we like |quit to |
|00005230| 62 65 20 61 74 20 74 68 | 65 20 65 6e 64 20 6f 66 |be at th|e end of|
|00005240| 20 74 68 65 20 6c 69 73 | 74 2e 0d 20 20 20 53 6f | the lis|t.. So|
|00005250| 2c 20 73 69 6e 63 65 20 | 4e 65 77 20 69 73 20 75 |, since |New is u|
|00005260| 73 75 61 6c 6c 79 20 61 | 6c 77 61 79 73 20 66 69 |sually a|lways fi|
|00005270| 72 73 74 20 77 68 65 6e | 20 69 74 20 69 73 20 75 |rst when| it is u|
|00005280| 73 65 64 2c 20 74 68 61 | 74 20 74 68 65 20 6f 6e |sed, tha|t the on|
|00005290| 65 0d 20 20 20 63 68 6f | 73 65 6e 20 74 6f 20 73 |e. cho|sen to s|
|000052a0| 74 61 72 74 20 46 69 6c | 65 2e 20 20 0d 2a 2f 0d |tart Fil|e. .*/.|
|000052b0| 0d 2f 2a 20 4c 6f 63 61 | 6c 20 70 72 6f 63 65 64 |./* Loca|l proced|
|000052c0| 75 72 65 20 2a 2f 0d 0d | 69 6e 69 74 73 6d 65 6e |ure */..|initsmen|
|000052d0| 75 73 28 61 62 6f 75 74 | 29 09 09 09 2f 2a 20 69 |us(about|).../* i|
|000052e0| 6e 69 74 20 73 69 6d 70 | 6c 65 74 6f 6f 6c 73 27 |nit simp|letools'|
|000052f0| 20 6d 65 6e 75 73 20 2a | 2f 0d 63 68 61 72 20 2a | menus *|/.char *|
|00005300| 61 62 6f 75 74 3b 0d 7b | 0d 09 69 74 65 6d 64 61 |about;.{|..itemda|
|00005310| 74 75 6d 20 2a 2a 69 74 | 65 6d 73 3b 0d 0d 09 73 |tum **it|ems;...s|
|00005320| 69 6d 70 6c 65 6d 65 6e | 75 73 20 3d 20 28 6d 65 |implemen|us = (me|
|00005330| 6e 75 64 61 74 75 6d 20 | 2a 2a 29 20 4e 65 77 48 |nudatum |**) NewH|
|00005340| 61 6e 64 6c 65 20 28 20 | 28 6c 6f 6e 67 29 73 69 |andle ( |(long)si|
|00005350| 7a 65 6f 66 28 6d 65 6e | 75 64 61 74 75 6d 29 29 |zeof(men|udatum))|
|00005360| 3b 0d 09 48 4c 6f 63 6b | 20 28 73 69 6d 70 6c 65 |;..HLock| (simple|
|00005370| 6d 65 6e 75 73 29 3b 0d | 0d 09 73 74 72 63 70 79 |menus);.|..strcpy|
|00005380| 20 28 20 28 2a 2a 73 69 | 6d 70 6c 65 6d 65 6e 75 | ( (**si|mplemenu|
|00005390| 73 29 2e 6d 65 6e 75 6e | 61 6d 65 2c 20 61 70 70 |s).menun|ame, app|
|000053a0| 6c 65 73 74 72 69 6e 67 | 29 3b 0d 09 28 2a 2a 73 |lestring|);..(**s|
|000053b0| 69 6d 70 6c 65 6d 65 6e | 75 73 29 2e 6d 65 6e 75 |implemen|us).menu|
|000053c0| 49 64 20 3d 20 31 3b 0d | 09 28 2a 2a 73 69 6d 70 |Id = 1;.|.(**simp|
|000053d0| 6c 65 6d 65 6e 75 73 29 | 2e 6e 65 78 74 20 3d 20 |lemenus)|.next = |
|000053e0| 28 50 74 72 29 20 30 4c | 3b 0d 09 63 74 6f 70 20 |(Ptr) 0L|;..ctop |
|000053f0| 28 28 2a 2a 73 69 6d 70 | 6c 65 6d 65 6e 75 73 29 |((**simp|lemenus)|
|00005400| 2e 6d 65 6e 75 6e 61 6d | 65 29 3b 0d 09 28 2a 2a |.menunam|e);..(**|
|00005410| 73 69 6d 70 6c 65 6d 65 | 6e 75 73 29 2e 6d 65 6e |simpleme|nus).men|
|00005420| 75 68 61 6e 64 20 3d 20 | 4e 65 77 4d 65 6e 75 20 |uhand = |NewMenu |
|00005430| 28 31 2c 20 28 2a 2a 73 | 69 6d 70 6c 65 6d 65 6e |(1, (**s|implemen|
|00005440| 75 73 29 2e 6d 65 6e 75 | 6e 61 6d 65 29 3b 0d 09 |us).menu|name);..|
|00005450| 70 74 6f 63 20 28 28 2a | 2a 73 69 6d 70 6c 65 6d |ptoc ((*|*simplem|
|00005460| 65 6e 75 73 29 2e 6d 65 | 6e 75 6e 61 6d 65 29 3b |enus).me|nuname);|
|00005470| 0d 09 48 55 6e 6c 6f 63 | 6b 20 28 28 2a 2a 73 69 |..HUnloc|k ((**si|
|00005480| 6d 70 6c 65 6d 65 6e 75 | 73 29 2e 6d 65 6e 75 68 |mplemenu|s).menuh|
|00005490| 61 6e 64 29 3b 0d 0d 09 | 28 2a 2a 73 69 6d 70 6c |and);...|(**simpl|
|000054a0| 65 6d 65 6e 75 73 29 2e | 69 74 65 6d 6c 69 73 74 |emenus).|itemlist|
|000054b0| 20 3d 20 28 69 74 65 6d | 64 61 74 75 6d 20 2a 2a | = (item|datum **|
|000054c0| 29 4e 65 77 48 61 6e 64 | 6c 65 20 28 20 0d 09 09 |)NewHand|le ( ...|
|000054d0| 09 28 6c 6f 6e 67 29 73 | 69 7a 65 6f 66 28 69 74 |.(long)s|izeof(it|
|000054e0| 65 6d 64 61 74 75 6d 29 | 29 3b 0d 09 69 74 65 6d |emdatum)|);..item|
|000054f0| 73 20 3d 20 28 69 74 65 | 6d 64 61 74 75 6d 20 2a |s = (ite|mdatum *|
|00005500| 2a 29 20 28 2a 2a 73 69 | 6d 70 6c 65 6d 65 6e 75 |*) (**si|mplemenu|
|00005510| 73 29 2e 69 74 65 6d 6c | 69 73 74 3b 0d 09 48 4c |s).iteml|ist;..HL|
|00005520| 6f 63 6b 20 28 69 74 65 | 6d 73 29 3b 0d 20 0d 09 |ock (ite|ms);. ..|
|00005530| 73 74 72 63 70 79 20 28 | 28 2a 2a 69 74 65 6d 73 |strcpy (|(**items|
|00005540| 29 2e 69 74 65 6d 6e 61 | 6d 65 2c 20 61 62 6f 75 |).itemna|me, abou|
|00005550| 74 29 3b 0d 09 28 2a 2a | 69 74 65 6d 73 29 2e 69 |t);..(**|items).i|
|00005560| 74 65 6d 6e 6f 20 3d 20 | 31 3b 0d 09 28 2a 2a 69 |temno = |1;..(**i|
|00005570| 74 65 6d 73 29 2e 6d 65 | 6e 75 49 64 20 3d 20 31 |tems).me|nuId = 1|
|00005580| 3b 0d 09 28 2a 2a 69 74 | 65 6d 73 29 2e 6d 65 6e |;..(**it|ems).men|
|00005590| 75 68 61 6e 64 20 3d 20 | 28 2a 2a 73 69 6d 70 6c |uhand = |(**simpl|
|000055a0| 65 6d 65 6e 75 73 29 2e | 6d 65 6e 75 68 61 6e 64 |emenus).|menuhand|
|000055b0| 3b 0d 09 28 2a 2a 69 74 | 65 6d 73 29 2e 6d 65 6e |;..(**it|ems).men|
|000055c0| 75 72 75 6e 20 3d 20 28 | 50 72 6f 63 50 74 72 29 |urun = (|ProcPtr)|
|000055d0| 20 73 74 6e 6f 70 3b 0d | 09 28 2a 2a 69 74 65 6d | stnop;.|.(**item|
|000055e0| 73 29 2e 6e 65 78 74 20 | 3d 20 30 4c 3b 0d 09 48 |s).next |= 0L;..H|
|000055f0| 55 6e 6c 6f 63 6b 20 28 | 69 74 65 6d 73 29 3b 0d |Unlock (|items);.|
|00005600| 0d 09 63 74 6f 70 20 28 | 61 62 6f 75 74 29 3b 0d |..ctop (|about);.|
|00005610| 09 41 70 70 65 6e 64 4d | 65 6e 75 20 28 28 2a 2a |.AppendM|enu ((**|
|00005620| 73 69 6d 70 6c 65 6d 65 | 6e 75 73 29 2e 6d 65 6e |simpleme|nus).men|
|00005630| 75 68 61 6e 64 2c 20 61 | 62 6f 75 74 29 3b 0d 09 |uhand, a|bout);..|
|00005640| 70 74 6f 63 20 28 61 62 | 6f 75 74 29 3b 0d 09 44 |ptoc (ab|out);..D|
|00005650| 69 73 61 62 6c 65 49 74 | 65 6d 20 28 28 2a 2a 73 |isableIt|em ((**s|
|00005660| 69 6d 70 6c 65 6d 65 6e | 75 73 29 2e 6d 65 6e 75 |implemen|us).menu|
|00005670| 68 61 6e 64 2c 20 31 29 | 3b 0d 09 6d 65 6e 75 20 |hand, 1)|;..menu |
|00005680| 28 61 70 70 6c 65 73 74 | 72 69 6e 67 2c 20 22 2d |(applest|ring, "-|
|00005690| 22 2c 20 28 50 72 6f 63 | 50 74 72 29 20 69 74 65 |", (Proc|Ptr) ite|
|000056a0| 6d 64 69 73 61 62 6c 65 | 29 3b 0d 09 23 69 66 64 |mdisable|);..#ifd|
|000056b0| 65 66 20 4d 45 47 41 4d | 41 58 0d 09 20 20 41 64 |ef MEGAM|AX.. Ad|
|000056c0| 64 52 65 73 4d 65 6e 75 | 20 28 28 2a 2a 73 69 6d |dResMenu| ((**sim|
|000056d0| 70 6c 65 6d 65 6e 75 73 | 29 2e 6d 65 6e 75 68 61 |plemenus|).menuha|
|000056e0| 6e 64 2c 20 22 44 52 56 | 52 22 29 3b 0d 09 23 65 |nd, "DRV|R");..#e|
|000056f0| 6c 73 65 0d 09 20 20 41 | 64 64 52 65 73 4d 65 6e |lse.. A|ddResMen|
|00005700| 75 20 28 28 2a 2a 73 69 | 6d 70 6c 65 6d 65 6e 75 |u ((**si|mplemenu|
|00005710| 73 29 2e 6d 65 6e 75 68 | 61 6e 64 2c 20 27 44 52 |s).menuh|and, 'DR|
|00005720| 56 52 27 29 3b 0d 09 23 | 65 6e 64 69 66 0d 09 49 |VR');..#|endif..I|
|00005730| 6e 73 65 72 74 4d 65 6e | 75 20 28 28 2a 2a 73 69 |nsertMen|u ((**si|
|00005740| 6d 70 6c 65 6d 65 6e 75 | 73 29 2e 6d 65 6e 75 68 |mplemenu|s).menuh|
|00005750| 61 6e 64 2c 20 30 29 3b | 0d 09 48 55 6e 6c 6f 63 |and, 0);|..HUnloc|
|00005760| 6b 20 28 73 69 6d 70 6c | 65 6d 65 6e 75 73 29 3b |k (simpl|emenus);|
|00005770| 0d 0d 09 6d 65 6e 75 20 | 28 22 46 69 6c 65 22 2c |...menu |("File",|
|00005780| 20 22 4e 65 77 22 2c 20 | 28 50 72 6f 63 50 74 72 | "New", |(ProcPtr|
|00005790| 29 69 74 65 6d 64 69 73 | 61 62 6c 65 29 3b 0d 09 |)itemdis|able);..|
|000057a0| 6d 65 6e 75 20 28 22 45 | 64 69 74 22 2c 20 22 55 |menu ("E|dit", "U|
|000057b0| 6e 64 6f 22 2c 20 73 74 | 6e 6f 70 29 3b 0d 09 6d |ndo", st|nop);..m|
|000057c0| 65 6e 75 20 28 22 45 64 | 69 74 22 2c 20 22 2d 22 |enu ("Ed|it", "-"|
|000057d0| 2c 20 28 50 72 6f 63 50 | 74 72 29 69 74 65 6d 64 |, (ProcP|tr)itemd|
|000057e0| 69 73 61 62 6c 65 29 3b | 0d 09 6d 65 6e 75 20 28 |isable);|..menu (|
|000057f0| 22 45 64 69 74 22 2c 20 | 22 43 75 74 2f 58 22 2c |"Edit", |"Cut/X",|
|00005800| 20 73 74 6e 6f 70 29 3b | 0d 09 6d 65 6e 75 20 28 | stnop);|..menu (|
|00005810| 22 45 64 69 74 22 2c 20 | 22 43 6f 70 79 2f 43 22 |"Edit", |"Copy/C"|
|00005820| 2c 20 73 74 6e 6f 70 29 | 3b 0d 09 6d 65 6e 75 20 |, stnop)|;..menu |
|00005830| 28 22 45 64 69 74 22 2c | 20 22 50 61 73 74 65 2f |("Edit",| "Paste/|
|00005840| 56 22 2c 20 73 74 6e 6f | 70 29 3b 0d 09 6d 65 6e |V", stno|p);..men|
|00005850| 75 20 28 22 45 64 69 74 | 22 2c 20 22 43 6c 65 61 |u ("Edit|", "Clea|
|00005860| 72 22 2c 20 73 74 6e 6f | 70 29 3b 0d 7d 0d 0d 2f |r", stno|p);.}../|
|00005870| 2a 20 4c 6f 63 61 6c 20 | 70 72 6f 63 65 64 75 72 |* Local |procedur|
|00005880| 65 20 2a 2f 0d 0d 23 69 | 66 6e 64 65 66 20 4c 49 |e */..#i|fndef LI|
|00005890| 47 48 54 53 50 45 45 44 | 0d 67 6f 74 74 72 61 6e |GHTSPEED|.gottran|
|000058a0| 73 20 28 29 20 0d 7b 0d | 20 20 63 68 61 72 20 70 |s () .{.| char p|
|000058b0| 72 6f 67 5b 38 30 5d 3b | 0d 20 20 63 68 61 72 20 |rog[80];|. char |
|000058c0| 2a 61 72 67 76 5b 33 5d | 3b 0d 20 20 69 66 20 28 |*argv[3]|;. if (|
|000058d0| 20 67 65 74 66 69 6c 65 | 28 22 41 50 50 4c 22 2c | getfile|("APPL",|
|000058e0| 20 70 72 6f 67 29 20 29 | 20 7b 0d 20 20 20 20 61 | prog) )| {. a|
|000058f0| 72 67 76 5b 31 5d 20 3d | 20 4e 55 4c 4c 3b 0d 20 |rgv[1] =| NULL;. |
|00005900| 20 20 20 65 78 65 63 76 | 20 28 70 72 6f 67 2c 20 | execv| (prog, |
|00005910| 61 72 67 76 29 3b 0d 20 | 20 7d 0d 7d 0d 23 65 6e |argv);. | }.}.#en|
|00005920| 64 69 66 0d 0d 2f 2a 20 | 4c 6f 63 61 6c 20 70 72 |dif../* |Local pr|
|00005930| 6f 63 65 64 75 72 65 20 | 2a 2f 0d 0d 67 6f 74 71 |ocedure |*/..gotq|
|00005940| 75 69 74 20 28 29 0d 7b | 0d 20 20 45 78 69 74 54 |uit ().{|. ExitT|
|00005950| 6f 53 68 65 6c 6c 28 29 | 3b 0d 7d 0d 0d 2f 2a 20 |oShell()|;.}../* |
|00005960| 54 68 69 73 20 72 6f 75 | 74 69 6e 65 20 69 73 20 |This rou|tine is |
|00005970| 66 6f 72 20 74 68 65 20 | 57 69 6e 64 6f 77 73 20 |for the |Windows |
|00005980| 6d 65 6e 75 20 49 74 65 | 6d 2e 20 20 54 68 65 20 |menu Ite|m. The |
|00005990| 57 69 6e 64 6f 77 73 20 | 6d 65 6e 75 20 69 73 0d |Windows |menu is.|
|000059a0| 20 20 20 73 65 74 20 75 | 70 20 77 68 65 6e 20 6e | set u|p when n|
|000059b0| 65 77 20 77 69 6e 64 6f | 77 73 20 61 72 65 20 61 |ew windo|ws are a|
|000059c0| 64 64 65 64 2e 20 20 49 | 74 20 69 73 20 75 73 65 |dded. I|t is use|
|000059d0| 64 20 74 6f 20 62 72 69 | 6e 67 20 66 6f 72 77 61 |d to bri|ng forwa|
|000059e0| 72 64 20 61 6e 64 0d 20 | 20 20 62 72 69 6e 67 20 |rd and. | bring |
|000059f0| 69 6e 74 6f 20 76 69 65 | 77 20 77 69 6e 64 6f 77 |into vie|w window|
|00005a00| 73 20 74 68 61 74 20 6d | 61 79 20 62 65 20 75 6e |s that m|ay be un|
|00005a10| 64 65 72 20 6f 74 68 65 | 72 20 77 69 6e 64 6f 77 |der othe|r window|
|00005a20| 73 20 6f 72 20 68 61 76 | 65 20 62 65 65 6e 0d 20 |s or hav|e been. |
|00005a30| 20 20 73 65 6e 74 20 68 | 69 64 69 6e 67 20 62 79 | sent h|iding by|
|00005a40| 20 61 20 63 6c 69 63 6b | 20 6f 6e 20 74 68 65 69 | a click| on thei|
|00005a50| 72 20 63 6c 6f 73 65 20 | 62 6f 78 2e 0d 2a 2f 0d |r close |box..*/.|
|00005a60| 0d 2f 2a 20 4c 6f 63 61 | 6c 20 70 72 6f 63 65 64 |./* Loca|l proced|
|00005a70| 75 72 65 20 2a 2f 0d 0d | 73 68 6f 77 61 77 69 6e |ure */..|showawin|
|00005a80| 64 6f 77 28 6e 61 6d 65 | 29 09 09 09 2f 2a 20 73 |dow(name|).../* s|
|00005a90| 68 6f 77 20 74 68 65 20 | 6e 61 6d 65 64 20 77 69 |how the |named wi|
|00005aa0| 6e 64 6f 77 09 2a 2f 0d | 63 68 61 72 20 2a 6e 61 |ndow.*/.|char *na|
|00005ab0| 6d 65 3b 0d 7b 0d 09 57 | 69 6e 64 6f 77 50 74 72 |me;.{..W|indowPtr|
|00005ac0| 20 66 6f 6f 3b 0d 09 66 | 6f 6f 20 3d 20 77 69 6e | foo;..f|oo = win|
|00005ad0| 64 6f 77 70 6f 69 6e 74 | 28 6e 61 6d 65 29 3b 09 |dowpoint|(name);.|
|00005ae0| 2f 2a 20 67 65 74 20 69 | 74 73 20 77 69 6e 64 6f |/* get i|ts windo|
|00005af0| 77 20 70 6f 69 6e 74 65 | 72 09 2a 2f 0d 09 69 66 |w pointe|r.*/..if|
|00005b00| 20 28 20 66 6f 6f 20 29 | 20 7b 0d 09 09 53 68 6f | ( foo )| {...Sho|
|00005b10| 77 57 69 6e 64 6f 77 28 | 66 6f 6f 29 3b 09 2f 2a |wWindow(|foo);./*|
|00005b20| 20 73 68 6f 77 20 69 74 | 20 6f 6e 20 74 68 65 20 | show it| on the |
|00005b30| 73 63 72 65 65 6e 09 2a | 2f 0d 09 09 53 65 74 50 |screen.*|/...SetP|
|00005b40| 6f 72 74 20 28 66 6f 6f | 29 3b 09 09 2f 2a 20 73 |ort (foo|);../* s|
|00005b50| 65 74 20 66 75 72 74 68 | 65 72 20 6f 75 74 70 75 |et furth|er outpu|
|00005b60| 74 20 74 6f 20 69 74 20 | 2a 2f 0d 09 09 69 66 20 |t to it |*/...if |
|00005b70| 28 20 66 6f 6f 20 21 3d | 20 46 72 6f 6e 74 57 69 |( foo !=| FrontWi|
|00005b80| 6e 64 6f 77 28 29 29 09 | 2f 2a 20 69 66 20 69 74 |ndow()).|/* if it|
|00005b90| 20 69 73 6e 27 74 20 61 | 63 74 69 76 65 2c 09 2a | isn't a|ctive,.*|
|00005ba0| 2f 0d 09 09 09 53 65 6c | 65 63 74 57 69 6e 64 6f |/....Sel|ectWindo|
|00005bb0| 77 20 28 66 6f 6f 29 3b | 09 2f 2a 20 61 63 74 69 |w (foo);|./* acti|
|00005bc0| 76 61 74 65 20 69 74 20 | 09 09 2a 2f 0d 09 7d 0d |vate it |..*/..}.|
|00005bd0| 7d 0d 0d 2f 2a 20 4c 6f | 63 61 6c 20 70 72 6f 63 |}../* Lo|cal proc|
|00005be0| 65 64 75 72 65 20 2a 2f | 0d 0d 77 69 6e 64 64 61 |edure */|..windda|
|00005bf0| 74 75 6d 20 2a 2a 77 64 | 61 74 75 6d 28 77 69 6e |tum **wd|atum(win|
|00005c00| 64 70 74 29 09 09 2f 2a | 20 72 65 74 75 72 6e 20 |dpt)../*| return |
|00005c10| 48 61 6e 64 6c 65 20 74 | 6f 20 77 69 6e 64 6f 77 |Handle t|o window|
|00005c20| 20 64 61 74 61 20 2a 2f | 0d 57 69 6e 64 6f 77 50 | data */|.WindowP|
|00005c30| 74 72 20 77 69 6e 64 70 | 74 3b 0d 7b 0d 09 77 69 |tr windp|t;.{..wi|
|00005c40| 6e 64 64 61 74 75 6d 20 | 2a 2a 77 69 6e 64 2c 20 |nddatum |**wind, |
|00005c50| 2a 2a 74 65 6d 70 3b 0d | 0d 09 69 66 20 28 66 69 |**temp;.|..if (fi|
|00005c60| 72 73 74 77 69 6e 64 29 | 20 72 65 74 75 72 6e 20 |rstwind)| return |
|00005c70| 28 28 77 69 6e 64 64 61 | 74 75 6d 20 2a 2a 29 20 |((windda|tum **) |
|00005c80| 30 4c 29 3b 0d 09 77 69 | 6e 64 20 3d 20 73 69 6d |0L);..wi|nd = sim|
|00005c90| 70 6c 65 77 69 6e 64 73 | 3b 0d 09 48 4c 6f 63 6b |plewinds|;..HLock|
|00005ca0| 20 28 77 69 6e 64 29 3b | 0d 0d 09 77 68 69 6c 65 | (wind);|...while|
|00005cb0| 20 28 20 28 28 2a 2a 77 | 69 6e 64 29 2e 77 70 74 | ( ((**w|ind).wpt|
|00005cc0| 72 20 21 3d 20 77 69 6e | 64 70 74 29 20 26 26 20 |r != win|dpt) && |
|00005cd0| 28 2a 2a 77 69 6e 64 29 | 2e 6e 65 78 74 29 20 7b |(**wind)|.next) {|
|00005ce0| 0d 09 09 74 65 6d 70 20 | 3d 20 77 69 6e 64 3b 0d |...temp |= wind;.|
|00005cf0| 09 09 77 69 6e 64 20 3d | 20 28 77 69 6e 64 64 61 |..wind =| (windda|
|00005d00| 74 75 6d 20 2a 2a 29 20 | 28 2a 2a 77 69 6e 64 29 |tum **) |(**wind)|
|00005d10| 2e 6e 65 78 74 3b 0d 09 | 09 48 55 6e 6c 6f 63 6b |.next;..|.HUnlock|
|00005d20| 20 28 74 65 6d 70 29 3b | 0d 09 09 48 4c 6f 63 6b | (temp);|...HLock|
|00005d30| 20 28 77 69 6e 64 29 3b | 0d 09 7d 0d 0d 09 69 66 | (wind);|..}...if|
|00005d40| 20 28 20 28 2a 2a 77 69 | 6e 64 29 2e 77 70 74 72 | ( (**wi|nd).wptr|
|00005d50| 20 3d 3d 20 77 69 6e 64 | 70 74 29 20 7b 0d 09 09 | == wind|pt) {...|
|00005d60| 48 55 6e 6c 6f 63 6b 20 | 28 77 69 6e 64 29 3b 0d |HUnlock |(wind);.|
|00005d70| 09 09 72 65 74 75 72 6e | 20 28 77 69 6e 64 29 3b |..return| (wind);|
|00005d80| 0d 09 7d 20 65 6c 73 65 | 20 7b 0d 09 09 48 55 6e |..} else| {...HUn|
|00005d90| 6c 6f 63 6b 20 28 77 69 | 6e 64 29 3b 0d 09 09 72 |lock (wi|nd);...r|
|00005da0| 65 74 75 72 6e 20 28 28 | 77 69 6e 64 64 61 74 75 |eturn ((|winddatu|
|00005db0| 6d 20 2a 2a 29 20 30 4c | 29 3b 09 2f 2a 20 7a 65 |m **) 0L|);./* ze|
|00005dc0| 72 6f 20 69 66 20 6e 6f | 74 20 66 6f 75 6e 64 20 |ro if no|t found |
|00005dd0| 2a 2f 0d 09 7d 0d 7d 0d | 20 20 0d 2f 2a 20 4c 6f |*/..}.}.| ./* Lo|
|00005de0| 63 61 6c 20 70 72 6f 63 | 65 64 75 72 65 20 2a 2f |cal proc|edure */|
|00005df0| 0d 0d 72 75 6e 72 75 6e | 73 28 65 76 65 6e 74 29 |..runrun|s(event)|
|00005e00| 09 09 09 2f 2a 20 72 75 | 6e 20 61 6c 6c 20 74 68 |.../* ru|n all th|
|00005e10| 65 20 69 6e 73 74 61 6c | 6c 65 64 20 72 75 6e 20 |e instal|led run |
|00005e20| 70 72 6f 63 65 64 75 72 | 65 73 09 2a 2f 0d 45 76 |procedur|es.*/.Ev|
|00005e30| 65 6e 74 52 65 63 6f 72 | 64 20 2a 65 76 65 6e 74 |entRecor|d *event|
|00005e40| 3b 09 09 2f 2a 20 72 65 | 74 75 72 6e 73 20 6e 75 |;../* re|turns nu|
|00005e50| 6d 62 65 72 20 6f 66 20 | 72 6f 75 74 69 6e 65 73 |mber of |routines|
|00005e60| 20 72 75 6e 20 09 2a 2f | 0d 7b 0d 09 69 6e 74 20 | run .*/|.{..int |
|00005e70| 69 3d 30 3b 0d 09 57 69 | 6e 64 6f 77 50 74 72 20 |i=0;..Wi|ndowPtr |
|00005e80| 73 61 76 65 70 6f 72 74 | 3b 0d 09 47 65 74 50 6f |saveport|;..GetPo|
|00005e90| 72 74 20 28 26 73 61 76 | 65 70 6f 72 74 29 3b 0d |rt (&sav|eport);.|
|00005ea0| 09 77 68 69 6c 65 20 28 | 20 73 69 6d 70 6c 65 72 |.while (| simpler|
|00005eb0| 75 6e 73 5b 69 5d 20 29 | 0d 09 09 28 2a 28 73 69 |uns[i] )|...(*(si|
|00005ec0| 6d 70 6c 65 72 75 6e 73 | 5b 69 2b 2b 5d 29 29 20 |mpleruns|[i++])) |
|00005ed0| 28 65 76 65 6e 74 29 3b | 0d 09 53 65 74 50 6f 72 |(event);|..SetPor|
|00005ee0| 74 20 28 73 61 76 65 70 | 6f 72 74 29 3b 0d 09 72 |t (savep|ort);..r|
|00005ef0| 65 74 75 72 6e 28 69 29 | 3b 0d 7d 0d 0d 2f 2a 20 |eturn(i)|;.}../* |
|00005f00| 4c 6f 63 61 6c 20 70 72 | 6f 63 65 64 75 72 65 20 |Local pr|ocedure |
|00005f10| 2a 2f 0d 0d 73 74 64 69 | 61 6c 6f 67 28 20 71 75 |*/..stdi|alog( qu|
|00005f20| 65 73 74 69 6f 6e 2c 20 | 61 6e 73 77 65 72 2c 20 |estion, |answer, |
|00005f30| 74 79 70 65 29 20 20 2f | 2a 20 61 20 67 65 6e 65 |type) /|* a gene|
|00005f40| 72 61 6c 20 64 69 61 6c | 6f 67 20 64 69 73 70 6c |ral dial|og displ|
|00005f50| 61 79 65 72 20 09 2a 2f | 0d 63 68 61 72 20 2a 71 |ayer .*/|.char *q|
|00005f60| 75 65 73 74 69 6f 6e 3b | 0d 63 68 61 72 20 2a 61 |uestion;|.char *a|
|00005f70| 6e 73 77 65 72 3b 0d 69 | 6e 74 20 20 74 79 70 65 |nswer;.i|nt type|
|00005f80| 3b 09 09 09 2f 2a 20 74 | 79 70 65 3a 20 20 31 3d |;.../* t|ype: 1=|
|00005f90| 70 72 6f 6d 70 74 2c 20 | 32 3d 6d 65 73 73 61 67 |prompt, |2=messag|
|00005fa0| 65 20 09 09 2a 2f 0d 7b | 0d 09 44 69 61 6c 6f 67 |e ..*/.{|..Dialog|
|00005fb0| 50 74 72 20 64 69 61 6c | 6f 67 3b 09 2f 2a 20 64 |Ptr dial|og;./* d|
|00005fc0| 69 61 6c 6f 67 20 72 65 | 66 65 72 65 6e 63 65 20 |ialog re|ference |
|00005fd0| 09 09 09 2a 2f 0d 09 48 | 61 6e 64 6c 65 20 49 74 |...*/..H|andle It|
|00005fe0| 65 6d 2c 20 69 74 65 6d | 73 3b 09 2f 2a 20 68 61 |em, item|s;./* ha|
|00005ff0| 6e 64 6c 65 73 20 66 6f | 72 20 74 68 65 20 64 69 |ndles fo|r the di|
|00006000| 61 6c 6f 67 20 69 74 65 | 6d 73 20 09 2a 2f 0d 09 |alog ite|ms .*/..|
|00006010| 52 65 63 74 20 73 63 72 | 65 65 6e 2c 20 62 6f 78 |Rect scr|een, box|
|00006020| 3b 09 2f 2a 20 72 65 63 | 74 61 6e 67 6c 65 73 20 |;./* rec|tangles |
|00006030| 66 6f 72 20 64 69 61 6c | 6f 67 2f 69 74 65 6d 73 |for dial|og/items|
|00006040| 20 09 09 2a 2f 0d 09 69 | 6e 74 20 64 74 79 70 65 | ..*/..i|nt dtype|
|00006050| 2c 20 68 69 74 2c 20 63 | 61 6e 63 3b 09 2f 2a 20 |, hit, c|anc;./* |
|00006060| 49 74 65 6d 20 74 79 70 | 65 20 61 6e 64 20 77 68 |Item typ|e and wh|
|00006070| 69 63 68 20 77 61 73 20 | 68 69 74 20 09 09 2a 2f |ich was |hit ..*/|
|00006080| 0d 09 63 68 61 72 20 74 | 65 6d 70 61 6e 73 77 65 |..char t|empanswe|
|00006090| 72 5b 32 35 35 5d 3b 09 | 2f 2a 20 61 64 64 72 65 |r[255];.|/* addre|
|000060a0| 73 73 20 77 68 65 72 65 | 20 61 6e 73 77 65 72 20 |ss where| answer |
|000060b0| 69 73 20 09 09 2a 2f 0d | 0d 09 69 74 65 6d 73 20 |is ..*/.|..items |
|000060c0| 3d 20 4e 65 77 48 61 6e | 64 6c 65 20 28 35 31 32 |= NewHan|dle (512|
|000060d0| 4c 29 3b 2f 2a 20 67 65 | 74 20 6d 65 6d 6f 72 79 |L);/* ge|t memory|
|000060e0| 20 66 6f 72 20 69 74 65 | 6d 73 20 6c 69 73 74 20 | for ite|ms list |
|000060f0| 09 09 2a 2f 0d 09 48 4c | 6f 63 6b 20 28 69 74 65 |..*/..HL|ock (ite|
|00006100| 6d 73 29 3b 09 09 2f 2a | 20 6c 6f 63 6b 20 69 74 |ms);../*| lock it|
|00006110| 20 64 6f 77 6e 20 09 09 | 09 2a 2f 0d 09 69 66 20 | down ..|.*/..if |
|00006120| 28 74 79 70 65 20 3d 3d | 20 31 29 0d 09 09 42 6c |(type ==| 1)...Bl|
|00006130| 6f 63 6b 4d 6f 76 65 20 | 28 71 75 65 73 64 2c 20 |ockMove |(quesd, |
|00006140| 2a 69 74 65 6d 73 2c 20 | 28 6c 6f 6e 67 29 20 51 |*items, |(long) Q|
|00006150| 55 45 53 4e 20 2a 20 32 | 4c 29 3b 20 0d 09 65 6c |UESN * 2|L); ..el|
|00006160| 73 65 0d 09 09 42 6c 6f | 63 6b 4d 6f 76 65 20 28 |se...Blo|ckMove (|
|00006170| 6d 65 73 73 64 2c 20 2a | 69 74 65 6d 73 2c 20 28 |messd, *|items, (|
|00006180| 6c 6f 6e 67 29 20 4d 45 | 53 53 4e 20 2a 20 32 4c |long) ME|SSN * 2L|
|00006190| 29 3b 0d 09 53 65 74 52 | 65 63 74 20 28 26 73 63 |);..SetR|ect (&sc|
|000061a0| 72 65 65 6e 2c 20 31 30 | 33 2c 20 35 30 2c 20 34 |reen, 10|3, 50, 4|
|000061b0| 30 39 2c 20 31 33 37 29 | 3b 09 09 0d 09 0d 09 2f |09, 137)|;....../|
|000061c0| 2a 20 46 6f 72 20 4c 49 | 47 48 54 53 50 45 45 44 |* For LI|GHTSPEED|
|000061d0| 2c 20 75 73 65 20 61 20 | 6c 6f 77 65 72 20 63 61 |, use a |lower ca|
|000061e0| 73 65 20 64 20 61 6e 64 | 20 75 70 70 65 72 20 63 |se d and| upper c|
|000061f0| 61 73 65 20 42 20 61 6e | 64 20 50 09 2a 2f 0d 09 |ase B an|d P.*/..|
|00006200| 2f 2a 20 66 6f 72 20 44 | 42 6f 78 50 72 6f 63 2e |/* for D|BoxProc.|
|00006210| 20 20 4d 65 67 61 6d 61 | 78 20 63 6f 6e 76 65 72 | Megama|x conver|
|00006220| 73 69 6f 6e 20 75 74 69 | 6c 69 74 79 20 64 6f 65 |sion uti|lity doe|
|00006230| 73 20 74 68 69 73 20 77 | 72 6f 6e 67 2e 09 2a 2f |s this w|rong..*/|
|00006240| 0d 09 0d 09 64 69 61 6c | 6f 67 20 3d 20 4e 65 77 |....dial|og = New|
|00006250| 44 69 61 6c 6f 67 20 28 | 30 4c 2c 20 26 73 63 72 |Dialog (|0L, &scr|
|00006260| 65 65 6e 2c 20 22 22 2c | 20 30 2c 20 64 42 6f 78 |een, "",| 0, dBox|
|00006270| 50 72 6f 63 2c 20 2d 31 | 4c 2c 20 30 2c 20 30 4c |Proc, -1|L, 0, 0L|
|00006280| 2c 20 69 74 65 6d 73 29 | 3b 0d 09 47 65 74 44 49 |, items)|;..GetDI|
|00006290| 74 65 6d 20 28 64 69 61 | 6c 6f 67 2c 20 32 2c 20 |tem (dia|log, 2, |
|000062a0| 26 64 74 79 70 65 2c 20 | 26 49 74 65 6d 2c 20 26 |&dtype, |&Item, &|
|000062b0| 62 6f 78 29 3b 0d 09 63 | 74 6f 70 20 28 71 75 65 |box);..c|top (que|
|000062c0| 73 74 69 6f 6e 29 3b 09 | 0d 09 53 65 74 49 54 65 |stion);.|..SetITe|
|000062d0| 78 74 20 28 49 74 65 6d | 2c 20 71 75 65 73 74 69 |xt (Item|, questi|
|000062e0| 6f 6e 29 3b 09 09 2f 2a | 20 73 65 74 20 49 74 65 |on);../*| set Ite|
|000062f0| 6d 23 32 20 74 65 78 74 | 20 09 2a 2f 0d 09 70 74 |m#2 text| .*/..pt|
|00006300| 6f 63 20 28 71 75 65 73 | 74 69 6f 6e 29 3b 0d 09 |oc (ques|tion);..|
|00006310| 69 66 20 28 74 79 70 65 | 20 3d 3d 20 31 29 20 7b |if (type| == 1) {|
|00006320| 09 09 09 2f 2a 20 73 65 | 74 20 64 65 66 61 75 6c |.../* se|t defaul|
|00006330| 74 20 61 6e 73 77 65 72 | 09 2a 2f 0d 09 09 47 65 |t answer|.*/...Ge|
|00006340| 74 44 49 74 65 6d 20 28 | 64 69 61 6c 6f 67 2c 20 |tDItem (|dialog, |
|00006350| 33 2c 20 26 64 74 79 70 | 65 2c 20 26 49 74 65 6d |3, &dtyp|e, &Item|
|00006360| 2c 20 26 62 6f 78 29 3b | 0d 09 09 63 74 6f 70 20 |, &box);|...ctop |
|00006370| 28 61 6e 73 77 65 72 29 | 3b 0d 09 09 53 65 74 49 |(answer)|;...SetI|
|00006380| 54 65 78 74 20 28 49 74 | 65 6d 2c 20 61 6e 73 77 |Text (It|em, answ|
|00006390| 65 72 29 3b 0d 09 09 70 | 74 6f 63 20 28 61 6e 73 |er);...p|toc (ans|
|000063a0| 77 65 72 29 3b 0d 09 09 | 63 61 6e 63 20 3d 20 34 |wer);...|canc = 4|
|000063b0| 3b 0d 09 7d 20 65 6c 73 | 65 0d 09 09 63 61 6e 63 |;..} els|e...canc|
|000063c0| 20 3d 20 33 3b 0d 09 53 | 68 6f 77 57 69 6e 64 6f | = 3;..S|howWindo|
|000063d0| 77 20 28 64 69 61 6c 6f | 67 29 3b 09 09 09 2f 2a |w (dialo|g);.../*|
|000063e0| 20 64 69 73 70 6c 61 79 | 20 74 68 65 20 64 69 61 | display| the dia|
|000063f0| 6c 6f 67 09 2a 2f 0d 09 | 64 6f 20 7b 0d 09 09 4d |log.*/..|do {...M|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.