公开培训二次开发introduction to hwtk_第1页
公开培训二次开发introduction to hwtk_第2页
公开培训二次开发introduction to hwtk_第3页
公开培训二次开发introduction to hwtk_第4页
公开培训二次开发introduction to hwtk_第5页
已阅读5页,还剩23页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、March 2016 GUI designControlsGeneralCommand buttonsTooltipsProgress barsPromptsNotificationsLayoutControl sizes.Layout balance.Layout resize.Keyboard shortcutsMouse actionsDialog boxesError messagesConfirmationsIconsHelpWhat is HWTK (Hyper Works Tool Kit)HWTK is our new Tk toolkitCovers commonly use

2、d widgetsEmbedded GUI standardsWith modern look and feelSimple Tk like syntaxTwiki: Documentation (Perforce and Twiki)Unit testsAdvantagesOO code base with Tk syntaxStyles and themesConsistent widgets ( arguments & behavior )Auto-tooltip simply provide the string to showValidationNational Language S

3、upport (NLS)Embedded GUI standardsF1 - Launches helpDnD (where applicable)Easy to enhance and maintainDerive or create your own widgets if needed%-char substitutions for callbacksMeaningful error messages (stack trace)HWTK Base Widgets - Object DiagramButton Checkbutton Choosedirentry Combobox Entry

4、 Frame Label Labelframe Menu Notebook Openfileentry Pane Progressbar Radiobutton Savefileentry Scale Searchentry Separator Sizegrip Spinbox Splitframe Statebutton ToolbuttonHWTK Dialogs - Object DiagramDialogWindowWizardInputdialogHWTK toolbuttonHWTK openfileentryHWTK savefileentryHWTK comboboxHWTK

5、Entry:hwtk:dialog .d -title :hwtk:entryset f .d recesshwtk:label $f.l1 -text Stringhwtk:entry $f.e1 -help String entrypack $f.l1 $f.e1 -side left .d postHWTK Checkbutton:hwtk:dialog .d -title :hwtk:checkbuttonset f .d recessset state_wipers 1;set state_brakes 1;set state_driver 1;hwtk:checkbutton $f

6、.ck1 -text Wipers OK -help Select safety item - wipers -variable state_wipers;hwtk:checkbutton $f.ck2 -text Brakes OK -help Select safety item - brakes -variable state_brakes;hwtk:checkbutton $f.ck3 -text Driver sober -help Select safety item - driver state -variable state_driver;grid $f.ck1 -sticky

7、 wgrid $f.ck2 -sticky wgrid $f.ck3 -sticky w.d postHWTK radiobutton:hwtk:dialog .d -title :hwtk:radiobuttonset recess .d recess;set fontsize 12hwtk:radiobutton $recess.rb1 -text Point Size 10 -variable fontsize -value 10;hwtk:radiobutton $recess.rb2 -text Point Size 12 -variable fontsize -value 12;h

8、wtk:radiobutton $recess.rb3 -text Point Size 14 -variable fontsize -value 14;pack $recess.rb1 $recess.rb2 $recess.rb3;.d post;HWTK SelectList (Itcl)setwhwtk:dialog.dialog-titleselectlistdemo$whideapply;setrecess$wrecesshwtk:selectlist$recess.sl-stripes1-selectmodemultiple mandpack$recess.sl-fillboth

9、-expandtrue;$recess.slcolumnaddentities-textEntities$recess.slcolumnaddid-textId$recess.slcolumnaddcolor-imagepalette-16.png$recess.slcolumnaddthickness-textThicknessforseti0$i10incrisetclrexprint(rand()*64)$recess.slrowaddrow$i-valueslistentitiescomp$clrid$icolorexpr$clr?$clr:1thickness$i.$i$i$wpos

10、thwt:Table:Create set tbl :hwt:Table:Create $listboxFrame $columnDescriptionList -titleList $titleList -dataListVar $ns:dataList -callbackFunctionList list $ns:ToggleCheckInState %f %r %c %si %dl $ns:CreateButton %f %r %c %dl %sc $ns:OnEditCallBackFunc %d %c %r $listboxFrame $ns boBoxCallBack %f %r

11、%c %dl %sc $ns boBoxPropertyCallBack %f %r %c %dl %sc -selectmode extended -columnwidth 50 50 150 -invalidchar a boboxlist $ns boBoxList -invalidcharcallback $ns:OnInvalidChar %f %r %c %sc mand $ns:OnSelChange; set data0 lindex $preFix 0_$preIndex :hwt:Table:AddRow $tbl end $datahwtk:tablehwtk:menuM

12、enu:hwtk:treectrlHWTK DNDNotebookModern appearanceEasy to identify the active tabImage and/or text on TabOptional close button on tabsOptional DnD of tabsEnable/disable tabs.Examples (Buttonbox)PerformanceHWTK TestsTest e.g.There are 1086 test cases so far.Example: Write Your Own WidgetExample: Write Your Own Widget Cont.Future DevelopmentHWTK:NLS using msgcat packageToolba

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论