PLM之家精品课程培训,联系电话:18301858168 QQ: 939801026

  • NX二次开培训

    NX二次开培训

    适合初级入门或想深入了解二次开发的工程师,本培训结合ufun,NXOpen C++,大量的实例及官方内部的开发技术对于老鸟也值得借鉴!.

    NX CAM二次开发培训报名 NX二次开发基础培训报名
  • PLM之家Catia CAA二次开发培训

    Catia二次开发培训

    Catia二次开发的市场大,这方面开发人才少,难度大。所以只要你掌握了开发,那么潜力巨大,随着时间的积累,你必将有所用武之地!

  • PLM之Teamcenter最佳学习方案

    Teamcenter培训

    用户应用基础培训,管理员基础培训,管理员高级培训,二次开发培训应有尽有,只要你感兴趣肯学习,专业多年经验大师级打造!

  • PLM之Tecnomatix制造领域培训

    Tecnomatix培训

    想了解制造领域数字化吗?想了解工厂,生产线设计吗?数字化双胞胎,工业4.0吗?我们的课程虚位以待!

PLM之家PLMHome-国产软件践行者

关于NX二次开发,经典界面到RIbbon界面转换的菜单开发技巧

2015-1-9 10:40| 发布者: admin| 查看: 6503| 评论: 0|原作者: admin

摘要: 关于NX二次开发,经典界面到RIbbon界面转换的菜单开发技巧 在经典界面下,需要的文件 customer_men.mencustomer_toolbar.tbr 在ribbon界面下你可能需要的文件 customer_men.mencustomer_tab.rtbcustomer_toolbar.t ...
关于NX二次开发,经典界面到RIbbon界面转换的菜单开发技巧
经典界面到RIbbon界面转换
在经典界面下,需要的文件
  • customer_men.men
  • customer_toolbar.tbr
在ribbon界面下你可能需要的文件
  • customer_men.men
  • customer_tab.rtb
  • customer_toolbar.tbr
  • customer_toolbar_alternate.tbr
  • customer_group.grb



举例如下:


customer_men.men
!
!  Customer menu file
!
!  Contains button definitions to be used in
!  toolbars and Ribbon files
!

VERSION 120

EDIT UG_GATEWAY_MAIN_MENUBAR

TOP_MENU
    CASCADE_BUTTON CUSTOMER_MENU
    LABEL Customer Menu

END_OF_TOP_MENU

MENU CUSTOMER_MENU

    BUTTON CUSTOMER_BUTTON_1
    LABEL Menu Button1
        RIBBON_LABEL Ribbon Button1
        TOOLBAR_LABEL Toolbar Button1
    BITMAP fileopen

    BUTTON CUSTOMER_BUTTON_2
    LABEL Menu Button2
        RIBBON_LABEL Ribbon Button2
        TOOLBAR_LABEL Toolbar Button2
    BITMAP filesave

    BUTTON CUSTOMER_BUTTON_3
    LABEL Menu Button3
        RIBBON_LABEL Ribbon Button3
        TOOLBAR_LABEL Toolbar Button3
    BITMAP current_feature

    BUTTON CUSTOMER_BUTTON_4
    LABEL Menu Button4
        RIBBON_LABEL Ribbon Button4
        TOOLBAR_LABEL Toolbar Button4
    BITMAP block

    BUTTON CUSTOMER_BUTTON_5
    LABEL Menu Button5
        RIBBON_LABEL Ribbon Button5
        TOOLBAR_LABEL Toolbar Button5
    BITMAP checkgreen

END_OF_MENU



customer_ribbon_tab.rtb
!
!  Customer Ribbon Tab
!
!  This file will create a new customer tab containing three groups and
!  one top level button.
!

TITLE  Customer Tab
VERSION 170

!  The first group represents a Ribbon group that references an existing
!  toolbar with no Ribbon style changes.  
!
!  This is the quickest way to add existing toolbar content into Ribbon mode.
!
GROUP  customer_toolbar.tbr

!  The second group represents a Ribbon group that references an existing
!  toolbar with Ribbon specific style changes added to it.  There is no difference
!  in how this toolbar is referenced in the .rtb file compared to the first
!  toolbar as a group.  The only differences from the first group exist within
!  the .tbr file itself.
!
!  This approach has advantages for customers that will deploy both Ribbon and
!  Classic Mode customizations since all the content is defined in the .tbr
!  file and it will stay synchronized in both modes.  Only one set of customizations
!  will need to be maintained while still making use of RIBBON_STYLE to
!  control the presentation of the buttons on the Ribbon.
!
GROUP  customer_toolbar_alternate.tbr

!  The third group represents a Ribbon group that has been created explicitly
!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the
!  preferred option since the user will be able to take advantage of all the
!  layout styles and containers offered by the Ribbon.  
!
!  For customers that will deploy both Ribbon and Classic Mode customizations,
!  this approach will result in no synchronization and two sets of customizations
!  will need to be maintained.
!
!  A group can alternatively be defined directly inside the .rtb file by using the
!  keywords BEGIN_GROUP and END_GROUP.  
!
GROUP  customer_group.grb

!  Example of a button that is placed directly on the Ribbon without being
!  contained in a group.  This is a simple way to add a button to a tab
!  but is not recommended for many buttons since groups have advantages.
!  
!  A few advantages of groups:
!     1. Easier to move many buttons around together in quick customization.  
!        For example, MB3 on a group and choose "Add to Left Border Bar".  
!        This will move the whole group to a new location.  If buttons are
!        not in a group, they need to be moved one at a time.
!
!     2. Provide a label to describe its contents.
!
BUTTON CUSTOMER_BUTTON_1
LABEL Button1 Directly on Tab



customer_toolbar.tbr
!
!  Customer Toolbar File
!
!  This is similar to an existing toolbar file containing
!  no Ribbon changes.
!
!  In Classic Toolbars mode - This toolbar will still show up in the
!     toolbars list.
!
!  In Ribbon mode - This toolbar will be automatically converted to a
!     Ribbon group and will appear in the "Classic Toolbars as Groups"
!     section in the Customize dialog.
!  

TITLE Toolbar
VERSION 170

BUTTON CUSTOMER_BUTTON_1

BUTTON CUSTOMER_BUTTON_2

BUTTON CUSTOMER_BUTTON_3

BUTTON CUSTOMER_BUTTON_4

BUTTON CUSTOMER_BUTTON_5



customer_toolbar_alternate.tbr
!
!  Customer Toolbar File (Alternate)
!
!  This is similar to an existing toolbar file with new
!  Ribbon styles added.
!  
!  The RIBBON_STYLE will be honored when the toolbar is loaded
!  in Ribbon mode as a group but will be ignored when the toolbar
!  is displayed in Classic Toolbars mode.
!
!  In Classic Toolbars mode - This toolbar will still show up in the
!     toolbars list.
!
!  In Ribbon mode - This toolbar will be automatically converted to a
!     Ribbon group and will appear in the "Classic Toolbars as Groups"
!     section in the Customize dialog.
!

TITLE Toolbar (Alternate)
VERSION 170

BUTTON CUSTOMER_BUTTON_1
LABEL Toolbar(Alt) Button1
RIBBON_STYLE LARGE_IMAGE

BUTTON CUSTOMER_BUTTON_2
LABEL Toolbar(Alt) Button2
RIBBON_STYLE LARGE_IMAGE

BUTTON CUSTOMER_BUTTON_3
LABEL Toolbar(Alt) Button3
RIBBON_STYLE SMALL_IMAGE_AND_TEXT

BUTTON CUSTOMER_BUTTON_4
LABEL Toolbar(Alt) Button4
RIBBON_STYLE SMALL_IMAGE_AND_TEXT

BUTTON CUSTOMER_BUTTON_5
LABEL Toolbar(Alt) Button5
RIBBON_STYLE SMALL_IMAGE_AND_TEXT



customer_group.grb
!
!  Customer Ribbon Group File
!
!  In Classic Toolbars mode - This group will be unavailable
!
!  In Ribbon mode - This group will show up in the "All Groups" list
!     in the Customize dialog.
!
!  The labels of the buttons are defined using the RIBBON_LABEL token in the MEN files
!

TITLE Group
VERSION 170

!  No LABEL defined, using RIBBON_LABEL defined in customer_men.men
BUTTON CUSTOMER_BUTTON_1
RIBBON_STYLE LARGE_IMAGE

!  Example of a gallery defined in a GRB file.
!
!  If this gallery is to be used in other places, then it could be
!  defined in its own gallery (GLY) file and referenced here
!  Example:
!    GALLERY customer_gallery.gly
!
BEGIN_GALLERY  CUSTOMER_GALLERY
COLUMN_IN_RIBBON 2
COLUMN_IN_POPUP 2
LABEL Gallery
GALLERY_STYLE MEDIUM_IMAGE_AND_TEXT

    BUTTON CUSTOMER_BUTTON_2

    BUTTON CUSTOMER_BUTTON_3

    BUTTON CUSTOMER_BUTTON_4

    BUTTON CUSTOMER_BUTTON_5

END_GALLERY



鲜花

握手

雷人

路过

鸡蛋

相关阅读

最新评论

登录之后发表您得观点!
  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了