博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Matlab GUI - 怎样使GUI在不同分辨率的电脑上都能正常显示
阅读量:4182 次
发布时间:2019-05-26

本文共 1260 字,大约阅读时间需要 4 分钟。

1. 怎样使GUI在不同分辨率的电脑上都能正常显示

方法是将所有控件的Units都改成normalized。

注意所有控件的Postion都是相对于屏幕左下角而言的。

 

2. 怎样保存和加载默认设置

a. 在*_CloseRequestFcn中取出数据并保存到.mat文件:

configdir = get(handles.projectFolder_editText,'String');remote_folder = get(handles.remoteFolder_editText,'String');configdir_HE = get(handles.configdir_HE_editText,'String');configdir_LC = get(handles.configdir_LC_editText,'String');seqAlloc = get(handles.seqAlloc_pushbutton,'UserData');seqAllocTable = get(handles.seqAlloc_table,'Data');configdir_prefixHE = get(handles.prefix_editText, 'String');save settings.mat configdir remote_folder configdir_HE configdir_LC seqAlloc seqAllocTable configdir_prefixHE;% Hint: delete(hObject) closes the figuredelete(hObject);

b. 在*_OpeningFcn中加载数据:

% Update handles structureguidata(hObject, handles);if exist('settings.mat', 'file')    load settings.mat;    set(handles.projectFolder_editText,'String', configdir);    set(handles.remoteFolder_editText,'String', remote_folder);    set(handles.configdir_HE_editText,'String', configdir_HE);    set(handles.configdir_LC_editText,'String', configdir_LC);    set(handles.seqAlloc_pushbutton,'UserData', seqAlloc);    set(handles.seqAlloc_table,'Data', seqAllocTable);    set(handles.prefix_editText, 'String', configdir_prefixHE);end

 

转载地址:http://athai.baihongyu.com/

你可能感兴趣的文章
CMake 手册详解(七)
查看>>
CMake 手册详解(八)
查看>>
CMake手册详解 (九)
查看>>
CMake手册详解 (十)
查看>>
CMake手册详解 (十一)
查看>>
CMake手册详解 (十二)
查看>>
CMake手册详解 (十三)
查看>>
CMake手册详解 (十四)
查看>>
CMake手册详解 (十五)
查看>>
map::lower_bound/upper_bound的使用
查看>>
C++ STL中Map的按Key排序和按Value排序
查看>>
互斥量、条件变量与pthread_cond_wait()函数的使用,详解
查看>>
IO模式设置网络编程常见问题总结
查看>>
windows 编译webrtc 58版本库
查看>>
git tag操作教程
查看>>
Ubuntu系统中git每次提交都要输入密码怎么办?
查看>>
constexpr关键字
查看>>
std::copy详解
查看>>
C++11 新特性摘抄
查看>>
WebRTC学习之函数的异步执行
查看>>