Code covered by the BSD License  

Highlights from
guidegetter

4.42857

4.4 | 7 ratings Rate this file 10 Downloads (last 30 days) File Size: 4.97 KB File ID: #20152
image thumbnail

guidegetter

by Matt Fig

 

02 Jun 2008 (Updated 17 Jun 2008)

Creates a standalone M-file GUI from a guide made GUI.

| Watch this File

File Information
Description

This tool is useful when one wants to create a GUI from a standalone M-file, but would like to use guide for it's excellent ability to position the GUI objects within the GUI. guidegetter works by first fetching the layout of the uicontrols, uimenus and other objects from a guide generated .fig file. Then an M-file is created that will generate the same GUI without the use of a fig file. The new M-file can then be used to complete the GUI project (write callbacks, etc).

See the help for more information. Please email me about bugs.
Tested on 6.5 2006a and 2007a.

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (14)
03 Jun 2008 matt fig (author)

Someone found a bug already with version 2006a. Apparently in this version you cannot create a uibuttongroup the same way as in 2007a. You must specifically identify the parent property in the declaration when making a uibuttongroup the child of a uipanel, as opposed to simply listing the parent handle first like you can for other objects. I have added this to line 198 and will post an updated version.

04 Jun 2008 Gary Rubin

Haven't tried it yet, but I love the idea! I was planning on building the same thing myself when I had the time.

04 Jun 2008 T. Janis

Excellent! Great! Finally! I like this WAAAYYYYY better than the guess-and-check method of positioning my GUI.

10 Jun 2008 J. Luis

Matt,
You may find interesting my desGUIDE function
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=5834&objectType=FILE

12 Jun 2008 Matt Fig

A user has found that guidegetter will not deal with uicontextmenus, I will post an update shortly.

14 Jun 2008 Jeff Micat

Thank you. It does what you say.

01 Jul 2008 Thierry Dalon

Unfortunately like you can see in the example picture, the String properties are renamed by <uicontroltype>_<counter> so you loose this information defined in GUIDE.

01 Jul 2008 Thierry Dalon

Because of problem see review below, change line 165 to
p.onm{ii}=get(p.oh(ii),'String'); % TD

02 Jul 2008 Matt Fig

Thanks Thierry, but what you describe is not actually a problem. This was done on purpose and the reason is explained in the help. Basically, the names of the objects match the handles in the M-file to allow one to quickly identify which line of code creates which object in the GUI. Of course all of this can be changed by the user by simply replacing the string property value in the M-file, which should be done anyway if a GUI is to be useful.

10 Jul 2008 Thierry Dalon

FX 14340 generate_m_file is much better.

11 Jul 2008 Dave S.

Helps a lot.

16 Jul 2008 Gary Cole

I find this real useful. Great idea. The Mathworks needs to do away with figure files made by GUIDE anyway.

24 Jul 2008 Ransef Sindet

I like you program. Can you help me with my gui? I am stuck with callback.
email me to: rsind@gmail.com
Thanks.

27 Nov 2008 Roy

Very good. Thanks. A pity is that the program cannot get the original name of those elements.

Please login to add a comment or rating.
Updates
04 Jun 2008

See the first rating.

06 Jun 2008

Changed some of the coding to make it easier to read.

17 Jun 2008

Added uicontextmenus, fixed quirk for version 6.5. Increased functionality.

Tag Activity for this File
Tag Applied By Date/Time
gui tools Matt Fig 22 Oct 2008 10:04:38
example Matt Fig 22 Oct 2008 10:04:38
gui guide create mfile mfile make gui fig figure convert Matt Fig 22 Oct 2008 10:04:38

Contact us at files@mathworks.com