home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1992-04-08 | 12.9 KB | [TEXT/KAHL] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
1%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Wed Apr 8 17:59:22 1992, modified Wed Apr 8 17:59:22 1992, creator Think C, type ASCII, 12530 bytes "Windows.c" , at 0x3172 462 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| dearkID
| deark: macbinary
| default
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [KAHL] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 57 69 6e 64 6f 77 | 73 2e 63 00 00 00 00 00 |..Window|s.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 30 f2 00 | 00 01 ce a6 09 1d 3a a6 |.....0..|......:.|
|00000060| 09 1d 3a 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 36 61 00 00 |........|....6a..|
|00000080| 2f 2a 20 46 69 6c 65 3a | 20 57 69 6e 64 6f 77 73 |/* File:| Windows|
|00000090| 2e 63 20 2a 2f 0d 0d 23 | 69 6e 63 6c 75 64 65 20 |.c */..#|include |
|000000a0| 22 53 63 72 69 70 74 53 | 63 72 61 70 2e 68 22 0d |"ScriptS|crap.h".|
|000000b0| 23 69 6e 63 6c 75 64 65 | 20 22 50 72 6f 74 6f 74 |#include| "Protot|
|000000c0| 79 70 65 73 2e 68 22 0d | 0d 23 69 6e 63 6c 75 64 |ypes.h".|.#includ|
|000000d0| 65 20 22 41 45 52 65 67 | 69 73 74 72 79 2e 68 22 |e "AEReg|istry.h"|
|000000e0| 0d 0d 0d 2f 2a 20 54 68 | 69 73 20 72 6f 75 74 69 |.../* Th|is routi|
|000000f0| 6e 65 20 67 65 74 73 20 | 63 61 6c 6c 65 64 20 77 |ne gets |called w|
|00000100| 68 65 6e 65 76 65 72 20 | 74 68 65 20 63 75 72 72 |henever |the curr|
|00000110| 65 6e 74 20 73 65 6c 65 | 63 74 69 6f 6e 20 67 65 |ent sele|ction ge|
|00000120| 74 73 20 63 68 61 6e 67 | 65 64 20 61 6e 64 20 77 |ts chang|ed and w|
|00000130| 65 20 09 20 20 20 2a 2f | 0d 2f 2a 20 6e 65 65 64 |e . */|./* need|
|00000140| 20 74 6f 20 64 72 61 77 | 20 61 20 6e 65 77 20 65 | to draw| a new e|
|00000150| 6e 74 72 79 20 6f 72 20 | 63 68 61 6e 67 65 20 74 |ntry or |change t|
|00000160| 68 65 20 73 74 61 74 75 | 73 20 61 72 65 61 20 61 |he statu|s area a|
|00000170| 74 20 74 68 65 20 62 6f | 74 74 6f 6d 20 6f 66 20 |t the bo|ttom of |
|00000180| 74 68 65 20 77 69 6e 64 | 6f 77 2e 20 2a 2f 0d 2f |the wind|ow. */./|
|00000190| 2a 20 57 65 27 6c 6c 20 | 75 73 65 20 69 74 20 74 |* We'll |use it t|
|000001a0| 6f 20 73 65 6c 65 63 74 | 69 76 65 6c 79 20 69 6e |o select|ively in|
|000001b0| 76 61 6c 69 64 61 74 65 | 20 6f 6e 6c 79 20 74 68 |validate| only th|
|000001c0| 6f 73 65 20 61 72 65 61 | 73 20 77 68 69 63 68 20 |ose area|s which |
|000001d0| 6e 65 65 64 20 72 65 2d | 64 72 61 77 69 6e 67 2c |need re-|drawing,|
|000001e0| 20 20 2a 2f 0d 2f 2a 20 | 77 68 69 63 68 20 77 69 | */./* |which wi|
|000001f0| 6c 6c 20 70 72 65 76 65 | 6e 74 20 74 68 65 20 22 |ll preve|nt the "|
|00000200| 66 72 61 6d 65 22 20 70 | 6f 72 74 69 6f 6e 20 66 |frame" p|ortion f|
|00000210| 72 6f 6d 20 66 6c 69 63 | 6b 65 72 69 6e 67 2e 09 |rom flic|kering..|
|00000220| 09 09 09 09 09 20 20 20 | 2a 2f 0d 76 6f 69 64 20 |..... |*/.void |
|00000230| 49 6e 76 61 6c 69 64 61 | 74 65 57 69 6e 64 6f 77 |Invalida|teWindow|
|00000240| 28 57 69 6e 64 6f 77 50 | 74 72 20 77 68 69 63 68 |(WindowP|tr which|
|00000250| 57 69 6e 64 6f 77 29 0d | 7b 0d 09 52 65 63 74 09 |Window).|{..Rect.|
|00000260| 72 3b 0d 09 77 69 48 61 | 6e 64 09 69 6e 66 6f 20 |r;..wiHa|nd.info |
|00000270| 3d 20 28 77 69 48 61 6e | 64 29 47 65 74 57 52 65 |= (wiHan|d)GetWRe|
|00000280| 66 43 6f 6e 28 77 68 69 | 63 68 57 69 6e 64 6f 77 |fCon(whi|chWindow|
|00000290| 29 3b 0d 09 0d 09 53 65 | 74 50 6f 72 74 28 77 68 |);....Se|tPort(wh|
|000002a0| 69 63 68 57 69 6e 64 6f | 77 29 3b 0d 09 72 20 3d |ichWindo|w);..r =|
|000002b0| 20 28 2a 69 6e 66 6f 29 | 2d 3e 64 72 61 77 69 6e | (*info)|->drawin|
|000002c0| 67 41 72 65 61 3b 0d 09 | 49 6e 76 61 6c 52 65 63 |gArea;..|InvalRec|
|000002d0| 74 28 26 72 29 3b 0d 09 | 72 20 3d 20 28 2a 69 6e |t(&r);..|r = (*in|
|000002e0| 66 6f 29 2d 3e 73 74 61 | 74 75 73 41 72 65 61 3b |fo)->sta|tusArea;|
|000002f0| 0d 09 49 6e 76 61 6c 52 | 65 63 74 28 26 72 29 3b |..InvalR|ect(&r);|
|00000300| 0d 09 72 20 3d 20 28 2a | 28 2a 69 6e 66 6f 29 2d |..r = (*|(*info)-|
|00000310| 3e 73 65 6c 65 63 74 69 | 6f 6e 42 61 72 29 2d 3e |>selecti|onBar)->|
|00000320| 63 6f 6e 74 72 6c 52 65 | 63 74 3b 0d 09 49 6e 76 |contrlRe|ct;..Inv|
|00000330| 61 6c 52 65 63 74 28 26 | 72 29 3b 0d 7d 0d 0d 0d |alRect(&|r);.}...|
|00000340| 76 6f 69 64 20 45 6e 74 | 72 79 41 64 64 65 64 20 |void Ent|ryAdded |
|00000350| 28 57 69 6e 64 6f 77 50 | 74 72 20 77 68 69 63 68 |(WindowP|tr which|
|00000360| 57 69 6e 64 6f 77 2c 20 | 73 68 6f 72 74 20 65 6e |Window, |short en|
|00000370| 74 72 79 4e 75 6d 29 0d | 7b 0d 09 2f 2a 20 54 68 |tryNum).|{../* Th|
|00000380| 69 73 20 72 6f 75 74 69 | 6e 65 20 67 65 74 73 20 |is routi|ne gets |
|00000390| 63 61 6c 6c 65 64 20 77 | 68 65 6e 65 76 65 72 20 |called w|henever |
|000003a0| 61 20 6e 65 77 20 65 6e | 74 72 79 20 67 65 74 73 |a new en|try gets|
|000003b0| 20 61 64 64 65 64 20 74 | 6f 20 74 68 65 20 2a 2f | added t|o the */|
|000003c0| 0d 09 2f 2a 20 73 63 72 | 61 70 62 6f 6f 6b 2c 20 |../* scr|apbook, |
|000003d0| 61 6e 64 20 69 74 20 75 | 70 64 61 74 65 73 20 74 |and it u|pdates t|
|000003e0| 68 65 20 64 69 73 70 6c | 61 79 20 61 70 70 72 6f |he displ|ay appro|
|000003f0| 70 72 69 61 74 65 6c 79 | 2e 09 09 09 20 20 20 2a |priately|.... *|
|00000400| 2f 0d 09 77 69 48 61 6e | 64 09 69 6e 66 6f 20 3d |/..wiHan|d.info =|
|00000410| 20 28 77 69 48 61 6e 64 | 29 47 65 74 57 52 65 66 | (wiHand|)GetWRef|
|00000420| 43 6f 6e 28 77 68 69 63 | 68 57 69 6e 64 6f 77 29 |Con(whic|hWindow)|
|00000430| 3b 0d 09 0d 09 28 2a 69 | 6e 66 6f 29 2d 3e 6e 75 |;....(*i|nfo)->nu|
|00000440| 6d 45 6e 74 72 69 65 73 | 20 2b 3d 20 31 3b 0d 09 |mEntries| += 1;..|
|00000450| 48 69 6c 69 74 65 43 6f | 6e 74 72 6f 6c 28 28 2a |HiliteCo|ntrol((*|
|00000460| 69 6e 66 6f 29 2d 3e 73 | 65 6c 65 63 74 69 6f 6e |info)->s|election|
|00000470| 42 61 72 2c 20 30 29 3b | 0d 09 53 65 74 43 74 6c |Bar, 0);|..SetCtl|
|00000480| 4d 61 78 28 28 2a 69 6e | 66 6f 29 2d 3e 73 65 6c |Max((*in|fo)->sel|
|00000490| 65 63 74 69 6f 6e 42 61 | 72 2c 20 28 2a 69 6e 66 |ectionBa|r, (*inf|
|000004a0| 6f 29 2d 3e 6e 75 6d 45 | 6e 74 72 69 65 73 29 3b |o)->numE|ntries);|
|000004b0| 0d 09 49 6e 76 61 6c 69 | 64 61 74 65 57 69 6e 64 |..Invali|dateWind|
|000004c0| 6f 77 28 77 68 69 63 68 | 57 69 6e 64 6f 77 29 3b |ow(which|Window);|
|000004d0| 0d 7d 0d 0d 0d 76 6f 69 | 64 20 45 6e 74 72 79 52 |.}...voi|d EntryR|
|000004e0| 65 6d 6f 76 65 64 20 28 | 57 69 6e 64 6f 77 50 74 |emoved (|WindowPt|
|000004f0| 72 20 77 68 69 63 68 57 | 69 6e 64 6f 77 2c 20 73 |r whichW|indow, s|
|00000500| 68 6f 72 74 20 65 6e 74 | 72 79 4e 75 6d 29 0d 7b |hort ent|ryNum).{|
|00000510| 0d 09 2f 2a 20 54 68 69 | 73 20 72 6f 75 74 69 6e |../* Thi|s routin|
|00000520| 65 20 67 65 74 73 20 63 | 61 6c 6c 65 64 20 77 68 |e gets c|alled wh|
|00000530| 65 6e 65 76 65 72 20 61 | 6e 20 65 6e 74 72 79 20 |enever a|n entry |
|00000540| 69 73 20 72 65 6d 6f 76 | 65 64 20 66 72 6f 6d 20 |is remov|ed from |
|00000550| 74 68 65 20 20 2a 2f 0d | 09 2f 2a 20 73 63 72 61 |the */.|./* scra|
|00000560| 70 62 6f 6f 6b 2c 20 61 | 6e 64 20 69 74 20 75 70 |pbook, a|nd it up|
|00000570| 64 61 74 65 73 20 74 68 | 65 20 64 69 73 70 6c 61 |dates th|e displa|
|00000580| 79 20 61 70 70 72 6f 70 | 72 69 61 74 65 6c 79 2e |y approp|riately.|
|00000590| 09 09 09 20 20 20 2a 2f | 0d 09 77 69 48 61 6e 64 |... */|..wiHand|
|000005a0| 09 69 6e 66 6f 20 3d 20 | 28 77 69 48 61 6e 64 29 |.info = |(wiHand)|
|000005b0| 47 65 74 57 52 65 66 43 | 6f 6e 28 77 68 69 63 68 |GetWRefC|on(which|
|000005c0| 57 69 6e 64 6f 77 29 3b | 0d 09 0d 09 69 66 20 28 |Window);|....if (|
|000005d0| 28 2a 69 6e 66 6f 29 2d | 3e 6e 75 6d 45 6e 74 72 |(*info)-|>numEntr|
|000005e0| 69 65 73 20 3e 20 30 29 | 0d 09 09 28 2a 69 6e 66 |ies > 0)|...(*inf|
|000005f0| 6f 29 2d 3e 6e 75 6d 45 | 6e 74 72 69 65 73 20 2d |o)->numE|ntries -|
|00000600| 3d 20 31 3b 0d 09 69 66 | 20 28 28 2a 69 6e 66 6f |= 1;..if| ((*info|
|00000610| 29 2d 3e 6e 75 6d 45 6e | 74 72 69 65 73 20 3d 3d |)->numEn|tries ==|
|00000620| 20 30 29 0d 09 09 48 69 | 6c 69 74 65 43 6f 6e 74 | 0)...Hi|liteCont|
|00000630| 72 6f 6c 28 28 2a 69 6e | 66 6f 29 2d 3e 73 65 6c |rol((*in|fo)->sel|
|00000640| 65 63 74 69 6f 6e 42 61 | 72 2c 20 32 35 35 29 3b |ectionBa|r, 255);|
|00000650| 0d 09 53 65 74 43 74 6c | 4d 61 78 28 28 2a 69 6e |..SetCtl|Max((*in|
|00000660| 66 6f 29 2d 3e 73 65 6c | 65 63 74 69 6f 6e 42 61 |fo)->sel|ectionBa|
|00000670| 72 2c 20 28 2a 69 6e 66 | 6f 29 2d 3e 6e 75 6d 45 |r, (*inf|o)->numE|
|00000680| 6e 74 72 69 65 73 29 3b | 0d 09 69 66 20 28 28 2a |ntries);|..if ((*|
|00000690| 69 6e 66 6f 29 2d 3e 63 | 75 72 72 45 6e 74 72 79 |info)->c|urrEntry|
|000006a0| 4e 75 6d 20 3e 20 28 2a | 69 6e 66 6f 29 2d 3e 6e |Num > (*|info)->n|
|000006b0| 75 6d 45 6e 74 72 69 65 | 73 29 0d 09 09 47 6f 54 |umEntrie|s)...GoT|
|000006c0| 6f 45 6e 74 72 79 28 77 | 68 69 63 68 57 69 6e 64 |oEntry(w|hichWind|
|000006d0| 6f 77 2c 20 28 2a 69 6e | 66 6f 29 2d 3e 6e 75 6d |ow, (*in|fo)->num|
|000006e0| 45 6e 74 72 69 65 73 29 | 3b 0d 09 65 6c 73 65 0d |Entries)|;..else.|
|000006f0| 09 09 49 6e 76 61 6c 69 | 64 61 74 65 57 69 6e 64 |..Invali|dateWind|
|00000700| 6f 77 28 77 68 69 63 68 | 57 69 6e 64 6f 77 29 3b |ow(which|Window);|
|00000710| 0d 7d 0d 0d 0d 76 6f 69 | 64 20 47 6f 54 6f 45 6e |.}...voi|d GoToEn|
|00000720| 74 72 79 20 28 57 69 6e | 64 6f 77 50 74 72 20 77 |try (Win|dowPtr w|
|00000730| 68 69 63 68 57 69 6e 64 | 6f 77 2c 20 73 68 6f 72 |hichWind|ow, shor|
|00000740| 74 20 65 6e 74 72 79 4e | 75 6d 29 0d 7b 0d 09 77 |t entryN|um).{..w|
|00000750| 69 48 61 6e 64 09 69 6e | 66 6f 20 3d 20 28 77 69 |iHand.in|fo = (wi|
|00000760| 48 61 6e 64 29 47 65 74 | 57 52 65 66 43 6f 6e 28 |Hand)Get|WRefCon(|
|00000770| 77 68 69 63 68 57 69 6e | 64 6f 77 29 3b 0d 09 52 |whichWin|dow);..R|
|00000780| 65 73 54 79 70 65 09 73 | 63 72 61 74 63 68 54 79 |esType.s|cratchTy|
|00000790| 70 65 3b 0d 09 4f 53 45 | 72 72 09 65 72 72 3b 0d |pe;..OSE|rr.err;.|
|000007a0| 09 0d 09 69 66 20 28 65 | 6e 74 72 79 4e 75 6d 20 |...if (e|ntryNum |
|000007b0| 3c 20 31 29 0d 09 09 65 | 6e 74 72 79 4e 75 6d 20 |< 1)...e|ntryNum |
|000007c0| 3d 20 31 3b 0d 09 65 6c | 73 65 20 69 66 20 28 65 |= 1;..el|se if (e|
|000007d0| 6e 74 72 79 4e 75 6d 20 | 3e 20 28 2a 69 6e 66 6f |ntryNum |> (*info|
|000007e0| 29 2d 3e 6e 75 6d 45 6e | 74 72 69 65 73 29 0d 09 |)->numEn|tries)..|
|000007f0| 09 65 6e 74 72 79 4e 75 | 6d 20 3d 20 28 2a 69 6e |.entryNu|m = (*in|
|00000800| 66 6f 29 2d 3e 6e 75 6d | 45 6e 74 72 69 65 73 3b |fo)->num|Entries;|
|00000810| 0d 09 65 72 72 20 3d 20 | 47 65 74 42 65 73 74 54 |..err = |GetBestT|
|00000820| 79 70 65 28 65 6e 74 72 | 79 4e 75 6d 2c 20 26 73 |ype(entr|yNum, &s|
|00000830| 63 72 61 74 63 68 54 79 | 70 65 29 3b 09 2f 2a 20 |cratchTy|pe);./* |
|00000840| 47 65 74 20 74 68 65 20 | 64 65 66 61 75 6c 74 20 |Get the |default |
|00000850| 74 79 70 65 20 66 6f 72 | 20 74 68 69 73 20 65 6e |type for| this en|
|00000860| 74 72 79 20 2a 2f 0d 09 | 69 66 20 28 65 72 72 20 |try */..|if (err |
|00000870| 3d 3d 20 6e 6f 45 72 72 | 29 0d 09 09 28 2a 69 6e |== noErr|)...(*in|
|00000880| 66 6f 29 2d 3e 63 75 72 | 72 45 6e 74 72 79 54 79 |fo)->cur|rEntryTy|
|00000890| 70 65 20 3d 20 73 63 72 | 61 74 63 68 54 79 70 65 |pe = scr|atchType|
|000008a0| 3b 0d 09 53 65 74 43 74 | 6c 56 61 6c 75 65 28 28 |;..SetCt|lValue((|
|000008b0| 2a 69 6e 66 6f 29 2d 3e | 73 65 6c 65 63 74 69 6f |*info)->|selectio|
|000008c0| 6e 42 61 72 2c 20 65 6e | 74 72 79 4e 75 6d 29 3b |nBar, en|tryNum);|
|000008d0| 0d 09 28 2a 69 6e 66 6f | 29 2d 3e 63 75 72 72 45 |..(*info|)->currE|
|000008e0| 6e 74 72 79 4e 75 6d 20 | 3d 20 65 6e 74 72 79 4e |ntryNum |= entryN|
|000008f0| 75 6d 3b 0d 09 49 6e 76 | 61 6c 69 64 61 74 65 57 |um;..Inv|alidateW|
|00000900| 69 6e 64 6f 77 28 77 68 | 69 63 68 57 69 6e 64 6f |indow(wh|ichWindo|
|00000910| 77 29 3b 0d 09 44 6f 55 | 70 64 61 74 65 28 77 68 |w);..DoU|pdate(wh|
|00000920| 69 63 68 57 69 6e 64 6f | 77 29 3b 0d 7d 0d 0d 0d |ichWindo|w);.}...|
|00000930| 4f 53 45 72 72 20 4e 65 | 77 53 63 72 61 70 62 6f |OSErr Ne|wScrapbo|
|00000940| 6f 6b 46 69 6c 65 28 46 | 53 53 70 65 63 20 2a 74 |okFile(F|SSpec *t|
|00000950| 68 65 46 69 6c 65 2c 20 | 42 6f 6f 6c 65 61 6e 20 |heFile, |Boolean |
|00000960| 2a 63 61 6e 63 65 6c 6c | 65 64 29 0d 7b 0d 09 2f |*cancell|ed).{../|
|00000970| 2a 20 54 68 69 73 20 72 | 6f 75 74 69 6e 65 20 61 |* This r|outine a|
|00000980| 73 6b 73 20 74 68 65 20 | 75 73 65 72 20 74 6f 20 |sks the |user to |
|00000990| 63 72 65 61 74 65 20 61 | 20 6e 65 77 20 73 63 72 |create a| new scr|
|000009a0| 61 70 62 6f 6f 6b 20 66 | 69 6c 65 2e 20 49 66 20 |apbook f|ile. If |
|000009b0| 61 20 66 69 6c 65 20 61 | 6c 72 65 61 64 79 20 2a |a file a|lready *|
|000009c0| 2f 0d 09 2f 2a 20 65 78 | 69 73 74 73 2c 20 69 74 |/../* ex|ists, it|
|000009d0| 20 72 65 70 6c 61 63 65 | 64 2e 20 09 09 09 09 09 | replace|d. .....|
|000009e0| 09 09 09 09 09 09 09 09 | 09 2a 2f 0d 09 2f 2a 20 |........|.*/../* |
|000009f0| 52 65 74 75 72 6e 73 20 | 6e 6f 45 72 72 20 69 66 |Returns |noErr if|
|00000a00| 20 73 75 63 63 65 73 73 | 66 75 6c 2c 20 61 6e 64 | success|ful, and|
|00000a10| 20 70 6c 61 63 65 73 20 | 61 6e 20 46 53 53 70 65 | places |an FSSpe|
|00000a20| 63 20 69 6e 74 6f 20 2a | 74 68 65 46 69 6c 65 2e |c into *|theFile.|
|00000a30| 20 09 09 09 2a 2f 0d 09 | 2f 2a 20 52 65 74 75 72 | ...*/..|/* Retur|
|00000a40| 6e 73 20 65 72 72 41 45 | 45 76 65 6e 74 46 61 69 |ns errAE|EventFai|
|00000a50| 6c 65 64 20 69 66 20 74 | 68 65 20 75 73 65 72 20 |led if t|he user |
|00000a60| 63 61 6e 63 65 6c 73 2c | 20 61 6e 64 20 73 65 74 |cancels,| and set|
|00000a70| 73 20 2a 63 61 6e 63 65 | 6c 6c 65 64 20 74 6f 20 |s *cance|lled to |
|00000a80| 54 52 55 45 2e 09 2a 2f | 0d 09 2f 2a 20 4f 74 68 |TRUE..*/|../* Oth|
|00000a90| 65 72 77 69 73 65 2c 20 | 72 65 74 75 72 6e 73 20 |erwise, |returns |
|00000aa0| 61 6e 79 20 69 6e 74 65 | 72 6d 65 64 69 61 74 65 |any inte|rmediate|
|00000ab0| 20 65 72 72 6f 72 20 63 | 6f 64 65 73 20 74 68 61 | error c|odes tha|
|00000ac0| 74 20 6d 61 79 20 6f 63 | 63 75 72 2e 09 09 09 09 |t may oc|cur.....|
|00000ad0| 2a 2f 0d 09 0d 09 73 6d | 61 70 48 61 6e 64 09 09 |*/....sm|apHand..|
|00000ae0| 20 20 74 68 65 53 6d 61 | 70 3b 0d 09 53 74 61 6e | theSma|p;..Stan|
|00000af0| 64 61 72 64 46 69 6c 65 | 52 65 70 6c 79 20 72 65 |dardFile|Reply re|
|00000b00| 70 6c 79 3b 0d 09 4f 53 | 45 72 72 09 09 09 20 20 |ply;..OS|Err... |
|00000b10| 65 72 72 3b 0d 09 73 68 | 6f 72 74 09 09 09 20 20 |err;..sh|ort... |
|00000b20| 72 65 66 4e 75 6d 20 3d | 20 30 3b 0d 09 0d 09 09 |refNum =| 0;.....|
|00000b30| 65 72 72 20 3d 20 4d 79 | 49 6e 74 65 72 61 63 74 |err = My|Interact|
|00000b40| 57 69 74 68 55 73 65 72 | 28 74 72 75 65 29 3b 09 |WithUser|(true);.|
|00000b50| 2f 2a 20 4d 61 6b 65 20 | 73 75 72 65 20 77 65 27 |/* Make |sure we'|
|00000b60| 72 65 20 69 6e 20 66 72 | 6f 6e 74 20 2a 2f 0d 09 |re in fr|ont */..|
|00000b70| 09 69 66 20 28 65 72 72 | 20 21 3d 20 6e 6f 45 72 |.if (err| != noEr|
|00000b80| 72 29 20 67 6f 74 6f 20 | 64 6f 6e 65 3b 0d 0d 09 |r) goto |done;...|
|00000b90| 09 53 74 61 6e 64 61 72 | 64 50 75 74 46 69 6c 65 |.Standar|dPutFile|
|00000ba0| 28 22 5c 70 22 2c 20 22 | 5c 70 4e 65 77 20 53 63 |("\p", "|\pNew Sc|
|00000bb0| 72 61 70 62 6f 6f 6b 22 | 2c 20 26 72 65 70 6c 79 |rapbook"|, &reply|
|00000bc0| 29 3b 0d 09 09 2a 63 61 | 6e 63 65 6c 6c 65 64 20 |);...*ca|ncelled |
|00000bd0| 3d 20 21 72 65 70 6c 79 | 2e 73 66 47 6f 6f 64 3b |= !reply|.sfGood;|
|00000be0| 0d 09 09 0d 09 09 69 66 | 20 28 72 65 70 6c 79 2e |......if| (reply.|
|00000bf0| 73 66 47 6f 6f 64 29 20 | 7b 0d 09 09 09 2a 74 68 |sfGood) |{....*th|
|00000c00| 65 46 69 6c 65 20 3d 20 | 72 65 70 6c 79 2e 73 66 |eFile = |reply.sf|
|00000c10| 46 69 6c 65 3b 0d 09 09 | 09 2f 2a 20 43 72 65 61 |File;...|./* Crea|
|00000c20| 74 65 20 74 68 65 20 66 | 69 6c 65 20 73 6f 20 77 |te the f|ile so w|
|00000c30| 65 20 63 61 6e 20 6f 70 | 65 6e 20 69 74 20 2a 2f |e can op|en it */|
|00000c40| 0d 09 09 09 69 66 20 28 | 72 65 70 6c 79 2e 73 66 |....if (|reply.sf|
|00000c50| 52 65 70 6c 61 63 69 6e | 67 29 20 2f 2a 20 47 65 |Replacin|g) /* Ge|
|00000c60| 74 20 72 69 64 20 6f 66 | 20 74 68 65 20 6f 6c 64 |t rid of| the old|
|00000c70| 20 66 69 6c 65 20 66 69 | 72 73 74 20 2a 2f 0d 09 | file fi|rst */..|
|00000c80| 09 09 09 69 66 20 28 65 | 72 72 20 3d 20 46 53 70 |...if (e|rr = FSp|
|00000c90| 44 65 6c 65 74 65 28 74 | 68 65 46 69 6c 65 29 29 |Delete(t|heFile))|
|00000ca0| 20 67 6f 74 6f 20 64 6f | 6e 65 3b 0d 09 09 09 46 | goto do|ne;....F|
|00000cb0| 53 70 43 72 65 61 74 65 | 52 65 73 46 69 6c 65 28 |SpCreate|ResFile(|
|00000cc0| 74 68 65 46 69 6c 65 2c | 20 27 73 63 62 6b 27 2c |theFile,| 'scbk',|
|00000cd0| 20 27 73 63 62 6b 27 2c | 20 72 65 70 6c 79 2e 73 | 'scbk',| reply.s|
|00000ce0| 66 53 63 72 69 70 74 29 | 3b 0d 09 09 09 2f 2a 20 |fScript)|;..../* |
|00000cf0| 4f 70 65 6e 20 74 68 65 | 20 66 69 6c 65 20 61 6e |Open the| file an|
|00000d00| 64 20 63 72 65 61 74 65 | 20 61 20 62 6c 61 6e 6b |d create| a blank|
|00000d10| 20 53 4d 41 50 20 72 65 | 73 6f 75 72 63 65 20 69 | SMAP re|source i|
|00000d20| 6e 20 69 74 20 2a 2f 0d | 09 09 09 72 65 66 4e 75 |n it */.|...refNu|
|00000d30| 6d 20 3d 20 46 53 70 4f | 70 65 6e 52 65 73 46 69 |m = FSpO|penResFi|
|00000d40| 6c 65 28 74 68 65 46 69 | 6c 65 2c 20 66 73 52 64 |le(theFi|le, fsRd|
|00000d50| 57 72 50 65 72 6d 29 3b | 0d 09 09 09 69 66 20 28 |WrPerm);|....if (|
|00000d60| 28 65 72 72 20 3d 20 52 | 65 73 45 72 72 6f 72 28 |(err = R|esError(|
|00000d70| 29 29 20 21 3d 20 6e 6f | 45 72 72 29 20 67 6f 74 |)) != no|Err) got|
|00000d80| 6f 20 64 6f 6e 65 3b 0d | 09 09 09 55 73 65 52 65 |o done;.|...UseRe|
|00000d90| 73 46 69 6c 65 28 72 65 | 66 4e 75 6d 29 3b 0d 09 |sFile(re|fNum);..|
|00000da0| 09 09 74 68 65 53 6d 61 | 70 20 3d 20 28 76 6f 69 |..theSma|p = (voi|
|00000db0| 64 20 2a 29 20 4e 65 77 | 48 61 6e 64 6c 65 43 6c |d *) New|HandleCl|
|00000dc0| 65 61 72 28 73 69 7a 65 | 6f 66 28 73 6d 61 70 29 |ear(size|of(smap)|
|00000dd0| 29 3b 0d 09 09 09 69 66 | 20 28 28 65 72 72 20 3d |);....if| ((err =|
|00000de0| 20 4d 65 6d 45 72 72 6f | 72 28 29 29 20 21 3d 20 | MemErro|r()) != |
|00000df0| 6e 6f 45 72 72 29 20 67 | 6f 74 6f 20 64 6f 6e 65 |noErr) g|oto done|
|00000e00| 3b 0d 09 09 09 41 64 64 | 52 65 73 6f 75 72 63 65 |;....Add|Resource|
|00000e10| 28 28 48 61 6e 64 6c 65 | 29 74 68 65 53 6d 61 70 |((Handle|)theSmap|
|00000e20| 2c 20 27 53 4d 41 50 27 | 2c 20 30 2c 20 22 5c 70 |, 'SMAP'|, 0, "\p|
|00000e30| 22 29 3b 0d 09 09 09 69 | 66 20 28 28 65 72 72 20 |");....i|f ((err |
|00000e40| 3d 20 52 65 73 45 72 72 | 6f 72 28 29 29 20 21 3d |= ResErr|or()) !=|
|00000e50| 20 6e 6f 45 72 72 29 20 | 67 6f 74 6f 20 64 6f 6e | noErr) |goto don|
|00000e60| 65 3b 0d 09 09 09 55 70 | 64 61 74 65 52 65 73 46 |e;....Up|dateResF|
|00000e70| 69 6c 65 28 72 65 66 4e | 75 6d 29 3b 0d 09 09 09 |ile(refN|um);....|
|00000e80| 69 66 20 28 28 65 72 72 | 20 3d 20 52 65 73 45 72 |if ((err| = ResEr|
|00000e90| 72 6f 72 28 29 29 20 21 | 3d 20 6e 6f 45 72 72 29 |ror()) !|= noErr)|
|00000ea0| 20 67 6f 74 6f 20 64 6f | 6e 65 3b 0d 09 09 09 0d | goto do|ne;.....|
|00000eb0| 09 09 7d 20 65 6c 73 65 | 0d 09 09 09 65 72 72 20 |..} else|....err |
|00000ec0| 3d 20 65 72 72 41 45 45 | 76 65 6e 74 46 61 69 6c |= errAEE|ventFail|
|00000ed0| 65 64 3b 09 2f 2a 20 54 | 68 65 20 75 73 65 72 20 |ed;./* T|he user |
|00000ee0| 63 61 6e 63 65 6c 6c 65 | 64 20 2a 2f 0d 0d 64 6f |cancelle|d */..do|
|00000ef0| 6e 65 3a 0d 09 69 66 20 | 28 72 65 66 4e 75 6d 20 |ne:..if |(refNum |
|00000f00| 3e 20 30 29 0d 09 09 43 | 6c 6f 73 65 52 65 73 46 |> 0)...C|loseResF|
|00000f10| 69 6c 65 28 72 65 66 4e | 75 6d 29 3b 0d 0d 09 72 |ile(refN|um);...r|
|00000f20| 65 74 75 72 6e 20 65 72 | 72 3b 0d 7d 0d 0d 0d 4f |eturn er|r;.}...O|
|00000f30| 53 45 72 72 20 4e 65 77 | 44 69 73 70 6c 61 79 57 |SErr New|DisplayW|
|00000f40| 69 6e 64 6f 77 20 28 63 | 6f 6e 73 74 20 46 53 53 |indow (c|onst FSS|
|00000f50| 70 65 63 20 2a 73 6f 75 | 72 63 65 46 69 6c 65 29 |pec *sou|rceFile)|
|00000f60| 0d 7b 0d 09 46 53 53 70 | 65 63 09 09 66 69 6c 65 |.{..FSSp|ec..file|
|00000f70| 54 6f 4f 70 65 6e 3b 0d | 09 57 69 6e 64 6f 77 50 |ToOpen;.|.WindowP|
|00000f80| 74 72 09 6e 65 77 57 69 | 6e 64 6f 77 20 3d 20 4e |tr.newWi|ndow = N|
|00000f90| 55 4c 4c 3b 0d 09 77 69 | 48 61 6e 64 09 09 69 6e |ULL;..wi|Hand..in|
|00000fa0| 66 6f 09 20 20 3d 20 4e | 55 4c 4c 3b 0d 09 50 74 |fo. = N|ULL;..Pt|
|00000fb0| 72 09 09 09 73 74 6f 72 | 61 67 65 09 20 20 3d 20 |r...stor|age. = |
|00000fc0| 4e 55 4c 4c 3b 0d 09 72 | 65 67 69 73 74 65 72 20 |NULL;..r|egister |
|00000fd0| 4f 53 45 72 72 20 65 72 | 72 20 09 20 20 3d 20 6e |OSErr er|r . = n|
|00000fe0| 6f 45 72 72 3b 0d 09 73 | 68 6f 72 74 09 09 72 65 |oErr;..s|hort..re|
|00000ff0| 66 4e 75 6d 20 3d 20 30 | 3b 0d 09 73 68 6f 72 74 |fNum = 0|;..short|
|00001000| 09 09 6e 75 6d 45 6e 74 | 72 69 65 73 3b 0d 09 52 |..numEnt|ries;..R|
|00001010| 65 63 74 09 09 73 63 72 | 6f 6c 6c 42 61 72 42 6f |ect..scr|ollBarBo|
|00001020| 75 6e 64 73 2c 0d 09 09 | 09 09 64 72 61 77 69 6e |unds,...|..drawin|
|00001030| 67 41 72 65 61 2c 20 73 | 74 61 74 75 73 41 72 65 |gArea, s|tatusAre|
|00001040| 61 3b 0d 09 43 6f 6e 74 | 72 6f 6c 48 61 6e 64 6c |a;..Cont|rolHandl|
|00001050| 65 20 73 63 72 6f 6c 6c | 42 61 72 3b 0d 09 52 65 |e scroll|Bar;..Re|
|00001060| 73 54 79 70 65 09 09 73 | 63 72 61 74 63 68 54 79 |sType..s|cratchTy|
|00001070| 70 65 3b 0d 09 42 6f 6f | 6c 65 61 6e 09 09 63 61 |pe;..Boo|lean..ca|
|00001080| 6e 63 65 6c 6c 65 64 3b | 0d 09 0d 09 69 66 20 28 |ncelled;|....if (|
|00001090| 73 6f 75 72 63 65 46 69 | 6c 65 20 3d 3d 20 4e 55 |sourceFi|le == NU|
|000010a0| 4c 4c 29 20 7b 0d 09 09 | 2f 2a 20 49 66 20 77 65 |LL) {...|/* If we|
|000010b0| 20 68 61 76 65 6e 27 74 | 20 62 65 65 6e 20 67 69 | haven't| been gi|
|000010c0| 76 65 6e 20 61 20 66 69 | 6c 65 2c 20 74 68 65 6e |ven a fi|le, then|
|000010d0| 20 61 73 6b 20 74 68 65 | 20 75 73 65 72 20 66 6f | ask the| user fo|
|000010e0| 72 20 6f 6e 65 20 2a 2f | 0d 09 09 65 72 72 20 3d |r one */|...err =|
|000010f0| 20 4e 65 77 53 63 72 61 | 70 62 6f 6f 6b 46 69 6c | NewScra|pbookFil|
|00001100| 65 28 26 66 69 6c 65 54 | 6f 4f 70 65 6e 2c 20 26 |e(&fileT|oOpen, &|
|00001110| 63 61 6e 63 65 6c 6c 65 | 64 29 3b 0d 09 09 69 66 |cancelle|d);...if|
|00001120| 20 28 65 72 72 20 21 3d | 20 6e 6f 45 72 72 29 20 | (err !=| noErr) |
|00001130| 67 6f 74 6f 20 65 72 72 | 6f 72 3b 0d 09 7d 20 65 |goto err|or;..} e|
|00001140| 6c 73 65 20 7b 0d 09 09 | 2f 2a 20 54 68 65 20 63 |lse {...|/* The c|
|00001150| 61 6c 6c 65 72 20 73 70 | 65 63 69 66 69 65 64 20 |aller sp|ecified |
|00001160| 61 20 66 69 6c 65 20 2a | 2f 0d 09 09 66 69 6c 65 |a file *|/...file|
|00001170| 54 6f 4f 70 65 6e 20 3d | 20 2a 73 6f 75 72 63 65 |ToOpen =| *source|
|00001180| 46 69 6c 65 3b 0d 09 7d | 0d 09 2f 2a 20 4f 70 65 |File;..}|../* Ope|
|00001190| 6e 20 74 68 65 20 66 69 | 6c 65 20 2a 2f 0d 09 72 |n the fi|le */..r|
|000011a0| 65 66 4e 75 6d 20 3d 20 | 46 53 70 4f 70 65 6e 52 |efNum = |FSpOpenR|
|000011b0| 65 73 46 69 6c 65 28 26 | 66 69 6c 65 54 6f 4f 70 |esFile(&|fileToOp|
|000011c0| 65 6e 2c 20 66 73 52 64 | 57 72 50 65 72 6d 29 3b |en, fsRd|WrPerm);|
|000011d0| 0d 09 69 66 20 28 28 65 | 72 72 20 3d 20 52 65 73 |..if ((e|rr = Res|
|000011e0| 45 72 72 6f 72 28 29 29 | 20 21 3d 20 6e 6f 45 72 |Error())| != noEr|
|000011f0| 72 29 20 67 6f 74 6f 20 | 65 72 72 6f 72 3b 0d 09 |r) goto |error;..|
|00001200| 55 73 65 52 65 73 46 69 | 6c 65 28 72 65 66 4e 75 |UseResFi|le(refNu|
|00001210| 6d 29 3b 0d 09 0d 09 2f | 2a 20 43 72 65 61 74 65 |m);..../|* Create|
|00001220| 20 61 20 6e 65 77 20 77 | 69 6e 64 6f 77 20 2a 2f | a new w|indow */|
|00001230| 0d 09 73 74 6f 72 61 67 | 65 20 3d 20 4e 65 77 50 |..storag|e = NewP|
|00001240| 74 72 43 6c 65 61 72 28 | 73 69 7a 65 6f 66 28 57 |trClear(|sizeof(W|
|00001250| 69 6e 64 6f 77 52 65 63 | 6f 72 64 29 29 3b 0d 09 |indowRec|ord));..|
|00001260| 69 66 20 28 65 72 72 20 | 3d 20 4d 65 6d 45 72 72 |if (err |= MemErr|
|00001270| 6f 72 28 29 29 20 67 6f | 74 6f 20 65 72 72 6f 72 |or()) go|to error|
|00001280| 3b 0d 09 6e 65 77 57 69 | 6e 64 6f 77 20 3d 20 47 |;..newWi|ndow = G|
|00001290| 65 74 4e 65 77 43 57 69 | 6e 64 6f 77 28 6b 44 69 |etNewCWi|ndow(kDi|
|000012a0| 73 70 6c 61 79 57 69 6e | 64 6f 77 2c 20 73 74 6f |splayWin|dow, sto|
|000012b0| 72 61 67 65 2c 20 28 57 | 69 6e 64 6f 77 50 74 72 |rage, (W|indowPtr|
|000012c0| 29 2d 31 29 3b 0d 09 69 | 66 20 28 65 72 72 20 3d |)-1);..i|f (err =|
|000012d0| 20 4d 65 6d 45 72 72 6f | 72 28 29 29 20 67 6f 74 | MemErro|r()) got|
|000012e0| 6f 20 65 72 72 6f 72 3b | 0d 09 53 65 74 50 6f 72 |o error;|..SetPor|
|000012f0| 74 28 6e 65 77 57 69 6e | 64 6f 77 29 3b 0d 09 0d |t(newWin|dow);...|
|00001300| 09 2f 2a 20 43 72 65 61 | 74 65 20 61 6e 64 20 69 |./* Crea|te and i|
|00001310| 6e 69 74 69 61 6c 69 7a | 65 20 6f 75 72 20 77 69 |nitializ|e our wi|
|00001320| 6e 64 6f 77 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |ndow inf|ormation|
|00001330| 20 62 6c 6f 63 6b 20 2a | 2f 0d 09 69 6e 66 6f 20 | block *|/..info |
|00001340| 3d 20 28 77 69 48 61 6e | 64 29 4e 65 77 48 61 6e |= (wiHan|d)NewHan|
|00001350| 64 6c 65 43 6c 65 61 72 | 28 73 69 7a 65 6f 66 28 |dleClear|(sizeof(|
|00001360| 57 69 6e 64 6f 77 49 6e | 66 6f 29 29 3b 0d 09 69 |WindowIn|fo));..i|
|00001370| 66 20 28 65 72 72 20 3d | 20 4d 65 6d 45 72 72 6f |f (err =| MemErro|
|00001380| 72 28 29 29 20 67 6f 74 | 6f 20 65 72 72 6f 72 3b |r()) got|o error;|
|00001390| 0d 0d 09 2f 2a 20 44 65 | 66 69 6e 65 20 74 68 65 |.../* De|fine the|
|000013a0| 20 61 72 65 61 20 77 68 | 65 72 65 20 65 61 63 68 | area wh|ere each|
|000013b0| 20 65 6e 74 72 79 20 77 | 69 6c 6c 20 62 65 20 64 | entry w|ill be d|
|000013c0| 72 61 77 6e 20 2a 2f 0d | 09 64 72 61 77 69 6e 67 |rawn */.|.drawing|
|000013d0| 41 72 65 61 20 3d 20 6e | 65 77 57 69 6e 64 6f 77 |Area = n|ewWindow|
|000013e0| 2d 3e 70 6f 72 74 52 65 | 63 74 3b 0d 09 64 72 61 |->portRe|ct;..dra|
|000013f0| 77 69 6e 67 41 72 65 61 | 2e 62 6f 74 74 6f 6d 20 |wingArea|.bottom |
|00001400| 3d 20 64 72 61 77 69 6e | 67 41 72 65 61 2e 62 6f |= drawin|gArea.bo|
|00001410| 74 74 6f 6d 20 2d 20 34 | 38 3b 0d 09 49 6e 73 65 |ttom - 4|8;..Inse|
|00001420| 74 52 65 63 74 28 26 64 | 72 61 77 69 6e 67 41 72 |tRect(&d|rawingAr|
|00001430| 65 61 2c 20 31 31 2c 20 | 31 31 29 3b 0d 09 28 2a |ea, 11, |11);..(*|
|00001440| 69 6e 66 6f 29 2d 3e 64 | 72 61 77 69 6e 67 41 72 |info)->d|rawingAr|
|00001450| 65 61 20 3d 20 64 72 61 | 77 69 6e 67 41 72 65 61 |ea = dra|wingArea|
|00001460| 3b 0d 0d 09 2f 2a 20 44 | 65 66 69 6e 65 20 74 68 |;.../* D|efine th|
|00001470| 65 20 61 72 65 61 20 77 | 68 65 72 65 20 74 68 65 |e area w|here the|
|00001480| 20 63 75 72 72 20 65 6e | 74 72 79 20 6e 75 6d 62 | curr en|try numb|
|00001490| 65 72 2c 20 23 20 6f 66 | 20 65 6e 74 72 69 65 73 |er, # of| entries|
|000014a0| 2c 20 2a 2f 0d 09 2f 2a | 20 61 6e 64 20 65 6e 74 |, */../*| and ent|
|000014b0| 72 79 20 74 79 70 65 73 | 20 77 69 6c 6c 20 62 65 |ry types| will be|
|000014c0| 20 64 72 61 77 6e 2e 09 | 09 09 09 09 09 09 20 20 | drawn..|...... |
|000014d0| 2a 2f 0d 09 73 74 61 74 | 75 73 41 72 65 61 20 3d |*/..stat|usArea =|
|000014e0| 20 6e 65 77 57 69 6e 64 | 6f 77 2d 3e 70 6f 72 74 | newWind|ow->port|
|000014f0| 52 65 63 74 3b 0d 09 73 | 74 61 74 75 73 41 72 65 |Rect;..s|tatusAre|
|00001500| 61 2e 74 6f 70 20 3d 20 | 73 74 61 74 75 73 41 72 |a.top = |statusAr|
|00001510| 65 61 2e 62 6f 74 74 6f | 6d 20 2d 20 33 32 3b 0d |ea.botto|m - 32;.|
|00001520| 09 73 74 61 74 75 73 41 | 72 65 61 2e 62 6f 74 74 |.statusA|rea.bott|
|00001530| 6f 6d 20 2d 3d 20 36 3b | 0d 09 28 2a 69 6e 66 6f |om -= 6;|..(*info|
|00001540| 29 2d 3e 73 74 61 74 75 | 73 41 72 65 61 20 3d 20 |)->statu|sArea = |
|00001550| 73 74 61 74 75 73 41 72 | 65 61 3b 0d 09 0d 09 28 |statusAr|ea;....(|
|00001560| 2a 69 6e 66 6f 29 2d 3e | 66 52 65 66 4e 75 6d 20 |*info)->|fRefNum |
|00001570| 3d 20 72 65 66 4e 75 6d | 3b 0d 09 28 2a 69 6e 66 |= refNum|;..(*inf|
|00001580| 6f 29 2d 3e 66 69 6c 65 | 53 70 65 63 20 3d 20 66 |o)->file|Spec = f|
|00001590| 69 6c 65 54 6f 4f 70 65 | 6e 3b 0d 09 65 72 72 20 |ileToOpe|n;..err |
|000015a0| 3d 20 43 6f 75 6e 74 53 | 63 72 61 70 62 6f 6f 6b |= CountS|crapbook|
|000015b0| 45 6e 74 72 69 65 73 28 | 26 6e 75 6d 45 6e 74 72 |Entries(|&numEntr|
|000015c0| 69 65 73 29 3b 20 0d 09 | 69 66 20 28 65 72 72 20 |ies); ..|if (err |
|000015d0| 21 3d 20 6e 6f 45 72 72 | 29 20 67 6f 74 6f 20 65 |!= noErr|) goto e|
|000015e0| 72 72 6f 72 3b 0d 09 0d | 09 2f 2a 20 43 6f 6e 73 |rror;...|./* Cons|
|000015f0| 74 72 75 63 74 20 74 68 | 65 20 73 63 72 6f 6c 6c |truct th|e scroll|
|00001600| 20 62 61 72 20 2a 2f 0d | 09 53 65 74 52 65 63 74 | bar */.|.SetRect|
|00001610| 28 26 73 63 72 6f 6c 6c | 42 61 72 42 6f 75 6e 64 |(&scroll|BarBound|
|00001620| 73 2c 20 35 2c 20 6e 65 | 77 57 69 6e 64 6f 77 2d |s, 5, ne|wWindow-|
|00001630| 3e 70 6f 72 74 52 65 63 | 74 2e 62 6f 74 74 6f 6d |>portRec|t.bottom|
|00001640| 20 2d 20 34 30 2c 20 6e | 65 77 57 69 6e 64 6f 77 | - 40, n|ewWindow|
|00001650| 2d 3e 70 6f 72 74 52 65 | 63 74 2e 72 69 67 68 74 |->portRe|ct.right|
|00001660| 20 2d 20 35 2c 20 6e 65 | 77 57 69 6e 64 6f 77 2d | - 5, ne|wWindow-|
|00001670| 3e 70 6f 72 74 52 65 63 | 74 2e 62 6f 74 74 6f 6d |>portRec|t.bottom|
|00001680| 20 2d 20 32 34 29 3b 0d | 09 2f 2a 20 43 72 65 61 | - 24);.|./* Crea|
|00001690| 74 65 20 61 20 73 63 72 | 6f 6c 6c 20 62 61 72 20 |te a scr|oll bar |
|000016a0| 77 69 74 68 20 61 20 6d | 69 6e 69 6d 75 6d 20 76 |with a m|inimum v|
|000016b0| 61 6c 75 65 20 6f 66 20 | 31 20 61 6e 64 20 61 20 |alue of |1 and a |
|000016c0| 6d 61 78 2e 20 76 61 6c | 75 65 20 6f 66 20 6e 75 |max. val|ue of nu|
|000016d0| 6d 45 6e 74 72 69 65 73 | 20 2a 2f 0d 09 2f 2a 20 |mEntries| */../* |
|000016e0| 49 66 20 6e 75 6d 45 6e | 74 72 69 65 73 20 69 73 |If numEn|tries is|
|000016f0| 20 30 2c 20 74 68 69 73 | 20 77 6f 75 6c 64 20 70 | 0, this| would p|
|00001700| 72 65 73 65 6e 74 20 61 | 20 70 72 6f 62 6c 65 6d |resent a| problem|
|00001710| 2c 20 65 78 63 65 70 74 | 20 74 68 61 74 20 74 68 |, except| that th|
|00001720| 65 20 75 70 64 61 74 65 | 20 09 20 2a 2f 0d 09 2f |e update| . */../|
|00001730| 2a 20 72 6f 75 74 69 6e | 65 20 64 69 73 61 62 6c |* routin|e disabl|
|00001740| 65 73 20 74 68 65 20 73 | 63 72 6f 6c 6c 20 62 61 |es the s|croll ba|
|00001750| 72 20 69 66 20 6e 75 6d | 45 6e 74 72 69 65 73 20 |r if num|Entries |
|00001760| 3d 3d 20 30 2e 09 09 09 | 09 09 09 09 20 2a 2f 0d |== 0....|.... */.|
|00001770| 09 73 63 72 6f 6c 6c 42 | 61 72 20 3d 20 4e 65 77 |.scrollB|ar = New|
|00001780| 43 6f 6e 74 72 6f 6c 28 | 6e 65 77 57 69 6e 64 6f |Control(|newWindo|
|00001790| 77 2c 20 26 73 63 72 6f | 6c 6c 42 61 72 42 6f 75 |w, &scro|llBarBou|
|000017a0| 6e 64 73 2c 20 22 5c 70 | 22 2c 20 74 72 75 65 2c |nds, "\p|", true,|
|000017b0| 20 31 2c 20 31 2c 20 6e | 75 6d 45 6e 74 72 69 65 | 1, 1, n|umEntrie|
|000017c0| 73 2c 20 73 63 72 6f 6c | 6c 42 61 72 50 72 6f 63 |s, scrol|lBarProc|
|000017d0| 2c 20 30 29 3b 0d 09 28 | 2a 69 6e 66 6f 29 2d 3e |, 0);..(|*info)->|
|000017e0| 73 65 6c 65 63 74 69 6f | 6e 42 61 72 20 3d 20 73 |selectio|nBar = s|
|000017f0| 63 72 6f 6c 6c 42 61 72 | 3b 0d 09 28 2a 69 6e 66 |crollBar|;..(*inf|
|00001800| 6f 29 2d 3e 6e 75 6d 45 | 6e 74 72 69 65 73 20 3d |o)->numE|ntries =|
|00001810| 20 6e 75 6d 45 6e 74 72 | 69 65 73 3b 0d 09 69 66 | numEntr|ies;..if|
|00001820| 20 28 6e 75 6d 45 6e 74 | 72 69 65 73 20 3e 20 30 | (numEnt|ries > 0|
|00001830| 29 20 7b 0d 09 09 28 2a | 69 6e 66 6f 29 2d 3e 63 |) {...(*|info)->c|
|00001840| 75 72 72 45 6e 74 72 79 | 4e 75 6d 20 3d 20 31 3b |urrEntry|Num = 1;|
|00001850| 09 09 09 2f 2a 20 53 65 | 6c 65 63 74 20 65 6e 74 |.../* Se|lect ent|
|00001860| 72 79 20 23 20 31 20 2a | 2f 0d 09 09 65 72 72 20 |ry # 1 *|/...err |
|00001870| 3d 20 47 65 74 42 65 73 | 74 54 79 70 65 28 31 2c |= GetBes|tType(1,|
|00001880| 20 26 73 63 72 61 74 63 | 68 54 79 70 65 29 3b 09 | &scratc|hType);.|
|00001890| 2f 2a 20 47 65 74 20 74 | 68 65 20 64 65 66 61 75 |/* Get t|he defau|
|000018a0| 6c 74 20 74 79 70 65 20 | 66 6f 72 20 65 6e 74 72 |lt type |for entr|
|000018b0| 79 20 31 20 2a 2f 0d 09 | 09 69 66 20 28 65 72 72 |y 1 */..|.if (err|
|000018c0| 20 21 3d 20 6e 6f 45 72 | 72 29 20 67 6f 74 6f 20 | != noEr|r) goto |
|000018d0| 65 72 72 6f 72 3b 0d 09 | 09 28 2a 69 6e 66 6f 29 |error;..|.(*info)|
|000018e0| 2d 3e 63 75 72 72 45 6e | 74 72 79 54 79 70 65 20 |->currEn|tryType |
|000018f0| 3d 20 73 63 72 61 74 63 | 68 54 79 70 65 3b 0d 09 |= scratc|hType;..|
|00001900| 7d 0d 09 0d 09 2f 2a 20 | 45 76 65 72 79 74 68 69 |}..../* |Everythi|
|00001910| 6e 67 20 77 6f 72 6b 65 | 64 2c 20 73 6f 20 73 65 |ng worke|d, so se|
|00001920| 74 20 75 70 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |t up the| window |
|00001930| 61 6e 64 20 64 69 73 70 | 6c 61 79 20 69 74 20 2a |and disp|lay it *|
|00001940| 2f 0d 09 53 65 74 57 52 | 65 66 43 6f 6e 28 6e 65 |/..SetWR|efCon(ne|
|00001950| 77 57 69 6e 64 6f 77 2c | 20 28 6c 6f 6e 67 29 69 |wWindow,| (long)i|
|00001960| 6e 66 6f 29 3b 0d 09 53 | 65 74 57 54 69 74 6c 65 |nfo);..S|etWTitle|
|00001970| 28 6e 65 77 57 69 6e 64 | 6f 77 2c 20 66 69 6c 65 |(newWind|ow, file|
|00001980| 54 6f 4f 70 65 6e 2e 6e | 61 6d 65 29 3b 0d 09 53 |ToOpen.n|ame);..S|
|00001990| 68 6f 77 57 69 6e 64 6f | 77 28 6e 65 77 57 69 6e |howWindo|w(newWin|
|000019a0| 64 6f 77 29 3b 0d 09 44 | 6f 55 70 64 61 74 65 28 |dow);..D|oUpdate(|
|000019b0| 6e 65 77 57 69 6e 64 6f | 77 29 3b 0d 09 67 6f 74 |newWindo|w);..got|
|000019c0| 6f 20 73 75 63 63 65 73 | 73 3b 0d 09 0d 65 72 72 |o succes|s;...err|
|000019d0| 6f 72 3a 0d 09 2f 2a 20 | 49 66 20 74 68 65 72 65 |or:../* |If there|
|000019e0| 20 77 61 73 20 61 20 70 | 72 6f 62 6c 65 6d 2c 20 | was a p|roblem, |
|000019f0| 74 68 65 6e 20 64 69 73 | 70 6f 73 65 20 6f 66 20 |then dis|pose of |
|00001a00| 61 6e 79 20 61 6c 6c 6f | 63 61 74 65 64 20 6d 65 |any allo|cated me|
|00001a10| 6d 6f 72 79 20 61 6e 64 | 20 63 6c 6f 73 65 20 74 |mory and| close t|
|00001a20| 68 65 20 66 69 6c 65 20 | 2a 2f 0d 09 69 66 20 28 |he file |*/..if (|
|00001a30| 72 65 66 4e 75 6d 20 3e | 20 30 29 0d 09 09 43 6c |refNum >| 0)...Cl|
|00001a40| 6f 73 65 52 65 73 46 69 | 6c 65 28 72 65 66 4e 75 |oseResFi|le(refNu|
|00001a50| 6d 29 3b 0d 09 69 66 20 | 28 69 6e 66 6f 20 21 3d |m);..if |(info !=|
|00001a60| 20 4e 55 4c 4c 29 0d 09 | 09 44 69 73 70 6f 73 48 | NULL)..|.DisposH|
|00001a70| 61 6e 64 6c 65 28 28 48 | 61 6e 64 6c 65 29 69 6e |andle((H|andle)in|
|00001a80| 66 6f 29 3b 0d 09 69 66 | 20 28 6e 65 77 57 69 6e |fo);..if| (newWin|
|00001a90| 64 6f 77 20 21 3d 20 4e | 55 4c 4c 29 0d 09 09 43 |dow != N|ULL)...C|
|00001aa0| 6c 6f 73 65 57 69 6e 64 | 6f 77 28 6e 65 77 57 69 |loseWind|ow(newWi|
|00001ab0| 6e 64 6f 77 29 3b 0d 09 | 69 66 20 28 73 74 6f 72 |ndow);..|if (stor|
|00001ac0| 61 67 65 20 21 3d 20 4e | 55 4c 4c 29 0d 09 09 44 |age != N|ULL)...D|
|00001ad0| 69 73 70 6f 73 50 74 72 | 28 73 74 6f 72 61 67 65 |isposPtr|(storage|
|00001ae0| 29 3b 0d 0d 73 75 63 63 | 65 73 73 3a 0d 09 72 65 |);..succ|ess:..re|
|00001af0| 74 75 72 6e 20 65 72 72 | 3b 0d 7d 20 2f 2a 20 4e |turn err|;.} /* N|
|00001b00| 65 77 44 69 73 70 6c 61 | 79 57 69 6e 64 6f 77 20 |ewDispla|yWindow |
|00001b10| 2a 2f 0d 0d 0d 76 6f 69 | 64 20 43 6c 6f 73 65 41 |*/...voi|d CloseA|
|00001b20| 57 69 6e 64 6f 77 20 28 | 57 69 6e 64 6f 77 50 74 |Window (|WindowPt|
|00001b30| 72 20 77 68 69 63 68 57 | 69 6e 64 6f 77 29 0d 7b |r whichW|indow).{|
|00001b40| 0d 09 73 68 6f 72 74 09 | 09 77 4b 69 6e 64 3b 0d |..short.|.wKind;.|
|00001b50| 09 77 69 48 61 6e 64 09 | 09 69 6e 66 6f 3b 0d 0d |.wiHand.|.info;..|
|00001b60| 09 69 66 20 28 77 68 69 | 63 68 57 69 6e 64 6f 77 |.if (whi|chWindow|
|00001b70| 29 20 7b 0d 09 09 77 4b | 69 6e 64 20 3d 20 28 28 |) {...wK|ind = ((|
|00001b80| 57 69 6e 64 6f 77 50 65 | 65 6b 29 77 68 69 63 68 |WindowPe|ek)which|
|00001b90| 57 69 6e 64 6f 77 29 2d | 3e 77 69 6e 64 6f 77 4b |Window)-|>windowK|
|00001ba0| 69 6e 64 3b 0d 09 09 69 | 66 20 28 77 4b 69 6e 64 |ind;...i|f (wKind|
|00001bb0| 20 3c 20 30 29 0d 09 09 | 09 43 6c 6f 73 65 44 65 | < 0)...|.CloseDe|
|00001bc0| 73 6b 41 63 63 28 77 4b | 69 6e 64 29 3b 0d 09 09 |skAcc(wK|ind);...|
|00001bd0| 65 6c 73 65 20 69 66 20 | 28 77 4b 69 6e 64 20 3d |else if |(wKind =|
|00001be0| 3d 20 75 73 65 72 4b 69 | 6e 64 29 20 7b 0d 09 09 |= userKi|nd) {...|
|00001bf0| 09 69 6e 66 6f 20 3d 20 | 28 77 69 48 61 6e 64 29 |.info = |(wiHand)|
|00001c00| 47 65 74 57 52 65 66 43 | 6f 6e 28 77 68 69 63 68 |GetWRefC|on(which|
|00001c10| 57 69 6e 64 6f 77 29 3b | 0d 09 09 09 43 6c 6f 73 |Window);|....Clos|
|00001c20| 65 52 65 73 46 69 6c 65 | 28 28 2a 69 6e 66 6f 29 |eResFile|((*info)|
|00001c30| 2d 3e 66 52 65 66 4e 75 | 6d 29 3b 0d 09 09 09 44 |->fRefNu|m);....D|
|00001c40| 69 73 70 6f 73 48 61 6e | 64 6c 65 28 28 48 61 6e |isposHan|dle((Han|
|00001c50| 64 6c 65 29 69 6e 66 6f | 29 3b 0d 09 09 09 44 69 |dle)info|);....Di|
|00001c60| 73 70 6f 73 65 57 69 6e | 64 6f 77 28 77 68 69 63 |sposeWin|dow(whic|
|00001c70| 68 57 69 6e 64 6f 77 29 | 3b 0d 09 09 09 41 64 6a |hWindow)|;....Adj|
|00001c80| 75 73 74 4d 65 6e 75 73 | 3b 0d 09 09 7d 0d 09 7d |ustMenus|;...}..}|
|00001c90| 0d 7d 20 2f 2a 20 43 6c | 6f 73 65 41 57 69 6e 64 |.} /* Cl|oseAWind|
|00001ca0| 6f 77 20 2a 2f 0d 0d 0d | 2f 2a 2d 2d 2d 2d 2d 2d |ow */...|/*------|
|00001cb0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001cc0| 2d 20 48 61 6e 64 6c 65 | 20 77 69 6e 64 6f 77 20 |- Handle| window |
|00001cd0| 75 70 64 61 74 65 20 65 | 76 65 6e 74 73 20 2d 2d |update e|vents --|
|00001ce0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001cf0| 2d 2d 2d 2d 2a 2f 0d 0d | 0d 76 6f 69 64 20 44 6f |----*/..|.void Do|
|00001d00| 55 70 64 61 74 65 20 28 | 57 69 6e 64 6f 77 50 74 |Update (|WindowPt|
|00001d10| 72 20 77 70 29 0d 7b 0d | 09 52 65 63 74 20 09 09 |r wp).{.|.Rect ..|
|00001d20| 75 70 64 61 74 65 52 65 | 63 74 3b 0d 09 77 69 48 |updateRe|ct;..wiH|
|00001d30| 61 6e 64 09 09 69 6e 66 | 6f 20 3d 20 28 77 69 48 |and..inf|o = (wiH|
|00001d40| 61 6e 64 29 47 65 74 57 | 52 65 66 43 6f 6e 28 77 |and)GetW|RefCon(w|
|00001d50| 70 29 3b 0d 09 52 65 63 | 74 09 09 70 6f 72 74 52 |p);..Rec|t..portR|
|00001d60| 65 63 74 20 3d 20 77 70 | 2d 3e 70 6f 72 74 52 65 |ect = wp|->portRe|
|00001d70| 63 74 3b 0d 09 52 65 63 | 74 09 09 70 69 63 52 65 |ct;..Rec|t..picRe|
|00001d80| 63 74 3b 0d 09 52 67 6e | 48 61 6e 64 6c 65 09 6f |ct;..Rgn|Handle.o|
|00001d90| 6c 64 43 6c 69 70 20 3d | 20 4e 55 4c 4c 3b 0d 09 |ldClip =| NULL;..|
|00001da0| 52 65 63 74 09 09 64 72 | 61 77 69 6e 67 41 72 65 |Rect..dr|awingAre|
|00001db0| 61 2c 20 73 74 61 74 75 | 73 41 72 65 61 2c 20 64 |a, statu|sArea, d|
|00001dc0| 72 61 77 69 6e 67 46 72 | 61 6d 65 2c 20 70 69 63 |rawingFr|ame, pic|
|00001dd0| 46 72 61 6d 65 2c 20 73 | 63 61 6c 65 64 46 72 61 |Frame, s|caledFra|
|00001de0| 6d 65 3b 0d 09 52 65 73 | 54 79 70 65 09 09 72 65 |me;..Res|Type..re|
|00001df0| 73 54 79 70 65 4c 69 73 | 74 5b 31 30 5d 3b 0d 09 |sTypeLis|t[10];..|
|00001e00| 73 68 6f 72 74 09 09 6e | 75 6d 52 65 73 54 79 70 |short..n|umResTyp|
|00001e10| 65 73 2c 20 63 6f 75 6e | 74 3b 0d 09 4f 53 45 72 |es, coun|t;..OSEr|
|00001e20| 72 09 09 65 72 72 3b 0d | 09 53 74 72 32 35 35 09 |r..err;.|.Str255.|
|00001e30| 09 73 63 72 61 74 63 68 | 53 74 72 3b 0d 09 41 45 |.scratch|Str;..AE|
|00001e40| 44 65 73 63 09 09 63 75 | 72 72 49 74 65 6d 44 65 |Desc..cu|rrItemDe|
|00001e50| 73 63 3b 0d 09 0d 09 53 | 65 74 50 6f 72 74 28 77 |sc;....S|etPort(w|
|00001e60| 70 29 3b 09 20 09 09 09 | 09 09 2f 2a 20 6d 61 6b |p);. ...|../* mak|
|00001e70| 65 20 75 70 64 61 74 65 | 20 77 69 6e 64 6f 77 20 |e update| window |
|00001e80| 61 63 74 69 76 65 20 67 | 72 61 66 50 6f 72 74 09 |active g|rafPort.|
|00001e90| 2a 2f 0d 09 42 65 67 69 | 6e 55 70 64 61 74 65 28 |*/..Begi|nUpdate(|
|00001ea0| 77 70 29 3b 09 09 09 09 | 09 2f 2a 20 76 69 73 52 |wp);....|./* visR|
|00001eb0| 67 6e 20 74 65 6d 70 6f | 72 61 72 69 6c 79 20 3d |gn tempo|rarily =|
|00001ec0| 20 75 70 64 61 74 65 52 | 67 6e 09 09 2a 2f 0d 09 | updateR|gn..*/..|
|00001ed0| 45 72 61 73 65 52 65 63 | 74 28 26 70 6f 72 74 52 |EraseRec|t(&portR|
|00001ee0| 65 63 74 29 3b 0d 09 69 | 66 20 28 28 2a 69 6e 66 |ect);..i|f ((*inf|
|00001ef0| 6f 29 2d 3e 6e 75 6d 45 | 6e 74 72 69 65 73 20 3d |o)->numE|ntries =|
|00001f00| 3d 20 30 29 20 0d 09 09 | 48 69 6c 69 74 65 43 6f |= 0) ...|HiliteCo|
|00001f10| 6e 74 72 6f 6c 28 28 2a | 69 6e 66 6f 29 2d 3e 73 |ntrol((*|info)->s|
|00001f20| 65 6c 65 63 74 69 6f 6e | 42 61 72 2c 20 32 35 35 |election|Bar, 255|
|00001f30| 29 3b 0d 09 65 6c 73 65 | 0d 09 09 48 69 6c 69 74 |);..else|...Hilit|
|00001f40| 65 43 6f 6e 74 72 6f 6c | 28 28 2a 69 6e 66 6f 29 |eControl|((*info)|
|00001f50| 2d 3e 73 65 6c 65 63 74 | 69 6f 6e 42 61 72 2c 20 |->select|ionBar, |
|00001f60| 30 29 3b 0d 09 44 72 61 | 77 43 6f 6e 74 72 6f 6c |0);..Dra|wControl|
|00001f70| 73 28 77 70 29 3b 0d 09 | 0d 09 2f 2a 20 47 65 74 |s(wp);..|../* Get|
|00001f80| 20 74 68 65 20 61 72 65 | 61 73 20 6f 66 20 6f 75 | the are|as of ou|
|00001f90| 72 20 77 69 6e 64 6f 77 | 20 66 72 6f 6d 20 74 68 |r window| from th|
|00001fa0| 65 20 69 6e 66 6f 20 72 | 65 63 6f 72 64 20 2a 2f |e info r|ecord */|
|00001fb0| 0d 09 64 72 61 77 69 6e | 67 41 72 65 61 20 3d 20 |..drawin|gArea = |
|00001fc0| 28 2a 69 6e 66 6f 29 2d | 3e 64 72 61 77 69 6e 67 |(*info)-|>drawing|
|00001fd0| 41 72 65 61 3b 0d 09 73 | 74 61 74 75 73 41 72 65 |Area;..s|tatusAre|
|00001fe0| 61 20 3d 20 28 2a 69 6e | 66 6f 29 2d 3e 73 74 61 |a = (*in|fo)->sta|
|00001ff0| 74 75 73 41 72 65 61 3b | 0d 0d 09 2f 2a 20 44 72 |tusArea;|.../* Dr|
|00002000| 61 77 20 74 68 65 20 6e | 65 73 74 65 64 20 62 6f |aw the n|ested bo|
|00002010| 78 73 20 77 68 69 63 68 | 20 62 6f 75 6e 64 20 74 |xs which| bound t|
|00002020| 68 65 20 63 75 72 72 65 | 6e 74 6c 79 20 64 69 73 |he curre|ntly dis|
|00002030| 70 6c 61 79 65 64 20 65 | 6e 74 72 79 20 2a 2f 0d |played e|ntry */.|
|00002040| 09 50 65 6e 4e 6f 72 6d | 61 6c 28 29 3b 0d 09 46 |.PenNorm|al();..F|
|00002050| 6f 72 65 43 6f 6c 6f 72 | 28 62 6c 61 63 6b 43 6f |oreColor|(blackCo|
|00002060| 6c 6f 72 29 3b 0d 09 64 | 72 61 77 69 6e 67 46 72 |lor);..d|rawingFr|
|00002070| 61 6d 65 20 3d 20 64 72 | 61 77 69 6e 67 41 72 65 |ame = dr|awingAre|
|00002080| 61 3b 0d 09 49 6e 73 65 | 74 52 65 63 74 28 26 64 |a;..Inse|tRect(&d|
|00002090| 72 61 77 69 6e 67 46 72 | 61 6d 65 2c 20 2d 31 2c |rawingFr|ame, -1,|
|000020a0| 20 2d 31 29 3b 0d 09 50 | 65 6e 53 69 7a 65 28 31 | -1);..P|enSize(1|
|000020b0| 2c 20 31 29 3b 0d 09 46 | 72 61 6d 65 52 65 63 74 |, 1);..F|rameRect|
|000020c0| 28 26 64 72 61 77 69 6e | 67 46 72 61 6d 65 29 3b |(&drawin|gFrame);|
|000020d0| 0d 09 49 6e 73 65 74 52 | 65 63 74 28 26 64 72 61 |..InsetR|ect(&dra|
|000020e0| 77 69 6e 67 46 72 61 6d | 65 2c 20 2d 35 2c 20 2d |wingFram|e, -5, -|
|000020f0| 35 29 3b 0d 09 2f 2a 20 | 44 72 61 77 20 74 68 65 |5);../* |Draw the|
|00002100| 20 6c 61 72 67 65 20 66 | 72 61 6d 65 20 69 6e 20 | large f|rame in |
|00002110| 67 72 61 79 20 69 66 20 | 77 65 27 72 65 20 64 65 |gray if |we're de|
|00002120| 2d 61 63 74 69 76 61 74 | 65 64 20 2a 2f 0d 09 69 |-activat|ed */..i|
|00002130| 66 20 28 28 28 57 69 6e | 64 6f 77 50 65 65 6b 29 |f (((Win|dowPeek)|
|00002140| 77 70 29 2d 3e 68 69 6c | 69 74 65 64 20 3d 3d 20 |wp)->hil|ited == |
|00002150| 30 29 0d 09 09 50 65 6e | 50 61 74 28 71 64 2e 67 |0)...Pen|Pat(qd.g|
|00002160| 72 61 79 29 3b 0d 09 46 | 6f 72 65 43 6f 6c 6f 72 |ray);..F|oreColor|
|00002170| 28 62 6c 75 65 43 6f 6c | 6f 72 29 3b 0d 09 50 65 |(blueCol|or);..Pe|
|00002180| 6e 53 69 7a 65 28 33 2c | 20 33 29 3b 0d 09 46 72 |nSize(3,| 3);..Fr|
|00002190| 61 6d 65 52 65 63 74 28 | 26 64 72 61 77 69 6e 67 |ameRect(|&drawing|
|000021a0| 46 72 61 6d 65 29 3b 0d | 09 46 6f 72 65 43 6f 6c |Frame);.|.ForeCol|
|000021b0| 6f 72 28 62 6c 61 63 6b | 43 6f 6c 6f 72 29 3b 0d |or(black|Color);.|
|000021c0| 09 50 65 6e 4e 6f 72 6d | 61 6c 28 29 3b 0d 09 0d |.PenNorm|al();...|
|000021d0| 09 2f 2a 20 72 65 6d 65 | 6d 62 65 72 20 6f 75 72 |./* reme|mber our|
|000021e0| 20 6f 6c 64 20 63 6c 69 | 70 70 69 6e 67 20 72 65 | old cli|pping re|
|000021f0| 67 69 6f 6e 20 73 6f 20 | 77 65 20 63 61 6e 20 73 |gion so |we can s|
|00002200| 65 74 20 74 68 65 20 63 | 6c 69 70 20 62 65 66 6f |et the c|lip befo|
|00002210| 72 65 20 64 72 61 77 69 | 6e 67 20 2a 2f 0d 09 2f |re drawi|ng */../|
|00002220| 2a 20 63 65 72 74 61 69 | 6e 20 69 74 65 6d 73 20 |* certai|n items |
|00002230| 2a 2f 0d 09 6f 6c 64 43 | 6c 69 70 20 3d 20 4e 65 |*/..oldC|lip = Ne|
|00002240| 77 52 67 6e 28 29 3b 0d | 09 47 65 74 43 6c 69 70 |wRgn();.|.GetClip|
|00002250| 28 6f 6c 64 43 6c 69 70 | 29 3b 0d 09 0d 09 0d 09 |(oldClip|);......|
|00002260| 2f 2a 20 44 72 61 77 20 | 74 68 65 20 22 6e 75 6d |/* Draw |the "num|
|00002270| 62 65 72 20 6f 66 20 69 | 74 65 6d 73 22 20 73 74 |ber of i|tems" st|
|00002280| 61 74 69 73 74 69 63 20 | 2a 2f 0d 09 43 6c 69 70 |atistic |*/..Clip|
|00002290| 52 65 63 74 28 26 73 74 | 61 74 75 73 41 72 65 61 |Rect(&st|atusArea|
|000022a0| 29 3b 0d 09 54 65 78 74 | 46 6f 6e 74 28 6d 6f 6e |);..Text|Font(mon|
|000022b0| 61 63 6f 29 3b 20 54 65 | 78 74 53 69 7a 65 28 39 |aco); Te|xtSize(9|
|000022c0| 29 3b 20 54 65 78 74 46 | 61 63 65 28 30 29 3b 0d |); TextF|ace(0);.|
|000022d0| 09 4d 6f 76 65 54 6f 28 | 73 74 61 74 75 73 41 72 |.MoveTo(|statusAr|
|000022e0| 65 61 2e 6c 65 66 74 2c | 20 73 74 61 74 75 73 41 |ea.left,| statusA|
|000022f0| 72 65 61 2e 62 6f 74 74 | 6f 6d 20 2d 20 32 29 3b |rea.bott|om - 2);|
|00002300| 0d 09 4e 75 6d 54 6f 53 | 74 72 69 6e 67 28 28 2a |..NumToS|tring((*|
|00002310| 69 6e 66 6f 29 2d 3e 63 | 75 72 72 45 6e 74 72 79 |info)->c|urrEntry|
|00002320| 4e 75 6d 2c 20 73 63 72 | 61 74 63 68 53 74 72 29 |Num, scr|atchStr)|
|00002330| 3b 0d 09 44 72 61 77 53 | 74 72 69 6e 67 28 73 63 |;..DrawS|tring(sc|
|00002340| 72 61 74 63 68 53 74 72 | 29 3b 0d 09 44 72 61 77 |ratchStr|);..Draw|
|00002350| 53 74 72 69 6e 67 28 22 | 5c 70 20 2f 20 22 29 3b |String("|\p / ");|
|00002360| 0d 09 4e 75 6d 54 6f 53 | 74 72 69 6e 67 28 28 2a |..NumToS|tring((*|
|00002370| 69 6e 66 6f 29 2d 3e 6e | 75 6d 45 6e 74 72 69 65 |info)->n|umEntrie|
|00002380| 73 2c 20 73 63 72 61 74 | 63 68 53 74 72 29 3b 0d |s, scrat|chStr);.|
|00002390| 09 44 72 61 77 53 74 72 | 69 6e 67 28 73 63 72 61 |.DrawStr|ing(scra|
|000023a0| 74 63 68 53 74 72 29 3b | 0d 09 0d 09 2f 2a 20 44 |tchStr);|..../* D|
|000023b0| 72 61 77 20 74 68 65 20 | 6c 69 73 74 20 6f 66 20 |raw the |list of |
|000023c0| 72 65 73 6f 75 72 63 65 | 20 74 79 70 65 73 20 2a |resource| types *|
|000023d0| 2f 0d 09 6e 75 6d 52 65 | 73 54 79 70 65 73 20 3d |/..numRe|sTypes =|
|000023e0| 20 31 30 3b 0d 09 65 72 | 72 20 3d 20 47 65 74 41 | 10;..er|r = GetA|
|000023f0| 6c 6c 54 79 70 65 73 28 | 28 2a 69 6e 66 6f 29 2d |llTypes(|(*info)-|
|00002400| 3e 63 75 72 72 45 6e 74 | 72 79 4e 75 6d 2c 20 26 |>currEnt|ryNum, &|
|00002410| 6e 75 6d 52 65 73 54 79 | 70 65 73 2c 20 72 65 73 |numResTy|pes, res|
|00002420| 54 79 70 65 4c 69 73 74 | 29 3b 0d 09 69 66 20 28 |TypeList|);..if (|
|00002430| 65 72 72 20 3d 3d 20 6e | 6f 45 72 72 29 20 7b 0d |err == n|oErr) {.|
|00002440| 09 09 2f 2a 20 44 72 61 | 77 20 74 68 65 20 6c 69 |../* Dra|w the li|
|00002450| 73 74 20 6f 66 20 74 79 | 70 65 73 20 2a 2f 0d 09 |st of ty|pes */..|
|00002460| 09 4d 6f 76 65 54 6f 28 | 73 74 61 74 75 73 41 72 |.MoveTo(|statusAr|
|00002470| 65 61 2e 72 69 67 68 74 | 20 2d 20 6e 75 6d 52 65 |ea.right| - numRe|
|00002480| 73 54 79 70 65 73 20 2a | 20 53 74 72 69 6e 67 57 |sTypes *| StringW|
|00002490| 69 64 74 68 28 22 5c 70 | 20 20 20 20 20 20 22 29 |idth("\p| ")|
|000024a0| 20 2d 20 35 2c 20 0d 09 | 09 20 20 20 20 20 20 20 | - 5, ..|. |
|000024b0| 73 74 61 74 75 73 41 72 | 65 61 2e 62 6f 74 74 6f |statusAr|ea.botto|
|000024c0| 6d 20 2d 20 32 29 3b 0d | 09 09 66 6f 72 20 28 63 |m - 2);.|..for (c|
|000024d0| 6f 75 6e 74 20 3d 20 30 | 3b 20 63 6f 75 6e 74 20 |ount = 0|; count |
|000024e0| 3c 20 6e 75 6d 52 65 73 | 54 79 70 65 73 3b 20 63 |< numRes|Types; c|
|000024f0| 6f 75 6e 74 2b 2b 29 20 | 7b 0d 09 09 09 4f 53 54 |ount++) |{....OST|
|00002500| 79 70 65 54 6f 50 53 74 | 72 28 72 65 73 54 79 70 |ypeToPSt|r(resTyp|
|00002510| 65 4c 69 73 74 5b 63 6f | 75 6e 74 5d 2c 20 28 63 |eList[co|unt], (c|
|00002520| 68 61 72 20 2a 29 73 63 | 72 61 74 63 68 53 74 72 |har *)sc|ratchStr|
|00002530| 29 3b 0d 09 09 09 44 72 | 61 77 53 74 72 69 6e 67 |);....Dr|awString|
|00002540| 28 73 63 72 61 74 63 68 | 53 74 72 29 3b 0d 09 09 |(scratch|Str);...|
|00002550| 09 69 66 20 28 63 6f 75 | 6e 74 20 3c 20 6e 75 6d |.if (cou|nt < num|
|00002560| 52 65 73 54 79 70 65 73 | 20 2d 20 31 29 0d 09 09 |ResTypes| - 1)...|
|00002570| 09 09 44 72 61 77 53 74 | 72 69 6e 67 28 22 5c 70 |..DrawSt|ring("\p|
|00002580| 2c 20 22 29 3b 0d 09 09 | 7d 0d 09 7d 0d 09 0d 09 |, ");...|}..}....|
|00002590| 0d 09 2f 2a 20 44 72 61 | 77 20 74 68 65 20 63 75 |../* Dra|w the cu|
|000025a0| 72 72 65 6e 74 6c 79 20 | 73 65 6c 65 63 74 65 64 |rrently |selected|
|000025b0| 20 73 63 72 61 70 62 6f | 6f 6b 20 65 6e 74 72 79 | scrapbo|ok entry|
|000025c0| 20 2a 2f 0d 09 43 6c 69 | 70 52 65 63 74 28 26 64 | */..Cli|pRect(&d|
|000025d0| 72 61 77 69 6e 67 41 72 | 65 61 29 3b 0d 09 65 72 |rawingAr|ea);..er|
|000025e0| 72 20 3d 20 47 65 74 31 | 53 63 72 61 70 62 6f 6f |r = Get1|Scrapboo|
|000025f0| 6b 49 74 65 6d 20 28 28 | 2a 69 6e 66 6f 29 2d 3e |kItem ((|*info)->|
|00002600| 63 75 72 72 45 6e 74 72 | 79 4e 75 6d 2c 20 28 2a |currEntr|yNum, (*|
|00002610| 69 6e 66 6f 29 2d 3e 63 | 75 72 72 45 6e 74 72 79 |info)->c|urrEntry|
|00002620| 54 79 70 65 2c 20 26 63 | 75 72 72 49 74 65 6d 44 |Type, &c|urrItemD|
|00002630| 65 73 63 29 3b 0d 09 69 | 66 20 28 65 72 72 20 3d |esc);..i|f (err =|
|00002640| 3d 20 6e 6f 45 72 72 29 | 20 7b 0d 09 09 69 66 20 |= noErr)| {...if |
|00002650| 28 63 75 72 72 49 74 65 | 6d 44 65 73 63 2e 64 65 |(currIte|mDesc.de|
|00002660| 73 63 72 69 70 74 6f 72 | 54 79 70 65 20 3d 3d 20 |scriptor|Type == |
|00002670| 27 50 49 43 54 27 29 20 | 7b 0d 09 09 09 70 69 63 |'PICT') |{....pic|
|00002680| 46 72 61 6d 65 20 3d 20 | 28 2a 28 50 69 63 48 61 |Frame = |(*(PicHa|
|00002690| 6e 64 6c 65 29 63 75 72 | 72 49 74 65 6d 44 65 73 |ndle)cur|rItemDes|
|000026a0| 63 2e 64 61 74 61 48 61 | 6e 64 6c 65 29 2d 3e 70 |c.dataHa|ndle)->p|
|000026b0| 69 63 46 72 61 6d 65 3b | 0d 09 09 09 2f 2f 20 3c |icFrame;|....// <|
|000026c0| 3c 3c 20 43 72 65 61 74 | 65 20 61 20 70 72 6f 70 |<< Creat|e a prop|
|000026d0| 65 72 6c 79 20 73 63 61 | 6c 65 64 20 66 72 61 6d |erly sca|led fram|
|000026e0| 65 20 68 65 72 65 0d 09 | 09 09 44 72 61 77 50 69 |e here..|..DrawPi|
|000026f0| 63 74 75 72 65 28 28 50 | 69 63 48 61 6e 64 6c 65 |cture((P|icHandle|
|00002700| 29 63 75 72 72 49 74 65 | 6d 44 65 73 63 2e 64 61 |)currIte|mDesc.da|
|00002710| 74 61 48 61 6e 64 6c 65 | 2c 20 26 64 72 61 77 69 |taHandle|, &drawi|
|00002720| 6e 67 41 72 65 61 29 3b | 0d 09 09 7d 0d 09 09 65 |ngArea);|...}...e|
|00002730| 6c 73 65 20 69 66 20 28 | 63 75 72 72 49 74 65 6d |lse if (|currItem|
|00002740| 44 65 73 63 2e 64 65 73 | 63 72 69 70 74 6f 72 54 |Desc.des|criptorT|
|00002750| 79 70 65 20 3d 3d 20 27 | 54 45 58 54 27 29 20 7b |ype == '|TEXT') {|
|00002760| 0d 09 09 09 4d 6f 76 65 | 48 48 69 28 63 75 72 72 |....Move|HHi(curr|
|00002770| 49 74 65 6d 44 65 73 63 | 2e 64 61 74 61 48 61 6e |ItemDesc|.dataHan|
|00002780| 64 6c 65 29 3b 0d 09 09 | 09 48 4c 6f 63 6b 28 63 |dle);...|.HLock(c|
|00002790| 75 72 72 49 74 65 6d 44 | 65 73 63 2e 64 61 74 61 |urrItemD|esc.data|
|000027a0| 48 61 6e 64 6c 65 29 3b | 0d 09 09 09 54 65 78 74 |Handle);|....Text|
|000027b0| 46 6f 6e 74 28 74 69 6d | 65 73 29 3b 0d 09 09 09 |Font(tim|es);....|
|000027c0| 54 65 78 74 53 69 7a 65 | 28 30 29 3b 0d 09 09 09 |TextSize|(0);....|
|000027d0| 54 65 78 74 46 61 63 65 | 28 30 29 3b 0d 09 09 09 |TextFace|(0);....|
|000027e0| 54 65 78 74 42 6f 78 28 | 2a 63 75 72 72 49 74 65 |TextBox(|*currIte|
|000027f0| 6d 44 65 73 63 2e 64 61 | 74 61 48 61 6e 64 6c 65 |mDesc.da|taHandle|
|00002800| 2c 20 47 65 74 48 61 6e | 64 6c 65 53 69 7a 65 28 |, GetHan|dleSize(|
|00002810| 63 75 72 72 49 74 65 6d | 44 65 73 63 2e 64 61 74 |currItem|Desc.dat|
|00002820| 61 48 61 6e 64 6c 65 29 | 2c 20 26 64 72 61 77 69 |aHandle)|, &drawi|
|00002830| 6e 67 41 72 65 61 2c 20 | 74 65 4a 75 73 74 4c 65 |ngArea, |teJustLe|
|00002840| 66 74 29 3b 0d 09 09 7d | 0d 09 09 65 6c 73 65 20 |ft);...}|...else |
|00002850| 7b 0d 09 09 09 2f 2a 20 | 57 65 20 64 6f 6e 27 74 |{..../* |We don't|
|00002860| 20 6b 6e 6f 77 20 68 6f | 77 20 74 6f 20 64 72 61 | know ho|w to dra|
|00002870| 77 20 69 74 20 2a 2f 0d | 09 09 09 4d 6f 76 65 54 |w it */.|...MoveT|
|00002880| 6f 28 64 72 61 77 69 6e | 67 41 72 65 61 2e 6c 65 |o(drawin|gArea.le|
|00002890| 66 74 20 2b 20 32 2c 20 | 64 72 61 77 69 6e 67 41 |ft + 2, |drawingA|
|000028a0| 72 65 61 2e 74 6f 70 20 | 2b 20 31 38 29 3b 0d 09 |rea.top |+ 18);..|
|000028b0| 09 09 54 65 78 74 53 69 | 7a 65 28 31 32 29 3b 20 |..TextSi|ze(12); |
|000028c0| 54 65 78 74 46 6f 6e 74 | 28 74 69 6d 65 73 29 3b |TextFont|(times);|
|000028d0| 20 54 65 78 74 46 61 63 | 65 28 62 6f 6c 64 29 3b | TextFac|e(bold);|
|000028e0| 0d 09 09 09 44 72 61 77 | 53 74 72 69 6e 67 28 22 |....Draw|String("|
|000028f0| 5c 70 43 61 6e 6e 6f 74 | 20 64 69 73 70 6c 61 79 |\pCannot| display|
|00002900| 20 74 68 69 73 20 65 6e | 74 72 79 22 29 3b 0d 09 | this en|try");..|
|00002910| 09 7d 0d 09 09 28 76 6f | 69 64 29 20 41 45 44 69 |.}...(vo|id) AEDi|
|00002920| 73 70 6f 73 65 44 65 73 | 63 28 26 63 75 72 72 49 |sposeDes|c(&currI|
|00002930| 74 65 6d 44 65 73 63 29 | 3b 0d 09 7d 0d 09 0d 09 |temDesc)|;..}....|
|00002940| 53 65 74 43 6c 69 70 28 | 6f 6c 64 43 6c 69 70 29 |SetClip(|oldClip)|
|00002950| 3b 0d 09 44 69 73 70 6f | 73 65 52 67 6e 28 6f 6c |;..Dispo|seRgn(ol|
|00002960| 64 43 6c 69 70 29 3b 0d | 09 0d 09 44 72 61 77 43 |dClip);.|...DrawC|
|00002970| 6f 6e 74 72 6f 6c 73 28 | 77 70 29 3b 0d 09 45 6e |ontrols(|wp);..En|
|00002980| 64 55 70 64 61 74 65 28 | 77 70 29 3b 09 09 09 09 |dUpdate(|wp);....|
|00002990| 09 09 2f 2a 20 72 65 73 | 74 6f 72 65 20 6e 6f 72 |../* res|tore nor|
|000029a0| 6d 61 6c 20 76 69 73 52 | 67 6e 20 6f 66 20 67 72 |mal visR|gn of gr|
|000029b0| 61 66 70 6f 72 74 09 2a | 2f 0d 7d 20 2f 2a 20 44 |afport.*|/.} /* D|
|000029c0| 6f 55 70 64 61 74 65 20 | 2a 2f 0d 0d 0d 2f 2a 20 |oUpdate |*/.../* |
|000029d0| 54 68 69 73 20 69 73 20 | 63 61 6c 6c 65 64 20 77 |This is |called w|
|000029e0| 68 65 6e 65 76 65 72 20 | 61 20 77 69 6e 64 6f 77 |henever |a window|
|000029f0| 20 69 73 20 61 63 74 69 | 76 61 74 65 64 20 6f 72 | is acti|vated or|
|00002a00| 20 64 65 61 63 74 69 76 | 61 74 65 64 20 61 6e 64 | deactiv|ated and|
|00002a10| 20 69 73 20 72 65 73 70 | 6f 6e 73 69 62 6c 65 20 | is resp|onsible |
|00002a20| 2a 2f 0d 2f 2a 20 66 6f | 72 20 68 69 67 68 6c 69 |*/./* fo|r highli|
|00002a30| 67 68 74 69 6e 67 20 28 | 6f 72 20 64 69 6d 6d 69 |ghting (|or dimmi|
|00002a40| 6e 67 29 20 74 68 65 20 | 63 6f 6e 74 65 6e 74 73 |ng) the |contents|
|00002a50| 20 6f 66 20 74 68 65 20 | 77 69 6e 64 6f 77 20 61 | of the |window a|
|00002a60| 70 70 72 6f 70 72 69 61 | 74 65 6c 79 2e 09 09 20 |ppropria|tely... |
|00002a70| 20 20 2a 2f 0d 76 6f 69 | 64 20 44 6f 41 63 74 69 | */.voi|d DoActi|
|00002a80| 76 61 74 65 20 28 57 69 | 6e 64 6f 77 50 74 72 20 |vate (Wi|ndowPtr |
|00002a90| 77 70 2c 20 42 6f 6f 6c | 65 61 6e 20 61 63 74 69 |wp, Bool|ean acti|
|00002aa0| 76 61 74 65 29 0d 7b 09 | 0d 09 77 69 48 61 6e 64 |vate).{.|..wiHand|
|00002ab0| 09 69 6e 66 6f 20 3d 20 | 28 77 69 48 61 6e 64 29 |.info = |(wiHand)|
|00002ac0| 47 65 74 57 52 65 66 43 | 6f 6e 28 77 70 29 3b 0d |GetWRefC|on(wp);.|
|00002ad0| 09 0d 09 41 64 6a 75 73 | 74 4d 65 6e 75 73 28 29 |...Adjus|tMenus()|
|00002ae0| 3b 0d 09 53 65 74 50 6f | 72 74 28 77 70 29 3b 0d |;..SetPo|rt(wp);.|
|00002af0| 09 2f 2a 20 48 69 67 68 | 6c 69 67 68 74 20 74 68 |./* High|light th|
|00002b00| 65 20 73 65 6c 65 63 74 | 69 6f 6e 20 62 61 72 20 |e select|ion bar |
|00002b10| 61 70 70 72 6f 70 72 69 | 61 74 65 6c 79 20 2a 2f |appropri|ately */|
|00002b20| 0d 09 69 66 20 28 61 63 | 74 69 76 61 74 65 20 26 |..if (ac|tivate &|
|00002b30| 26 20 28 28 2a 69 6e 66 | 6f 29 2d 3e 6e 75 6d 45 |& ((*inf|o)->numE|
|00002b40| 6e 74 72 69 65 73 20 3e | 20 30 29 29 0d 09 09 48 |ntries >| 0))...H|
|00002b50| 69 6c 69 74 65 43 6f 6e | 74 72 6f 6c 28 28 2a 69 |iliteCon|trol((*i|
|00002b60| 6e 66 6f 29 2d 3e 73 65 | 6c 65 63 74 69 6f 6e 42 |nfo)->se|lectionB|
|00002b70| 61 72 2c 20 30 29 3b 0d | 09 65 6c 73 65 0d 09 09 |ar, 0);.|.else...|
|00002b80| 48 69 6c 69 74 65 43 6f | 6e 74 72 6f 6c 28 28 2a |HiliteCo|ntrol((*|
|00002b90| 69 6e 66 6f 29 2d 3e 73 | 65 6c 65 63 74 69 6f 6e |info)->s|election|
|00002ba0| 42 61 72 2c 20 32 35 35 | 29 3b 0d 09 2f 2a 20 52 |Bar, 255|);../* R|
|00002bb0| 65 64 72 61 77 20 74 68 | 65 20 77 69 6e 64 6f 77 |edraw th|e window|
|00002bc0| 20 73 6f 20 74 68 61 74 | 20 74 68 65 20 64 72 61 | so that| the dra|
|00002bd0| 77 69 6e 67 20 61 72 65 | 61 20 66 72 61 6d 65 20 |wing are|a frame |
|00002be0| 63 61 6e 20 62 65 20 67 | 72 61 79 65 64 20 6f 75 |can be g|rayed ou|
|00002bf0| 74 20 2a 2f 0d 09 2f 2a | 20 6f 72 20 68 69 67 68 |t */../*| or high|
|00002c00| 6c 69 67 68 74 65 64 2e | 09 09 09 09 09 09 09 09 |lighted.|........|
|00002c10| 09 09 09 09 09 20 20 2a | 2f 0d 09 49 6e 76 61 6c |..... *|/..Inval|
|00002c20| 52 65 63 74 28 26 77 70 | 2d 3e 70 6f 72 74 52 65 |Rect(&wp|->portRe|
|00002c30| 63 74 29 3b 0d 09 44 6f | 55 70 64 61 74 65 28 77 |ct);..Do|Update(w|
|00002c40| 70 29 3b 0d 7d 20 2f 2a | 20 44 6f 41 63 74 69 76 |p);.} /*| DoActiv|
|00002c50| 61 74 65 20 2a 2f 0d 0d | 0d 73 74 61 74 69 63 20 |ate */..|.static |
|00002c60| 70 61 73 63 61 6c 20 76 | 6f 69 64 20 43 6f 6e 74 |pascal v|oid Cont|
|00002c70| 72 6f 6c 41 63 74 69 6f | 6e 28 43 6f 6e 74 72 6f |rolActio|n(Contro|
|00002c80| 6c 48 61 6e 64 6c 65 20 | 77 68 69 63 68 43 6f 6e |lHandle |whichCon|
|00002c90| 74 72 6f 6c 2c 20 73 68 | 6f 72 74 20 70 61 72 74 |trol, sh|ort part|
|00002ca0| 29 3b 0d 2f 2a 20 48 65 | 72 65 27 73 20 61 6e 20 |);./* He|re's an |
|00002cb0| 61 63 74 69 6f 6e 20 70 | 72 6f 63 65 64 75 72 65 |action p|rocedure|
|00002cc0| 20 77 68 69 63 68 20 68 | 61 6e 64 6c 65 73 20 74 | which h|andles t|
|00002cd0| 68 65 20 63 61 73 65 20 | 77 68 65 72 65 20 74 68 |he case |where th|
|00002ce0| 65 20 75 73 65 72 20 2a | 2f 0d 2f 2a 20 68 6f 6c |e user *|/./* hol|
|00002cf0| 64 73 20 74 68 65 20 6d | 6f 75 73 65 20 64 6f 77 |ds the m|ouse dow|
|00002d00| 6e 20 69 6e 20 74 68 65 | 20 73 65 6c 65 63 74 69 |n in the| selecti|
|00002d10| 6f 6e 20 73 63 72 6f 6c | 6c 62 61 72 20 2a 2f 0d |on scrol|lbar */.|
|00002d20| 0d 73 74 61 74 69 63 20 | 70 61 73 63 61 6c 20 76 |.static |pascal v|
|00002d30| 6f 69 64 20 43 6f 6e 74 | 72 6f 6c 41 63 74 69 6f |oid Cont|rolActio|
|00002d40| 6e 28 43 6f 6e 74 72 6f | 6c 48 61 6e 64 6c 65 20 |n(Contro|lHandle |
|00002d50| 77 68 69 63 68 43 6f 6e | 74 72 6f 6c 2c 20 73 68 |whichCon|trol, sh|
|00002d60| 6f 72 74 20 70 61 72 74 | 29 0d 7b 0d 09 73 68 6f |ort part|).{..sho|
|00002d70| 72 74 09 76 61 6c 75 65 | 20 3d 20 47 65 74 43 74 |rt.value| = GetCt|
|00002d80| 6c 56 61 6c 75 65 28 77 | 68 69 63 68 43 6f 6e 74 |lValue(w|hichCont|
|00002d90| 72 6f 6c 29 3b 0d 09 0d | 09 73 77 69 74 63 68 28 |rol);...|.switch(|
|00002da0| 70 61 72 74 29 20 7b 0d | 09 09 63 61 73 65 20 69 |part) {.|..case i|
|00002db0| 6e 55 70 42 75 74 74 6f | 6e 3a 0d 09 09 09 76 61 |nUpButto|n:....va|
|00002dc0| 6c 75 65 20 2d 3d 20 31 | 3b 0d 09 09 62 72 65 61 |lue -= 1|;...brea|
|00002dd0| 6b 3b 0d 09 09 0d 09 09 | 63 61 73 65 20 69 6e 44 |k;......|case inD|
|00002de0| 6f 77 6e 42 75 74 74 6f | 6e 3a 0d 09 09 09 76 61 |ownButto|n:....va|
|00002df0| 6c 75 65 20 2b 3d 20 31 | 3b 0d 09 09 62 72 65 61 |lue += 1|;...brea|
|00002e00| 6b 3b 0d 09 09 0d 09 09 | 63 61 73 65 20 69 6e 50 |k;......|case inP|
|00002e10| 61 67 65 55 70 3a 0d 09 | 09 09 76 61 6c 75 65 20 |ageUp:..|..value |
|00002e20| 2d 3d 20 35 3b 0d 09 09 | 62 72 65 61 6b 3b 0d 09 |-= 5;...|break;..|
|00002e30| 09 0d 09 09 63 61 73 65 | 20 69 6e 50 61 67 65 44 |....case| inPageD|
|00002e40| 6f 77 6e 3a 0d 09 09 09 | 76 61 6c 75 65 20 2b 3d |own:....|value +=|
|00002e50| 20 35 3b 0d 09 09 62 72 | 65 61 6b 3b 0d 09 09 0d | 5;...br|eak;....|
|00002e60| 09 09 64 65 66 61 75 6c | 74 3a 0d 09 09 09 72 65 |..defaul|t:....re|
|00002e70| 74 75 72 6e 3b 0d 09 7d | 0d 09 0d 09 47 6f 54 6f |turn;..}|....GoTo|
|00002e80| 45 6e 74 72 79 28 28 2a | 77 68 69 63 68 43 6f 6e |Entry((*|whichCon|
|00002e90| 74 72 6f 6c 29 2d 3e 63 | 6f 6e 74 72 6c 4f 77 6e |trol)->c|ontrlOwn|
|00002ea0| 65 72 2c 20 76 61 6c 75 | 65 29 3b 0d 09 0d 7d 0d |er, valu|e);...}.|
|00002eb0| 0d 0d 76 6f 69 64 20 44 | 6f 43 6f 6e 74 65 6e 74 |..void D|oContent|
|00002ec0| 43 6c 69 63 6b 20 28 57 | 69 6e 64 6f 77 50 74 72 |Click (W|indowPtr|
|00002ed0| 20 77 68 69 63 68 57 69 | 6e 64 6f 77 2c 20 50 6f | whichWi|ndow, Po|
|00002ee0| 69 6e 74 20 67 6c 6f 62 | 61 6c 50 74 29 0d 7b 0d |int glob|alPt).{.|
|00002ef0| 09 50 6f 69 6e 74 09 09 | 6c 6f 63 61 6c 50 74 3b |.Point..|localPt;|
|00002f00| 0d 09 43 6f 6e 74 72 6f | 6c 48 61 6e 64 6c 65 20 |..Contro|lHandle |
|00002f10| 77 68 69 63 68 43 6f 6e | 74 72 6f 6c 3b 0d 09 73 |whichCon|trol;..s|
|00002f20| 68 6f 72 74 09 09 70 61 | 72 74 3b 0d 09 77 69 48 |hort..pa|rt;..wiH|
|00002f30| 61 6e 64 09 09 69 6e 66 | 6f 3b 0d 0d 09 69 66 20 |and..inf|o;...if |
|00002f40| 28 77 68 69 63 68 57 69 | 6e 64 6f 77 20 21 3d 20 |(whichWi|ndow != |
|00002f50| 46 72 6f 6e 74 57 69 6e | 64 6f 77 28 29 29 0d 09 |FrontWin|dow())..|
|00002f60| 09 53 65 6c 65 63 74 57 | 69 6e 64 6f 77 28 77 68 |.SelectW|indow(wh|
|00002f70| 69 63 68 57 69 6e 64 6f | 77 29 3b 0d 09 65 6c 73 |ichWindo|w);..els|
|00002f80| 65 20 7b 0d 09 09 53 65 | 74 50 6f 72 74 28 77 68 |e {...Se|tPort(wh|
|00002f90| 69 63 68 57 69 6e 64 6f | 77 29 3b 0d 09 09 6c 6f |ichWindo|w);...lo|
|00002fa0| 63 61 6c 50 74 20 3d 20 | 67 6c 6f 62 61 6c 50 74 |calPt = |globalPt|
|00002fb0| 3b 0d 09 09 47 6c 6f 62 | 61 6c 54 6f 4c 6f 63 61 |;...Glob|alToLoca|
|00002fc0| 6c 28 26 6c 6f 63 61 6c | 50 74 29 3b 0d 09 09 69 |l(&local|Pt);...i|
|00002fd0| 6e 66 6f 20 3d 20 28 77 | 69 48 61 6e 64 29 47 65 |nfo = (w|iHand)Ge|
|00002fe0| 74 57 52 65 66 43 6f 6e | 28 77 68 69 63 68 57 69 |tWRefCon|(whichWi|
|00002ff0| 6e 64 6f 77 29 3b 0d 09 | 09 0d 09 09 2f 2a 20 54 |ndow);..|..../* T|
|00003000| 68 65 20 6f 6e 6c 79 20 | 63 6c 69 63 6b 73 20 74 |he only |clicks t|
|00003010| 68 61 74 20 69 6e 74 65 | 72 65 73 74 20 75 73 20 |hat inte|rest us |
|00003020| 61 72 65 20 63 6c 69 63 | 6b 73 20 69 6e 20 74 68 |are clic|ks in th|
|00003030| 65 20 73 65 6c 65 63 74 | 69 6f 6e 20 73 63 72 6f |e select|ion scro|
|00003040| 6c 6c 62 61 72 20 2a 2f | 0d 09 09 69 66 20 28 70 |llbar */|...if (p|
|00003050| 61 72 74 20 3d 20 46 69 | 6e 64 43 6f 6e 74 72 6f |art = Fi|ndContro|
|00003060| 6c 28 6c 6f 63 61 6c 50 | 74 2c 20 77 68 69 63 68 |l(localP|t, which|
|00003070| 57 69 6e 64 6f 77 2c 20 | 26 77 68 69 63 68 43 6f |Window, |&whichCo|
|00003080| 6e 74 72 6f 6c 29 29 20 | 7b 0d 09 09 09 69 66 20 |ntrol)) |{....if |
|00003090| 28 70 61 72 74 20 3d 3d | 20 69 6e 54 68 75 6d 62 |(part ==| inThumb|
|000030a0| 29 20 7b 0d 09 09 09 09 | 54 72 61 63 6b 43 6f 6e |) {.....|TrackCon|
|000030b0| 74 72 6f 6c 28 77 68 69 | 63 68 43 6f 6e 74 72 6f |trol(whi|chContro|
|000030c0| 6c 2c 20 6c 6f 63 61 6c | 50 74 2c 20 4e 55 4c 4c |l, local|Pt, NULL|
|000030d0| 29 3b 0d 09 09 09 09 47 | 6f 54 6f 45 6e 74 72 79 |);.....G|oToEntry|
|000030e0| 28 77 68 69 63 68 57 69 | 6e 64 6f 77 2c 20 47 65 |(whichWi|ndow, Ge|
|000030f0| 74 43 74 6c 56 61 6c 75 | 65 28 77 68 69 63 68 43 |tCtlValu|e(whichC|
|00003100| 6f 6e 74 72 6f 6c 29 29 | 3b 0d 09 09 09 7d 20 65 |ontrol))|;....} e|
|00003110| 6c 73 65 0d 09 09 09 09 | 54 72 61 63 6b 43 6f 6e |lse.....|TrackCon|
|00003120| 74 72 6f 6c 28 77 68 69 | 63 68 43 6f 6e 74 72 6f |trol(whi|chContro|
|00003130| 6c 2c 20 6c 6f 63 61 6c | 50 74 2c 20 43 6f 6e 74 |l, local|Pt, Cont|
|00003140| 72 6f 6c 41 63 74 69 6f | 6e 29 3b 0d 09 09 09 0d |rolActio|n);.....|
|00003150| 09 09 7d 0d 09 09 0d 09 | 7d 0d 7d 20 2f 2a 20 44 |..}.....|}.} /* D|
|00003160| 6f 43 6f 6e 74 65 6e 74 | 43 6c 69 63 6b 20 2a 2f |oContent|Click */|
|00003170| 0d 0d 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003180| 00 00 01 00 00 00 01 9c | 00 00 00 9c 00 00 00 32 |........|.......2|
|00003190| 50 01 01 a2 51 02 20 ad | f9 f2 51 fc 02 00 44 26 |P...Q. .|..Q...D&|
|000031a0| 4b 51 03 20 2d fe 10 20 | 80 67 bb 55 01 2d 4b 16 |KQ. -.. |.g.U.-K.|
|000031b0| 09 57 69 6e 64 6f 77 73 | 2e 63 02 00 00 00 54 45 |.Windows|.c....TE|
|000031c0| 58 54 4b 41 48 4c 01 00 | 00 ca 00 09 00 00 00 00 |XTKAHL..|........|
|000031d0| 00 00 54 45 58 54 4b 41 | 48 4c 01 00 00 ca 00 09 |..TEXTKA|HL......|
|000031e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000031f0| 00 00 a5 19 0a 95 00 00 | 30 f2 00 00 01 ce 5f 02 |........|0....._.|
|00003200| 4a 2d f6 bf 67 01 67 2c | 98 52 59 54 13 48 68 00 |J-..g.g,|.RYT.Hh.|
|00003210| 02 48 7a 01 00 72 25 59 | 54 17 3f 10 72 ff 2f 01 |.Hz..r%Y|T.?.r./.|
|00003220| 70 01 1f 00 2f 2e 00 0c | 03 aa 45 28 5f 60 2a 98 |p.../...|..E(_`*.|
|00003230| 52 59 54 20 0f 01 00 46 | 25 59 54 20 10 01 a9 13 |RYT ...F|%YT ....|
|00003240| 28 5f 01 a0 1b 8d 04 66 | 0e 20 4b a0 1f 70 94 56 |(_.....f|. K..p.V|
|00003250| 50 01 01 da 67 01 39 7c | 71 01 00 6c 8d 2b 79 65 |P...g.9||q..l.+ye|
|00003260| 4e 4b 63 01 ff c4 41 42 | 55 30 76 5b 57 12 ff c4 |NKc...AB|U0v[W...|
|00003270| 4e ad 48 67 01 67 5e 31 | 32 c6 33 30 3b 6d d8 7f |N.Hg.g^1|2.30;m..|
|00003280| 00 00 00 98 00 07 00 00 | 1a 9a 00 00 1a a6 0d 43 |........|.......C|
|00003290| 6c 6f 73 65 41 57 69 6e | 64 6f 77 00 00 00 2c b4 |loseAWin|dow...,.|
|000032a0| 00 00 2c c1 0d 43 6f 6e | 74 72 6f 6c 41 63 74 69 |..,..Con|trolActi|
|000032b0| 6f 6e 00 00 29 fa 00 00 | 2a 04 0b 44 6f 41 63 74 |on..)...|*..DoAct|
|000032c0| 69 76 61 74 65 00 00 00 | 2e 37 00 00 2e 45 0f 44 |ivate...|.7...E.D|
|000032d0| 6f 43 6f 6e 74 65 6e 74 | 43 6c 69 63 6b 00 00 00 |oContent|Click...|
|000032e0| 1c 7e 00 00 1c 86 09 44 | 6f 55 70 64 61 74 65 00 |.~.....D|oUpdate.|
|000032f0| 00 00 0e ad 00 00 0e ad | 09 47 6f 54 6f 45 6e 74 |........|.GoToEnt|
|00003300| 72 79 00 00 0e b5 00 00 | 0e c5 11 4e 65 77 44 69 |ry......|...NewDi|
|00003310| 73 70 6c 61 79 57 69 6e | 64 6f 77 00 00 00 01 00 |splayWin|dow.....|
|00003320| 00 00 01 9c 00 00 00 9c | 00 00 00 32 01 06 f5 00 |........|...2....|
|00003330| 06 9e 00 00 00 1c 00 32 | 00 00 4d 50 53 52 00 00 |.......2|..MPSR..|
|00003340| 00 0a 03 ef ff ff 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+