tree_check_replace_auto

 

Description

check given treenode to see if it has an Auto checkbox, and to replace the double value if it is Auto

Syntax

int tree_check_replace_auto( TreeNode & tr, double dValToReplace )

Parameters

tr
[input/output] treenode to check and update
dValToReplace
[input] double value to replace the node value

Return

Returns the one of the following:

1 = tr has Auto checkbox and is checked, tr value is updated to dValToReplace
0 = tr does not have Auto checkbox, pdValToReplace is ignored
-1= tr has Auto checkbox but is unchecked, tr value is not changed

Examples

EX1

#include <GetNbox.h>
void GETN_ADD_AUTO_ex1()
{
    GETN_TREE(tr)
 
    GETN_BEGIN_BRANCH(tt, _L("Output Find Specific X/Y Tables"))
        GETN_OPTION_BRANCH(GETNBRANCH_OPEN) 
        GETN_NUM(start, "Start Time", 1) GETN_ADD_AUTO(1)
        GETN_NUM(stop, "Stop Time", 100) GETN_ADD_AUTO(1)
    GETN_END_BRANCH(tt)
    if(GetNBox(tr))
    {
        tree_check_replace_auto(tr.tt.start, NANUM);
        tree_check_replace_auto(tr.tt.stop, -1);
        out_tree(tr);
    }
}

Remark

See Also

octree_get_auto_support

header to Include

Reference