Node* newNode=treeControl->CreateNode("");新建节点,""节点名称,可以传值,也可以传空值。
treeControl->InsertNode(newNode,NULL,NULL,Tree::NodeInsertOptionLast);插入节点。
参数1:要插入的新节点;
参数2:父节点,如果有多级节点就需要传父节点,例如装配树,没有就传空;
参数3:上一个节点,没有就传空;
参数4:插入类型枚举,一般插在尾部;
Node* newNode=treeControl->CreateNode("");
treeControl->InsertNode(newNode,NULL,NULL,Tree::NodeInsertOptionLast);
NXOpen::BlockStyler::Node * CreateNode
(
const char * displayText /**Specifies the display text of the node.*/
);
public: void InsertNode
(
NXOpen::BlockStyler::Node * newNode /**New Node.*/,
NXOpen::BlockStyler::Node * parentNode /**Parent node under which new node is supposed to be placed.*/,
NXOpen::BlockStyler::Node * afterNode /**New node placed after this node. If there is mismatch between parent-node and after-node then former is honoured.*/,
NXOpen::BlockStyler::Tree::NodeInsertOption nodeInsertOption /**Node insert option. Provide the value if after node is NULL.
This value is not considered if a valid after-node is supplied.*/
);
public: enum NodeInsertOption
{
NodeInsertOptionFirst/**Node is placed first in the hierarchy in which it is inserted.*/,
NodeInsertOptionLast/**Node is placed last in the hierarchy in which it is inserted.*/,
NodeInsertOptionSort/**Node is sorted according to display text and placed accordingly in the hierarchy in which it is inserted*/,
NodeInsertOptionAlwaysFirst/**Node is placed first in the hierarchy in which it is inserted. This is same as
@link BlockStyler::Tree::NodeInsertOptionFirst BlockStyler::Tree::NodeInsertOptionFirst@endlink , except that it
remains first after a column sort. If there is more than one node beneath a single parent
with this option then they will be sorted relative to each other.
*/,
NodeInsertOptionAlwaysLast/**Node is placed last in the hierarchy in which it is inserted. This is same as
@link BlockStyler::Tree::NodeInsertOptionLast BlockStyler::Tree::NodeInsertOptionLast@endlink , except that it
remains last after a column sort. If there is more than one node beneath a single parent
with this option then they will be sorted relative to each other.
*/
};