青华模具培训学校

 找回密码
 注册

QQ登录

只需一步,快速开始

青华模具培训学院
查看: 2608|回复: 5

[教程] 讲讲user_styler的详细函数用法

[复制链接]
发表于 2014-3-7 09:42 | 显示全部楼层 |阅读模式
本帖最后由 xcb 于 2014-3-7 09:44 编辑 ( B* C) r4 Q/ A8 o- C& z: p2 @. b
/ A' H! V  H8 Y* a, g. f  Z3 t8 m7 |
' D- T, b( ?# S  S! C2 s
, H( ~* r/ v$ `

很早前我们做过一个讲user_styler的视频教程,但很多朋友都说讲的比较浅。所以今天把详细的函数分列出来,希望对大家有帮助。

原帖地址:http://www.ugufun.com/?p=92


1 F! P% l4 B7 b6 ?! F


, n5 m1 |& I  i

Label:标签 一般没有回调函数
; Z* O$ J0 W3 c( }( oInteger:整数 可以回调函数
" G5 p& Q# N& `0 f) w$ vReal:实数 可以有回调函数, ~. U. N  i3 _2 U, _1 J# I
String:字符串 一般没有回调函数
8 O1 [, K$ L1 Q  f$ Y1 yText Box:文本框 输入文本文字 一般没有回调函数
$ s% S( M- P6 r. ~2 {) @9 H  wPush Button:工具条 一般有回调函数
, {: z- S- T/ [7 Y7 F9 Z: cToggle:勾选框 作为判断
/ L$ G9 K/ k- v' ^Separator: 分割线8 r5 e( e& j: v. V; C8 }) t0 r0 \
Bitmap:位图
+ W% G* s9 R7 E; S' vButton Layout:排列式工具条 一般设回调函数
- n8 e2 d- a1 K8 _0 @Option Menu:下拉框 0,1,2…可以回调函数
8 M$ h7 K8 e$ \) n( ?; D3 R  m2 fRadio Box:消息框 一般作为判断标准
$ l7 F2 Y, M$ s7 u" n, F2 zSingle List: 单选框 0,1,2… 一般有回调函数; N" k+ d, |$ s1 o! J1 h
File -> Save 保存构造的对话框生成三个文件:% M- S; B4 }, l" q
*.dlg 文件(对话框文件)
* _% Z4 w4 q, t*.c 文件(对话框对应的源文件)5 ^' }4 G* G& j. x' q/ j% y
*.h 文件(原文件对应的头文件)- j/ S  z6 n$ h9 Y
建立工作文件夹,下面设置application、startup、source(最好下设include和resource文件夹)、parts文件夹,并且设置环境变量ugII_USER_DIR

把dlg文件放在application目录下,*c文件放在source->resource
" E; o6 S' {6 `. \, A8 ]4 b3 D文件夹,*h文件放在source->include目录下

1 A/ I0 M4 u  {$ w6 u


! w2 a7 Y% T3 n+ dLabel, h+ t% i/ _; U, ^
extern void Test_set_label ( int dialog_id, char *item_id, char *name )
! |; y9 \) u  z  S4 w! p( w5 ]{ UF_STYLER_item_value_type_t Text;
. E' i! q7 n. mText.item_attr = UF_STYLER_LABEL;
; E# J) y5 h7 c* KText.item_id = item_id;
5 U* Y/ y8 N2 p. f+ U: Q5 YText.value.string = name;
2 O' A. e8 v! ]! {! lUF_STYLER_set_value ( dialog_id, &Text );. A% K) m4 i! s
}
# j" \! A  Q7 K' t% |8 R- wInteger
4 }- P& b8 {3 q, fextern void Test_read_integer ( int dialog_id, char *item_id, int *value ): I% m, e7 S. \" P7 Y
{ UF_STYLER_item_value_type_t Text;
. T* S9 C* @" C$ a1 I$ pText.item_attr = UF_STYLER_VALUE;* _: Z4 u4 s: Z9 V. t6 L
Text.item_id = item_id;' F2 i" K" d: A
UF_STYLER_ask_value ( dialog_id, &Text );: j/ y( x+ L3 R- t: b- M5 e1 o3 o
*value = Text.value.integer;
. T5 F: A( n  I# r9 j, }3 _}
1 }: u0 A* M0 Rextern void Test_set_integer ( int dialog_id, char *item_id, int value )
5 R) U7 o& j! U* Y7 j# x. }: n+ G{ UF_STYLER_item_value_type_t Text;
  [8 N- Q8 o. S- ?; t! n$ B' _Text.item_attr = UF_STYLER_VALUE;5 R; x, |* ~# I9 j- X
Text.item_id = item_id;6 j1 j8 O" r; n2 K  _! Y) q' b
Text.value.integer = value;  }+ h) [7 K% ^- ~  u  t" {' G1 Q
UF_STYLER_set_value ( dialog_id, &Text );2 m# A7 _2 r: l, E
}

Sensitivity

extern void Test_set_sensitivity ( int dialog_id, char *item_id, logical check )
; D5 A4 A- C5 u( y, y5 x{ UF_STYLER_item_value_type_t item_sensitivity;8 A8 u3 Y$ [! c4 @- e
item_sensitivity.item_attr = UF_STYLER_SENSITIVITY;
* m8 D7 {- V- N/ I$ x; ritem_sensitivity.item_id = item_id;& C: J4 [* z/ }& U: t4 D
item_sensitivity.value.integer = check;
7 B8 T; H7 ~# O0 pUF_STYLER_set_value ( dialog_id, &item_sensitivity );) q) |8 C) B: k7 B; h( d6 b
}, _! C) _. z2 y( [* w9 e
Real6 K- j4 `& Y! z
extern void Test_read_real ( int dialog_id, char *item_id, double *value )
9 f+ I5 m# |- L; t{ UF_STYLER_item_value_type_t Text;, X% @# i" j5 I+ v* b: U
Text.item_attr = UF_STYLER_VALUE;
8 V. v9 G' i& ~: M3 zText.item_id = item_id;
3 T. c* B0 c& k/ V) a2 rUF_STYLER_ask_value ( dialog_id, &Text );" P% r0 `& ?9 [" A
*value = Text.value.real;" {: _7 v5 c$ g5 y  N
}
2 \/ j8 s( _: Z2 O% _extern void Test_set_real ( int dialog_id, char *item_id, double value )
6 ?8 E& V: v, V9 N% r{ UF_STYLER_item_value_type_t Text;
( {: P' @* R$ c9 n& K8 e+ i, V5 F0 DText.item_attr = UF_STYLER_VALUE;
+ k( X' o0 ~8 S0 w* h1 l# qText.item_id = item_id;
( Y( a7 ^+ h$ l8 l/ IText.value.real = value;
3 Z6 g3 e4 k" BUF_STYLER_set_value ( dialog_id, &Text );. t" ]5 p' h5 _) h5 z& S& n& x. P
}! V7 i& z% ]+ f- i- w- A
Visibility; v8 h1 `, k0 B( l
extern void Test_set_visibility ( int dialog_id, char *item_id, logical check )
2 X6 w& ?1 b0 S  ]{ UF_STYLER_item_value_type_t item_visibility;& ^# D" }& C6 t
item_visibility.item_attr = UF_STYLER_VISIBILITY;
& N4 ~" ?3 n+ x4 e% q9 Ritem_visibility.item_id = item_id;
3 {6 X6 L8 M0 kitem_visibility.value.integer = check;% R% ]5 G6 w( b; m4 d/ S
UF_STYLER_set_value ( dialog_id, &item_visibility );
5 n. p9 z! u1 F) m. H}3 I% S7 }( _7 M# r+ Z
String/ T4 ^7 H8 p# `, ~) D2 F$ o/ o" ~6 H
extern void Test_read_string ( int dialog_id, char *item_id, char *value ), n% [9 t2 G# O
{ UF_STYLER_item_value_type_t Text;
/ R% Z7 N# O* x4 J  L6 ~Text.item_attr = UF_STYLER_VALUE;3 S5 y3 t0 o5 k1 h
Text.item_id = item_id;
0 x* u+ @( |4 nUF_STYLER_ask_value ( dialog_id, &Text );9 x, b' H$ I8 ?
sprintf ( value, "%s", Text.value.string );
( D; a3 J2 R; `* @0 ]}0 v+ `4 R3 B5 z  D. z
extern void Test_set_string ( int dialog_id, char *item_id, char *value )
5 `8 {0 g* M2 O, X2 Q& l& a/ S+ o{ UF_STYLER_item_value_type_t Text;
1 y1 Y. ^5 b1 \6 V1 [) ]Text.item_attr = UF_STYLER_VALUE;
/ H" V' K: M* N3 TText.item_id = item_id;* `3 ^/ A% `& a. \
Text.value.string = value;' ~7 g+ l- H0 T
UF_STYLER_set_value ( dialog_id, &Text );
& V* B; }( X% u/ c. F2 ^1 x4 ]3 y) M}
7 S/ F5 `- k+ }0 T1 p: l( `Radio
: O% W1 u) l+ t, Mextern void Test_set_radio_sensitivity ( int dialog_id, char *item_id,
& a5 @/ B6 a! Q6 m5 qint subitem_index, logical check )
& m/ G+ ~! X# m* i7 N  C$ G{ UF_STYLER_item_value_type_t item_sensitivity;, A; S$ Z' v# B- F' J( r1 G
item_sensitivity.item_attr = UF_STYLER_SENSITIVITY;* y- H, I2 C( t2 i
item_sensitivity.item_id = item_id;4 q7 M- [; J/ Y4 p) i
item_sensitivity.subitem_index = subitem_index;. I: r: R; G3 J( ~4 q
item_sensitivity.value.integer = check;$ Z3 U- }0 P& Q; Y1 o
UF_STYLER_set_value ( dialog_id, &item_sensitivity );
$ e* A8 A1 k/ w1 g- k" \* P  x}
; @, S' E! S9 z5 mextern void Test_read_radio ( int dialog_id, char *item_id, int *value )6 P. w5 ^7 G5 p6 g1 a" n; A8 f
{ UF_STYLER_item_value_type_t Radio;
& [! X/ V: j- ?% i0 F/ \Radio.item_attr = UF_STYLER_VALUE;
2 G1 K. }) X, U0 r3 hRadio.item_id = item_id;; w0 A% T, t, f! l: S
UF_STYLER_ask_value ( dialog_id, &Radio );1 c! [+ c; Q5 Y0 e4 v2 ?4 e- V' ?
*value = Radio.value.integer;
6 _5 v* R6 [4 \}
5 U/ H: Y5 E3 u. i, M8 O+ m( N3 oextern void Test_set_radio ( int dialog_id, char *item_id, int value )1 v8 {0 W+ G" T. `6 T4 m) h
{ UF_STYLER_item_value_type_t Radio;: _4 N; a3 s; [, y1 Y/ x# w
Radio.item_attr = UF_STYLER_VALUE;1 q5 ?! Y& T  X$ E# c$ {+ l
Radio.item_id = item_id;
- S% l5 E9 ~3 t9 o" B; b! ^Radio.subitem_index = value;/ ?) [; K/ s* {5 ~) q, D# e
UF_STYLER_set_value ( dialog_id, &Radio );
# M$ }7 n) h0 |2 L7 d}: Y* m9 `8 |- I3 L+ w
Bitmap
% q* s/ s1 n4 I& I6 X; R: Aextern void Test_set_bitmap ( int dialog_id, char *item_id, char *name )% V3 P3 [; a3 k6 m" L; o9 H
{ UF_STYLER_item_value_type_t bitmap;) j* a# A2 j7 D' a% |: v3 [
bitmap.item_attr = UF_STYLER_BITMAP;8 X; q1 T6 o* \4 o
bitmap.item_id = item_id;9 v1 \. c* z, @4 ~3 f( V$ ?
bitmap.value.string = name;
" M2 n; R$ c. s, _UF_STYLER_set_value ( dialog_id, &bitmap );6 C8 t$ g! m- p( @# _5 R
}
5 ^" [+ \4 b, w; wToggle
2 W5 B: M/ L+ l# fextern void Test_read_toggle ( int dialog_id, char *item_id, logical *check )5 ~2 Y1 k* J: s2 i# _+ S. L% I. E' V
{ UF_STYLER_item_value_type_t Toggle;
0 l5 \. p0 ]% q. ?Toggle.item_attr = UF_STYLER_VALUE;
; q/ n, T! }, N5 U/ u+ TToggle.item_id = item_id;
4 C& d( U3 J/ E0 QUF_STYLER_ask_value ( dialog_id, &Toggle );! g5 g2 H& j: w) z/ ?
*check = Toggle.value.integer;
# C9 |$ j* S% b. F7 b5 {# T}
, `( c$ |+ W. l( jextern void Test_set_toggle ( int dialog_id, char *item_id, logical check )
5 t, ^5 o4 Y$ J) P, o  s: E5 e4 @1 ~{ UF_STYLER_item_value_type_t Toggle;
$ |# A/ x- L+ |2 F; BToggle.item_attr = UF_STYLER_VALUE;4 A9 ?1 u; c5 |4 T+ t
Toggle.item_id = item_id;
* H* g( B; v* t8 @  c, BToggle.value.integer = check;8 t: x% y1 ], ^* T4 @6 e
UF_STYLER_set_value ( dialog_id, &Toggle );
% O1 N  T2 q% ^3 o& v  b2 y. @- U}' E! j4 d* `6 t' M3 r7 W
Dialog6 H8 Q0 c' Q( e1 F
extern void Test_set_dialog_title ( int dialog_id, char *title )
0 w# k0 B' U) Y/ h2 A{ UF_STYLER_item_value_type_t dialog;
* Q, y9 E. Z. }! u- L' F7 _dialog.item_attr = UF_STYLER_LABEL;( t& F3 d" Z3 H4 i
dialog.item_id = UF_STYLER_DIALOG_INDEX;0 Y! }9 `2 @( X2 Z
dialog.value.string = title;9 c( g$ Q5 ?9 g; D/ H, @
UF_STYLER_set_value ( dialog_id, &dialog );
1 x" A4 v& `" n3 U& S}* ~/ `! P2 V) }! `8 |
extern void Test_set_dialog_sensitivity ( int dialog_id, int item_id,
. G8 i6 M$ y6 @& S2 Q: F! Y0 H" hlogical check )1 ]" I+ s1 g! q1 ~* l: R9 t: ~
{ UF_STYLER_item_value_type_t dialog_sensitivity;5 ^  s# h3 X" @5 H: O) y) e
dialog_sensitivity.item_attr = UF_STYLER_SENSITIVITY;
* m& z  Q" y0 k' _: v( L' [$ O, M6 idialog_sensitivity.item_id = UF_STYLER_NAV_INDEX;
4 }5 \, b. D: w! z" n% ~1 Iif ( item_id == 1 )
9 ]6 ]- i3 e- F& R4 n) C" y9 W: Bdialog_sensitivity.subitem_index = UF_STYLER_OK_INDEX;
! @3 B6 [4 `6 o% U; u: i" gelse if ( item_id == 2 )
9 i' S, o1 c8 k# s( R- b+ L" ~  X6 ^dialog_sensitivity.subitem_index = UF_STYLER_APPLY_INDEX;- z( M% v/ {9 A
else if ( item_id == 3 )5 U  n5 A# Y  h8 E$ k* Q
dialog_sensitivity.subitem_index = UF_STYLER_BACK_INDEX;
6 ^2 R: |& s9 Z# v- ^5 s) Kelse
6 H- U( W' S* q( Bdialog_sensitivity.subitem_index = UF_STYLER_CANCEL_INDEX;
  h( z9 q) v5 g0 `* s: E! @! m  Wdialog_sensitivity.value.integer = check;
3 g$ Z8 V8 T6 i- BUF_STYLER_set_value ( dialog_id, &dialog_sensitivity );7 ~7 Z7 x4 y) ~+ S0 ^
}
! E6 b' _( c9 D4 X, y. [Option, B! `# n- Q* B( m! y9 `' W
extern void Test_read_option_allitems ( int dialog_id, char *item_id,2 l( T4 r; T# y
int *count, char ***strings )" {; L7 @1 @: K
{ UF_STYLER_item_value_type_t Option; int i, error = 0;/ X- |5 r3 B$ y$ ^
Option.item_attr = UF_STYLER_SUBITEM_VALUES;, Y0 P: @- a0 k- S# L4 C
Option.item_id = item_id;. c9 _) P) U* P' B- R
Option.indicator = UF_STYLER_STRING_PTR_VALUE;
4 X, Y$ e% q! ?5 L  fUF_STYLER_ask_value ( dialog_id, &Option );+ {$ M. G: b8 A5 s" A
(*count) = Option.count;
" B- c* r0 d7 O(*strings) = (char **) UF_allocate_memory ( Option.count * sizeof ( char * ), &error );
+ `$ L& H# {* N" rfor ( i = 0; i < Option.count; i ++ )+ U" D4 q' R' a" k* Z4 A( O
{ (*strings) = (char *)UF_allocate_memory( 133*sizeof(char),&error);1 e  t- }. {2 Y# Q
sprintf ( (*strings), "%s", Option.value.strings );8 ~9 C  C1 ^3 L4 R$ U# \1 d9 d
} UF_STYLER_free_value ( &Option );6 w, e- ?/ O$ L# a
}
3 p* N" M2 h8 l; b9 Zextern void Test_read_option_activeitem ( int dialog_id, char *item_id,4 ]' |1 [8 {9 T' c3 y
int *value )
* o8 A, e5 K9 Q. ^6 u# b- X0 x{ UF_STYLER_item_value_type_t Option;
$ b' W4 H  L: `Option.item_attr = UF_STYLER_VALUE;
0 k8 w8 ~) v/ |# A3 rOption.item_id = item_id;
) y( Y! W. B* n5 YUF_STYLER_ask_value ( dialog_id, &Option );
9 G$ d! n) e1 V& `& X4 x*value = Option.value.integer;- D: f4 r" v- ^, x
}
2 b( n0 o  w, a% L0 s' @extern void Test_set_option_allitems ( int dialog_id, char *item_id,. G# }: _* n* ^4 L1 ?( |/ n6 c9 {
int count, char **strings )0 h/ `" A! x9 t) ^
{ UF_STYLER_item_value_type_t Option; int i, error;
# ^+ \3 @/ q/ o0 L7 `$ v5 r# FOption.item_attr = UF_STYLER_SUBITEM_VALUES;! y" S# z. Z8 ^; T1 F+ p& Y
Option.item_id = item_id;
1 L/ @$ v( M6 e2 wOption.count = count;7 O; Z) q3 B' j
Option.value.strings = (char **) UF_allocate_memory ( count * sizeof ( char * ), &error );
  H& ^8 J5 b3 g- A7 vfor ( i = 0; i < count; i ++ )
  T" c, b+ o' i5 b& R{ Option.value.strings = (char *) UF_allocate_memory ( 133 * sizeof ( char ), &error );3 ]5 s: L; u3 m* [
sprintf ( Option.value.strings, "%s", strings );
3 j0 G$ j0 \; _* l: q4 l* w" H, d} UF_STYLER_set_value ( dialog_id, &Option );
# U* t! H$ O# t# ^+ _6 i7 x( q5 cUF_STYLER_free_value ( &Option );
+ O; F- N4 N4 z8 ^6 I" o}% n$ \4 q5 g! f( ?) \
extern void Test_set_option_activeitem ( int dialog_id, char *item_id,6 v! y/ e9 h9 u: y
int value )' Q$ j8 |  J. a1 X* Q/ |
{ UF_STYLER_item_value_type_t Option;
, X: O' B+ T/ \2 _& ZOption.item_attr = UF_STYLER_VALUE;
0 f% e- Y/ X3 g7 DOption.item_id = item_id;
+ f+ ]. e( I9 X, [Option.subitem_index = value;
9 N# l( p  H- o; mUF_STYLER_set_value ( dialog_id, &Option );
/ M& P1 |4 `3 g  N: K9 U# ], N" x}1 u7 O9 Q% j( b; l4 A' M6 y
Single Select List& k* Z/ B4 }) M3 j6 X4 e- ]
extern void Test_read_singleselectlist_allitems ( int dialog_id,$ A" T* G3 b  L+ ^
char *item_id, int *count, char ***strings )$ j2 [8 ]+ T$ a6 n. A% ^4 ?/ U
{ UF_STYLER_item_value_type_t Singleselectlist; int i, error = 0;
6 D( y0 C! e+ B2 W/ \Singleselectlist.item_attr = UF_STYLER_SUBITEM_VALUES;7 q, c$ T% U# j1 U( i* I
Singleselectlist.item_id = item_id;7 p2 R' F3 r, K
UF_STYLER_ask_value ( dialog_id, &Singleselectlist );
# }# ~7 B" [9 f; E(*count) = Singleselectlist.count;+ K# ~6 z' }6 D! O" y
(*strings) = (char **) UF_allocate_memory ( Singleselectlist.count * sizeof ( char * ), &error );
+ p- g, K. g$ O1 a5 ^for ( i = 0; i < Singleselectlist.count; i ++ )% A% M, \* Q- l
{ (*strings) = (char *)UF_allocate_memory(133*sizeof(char),&error);
; L7 c4 w- j/ G5 Csprintf ( (*strings), "%s", Singleselectlist.value.strings );
7 S# Q  w! |' U2 @} UF_STYLER_free_value ( &Singleselectlist );" B5 I, |1 S9 s0 q6 j# _! X4 ]
}
  z8 g" B3 B5 v4 L- |. l, bextern void Test_read_singleselectlist_activeitem ( int dialog_id,
  V" Y7 U4 Q8 q7 \, B4 ochar *item_id, int *value, char *string )
7 E. O% {: h) Q& I5 |{ UF_STYLER_item_value_type_t Singleselectlist;
' y+ \* s5 f5 k- O( iSingleselectlist.item_attr = UF_STYLER_VALUE;
, i" t, P" K  FSingleselectlist.item_id = item_id;
* k  G: O" z  L0 q3 uSingleselectlist.indicator = UF_STYLER_INTEGER_VALUE;# y# ]' ~% A) T3 Y1 y2 D' U% l1 o
UF_STYLER_ask_value ( dialog_id, &Singleselectlist );1 I2 c- |& R# \/ c3 K6 R6 c
*value = Singleselectlist.value.integer;7 M% F/ E% O0 g6 {* b8 S! L
Singleselectlist.indicator = UF_STYLER_STRING_VALUE;
3 o, V2 }# C1 J# H- hUF_STYLER_ask_value ( dialog_id, &Singleselectlist );
2 {# |: F7 L$ i1 M, [" k" Vsprintf ( string, "%s", Singleselectlist.value.string );5 \! q6 m; D1 v% t  H
}6 E  y' S% @+ @, [0 j) ]9 T
extern void Test_set_singleselectlist_allitems ( int dialog_id, char *item_id," E& W6 G$ B3 I# d+ @
int count, char **strings )  W- v$ ^! _- h
{ UF_STYLER_item_value_type_t Singleselectlist; int i, error = 0;
" G4 y, E' j3 t: z+ f( tSingleselectlist.item_attr = UF_STYLER_SUBITEM_VALUES;% c! m) K0 V5 a, `+ b$ Q
Singleselectlist.item_id = item_id;# W5 i3 F- t# L2 m  ]2 ^$ z7 B+ J
Singleselectlist.count = count;
3 [6 R: Z0 m& hSingleselectlist.value.strings = (char **) UF_allocate_memory ( count * sizeof ( char * ), &error );% g8 N3 ~( @+ R; W/ i4 F
for ( i = 0; i < count; i ++ )# F0 A+ X, m9 ?7 V
{ Singleselectlist.value.strings = (char *) UF_allocate_memory ( 133 * sizeof ( char ), &error );& y# A9 b; p3 W( q
sprintf ( Singleselectlist.value.strings, "%s", strings );# q" m: o+ T3 z% `/ i$ b, I
}; x$ M0 u- F4 _" o
UF_STYLER_set_value ( dialog_id, &Singleselectlist );
) g; `9 l$ Q! c, l( @1 _7 xUF_STYLER_free_value ( &Singleselectlist );
8 o4 d1 O0 |8 y: a  D}6 K9 s  v+ k' a1 f: z
extern void Test_set_singleselectlist_focusitem ( int dialog_id, char *item_id,
' r" ~6 G; l: w: c' k& ]int value )! j- o8 T3 q2 f8 h: C
{ UF_STYLER_item_value_type_t Singleselectlist;( Y# k8 i* }5 R& [
Singleselectlist.item_attr = UF_STYLER_VALUE;
' k; m2 `1 d* ?7 \/ _5 SSingleselectlist.item_id = item_id;
, M. a4 o$ j3 TSingleselectlist.subitem_index = value < 0 ? UF_STYLER_NO_SUB_INDEX : value;8 E) X( }) A8 L6 L% Y4 M
UF_STYLER_set_value ( dialog_id, &Singleselectlist );2 R: B) j) C0 }  S) v  z9 d7 g6 i  E
}9 p6 ~! K' a" D2 r! p+ E9 Y
Property Pages1 ]& G: M* i" X$ `- S# Z
extern void Test_read_propertypages_activepage ( int dialog_id,
+ x3 F, i# J4 F6 D& O6 Cint *active_page )4 b9 l: [" w6 J2 O3 j
{ UF_STYLER_item_value_type_t Propertypages;
1 ~3 `7 y; x, @& X4 yPropertypages.item_attr = UF_STYLER_ACTIVE_PAGE;
& y6 I" Y$ W# m1 L) Q9 yPropertypages.item_id = UF_STYLER_DIALOG_INDEX;; A$ J4 V* P8 [* L) Q3 [" N
UF_STYLER_ask_value ( dialog_id, &Propertypages );  @) x) d+ {* S  [/ U
*active_page = Propertypages.value.integer;
# {; ~2 ^* H+ x}
' K; X5 |' A. }2 yextern void Test_set_propertypages_activepage ( int dialog_id,+ B3 W9 q  Z! N
int active_page )& x/ H# d% w+ J$ D$ t: M
{ UF_STYLER_item_value_type_t Propertypages;
/ i0 C$ w$ B/ ~$ s- TPropertypages.item_attr = UF_STYLER_ACTIVE_PAGE;  o/ g. w- p9 H
Propertypages.item_id = UF_STYLER_DIALOG_INDEX;
, @8 J) [( ?, S5 N) H/ Z4 cPropertypages.value.integer = active_page;4 J; d& J. Z  X/ A, F, ^
UF_STYLER_set_value ( dialog_id, &Propertypages );8 {8 N5 g. S6 g( d5 S1 T
}
  r8 x& m$ X$ ?! t! F" xColor Tool+ i4 ~3 c- L: r1 v
extern void Test_read_colortool_activecolor ( int dialog_id,
7 o) @4 e9 y+ b8 schar *item_id, int *active_color )
3 P+ ?) P( Q" }{ UF_STYLER_item_value_type_t Colortool;$ r; O" x) Y, \. ]; Z- q* M4 t
Colortool.item_attr = UF_STYLER_VALUE;1 n8 W# }- l, t4 k1 R2 D. n
Colortool.item_id = item_id;& v" d: j3 l+ a9 n$ @2 S0 [4 y  o
UF_STYLER_ask_value ( dialog_id, &Colortool );, q5 M" x. {! i$ P+ }
*active_color = Colortool.value.integer;
: v: l- }+ l" a- r, B" n. S4 t: T" R}
$ l4 e$ d& S: h! Jextern void Test_set_colortool_activecolor ( int dialog_id,
5 E) ^9 @2 r8 \& |% ^char *item_id, int active_color )
' b: F; N; Y4 u; |{ UF_STYLER_item_value_type_t Colortool;
  u' |4 q- x6 l1 F2 U0 rColortool.item_attr = UF_STYLER_VALUE;
4 X9 o0 M2 n' Q% x4 [Colortool.item_id = item_id;( [; J, s* e1 h; m
Colortool.value.integer = active_color;
1 k0 r- w! g/ G0 Y, B& J" z. iUF_STYLER_set_value ( dialog_id, &Colortool );
- T% X# e0 ~+ B. F}

发表于 2014-3-7 23:05 | 显示全部楼层
Multi-line Text 这个空间如何编制代码??请赐教
回复 支持 反对

使用道具 举报

 楼主| 发表于 2014-3-8 13:28 | 显示全部楼层
dialog_item.item_attr = UF_STYLER_VALUE; % V9 ]5 W, K$ ]
dialog_item.item_id = &lt;Multiline item name&gt;;
$ z' I% G8 A+ Edialog_item.count = &lt;Number of strings in that char**&gt;.
* C6 P8 _# g9 G4 J0 V2 a3 B% [dialog_item.value.strings = &lt;your char**&gt;;
- n6 M6 Q5 V8 @- V3 n1 @  3 a. B" E7 Z- Z" X1 F( W2 l3 _* n
UF_STYLER _set_value( dialog_id, [$dialog_item )]
回复 支持 反对

使用道具 举报

发表于 2014-9-16 10:08 | 显示全部楼层
qingkong 发表于 2014-3-7 23:05
  u2 C* A6 u7 z/ m/ DMulti-line Text 这个空间如何编制代码??请赐教

; q3 b4 K: q/ _) u请问有完整的函数吗? 另外得到的数怎样存储?  m' o  D9 Q& L
回复 支持 反对

使用道具 举报

发表于 2014-9-16 10:11 | 显示全部楼层
xcb 发表于 2014-3-8 13:28, J+ N* N; W  f6 H) A
dialog_item.item_attr = UF_STYLER_VALUE; 4 }: D8 g$ |* E1 q
dialog_item.item_id = &lt;Multiline item name&gt;;
3 q& g! g+ R/ k' X8 Mdialog ...
9 h8 B3 g' h3 a, d
请教怎样获得多行的值? 每行只有一个浮点型数据
回复 支持 反对

使用道具 举报

发表于 2014-9-29 16:27 | 显示全部楼层
学习一下,谢谢
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|关于我们|sitemap|小黑屋|Archiver|手机版|UG网-UG技术论坛-青华数控模具培训学校 ( 粤ICP备15108561号 )

GMT+8, 2025-2-19 07:16 , Processed in 0.064525 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表