2.1.26.55 tree_node_changed


Description

If bSet is false, then just get the value of Change attribute; if bSet is true and lpcszOldValue is NULL will clear changed; if bSet is true and lpcszOldValue is not NULL will Set Change attribute as old value

Syntax

bool tree_node_changed( TreeNode & trNode, bool bSet = false, LPCSTR lpcszOldValue = NULL )

Parameters

trNode
[input]TreeNode to check attribute STR_CHANGED_ATTRIB
bSet
[Input]ture, get and set Change attribute; false, just get
lpcszOldValue
[Input]the value set to attribute

Return

true, if trNode is valid

Examples

EX1

void tree_node_changed_ex1()
{
    Tree tr;
    TreeNode trNode1 = tr.AddTextNode("abc", "node1", 1);
    trNode1.SetAttribute(STR_CHANGED_ATTRIB, "Changed");
    TreeNode trNode2 = tr.AddTextNode("def", "node2", 2);
    trNode2.SetAttribute(STR_CHANGED_ATTRIB, "Changed");
 
    vector<string> vs = {"ccc", "def"};    
    int index=0;
    string strLabel;    
    foreach(TreeNode trNode in tr.Children)
    {
        tree_node_changed(trNode, true, vs[index++]);    
        trNode.GetAttribute(STR_CHANGED_ATTRIB, strLabel);
        out_str(strLabel);
    }
}

Remark

See Also

Header to Include

origin.h

Reference