2.2.3.17.8 TreeNode::Enable

ClassName

TreeNode

AccessType

public

Name

Enable

Declaration

int Enable

Remark

Enable is an treenode attribute. This attribute only effect on GUI treenode (GetN Tree) to make control editable(Enable is 1) or disabled(Enable is 0).

Examples

void TreeNode_Enable_ex1()
{
	// access Enable by property
	Tree tr; 						// Declare a Tree variable
	tr.abc.Enable = 1; 				// Add a tree node named "abc" and set Enable to 1
	int nn = tr.abc.Enable; 		// Read Enable 
	out_int("nn = ", nn);			// Output: nn = 1

	//access Enable by TreeNode::SetAttribute and TreeNode::GetAttribute
	TreeNode trN = tr.AddNode("def");				// Add a tree node named "def" 
	trN.SetAttribute(STR_ENABLE_ATTRIB, 1);			// Set Enable to 1
	int kk;
	if( trN.GetAttribute(STR_ENABLE_ATTRIB, kk) )	// Get Enable value
	{
			out_int("kk = ", kk);					// Output: kk = 1
	}
	else
	{
			out_str("Error, Enable attribute not exist.");
	}     
}

Description

Read or write treenode's Enable status.

Header to Include

origin.h

See Also

TreeNode::GetAttribute, TreeNode::SetAttribute, TreeNode::AddNode, GETN_TREE, TreeNode::Show

Reference