zdqwy19 发表于 2014-7-6 07:43:34

风树 发表于 2014-7-5 23:21 static/image/common/back.gif
没用过该类,按理来说,那两个应该更好实现的,基类的基本操作吧,
只是感觉是这样,

这是CAcuiTrueColorCombobox的声明文件
#define ACUI_TRUECOLOR_COMBOBOX_TABLE_SIZEACUI_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;
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项不知如何显示?

风树 发表于 2014-7-6 08:41:55


看看CAcUiMRUComboBox和她的基类的声明,找找看,
直接调用基类的插入函数?

zdqwy19 发表于 2014-7-6 18:05:39

风树 发表于 2014-7-6 08:41 static/image/common/back.gif
看看CAcUiMRUComboBox和她的基类的声明,找找看,
直接调用基类的插入函数?

谷歌又封了,不然还可以找找,百度上的东西太少了

风树 发表于 2014-7-6 18:11:18

试试把网址后续从hk改成tw看看

zdqwy19 发表于 2014-7-7 08:38:24

这篇文章ObjectARX & Dummies: Lab 2 - Using a MFC dialog谁有?

swjtu_csdn2 发表于 2014-8-15 05:07:22

可以看下支持MFC的

zdqwy19 发表于 2015-6-19 20:26:27

现在有知道这个怎么实现的?
页: 1 [2]
查看完整版本: 这个颜色下拉框在objectarx中属于那个类