2.1.26.38 tree_get_folders_and_pages


Description

Generate a tree from the given folder's folders and pages and add to the parent.

Syntax

int tree_get_folders_and_pages( Folder & fldFolder, TreeNode & trParent, TreeNode & trNewFolder, DWORD dwPageTypeFilter = 0 )

Parameters

fldFolder
[input] Folder will add to trParent.
trParent
[Output]TreeNode to receive the folders and pages
trNewFolder
[Output]TreeNode to receive the up-to-date folders and pages
dwPageTypeFilter
[Input]filter options

Return

return -1 if false, else return the folder's position of the parent treenode

Examples

EX1

//Make sure there are some folders and pages in the current project before running the codes.
void tree_get_folders_and_pages_ex1()
{
    Tree tr;
    Tree trNew;
    Folder fldRoot;
    fldRoot = Application.RootFolder;
    
    int nRet = tree_get_folders_and_pages( fldRoot,tr,trNew,0);
    out_tree(tr);    
    out_tree(trNew);
}

Remark

Generate a tree from the given folder's folders and pages and add to the parent .

Folders will have tagName enumerated as Folder1, Folder2 etc.

Pages will have tagName enumerated as Page1, Page2 etc.

Each folder and page will have STR_LABEL_ATTRIB for the display name,

folders will have STR_PATH_ATTRIB for the full folder path and pages will have STR_NAME_ATTRIB for the LT name

See Also

Header to Include

origin.h

Reference