home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 …ember: Reference Library / Apple Developer Reference Library (December 1999) (Disk 1).iso / pc / technical documentation / develop / develop issue 18 / develop issue 18 code / hierarchical lists.sea / Hierarchical Lists / Src / TwistDownList.c < prev    next >
MacBinary  |  1994-03-16  |  40.4 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).

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, Wed Mar 16 15:58:07 1994, modified Wed Mar 16 15:58:07 1994, creator Think C, type ASCII, 40635 bytes "TwistDownList.c" , at 0x9f3b 490 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 0f 54 77 69 73 74 44 | 6f 77 6e 4c 69 73 74 2e |..TwistD|ownList.|
|00000010| 63 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |c.......|........|
|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 9e bb 00 | 00 01 ea a9 ad 23 5f a9 |........|.....#_.|
|00000060| ad 23 5f 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 46 d9 00 00 |........|....F...|
|00000080| 2f 2a 09 09 09 09 09 09 | 09 09 09 54 77 69 73 74 |/*......|...Twist|
|00000090| 44 6f 77 6e 4c 69 73 74 | 2e 63 09 09 09 09 09 09 |DownList|.c......|
|000000a0| 09 09 2a 2f 0d 2f 2a 0d | 20 2a 20 4c 69 73 74 20 |..*/./*.| * List |
|000000b0| 49 6e 20 41 20 4c 69 73 | 74 20 53 61 6d 70 6c 65 |In A Lis|t Sample|
|000000c0| 0d 20 2a 20 54 77 69 73 | 74 44 6f 77 6e 4c 69 73 |. * Twis|tDownLis|
|000000d0| 74 2e 63 0d 20 2a 20 43 | 6f 70 79 72 69 67 68 74 |t.c. * C|opyright|
|000000e0| 20 a9 20 31 39 39 33 2d | 39 34 20 41 70 70 6c 65 | . 1993-|94 Apple|
|000000f0| 20 43 6f 6d 70 75 74 65 | 72 20 49 6e 63 2e 0d 20 | Compute|r Inc.. |
|00000100| 2a 0d 20 2a 20 54 77 69 | 73 74 44 6f 77 6e 4c 69 |*. * Twi|stDownLi|
|00000110| 73 74 20 6d 61 6e 61 67 | 65 73 20 61 6c 6c 20 61 |st manag|es all a|
|00000120| 73 70 65 63 74 73 20 6f | 66 20 74 68 65 20 22 74 |spects o|f the "t|
|00000130| 77 69 73 74 2d 64 6f 77 | 6e 22 20 6c 69 73 74 2c |wist-dow|n" list,|
|00000140| 20 61 20 6f 6e 65 2d 63 | 6f 6c 75 6d 6e 20 74 65 | a one-c|olumn te|
|00000150| 78 74 0d 20 2a 20 6c 69 | 73 74 20 77 68 65 72 65 |xt. * li|st where|
|00000160| 20 65 61 63 68 20 72 6f | 77 20 63 6f 6e 74 61 69 | each ro|w contai|
|00000170| 6e 73 20 61 20 74 72 69 | 61 6e 67 75 6c 61 72 20 |ns a tri|angular |
|00000180| 62 75 74 74 6f 6e 2e 20 | 54 68 65 20 62 75 74 74 |button. |The butt|
|00000190| 6f 6e 20 6d 61 79 20 62 | 65 20 69 6e 20 6f 6e 65 |on may b|e in one|
|000001a0| 20 6f 66 0d 20 2a 20 74 | 77 6f 20 73 74 61 74 65 | of. * t|wo state|
|000001b0| 73 3a 20 63 6c 6f 73 65 | 64 20 61 6e 64 20 6f 70 |s: close|d and op|
|000001c0| 65 6e 65 64 2e 20 57 68 | 65 6e 20 6f 70 65 6e 65 |ened. Wh|en opene|
|000001d0| 64 2c 20 73 75 62 2d 65 | 6c 65 6d 65 6e 74 73 20 |d, sub-e|lements |
|000001e0| 74 6f 20 74 68 69 73 20 | 72 6f 77 20 61 72 65 0d |to this |row are.|
|000001f0| 20 2a 20 64 69 73 70 6c | 61 79 65 64 2e 20 54 68 | * displ|ayed. Th|
|00000200| 65 20 74 77 69 73 74 2d | 64 6f 77 6e 20 6c 69 73 |e twist-|down lis|
|00000210| 74 20 69 73 20 67 65 6e | 65 72 61 6c 6c 79 20 62 |t is gen|erally b|
|00000220| 61 73 65 64 20 6f 6e 20 | 63 6f 64 65 20 66 72 6f |ased on |code fro|
|00000230| 6d 20 4e 65 77 73 57 61 | 74 63 68 65 72 0d 20 2a |m NewsWa|tcher. *|
|00000240| 20 62 79 20 53 74 65 76 | 65 20 46 61 6c 6b 65 6e | by Stev|e Falken|
|00000250| 62 75 72 67 2c 20 62 75 | 74 20 53 74 65 76 65 20 |burg, bu|t Steve |
|00000260| 73 61 79 73 20 74 68 61 | 74 20 74 68 65 20 63 6f |says tha|t the co|
|00000270| 64 65 20 77 61 73 20 6f | 72 69 67 69 6e 61 6c 6c |de was o|riginall|
|00000280| 79 20 77 72 69 74 74 65 | 6e 20 62 79 0d 20 2a 20 |y writte|n by. * |
|00000290| 4a 6f 68 6e 20 4e 6f 72 | 73 74 61 64 2e 0d 20 2a |John Nor|stad.. *|
|000002a0| 0d 20 2a 20 4e 6f 74 65 | 20 74 68 61 74 20 79 6f |. * Note| that yo|
|000002b0| 75 20 6d 75 73 74 20 70 | 72 6f 76 69 64 65 20 61 |u must p|rovide a|
|000002c0| 20 4c 44 45 46 20 73 74 | 75 62 20 72 65 73 6f 75 | LDEF st|ub resou|
|000002d0| 72 63 65 20 69 6e 20 79 | 6f 75 72 20 61 70 70 6c |rce in y|our appl|
|000002e0| 69 63 61 74 69 6f 6e 20 | 72 65 73 6f 75 72 63 65 |ication |resource|
|000002f0| 0d 20 2a 20 66 69 6c 65 | 2e 20 53 65 65 20 4c 69 |. * file|. See Li|
|00000300| 73 74 49 6e 41 4c 69 73 | 74 2e 72 20 66 6f 72 20 |stInALis|t.r for |
|00000310| 61 6e 20 65 78 61 6d 70 | 6c 65 2e 0d 20 2a 0d 20 |an examp|le.. *. |
|00000320| 2a 20 42 65 63 61 75 73 | 65 20 6f 66 20 74 68 65 |* Becaus|e of the|
|00000330| 20 77 61 79 20 74 68 61 | 74 20 74 68 65 20 63 61 | way tha|t the ca|
|00000340| 6c 6c 62 61 63 6b 20 4c | 44 45 46 20 69 73 20 6d |llback L|DEF is m|
|00000350| 61 6e 61 67 65 64 2c 20 | 69 74 20 6d 75 73 74 20 |anaged, |it must |
|00000360| 62 65 20 69 6e 20 74 68 | 65 0d 20 2a 20 61 70 70 |be in th|e. * app|
|00000370| 6c 69 63 61 74 69 6f 6e | 27 73 20 72 6f 6f 74 20 |lication|'s root |
|00000380| 73 65 67 6d 65 6e 74 2e | 20 49 66 20 74 68 69 73 |segment.| If this|
|00000390| 20 69 73 20 69 6e 61 70 | 70 72 6f 70 72 69 61 74 | is inap|propriat|
|000003a0| 65 2c 20 74 68 65 20 73 | 65 67 65 6d 65 6e 74 20 |e, the s|egement |
|000003b0| 72 65 73 6f 75 72 63 65 | 0d 20 2a 20 6d 75 73 74 |resource|. * must|
|000003c0| 20 62 65 20 6d 61 72 6b | 65 64 20 22 70 72 65 6c | be mark|ed "prel|
|000003d0| 6f 61 64 22 20 61 6e 64 | 20 22 6c 6f 63 6b 65 64 |oad" and| "locked|
|000003e0| 22 20 2d 2d 20 6f 74 68 | 65 72 77 69 73 65 2c 20 |" -- oth|erwise, |
|000003f0| 79 6f 75 72 20 70 72 6f | 67 72 61 6d 20 77 69 6c |your pro|gram wil|
|00000400| 6c 20 63 72 61 73 68 2e | 0d 20 2a 2f 0d 23 69 6e |l crash.|. */.#in|
|00000410| 63 6c 75 64 65 20 22 54 | 77 69 73 74 44 6f 77 6e |clude "T|wistDown|
|00000420| 4c 69 73 74 2e 68 22 0d | 23 69 6e 63 6c 75 64 65 |List.h".|#include|
|00000430| 20 3c 50 61 6c 65 74 74 | 65 73 2e 68 3e 0d 23 69 | <Palett|es.h>.#i|
|00000440| 6e 63 6c 75 64 65 20 3c | 47 65 73 74 61 6c 74 45 |nclude <|GestaltE|
|00000450| 71 75 2e 68 3e 0d 23 69 | 66 64 65 66 20 5f 5f 70 |qu.h>.#i|fdef __p|
|00000460| 6f 77 65 72 63 0d 2f 2a | 0d 20 2a 20 50 6f 77 65 |owerc./*|. * Powe|
|00000470| 72 50 43 20 53 79 73 74 | 65 6d 20 61 72 65 61 20 |rPC Syst|em area |
|00000480| 6c 6f 63 61 74 69 6f 6e | 73 20 69 6e 20 22 47 65 |location|s in "Ge|
|00000490| 74 22 20 61 6e 64 20 22 | 53 65 74 22 20 66 75 6e |t" and "|Set" fun|
|000004a0| 63 74 69 6f 6e 73 2e 20 | 54 68 65 79 20 61 72 65 |ctions. |They are|
|000004b0| 0d 20 2a 20 64 65 66 69 | 6e 65 64 20 69 6e 20 4c |. * defi|ned in L|
|000004c0| 6f 77 4d 65 6d 2e 68 0d | 20 2a 2f 0d 23 69 6e 63 |owMem.h.| */.#inc|
|000004d0| 6c 75 64 65 20 3c 4c 6f | 77 4d 65 6d 2e 68 3e 0d |lude <Lo|wMem.h>.|
|000004e0| 23 65 6c 73 65 0d 23 69 | 66 64 65 66 20 4d 50 57 |#else.#i|fdef MPW|
|000004f0| 0d 2f 2a 0d 20 2a 20 4d | 50 57 20 72 65 71 75 69 |./*. * M|PW requi|
|00000500| 72 65 73 20 61 20 72 65 | 66 65 72 65 6e 63 65 20 |res a re|ference |
|00000510| 74 6f 20 61 20 6c 6f 77 | 20 6d 65 6d 6f 72 79 20 |to a low| memory |
|00000520| 67 6c 6f 62 61 6c 20 74 | 6f 20 73 65 74 20 68 69 |global t|o set hi|
|00000530| 6c 69 74 69 6e 67 0d 20 | 2a 20 54 68 69 6e 6b 20 |liting. |* Think |
|00000540| 43 20 61 6e 64 20 4d 65 | 74 72 6f 57 6f 72 6b 73 |C and Me|troWorks|
|00000550| 20 69 6e 63 6c 75 64 65 | 73 20 53 79 73 45 71 75 | include|s SysEqu|
|00000560| 2e 68 20 69 6e 20 74 68 | 65 20 64 65 66 61 75 6c |.h in th|e defaul|
|00000570| 74 20 4d 61 63 48 65 61 | 64 65 72 73 20 66 69 6c |t MacHea|ders fil|
|00000580| 65 2e 0d 20 2a 2f 0d 23 | 69 6e 63 6c 75 64 65 20 |e.. */.#|include |
|00000590| 3c 53 79 73 45 71 75 2e | 68 3e 0d 23 69 6e 63 6c |<SysEqu.|h>.#incl|
|000005a0| 75 64 65 20 3c 52 65 73 | 6f 75 72 63 65 73 2e 68 |ude <Res|ources.h|
|000005b0| 3e 0d 23 65 6e 64 69 66 | 0d 23 65 6e 64 69 66 0d |>.#endif|.#endif.|
|000005c0| 0d 23 69 66 6e 64 65 66 | 20 4d 4f 4e 4f 43 48 52 |.#ifndef| MONOCHR|
|000005d0| 4f 4d 45 5f 46 49 4c 4c | 0d 23 64 65 66 69 6e 65 |OME_FILL|.#define|
|000005e0| 20 4d 4f 4e 4f 43 48 52 | 4f 4d 45 5f 46 49 4c 4c | MONOCHR|OME_FILL|
|000005f0| 09 30 0d 23 65 6e 64 69 | 66 0d 2f 2a 0d 20 2a 20 |.0.#endi|f./*. * |
|00000600| 41 20 63 6f 6d 6d 6f 6e | 20 4c 69 73 74 20 53 65 |A common| List Se|
|00000610| 6c 65 63 74 69 6f 6e 20 | 66 6c 61 67 20 76 61 72 |lection |flag var|
|00000620| 69 61 74 69 6f 6e 20 74 | 68 61 74 20 65 71 75 61 |iation t|hat equa|
|00000630| 74 65 73 20 53 68 69 66 | 74 20 61 6e 64 20 43 6f |tes Shif|t and Co|
|00000640| 6d 6d 61 6e 64 20 6b 65 | 79 73 2e 0d 20 2a 2f 0d |mmand ke|ys.. */.|
|00000650| 23 64 65 66 69 6e 65 20 | 53 45 4c 45 43 54 49 4f |#define |SELECTIO|
|00000660| 4e 5f 46 4c 41 47 53 09 | 5c 0d 09 28 6c 55 73 65 |N_FLAGS.|\..(lUse|
|00000670| 53 65 6e 73 65 20 7c 20 | 6c 4e 6f 52 65 63 74 20 |Sense | |lNoRect |
|00000680| 7c 20 6c 4e 6f 45 78 74 | 65 6e 64 20 7c 20 6c 4e || lNoExt|end | lN|
|00000690| 6f 4e 69 6c 48 69 6c 69 | 74 65 20 7c 20 6c 44 6f |oNilHili|te | lDo|
|000006a0| 56 41 75 74 6f 73 63 72 | 6f 6c 6c 29 0d 2f 2a 0d |VAutoscr|oll)./*.|
|000006b0| 20 2a 20 53 45 4c 45 43 | 54 49 4f 4e 5f 46 4c 41 | * SELEC|TION_FLA|
|000006c0| 47 53 2c 20 62 79 20 64 | 65 66 61 75 6c 74 2c 20 |GS, by d|efault, |
|000006d0| 61 6c 6c 6f 77 73 20 61 | 20 73 69 6e 67 6c 65 20 |allows a| single |
|000006e0| 6c 69 73 74 20 63 65 6c | 6c 20 74 6f 20 62 65 20 |list cel|l to be |
|000006f0| 73 65 6c 65 63 74 65 64 | 2e 0d 20 2a 2f 20 0d 23 |selected|.. */ .#|
|00000700| 69 66 6e 64 65 66 20 53 | 45 4c 45 43 54 49 4f 4e |ifndef S|ELECTION|
|00000710| 5f 46 4c 41 47 53 0d 23 | 64 65 66 69 6e 65 20 53 |_FLAGS.#|define S|
|00000720| 45 4c 45 43 54 49 4f 4e | 5f 46 4c 41 47 53 20 28 |ELECTION|_FLAGS (|
|00000730| 6c 4f 6e 6c 79 4f 6e 65 | 20 7c 20 6c 4e 6f 4e 69 |lOnlyOne| | lNoNi|
|00000740| 6c 48 69 6c 69 74 65 20 | 7c 20 6c 44 6f 56 41 75 |lHilite || lDoVAu|
|00000750| 74 6f 73 63 72 6f 6c 6c | 29 0d 23 65 6e 64 69 66 |toscroll|).#endif|
|00000760| 0d 2f 2a 0d 20 2a 20 6b | 41 6e 69 6d 61 74 69 6f |./*. * k|Animatio|
|00000770| 6e 44 65 6c 61 79 20 69 | 73 20 74 68 65 20 6e 75 |nDelay i|s the nu|
|00000780| 6d 62 65 72 20 6f 66 20 | 74 69 63 6b 73 20 74 6f |mber of |ticks to|
|00000790| 20 64 69 73 70 6c 61 79 | 20 74 68 65 20 69 6e 74 | display| the int|
|000007a0| 65 72 6d 65 64 69 61 74 | 65 0d 20 2a 20 22 74 77 |ermediat|e. * "tw|
|000007b0| 69 73 74 69 6e 67 22 20 | 67 6c 79 70 68 2e 0d 20 |isting" |glyph.. |
|000007c0| 2a 2f 0d 23 64 65 66 69 | 6e 65 20 6b 41 6e 69 6d |*/.#defi|ne kAnim|
|000007d0| 61 74 69 6f 6e 44 65 6c | 61 79 09 09 33 4c 0d 2f |ationDel|ay..3L./|
|000007e0| 2a 0d 20 2a 20 54 68 65 | 20 74 72 69 61 6e 67 6c |*. * The| triangl|
|000007f0| 65 20 67 61 70 20 70 61 | 72 61 6d 65 74 65 72 73 |e gap pa|rameters|
|00000800| 20 64 65 66 69 6e 65 20 | 74 68 65 20 61 6d 6f 75 | define |the amou|
|00000810| 6e 74 20 6f 66 20 73 70 | 61 63 65 20 74 6f 20 64 |nt of sp|ace to d|
|00000820| 69 73 70 6c 61 79 20 74 | 6f 20 74 68 65 0d 20 2a |isplay t|o the. *|
|00000830| 20 6c 65 66 74 20 61 6e | 64 20 72 69 67 68 74 20 | left an|d right |
|00000840| 6f 66 20 74 68 65 20 74 | 77 69 73 74 2d 64 6f 77 |of the t|wist-dow|
|00000850| 6e 20 74 72 69 61 6e 67 | 6c 65 2e 20 54 68 65 20 |n triang|le. The |
|00000860| 22 6f 75 74 73 69 64 65 | 20 67 61 70 22 20 69 73 |"outside| gap" is|
|00000870| 20 74 6f 20 74 68 65 20 | 6c 65 66 74 0d 20 2a 20 | to the |left. * |
|00000880| 6f 6e 20 52 6f 6d 61 6e | 2d 61 6c 70 68 61 62 65 |on Roman|-alphabe|
|00000890| 74 20 73 63 72 69 70 74 | 73 20 61 6e 64 20 6f 6e |t script|s and on|
|000008a0| 20 74 68 65 20 72 69 67 | 68 74 20 6f 6e 20 48 65 | the rig|ht on He|
|000008b0| 62 72 65 77 20 6f 72 20 | 41 72 61 62 69 63 20 73 |brew or |Arabic s|
|000008c0| 63 72 69 70 74 73 2e 0d | 20 2a 20 54 68 65 20 64 |cripts..| * The d|
|000008d0| 65 66 61 75 6c 74 20 76 | 61 6c 75 65 73 20 61 72 |efault v|alues ar|
|000008e0| 65 20 73 75 69 74 61 62 | 6c 65 20 66 6f 72 20 73 |e suitab|le for s|
|000008f0| 6d 61 6c 6c 20 66 6f 6e | 74 20 73 69 7a 65 73 2c |mall fon|t sizes,|
|00000900| 20 62 75 74 20 63 6f 75 | 6c 64 20 62 65 20 69 6e | but cou|ld be in|
|00000910| 63 72 65 61 73 65 64 0d | 20 2a 20 66 6f 72 20 6c |creased.| * for l|
|00000920| 61 72 67 65 20 73 69 7a | 65 73 2e 0d 20 2a 2f 0d |arge siz|es.. */.|
|00000930| 23 64 65 66 69 6e 65 20 | 6b 54 72 69 61 6e 67 6c |#define |kTriangl|
|00000940| 65 4f 75 74 73 69 64 65 | 47 61 70 09 09 28 31 29 |eOutside|Gap..(1)|
|00000950| 09 09 09 09 09 2f 2a 20 | 46 72 6f 6d 20 6d 61 72 |...../* |From mar|
|00000960| 67 69 6e 20 74 6f 20 62 | 75 74 74 6f 6e 09 2a 2f |gin to b|utton.*/|
|00000970| 0d 23 64 65 66 69 6e 65 | 20 6b 54 72 69 61 6e 67 |.#define| kTriang|
|00000980| 6c 65 49 6e 73 69 64 65 | 47 61 70 09 09 28 32 29 |leInside|Gap..(2)|
|00000990| 09 09 09 09 09 2f 2a 20 | 46 72 6f 6d 20 62 75 74 |...../* |From but|
|000009a0| 74 6f 6e 20 74 6f 20 74 | 65 78 74 09 09 2a 2f 0d |ton to t|ext..*/.|
|000009b0| 23 64 65 66 69 6e 65 20 | 6b 53 63 72 6f 6c 6c 42 |#define |kScrollB|
|000009c0| 61 72 57 69 64 74 68 09 | 09 09 28 31 36 29 09 09 |arWidth.|..(16)..|
|000009d0| 09 09 2f 2a 20 57 69 64 | 74 68 20 6f 66 20 61 20 |../* Wid|th of a |
|000009e0| 73 63 72 6f 6c 6c 20 62 | 61 72 09 2a 2f 0d 0d 2f |scroll b|ar.*/../|
|000009f0| 2a 0d 20 2a 20 54 68 65 | 20 4c 69 73 74 27 73 20 |*. * The| List's |
|00000a00| 75 73 65 72 48 61 6e 64 | 6c 65 20 63 6f 6e 74 61 |userHand|le conta|
|00000a10| 69 6e 73 20 6f 75 72 20 | 70 72 69 76 61 74 65 20 |ins our |private |
|00000a20| 63 6f 6e 74 65 78 74 20 | 69 6e 66 6f 72 6d 61 74 |context |informat|
|00000a30| 69 6f 6e 2e 20 54 68 65 | 20 50 6f 6c 79 48 61 6e |ion. The| PolyHan|
|00000a40| 64 6c 65 73 0d 20 2a 20 | 61 72 65 20 75 73 65 64 |dles. * |are used|
|00000a50| 20 74 6f 20 64 72 61 77 | 20 74 68 65 20 22 74 72 | to draw| the "tr|
|00000a60| 69 61 6e 67 6c 65 22 20 | 62 75 74 74 6f 6e 73 2e |iangle" |buttons.|
|00000a70| 20 4e 6f 74 65 20 74 68 | 61 74 20 74 68 65 79 20 | Note th|at they |
|00000a80| 61 72 65 20 64 72 61 77 | 6e 20 74 6f 20 74 68 65 |are draw|n to the|
|00000a90| 20 6c 69 73 74 0d 20 2a | 20 63 65 6c 6c 20 68 65 | list. *| cell he|
|00000aa0| 69 67 68 74 2e 20 57 68 | 65 6e 20 69 74 20 63 68 |ight. Wh|en it ch|
|00000ab0| 61 6e 67 65 73 2c 20 74 | 68 65 20 74 72 69 61 6e |anges, t|he trian|
|00000ac0| 67 6c 65 73 20 77 69 6c | 6c 20 62 65 20 72 65 63 |gles wil|l be rec|
|00000ad0| 6f 6e 73 74 72 75 63 74 | 65 64 2e 20 54 68 65 20 |onstruct|ed. The |
|00000ae0| 66 6f 6e 74 53 69 7a 65 | 2c 0d 20 2a 20 66 6f 6e |fontSize|,. * fon|
|00000af0| 74 4e 75 6d 62 65 72 2c | 20 61 6e 64 20 69 73 4c |tNumber,| and isL|
|00000b00| 65 66 74 4a 75 73 74 69 | 66 79 20 76 61 72 69 61 |eftJusti|fy varia|
|00000b10| 62 6c 65 73 20 61 72 65 | 20 75 73 65 64 20 74 6f |bles are| used to|
|00000b20| 20 64 72 61 77 20 74 68 | 65 20 6c 69 73 74 20 63 | draw th|e list c|
|00000b30| 65 6c 6c 20 63 6f 6e 74 | 65 6e 74 2e 0d 20 2a 2f |ell cont|ent.. */|
|00000b40| 0d 73 74 72 75 63 74 20 | 54 77 69 73 74 44 6f 77 |.struct |TwistDow|
|00000b50| 6e 50 72 69 76 61 74 65 | 52 65 63 6f 72 64 20 7b |nPrivate|Record {|
|00000b60| 0d 09 09 54 77 69 73 74 | 44 6f 77 6e 44 72 61 77 |...Twist|DownDraw|
|00000b70| 50 72 6f 63 09 64 72 61 | 77 50 72 6f 63 3b 09 09 |Proc.dra|wProc;..|
|00000b80| 09 09 2f 2a 20 54 68 69 | 73 20 64 72 61 77 73 20 |../* Thi|s draws |
|00000b90| 74 68 65 20 63 65 6c 6c | 20 64 61 74 61 09 2a 2f |the cell| data.*/|
|00000ba0| 0d 09 09 50 6f 6c 79 48 | 61 6e 64 6c 65 09 09 09 |...PolyH|andle...|
|00000bb0| 6f 70 65 6e 54 72 69 61 | 6e 67 6c 65 3b 09 09 09 |openTria|ngle;...|
|00000bc0| 2f 2a 20 54 68 65 20 22 | 65 78 70 61 6e 64 65 64 |/* The "|expanded|
|00000bd0| 22 20 62 75 74 74 6f 6e | 09 2a 2f 0d 09 09 50 6f |" button|.*/...Po|
|00000be0| 6c 79 48 61 6e 64 6c 65 | 09 09 09 63 6c 6f 73 65 |lyHandle|...close|
|00000bf0| 64 54 72 69 61 6e 67 6c | 65 3b 09 09 09 2f 2a 20 |dTriangl|e;.../* |
|00000c00| 54 68 65 20 22 63 6c 6f | 73 65 64 22 20 62 75 74 |The "clo|sed" but|
|00000c10| 74 6f 6e 09 09 2a 2f 0d | 09 09 50 6f 6c 79 48 61 |ton..*/.|..PolyHa|
|00000c20| 6e 64 6c 65 09 09 09 69 | 6e 74 65 72 6d 65 64 69 |ndle...i|ntermedi|
|00000c30| 61 74 65 54 72 69 61 6e | 67 6c 65 3b 09 2f 2a 20 |ateTrian|gle;./* |
|00000c40| 54 68 65 20 22 65 78 70 | 61 6e 64 69 6e 67 22 20 |The "exp|anding" |
|00000c50| 62 75 74 74 6f 6e 09 2a | 2f 0d 09 09 73 68 6f 72 |button.*|/...shor|
|00000c60| 74 09 09 09 09 74 61 62 | 49 6e 64 65 6e 74 3b 09 |t....tab|Indent;.|
|00000c70| 09 09 09 2f 2a 20 4e 65 | 77 54 77 69 73 74 44 6f |.../* Ne|wTwistDo|
|00000c80| 77 6e 4c 69 73 74 20 70 | 61 72 61 6d 09 2a 2f 0d |wnList p|aram.*/.|
|00000c90| 09 09 73 68 6f 72 74 09 | 09 09 09 66 6f 6e 74 53 |..short.|...fontS|
|00000ca0| 69 7a 65 3b 09 09 09 09 | 2f 2a 20 66 6f 72 20 54 |ize;....|/* for T|
|00000cb0| 65 78 74 53 69 7a 65 09 | 09 09 09 2a 2f 0d 09 09 |extSize.|...*/...|
|00000cc0| 73 68 6f 72 74 09 09 09 | 09 66 6f 6e 74 4e 75 6d |short...|.fontNum|
|00000cd0| 62 65 72 3b 09 09 09 09 | 2f 2a 20 66 6f 72 20 54 |ber;....|/* for T|
|00000ce0| 65 78 74 46 6f 6e 74 09 | 09 09 09 2a 2f 0d 09 09 |extFont.|...*/...|
|00000cf0| 42 6f 6f 6c 65 61 6e 09 | 09 09 09 63 61 6e 48 69 |Boolean.|...canHi|
|00000d00| 6c 69 74 65 53 65 6c 65 | 63 74 69 6f 6e 3b 09 09 |liteSele|ction;..|
|00000d10| 2f 2a 20 54 52 55 45 20 | 69 66 20 68 69 6c 69 74 |/* TRUE |if hilit|
|00000d20| 65 20 6f 6b 09 09 2a 2f | 0d 09 09 42 6f 6f 6c 65 |e ok..*/|...Boole|
|00000d30| 61 6e 09 09 09 09 69 73 | 4c 65 66 74 4a 75 73 74 |an....is|LeftJust|
|00000d40| 69 66 79 3b 09 09 09 2f | 2a 20 47 65 74 53 79 73 |ify;.../|* GetSys|
|00000d50| 4a 75 73 74 20 76 61 6c | 75 65 09 09 09 2a 2f 0d |Just val|ue...*/.|
|00000d60| 09 09 73 68 6f 72 74 09 | 09 09 09 74 72 69 61 6e |..short.|...trian|
|00000d70| 67 6c 65 57 69 64 74 68 | 3b 09 09 09 2f 2a 20 54 |gleWidth|;.../* T|
|00000d80| 77 69 73 74 2d 64 6f 77 | 6e 20 62 75 74 74 6f 6e |wist-dow|n button|
|00000d90| 20 77 69 64 74 68 09 2a | 2f 0d 7d 3b 0d 74 79 70 | width.*|/.};.typ|
|00000da0| 65 64 65 66 20 73 74 72 | 75 63 74 20 54 77 69 73 |edef str|uct Twis|
|00000db0| 74 44 6f 77 6e 50 72 69 | 76 61 74 65 52 65 63 6f |tDownPri|vateReco|
|00000dc0| 72 64 09 54 77 69 73 74 | 44 6f 77 6e 50 72 69 76 |rd.Twist|DownPriv|
|00000dd0| 61 74 65 52 65 63 6f 72 | 64 2c 0d 09 09 2a 54 77 |ateRecor|d,...*Tw|
|00000de0| 69 73 74 44 6f 77 6e 50 | 72 69 76 61 74 65 50 74 |istDownP|rivatePt|
|00000df0| 72 2c 20 2a 2a 54 77 69 | 73 74 44 6f 77 6e 50 72 |r, **Twi|stDownPr|
|00000e00| 69 76 61 74 65 48 64 6c | 3b 0d 0d 2f 2a 0d 20 2a |ivateHdl|;../*. *|
|00000e10| 20 54 68 65 20 64 65 2d | 72 65 66 65 72 65 6e 63 | The de-|referenc|
|00000e20| 65 64 20 70 72 69 76 61 | 74 65 20 64 61 74 61 20 |ed priva|te data |
|00000e30| 72 65 63 6f 72 64 20 69 | 73 20 74 6f 6f 20 6c 6f |record i|s too lo|
|00000e40| 6e 67 20 74 6f 20 74 79 | 70 65 20 65 61 63 68 20 |ng to ty|pe each |
|00000e50| 74 69 6d 65 20 69 74 20 | 61 70 70 65 61 72 73 0d |time it |appears.|
|00000e60| 20 2a 20 73 6f 20 69 74 | 20 77 69 6c 6c 20 62 65 | * so it| will be|
|00000e70| 20 64 65 66 69 6e 65 64 | 20 62 79 20 74 68 65 20 | defined| by the |
|00000e80| 50 52 49 56 41 54 45 20 | 6d 61 63 72 6f 2e 0d 20 |PRIVATE |macro.. |
|00000e90| 2a 2f 0d 23 64 65 66 69 | 6e 65 20 50 52 49 56 41 |*/.#defi|ne PRIVA|
|00000ea0| 54 45 09 09 09 28 2a 2a | 28 28 54 77 69 73 74 44 |TE...(**|((TwistD|
|00000eb0| 6f 77 6e 50 72 69 76 61 | 74 65 48 64 6c 29 20 28 |ownPriva|teHdl) (|
|00000ec0| 28 2a 2a 74 68 65 4c 69 | 73 74 29 2e 75 73 65 72 |(**theLi|st).user|
|00000ed0| 48 61 6e 64 6c 65 29 29 | 29 0d 2f 2a 0d 20 2a 20 |Handle))|)./*. * |
|00000ee0| 54 68 65 73 65 20 6d 61 | 63 72 6f 73 20 73 69 6d |These ma|cros sim|
|00000ef0| 70 6c 69 66 79 20 61 63 | 63 65 73 73 20 74 6f 20 |plify ac|cess to |
|00000f00| 74 68 65 20 66 6c 61 67 | 20 77 6f 72 64 20 69 6e |the flag| word in|
|00000f10| 20 74 68 65 20 6c 69 73 | 74 20 65 6c 65 6d 65 6e | the lis|t elemen|
|00000f20| 74 2e 0d 20 2a 2f 0d 23 | 64 65 66 69 6e 65 20 53 |t.. */.#|define S|
|00000f30| 65 74 54 44 46 6c 61 67 | 28 65 6c 65 6d 65 6e 74 |etTDFlag|(element|
|00000f40| 48 64 6c 2c 20 6d 61 73 | 6b 29 09 09 28 28 2a 2a |Hdl, mas|k)..((**|
|00000f50| 65 6c 65 6d 65 6e 74 48 | 64 6c 29 2e 66 6c 61 67 |elementH|dl).flag|
|00000f60| 20 7c 3d 20 28 6d 61 73 | 6b 29 29 0d 23 64 65 66 | |= (mas|k)).#def|
|00000f70| 69 6e 65 20 43 6c 65 61 | 72 54 44 46 6c 61 67 28 |ine Clea|rTDFlag(|
|00000f80| 65 6c 65 6d 65 6e 74 48 | 64 6c 2c 20 6d 61 73 6b |elementH|dl, mask|
|00000f90| 29 09 28 28 2a 2a 65 6c | 65 6d 65 6e 74 48 64 6c |).((**el|ementHdl|
|00000fa0| 29 2e 66 6c 61 67 20 26 | 3d 20 7e 28 6d 61 73 6b |).flag &|= ~(mask|
|00000fb0| 29 29 0d 23 64 65 66 69 | 6e 65 20 49 6e 76 65 72 |)).#defi|ne Inver|
|00000fc0| 74 54 44 46 6c 61 67 28 | 65 6c 65 6d 65 6e 74 48 |tTDFlag(|elementH|
|00000fd0| 64 6c 2c 20 6d 61 73 6b | 29 09 28 28 2a 2a 65 6c |dl, mask|).((**el|
|00000fe0| 65 6d 65 6e 74 48 64 6c | 29 2e 66 6c 61 67 20 5e |ementHdl|).flag ^|
|00000ff0| 3d 20 28 6d 61 73 6b 29 | 29 0d 23 64 65 66 69 6e |= (mask)|).#defin|
|00001000| 65 20 54 65 73 74 54 44 | 46 6c 61 67 28 65 6c 65 |e TestTD|Flag(ele|
|00001010| 6d 65 6e 74 48 64 6c 2c | 20 6d 61 73 6b 29 09 28 |mentHdl,| mask).(|
|00001020| 28 28 2a 2a 65 6c 65 6d | 65 6e 74 48 64 6c 29 2e |((**elem|entHdl).|
|00001030| 66 6c 61 67 20 26 20 28 | 6d 61 73 6b 29 29 20 21 |flag & (|mask)) !|
|00001040| 3d 20 30 29 0d 2f 2a 0d | 20 2a 20 54 68 65 20 70 |= 0)./*.| * The p|
|00001050| 72 6f 70 65 72 20 77 61 | 79 20 74 6f 20 62 75 69 |roper wa|y to bui|
|00001060| 6c 64 20 61 20 63 6f 6d | 70 69 6c 65 64 2d 69 6e |ld a com|piled-in|
|00001070| 20 4c 44 45 46 20 69 73 | 20 74 6f 20 70 6c 75 67 | LDEF is| to plug|
|00001080| 20 61 20 74 72 61 6e 73 | 66 65 72 20 61 64 64 72 | a trans|fer addr|
|00001090| 65 73 73 20 69 6e 74 6f | 20 61 0d 20 2a 20 73 74 |ess into| a. * st|
|000010a0| 75 62 20 63 6f 64 65 20 | 72 65 73 6f 75 72 63 65 |ub code |resource|
|000010b0| 2e 20 54 68 65 20 53 74 | 75 62 52 65 63 6f 72 64 |. The St|ubRecord|
|000010c0| 20 6d 75 73 74 20 74 72 | 61 63 6b 20 61 6e 79 20 | must tr|ack any |
|000010d0| 63 68 61 6e 67 65 73 20 | 69 6e 20 74 68 65 20 4c |changes |in the L|
|000010e0| 44 45 46 20 72 65 73 6f | 75 72 63 65 2e 0d 20 2a |DEF reso|urce.. *|
|000010f0| 20 54 68 65 20 23 70 72 | 61 67 6d 61 20 73 74 61 | The #pr|agma sta|
|00001100| 74 65 6d 65 6e 74 73 20 | 61 72 65 20 64 65 66 69 |tements |are defi|
|00001110| 6e 65 64 20 6f 6e 6c 79 | 20 66 6f 72 20 50 6f 77 |ned only| for Pow|
|00001120| 65 72 20 50 43 3a 20 74 | 68 65 79 20 67 69 76 65 |er PC: t|hey give|
|00001130| 20 65 72 72 6f 72 73 20 | 6f 6e 0d 20 2a 20 54 68 | errors |on. * Th|
|00001140| 69 6e 6b 20 43 2e 20 0d | 20 2a 2f 0d 23 69 66 64 |ink C. .| */.#ifd|
|00001150| 65 66 20 5f 5f 70 6f 77 | 65 72 63 0d 23 70 72 61 |ef __pow|erc.#pra|
|00001160| 67 6d 61 20 6f 70 74 69 | 6f 6e 73 20 61 6c 69 67 |gma opti|ons alig|
|00001170| 6e 3d 6d 61 63 36 38 6b | 0d 23 65 6e 64 69 66 0d |n=mac68k|.#endif.|
|00001180| 73 74 72 75 63 74 20 53 | 74 75 62 52 65 63 6f 72 |struct S|tubRecor|
|00001190| 64 20 7b 0d 09 6c 6f 6e | 67 09 09 09 6c 65 61 3b |d {..lon|g...lea;|
|000011a0| 09 09 09 2f 2a 09 4c 65 | 61 09 09 09 28 70 63 29 |.../*.Le|a...(pc)|
|000011b0| 2b 38 2c 61 30 09 09 09 | 09 09 2a 2f 0d 09 73 68 |+8,a0...|..*/..sh|
|000011c0| 6f 72 74 09 09 09 6d 6f | 76 65 61 3b 09 09 09 2f |ort...mo|vea;.../|
|000011d0| 2a 09 4d 6f 76 65 61 2e | 6c 09 09 28 61 30 29 2c |*.Movea.|l..(a0),|
|000011e0| 61 30 09 09 09 09 09 09 | 2a 2f 0d 09 73 68 6f 72 |a0......|*/..shor|
|000011f0| 74 09 09 09 6a 6d 70 3b | 09 09 09 2f 2a 09 6a 6d |t...jmp;|.../*.jm|
|00001200| 70 09 09 09 28 61 30 29 | 09 09 09 09 09 09 2a 2f |p...(a0)|......*/|
|00001210| 0d 09 50 72 6f 63 50 74 | 72 09 09 09 6c 64 65 66 |..ProcPt|r...ldef|
|00001220| 41 64 64 72 65 73 73 3b | 09 2f 2a 09 64 63 2e 6c |Address;|./*.dc.l|
|00001230| 09 09 30 09 09 09 09 09 | 09 09 2a 2f 0d 7d 3b 0d |..0.....|..*/.};.|
|00001240| 74 79 70 65 64 65 66 20 | 73 74 72 75 63 74 20 53 |typedef |struct S|
|00001250| 74 75 62 52 65 63 6f 72 | 64 09 2a 2a 53 74 75 62 |tubRecor|d.**Stub|
|00001260| 48 61 6e 64 6c 65 3b 0d | 23 69 66 64 65 66 20 5f |Handle;.|#ifdef _|
|00001270| 5f 70 6f 77 65 72 63 0d | 23 70 72 61 67 6d 61 20 |_powerc.|#pragma |
|00001280| 6f 70 74 69 6f 6e 73 20 | 61 6c 69 67 6e 3d 72 65 |options |align=re|
|00001290| 73 65 74 0d 23 65 6e 64 | 69 66 0d 0d 2f 2a 0d 20 |set.#end|if../*. |
|000012a0| 2a 20 4c 6f 63 61 6c 20 | 28 70 72 69 76 61 74 65 |* Local |(private|
|000012b0| 29 20 66 75 6e 63 74 69 | 6f 6e 73 2e 0d 20 2a 2f |) functi|ons.. */|
|000012c0| 0d 2f 2a 0d 20 2a 20 44 | 69 73 70 6f 73 65 20 6f |./*. * D|ispose o|
|000012d0| 66 20 61 20 50 6f 6c 79 | 48 61 6e 64 6c 65 2e 20 |f a Poly|Handle. |
|000012e0| 54 68 69 73 20 6d 75 73 | 74 20 62 65 20 61 20 6d |This mus|t be a m|
|000012f0| 61 63 72 6f 2e 20 54 68 | 65 20 61 72 67 75 6d 65 |acro. Th|e argume|
|00001300| 6e 74 0d 20 2a 20 6d 61 | 79 20 6e 6f 74 20 68 61 |nt. * ma|y not ha|
|00001310| 76 65 20 73 69 64 65 2d | 65 66 66 65 63 74 73 2e |ve side-|effects.|
|00001320| 0d 20 2a 2f 0d 23 64 65 | 66 69 6e 65 20 46 6f 72 |. */.#de|fine For|
|00001330| 67 65 74 50 6f 6c 79 28 | 74 68 65 50 6f 6c 79 29 |getPoly(|thePoly)|
|00001340| 20 64 6f 20 7b 09 09 5c | 0d 09 09 69 66 20 28 74 | do {..\|...if (t|
|00001350| 68 65 50 6f 6c 79 20 21 | 3d 20 4e 55 4c 4c 29 20 |hePoly !|= NULL) |
|00001360| 7b 09 20 09 09 5c 0d 09 | 09 09 4b 69 6c 6c 50 6f |{. ..\..|..KillPo|
|00001370| 6c 79 28 74 68 65 50 6f | 6c 79 29 3b 09 09 09 5c |ly(thePo|ly);...\|
|00001380| 0d 09 09 09 74 68 65 50 | 6f 6c 79 20 3d 20 4e 55 |....theP|oly = NU|
|00001390| 4c 4c 3b 09 09 09 09 5c | 0d 09 09 7d 09 09 09 09 |LL;....\|...}....|
|000013a0| 09 09 09 09 5c 0d 09 7d | 20 77 68 69 6c 65 20 28 |....\..}| while (|
|000013b0| 30 29 0d 23 64 65 66 69 | 6e 65 20 68 65 69 67 68 |0).#defi|ne heigh|
|000013c0| 74 28 72 29 09 09 28 28 | 72 29 2e 62 6f 74 74 6f |t(r)..((|r).botto|
|000013d0| 6d 20 2d 20 28 72 29 2e | 74 6f 70 29 0d 23 64 65 |m - (r).|top).#de|
|000013e0| 66 69 6e 65 20 77 69 64 | 74 68 28 72 29 09 09 28 |fine wid|th(r)..(|
|000013f0| 28 72 29 2e 72 69 67 68 | 74 20 2d 20 28 72 29 2e |(r).righ|t - (r).|
|00001400| 6c 65 66 74 29 0d 0d 73 | 74 61 74 69 63 20 73 68 |left)..s|tatic sh|
|00001410| 6f 72 74 09 09 09 09 09 | 43 6f 75 6e 74 56 69 73 |ort.....|CountVis|
|00001420| 69 62 6c 65 45 6c 65 6d | 65 6e 74 73 28 0d 09 09 |ibleElem|ents(...|
|00001430| 54 77 69 73 74 44 6f 77 | 6e 48 64 6c 09 09 09 09 |TwistDow|nHdl....|
|00001440| 74 77 69 73 74 44 6f 77 | 6e 48 61 6e 64 6c 65 0d |twistDow|nHandle.|
|00001450| 09 29 3b 0d 73 74 61 74 | 69 63 20 76 6f 69 64 20 |.);.stat|ic void |
|00001460| 09 09 09 09 09 43 6c 65 | 61 72 53 65 6c 65 63 74 |.....Cle|arSelect|
|00001470| 65 64 45 6c 65 6d 65 6e | 74 42 69 74 28 0d 09 09 |edElemen|tBit(...|
|00001480| 54 77 69 73 74 44 6f 77 | 6e 48 64 6c 09 09 09 09 |TwistDow|nHdl....|
|00001490| 74 77 69 73 74 44 6f 77 | 6e 48 61 6e 64 6c 65 0d |twistDow|nHandle.|
|000014a0| 09 29 3b 0d 73 74 61 74 | 69 63 20 76 6f 69 64 09 |.);.stat|ic void.|
|000014b0| 09 09 09 09 09 43 6f 70 | 79 53 65 6c 65 63 74 69 |.....Cop|ySelecti|
|000014c0| 6f 6e 53 74 61 74 65 54 | 6f 4c 69 73 74 28 0d 09 |onStateT|oList(..|
|000014d0| 09 4c 69 73 74 48 61 6e | 64 6c 65 09 09 09 09 09 |.ListHan|dle.....|
|000014e0| 74 68 65 4c 69 73 74 2c | 0d 09 09 73 68 6f 72 74 |theList,|...short|
|000014f0| 09 09 09 09 09 09 73 65 | 6c 65 63 74 65 64 52 6f |......se|lectedRo|
|00001500| 77 0d 09 29 3b 0d 73 74 | 61 74 69 63 20 76 6f 69 |w..);.st|atic voi|
|00001510| 64 09 09 09 09 09 09 53 | 65 74 45 6c 65 6d 65 6e |d......S|etElemen|
|00001520| 74 73 49 6e 4c 69 73 74 | 28 0d 09 09 4c 69 73 74 |tsInList|(...List|
|00001530| 48 61 6e 64 6c 65 09 09 | 09 09 09 74 68 65 4c 69 |Handle..|...theLi|
|00001540| 73 74 2c 0d 09 09 54 77 | 69 73 74 44 6f 77 6e 48 |st,...Tw|istDownH|
|00001550| 64 6c 09 09 09 09 74 77 | 69 73 74 44 6f 77 6e 48 |dl....tw|istDownH|
|00001560| 61 6e 64 6c 65 2c 0d 09 | 09 43 65 6c 6c 09 09 09 |andle,..|.Cell...|
|00001570| 09 09 09 2a 63 75 72 72 | 65 6e 74 43 65 6c 6c 0d |...*curr|entCell.|
|00001580| 09 29 3b 0d 73 74 61 74 | 69 63 20 70 61 73 63 61 |.);.stat|ic pasca|
|00001590| 6c 20 76 6f 69 64 09 09 | 09 09 54 77 69 73 74 44 |l void..|..TwistD|
|000015a0| 6f 77 6e 4c 44 45 46 28 | 0d 09 09 73 68 6f 72 74 |ownLDEF(|...short|
|000015b0| 09 09 09 09 09 09 6c 69 | 73 74 4d 65 73 73 61 67 |......li|stMessag|
|000015c0| 65 2c 0d 09 09 42 6f 6f | 6c 65 61 6e 09 09 09 09 |e,...Boo|lean....|
|000015d0| 09 09 6c 69 73 74 53 65 | 6c 65 63 74 2c 0d 09 09 |..listSe|lect,...|
|000015e0| 52 65 63 74 09 09 09 09 | 09 09 2a 6c 69 73 74 52 |Rect....|..*listR|
|000015f0| 65 63 74 2c 0d 09 09 43 | 65 6c 6c 09 09 09 09 09 |ect,...C|ell.....|
|00001600| 09 6c 69 73 74 43 65 6c | 6c 2c 0d 09 09 73 68 6f |.listCel|l,...sho|
|00001610| 72 74 09 09 09 09 09 09 | 6c 69 73 74 44 61 74 61 |rt......|listData|
|00001620| 4f 66 66 73 65 74 2c 0d | 09 09 73 68 6f 72 74 09 |Offset,.|..short.|
|00001630| 09 09 09 09 09 6c 69 73 | 74 44 61 74 61 4c 65 6e |.....lis|tDataLen|
|00001640| 2c 0d 09 09 4c 69 73 74 | 48 61 6e 64 6c 65 09 09 |,...List|Handle..|
|00001650| 09 09 09 6c 69 73 74 48 | 61 6e 64 6c 65 0d 09 29 |...listH|andle..)|
|00001660| 3b 0d 73 74 61 74 69 63 | 20 76 6f 69 64 09 09 09 |;.static| void...|
|00001670| 09 09 09 44 72 61 77 54 | 72 69 61 6e 67 6c 65 28 |...DrawT|riangle(|
|00001680| 0d 09 09 50 6f 6c 79 48 | 61 6e 64 6c 65 09 09 09 |...PolyH|andle...|
|00001690| 09 09 70 6f 6c 79 48 61 | 6e 64 6c 65 2c 0d 09 09 |..polyHa|ndle,...|
|000016a0| 50 6f 69 6e 74 09 09 09 | 09 09 09 70 6f 6c 79 50 |Point...|...polyP|
|000016b0| 6f 69 6e 74 2c 0d 09 09 | 42 6f 6f 6c 65 61 6e 09 |oint,...|Boolean.|
|000016c0| 09 09 09 09 09 69 73 53 | 65 6c 65 63 74 65 64 0d |.....isS|elected.|
|000016d0| 09 29 3b 0d 0d 2f 2a 20 | 2a 20 2a 20 2a 20 2a 20 |.);../* |* * * * |
|000016e0| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|000016f0| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|00001700| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|00001710| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|00001720| 2a 20 2a 20 2a 0d 20 2a | 20 4e 65 77 54 77 69 73 |* * *. *| NewTwis|
|00001730| 74 44 6f 77 6e 4c 69 73 | 74 0d 20 2a 0d 20 2a 20 |tDownLis|t. *. * |
|00001740| 43 72 65 61 74 65 20 61 | 20 74 77 69 73 74 2d 64 |Create a| twist-d|
|00001750| 6f 77 6e 20 6c 69 73 74 | 2e 20 42 65 66 6f 72 65 |own list|. Before|
|00001760| 20 63 61 6c 6c 69 6e 67 | 2c 20 79 6f 75 20 6d 75 | calling|, you mu|
|00001770| 73 74 20 73 65 74 20 74 | 68 65 20 70 6f 72 74 20 |st set t|he port |
|00001780| 74 6f 20 74 68 65 20 63 | 75 72 72 65 6e 74 0d 20 |to the c|urrent. |
|00001790| 2a 20 77 69 6e 64 6f 77 | 20 61 6e 64 20 73 70 65 |* window| and spe|
|000017a0| 63 69 66 79 20 74 68 65 | 20 66 6f 6e 74 20 61 6e |cify the| font an|
|000017b0| 64 20 66 6f 6e 74 20 73 | 69 7a 65 20 74 68 61 74 |d font s|ize that|
|000017c0| 20 69 73 20 74 6f 20 62 | 65 20 75 73 65 64 20 74 | is to b|e used t|
|000017d0| 6f 20 64 72 61 77 20 74 | 68 65 20 6c 69 73 74 2e |o draw t|he list.|
|000017e0| 0d 20 2a 20 4e 65 77 54 | 77 69 73 74 44 6f 77 6e |. * NewT|wistDown|
|000017f0| 4c 69 73 74 20 63 72 65 | 61 74 65 73 20 61 6e 20 |List cre|ates an |
|00001800| 65 6d 70 74 79 20 6f 6e | 65 2d 63 6f 6c 75 6d 6e |empty on|e-column|
|00001810| 20 6c 69 73 74 20 77 69 | 74 68 20 61 20 76 65 72 | list wi|th a ver|
|00001820| 74 69 63 61 6c 20 73 63 | 72 6f 6c 6c 20 62 61 72 |tical sc|roll bar|
|00001830| 0d 20 2a 20 61 6e 64 20 | 6e 6f 20 67 72 6f 77 20 |. * and |no grow |
|00001840| 62 6f 78 2e 20 4f 6e 6c | 79 20 6f 6e 65 20 69 74 |box. Onl|y one it|
|00001850| 65 6d 20 6d 61 79 20 62 | 65 20 73 65 6c 65 63 74 |em may b|e select|
|00001860| 65 64 20 61 74 20 61 20 | 74 69 6d 65 3b 20 62 75 |ed at a |time; bu|
|00001870| 74 20 74 68 69 73 20 63 | 6f 75 6c 64 0d 20 2a 20 |t this c|ould. * |
|00001880| 62 65 20 63 68 61 6e 67 | 65 64 20 62 79 20 74 68 |be chang|ed by th|
|00001890| 65 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 20 77 69 |e applic|ation wi|
|000018a0| 74 68 6f 75 74 20 64 69 | 66 66 69 63 75 6c 74 79 |thout di|fficulty|
|000018b0| 2e 0d 20 2a 0d 20 2a 20 | 4e 6f 74 65 3a 20 75 6e |.. *. * |Note: un|
|000018c0| 6c 69 6b 65 20 4c 4e 65 | 77 2c 20 74 68 65 20 76 |like LNe|w, the v|
|000018d0| 69 65 77 52 65 63 74 20 | 69 6e 63 6c 75 64 65 73 |iewRect |includes|
|000018e0| 20 74 68 65 20 76 65 72 | 74 69 63 61 6c 20 73 63 | the ver|tical sc|
|000018f0| 72 6f 6c 6c 20 62 61 72 | 2e 20 54 68 65 20 66 72 |roll bar|. The fr|
|00001900| 61 6d 65 0d 20 2a 20 61 | 6e 64 20 66 6f 63 75 73 |ame. * a|nd focus|
|00001910| 20 72 65 63 74 61 6e 67 | 6c 65 73 20 73 68 6f 75 | rectang|les shou|
|00001920| 6c 64 20 62 65 20 64 72 | 61 77 6e 20 6f 75 74 73 |ld be dr|awn outs|
|00001930| 69 64 65 20 6f 66 20 74 | 68 65 20 6c 69 73 74 27 |ide of t|he list'|
|00001940| 73 20 72 56 69 65 77 2e | 0d 20 2a 0d 20 2a 20 54 |s rView.|. *. * T|
|00001950| 68 65 20 74 61 62 49 6e | 64 65 6e 74 20 70 61 72 |he tabIn|dent par|
|00001960| 61 6d 65 74 65 72 20 73 | 68 6f 75 6c 64 20 62 65 |ameter s|hould be|
|00001970| 20 73 65 74 20 74 6f 20 | 74 68 65 20 61 6d 6f 75 | set to |the amou|
|00001980| 6e 74 20 74 6f 20 69 6e | 64 65 6e 74 20 73 75 63 |nt to in|dent suc|
|00001990| 63 65 73 73 69 76 65 20 | 6c 65 76 65 6c 73 0d 20 |cessive |levels. |
|000019a0| 2a 20 28 7a 65 72 6f 20 | 6d 65 61 6e 73 20 6e 6f |* (zero |means no|
|000019b0| 20 69 6e 64 65 6e 74 61 | 74 69 6f 6e 29 2e 20 53 | indenta|tion). S|
|000019c0| 65 74 74 69 6e 67 20 69 | 74 20 74 6f 20 74 68 65 |etting i|t to the|
|000019d0| 20 77 69 64 4d 61 78 20 | 76 61 6c 75 65 20 66 72 | widMax |value fr|
|000019e0| 6f 6d 20 74 68 65 20 63 | 75 72 72 65 6e 74 0d 20 |om the c|urrent. |
|000019f0| 2a 20 66 6f 6e 74 20 73 | 65 65 6d 73 20 72 65 61 |* font s|eems rea|
|00001a00| 73 6f 6e 61 62 6c 65 2e | 0d 20 2a 0d 20 2a 20 63 |sonable.|. *. * c|
|00001a10| 61 6e 48 69 6c 69 74 65 | 53 65 6c 65 63 74 69 6f |anHilite|Selectio|
|00001a20| 6e 20 73 68 6f 75 6c 64 | 20 62 65 20 54 52 55 45 |n should| be TRUE|
|00001a30| 20 66 6f 72 20 6e 6f 72 | 6d 61 6c 20 73 65 6c 65 | for nor|mal sele|
|00001a40| 63 74 69 6f 6e 20 28 74 | 68 65 20 73 65 6c 65 63 |ction (t|he selec|
|00001a50| 74 69 6f 6e 20 69 73 0d | 20 2a 20 68 69 6c 69 74 |tion is.| * hilit|
|00001a60| 65 64 29 2e 20 49 74 20 | 73 68 6f 75 6c 64 20 62 |ed). It |should b|
|00001a70| 65 20 46 41 4c 53 45 20 | 69 66 20 79 6f 75 20 77 |e FALSE |if you w|
|00001a80| 61 6e 74 20 74 6f 20 73 | 75 70 72 65 73 73 20 73 |ant to s|upress s|
|00001a90| 65 6c 65 63 74 69 6f 6e | 2e 20 42 65 63 61 75 73 |election|. Becaus|
|00001aa0| 65 0d 20 2a 20 68 69 72 | 65 61 72 63 68 69 63 61 |e. * hir|earchica|
|00001ab0| 6c 20 6c 69 73 74 73 20 | 6f 66 74 65 6e 20 22 73 |l lists |often "s|
|00001ac0| 65 6c 65 63 74 22 20 62 | 79 20 72 65 76 65 61 6c |elect" b|y reveal|
|00001ad0| 69 6e 67 20 61 20 73 75 | 62 2d 74 6f 70 69 63 2c |ing a su|b-topic,|
|00001ae0| 20 74 68 69 73 20 6d 61 | 79 20 62 65 0d 20 2a 20 | this ma|y be. * |
|00001af0| 6d 6f 72 65 20 72 65 61 | 73 6f 6e 61 62 6c 65 20 |more rea|sonable |
|00001b00| 69 6e 20 6d 61 6e 79 20 | 63 61 73 65 73 2e 0d 20 |in many |cases.. |
|00001b10| 2a 0d 20 2a 20 69 73 4c | 65 66 74 4a 75 73 74 69 |*. * isL|eftJusti|
|00001b20| 66 79 20 73 68 6f 75 6c | 64 20 62 65 20 73 65 74 |fy shoul|d be set|
|00001b30| 20 54 52 55 45 20 66 6f | 72 20 73 79 73 74 65 6d | TRUE fo|r system|
|00001b40| 73 20 75 73 69 6e 67 20 | 74 68 65 20 52 6f 6d 61 |s using |the Roma|
|00001b50| 6e 20 61 6c 70 68 61 62 | 65 74 2e 20 49 74 20 77 |n alphab|et. It w|
|00001b60| 6f 75 6c 64 0d 20 2a 20 | 62 65 20 73 65 74 20 46 |ould. * |be set F|
|00001b70| 41 4c 53 45 20 66 6f 72 | 20 72 69 67 68 74 2d 74 |ALSE for| right-t|
|00001b80| 6f 2d 6c 65 66 74 20 6c | 61 6e 67 75 61 67 65 73 |o-left l|anguages|
|00001b90| 20 73 75 63 68 20 61 73 | 20 41 72 61 62 69 63 20 | such as| Arabic |
|00001ba0| 61 6e 64 20 48 65 62 72 | 65 77 2e 20 49 74 20 69 |and Hebr|ew. It i|
|00001bb0| 73 20 75 73 65 64 0d 20 | 2a 20 74 6f 20 63 6f 6e |s used. |* to con|
|00001bc0| 66 69 67 75 72 65 20 74 | 68 65 20 64 69 72 65 63 |figure t|he direc|
|00001bd0| 74 69 6f 6e 20 6f 66 20 | 74 68 65 20 62 75 74 74 |tion of |the butt|
|00001be0| 6f 6e 73 20 61 6e 64 20 | 74 68 65 20 6c 6f 63 61 |ons and |the loca|
|00001bf0| 74 69 6f 6e 20 6f 66 20 | 74 65 78 74 20 77 69 74 |tion of |text wit|
|00001c00| 68 69 6e 0d 20 2a 20 74 | 68 65 20 64 69 73 70 6c |hin. * t|he displ|
|00001c10| 61 79 65 64 20 6c 69 73 | 74 20 63 65 6c 6c 2e 0d |ayed lis|t cell..|
|00001c20| 20 2a 2f 0d 4c 69 73 74 | 48 61 6e 64 6c 65 0d 4e | */.List|Handle.N|
|00001c30| 65 77 54 77 69 73 74 44 | 6f 77 6e 4c 69 73 74 28 |ewTwistD|ownList(|
|00001c40| 0d 09 09 63 6f 6e 73 74 | 20 52 65 63 74 09 09 09 |...const| Rect...|
|00001c50| 09 09 2a 76 69 65 77 52 | 65 63 74 2c 0d 09 09 54 |..*viewR|ect,...T|
|00001c60| 77 69 73 74 44 6f 77 6e | 44 72 61 77 50 72 6f 63 |wistDown|DrawProc|
|00001c70| 09 09 09 64 72 61 77 50 | 72 6f 63 2c 0d 09 09 75 |...drawP|roc,...u|
|00001c80| 6e 73 69 67 6e 65 64 20 | 73 68 6f 72 74 09 09 09 |nsigned |short...|
|00001c90| 09 74 61 62 49 6e 64 65 | 6e 74 2c 0d 09 09 42 6f |.tabInde|nt,...Bo|
|00001ca0| 6f 6c 65 61 6e 09 09 09 | 09 09 09 63 61 6e 48 69 |olean...|...canHi|
|00001cb0| 6c 69 74 65 53 65 6c 65 | 63 74 69 6f 6e 2c 0d 09 |liteSele|ction,..|
|00001cc0| 09 42 6f 6f 6c 65 61 6e | 09 09 09 09 09 09 69 73 |.Boolean|......is|
|00001cd0| 4c 65 66 74 4a 75 73 74 | 69 66 79 0d 09 29 0d 7b |LeftJust|ify..).{|
|00001ce0| 0d 09 09 72 65 67 69 73 | 74 65 72 20 54 77 69 73 |...regis|ter Twis|
|00001cf0| 74 44 6f 77 6e 50 72 69 | 76 61 74 65 50 74 72 09 |tDownPri|vatePtr.|
|00001d00| 70 72 69 76 61 74 65 50 | 74 72 3b 0d 09 09 4c 69 |privateP|tr;...Li|
|00001d10| 73 74 48 61 6e 64 6c 65 | 09 09 09 09 09 09 74 68 |stHandle|......th|
|00001d20| 65 4c 69 73 74 3b 0d 09 | 09 73 68 6f 72 74 09 09 |eList;..|.short..|
|00001d30| 09 09 09 09 09 6c 69 73 | 74 48 65 69 67 68 74 3b |.....lis|tHeight;|
|00001d40| 0d 09 09 50 6f 69 6e 74 | 09 09 09 09 09 09 09 63 |...Point|.......c|
|00001d50| 65 6c 6c 53 69 7a 65 3b | 0d 09 09 52 65 63 74 09 |ellSize;|...Rect.|
|00001d60| 09 09 09 09 09 09 64 61 | 74 61 42 6f 75 6e 64 73 |......da|taBounds|
|00001d70| 3b 0d 09 09 52 65 63 74 | 09 09 09 09 09 09 09 6c |;...Rect|.......l|
|00001d80| 69 73 74 52 65 63 74 3b | 0d 09 09 46 6f 6e 74 49 |istRect;|...FontI|
|00001d90| 6e 66 6f 09 09 09 09 09 | 09 69 6e 66 6f 3b 0d 09 |nfo.....|.info;..|
|00001da0| 09 73 68 6f 72 74 09 09 | 09 09 09 09 09 6c 69 73 |.short..|.....lis|
|00001db0| 74 46 6f 6e 74 48 65 69 | 67 68 74 3b 0d 09 09 47 |tFontHei|ght;...G|
|00001dc0| 72 61 66 50 74 72 09 09 | 09 09 09 09 09 63 75 72 |rafPtr..|.....cur|
|00001dd0| 72 65 6e 74 50 6f 72 74 | 3b 0d 09 09 50 72 6f 63 |rentPort|;...Proc|
|00001de0| 50 74 72 09 09 09 09 09 | 09 09 6c 69 73 74 44 65 |Ptr.....|..listDe|
|00001df0| 66 50 72 6f 63 3b 0d 09 | 09 53 74 75 62 48 61 6e |fProc;..|.StubHan|
|00001e00| 64 6c 65 09 09 09 09 09 | 09 73 74 75 62 48 61 6e |dle.....|.stubHan|
|00001e10| 64 6c 65 3b 0d 0d 09 09 | 74 68 65 4c 69 73 74 20 |dle;....|theList |
|00001e20| 3d 20 4e 55 4c 4c 3b 0d | 09 09 47 65 74 50 6f 72 |= NULL;.|..GetPor|
|00001e30| 74 28 26 63 75 72 72 65 | 6e 74 50 6f 72 74 29 3b |t(&curre|ntPort);|
|00001e40| 0d 09 09 47 65 74 46 6f | 6e 74 49 6e 66 6f 28 26 |...GetFo|ntInfo(&|
|00001e50| 69 6e 66 6f 29 3b 0d 09 | 09 6c 69 73 74 46 6f 6e |info);..|.listFon|
|00001e60| 74 48 65 69 67 68 74 20 | 3d 20 69 6e 66 6f 2e 61 |tHeight |= info.a|
|00001e70| 73 63 65 6e 74 20 2b 20 | 69 6e 66 6f 2e 64 65 73 |scent + |info.des|
|00001e80| 63 65 6e 74 20 2b 20 69 | 6e 66 6f 2e 6c 65 61 64 |cent + i|nfo.lead|
|00001e90| 69 6e 67 3b 0d 09 09 2f | 2a 0d 09 09 20 2a 20 44 |ing;.../|*... * D|
|00001ea0| 65 66 69 6e 65 20 74 68 | 65 20 6c 69 73 74 20 64 |efine th|e list d|
|00001eb0| 72 61 77 69 6e 67 20 61 | 72 65 61 2e 20 49 66 20 |rawing a|rea. If |
|00001ec0| 74 68 65 20 6c 69 73 74 | 20 76 69 65 77 52 65 63 |the list| viewRec|
|00001ed0| 74 2e 62 6f 74 74 6f 6d | 0d 09 09 20 2a 20 69 73 |t.bottom|... * is|
|00001ee0| 20 6c 65 73 73 20 74 68 | 61 6e 20 74 68 65 20 70 | less th|an the p|
|00001ef0| 6f 72 74 52 65 63 74 2e | 62 6f 74 74 6f 6d 2c 20 |ortRect.|bottom, |
|00001f00| 61 64 6a 75 73 74 20 74 | 68 65 20 6c 69 73 74 20 |adjust t|he list |
|00001f10| 61 72 65 61 20 68 65 69 | 67 68 74 0d 09 09 20 2a |area hei|ght... *|
|00001f20| 20 69 6e 74 65 67 72 61 | 6c 20 6e 75 6d 62 65 72 | integra|l number|
|00001f30| 20 6f 66 20 72 6f 77 73 | 20 77 69 6c 6c 20 62 65 | of rows| will be|
|00001f40| 20 64 72 61 77 6e 2e 20 | 49 66 20 65 71 75 61 6c | drawn. |If equal|
|00001f50| 2c 20 74 68 65 20 6c 69 | 73 74 0d 09 09 20 2a 20 |, the li|st... * |
|00001f60| 61 72 65 61 20 61 62 75 | 74 73 20 74 68 65 20 62 |area abu|ts the b|
|00001f70| 6f 74 74 6f 6d 20 6f 66 | 20 74 68 65 20 64 69 73 |ottom of| the dis|
|00001f80| 70 6c 61 79 20 77 69 6e | 64 6f 77 20 61 6e 64 20 |play win|dow and |
|00001f90| 77 65 20 73 68 6f 75 6c | 64 6e 27 74 0d 09 09 20 |we shoul|dn't... |
|00001fa0| 2a 20 63 68 61 6e 67 65 | 20 74 68 65 20 62 6f 74 |* change| the bot|
|00001fb0| 74 6f 6d 20 6f 72 20 74 | 68 65 20 73 63 72 6f 6c |tom or t|he scrol|
|00001fc0| 6c 20 62 61 72 73 20 77 | 69 6c 6c 20 6c 6f 6f 6b |l bars w|ill look|
|00001fd0| 20 77 69 65 72 64 2e 0d | 09 09 20 2a 2f 0d 09 09 | wierd..|.. */...|
|00001fe0| 6c 69 73 74 52 65 63 74 | 20 3d 20 2a 76 69 65 77 |listRect| = *view|
|00001ff0| 52 65 63 74 3b 0d 09 09 | 6c 69 73 74 52 65 63 74 |Rect;...|listRect|
|00002000| 2e 72 69 67 68 74 20 2d | 3d 20 6b 53 63 72 6f 6c |.right -|= kScrol|
|00002010| 6c 42 61 72 57 69 64 74 | 68 3b 0d 09 09 53 65 74 |lBarWidt|h;...Set|
|00002020| 50 74 28 26 63 65 6c 6c | 53 69 7a 65 2c 20 77 69 |Pt(&cell|Size, wi|
|00002030| 64 74 68 28 6c 69 73 74 | 52 65 63 74 29 2c 20 6c |dth(list|Rect), l|
|00002040| 69 73 74 46 6f 6e 74 48 | 65 69 67 68 74 29 3b 0d |istFontH|eight);.|
|00002050| 09 09 69 66 20 28 6c 69 | 73 74 52 65 63 74 2e 62 |..if (li|stRect.b|
|00002060| 6f 74 74 6f 6d 20 3c 20 | 63 75 72 72 65 6e 74 50 |ottom < |currentP|
|00002070| 6f 72 74 2d 3e 70 6f 72 | 74 52 65 63 74 2e 62 6f |ort->por|tRect.bo|
|00002080| 74 74 6f 6d 29 20 7b 0d | 09 09 09 6c 69 73 74 48 |ttom) {.|...listH|
|00002090| 65 69 67 68 74 20 3d 20 | 68 65 69 67 68 74 28 6c |eight = |height(l|
|000020a0| 69 73 74 52 65 63 74 29 | 3b 0d 09 09 09 6c 69 73 |istRect)|;....lis|
|000020b0| 74 48 65 69 67 68 74 20 | 2d 3d 20 28 6c 69 73 74 |tHeight |-= (list|
|000020c0| 48 65 69 67 68 74 20 25 | 20 6c 69 73 74 46 6f 6e |Height %| listFon|
|000020d0| 74 48 65 69 67 68 74 29 | 3b 0d 09 09 09 6c 69 73 |tHeight)|;....lis|
|000020e0| 74 52 65 63 74 2e 62 6f | 74 74 6f 6d 20 3d 20 6c |tRect.bo|ttom = l|
|000020f0| 69 73 74 52 65 63 74 2e | 74 6f 70 20 2b 20 6c 69 |istRect.|top + li|
|00002100| 73 74 48 65 69 67 68 74 | 3b 0d 09 09 7d 0d 09 09 |stHeight|;...}...|
|00002110| 2f 2a 0d 09 09 20 2a 20 | 44 65 66 69 6e 65 20 61 |/*... * |Define a|
|00002120| 20 6f 6e 65 2d 63 6f 6c | 75 6d 6e 20 6c 69 73 74 | one-col|umn list|
|00002130| 2e 0d 09 09 20 2a 2f 0d | 23 69 66 64 65 66 20 5f |.... */.|#ifdef _|
|00002140| 5f 70 6f 77 65 72 63 0d | 09 09 2f 2a 0d 09 09 20 |_powerc.|../*... |
|00002150| 2a 20 43 72 65 61 74 65 | 20 61 20 75 6e 69 76 65 |* Create| a unive|
|00002160| 72 73 61 6c 20 72 6f 75 | 74 69 6e 65 20 64 65 73 |rsal rou|tine des|
|00002170| 63 72 69 70 74 6f 72 20 | 66 6f 72 20 6f 75 72 20 |criptor |for our |
|00002180| 70 72 69 76 61 74 65 20 | 4c 44 45 46 2e 20 54 68 |private |LDEF. Th|
|00002190| 69 73 20 69 73 0d 09 09 | 20 2a 20 74 68 65 20 67 |is is...| * the g|
|000021a0| 65 6e 65 72 61 6c 20 6d | 6f 64 65 6c 20 66 6f 72 |eneral m|odel for|
|000021b0| 20 61 6c 6c 20 70 6f 69 | 6e 74 65 72 2d 74 6f 2d | all poi|nter-to-|
|000021c0| 66 75 6e 63 74 69 6f 6e | 20 72 65 66 65 72 65 6e |function| referen|
|000021d0| 63 65 73 2e 0d 09 09 20 | 2a 2f 0d 09 09 6c 69 73 |ces.... |*/...lis|
|000021e0| 74 44 65 66 50 72 6f 63 | 20 3d 20 28 50 72 6f 63 |tDefProc| = (Proc|
|000021f0| 50 74 72 29 20 4e 65 77 | 4c 69 73 74 44 65 66 50 |Ptr) New|ListDefP|
|00002200| 72 6f 63 28 54 77 69 73 | 74 44 6f 77 6e 4c 44 45 |roc(Twis|tDownLDE|
|00002210| 46 29 3b 0d 23 65 6c 73 | 65 0d 09 09 6c 69 73 74 |F);.#els|e...list|
|00002220| 44 65 66 50 72 6f 63 20 | 3d 20 28 50 72 6f 63 50 |DefProc |= (ProcP|
|00002230| 74 72 29 20 54 77 69 73 | 74 44 6f 77 6e 4c 44 45 |tr) Twis|tDownLDE|
|00002240| 46 3b 0d 23 65 6e 64 69 | 66 0d 09 09 73 74 75 62 |F;.#endi|f...stub|
|00002250| 48 61 6e 64 6c 65 20 3d | 20 28 53 74 75 62 48 61 |Handle =| (StubHa|
|00002260| 6e 64 6c 65 29 20 47 65 | 74 52 65 73 6f 75 72 63 |ndle) Ge|tResourc|
|00002270| 65 28 27 4c 44 45 46 27 | 2c 20 4c 44 45 46 5f 53 |e('LDEF'|, LDEF_S|
|00002280| 74 75 62 29 3b 0d 09 09 | 69 66 20 28 73 74 75 62 |tub);...|if (stub|
|00002290| 48 61 6e 64 6c 65 20 3d | 3d 20 4e 55 4c 4c 29 0d |Handle =|= NULL).|
|000022a0| 09 09 09 67 6f 74 6f 20 | 65 78 69 74 3b 09 09 09 |...goto |exit;...|
|000022b0| 09 09 2f 2a 20 46 61 69 | 6c 75 72 65 09 09 09 09 |../* Fai|lure....|
|000022c0| 09 09 09 09 2a 2f 0d 09 | 09 28 2a 2a 73 74 75 62 |....*/..|.(**stub|
|000022d0| 48 61 6e 64 6c 65 29 2e | 6c 64 65 66 41 64 64 72 |Handle).|ldefAddr|
|000022e0| 65 73 73 20 3d 20 6c 69 | 73 74 44 65 66 50 72 6f |ess = li|stDefPro|
|000022f0| 63 3b 0d 09 09 53 65 74 | 52 65 63 74 28 26 64 61 |c;...Set|Rect(&da|
|00002300| 74 61 42 6f 75 6e 64 73 | 2c 20 30 2c 20 30 2c 20 |taBounds|, 0, 0, |
|00002310| 31 2c 20 30 29 3b 0d 09 | 09 74 68 65 4c 69 73 74 |1, 0);..|.theList|
|00002320| 20 3d 20 4c 4e 65 77 28 | 0d 09 09 09 09 26 6c 69 | = LNew(|.....&li|
|00002330| 73 74 52 65 63 74 2c 09 | 09 09 09 2f 2a 20 56 69 |stRect,.|.../* Vi|
|00002340| 65 77 69 6e 67 20 61 72 | 65 61 09 09 09 09 09 09 |ewing ar|ea......|
|00002350| 09 2a 2f 0d 09 09 09 09 | 26 64 61 74 61 42 6f 75 |.*/.....|&dataBou|
|00002360| 6e 64 73 2c 09 09 09 2f | 2a 20 52 6f 77 73 20 61 |nds,.../|* Rows a|
|00002370| 6e 64 20 63 6f 6c 27 73 | 09 09 09 09 09 09 2a 2f |nd col's|......*/|
|00002380| 0d 09 09 09 09 63 65 6c | 6c 53 69 7a 65 2c 09 09 |.....cel|lSize,..|
|00002390| 09 09 2f 2a 20 45 6c 65 | 6d 65 6e 74 20 73 69 7a |../* Ele|ment siz|
|000023a0| 65 09 09 09 09 09 09 09 | 2a 2f 0d 09 09 09 09 4c |e.......|*/.....L|
|000023b0| 44 45 46 5f 53 74 75 62 | 2c 09 09 09 09 2f 2a 20 |DEF_Stub|,..../* |
|000023c0| 43 61 6c 6c 62 61 63 6b | 20 64 65 66 70 72 6f 63 |Callback| defproc|
|000023d0| 09 09 09 09 09 09 2a 2f | 0d 09 09 09 09 63 75 72 |......*/|.....cur|
|000023e0| 72 65 6e 74 50 6f 72 74 | 2c 09 09 09 2f 2a 20 44 |rentPort|,.../* D|
|000023f0| 69 73 70 6c 61 79 20 77 | 69 6e 64 6f 77 09 09 09 |isplay w|indow...|
|00002400| 09 09 09 2a 2f 0d 09 09 | 09 09 54 52 55 45 2c 09 |...*/...|..TRUE,.|
|00002410| 09 09 09 09 2f 2a 20 44 | 72 61 77 20 69 74 09 09 |..../* D|raw it..|
|00002420| 09 09 09 09 09 09 2a 2f | 0d 09 09 09 09 46 41 4c |......*/|.....FAL|
|00002430| 53 45 2c 09 09 09 09 09 | 2f 2a 20 4e 6f 20 67 72 |SE,.....|/* No gr|
|00002440| 6f 77 20 62 6f 78 09 09 | 09 09 09 09 09 2a 2f 0d |ow box..|.....*/.|
|00002450| 09 09 09 09 46 41 4c 53 | 45 2c 09 09 09 09 09 2f |....FALS|E,...../|
|00002460| 2a 20 4e 6f 20 68 6f 72 | 69 7a 20 73 63 72 6f 6c |* No hor|iz scrol|
|00002470| 6c 09 09 09 09 09 09 2a | 2f 0d 09 09 09 09 54 52 |l......*|/.....TR|
|00002480| 55 45 09 09 09 09 09 2f | 2a 20 56 65 72 74 69 63 |UE...../|* Vertic|
|00002490| 61 6c 20 73 63 72 6f 6c | 6c 09 09 09 09 09 09 2a |al scrol|l......*|
|000024a0| 2f 0d 09 09 09 29 3b 0d | 09 09 69 66 20 28 74 68 |/....);.|..if (th|
|000024b0| 65 4c 69 73 74 20 3d 3d | 20 4e 55 4c 4c 29 0d 09 |eList ==| NULL)..|
|000024c0| 09 09 67 6f 74 6f 20 65 | 78 69 74 3b 0d 09 09 28 |..goto e|xit;...(|
|000024d0| 2a 2a 74 68 65 4c 69 73 | 74 29 2e 73 65 6c 46 6c |**theLis|t).selFl|
|000024e0| 61 67 73 20 3d 20 53 45 | 4c 45 43 54 49 4f 4e 5f |ags = SE|LECTION_|
|000024f0| 46 4c 41 47 53 3b 0d 09 | 09 28 2a 2a 74 68 65 4c |FLAGS;..|.(**theL|
|00002500| 69 73 74 29 2e 72 65 66 | 43 6f 6e 20 3d 20 30 3b |ist).ref|Con = 0;|
|00002510| 09 09 09 2f 2a 20 50 61 | 72 61 6e 6f 69 61 09 09 |.../* Pa|ranoia..|
|00002520| 09 09 09 09 09 09 2a 2f | 0d 09 09 28 2a 2a 74 68 |......*/|...(**th|
|00002530| 65 4c 69 73 74 29 2e 75 | 73 65 72 48 61 6e 64 6c |eList).u|serHandl|
|00002540| 65 20 3d 20 4e 65 77 48 | 61 6e 64 6c 65 43 6c 65 |e = NewH|andleCle|
|00002550| 61 72 28 73 69 7a 65 6f | 66 20 28 54 77 69 73 74 |ar(sizeo|f (Twist|
|00002560| 44 6f 77 6e 50 72 69 76 | 61 74 65 52 65 63 6f 72 |DownPriv|ateRecor|
|00002570| 64 29 29 3b 0d 09 09 69 | 66 20 28 28 2a 2a 74 68 |d));...i|f ((**th|
|00002580| 65 4c 69 73 74 29 2e 75 | 73 65 72 48 61 6e 64 6c |eList).u|serHandl|
|00002590| 65 20 3d 3d 20 4e 55 4c | 4c 29 0d 09 09 09 67 6f |e == NUL|L)....go|
|000025a0| 74 6f 20 66 61 69 6c 75 | 72 65 3b 0d 09 09 70 72 |to failu|re;...pr|
|000025b0| 69 76 61 74 65 50 74 72 | 20 3d 20 28 54 77 69 73 |ivatePtr| = (Twis|
|000025c0| 74 44 6f 77 6e 50 72 69 | 76 61 74 65 50 74 72 29 |tDownPri|vatePtr)|
|000025d0| 20 28 2a 28 2a 2a 74 68 | 65 4c 69 73 74 29 2e 75 | (*(**th|eList).u|
|000025e0| 73 65 72 48 61 6e 64 6c | 65 29 3b 0d 23 64 65 66 |serHandl|e);.#def|
|000025f0| 69 6e 65 20 50 52 49 56 | 20 28 2a 70 72 69 76 61 |ine PRIV| (*priva|
|00002600| 74 65 50 74 72 29 0d 09 | 09 50 52 49 56 2e 64 72 |tePtr)..|.PRIV.dr|
|00002610| 61 77 50 72 6f 63 20 3d | 20 64 72 61 77 50 72 6f |awProc =| drawPro|
|00002620| 63 3b 0d 09 09 50 52 49 | 56 2e 74 61 62 49 6e 64 |c;...PRI|V.tabInd|
|00002630| 65 6e 74 20 3d 20 74 61 | 62 49 6e 64 65 6e 74 3b |ent = ta|bIndent;|
|00002640| 0d 09 09 50 52 49 56 2e | 63 61 6e 48 69 6c 69 74 |...PRIV.|canHilit|
|00002650| 65 53 65 6c 65 63 74 69 | 6f 6e 20 3d 20 63 61 6e |eSelecti|on = can|
|00002660| 48 69 6c 69 74 65 53 65 | 6c 65 63 74 69 6f 6e 3b |HiliteSe|lection;|
|00002670| 0d 09 09 50 52 49 56 2e | 69 73 4c 65 66 74 4a 75 |...PRIV.|isLeftJu|
|00002680| 73 74 69 66 79 20 3d 20 | 69 73 4c 65 66 74 4a 75 |stify = |isLeftJu|
|00002690| 73 74 69 66 79 3b 0d 09 | 09 50 52 49 56 2e 66 6f |stify;..|.PRIV.fo|
|000026a0| 6e 74 4e 75 6d 62 65 72 | 20 3d 20 63 75 72 72 65 |ntNumber| = curre|
|000026b0| 6e 74 50 6f 72 74 2d 3e | 74 78 46 6f 6e 74 3b 0d |ntPort->|txFont;.|
|000026c0| 09 09 50 52 49 56 2e 66 | 6f 6e 74 53 69 7a 65 20 |..PRIV.f|ontSize |
|000026d0| 3d 20 63 75 72 72 65 6e | 74 50 6f 72 74 2d 3e 74 |= curren|tPort->t|
|000026e0| 78 53 69 7a 65 3b 0d 23 | 75 6e 64 65 66 20 50 52 |xSize;.#|undef PR|
|000026f0| 49 56 0d 09 09 43 72 65 | 61 74 65 54 77 69 73 74 |IV...Cre|ateTwist|
|00002700| 44 6f 77 6e 42 75 74 74 | 6f 6e 73 28 74 68 65 4c |DownButt|ons(theL|
|00002710| 69 73 74 29 3b 0d 09 09 | 67 6f 74 6f 20 65 78 69 |ist);...|goto exi|
|00002720| 74 3b 0d 66 61 69 6c 75 | 72 65 3a 0d 09 09 44 69 |t;.failu|re:...Di|
|00002730| 73 70 6f 73 65 54 77 69 | 73 74 44 6f 77 6e 4c 69 |sposeTwi|stDownLi|
|00002740| 73 74 28 74 68 65 4c 69 | 73 74 29 3b 0d 09 09 74 |st(theLi|st);...t|
|00002750| 68 65 4c 69 73 74 20 3d | 20 4e 55 4c 4c 3b 0d 65 |heList =| NULL;.e|
|00002760| 78 69 74 3a 09 72 65 74 | 75 72 6e 20 28 74 68 65 |xit:.ret|urn (the|
|00002770| 4c 69 73 74 29 3b 0d 7d | 0d 0d 2f 2a 20 2a 20 2a |List);.}|../* * *|
|00002780| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|00002790| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000027a0| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000027b0| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000027c0| 20 2a 20 2a 20 2a 20 2a | 20 2a 0d 20 2a 20 44 69 | * * * *| *. * Di|
|000027d0| 73 70 6f 73 65 54 77 69 | 73 74 44 6f 77 6e 4c 69 |sposeTwi|stDownLi|
|000027e0| 73 74 0d 20 2a 0d 20 2a | 20 44 69 73 70 6f 73 65 |st. *. *| Dispose|
|000027f0| 20 6f 66 20 74 68 65 20 | 6c 69 73 74 20 61 6e 64 | of the |list and|
|00002800| 20 6f 75 72 20 70 72 69 | 76 61 74 65 20 64 61 74 | our pri|vate dat|
|00002810| 61 2e 0d 20 2a 2f 0d 76 | 6f 69 64 0d 44 69 73 70 |a.. */.v|oid.Disp|
|00002820| 6f 73 65 54 77 69 73 74 | 44 6f 77 6e 4c 69 73 74 |oseTwist|DownList|
|00002830| 28 0d 09 09 4c 69 73 74 | 48 61 6e 64 6c 65 09 09 |(...List|Handle..|
|00002840| 09 09 09 74 68 65 4c 69 | 73 74 0d 09 29 0d 7b 0d |...theLi|st..).{.|
|00002850| 09 09 69 66 20 28 74 68 | 65 4c 69 73 74 20 21 3d |..if (th|eList !=|
|00002860| 20 4e 55 4c 4c 29 20 7b | 0d 09 09 09 69 66 20 28 | NULL) {|....if (|
|00002870| 28 2a 2a 74 68 65 4c 69 | 73 74 29 2e 75 73 65 72 |(**theLi|st).user|
|00002880| 48 61 6e 64 6c 65 20 21 | 3d 20 4e 55 4c 4c 29 20 |Handle !|= NULL) |
|00002890| 7b 0d 09 09 09 09 46 6f | 72 67 65 74 50 6f 6c 79 |{.....Fo|rgetPoly|
|000028a0| 28 50 52 49 56 41 54 45 | 2e 6f 70 65 6e 54 72 69 |(PRIVATE|.openTri|
|000028b0| 61 6e 67 6c 65 29 3b 0d | 09 09 09 09 46 6f 72 67 |angle);.|....Forg|
|000028c0| 65 74 50 6f 6c 79 28 50 | 52 49 56 41 54 45 2e 63 |etPoly(P|RIVATE.c|
|000028d0| 6c 6f 73 65 64 54 72 69 | 61 6e 67 6c 65 29 3b 0d |losedTri|angle);.|
|000028e0| 09 09 09 09 46 6f 72 67 | 65 74 50 6f 6c 79 28 50 |....Forg|etPoly(P|
|000028f0| 52 49 56 41 54 45 2e 69 | 6e 74 65 72 6d 65 64 69 |RIVATE.i|ntermedi|
|00002900| 61 74 65 54 72 69 61 6e | 67 6c 65 29 3b 0d 09 09 |ateTrian|gle);...|
|00002910| 09 09 44 69 73 70 6f 73 | 65 48 61 6e 64 6c 65 28 |..Dispos|eHandle(|
|00002920| 28 48 61 6e 64 6c 65 29 | 20 28 2a 2a 74 68 65 4c |(Handle)| (**theL|
|00002930| 69 73 74 29 2e 75 73 65 | 72 48 61 6e 64 6c 65 29 |ist).use|rHandle)|
|00002940| 3b 0d 09 09 09 09 28 2a | 2a 74 68 65 4c 69 73 74 |;.....(*|*theList|
|00002950| 29 2e 75 73 65 72 48 61 | 6e 64 6c 65 20 3d 20 4e |).userHa|ndle = N|
|00002960| 55 4c 4c 3b 0d 09 09 09 | 7d 0d 09 09 09 4c 44 69 |ULL;....|}....LDi|
|00002970| 73 70 6f 73 65 28 74 68 | 65 4c 69 73 74 29 3b 0d |spose(th|eList);.|
|00002980| 09 09 7d 0d 7d 0d 0d 2f | 2a 20 2a 20 2a 20 2a 20 |..}.}../|* * * * |
|00002990| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|000029a0| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|000029b0| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|000029c0| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|000029d0| 2a 20 2a 20 2a 20 2a 0d | 20 2a 20 43 72 65 61 74 |* * * *.| * Creat|
|000029e0| 65 54 77 69 73 74 44 6f | 77 6e 42 75 74 74 6f 6e |eTwistDo|wnButton|
|000029f0| 73 0d 20 2a 0d 20 2a 20 | 43 72 65 61 74 65 54 77 |s. *. * |CreateTw|
|00002a00| 69 73 74 44 6f 77 6e 42 | 75 74 74 6f 6e 73 0d 20 |istDownB|uttons. |
|00002a10| 2a 20 54 68 69 73 20 66 | 75 6e 63 74 69 6f 6e 20 |* This f|unction |
|00002a20| 63 72 65 61 74 65 73 20 | 74 68 65 20 74 68 72 65 |creates |the thre|
|00002a30| 65 20 73 74 61 74 65 73 | 20 6f 66 20 74 68 65 20 |e states| of the |
|00002a40| 74 77 69 73 74 2d 64 6f | 77 6e 20 62 75 74 74 6f |twist-do|wn butto|
|00002a50| 6e 20 74 68 61 74 20 61 | 72 65 20 64 72 61 77 6e |n that a|re drawn|
|00002a60| 0d 20 2a 20 69 6e 20 74 | 68 65 20 64 69 73 70 6c |. * in t|he displ|
|00002a70| 61 79 20 6c 69 73 74 2e | 0d 20 2a 0d 20 2a 20 43 |ay list.|. *. * C|
|00002a80| 72 65 61 74 65 54 77 69 | 73 74 44 6f 77 6e 42 75 |reateTwi|stDownBu|
|00002a90| 74 74 6f 6e 73 20 69 73 | 20 63 61 6c 6c 65 64 20 |ttons is| called |
|00002aa0| 77 68 65 6e 20 74 68 65 | 20 6c 69 73 74 20 69 73 |when the| list is|
|00002ab0| 20 63 72 65 61 74 65 64 | 2e 20 54 68 65 20 61 70 | created|. The ap|
|00002ac0| 70 6c 69 63 61 74 69 6f | 6e 20 6d 75 73 74 0d 20 |plicatio|n must. |
|00002ad0| 2a 20 63 61 6c 6c 20 69 | 74 20 64 69 72 65 63 74 |* call i|t direct|
|00002ae0| 6c 79 20 61 66 74 65 72 | 20 63 68 61 6e 67 69 6e |ly after| changin|
|00002af0| 67 20 74 68 65 20 6c 69 | 73 74 20 63 65 6c 6c 20 |g the li|st cell |
|00002b00| 68 65 69 67 68 74 20 28 | 62 79 20 63 61 6c 6c 69 |height (|by calli|
|00002b10| 6e 67 20 4c 53 69 7a 65 | 29 2e 0d 20 2a 0d 20 2a |ng LSize|).. *. *|
|00002b20| 20 4e 6f 74 65 20 74 68 | 61 74 20 74 68 65 20 70 | Note th|at the p|
|00002b30| 6f 72 74 20 61 6e 64 20 | 74 65 78 74 20 64 72 61 |ort and |text dra|
|00002b40| 77 69 6e 67 20 63 68 61 | 72 61 63 74 65 72 69 73 |wing cha|racteris|
|00002b50| 74 69 63 73 20 6d 75 73 | 74 20 68 61 76 65 20 62 |tics mus|t have b|
|00002b60| 65 65 6e 20 73 65 74 2e | 0d 20 2a 2f 0d 76 6f 69 |een set.|. */.voi|
|00002b70| 64 0d 43 72 65 61 74 65 | 54 77 69 73 74 44 6f 77 |d.Create|TwistDow|
|00002b80| 6e 42 75 74 74 6f 6e 73 | 28 0d 09 09 4c 69 73 74 |nButtons|(...List|
|00002b90| 48 61 6e 64 6c 65 09 09 | 09 09 09 74 68 65 4c 69 |Handle..|...theLi|
|00002ba0| 73 74 0d 09 29 0d 7b 0d | 09 09 73 68 6f 72 74 09 |st..).{.|..short.|
|00002bb0| 09 09 09 09 09 62 75 74 | 74 6f 6e 53 69 7a 65 3b |.....but|tonSize;|
|00002bc0| 0d 09 09 73 68 6f 72 74 | 09 09 09 09 09 09 68 61 |...short|......ha|
|00002bd0| 6c 66 53 69 7a 65 3b 0d | 09 09 73 68 6f 72 74 09 |lfSize;.|..short.|
|00002be0| 09 09 09 09 09 69 6e 74 | 65 72 6d 65 64 69 61 74 |.....int|ermediat|
|00002bf0| 65 53 69 7a 65 3b 0d 09 | 09 46 6f 6e 74 49 6e 66 |eSize;..|.FontInf|
|00002c00| 6f 09 09 09 09 09 69 6e | 66 6f 3b 0d 0d 09 09 46 |o.....in|fo;....F|
|00002c10| 6f 72 67 65 74 50 6f 6c | 79 28 50 52 49 56 41 54 |orgetPol|y(PRIVAT|
|00002c20| 45 2e 6f 70 65 6e 54 72 | 69 61 6e 67 6c 65 29 3b |E.openTr|iangle);|
|00002c30| 0d 09 09 46 6f 72 67 65 | 74 50 6f 6c 79 28 50 52 |...Forge|tPoly(PR|
|00002c40| 49 56 41 54 45 2e 63 6c | 6f 73 65 64 54 72 69 61 |IVATE.cl|osedTria|
|00002c50| 6e 67 6c 65 29 3b 0d 09 | 09 46 6f 72 67 65 74 50 |ngle);..|.ForgetP|
|00002c60| 6f 6c 79 28 50 52 49 56 | 41 54 45 2e 69 6e 74 65 |oly(PRIV|ATE.inte|
|00002c70| 72 6d 65 64 69 61 74 65 | 54 72 69 61 6e 67 6c 65 |rmediate|Triangle|
|00002c80| 29 3b 0d 09 09 47 65 74 | 46 6f 6e 74 49 6e 66 6f |);...Get|FontInfo|
|00002c90| 28 26 69 6e 66 6f 29 3b | 0d 09 09 62 75 74 74 6f |(&info);|...butto|
|00002ca0| 6e 53 69 7a 65 20 3d 20 | 69 6e 66 6f 2e 61 73 63 |nSize = |info.asc|
|00002cb0| 65 6e 74 3b 09 09 09 09 | 2f 2a 20 54 68 65 20 22 |ent;....|/* The "|
|00002cc0| 73 68 6f 77 20 73 75 62 | 6c 69 73 74 22 20 62 75 |show sub|list" bu|
|00002cd0| 74 74 6f 6e 09 2a 2f 0d | 09 09 62 75 74 74 6f 6e |tton.*/.|..button|
|00002ce0| 53 69 7a 65 20 26 3d 20 | 7e 31 3b 09 09 09 09 09 |Size &= |~1;.....|
|00002cf0| 09 2f 2a 20 52 6f 75 6e | 64 20 64 6f 77 6e 20 74 |./* Roun|d down t|
|00002d00| 6f 20 61 6e 20 65 76 65 | 6e 20 6e 75 6d 62 65 72 |o an eve|n number|
|00002d10| 09 2a 2f 0d 09 09 68 61 | 6c 66 53 69 7a 65 20 3d |.*/...ha|lfSize =|
|00002d20| 20 62 75 74 74 6f 6e 53 | 69 7a 65 20 2f 20 32 3b | buttonS|ize / 2;|
|00002d30| 0d 09 09 69 6e 74 65 72 | 6d 65 64 69 61 74 65 53 |...inter|mediateS|
|00002d40| 69 7a 65 20 3d 20 28 62 | 75 74 74 6f 6e 53 69 7a |ize = (b|uttonSiz|
|00002d50| 65 20 2a 20 33 29 20 2f | 20 34 3b 0d 09 09 50 52 |e * 3) /| 4;...PR|
|00002d60| 49 56 41 54 45 2e 6f 70 | 65 6e 54 72 69 61 6e 67 |IVATE.op|enTriang|
|00002d70| 6c 65 20 3d 20 4f 70 65 | 6e 50 6f 6c 79 28 29 3b |le = Ope|nPoly();|
|00002d80| 0d 09 09 09 4d 6f 76 65 | 54 6f 28 30 2c 20 68 61 |....Move|To(0, ha|
|00002d90| 6c 66 53 69 7a 65 29 3b | 0d 09 09 09 4c 69 6e 65 |lfSize);|....Line|
|00002da0| 54 6f 28 62 75 74 74 6f | 6e 53 69 7a 65 2c 20 68 |To(butto|nSize, h|
|00002db0| 61 6c 66 53 69 7a 65 29 | 3b 0d 09 09 09 4c 69 6e |alfSize)|;....Lin|
|00002dc0| 65 54 6f 28 68 61 6c 66 | 53 69 7a 65 2c 20 62 75 |eTo(half|Size, bu|
|00002dd0| 74 74 6f 6e 53 69 7a 65 | 29 3b 0d 09 09 09 4c 69 |ttonSize|);....Li|
|00002de0| 6e 65 54 6f 28 30 2c 20 | 68 61 6c 66 53 69 7a 65 |neTo(0, |halfSize|
|00002df0| 29 3b 0d 09 09 43 6c 6f | 73 65 50 6f 6c 79 28 29 |);...Clo|sePoly()|
|00002e00| 3b 0d 09 09 69 66 20 28 | 50 52 49 56 41 54 45 2e |;...if (|PRIVATE.|
|00002e10| 69 73 4c 65 66 74 4a 75 | 73 74 69 66 79 29 20 7b |isLeftJu|stify) {|
|00002e20| 09 09 09 2f 2a 20 52 6f | 6d 61 6e 20 61 6c 70 68 |.../* Ro|man alph|
|00002e30| 61 62 65 74 20 74 72 69 | 61 6e 67 6c 65 73 09 09 |abet tri|angles..|
|00002e40| 2a 2f 0d 09 09 09 50 52 | 49 56 41 54 45 2e 63 6c |*/....PR|IVATE.cl|
|00002e50| 6f 73 65 64 54 72 69 61 | 6e 67 6c 65 20 3d 20 4f |osedTria|ngle = O|
|00002e60| 70 65 6e 50 6f 6c 79 28 | 29 3b 0d 09 09 09 09 4d |penPoly(|);.....M|
|00002e70| 6f 76 65 54 6f 28 68 61 | 6c 66 53 69 7a 65 2c 20 |oveTo(ha|lfSize, |
|00002e80| 30 29 3b 0d 09 09 09 09 | 4c 69 6e 65 54 6f 28 62 |0);.....|LineTo(b|
|00002e90| 75 74 74 6f 6e 53 69 7a | 65 2c 20 68 61 6c 66 53 |uttonSiz|e, halfS|
|00002ea0| 69 7a 65 29 3b 0d 09 09 | 09 09 4c 69 6e 65 54 6f |ize);...|..LineTo|
|00002eb0| 28 68 61 6c 66 53 69 7a | 65 2c 20 62 75 74 74 6f |(halfSiz|e, butto|
|00002ec0| 6e 53 69 7a 65 29 3b 0d | 09 09 09 09 4c 69 6e 65 |nSize);.|....Line|
|00002ed0| 54 6f 28 68 61 6c 66 53 | 69 7a 65 2c 20 30 29 3b |To(halfS|ize, 0);|
|00002ee0| 0d 09 09 09 43 6c 6f 73 | 65 50 6f 6c 79 28 29 3b |....Clos|ePoly();|
|00002ef0| 0d 09 09 09 50 52 49 56 | 41 54 45 2e 69 6e 74 65 |....PRIV|ATE.inte|
|00002f00| 72 6d 65 64 69 61 74 65 | 54 72 69 61 6e 67 6c 65 |rmediate|Triangle|
|00002f10| 20 3d 20 4f 70 65 6e 50 | 6f 6c 79 28 29 3b 09 0d | = OpenP|oly();..|
|00002f20| 09 09 09 09 4d 6f 76 65 | 54 6f 28 69 6e 74 65 72 |....Move|To(inter|
|00002f30| 6d 65 64 69 61 74 65 53 | 69 7a 65 2c 20 30 29 3b |mediateS|ize, 0);|
|00002f40| 0d 09 09 09 09 4c 69 6e | 65 54 6f 28 69 6e 74 65 |.....Lin|eTo(inte|
|00002f50| 72 6d 65 64 69 61 74 65 | 53 69 7a 65 2c 20 69 6e |rmediate|Size, in|
|00002f60| 74 65 72 6d 65 64 69 61 | 74 65 53 69 7a 65 29 3b |termedia|teSize);|
|00002f70| 0d 09 09 09 09 4c 69 6e | 65 54 6f 28 30 2c 20 69 |.....Lin|eTo(0, i|
|00002f80| 6e 74 65 72 6d 65 64 69 | 61 74 65 53 69 7a 65 29 |ntermedi|ateSize)|
|00002f90| 3b 0d 09 09 09 09 4c 69 | 6e 65 54 6f 28 69 6e 74 |;.....Li|neTo(int|
|00002fa0| 65 72 6d 65 64 69 61 74 | 65 53 69 7a 65 2c 20 30 |ermediat|eSize, 0|
|00002fb0| 29 3b 0d 09 09 09 43 6c | 6f 73 65 50 6f 6c 79 28 |);....Cl|osePoly(|
|00002fc0| 29 3b 0d 09 09 7d 0d 09 | 09 65 6c 73 65 20 7b 09 |);...}..|.else {.|
|00002fd0| 09 09 09 09 09 09 09 09 | 2f 2a 20 41 72 61 62 69 |........|/* Arabi|
|00002fe0| 63 2f 48 65 62 72 65 77 | 20 74 72 69 61 6e 67 6c |c/Hebrew| triangl|
|00002ff0| 65 73 09 09 2a 2f 0d 09 | 09 09 50 52 49 56 41 54 |es..*/..|..PRIVAT|
|00003000| 45 2e 63 6c 6f 73 65 64 | 54 72 69 61 6e 67 6c 65 |E.closed|Triangle|
|00003010| 20 3d 20 4f 70 65 6e 50 | 6f 6c 79 28 29 3b 0d 09 | = OpenP|oly();..|
|00003020| 09 09 09 4d 6f 76 65 54 | 6f 28 62 75 74 74 6f 6e |...MoveT|o(button|
|00003030| 53 69 7a 65 20 2d 20 68 | 61 6c 66 53 69 7a 65 2c |Size - h|alfSize,|
|00003040| 20 30 29 3b 0d 09 09 09 | 09 4c 69 6e 65 54 6f 28 | 0);....|.LineTo(|
|00003050| 30 2c 20 68 61 6c 66 53 | 69 7a 65 29 3b 0d 09 09 |0, halfS|ize);...|
|00003060| 09 09 4c 69 6e 65 54 6f | 28 62 75 74 74 6f 6e 53 |..LineTo|(buttonS|
|00003070| 69 7a 65 20 2d 20 68 61 | 6c 66 53 69 7a 65 2c 20 |ize - ha|lfSize, |
|00003080| 62 75 74 74 6f 6e 53 69 | 7a 65 29 3b 0d 09 09 09 |buttonSi|ze);....|
|00003090| 09 4c 69 6e 65 54 6f 28 | 62 75 74 74 6f 6e 53 69 |.LineTo(|buttonSi|
|000030a0| 7a 65 20 2d 20 68 61 6c | 66 53 69 7a 65 2c 20 30 |ze - hal|fSize, 0|
|000030b0| 29 3b 0d 09 09 09 43 6c | 6f 73 65 50 6f 6c 79 28 |);....Cl|osePoly(|
|000030c0| 29 3b 0d 09 09 09 50 52 | 49 56 41 54 45 2e 69 6e |);....PR|IVATE.in|
|000030d0| 74 65 72 6d 65 64 69 61 | 74 65 54 72 69 61 6e 67 |termedia|teTriang|
|000030e0| 6c 65 20 3d 20 4f 70 65 | 6e 50 6f 6c 79 28 29 3b |le = Ope|nPoly();|
|000030f0| 0d 09 09 09 09 4d 6f 76 | 65 54 6f 28 62 75 74 74 |.....Mov|eTo(butt|
|00003100| 6f 6e 53 69 7a 65 20 2d | 20 69 6e 74 65 72 6d 65 |onSize -| interme|
|00003110| 64 69 61 74 65 53 69 7a | 65 2c 20 30 29 3b 0d 09 |diateSiz|e, 0);..|
|00003120| 09 09 09 4c 69 6e 65 54 | 6f 28 62 75 74 74 6f 6e |...LineT|o(button|
|00003130| 53 69 7a 65 20 2d 20 69 | 6e 74 65 72 6d 65 64 69 |Size - i|ntermedi|
|00003140| 61 74 65 53 69 7a 65 2c | 20 69 6e 74 65 72 6d 65 |ateSize,| interme|
|00003150| 64 69 61 74 65 53 69 7a | 65 29 3b 0d 09 09 09 09 |diateSiz|e);.....|
|00003160| 4c 69 6e 65 54 6f 28 62 | 75 74 74 6f 6e 53 69 7a |LineTo(b|uttonSiz|
|00003170| 65 2c 20 69 6e 74 65 72 | 6d 65 64 69 61 74 65 53 |e, inter|mediateS|
|00003180| 69 7a 65 29 3b 0d 09 09 | 09 09 4c 69 6e 65 54 6f |ize);...|..LineTo|
|00003190| 28 62 75 74 74 6f 6e 53 | 69 7a 65 20 2d 20 69 6e |(buttonS|ize - in|
|000031a0| 74 65 72 6d 65 64 69 61 | 74 65 53 69 7a 65 2c 20 |termedia|teSize, |
|000031b0| 30 29 3b 0d 09 09 09 43 | 6c 6f 73 65 50 6f 6c 79 |0);....C|losePoly|
|000031c0| 28 29 3b 0d 09 09 7d 09 | 09 0d 09 09 2f 2a 0d 09 |();...}.|..../*..|
|000031d0| 09 20 2a 20 52 65 6d 65 | 6d 62 65 72 20 74 68 65 |. * Reme|mber the|
|000031e0| 20 77 69 64 74 68 20 6f | 66 20 74 68 65 20 22 62 | width o|f the "b|
|000031f0| 75 74 74 6f 6e 22 20 61 | 72 65 61 2e 0d 09 09 20 |utton" a|rea.... |
|00003200| 2a 2f 0d 09 09 50 52 49 | 56 41 54 45 2e 74 72 69 |*/...PRI|VATE.tri|
|00003210| 61 6e 67 6c 65 57 69 64 | 74 68 20 3d 0d 09 09 09 |angleWid|th =....|
|00003220| 09 09 28 2a 2a 50 52 49 | 56 41 54 45 2e 6f 70 65 |..(**PRI|VATE.ope|
|00003230| 6e 54 72 69 61 6e 67 6c | 65 29 2e 70 6f 6c 79 42 |nTriangl|e).polyB|
|00003240| 42 6f 78 2e 72 69 67 68 | 74 0d 09 09 09 09 09 2b |Box.righ|t......+|
|00003250| 20 6b 54 72 69 61 6e 67 | 6c 65 4f 75 74 73 69 64 | kTriang|leOutsid|
|00003260| 65 47 61 70 0d 09 09 09 | 09 09 2b 20 6b 54 72 69 |eGap....|..+ kTri|
|00003270| 61 6e 67 6c 65 49 6e 73 | 69 64 65 47 61 70 3b 0d |angleIns|ideGap;.|
|00003280| 7d 0d 0d 2f 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |}../* * |* * * * |
|00003290| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|000032a0| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|000032b0| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|000032c0| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|000032d0| 2a 20 2a 0d 20 2a 20 44 | 6f 54 77 69 73 74 44 6f |* *. * D|oTwistDo|
|000032e0| 77 6e 43 6c 69 63 6b 0d | 20 2a 0d 20 2a 20 44 6f |wnClick.| *. * Do|
|000032f0| 54 77 69 73 74 44 6f 77 | 6e 43 6c 69 63 6b 20 68 |TwistDow|nClick h|
|00003300| 61 6e 64 6c 65 73 20 61 | 6c 6c 20 70 72 6f 63 65 |andles a|ll proce|
|00003310| 73 73 69 6e 67 20 61 66 | 74 65 72 20 61 20 63 6c |ssing af|ter a cl|
|00003320| 69 63 6b 20 69 6e 20 74 | 68 65 20 6c 69 73 74 20 |ick in t|he list |
|00003330| 77 69 6e 64 6f 77 2e 0d | 20 2a 20 49 74 20 72 65 |window..| * It re|
|00003340| 74 75 72 6e 73 20 61 6e | 20 69 6e 64 69 63 61 74 |turns an| indicat|
|00003350| 69 6f 6e 20 6f 66 20 74 | 68 65 20 75 73 65 72 20 |ion of t|he user |
|00003360| 61 63 74 69 6f 6e 3a 0d | 20 2a 09 6b 54 77 69 73 |action:.| *.kTwis|
|00003370| 74 44 6f 77 6e 4e 6f 74 | 49 6e 4c 69 73 74 0d 20 |tDownNot|InList. |
|00003380| 2a 09 09 54 68 65 20 63 | 6c 69 63 6b 20 77 61 73 |*..The c|lick was|
|00003390| 20 6e 6f 74 20 69 6e 20 | 74 68 69 73 20 6c 69 73 | not in |this lis|
|000033a0| 74 2e 20 59 6f 75 72 20 | 61 70 70 6c 69 63 61 74 |t. Your |applicat|
|000033b0| 69 6f 6e 20 6d 61 79 20 | 69 67 6e 6f 72 65 20 74 |ion may |ignore t|
|000033c0| 68 69 73 20 63 6c 69 63 | 6b 20 6f 72 0d 20 2a 09 |his clic|k or. *.|
|000033d0| 09 74 61 6b 65 20 6f 74 | 68 65 72 20 61 70 70 72 |.take ot|her appr|
|000033e0| 6f 70 72 69 61 74 65 20 | 61 63 74 69 6f 6e 2e 0d |opriate |action..|
|000033f0| 20 2a 09 6b 54 77 69 73 | 74 44 6f 77 6e 4e 6f 43 | *.kTwis|tDownNoC|
|00003400| 6c 69 63 6b 0d 20 2a 09 | 09 54 68 65 20 75 73 65 |lick. *.|.The use|
|00003410| 72 20 72 65 6c 65 61 73 | 65 64 20 74 68 65 20 6d |r releas|ed the m|
|00003420| 6f 75 73 65 20 6f 75 74 | 73 69 64 65 20 6f 66 20 |ouse out|side of |
|00003430| 74 68 65 20 6c 69 73 74 | 20 61 72 65 61 3a 20 74 |the list| area: t|
|00003440| 68 69 73 20 63 6c 69 63 | 6b 20 73 68 6f 75 6c 64 |his clic|k should|
|00003450| 20 62 65 0d 20 2a 09 09 | 69 67 6e 6f 72 65 64 2e | be. *..|ignored.|
|00003460| 20 28 49 74 20 6d 61 79 | 20 68 61 76 65 20 62 65 | (It may| have be|
|00003470| 65 6e 20 61 20 63 6c 69 | 63 6b 20 69 6e 20 74 68 |en a cli|ck in th|
|00003480| 65 20 73 63 72 6f 6c 6c | 20 62 61 72 2e 29 0d 20 |e scroll| bar.). |
|00003490| 2a 09 6b 54 77 69 73 74 | 44 6f 77 6e 42 75 74 74 |*.kTwist|DownButt|
|000034a0| 6f 6e 43 6c 69 63 6b 0d | 20 2a 09 09 54 68 65 20 |onClick.| *..The |
|000034b0| 75 73 65 72 20 63 6c 69 | 63 6b 65 64 20 6f 6e 20 |user cli|cked on |
|000034c0| 74 68 65 20 74 77 69 73 | 74 2d 64 6f 77 6e 20 62 |the twis|t-down b|
|000034d0| 75 74 74 6f 6e 2e 20 54 | 68 65 20 6c 69 73 74 20 |utton. T|he list |
|000034e0| 77 69 6c 6c 20 62 65 20 | 65 78 70 61 6e 64 65 64 |will be |expanded|
|000034f0| 20 6f 72 0d 20 2a 09 09 | 63 6f 6e 74 72 61 63 74 | or. *..|contract|
|00003500| 65 64 20 61 73 20 61 70 | 70 72 6f 70 72 69 61 74 |ed as ap|propriat|
|00003510| 65 2e 0d 20 2a 09 6b 54 | 77 69 73 74 44 6f 77 6e |e.. *.kT|wistDown|
|00003520| 43 6c 69 63 6b 0d 20 2a | 09 09 54 68 65 20 75 73 |Click. *|..The us|
|00003530| 65 72 20 63 6c 69 63 6b | 65 64 20 28 6f 6e 63 65 |er click|ed (once|
|00003540| 29 20 6f 6e 20 61 20 6c | 69 73 74 20 64 61 74 75 |) on a l|ist datu|
|00003550| 6d 2e 20 54 68 65 20 61 | 70 70 6c 69 63 61 74 69 |m. The a|pplicati|
|00003560| 6f 6e 20 73 68 6f 75 6c | 64 20 74 72 65 61 74 20 |on shoul|d treat |
|00003570| 74 68 69 73 0d 20 2a 09 | 09 61 73 20 61 6e 20 69 |this. *.|.as an i|
|00003580| 74 65 6d 20 73 65 6c 65 | 63 74 69 6f 6e 2e 0d 20 |tem sele|ction.. |
|00003590| 2a 09 6b 54 77 69 73 74 | 44 6f 77 6e 44 6f 75 62 |*.kTwist|DownDoub|
|000035a0| 6c 65 43 6c 69 63 6b 0d | 20 2a 09 09 54 68 65 20 |leClick.| *..The |
|000035b0| 75 73 65 72 20 64 6f 75 | 62 6c 65 2d 63 6c 69 63 |user dou|ble-clic|
|000035c0| 6b 65 64 20 6f 6e 20 61 | 20 6c 69 73 74 20 64 61 |ked on a| list da|
|000035d0| 74 75 6d 2e 20 54 68 65 | 20 61 70 70 6c 69 63 61 |tum. The| applica|
|000035e0| 74 69 6f 6e 20 73 68 6f | 75 6c 64 20 6f 70 65 6e |tion sho|uld open|
|000035f0| 20 74 68 69 73 0d 20 2a | 09 09 69 74 65 6d 20 6f | this. *|..item o|
|00003600| 72 20 74 61 6b 65 20 6f | 74 68 65 72 20 61 70 70 |r take o|ther app|
|00003610| 72 6f 70 72 69 61 74 65 | 20 61 63 74 69 6f 6e 2e |ropriate| action.|
|00003620| 0d 20 2a 0d 20 2a 20 49 | 66 20 44 6f 54 77 69 73 |. *. * I|f DoTwis|
|00003630| 74 44 6f 77 6e 43 6c 69 | 63 6b 20 72 65 74 75 72 |tDownCli|ck retur|
|00003640| 6e 73 20 6b 54 77 69 73 | 74 44 6f 77 6e 42 75 74 |ns kTwis|tDownBut|
|00003650| 74 6f 6e 43 6c 69 63 6b | 2c 20 6b 54 77 69 73 74 |tonClick|, kTwist|
|00003660| 44 6f 77 6e 43 6c 69 63 | 6b 2c 20 6f 72 0d 20 2a |DownClic|k, or. *|
|00003670| 20 6b 54 77 69 73 74 44 | 6f 77 6e 44 6f 75 62 6c | kTwistD|ownDoubl|
|00003680| 65 43 6c 69 63 6b 2c 20 | 73 65 6c 65 63 74 65 64 |eClick, |selected|
|00003690| 4c 69 73 74 43 65 6c 6c | 20 77 69 6c 6c 20 62 65 |ListCell| will be|
|000036a0| 20 73 65 74 20 74 6f 20 | 74 68 65 20 63 65 6c 6c | set to |the cell|
|000036b0| 20 74 68 61 74 20 74 68 | 65 20 75 73 65 72 0d 20 | that th|e user. |
|000036c0| 2a 20 63 6c 69 63 6b 65 | 64 20 6f 6e 2e 0d 20 2a |* clicke|d on.. *|
|000036d0| 2f 0d 54 77 69 73 74 44 | 6f 77 6e 43 6c 69 63 6b |/.TwistD|ownClick|
|000036e0| 53 74 61 74 65 0d 44 6f | 54 77 69 73 74 44 6f 77 |State.Do|TwistDow|
|000036f0| 6e 43 6c 69 63 6b 28 0d | 09 09 4c 69 73 74 48 61 |nClick(.|..ListHa|
|00003700| 6e 64 6c 65 09 09 09 09 | 09 74 68 65 4c 69 73 74 |ndle....|.theList|
|00003710| 2c 0d 09 09 63 6f 6e 73 | 74 20 45 76 65 6e 74 52 |,...cons|t EventR|
|00003720| 65 63 6f 72 64 09 09 09 | 2a 65 76 65 6e 74 52 65 |ecord...|*eventRe|
|00003730| 63 6f 72 64 50 74 72 2c | 0d 09 09 43 65 6c 6c 09 |cordPtr,|...Cell.|
|00003740| 09 09 09 09 09 2a 73 65 | 6c 65 63 74 65 64 4c 69 |.....*se|lectedLi|
|00003750| 73 74 43 65 6c 6c 0d 09 | 29 0d 7b 0d 09 09 43 65 |stCell..|).{...Ce|
|00003760| 6c 6c 09 09 09 09 09 09 | 74 68 65 43 65 6c 6c 3b |ll......|theCell;|
|00003770| 0d 09 09 52 65 63 74 09 | 09 09 09 09 09 68 69 74 |...Rect.|.....hit|
|00003780| 52 65 63 74 3b 0d 09 09 | 42 6f 6f 6c 65 61 6e 09 |Rect;...|Boolean.|
|00003790| 09 09 09 09 09 69 6e 48 | 69 74 52 65 63 74 3b 0d |.....inH|itRect;.|
|000037a0| 09 09 42 6f 6f 6c 65 61 | 6e 09 09 09 09 09 09 6e |..Boolea|n......n|
|000037b0| 65 77 49 6e 48 69 74 52 | 65 63 74 3b 0d 09 09 73 |ewInHitR|ect;...s|
|000037c0| 68 6f 72 74 09 09 09 09 | 09 09 63 65 6c 6c 48 65 |hort....|..cellHe|
|000037d0| 69 67 68 74 3b 0d 09 09 | 73 68 6f 72 74 09 09 09 |ight;...|short...|
|000037e0| 09 09 09 76 69 73 69 62 | 6c 65 54 6f 70 3b 0d 09 |...visib|leTop;..|
|000037f0| 09 54 77 69 73 74 44 6f | 77 6e 48 64 6c 09 09 09 |.TwistDo|wnHdl...|
|00003800| 09 74 77 69 73 74 44 6f | 77 6e 48 61 6e 64 6c 65 |.twistDo|wnHandle|
|00003810| 3b 0d 09 09 50 6f 69 6e | 74 09 09 09 09 09 09 6d |;...Poin|t......m|
|00003820| 6f 75 73 65 50 74 3b 0d | 09 09 54 77 69 73 74 44 |ousePt;.|..TwistD|
|00003830| 6f 77 6e 43 6c 69 63 6b | 53 74 61 74 65 09 09 09 |ownClick|State...|
|00003840| 72 65 73 75 6c 74 3b 0d | 09 09 6c 6f 6e 67 09 09 |result;.|..long..|
|00003850| 09 09 09 09 66 69 6e 61 | 6c 54 69 63 6b 73 3b 0d |....fina|lTicks;.|
|00003860| 0d 09 09 6d 6f 75 73 65 | 50 74 20 3d 20 65 76 65 |...mouse|Pt = eve|
|00003870| 6e 74 52 65 63 6f 72 64 | 50 74 72 2d 3e 77 68 65 |ntRecord|Ptr->whe|
|00003880| 72 65 3b 0d 09 09 47 6c | 6f 62 61 6c 54 6f 4c 6f |re;...Gl|obalToLo|
|00003890| 63 61 6c 28 26 6d 6f 75 | 73 65 50 74 29 3b 0d 09 |cal(&mou|sePt);..|
|000038a0| 09 68 69 74 52 65 63 74 | 20 3d 20 28 2a 2a 74 68 |.hitRect| = (**th|
|000038b0| 65 4c 69 73 74 29 2e 72 | 56 69 65 77 3b 0d 09 09 |eList).r|View;...|
|000038c0| 68 69 74 52 65 63 74 2e | 72 69 67 68 74 20 2b 3d |hitRect.|right +=|
|000038d0| 20 6b 53 63 72 6f 6c 6c | 42 61 72 57 69 64 74 68 | kScroll|BarWidth|
|000038e0| 3b 0d 09 09 69 66 20 28 | 50 74 49 6e 52 65 63 74 |;...if (|PtInRect|
|000038f0| 28 6d 6f 75 73 65 50 74 | 2c 20 26 68 69 74 52 65 |(mousePt|, &hitRe|
|00003900| 63 74 29 20 3d 3d 20 46 | 41 4c 53 45 29 0d 09 09 |ct) == F|ALSE)...|
|00003910| 09 72 65 73 75 6c 74 20 | 3d 20 6b 54 77 69 73 74 |.result |= kTwist|
|00003920| 44 6f 77 6e 4e 6f 74 49 | 6e 4c 69 73 74 3b 0d 09 |DownNotI|nList;..|
|00003930| 09 65 6c 73 65 20 7b 0d | 09 09 09 2f 2a 0d 09 09 |.else {.|.../*...|
|00003940| 09 20 2a 20 53 65 74 20 | 68 69 74 52 65 63 74 20 |. * Set |hitRect |
|00003950| 74 6f 20 74 68 65 20 61 | 72 65 61 20 6f 66 20 74 |to the a|rea of t|
|00003960| 68 65 20 6c 69 73 74 20 | 74 68 61 74 20 63 6f 6e |he list |that con|
|00003970| 74 61 69 6e 73 20 74 68 | 65 20 74 77 69 73 74 2d |tains th|e twist-|
|00003980| 64 6f 77 6e 0d 09 09 09 | 20 2a 20 74 72 69 61 6e |down....| * trian|
|00003990| 67 6c 65 20 62 75 74 74 | 6f 6e 2e 20 4e 6f 74 65 |gle butt|on. Note|
|000039a0| 20 74 68 61 74 20 74 68 | 69 73 20 70 72 65 73 75 | that th|is presu|
|000039b0| 6d 65 73 20 61 20 6c 69 | 73 74 20 77 68 65 72 65 |mes a li|st where|
|000039c0| 20 6f 6e 6c 79 20 63 6f | 6c 75 6d 6e 0d 09 09 09 | only co|lumn....|
|000039d0| 20 2a 20 7a 65 72 6f 20 | 69 73 20 64 69 73 70 6c | * zero |is displ|
|000039e0| 61 79 65 64 2e 0d 09 09 | 09 20 2a 2f 0d 09 09 09 |ayed....|. */....|
|000039f0| 69 66 20 28 50 52 49 56 | 41 54 45 2e 69 73 4c 65 |if (PRIV|ATE.isLe|
|00003a00| 66 74 4a 75 73 74 69 66 | 79 29 20 7b 0d 09 09 09 |ftJustif|y) {....|
|00003a10| 09 68 69 74 52 65 63 74 | 2e 72 69 67 68 74 20 3d |.hitRect|.right =|
|00003a20| 20 28 2a 2a 74 68 65 4c | 69 73 74 29 2e 72 56 69 | (**theL|ist).rVi|
|00003a30| 65 77 2e 6c 65 66 74 0d | 09 09 09 09 09 09 2b 20 |ew.left.|......+ |
|00003a40| 28 2a 2a 74 68 65 4c 69 | 73 74 29 2e 69 6e 64 65 |(**theLi|st).inde|
|00003a50| 6e 74 2e 68 0d 09 09 09 | 09 09 09 2b 20 50 52 49 |nt.h....|...+ PRI|
|00003a60| 56 41 54 45 2e 74 72 69 | 61 6e 67 6c 65 57 69 64 |VATE.tri|angleWid|
|00003a70| 74 68 3b 0d 09 09 09 7d | 0d 09 09 09 65 6c 73 65 |th;....}|....else|
|00003a80| 20 7b 0d 09 09 09 09 68 | 69 74 52 65 63 74 2e 6c | {.....h|itRect.l|
|00003a90| 65 66 74 20 3d 20 28 2a | 2a 74 68 65 4c 69 73 74 |eft = (*|*theList|
|00003aa0| 29 2e 72 56 69 65 77 2e | 72 69 67 68 74 0d 09 09 |).rView.|right...|
|00003ab0| 09 09 09 09 2d 20 28 2a | 2a 74 68 65 4c 69 73 74 |....- (*|*theList|
|00003ac0| 29 2e 69 6e 64 65 6e 74 | 2e 68 0d 09 09 09 09 09 |).indent|.h......|
|00003ad0| 09 2d 20 50 52 49 56 41 | 54 45 2e 74 72 69 61 6e |.- PRIVA|TE.trian|
|00003ae0| 67 6c 65 57 69 64 74 68 | 3b 0d 09 09 09 7d 0d 09 |gleWidth|;....}..|
|00003af0| 09 09 69 6e 48 69 74 52 | 65 63 74 20 3d 20 46 41 |..inHitR|ect = FA|
|00003b00| 4c 53 45 3b 0d 09 09 09 | 69 66 20 28 50 74 49 6e |LSE;....|if (PtIn|
|00003b10| 52 65 63 74 28 6d 6f 75 | 73 65 50 74 2c 20 26 68 |Rect(mou|sePt, &h|
|00003b20| 69 74 52 65 63 74 29 29 | 20 7b 0d 09 09 09 09 2f |itRect))| {...../|
|00003b30| 2a 0d 09 09 09 09 20 2a | 20 49 74 27 73 20 69 6e |*..... *| It's in|
|00003b40| 20 61 20 74 68 65 20 74 | 72 69 61 6e 67 6c 65 20 | a the t|riangle |
|00003b50| 61 72 65 61 2e 20 46 69 | 6e 64 20 74 68 65 20 73 |area. Fi|nd the s|
|00003b60| 65 6c 65 63 74 65 64 20 | 63 65 6c 6c 20 61 6e 64 |elected |cell and|
|00003b70| 20 63 68 65 63 6b 0d 09 | 09 09 09 20 2a 20 77 68 | check..|... * wh|
|00003b80| 65 74 68 65 72 20 74 68 | 69 73 20 63 65 6c 6c 27 |ether th|is cell'|
|00003b90| 73 20 65 6c 65 6d 65 6e | 74 20 68 61 73 20 61 20 |s elemen|t has a |
|00003ba0| 76 69 73 69 62 6c 65 20 | 74 77 69 73 74 2d 64 6f |visible |twist-do|
|00003bb0| 77 6e 20 62 75 74 74 6f | 6e 2e 0d 09 09 09 09 20 |wn butto|n...... |
|00003bc0| 2a 2f 0d 09 09 09 09 76 | 69 73 69 62 6c 65 54 6f |*/.....v|isibleTo|
|00003bd0| 70 20 3d 20 28 2a 2a 74 | 68 65 4c 69 73 74 29 2e |p = (**t|heList).|
|00003be0| 76 69 73 69 62 6c 65 2e | 74 6f 70 3b 0d 09 09 09 |visible.|top;....|
|00003bf0| 09 63 65 6c 6c 48 65 69 | 67 68 74 20 3d 20 28 2a |.cellHei|ght = (*|
|00003c00| 2a 74 68 65 4c 69 73 74 | 29 2e 63 65 6c 6c 53 69 |*theList|).cellSi|
|00003c10| 7a 65 2e 76 3b 0d 09 09 | 09 09 74 68 65 43 65 6c |ze.v;...|..theCel|
|00003c20| 6c 2e 68 20 3d 20 30 3b | 09 09 2f 2a 20 54 68 69 |l.h = 0;|../* Thi|
|00003c30| 73 20 68 61 73 20 74 68 | 65 20 76 69 73 75 61 6c |s has th|e visual|
|00003c40| 20 63 6f 6e 74 65 6e 74 | 09 09 09 2a 2f 0d 09 09 | content|...*/...|
|00003c50| 09 09 74 68 65 43 65 6c | 6c 2e 76 20 3d 0d 09 09 |..theCel|l.v =...|
|00003c60| 09 09 09 28 28 6d 6f 75 | 73 65 50 74 2e 76 20 2d |...((mou|sePt.v -|
|00003c70| 20 28 2a 2a 74 68 65 4c | 69 73 74 29 2e 72 56 69 | (**theL|ist).rVi|
|00003c80| 65 77 2e 74 6f 70 29 20 | 2f 20 63 65 6c 6c 48 65 |ew.top) |/ cellHe|
|00003c90| 69 67 68 74 29 0d 09 09 | 09 09 09 2b 20 76 69 73 |ight)...|...+ vis|
|00003ca0| 69 62 6c 65 54 6f 70 3b | 0d 09 09 09 09 2f 2a 0d |ibleTop;|...../*.|
|00003cb0| 09 09 09 09 20 2a 20 53 | 65 74 20 69 6e 48 69 74 |.... * S|et inHit|
|00003cc0| 52 65 63 74 20 54 52 55 | 45 20 69 66 20 74 68 65 |Rect TRU|E if the|
|00003cd0| 72 65 20 69 73 20 61 20 | 73 75 62 2d 6c 69 73 74 |re is a |sub-list|
|00003ce0| 20 62 75 74 74 6f 6e 20 | 68 65 72 65 2e 0d 09 09 | button |here....|
|00003cf0| 09 09 20 2a 20 4e 6f 74 | 65 3a 20 69 74 20 69 73 |.. * Not|e: it is|
|00003d00| 20 70 6f 73 73 69 62 6c | 65 20 74 6f 20 68 61 76 | possibl|e to hav|
|00003d10| 65 20 61 20 62 75 74 74 | 6f 6e 20 62 75 74 20 6e |e a butt|on but n|
|00003d20| 6f 20 61 63 74 75 61 6c | 20 73 75 62 2d 6c 69 73 |o actual| sub-lis|
|00003d30| 74 0d 09 09 09 09 20 2a | 20 28 63 6f 6e 73 69 64 |t..... *| (consid|
|00003d40| 65 72 20 61 6e 20 65 6d | 70 74 79 20 66 6f 6c 64 |er an em|pty fold|
|00003d50| 65 72 20 69 6e 20 61 20 | 64 69 73 6b 20 68 69 65 |er in a |disk hie|
|00003d60| 72 61 72 63 68 79 3a 20 | 74 68 65 20 70 72 65 73 |rarchy: |the pres|
|00003d70| 65 6e 63 65 0d 09 09 09 | 09 20 2a 20 6f 66 20 74 |ence....|. * of t|
|00003d80| 68 65 20 62 75 74 74 6f | 6e 20 69 6e 64 69 63 61 |he butto|n indica|
|00003d90| 74 65 73 20 22 74 68 69 | 73 20 69 73 20 61 20 66 |tes "thi|s is a f|
|00003da0| 6f 6c 64 65 72 22 20 74 | 6f 20 74 68 65 20 75 73 |older" t|o the us|
|00003db0| 65 72 29 2e 0d 09 09 09 | 09 20 2a 2f 0d 09 09 09 |er).....|. */....|
|00003dc0| 09 74 77 69 73 74 44 6f | 77 6e 48 61 6e 64 6c 65 |.twistDo|wnHandle|
|00003dd0| 20 3d 20 47 65 74 54 77 | 69 73 74 44 6f 77 6e 45 | = GetTw|istDownE|
|00003de0| 6c 65 6d 65 6e 74 48 61 | 6e 64 6c 65 28 74 68 65 |lementHa|ndle(the|
|00003df0| 4c 69 73 74 2c 20 74 68 | 65 43 65 6c 6c 29 3b 0d |List, th|eCell);.|
|00003e00| 09 09 09 09 69 66 20 28 | 74 77 69 73 74 44 6f 77 |....if (|twistDow|
|00003e10| 6e 48 61 6e 64 6c 65 20 | 21 3d 20 4e 55 4c 4c 0d |nHandle |!= NULL.|
|00003e20| 09 09 09 09 20 26 26 20 | 54 65 73 74 54 44 46 6c |.... && |TestTDFl|
|00003e30| 61 67 28 74 77 69 73 74 | 44 6f 77 6e 48 61 6e 64 |ag(twist|DownHand|
|00003e40| 6c 65 2c 20 6b 48 61 73 | 54 77 69 73 74 44 6f 77 |le, kHas|TwistDow|
|00003e50| 6e 29 29 0d 09 09 09 09 | 09 69 6e 48 69 74 52 65 |n)).....|.inHitRe|
|00003e60| 63 74 20 3d 20 54 52 55 | 45 3b 0d 09 09 09 7d 0d |ct = TRU|E;....}.|
|00003e70| 09 09 09 69 66 20 28 69 | 6e 48 69 74 52 65 63 74 |...if (i|nHitRect|
|00003e80| 20 3d 3d 20 46 41 4c 53 | 45 29 20 7b 0d 09 09 09 | == FALS|E) {....|
|00003e90| 09 2f 2a 0d 09 09 09 09 | 20 2a 20 54 68 69 73 20 |./*.....| * This |
|00003ea0| 63 65 6c 6c 20 64 6f 65 | 73 6e 27 74 20 68 61 76 |cell doe|sn't hav|
|00003eb0| 65 20 61 6e 20 65 78 70 | 61 6e 73 69 6f 6e 20 74 |e an exp|ansion t|
|00003ec0| 72 69 61 6e 67 6c 65 2c | 20 6f 72 20 74 68 65 20 |riangle,| or the |
|00003ed0| 75 73 65 72 20 64 69 64 | 0d 09 09 09 09 20 2a 20 |user did|..... * |
|00003ee0| 6e 6f 74 20 63 6c 69 63 | 6b 20 69 6e 20 74 68 65 |not clic|k in the|
|00003ef0| 20 62 75 74 74 6f 6e 20 | 61 72 65 61 2e 20 4a 75 | button |area. Ju|
|00003f00| 73 74 20 63 61 6c 6c 20 | 74 68 65 20 20 6e 6f 72 |st call |the nor|
|00003f10| 6d 61 6c 20 6c 69 73 74 | 20 63 6c 69 63 6b 0d 09 |mal list| click..|
|00003f20| 09 09 09 20 2a 20 68 61 | 6e 64 6c 65 72 20 74 6f |... * ha|ndler to|
|00003f30| 20 6d 61 6e 61 67 65 20 | 74 68 65 20 73 63 72 6f | manage |the scro|
|00003f40| 6c 6c 20 62 61 72 73 2e | 20 53 65 74 20 72 65 73 |ll bars.| Set res|
|00003f50| 75 6c 74 20 61 70 70 72 | 6f 70 72 69 61 74 65 6c |ult appr|opriatel|
|00003f60| 79 2e 0d 09 09 09 09 20 | 2a 2f 0d 09 09 09 09 72 |y...... |*/.....r|
|00003f70| 65 73 75 6c 74 20 3d 20 | 28 4c 43 6c 69 63 6b 28 |esult = |(LClick(|
|00003f80| 6d 6f 75 73 65 50 74 2c | 20 65 76 65 6e 74 52 65 |mousePt,| eventRe|
|00003f90| 63 6f 72 64 50 74 72 2d | 3e 6d 6f 64 69 66 69 65 |cordPtr-|>modifie|
|00003fa0| 72 73 2c 20 74 68 65 4c | 69 73 74 29 29 0d 09 09 |rs, theL|ist))...|
|00003fb0| 09 09 09 3f 20 6b 54 77 | 69 73 74 44 6f 77 6e 44 |...? kTw|istDownD|
|00003fc0| 6f 75 62 6c 65 43 6c 69 | 63 6b 0d 09 09 09 09 09 |oubleCli|ck......|
|00003fd0| 3a 20 6b 54 77 69 73 74 | 44 6f 77 6e 43 6c 69 63 |: kTwist|DownClic|
|00003fe0| 6b 3b 0d 09 09 09 7d 0d | 09 09 09 65 6c 73 65 20 |k;....}.|...else |
|00003ff0| 7b 0d 09 09 09 09 2f 2a | 0d 09 09 09 09 20 2a 20 |{...../*|..... * |
|00004000| 54 68 65 20 75 73 65 72 | 20 63 6c 69 63 6b 65 64 |The user| clicked|
|00004010| 20 6f 6e 20 69 6e 20 74 | 68 65 20 74 77 69 73 74 | on in t|he twist|
|00004020| 2d 64 6f 77 6e 20 62 75 | 74 74 6f 6e 20 61 72 65 |-down bu|tton are|
|00004030| 61 2e 20 53 69 6d 75 6c | 61 74 65 20 61 0d 09 09 |a. Simul|ate a...|
|00004040| 09 09 20 2a 20 62 75 74 | 74 6f 6e 20 63 6c 69 63 |.. * but|ton clic|
|00004050| 6b 20 61 6e 64 20 74 72 | 61 63 6b 20 74 68 65 20 |k and tr|ack the |
|00004060| 6d 6f 75 73 65 20 61 73 | 20 69 74 20 77 61 6e 64 |mouse as| it wand|
|00004070| 65 72 73 20 69 6e 20 61 | 6e 64 20 6f 75 74 20 6f |ers in a|nd out o|
|00004080| 66 20 74 68 65 0d 09 09 | 09 09 20 2a 20 62 75 74 |f the...|.. * but|
|00004090| 74 6f 6e 20 61 72 65 61 | 2e 20 28 69 6e 48 69 74 |ton area|. (inHit|
|000040a0| 52 65 63 74 20 69 73 20 | 74 72 75 65 20 61 74 20 |Rect is |true at |
|000040b0| 74 68 69 73 20 70 6f 69 | 6e 74 29 2e 20 57 68 65 |this poi|nt). Whe|
|000040c0| 6e 65 76 65 72 20 74 68 | 65 0d 09 09 09 09 20 2a |never th|e..... *|
|000040d0| 20 62 75 74 74 6f 6e 20 | 73 65 6c 65 63 74 69 6f | button |selectio|
|000040e0| 6e 20 73 74 61 74 65 20 | 63 68 61 6e 67 65 73 2c |n state |changes,|
|000040f0| 20 63 61 6c 6c 20 4c 44 | 72 61 77 20 74 6f 20 72 | call LD|raw to r|
|00004100| 65 64 72 61 77 20 74 68 | 65 0d 09 09 09 09 20 2a |edraw th|e..... *|
|00004110| 20 74 77 69 73 74 2d 64 | 6f 77 6e 20 74 72 69 61 | twist-d|own tria|
|00004120| 6e 67 6c 65 2e 20 54 68 | 69 73 20 69 73 20 74 68 |ngle. Th|is is th|
|00004130| 65 20 77 61 79 20 74 6f | 20 73 69 6d 75 6c 61 74 |e way to| simulat|
|00004140| 65 20 54 72 61 63 6b 43 | 6f 6e 74 72 6f 6c 2e 0d |e TrackC|ontrol..|
|00004150| 09 09 09 09 20 2a 2f 0d | 09 09 09 09 53 65 74 54 |.... */.|....SetT|
|00004160| 44 46 6c 61 67 28 74 77 | 69 73 74 44 6f 77 6e 48 |DFlag(tw|istDownH|
|00004170| 61 6e 64 6c 65 2c 0d 09 | 09 09 09 09 28 6b 44 72 |andle,..|....(kDr|
|00004180| 61 77 42 75 74 74 6f 6e | 46 69 6c 6c 65 64 20 7c |awButton|Filled ||
|00004190| 20 6b 4f 6e 6c 79 52 65 | 64 72 61 77 42 75 74 74 | kOnlyRe|drawButt|
|000041a0| 6f 6e 29 29 3b 0d 09 09 | 09 09 4c 44 72 61 77 28 |on));...|..LDraw(|
|000041b0| 74 68 65 43 65 6c 6c 2c | 20 74 68 65 4c 69 73 74 |theCell,| theList|
|000041c0| 29 3b 0d 09 09 09 09 2f | 2a 0d 09 09 09 09 20 2a |);...../|*..... *|
|000041d0| 20 53 65 74 20 68 69 74 | 52 65 63 74 20 74 6f 20 | Set hit|Rect to |
|000041e0| 74 68 65 20 64 69 6d 65 | 6e 73 69 6f 6e 73 20 6f |the dime|nsions o|
|000041f0| 66 20 74 68 65 20 74 77 | 69 73 74 2d 64 6f 77 6e |f the tw|ist-down|
|00004200| 20 62 75 74 74 6f 6e 2e | 0d 09 09 09 09 20 2a 2f | button.|..... */|
|00004210| 0d 09 09 09 09 68 69 74 | 52 65 63 74 2e 74 6f 70 |.....hit|Rect.top|
|00004220| 20 3d 0d 09 09 09 09 09 | 28 28 74 68 65 43 65 6c | =......|((theCel|
|00004230| 6c 2e 76 20 2d 20 76 69 | 73 69 62 6c 65 54 6f 70 |l.v - vi|sibleTop|
|00004240| 29 20 2a 20 63 65 6c 6c | 48 65 69 67 68 74 29 0d |) * cell|Height).|
|00004250| 09 09 09 09 09 2b 20 28 | 2a 2a 74 68 65 4c 69 73 |.....+ (|**theLis|
|00004260| 74 29 2e 72 56 69 65 77 | 2e 74 6f 70 3b 0d 09 09 |t).rView|.top;...|
|00004270| 09 09 68 69 74 52 65 63 | 74 2e 62 6f 74 74 6f 6d |..hitRec|t.bottom|
|00004280| 20 3d 20 68 69 74 52 65 | 63 74 2e 74 6f 70 20 2b | = hitRe|ct.top +|
|00004290| 20 63 65 6c 6c 48 65 69 | 67 68 74 3b 0d 09 09 09 | cellHei|ght;....|
|000042a0| 09 2f 2a 0d 09 09 09 09 | 20 2a 20 54 72 61 63 6b |./*.....| * Track|
|000042b0| 20 74 68 65 20 6d 6f 75 | 73 65 20 77 68 69 6c 65 | the mou|se while|
|000042c0| 20 69 74 20 73 74 69 6c | 6c 20 64 6f 77 6e 3a 20 | it stil|l down: |
|000042d0| 69 66 20 69 74 20 6d 6f | 76 65 73 20 69 6e 74 6f |if it mo|ves into|
|000042e0| 20 74 68 65 0d 09 09 09 | 09 20 2a 20 74 72 69 61 | the....|. * tria|
|000042f0| 6e 67 6c 65 20 72 65 63 | 74 61 6e 67 6c 65 2c 20 |ngle rec|tangle, |
|00004300| 72 65 64 72 61 77 20 69 | 74 20 66 69 6c 6c 65 64 |redraw i|t filled|
|00004310| 2c 20 69 66 20 69 74 20 | 6d 6f 76 65 73 20 6f 75 |, if it |moves ou|
|00004320| 74 20 6f 66 20 74 68 65 | 0d 09 09 09 09 20 2a 20 |t of the|..... * |
|00004330| 74 72 69 61 6e 67 6c 65 | 2c 20 72 65 64 72 61 77 |triangle|, redraw|
|00004340| 20 69 74 20 75 6e 66 69 | 6c 6c 65 64 2e 0d 09 09 | it unfi|lled....|
|00004350| 09 09 20 2a 2f 0d 09 09 | 09 09 69 66 20 28 53 74 |.. */...|..if (St|
|00004360| 69 6c 6c 44 6f 77 6e 28 | 29 29 20 7b 0d 09 09 09 |illDown(|)) {....|
|00004370| 09 09 77 68 69 6c 65 20 | 28 57 61 69 74 4d 6f 75 |..while |(WaitMou|
|00004380| 73 65 55 70 28 29 29 20 | 7b 0d 09 09 09 09 09 09 |seUp()) |{.......|
|00004390| 47 65 74 4d 6f 75 73 65 | 28 26 6d 6f 75 73 65 50 |GetMouse|(&mouseP|
|000043a0| 74 29 3b 0d 09 09 09 09 | 09 09 6e 65 77 49 6e 48 |t);.....|..newInH|
|000043b0| 69 74 52 65 63 74 20 3d | 20 50 74 49 6e 52 65 63 |itRect =| PtInRec|
|000043c0| 74 28 6d 6f 75 73 65 50 | 74 2c 20 26 68 69 74 52 |t(mouseP|t, &hitR|
|000043d0| 65 63 74 29 3b 0d 09 09 | 09 09 09 09 69 66 20 28 |ect);...|....if (|
|000043e0| 6e 65 77 49 6e 48 69 74 | 52 65 63 74 20 21 3d 20 |newInHit|Rect != |
|000043f0| 69 6e 48 69 74 52 65 63 | 74 29 20 7b 0d 09 09 09 |inHitRec|t) {....|
|00004400| 09 09 09 09 2f 2a 0d 09 | 09 09 09 09 09 09 20 2a |..../*..|...... *|
|00004410| 20 54 68 65 20 6d 6f 75 | 73 65 20 6d 6f 76 65 64 | The mou|se moved|
|00004420| 20 69 6e 20 6f 72 20 6f | 75 74 20 6f 66 20 74 68 | in or o|ut of th|
|00004430| 65 20 74 72 69 61 6e 67 | 6c 65 2e 0d 09 09 09 09 |e triang|le......|
|00004440| 09 09 09 20 2a 2f 0d 09 | 09 09 09 09 09 09 49 6e |... */..|......In|
|00004450| 76 65 72 74 54 44 46 6c | 61 67 28 74 77 69 73 74 |vertTDFl|ag(twist|
|00004460| 44 6f 77 6e 48 61 6e 64 | 6c 65 2c 20 6b 44 72 61 |DownHand|le, kDra|
|00004470| 77 42 75 74 74 6f 6e 46 | 69 6c 6c 65 64 29 3b 0d |wButtonF|illed);.|
|00004480| 09 09 09 09 09 09 09 4c | 44 72 61 77 28 74 68 65 |.......L|Draw(the|
|00004490| 43 65 6c 6c 2c 20 74 68 | 65 4c 69 73 74 29 3b 0d |Cell, th|eList);.|
|000044a0| 09 09 09 09 09 09 09 69 | 6e 48 69 74 52 65 63 74 |.......i|nHitRect|
|000044b0| 20 3d 20 6e 65 77 49 6e | 48 69 74 52 65 63 74 3b | = newIn|HitRect;|
|000044c0| 0d 09 09 09 09 09 09 7d | 0d 09 09 09 09 09 7d 0d |.......}|......}.|
|000044d0| 09 09 09 09 7d 0d 09 09 | 09 09 2f 2a 0d 09 09 09 |....}...|../*....|
|000044e0| 09 20 2a 20 54 68 65 20 | 75 73 65 72 20 72 65 6c |. * The |user rel|
|000044f0| 65 61 73 65 64 20 74 68 | 65 20 6d 6f 75 73 65 2e |eased th|e mouse.|
|00004500| 0d 09 09 09 09 20 2a 2f | 0d 09 09 09 09 69 66 20 |..... */|.....if |
|00004510| 28 69 6e 48 69 74 52 65 | 63 74 20 3d 3d 20 46 41 |(inHitRe|ct == FA|
|00004520| 4c 53 45 29 20 7b 0d 09 | 09 09 09 09 2f 2a 0d 09 |LSE) {..|..../*..|
|00004530| 09 09 09 09 20 2a 20 4e | 6f 72 6d 61 6c 6c 79 2c |.... * N|ormally,|
|00004540| 20 64 72 61 77 42 75 74 | 74 6f 6e 46 69 6c 6c 65 | drawBut|tonFille|
|00004550| 64 20 77 69 6c 6c 20 62 | 65 20 63 6c 65 61 72 2e |d will b|e clear.|
|00004560| 20 49 74 20 63 61 6e 20 | 62 65 20 73 65 74 2c 0d | It can |be set,.|
|00004570| 09 09 09 09 09 20 2a 20 | 68 6f 77 65 76 65 72 2c |..... * |however,|
|00004580| 20 69 66 20 74 68 65 20 | 75 73 65 72 20 63 6c 69 | if the |user cli|
|00004590| 63 6b 73 20 73 6f 20 62 | 72 69 65 66 6c 79 20 6f |cks so b|riefly o|
|000045a0| 6e 20 74 68 65 20 74 72 | 69 61 6e 67 6c 65 0d 09 |n the tr|iangle..|
|000045b0| 09 09 09 09 20 2a 20 74 | 68 61 74 20 74 68 65 20 |.... * t|hat the |
|000045c0| 53 74 69 6c 6c 44 6f 77 | 6e 28 29 20 74 65 73 74 |StillDow|n() test|
|000045d0| 20 61 62 6f 76 65 20 69 | 73 20 46 41 4c 53 45 2e | above i|s FALSE.|
|000045e0| 0d 09 09 09 09 09 20 2a | 2f 0d 09 09 09 09 09 69 |...... *|/......i|
|000045f0| 66 20 28 54 65 73 74 54 | 44 46 6c 61 67 28 74 77 |f (TestT|DFlag(tw|
|00004600| 69 73 74 44 6f 77 6e 48 | 61 6e 64 6c 65 2c 20 6b |istDownH|andle, k|
|00004610| 44 72 61 77 42 75 74 74 | 6f 6e 46 69 6c 6c 65 64 |DrawButt|onFilled|
|00004620| 29 29 20 7b 0d 09 09 09 | 09 09 09 43 6c 65 61 72 |)) {....|...Clear|
|00004630| 54 44 46 6c 61 67 28 74 | 77 69 73 74 44 6f 77 6e |TDFlag(t|wistDown|
|00004640| 48 61 6e 64 6c 65 2c 20 | 6b 44 72 61 77 42 75 74 |Handle, |kDrawBut|
|00004650| 74 6f 6e 46 69 6c 6c 65 | 64 29 3b 0d 09 09 09 09 |tonFille|d);.....|
|00004660| 09 09 4c 44 72 61 77 28 | 74 68 65 43 65 6c 6c 2c |..LDraw(|theCell,|
|00004670| 20 74 68 65 4c 69 73 74 | 29 3b 0d 09 09 09 09 09 | theList|);......|
|00004680| 7d 0d 09 09 09 09 09 72 | 65 73 75 6c 74 20 3d 20 |}......r|esult = |
|00004690| 6b 54 77 69 73 74 44 6f | 77 6e 4e 6f 43 6c 69 63 |kTwistDo|wnNoClic|
|000046a0| 6b 3b 0d 09 09 09 09 7d | 0d 09 09 09 09 65 6c 73 |k;.....}|.....els|
|000046b0| 65 20 7b 0d 09 09 09 09 | 09 2f 2a 0d 09 09 09 09 |e {.....|./*.....|
|000046c0| 09 20 2a 20 54 68 65 20 | 75 73 65 72 20 72 65 6c |. * The |user rel|
|000046d0| 65 61 73 65 64 20 74 68 | 65 20 6d 6f 75 73 65 20 |eased th|e mouse |
|000046e0| 69 6e 20 74 68 65 20 65 | 78 70 61 6e 73 69 6f 6e |in the e|xpansion|
|000046f0| 20 74 72 69 61 6e 67 6c | 65 2e 0d 09 09 09 09 09 | triangl|e.......|
|00004700| 20 2a 20 44 72 61 77 20 | 61 6e 20 69 6e 74 65 72 | * Draw |an inter|
|00004710| 6d 65 64 69 61 74 65 20 | 22 61 6e 69 6d 61 74 69 |mediate |"animati|
|00004720| 6f 6e 22 20 74 72 69 61 | 6e 67 6c 65 2e 20 54 68 |on" tria|ngle. Th|
|00004730| 65 6e 20 63 61 6c 6c 20 | 0d 09 09 09 09 09 20 2a |en call |...... *|
|00004740| 20 45 78 70 61 6e 64 4f | 72 43 6f 6c 6c 61 70 73 | ExpandO|rCollaps|
|00004750| 65 54 77 69 73 74 44 6f | 77 6e 4c 69 73 74 20 77 |eTwistDo|wnList w|
|00004760| 68 69 63 68 20 77 69 6c | 6c 20 72 65 64 72 61 77 |hich wil|l redraw|
|00004770| 20 74 68 65 0d 09 09 09 | 09 09 20 2a 20 62 75 74 | the....|.. * but|
|00004780| 74 6f 6e 20 69 6e 20 69 | 74 73 20 6e 65 77 20 73 |ton in i|ts new s|
|00004790| 74 61 74 65 2e 0d 09 09 | 09 09 09 20 2a 2f 0d 09 |tate....|... */..|
|000047a0| 09 09 09 09 53 65 74 54 | 44 46 6c 61 67 28 74 77 |....SetT|DFlag(tw|
|000047b0| 69 73 74 44 6f 77 6e 48 | 61 6e 64 6c 65 2c 0d 09 |istDownH|andle,..|
|000047c0| 09 09 09 09 09 28 6b 44 | 72 61 77 49 6e 74 65 72 |.....(kD|rawInter|
|000047d0| 6d 65 64 69 61 74 65 20 | 7c 20 6b 45 72 61 73 65 |mediate || kErase|
|000047e0| 42 75 74 74 6f 6e 41 72 | 65 61 29 29 3b 0d 09 09 |ButtonAr|ea));...|
|000047f0| 09 09 09 4c 44 72 61 77 | 28 74 68 65 43 65 6c 6c |...LDraw|(theCell|
|00004800| 2c 20 74 68 65 4c 69 73 | 74 29 3b 0d 09 09 09 09 |, theLis|t);.....|
|00004810| 09 44 65 6c 61 79 28 6b | 41 6e 69 6d 61 74 69 6f |.Delay(k|Animatio|
|00004820| 6e 44 65 6c 61 79 2c 20 | 26 66 69 6e 61 6c 54 69 |nDelay, |&finalTi|
|00004830| 63 6b 73 29 3b 0d 09 09 | 09 09 09 43 6c 65 61 72 |cks);...|...Clear|
|00004840| 54 44 46 6c 61 67 28 74 | 77 69 73 74 44 6f 77 6e |TDFlag(t|wistDown|
|00004850| 48 61 6e 64 6c 65 2c 0d | 09 09 09 09 09 09 28 6b |Handle,.|......(k|
|00004860| 44 72 61 77 49 6e 74 65 | 72 6d 65 64 69 61 74 65 |DrawInte|rmediate|
|00004870| 20 7c 20 6b 44 72 61 77 | 42 75 74 74 6f 6e 46 69 | | kDraw|ButtonFi|
|00004880| 6c 6c 65 64 20 7c 20 6b | 45 72 61 73 65 42 75 74 |lled | k|EraseBut|
|00004890| 74 6f 6e 41 72 65 61 29 | 29 3b 0d 09 09 09 09 09 |tonArea)|);......|
|000048a0| 45 78 70 61 6e 64 4f 72 | 43 6f 6c 6c 61 70 73 65 |ExpandOr|Collapse|
|000048b0| 54 77 69 73 74 44 6f 77 | 6e 4c 69 73 74 28 74 68 |TwistDow|nList(th|
|000048c0| 65 4c 69 73 74 2c 20 74 | 68 65 43 65 6c 6c 29 3b |eList, t|heCell);|
|000048d0| 0d 09 09 09 09 09 72 65 | 73 75 6c 74 20 3d 20 6b |......re|sult = k|
|000048e0| 54 77 69 73 74 44 6f 77 | 6e 42 75 74 74 6f 6e 43 |TwistDow|nButtonC|
|000048f0| 6c 69 63 6b 3b 0d 09 09 | 09 09 09 2a 73 65 6c 65 |lick;...|...*sele|
|00004900| 63 74 65 64 4c 69 73 74 | 43 65 6c 6c 20 3d 20 74 |ctedList|Cell = t|
|00004910| 68 65 43 65 6c 6c 3b 0d | 09 09 09 09 7d 0d 09 09 |heCell;.|....}...|
|00004920| 09 09 43 6c 65 61 72 54 | 44 46 6c 61 67 28 74 77 |..ClearT|DFlag(tw|
|00004930| 69 73 74 44 6f 77 6e 48 | 61 6e 64 6c 65 2c 20 6b |istDownH|andle, k|
|00004940| 4f 6e 6c 79 52 65 64 72 | 61 77 42 75 74 74 6f 6e |OnlyRedr|awButton|
|00004950| 29 3b 0d 09 09 09 7d 0d | 09 09 7d 0d 09 09 72 65 |);....}.|..}...re|
|00004960| 74 75 72 6e 20 28 72 65 | 73 75 6c 74 29 3b 0d 7d |turn (re|sult);.}|
|00004970| 0d 0d 2f 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a |../* * *| * * * *|
|00004980| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|00004990| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000049a0| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000049b0| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000049c0| 20 2a 0d 20 2a 20 45 78 | 70 61 6e 64 4f 72 43 6f | *. * Ex|pandOrCo|
|000049d0| 6c 6c 61 70 73 65 54 77 | 69 73 74 44 6f 77 6e 4c |llapseTw|istDownL|
|000049e0| 69 73 74 0d 20 2a 0d 20 | 2a 20 45 78 70 61 6e 64 |ist. *. |* Expand|
|000049f0| 4f 72 43 6f 6c 6c 61 70 | 73 65 54 77 69 73 74 44 |OrCollap|seTwistD|
|00004a00| 6f 77 6e 4c 69 73 74 20 | 6d 6f 64 69 66 69 65 73 |ownList |modifies|
|00004a10| 20 74 68 65 20 22 73 68 | 6f 77 20 73 75 62 6c 69 | the "sh|ow subli|
|00004a20| 73 74 22 20 66 6c 61 67 | 20 66 6f 72 20 74 68 65 |st" flag| for the|
|00004a30| 20 73 65 6c 65 63 74 65 | 64 0d 20 2a 20 63 65 6c | selecte|d. * cel|
|00004a40| 6c 20 61 6e 64 20 72 65 | 62 75 69 6c 64 73 20 74 |l and re|builds t|
|00004a50| 68 65 20 76 69 73 75 61 | 6c 20 64 69 73 70 6c 61 |he visua|l displa|
|00004a60| 79 2e 0d 20 2a 2f 0d 76 | 6f 69 64 0d 45 78 70 61 |y.. */.v|oid.Expa|
|00004a70| 6e 64 4f 72 43 6f 6c 6c | 61 70 73 65 54 77 69 73 |ndOrColl|apseTwis|
|00004a80| 74 44 6f 77 6e 4c 69 73 | 74 28 0d 09 09 4c 69 73 |tDownLis|t(...Lis|
|00004a90| 74 48 61 6e 64 6c 65 09 | 09 09 09 09 74 68 65 4c |tHandle.|....theL|
|00004aa0| 69 73 74 2c 0d 09 09 43 | 65 6c 6c 09 09 09 09 09 |ist,...C|ell.....|
|00004ab0| 09 73 65 6c 65 63 74 65 | 64 4c 69 73 74 43 65 6c |.selecte|dListCel|
|00004ac0| 6c 0d 09 29 0d 7b 0d 09 | 09 54 77 69 73 74 44 6f |l..).{..|.TwistDo|
|00004ad0| 77 6e 48 64 6c 09 09 09 | 09 74 77 69 73 74 44 6f |wnHdl...|.twistDo|
|00004ae0| 77 6e 48 61 6e 64 6c 65 | 3b 0d 09 09 0d 09 09 74 |wnHandle|;......t|
|00004af0| 77 69 73 74 44 6f 77 6e | 48 61 6e 64 6c 65 20 3d |wistDown|Handle =|
|00004b00| 20 47 65 74 54 77 69 73 | 74 44 6f 77 6e 45 6c 65 | GetTwis|tDownEle|
|00004b10| 6d 65 6e 74 48 61 6e 64 | 6c 65 28 74 68 65 4c 69 |mentHand|le(theLi|
|00004b20| 73 74 2c 20 73 65 6c 65 | 63 74 65 64 4c 69 73 74 |st, sele|ctedList|
|00004b30| 43 65 6c 6c 29 3b 0d 09 | 09 69 66 20 28 74 77 69 |Cell);..|.if (twi|
|00004b40| 73 74 44 6f 77 6e 48 61 | 6e 64 6c 65 20 21 3d 20 |stDownHa|ndle != |
|00004b50| 4e 55 4c 4c 0d 09 09 20 | 26 26 20 54 65 73 74 54 |NULL... |&& TestT|
|00004b60| 44 46 6c 61 67 28 74 77 | 69 73 74 44 6f 77 6e 48 |DFlag(tw|istDownH|
|00004b70| 61 6e 64 6c 65 2c 20 6b | 48 61 73 54 77 69 73 74 |andle, k|HasTwist|
|00004b80| 44 6f 77 6e 29 29 20 7b | 0d 09 09 09 49 6e 76 65 |Down)) {|....Inve|
|00004b90| 72 74 54 44 46 6c 61 67 | 28 74 77 69 73 74 44 6f |rtTDFlag|(twistDo|
|00004ba0| 77 6e 48 61 6e 64 6c 65 | 2c 20 6b 53 68 6f 77 53 |wnHandle|, kShowS|
|00004bb0| 75 62 6c 69 73 74 29 3b | 0d 09 09 09 2f 2a 0d 09 |ublist);|..../*..|
|00004bc0| 09 09 20 2a 20 52 65 64 | 72 61 77 20 74 68 65 20 |.. * Red|raw the |
|00004bd0| 74 77 69 73 74 2d 64 6f | 77 6e 20 62 75 74 74 6f |twist-do|wn butto|
|00004be0| 6e 20 69 6e 20 69 74 73 | 20 6e 65 77 20 73 74 61 |n in its| new sta|
|00004bf0| 74 65 2e 0d 09 09 09 20 | 2a 2f 0d 09 09 09 43 6c |te..... |*/....Cl|
|00004c00| 65 61 72 54 44 46 6c 61 | 67 28 74 77 69 73 74 44 |earTDFla|g(twistD|
|00004c10| 6f 77 6e 48 61 6e 64 6c | 65 2c 20 6b 44 72 61 77 |ownHandl|e, kDraw|
|00004c20| 42 75 74 74 6f 6e 46 69 | 6c 6c 65 64 29 3b 0d 09 |ButtonFi|lled);..|
|00004c30| 09 09 53 65 74 54 44 46 | 6c 61 67 28 74 77 69 73 |..SetTDF|lag(twis|
|00004c40| 74 44 6f 77 6e 48 61 6e | 64 6c 65 2c 20 28 6b 4f |tDownHan|dle, (kO|
|00004c50| 6e 6c 79 52 65 64 72 61 | 77 42 75 74 74 6f 6e 20 |nlyRedra|wButton |
|00004c60| 7c 20 6b 45 72 61 73 65 | 42 75 74 74 6f 6e 41 72 || kErase|ButtonAr|
|00004c70| 65 61 29 29 3b 0d 09 09 | 09 4c 44 72 61 77 28 73 |ea));...|.LDraw(s|
|00004c80| 65 6c 65 63 74 65 64 4c | 69 73 74 43 65 6c 6c 2c |electedL|istCell,|
|00004c90| 20 74 68 65 4c 69 73 74 | 29 3b 0d 09 09 09 43 6c | theList|);....Cl|
|00004ca0| 65 61 72 54 44 46 6c 61 | 67 28 74 77 69 73 74 44 |earTDFla|g(twistD|
|00004cb0| 6f 77 6e 48 61 6e 64 6c | 65 2c 20 28 6b 4f 6e 6c |ownHandl|e, (kOnl|
|00004cc0| 79 52 65 64 72 61 77 42 | 75 74 74 6f 6e 20 7c 20 |yRedrawB|utton | |
|00004cd0| 6b 45 72 61 73 65 42 75 | 74 74 6f 6e 41 72 65 61 |kEraseBu|ttonArea|
|00004ce0| 29 29 3b 0d 09 09 09 2f | 2a 0d 09 09 09 20 2a 20 |));..../|*.... * |
|00004cf0| 49 66 20 73 6f 6d 65 20 | 6f 74 68 65 72 20 70 61 |If some |other pa|
|00004d00| 72 74 20 6f 66 20 74 68 | 65 20 6c 69 73 74 20 77 |rt of th|e list w|
|00004d10| 69 6c 6c 20 63 68 61 6e | 67 65 2c 20 72 65 62 75 |ill chan|ge, rebu|
|00004d20| 69 6c 64 20 74 68 65 0d | 09 09 09 20 2a 20 4c 69 |ild the.|... * Li|
|00004d30| 73 74 20 4d 61 6e 61 67 | 65 72 20 6c 69 73 74 20 |st Manag|er list |
|00004d40| 63 65 6c 6c 73 20 61 6e | 64 20 72 65 64 72 61 77 |cells an|d redraw|
|00004d50| 20 74 68 65 20 6c 69 73 | 74 2e 0d 09 09 09 20 2a | the lis|t..... *|
|00004d60| 2f 0d 09 09 09 69 66 20 | 28 28 2a 2a 74 77 69 73 |/....if |((**twis|
|00004d70| 74 44 6f 77 6e 48 61 6e | 64 6c 65 29 2e 73 75 62 |tDownHan|dle).sub|
|00004d80| 45 6c 65 6d 65 6e 74 20 | 21 3d 20 4e 55 4c 4c 29 |Element |!= NULL)|
|00004d90| 0d 09 09 09 09 42 75 69 | 6c 64 56 69 73 69 62 6c |.....Bui|ldVisibl|
|00004da0| 65 4c 69 73 74 28 74 68 | 65 4c 69 73 74 2c 20 73 |eList(th|eList, s|
|00004db0| 65 6c 65 63 74 65 64 4c | 69 73 74 43 65 6c 6c 2e |electedL|istCell.|
|00004dc0| 76 29 3b 0d 09 09 7d 0d | 7d 0d 0d 2f 2a 20 2a 20 |v);...}.|}../* * |
|00004dd0| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|00004de0| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|00004df0| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|00004e00| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|00004e10| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 0d 20 2a 20 43 |* * * * |* *. * C|
|00004e20| 72 65 61 74 65 56 69 73 | 69 62 6c 65 4c 69 73 74 |reateVis|ibleList|
|00004e30| 0d 20 2a 0d 20 2a 20 43 | 72 65 61 74 65 56 69 73 |. *. * C|reateVis|
|00004e40| 69 62 6c 65 4c 69 73 74 | 20 69 73 20 63 61 6c 6c |ibleList| is call|
|00004e50| 65 64 20 77 68 65 6e 20 | 74 68 65 20 6c 69 73 74 |ed when |the list|
|00004e60| 20 69 73 20 63 72 65 61 | 74 65 64 2e 20 49 74 20 | is crea|ted. It |
|00004e70| 73 74 6f 72 65 73 20 74 | 68 65 20 6c 69 73 74 0d |stores t|he list.|
|00004e80| 20 2a 20 68 65 61 64 20 | 69 6e 74 6f 20 63 65 6c | * head |into cel|
|00004e90| 6c 20 5b 30 2c 20 30 5d | 20 61 6e 64 20 63 61 6c |l [0, 0]| and cal|
|00004ea0| 6c 73 20 42 75 69 6c 64 | 56 69 73 69 62 6c 65 4c |ls Build|VisibleL|
|00004eb0| 69 73 74 20 74 6f 20 69 | 6e 73 74 61 6e 74 69 61 |ist to i|nstantia|
|00004ec0| 74 65 20 74 68 65 20 64 | 69 73 70 6c 61 79 2e 0d |te the d|isplay..|
|00004ed0| 20 2a 2f 0d 76 6f 69 64 | 0d 43 72 65 61 74 65 56 | */.void|.CreateV|
|00004ee0| 69 73 69 62 6c 65 4c 69 | 73 74 28 0d 09 09 4c 69 |isibleLi|st(...Li|
|00004ef0| 73 74 48 61 6e 64 6c 65 | 09 09 09 09 09 74 68 65 |stHandle|.....the|
|00004f00| 4c 69 73 74 2c 0d 09 09 | 54 77 69 73 74 44 6f 77 |List,...|TwistDow|
|00004f10| 6e 48 64 6c 09 09 09 09 | 74 77 69 73 74 44 6f 77 |nHdl....|twistDow|
|00004f20| 6e 48 61 6e 64 6c 65 0d | 09 29 0d 7b 0d 09 09 43 |nHandle.|.).{...C|
|00004f30| 65 6c 6c 09 09 09 09 09 | 09 74 68 65 43 65 6c 6c |ell.....|.theCell|
|00004f40| 3b 0d 09 09 0d 09 09 69 | 66 20 28 28 2a 2a 74 68 |;......i|f ((**th|
|00004f50| 65 4c 69 73 74 29 2e 64 | 61 74 61 42 6f 75 6e 64 |eList).d|ataBound|
|00004f60| 73 2e 62 6f 74 74 6f 6d | 20 3d 3d 20 30 29 20 7b |s.bottom| == 0) {|
|00004f70| 0d 09 09 09 2f 2a 0d 09 | 09 09 20 2a 20 41 64 64 |..../*..|.. * Add|
|00004f80| 20 6f 6e 65 20 72 6f 77 | 20 74 6f 20 74 68 65 20 | one row| to the |
|00004f90| 6c 69 73 74 20 73 6f 20 | 74 68 65 72 65 20 69 73 |list so |there is|
|00004fa0| 20 61 20 70 6c 61 63 65 | 20 66 6f 72 20 74 68 65 | a place| for the|
|00004fb0| 20 68 65 61 64 20 65 6c | 65 6d 65 6e 74 2e 0d 09 | head el|ement...|
|00004fc0| 09 09 20 2a 2f 0d 09 09 | 09 4c 44 6f 44 72 61 77 |.. */...|.LDoDraw|
|00004fd0| 28 46 41 4c 53 45 2c 20 | 74 68 65 4c 69 73 74 29 |(FALSE, |theList)|
|00004fe0| 3b 0d 09 09 09 4c 41 64 | 64 52 6f 77 28 31 2c 20 |;....LAd|dRow(1, |
|00004ff0| 30 2c 20 74 68 65 4c 69 | 73 74 29 3b 0d 09 09 09 |0, theLi|st);....|
|00005000| 4c 44 6f 44 72 61 77 28 | 54 52 55 45 2c 20 74 68 |LDoDraw(|TRUE, th|
|00005010| 65 4c 69 73 74 29 3b 0d | 09 09 7d 0d 09 09 53 65 |eList);.|..}...Se|
|00005020| 74 50 74 28 26 74 68 65 | 43 65 6c 6c 2c 20 30 2c |tPt(&the|Cell, 0,|
|00005030| 20 30 29 3b 0d 09 09 4c | 53 65 74 43 65 6c 6c 28 | 0);...L|SetCell(|
|00005040| 26 74 77 69 73 74 44 6f | 77 6e 48 61 6e 64 6c 65 |&twistDo|wnHandle|
|00005050| 2c 20 73 69 7a 65 6f 66 | 20 74 77 69 73 74 44 6f |, sizeof| twistDo|
|00005060| 77 6e 48 61 6e 64 6c 65 | 2c 20 74 68 65 43 65 6c |wnHandle|, theCel|
|00005070| 6c 2c 20 74 68 65 4c 69 | 73 74 29 3b 0d 09 09 42 |l, theLi|st);...B|
|00005080| 75 69 6c 64 56 69 73 69 | 62 6c 65 4c 69 73 74 28 |uildVisi|bleList(|
|00005090| 74 68 65 4c 69 73 74 2c | 20 30 29 3b 0d 7d 0d 0d |theList,| 0);.}..|
|000050a0| 2f 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a |/* * * *| * * * *|
|000050b0| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000050c0| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000050d0| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000050e0| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000050f0| 0d 20 2a 20 42 75 69 6c | 64 56 69 73 69 62 6c 65 |. * Buil|dVisible|
|00005100| 4c 69 73 74 0d 20 2a 0d | 20 2a 20 42 75 69 6c 64 |List. *.| * Build|
|00005110| 56 69 73 69 62 6c 65 4c | 69 73 74 20 69 73 20 63 |VisibleL|ist is c|
|00005120| 61 6c 6c 65 64 20 77 68 | 65 6e 20 74 68 65 20 6c |alled wh|en the l|
|00005130| 69 73 74 20 69 73 20 63 | 72 65 61 74 65 64 2c 20 |ist is c|reated, |
|00005140| 6f 72 20 77 68 65 6e 20 | 74 68 65 20 75 73 65 72 |or when |the user|
|00005150| 20 63 6c 69 63 6b 73 20 | 6f 6e 0d 20 2a 20 61 20 | clicks |on. * a |
|00005160| 74 77 69 73 74 2d 64 6f | 77 6e 20 62 75 74 74 6f |twist-do|wn butto|
|00005170| 6e 2e 20 73 65 6c 65 63 | 74 65 64 52 6f 77 20 69 |n. selec|tedRow i|
|00005180| 73 20 74 68 65 20 66 69 | 72 73 74 20 72 6f 77 20 |s the fi|rst row |
|00005190| 74 68 61 74 20 6e 65 65 | 64 73 20 74 6f 20 62 65 |that nee|ds to be|
|000051a0| 20 72 65 64 72 61 77 6e | 2e 0d 20 2a 20 54 6f 20 | redrawn|.. * To |
|000051b0| 72 65 62 75 69 6c 64 20 | 74 68 65 20 65 6e 74 69 |rebuild |the enti|
|000051c0| 72 65 20 6c 69 73 74 2c | 20 73 74 6f 72 65 20 74 |re list,| store t|
|000051d0| 68 65 20 6c 69 73 74 20 | 68 65 61 64 20 69 6e 74 |he list |head int|
|000051e0| 6f 20 63 65 6c 6c 20 5b | 30 2c 20 30 5d 20 61 6e |o cell [|0, 0] an|
|000051f0| 64 20 63 61 6c 6c 0d 20 | 2a 20 77 69 74 68 20 73 |d call. |* with s|
|00005200| 65 6c 65 63 74 65 64 52 | 6f 77 20 3d 20 30 2e 20 |electedR|ow = 0. |
|00005210| 4e 6f 74 65 3a 20 62 65 | 63 61 75 73 65 20 70 65 |Note: be|cause pe|
|00005220| 6f 70 6c 65 20 63 61 6e | 20 62 65 20 72 65 62 75 |ople can| be rebu|
|00005230| 69 6c 64 69 6e 67 20 74 | 68 65 20 6c 69 73 74 20 |ilding t|he list |
|00005240| 66 72 6f 6d 0d 20 2a 20 | 77 69 74 68 69 6e 20 61 |from. * |within a|
|00005250| 20 6c 61 72 67 65 72 20 | 73 75 62 6c 69 73 74 20 | larger |sublist |
|00005260| 63 6f 6e 74 65 78 74 2c | 20 74 68 65 20 6c 69 73 |context,| the lis|
|00005270| 74 20 68 65 61 64 20 6d | 75 73 74 20 62 65 20 73 |t head m|ust be s|
|00005280| 74 6f 72 65 64 20 69 6e | 20 63 65 6c 6c 20 5b 30 |tored in| cell [0|
|00005290| 2c 20 30 5d 2e 0d 20 2a | 2f 0d 76 6f 69 64 0d 42 |, 0].. *|/.void.B|
|000052a0| 75 69 6c 64 56 69 73 69 | 62 6c 65 4c 69 73 74 28 |uildVisi|bleList(|
|000052b0| 0d 09 09 4c 69 73 74 48 | 61 6e 64 6c 65 09 09 09 |...ListH|andle...|
|000052c0| 09 09 74 68 65 4c 69 73 | 74 2c 0d 09 09 73 68 6f |..theLis|t,...sho|
|000052d0| 72 74 09 09 09 09 09 09 | 73 65 6c 65 63 74 65 64 |rt......|selected|
|000052e0| 52 6f 77 0d 09 29 0d 7b | 0d 09 09 73 68 6f 72 74 |Row..).{|...short|
|000052f0| 09 09 09 09 09 09 6e 52 | 6f 77 73 3b 09 09 09 2f |......nR|ows;.../|
|00005300| 2a 20 48 6f 77 20 6d 61 | 6e 79 20 77 65 20 6e 65 |* How ma|ny we ne|
|00005310| 65 64 09 74 6f 20 73 68 | 6f 77 09 2a 2f 0d 09 09 |ed.to sh|ow.*/...|
|00005320| 73 68 6f 72 74 09 09 09 | 09 09 09 63 75 72 72 65 |short...|...curre|
|00005330| 6e 74 52 6f 77 73 3b 09 | 2f 2a 20 48 6f 77 20 6d |ntRows;.|/* How m|
|00005340| 61 6e 79 20 61 72 65 20 | 69 6e 20 74 68 65 20 6c |any are |in the l|
|00005350| 69 73 74 09 2a 2f 0d 09 | 09 52 65 63 74 09 09 09 |ist.*/..|.Rect...|
|00005360| 09 09 09 76 69 65 77 52 | 65 63 74 3b 0d 09 09 54 |...viewR|ect;...T|
|00005370| 77 69 73 74 44 6f 77 6e | 48 64 6c 09 09 09 09 6c |wistDown|Hdl....l|
|00005380| 69 73 74 48 65 61 64 3b | 0d 09 09 43 65 6c 6c 09 |istHead;|...Cell.|
|00005390| 09 09 09 09 09 74 68 65 | 43 65 6c 6c 3b 0d 09 09 |.....the|Cell;...|
|000053a0| 0d 09 09 4c 44 6f 44 72 | 61 77 28 46 41 4c 53 45 |...LDoDr|aw(FALSE|
|000053b0| 2c 20 74 68 65 4c 69 73 | 74 29 3b 0d 09 09 53 65 |, theLis|t);...Se|
|000053c0| 74 50 74 28 26 74 68 65 | 43 65 6c 6c 2c 20 30 2c |tPt(&the|Cell, 0,|
|000053d0| 20 30 29 3b 09 09 09 09 | 09 09 2f 2a 20 47 65 74 | 0);....|../* Get|
|000053e0| 20 74 68 65 20 6c 69 73 | 74 20 68 65 61 64 09 09 | the lis|t head..|
|000053f0| 2a 2f 0d 09 09 6c 69 73 | 74 48 65 61 64 20 3d 20 |*/...lis|tHead = |
|00005400| 47 65 74 54 77 69 73 74 | 44 6f 77 6e 45 6c 65 6d |GetTwist|DownElem|
|00005410| 65 6e 74 48 61 6e 64 6c | 65 28 74 68 65 4c 69 73 |entHandl|e(theLis|
|00005420| 74 2c 20 74 68 65 43 65 | 6c 6c 29 3b 0d 09 09 43 |t, theCe|ll);...C|
|00005430| 6c 65 61 72 53 65 6c 65 | 63 74 65 64 45 6c 65 6d |learSele|ctedElem|
|00005440| 65 6e 74 42 69 74 28 6c | 69 73 74 48 65 61 64 29 |entBit(l|istHead)|
|00005450| 3b 0d 09 09 43 6f 70 79 | 53 65 6c 65 63 74 69 6f |;...Copy|Selectio|
|00005460| 6e 53 74 61 74 65 54 6f | 4c 69 73 74 28 74 68 65 |nStateTo|List(the|
|00005470| 4c 69 73 74 2c 20 73 65 | 6c 65 63 74 65 64 52 6f |List, se|lectedRo|
|00005480| 77 29 3b 0d 09 09 6e 52 | 6f 77 73 20 3d 20 43 6f |w);...nR|ows = Co|
|00005490| 75 6e 74 56 69 73 69 62 | 6c 65 45 6c 65 6d 65 6e |untVisib|leElemen|
|000054a0| 74 73 28 6c 69 73 74 48 | 65 61 64 29 3b 0d 09 09 |ts(listH|ead);...|
|000054b0| 63 75 72 72 65 6e 74 52 | 6f 77 73 20 3d 20 28 2a |currentR|ows = (*|
|000054c0| 2a 74 68 65 4c 69 73 74 | 29 2e 64 61 74 61 42 6f |*theList|).dataBo|
|000054d0| 75 6e 64 73 2e 62 6f 74 | 74 6f 6d 3b 0d 09 09 69 |unds.bot|tom;...i|
|000054e0| 66 20 28 63 75 72 72 65 | 6e 74 52 6f 77 73 20 3e |f (curre|ntRows >|
|000054f0| 20 6e 52 6f 77 73 29 0d | 09 09 09 4c 44 65 6c 52 | nRows).|...LDelR|
|00005500| 6f 77 28 63 75 72 72 65 | 6e 74 52 6f 77 73 20 2d |ow(curre|ntRows -|
|00005510| 20 6e 52 6f 77 73 2c 20 | 6e 52 6f 77 73 2c 20 74 | nRows, |nRows, t|
|00005520| 68 65 4c 69 73 74 29 3b | 09 2f 2a 20 53 68 72 69 |heList);|./* Shri|
|00005530| 6e 6b 20 74 68 65 20 6c | 69 73 74 09 2a 2f 0d 09 |nk the l|ist.*/..|
|00005540| 09 65 6c 73 65 20 69 66 | 20 28 63 75 72 72 65 6e |.else if| (curren|
|00005550| 74 52 6f 77 73 20 3c 20 | 6e 52 6f 77 73 29 0d 09 |tRows < |nRows)..|
|00005560| 09 09 4c 41 64 64 52 6f | 77 28 6e 52 6f 77 73 20 |..LAddRo|w(nRows |
|00005570| 2d 20 63 75 72 72 65 6e | 74 52 6f 77 73 2c 20 63 |- curren|tRows, c|
|00005580| 75 72 72 65 6e 74 52 6f | 77 73 20 2b 20 31 2c 20 |urrentRo|ws + 1, |
|00005590| 74 68 65 4c 69 73 74 29 | 3b 09 2f 2a 20 47 72 6f |theList)|;./* Gro|
|000055a0| 77 20 69 74 09 2a 2f 0d | 09 09 69 66 20 28 6e 52 |w it.*/.|..if (nR|
|000055b0| 6f 77 73 20 21 3d 20 30 | 29 20 7b 0d 09 09 09 53 |ows != 0|) {....S|
|000055c0| 65 74 45 6c 65 6d 65 6e | 74 73 49 6e 4c 69 73 74 |etElemen|tsInList|
|000055d0| 28 74 68 65 4c 69 73 74 | 2c 20 6c 69 73 74 48 65 |(theList|, listHe|
|000055e0| 61 64 2c 20 26 74 68 65 | 43 65 6c 6c 29 3b 0d 09 |ad, &the|Cell);..|
|000055f0| 09 7d 0d 09 09 4c 44 6f | 44 72 61 77 28 54 52 55 |.}...LDo|Draw(TRU|
|00005600| 45 2c 20 74 68 65 4c 69 | 73 74 29 3b 0d 09 09 2f |E, theLi|st);.../|
|00005610| 2a 0d 09 09 20 2a 20 52 | 65 64 72 61 77 20 61 6e |*... * R|edraw an|
|00005620| 79 20 65 6c 65 6d 65 6e | 74 73 20 74 68 61 74 20 |y elemen|ts that |
|00005630| 61 72 65 20 67 72 65 61 | 74 65 72 20 74 68 61 6e |are grea|ter than|
|00005640| 20 74 68 65 20 69 6e 73 | 65 72 74 65 64 20 72 6f | the ins|erted ro|
|00005650| 77 2e 0d 09 09 20 2a 2f | 0d 09 09 76 69 65 77 52 |w.... */|...viewR|
|00005660| 65 63 74 20 3d 20 28 2a | 2a 74 68 65 4c 69 73 74 |ect = (*|*theList|
|00005670| 29 2e 72 56 69 65 77 3b | 0d 09 09 76 69 65 77 52 |).rView;|...viewR|
|00005680| 65 63 74 2e 74 6f 70 20 | 2b 3d 20 28 28 73 65 6c |ect.top |+= ((sel|
|00005690| 65 63 74 65 64 52 6f 77 | 20 2b 20 31 29 20 2d 20 |ectedRow| + 1) - |
|000056a0| 28 2a 2a 74 68 65 4c 69 | 73 74 29 2e 76 69 73 69 |(**theLi|st).visi|
|000056b0| 62 6c 65 2e 74 6f 70 29 | 0d 09 09 09 09 09 09 09 |ble.top)|........|
|000056c0| 2a 20 28 2a 2a 74 68 65 | 4c 69 73 74 29 2e 63 65 |* (**the|List).ce|
|000056d0| 6c 6c 53 69 7a 65 2e 76 | 3b 0d 09 09 69 66 20 28 |llSize.v|;...if (|
|000056e0| 76 69 65 77 52 65 63 74 | 2e 74 6f 70 20 3c 20 76 |viewRect|.top < v|
|000056f0| 69 65 77 52 65 63 74 2e | 62 6f 74 74 6f 6d 29 0d |iewRect.|bottom).|
|00005700| 09 09 09 49 6e 76 61 6c | 52 65 63 74 28 26 76 69 |...Inval|Rect(&vi|
|00005710| 65 77 52 65 63 74 29 3b | 0d 7d 0d 0d 2f 2a 20 2a |ewRect);|.}../* *|
|00005720| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|00005730| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|00005740| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|00005750| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|00005760| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 0d 20 2a 20 | * * * *| * *. * |
|00005770| 43 6f 75 6e 74 56 69 73 | 69 62 6c 65 45 6c 65 6d |CountVis|ibleElem|
|00005780| 65 6e 74 73 0d 20 2a 0d | 20 2a 20 43 6f 75 6e 74 |ents. *.| * Count|
|00005790| 56 69 73 69 62 6c 65 45 | 6c 65 6d 65 6e 74 73 20 |VisibleE|lements |
|000057a0| 69 73 20 61 20 72 65 63 | 75 72 73 69 76 65 20 66 |is a rec|ursive f|
|000057b0| 75 6e 63 74 69 6f 6e 20 | 74 68 61 74 20 72 65 74 |unction |that ret|
|000057c0| 75 72 6e 73 20 74 68 65 | 20 6e 75 6d 62 65 72 20 |urns the| number |
|000057d0| 6f 66 20 76 69 73 69 62 | 6c 65 0d 20 2a 20 65 6c |of visib|le. * el|
|000057e0| 65 6d 65 6e 74 73 20 69 | 6e 20 74 68 65 20 6c 69 |ements i|n the li|
|000057f0| 73 74 2e 20 43 61 6c 6c | 20 77 69 74 68 20 74 68 |st. Call| with th|
|00005800| 65 20 6c 69 73 74 20 68 | 65 61 64 20 74 6f 20 70 |e list h|ead to p|
|00005810| 72 6f 63 65 73 73 20 74 | 68 65 20 65 6e 74 69 72 |rocess t|he entir|
|00005820| 65 20 6c 69 73 74 2e 20 | 4e 6f 74 65 3a 0d 20 2a |e list. |Note:. *|
|00005830| 20 6c 69 73 74 20 65 6c | 65 6d 65 6e 74 73 20 61 | list el|ements a|
|00005840| 72 65 20 76 69 73 69 62 | 6c 65 2c 20 62 75 74 20 |re visib|le, but |
|00005850| 73 75 62 2d 6c 69 73 74 | 73 20 61 72 65 20 76 69 |sub-list|s are vi|
|00005860| 73 69 62 6c 65 20 6f 6e | 6c 79 20 69 66 20 74 68 |sible on|ly if th|
|00005870| 65 20 62 75 74 74 6f 6e | 20 73 74 61 74 65 0d 20 |e button| state. |
|00005880| 2a 20 72 65 71 75 65 73 | 74 73 20 76 69 73 69 62 |* reques|ts visib|
|00005890| 6c 69 74 79 2e 20 54 68 | 69 73 20 66 75 6e 63 74 |lity. Th|is funct|
|000058a0| 69 6f 6e 20 6d 61 79 20 | 62 65 20 63 61 6c 6c 65 |ion may |be calle|
|000058b0| 64 20 77 69 74 68 20 61 | 20 4e 55 4c 4c 20 61 72 |d with a| NULL ar|
|000058c0| 67 75 6d 65 6e 74 20 77 | 69 74 68 6f 75 74 0d 20 |gument w|ithout. |
|000058d0| 2a 20 70 72 6f 62 6c 65 | 6d 73 2e 20 41 6c 73 6f |* proble|ms. Also|
|000058e0| 20 6e 6f 74 65 20 74 68 | 61 74 20 77 65 20 69 67 | note th|at we ig|
|000058f0| 6e 6f 72 65 20 74 68 65 | 20 63 75 72 72 65 6e 74 |nore the| current|
|00005900| 20 4c 69 73 74 20 4d 61 | 6e 61 67 65 72 20 63 65 | List Ma|nager ce|
|00005910| 6c 6c 20 64 61 74 61 2c | 20 77 6f 72 6b 69 6e 67 |ll data,| working|
|00005920| 0d 20 2a 20 6f 6e 6c 79 | 20 77 69 74 68 20 74 68 |. * only| with th|
|00005930| 65 20 61 63 74 75 61 6c | 20 6c 69 6e 6b 65 64 20 |e actual| linked |
|00005940| 6c 69 73 74 20 73 74 72 | 75 63 74 75 72 65 2e 20 |list str|ucture. |
|00005950| 42 79 20 63 6f 6e 76 65 | 6e 74 69 6f 6e 2c 20 68 |By conve|ntion, h|
|00005960| 6f 77 65 76 65 72 2c 20 | 74 68 65 20 6c 69 73 74 |owever, |the list|
|00005970| 0d 20 2a 20 68 65 61 64 | 20 69 73 20 73 74 6f 72 |. * head| is stor|
|00005980| 65 64 20 69 6e 20 63 65 | 6c 6c 20 5b 30 2c 20 30 |ed in ce|ll [0, 0|
|00005990| 5d 2e 0d 20 2a 2f 0d 73 | 74 61 74 69 63 20 73 68 |].. */.s|tatic sh|
|000059a0| 6f 72 74 0d 43 6f 75 6e | 74 56 69 73 69 62 6c 65 |ort.Coun|tVisible|
|000059b0| 45 6c 65 6d 65 6e 74 73 | 28 0d 09 09 54 77 69 73 |Elements|(...Twis|
|000059c0| 74 44 6f 77 6e 48 64 6c | 09 09 09 09 74 77 69 73 |tDownHdl|....twis|
|000059d0| 74 44 6f 77 6e 48 61 6e | 64 6c 65 0d 09 29 0d 7b |tDownHan|dle..).{|
|000059e0| 0d 09 09 73 68 6f 72 74 | 09 09 09 09 09 09 72 65 |...short|......re|
|000059f0| 73 75 6c 74 3b 0d 0d 09 | 09 72 65 73 75 6c 74 20 |sult;...|.result |
|00005a00| 3d 20 30 3b 0d 09 09 77 | 68 69 6c 65 20 28 74 77 |= 0;...w|hile (tw|
|00005a10| 69 73 74 44 6f 77 6e 48 | 61 6e 64 6c 65 20 21 3d |istDownH|andle !=|
|00005a20| 20 4e 55 4c 4c 29 20 7b | 0d 09 09 09 2b 2b 72 65 | NULL) {|....++re|
|00005a30| 73 75 6c 74 3b 0d 09 09 | 09 69 66 20 28 54 65 73 |sult;...|.if (Tes|
|00005a40| 74 54 44 46 6c 61 67 28 | 74 77 69 73 74 44 6f 77 |tTDFlag(|twistDow|
|00005a50| 6e 48 61 6e 64 6c 65 2c | 20 6b 53 68 6f 77 53 75 |nHandle,| kShowSu|
|00005a60| 62 6c 69 73 74 29 29 0d | 09 09 09 09 72 65 73 75 |blist)).|....resu|
|00005a70| 6c 74 20 2b 3d 20 43 6f | 75 6e 74 56 69 73 69 62 |lt += Co|untVisib|
|00005a80| 6c 65 45 6c 65 6d 65 6e | 74 73 28 28 2a 2a 74 77 |leElemen|ts((**tw|
|00005a90| 69 73 74 44 6f 77 6e 48 | 61 6e 64 6c 65 29 2e 73 |istDownH|andle).s|
|00005aa0| 75 62 45 6c 65 6d 65 6e | 74 29 3b 0d 09 09 09 74 |ubElemen|t);....t|
|00005ab0| 77 69 73 74 44 6f 77 6e | 48 61 6e 64 6c 65 20 3d |wistDown|Handle =|
|00005ac0| 20 28 2a 2a 74 77 69 73 | 74 44 6f 77 6e 48 61 6e | (**twis|tDownHan|
|00005ad0| 64 6c 65 29 2e 6e 65 78 | 74 45 6c 65 6d 65 6e 74 |dle).nex|tElement|
|00005ae0| 3b 0d 09 09 7d 09 09 09 | 0d 09 09 72 65 74 75 72 |;...}...|...retur|
|00005af0| 6e 20 28 72 65 73 75 6c | 74 29 3b 0d 7d 0d 0d 2f |n (resul|t);.}../|
|00005b00| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|00005b10| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|00005b20| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|00005b30| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 20 |* * * * |* * * * |
|00005b40| 2a 20 2a 20 2a 20 2a 20 | 2a 20 2a 20 2a 20 2a 0d |* * * * |* * * *.|
|00005b50| 20 2a 20 43 6f 75 6e 74 | 4c 69 73 74 45 6c 65 6d | * Count|ListElem|
|00005b60| 65 6e 74 73 0d 20 2a 0d | 20 2a 20 43 6f 75 6e 74 |ents. *.| * Count|
|00005b70| 4c 69 73 74 45 6c 65 6d | 65 6e 74 73 20 72 65 74 |ListElem|ents ret|
|00005b80| 75 72 6e 73 20 74 68 65 | 20 6e 75 6d 62 65 72 20 |urns the| number |
|00005b90| 6f 66 20 65 6c 65 6d 65 | 6e 74 73 20 69 6e 20 74 |of eleme|nts in t|
|00005ba0| 68 65 20 6c 69 73 74 20 | 28 69 74 20 63 6f 75 6e |he list |(it coun|
|00005bb0| 74 73 20 61 6c 6c 0d 20 | 2a 20 65 6c 65 6d 65 6e |ts all. |* elemen|
|00005bc0| 74 73 2c 20 76 69 73 69 | 62 6c 65 20 6f 72 20 6e |ts, visi|ble or n|
|00005bd0| 6f 74 2e 0d 20 2a 2f 0d | 75 6e 73 69 67 6e 65 64 |ot.. */.|unsigned|
|00005be0| 20 6c 6f 6e 67 0d 43 6f | 75 6e 74 4c 69 73 74 45 | long.Co|untListE|
|00005bf0| 6c 65 6d 65 6e 74 73 28 | 0d 09 09 54 77 69 73 74 |lements(|...Twist|
|00005c00| 44 6f 77 6e 48 64 6c 09 | 09 09 09 74 77 69 73 74 |DownHdl.|...twist|
|00005c10| 44 6f 77 6e 48 61 6e 64 | 6c 65 0d 09 29 0d 7b 0d |DownHand|le..).{.|
|00005c20| 09 09 75 6e 73 69 67 6e | 65 64 20 6c 6f 6e 67 09 |..unsign|ed long.|
|00005c30| 09 09 09 72 65 73 75 6c | 74 3b 0d 0d 09 09 72 65 |...resul|t;....re|
|00005c40| 73 75 6c 74 20 3d 20 30 | 3b 0d 09 09 77 68 69 6c |sult = 0|;...whil|
|00005c50| 65 20 28 74 77 69 73 74 | 44 6f 77 6e 48 61 6e 64 |e (twist|DownHand|
|00005c60| 6c 65 20 21 3d 20 4e 55 | 4c 4c 29 20 7b 0d 09 09 |le != NU|LL) {...|
|00005c70| 09 2b 2b 72 65 73 75 6c | 74 3b 0d 09 09 09 69 66 |.++resul|t;....if|
|00005c80| 20 28 28 2a 2a 74 77 69 | 73 74 44 6f 77 6e 48 61 | ((**twi|stDownHa|
|00005c90| 6e 64 6c 65 29 2e 73 75 | 62 45 6c 65 6d 65 6e 74 |ndle).su|bElement|
|00005ca0| 20 21 3d 20 4e 55 4c 4c | 29 0d 09 09 09 09 72 65 | != NULL|).....re|
|00005cb0| 73 75 6c 74 20 2b 3d 20 | 43 6f 75 6e 74 56 69 73 |sult += |CountVis|
|00005cc0| 69 62 6c 65 45 6c 65 6d | 65 6e 74 73 28 28 2a 2a |ibleElem|ents((**|
|00005cd0| 74 77 69 73 74 44 6f 77 | 6e 48 61 6e 64 6c 65 29 |twistDow|nHandle)|
|00005ce0| 2e 73 75 62 45 6c 65 6d | 65 6e 74 29 3b 0d 09 09 |.subElem|ent);...|
|00005cf0| 09 74 77 69 73 74 44 6f | 77 6e 48 61 6e 64 6c 65 |.twistDo|wnHandle|
|00005d00| 20 3d 20 28 2a 2a 74 77 | 69 73 74 44 6f 77 6e 48 | = (**tw|istDownH|
|00005d10| 61 6e 64 6c 65 29 2e 6e | 65 78 74 45 6c 65 6d 65 |andle).n|extEleme|
|00005d20| 6e 74 3b 0d 09 09 7d 09 | 09 09 0d 09 09 72 65 74 |nt;...}.|.....ret|
|00005d30| 75 72 6e 20 28 72 65 73 | 75 6c 74 29 3b 0d 7d 0d |urn (res|ult);.}.|
|00005d40| 0d 0d 2f 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a |../* * *| * * * *|
|00005d50| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|00005d60| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|00005d70| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|00005d80| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|00005d90| 20 2a 0d 20 2a 20 43 6c | 65 61 72 53 65 6c 65 63 | *. * Cl|earSelec|
|00005da0| 74 65 64 45 6c 65 6d 65 | 6e 74 42 69 74 0d 20 2a |tedEleme|ntBit. *|
|00005db0| 0d 20 2a 20 57 68 65 6e | 20 77 65 20 65 78 70 61 |. * When| we expa|
|00005dc0| 6e 64 20 6f 72 20 63 6f | 6e 74 72 61 63 74 20 74 |nd or co|ntract t|
|00005dd0| 68 65 20 76 69 73 69 62 | 6c 65 20 6c 69 73 74 2c |he visib|le list,|
|00005de0| 20 74 68 65 20 72 65 6c | 61 74 69 6f 6e 73 68 69 | the rel|ationshi|
|00005df0| 70 20 62 65 74 77 65 65 | 6e 20 74 68 65 0d 20 2a |p betwee|n the. *|
|00005e00| 20 76 69 73 75 61 6c 20 | 64 69 73 70 6c 61 79 20 | visual |display |
|00005e10| 61 6e 64 20 74 68 65 20 | 61 63 74 75 61 6c 20 64 |and the |actual d|
|00005e20| 61 74 61 20 63 68 61 6e | 67 65 73 2e 20 49 6e 20 |ata chan|ges. In |
|00005e30| 70 61 72 74 69 63 75 6c | 61 72 2c 20 74 68 65 20 |particul|ar, the |
|00005e40| 73 65 6c 65 63 74 65 64 | 20 63 65 6c 6c 0d 20 2a |selected| cell. *|
|00005e50| 20 6d 61 79 20 63 6f 6e | 74 61 69 6e 20 64 69 66 | may con|tain dif|
|00005e60| 66 65 72 65 6e 74 20 64 | 61 74 61 2e 20 54 6f 20 |ferent d|ata. To |
|00005e70| 72 65 73 6f 6c 76 65 20 | 74 68 69 73 20 64 69 6c |resolve |this dil|
|00005e80| 65 6d 6e 61 2c 20 77 65 | 20 63 6f 70 79 20 74 68 |emna, we| copy th|
|00005e90| 65 20 63 75 72 72 65 6e | 74 0d 20 2a 20 73 65 6c |e curren|t. * sel|
|00005ea0| 65 63 74 69 6f 6e 20 66 | 72 6f 6d 20 74 68 65 20 |ection f|rom the |
|00005eb0| 64 69 73 70 6c 61 79 20 | 6c 69 73 74 20 74 6f 20 |display |list to |
|00005ec0| 74 68 65 20 64 61 74 61 | 20 65 6c 65 6d 65 6e 74 |the data| element|
|00005ed0| 73 2c 20 74 68 65 6e 20 | 63 6f 70 79 20 74 68 65 |s, then |copy the|
|00005ee0| 20 69 6e 66 6f 72 6d 61 | 74 69 6f 6e 0d 20 2a 20 | informa|tion. * |
|00005ef0| 62 61 63 6b 20 77 68 65 | 6e 20 74 68 65 20 6e 65 |back whe|n the ne|
|00005f00| 77 20 65 6c 65 6d 65 6e | 74 73 20 61 72 65 20 69 |w elemen|ts are i|
|00005f10| 6e 73 65 72 74 65 64 20 | 69 6e 74 6f 20 74 68 65 |nserted |into the|
|00005f20| 20 6c 69 73 74 2e 20 54 | 68 69 73 20 69 73 20 61 | list. T|his is a|
|00005f30| 20 74 68 72 65 65 2d 73 | 74 65 70 0d 20 2a 20 70 | three-s|tep. * p|
|00005f40| 72 6f 63 65 73 73 2e 20 | 46 69 72 73 74 2c 20 77 |rocess. |First, w|
|00005f50| 65 20 63 6c 65 61 72 20 | 6f 75 74 20 74 68 65 20 |e clear |out the |
|00005f60| 6b 53 65 6c 65 63 74 65 | 64 45 6c 65 6d 65 6e 74 |kSelecte|dElement|
|00005f70| 20 62 69 74 20 66 72 6f | 6d 20 74 68 65 20 6c 69 | bit fro|m the li|
|00005f80| 6e 6b 65 64 20 6c 69 73 | 74 2e 0d 20 2a 2f 0d 73 |nked lis|t.. */.s|
|00005f90| 74 61 74 69 63 20 76 6f | 69 64 0d 43 6c 65 61 72 |tatic vo|id.Clear|
|00005fa0| 53 65 6c 65 63 74 65 64 | 45 6c 65 6d 65 6e 74 42 |Selected|ElementB|
|00005fb0| 69 74 28 0d 09 09 54 77 | 69 73 74 44 6f 77 6e 48 |it(...Tw|istDownH|
|00005fc0| 64 6c 09 09 09 09 74 77 | 69 73 74 44 6f 77 6e 48 |dl....tw|istDownH|
|00005fd0| 61 6e 64 6c 65 0d 09 29 | 0d 7b 0d 09 09 77 68 69 |andle..)|.{...whi|
|00005fe0| 6c 65 20 28 74 77 69 73 | 74 44 6f 77 6e 48 61 6e |le (twis|tDownHan|
|00005ff0| 64 6c 65 20 21 3d 20 4e | 55 4c 4c 29 20 7b 0d 09 |dle != N|ULL) {..|
|00006000| 09 09 43 6c 65 61 72 54 | 44 46 6c 61 67 28 74 77 |..ClearT|DFlag(tw|
|00006010| 69 73 74 44 6f 77 6e 48 | 61 6e 64 6c 65 2c 20 6b |istDownH|andle, k|
|00006020| 53 65 6c 65 63 74 65 64 | 45 6c 65 6d 65 6e 74 29 |Selected|Element)|
|00006030| 3b 0d 09 09 09 69 66 20 | 28 28 2a 2a 74 77 69 73 |;....if |((**twis|
|00006040| 74 44 6f 77 6e 48 61 6e | 64 6c 65 29 2e 73 75 62 |tDownHan|dle).sub|
|00006050| 45 6c 65 6d 65 6e 74 20 | 21 3d 20 4e 55 4c 4c 29 |Element |!= NULL)|
|00006060| 0d 09 09 09 09 43 6c 65 | 61 72 53 65 6c 65 63 74 |.....Cle|arSelect|
|00006070| 65 64 45 6c 65 6d 65 6e | 74 42 69 74 28 28 2a 2a |edElemen|tBit((**|
|00006080| 74 77 69 73 74 44 6f 77 | 6e 48 61 6e 64 6c 65 29 |twistDow|nHandle)|
|00006090| 2e 73 75 62 45 6c 65 6d | 65 6e 74 29 3b 0d 09 09 |.subElem|ent);...|
|000060a0| 09 74 77 69 73 74 44 6f | 77 6e 48 61 6e 64 6c 65 |.twistDo|wnHandle|
|000060b0| 20 3d 20 28 2a 2a 74 77 | 69 73 74 44 6f 77 6e 48 | = (**tw|istDownH|
|000060c0| 61 6e 64 6c 65 29 2e 6e | 65 78 74 45 6c 65 6d 65 |andle).n|extEleme|
|000060d0| 6e 74 3b 0d 09 09 7d 09 | 09 09 0d 7d 0d 0d 2f 2a |nt;...}.|...}../*|
|000060e0| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|000060f0| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|00006100| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|00006110| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 20 2a | * * * *| * * * *|
|00006120| 20 2a 20 2a 20 2a 20 2a | 20 2a 20 2a 20 2a 0d 20 | * * * *| * * *. |
|00006130| 2a 20 43 6c 65 61 72 53 | 65 6c 65 63 74 65 64 45 |* ClearS|electedE|
|00006140| 6c 65 6d 65 6e 74 42 69 | 74 0d 20 2a 0d 20 2a 20 |lementBi|t. *. * |
|00006150| 41 66 74 65 72 20 63 6c | 65 61 72 69 6e 67 20 74 |After cl|earing t|
|00006160| 68 65 20 6b 53 65 6c 65 | 63 74 65 64 45 6c 65 6d |he kSele|ctedElem|
|00006170| 65 6e 74 42 69 74 20 66 | 72 6f 6d 20 74 68 65 20 |entBit f|rom the |
|00006180| 65 6c 65 6d 65 6e 74 20 | 6c 69 73 74 2c 20 77 65 |element |list, we|
|00006190| 20 73 61 76 65 20 74 68 | 65 0d 20 2a 20 22 69 73 | save th|e. * "is|
|000061a0| 20 73 65 6c 65 63 74 65 | 64 22 20 62 69 74 20 66 | selecte|d" bit f|
|000061b0| 72 6f 6d 20 74 68 65 20 | 64 69 73 70 6c 61 79 20 |rom the |display |
|000061c0| 6c 69 73 74 20 69 6e 74 | 6f 20 74 68 65 20 61 73 |list int|o the as|
|000061d0| 73 6f 63 69 61 74 65 64 | 20 65 6c 65 6d 65 6e 74 |sociated| element|
|000061e0| 2e 20 4e 6f 74 65 20 74 | 68 61 74 0d 20 2a 20 74 |. Note t|hat. * t|
|000061f0| 68 65 20 63 65 6c 6c 20 | 77 69 6c 6c 20 62 65 20 |he cell |will be |
|00006200| 64 65 73 65 6c 65 63 74 | 65 64 20 62 75 74 20 73 |deselect|ed but s|
|00006210| 65 6c 65 63 74 69 6f 6e | 20 73 74 61 74 65 20 69 |election| state i|
|00006220| 73 20 72 65 73 74 6f 72 | 65 64 20 77 68 65 6e 20 |s restor|ed when |
|00006230| 74 68 65 20 6c 69 73 74 | 20 69 73 0d 20 2a 20 72 |the list| is. * r|
|00006240| 65 62 75 69 6c 74 2e 20 | 54 68 65 20 66 75 6e 63 |ebuilt. |The func|
|00006250| 74 69 6f 6e 20 73 74 61 | 72 74 73 20 77 69 74 68 |tion sta|rts with|
|00006260| 20 74 68 65 20 72 6f 77 | 20 61 66 74 65 72 20 74 | the row| after t|
|00006270| 68 65 20 73 65 6c 65 63 | 74 65 64 20 28 63 6c 69 |he selec|ted (cli|
|00006280| 63 6b 65 64 20 6f 6e 29 | 20 63 65 6c 6c 0d 20 2a |cked on)| cell. *|
|00006290| 20 61 73 20 74 68 61 74 | 20 63 65 6c 6c 20 69 73 | as that| cell is|
|000062a0| 20 6e 6f 74 20 72 65 64 | 72 61 77 6e 20 61 6e 64 | not red|rawn and|
|000062b0| 2c 20 70 72 65 73 75 6d | 61 62 6c 79 2c 20 69 73 |, presum|ably, is|
|000062c0| 20 63 6f 72 72 65 63 74 | 6c 79 20 68 69 6c 69 74 | correct|ly hilit|
|000062d0| 65 64 2e 0d 20 2a 2f 0d | 73 74 61 74 69 63 20 76 |ed.. */.|static v|
|000062e0| 6f 69 64 0d 43 6f 70 79 | 53 65 6c 65 63 74 69 6f |oid.Copy|Selectio|
|000062f0| 6e 53 74 61 74 65 54 6f | 4c 69 73 74 28 0d 09 09 |nStateTo|List(...|
|00006300| 4c 69 73 74 48 61 6e 64 | 6c 65 09 09 09 09 09 74 |ListHand|le.....t|
|00006310| 68 65 4c 69 73 74 2c 0d | 09 09 73 68 6f 72 74 09 |heList,.|..short.|
|00006320| 09 09 09 09 09 73 65 6c | 65 63 74 65 64 52 6f 77 |.....sel|ectedRow|
|00006330| 0d 09 29 0d 7b 0d 09 09 | 54 77 69 73 74 44 6f 77 |..).{...|TwistDow|
|00006340| 6e 48 64 6c 09 09 09 09 | 74 77 69 73 74 44 6f 77 |nHdl....|twistDow|
|00006350| 6e 48 61 6e 64 6c 65 3b | 0d 09 09 43 65 6c 6c 09 |nHandle;|...Cell.|
|00006360| 09 09 09 09 09 74 68 65 | 43 65 6c 6c 3b 0d 09 09 |.....the|Cell;...|
|00006370| 0d 09 09 53 65 74 50 74 | 28 26 74 68 65 43 65 6c |...SetPt|(&theCel|
|00006380| 6c 2c 20 30 2c 20 73 65 | 6c 65 63 74 65 64 52 6f |l, 0, se|lectedRo|
|00006390| 77 20 2b 20 31 29 3b 0d | 09 09 77 68 69 6c 65 20 |w + 1);.|..while |
|000063a0| 28 4c 47 65 74 53 65 6c | 65 63 74 28 54 52 55 45 |(LGetSel|ect(TRUE|
|000063b0| 2c 20 26 74 68 65 43 65 | 6c 6c 2c 20 74 68 65 4c |, &theCe|ll, theL|
|000063c0| 69 73 74 29 29 20 7b 0d | 09 09 09 74 77 69 73 74 |ist)) {.|...twist|
|000063d0| 44 6f 77 6e 48 61 6e 64 | 6c 65 20 3d 20 47 65 74 |DownHand|le = Get|
|000063e0| 54 77 69 73 74 44 6f 77 | 6e 45 6c 65 6d 65 6e 74 |TwistDow|nElement|
|000063f0| 48 61 6e 64 6c 65 28 74 | 68 65 4c 69 73 74 2c 20 |Handle(t|heList, |
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.