|
|

楼主 |
发表于 2014-3-7 10:16:19
|
显示全部楼层
来自: 中国江苏苏州
Radio" [7 [2 `) y/ E( o5 S* C
extern void Test_set_radio_sensitivity ( int dialog_id, char *item_id,
4 T. D) |, ~* ^, w6 Z* Eint subitem_index, logical check )5 I/ g3 B7 L0 z: W. F
{ UF_STYLER_item_value_type_t item_sensitivity;
5 B* X$ t0 z; [0 a R6 Litem_sensitivity.item_attr = UF_STYLER_SENSITIVITY;
- T% y: s# o+ r' @) zitem_sensitivity.item_id = item_id;- f l9 h1 g3 N9 \' J
item_sensitivity.subitem_index = subitem_index;7 r2 r& ]2 Q9 J) ~* r; c1 X
item_sensitivity.value.integer = check;
" j, M. f& m- ^& m+ d0 f( bUF_STYLER_set_value ( dialog_id, &item_sensitivity );
0 P6 L7 N+ l2 E! d! i7 A. m}" c7 }& U; A4 ^+ \
extern void Test_read_radio ( int dialog_id, char *item_id, int *value )
, P( w* h2 g3 v$ j8 ]& A- }! R{ UF_STYLER_item_value_type_t Radio;! q' @6 P% q# h. D/ d
Radio.item_attr = UF_STYLER_VALUE;
0 Y: Z( {/ r) _1 bRadio.item_id = item_id;
! g) m+ \) ^; k$ w! x/ ~, O- yUF_STYLER_ask_value ( dialog_id, &Radio );; B& H* Z1 Y( A+ h/ x4 a
*value = Radio.value.integer;* j+ x2 m- a% t$ u. H8 s. s
}3 }) M( e4 ^& n/ L1 q5 M" Z
extern void Test_set_radio ( int dialog_id, char *item_id, int value )9 x0 b: b/ i; \ t4 T
{ UF_STYLER_item_value_type_t Radio;
) G) l+ A, I( Y6 `% G8 }7 SRadio.item_attr = UF_STYLER_VALUE;9 ?) |& ^+ P6 b- ]* h$ p) F8 `! E# q
Radio.item_id = item_id;/ P9 m' m3 F* Z! `! j( |/ K& I
Radio.subitem_index = value;0 [; C1 n! l3 Y2 Y, w0 D
UF_STYLER_set_value ( dialog_id, &Radio );
: Q1 c' l( b/ f8 p: x}
; k, x# a5 R. I0 F9 Y; {( vBitmap; ?- S8 M8 ?3 b% a8 T+ x
extern void Test_set_bitmap ( int dialog_id, char *item_id, char *name ), x; Z0 [! Z4 X9 f
{ UF_STYLER_item_value_type_t bitmap;
' i% q- l4 i5 l" vbitmap.item_attr = UF_STYLER_BITMAP;7 R$ |; r6 K2 _- u2 G
bitmap.item_id = item_id;* G2 a8 D# T7 j" m5 P+ U
bitmap.value.string = name;: J# d+ \5 q2 ]7 B7 E' m
UF_STYLER_set_value ( dialog_id, &bitmap );6 x5 U" @. z* X* f& r5 v1 Q q/ _
}
' R: T0 D/ W, CToggle" @$ ^/ ~: m, x3 b! G
extern void Test_read_toggle ( int dialog_id, char *item_id, logical *check )2 A+ g, h" T# c2 S3 z! X1 A+ |% W7 D/ |
{ UF_STYLER_item_value_type_t Toggle;
- T( a$ L2 C# l7 f& g) XToggle.item_attr = UF_STYLER_VALUE;$ R; n# k! ] ~# o3 w4 K
Toggle.item_id = item_id;
$ }6 z+ Y4 k# o2 @UF_STYLER_ask_value ( dialog_id, &Toggle );/ I0 T! x g+ l* t, w" z. r
*check = Toggle.value.integer;, |( }/ G4 _9 K5 _& }+ ^& |8 F% j
}$ y0 x" g6 Z( z) {
extern void Test_set_toggle ( int dialog_id, char *item_id, logical check )
2 W# b* K' V4 H S. A{ UF_STYLER_item_value_type_t Toggle;
' w' r- m/ M) q( t6 V) Q. uToggle.item_attr = UF_STYLER_VALUE;
( |! b8 L: {7 D8 hToggle.item_id = item_id; O* U6 d& l% {) P
Toggle.value.integer = check;( B6 N7 Q5 `" H* q. s7 c% Y
UF_STYLER_set_value ( dialog_id, &Toggle ); {4 M/ ?" ?) R& L% ~, T1 U; G* B1 F
}+ g L5 C6 D$ c) N
Dialog
, l! b$ L; H; n. h d- N+ [6 Mextern void Test_set_dialog_title ( int dialog_id, char *title )
9 w' P* e# w' }: K/ a& [. `{ UF_STYLER_item_value_type_t dialog;$ W8 _( B& X9 d' r4 t5 A/ q* G9 }$ J
dialog.item_attr = UF_STYLER_LABEL;0 j2 B( y$ |, w% E; i. h- Y
dialog.item_id = UF_STYLER_DIALOG_INDEX;
# \# @" q( p. a; r; p5 udialog.value.string = title;9 r6 L1 Z M8 v- m0 n y
UF_STYLER_set_value ( dialog_id, &dialog );" B1 ^, F- N5 G) l( D
}
! i# E% j! q p1 p$ rextern void Test_set_dialog_sensitivity ( int dialog_id, int item_id,
p( i+ _' m( t I% i6 S2 `logical check )
2 p: L9 X+ O8 I5 w{ UF_STYLER_item_value_type_t dialog_sensitivity;
( L( L1 N! Q. C" g! w& \dialog_sensitivity.item_attr = UF_STYLER_SENSITIVITY;
7 ?, i; h- H! Zdialog_sensitivity.item_id = UF_STYLER_NAV_INDEX;
8 J1 r1 p9 ]& v5 v! Mif ( item_id == 1 )
' ^& r6 `1 Y* s3 o& i1 q) Ddialog_sensitivity.subitem_index = UF_STYLER_OK_INDEX;0 r, F; y# ^' @8 A; Y7 D1 [
else if ( item_id == 2 )
+ n u+ V/ O& t. cdialog_sensitivity.subitem_index = UF_STYLER_APPLY_INDEX;1 J2 t+ |5 b! s# A+ N& K; L
else if ( item_id == 3 ). \2 `8 P( |; w4 I
dialog_sensitivity.subitem_index = UF_STYLER_BACK_INDEX;
# @* N' @0 W4 D. }3 e6 V/ h& J+ ielse
3 Y3 `1 K& G( O1 ?8 Pdialog_sensitivity.subitem_index = UF_STYLER_CANCEL_INDEX;1 \$ A* O% N- ?) a
dialog_sensitivity.value.integer = check;% q2 i! ^6 h1 z5 J3 ?3 J
UF_STYLER_set_value ( dialog_id, &dialog_sensitivity );; n( |$ P$ p, g1 A: M4 k
}$ n- L7 I! h1 u8 B6 Z) e/ @0 o/ I2 T
Option
: r6 \" r# t: f) v% zextern void Test_read_option_allitems ( int dialog_id, char *item_id,; }7 c% j f1 B$ X3 l6 P% i0 E* ], K
int *count, char ***strings )1 r0 X. @1 S8 t- M$ Y+ `
{ UF_STYLER_item_value_type_t Option; int i, error = 0;
- Y3 g2 S% [% W& q8 D# g4 X/ f* tOption.item_attr = UF_STYLER_SUBITEM_VALUES;: F2 T: B4 o7 r1 {9 G8 T6 d6 s* F9 D
Option.item_id = item_id;
% j0 [: b, K, O7 ]( L; X# yOption.indicator = UF_STYLER_STRING_PTR_VALUE;
+ g: m4 ~; o0 B5 W1 SUF_STYLER_ask_value ( dialog_id, &Option );. j% [ u+ f' ^& U r
(*count) = Option.count;; }/ T5 [% ?5 {; c
(*strings) = (char **) UF_allocate_memory ( Option.count * sizeof ( char * ), &error );7 F& `* {9 B6 z) H
for ( i = 0; i < Option.count; i ++ )
; ~$ H* Y5 n1 i) b{ (*strings) = (char *)UF_allocate_memory( 133*sizeof(char),&error);: ~* b' D5 P+ C( Q4 ^* \
sprintf ( (*strings), "%s", Option.value.strings );
2 m7 w! i6 [8 M$ E9 |- d K} UF_STYLER_free_value ( &Option );1 r$ i( l* L3 x: F: e. U$ ?* P3 D
}' _% J$ h* s' R
extern void Test_read_option_activeitem ( int dialog_id, char *item_id,! `3 a: W5 I+ S; W* y6 u
int *value )
9 E9 t% N2 Z$ }( g# I{ UF_STYLER_item_value_type_t Option;9 p, g5 _ R4 ]. {4 _
Option.item_attr = UF_STYLER_VALUE;
! E r3 X1 n/ n" XOption.item_id = item_id;
2 C+ ]& U4 P% ]1 O9 w* ?, wUF_STYLER_ask_value ( dialog_id, &Option );
0 P1 K% w$ f5 s5 Z5 r*value = Option.value.integer;) h4 W# ^! |* m8 X; I
}' Y) H% T8 d a& [3 S; _
extern void Test_set_option_allitems ( int dialog_id, char *item_id,, j5 _+ O2 I: X2 T- b6 U \
int count, char **strings )
9 B5 o. Q! }; m' N5 A8 H- L$ i{ UF_STYLER_item_value_type_t Option; int i, error;
( Z, C9 B2 H( q: z" Z6 E' N5 EOption.item_attr = UF_STYLER_SUBITEM_VALUES;
# X6 [- a, e- F% U( ROption.item_id = item_id;
6 L R- }+ g$ g# w' Y& D7 e* LOption.count = count;
7 T) s2 s; e: SOption.value.strings = (char **) UF_allocate_memory ( count * sizeof ( char * ), &error );
- n" u& D6 M+ |% k' sfor ( i = 0; i < count; i ++ )# U R- U, `; H" V2 E$ O, u* {; Y7 G
{ Option.value.strings = (char *) UF_allocate_memory ( 133 * sizeof ( char ), &error );4 {6 ~. e0 M( G3 v5 X" I& U
sprintf ( Option.value.strings, "%s", strings );
% N. R) C. @' g' o9 n} UF_STYLER_set_value ( dialog_id, &Option );" p) ?( d( _- y0 G3 v
UF_STYLER_free_value ( &Option );
' \7 V# w4 E3 F$ w) F* ~} |! g& X; M: O* [2 T; M
extern void Test_set_option_activeitem ( int dialog_id, char *item_id,5 ^& \( V. v. S% F/ f
int value )2 i/ W" \: [8 O, Z8 T
{ UF_STYLER_item_value_type_t Option;7 s0 B7 {, d# |1 ~8 d( Y, U9 v9 T: k
Option.item_attr = UF_STYLER_VALUE;# m3 W% K9 O, k% ^: y. T$ r( ]8 F( D
Option.item_id = item_id;2 w2 G8 \9 }5 J5 g8 H
Option.subitem_index = value;
7 f# S3 I1 i5 y7 `UF_STYLER_set_value ( dialog_id, &Option );; u2 \" }9 H4 g2 E$ d0 r( W
}$ B4 G+ l; q, }% j- R+ U( d* |
Single Select List: ?: F, h G5 `9 g7 ]
extern void Test_read_singleselectlist_allitems ( int dialog_id,3 d4 X/ E1 ^$ a* H) K
char *item_id, int *count, char ***strings )
; b* E0 [0 p2 Q% v. b3 P ?{ UF_STYLER_item_value_type_t Singleselectlist; int i, error = 0;
8 _: W' k2 t2 L6 s" xSingleselectlist.item_attr = UF_STYLER_SUBITEM_VALUES;
* L( w& E' x4 I2 rSingleselectlist.item_id = item_id;. u; d1 R$ d, j6 _/ x
UF_STYLER_ask_value ( dialog_id, &Singleselectlist );- O, D7 N. e7 r1 Y/ r+ {6 C
(*count) = Singleselectlist.count;
, {5 h; g* e+ }1 H' Y5 E$ E(*strings) = (char **) UF_allocate_memory ( Singleselectlist.count * sizeof ( char * ), &error ); t& C7 ` @: p( y) |+ L, g. N
for ( i = 0; i < Singleselectlist.count; i ++ ). n8 F+ c% Z y7 K- z3 M/ P
{ (*strings) = (char *)UF_allocate_memory(133*sizeof(char),&error);8 \- `2 D$ I" w3 z6 s3 w! r" l
sprintf ( (*strings), "%s", Singleselectlist.value.strings );
1 v5 {& {$ S' Q} UF_STYLER_free_value ( &Singleselectlist );4 X: E+ G' H$ a' v! Q* C
}
$ B/ `, S l; textern void Test_read_singleselectlist_activeitem ( int dialog_id,9 }4 |" B6 n1 Y; A0 A2 p
char *item_id, int *value, char *string )
5 E0 @* W0 O2 v% O# \{ UF_STYLER_item_value_type_t Singleselectlist;- a% o$ I) r) O, D/ n! p
Singleselectlist.item_attr = UF_STYLER_VALUE;' @4 m2 E+ A* b/ a" W' ? U& T
Singleselectlist.item_id = item_id;, f; v8 T" S; @
Singleselectlist.indicator = UF_STYLER_INTEGER_VALUE;
! R t8 C. E, {9 ]. mUF_STYLER_ask_value ( dialog_id, &Singleselectlist );7 @3 c% g6 z8 a" b# C
*value = Singleselectlist.value.integer;
: Q* o- \. @ T* S5 ]$ o7 \* k. J; [Singleselectlist.indicator = UF_STYLER_STRING_VALUE;
' s9 m1 G4 v3 t9 E. @9 UUF_STYLER_ask_value ( dialog_id, &Singleselectlist );
' G* L5 O. P! i/ msprintf ( string, "%s", Singleselectlist.value.string );
7 _" J) L$ X& j/ I1 M2 a; _}
% |: G% N' l& Vextern void Test_set_singleselectlist_allitems ( int dialog_id, char *item_id,
5 L6 d( \# m$ V2 U6 i. l3 A9 y& b& Uint count, char **strings )
4 v: ~/ [ S4 W3 G% q7 B0 K9 [{ UF_STYLER_item_value_type_t Singleselectlist; int i, error = 0;
& x4 k, d8 y* G F0 d$ }# x. f$ BSingleselectlist.item_attr = UF_STYLER_SUBITEM_VALUES;
$ N; T, D0 ? a x6 ISingleselectlist.item_id = item_id;
$ ^. ?: v+ V/ c* {- lSingleselectlist.count = count;
! K' ]% L6 t! P+ W/ d6 sSingleselectlist.value.strings = (char **) UF_allocate_memory ( count * sizeof ( char * ), &error );
. a) w$ i; g7 \' e3 yfor ( i = 0; i < count; i ++ )
3 k8 \5 b: b; ~" H) c{ Singleselectlist.value.strings = (char *) UF_allocate_memory ( 133 * sizeof ( char ), &error );
. \' _' B3 c7 c2 t" L2 n% e asprintf ( Singleselectlist.value.strings, "%s", strings );( H4 e6 ]. ~+ D, \, G- U ^
}; ]0 x2 g- G9 d2 h6 _
UF_STYLER_set_value ( dialog_id, &Singleselectlist );
0 x2 t( D/ }* Z) Z1 v# }0 C/ EUF_STYLER_free_value ( &Singleselectlist );! c I6 t5 [6 K0 G3 I* u1 r9 z
}* Z7 v* g+ {# V# Z/ h' y2 U$ Y
extern void Test_set_singleselectlist_focusitem ( int dialog_id, char *item_id,
. x% B7 A( q* k U. {! h Kint value )0 T' E# w5 U+ e5 H( E" m
{ UF_STYLER_item_value_type_t Singleselectlist;
# O0 @2 h& c- QSingleselectlist.item_attr = UF_STYLER_VALUE;7 n. u4 d' _; T! [4 x3 W0 o) C
Singleselectlist.item_id = item_id;
- a @ Y6 f- BSingleselectlist.subitem_index = value < 0 ? UF_STYLER_NO_SUB_INDEX : value;
% U3 X" o( l+ J5 QUF_STYLER_set_value ( dialog_id, &Singleselectlist );
2 \5 l/ d+ q% r, [8 I}, Q3 d$ K3 ?: ~3 ~* C9 h) S7 a- l
Property Pages
+ j/ o# q C) C' B# X2 p3 _4 zextern void Test_read_propertypages_activepage ( int dialog_id,
5 Y" G3 d' v) G, t1 \( w, nint *active_page )
3 o0 b5 l: J0 D4 m/ [& D{ UF_STYLER_item_value_type_t Propertypages;
7 R6 s4 {( m8 }Propertypages.item_attr = UF_STYLER_ACTIVE_PAGE;
( D4 X. ^; ^, KPropertypages.item_id = UF_STYLER_DIALOG_INDEX; I3 j+ {+ d4 f( r7 u
UF_STYLER_ask_value ( dialog_id, &Propertypages );
5 C! v0 I, m+ q% u% y*active_page = Propertypages.value.integer;1 J7 |/ b/ a$ H/ M) O& D. Z; l" c- K6 D
}, h! k4 U" O' q, J( g
extern void Test_set_propertypages_activepage ( int dialog_id,8 p9 t) a2 S; v9 N* ?
int active_page )
7 z; \. p. U( ^{ UF_STYLER_item_value_type_t Propertypages;/ t$ J# V5 Q4 v" f) d$ k
Propertypages.item_attr = UF_STYLER_ACTIVE_PAGE;+ `$ S8 i# T6 x: z; Z, v2 p
Propertypages.item_id = UF_STYLER_DIALOG_INDEX;
; b$ i2 W2 T: l# C0 _& H. E* |4 rPropertypages.value.integer = active_page;3 I: v5 s2 y, g% Y( `8 Y
UF_STYLER_set_value ( dialog_id, &Propertypages );
; K9 T# a3 @2 @. i5 X$ l! e}% j( q% g$ ~' w! r% r/ b1 u" s
Color Tool
4 }4 F. Y# [8 S- q ?extern void Test_read_colortool_activecolor ( int dialog_id,# L, v6 n7 z) N7 C5 R% s
char *item_id, int *active_color )
( c; m6 g) p. ~7 V{ UF_STYLER_item_value_type_t Colortool;" `( }, e5 o3 h! a. P) b' `
Colortool.item_attr = UF_STYLER_VALUE;
! h* M+ D+ k( }% i% `Colortool.item_id = item_id;
' v! J5 p- l" S9 g7 b8 sUF_STYLER_ask_value ( dialog_id, &Colortool );0 S8 z# e+ b' \4 j% f3 T
*active_color = Colortool.value.integer;
! }$ m6 t; `7 [ r( t}* ?: v7 |! Z2 v
extern void Test_set_colortool_activecolor ( int dialog_id,
/ f; j" m3 E& B |char *item_id, int active_color ): K! J. w$ z5 q+ a- L+ o1 a/ P
{ UF_STYLER_item_value_type_t Colortool;
7 F, ^8 Y4 w1 gColortool.item_attr = UF_STYLER_VALUE;
. b5 b9 v! Y' z. i& ]8 L: W! MColortool.item_id = item_id;# H0 R7 J: g. |0 h! Y
Colortool.value.integer = active_color;
4 v; e: X* T( L+ h3 q ?5 wUF_STYLER_set_value ( dialog_id, &Colortool );- _; v& U7 k: S+ W' X) v
} |
|