将Matlab GUI转换为指南GUI [英] Converting Matlab GUI into a guide GUI

查看:99
本文介绍了将Matlab GUI转换为指南GUI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我继承了一堆Matlab脚本,这些脚本使用对uicontrol,uimenu等的调用来手动构建GUI.多年来,我们需要删除元素并将其添加到GUI中,并且由于所有位置都是在脚本中手动指定的,布局并没有真正改变以容纳缺失的元素,因此它开始看起来像是一堆垃圾.

I have inherited a pile of Matlab scripts that manually build a GUI using calls to uicontrol, uimenu, etc. Over the years we have needed to remove and add elements to the GUI and since all the positions are specified manually in the scripts, the layout hasn't really changed to accommodate the missing elements so it is really starting to look like a pile of trash.

有没有一种方法可以将我的matlab脚本化gui自动转换为可以与guide一起使用的东西?我宁愿不必重新开始...

Is there a way to automatically convert my matlab scripted gui into something I can use with guide? I would rather not have to start over...

推荐答案

使用GUIDE生成的GUI并不比手动编写的GUI好多少(就维护性而言,我认为还不错).

GUIs generated with GUIDE are not much better than manually scripted ones (if not worse in my opinion in terms of maintainability).

可悲的事实是,MATLAB中没有内置的布局管理器(FEX上有用户提供的布局管理器,例如 gridbag布局等.如果要重构代码,请考虑使用某种GUI布局管理器.

The sad truth is that there are no builtin layout managers in MATLAB (there are user-contributed ones on FEX like border layout, gridbag layout and others). If you are refactoring the code, please consider using some sort of GUI layout manager.

要回答您的问题,afaik没有自动工具可以进行这种转换.

To answer your question, afaik there is no automatic tool for such a conversion.

确切地说,MATLAB有一些未公开的布局管理器:uiflowcontaineruigridcontainer.参见Yair Altman的文章

To be exact, MATLAB has some undocumented layout managers: uiflowcontainer and uigridcontainer. See this article by Yair Altman

这篇关于将Matlab GUI转换为指南GUI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆