【お知らせ】この部分は英語原文のみでの提供となります。何卒ご了承ください。
2.1.26.68 tree_set_or_remove_attribute
Contents
Description
Add or remove an attribute on a treenode.
Syntax
bool tree_set_or_remove_attribute( TreeNode & tr, LPCSTR lpcszAttribute = NULL, bool bAdd = false, LPCSTR lpcszAttribValue = NULL )
Parameters
- tr
- [input] tree node to set or remove attribute
- lpcszAttribute
- [input]attribute string
- bAdd
- [input] ture will add attribute
- lpcszAttribValue
- [input] adding attribute value
Return
TRUE if success, else false
Examples
EX1
int tree_set_or_remove_attribute_ex1() { Tree tr; TreeNode trNode = tr.AddNode("Root"); trNode.SetAttribute(STR_LABEL_ATTRIB, "OK"); string str; tree_set_or_remove_attribute(trNode, STR_LABEL_ATTRIB); //remove attribute if( !trNode.GetAttribute(STR_LABEL_ATTRIB, str)) tree_set_or_remove_attribute(trNode, STR_LABEL_ATTRIB, true, "NewStr"); //add attribute return 1; }
Remark
See Also
Header to Include
origin.h