《HyperWorks桌面自定义简介.docx》由会员分享,可在线阅读,更多相关《HyperWorks桌面自定义简介.docx(20页珍藏版)》请在第壹文秘上搜索。
1、TableofContentsIntroductiontoHyperWorksDesktopCustomizationChaPter1:IntrOdUCtiOntoTC1.7AbOInTC1.7AbOiJtTk8BascTelSVnlaX8TC1.COmrnandOVefVteW8TkBaSiCCOmmandS23ChaPter2:HVPerWOrkSDeSktOPEnVironment29TheHyDerWorkSDeSktoD29TheCommand1.aVer31EXerCiSe2.1ChanQinQIheClientTVDeUSingtheCB1U11andWindowPraCtiCa
2、lEXerCiSeS4243ChaPter3:TheCOmmand1.aYerEXPIOredCommanClCateaOrieS43BaSiCCOmmandS44WOrkIntlWithHandIeS46EXerCiSe3BaSiCCommandSandWorkinqWimHandleS49PraCtiCalExercises54ChaPter4:TheAnirnatiOnClient55AnimauOnWindow55EXerCiSe4.11.OaClinaaModelandReSUltSFiIe59MOdelObieCt61EXerCiSe4.2WorkinQWlththeModelOb
3、ect67PraCtiCalEXerCiSeS71ChaPter5:ReSUltSandQUerV73ADDlYinaReSUltS73EXereiSe5.1ContourinaReSUItSandContOUnnabySeIeCtiOn77Res,s81EXerCiSe5.2QUeryinqCOnK)UredReSiJhSandCreatinga1.iStOfReSUItS84PraCHCalEXerCiSeS88ChaPter6:ThePlOtUnaCIient91ThePIOttinQWindOW91DefininqCurvesfromDataFiles92DefiningClJrVeS
4、fromMathEXPreSSiOnS94AddinqNOteStoaPlOt95IntrodUCUontoTemPIeXStatementS97EXerCiSe6.1CreatinqPIotSandNQteSWimTemDleXinsideIheNQteS98PraCtiCalExercises106ChaDter7:TheMotiOnVieWModelClient109MOdelWindOW109SolUtiOnSForEXerCiSeS113GUIsquickly.Itprovedsopopularthatitnowshipswithalldistributionsof7cl.Tksha
5、resmanyconceptswithotherwindowingtoolkits,butyoudonotneedtoknowmuchaboutgraphicaluserinterfacestogetstartedwithTk.Tkaddsabout35Tclcommandsthatletyoucreateandmanipulatewidgetsinagraphicaluserinterface.AWldgetisawindowinagraphicaluserinterfacethathasaparticularappearanceandbehavior.Thetermswidgetandwi
6、ndowareoftenusedinterchangeably.Widgettypesincludebuttons,scrollbars,menus,andtextwindows.Tkalsohasageneral-purposedrawingWIdgetcalledacanvasthatletsyoucreatelighter-weightitemssuchaslines,boxes,andbitmaps.TclandTkarehighlyportable,runningonessentiallyallflavorsofUnix(1.inux,Solaris.IRIX1AIX.*BSD,th
7、elistgoesonandon),Windows.Macintosh,andmore.SomebasicTkcommandswillbediscussedlater.Foradditionalinformation,pleaserefertothemanual.BasicTclSyntax Firstitemofacommandlineisammandname. Thewordsinthemmandlineareseparatedbyoneormorespaces. Wordscanbegroupedwithdoublequotesorcrlybaces. Commandsaretermin
8、atedwithnewlineorsemi-lon. Awordstartingwithadollarsign($)mustbeavariablename.Thestringwillbereplacedbythevalueolthevariable. WordsenclosedwithinsquarebracketsmustbealegalIclcommand.Thestringswouldbereplacedbytheresultsofevaluatingthecommand.TC1.CommandOverviewInthefollowingmmandoverviewitisrecommen
9、dthatthestudentstrytheexamplesthemselves.1.TextOutputPrintingoutastringusingTclisdoneusingtheputscommand.Asingleunitoftextaftertheputscommandwillbeoutput.Example1.1putsHyperWorksOutput:HyperWorksIfthestringismorethanoneword,thestringmustbeenclosedineitherdoublequotes(b*)orbraces().Manycommands,inclu
10、dingtheputscommand,acceptmultiplearguments.Ifthestringisnotenclosedinquotesorbraces,theindividualwordsareconsideredarguments.Asetofwordsenclosedinquotesorbraceswilltreatedasasingleunit.Thetwooptionsofquotesorbracesbehavedifferentlyandthedifferenceswillbediscussedinthenextsection.OutputAlbanyTheCapit
11、olofNewYorkis:TheCapitolofNewYorkis:AlbanyTheCapltolofNewYorkIs:$ZWhendefiningastring,iftherearemultiplewordsinthestringwehavelearnedthatwecaneitherusedoublequotesorbraces.Thedifferencebetweenthesetwooptionsishowtheytreatvariablesthatareintheirstrings.Example 2.3: puts$ZJ1.ABE1.puts$Z_1.ABE1.OutputT
12、heCapitolofNewYorkis:Albany$Z_1.ABE1.$ZExample2.3showshowusingthedoublebraceactuallydisablesthesubstitutionofvariableswithinthebraces.Notethatbraceshavethiseffectonlywhentheyareusedtorgrouping(i.e.atthebeginningandendofasequenceofwords).Ifastringisalreadygrouped,eitherwrthquotesorbraces,andbracesocc
13、urinthemiddleofthegroupedstring(i.e.foobar),thenthebracesaretreatedasregularcharacterswithnospecialmeaning.Ifthestringisgroupedwithquotes,substitutionswilloccurwithinthequotedstring,evenbetweenthebraces.Example 2.4:setmonth2setday3setyear09setdateSroonth:$day:$yearputs$dateOutput:2:3:09Herevariables
14、ubstitutionisusedinseveralplaces:Thevaluesofthevariablesmonth,day,andyeararesubstitutedinthesetcommandthatassignsthevalueofthedate*variable,andthevalueofthedatevariableisthensubstitutedinthelinethatdisplaystheoutput.Example 2.5:stfooputshi,eval$fooOutput:hiInthisexample,thevariablefooholdsanother(sm
15、all)Tclscriptthatsimplyprintsthewordhi.Thevalueofthevariablefoo,issubstitutedintoanevalcommand.Theevalmmandtakesoneormoreargumentsv/hichtogethercompriseaTclscriptandpassesittotheTclinterpreter.3. ExpressionsExamples3.1and3.2illustratetheuseofrelationalexpressionswiththeeprcommand.Thefirstexpressionevaluatesto0(false)since0doesnotequal1,whereasthesecondexpressionevaluatesto1(true),since,obviously.1doesequal1Therelationaloperator三三isusedtodothecomparison.Example 1.3:epr4+5Output