講義文稿案例guic_第1頁
講義文稿案例guic_第2頁
講義文稿案例guic_第3頁
講義文稿案例guic_第4頁
已閱讀5頁,還剩7頁未讀, 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、Lesson content:GUI Application OverviewData TargetsUsing Keywords and Targets with WidgetsLesson 7: Commands and Keywords (Part 2)30 minutesGUI Application OverviewMenus/IconsProvide the user with access to functionalityModesResponsible for gathering user input, processing commandsFormsProceduresFor

2、ms are “standalone”, procedures use promptsDialogsPrompt line, dialogs, viewportInput mechanismsLayout ManagersControl widget layoutWidgetsGUI controls (buttons, text fields, lists, etc.)GUI Commands & KeywordsProvide an interface between application data and the user interfaceData Targets (1/8)Reca

3、ll that data targets can operate in two modes, value and optionOption mode:Specified by using a message ID zero Data target responds by issuing the sender an ID_CHECK message if the senders ID matches the targets value; otherwise an ID_UNCHECK message is sent to the senderBy connecting multiple radi

4、o buttons (with different IDs) to the same target, the “one of many” selection is automatically enforced(as in the next example)Data Targets (2/8)Radio button exampleLets say that a data target, dt, has a value of 2Radio button 1 is given an ID = 1, and a target = dtRadio button 2 is given an ID = 2

5、, and a target = dtRadio button 3 is given an ID = 3, and a target = dtFXRadioButton(p, Button 1, dt, 1)FXRadioButton(p, Button 2, dt, 2)FXRadioButton(p, Button 3, dt, 3)Data Targets (3/8)Radio button exampleInitially, none of the buttons are checkedButton 1Button 2Button 3Data Targets (4/8)Radio bu

6、tton exampleDuring the GUI update process, Button 1 sends its target an update messageSince the ID of Button 1 does not match the data targets value, the data target sends the button an ID_UNCHECK messageID=1, SEL_UPDATEID_UNCHECK, MAND Data Targetvalue = 2Button 1Button 2Button 3Data Targets (5/8)R

7、adio button exampleNext in the GUI update process, Button 2 sends its target an update messageSince the ID of Button 2 does match the data targets value, the data target sends the button an ID_CHECK messageID=2, SEL_UPDATEID_CHECK, MANDButton 1Button 2Button 3 Data Targetvalue = 2Data Targets (6/8)R

8、adio button exampleNext in the GUI update process, Button 3 sends its target an update messageSince the ID of Button 3 does not match the data targets value, the data target sends the button an ID_UNCHECK messageButton 1Button 2Button 3 Data Targetvalue = 2ID=3, SEL_UPDATEID_UNCHECK, MANDData Target

9、s (7/8)Radio button exampleNow, if the user clicks on Button 1 it will send its target an command messageThe target responds by setting its value to 1ID=1, MAND Data Targetvalue = 1Button 1Button 2Button 3Data Targets (8/8)Radio button exampleThe GUI initiates another round of updating, and this tim

10、e Button 1 will receive an ID_CHECK message, and Button 2 and Button 3 will receive ID_UNCHECK messagesButton 1Button 2Button 3Using Keywords and Targets with Widgets (1/2)Symbolic constants Symbolic constants for kernel commands are all available in the top-level kernel name spaceThe same symbolic

11、constants are also available in the GUIGUI updating uses integer message IDs, but Abaqus/CAE often uses symbolic constants in its commands (for example renderStyle=WIREFRAME)Special symbolic constants have been created for the GUI process that have a string representation and a unique integer IDUse

12、of the ID allows AFXSymConstKeywords to be used with GUI updatingUse the getId() method of symbolic constants to obtain their IDUsing Keywords and Targets with Widgets (2/2)The widgets ID (selector) depends upon the type of keyword or target it is connected to:For int, float, string, and bool types,

13、 use a value of 0 (the default)For symbolic constant or int types:When connected to a list or combo box, use 0 When connected to a radio button, use the value of anappropriate symbolic constants ID (accessible via thegetId method)For tuple keywords:Use a value of zero when addressing the entire tupleUse the element number (1-based) when addressing a single element of the tuplecombo = boBox(hf, 8, 4,

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論