{"id":2648,"date":"2011-02-18T10:41:54","date_gmt":"2011-02-18T10:41:54","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2011\/02\/18\/fancy-menus\/"},"modified":"2011-02-18T16:33:57","modified_gmt":"2011-02-18T16:33:57","slug":"fancy-menus","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2011\/02\/18\/fancy-menus\/","title":{"rendered":"Fancy Menus"},"content":{"rendered":"<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007\">Jiro<\/a>'s pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/29760-menubar\"><tt>menubar<\/tt><\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/29180\">Dirk-Jan Kroon<\/a>.\r\n   <\/p>\r\n   <p>I'm honestly perplexed that his files have not been highlighted in Pick of the Week before. He is a big contributor to File\r\n      Exchange with 57 submissions and second most downloaded in the last 30 days as of this writing. As you can see from his <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/29180\">author page<\/a>, many of his files have high ratings. I'm sure I'll be looking at more of his entries later.\r\n   <\/p>\r\n   <p>This entry, <tt>menubar<\/tt>, is a clever one. Some of you may know that you can create menus in your GUI using <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/techdoc\/ref\/uimenu.html\"><tt>uimenu<\/tt><\/a>. It allows you to create menus at the top of the GUI with a standard look and feel. Dirk-Jan's <tt>menubar<\/tt> lets you create fancy-looking menus. You can also place them anywhere in your GUI. The way you create it is to simply create\r\n      a <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2010b\/techdoc\/ref\/uicontextmenu.html\"><tt>uicontextmenu<\/tt><\/a> and call <tt>menubar<\/tt>. He provides a sample GUI which you can run:\r\n   <\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_fancymenubar\/FancyMenuAnimation.gif\"> <\/p>\r\n   <p><b>Comments<\/b><\/p>\r\n   <p>Let us know what you think <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=2648#respond\">here<\/a> or leave a <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/29760-menubar#comments\">comment<\/a> for Dirk-Jan.\r\n   <\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_3efe5859fa1b440882be4d6934b0bb7d() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='3efe5859fa1b440882be4d6934b0bb7d ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 3efe5859fa1b440882be4d6934b0bb7d';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Jiro Doke';\r\n        copyright = 'Copyright 2011 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \r\n-->\r\n<\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_3efe5859fa1b440882be4d6934b0bb7d()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.11<br><\/p>\r\n<\/div>\r\n<!--\r\n3efe5859fa1b440882be4d6934b0bb7d ##### SOURCE BEGIN #####\r\n%%\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007\r\n% Jiro>'s pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/29760-menubar\r\n% |menubar|> by\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/29180\r\n% Dirk-Jan Kroon>.\r\n%\r\n% I'm honestly perplexed that his files have not been highlighted in Pick\r\n% of the Week before. He is a big contributor to File Exchange with 57\r\n% submissions and second most downloaded in the last 30 days as of this\r\n% writing. As you can see from his\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/29180 author\r\n% page>, many of his files have high ratings. I'm sure I'll be looking at\r\n% more of his entries later.\r\n%\r\n% This entry, |menubar|, is a clever one. Some of you may know that you can\r\n% create menus in your GUI using\r\n% <https:\/\/www.mathworks.com\/help\/releases\/R2010b\/techdoc\/ref\/uimenu.html\r\n% |uimenu|>. It allows you to create menus at the top of the GUI\r\n% with a standard look and feel. Dirk-Jan's |menubar| lets you create\r\n% fancy-looking menus. You can also place them anywhere in your GUI. The\r\n% way you create it is to simply create a\r\n% <https:\/\/www.mathworks.com\/help\/releases\/R2010b\/techdoc\/ref\/uicontextmenu.html\r\n% |uicontextmenu|> and call |menubar|. He provides a sample GUI which you\r\n% can run:\r\n%\r\n% <<FancyMenuAnimation.gif>>\r\n% \r\n% *Comments*\r\n%\r\n% Let us know what you think\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=2648#respond here> or leave a\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/29760-menubar#comments\r\n% comment> for Dirk-Jan.\r\n\r\n##### SOURCE END ##### 3efe5859fa1b440882be4d6934b0bb7d\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\n   Jiro's pick this week is menubar by Dirk-Jan Kroon.\r\n   \r\n   I'm honestly perplexed that his files have not been highlighted in Pick of the Week before. He is a big contributor to File\r\n     ... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2011\/02\/18\/fancy-menus\/\">read more >><\/a><\/p>","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[12,16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2648"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=2648"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2648\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}