明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖
楼主: zdqwy19

这个颜色下拉框在objectarx中属于那个类

[复制链接]
 楼主| 发表于 2014-7-6 07:43 | 显示全部楼层
风树 发表于 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项不知如何显示?
发表于 2014-7-6 08:41 | 显示全部楼层

看看CAcUiMRUComboBox和她的基类的声明,找找看,
直接调用基类的插入函数?
 楼主| 发表于 2014-7-6 18:05 | 显示全部楼层
风树 发表于 2014-7-6 08:41
看看CAcUiMRUComboBox和她的基类的声明,找找看,
直接调用基类的插入函数?

谷歌又封了,不然还可以找找,百度上的东西太少了
发表于 2014-7-6 18:11 | 显示全部楼层
试试把网址后续从hk改成tw看看
 楼主| 发表于 2014-7-7 08:38 | 显示全部楼层
这篇文章ObjectARX & Dummies: Lab 2 - Using a MFC dialog谁有?
发表于 2014-8-15 05:07 | 显示全部楼层
可以看下支持MFC的
回复 支持 0 反对 1

使用道具 举报

 楼主| 发表于 2015-6-19 20:26 | 显示全部楼层
现在有知道这个怎么实现的?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-3-28 21:23 , Processed in 0.195039 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表