matlab gui(三)对话框(文件打开/保存对话框,进度条)
2016-03-19 17:23
951 查看
%% 文件打开/保存 %uigetfile uigetfile%默认获得(不是打开)文件对话框 doc uigetfile %规定打开文件类型 uigetfile('*.m'); %输出参数的意义,可看上边的doc文件 [filename,path,sureORcancel]=uigetfile; if(sureORcancel==1) load(fullfile(filename,path)); end uigetfile('*.m','实例','default.m'); %输入/保存文件 [a b c]=inputfile('*.m'); %% 颜色/字体设置对话框 uisetcolor doc uisetcolor c=uisetcolor([1 0 0]) h=plot(0:10); c=uisetcolor(h);%将句柄加入,可以设置其代表的图形的颜色 b=uicontrol('Parent',gcf,'String','颜色值','Style','pushbutton', ... 'Callback','c=uisetcolor;set(b,''BackgroundColor'',c);'); %字体对话框 uisetfont(b); %% 进度条 h=waitbar(0,'MySample'); get(h)%进度条由,坐标,{line,patch(面)},组成 get(get(h,'Children')); ha=get(h,'Children'); %获得坐标轴子对象的子对象的内容 get(ha,'Children') get(ans(1)) get(ans(2)) %获得个对象的内容就可改变其属性 hrand=waitbar(0.3,'颜色') ha1=get(hrand,'Children'); hac=get(ha1,'Children');%ha1子对像的句柄列表 hapa=findall(hac,'Type','patch'); set(hapa,'Facecolor','k'); %% 普通对话框 dialog h=dialog('name','aboutme', ... 'Position',[200 200 200 70]); uicontrol('Style','pushbutton', ... 'Parent',h, ... 'Callback','plot(cos([0:0.1:6]))', ... 'String','确定', ... 'Units','Normalized', ... 'Position',[0.1 0.1 0.2 0.2]); %错误/警告对话框 errordlg warndlg %% 输入对话框 name=inputdlg('input your name','MySample'); name=inputdlg({'input your name','age'},'MySample');
相关文章推荐
- MooBox 基于Mootools的对话框插件
- 基于jQuery实现带动画效果超炫酷的弹出对话框(附源码下载)
- C#实现在前端网页弹出警告对话框(alert)的方法
- Android开发必知 九种对话框的实现方法
- Android列表对话框用法实例分析
- C#使用Word中的内置对话框实例
- MFC对话框中添加状态栏的方法
- 解析在main函数之前调用函数以及对设计的作用详解
- 用JavaScript实现对话框的教程
- Asp.net 弹出对话框基类(输出alet警告框)
- boxy基于jquery的弹出层对话框插件扩展应用 弹出层选择器
- 自制轻量级仿jQuery.boxy对话框插件代码
- 基于jQuery的弹出警告对话框美化插件(警告,确认和提示)
- JS 模态对话框和非模态对话框操作技巧汇总
- jquery ui对话框实例代码
- Android中自定义对话框(Dialog)的实例代码
- asp.net静态方法弹出对话框实现思路
- JavaScript 对话框和状态栏使用说明
- Jquery实现页面加载时弹出对话框代码
- java和matlab画多边形闭合折线图示例讲解