Code covered by the BSD License  

Highlights from
StructDlg - Structure based GUI definition

4.83333

4.8 | 12 ratings Rate this file 15 Downloads (last 30 days) File Size: 634 KB File ID: #6668
image thumbnail

StructDlg - Structure based GUI definition

by

 

03 Jan 2005 (Updated )

A structure based definition of an input GUI.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| 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)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (13)
26 Nov 2009 Ben Petschel

Nice tool, though I encountered an obscure bug that froze matlab when I passed it a bad input, e.g. S.a={{true}};StructDlg(S)

To close it without killing matlab had to press Ctrl-C (to restore command-line access) then type closereq (because the usual CloseRequestFcn is overridden).

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.

12 May 2009 Eduard Rudyk

Excellent toolbox!

06 Mar 2009 Mais

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" ?)

07 Sep 2007 Andrew Blackburn

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

14 Jun 2007 Kynan Graves

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

08 May 2007 Niels Smaby

Amazing tool - huge time saver and slick!

05 Apr 2007 Wojtek Grabski  
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

27 Jan 2007 Joe Lotz

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

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.

14 Mar 2006 Roger Jeurissen

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

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!!!

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.

Contact us