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:37:48 4236 0

admin 发表于 2015-1-9 10:37:48 |阅读模式

admin 楼主

2015-1-9 10:37:48

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

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

x
关于NX二次开发,经典界面到RIbbon界面转换的菜单开发技巧* ?* @; X0 ^5 V: p8 K+ C8 U

经典界面到RIbbon界面转换

经典界面到RIbbon界面转换
& r/ ?  r# {& O3 g, T' m* w
在经典界面下,需要的文件
0 M' ~6 X% e2 x3 s; V, |
  • customer_men.men
  • customer_toolbar.tbr
    3 h( T! {8 S8 z  C2 q
在ribbon界面下你可能需要的文件 8 v) |1 H: g- v8 s9 v0 k8 a3 j
  • customer_men.men
  • customer_tab.rtb
  • customer_toolbar.tbr
  • customer_toolbar_alternate.tbr
  • customer_group.grb

    " ]' W, M+ p4 ^
8 }7 d; w( x$ o* I+ y; Q
/ G3 p& _  E  w
举例如下:
$ [6 Z" Y1 E" P( q1 O2 u4 q2 _" F6 M0 W  g' y

3 A/ {! C7 Q5 p4 q6 o7 l9 P. {: Ucustomer_men.men
6 z0 x# j* G, K1 S: c7 z  W- ]!
2 V1 O: e6 e  P5 B" _!  Customer menu file
. k+ A# H, r/ o7 m6 ~3 Z! ; Q4 Q) P3 {/ |# K0 p9 N( s* |* Q' }
!  Contains button definitions to be used in & l; p) K/ a* }) ^; h5 g
!  toolbars and Ribbon files
) t1 v. q# F8 y: @!
& S8 R+ _, `; k) M/ L2 t1 ^5 @! k  ^. I9 i- i
VERSION 120: A1 G. U7 s2 m" E+ Q; s; l
/ ~% l6 X. j8 D  M9 l5 z
EDIT UG_GATEWAY_MAIN_MENUBAR+ @* W: w; f- {
0 [3 O$ K/ z* ^- ]  P8 y) ~$ e1 |& k9 {
TOP_MENU0 {7 M! j8 Q# e# \1 ]( X6 G
    CASCADE_BUTTON CUSTOMER_MENU4 h" k- C9 j: f: t- H. ]$ M7 X5 `$ z
    LABEL Customer Menu, X/ q/ |" w% `6 q. O9 j

5 y7 n& P, t: b# _* g; w# LEND_OF_TOP_MENU
/ `8 u! o6 k1 ]: F% t6 H# x3 X' P  L& o9 u/ Y" z
MENU CUSTOMER_MENU
1 Z' |$ Y' T. w5 H8 |) ?% f. Y' W! o! O
    BUTTON CUSTOMER_BUTTON_1. ^* p" g+ Z; B) D
    LABEL Menu Button1
+ B) U/ I0 u( ?& t         RIBBON_LABEL Ribbon Button12 I3 @& [' o& {- e0 w
        TOOLBAR_LABEL Toolbar Button1
: B8 }* ?  L+ v. _4 v    BITMAP fileopen
% [0 V0 f2 `6 b  [. G5 t7 _- R5 c0 {' w$ w: t0 G
    BUTTON CUSTOMER_BUTTON_2: q* R# A9 e4 p# ^+ J/ \2 X2 b  @6 c
    LABEL Menu Button2
% S9 u% l, L* Q        RIBBON_LABEL Ribbon Button2
0 L: l' N  C  L1 T  D        TOOLBAR_LABEL Toolbar Button26 Q* \, r1 i) X! G$ `* G
    BITMAP filesave
# E5 P4 W( P) ?* n  @0 e
: x" [9 }: X4 Z# `& X! W    BUTTON CUSTOMER_BUTTON_37 q4 _& E. x9 ~! o- V
    LABEL Menu Button3) b1 t9 |8 h" D  m
        RIBBON_LABEL Ribbon Button3- ~( [: G  u: Y, |7 U0 r- L% w
        TOOLBAR_LABEL Toolbar Button3. q1 x9 L' }8 E
    BITMAP current_feature
: n( z" Q( I- E3 p( l2 o+ r7 Q, i& E, d) n' S0 ?8 u& U
    BUTTON CUSTOMER_BUTTON_4
% L5 F* V3 |4 ^- |9 }9 R$ U    LABEL Menu Button4
: ], I7 N7 _2 v  d# j        RIBBON_LABEL Ribbon Button4
6 ]! g% s' P$ c1 S. K        TOOLBAR_LABEL Toolbar Button47 W& c7 R0 h  Y5 X& P$ Y9 G* q
    BITMAP block
( ]2 v! `6 Y) T* q; J6 D5 X* _* R( C  K
    BUTTON CUSTOMER_BUTTON_5
+ q( Y. g8 ^4 x; z8 U+ Q1 N; A4 ?    LABEL Menu Button50 z% y" G, J8 |9 M5 ?' t6 l9 d
        RIBBON_LABEL Ribbon Button5" y3 ]' T  F0 P) a9 W+ a
        TOOLBAR_LABEL Toolbar Button5
0 x, e5 P4 y! @& s' Y+ L5 R    BITMAP checkgreen
0 @, s2 G. Z. q7 W! N6 ]9 e# M4 p: R
END_OF_MENU
4 N6 p& F, P4 f  Z' L* _8 C: X9 W3 ^8 C! a+ d5 w9 k

" r6 H" H! r- e/ Z, o' f
1 p, o( C# W, dcustomer_ribbon_tab.rtb, S: J: m5 U; H- i" b
!
' e5 [+ e$ {: W3 S  X- b!  Customer Ribbon Tab" L2 J0 h/ f0 i( i$ V) d
!
0 e7 J  _( E2 o) ^!  This file will create a new customer tab containing three groups and  ?' G3 T: g: F0 y
!  one top level button.
# B& E5 i0 U5 {; m$ Y- S!
6 K) w6 m- Y; m+ G. X) q
6 T; M* @, c8 t% N$ J! k3 y7 N2 sTITLE  Customer Tab  \. j5 Z; O" s% u2 n, O/ R% ?
VERSION 170# F7 b- s; ~8 B
( S( c  u( P) k6 [1 E8 i
!  The first group represents a Ribbon group that references an existing
0 c+ n; V( {, ~1 H: P5 O) k!  toolbar with no Ribbon style changes.  
7 t4 m8 H! s# v7 k- h; R( ~% N. J!
9 t6 Z; F9 \* j!  This is the quickest way to add existing toolbar content into Ribbon mode.* a! g. |2 \" P# O( V
!! X# U: K2 n3 F; E% v/ x
GROUP  customer_toolbar.tbr& ^. q* \; c7 O' f7 X# f

) [& B8 Y0 C3 k# U8 f6 v!  The second group represents a Ribbon group that references an existing
; a! m5 G. z4 p& l) E, N! E1 i" W!  toolbar with Ribbon specific style changes added to it.  There is no difference5 v6 q- `; Q! N7 D, V
!  in how this toolbar is referenced in the .rtb file compared to the first; T2 \- M/ m9 ]9 L
!  toolbar as a group.  The only differences from the first group exist within * H% ]( z6 k6 ~3 y
!  the .tbr file itself.
. x. i/ ^5 f' k# J3 }) K!
: ^- E' W, u9 {" O2 ~4 Z8 c, ]!  This approach has advantages for customers that will deploy both Ribbon and
+ q9 F, a* o* b!  Classic Mode customizations since all the content is defined in the .tbr
  h7 n- l0 F7 b/ P4 p: \!  file and it will stay synchronized in both modes.  Only one set of customizations; i: ?8 e3 D' p/ l0 }. T: Y
!  will need to be maintained while still making use of RIBBON_STYLE to 0 `/ y, F9 d! U6 j
!  control the presentation of the buttons on the Ribbon.9 ^) Q2 @0 ~' M
!
: E2 J& S. Z) ?7 q* i5 U3 VGROUP  customer_toolbar_alternate.tbr
3 \4 ]- Z2 I( g% a- _5 Q( g
, c1 c/ Y4 r" Q# v!  The third group represents a Ribbon group that has been created explicitly$ y- Y% @$ I4 s% p1 W* n
!  as a Ribbon group and will not exist in Classic Toolbar mode.  This is the
& z9 `9 I) f( W/ b% K!  preferred option since the user will be able to take advantage of all the , U( r# P7 l3 R: l. l5 q( W
!  layout styles and containers offered by the Ribbon.  % o, T- w6 N* c/ B
!
# u9 l# O7 k2 ?!  For customers that will deploy both Ribbon and Classic Mode customizations,
" U4 ^+ m* a8 L% G- f6 `7 Y!  this approach will result in no synchronization and two sets of customizations 7 C9 J5 q4 ]- j
!  will need to be maintained.8 j6 h8 \/ f$ D8 d+ E: W/ t2 a( n5 F
!8 }3 x! L3 r: h0 J- O, z
!  A group can alternatively be defined directly inside the .rtb file by using the
8 f1 a, }" M$ K0 B7 U/ x  P5 U!  keywords BEGIN_GROUP and END_GROUP.  
+ W+ n9 U* M" O. g- l" v!6 k/ U5 r$ l. p
GROUP  customer_group.grb* i1 D/ @( U. |7 o* F/ `7 _

# S7 g, e0 a  w& w6 i) I8 M2 {!  Example of a button that is placed directly on the Ribbon without being
) c( S" A9 M% \" ]- \# |- ?) T2 @$ l!  contained in a group.  This is a simple way to add a button to a tab
+ W9 E8 ~# {$ |1 e, |$ z!  but is not recommended for many buttons since groups have advantages.
; ]2 L1 ^8 n+ d8 R6 t!  
+ x; q% ]5 O; |" ?& B& I5 O; ~/ p!  A few advantages of groups:
/ [8 h# o+ Z" m+ u!     1. Easier to move many buttons around together in quick customization.  
. m; d( Y0 R% G!        For example, MB3 on a group and choose "Add to Left Border Bar".  
- u( B2 M! R% C9 M!        This will move the whole group to a new location.  If buttons are % e# Y. Y0 F; L" n
!        not in a group, they need to be moved one at a time.
. V/ P; q+ R9 y2 W; f!1 ~& U3 z. b$ n; Q" r: a' o
!     2. Provide a label to describe its contents.6 _5 ^, I$ T" O( C9 Q4 z+ R' _
!
. n$ J+ W7 @' T# QBUTTON CUSTOMER_BUTTON_1# F9 L$ f$ x* a
LABEL Button1 Directly on Tab
5 O$ P5 j) m  X9 o9 r  W$ U" H
. o1 J: W2 e; M* e7 |* x% U5 d/ k4 @" M) y9 u) s

; G  |) M2 a: j; Ucustomer_toolbar.tbr/ T# c5 a5 a4 p; @' p5 k% r
!  P+ M9 C+ K& M& g9 j) P
!  Customer Toolbar File
5 P- Z2 |* p0 w$ O& U& k  F( C!
: t0 Y7 a4 f' |+ B% V! t- d$ E' z!  This is similar to an existing toolbar file containing2 n# z! E1 R) x0 \
!  no Ribbon changes.
0 Z4 ^# ^3 V0 y!
4 q: _% V, x- A! U& B: d  W! Q4 j!  In Classic Toolbars mode - This toolbar will still show up in the
/ v' C  P2 s: o( u, a) U!     toolbars list.
$ M# c7 a1 J; v!. ~+ i( ^+ Z* f# L
!  In Ribbon mode - This toolbar will be automatically converted to a
7 B$ `5 t, T  n. H!     Ribbon group and will appear in the "Classic Toolbars as Groups"
2 ]) _0 L) ]! l& S!     section in the Customize dialog.2 X0 T8 }, ?& `. S+ W9 }
!  3 k( C& K8 W. b' H+ r9 X6 j& Q
* c8 f! `; U) c6 ]7 U6 \3 K
TITLE Toolbar$ [$ Y) D# G" B
VERSION 170
9 G8 N* L1 n8 W6 q7 b# s! \/ `4 x
* x1 T6 ^' z* w8 \BUTTON CUSTOMER_BUTTON_1  C0 l( F+ `& T5 N; r

4 F2 o8 R4 U* i. yBUTTON CUSTOMER_BUTTON_2
: c/ M0 \& b6 |/ x( u1 s, R) n" Y; p/ W' K, X' o- R1 d! ~
BUTTON CUSTOMER_BUTTON_35 v/ i7 Z, K, c" ?5 \
% A0 c3 D) E0 h8 r8 @, @4 ]3 Q' z( _
BUTTON CUSTOMER_BUTTON_4
+ |4 r# y! O/ W, O5 U- D$ c" Y7 ~" k9 J% H! Z  u) J$ q  y, c, L% i6 I
BUTTON CUSTOMER_BUTTON_5
( W# v/ {! |8 `: W& [) I9 i  e  v8 W
; ]8 B4 f, Q' x2 o- q" `/ M. Y; g
0 h6 F" C( Z; X( e: X5 C& f8 u+ b* i& ]& {! B, j6 e
customer_toolbar_alternate.tbr: P8 L6 p  P+ j$ G8 o9 Y+ G1 Y
!
. J9 @6 p5 \0 B- k!  Customer Toolbar File (Alternate)
5 `( }+ d  F' `4 W1 o!6 ^5 M- o3 k# D0 U, Q) O  V
!  This is similar to an existing toolbar file with new
7 j3 ^  u6 e2 C  n) K; _) {!  Ribbon styles added.
% _6 H! j  u) t0 v8 A$ e9 |!  
, ~2 N1 k) S! F; B6 f) Z% @8 H!  The RIBBON_STYLE will be honored when the toolbar is loaded - D8 C; }8 E& l3 F
!  in Ribbon mode as a group but will be ignored when the toolbar
4 S% l% T5 e3 c. ?8 G3 U7 e!  is displayed in Classic Toolbars mode.3 V5 _  |: v9 G3 b7 ^6 Q! }
!. [) ?7 A/ o7 v% `' R) H; x
!  In Classic Toolbars mode - This toolbar will still show up in the / n9 A5 x" F: ~
!     toolbars list.
6 Q$ z4 S! A# M% ^: }!. m& R- {9 g9 q( O6 z& ?7 `' k
!  In Ribbon mode - This toolbar will be automatically converted to a
7 h- M; @3 x, `' e!     Ribbon group and will appear in the "Classic Toolbars as Groups"
$ C- \4 m8 U4 F( o0 {! Z!     section in the Customize dialog.7 I: n2 [. m, e! ]
!4 s9 d2 b1 M1 C3 t3 n0 g

9 z6 _( P0 w$ i6 ~9 XTITLE Toolbar (Alternate)9 }. `) o6 s$ P
VERSION 170) U% V3 V! p+ @- _1 _. f, H

! s" k4 M  a' |% Q' [7 ]) mBUTTON CUSTOMER_BUTTON_1
8 {9 [. |6 [  X6 Y+ x# cLABEL Toolbar(Alt) Button1$ _! V5 j  H  @6 `/ z
RIBBON_STYLE LARGE_IMAGE3 b( J4 \; E0 d) ^

$ C& @1 A/ l2 E7 i4 x$ SBUTTON CUSTOMER_BUTTON_2; i/ }' c; [  n2 n+ r* }; m
LABEL Toolbar(Alt) Button2
/ F0 @9 X- i' y+ o6 n5 Y" _! URIBBON_STYLE LARGE_IMAGE6 V1 _) M" b3 X; D9 Q9 A

4 n& v0 n7 _0 ?3 U$ ?! ~; F1 {BUTTON CUSTOMER_BUTTON_3
/ b8 i; _9 Q0 u9 U9 B8 F3 rLABEL Toolbar(Alt) Button3# w, |0 d* `) T. A: l
RIBBON_STYLE SMALL_IMAGE_AND_TEXT
, t  z3 h( E1 v& E; e2 Z* U  M# a7 x8 Z
* J# `7 |- Q% Q3 p5 W7 @BUTTON CUSTOMER_BUTTON_49 p2 Z: r0 D7 c6 J1 S
LABEL Toolbar(Alt) Button4
4 e7 u+ ?& C. g& o* w* aRIBBON_STYLE SMALL_IMAGE_AND_TEXT. g, U4 p9 O( C6 C6 a

6 F& T* I7 K/ P3 \BUTTON CUSTOMER_BUTTON_5  @5 A7 ^6 G- U, b
LABEL Toolbar(Alt) Button57 D0 p- p% v5 x# D, G# o( z$ Z3 S2 a
RIBBON_STYLE SMALL_IMAGE_AND_TEXT
- q" K) b9 i- A! U3 t  b( J* a7 _8 U7 c$ t

: X1 V# ?. u% E- C6 x  c/ g0 B/ Z
customer_group.grb1 E7 Z7 T$ u" ]$ B7 E+ e; b5 O4 t
!2 S: t" q( c  P! J* k; b
!  Customer Ribbon Group File( z6 t. q7 p' A/ C
!
/ z( T) G1 Q! [6 F7 G!  In Classic Toolbars mode - This group will be unavailable
* q: s2 u6 j3 ]4 l9 X) y!. b7 O2 i* r: L' {
!  In Ribbon mode - This group will show up in the "All Groups" list
! p+ I6 d9 r' {/ j!     in the Customize dialog.+ j" v% R2 S, P4 a, U( ]
!. N$ g8 z2 i# V- {& h
!  The labels of the buttons are defined using the RIBBON_LABEL token in the MEN files
6 F7 I1 I/ d5 C% [( E, ?& e!
- u% C( Q& o) b( `$ o, ~' ]' z* f" k4 v' ]' @* i0 j
TITLE Group
5 z- P) w4 q: [' b3 FVERSION 170% M* B) N6 b% o" E; f  _( h: R
  K* l; q' S) r& {: g& c( `; i; }
!  No LABEL defined, using RIBBON_LABEL defined in customer_men.men
) c& {' I' r! u0 S8 z7 FBUTTON CUSTOMER_BUTTON_17 v- d1 B$ J6 {# a
RIBBON_STYLE LARGE_IMAGE2 {5 C5 |3 E, L; E( o  t; o! O" J% D

( R% Q; @* l/ }! ?/ T9 Q9 p, O# \!  Example of a gallery defined in a GRB file.
! k, A; K4 L* _  H! 5 Z! H4 D4 ^8 m5 F% x
!  If this gallery is to be used in other places, then it could be ( U# v' g, K) t0 G6 v# B, d$ ]
!  defined in its own gallery (GLY) file and referenced here
. {" `2 Z/ C5 x5 E6 B# L  D* x, Z!  Example:3 t0 s" P  g% u
!    GALLERY customer_gallery.gly7 s, v4 |- `9 ?5 T3 M  A6 K
!0 L1 }8 M, p& v8 \* r- h1 N
BEGIN_GALLERY  CUSTOMER_GALLERY
& d- z/ f( C6 M' rCOLUMN_IN_RIBBON 24 k1 |  I( T% b3 q
COLUMN_IN_POPUP 2) M6 |4 m7 R# u3 \" u* i3 U
LABEL Gallery
) c! g7 X$ ?: q( \0 J( eGALLERY_STYLE MEDIUM_IMAGE_AND_TEXT
( @& \$ y$ ]/ F7 V, r, M) x# K
    BUTTON CUSTOMER_BUTTON_2* I  S% E7 {2 x# c3 x8 _
! A1 _2 ?- {" d1 \" p5 t) w$ }4 f
    BUTTON CUSTOMER_BUTTON_3
/ s8 m' V/ o9 n# I) l) n4 W5 f2 Y& w" o& u: J$ z
    BUTTON CUSTOMER_BUTTON_4* q' u1 k% e# C- f* T

" g8 @& x- V) O& {" Q    BUTTON CUSTOMER_BUTTON_5
- |0 A: E: |, g# y/ F( P1 H- ~- {$ W' j4 A1 M  u" t- u
END_GALLERY/ }2 ~7 n; `7 O- U+ M/ a5 x

7 i& r( [+ I4 J! R) v
* t- V3 f: R+ H7 g* _
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.diantuankj.com/ doTeam.tech
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

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

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

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

    我知道了