PLM之家PLMHome-工业软件践行者

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

[复制链接]

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

2470

主题

1275

回帖

8万

积分

管理员

PLM之家站长

积分
82162
QQ
发表于 2018-12-25 16:10:57 | 显示全部楼层 |阅读模式

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

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

x
3 A1 c4 i2 |7 K( @( d

# J8 S2 [9 n, a. Z# }$ H$ F3 V, k6 J$ \9 S1 l
/ D# ?! w! c: ]0 G1 e8 o
首先认识下关于菜单的后缀文件" g' S) C6 I% d

1 H. T+ _& G8 H7 @
Extension
UI object
.tbr
Toolbar
.grb
Group
.gly
Gallery
.ddb
Drop-down
.rtb
Ribbon tab
.csb
Cascade
.abr
Attachment

! C) J! M$ _) R: L( K- O; ~
, F) d! D- B9 t, Z& e5 zRTB作为菜单ribbon 界面定义的关键,详细信息如下; T& a+ Y0 b3 I  E4 H

! E( b/ ]( B, c5 q7 P2 J8 d
! G1 h( }3 \; O5 |( Wcustomer_ribbon_tab.rtb  q. G2 Q  n! {4 n
!
9 D; r8 P) z4 M; W!  Customer Ribbon Tab7 r. j$ c2 F1 |3 v0 {# T& i
! & N) x" }8 q9 a: ]# {! P( p0 L4 J; a
!  This file will create a new customer tab containing three groups and
* Z. y) O! h: c4 d; T8 e& S!  one top level button.
. B( j9 n9 w1 }1 P!
! c& @& o- m0 P
& V* w5 a) _4 `, N- g. TTITLE  Customer Tab& H9 B1 k" k5 A3 A* H3 j
VERSION 1706 T: U, b: b+ V! `

, J/ c' ~: a5 N; D!  The first group represents a Ribbon group that references an existing
/ X: J4 [9 ~! I$ s!  toolbar with no Ribbon style changes.  
1 L! W6 A7 W: d  `9 z& v!
8 V  A* K+ R. g4 P2 Z7 o!  This is the quickest way to add existing toolbar content into Ribbon mode.( x+ H) X& W! F5 A( o) x7 E! |
!. U& k6 o* ^9 I) ]7 P4 J" ^
GROUP  customer_toolbar.tbr, n0 d* u1 y* c" n
! 如果想直接切换tbr 到 rtb,这是最快的
) D+ l; w8 ^  ~2 p: p& d* V!  The second group represents a Ribbon group that references an existing
- g; B0 h) r1 r1 x* v6 Y$ s* B) T!  toolbar with Ribbon specific style changes added to it.  There is no difference4 `- h. {1 G4 a7 ]
!  in how this toolbar is referenced in the .rtb file compared to the first
5 {* p! F+ c' r" }5 a! k6 K6 U!  toolbar as a group.  The only differences from the first group exist within
7 b3 Y+ \+ u2 T$ H. w" g!  the .tbr file itself.
4 P7 H( j& R4 N* s) W& S!
9 A# h( v% ~# _9 P! [( Q" x9 p3 ]!  This approach has advantages for customers that will deploy both Ribbon and9 w; p6 q$ Y  ?5 U! N
!  Classic Mode customizations since all the content is defined in the .tbr
/ N, Z8 o% a) e8 p) F) T!  file and it will stay synchronized in both modes.  Only one set of customizations: i, p& D1 _% U) A
!  will need to be maintained while still making use of RIBBON_STYLE to
9 v' S  d5 n5 `  a8 r3 R# P!  control the presentation of the buttons on the Ribbon.- Q, i. y0 r+ d" e" R6 @; Z* o$ e
!' a' ?: H! V- V  f9 M; o5 z0 B) B0 ^* ?
GROUP  customer_toolbar_alternate.tbr
# J: k! x0 f# b9 ?
! m5 M, d+ `8 |& T' q) z0 P!  The third group represents a Ribbon group that has been created explicitly$ M& _3 ~  B+ {+ M+ {) p
!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the9 g+ _. y2 i: r
!  preferred option since the user will be able to take advantage of all the
/ q* B4 w8 e; C: D# J+ W8 G!  layout styles and containers offered by the Ribbon.  2 W8 S: j( N* N& W
!
; ]9 c! ~1 N) w7 @* h% H!  For customers that will deploy both Ribbon and Classic Mode customizations,
7 e) n7 x6 D. D, V0 N" E" U: J!  this approach will result in no synchronization and two sets of customizations
" `( L( P8 J6 p: U3 x" t& A!  will need to be maintained.* K! B3 [+ s% l, C- A+ a* ?; ?0 }
!0 i; g1 ~4 ]6 V; H4 o
!  A group can alternatively be defined directly inside the .rtb file by using the" Y, Z  h4 {" f4 ]# i
!  keywords BEGIN_GROUP and END_GROUP.  
  t& N) u& x, D- C8 W$ E!
7 z$ S1 T+ a6 U$ p/ I! [) x( m  AGROUP  customer_group.grb8 S) E# T/ D' H# D$ _
' B& ~8 g0 C( s4 r
!  Example of a button that is placed directly on the Ribbon without being  q" ?9 ~$ Y) a( Z" p" n9 g
!  contained in a group.  This is a simple way to add a button to a tab! C+ g6 @. I) x3 @9 P1 l+ z
!  but is not recommended for many buttons since groups have advantages.% g6 t4 y8 F( s7 `- h* s
!  
6 m5 B: a3 p; h8 ]1 G!  A few advantages of groups:9 `- ^& t8 Q5 R" g* E
!     1. Easier to move many buttons around together in quick customization.  . O! n/ T( h; d# O
!        For example, MB3 on a group and choose "Add to Left Border Bar".  5 \$ B% }* c" Y5 |6 Z2 f
!        This will move the whole group to a new location.  If buttons are
$ Z; S) j+ d* g! N( O!        not in a group, they need to be moved one at a time.
+ r1 D. C) p& x, N& y0 N5 y0 m4 Y!
; Q! H" Y1 P0 U0 K  X4 g!     2. Provide a label to describe its contents.
. I" v0 t' L" _! H, C. a! r!9 r' L/ |$ M% F$ u9 P; j
BUTTON CUSTOMER_BUTTON_1
2 @9 @, B% z% L. JLABEL Button1 Directly on Tab

) T: w- C0 n2 M, u" S
* o1 b3 N3 m1 F# u; G
部分菜单可以单独写成group gallery 作为对应后缀,重复调用
6 }# m6 n% U0 q# n# y# R/ p!  Example of a gallery defined in a GRB file.
% t" I& I/ [0 f4 g( h8 C!
4 G- s, K, b) q!  If this gallery is to be used in other places, then it could be 2 ]+ y" `3 h. |. g
!  defined in its own gallery (GLY) file and referenced here
5 i9 }+ R, l6 X8 D8 E8 X& a8 ]6 \% m!  Example:8 B( \/ d* C; [4 N9 t- F
!    GALLERY customer_gallery.gly8 T% r- n" d. I9 Y* I6 `8 \
!6 u( S" S# i& D
BEGIN_GALLERY  CUSTOMER_GALLERY6 F/ `9 O0 J1 s. l+ t2 X+ K3 @
COLUMN_IN_RIBBON 2% z. x. ~# S& U/ `4 _
COLUMN_IN_POPUP 2
5 z4 P% Y" G: Q$ B: {1 WLABEL Gallery2 v- P6 Q/ T" _; t$ c, L: _
GALLERY_STYLE MEDIUM_IMAGE_AND_TEXT( P2 r0 P* G7 F% O! r

# l& c" [7 G! `+ z& T9 Q    BUTTON CUSTOMER_BUTTON_2
8 y" L! W$ Y8 T3 ]; q6 V3 F   
  w! U' f/ c  c  `0 ^' Z    BUTTON CUSTOMER_BUTTON_3
, e# J+ \  _9 V2 P! }1 k: U   
* j" b# D2 N& I) d  N/ {8 Q    BUTTON CUSTOMER_BUTTON_4  V% W0 y: D! ]9 b
    8 a4 S; ?* `) h$ @7 @5 Q8 ?
    BUTTON CUSTOMER_BUTTON_58 S9 D1 A7 G( K" h( ]: k
    # `# |$ W& x+ ~
END_GALLERY& B# s$ [8 L% ~3 }8 m1 q* A

& ~& U$ {* I- }; |* B+ H+ P* U
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了