/*|*\
|*| File: FocusEditCtrl.h
|*|
|*| By: James R. Twine
|*| Copyright 1998, James R. Twine
|*| Copyright 1999-2000, TransactionWorks, Inc.
|*| Date: xxxx, xxxx, 1998
|*|
|*| This implementes a ComboBox control that can be
|*| used to display and provide selection for a specific
|*| set of colors. The standard set of colors provided
|*| by the control are a subset of the X11 colorset, and
|*| are the ones available in (and the color names
|*| recognized by) Internet Explorer.
|*|
|*| The ComboBox that is subclassed must have the
|*| Owner Draw Fixed and Has Strings styles.
|*|
|*| This is based on code that was originally found on
|*| CodeGuru, and was ?1997 Baldvin Hansson.
|*|
|*| A bug fix by Marcel Galem was added to provide
|*| correct masking of the COLORREF values.
|*|
|*| DDX routines were provided by Paul Wardle
|*| ([email protected])
|*|
|*| This Code May Be Freely Incorporated Into
|*| Projects Of Any Type Subject To The Following
|*| Conditions:
|*|
|*| o This Header Must Remain In This File, And Any
|*| Files Derived From It
|*| o Do Not Misrepresent The Origin Of Any Parts Of
|*| This Code (IOW, Do Not Claim You Wrote It)
|*|
|*| A "Mention In The Credits", Or Similar Acknowledgement,
|*| Is *NOT* Required. It Would Be Nice, Though! :)
|*|
\*|*/
#pragma warning (disable : 4127) // conditional expression is constant
#include "stdafx.h"
#include "ColorPickerCB.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//
// Uncomment This To Help Debugging The Color Values...
//
//#define _INCLUDE_COLOR_INFO
//
// Load/Create Standard Colors...
//
SColorAndName CColorPickerCB::ms_pColors[] =
{
//
// Standard IE Colors (Subset Of X11 Colorset)...
//
SColorAndName( RGB( 0xF0, 0xF8, 0xFF ), _T( "AliceBlue" ) ),
SColorAndName( RGB( 0xFA, 0xEB, 0xD7 ), _T( "AntiqueWhite" ) ),
SColorAndName( RGB( 0x00, 0xFF, 0xFF ), _T( "Aqua" ) ),
SColorAndName( RGB( 0x7F, 0xFF, 0xD4 ), _T( "Aquamarine" ) ),
SColorAndName( RGB( 0xF0, 0xFF, 0xFF ), _T( "Azure" ) ),
SColorAndName( RGB( 0xF5, 0xF5, 0xDC ), _T( "Beige" ) ),
SColorAndName( RGB( 0xFF, 0xE4, 0xC4 ), _T( "Bisque" ) ),
SColorAndName( RGB( 0x00, 0x00, 0x00 ), _T( "Black" ) ),
SColorAndName( RGB( 0xFF, 0xEB, 0xCD ), _T( "BlanchedAlmond" ) ),
SColorAndName( RGB( 0x00, 0x00, 0xFF ), _T( "Blue" ) ),
SColorAndName( RGB( 0x8A, 0x2B, 0xE2 ), _T( "BlueViolet" ) ),
SColorAndName( RGB( 0xA5, 0x2A, 0x2A ), _T( "Brown" ) ),
SColorAndName( RGB( 0xDE, 0xB8, 0x87 ), _T( "BurlyWood" ) ),
SColorAndName( RGB( 0x5F, 0x9E, 0xA0 ), _T( "CadetBlue" ) ),
SColorAndName( RGB( 0x7F, 0xFF, 0x00 ), _T( "Chartreuse" ) ),
SColorAndName( RGB( 0xD2, 0x69, 0x1E ), _T( "Chocolate" ) ),
SColorAndName( RGB( 0xFF, 0x7F, 0x50 ), _T( "Coral" ) ),
SColorAndName( RGB( 0x64, 0x95, 0xED ), _T( "CornflowerBlue" ) ),
SColorAndName( RGB( 0xFF, 0xF8, 0xDC ), _T( "Cornsilk" ) ),
SColorAndName( RGB( 0xDC, 0x14, 0x3C ), _T( "Crimson" ) ),
SColorAndName( RGB( 0x00, 0xFF, 0xFF ), _T( "Cyan" ) ),
SColorAndName( RGB( 0x00, 0x00, 0x8B ), _T( "DarkBlue" ) ),
SColorAndName( RGB( 0x00, 0x8B, 0x8B ), _T( "DarkCyan" ) ),
SColorAndName( RGB( 0xB8, 0x86, 0x0B ), _T( "DarkGoldenrod" ) ),
SColorAndName( RGB( 0xA9, 0xA9, 0xA9 ), _T( "DarkGray" ) ),
SColorAndName( RGB( 0x00, 0x64, 0x00 ), _T( "DarkGreen" ) ),
SColorAndName( RGB( 0xBD, 0xB7, 0x6B ), _T( "DarkKhaki" ) ),
SColorAndName( RGB( 0x8B, 0x00, 0x8B ), _T( "DarkMagenta" ) ),
SColorAndName( RGB( 0x55, 0x6B, 0x2F ), _T( "DarkOliveGreen" ) ),
SColorAndName( RGB( 0xFF, 0x8C, 0x00 ), _T( "DarkOrange" ) ),
SColorAndName( RGB( 0x99, 0x32, 0xCC ), _T( "DarkOrchid" ) ),
SColorAndName( RGB( 0x8B, 0x00, 0x00 ), _T( "DarkRed" ) ),
SColorAndName( RGB( 0xE9, 0x96, 0x7A ), _T( "DarkSalmon" ) ),
SColorAndName( RGB( 0x8F, 0xBC, 0x8F ), _T( "DarkSeaGreen" ) ),
SColorAndName( RGB( 0x48, 0x3D, 0x8B ), _T( "DarkSlateBlue" ) ),
SColorAndName( RGB( 0x2F, 0x4F, 0x4F ), _T( "DarkSlateGray" ) ),
SColorAndName( RGB( 0x00, 0xCE, 0xD1 ), _T( "DarkTurquoise" ) ),
SColorAndName( RGB( 0x94, 0x00, 0xD3 ), _T( "DarkViolet" ) ),
SColorAndName( RGB( 0xFF, 0x14, 0x93 ), _T( "DeepPink" ) ),
SColorAndName( RGB( 0x00, 0xBF, 0xFF ), _T( "DeepSkyBlue" ) ),
SColorAndName( RGB( 0x69, 0x69, 0x69 ), _T( "DimGray" ) ),
SColorAndName( RGB( 0x1E, 0x90, 0xFF ), _T( "DodgerBlue" ) ) ,
SColorAndName( RGB( 0xB2, 0x22, 0x22 ), _T( "FireBrick" ) ),
SColorAndName( RGB( 0xFF, 0xFA, 0xF0 ), _T( "FloralWhite" ) ),
SColorAndName( RGB( 0x22, 0x8B, 0x22 ), _T( "ForestGreen" ) ),
SColorAndName( RGB( 0xFF, 0x00, 0xFF ), _T( "Fuchsia" ) ),
SColorAndName( RGB( 0xDC, 0xDC, 0xDC ), _T( "Gainsboro" ) ),
SColorAndName( RGB( 0xF8, 0xF8, 0xFF ), _T( "GhostWhite" ) ),
SColorAndName( RGB( 0xFF, 0xD7, 0x00 ), _T( "Gold" ) ),
SColorAndName( RGB( 0xDA, 0xA5, 0x20 ), _T( "Goldenrod" ) ),
SColorAndName( RGB( 0x80, 0x80, 0x80 ), _T( "Gray" ) ),
SColorAndName( RGB( 0x00, 0x80, 0x00 ), _T( "Green" ) ),
SColorAndName( RGB( 0xAD, 0xFF, 0x2F ), _T( "GreenYellow" ) ),
SColorAndName( RGB( 0xF0, 0xFF, 0xF0 ), _T( "Honeydew" ) ),
SColorAndName( RGB( 0xFF, 0x69, 0xB4 ), _T( "HotPink" ) ),
SColorAndName( RGB( 0xCD, 0x5C, 0x5C ), _T( "IndianRed" ) ),
SColorAndName( RGB( 0x4B, 0x00, 0x82 ), _T( "Indigo" ) ),
SColorAndName( RGB( 0xFF, 0xFF, 0xF0 ), _T( "Ivory" ) ),
SColorAndName( RGB( 0xF0, 0xE6, 0x8C ), _T( "Khaki" ) ),
SColorAndName( RGB( 0xE6, 0xE6, 0xFA ), _T( "Lavender" ) ),
SColorAndName( RGB( 0xFF, 0xF0, 0xF5 ), _T( "LavenderBlush" ) ),
SColorAndName( RGB( 0x7C, 0xFC, 0x00 ), _T( "LawnGreen" ) ),
SColorAndName( RGB( 0xFF, 0xFA, 0xCD ), _T( "LemonChiffon" ) ),
SColorAndName( RGB( 0xAD, 0xD8, 0xE6 ), _T( "LightBlue" ) ),
SColorAndName( RGB( 0xF0, 0x80, 0x80 ), _T( "LightCoral" ) ),
SColorAndName( RGB( 0xE0, 0xFF, 0xFF ), _T( "LightCyan" ) ),
SColorAndName( RGB( 0xFA, 0xFA, 0xD2 ), _T( "LightGoldenrodYellow" ) ),
SColorAndName( RGB( 0x90, 0xEE, 0x90 ), _T( "LightGreen" ) ),
SColorAndName( RGB( 0xD3, 0xD3, 0xD3 ), _T( "LightGrey" ) ),
SColorAndName( RGB( 0xFF, 0xB6, 0xC1 ), _T( "LightPink" ) ),
SColorAndName( RGB( 0xFF, 0xA0, 0x7A ), _T( "LightSalmon" ) ),
SColorAndName( RGB( 0x20, 0xB2, 0xAA ), _T( "LightSeaGreen" ) ),
SColorAndName( RGB( 0x87, 0xCE, 0xFA ), _T( "LightSkyBlue" ) ),
SColorAndName( RGB( 0x77, 0x88, 0x99 ), _T( "LightSlateGray" ) ),
SColorAndName( RGB( 0xB0, 0xC4, 0xDE ), _T( "LightSteelBlue" ) ),
SColorAndName( RGB( 0xFF, 0xFF, 0xE0 ), _T( "LightYellow" ) ),
SColorAndName( RGB( 0x00, 0xFF, 0x00 ), _T( "Lime" ) ),
SColorAndName( RGB( 0x32, 0xCD, 0x32 ), _T( "LimeGreen" ) ),
SColorAndName( RGB( 0xFA, 0xF0, 0xE6 ), _T( "Linen" ) ),
SColorAndName( RGB( 0xFF, 0x00, 0xFF ), _T( "Magenta" ) ),
SColorAndName( RGB( 0x80, 0x00, 0x00 ), _T( "Maroon" ) ),
SColorAndName( RGB( 0x66, 0xCD, 0xAA ), _T( "MediumAquamarine" ) ),
SColorAndName( RGB( 0x00, 0x00, 0xCD ), _T( "MediumBlue" ) ),
SColorAndName( RGB( 0xBA, 0x55, 0xD3 ), _T( "MediumOrchid" ) ),
SColorAndName( RGB( 0x93, 0x70, 0xDB ), _T( "MediumPurple" ) ),
SColorAndName( RGB( 0x3C, 0xB3, 0x71 ), _T( "MediumSeaGreen" ) ),
SColorAndName( RGB( 0x7B, 0x68, 0xEE ), _T( "MediumSlateBlue" ) ),
SColorAndName( RGB( 0x00, 0xFA, 0x9A ), _T( "MediumSpringGreen" ) ),
SColorAndName( RGB( 0x48, 0xD1, 0xCC ), _T( "MediumTurquoise" ) ),
SColorAndName( RGB( 0xC7, 0x15, 0x85 ), _T( "MediumVioletRed" ) ),
SColorAndName( RGB( 0x19, 0x19, 0x70 ), _T
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
MFC Windows 程序设计之取色下拉框,适合初学MFC的小伙伴学习研究,博客中有对应的讲解和演示,避免走弯路,费时费力。也真心希望能够帮助正在苦学MFC Windows 程序设计的小伙伴们,你们的成长是我最大的幸福。
资源推荐
资源详情
资源评论
收起资源包目录
AColourPickerCB_demo.zip (45个子文件)
ColourPickerCB_demo
.vs
CPCBTEST
v15
Browse.VC.db 65.66MB
.suo 36KB
ipch
9987d7a2724e3bda.ipch 91.94MB
ColorPickerCB.cpp 22KB
CPCBTEST.cpp 2KB
Release
CPCBTEST.exe 28KB
CPCBTEST.sln 1KB
CPCBTEST.dsw 539B
CPCBTESTDlg.cpp 5KB
CPCBTEST.vcxproj.filters 2KB
CPCBTEST.dsp 4KB
CPCBTEST.vcxproj 8KB
CPCBTEST.vcxproj.user 165B
StdAfx.cpp 210B
resource.h 824B
CPCBTESTDlg.h 1KB
StdAfx.h 999B
Res
CPCBTEST.rc2 400B
CPCBTEST.ico 1KB
Backup
UpgradeLog.htm 33KB
Debug
StdAfx.obj 820KB
CPCBTEST.res 3KB
CPCBTEST.log 3KB
CPCBTEST.pch 34.63MB
CPCBTEST.pdb 5.49MB
ColorPickerCB.obj 67KB
CPCBTEST.ilk 1.5MB
CPCBTEST.tlog
CL.write.1.tlog 3KB
CL.read.1.tlog 52KB
rc.write.1.tlog 290B
rc.read.1.tlog 3KB
CL.command.1.tlog 4KB
CPCBTEST.lastbuildstate 229B
link.write.1.tlog 1KB
link.command.1.tlog 2KB
rc.command.1.tlog 460B
link.read.1.tlog 7KB
vc141.idb 1.45MB
CPCBTEST.obj 24KB
CPCBTEST.exe 150KB
vc141.pdb 3.94MB
CPCBTESTDlg.obj 46KB
CPCBTEST.h 1KB
CPCBTEST.rc 6KB
ColorPickerCB.h 5KB
共 45 条
- 1
资源评论
五一编程
- 粉丝: 1w+
- 资源: 882
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功