CTreePropertySheet::AddPage

CTreePropertySheet::AddPage( int nType,
CPropertyPage* pPage,
LPCTSTR lpszCaptionDescr=_T("") );

Parameters

nType The type of this item. Can be one of these values:
tps_item_branch This item has sub-items. All following items are one level below this item, until a 'tps_item_endbranch' is found.
tps_item_node This item is a simple node in the tree.
tps_item_endbranch This item is the last item of the current sub-branch(which was initiated with an tps_item_branch). All following items are on the same level as the corresponding 'tps_item_branch' entry.
pPage Points to the 'CPropertyPage' template this item is associated with.
sCaptionDescr Defines an additional description to the main caption of this item. This is only shown if the dialog belonging to this item is currently selected.

Modifications

This method has been modified to fit into the scheme of using the 'CPropertySheet'/ 'CPropertyPage' approach. In the former version, you had to pass a caption text 'sCaption', a template ID 'nIDTemplate', and a pointer to a dialog template 'pDlg'.
In this version, the caption text 'sCaption' is taken from the property pages' caption. The 'nIDTemplate' is useless as you now must specify the property page
belonging to each item, also the 'pDlg' pointer.
It shouldn't take many changes to modify 'CDialog' pages to 'CPropertyPage's as they are almost identical, and it cleans up with many workarounds the previous version required :)

Remarks

Call this function to add property pages to the CTreePropertySheet.
The nType parameter specifies how to insert the page into the tree. Consider this example:

(tree control contents) (code)
+ Main preferences AddPage(tps_item_branch,&cMainPrefsPage);
    - Directories AddPage(tps_item_node,&cDirectoriesPage);
    - User information AddPage(tps_item_node, &cUserPage);
    - Plugins AddPage(tps_item_endbranch, &cPluginPage);
- Security AddPage(tps_item_node, &cSecurityPage);