admin 发表于 2018-12-25 16:10:57

关于NX二次开发 Ribbon菜单定义技巧





首先认识下关于菜单的后缀文件


ExtensionUI object
.tbrToolbar
.grbGroup
.glyGallery
.ddbDrop-down
.rtbRibbon tab
.csbCascade
.abrAttachment


RTB作为菜单ribbon 界面定义的关键,详细信息如下


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

TITLECustomer 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.
!
GROUPcustomer_toolbar.tbr
! 如果想直接切换tbr 到 rtb,这是最快的
!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.
!
GROUPcustomer_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.
!
GROUPcustomer_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

部分菜单可以单独写成group gallery 作为对应后缀,重复调用
!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_GALLERYCUSTOMER_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

页: [1]
查看完整版本: 关于NX二次开发 Ribbon菜单定义技巧