2.1.1.6 out_tree


Description

Quick display of a tree, shows the tagName or label attribute, the value of Text are shown for leaf node.

Syntax

bool out_tree(TreeNode& tr, bool bShowLine = true, bool bAlwaysShowTagName = false)

Parameters

tr
[Input]TreeNode to dump to output
bShowLine
[Input] If true, the grid lines will be shown in the output result, else it will simply output the content of the tree.
bAlwaysShowTagName
[Input] If true, the tagName will be output to identify each subnode, else the content of label attribute (STR_LABEL_ATTRIB) will be output instead if it exist.

Return

true if given tree is a valid TreeNode, otherwise false

Examples

EX1

void out_tree_ex1()
{
    Tree tr;
    tr.Grade.Math.dVal = 90.5;
    tr.Grade.English.dVal = 95.5;
    bool bShowLine = false;
    bool bAlwaysShowTagName = true;
    out_tree(tr, bShowLine, bAlwaysShowTagName );
}

EX2

void out_tree_ex2()
{
    GraphPage gp;
    if (gp.Create("Origin"))
    {
        TreeNode tnFormat = gp.GetFormat();
        bool bShowLine = true;
        bool bAlwaysShowTagName = true;
        out_tree(tnFormat, bShowLine, bAlwaysShowTagName);
    }
}

Remark

See Also

Header to Include

origin.h

Reference