<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Customizing the standard figure toolbar, menubar	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=customizing-standard-figure-toolbar-menubar</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Sun, 12 Mar 2017 11:41:57 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>
		By: Alireza Kharazmi		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-402731</link>

		<dc:creator><![CDATA[Alireza Kharazmi]]></dc:creator>
		<pubDate>Sun, 12 Mar 2017 11:41:57 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3461#comment-402731</guid>

					<description><![CDATA[Hi Yair,

I have created a GUI in Matlab for my data analysis. I am trying to modify the save button according to my need. I am using the code writing at the this page but with a bit of modification as written below:

&lt;pre lang=&quot;matlab&quot;&gt;
hSave = findall(gcf, &#039;tooltipstring&#039;, &#039;Save Figure&#039;);
save_data = get(hSave);
hToolbar = save_data.Parent;
delete(hSave);
hNewSave = uisplittool(&#039;Parent&#039;,hToolbar, ...
                       &#039;CData&#039;,save_data.CData, ...
                       &#039;Tooltip&#039;,save_data.TooltipString); 
drawnow;  
jToolbar = get(get(hToolbar,&#039;JavaContainer&#039;),&#039;ComponentPeer&#039;);
jButtons = jToolbar.getComponents;
jToolbar.setComponentZOrder(jButtons(end),3); 
jToolbar.revalidate;  

savelist = {&#039;Save Reference Subtracted Spectra&#039;,...
    &#039;Save Sum of Scaled Reference Spectra&#039;,&#039;Save Coeficients&#039;,&#039;Save All&#039;};

jNewSave = get(hNewSave,&#039;JavaContainer&#039;);
jNewSaveMenu = jNewSave.getMenuComponent;

for fileIdx = 1 : length(savelist)
    jMenuItem = handle(jNewSaveMenu.add(savelist{fileIdx}),&#039;CallbackProperties&#039;);
    set(jMenuItem,&#039;ActionPerformedCallback&#039;,...          @(jMenuItem,eventdata)photolysis_analyzer(&#039;mysave_ClickedCallback&#039;,hObject,eventdata,guidata(hObject)));
end
&lt;/pre&gt;

In the last line of the for loop I cannot use &quot;&lt;code&gt;set(jMenuItem,&#039;ActionPerformedCallback&#039; {@mysave_ClickedCallback,savelist{fileIdx}});&lt;/code&gt;&quot; since it resets all my GUI handles. Now at this point, I want to recognise which &lt;code&gt;savelist&lt;/code&gt; item is clicked in order to assign the appropriate action in my GUI. 

I was wondering if you could help me with this problem.

Many thanks,
AKh]]></description>
			<content:encoded><![CDATA[<p>Hi Yair,</p>
<p>I have created a GUI in Matlab for my data analysis. I am trying to modify the save button according to my need. I am using the code writing at the this page but with a bit of modification as written below:</p>
<pre lang="matlab">
hSave = findall(gcf, 'tooltipstring', 'Save Figure');
save_data = get(hSave);
hToolbar = save_data.Parent;
delete(hSave);
hNewSave = uisplittool('Parent',hToolbar, ...
                       'CData',save_data.CData, ...
                       'Tooltip',save_data.TooltipString); 
drawnow;  
jToolbar = get(get(hToolbar,'JavaContainer'),'ComponentPeer');
jButtons = jToolbar.getComponents;
jToolbar.setComponentZOrder(jButtons(end),3); 
jToolbar.revalidate;  

savelist = {'Save Reference Subtracted Spectra',...
    'Save Sum of Scaled Reference Spectra','Save Coeficients','Save All'};

jNewSave = get(hNewSave,'JavaContainer');
jNewSaveMenu = jNewSave.getMenuComponent;

for fileIdx = 1 : length(savelist)
    jMenuItem = handle(jNewSaveMenu.add(savelist{fileIdx}),'CallbackProperties');
    set(jMenuItem,'ActionPerformedCallback',...          @(jMenuItem,eventdata)photolysis_analyzer('mysave_ClickedCallback',hObject,eventdata,guidata(hObject)));
end
</pre>
<p>In the last line of the for loop I cannot use &#8220;<code>set(jMenuItem,'ActionPerformedCallback' {@mysave_ClickedCallback,savelist{fileIdx}});</code>&#8221; since it resets all my GUI handles. Now at this point, I want to recognise which <code>savelist</code> item is clicked in order to assign the appropriate action in my GUI. </p>
<p>I was wondering if you could help me with this problem.</p>
<p>Many thanks,<br />
AKh</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-352710</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Thu, 09 Jul 2015 08:00:14 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3461#comment-352710</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-352709&quot;&gt;Helly&lt;/a&gt;.

@Helly - your &lt;i&gt;getMRU&lt;/i&gt; function probably returns less filenames than you expect. You should debug that function.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-352709">Helly</a>.</p>
<p>@Helly &#8211; your <i>getMRU</i> function probably returns less filenames than you expect. You should debug that function.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Helly		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-352709</link>

		<dc:creator><![CDATA[Helly]]></dc:creator>
		<pubDate>Thu, 09 Jul 2015 07:56:50 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3461#comment-352709</guid>

					<description><![CDATA[Hi Yair

Thanks for this wonderful post. I have created the recent files list in the menu and toolbar successfully. But there were problems:

Because I need to get the handles for different sessions, so I modified your code to pass the handles as follows
&lt;pre lang=&#039;matlab&#039;&gt;
function handles = recent_file(handles)
delete(get(handles.hMruMenu, &#039;Children&#039;));
filenames = getMRU();
for fileIdx = 1 : length(filenames)
    uimenu(handles.hMruMenu, &#039;Label&#039;,filenames{fileIdx}, &#039;Callback&#039;,{@tpa_open_TPA_re,handles,filenames{fileIdx}});
end
&lt;/pre&gt;

I call this function when I open a file or save a file. I listed all filenames I selected from the recent file menu or open file menu in a popupmenu. when I select any filename from the popupmenu, the list of the filenames should remain same, but in fact it is changed to less filenames. It seems to me that the handles wasn&#039;t updated correctly. 

Do you have any idea how to solve this problem?]]></description>
			<content:encoded><![CDATA[<p>Hi Yair</p>
<p>Thanks for this wonderful post. I have created the recent files list in the menu and toolbar successfully. But there were problems:</p>
<p>Because I need to get the handles for different sessions, so I modified your code to pass the handles as follows</p>
<pre lang='matlab'>
function handles = recent_file(handles)
delete(get(handles.hMruMenu, 'Children'));
filenames = getMRU();
for fileIdx = 1 : length(filenames)
    uimenu(handles.hMruMenu, 'Label',filenames{fileIdx}, 'Callback',{@tpa_open_TPA_re,handles,filenames{fileIdx}});
end
</pre>
<p>I call this function when I open a file or save a file. I listed all filenames I selected from the recent file menu or open file menu in a popupmenu. when I select any filename from the popupmenu, the list of the filenames should remain same, but in fact it is changed to less filenames. It seems to me that the handles wasn&#8217;t updated correctly. </p>
<p>Do you have any idea how to solve this problem?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dew		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-145858</link>

		<dc:creator><![CDATA[Dew]]></dc:creator>
		<pubDate>Thu, 24 Jan 2013 05:33:40 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3461#comment-145858</guid>

					<description><![CDATA[@ Yair, thanks for the reply
unfortunately my script is using plot on several occasions to create the .fig files
when running in Matlab environment it is fine but in stand alone environment I do not see any tool bar &#038; in menu item only File is left

Regards
Dew]]></description>
			<content:encoded><![CDATA[<p>@ Yair, thanks for the reply<br />
unfortunately my script is using plot on several occasions to create the .fig files<br />
when running in Matlab environment it is fine but in stand alone environment I do not see any tool bar &amp; in menu item only File is left</p>
<p>Regards<br />
Dew</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-145460</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 23 Jan 2013 11:14:03 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3461#comment-145460</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-145459&quot;&gt;Dew&lt;/a&gt;.

@Dew - assuming you&#039;re using GUIDE, try to set a custom figure toolbar and simply drag your desired tool icons onto the toolbar, from the standard palette on the left of GUIDE&#039;s toolbar designer window.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-145459">Dew</a>.</p>
<p>@Dew &#8211; assuming you&#8217;re using GUIDE, try to set a custom figure toolbar and simply drag your desired tool icons onto the toolbar, from the standard palette on the left of GUIDE&#8217;s toolbar designer window.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dew		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-145459</link>

		<dc:creator><![CDATA[Dew]]></dc:creator>
		<pubDate>Wed, 23 Jan 2013 11:06:59 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3461#comment-145459</guid>

					<description><![CDATA[When generating figure files using &lt;i&gt;&lt;b&gt;plot&lt;/b&gt;&lt;/i&gt; command in Matlab environment, the figure menu has items including Edit, View, Tools, etc... and  toolbar contains the figure Edit tool Zoom etc.
But when the same script is executed after compiling it, it has only File in the menu item

Is there any way we can have standard Menu &#038; tool bar in figure generated from compiled Matlab code
If not standard at least Zoom in, Zoom out, Edit, Copy, View Data (critical ones!)

Regards
Dew]]></description>
			<content:encoded><![CDATA[<p>When generating figure files using <i><b>plot</b></i> command in Matlab environment, the figure menu has items including Edit, View, Tools, etc&#8230; and  toolbar contains the figure Edit tool Zoom etc.<br />
But when the same script is executed after compiling it, it has only File in the menu item</p>
<p>Is there any way we can have standard Menu &amp; tool bar in figure generated from compiled Matlab code<br />
If not standard at least Zoom in, Zoom out, Edit, Copy, View Data (critical ones!)</p>
<p>Regards<br />
Dew</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Reza		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-141164</link>

		<dc:creator><![CDATA[Reza]]></dc:creator>
		<pubDate>Sun, 13 Jan 2013 17:39:29 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3461#comment-141164</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-140947&quot;&gt;Yair Altman&lt;/a&gt;.

Hi 
Thanks so much.
That is work. You are great....]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-140947">Yair Altman</a>.</p>
<p>Hi<br />
Thanks so much.<br />
That is work. You are great&#8230;.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-141004</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sun, 13 Jan 2013 00:23:13 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3461#comment-141004</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-140693&quot;&gt;Dan&lt;/a&gt;.

@Dan - I do not know of a way to do this. I agree with you that the current situation is far from perfect. It might be less frustrating to get used to working in an undocked Figures group (i.e., all the figures are docked, but the Figures group itself is undocked). You then have the old menubar and toolbar available at the top of the Figures window, as you&#039;re used to.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-140693">Dan</a>.</p>
<p>@Dan &#8211; I do not know of a way to do this. I agree with you that the current situation is far from perfect. It might be less frustrating to get used to working in an undocked Figures group (i.e., all the figures are docked, but the Figures group itself is undocked). You then have the old menubar and toolbar available at the top of the Figures window, as you&#8217;re used to.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-140947</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sat, 12 Jan 2013 16:26:50 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3461#comment-140947</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-140942&quot;&gt;Reza&lt;/a&gt;.

@Reza - the &lt;i&gt;&lt;b&gt;javacomponent&lt;/b&gt;&lt;/i&gt; function that you use to display the JProgressBar returns a second output parameter that is the Matlab HG container. You can set this container&#039;s &lt;b&gt;Position&lt;/b&gt; property just like for any other Matlab HG control. alternately, you can set the &lt;b&gt;Position&lt;/b&gt; directly in your call to &lt;i&gt;&lt;b&gt;javacomponent&lt;/b&gt;&lt;/i&gt;:

&lt;pre lang=&#039;matlab&#039;&gt;
[hjProgressBar, hContainer] = javacomponent(&#039;javax.swing.JProgressBar&#039;, pixelPosition, gcf);
set(hContainer, &#039;Position&#039;, newPosition);
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-140942">Reza</a>.</p>
<p>@Reza &#8211; the <i><b>javacomponent</b></i> function that you use to display the JProgressBar returns a second output parameter that is the Matlab HG container. You can set this container&#8217;s <b>Position</b> property just like for any other Matlab HG control. alternately, you can set the <b>Position</b> directly in your call to <i><b>javacomponent</b></i>:</p>
<pre lang='matlab'>
[hjProgressBar, hContainer] = javacomponent('javax.swing.JProgressBar', pixelPosition, gcf);
set(hContainer, 'Position', newPosition);
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Reza		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-standard-figure-toolbar-menubar#comment-140942</link>

		<dc:creator><![CDATA[Reza]]></dc:creator>
		<pubDate>Sat, 12 Jan 2013 16:13:19 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3461#comment-140942</guid>

					<description><![CDATA[Hi
I GUI programmer in MATLAB and visit your site recently. this is really great and useful.
I have a guestion about java objects that added in GUI of MATLAB.
How can I change the dimention of these objects in MATLAB.
for example I create the  JprogressBar in my GUI.
it has the specific dimention:
get(JprogressBar,&#039;Width&#039;) === 148
but when I try to change it width by
set(JprogressBar ,&#039;Width&#039;,300)
MATLAB send this message:
Changing the &#039;Width&#039; property of javahandle_withcallbacks.javax.swing.JProgressBar is not allowed.
What should I do?]]></description>
			<content:encoded><![CDATA[<p>Hi<br />
I GUI programmer in MATLAB and visit your site recently. this is really great and useful.<br />
I have a guestion about java objects that added in GUI of MATLAB.<br />
How can I change the dimention of these objects in MATLAB.<br />
for example I create the  JprogressBar in my GUI.<br />
it has the specific dimention:<br />
get(JprogressBar,&#8217;Width&#8217;) === 148<br />
but when I try to change it width by<br />
set(JprogressBar ,&#8217;Width&#8217;,300)<br />
MATLAB send this message:<br />
Changing the &#8216;Width&#8217; property of javahandle_withcallbacks.javax.swing.JProgressBar is not allowed.<br />
What should I do?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
