4.83333

4.8 | 12 ratings Rate this file 30 downloads (last 30 days) File Size: 634.3 KB File ID: #6668

StructDlg - Structure based GUI definition

by Alon Fishbach

 

03 Jan 2005 (Updated 01 Mar 2005)

Code covered by BSD License  

A structure based definition of an input GUI.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

Download Now | Watch this File

File Information
Description

StructDlg creates a modal dialog box that contains a user interface (UI) control for each of the input structure fields. In its simple form, StructDlg serves as a structure-based alternative to INPUTDLG and it is a convenient method for browsing and changing structure values (e.g. when the structure contains parameters).
In its advanced form, StructDlg allows for a quick and convenient text based definition of a GUI that may contain many styles of UI controls such as edit, popup menus, radio buttons, toggles and more.

Detailed examples are given in an HTML doc file.

MATLAB release MATLAB 7.0.1 (R14SP1)
Zip File Content  
Published M Files StructDlg
Other Files
structdlg/get_screen_size.m,
structdlg/ref/structdlg-1.jpg,
structdlg/ref/structdlg-11.jpg,
structdlg/ref/structdlg-12.jpg,
structdlg/ref/structdlg-13.jpg,
structdlg/ref/structdlg-2.jpg,
structdlg/ref/structdlg-21.jpg,
structdlg/ref/structdlg-22.jpg,
structdlg/ref/structdlg-23.jpg,
structdlg/ref/structdlg-24.jpg,
structdlg/Structdlg_examples.m,
structdlg/ref/structdlg-31.jpg,
structdlg/ref/structdlg-4.jpg,
structdlg/struct_mfile_reference.m,
structdlg/ref/Untitled-1a.jpg,
structdlg/ref/Untitled-2a.jpg,
structdlg/struct2str.m,
structdlg/StructDlg.m,
structdlg/ref/structdlg-3.jpg
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (12)
14 Feb 2005 Heiko Marx

Very nice! Allows highly structured but easy to build input dialogs. Two negative points though: I got error an message when I closed the GUI with the close button (x). There is no 'Cancel' button. Second: There is an option to give a GUI position and size which is not documented but might (as in my case) be helpful for a desired performance. Thank you for this tool!!!

14 Mar 2006 Roger Jeurissen

This function does what it claims (and the cancel button seems to have been added). Thank you.

31 Mar 2006 Chris Cannell

This is a great script. One thing you may want to add. Right now fieldnames are parsed into separate words for use as labels using only underscore. You may want to add parsing for camelCaps. I prefer camelCaps to underscores for separating words in variable names. I added this functionality for my use. You can add:

fnames_lbl = regexprep(fnames,'([A-Z])',' $1');
for i=1:length(fnames_lbl)
    fnames_lbl{i} = [upper(fnames_lbl{i}(1)) fnames_lbl{i}(2:end)];
end

after line 428 in StructDlg.m. Thanks for the great script.

27 Jan 2007 Joe Lotz

Excellent! This has made GUI creation very easy. I used it and it has worked great.

27 Feb 2007 Jorge Otero-Millan

That's an awsome script and really really usefull to develop guis fast.
Just one comment. The checkboxes appeard cuted in the left in my computer.
I changed the file StructDlg in the line 1067
      'position', [lbl_pos(3)+lbl_pos(1)+0.5 lbl_pos(2) 3 1.5],...

I put a 3 where used to be a 2 and now it looks fine for me.

Thanks a lot!

Jorge

05 Apr 2007 Wojtek Grabski  
08 May 2007 Niels Smaby

Amazing tool - huge time saver and slick!

14 Jun 2007 Kynan Graves

Very Handy. Saves a lot of development time.
Thanks.

07 Sep 2007 Andrew Blackburn

Extremely useful time-saving code. Saved a whole day's worth of work.

06 Mar 2009 Matthias Issbrücker

thats so awesome !!!

very useful tool and very easy to handle with.
saves so much time when creating GUIs to input data.
(why wasn't this a "pick of the week" ?)

12 May 2009 Eduard Rudyk

Excellent toolbox!

07 Aug 2009 Gerd Kunert

Hello,

nice tool. One wish:
I would like to have a multi line edit box.
For example for a GUI where the user can enter a comment field with several lines.

Please login to add a comment or rating.
Updates
11 Jan 2005

This version fixes a bug that crashed StructDlg when substructures were used.
Additionally, StructDlg allows now for auto-updates even when the referenced field is not a numeric field.

01 Mar 2005

A cancel button was added and the previously undocumented position argument is now easier to use and is documented. Closing the GUI with the (x) button does not crash the program.

Tag Activity for this File
Tag Applied By Date/Time
gui tools Alon Fishbach 22 Oct 2008 07:39:10
example Alon Fishbach 22 Oct 2008 07:39:10
gui Alon Fishbach 22 Oct 2008 07:39:10
utilities Alon Fishbach 22 Oct 2008 07:39:10
text based Alon Fishbach 22 Oct 2008 07:39:10
structure Alon Fishbach 22 Oct 2008 07:39:10
potw Shari Freedman 07 Aug 2009 11:51:16
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com