CTreeOptionsCtrl v1.74

Welcome to CTreeOptionsCtrl, a control which implements a tree options control similar to the advanced tab as seen on the "Internet Options" dialog in Internet Explorer 4 and later. In addition to Boolean values, it also allows edit boxes, combo boxes, file browser, folder browsers, color browsers, font browsers, font name combo boxes, general opaque objects, date controls, time controls and IP address controls to be included in the tree control, similar to the new printer property dialogs which were introduced in Windows 2000. Included below is a snapshot showing the demo application and what the control looks like.

 

 

Features
Copyright
Usage
History
API Reference
Planned Enhancements
Contacting the Author

 

 

 

Features

 

 

Copyright

 

 

 

Usage

 

 

 

History

V1.0 (2 April 1999)

V1.01 (20 April 1999)

V1.1 (21 April 1999)

V1.11 (5 October 1999)

V1.2 (8 October 1999)

V1.21 (29 February 2000)

V1.22 (3 April 2000)

V1.23 (10 May 2000)

V1.24 (30 May 2000)

V1.25 (3 July 2000)

V1.26 (25 April 2001)

V1.30 (12 August 2001)

V1.31 (27 August 2001)

V1.4 (17 October 2001)

V1.41 (27 November 2001)

V1.42 (5 December 2001)

V1.43 (13 December 2001)

V1.44 (14 February 2002)

V1.45 (2 June 2002)

V1.46 (24 September 2002)

V1.47 (17 October 2002)

V1.48 (25 October 2002)

V1.49 (28 October 2002)

V1.50 (30 October 2002)

V1.51 (15 November 2002)

V1.52 (6 February 2003)

V1.53 (14 May 2003)

V1.54 (7 June 2003)

V1.55 (17 July 2003)

V1.56 (26 July 2003)

V1.6 (31 July 2003)

V1.61 (2 August 2003)

V1.62 (18 September 2003)

20 September 2003

V1.63 (11 December 2003)

V1.64 (5 February 2004)

V1.65 (5 May 2004)

V1.66 (26 January 2005)

V1.67 (16 March 2005)

V1.68 (11 July 2006)

V1.69 (23 December 2007)

V1.70 (21 June 2008)

V1.71 (20 July 2008)

V1.72 (29 April 2012)

V1.73 (21 May 2012)

V1.74 (16 March 2015)

 

 

 

API Reference

The API consists of the following class members and global functions

CTreeOptionsCtrl::InsertGroup
CTreeOptionsCtrl::InsertCheckBox
CTreeOptionsCtrl::InsertRadioButton
CTreeOptionsCtrl::IsGroup
CTreeOptionsCtrl::IsCheckBox
CTreeOptionsCtrl::IsEditBox
CTreeOptionsCtrl::IsFileItem
CTreeOptionsCtrl::IsFolderItem
CTreeOptionsCtrl::IsColorItem
CTreeOptionsCtrl::IsFontItem
CTreeOptionsCtrl::IsRadioButton
CTreeOptionsCtrl::SetCheckBox
CTreeOptionsCtrl::GetCheckBox
CTreeOptionsCtrl::GetRadioButton
CTreeOptionsCtrl::SetRadioButton
CTreeOptionsCtrl::SetGroupEnable
CTreeOptionsCtrl::SetCheckBoxEnable
CTreeOptionsCtrl::SetRadioButtonEnable
CTreeOptionsCtrl::GetRadioButtonEnable
CTreeOptionsCtrl::GetCheckBoxEnable
CTreeOptionsCtrl::AddComboBox
CTreeOptionsCtrl::AddEditBox
CTreeOptionsCtrl::AddFileEditBox
CTreeOptionsCtrl::AddFolderEditBox
CTreeOptionsCtrl::GetComboText
CTreeOptionsCtrl::GetEditText
CTreeOptionsCtrl::GetFileEditText
CTreeOptionsCtrl::GetFolderEditText
CTreeOptionsCtrl::SetComboText
CTreeOptionsCtrl::SetEditText
CTreeOptionsCtrl::SetFileEditText
CTreeOptionsCtrl::SetFolderEditText
CTreeOptionsCtrl::AddColorSelector
CTreeOptionsCtrl::GetColor
CTreeOptionsCtrl::SetColor
CTreeOptionsCtrl::AddFontSelector
CTreeOptionsCtrl::GetFontItem
CTreeOptionsCtrl::SetFontItem
CTreeOptionsCtrl::AddOpaque
CTreeOptionsCtrl::SetOpaque
CTreeOptionsCtrl::IsOpaque
DDX_TreeCheck
DDX_TreeRadio
DDX_TreeEdit
DDX_TreeCombo
DDX_TreeFileEdit
DDX_TreeFolderEdit
DDX_TreeColor
DDX_TreeFont
DDX_TreeBoolean

 

CTreeOptionsCtrl::InsertGroup

HTREEITEM InsertGroup(LPCTSTR lpszItem, int nImage, HTREEITEM hParent = TVI_ROOT,  HTREEITEM hAfter = TVI_LAST, DWORD_PTR dwItemData = 0);

Return Value

The group item's tree identifier.

Parameters

lpszItem The text of the item to add.

nImage The zero based index of the icon in the tree controls image list to use for this group item.

hParent Handle of the parent where the item should be inserted.

hAfter The item to insert this item after.

dwItemData The custom item data you want to use with this tree item. This can be used for whatever you want e.g. to maintain a pointer to a custom structure.

Remarks

Adds a group item to the tree control. A group item is the parent of either a collection of radio items or check items. In the sample app, the two items which are group items are "Accessibility (Example of check options)" and "When Searching (Example of radio options)". The first 8 icons of the image list associated with the tree options control are reserved and you should specify a "nImage" value greater than 7 when adding a group item. By default the function will add items at the root level of the tree control but you can add them at any depth using the "hParent" parameter. You can see this in the "Internet options" dialog which the control emulates.

 

CTreeOptionsCtrl::InsertCheckBox

HTREEITEM InsertCheckBox(LPCTSTR lpszItem, HTREEITEM hParent, BOOL bCheck = TRUE, HTREEITEM hAfter = TVI_LAST, DWORD_PTR dwItemData = 0);

Return Value

The check box item identifier.

Parameters

lpszItem The text of the item to add.

hParent Handle of the parent where the item should be inserted.

bCheck The initial checked state of the check box. TRUE if the item is to be checked, FALSE to leave it unchecked.

hAfter The item to insert this item after.

dwItemData The custom item data you want to use with this tree item. This can be used for what ever you want e.g. to maintain a pointer to a custom structure.

Remarks

Adds a check box item to the tree control. A check box item behaves the same as a normal check box. Using the space bar or left mouse button will toggle its state.

 

CTreeOptionsCtrl::InsertRadioButton

HTREEITEM InsertRadioButton(LPCTSTR lpszItem, HTREEITEM hParent, BOOL bCheck = TRUE, HTREEITEM hAfter = TVI_LAST, DWORD_PTR dwItemData = 0);

Return Value

The radio button item identifier.

Parameters

lpszItem The text of the item to add.

hParent Handle of the parent where the item should be inserted.

bCheck The initial checked state of the check box. TRUE if the item is to be checked, FALSE to leave it unchecked.

hAfter The item to insert this item after.

dwItemData The custom item data you want to use with this tree item. This can be used for whathever you want e.g. to maintain a pointer to a custom structure.

Remarks

Adds a radio button item to the tree control. A radio button item behaves the same as a normal radio button i.e. when a radio button is checked all the other items in the same group are unchecked. Using the space bar or left mouse button will toggle its state. The parent of the radio button item must be a group item as added with InsertGroup

 

CTreeOptionsCtrl::IsGroup

BOOL IsGroup(HTREEITEM hItem) const;

Return Value

TRUE if the specified item is a group item otherwise FALSE.

Parameters

hItem Handle of the item to check the type of.

Remarks

Checks to see if the specified item is a group item i.e. an item which is the parent of a collection of radio button or check box items.

 

CTreeOptionsCtrl::IsCheckBox

BOOL IsCheckBox(HTREEITEM hItem) const;

Return Value

TRUE if the specified item is a check box item otherwise FALSE.

Parameters

hItem Handle of the item to check the type of.

Remarks

Checks to see if the specified item is a check box item.

 

CTreeOptionsCtrl::IsEditBox

BOOL IsEditBox(HTREEITEM hItem) const;

Return Value

TRUE if the specified item is a edit box item otherwise FALSE.

Parameters

hItem Handle of the item to check the type of.

Remarks

Checks to see if the specified item is a edit box item.

 

CTreeOptionsCtrl::IsFileItem

BOOL IsFileItem(HTREEITEM hItem) const;

Return Value

TRUE if the specified item is a file browser item otherwise FALSE.

Parameters

hItem Handle of the item to check the type of.

Remarks

Checks to see if the specified item is a file browser item.

 

CTreeOptionsCtrl::IsFolderItem

BOOL IsFolderItem(HTREEITEM hItem) const;

Return Value

TRUE if the specified item is a folder browser item otherwise FALSE.

Parameters

hItem Handle of the item to check the type of.

Remarks

Checks to see if the specified item is a folder browser item.

 

CTreeOptionsCtrl::IsColorItem

BOOL IsColorItem(HTREEITEM hItem) const;

Return Value

TRUE if the specified item is a color browser item otherwise FALSE.

Parameters

hItem Handle of the item to check the type of.

Remarks

Checks to see if the specified item is a color browser item.

 

CTreeOptionsCtrl::IsFontItem

BOOL IsFontItem(HTREEITEM hItem) const;

Return Value

TRUE if the specified item is a font browser item otherwise FALSE.

Parameters

hItem Handle of the item to check the type of.

Remarks

Checks to see if the specified item is a font browser item.

 

CTreeOptionsCtrl::IsRadioButton

BOOL IsRadioButton(HTREEITEM hItem) const;

Return Value

TRUE if the specified item is a radio button item otherwise FALSE.

Parameters

hItem Handle of the item to check the type of.

Remarks

Checks to see if the specified item is a radio button item.

 

CTreeOptionsCtrl::IsOpaque

BOOL IsOpaque(HTREEITEM hItem) const;

Return Value

TRUE if the specified item is an "Opaque Browser" item otherwise FALSE.

Parameters

hItem Handle of the item to check the type of.

Remarks

Checks to see if the specified item is an "Opaque Browser" item.

 

CTreeOptionsCtrl::SetCheckBox

BOOL SetCheckBox(HTREEITEM hItem, BOOL bCheck);

Return Value

TRUE if the check state of the item was successfully changed otherwise FALSE.

Parameters

hItem Handle of the item to change the checked state of.

bCheck The state of the check box to be set. TRUE if the item is to be checked, FALSE to uncheck the item.

Remarks

Changes the checked state of a check box item.

 

CTreeOptionsCtrl::GetCheckBox

BOOL GetCheckBox(HTREEITEM hItem, BOOL& bCheck) const;

Return Value

TRUE if the check state of the item was successfully retrieved otherwise FALSE.

Parameters

hItem Handle of the item to retrieve the checked state of.

bCheck Upon successful return, this will contain the state of the check box. TRUE if the item is checked, FALSE if unchecked.

Remarks

Retrieves the checked state of a check box item.

 

CTreeOptionsCtrl::SetRadioButton

BOOL SetRadioButton(HTREEITEM hParent, int nIndex);

BOOL SetRadioButton(HTREEITEM hItem);

Return Value

TRUE if the check state of the specified radio button in the specified group was successfully set otherwise FALSE.

Parameters

hParent Handle of the parent group item which contains the radio button items.

nIndex The index of the radio button in the group to select.

hItem The item in the radio button group to check.

Remarks

Changes the checked state of the specified item in the specified radio button group. The item specified by the value "nIndex" or "hItem" is checked and all the other items in the group are unchecked.

 

CTreeOptionsCtrl::GetRadioButton

BOOL GetRadioButton(HTREEITEM hParent, int& nIndex, HTREEITEM& hCheckItem) const;

BOOL GetRadioButton(HTREEITEM hItem, BOOL& bCheck) const;

Return Value

TRUE if the check state was successfully retrieved otherwise FALSE.

Parameters

hParent Handle of the parent group item which contains the radio button items.

nIndex Upon successful return, this will contain the index of the radio button in the group which is checked.

hCheckItem Upon successful return, this will contain the handle of the radio button item which is checked.

hItem Handle of the radio button item to check the state of.

bCheck Upon successful return, this will contain the state of the radio button. TRUE if the item is checked, FALSE if unchecked.

Remarks

Retrieves the checked state of a radio button item.

 

CTreeOptionsCtrl::SetGroupEnable

BOOL SetGroupEnable(HTREEITEM hItem, BOOL bEnable);

Return Value

TRUE if the check state of the items in the group were successfully enabled / disabled.

Parameters

hItem Handle of the group item to enable or disable.

bEnable TRUE if the items should be enabled, FALSE to disable the items.

Remarks

Enables or disables all the items under a group item.

 

CTreeOptionsCtrl::SetCheckBoxEnable

BOOL SetCheckBoxEnable(HTREEITEM hItem, BOOL bEnable);

Return Value

TRUE if the check state of the check box item was successfully enabled / disabled.

Parameters

hItem Handle of the check box item to enable or disable.

bEnable TRUE if the item should be enabled, FALSE to disable the item.

Remarks

Enables or disables the specified check box item.

 

CTreeOptionsCtrl::SetRadioButtonEnable

BOOL SetRadioButtonEnable(HTREEITEM hItem, BOOL bEnable);

Return Value

TRUE if the check state of the radio button item was successfully enabled / disabled.

Parameters

hItem Handle of the radio button item to enable or disable.

bEnable TRUE if the item should be enabled, FALSE to disable the item.

Remarks

Enables or disables the specified radio button item.

 

CTreeOptionsCtrl::GetRadioButtonEnable

BOOL GetRadioButtonEnable(HTREEITEM hItem, BOOL& bEnable) const;

Return Value

TRUE if the enabled state of the item was successfully retrieved otherwise FALSE.

Parameters

hItem Handle of the item to retrieve the enabled state of.

bCheck Upon successful return, this will contain the enabled state of the radio button. TRUE if the item is enabled, FALSE if disabled.

Remarks

Retrieves the enabled state of a radio button item.

 

CTreeOptionsCtrl::GetCheckBoxButtonEnable

BOOL GetCheckBoxEnable(HTREEITEM hItem, BOOL& bEnable) const;

Return Value

TRUE if the enabled state of the item was successfully retrieved otherwise FALSE.

Parameters

hItem Handle of the item to retrieve the enabled state of.

bCheck Upon successful return, this will contain the enabled state of the check box. TRUE if the item is enabled, FALSE if disabled.

Remarks

Retrieves the enabled state of a check box item.

 

CTreeOptionsCtrl::AddComboBox

BOOL AddComboBox(HTREEITEM hItem, CRuntimeClass* pRuntimeClass, DWORD_PTR dwItemData = 0);

Return Value

TRUE if the combo box item was successfully added otherwise FALSE.

Parameters

hItem Handle of the item to add the combo box at.

pRuntimeClass The runtime class pointer on a class derived from "CTreeOptionsCombo" which is to be added to the tree options control.

dwItemData The custom item data you want to use with this tree item. This can be used for whatever you want e.g. to maintain a pointer to a custom structure.

Remarks

Adds a combo box item to the tree control. The combo box by default provides a choice of multiple strings from which to pick. You are free to derive your own class from "CTreeOptionsCombo" to implement customized behavior

 

CTreeOptionsCtrl::AddEditBox

BOOL AddEditBox(HTREEITEM hItem, CRuntimeClass* pRuntimeClassEditCtrl, DWORD_PTR dwItemData = 0);

BOOL AddEditBox(HTREEITEM hItem, CRuntimeClass* pRuntimeClassEditCtrl, CRuntimeClass* pRuntimeClassSpinCtrl, DWORD_PTR dwItemData = 0);

Return Value

TRUE if the edit box item was successfully added otherwise FALSE.

Parameters

hItem Handle of the item to add the edit box at.

pRuntimeClassEditCtrl The runtime class pointer on a class derived from "CTreeOptionsEdit" which is to be added to the tree options control.

pRuntimeClassSpinCtrl The runtime class pointer on a class derived from "CTreeOptionsSpinCtrl" which is to be attached to the edit box to allow the edit box value to be changed using a standard spin control.

dwItemData The custom item data you want to use with this tree item. This can be used for whathever you want e.g. to maintain a pointer to a custom structure.

Remarks

Adds a edit box item to the tree control. The edit box by default allows any text to be set. You are free to derive your own class from "CTreeOptionsEdit" to implement customized behavior. You can use the second version of the function to add an edit box along with a standard spin control with it.

 

CTreeOptionsCtrl::AddFileEditBox

BOOL AddFileEditBox(HTREEITEM hItem, CRuntimeClass* pRuntimeClassEditCtrl, CRuntimeClass* pRuntimeClassBrowseButton, DWORD_PTR dwItemData = 0);

Return Value

TRUE if the edit box item was successfully added otherwise FALSE.

Parameters

hItem Handle of the item to add the File Browser edit box at.

pRuntimeClassEditCtrl The runtime class pointer on a class derived from "CTreeOptionsEdit" which is to be added to the tree options control.

pRuntimeClassBrowseButton The runtime class pointer on a class derived from "CTreeOptionsBrowseButton" which is to be attached to the edit box to allow the edit box value to be changed using a standard file dialog control.

dwItemData The custom item data you want to use with this tree item. This can be used for whathever you want e.g. to maintain a pointer to a custom structure.

Remarks

Adds a File Browser edit box item to the tree control. The edit box by default allows any text to be set. You are free to derive your own class from "CTreeOptionsEdit" to implement customized behavior.

 

CTreeOptionsCtrl::AddFolderEditBox

BOOL AddFolderEditBox(HTREEITEM hItem, CRuntimeClass* pRuntimeClassEditCtrl, CRuntimeClass* pRuntimeClassBrowseButton, DWORD_PTR dwItemData = 0);

Return Value

TRUE if the edit box item was successfully added otherwise FALSE.

Parameters

hItem Handle of the item to add the Folder Browser edit box at.

pRuntimeClassEditCtrl The runtime class pointer on a class derived from "CTreeOptionsEdit" which is to be added to the tree options control.

pRuntimeClassBrowseButton The runtime class pointer on a class derived from "CTreeOptionsBrowseButton" which is to be attached to the edit box to allow the edit box value to be changed using a standard folder selection dialog control.

dwItemData The custom item data you want to use with this tree item. This can be used for whathever you want e.g. to maintain a pointer to a custom structure.

Remarks

Adds a Folder Browser edit box item to the tree control. The edit box by default allows any text to be set. You are free to derive your own class from "CTreeOptionsEdit" to implement customized behavior.

 

CTreeOptionsCtrl::GetComboText

CString GetComboText(HTREEITEM hItem) const;

Return Value

The text associated with this combo box item.

Parameters

hItem Handle of the item to retrieve the combo box text of.

Remarks

Retrieves the combo text of a combo box item.

 

CTreeOptionsCtrl::GetEditText

CString GetEditText(HTREEITEM hItem) const;

Return Value

The text associated with this edit box item.

Parameters

hItem Handle of the item to retrieve the edit box text of.

Remarks

Retrieves the edit box text of a edit box item.

 

CTreeOptionsCtrl::GetFileEditText

CString GetEditText(HTREEITEM hItem) const;

Return Value

The text associated with this edit box item.

Parameters

hItem Handle of the item to retrieve the edit box text of.

Remarks

Retrieves the edit box text of a File Browser edit box item.

 

CTreeOptionsCtrl::GetFolderEditText

CString GetEditText(HTREEITEM hItem) const;

Return Value

The text associated with this edit box item.

Parameters

hItem Handle of the item to retrieve the edit box text of.

Remarks

Retrieves the edit box text of a Folder Browser edit box item.

 

CTreeOptionsCtrl::SetComboText

void SetComboText(HTREEITEM hItem, const CString& sComboText);

Parameters

hItem Handle of the item to change the combo box text of.

sComboText The text to set in the combo box.

Remarks

Changes the combo box text of a combo box item.

 

CTreeOptionsCtrl::SetEditText

void SetEditText(HTREEITEM hItem, const CString& sEditText);

Parameters

hItem Handle of the item to change the edit box text of.

sEditText The text to set in the edit box.

Remarks

Changes the edit box text of a edit box item.

 

CTreeOptionsCtrl::SetFileEditText

void SetFileText(HTREEITEM hItem, const CString& sEditText);

Parameters

hItem Handle of the item to change the edit box text of.

sEditText The text to set in the edit box.

Remarks

Changes the edit box text of a File Browser edit box item.

 

CTreeOptionsCtrl::SetFolderEditText

void SetFolderText(HTREEITEM hItem, const CString& sEditText);

Parameters

hItem Handle of the item to change the edit box text of.

sEditText The text to set in the edit box.

Remarks

Changes the edit box text of a Folder Browser edit box item.

 

CTreeOptionsCtrl::AddColorSelector

BOOL AddColorSelector(HTREEITEM hItem, CRuntimeClass* pRuntimeClassButton, DWORD_PTR dwItemData = 0);

Return Value

TRUE if the color browser item was successfully added otherwise FALSE.

Parameters

hItem Handle of the item to add the color browser at.

pRuntimeClassButton The runtime class pointer on a class derived from "CTreeOptionsBrowseButton" which is to be added to the tree options control.

dwItemData The custom item data you want to use with this tree item. This can be used for whathever you want e.g. to maintain a pointer to a custom structure.

Remarks

Adds a Color Browser item to the tree control. The color browser displays a standard CColorDialog when you hit the browse button. You are free to derive your own class from "CTreeOptionsBrowseButton" to implement customized behavior.

 

CTreeOptionsCtrl::GetColor

COLORREF GetColor(HTREEITEM hItem) const;

Return Value

The COLORREF value associated with this color browser item.

Parameters

hItem Handle of the item to retrieve the COLORREF of.

Remarks

Retrieves the color of a color browser item.

 

CTreeOptionsCtrl::SetColor

void SetColor(HTREEITEM hItem, COLORREF color);

Parameters

hItem Handle of the item to change the color of.

color The color to set in the color browser item.

Remarks

Changes the edit box text of a edit box item.

 

CTreeOptionsCtrl::AddFontSelector

BOOL AddFontSelector(HTREEITEM hItem, CRuntimeClass* pRuntimeClassButton, DWORD_PTR dwItemData = 0);

Return Value

TRUE if the font browser item was successfully added otherwise FALSE.

Parameters

hItem Handle of the item to add the color browser at.

pRuntimeClassButton The runtime class pointer on a class derived from "CTreeOptionsBrowseButton" which is to be added to the tree options control.

dwItemData The custom item data you want to use with this tree item. This can be used for whathever you want e.g. to maintain a pointer to a custom structure.

Remarks

Adds a font browser item to the tree control. The font browser displays a standard CFontDialog when you hit the browse button. You are free to derive your own class from "CTreeOptionsBrowseButton" to implement customized behavior.

 

CTreeOptionsCtrl::GetFontItem

void GetFontItem(HTREEITEM hItem, LOGFONT* pLogFont) const;

Parameters

hItem Handle of the item to retrieve the COLORREF of.

pLogFont Upon return this will contain the update LOGFONT structure.

Remarks

Retrieves the font characteristics of a font browser item.

 

CTreeOptionsCtrl::SetFontItem

void SetFontItem(HTREEITEM hItem, const LOGFONT* pLogFont);

Parameters

hItem Handle of the item to change the color of.

pLogFont pointer to the LOGFONT structure to set in the font browser item.

Remarks

Changes the edit font characteristics of a font browser item.

 

CTreeOptionsCtrl::AddOpaque

BOOL AddOpaque(HTREEITEM hItem, CRuntimeClass* pRuntimeClass1, CRuntimeClass* pRuntimeClass2, DWORD_PTR dwItemData = 0);

Return Value

TRUE if the opaque browser was successfully added otherwise FALSE.

Parameters

hItem Handle of the item to add the File Browser edit box at.

pRuntimeClass1 The runtime class pointer on a first class control for this item.

pRuntimeClass2 The runtime class pointer on the second class control for this item.

dwItemData The custom item data you want to use with this tree item. This can be used for whathever you want e.g. to maintain a pointer to a custom structure.

Remarks

Adds an "Opaque Browser" to the tree control. An Opaque Browser is where the tree options control allows a end user specified structure to be edited by the tree options control without it explicitly knowing what it is editing. 

 

CTreeOptionsCtrl::SetOpaque

void SetOpaque(HTREEITEM hItem, DWORD_PTR dwItemData);

Parameters

hItem Handle of the item to change the color of.

dwItemData The item data to set in the "Opaque Browser" item.

Remarks

Changes the item data of an "Opaque Browser" item.

 

void DDX_TreeCheck(CDataExchange* pDX, int nIDC, HTREEITEM hItem, BOOL& bCheck);

Parameters

pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.

nIDC The resource ID of the tree control associated with the control property.

hItem Handle of the check box item to get/set the state of.

bCheck A reference to a member variable of the dialog box, form view, or control view object with which data is exchanged.

Remarks

The DDX_TreeCheck function manages the transfer of BOOL data between a check box item in the CTreeOptionsCtrl in a dialog box, form view, or control view object and a BOOL data member of the dialog box, form view, or control view object.

 

void DDX_TreeRadio(CDataExchange* pDX, int nIDC, HTREEITEM hParent, int& nIndex);

Parameters

pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.

nIDC The resource ID of the tree control associated with the control property.

hParent Handle of the parent group item which contains the radio button items.

nIndex A reference to a member variable of the dialog box, form view, or control view object with which data is exchanged.

Remarks

The DDX_TreeRadio function manages the transfer of int data between a radio button group in the CTreeOptionsCtrl in a dialog box, form view, or control view object and an int data member of the dialog box, form view, or control view object.

 

void DDX_TreeEdit(CDataExchange* pDX, int nIDC, HTREEITEM hItem, CString& sText);

void DDX_TreeEdit(CDataExchange* pDX, int nIDC, HTREEITEM hItem, int& nValue);

Parameters

pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.

nIDC The resource ID of the tree control associated with the control property.

hParent Handle of the parent group item which contains the radio button items.

sText A reference to a CString which is the text to display or retrieve from the tree options control.

Remarks

The DDX_TreeEdit function manages the transfer of CString or integer data between a edit box in the CTreeOptionsCtrl in a dialog box, form view, or control view object and a CString or integer value.

 

void DDX_TreeCombo(CDataExchange* pDX, int nIDC, HTREEITEM hItem, CString& sText);

Parameters

pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.

nIDC The resource ID of the tree control associated with the control property.

hParent Handle of the parent group item which contains the radio button items.

sText A reference to a CString which is the text to display or retrieve from the tree options control.

Remarks

The DDX_TreeCombo function manages the transfer of CString data between a combo box in the CTreeOptionsCtrl in a dialog box, form view, or control view object and a CString data member.

 

void DDX_TreeFileEdit(CDataExchange* pDX, int nIDC, HTREEITEM hItem, CString& sText);

Parameters

pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.

nIDC The resource ID of the tree control associated with the control property.

hParent Handle of the parent group item which contains the radio button items.

sText A reference to a CString which is the text to display or retrieve from the tree options control.

Remarks

The DDX_TreeFileEdit function manages the transfer of CString data between a File Browser edit box in the CTreeOptionsCtrl in a dialog box, form view, or control view object and a CString value.

 

void DDX_TreeFolderEdit(CDataExchange* pDX, int nIDC, HTREEITEM hItem, CString& sText);

Parameters

pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.

nIDC The resource ID of the tree control associated with the control property.

hParent Handle of the parent group item which contains the radio button items.

sText A reference to a CString which is the text to display or retrieve from the tree options control.

Remarks

The DDX_TreeFolderEdit function manages the transfer of CString data between a Folder Browser edit box in the CTreeOptionsCtrl in a dialog box, form view, or control view object and a CString value.

 

void DDX_TreeColor(CDataExchange* pDX, int nIDC, HTREEITEM hItem, COLORREF& color);

Parameters

pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.

nIDC The resource ID of the tree control associated with the control property.

hParent Handle of the parent group item which contains the radio button items.

color A reference to a COLORREF which is the color to display or retrieve from the tree options control.

Remarks

The DDX_TreeColor function manages the transfer of COLORREF data between a color browser item in the CTreeOptionsCtrl in a dialog box, form view, or control view object and a COLORREF value.

 

void DDX_TreeFont(CDataExchange* pDX, int nIDC, HTREEITEM hItem, LOGFONT* pLogFont);

Parameters

pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.

nIDC The resource ID of the tree control associated with the control property.

hParent Handle of the parent group item which contains the radio button items.

color A pointer to a LOGFONT structure which is the font to display or retrieve from the tree options control.

Remarks

The DDX_TreeFont function manages the transfer of LOGFONT structure data between a font browser item in the CTreeOptionsCtrl in a dialog box, form view, or control view object and a LOGFONT structure value.

 

void DDX_TreeBoolean(CDataExchange* pDX, int nIDC, HTREEITEM hItem, BOOL& bValue);

Parameters

pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.

nIDC The resource ID of the tree control associated with the control property.

hParent Handle of the parent group item which contains the radio button items.

color A reference to a BOOL which is the Boolean value to display or retrieve from the tree options control.

Remarks

The DDX_TreeBoolean function manages the transfer of a BOOL value between a Boolean combo box item in the CTreeOptionsCtrl in a dialog box, form view, or control view object and a BOOL value.

 

 

 

Planned Enhancements

 

 

 

Contacting the Author

PJ Naughter
Email: pjna@naughter.com
Web: http://www.naughter.com
16 March 2015