<?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>Thu, 09 Feb 2012 09:23:08 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.1.1</generator> <item><title>By: Yair Altman</title><link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/#comment-41258</link> <dc:creator>Yair Altman</dc:creator> <pubDate>Mon, 25 Apr 2011 20:25:59 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=944#comment-41258</guid> <description>@Jorge - unfortunately, not all CSS style formattings are supported</description> <content:encoded><![CDATA[<p>@Jorge &#8211; unfortunately, not all CSS style formattings are supported</p> ]]></content:encoded> </item> <item><title>By: Jorge</title><link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/#comment-38800</link> <dc:creator>Jorge</dc:creator> <pubDate>Mon, 04 Apr 2011 16:30:04 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=944#comment-38800</guid> <description>htmlStr contains, but it doesnt show: *div style=&quot;text-decoration: overline&quot;+text*/div+....* means </description> <content:encoded><![CDATA[<p>htmlStr contains, but it doesnt show: *div style=&#8221;text-decoration: overline&#8221;+text*/div+&#8230;.* means</p> ]]></content:encoded> </item> <item><title>By: Jorge</title><link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/#comment-38799</link> <dc:creator>Jorge</dc:creator> <pubDate>Mon, 04 Apr 2011 16:26:49 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=944#comment-38799</guid> <description>Nice article with useful information. But i have problem. I try overline text, but it doesnt work.&lt;pre lang=&quot;matlab&quot;&gt;
htmlStr = [&#039;Matlab&#039;];
jEditbox.setText(htmlStr)
&lt;/pre&gt;Is there any change, how to make overline text ?Thank you for answer</description> <content:encoded><![CDATA[<p>Nice article with useful information. But i have problem. I try overline text, but it doesnt work.</p><div
class="wp_syntax"><div
class="code"><pre class="matlab" style="font-family:monospace;">htmlStr = <span style="color: #080;">&#91;</span><span style="color:#A020F0;">'Matlab'</span><span style="color: #080;">&#93;</span>;
jEditbox.<span style="">setText</span><span style="color: #080;">&#40;</span>htmlStr<span style="color: #080;">&#41;</span></pre></div></div><p>Is there any change, how to make overline text ?</p><p>Thank you for answer</p> ]]></content:encoded> </item> <item><title>By: Yair Altman</title><link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/#comment-18319</link> <dc:creator>Yair Altman</dc:creator> <pubDate>Wed, 22 Sep 2010 06:53:25 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=944#comment-18319</guid> <description>@Noushin - of course; HTML is not multi-line by default, as you will notice if you prepare a multi-line HTML file and load it in your browser. To separate lines, you can use the HTML &lt;p&gt; or &lt;br&gt; tags. The &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.w3schools.com/html/default.asp&quot; rel=&quot;nofollow&quot;&gt;W3Schools&lt;/a&gt; website is a good reference &amp; tutorial for HTML and related technologies.</description> <content:encoded><![CDATA[<p>@Noushin &#8211; of course; HTML is not multi-line by default, as you will notice if you prepare a multi-line HTML file and load it in your browser. To separate lines, you can use the HTML &lt;p&gt; or &lt;br&gt; tags. The <a
rel="nofollow" target="_blank" href="http://www.w3schools.com/html/default.asp" rel="nofollow">W3Schools</a> website is a good reference &#038; tutorial for HTML and related technologies.</p> ]]></content:encoded> </item> <item><title>By: Noushin</title><link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/#comment-18305</link> <dc:creator>Noushin</dc:creator> <pubDate>Wed, 22 Sep 2010 02:05:35 +0000</pubDate> <guid
isPermaLink="false">http://undocumentedmatlab.com/?p=944#comment-18305</guid> <description>Hi
Thank you very much for the useful info. In my GUI, I first read a long string from an editbox (multiple lines) and then I&#039;d like to change the font color of a portion of this text and display it in the same editbox. I&#039;m not familiar with HTML coding but that&#039;s what I did using your example above:
&lt;pre lang=&quot;matlab&quot;&gt;
hEditbox=handles.my_editbox;
jScrollPane = findjobj(hEditbox);
jViewPort = jScrollPane.getViewport;
jEditbox = jViewPort.getComponent(0);
jEditbox.setEditorKit(javax.swing.text.html.HTMLEditorKit);
htmlStr = [str_part1,&#039;&lt;b&gt;&#039;, str_part2,&#039;&lt;/b&gt;&#039;, str_part3);
jEditbox.setText(htmlStr);
&lt;/pre&gt;the formatted string is displayed in the editbox however, it is no longer divided nicely between multiple lines! There is a very long first line where most of the string is out of the right margin. I was wondering is there is another setting that I need to tune for this to be properly displayed?I appreciate your help, Noushin</description> <content:encoded><![CDATA[<p>Hi<br
/> Thank you very much for the useful info. In my GUI, I first read a long string from an editbox (multiple lines) and then I&#8217;d like to change the font color of a portion of this text and display it in the same editbox. I&#8217;m not familiar with HTML coding but that&#8217;s what I did using your example above:</p><div
class="wp_syntax"><div
class="code"><pre class="matlab" style="font-family:monospace;">hEditbox=handles.<span style="">my_editbox</span>;
jScrollPane = findjobj<span style="color: #080;">&#40;</span>hEditbox<span style="color: #080;">&#41;</span>;
jViewPort = jScrollPane.<span style="">getViewport</span>;
jEditbox = jViewPort.<span style="">getComponent</span><span style="color: #080;">&#40;</span><span style="color: #33f;">0</span><span style="color: #080;">&#41;</span>;
jEditbox.<span style="">setEditorKit</span><span style="color: #080;">&#40;</span>javax.<span style="">swing</span>.<span style="">text</span>.<span style="">html</span>.<span style="">HTMLEditorKit</span><span style="color: #080;">&#41;</span>;
htmlStr = <span style="color: #080;">&#91;</span>str_part1,<span style="color:#A020F0;">'&lt;b&gt;'</span>, str_part2,<span style="color:#A020F0;">'&lt;/b&gt;'</span>, str_part3<span style="color: #080;">&#41;</span>;
jEditbox.<span style="">setText</span><span style="color: #080;">&#40;</span>htmlStr<span style="color: #080;">&#41;</span>;</pre></div></div><p>the formatted string is displayed in the editbox however, it is no longer divided nicely between multiple lines! There is a very long first line where most of the string is out of the right margin. I was wondering is there is another setting that I need to tune for this to be properly displayed?</p><p>I appreciate your help, Noushin</p> ]]></content:encoded> </item> <item><title>By: Yair Altman</title><link>http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/#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-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 regardsCamilo</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-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-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 regardsYoulian</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-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> </channel> </rss>

<!-- W3 Total Cache: Minify debug info:
Engine:             disk: basic
Theme:              b7666
Template:           single
-->
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: undocumentedmatlab.com @ 2012-02-09 05:12:22 -->

<!-- W3 Total Cache: Page cache debug info:
Engine:             disk: enhanced
Cache key:          blog/rich-matlab-editbox-contents/feed/_index.xml_gzip
Caching:            enabled
Status:             not cached
Creation Time:      0.743s
Header info:
X-Pingback:         http://undocumentedmatlab.com/blog/xmlrpc.php
Set-Cookie:         wpgb_visit_last_php-default=1328789542; expires=Fri, 08-Feb-2013 12:12:22 GMT; path=/
Link:               <http://undocumentedmatlab.com/?p=944>; rel=shortlink
Content-Type:       text/xml; charset=UTF-8
Last-Modified:      Thu, 09 Feb 2012 12:12:22 GMT
Vary:               Accept-Encoding, Cookie
Expires:            Thu, 09 Feb 2012 13:12:22 GMT
Pragma:             public
Cache-Control:      public, must-revalidate, proxy-revalidate
Etag:               33cd8fa2395b634b05f691dea3b3d71c
Content-Encoding:   gzip
-->
