资源描述
,单击此处编辑母版标题样式,单击此处编辑母版文本样式,第二级,第三级,第四级,第五级,2019/1/25,1,/38,2024/11/24,图形用户界面设计,图形用户界面,(Graphical User Interface),面板(,panel,),菜单条(,menu bar,),控件(,control,),LabWindows/CVI,自定义的资源格式,面板设计,其它资源的容器,面板属性编辑器,使用用户界面设计函数创建面板和改变面板属性,2023/9/20图形用户界面设计图形用户界面(Graphi,2024/11/24,面板,(panel),2023/9/20面板(panel),2024/11/24,面板编辑窗口,2023/9/20面板编辑窗口,2024/11/24,面板操作函数:,NewPanel,创建面板,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_Resource_ID);,testPanelHandle=LoadPanel(0,test.uir,PANEL_TEST);,DisplayPanel,显示面板,int DisplayPanel(int Panel_Handle);,DisplayPanel(testPanelHandle);,DiscardPanel,释放面板,int DiscardPanel(int Panel_Handle),DiscardPanel(testPanelHandle);,2023/9/20面板操作函数:,2024/11/24,HidePanel,隐藏面板,int HidePanel(int Panel_Handle);,HidePanel(testPanelHandle);,GetPanelAttribute,获取面板属性,int GetPanelAttribute(int Panel_Handle,int Panel_Attribute,void*Attribute_Value);,GetPanelAttribute(testPanelHandle,ATTR_BACKCOLOR,SetPanelAttribute,设置面板属性,int SetPanelAttribute(int Panel_Handle,int Panel_Attribute,.);,SetPanelAttribute(testPanelHandle,ATTR_BACKCOLOR,VAL_RED);,SavePanelState,保存面板状态,RacallPanelState,调出面板状态,2023/9/20HidePanel隐藏面板,2024/11/24,弹出式面板,(Pop-up Panel),2023/9/20弹出式面板(Pop-up Panel),2024/11/24,弹出式面板,(Pop-up Panel),2023/9/20弹出式面板(Pop-up Panel),2024/11/24,弹出式面板函数,(Pop-up Panel),InstallPopup,载入弹出式面板,int InstallPopup(int Panel_Handle);,InstallPopup(testPanelHandle);,RemovePopup,删除弹出式面板,int RemovePopup(int Remove_Popup);,RemovePopup(0);,MessagePopup,输出信息对话框,int MessagePopup(char Title,char Message);,MessagePopup(,提示信息,测试结束,全部合格,);,ConfirmPopup,等待确认对话框,Yes or No,int ConfirmPopup(char Title,char Message);,response=ConfirmPopup(,测试信息,测量错误,是否继续?,);,PromptPopup,等待输入字符信息对话框,int PromptPopup(char Title,char Message,char Response_Buffer,int Max_Response_Length);,PromptPopup(,输入信息,请输入姓名,2023/9/20弹出式面板函数(Pop-up Panel),2024/11/24,FileSelectPopup,int FileSelectPopup(char Default_Directory,char Default_File_Spec,char File_Type_List,char Title,int Button_Label,int Restrict_Directory?,int Restrict_Extension?,int Allow_Cancel?,int Allow_Make_Directory?,char Path_Name);,i=FileSelectPopup(c:vxipnp,*.txt,*.*,选择数据文件,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=DirSelectPopup(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(,测量波形,testdata,1024,VAL_DOUBLE,1.0,0.0,0.0,1.0);,2023/9/20FileSelectPopup,2024/11/24,菜单条设计,简易菜单条和定制菜单条,菜单制作和编辑器,使用用户界面函数创建和编辑菜单,2023/9/20菜单条设计,2024/11/24,菜单编辑窗口,2023/9/20菜单编辑窗口,2024/11/24,菜单操作函数:,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_Handle);,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);,2023/9/20菜单操作函数:,2024/11/24,NewMenuItem,int 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,打开,.,1,0,FileOpen,0);,NewSubMenu,int NewSubMenu(int Menu_Bar_Handle,int Menu_Item_ID);,menuFileOpenID=NewSubMenu(mainMenuHandle,menuFileID);,DiscardMenu,DiscardSubMenu,DiscardMenuItem,2023/9/20,2024/11/24,控件设计,控件种类:,数值型,(Numeric),:数值控件,颜色选择控件,数值滑动条,2023/9/20 控件设计,2024/11/24,文本型,(Text),:字符串控件,文本信息,文本框,2023/9/20文本型(Text):字符串控件,文本信息,,2024/11/24,命令按钮,(Command Button),:命令按钮,图片按钮,双态按钮,(Toggle Button),:双态按钮,文本,/,图形按钮,单选,/,复选控件,2023/9/20命令按钮(Command Button):,2024/11/24,指示等,(LED),二值开关,(Binary Switch),2023/9/20指示等(LED),2024/11/24,列表控件,(Ring),:下拉列表,滑动列表,图形列表,2023/9/20列表控件(Ring):下拉列表,滑动列表,,2024/11/24,列表框,(List Box),装饰控件,(Decoration),2023/9/20列表框(List Box),2024/11/24,图形控件,(Graph),:曲线图控件,带状图控件,数字图控件,曲线图控件,(Graph),2023/9/20图形控件(Graph):曲线图控件,带状图,2024/11/24,带状图控件,(Strip Chart),2023/9/20带状图控件(Strip Chart),2024/11/24,数字图控件,(Digital Graph),2023/9/20数字图控件(Digital Graph),2024/11/24,图片控件,(Picture),2023/9/20图片控件(Picture),2024/11/24,树形控件,(Tree),2023/9/20树形控件(Tree),2024/11/24,定时器控件,(Timer),画布控件,(Canvas),2023/9/20定时器控件(Timer),2024/11/24,表格控件,(Table),2023/9/20表格控件(Table),2024/11/24,分隔控件,(Splitter),2023/9/20分隔控件(Splitter),2024/11/24,分页控件,(Tab),2023/9/20分页控件(Tab),2024/11/24,定制控件,(Custom Control),2023/9/20定制控件(Custom Control),2024/11/24,通用控件操作函数:,GetCtrlVal,int GetCtrlVal(int Panel_Handle,int Control_ID,void*Value);,GetCtrlVal(testPanelHandle,NUMERIC_VOL,SetCtrlVal,int SetCtrlVal(int Pan
展开阅读全文