Originally posted by: JohnCz
Paul Elliott:
You have to handle WM_DRAWITEM.
Since you have created "view" out of it, you will receive reflection from a control rather than notification message.
Use ON_WM_DRAWITEM_REFLECT macro instead OnNotify.
Sreedevi G. and YiHai:
Windows class: WC_TREEVIEW.
Just change your base class to CCtrlView.
If you want to use CTreeCtrl functionality write GetTreeCtrlEx and return (CVTreeView)this. Call all functions of CTreeView class using this pointer.
Transfer all functionality from CVTreeView to your new view class.
Originally posted by: YiHai
Hello,Tom:
Good article,but ...I have the same question like the previous two guys.Pls help me!!
yihai
ReplyOriginally posted by: Sreedevi G.
I have a class "CVStaticTreeCtrl" derived from the standard CTreeCtrl. I want a CVTreeView derived from CCtrlView corresponding to the CVStaticTreeCtrl.
What is the class name that I have to specify in the constructor of CCtrlView?
CVTreeView::CVTreeView() :
CCtrlView(??, AFX_WS_DEFAULT_VIEW) { };
How and when should I register a class name for the CVStaticTree?
Thank you in advance
ReplyOriginally posted by: Paul Elliott
I've done something very similiar for tab controls using CTabCtrl e.g.
class CTabView : public CCtrlView{
CTabCtrl& GetTabCtrl ()
//ETC
But I can't get it to work for owner draw controls e.g.
CTabCtrlEx (which allows the text on a tab label to be coloured)
Any ideas?
Does it work for owner draw control?
CTabView() :
CCtrlView (WC_TABCONTROL, AFX_WS_DEFAULT_VIEW) {}
// ETC
//ETC
const { return *(CTabCtrl*) this; }
//ETC
}