直齿花键C语言程序源代码Word文档下载推荐.docx

上传人:b****7 文档编号:22757990 上传时间:2023-02-05 格式:DOCX 页数:25 大小:20.87KB
下载 相关 举报
直齿花键C语言程序源代码Word文档下载推荐.docx_第1页
第1页 / 共25页
直齿花键C语言程序源代码Word文档下载推荐.docx_第2页
第2页 / 共25页
直齿花键C语言程序源代码Word文档下载推荐.docx_第3页
第3页 / 共25页
直齿花键C语言程序源代码Word文档下载推荐.docx_第4页
第4页 / 共25页
直齿花键C语言程序源代码Word文档下载推荐.docx_第5页
第5页 / 共25页
点击查看更多>>
下载资源
资源描述

直齿花键C语言程序源代码Word文档下载推荐.docx

《直齿花键C语言程序源代码Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《直齿花键C语言程序源代码Word文档下载推荐.docx(25页珍藏版)》请在冰豆网上搜索。

直齿花键C语言程序源代码Word文档下载推荐.docx

==============================================================================*/

/*==============================================================================

Purpose:

ThisTEMPLATEfilecontainsCsourceandstaticstructuresto

guideyouintheconstructionofyourNXOpenapplicationdialog.

Thegenerationofyourdialogfile(.dlgextension)isthefirststeptowards

dialogconstructionwithinUnigraphics.YoumustnowcreateaUGOpen

applicationthatutilizesthisfile(.dlg).

Theinformationinthisfileprovidesyouwiththefollowing:

1.Helpontheuseofthefunctions,UF_MB_add_styler_actionsand

UF_STYLER_create_dialoginyourNXOpenapplication.Thesefunctions

willloadanddisplayyourUIStylerdialoginUnigraphics.

Anexampleofthefunction,UF_MB_add_styler_actionstoassociateyour

dialogtothemenubarisshownbelow(SearchonExample1).

Anexampleofainvokingadialogfromacallbackutilizing

UF_STYLER_create_dialogisalsoshownbelow(SearchforExample2).

AnexampleofauserexitutilizingUF_STYLER_create_dialogisalso

shownbelow(SearchforExample3).

2.Thecallbackstructure:

---CHANGE_cbs---

ThisstructureisVERYimportantifyouhavecallbacksassociatedwith

yourdialog.Itcorrelatesthedialogitemsinyourdialogwiththe

callbackfunctionsyoumustsupply.Youshouldnotmodifythis

structuresinceitMUSTmatchuptotheinformationstoredinyour

dialogfile(.dlg).Anyattempttodosowillcauseanerrorwhile

constructingyourdialog.Ifyouwishtomodifytheassociationof

yourcallbackstoyourdialog,pleasereloadyourdialogfile(.dlg)into

theUIStylerandregenerateyourfiles.

Youdonotneedtobeconcernedaboutthisstructure,simplypassitas

anargumenttothefunction,UF_STYLER_create_dialogalongwithyour

dialogfile(.dlg).

Example1displaystheactualcallyoumaymakeforthisparticular

dialog.

3.Theemptycallbackfunctions(stubs)associatedwithyourdialogitems

havealsobeenplacedinthisfile.Theseemptyfunctionshavebeen

createdsimplytostartyoualongwithyourcodingrequirements.

Thefunctionname,argumentlistandpossiblereturnvalueshavealready

beenprovidedforyou.

NOTE:

EachcallbackmustbewrapperedwiththefunctionsUF_initialize()

andUF_terminate().

/*Theseincludefilesareneededforthefollowingtemplatecode.*/

#include<

stdio.h>

uf.h>

uf_defs.h>

uf_exit.h>

uf_ui.h>

uf_styler.h>

uf_mb.h>

stdlib.h>

uf_modl_expressions.h>

uf_part.h>

uf_modl.h>

#include"

spline_dialog.h"

/*Thefollowingdefinitiondefinesthenumberofcallbackentries*/

/*inthecallbackstructure:

*/

/*UF_STYLER_callback_info_tCHANGE_cbs*/

#defineSPLINE_CB_COUNT(4+1)/*Add1fortheterminator*/

/*--------------------------------------------------------------------------

Thefollowingstructuredefinesthecallbackentriesusedbythe

stylerfile.ThisstructureMUSTbepassedintotheuserfunction,

UF_STYLER_create_dialogalongwithCHANGE_CB_COUNT.

--------------------------------------------------------------------------*/

staticUF_STYLER_callback_info_tSPLINE_cbs[SPLINE_CB_COUNT]=

{

{UF_STYLER_DIALOG_INDEX,UF_STYLER_CONSTRUCTOR_CB,0,SPLINE_constructor},

{UF_STYLER_DIALOG_INDEX,UF_STYLER_DESTRUCTOR_CB,0,SPLINE_destructor},

{UF_STYLER_DIALOG_INDEX,UF_STYLER_OK_CB,0,SPLINE_ok},

{UF_STYLER_DIALOG_INDEX,UF_STYLER_CANCEL_CB,0,SPLINE_cancel},

{UF_STYLER_NULL_OBJECT,UF_STYLER_NO_CB,0,0}

};

UF_MB_styler_actions_tcontains4fields.Thesearedefinedasfollows:

Field1:

thenameofyourdialogthatyouwishtodisplay.

Field2:

anyclientdatayouwishtopasstoyourcallbacks.

Field3:

yourcallbackstructure.

Field4:

flagtoinformmenubarofyourdialoglocation.ThisflagMUST

matchtheresourcesetinyourdialog!

DoNOTASSUMEthatchanging

thisfieldwillupdatethelocationofyourdialog.Pleaseusethe

UIStylertoindicatethepositionofyourdialog.

staticUF_MB_styler_actions_tactions[]={

{"

spline_dialog.dlg"

NULL,SPLINE_cbs,UF_MB_STYLER_IS_NOT_TOP},

{NULL,NULL,NULL,0}/*ThisisaNULLterminatedlist*/

/*----------------MENUBARHOOKUPHELPExample-------------------

TolaunchthisdialogfromaUnigraphicsmenubar,youmustfollow

thestepsbelow.

1)AddthefollowinglinestoyourMenuScriptfileinorderto

associateamenubarbuttonwithyourdialog.Inthis

example,acascademenuwillbecreatedandwillbe

locatedjustbeforetheHelpbuttononthemainmenubar.

Thebutton,SPLINE_DIALOG_BTNissetuptolaunchyourdialogand

willbepositionedasthefirstbuttononyourpulldownmenu.

Ifyouwishtoaddthebuttontoanexistingcascade,simply

addthe3linesbetweenMENULAUNCH_CASCADEandEND_OF_MENU

toyourmenuscriptfile.

TheMenuScriptfilerequiresanextensionof"

.men"

.

Makesurethatyouaddtheextensiontothefileandplace

thefileinyourstartupdirectory:

$UGII_USER_DIR/startupor

$UGII_SITE_DIR/startupor

$UGII_VENDOR_DIR/startupdirectory

MovethecontentsbetweenthedashedlinestoyourMenuscriptfile.

----------------------------------------------------------------

VERSION120

EDITUG_GATEWAY_MAIN_MENUBAR

BEFOREUG_HELP

CASCADE_BUTTONUISTYLER_DLG_CASCADE_BTN

LABELDialogLauncher

END_OF_BEFORE

MENUUISTYLER_DLG_CASCADE_BTN

BUTTONSPLINE_DIALOG_BTN

LABELDisplayspline_dialogdialog

ACTIONSspline_dialog.dlg

END_OF_MENU

---------------------------------------------------------------

2)Issueacalltothefunction,UF_MB_add_styler_actionsfromtheufsta

userexitasshownbelow.Tousethiscall,removetheconditional

definitions:

#ifdefMENUBAR_COMMENTED_OUT

#endifMENUBAR_COMMENTED_OUT

Thestaticstructure,actions,willallowyoutoassociateALLofyour

dialogsandcallbackfunctionstothemenubaratonce.Forexample,ifyou

wishtohave10dialogsassociatedto10differentbuttonsonthemenubar,

youmayentereachdialogandcallbacklistintotheactionsstructure.Make

surethatyouhavecreatedacorrespondingbuttoninyourMenuScriptfile.

Youmayalsohaveseparatesharedlibraries,eachwithaufstauserexit

foreachindividualdialog.

3)Placeyourcompiledandlinkedufstauserfunctionin

$UGII_VENDOR_DIR/startupdirectory.

NOTE:

Theuserfunctionmustcontaintheproperextension.so,.slor.dll

tomakeensurethatitisrecognizedbytheMenuScript.Ifitdoesnot

havetheproperextension,itwillNOTberecognizedbyMenuScript.

TheactionnameyouhaveprovidedinyourMenuScriptmustcorrespondto

tothedialognameprovidedintheactionstructure.ThisMUSTmatchinorder

tobindyourdlgfiletoyourMenuScriptbutton.

4)CopyyourUIStylerdialogfiletotheproperdirectory.

Alldialogfiles(.dlg)mustbelocatedin

$UGII_USER_DIR/applicationor

$UGII_SITE_DIR/applicationor

$UGII_VENDOR_DIR/applicationdirectory

------------------------------------------------------------*/

//#ifdefMENUBAR_COMMENTED_OUT

externvoidufsta(char*param,int*retcode,intrlen)

interror_code;

if((UF_initialize())!

=0)

return;

if((error_code=UF_MB_add_styler_actions(actions))!

=0)

{

charfail_message[133];

UF_get_fail_message(error_code,fail_message);

printf("

%s\n"

fail_message);

}

UF_terminate();

}

//#endif/*MENUBAR_COMMENTED_OUT*/

/*-------DIALOGCREATIONFROMACALLBACKHELPExample----------

Ifyouwishtohavethisdialogdisplayedfromthecallbackof

anotherUIStylerdialog,youshould:

1)MakesurethatthecallbackofyourUIStylerdialogis

designatedasadialogbuildingcallback.

2)Removetheconditionaldefinitions:

#ifdefDISPLAY_FROM_CALLBACK

#endifDISPLAY_FROM_CALLBACK

3)Yourcallbackshouldissueacalltothisfunction.

4)Youshouldalsoaddthefuncitonalprototypetoyourheaderfile

(spline_dialog.h)andensurethatthefileisproperlyincluded.

Alldialogfilesmustbelocatedin

--------------------------------------------------------------*/

#ifdefDISPLAY_FROM_CALLBACK

externint<

enterthenameofyourfunction>

(int*response)

interror_code=0;

if((error_code=UF_initialize())!

=0)

return(0);

if((error_code=UF_STYLER_create_dialog("

CHANGE_cbs,/*Callbacksfromdialog*/

CHANGE_CB_COUNT,/*numberofcallbacks*/

NULL,/*Thisisyourclientdata*/

response))!

/*Gettheuserfunctionfailmessagebasedonthefailcode.*/

UF_UI_set_status(fail_message);

%s

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 解决方案 > 其它

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1