{"id":325,"date":"2009-08-03T14:08:38","date_gmt":"2009-08-03T14:08:38","guid":{"rendered":"https:\/\/blogs.mathworks.com\/desktop\/2009\/08\/03\/more-dialogs-than-you-can-shake-a-stick-at\/"},"modified":"2009-08-03T14:08:38","modified_gmt":"2009-08-03T14:08:38","slug":"more-dialogs-than-you-can-shake-a-stick-at","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/community\/2009\/08\/03\/more-dialogs-than-you-can-shake-a-stick-at\/","title":{"rendered":"More dialogs than you can shake a stick at"},"content":{"rendered":"<p>I&#8217;m going to continue my <a href=\"https:\/\/blogs.mathworks.com\/community\/2009\/07\/20\/the-gui-way-of-doing-things\/\">dialog discussion<\/a> from two weeks ago with more of the MATLAB dialog gallery. I feel a bit like a car salesman, we&#8217;ve got so many dialogs to choose from. I&#8217;ve grouped them into two categories: dialogs for messages, and dialogs for setting\/getting things. <\/p>\n<p>The first group is the <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/index.html?\/access\/helpdesk\/help\/releases\/R2009a\/techdoc\/ref\/msgbox.html\"><tt>msgbox<\/tt><\/a> and it&#8217;s specialized variants: <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/index.html?\/access\/helpdesk\/help\/releases\/R2009a\/techdoc\/ref\/warndlg.html\"><tt>warndlg<\/tt><\/a>, <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/index.html?\/access\/helpdesk\/help\/releases\/R2009a\/techdoc\/ref\/errordlg.html\"><tt>errordlg<\/tt><\/a>, and <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/index.html?\/access\/helpdesk\/help\/releases\/R2009a\/techdoc\/ref\/helpdlg.html\"><tt>helpdlg<\/tt><\/a>. Msgbox is a basic dialog that  presents a message to the user with an &#8220;OK&#8221; button. The warning, error, and help dialogs are all special cases of msgbox with the icon pre-chosen:<\/p>\n<div align=\"center\">\n<strong>errordlg<\/strong><br \/>\n<img decoding=\"async\" border=\"0\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_more_dialogs\/errordlg.png\" alt=\"errdlg Error Dialog\"\/><br \/>\n<strong>warndlg<\/strong><br \/>\n<img decoding=\"async\" border=\"0\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_more_dialogs\/warndlg.png\" alt=\"warndlg Warning Dialog\"\/><br \/>\n<strong>helpdlg<\/strong><br \/>\n<img decoding=\"async\" border=\"0\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_more_dialogs\/helpdlg.png\" alt=\"helpdlg Help Dialog\"\/>\n<\/div>\n<p>The second group provides common dialogs that are either system, Java, or Handle Graphics based, depending on the dialog and platform. These are dialogs for dealing with files, printing, and picking fonts and colors.<\/p>\n<p><strong>File Picker(s)<\/strong><br \/>\n<a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/index.html?\/access\/helpdesk\/help\/releases\/R2009a\/techdoc\/ref\/uigetfile.html\"><tt>uigetfile<\/tt><\/a>, <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/index.html?\/access\/helpdesk\/help\/releases\/R2009a\/techdoc\/ref\/uiopen.html\"><tt>uiopen<\/tt><\/a>, and <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/index.html?\/access\/helpdesk\/help\/releases\/R2009a\/techdoc\/ref\/uigetdir.html\"><tt>uigetdir<\/tt><\/a> are all file\/folder browsers for selecting a file from the system and returning the result to MATLAB. The <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/index.html?\/access\/helpdesk\/help\/releases\/R2009a\/techdoc\/ref\/uiputfile.html\"><tt>uiputfile<\/tt><\/a> and <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/index.html?\/access\/helpdesk\/help\/releases\/R2009a\/techdoc\/ref\/uisave.html\"><tt>uisave<\/tt><\/a> are for selecting files for saving as determined by whatever your program wants (<tt>uiputfile<\/tt>) or for saving workspace variables (<tt>uisave<\/tt>).<\/p>\n<p>Here&#8217;s what they look like on Windows and MAC<\/p>\n<div align=\"center\">\n<img decoding=\"async\" border=\"0\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_more_dialogs\/uigetfile.png\" alt=\"uigefile dialog on Windows\"\/><br \/>\n<img decoding=\"async\" border=\"0\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_more_dialogs\/uigetfile_mac.png\" alt=\"uigefile dialog on Macintosh\"\/>\n<\/div>\n<p><strong>Setting Fonts and Colors<\/strong><br \/>\nSometimes you want to present the chooser with a dialog specialized for selecting a complex data type. We&#8217;ve provided two dialogs: one for selecting fonts <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/index.html?\/access\/helpdesk\/help\/releases\/R2009a\/techdoc\/ref\/uisetfont.html\"><tt>uisetfont<\/tt><\/a>, and one for selecting a color <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/index.html?\/access\/helpdesk\/help\/releases\/R2009a\/techdoc\/ref\/uisetcolor.html\"><tt>uisetcolor<\/tt><\/a>.<\/p>\n<div align=\"center\">\n<img decoding=\"async\" border=\"0\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_more_dialogs\/uisetfont.png\" alt=\"uisetfont font picker\"\/><br \/>\n<img decoding=\"async\" border=\"0\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_more_dialogs\/uisetcolor.png\" alt=\"uisetcolorfont picker\"\/>\n<\/div>\n<p>I didn&#8217;t cover <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/index.html?\/access\/helpdesk\/help\/releases\/R2009a\/techdoc\/ref\/printdlg.html\"><tt>printdlg<\/tt><\/a> and <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/index.html?\/access\/helpdesk\/help\/releases\/R2009a\/techdoc\/ref\/printpreview.html\"><tt>printpreview<\/tt><\/a> which are dialogs for printing MATLAB figure windows. I recommend checking them out on your own. There&#8217;s also a progressbar <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009a\/techdoc\/index.html?\/access\/helpdesk\/help\/releases\/R2009a\/techdoc\/ref\/waitbar.html\"><tt>waitbar<\/tt><\/a>:<\/p>\n<div align=\"center\">\n<img decoding=\"async\" border=\"0\" src=\"https:\/\/blogs.mathworks.com\/images\/desktop\/michael_katz_more_dialogs\/waitbar.png\" alt=\"waitbar\"\/>\n<\/div>\n<p>If all these predefined UI&#8217;s aren&#8217;t enough for you, check out the <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/?term=dialog\">MATLAB file exchange<\/a>. Last week&#8217;s pick of the week was <a href=\"https:\/\/blogs.mathworks.com\/pick\/2009\/07\/31\/structdlg-part-1-of-2\/\">STRUCTDLG<\/a>, a dialog for editing the fields of a struct. This week they&#8217;ll highlight another submission in the same vein. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m going to continue my dialog discussion from two weeks ago with more of the MATLAB dialog gallery. I feel a bit like a car salesman, we&#8217;ve got so many dialogs to choose from&#8230;. <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/community\/2009\/08\/03\/more-dialogs-than-you-can-shake-a-stick-at\/\">read more >><\/a><\/p>\n","protected":false},"author":38,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/325"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/comments?post=325"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/posts\/325\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/media?parent=325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/categories?post=325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/community\/wp-json\/wp\/v2\/tags?post=325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}