NX二次开发树列表添加节点

 

 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.
                                                    */
};

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

曹大师

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值