|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
1 `! ~( C% _! Q6 l4 v
& q7 t9 z/ L! f, I* P, rNX二次开发源码分享:自定义yes或者no的确认对话框
3 d( H+ u+ E5 V7 a
4 P3 T2 y* u% ~0 {6 v8 S& \static bool AskYesOrNo(string title, string message)
- Y8 v0 j( k+ l/ ]& g {
* j$ P4 n$ p/ [8 Z0 [& `; h string[] messages = { message };
' ~6 g8 j5 a& h) B/ i9 Z UFUi.MessageButtons buttons = default(UFUi.MessageButtons);
4 l0 w% W, H7 {5 V S+ P( ] buttons.button1 = true;
* F3 x- J% D, @/ L% T buttons.button2 = false;
1 L4 T% v5 K, c0 u4 }& e1 ]0 N buttons.button3 = true;
5 u6 A# z7 w# D% t+ G$ Z9 C# A" i buttons.label1 = "Yes";
, M. G, j y' W0 J7 g# v( } buttons.label2 = null;
5 p$ l: S; d, D4 d buttons.label3 = "No";# G, H! \* D: j( G# A) S6 V9 P* Y7 Q
buttons.response1 = 1;
% \7 A% X9 g- B( j) k& ? buttons.response2 = 0;5 b# Z4 }! u, O& \3 u
buttons.response3 = 2;
5 f! O$ O; e. Z) ^ int resp = 0;
* [/ f* F) s, k# j+ x) u: W( d4 u- @$ X' Q6 A
theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM);
+ q7 x% C k: h! Y% u* K theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion, ; u0 [/ i j+ i D Y% b3 S
messages, 1, true, ref buttons, out resp);
; n, E; s2 }* X8 | theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM);
' f# I2 f9 ^) R0 c
/ K+ \& l5 B! t! g6 r, \/ T3 Q! _( m if (resp == 1)
4 p! h. m% T7 n# E& R! l return true;
Q* Q0 t2 g9 B6 Z' m! B6 B% g else: ?5 z3 p4 q. |# D; z3 R( N! R# p
return false;, C$ O8 R3 Q$ z6 L& ^
}- h& v3 P U/ Y: s/ C
& f/ `* N; _; l# M) c! M$ u/ w! B, |* t0 S8 ]- k
|
|