|
error LNK2001: unresolved external symbol _main. X4 U! P! u& S, y- i5 H
/ c/ [- B0 ^" i, a, F, Q源程序:
: A F1 U7 Y2 i5 e* D4 d6 L: q, J/*=============================================================================% v- Z* B% u1 Q- G" u- l- g) G2 ~
WARNING!! This file is overwritten by the UIStyler each time the Styler 2 @+ o7 a4 k. r! N+ z8 o* d% `
file is saved.
$ t+ n( H8 Q6 o* g % O/ j# F8 {( X8 r! i
^6 @7 y1 ?, B% O3 o$ ^' e# Y0 y
Filename: pro_design_template.c8 N+ y" G7 b) {, w+ F' j* y* o r
" l6 _, g9 y1 y8 L" A: ^ This file was generated by the NX User Interface Styler5 Q, b! `6 x+ ]) F
Created by: befree3 D6 z3 F# y1 b4 k
Version: NX 3
( r0 W' D2 ?$ i- z* P Date: 10-27- 6: r8 Q! b" f9 A0 T' r4 g: Q
Time: 10:04+ L0 D; i8 p3 s; k% |
) K9 i+ {0 P) R" u+ n5 A This template file is overwritten each time the UIStyler dialog is
) L* l5 T+ V3 n8 ~ saved. Any modifications to this file will be lost.$ }( O& P) g; L' x+ ?; B
==============================================================================*/
! ]# }) ^& p; I
- ~9 ^" W' q4 u* `1 \
/ g& }# K; q0 i8 [" u/*==============================================================================( H1 e& f% a* Z e0 U
Purpose: This TEMPLATE file contains C source and static structures to
) q( h' c. h/ H guide you in the construction of your NX Open application dialog.
; U- l+ C7 T* A- O5 Q The generation of your dialog file (.dlg extension) is the first step towards
: y0 A+ |* e$ M$ I0 B5 Q dialog construction within Unigraphics. You must now create a ugOpen
) ^" j0 i5 g% i: V/ H8 V application that utilizes this file (.dlg).
. W3 M7 O# ]6 i ' e2 @' [, F7 g- K9 M3 k9 d
The information in this file provides you with the following: Y: k- x" h; ~$ Q2 p, u
6 w/ }! o2 i9 |2 s+ N! x
1. Help on the use of the functions, UF_MB_add_styler_actions and 4 n- s, C" O; J; ]8 B0 r
UF_STYLER_create_dialog in your NX Open application. These functions " M( x& @$ L' S4 ^8 H, w- d
will load and display your UIStyler dialog in Unigraphics.
$ d" }5 o, q# t/ V$ C 5 ?/ W1 _3 [7 s7 W4 Y
An example of the function, UF_MB_add_styler_actions to associate your
$ J5 Z4 k2 B- Y/ u dialog to the menubar is shown below (Search on Example 1). 6 q+ X- j% X% u
! Q, \, F5 G9 h$ _; O An example of a invoking a dialog from a callback utilizing 5 Y( r' H7 d4 l3 L0 D1 t ^
UF_STYLER_create_dialog is also shown below (Search for Example 2). 5 W1 ~+ u' z0 l% e5 N# B$ b% j. L
) J9 e1 U1 C6 `" x+ H6 H# T/ p+ z! x3 b# }
An example of a user exit utilizing UF_STYLER_create_dialog is also
% D% }7 E2 L( h/ ]9 v+ Y- w shown below (Search for Example 3).
; z7 T) ?+ z* q9 u6 j$ P* ^
! S) c! z: h5 V) Q2 Q; }" i 2. The callback structure: --- PRO_DESIG_cbs --- : z( A2 m9 E/ ]% u0 u0 b
This structure is VERY important if you have callbacks associated with
4 m/ R; X1 P& H# E your dialog. It correlates the dialog items in your dialog with the
( w7 C/ h/ k h7 v4 x; `+ D callback functions you must supply. You should not modify this
+ J1 |+ W' p9 n( B/ D structure since it MUST match up to the information stored in your 0 @; A q6 i' b% L& Z
dialog file (.dlg). Any attempt to do so will cause an error while
: v- _9 S2 f. D$ B6 T5 ]/ T4 ^* I constructing your dialog. If you wish to modify the association of
5 L3 Y- w( G1 }) w- k; X: l your callbacks to your dialog, please reload your dialog file (.dlg) into
' T& h& i) S2 g the UIStyler and regenerate your files. $ V l9 z: N( p6 h- {1 E# L* i
You do not need to be concerned about this structure, simply pass it as ' h/ Q' w. C: m0 D: @7 L2 C
an argument to the function, UF_STYLER_create_dialog along with your & t- {- e5 {$ K
dialog file (.dlg).: P5 i& E+ {# z9 h. _; ?# E
" N1 d$ ~) `7 D; a Example 1 displays the actual call you may make for this particular 0 w7 A3 ^) f2 P) t
dialog.
* S2 l7 i3 }. j1 A # [: Y7 `* {% t2 u7 A
3. The empty callback functions (stubs) associated with your dialog items ) e" f, M; {/ ^1 ~: w% {# s
have also been placed in this file. These empty functions have been
* e- p. V% x- y* ^& C3 k+ c created simply to start you along with your coding requirements.
2 M. {4 F e+ h$ m" A& e The function name, argument list and possible return values have already 4 V A) P0 b" @ o( W
been provided for you.
6 d; z0 Y8 c' G9 D. v8 k' f# n
7 y3 f0 U: W! ]/ hNOTE: Each callback must be wrappered with the functions UF_initialize() 5 Z# {# {8 e3 d' e7 B; n, I P
and UF_terminate(). & I$ F, F/ [- U/ z8 G6 }8 d
* D6 S- d$ k$ r& D' [- Z==============================================================================*/. V$ g# ]9 S: ?# i- j: u
* }, P3 x$ ? C9 i$ o% u: K
/* These include files are needed for the following template code. *// C2 x% ]: U" L4 S! j/ i
#include <stdio.h> 4 M2 ` n7 l: D
#include <uf.h>- D! r" l* c4 h$ U& K5 r8 [" ^7 q5 m
#include <uf_defs.h>
0 m5 r0 m+ p7 y5 I- y2 E* o- B#include <uf_exit.h>
! D6 n8 Y2 t$ R; B#include <uf_ui.h>
V7 n2 |" _5 h#include <uf_styler.h>
2 ~" {# z& X8 _5 \#include <uf_mb.h>
, Q) v7 W$ k* u( w, j# x% ?#include <uf_part.h>+ a* x5 y( C. h
#include <uf_modl.h>
' [6 v* y0 j# ^2 X! O, A: ]#include "pro_design_dialog.h"* u4 `! d) A( x1 b, b
/* The following definition defines the number of callback entries */
5 y/ k5 Q# n: @! T: Q/* in the callback structure: */ [. e8 r1 ~4 C B5 i4 t! g
/* UF_STYLER_callback_info_t PRO_DESIG_cbs */
2 j" J% X, ]8 n#define PRO_DESIG_CB_COUNT ( 4 + 1 ) /* Add 1 for the terminator */
# x! j ~9 R$ {# k
, R: i1 z P$ S: L+ S/*--------------------------------------------------------------------------. t5 C% X& p N- z# M9 E
The following structure defines the callback entries used by the
/ i+ Q% [7 S% U4 Tstyler file. This structure MUST be passed into the user function,
3 ]1 Z" d% P: UUF_STYLER_create_dialog along with PRO_DESIG_CB_COUNT. 9 p6 _! i% V( X1 G4 j8 z$ i- N
--------------------------------------------------------------------------*/
5 {8 Y4 T3 v3 J4 j# p3 Wstatic UF_STYLER_callback_info_t PRO_DESIG_cbs[PRO_DESIG_CB_COUNT] =
" | k: w/ E5 R3 t) `{# ]# h) p7 \: Z. b
{UF_STYLER_DIALOG_INDEX, UF_STYLER_CONSTRUCTOR_CB , 0, PRO_DESIG_construct_fun},( e$ K, M2 ~' U9 k3 o4 s
{UF_STYLER_DIALOG_INDEX, UF_STYLER_OK_CB , 0, PRO_DESIG_ok_fun},4 d- c1 M w8 c$ K( K- y6 r
{UF_STYLER_DIALOG_INDEX, UF_STYLER_APPLY_CB , 0, PRO_DESIG_apply_fun},
% K& s9 i, ^0 R% \# h {UF_STYLER_DIALOG_INDEX, UF_STYLER_CANCEL_CB , 0, PRO_DESIG_cancel_fun},' v. Q% M1 N: {) `6 n
{UF_STYLER_NULL_OBJECT, UF_STYLER_NO_CB, 0, 0 }
3 [( q9 w/ S: X# }8 o) K* l2 z};
6 J% X6 M# J4 i. |
" O" h% J; Q: O: k& |: M4 R/*--------------------------------------------------------------------------
3 Q2 D& g/ ~ `( I& R/ pUF_MB_styler_actions_t contains 4 fields. These are defined as follows:
& N+ c: ]) ?( |1 ~' ^; M: ^+ { d' `: m* z( n; ]: J
Field 1 : the name of your dialog that you wish to display.8 i+ f8 f2 p; W+ ^- ~) o
Field 2 : any client data you wish to pass to your callbacks.6 X9 }8 J, i5 S7 X) L1 U
Field 3 : your callback structure.8 T% O% t% ^# ?. u9 v
Field 4 : flag to inform menubar of your dialog location. This flag MUST , F' L% r/ c {( f M& e7 `
match the resource set in your dialog! Do NOT ASSUME that changing
% X, n D2 D+ T this field will update the location of your dialog. Please use the & T) N- l* n2 g
UIStyler to indicate the position of your dialog.
1 z& [3 b. d4 e' O2 h--------------------------------------------------------------------------*/7 A3 x! [; J5 H
static UF_MB_styler_actions_t actions[] = {
; f2 @+ ~4 y( d2 k+ W! K { "pro_design.dlg", NULL, PRO_DESIG_cbs, UF_MB_STYLER_IS_NOT_TOP },
# k; `% O2 J, ^ b% L+ r { NULL, NULL, NULL, 0 } /* This is a NULL terminated list */% b; O% f1 s% i# y( Y% B' \
};
6 j5 J' D7 N L) s5 f& ^0 H* J, x, M9 N; M5 A
- r% }" Y9 W2 H5 t, C2 v3 F j
( q" M f7 W5 W5 ]$ }; n9 L7 G8 e; s. x1 N( ]# R# i1 v
/*-------DIALOG CREATION FROM A CALLBACK HELP Example ----------/ {+ i: Y+ k t( p3 D4 [; T
If you wish to have this dialog displayed from the callback of 2 A& W* e- J6 `
another UIStyler dialog, you should:
7 [6 w; A' ] e. Z' \$ p1) Make sure that the callback of your UIStyler dialog is
6 ]" W7 ~" g! E; B8 K! a& ~ designated as a dialog building callback. * _3 u, U& w# y
2) Remove the conditional definitions:, n T' k/ S: y2 f! @6 [7 Y
#ifdef DISPLAY_FROM_CALLBACK " Q+ Y4 t/ V- [
#endif DISPLAY_FROM_CALLBACK
, t8 N7 e* D9 C8 ?! P" x3) Your callback should issue a call to this function.& O) `4 S5 C4 C2 p- R0 H) w/ h3 a
4) You should also add the funcitonal prototype to your header file
, X, q) e* B$ X6 } (pro_design.h) and ensure that the file is properly included.
# M! g, z6 t" B* a8 WAll dialog files must be located in . u! K: y m" v7 Q& c
$UGII_USER_DIR/application or 6 g- H# o \. D% ^
$UGII_SITE_DIR/application or ; g4 j+ t! ~2 Q" r9 L
$UGII_VENDOR_DIR/application directory! @9 K9 l6 P! L6 c
--------------------------------------------------------------*/5 i$ m; `; b; s3 w9 H
t [( }; D' i& ^( Q
extern int LaunchProDesignDialog( int *response )% M7 q" n8 J5 ~4 X0 F
{
2 E+ u; U' j9 Y6 X int error_code = 0;
* p( _' A! P1 b$ C, i/ q
+ O* M' x8 o8 p* {. v if ( ( error_code = UF_initialize() ) != 0 )
( q* k$ _0 r' G5 r; m return (0) ;
- [1 p# Q7 g8 O if ( ( error_code = UF_STYLER_create_dialog ( "pro_design.dlg",
1 c) ?6 z, X8 e5 _5 a PRO_DESIG_cbs, /* Callbacks from dialog */: r2 I4 }! R9 I" p( b8 Q, _1 h/ s
PRO_DESIG_CB_COUNT, /* number of callbacks*/6 h, t6 ~/ l0 J. B2 d# u/ \
NULL, /* This is your client data */
, N3 J f/ L& }3 n* T8 T6 ` response ) ) != 0 )8 \+ `4 ?) z; r: ]3 E6 b
{- v2 T$ h" s- F4 R) n% W& q* U8 ?" O
char fail_message[133];
- u1 r9 Q% Y, p( T8 ^( v /* Get the user function fail message based on the fail code.*/
" |9 p/ P( m) g4 ~ UF_get_fail_message(error_code, fail_message);" H) H, M" G0 E: `3 K; S1 O) U5 }& |
UF_UI_set_status (fail_message);
% ]$ `1 v4 U3 g3 j3 ~ printf ( "%s\n", fail_message ); 3 q" u% P8 i' n; B! o
}
& c$ B0 l! Q* K8 e' \" l$ d8 I. \1 S7 H. h
UF_terminate(); 7 r) ?1 A8 u$ T/ s9 I& B
return (error_code);
' e, z: A0 J) A. L}
' |; j, u h3 P0 Z/ y- Z1 S5 ]2 X
# @5 O5 ]7 W+ F! d$ ^6 @. K6 ~! v' d
, D& y+ R2 c" a3 I/*-------------------------------------------------------------------------*/
+ \( D0 _! D1 P5 K! M3 C8 W/*---------------------- UIStyler Callback Functions ----------------------*/
. A0 D& `1 z2 k9 J" R/ F3 N' x/*-------------------------------------------------------------------------*/- p5 R/ m: D) F. n' G2 W$ Y
/* -------------------------------------------------------------------------/ r1 j& }1 ^3 m' c
* Callback Name: PRO_DESIG_construct_fun1 z$ d# U5 h/ c$ b& F
* This is a callback function associated with an action taken from a
* t! x1 z3 K- F* M0 n * UIStyler object.
, t! g2 ^1 ]6 M: H, x7 a *
3 F1 L- L% ?$ _ g * Input: dialog_id - The dialog id indicate which dialog this callback
9 p2 P5 {3 j: Q* ~ * is associated with. The dialog id is a dynamic,
?8 h" w2 ]1 _* U, h% X * unique id and should not be stored. It is) T. I3 \# I \4 R
* strictly for the use in the NX Open API:
2 i: `' W" Q+ E5 _3 B0 I9 m * UF_STYLER_ask_value(s) $ K# K- m! u9 D; g, A4 C
* UF_STYLER_set_value
3 U2 \6 J# U' ^& i0 s: ]+ S# [5 K * client_data - Client data is user defined data associated, W2 ~8 u+ P* r3 _
* with your dialog. Client data may be bound( w+ {- I7 L8 V7 _5 n1 m' E8 S
* to your dialog with UF_MB_add_styler_actions
/ i/ H, w. P: a/ q2 W- A * or UF_STYLER_create_dialog. 6 L, n" A( S, e
* callback_data - This structure pointer contains information
5 v/ D, x" W& j/ v- h$ B9 t# l * specific to the UIStyler Object type that
: P( L1 E) a3 J * invoked this callback and the callback type.
" u- l7 f8 n- e * -----------------------------------------------------------------------*/8 I) }! _* N1 ]4 g1 c/ U3 o% o
int PRO_DESIG_construct_fun ( int dialog_id,& d" x' a$ t$ v
void * client_data,
& l9 W* S7 Z" L3 {5 o& e UF_STYLER_item_value_type_p_t callback_data)* G: V0 L( f4 T/ V7 B* q
{
1 U* g4 ^3 ~7 m+ a' j /* Make sure User Function is available. */ Q' \) |' o2 ~2 P l" w2 \
double value;) W5 O3 I' B( E' q1 H$ P
char prompt[256];
" ~: i& n. U; n& j2 B, L: N4 W UF_STYLER_item_value_type_t data;
- g0 x8 ~4 w( S$ ]) A/ V if ( UF_initialize() != 0)
# L- r6 C+ y7 J return ( UF_UI_CB_CONTINUE_DIALOG );) C3 `$ o5 O' T
data.item_attr=UF_STYLER_VALUE;6 ]6 G0 n9 Z+ O$ _' k% i. \; v
data.item_id=PRO_DESIG_REAL_L1;8 _& A9 Z) h! m/ D$ ]8 K
UF_MODL_eval_exp("L1",&data.value.real);* b7 v0 ^( n7 l8 j
UF_STYLER_set_value(dialog_id,&data);
' l) Z( {# U* i; a/ G2 L data.item_attr=UF_STYLER_VALUE;
, |9 a8 ~1 y* e: A data.item_id=PRO_DESIG_REAL_W1;* ?( P, w6 \5 k' V8 i$ Z0 Q
UF_MODL_eval_exp("W1",&data.value.real);% {8 L" Z$ }- g. K( c( g
UF_STYLER_set_value(dialog_id,&data);
" ]; ^& W. h% a# T data.item_attr=UF_STYLER_VALUE;8 L0 F x1 w- b! x
data.item_id=PRO_DESIG_REAL_H1;$ Z1 f* [) `4 D# C
UF_MODL_eval_exp("H1",&data.value.real);
L. E- x4 ^* I1 p6 V# i UF_STYLER_set_value(dialog_id,&data);
# Y. L+ M% ~" ~) b
! y! @- U! i& r- H. D data.item_attr=UF_STYLER_VALUE;
: \( e& l; z, G; L- Y9 I data.item_id=PRO_DESIG_REAL_H2;
& R4 T6 m7 D; h, `( k UF_MODL_eval_exp("H2",&data.value.real);
, ^; m0 n6 L+ N" D UF_STYLER_set_value(dialog_id,&data);
# x; K; ^# J* @4 J data.item_attr=UF_STYLER_VALUE; c$ o6 ?8 T; L) J! J" j
data.item_id=PRO_DESIG_REAL_L2;
7 |. y8 m- ]* y- f3 ] UF_MODL_eval_exp("L2",&data.value.real);$ e. m4 b) q1 i& [& s0 k8 C9 U
UF_STYLER_set_value(dialog_id,&data);+ `5 \! {% Y& q" L9 V( v
data.item_attr=UF_STYLER_VALUE;2 O4 a' k9 P& e$ A
data.item_id=PRO_DESIG_REAL_W2;
3 T" ^2 G% K2 ]* w; i7 v! E UF_MODL_eval_exp("W2",&data.value.real);: F! N3 B1 V) N8 t. S, ^
UF_STYLER_set_value(dialog_id,&data);+ ]8 X% ^. P% S. T( t) {& i
data.item_attr=UF_STYLER_VALUE;
6 |9 [. R# W% D0 {6 a6 M" r. W, ^# o3 o5 h data.item_id=PRO_DESIG_REAL_L3;* f% a9 T+ K1 x0 F
UF_MODL_eval_exp("L3",&data.value.real);
- ^9 P* P4 T5 l: N: t G5 d UF_STYLER_set_value(dialog_id,&data);, p3 A2 ^: ~' U
UF_MODL_eval_exp("VOLUME",&value);
# b0 |+ p4 V% u sprintf(prompt,"当前压块的体积为%.3f",value);
; R X4 h/ e0 v0 H data.item_attr=UF_STYLER_LABEL;/ p% Q s3 X( O! A0 f. e
data.item_id=PRO_DESIG_LABEL_VOLME;
+ G" n; O2 q# A0 W2 c data.value.string=prompt;
7 A7 ]9 a- E2 I, H- q9 I. w UF_STYLER_set_value(dialog_id,&data);
/ @" f4 `/ }- `( [, h$ t /* ---- Enter your callback code here ----- */+ N ]2 U7 R7 s; \! i- J' p0 ~
UF_terminate ();8 W$ h' P1 K& N+ B* q
/* Callback acknowledged, do not terminate dialog */ {+ i7 P6 c" ~1 Y8 n* n9 I2 H
return (UF_UI_CB_CONTINUE_DIALOG);
7 \9 ^' B: r+ @" n3 y /* A return value of UF_UI_CB_EXIT_DIALOG will not be accepted */
8 j8 S5 j h% i /* for this callback type. You must continue dialog construction.*/3 o: r8 W1 X2 e! N5 Q$ [
}8 H; H! c. d1 q
f) E( Z" J/ Z9 r! a/* -------------------------------------------------------------------------5 r. n" m: z6 t
* Callback Name: PRO_DESIG_ok_fun; v6 `- `% @7 ^+ {
* This is a callback function associated with an action taken from a
) f5 R" B' i% P( n * UIStyler object. , J1 `& L& E7 D P b, F9 y/ \
*. w! e' t4 j8 I$ m$ w6 y; y
* Input: dialog_id - The dialog id indicate which dialog this callback6 B( H. e1 l3 w2 e) ?' Q8 h. Z
* is associated with. The dialog id is a dynamic,
& [* O6 o- X: A! f! J * unique id and should not be stored. It is) f& c5 ?0 ]+ i9 e n7 J3 {
* strictly for the use in the NX Open API:" y9 J: t U) `+ g
* UF_STYLER_ask_value(s)
8 X8 O6 w0 p3 m4 @$ |* y * UF_STYLER_set_value
0 K9 A! w! d/ B) c& M4 s7 m# b * client_data - Client data is user defined data associated
H/ h2 j4 Q' o * with your dialog. Client data may be bound
4 d/ B. N+ @; L) s * to your dialog with UF_MB_add_styler_actions
# e- h5 W; O% J6 e * or UF_STYLER_create_dialog. ) a6 z9 T: U" r/ h/ e
* callback_data - This structure pointer contains information
5 \+ d& v; H/ j * specific to the UIStyler Object type that
0 j/ v# x9 }' |: ~& s+ ^; M * invoked this callback and the callback type.& R% z4 G/ x6 d% ^1 t3 T5 k% C
* -----------------------------------------------------------------------*/6 X/ p( L, u; ^' A' Q6 |+ P$ x: Q
int PRO_DESIG_ok_fun ( int dialog_id,, e: r* J( E+ _! E2 c- r* ~
void * client_data,
2 d" Z% A6 z2 l& u- W UF_STYLER_item_value_type_p_t callback_data)# x; T- q6 M$ x5 e/ q
{6 l' P/ Y, E2 u( b7 {/ w ~
/* Make sure User Function is available. */
7 n5 e9 _' z7 J UF_STYLER_item_value_type_t data;
" I0 I. ?' p, `$ }! ]6 I if ( UF_initialize() != 0)
, T4 ^# O4 K z; C$ T' J0 G. G9 O return ( UF_UI_CB_CONTINUE_DIALOG );
& p* p% [" z" `4 l
- a7 P* P6 p) X! f) T. R9 I. N& J data.item_attr=UF_STYLER_VALUE;
# r+ y! Q8 j9 t9 K data.item_id=PRO_DESIG_REAL_L1;
8 t: i" _! c/ O UF_STYLER_ask_value(dialog_id,&data);' n i5 ?9 I3 E4 w
PRO_DESIGN_edit_exp("L1",data.value.real);/ S7 @$ B0 X3 N% {
data.item_attr=UF_STYLER_VALUE;4 @& ^% C1 k# o$ Q& U
data.item_id=PRO_DESIG_REAL_W1;
6 W% N4 d5 n4 R. h, |, Y- ] UF_STYLER_ask_value(dialog_id,&data);
; ~, I A) g; i9 U* Q PRO_DESIGN_edit_exp("W1",data.value.real);
* g, v+ \( Y+ K! H' ^ data.item_attr=UF_STYLER_VALUE;: C# D8 G+ X$ X- z# D
data.item_id=PRO_DESIG_REAL_H1;
2 L* m& b" Q$ o( y% z5 p& h UF_STYLER_ask_value(dialog_id,&data);
2 ~3 p" w& U i5 ^- a PRO_DESIGN_edit_exp("H1",data.value.real);- g7 D4 f0 L" ]% i5 a/ A
; _$ b* L7 u& @ w) e) u- w
data.item_attr=UF_STYLER_VALUE;
3 @3 j+ M. t$ A, m. z data.item_id=PRO_DESIG_REAL_H2;
, ]! E" C, U) ~ p ^, C2 M5 }6 o' ? UF_STYLER_ask_value(dialog_id,&data);4 _2 a7 f# ?, N: i
PRO_DESIGN_edit_exp("H2",data.value.real);
# E" K! u: ^3 S. ?& n9 w/ r# z data.item_attr=UF_STYLER_VALUE;
: Y/ @; Z( P$ T# Q3 L. e data.item_id=PRO_DESIG_REAL_L2;" q. R/ Q+ e9 U# X, G
UF_STYLER_ask_value(dialog_id,&data);9 p- X! C6 s/ f. G
PRO_DESIGN_edit_exp("L2",data.value.real);" x8 ^$ G; q b3 |* a+ ^: z" \! u
data.item_attr=UF_STYLER_VALUE;
& o l& t( v# h: O/ k data.item_id=PRO_DESIG_REAL_W2;
+ C3 j! \ a; O" I% n UF_STYLER_ask_value(dialog_id,&data);- V+ s2 y; z, |
PRO_DESIGN_edit_exp("W2",data.value.real);2 ?# J9 S5 G' B/ _* S. ^: m$ p
data.item_attr=UF_STYLER_VALUE;
9 G+ ?9 ^- J* u: |4 d- Z data.item_id=PRO_DESIG_REAL_L3;" ]& t& t9 r0 d
UF_STYLER_ask_value(dialog_id,&data);4 L4 _7 b( x5 y/ S
PRO_DESIGN_edit_exp("L3",data.value.real);$ ]7 H [( o: O; M0 Z
UF_MODL_update();
9 y! _- G; w" G4 L: u - w! s, `- K) p, p1 t* K% l- m
/* ---- Enter your callback code here ----- */
0 @6 j5 L* O& s/ g" g UF_terminate ();/ k8 s3 ]* g& Y& L! D p' C
/* Callback acknowledged, terminate dialog */
9 A- T- M& ]0 f; c% a /* It is STRONGLY recommended that you exit your */( q) B2 i0 B% t. q- i# D
/* callback with UF_UI_CB_EXIT_DIALOG in a ok callback.*/3 j! K( y4 X$ b
/* return ( UF_UI_CB_EXIT_DIALOG ); */
8 [6 |" D+ `! R2 O3 U# P4 y return (UF_UI_CB_EXIT_DIALOG);
2 W8 z$ Z( ?' }+ u+ p! X}! }/ e4 w) @: k$ b
4 y9 p& D- U( _/ g: E4 {8 q2 h0 t/* -------------------------------------------------------------------------, n1 g4 V+ A H
* Callback Name: PRO_DESIG_apply_fun4 R" e' s1 f* G$ K; p F! v
* This is a callback function associated with an action taken from a
! d. ~$ ^+ q$ {& B# ` * UIStyler object.
" W0 k) N1 A N *' K! `$ F: M6 s" U; F
* Input: dialog_id - The dialog id indicate which dialog this callback
5 J E6 ]7 F# E8 ~. {7 L1 t: Y7 C * is associated with. The dialog id is a dynamic,0 ~3 q8 g2 y2 o/ S9 m9 q3 z
* unique id and should not be stored. It is
}- k& X6 @, J @" Q6 {' W * strictly for the use in the NX Open API:
2 @8 k& e4 V; ^; ~ L * UF_STYLER_ask_value(s) * u0 r) a+ j4 Y' l
* UF_STYLER_set_value / L- G+ w; i. B, q6 @7 `
* client_data - Client data is user defined data associated
2 X3 z0 Q8 c7 X: e* y: i u * with your dialog. Client data may be bound1 b) z6 u0 M! A; [/ z5 Z
* to your dialog with UF_MB_add_styler_actions
/ C! } Z0 g# G b) k3 q * or UF_STYLER_create_dialog.
3 Y' G" i6 F$ e: j3 d0 W4 c Q * callback_data - This structure pointer contains information
0 D5 z) d! g% T* j * specific to the UIStyler Object type that
# a# K# ~5 _2 I9 ? * invoked this callback and the callback type.. `; `+ e8 v% L1 ] k) m% W' [
* -----------------------------------------------------------------------*/9 {1 o: w. | Y& z/ I! |# ?* V- a
int PRO_DESIG_apply_fun ( int dialog_id,
+ \ @0 |. Z% |4 k0 G& R void * client_data,' ~7 I( T: Y6 B( b& x
UF_STYLER_item_value_type_p_t callback_data)4 E, [) p8 p3 {, q: {9 {+ r
{
2 u1 p* v5 k: X. U" F /* Make sure User Function is available. */
- H" v# H" k8 d( Y+ a UF_STYLER_item_value_type_t data;
7 A" K* V2 n* N4 o double value;
5 `2 p/ d( B+ {5 V7 k6 X4 d# i char prompt[256];
9 I# J; K* J7 l9 K/ D! y+ h if ( UF_initialize() != 0)
$ N! b* w9 K: Y4 g( X1 W return ( UF_UI_CB_CONTINUE_DIALOG );
+ T) _* g3 }! b' W/ Y" p+ W data.item_attr=UF_STYLER_VALUE;
' ?# I3 q+ r% Q8 V2 v data.item_id=PRO_DESIG_REAL_L1;6 m+ |5 F' T! j7 G) a6 h/ E
UF_STYLER_ask_value(dialog_id,&data);
5 E v2 n. V9 N PRO_DESIGN_edit_exp("L1",data.value.real);. g8 J; A3 w0 f5 w
data.item_attr=UF_STYLER_VALUE;" t v( K& T7 T7 A6 M4 T2 H
data.item_id=PRO_DESIG_REAL_W1;/ O7 k' V9 U) x0 u) o
UF_STYLER_ask_value(dialog_id,&data);" X" t5 [# v3 x* @
PRO_DESIGN_edit_exp("W1",data.value.real);
/ K- E1 N F( }0 A/ D5 y data.item_attr=UF_STYLER_VALUE;9 Q5 e6 H4 W( m5 J* E, ~* O* l
data.item_id=PRO_DESIG_REAL_H1;
# w Z( d0 w3 G9 ^' A* i5 \' S UF_STYLER_ask_value(dialog_id,&data);1 p* A4 ^" k2 x7 h
PRO_DESIGN_edit_exp("H1",data.value.real);; O/ k: c( J( `1 S: h
2 F, V8 K1 N3 o# I8 r data.item_attr=UF_STYLER_VALUE;
@! f% y7 C. k- l) d5 p8 }( x data.item_id=PRO_DESIG_REAL_H2;
, [# ~9 h7 S' }+ g- k& r6 J UF_STYLER_ask_value(dialog_id,&data);
% Z" M- L, b+ [ n6 I: O7 P* m3 B PRO_DESIGN_edit_exp("H2",data.value.real);6 x4 N# I# W$ F
data.item_attr=UF_STYLER_VALUE;
5 \2 H4 v" Z! [ data.item_id=PRO_DESIG_REAL_L2;
$ e- @$ Q- [7 ] Z1 F UF_STYLER_ask_value(dialog_id,&data);
4 ]6 ]% y" F& G0 P2 I; V4 ]9 d$ W. K PRO_DESIGN_edit_exp("L2",data.value.real);! C/ z5 L% W# _: L" n5 K2 k7 a
data.item_attr=UF_STYLER_VALUE;
! f! v# R- i( z5 b0 }* w- l% r data.item_id=PRO_DESIG_REAL_W2;$ Z! e, T( Y# K' d# g! n" t
UF_STYLER_ask_value(dialog_id,&data);5 g U: I+ c1 _6 S V9 X- K
PRO_DESIGN_edit_exp("W2",data.value.real);
' q5 k2 `" _0 i data.item_attr=UF_STYLER_VALUE;! k' z/ h( K' n0 u9 B u
data.item_id=PRO_DESIG_REAL_L3;
6 p- q. `" I% |+ e: H2 T9 i UF_STYLER_ask_value(dialog_id,&data);
" l/ N" M! U, f6 g3 \2 J! F! } PRO_DESIGN_edit_exp("L3",data.value.real);4 G# p6 O g7 h) @
UF_MODL_update();
, L) n. ?; [" e' n& l 4 L, H) X2 [, P" K) e
UF_MODL_eval_exp("VOLUME",&value);
* z" T( h/ L$ H, l sprintf(prompt,"当前压块的体积为%.3f",value);
5 ~2 T# w2 [* F& r. @2 s data.item_attr=UF_STYLER_LABEL;) n- i6 G. ~# b& A& m; c! J- ^
data.item_id=PRO_DESIG_LABEL_VOLME;
- N2 n$ y! O) D' x; C data.value.string=prompt;. |' }3 ?; J7 W3 G# _" r( M
UF_STYLER_set_value(dialog_id,&data);: K9 T3 t- x6 `
/* ---- Enter your callback code here ----- */
/ V5 Z1 u" H P1 ^* t O UF_terminate ();
2 n( H7 B. v( M- S( a /* Callback acknowledged, do not terminate dialog */! y3 e' C4 k; h2 x
/* A return value of UF_UI_CB_EXIT_DIALOG will not be accepted */
- T' M. _. K5 H' [ /* for this callback type. You must respond to your apply button.*/- Q1 |+ h# u( G& W1 k
return (UF_UI_CB_CONTINUE_DIALOG);
/ u) U0 j' W ^/ V- A; \}! N) M0 r/ |" \9 V9 m
' J6 I; X, E( x$ `
int PRO_DESIGN_edit_exp(char *dim_name,double dim_value)
4 q; I! e7 m& t7 |1 A{ ?; |1 K2 l- E
char exp[256],temp[50];
% {: z3 S% o: q, k6 h" ^! t" B. H& T int err;9 P! f7 J2 Z h: i, T" C+ H' k
strcpy(exp,dim_name);' c$ U: x6 }0 N# m$ f
strcat(exp,"=");$ y# \$ U! y: A% X6 d8 q. ^- l
sprintf(temp,"%.5f",dim_value);' z+ h- b2 {; n3 A, x/ F- y4 @3 K
strcat(exp,temp);, K" w! n" B, C( l5 W9 ]9 r4 V
err=UF_MODL_edit_exp(exp);% V7 R6 r/ P( m+ y7 s
return err;
& {; Y" [- J. n; f% O! s$ [}2 o1 c+ H Z/ o( Z
/* -------------------------------------------------------------------------
) y9 R! ?+ ~; L6 g$ _0 d * Callback Name: PRO_DESIG_cancel_fun+ ]* B7 |; @! R% }, R: J& o
* This is a callback function associated with an action taken from a
5 k* t7 z( v E0 m& s * UIStyler object. 8 K9 |* A# }, V0 A
*3 D, }7 A i; b6 M% W
* Input: dialog_id - The dialog id indicate which dialog this callback
+ V& `: a) ?9 c6 \' [6 t+ E+ B" e * is associated with. The dialog id is a dynamic,1 w& `9 j# x; T: N
* unique id and should not be stored. It is5 a6 o+ \' u- V" v) w6 O H- }
* strictly for the use in the NX Open API:
( R9 y2 _6 c6 M" z/ w * UF_STYLER_ask_value(s)
! ^" W* n. ?& m+ n; }' I * UF_STYLER_set_value
1 V }! l! t; C ?4 Q+ @9 m * client_data - Client data is user defined data associated
, P, @2 w& {0 E, ?$ s) g" M$ m * with your dialog. Client data may be bound4 z9 } \3 i8 _* Y
* to your dialog with UF_MB_add_styler_actions' _+ `; r! d2 q1 `
* or UF_STYLER_create_dialog.
$ x2 w0 N# [( f+ }3 G * callback_data - This structure pointer contains information6 L, U( d/ B* ?. f( ?2 r7 `0 m# ]8 K
* specific to the UIStyler Object type that
3 M m5 Y: _' d$ O * invoked this callback and the callback type.
~9 r7 ]% U0 N2 a& M7 B6 ?: c! i * -----------------------------------------------------------------------*/
) g+ F% e/ L; r* Rint PRO_DESIG_cancel_fun ( int dialog_id,* \; j& ?3 Z3 r
void * client_data,, s5 y0 ?- W ^+ p& F
UF_STYLER_item_value_type_p_t callback_data)2 p, G5 ^+ u! J, o
{' p8 O" l% X& @
/* Make sure User Function is available. */ 0 B, |+ ?' ^4 G( u, Y! V
if ( UF_initialize() != 0)
% x* p& q3 {+ h0 u return ( UF_UI_CB_CONTINUE_DIALOG );' a" v8 ]( l3 O- W8 [
/* ---- Enter your callback code here ----- */ ?# X/ Q8 B3 r
UF_terminate ();
2 t6 G! i" \$ @) z* \ /* Callback acknowledged, terminate dialog */4 Y q; G8 a) v- R, s
/* It is STRONGLY recommended that you exit your */ v# ~; o, a3 Z; l9 w
/* callback with UF_UI_CB_EXIT_DIALOG in a cancel call */
, |3 O M% a# Z8 `" _% d5 t /* back rather than UF_UI_CB_CONTINUE_DIALOG. */3 D4 I7 z# l1 @; [
return ( UF_UI_CB_EXIT_DIALOG ); - D, J) `; L9 A
} |
|