- 积分
- 23668
- 明经币
- 个
- 注册时间
- 2011-2-21
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2014-7-6 07:43:34
|
显示全部楼层
风树 发表于 2014-7-5 23:21
没用过该类,按理来说,那两个应该更好实现的,基类的基本操作吧,
只是感觉是这样,
这是CAcuiTrueColorCombobox的声明文件
#define ACUI_TRUECOLOR_COMBOBOX_TABLE_SIZE ACUI_MAX_TRUECOLOR_COMBOBOX_MRU + 9
class ACUI_PORT CAcUiTrueColorComboBox : public CAcUiMRUComboBox {
public:
enum ColorTableIndex {
kCargoOption1 = 0, // index of byLayer
kCargoOption2 = 1, // index of byBlock
kCargoStockItem1 = 2, // index of Red
kCargoStockItem2 = 3, // index of Yellow
kCargoStockItem3 = 4, // index of Green
kCargoStockItem4 = 5, // index of Cyan
kCargoStockItem5 = 6, // index of Blue
kCargoStockItem6 = 7, // index of Magenta
kCargoStockItem7 = 8, // index of White
kIndexOfFirstMRUItem = 9, // default newt table index
kCargoOther1 = -1, // place holder for select color dialog
kCargoOther2 = -2, // place holder for windows dialog
kLastIndex = ACUI_TRUECOLOR_COMBOBOX_TABLE_SIZE-1 // last index in table
};
CAcUiTrueColorComboBox ();
virtual ~CAcUiTrueColorComboBox ();
// MRU List
void AddItems ();
int AddItemToList (LPCTSTR name, int index, INT_PTR cargo);
int AddItemToMRU (LPCTSTR name, int cargo); // INTERNAL USE ONLY - Override to sort correctly
int AddColorToMRU (const AcCmColor& color);
// Drop down list
int FindItemByColor (const AcCmColor& color);
void GetCurrentItemColor (AcCmColor& color);
DWORD getColorByCargo (int cargo);
// Members
const AcCmColor& GetBlockColor ();
void SetBlockColor (const AcCmColor& color);
virtual COLORREF GetColorFromIndex (int colorIndex);
DWORD getColorData (AcCmColor color);
int GetColorIndex (COLORREF color);
void SetSupportColorBook (BOOL newVal);
BOOL GetSupportColorBook ();
protected:
// Color Control
int m_cargoOther1;
int m_cargoOther2;
AcCmColor m_blockColor;
virtual void DrawItemImage (CDC& dc, CRect& r, INT_PTR cargo);
virtual void OnAddItems ();
// Color Pickers
virtual BOOL OnSelectOther (BOOL isOther2,int curSel,int& newSel);
BOOL GetOtherColor (AcCmColor& defaultColor,
const AcCmColor& layerColor,
BOOL enableMetaColors);
BOOL GetWindowsColor (AcCmColor& color);
virtual BOOL GetOtherName (BOOL isOther2, CString& name);
// AcCmColor Table
AcCmColor * m_AcCmColorTable[ACUI_TRUECOLOR_COMBOBOX_TABLE_SIZE];
int m_nextAcCmColorTableIndex;
void initAcCmColorTable (void);
// Color Utilities
void RGBFill (CDC& dc, CRect& rFill);
bool GetCurrentLayerColor (AcCmColor& color);
virtual COLORREF LookupColor (int colorIndex, LOGPALETTE *logPalette);
afx_msg void OnDrawItem (int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
// ClassWizard-controlled
public:
//{{AFX_VIRTUAL(CAcUiTrueColorComboBox)
//}}AFX_VIRTUAL
protected:
//{{AFX_MSG(CAcUiTrueColorComboBox)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
enum ColorTableIndex 声明有13项,直接引用只显示前9项,其它4项不知如何显示? |
|