|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
0 s; I8 j7 I4 C3 f
" c9 M" ~0 w4 I V. Q+ c+ D, qNX二次开发源码分享:自定义yes或者no的确认对话框3 u( u# f ^, E3 w2 h
" B( ?: k5 c; s# H, Estatic bool AskYesOrNo(string title, string message)
: | O9 s* i- `% b' |( ~& W6 c( U {. z: D3 S$ b7 l3 ^. ]+ h6 \4 N5 a
string[] messages = { message };6 _1 N- n; H- T) Y1 b) Q! A
UFUi.MessageButtons buttons = default(UFUi.MessageButtons);
9 P/ \' Y6 g6 B buttons.button1 = true;+ h* l& p' ?) E4 C U
buttons.button2 = false;# B/ g* M' m% I- p! y3 j
buttons.button3 = true;8 A# K3 R9 d2 f* g
buttons.label1 = "Yes";) Q! y5 Z4 R* z! ^0 g2 T9 n, O
buttons.label2 = null;
, f6 i9 K, O, U8 I: g0 s5 b U buttons.label3 = "No";
& H5 X, m8 n, F buttons.response1 = 1;0 ^- v2 n8 l# _- j- |
buttons.response2 = 0;% }, c0 c! W# W' o, e8 b6 v
buttons.response3 = 2;/ [' v$ E h: S, u* n! j
int resp = 0;9 B6 o# A* p/ g) R
7 V0 H2 K. I m! v+ Q theUFSession.Ui.LockUGAccess(UFConstants.UF_UI_FROM_CUSTOM); F8 g! E9 T. K$ a$ w
theUFSession.Ui.MessageDialog(title, UiMessageDialogType.UiMessageQuestion,
' ~ ?$ h/ d- v" y4 X- D. Y8 f1 j messages, 1, true, ref buttons, out resp);/ m6 Z" y5 Z8 p
theUFSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM); P. q- j) I. I7 x: r' S
( R' S4 e% f4 P5 o J
if (resp == 1)! h4 \+ P) M4 Z3 \5 V# y: Q
return true;: a4 A' o1 G3 d7 L% T4 V% `% m
else9 l% B8 b- p1 {8 D
return false;
2 t- m; A2 j4 @2 [ }: B& S7 e p* V' f. M, f5 ]
7 @% v* N8 Q( L! m( @- |* B5 q2 L v7 ~: z/ o$ z+ X. E1 B- T8 J
|
|