|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
1 J" u! P( o: k0 QNX二次开发源码分享:用ufun函数选择一个装配组件
3 [/ L" _6 t' @6 v* f
5 d4 }0 x- Q2 g6 Ystatic int mask_for_components(UF_UI_selection_p_t select, void *type)
7 R" W h$ P7 [9 ^0 d% S' h# R{
. B1 U7 r: D7 G% l UF_UI_mask_t9 M* X! s* X* F* P
mask = { UF_component_type, 0, 0 };
3 g- ?! o" q1 }2 O" I; E0 z- x6 o- f6 b2 y! f+ l$ h) `
if (!UF_CALL(UF_UI_set_sel_mask(select,
4 L5 {* t8 T8 A% x) s. R) F UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC, 1, &mask)))) U9 Z% \! l& G3 V' t. k
return (UF_UI_SEL_SUCCESS);( W. _. d. w, r. I8 P
else F# D. n$ P6 _$ k9 F. b
return (UF_UI_SEL_FAILURE);
8 U( g/ a' u( ^}
1 |4 Z) h& j" |, G( Z1 m0 z( @
* O, c s- k! Cstatic tag_t select_a_component(char *prompt)
! w1 o0 W! q& F' h' k+ e{
6 v, U3 Z0 [! k6 Y1 i7 D% G$ }1 n int/ ]/ M9 y" t0 N7 l' O* O* }; `
resp;* V. G r' D M# h5 `' M
double
. k$ t9 X" {4 s cp[3];
; ?" K9 ]/ m, f. N% _+ g, C6 W tag_t: R6 K- q! m t) J, F
object,
4 I$ j8 A4 ^; t2 W4 @+ R* U Z view;
7 R& o! C: C% g. a
9 ]& B3 N6 m! X1 v- ] UF_CALL(UF_UI_select_with_single_dialog("Select a component", prompt,( b0 E `$ |4 n2 r
UF_UI_SEL_SCOPE_WORK_PART, mask_for_components, NULL, &resp,+ `- d' L& k/ ]* u
&object, cp, &view));
. I8 y% O" d/ y3 |( E
( Q) `! t) I; G, p% t& w$ E if (resp == UF_UI_OBJECT_SELECTED || resp == UF_UI_OBJECT_SELECTED_BY_NAME)
: o1 b q% v# k/ Y4 P; @6 ]* K; n {1 f o5 m7 a( v0 Z- z4 I
UF_CALL(UF_DISP_set_highlight(object, 0));6 ?9 g4 l- o$ C2 r% N
return object;
: C9 g. b$ ]4 _' {6 m, x }
5 x/ h Z8 H% [$ x: B else return NULL_TAG;
: e2 r" D1 i, z, M" _8 _
) Z" W/ f* _, C2 o5 @2 h}2 s* ?0 G5 M4 j9 m3 C
; j- }) J: R, c# Q+ u3 Z
|
|