Introduction
This is a class derived from CWnd
class. It's a tree control with a list.
Features
Below are some of the many features that CTreeListCtrl
has:
- Compatible with
CTreeCtrl
& CListCtrl
- Header drag & drop
- Drag & drop between
CTreeListCtrl
- Transparent drag window with Alpha blend
- Double colors of list
- Background image
- Check box support
- Lock box support
- Embedded modified controls
- No more in future
Snapshot 1
Snapshot 2
How to Use It
Add this string
into stdafx.h:
#include "..\\TurboDLL\\xTurboDll.h"
Define Your Controls
class CMyTreeListCtrl : public CTreeListCtrl
{
public:
CMyTreeListCtrl();
virtual ~CMyTreeListCtrl();
protected:
afx_msg void OnExpanding(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnExpanded(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnUpdating(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnUpdated(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDragEnter(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDragLeave(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDragOver(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDrop(NMHDR* pNMHDR, LRESULT* pResult);
DECLARE_MESSAGE_MAP()
};
Use Your Controls
class CTurboDragDlg : public CDialog
{
public:
CTurboDragDlg(CWnd* pParent = NULL);
...
CImageList m_ImageList;
CMyTreeListCtrl m_tree1;
CMyTreeListCtrl m_tree2;
...
};
CTurboDragDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_ImageList.Create( IDB_BITMAP_TREE, 16, 4, 0xFF00FF );
CRect rect;
GetClientRect(&rect);
rect.DeflateRect( 5, 5, 5, 5 );
CRect left;
left = rect;
left.right = ( rect.left + rect.right ) / 2;
CRect right;
right = rect;
right.left = ( rect.left + rect.right ) / 2;
m_tree1.Create( 0x50810000, left, this, 0 );
m_tree2.Create( 0x50810000, right, this, 1 );
...
return TRUE;
}
Then use it freely.
License
This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below.
A list of licenses authors might use can be found here.