home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 December / PCWKCD1296.iso / vjplusb / msdev / bin / ide / msvcgal.pkg / TEMPLATE / 123 < prev    next >
Unknown  |  1996-07-12  |  4.6 KB

view JSON data     |     view as text     |     open on a Mac     |     open on a PC

This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
100% file data default
100% xdgMime text/x-matlab default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 00 ff ff 00 00 0e 00 | 43 53 74 61 74 69 63 45 |%.......|CStaticE|
|00000010| 6c 65 6d 65 6e 74 03 00 | 00 00 2f 2f 20 ff ff 00 |lement..|..// ...|
|00000020| 00 0d 00 43 56 61 6c 75 | 65 45 6c 65 6d 65 6e 74 |...CValu|eElement|
|00000030| 07 43 70 70 46 69 6c 65 | 01 80 1f 00 00 00 20 3a |.CppFile|...... :|
|00000040| 20 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 20 | impleme|ntation |
|00000050| 66 69 6c 65 0d 0a 2f 2f | 20 53 65 65 20 03 80 0a |file..//| See ...|
|00000060| 48 65 61 64 65 72 46 69 | 6c 65 01 80 4c 00 00 00 |HeaderFi|le..L...|
|00000070| 20 66 6f 72 20 64 65 74 | 61 69 6c 73 20 6f 6e 20 | for det|ails on |
|00000080| 68 6f 77 20 74 6f 20 75 | 73 65 20 74 68 69 73 20 |how to u|se this |
|00000090| 63 6c 61 73 73 0d 0a 2f | 2f 0d 0a 0d 0a 23 69 6e |class../|/....#in|
|000000a0| 63 6c 75 64 65 20 22 73 | 74 64 61 66 78 2e 68 22 |clude "s|tdafx.h"|
|000000b0| 0d 0a 23 69 6e 63 6c 75 | 64 65 20 22 03 80 0a 48 |..#inclu|de "...H|
|000000c0| 65 61 64 65 72 46 69 6c | 65 01 80 b2 00 00 00 22 |eaderFil|e......"|
|000000d0| 0d 0a 0d 0a 23 69 66 64 | 65 66 20 5f 44 45 42 55 |....#ifd|ef _DEBU|
|000000e0| 47 0d 0a 23 75 6e 64 65 | 66 20 54 48 49 53 5f 46 |G..#unde|f THIS_F|
|000000f0| 49 4c 45 0d 0a 73 74 61 | 74 69 63 20 63 68 61 72 |ILE..sta|tic char|
|00000100| 20 42 41 53 45 44 5f 43 | 4f 44 45 20 54 48 49 53 | BASED_C|ODE THIS|
|00000110| 5f 46 49 4c 45 5b 5d 20 | 3d 20 5f 5f 46 49 4c 45 |_FILE[] |= __FILE|
|00000120| 5f 5f 3b 0d 0a 23 65 6e | 64 69 66 0d 0a 0d 0a 2f |__;..#en|dif..../|
|00000130| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000140| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000150| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000160| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000170| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 0d 0a 2f 2f |////////|////..//|
|00000180| 20 03 80 09 43 6c 61 73 | 73 4e 61 6d 65 01 80 04 | ...Clas|sName...|
|00000190| 00 00 00 0d 0a 0d 0a 03 | 80 09 43 6c 61 73 73 4e |........|..ClassN|
|000001a0| 61 6d 65 01 80 02 00 00 | 00 3a 3a 03 80 09 43 6c |ame.....|.::...Cl|
|000001b0| 61 73 73 4e 61 6d 65 01 | 80 eb 00 00 00 28 29 0d |assName.|.....().|
|000001c0| 0a 7b 0d 0a 09 2f 2f 20 | 59 6f 75 20 63 61 6e 27 |.{...// |You can'|
|000001d0| 74 20 61 63 74 75 61 6c | 6c 79 20 61 64 64 20 61 |t actual|ly add a|
|000001e0| 6e 79 74 68 69 6e 67 20 | 74 6f 20 74 68 65 20 6c |nything |to the l|
|000001f0| 69 73 74 20 62 6f 78 20 | 68 65 72 65 20 73 69 6e |ist box |here sin|
|00000200| 63 65 20 74 68 65 0d 0a | 09 2f 2f 20 61 73 73 6f |ce the..|.// asso|
|00000210| 63 69 61 74 65 64 20 43 | 57 6e 64 20 68 61 73 6e |ciated C|Wnd hasn|
|00000220| 27 74 20 62 65 65 6e 20 | 63 72 65 61 74 65 64 20 |'t been |created |
|00000230| 79 65 74 2e 20 20 53 61 | 76 65 20 61 6e 79 20 69 |yet. Sa|ve any i|
|00000240| 6e 69 74 69 61 6c 69 7a | 61 74 69 6f 6e 0d 0a 09 |nitializ|ation...|
|00000250| 2f 2f 20 79 6f 75 20 6e | 65 65 64 20 74 6f 20 64 |// you n|eed to d|
|00000260| 6f 20 66 6f 72 20 61 66 | 74 65 72 20 74 68 65 20 |o for af|ter the |
|00000270| 43 57 6e 64 20 68 61 73 | 20 62 65 65 6e 20 63 6f |CWnd has| been co|
|00000280| 6e 73 74 72 75 63 74 65 | 64 2e 20 20 54 68 65 20 |nstructe|d. The |
|00000290| 54 4f 44 4f 3a 20 0d 0a | 09 2f 2f 20 63 6f 6d 6d |TODO: ..|.// comm|
|000002a0| 65 6e 74 73 20 69 6e 20 | 03 80 0a 48 65 61 64 65 |ents in |...Heade|
|000002b0| 72 46 69 6c 65 01 80 22 | 00 00 00 20 65 78 70 6c |rFile.."|... expl|
|000002c0| 61 69 6e 20 68 6f 77 20 | 74 6f 20 64 6f 20 74 68 |ain how |to do th|
|000002d0| 69 73 20 66 6f 72 20 0d | 0a 09 2f 2f 20 03 80 09 |is for .|..// ...|
|000002e0| 43 6c 61 73 73 4e 61 6d | 65 01 80 1c 00 00 00 20 |ClassNam|e...... |
|000002f0| 61 73 20 69 6d 70 6c 65 | 6d 65 6e 74 65 64 20 68 |as imple|mented h|
|00000300| 65 72 65 2e 0d 0a 7d 0d | 0a 0d 0a 03 80 09 43 6c |ere...}.|......Cl|
|00000310| 61 73 73 4e 61 6d 65 01 | 80 03 00 00 00 3a 3a 7e |assName.|.....::~|
|00000320| 03 80 09 43 6c 61 73 73 | 4e 61 6d 65 01 80 20 00 |...Class|Name.. .|
|00000330| 00 00 28 29 0d 0a 7b 0d | 0a 7d 0d 0a 0d 0a 0d 0a |..()..{.|.}......|
|00000340| 42 45 47 49 4e 5f 4d 45 | 53 53 41 47 45 5f 4d 41 |BEGIN_ME|SSAGE_MA|
|00000350| 50 28 03 80 09 43 6c 61 | 73 73 4e 61 6d 65 01 80 |P(...Cla|ssName..|
|00000360| 1e 00 00 00 2c 20 43 4c | 69 73 74 42 6f 78 29 0d |...., CL|istBox).|
|00000370| 0a 09 2f 2f 7b 7b 41 46 | 58 5f 4d 53 47 5f 4d 41 |..//{{AF|X_MSG_MA|
|00000380| 50 28 03 80 09 43 6c 61 | 73 73 4e 61 6d 65 01 80 |P(...Cla|ssName..|
|00000390| c4 00 00 00 29 0d 0a 09 | 09 2f 2f 20 4e 4f 54 45 |....)...|.// NOTE|
|000003a0| 20 2d 20 74 68 65 20 43 | 6c 61 73 73 57 69 7a 61 | - the C|lassWiza|
|000003b0| 72 64 20 77 69 6c 6c 20 | 61 64 64 20 61 6e 64 20 |rd will |add and |
|000003c0| 72 65 6d 6f 76 65 20 6d | 61 70 70 69 6e 67 20 6d |remove m|apping m|
|000003d0| 61 63 72 6f 73 20 68 65 | 72 65 2e 0d 0a 09 2f 2f |acros he|re....//|
|000003e0| 7d 7d 41 46 58 5f 4d 53 | 47 5f 4d 41 50 0d 0a 45 |}}AFX_MS|G_MAP..E|
|000003f0| 4e 44 5f 4d 45 53 53 41 | 47 45 5f 4d 41 50 28 29 |ND_MESSA|GE_MAP()|
|00000400| 0d 0a 0d 0a 0d 0a 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |......//|////////|
|00000410| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000420| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000430| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000440| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000450| 2f 2f 2f 0d 0a 2f 2f 20 | 03 80 09 43 6c 61 73 73 |///..// |...Class|
|00000460| 4e 61 6d 65 01 80 15 02 | 00 00 20 6d 65 73 73 61 |Name....|.. messa|
|00000470| 67 65 20 68 61 6e 64 6c | 65 72 73 0d 0a 0d 0a 2f |ge handl|ers..../|
|00000480| 2f 20 54 68 69 73 20 66 | 75 6e 63 74 69 6f 6e 20 |/ This f|unction |
|00000490| 64 72 61 77 73 20 61 20 | 63 6f 6c 6f 72 20 62 61 |draws a |color ba|
|000004a0| 72 20 69 6e 20 74 68 65 | 20 63 6c 69 65 6e 74 20 |r in the| client |
|000004b0| 73 70 61 63 65 20 6f 66 | 20 74 68 69 73 20 6c 69 |space of| this li|
|000004c0| 73 74 20 62 6f 78 20 0d | 0a 2f 2f 20 69 74 65 6d |st box .|.// item|
|000004d0| 2e 20 20 49 66 20 79 6f | 75 72 20 6c 69 73 74 20 |. If yo|ur list |
|000004e0| 62 6f 78 20 69 74 65 6d | 20 63 6f 6e 74 61 69 6e |box item| contain|
|000004f0| 73 20 73 6f 6d 65 74 68 | 69 6e 67 20 6f 74 68 65 |s someth|ing othe|
|00000500| 72 20 74 68 61 6e 20 63 | 6f 6c 6f 72 20 62 61 72 |r than c|olor bar|
|00000510| 73 2c 20 0d 0a 2f 2f 20 | 79 6f 75 20 6e 65 65 64 |s, ..// |you need|
|00000520| 20 74 6f 20 72 65 70 6c | 61 63 65 20 74 68 65 20 | to repl|ace the |
|00000530| 63 6f 6e 74 65 6e 74 73 | 20 6f 66 20 74 68 69 73 |contents| of this|
|00000540| 20 66 75 6e 63 74 69 6f | 6e 20 77 69 74 68 20 79 | functio|n with y|
|00000550| 6f 75 72 20 6f 77 6e 20 | 63 6f 64 65 20 0d 0a 2f |our own |code ../|
|00000560| 2f 20 66 6f 72 20 64 72 | 61 77 69 6e 67 20 69 74 |/ for dr|awing it|
|00000570| 2e 20 20 49 66 20 79 6f | 75 20 61 72 65 20 77 6f |. If yo|u are wo|
|00000580| 72 6b 69 6e 67 20 77 69 | 74 68 20 73 74 72 69 6e |rking wi|th strin|
|00000590| 67 73 2c 20 74 68 65 20 | 64 65 66 61 75 6c 74 20 |gs, the |default |
|000005a0| 4d 46 43 0d 0a 2f 2f 20 | 69 6d 70 6c 65 6d 65 6e |MFC..// |implemen|
|000005b0| 74 61 74 69 6f 6e 20 6f | 66 20 74 68 69 73 20 66 |tation o|f this f|
|000005c0| 75 6e 63 74 69 6f 6e 20 | 77 69 6c 6c 20 70 72 6f |unction |will pro|
|000005d0| 62 61 62 6c 79 20 77 6f | 72 6b 20 6a 75 73 74 20 |bably wo|rk just |
|000005e0| 66 69 6e 65 20 66 6f 72 | 20 79 6f 75 2e 20 20 0d |fine for| you. .|
|000005f0| 0a 2f 2f 20 28 45 78 61 | 6d 70 6c 65 20 6f 66 20 |.// (Exa|mple of |
|00000600| 61 20 73 74 72 69 6e 67 | 20 77 68 65 72 65 20 79 |a string| where y|
|00000610| 6f 75 20 6e 65 65 64 20 | 74 6f 20 64 6f 20 74 68 |ou need |to do th|
|00000620| 65 20 64 72 61 77 69 6e | 67 20 79 6f 75 72 73 65 |e drawin|g yourse|
|00000630| 6c 66 3a 20 6f 6e 65 20 | 0d 0a 2f 2f 20 64 69 73 |lf: one |..// dis|
|00000640| 70 6c 61 79 65 64 20 69 | 6e 20 61 20 64 69 66 66 |played i|n a diff|
|00000650| 65 72 65 6e 74 20 66 6f | 6e 74 20 74 68 61 6e 20 |erent fo|nt than |
|00000660| 74 68 65 20 72 65 73 74 | 20 6f 66 20 74 68 65 20 |the rest| of the |
|00000670| 64 69 61 6c 6f 67 2e 29 | 0d 0a 76 6f 69 64 20 03 |dialog.)|..void .|
|00000680| 80 09 43 6c 61 73 73 4e | 61 6d 65 01 80 ef 03 00 |..ClassN|ame.....|
|00000690| 00 3a 3a 44 72 61 77 49 | 74 65 6d 28 4c 50 44 52 |.::DrawI|tem(LPDR|
|000006a0| 41 57 49 54 45 4d 53 54 | 52 55 43 54 20 6c 70 44 |AWITEMST|RUCT lpD|
|000006b0| 72 61 77 49 74 65 6d 53 | 74 72 75 63 74 29 20 0d |rawItemS|truct) .|
|000006c0| 0a 7b 0d 0a 09 43 44 43 | 2a 20 70 44 43 20 3d 20 |.{...CDC|* pDC = |
|000006d0| 43 44 43 3a 3a 46 72 6f | 6d 48 61 6e 64 6c 65 28 |CDC::Fro|mHandle(|
|000006e0| 6c 70 44 72 61 77 49 74 | 65 6d 53 74 72 75 63 74 |lpDrawIt|emStruct|
|000006f0| 2d 3e 68 44 43 29 3b 0d | 0a 09 43 4f 4c 4f 52 52 |->hDC);.|..COLORR|
|00000700| 45 46 20 63 6f 6c 6f 72 | 20 3d 20 28 43 4f 4c 4f |EF color| = (COLO|
|00000710| 52 52 45 46 29 6c 70 44 | 72 61 77 49 74 65 6d 53 |RREF)lpD|rawItemS|
|00000720| 74 72 75 63 74 2d 3e 69 | 74 65 6d 44 61 74 61 3b |truct->i|temData;|
|00000730| 20 2f 2f 20 52 47 42 20 | 69 6e 20 69 74 65 6d 20 | // RGB |in item |
|00000740| 64 61 74 61 0d 0a 0d 0a | 09 2f 2f 20 57 68 69 74 |data....|.// Whit|
|00000750| 65 20 73 70 61 63 65 0d | 0a 09 43 52 65 63 74 20 |e space.|..CRect |
|00000760| 72 63 49 74 65 6d 28 6c | 70 44 72 61 77 49 74 65 |rcItem(l|pDrawIte|
|00000770| 6d 53 74 72 75 63 74 2d | 3e 72 63 49 74 65 6d 29 |mStruct-|>rcItem)|
|00000780| 3b 0d 0a 09 72 63 49 74 | 65 6d 2e 49 6e 66 6c 61 |;...rcIt|em.Infla|
|00000790| 74 65 52 65 63 74 28 2d | 32 2c 20 2d 32 29 3b 0d |teRect(-|2, -2);.|
|000007a0| 0a 0d 0a 09 2f 2f 20 50 | 61 69 6e 74 20 74 68 65 |....// P|aint the|
|000007b0| 20 63 6f 6c 6f 72 20 69 | 74 65 6d 20 69 6e 20 74 | color i|tem in t|
|000007c0| 68 65 20 63 6f 6c 6f 72 | 20 72 65 71 75 65 73 74 |he color| request|
|000007d0| 65 64 0d 0a 09 43 42 72 | 75 73 68 20 62 72 75 73 |ed...CBr|ush brus|
|000007e0| 68 28 63 6f 6c 6f 72 29 | 3b 0d 0a 09 70 44 43 2d |h(color)|;...pDC-|
|000007f0| 3e 46 69 6c 6c 52 65 63 | 74 28 72 63 49 74 65 6d |>FillRec|t(rcItem|
|00000800| 2c 20 26 62 72 75 73 68 | 29 3b 0d 0a 0d 0a 09 2f |, &brush|);...../|
|00000810| 2f 20 46 6f 63 75 73 20 | 72 65 63 74 0d 0a 09 69 |/ Focus |rect...i|
|00000820| 66 20 28 6c 70 44 72 61 | 77 49 74 65 6d 53 74 72 |f (lpDra|wItemStr|
|00000830| 75 63 74 2d 3e 69 74 65 | 6d 41 63 74 69 6f 6e 20 |uct->ite|mAction |
|00000840| 26 20 4f 44 41 5f 46 4f | 43 55 53 29 0d 0a 09 09 |& ODA_FO|CUS)....|
|00000850| 70 44 43 2d 3e 44 72 61 | 77 46 6f 63 75 73 52 65 |pDC->Dra|wFocusRe|
|00000860| 63 74 28 26 6c 70 44 72 | 61 77 49 74 65 6d 53 74 |ct(&lpDr|awItemSt|
|00000870| 72 75 63 74 2d 3e 72 63 | 49 74 65 6d 29 3b 0d 0a |ruct->rc|Item);..|
|00000880| 7d 0d 0a 0d 0a 2f 2f 20 | 54 68 69 73 20 66 75 6e |}....// |This fun|
|00000890| 63 74 69 6f 6e 20 63 6f | 6d 70 61 72 65 73 20 74 |ction co|mpares t|
|000008a0| 77 6f 20 63 6f 6c 6f 72 | 73 20 74 6f 20 65 61 63 |wo color|s to eac|
|000008b0| 68 20 6f 74 68 65 72 2e | 20 49 66 20 79 6f 75 27 |h other.| If you'|
|000008c0| 72 65 20 64 6f 69 6e 67 | 20 0d 0a 2f 2f 20 73 6f |re doing| ..// so|
|000008d0| 6d 65 74 68 69 6e 67 20 | 64 69 66 66 65 72 65 6e |mething |differen|
|000008e0| 74 2c 20 6c 69 6b 65 20 | 63 6f 6d 70 61 72 69 6e |t, like |comparin|
|000008f0| 67 20 74 77 6f 20 62 69 | 74 6d 61 70 73 20 74 6f |g two bi|tmaps to|
|00000900| 20 65 61 63 68 20 6f 74 | 68 65 72 2c 20 75 73 65 | each ot|her, use|
|00000910| 20 0d 0a 2f 2f 20 61 20 | 64 69 66 66 65 72 65 6e | ..// a |differen|
|00000920| 74 20 61 6c 67 6f 72 69 | 74 68 6d 2e 20 20 49 66 |t algori|thm. If|
|00000930| 20 79 6f 75 20 61 72 65 | 20 77 6f 72 6b 69 6e 67 | you are| working|
|00000940| 20 77 69 74 68 20 73 74 | 72 69 6e 67 73 2c 20 74 | with st|rings, t|
|00000950| 68 65 20 64 65 66 61 75 | 6c 74 20 0d 0a 2f 2f 20 |he defau|lt ..// |
|00000960| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 20 70 |implemen|tation p|
|00000970| 72 6f 76 69 64 65 64 20 | 62 79 20 4d 46 43 20 77 |rovided |by MFC w|
|00000980| 69 6c 6c 20 70 72 6f 62 | 61 62 6c 79 20 64 6f 20 |ill prob|ably do |
|00000990| 74 68 65 20 6a 6f 62 20 | 6a 75 73 74 20 66 69 6e |the job |just fin|
|000009a0| 65 2e 20 20 0d 0a 2f 2f | 20 28 45 78 61 6d 70 6c |e. ..//| (Exampl|
|000009b0| 65 20 6f 66 20 61 20 73 | 74 72 69 6e 67 20 77 68 |e of a s|tring wh|
|000009c0| 65 72 65 20 79 6f 75 20 | 6e 65 65 64 20 74 6f 20 |ere you |need to |
|000009d0| 64 6f 20 79 6f 75 72 20 | 6f 77 6e 20 63 6f 6d 70 |do your |own comp|
|000009e0| 61 72 69 73 6f 6e 73 3a | 20 69 66 20 0d 0a 2f 2f |arisons:| if ..//|
|000009f0| 20 79 6f 75 72 20 73 6f | 72 74 69 6e 67 20 73 63 | your so|rting sc|
|00000a00| 68 65 6d 65 20 69 73 20 | 64 69 66 66 65 72 65 6e |heme is |differen|
|00000a10| 74 20 74 68 61 6e 20 61 | 20 73 74 61 6e 64 61 72 |t than a| standar|
|00000a20| 64 20 63 6f 6c 6c 61 74 | 69 6e 67 20 73 65 71 75 |d collat|ing sequ|
|00000a30| 65 6e 63 65 2c 20 0d 0a | 2f 2f 20 73 75 63 68 20 |ence, ..|// such |
|00000a40| 61 73 20 6f 6e 65 20 77 | 68 65 72 65 20 74 68 65 |as one w|here the|
|00000a50| 20 63 6f 6d 70 61 72 69 | 73 6f 6e 73 20 6e 65 65 | compari|sons nee|
|00000a60| 64 20 74 6f 20 62 65 20 | 63 61 73 65 2d 69 6e 73 |d to be |case-ins|
|00000a70| 65 6e 73 69 74 69 76 65 | 2e 29 0d 0a 69 6e 74 20 |ensitive|.)..int |
|00000a80| 03 80 09 43 6c 61 73 73 | 4e 61 6d 65 01 80 e2 04 |...Class|Name....|
|00000a90| 00 00 3a 3a 43 6f 6d 70 | 61 72 65 49 74 65 6d 28 |..::Comp|areItem(|
|00000aa0| 4c 50 43 4f 4d 50 41 52 | 45 49 54 45 4d 53 54 52 |LPCOMPAR|EITEMSTR|
|00000ab0| 55 43 54 20 6c 70 43 6f | 6d 70 61 72 65 49 74 65 |UCT lpCo|mpareIte|
|00000ac0| 6d 53 74 72 75 63 74 29 | 20 0d 0a 7b 0d 0a 09 2f |mStruct)| ..{.../|
|00000ad0| 2f 20 72 65 74 75 72 6e | 20 2d 31 20 3d 20 69 74 |/ return| -1 = it|
|00000ae0| 65 6d 20 31 20 73 6f 72 | 74 73 20 62 65 66 6f 72 |em 1 sor|ts befor|
|00000af0| 65 20 69 74 65 6d 20 32 | 0d 0a 09 2f 2f 20 72 65 |e item 2|...// re|
|00000b00| 74 75 72 6e 20 30 20 3d | 20 69 74 65 6d 20 31 20 |turn 0 =| item 1 |
|00000b10| 61 6e 64 20 69 74 65 6d | 20 32 20 73 6f 72 74 20 |and item| 2 sort |
|00000b20| 74 68 65 20 73 61 6d 65 | 0d 0a 09 2f 2f 20 72 65 |the same|...// re|
|00000b30| 74 75 72 6e 20 31 20 3d | 20 69 74 65 6d 20 31 20 |turn 1 =| item 1 |
|00000b40| 73 6f 72 74 73 20 61 66 | 74 65 72 20 69 74 65 6d |sorts af|ter item|
|00000b50| 20 32 0d 0a 0d 0a 09 43 | 4f 4c 4f 52 52 45 46 20 | 2.....C|OLORREF |
|00000b60| 63 6f 6c 6f 72 31 20 3d | 20 28 43 4f 4c 4f 52 52 |color1 =| (COLORR|
|00000b70| 45 46 29 6c 70 43 6f 6d | 70 61 72 65 49 74 65 6d |EF)lpCom|pareItem|
|00000b80| 53 74 72 75 63 74 2d 3e | 69 74 65 6d 44 61 74 61 |Struct->|itemData|
|00000b90| 31 3b 0d 0a 09 43 4f 4c | 4f 52 52 45 46 20 63 6f |1;...COL|ORREF co|
|00000ba0| 6c 6f 72 32 20 3d 20 28 | 43 4f 4c 4f 52 52 45 46 |lor2 = (|COLORREF|
|00000bb0| 29 6c 70 43 6f 6d 70 61 | 72 65 49 74 65 6d 53 74 |)lpCompa|reItemSt|
|00000bc0| 72 75 63 74 2d 3e 69 74 | 65 6d 44 61 74 61 32 3b |ruct->it|emData2;|
|00000bd0| 0d 0a 09 69 66 20 28 63 | 6f 6c 6f 72 31 20 3d 3d |...if (c|olor1 ==|
|00000be0| 20 63 6f 6c 6f 72 32 29 | 0d 0a 09 09 72 65 74 75 | color2)|....retu|
|00000bf0| 72 6e 20 30 3b 20 20 20 | 20 20 20 20 2f 2f 20 65 |rn 0; | // e|
|00000c00| 78 61 63 74 20 6d 61 74 | 63 68 0d 0a 0d 0a 09 2f |xact mat|ch...../|
|00000c10| 2f 20 66 69 72 73 74 20 | 64 6f 20 61 6e 20 69 6e |/ first |do an in|
|00000c20| 74 65 6e 73 69 74 79 20 | 73 6f 72 74 2c 20 6c 6f |tensity |sort, lo|
|00000c30| 77 65 72 20 69 6e 74 65 | 6e 73 69 74 69 65 73 20 |wer inte|nsities |
|00000c40| 67 6f 20 66 69 72 73 74 | 0d 0a 09 69 6e 74 20 69 |go first|...int i|
|00000c50| 6e 74 65 6e 73 69 74 79 | 31 20 3d 20 47 65 74 52 |ntensity|1 = GetR|
|00000c60| 56 61 6c 75 65 28 63 6f | 6c 6f 72 31 29 20 2b 20 |Value(co|lor1) + |
|00000c70| 47 65 74 47 56 61 6c 75 | 65 28 63 6f 6c 6f 72 31 |GetGValu|e(color1|
|00000c80| 29 20 2b 20 47 65 74 42 | 56 61 6c 75 65 28 63 6f |) + GetB|Value(co|
|00000c90| 6c 6f 72 31 29 3b 0d 0a | 09 69 6e 74 20 69 6e 74 |lor1);..|.int int|
|00000ca0| 65 6e 73 69 74 79 32 20 | 3d 20 47 65 74 52 56 61 |ensity2 |= GetRVa|
|00000cb0| 6c 75 65 28 63 6f 6c 6f | 72 32 29 20 2b 20 47 65 |lue(colo|r2) + Ge|
|00000cc0| 74 47 56 61 6c 75 65 28 | 63 6f 6c 6f 72 32 29 20 |tGValue(|color2) |
|00000cd0| 2b 20 47 65 74 42 56 61 | 6c 75 65 28 63 6f 6c 6f |+ GetBVa|lue(colo|
|00000ce0| 72 32 29 3b 0d 0a 09 69 | 66 20 28 69 6e 74 65 6e |r2);...i|f (inten|
|00000cf0| 73 69 74 79 31 20 3c 20 | 69 6e 74 65 6e 73 69 74 |sity1 < |intensit|
|00000d00| 79 32 29 0d 0a 09 09 72 | 65 74 75 72 6e 20 2d 31 |y2)....r|eturn -1|
|00000d10| 3b 20 20 20 20 20 20 2f | 2f 20 6c 6f 77 65 72 20 |; /|/ lower |
|00000d20| 69 6e 74 65 6e 73 69 74 | 79 20 67 6f 65 73 20 66 |intensit|y goes f|
|00000d30| 69 72 73 74 0d 0a 09 65 | 6c 73 65 20 69 66 20 28 |irst...e|lse if (|
|00000d40| 69 6e 74 65 6e 73 69 74 | 79 31 20 3e 20 69 6e 74 |intensit|y1 > int|
|00000d50| 65 6e 73 69 74 79 32 29 | 0d 0a 09 09 72 65 74 75 |ensity2)|....retu|
|00000d60| 72 6e 20 31 3b 20 20 20 | 20 20 20 20 2f 2f 20 68 |rn 1; | // h|
|00000d70| 69 67 68 65 72 20 69 6e | 74 65 6e 73 69 74 79 20 |igher in|tensity |
|00000d80| 67 6f 65 73 20 73 65 63 | 6f 6e 64 0d 0a 0d 0a 09 |goes sec|ond.....|
|00000d90| 2f 2f 20 69 66 20 73 61 | 6d 65 20 69 6e 74 65 6e |// if sa|me inten|
|00000da0| 73 69 74 79 2c 20 73 6f | 72 74 20 62 79 20 63 6f |sity, so|rt by co|
|00000db0| 6c 6f 72 20 28 62 6c 75 | 65 73 20 66 69 72 73 74 |lor (blu|es first|
|00000dc0| 2c 20 72 65 64 73 20 6c | 61 73 74 29 0d 0a 09 69 |, reds l|ast)...i|
|00000dd0| 66 20 28 47 65 74 42 56 | 61 6c 75 65 28 63 6f 6c |f (GetBV|alue(col|
|00000de0| 6f 72 31 29 20 3e 20 47 | 65 74 42 56 61 6c 75 65 |or1) > G|etBValue|
|00000df0| 28 63 6f 6c 6f 72 32 29 | 29 0d 0a 09 09 72 65 74 |(color2)|)....ret|
|00000e00| 75 72 6e 20 2d 31 3b 0d | 0a 09 65 6c 73 65 20 69 |urn -1;.|..else i|
|00000e10| 66 20 28 47 65 74 47 56 | 61 6c 75 65 28 63 6f 6c |f (GetGV|alue(col|
|00000e20| 6f 72 31 29 20 3e 20 47 | 65 74 47 56 61 6c 75 65 |or1) > G|etGValue|
|00000e30| 28 63 6f 6c 6f 72 32 29 | 29 0d 0a 09 09 72 65 74 |(color2)|)....ret|
|00000e40| 75 72 6e 20 2d 31 3b 0d | 0a 09 65 6c 73 65 20 69 |urn -1;.|..else i|
|00000e50| 66 20 28 47 65 74 52 56 | 61 6c 75 65 28 63 6f 6c |f (GetRV|alue(col|
|00000e60| 6f 72 31 29 20 3e 20 47 | 65 74 52 56 61 6c 75 65 |or1) > G|etRValue|
|00000e70| 28 63 6f 6c 6f 72 32 29 | 29 0d 0a 09 09 72 65 74 |(color2)|)....ret|
|00000e80| 75 72 6e 20 2d 31 3b 0d | 0a 09 65 6c 73 65 0d 0a |urn -1;.|..else..|
|00000e90| 09 09 72 65 74 75 72 6e | 20 31 3b 0d 0a 7d 0d 0a |..return| 1;..}..|
|00000ea0| 0d 0a 23 64 65 66 69 6e | 65 20 43 4f 4c 4f 52 5f |..#defin|e COLOR_|
|00000eb0| 49 54 45 4d 5f 48 45 49 | 47 48 54 20 20 20 32 30 |ITEM_HEI|GHT 20|
|00000ec0| 0d 0a 0d 0a 2f 2f 20 57 | 65 20 6d 61 64 65 20 6f |....// W|e made o|
|00000ed0| 75 72 20 63 6f 6c 6f 72 | 20 62 61 72 73 20 61 6c |ur color| bars al|
|00000ee0| 6c 20 62 65 20 74 68 65 | 20 73 61 6d 65 20 68 65 |l be the| same he|
|00000ef0| 69 67 68 74 20 66 6f 72 | 20 73 69 6d 70 6c 69 63 |ight for| simplic|
|00000f00| 69 74 79 2e 20 20 59 6f | 75 20 0d 0a 2f 2f 20 63 |ity. Yo|u ..// c|
|00000f10| 61 6e 20 61 63 74 75 61 | 6c 6c 79 20 73 70 65 63 |an actua|lly spec|
|00000f20| 69 66 79 20 76 61 72 69 | 61 62 6c 65 20 68 65 69 |ify vari|able hei|
|00000f30| 67 68 74 73 20 61 73 20 | 6c 6f 6e 67 20 61 73 20 |ghts as |long as |
|00000f40| 79 6f 75 20 73 65 74 20 | 74 68 65 20 0d 0a 2f 2f |you set |the ..//|
|00000f50| 20 43 42 53 5f 4f 57 4e | 45 52 44 52 41 57 56 41 | CBS_OWN|ERDRAWVA|
|00000f60| 52 49 41 42 4c 45 20 73 | 74 79 6c 65 2e 0d 0a 76 |RIABLE s|tyle...v|
|00000f70| 6f 69 64 20 03 80 09 43 | 6c 61 73 73 4e 61 6d 65 |oid ...C|lassName|
|00000f80| 01 80 d2 00 00 00 3a 3a | 4d 65 61 73 75 72 65 49 |......::|MeasureI|
|00000f90| 74 65 6d 28 4c 50 4d 45 | 41 53 55 52 45 49 54 45 |tem(LPME|ASUREITE|
|00000fa0| 4d 53 54 52 55 43 54 20 | 6c 70 4d 65 61 73 75 72 |MSTRUCT |lpMeasur|
|00000fb0| 65 49 74 65 6d 53 74 72 | 75 63 74 29 0d 0a 7b 0d |eItemStr|uct)..{.|
|00000fc0| 0a 09 2f 2f 20 61 6c 6c | 20 69 74 65 6d 73 20 61 |..// all| items a|
|00000fd0| 72 65 20 6f 66 20 66 69 | 78 65 64 20 73 69 7a 65 |re of fi|xed size|
|00000fe0| 0d 0a 09 2f 2f 20 6d 75 | 73 74 20 75 73 65 20 4c |...// mu|st use L|
|00000ff0| 42 53 5f 4f 57 4e 45 52 | 44 52 41 57 56 41 52 49 |BS_OWNER|DRAWVARI|
|00001000| 41 42 4c 45 20 66 6f 72 | 20 74 68 69 73 20 74 6f |ABLE for| this to|
|00001010| 20 77 6f 72 6b 0d 0a 09 | 6c 70 4d 65 61 73 75 72 | work...|lpMeasur|
|00001020| 65 49 74 65 6d 53 74 72 | 75 63 74 2d 3e 69 74 65 |eItemStr|uct->ite|
|00001030| 6d 48 65 69 67 68 74 20 | 3d 20 43 4f 4c 4f 52 5f |mHeight |= COLOR_|
|00001040| 49 54 45 4d 5f 48 45 49 | 47 48 54 3b 0d 0a 7d 0d |ITEM_HEI|GHT;..}.|
|00001050| 0a 0d 0a 76 6f 69 64 20 | 03 80 09 43 6c 61 73 73 |...void |...Class|
|00001060| 4e 61 6d 65 01 80 1e 01 | 00 00 3a 3a 41 64 64 4c |Name....|..::AddL|
|00001070| 69 73 74 49 74 65 6d 28 | 43 4f 4c 4f 52 52 45 46 |istItem(|COLORREF|
|00001080| 20 63 6f 6c 6f 72 29 0d | 0a 7b 0d 0a 09 2f 2f 20 | color).|.{...// |
|00001090| 61 64 64 20 61 20 6c 69 | 73 74 62 6f 78 20 69 74 |add a li|stbox it|
|000010a0| 65 6d 0d 0a 09 41 64 64 | 53 74 72 69 6e 67 28 28 |em...Add|String((|
|000010b0| 4c 50 43 54 53 54 52 29 | 20 63 6f 6c 6f 72 29 3b |LPCTSTR)| color);|
|000010c0| 0d 0a 09 09 2f 2f 20 4c | 69 73 74 20 62 6f 78 20 |....// L|ist box |
|000010d0| 64 6f 65 73 20 6e 6f 74 | 20 68 61 76 65 20 74 68 |does not| have th|
|000010e0| 65 20 4c 42 53 5f 48 41 | 53 53 54 52 49 4e 47 53 |e LBS_HA|SSTRINGS|
|000010f0| 20 73 74 79 6c 65 2c 20 | 73 6f 20 74 68 65 0d 0a | style, |so the..|
|00001100| 09 09 2f 2f 20 20 6e 6f | 72 6d 61 6c 20 6c 69 73 |..// no|rmal lis|
|00001110| 74 20 62 6f 78 20 73 74 | 72 69 6e 67 20 69 73 20 |t box st|ring is |
|00001120| 75 73 65 64 20 74 6f 20 | 73 74 6f 72 65 20 61 6e |used to |store an|
|00001130| 20 52 47 42 20 63 6f 6c | 6f 72 0d 0a 7d 0d 0a 0d | RGB col|or..}...|
|00001140| 0a 2f 2f 20 61 64 64 20 | 38 20 63 6f 6c 6f 72 73 |.// add |8 colors|
|00001150| 20 74 6f 20 74 68 65 20 | 6c 69 73 74 20 62 6f 78 | to the |list box|
|00001160| 20 28 70 72 69 6d 61 72 | 79 20 2b 20 73 65 63 6f | (primar|y + seco|
|00001170| 6e 64 61 72 79 20 63 6f | 6c 6f 72 20 6f 6e 6c 79 |ndary co|lor only|
|00001180| 29 0d 0a 76 6f 69 64 20 | 03 80 09 43 6c 61 73 73 |)..void |...Class|
|00001190| 4e 61 6d 65 01 80 cd 00 | 00 00 3a 3a 4c 6f 61 64 |Name....|..::Load|
|000011a0| 4c 69 73 74 28 29 0d 0a | 7b 0d 0a 09 66 6f 72 20 |List()..|{...for |
|000011b0| 28 69 6e 74 20 72 65 64 | 20 3d 20 30 3b 20 72 65 |(int red| = 0; re|
|000011c0| 64 20 3c 3d 20 32 35 35 | 3b 20 72 65 64 20 2b 3d |d <= 255|; red +=|
|000011d0| 20 32 35 35 29 0d 0a 09 | 09 66 6f 72 20 28 69 6e | 255)...|.for (in|
|000011e0| 74 20 67 72 65 65 6e 20 | 3d 20 30 3b 20 67 72 65 |t green |= 0; gre|
|000011f0| 65 6e 20 3c 3d 20 32 35 | 35 3b 20 67 72 65 65 6e |en <= 25|5; green|
|00001200| 20 2b 3d 20 32 35 35 29 | 0d 0a 09 09 09 66 6f 72 | += 255)|.....for|
|00001210| 20 28 69 6e 74 20 62 6c | 75 65 20 3d 20 30 3b 20 | (int bl|ue = 0; |
|00001220| 62 6c 75 65 20 3c 3d 20 | 32 35 35 3b 20 62 6c 75 |blue <= |255; blu|
|00001230| 65 20 2b 3d 20 32 35 35 | 29 0d 0a 09 09 09 09 41 |e += 255|)......A|
|00001240| 64 64 4c 69 73 74 49 74 | 65 6d 28 52 47 42 28 72 |ddListIt|em(RGB(r|
|00001250| 65 64 2c 20 67 72 65 65 | 6e 2c 20 62 6c 75 65 29 |ed, gree|n, blue)|
|00001260| 29 3b 0d 0a 7d 0d 0a | |);..}.. | |
+--------+-------------------------+-------------------------+--------+--------+