正文

Custom Draw ListView Controls(5)2009-01-20 11:46:00

【评论】 【打印】 【字体: 】 本文链接:http://blog.pfan.cn/yuqiexing/40622.html

分享到:

protected:

 CFont* m_pOldItemFont;

 CFont* m_pOldSubItemFont;

 //

 // Callbacks for whole control

 //

 // do we want to do the drawing ourselves?

 virtual bool IsDraw() { return false; }

 // if we are doing the drawing ourselves

 // override and put the code in here

 // and return TRUE if we did indeed do

 // all the drawing ourselves

 virtual bool OnDraw(CDC* /*pDC*/, const CRect& /*r*/)

 { return false; }

 // do we want to handle custom draw for

 // individual items

 virtual bool IsNotifyItemDraw() { return false; }

 // do we want to be notified when the

 // painting has finished

 virtual bool IsNotifyPostPaint() { return false; }

 // do we want to do any drawing after

 // the list control is finished

 virtual bool IsPostDraw() { return false; }

 // if we are doing the drawing afterwards ourselves

 // override and put the code in here

 // the return value is not used here

 virtual bool OnPostDraw(CDC* /*pDC*/, const CRect& /*r*/)

 { return false; }

 //

 // Callbacks for each item

 //

 // return a pointer to the font to use for this item.

 // return NULL to use default

 virtual CFont* FontForItem(int /*nItem*/,

                            UINT /*nState*/,

                            LPARAM /*lParam*/)

 { return NULL; }

 // return the text color to use for this item

 // return CLR_DEFAULT to use default

 virtual COLORREF TextColorForItem(int /*nItem*/,

                                   UINT /*nState*/,

                                   LPARAM /*lParam*/)

 { return CLR_DEFAULT; }

 // return the background color to use for this item

 // return CLR_DEFAULT to use default

 virtual COLORREF BkColorForItem(int /*nItem*/,

                                 UINT /*nState*/,

                                 LPARAM /*lParam*/)

 { return CLR_DEFAULT; }

 // do we want to do the drawing for this item ourselves?

 virtual bool IsItemDraw(int /*nItem*/,

                         UINT /*nState*/,

                         LPARAM /*lParam*/)

 { return false; }

 // if we are doing the drawing ourselves

 // override and put the code in here

 // and return TRUE if we did indeed do

 // all the drawing ourselves

 virtual bool OnItemDraw(CDC* /*pDC*/,

                         int /*nItem*/,

                         UINT /*nState*/,

                         LPARAM /*lParam*/)

 { return false; }

阅读(1534) | 评论(1)


版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!

评论

loading...
您需要登录后才能评论,请 登录 或者 注册