Extended Tree Control class

COXTreeCtrl
 
Description:

This class is a extension of a tree control
It has the following features:
•	multicolumn support
•	multiple selections
•	entry row selection mode
•	bitmap support for each column
•	editable subitems
•	hide/unhide items
•	disable items
•	veritcal and horizontal grid lines
•	set font for individual item/subitem
•	set color for individual item/subitem
•	additional edit modes like for any item/subitem:
	= dropdown combobox
	= date picker (see COXCalendar control)

COXTreeCtrl is derived from CListCtrl not from CTreeCtrl. That means that if you  want to use dialog editor to create resource for your CDialog or CFormView  derived class you have to use CListCtrl with "Report" and  "OwnerDraw Fixed" style set. It also means that CListCtrl emulates CTreeCtrl  functionality although not to full extent (see function reference for details).  COXTreeCtrl lets you operate with standard structures and types that have  to do with CTreeCtrl, but you still can use CListCtrl stuff to work with control (it could be useful feature if you really need to do some fancy stuff with COXTreeCtrl). 
 
Taking into account all mentioned above, this is not a big surprise that you have to use special technique to utilize COXTreeCtrl control. And all in all you possibly cannot do that just changing the name of class from CTreeCtrl to COXTreeCtrl. Below you will find description of common steps that you have to take to implement COXTreeCtrl in your application :

COXTreeCtrl with Dialog Resource

If you want to use it in a dialog or FormView and you are using dialog resource, then the best way is to create a list control , set up "Report" style and "OwnerDraw Fixed" style in resource editor and map it to COXTreeCtrl member variable (using subclassing or ClassWizard and DDX/DDV technique)

Initializing and populating of COXTreeCtrl
	
As soon as control is created you can populate it with columns, items and set different styles to make it look the way you want. You can insert and delete columns, items and subitems at any time after control's creation.

COXTreeCtrl styles

You can set different style to COXTreeCtrl control to get the functionality you need. This control supports next standard styles:
TVS_SHOWSELALWAYS
TVS_EDITLABELS
TVS_SHOWSELALWAYS
TVS_EDITLABELS

Also we introduce extended styles:

TVOXS_MULTISEL	multiple selection
TVOXS_COLUMNHDR	column header
TVOXS_ROWSEL	row selection mode
TVOXS_HGRID		horizontal grid
TVOXS_VGRID		vertical grid
TVOXS_FLGRID		full length grid lines
TVOXS_PICKANYWHERE	select tree control item clicking anywhere within grid of control
 
Of course, all styles can be modified at run-time