<?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: Rich Matlab editbox contents</title>
	<atom:link href="http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/feed/" rel="self" type="application/rss+xml" />
	<link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/</link>
	<description>Charting Matlab's unsupported hidden underbelly</description>
	<lastBuildDate>Tue, 07 Sep 2010 22:25:59 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/comment-page-1/#comment-12899</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Fri, 16 Jul 2010 16:05:40 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=944#comment-12899</guid>
		<description>Regular Matlab uicontrols do not support syntax hiliting - you need to use one of the controls I mentioned in http://undocumentedmatlab.com/blog/syntax-highlighted-labels-panels/</description>
		<content:encoded><![CDATA[<p>Regular Matlab uicontrols do not support syntax hiliting &#8211; you need to use one of the controls I mentioned in <a href="http://undocumentedmatlab.com/blog/syntax-highlighted-labels-panels/" rel="nofollow">http://undocumentedmatlab.com/blog/syntax-highlighted-labels-panels/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Camilo</title>
		<link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/comment-page-1/#comment-12898</link>
		<dc:creator>Camilo</dc:creator>
		<pubDate>Fri, 16 Jul 2010 15:55:47 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=944#comment-12898</guid>
		<description>Hello,
it&#039;s possible to set this property (Matlab Syntax) in a uicontrol type text?
thanks.

Thank you!

Best regards

Camilo</description>
		<content:encoded><![CDATA[<p>Hello,<br />
it&#8217;s possible to set this property (Matlab Syntax) in a uicontrol type text?<br />
thanks.</p>
<p>Thank you!</p>
<p>Best regards</p>
<p>Camilo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/comment-page-1/#comment-12725</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Wed, 14 Jul 2010 16:06:16 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=944#comment-12725</guid>
		<description>@Youlian and any other reader interested in syntax highlighting - I posted an expanded article about this topic in http://undocumentedmatlab.com/blog/syntax-highlighted-labels-panels/</description>
		<content:encoded><![CDATA[<p>@Youlian and any other reader interested in syntax highlighting &#8211; I posted an expanded article about this topic in <a href="http://undocumentedmatlab.com/blog/syntax-highlighted-labels-panels/" rel="nofollow">http://undocumentedmatlab.com/blog/syntax-highlighted-labels-panels/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Youlian</title>
		<link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/comment-page-1/#comment-10856</link>
		<dc:creator>Youlian</dc:creator>
		<pubDate>Tue, 08 Jun 2010 14:05:25 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=944#comment-10856</guid>
		<description>Hello Yair,

thank you very much for your fast response. The code you posted worked quite well, with one exception, which is probably Matlab version dependent. The statement:
codeType = com.mathworks.widgets.text.mcode.MLanguage.M_MIME_TYPE;

led in Matlab 2008b to the following Matlab error:
??? Undefined variable &quot;com&quot; or class
&quot;com.mathworks.widgets.text.mcode.MLanguage.M_MIME_TYPE&quot;.

Instead of it I used:
codeType = com.mathworks.widgets.SyntaxTextPane.M_MIME_TYPE;

I tested it in Matlab 7.1, 2006b, 2007a and 2008b and it worked well.

Thank you very much once again!

Best regards


Youlian</description>
		<content:encoded><![CDATA[<p>Hello Yair,</p>
<p>thank you very much for your fast response. The code you posted worked quite well, with one exception, which is probably Matlab version dependent. The statement:<br />
codeType = com.mathworks.widgets.text.mcode.MLanguage.M_MIME_TYPE;</p>
<p>led in Matlab 2008b to the following Matlab error:<br />
??? Undefined variable &#8220;com&#8221; or class<br />
&#8220;com.mathworks.widgets.text.mcode.MLanguage.M_MIME_TYPE&#8221;.</p>
<p>Instead of it I used:<br />
codeType = com.mathworks.widgets.SyntaxTextPane.M_MIME_TYPE;</p>
<p>I tested it in Matlab 7.1, 2006b, 2007a and 2008b and it worked well.</p>
<p>Thank you very much once again!</p>
<p>Best regards</p>
<p>Youlian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/comment-page-1/#comment-10761</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Fri, 04 Jun 2010 12:54:41 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=944#comment-10761</guid>
		<description>@Youlian - Yes it is possible. Here&#039;s a short code snippet demonstrating this (I will provide more details and other possibilities in an article sometime in the upcoming weeks):

&lt;pre lang=&quot;matlab&quot;&gt;
jCodePane = com.mathworks.widgets.SyntaxTextPane;
codeType = com.mathworks.widgets.text.mcode.MLanguage.M_MIME_TYPE;
jCodePane.setContentType(codeType)
str = [&#039;% create a file for output\n&#039; ...
       &#039;!touch testFile.txt\n&#039; ...
       &#039;fid = fopen(&#039;&#039;testFile.txt&#039;&#039;, &#039;&#039;w&#039;&#039;);\n&#039; ...
       &#039;for i=1:10\n&#039; ...
       &#039;    % Unterminated string:\n&#039; ...
       &#039;    fprintf(fid,&#039;&#039;%6.2f \\n, i);\n&#039; ...
       &#039;end&#039;];
str = sprintf(strrep(str,&#039;%&#039;,&#039;%%&#039;));
jCodePane.setText(str)
jScrollPane = com.mathworks.mwswing.MJScrollPane(jCodePane);
[jhPanel,hContainer] = javacomponent(jScrollPane,[10,10,300,100],gcf);
&lt;/pre&gt;

&lt;img alt=&quot;SyntaxTextPane panel (Matlab MIME type)&quot; src=&quot;http://UndocumentedMatlab.com/images/SyntaxTextPane.png&quot; title=&quot;SyntaxTextPane panel (Matlab MIME type)&quot; width=&quot;330&quot; height=&quot;202&quot; /&gt;&lt;br/&gt;
SyntaxTextPane panel (Matlab MIME type)</description>
		<content:encoded><![CDATA[<p>@Youlian &#8211; Yes it is possible. Here&#8217;s a short code snippet demonstrating this (I will provide more details and other possibilities in an article sometime in the upcoming weeks):</p>

<div class="wp_syntax"><div class="code"><pre class="matlab" style="font-family:monospace;">jCodePane = com.<span style="">mathworks</span>.<span style="">widgets</span>.<span style="">SyntaxTextPane</span>;
codeType = com.<span style="">mathworks</span>.<span style="">widgets</span>.<span style="">text</span>.<span style="">mcode</span>.<span style="">MLanguage</span>.<span style="">M_MIME_TYPE</span>;
jCodePane.<span style="">setContentType</span><span style="color: #080;">&#40;</span>codeType<span style="color: #080;">&#41;</span>
str = <span style="color: #080;">&#91;</span><span style="color:#A020F0;">'% create a file for output\n'</span> <span style="color: #F0F;">...</span>
       <span style="color:#A020F0;">'!touch testFile.txt\n'</span> <span style="color: #F0F;">...</span>
       <span style="color:#A020F0;">'fid = fopen('</span><span style="color:#A020F0;">'testFile.txt'</span><span style="color:#A020F0;">', '</span><span style="color:#A020F0;">'w'</span><span style="color:#A020F0;">');\n'</span> <span style="color: #F0F;">...</span>
       <span style="color:#A020F0;">'for i=1:10\n'</span> <span style="color: #F0F;">...</span>
       <span style="color:#A020F0;">'    % Unterminated string:\n'</span> <span style="color: #F0F;">...</span>
       <span style="color:#A020F0;">'    fprintf(fid,'</span><span style="color:#A020F0;">'%6.2f \\n, i);\n'</span> <span style="color: #F0F;">...</span>
       <span style="color:#A020F0;">'end'</span><span style="color: #080;">&#93;</span>;
str = <span style="color: #0000FF;">sprintf</span><span style="color: #080;">&#40;</span><span style="color: #0000FF;">strrep</span><span style="color: #080;">&#40;</span>str,<span style="color:#A020F0;">'%'</span>,<span style="color:#A020F0;">'%%'</span><span style="color: #080;">&#41;</span><span style="color: #080;">&#41;</span>;
jCodePane.<span style="">setText</span><span style="color: #080;">&#40;</span>str<span style="color: #080;">&#41;</span>
jScrollPane = com.<span style="">mathworks</span>.<span style="">mwswing</span>.<span style="">MJScrollPane</span><span style="color: #080;">&#40;</span>jCodePane<span style="color: #080;">&#41;</span>;
<span style="color: #080;">&#91;</span>jhPanel,hContainer<span style="color: #080;">&#93;</span> = javacomponent<span style="color: #080;">&#40;</span>jScrollPane,<span style="color: #080;">&#91;</span><span style="color: #33f;">10</span>,<span style="color: #33f;">10</span>,<span style="color: #33f;">300</span>,<span style="color: #33f;">100</span><span style="color: #080;">&#93;</span>,<span style="color: #0000FF;">gcf</span><span style="color: #080;">&#41;</span>;</pre></div></div>

<p><img alt="SyntaxTextPane panel (Matlab MIME type)" src="http://UndocumentedMatlab.com/images/SyntaxTextPane.png" title="SyntaxTextPane panel (Matlab MIME type)" width="330" height="202" /><br />
SyntaxTextPane panel (Matlab MIME type)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Youlian</title>
		<link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/comment-page-1/#comment-10760</link>
		<dc:creator>Youlian</dc:creator>
		<pubDate>Fri, 04 Jun 2010 12:37:27 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=944#comment-10760</guid>
		<description>Hello,
first I would like to thank you for the usefull information I found in your blog. And now to my question: Do you know an easy way to have a matlab editor like features (syntax highliting, smart indent, ...) in an editable multiline text box?

Thank you!

Best regards

Youlian</description>
		<content:encoded><![CDATA[<p>Hello,<br />
first I would like to thank you for the usefull information I found in your blog. And now to my question: Do you know an easy way to have a matlab editor like features (syntax highliting, smart indent, &#8230;) in an editable multiline text box?</p>
<p>Thank you!</p>
<p>Best regards</p>
<p>Youlian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/comment-page-1/#comment-8704</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Thu, 01 Apr 2010 22:08:24 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=944#comment-8704</guid>
		<description>@Amichay - when you copy a styled Matlab text, it gets copied as Rich-Text Formatted (RTF) data. Some applications, like MS Word, automatically know how to use RTF data when you paste sch contents into them. If you need to paste into your own application, you need to create a dedicated RTF-sensitive CCP drop target. This is a very technical issue that is well outside the boundaries of this comment (or blog). You can start &lt;a target=&quot;_blank&quot; href=&quot;http://java.sun.com/docs/books/tutorial/uiswing/dnd/intro.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>@Amichay &#8211; when you copy a styled Matlab text, it gets copied as Rich-Text Formatted (RTF) data. Some applications, like MS Word, automatically know how to use RTF data when you paste sch contents into them. If you need to paste into your own application, you need to create a dedicated RTF-sensitive CCP drop target. This is a very technical issue that is well outside the boundaries of this comment (or blog). You can start <a target="_blank" href="http://java.sun.com/docs/books/tutorial/uiswing/dnd/intro.html" rel="nofollow">here</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amichay</title>
		<link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/comment-page-1/#comment-8677</link>
		<dc:creator>amichay</dc:creator>
		<pubDate>Thu, 01 Apr 2010 07:46:59 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=944#comment-8677</guid>
		<description>Yair,
I actually want to get (by copy paste) a text with colored text (such for example as some editros like matlab m-file editor) into the editbox (or if you can suggest something better) and process the text also according to the text color. Can you suggest what to do?</description>
		<content:encoded><![CDATA[<p>Yair,<br />
I actually want to get (by copy paste) a text with colored text (such for example as some editros like matlab m-file editor) into the editbox (or if you can suggest something better) and process the text also according to the text color. Can you suggest what to do?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/comment-page-1/#comment-8456</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Tue, 23 Mar 2010 21:58:54 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=944#comment-8456</guid>
		<description>@Amichay - if you use style runs then you can try to use &lt;i&gt;getCharacterAttributes()&lt;/i&gt;; if you use HTML you don&#039;t have an easy solution AFAIK, but if you are in control of the data that is placed in the editbox then you can keep meta-data information stored where it can later be retrieved (for example, in the control&#039;s appdata).</description>
		<content:encoded><![CDATA[<p>@Amichay &#8211; if you use style runs then you can try to use <i>getCharacterAttributes()</i>; if you use HTML you don&#8217;t have an easy solution AFAIK, but if you are in control of the data that is placed in the editbox then you can keep meta-data information stored where it can later be retrieved (for example, in the control&#8217;s appdata).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amichay</title>
		<link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/comment-page-1/#comment-8415</link>
		<dc:creator>amichay</dc:creator>
		<pubDate>Mon, 22 Mar 2010 14:33:57 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=944#comment-8415</guid>
		<description>Thanks.

Can you please explain how I can read from the editbox this information - for example what is the color of the first word in the third line?

I have problems understanding that part or retreiving information.</description>
		<content:encoded><![CDATA[<p>Thanks.</p>
<p>Can you please explain how I can read from the editbox this information &#8211; for example what is the color of the first word in the third line?</p>
<p>I have problems understanding that part or retreiving information.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
