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

[资料分享] 关于NX二次开发 Ribbon菜单定义技巧

[复制链接]

2018-12-25 16:10:57 2252 0

admin 发表于 2018-12-25 16:10:57 |阅读模式

admin 楼主

2018-12-25 16:10:57

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

x

7 p. ^; y  w; k- Q6 L: }, G7 S/ K3 G6 j6 N7 T) R2 `' r; \

: N6 H: j1 U; x2 ]) K9 `7 {
8 O& U- I& g) q首先认识下关于菜单的后缀文件/ }/ U, X. i1 M4 `! p, `( H" ^1 A& B

; c% f; x% r4 _2 K) _: J7 w! g8 S( U
Extension
UI object
.tbr
Toolbar
.grb
Group
.gly
Gallery
.ddb
Drop-down
.rtb
Ribbon tab
.csb
Cascade
.abr
Attachment

' M% [6 x1 I' j" x1 i" e1 {
% A( A' \- F7 J. _* gRTB作为菜单ribbon 界面定义的关键,详细信息如下- p( n: E, I8 [0 F) d

0 x" s6 t6 P: I2 ]9 D6 Z5 P7 Y# Y7 i4 {  a: Z- M
customer_ribbon_tab.rtb% e5 ~+ g* F- v+ b
!* W9 j" c3 @/ Q: F) Z' I9 q
!  Customer Ribbon Tab" q2 U. I2 S* w) s5 X2 C, Y! k
! . i' Y) E; z) B2 _
!  This file will create a new customer tab containing three groups and
+ u1 W" k; m5 t!  one top level button.
! U: _: U9 @, p" j!
6 V, Q4 }# j4 u. G2 r' l& d
) R& A2 i6 t6 i$ [2 n; N" ETITLE  Customer Tab& i! R) @7 l/ z2 x) ]) f+ W0 H6 V
VERSION 170
5 J$ F& K# K9 H/ H7 I
$ A7 S  @  f' e% s4 G" s!  The first group represents a Ribbon group that references an existing ; f4 z' t- p$ Z  s2 ]0 J1 k
!  toolbar with no Ribbon style changes.  
8 l! J  \: A- |4 G8 T; e! c6 I8 ~!
- I& S$ L5 ~0 z- A; ^4 E! B( N( F!  This is the quickest way to add existing toolbar content into Ribbon mode.
3 C. t$ J+ q5 S0 y: L) j!/ k% i/ K& _# r; O
GROUP  customer_toolbar.tbr2 U0 Z/ P2 ]/ H" Y: |
! 如果想直接切换tbr 到 rtb,这是最快的 * c' _" N5 U; y7 n: }
!  The second group represents a Ribbon group that references an existing : K. H' c7 t- Q8 l3 |3 s. S5 @1 W
!  toolbar with Ribbon specific style changes added to it.  There is no difference/ c  I- q4 o4 ^2 z8 j" a
!  in how this toolbar is referenced in the .rtb file compared to the first: ]3 M* d+ q' H; _# X# n- `
!  toolbar as a group.  The only differences from the first group exist within
" r5 u: D+ @# v, I!  the .tbr file itself.# X  X9 C; i3 ]6 d
!
, e9 Z' X3 q3 B7 R!  This approach has advantages for customers that will deploy both Ribbon and
8 d& `# Z; i3 y5 @!  Classic Mode customizations since all the content is defined in the .tbr 6 a+ x. R/ f( i! \! O6 ^8 q$ J
!  file and it will stay synchronized in both modes.  Only one set of customizations9 q/ [* f" A) E( `: \$ W; r! g
!  will need to be maintained while still making use of RIBBON_STYLE to " M) k0 E4 P$ r7 Z8 _" }. V
!  control the presentation of the buttons on the Ribbon.3 ]& v$ B1 i8 C! [, M* n8 t
!
) M2 @3 _3 Q, }) ^6 c# S* rGROUP  customer_toolbar_alternate.tbr- c7 {" H3 C9 k4 K4 @% B
0 j2 }6 T+ R' \$ c, n/ }- M
!  The third group represents a Ribbon group that has been created explicitly3 V, N7 G) Z) x- v) u6 l
!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the& r2 E! h( [! d/ _1 E- `
!  preferred option since the user will be able to take advantage of all the - G' ^. E/ y. u
!  layout styles and containers offered by the Ribbon.  # e& ]$ n& ?4 t
!
! @' o- K, g) {2 l; q6 C0 ~!  For customers that will deploy both Ribbon and Classic Mode customizations, / C) z3 s( \7 E9 R. }; T9 E& C
!  this approach will result in no synchronization and two sets of customizations 5 p- U. `+ [' b, X
!  will need to be maintained.; h# w. ?, ]( }4 n: ~5 c3 J* h
!
6 a" z& O$ _0 ?8 g' J4 A!  A group can alternatively be defined directly inside the .rtb file by using the' N! T2 x% `. r1 J) W' v
!  keywords BEGIN_GROUP and END_GROUP.  % X! `, j) \; N. {' ]
!3 F4 j' ~# l* D# G) ~& R
GROUP  customer_group.grb  r7 v, J7 d$ v0 l
1 S3 b. a* H8 k3 z
!  Example of a button that is placed directly on the Ribbon without being6 y' P' F+ E; o" g# O" {3 `
!  contained in a group.  This is a simple way to add a button to a tab* i  q7 ~2 Y0 A! y$ p- D
!  but is not recommended for many buttons since groups have advantages.: q! e0 n6 \8 ^8 o/ r
!  
/ t! m- [& e: ]3 `* \3 h$ b7 W!  A few advantages of groups:
. |0 s4 U' m; Q) x  `9 ~) W!     1. Easier to move many buttons around together in quick customization.  
: x6 \$ j/ L* e# g!        For example, MB3 on a group and choose "Add to Left Border Bar".  
9 q2 C0 N+ q5 R5 V( T* \. E( l!        This will move the whole group to a new location.  If buttons are
% i$ c  r/ w, W4 Y!        not in a group, they need to be moved one at a time., r# X$ ?) M0 f3 L
!) `1 C5 s1 a; O2 c& z4 c8 Q' V( i  j
!     2. Provide a label to describe its contents.
5 k& P$ P# k/ C8 S!, L1 d% e3 A1 H# E6 b
BUTTON CUSTOMER_BUTTON_15 g7 e) r4 C( i4 ?
LABEL Button1 Directly on Tab
$ V2 T+ D) n1 z2 x8 Z

1 l/ e* C! ]3 i
部分菜单可以单独写成group gallery 作为对应后缀,重复调用# w3 f  Y- Z# C0 _. s% M
!  Example of a gallery defined in a GRB file.
: \% g5 x% _8 ^: T7 ]1 ?9 {' ?!
% H3 C' |1 h9 g) X/ g6 u" N& v!  If this gallery is to be used in other places, then it could be . r3 {8 D' g3 @0 Q/ S/ \# ]/ e
!  defined in its own gallery (GLY) file and referenced here
5 b8 G3 d! J, }: M8 Z% v2 A* y/ E3 j0 N!  Example:
) K$ N# f- P9 f" Q4 S!    GALLERY customer_gallery.gly
7 O( i" `+ N% O) J2 O!& n9 J) C" J" ]3 O1 {# r( H
BEGIN_GALLERY  CUSTOMER_GALLERY2 t- {" o2 o* q  I4 z' A
COLUMN_IN_RIBBON 2
# c) N7 W, [7 A' XCOLUMN_IN_POPUP 2
1 l) C& e( P; d; ^$ ^5 `LABEL Gallery7 G$ ^- q; {8 r) U
GALLERY_STYLE MEDIUM_IMAGE_AND_TEXT
' o, J6 b  x9 H  s* I/ b# {* ?1 V
    BUTTON CUSTOMER_BUTTON_2" E* B2 E& d" g6 H  w# O2 I
   
6 k, i$ @0 ~! D* x7 J- u5 d    BUTTON CUSTOMER_BUTTON_3
/ i& h  U/ p7 y    2 a7 x1 u6 l3 P2 C0 t' Y
    BUTTON CUSTOMER_BUTTON_4
, v1 ~' [. N  C" H1 I   
8 w* h( |# I; _/ p    BUTTON CUSTOMER_BUTTON_5" a  ]( I9 q/ N7 s- n  l
    . [: e4 Z5 g" A8 R- |3 K
END_GALLERY
" ^0 n# ]" V, k1 n1 f7 r0 D

( Q# }* H/ \6 \$ j
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 注册

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

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

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

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

    我知道了