NX二次开发-导航器中嵌入BlockUI

   在NX10中西门子官方开放了导航器的接口,利用二次开发可以将第三方UI嵌入到导航器中,如果要实现和BlockUI一样的风格,需采用第三方UI自绘。如果可以实现将BLOCKUI嵌入到导航器中,不仅风格和NX一致,也不用再额外的花费时间去自绘。经过研究目前已经适配NX7.5到最新版本同一套代码都可以。

  1.封装的类如下,只需继承下做下处理,完全使用BlockUI那一套逻辑,代码风格一样

2.BlockUI框架继承导航器类

class NXTEST :public NXNavigatorDialog
{
    // class members
public:
    static Session *theSession;
    static UI *theUI;
    NXTEST();
    ~NXTEST();
    int Show();
    
    //----------------------- BlockStyler Callback Prototypes ---------------------
    // The following member function prototypes define the callbacks 
    // specified in your BlockStyler dialog.  The empty implementaiton
    // of these prototypes is provided in the NXTEST.cpp file. 
    // You are REQUIRED to write the implementation for these funtions.
    //------------------------------------------------------------------------------
    void initialize_cb();
    void dialogShown_cb();
    int apply_cb();
    int ok_cb();
    int update_cb(NXOpen::BlockStyler::UIBlock* block);
    void focusNotify_cb(NXOpen::BlockStyler::UIBlock* block, bool focus);
    void keyboardFocusNotify_cb(NXOpen::BlockStyler::UIBlock* block, bool focus);
    bool ShowNavigator();
    void  ActivationNavigator();
private:
    std::string theDialogName;
    NXOpen::BlockStyler::BlockDialog* theDialog;
    NXOpen::BlockStyler::UIBlock* group0;// Block type: Group
    NXOpen::BlockStyler::UIBlock* enum0;// Block type: Enumeration
    NXOpen::BlockStyler::UIBlock* selection0;// Block type: Selection
    NXOpen::BlockStyler::UIBlock* button0;// Block type: Button
    NXOpen::BlockStyler::Tree* tree_control0;// Block type: Tree Control
    
};

 3.在NX8.5中的实现

4.在NX2306中的实现

5.以下视频是在NX8.5的操作演示

导航器

 

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值