《labwindowscvi2第三章圖形用戶(hù)界面設(shè)計(jì)課件》由會(huì)員分享,可在線閱讀,更多相關(guān)《labwindowscvi2第三章圖形用戶(hù)界面設(shè)計(jì)課件(38頁(yè)珍藏版)》請(qǐng)?jiān)谘b配圖網(wǎng)上搜索。
1、,單擊此處編輯母版標(biāo)題樣式,單擊此處編輯母版文本樣式,第二級(jí),第三級(jí),第四級(jí),第五級(jí),*,*,/38,LabWindows,/CVI,教程,(2),用戶(hù)圖形界面設(shè)計(jì),喬立巖,http:/ ext.526,Office:,科學(xué)園,2A,棟,526,圖形用戶(hù)界面設(shè)計(jì),圖形用戶(hù)界面,(Graphical User Interface),面板(,panel,),菜單條(,menu bar,),控件(,control,),LabWindows,/CVI,自定義的資源格式,面板設(shè)計(jì),其它資源的容器,面板屬性編輯器,使用用戶(hù)界面設(shè)計(jì)函數(shù)創(chuàng)建面板和改變面板屬性,10/20/2024,面板,(panel),10
2、/20/2024,面板編輯窗口,10/20/2024,面板操作函數(shù):,NewPanel,創(chuàng)建面板,int,NewPanel,(,int,Parent_Panel_Handle,char,Panel_Title,int,Panel_Top,int,Panel_Left,int,Panel_Height,int,Panel_Width,);,testPanelHandle,=,NewPanel,(0,新面板,10,10,200,300);,LoadPanel,載入面板,int,LoadPanel,(,int,Parent_Panel_Handle,char Filename,int,Panel_R
3、esource_ID,);,testPanelHandle,=,LoadPanel,(0,test.uir,PANEL_TEST);,DisplayPanel,顯示面板,int,DisplayPanel,(,int,Panel_Handle,);,DisplayPanel,(,testPanelHandle,);,DiscardPanel,釋放面板,int,DiscardPanel,(,int,Panel_Handle,),DiscardPanel,(,testPanelHandle,);,10/20/2024,HidePanel,隱藏面板,int,HidePanel,(,int,Panel_
4、Handle,);,HidePanel,(,testPanelHandle,);,GetPanelAttribute,獲取面板屬性,int,GetPanelAttribute,(,int,Panel_Handle,int,Panel_Attribute,void*,Attribute_Value,);,GetPanelAttribute,(,testPanelHandle,ATTR_BACKCOLOR,SetPanelAttribute,設(shè)置面板屬性,int,SetPanelAttribute,(,int,Panel_Handle,int,Panel_Attribute,.);,SetPane
5、lAttribute,(,testPanelHandle,ATTR_BACKCOLOR,VAL_RED);,SavePanelState,保存面板狀態(tài),RacallPanelState,調(diào)出面板狀態(tài),10/20/2024,彈出式面板,(Pop-up Panel),10/20/2024,彈出式面板,(Pop-up Panel),10/20/2024,彈出式面板函數(shù),(Pop-up Panel),InstallPopup,載入彈出式面板,int,InstallPopup,(,int,Panel_Handle,);,InstallPopup,(,testPanelHandle,);,RemovePo
6、pup,刪除彈出式面板,int,RemovePopup,(,int,Remove_Popup,);,RemovePopup,(0);,MessagePopup,輸出信息對(duì)話框,int,MessagePopup,(char Title,char Message);,MessagePopup,(,提示信息,測(cè)試結(jié)束,全部合格,);,ConfirmPopup,等待確認(rèn)對(duì)話框,Yes or No,int,ConfirmPopup,(char Title,char Message);,response=,ConfirmPopup,(,測(cè)試信息,測(cè)量錯(cuò)誤,是否繼續(xù)?,);,PromptPopup,等待輸入
7、字符信息對(duì)話框,int,PromptPopup,(char Title,char Message,char,Response_Buffer,int,Max_Response_Length,);,PromptPopup,(,輸入信息,請(qǐng)輸入姓名,10/20/2024,FileSelectPopup,int,FileSelectPopup,(char,Default_Directory,char,Default_File_Spec,char,File_Type_List,char Title,int,Button_Label,int,Restrict_Directory,?,int,Restric
8、t_Extension,?,int,Allow_Cancel,?,int,Allow_Make_Directory,?,char,Path_Name,);,i=,FileSelectPopup,(,c:vxipnp,*.txt,*.*,選擇數(shù)據(jù)文件,VAL_LOAD_BUTTON,0,0,1,0,filename);,DirSelectPopup,int,DirSelectPopup,(char,Default_Directory,char Title,int,Allow_Cancel,?,int,Allow_Make_Directory,?,char,Path_Name,);,i=,DirS
9、electPopup,(,c:vxipnp,Select Directory,1,1,WaveformGraphPopup,int,WaveformGraphPopup,(char Title,void*,Y_Array,int,Number_of_Points,int,Y_Data_Type,double,Y_Gain,double,Y_Offset,double,Initial_X,double,X_Increment,);,WaveformGraphPopup,(,測(cè)量波形,testdata,1024,VAL_DOUBLE,1.0,0.0,0.0,1.0);,10/20/2024,菜單條
10、設(shè)計(jì),簡(jiǎn)易菜單條和定制菜單條,菜單制作和編輯器,使用用戶(hù)界面函數(shù)創(chuàng)建和編輯菜單,10/20/2024,菜單編輯窗口,10/20/2024,菜單操作函數(shù):,LoadMenuBar,int,LoadMenuBar,(,int,Destination_Panel_Handle,char Filename,int,Menu_Bar_Resource_ID,);,mainMenuHandle,=,LoadMenuBar,(,testPanelHandle,test.uir,MAIN_MENU);,DiscardMenuBar,int,DiscardMenuBar,(,int,Menu_Bar_Handl
11、e,);,DiscardMenuBar,(,mainMenuHandle,);,NewMenuBar,int,NewMenuBar,(,int,Destination_Panel_Handle,);,mainMenuHandle,=,NewMenuBar,(,testPanelHandle,);,NewMenu,int,NewMenu,(,int,Menu_Bar_Handle,char,Menu_Name,int,Before_Menu_ID,);,menuFileID,=,NewMenu,(,mainMenuHandle,文件,1);,10/20/2024,NewMenuItem,int,
12、NewMenuItem,(,int,Menu_Bar_Handle,int,Menu_ID,char,Item_Name,int,Before_Menu_Item_ID,int,Short_Cut_Key,MenuCallbackPtr,Event_Function,void*,Event_Callback_Data,);,&,menuFileOpenID,=,NewMenuItem,(,mainMenuHandle,menuFileID,打開(kāi),.,1,0,FileOpen,0);,NewSubMenu,int,NewSubMenu,(,int,Menu_Bar_Handle,int,Menu
13、_Item_ID,);,menuFileOpenID,=,NewSubMenu,(,mainMenuHandle,menuFileID,);,DiscardMenu,DiscardSubMenu,DiscardMenuItem,10/20/2024,控件設(shè)計(jì),控件種類(lèi):,數(shù)值型,(Numeric),:數(shù)值控件,顏色選擇控件,數(shù)值滑動(dòng)條,10/20/2024,文本型,(Text),:字符串控件,文本信息,文本框,10/20/2024,命令按鈕,(Command Button),:命令按鈕,圖片按鈕,雙態(tài)按鈕,(Toggle Button),:雙態(tài)按鈕,文本,/,圖形按鈕,單選,/,復(fù)選控件,10
14、/20/2024,指示等,(LED),二值開(kāi)關(guān),(Binary Switch),10/20/2024,列表控件,(Ring),:下拉列表,滑動(dòng)列表,圖形列表,10/20/2024,列表框,(List Box),裝飾控件,(Decoration),10/20/2024,圖形控件,(Graph),:曲線圖控件,帶狀圖控件,數(shù)字圖控件,曲線圖控件,(Graph),10/20/2024,帶狀圖控件,(Strip Chart),10/20/2024,數(shù)字圖控件,(Digital Graph),10/20/2024,圖片控件,(Picture),10/20/2024,樹(shù)形控件,(Tree),10/20/2
15、024,定時(shí)器控件,(Timer),畫(huà)布控件,(Canvas),10/20/2024,表格控件,(Table),10/20/2024,分隔控件,(Splitter),10/20/2024,分頁(yè)控件,(Tab),10/20/2024,定制控件,(Custom Control),10/20/2024,通用控件操作函數(shù):,GetCtrlVal,int,GetCtrlVal,(,int,Panel_Handle,int,Control_ID,void*Value);,GetCtrlVal,(,testPanelHandle,NUMERIC_VOL,SetCtrlVal,int,SetCtrlVal,(
16、,int,Panel_Handle,int,Control_ID,.);,SetCtrlVal,(,testPanelHandle,NUMERIC_VOL,5.0);,GetCtrlAttribute,int,GetCtrlAttribute,(,int,Panel_Handle,int,Control_ID,int,Control_Attribute,void*,Attribute_Value,);,GetCtrlAttribute,(,testPanelHandle,NUMERIC_VOL,ATTR_CTRL_VAL,SetCtrlAttribute,int,SetCtrlAttribute,(,int,Panel_Handle,int,Control_ID,int,Control_Attribute,.);,SetCtrlAttribute,(,testPanelHandle,NUMERIC_VOL,ATTR_CTRL_VAL,5.0);,10/20/2024,特定控件操作函數(shù):,列表控件函數(shù),文本框控件函數(shù),圖形控件函數(shù),定時(shí)器控件函數(shù),表格控件函數(shù),5.,用戶(hù)界面管理:,Ru