|
|

楼主 |
发表于 2014-3-7 10:16:19
|
显示全部楼层
来自: 中国江苏苏州
Radio I/ G) v1 y4 W4 C; p/ x
extern void Test_set_radio_sensitivity ( int dialog_id, char *item_id,( c( ], r- n7 i0 r
int subitem_index, logical check )1 B0 ?! Y3 }9 s8 \; f/ R
{ UF_STYLER_item_value_type_t item_sensitivity;: N) }: ?6 n/ K; A5 x
item_sensitivity.item_attr = UF_STYLER_SENSITIVITY;
0 {4 E; ~; u4 c0 a; \" aitem_sensitivity.item_id = item_id;
$ c$ T. }7 c' Z! `; Yitem_sensitivity.subitem_index = subitem_index;+ J. n7 z$ ?0 |% R
item_sensitivity.value.integer = check;
$ \6 _- I3 G/ t4 J& jUF_STYLER_set_value ( dialog_id, &item_sensitivity );
- I) n; F7 B/ [}3 d% T8 I4 o; L' b% O, L' _" D' F8 K
extern void Test_read_radio ( int dialog_id, char *item_id, int *value )! ^9 h* d; W$ E& [5 e" m. D
{ UF_STYLER_item_value_type_t Radio;
. Y1 A) J' V5 m$ u& |+ i: JRadio.item_attr = UF_STYLER_VALUE;
) B0 ?+ r" G, k2 n4 C, O! L* S$ nRadio.item_id = item_id;
' N( o( \) W/ ?2 h- K# O* G% _UF_STYLER_ask_value ( dialog_id, &Radio );
! w7 t$ }' _0 a, |: [) J! j/ W- i*value = Radio.value.integer;
- _& `. f: t6 @+ A0 Y}
) [: H `9 i; |extern void Test_set_radio ( int dialog_id, char *item_id, int value ) S& }) v0 A+ _! g; f# ^- ]' ` d
{ UF_STYLER_item_value_type_t Radio;; n8 z2 z$ e/ d4 [4 `9 m
Radio.item_attr = UF_STYLER_VALUE;) R( _5 L5 }7 H4 v: `3 j) V
Radio.item_id = item_id;
5 g$ |: ^/ t, WRadio.subitem_index = value;: y& T0 |1 d0 q' x
UF_STYLER_set_value ( dialog_id, &Radio );
0 t' |; E( Q. t# _6 M}
6 L. \: g, L s0 e% Y4 a& lBitmap7 R9 a2 q8 i% I1 o7 [
extern void Test_set_bitmap ( int dialog_id, char *item_id, char *name )
6 T+ Z. l% `6 x. P- Y" o{ UF_STYLER_item_value_type_t bitmap;5 N+ c* g# l" m/ m# [2 J
bitmap.item_attr = UF_STYLER_BITMAP;
# U8 C7 Q& B' S" h4 nbitmap.item_id = item_id;; C8 Y# O9 b9 X1 }4 g/ l) |
bitmap.value.string = name;
, X, h" a6 w+ p- S: s- RUF_STYLER_set_value ( dialog_id, &bitmap );) w, L! T: Y7 H& t
}
$ d3 L, ~& E/ d9 J' IToggle* g3 _; b: S2 t; b
extern void Test_read_toggle ( int dialog_id, char *item_id, logical *check )+ U2 m& H) r* f
{ UF_STYLER_item_value_type_t Toggle;
2 H: o" h4 n2 [5 \0 p( YToggle.item_attr = UF_STYLER_VALUE;
$ h, v% r, l4 x }; T a- kToggle.item_id = item_id;6 q/ f. R s7 q! K! y7 F6 h* e
UF_STYLER_ask_value ( dialog_id, &Toggle );) x; u7 s; t. J8 o9 m! C
*check = Toggle.value.integer;9 C/ g: I; }$ l
}
' z' b" f* t( B g% I2 ]. \; pextern void Test_set_toggle ( int dialog_id, char *item_id, logical check )
/ l8 L, [! N8 H' x5 m{ UF_STYLER_item_value_type_t Toggle;
, Q; k9 G% [8 C% L5 ^Toggle.item_attr = UF_STYLER_VALUE;
9 |4 C6 {! M9 l9 v% d: B/ r- _: F/ ]Toggle.item_id = item_id;
& \( r# N6 L0 ?3 O6 |+ HToggle.value.integer = check;% g. T. D( N/ m3 ?/ g
UF_STYLER_set_value ( dialog_id, &Toggle );* N G$ ~7 P7 }: N$ v% P% U
}- {; s: v8 `! j
Dialog
8 r$ Q: W1 l0 L" i' wextern void Test_set_dialog_title ( int dialog_id, char *title )1 R6 A1 f% d. m: b
{ UF_STYLER_item_value_type_t dialog;& G7 z8 X& Y/ D- M0 D
dialog.item_attr = UF_STYLER_LABEL;+ S; V/ W6 J; z* e
dialog.item_id = UF_STYLER_DIALOG_INDEX;
7 m; v* u4 \9 Zdialog.value.string = title;
2 e j% \6 ~+ x6 u5 `UF_STYLER_set_value ( dialog_id, &dialog );
1 I6 f( f2 N. k# d5 A5 L}/ n. [4 A( G5 |9 V
extern void Test_set_dialog_sensitivity ( int dialog_id, int item_id,
: O$ c! V5 ^" ]6 S' V. xlogical check )5 r* A& g" s6 W! a: D
{ UF_STYLER_item_value_type_t dialog_sensitivity;9 {2 \9 ?9 ^3 i L. _1 w4 D& M% Y
dialog_sensitivity.item_attr = UF_STYLER_SENSITIVITY;
. U- E& U: C& s; _4 x4 G; `* cdialog_sensitivity.item_id = UF_STYLER_NAV_INDEX;) L! B0 n6 t' K0 s+ D, [
if ( item_id == 1 )
7 d* I4 j" E) n# `! l1 _1 h' S" udialog_sensitivity.subitem_index = UF_STYLER_OK_INDEX;
' P2 D$ B' u: O: J( {+ I) ~else if ( item_id == 2 )* Z# X* X0 e4 G
dialog_sensitivity.subitem_index = UF_STYLER_APPLY_INDEX;, C# D. h2 b* o S. v6 ~
else if ( item_id == 3 )
: h5 Q+ F( v5 d: U% @1 R9 Edialog_sensitivity.subitem_index = UF_STYLER_BACK_INDEX;
3 A- i' z; N6 I8 \' j! Qelse, |! h( v1 Y4 E# v
dialog_sensitivity.subitem_index = UF_STYLER_CANCEL_INDEX;
# E# _/ \7 y, N' u N' w( B7 _! [dialog_sensitivity.value.integer = check;7 k- y) d2 z8 S: E6 F
UF_STYLER_set_value ( dialog_id, &dialog_sensitivity );) m) A7 d! i0 o ~1 K; g
}2 Q$ o# Z; B0 w/ M
Option n0 x3 _% Q0 R5 m* W6 d) s5 Q7 Y
extern void Test_read_option_allitems ( int dialog_id, char *item_id,, s; Q+ {6 d1 z z( R: e: s
int *count, char ***strings )
1 ~, A$ j! a2 |4 A2 J9 t( w, B{ UF_STYLER_item_value_type_t Option; int i, error = 0;6 X9 d/ i8 i9 [ P
Option.item_attr = UF_STYLER_SUBITEM_VALUES;
, C: O( i! z D* C, u) TOption.item_id = item_id;! x0 f$ D- o5 j9 e4 j
Option.indicator = UF_STYLER_STRING_PTR_VALUE;
+ }1 T. m, v& I/ AUF_STYLER_ask_value ( dialog_id, &Option );
g( s A0 n9 Y& Y3 O9 \" B1 y3 @(*count) = Option.count;
: Z! Y- h: C, M7 i(*strings) = (char **) UF_allocate_memory ( Option.count * sizeof ( char * ), &error );
. S( {- z- {, ?, a) b0 G2 pfor ( i = 0; i < Option.count; i ++ )4 d' f0 ~% a) n/ g5 ~
{ (*strings) = (char *)UF_allocate_memory( 133*sizeof(char),&error);, v; h' a+ z% p4 d6 k. Q
sprintf ( (*strings), "%s", Option.value.strings );( m4 r: L9 k' u- B2 } G2 x' {
} UF_STYLER_free_value ( &Option );
8 f! U+ f& B$ w} c0 {0 E3 \# O2 X/ Z7 K
extern void Test_read_option_activeitem ( int dialog_id, char *item_id,
2 V$ K# v9 b4 o& L3 r4 _( H2 _int *value )/ h3 q H4 K. b
{ UF_STYLER_item_value_type_t Option;9 Z6 P$ S9 i$ O' V% N% M/ S# `: e4 z
Option.item_attr = UF_STYLER_VALUE;/ z8 s$ V, o/ W7 d2 M% e7 n
Option.item_id = item_id;
9 e" z' Y- X# \, s# v. _UF_STYLER_ask_value ( dialog_id, &Option );
3 H2 v& z8 d" V; b' u3 h: v4 c*value = Option.value.integer;
/ j) w- n) ?" ^4 F% X}
% x$ C; w1 n; q5 ^extern void Test_set_option_allitems ( int dialog_id, char *item_id,0 L" `/ _+ ]9 n2 t! a& ?
int count, char **strings )
2 {7 @' @: u5 A$ E' x$ o{ UF_STYLER_item_value_type_t Option; int i, error;
2 z/ `" S. }1 A' I, _' H: J/ R' COption.item_attr = UF_STYLER_SUBITEM_VALUES;
& `; _& W; X/ w: U2 S' g8 aOption.item_id = item_id;. ?/ K% d9 m5 p6 S7 D8 J
Option.count = count;( s" c3 A) R# b# |8 }$ y
Option.value.strings = (char **) UF_allocate_memory ( count * sizeof ( char * ), &error );8 n* V+ I" v0 N5 d
for ( i = 0; i < count; i ++ )7 n5 x7 c# {' [- N. b {
{ Option.value.strings = (char *) UF_allocate_memory ( 133 * sizeof ( char ), &error );
! O- K- Z5 v" u, hsprintf ( Option.value.strings, "%s", strings );# t* J$ d$ S& M Y5 w
} UF_STYLER_set_value ( dialog_id, &Option );0 P# Z" O. c; s7 J6 v& t
UF_STYLER_free_value ( &Option ); p6 [9 V( A6 i; S
}
+ X. M' `0 H1 d+ `7 Z+ {1 cextern void Test_set_option_activeitem ( int dialog_id, char *item_id,$ G+ Q# D8 I+ t' M7 Q2 v
int value )
# `9 v3 f! U" x2 W5 T7 N% W{ UF_STYLER_item_value_type_t Option;$ [' c+ e( Y7 \# o" ^
Option.item_attr = UF_STYLER_VALUE;
9 q2 a" w( q& S3 h# }0 QOption.item_id = item_id;
0 n+ z& r% D4 I4 E" cOption.subitem_index = value;; _" r! W% h: _8 x
UF_STYLER_set_value ( dialog_id, &Option );
0 W4 t1 y! m- w$ [* Y7 ]}5 H: k4 u* j+ ~+ k& p( c6 @' U& I
Single Select List" ?3 G' S4 S' ^" K# \
extern void Test_read_singleselectlist_allitems ( int dialog_id,
* n9 f4 {- s9 T& s2 }* Vchar *item_id, int *count, char ***strings )! m x! R1 |! j
{ UF_STYLER_item_value_type_t Singleselectlist; int i, error = 0;+ m+ b1 E7 R2 i R: r, x6 v
Singleselectlist.item_attr = UF_STYLER_SUBITEM_VALUES;
* a, B8 q& j9 ISingleselectlist.item_id = item_id;8 {. p7 `, ]; S. ~' f6 E# I
UF_STYLER_ask_value ( dialog_id, &Singleselectlist );, D4 @. f+ O6 o" O% ~
(*count) = Singleselectlist.count;. M, W; m* W, H) F
(*strings) = (char **) UF_allocate_memory ( Singleselectlist.count * sizeof ( char * ), &error );
7 |' w# i1 ^; `1 Pfor ( i = 0; i < Singleselectlist.count; i ++ )$ s4 A3 R: |- g' i
{ (*strings) = (char *)UF_allocate_memory(133*sizeof(char),&error);
8 p2 y' V0 y) jsprintf ( (*strings), "%s", Singleselectlist.value.strings );
; N! R2 ^; {' }: X1 `( `} UF_STYLER_free_value ( &Singleselectlist );
8 W# s8 v- ~9 q}6 w( [6 x# ~5 V! S+ |
extern void Test_read_singleselectlist_activeitem ( int dialog_id,
7 C0 B, X$ Y( }+ l [+ G3 Gchar *item_id, int *value, char *string ). m. n2 J; L2 N2 u/ F/ r
{ UF_STYLER_item_value_type_t Singleselectlist;
5 m5 q) R" x2 w- U. x9 BSingleselectlist.item_attr = UF_STYLER_VALUE;
2 p& J: X" z8 Q% A [. j) qSingleselectlist.item_id = item_id;
8 ^6 P. R" V$ x$ f- V; H9 sSingleselectlist.indicator = UF_STYLER_INTEGER_VALUE;# e( L$ ~; Q4 r% _8 H" K
UF_STYLER_ask_value ( dialog_id, &Singleselectlist ); S7 D' @& I; B
*value = Singleselectlist.value.integer;
& D/ z) g# [1 S8 hSingleselectlist.indicator = UF_STYLER_STRING_VALUE;, a, T9 V9 ?9 S* |0 |
UF_STYLER_ask_value ( dialog_id, &Singleselectlist );
; H$ M/ u: W9 \( V2 F j$ ^3 Fsprintf ( string, "%s", Singleselectlist.value.string );
& \) m- H1 p% j! Y}
& G9 D* ]! ^2 H2 I1 }2 F& Vextern void Test_set_singleselectlist_allitems ( int dialog_id, char *item_id,
3 q% A/ ^; K X5 u% gint count, char **strings )
) |" y8 A# i, R+ A: |( ~* J{ UF_STYLER_item_value_type_t Singleselectlist; int i, error = 0;8 x$ Q1 q% }/ `1 j
Singleselectlist.item_attr = UF_STYLER_SUBITEM_VALUES;
7 T8 k3 I" E; T2 lSingleselectlist.item_id = item_id;
( j, ]7 w! f! v& i0 s0 u |1 PSingleselectlist.count = count;. o: `& U# X; U* w% s1 f G
Singleselectlist.value.strings = (char **) UF_allocate_memory ( count * sizeof ( char * ), &error );9 u e. X6 D' {: ^
for ( i = 0; i < count; i ++ )
v/ q7 P$ C( R! X. c9 h{ Singleselectlist.value.strings = (char *) UF_allocate_memory ( 133 * sizeof ( char ), &error );; u B! d+ `! q/ D
sprintf ( Singleselectlist.value.strings, "%s", strings );$ E6 |5 Y' W. s* y! N9 \
}
" A1 c& c4 ]4 }7 L5 fUF_STYLER_set_value ( dialog_id, &Singleselectlist );
' m/ H8 k# y7 s! uUF_STYLER_free_value ( &Singleselectlist );4 J+ ~$ C/ L3 P! q6 `# u% R$ j
}3 E0 r" s! l/ U
extern void Test_set_singleselectlist_focusitem ( int dialog_id, char *item_id,
' R0 q0 j8 ~8 I& @! b# ]/ qint value )" n6 y6 Y1 O) v; e
{ UF_STYLER_item_value_type_t Singleselectlist;
+ ^5 l% u5 t* sSingleselectlist.item_attr = UF_STYLER_VALUE;
* t( N! U- S( c! F% u2 `; x; x5 rSingleselectlist.item_id = item_id;
- B) ]& x6 `2 v6 oSingleselectlist.subitem_index = value < 0 ? UF_STYLER_NO_SUB_INDEX : value;5 j2 _7 W: I- ?0 r/ P. ^) e# |
UF_STYLER_set_value ( dialog_id, &Singleselectlist );! `% s3 j, E/ e' I, h
}
( t6 Q( E% H7 j& F, ^, q0 C, }Property Pages5 V' c1 F5 n0 z1 I" b; r
extern void Test_read_propertypages_activepage ( int dialog_id, w3 n2 `) `+ ] t/ o( T
int *active_page )
7 N1 M1 a) k' q& I9 Z9 s( j5 A{ UF_STYLER_item_value_type_t Propertypages;4 x1 Q+ s8 ~4 ^3 A8 X K* M3 s! Y
Propertypages.item_attr = UF_STYLER_ACTIVE_PAGE;
- _1 @; q+ y# A4 B! bPropertypages.item_id = UF_STYLER_DIALOG_INDEX;
% K0 y1 [4 I! c+ j8 A, A# KUF_STYLER_ask_value ( dialog_id, &Propertypages );3 E m# |$ f' l" ?4 ?0 Z! _; E
*active_page = Propertypages.value.integer;
1 U+ g% q, m- g# m1 K$ E; G/ l% A. K}# o- t1 m8 T: n6 K& @7 l
extern void Test_set_propertypages_activepage ( int dialog_id,
3 p( @/ J& [' ~int active_page )
9 p3 L4 W! Y5 Y0 Y }4 x{ UF_STYLER_item_value_type_t Propertypages;
6 i6 ^) @1 e& ~) `Propertypages.item_attr = UF_STYLER_ACTIVE_PAGE;
" T$ d; a" S7 Y: D; M" bPropertypages.item_id = UF_STYLER_DIALOG_INDEX;" h1 {8 L* ^7 B: `1 I! E& \
Propertypages.value.integer = active_page;
T* i; a7 k7 yUF_STYLER_set_value ( dialog_id, &Propertypages );7 t8 S6 e8 {' E# Z) y
} G+ L, D4 m; M2 J3 q- {! h% G! x+ \
Color Tool9 O& d' ?: h0 ]
extern void Test_read_colortool_activecolor ( int dialog_id,9 t1 s9 b8 ?( ~6 ~: @4 |5 R
char *item_id, int *active_color )
# L* a$ `4 \; ]8 F{ UF_STYLER_item_value_type_t Colortool;
3 i( k$ n0 I2 N% AColortool.item_attr = UF_STYLER_VALUE;# k9 v1 O4 N1 j- e' f: Z
Colortool.item_id = item_id;4 p& a1 N# s; }/ \0 J4 N0 J: }$ p
UF_STYLER_ask_value ( dialog_id, &Colortool );
% u4 ^8 r/ j7 T" \*active_color = Colortool.value.integer;
( n/ c* A* w) ~) R9 Q$ I! U}
# E5 O+ m1 {4 I2 D* k* B2 I# bextern void Test_set_colortool_activecolor ( int dialog_id,5 ?& \ ?) M @ Q2 z; _
char *item_id, int active_color )
, N: z$ S0 D+ ^ U/ G2 r{ UF_STYLER_item_value_type_t Colortool;2 U4 g. ~5 ~7 B
Colortool.item_attr = UF_STYLER_VALUE;
" v6 h* h- @# W, `Colortool.item_id = item_id;
" d$ h$ T% r' i( Y5 P+ ~; OColortool.value.integer = active_color;1 J+ h/ k$ z/ `2 d% t9 v% q
UF_STYLER_set_value ( dialog_id, &Colortool );
, k" R3 }6 x1 Z. g3 y$ _} |
|