<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>REALbasic City &#187; text</title>
	<atom:link href="http://realbasic.tutspolis.com/tag/text/feed/" rel="self" type="application/rss+xml" />
	<link>http://realbasic.tutspolis.com</link>
	<description>Tutorials - Tutspolis.com</description>
	<lastBuildDate>Sat, 29 May 2010 23:10:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PM: Create a text suggestion during typing</title>
		<link>http://realbasic.tutspolis.com/tutorials/pm-create-a-text-suggestion-during-typing/</link>
		<comments>http://realbasic.tutspolis.com/tutorials/pm-create-a-text-suggestion-during-typing/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 10:06:05 +0000</pubDate>
		<dc:creator>Jakub Pawlak</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[realbasic]]></category>
		<category><![CDATA[suggestion]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://realbasic.tutspolis.com/?p=252</guid>
		<description><![CDATA[<!-- isPostPurchased ,postID 252, userID 0, combination 1 -->
			
				
			
		
In this tutorial we will learn how can we create a text suggestion during typing in REALbasic. This way when we will write a text in TextField we will get a suggestion what we like to enter before we even finish typing. Watch it, learn it, enjoy it!


Creating the GUI for text suggestion during typing
Add [...]]]></description>
			<content:encoded><![CDATA[<!-- isPostPurchased ,postID 252, userID 0, combination 1 --><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Frealbasic.tutspolis.com%2Ftutorials%2Fpm-create-a-text-suggestion-during-typing%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Frealbasic.tutspolis.com%2Ftutorials%2Fpm-create-a-text-suggestion-during-typing%2F&amp;source=REALbasicCity&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In this tutorial we will learn how can we create a text suggestion during typing in REALbasic. This way when we will write a text in TextField we will get a suggestion what we like to enter before we even finish typing. Watch it, learn it, enjoy it!</p>
<p><span id="more-252"></span></p>
<div style="margin-left:19px;float:left">
<h2>Creating the GUI for text suggestion during typing</h2>
<p>Add to Window1 one TextField Control and two Static Text Controls. Change the StaticText1 Text Property to value &#8220;Suggestion:&#8221;. Now we will put some code to make everything work <img src='http://realbasic.tutspolis.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<h2>Coding a text suggestion function during typing</h2>
<p>Go to REALbasic code editor and in TextField1  Sub TextChange enter the code below. If you like you can also add to StaticText2 Function MouseDown code TextField1.Text = me.Text that will after clicking on StaticText2 change the TextField1.Text to StaticText2.Text.</p>
<p>	<div class='ArePayPalContent'>
	<p class='ArePayPalTextToShowIfNotLogedIn'>If you see this message you probably want access special material for Premium Members (Source Files, Bonus Tutorials, free Classes and More). You can do this by subscribing REALbasic City site for 10 USD (access for 3 months). There is also a option to buy access only to this material. Login or register to get option to buy and support REALbasic City.</p>
	<a class='ArePayPalLoginButton' href='http://tutspolis.com/wp-login.php'>Log in</a>
	</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://realbasic.tutspolis.com/tutorials/pm-create-a-text-suggestion-during-typing/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Working with text stream in REALbasic</title>
		<link>http://realbasic.tutspolis.com/tutorials/working-with-text-stream-in-realbasic/</link>
		<comments>http://realbasic.tutspolis.com/tutorials/working-with-text-stream-in-realbasic/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 20:15:48 +0000</pubDate>
		<dc:creator>Jakub Pawlak</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[binarystream]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[dialog]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[open]]></category>
		<category><![CDATA[realbasic]]></category>
		<category><![CDATA[save]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[textarea]]></category>

		<guid isPermaLink="false">http://realbasic.tutspolis.com/?p=139</guid>
		<description><![CDATA[<!-- isPostPurchased ,postID 139, userID 0, combination 1 -->
			
				
			
		
In this exciting tutorial we will learn some basics about saving, opening and convert encoding of text files in REALbasic using TextInputStream, TextOutputStream classes and ConvertEncoding function. Watch it, learn it, enjoy it!


Creating the GUI
Insert to Window Class one TextArea Control and 3 x PushButton Control. Here is my example of GUI look for this [...]]]></description>
			<content:encoded><![CDATA[<!-- isPostPurchased ,postID 139, userID 0, combination 1 --><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Frealbasic.tutspolis.com%2Ftutorials%2Fworking-with-text-stream-in-realbasic%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Frealbasic.tutspolis.com%2Ftutorials%2Fworking-with-text-stream-in-realbasic%2F&amp;source=REALbasicCity&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In this exciting tutorial we will learn some basics about saving, opening and convert encoding of text files in REALbasic using TextInputStream, TextOutputStream classes and ConvertEncoding function. Watch it, learn it, enjoy it!</p>
<p><span id="more-139"></span></p>
<div style="margin-left:19px;float:left">
<h2>Creating the GUI</h2>
<p>Insert to Window Class one TextArea Control and 3 x PushButton Control. Here is my example of GUI look for this application. You can make it the same or insert the controls where you like.</p>
<p><img src="http://realbasic.tutspolis.com/files/tutorials/textsaveopenconvert.png" alt="Working with text stream in REALbasic" /></p>
<h2>Save text to file</h2>
<p>To save all text available in TextArea to text file insert to PushButton1 Sub Open() this code. Please have in mind that you can save the file without interacting with user for example: f = GetFolderItem(&#8220;textfile.txt&#8221;)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Dim</span> t <span style="color: #000080;">As</span> TextOutputStream
<span style="color: #000080;">Dim</span> f <span style="color: #000080;">As</span> FolderItem
<span style="color: #000080;">Dim</span> dlg <span style="color: #000080;">As</span> SaveAsDialog
&nbsp;
dlg = <span style="color: #000080;">New</span> SaveAsDialog 
&nbsp;
f = dlg.ShowModal() // <span style="color: #000080;">open</span> save <span style="color: #000080;">as</span> dialog <span style="color: #000080;">for</span> entering the file name <span style="color: #000080;">and</span> selecting location <span style="color: #000080;">to</span> save
&nbsp;
<span style="color: #000080;">if</span> f &lt; &gt; nil <span style="color: #000080;">then</span> // f different from nil
    t = f.CreateTextFile // create file <span style="color: #000080;">in</span> selected location
    t.Write (TextArea1.Text) // write <span style="color: #000080;">date</span> from TextArea <span style="color: #000080;">to</span> file
    t.<span style="color: #000080;">Close</span> // <span style="color: #000080;">close</span> file
<span style="color: #000080;">else</span>
    // user cancelled
<span style="color: #000080;">end</span> <span style="color: #000080;">if</span></pre></td></tr></table></div>

<h2>Open text from file</h2>
<p>To open a text file and load it content to TextArea Control use this code in PushButton2 Sub Open().</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Dim</span> t <span style="color: #000080;">As</span> TextInputStream
<span style="color: #000080;">Dim</span> f <span style="color: #000080;">As</span> FolderItem
<span style="color: #000080;">Dim</span> dlg <span style="color: #000080;">As</span> OpenDialog
&nbsp;
dlg = <span style="color: #000080;">New</span> OpenDialog 
&nbsp;
f = dlg.ShowModal() // <span style="color: #000080;">open</span> <span style="color: #000080;">open</span> dialog <span style="color: #000080;">for</span> selecting a file <span style="color: #000080;">to</span> load
&nbsp;
<span style="color: #000080;">if</span> f &lt; &gt; nil <span style="color: #000080;">then</span> // f different from nil
    t = f.OpenAsTextFile // <span style="color: #000080;">open</span> selected text file
    TextArea1.Text = t.ReadAll // read data from text file into TextArea <span style="color: #000080;">control</span>
    t.<span style="color: #000080;">Close</span> // <span style="color: #000080;">close</span> the file
<span style="color: #000080;">else</span>
    // user cancelled
<span style="color: #000080;">end</span> <span style="color: #000080;">if</span></pre></td></tr></table></div>

<h2>Convert text encoding</h2>
<p>When you need to write text to a file that will be opened by other application that expects a particular encoding, you should convert the encoding before you call the Write method. You can do this by using ConvertEncoding function. Look on this example that converts the text from a TextArea1 to the UTF8 encoding. Code from PushButton3 Sub Open().</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Dim</span> t <span style="color: #000080;">As</span> TextOutputStream
<span style="color: #000080;">Dim</span> f <span style="color: #000080;">As</span> FolderItem
<span style="color: #000080;">Dim</span> dlg <span style="color: #000080;">As</span> SaveAsDialog
<span style="color: #000080;">Dim</span> s <span style="color: #000080;">As</span> <span style="color: #000080;">String</span>
&nbsp;
dlg = <span style="color: #000080;">New</span> SaveAsDialog 
&nbsp;
f = dlg.ShowModal() // <span style="color: #000080;">open</span> save <span style="color: #000080;">as</span> dialog <span style="color: #000080;">for</span> entering the file name <span style="color: #000080;">and</span> selecting location <span style="color: #000080;">to</span> save
&nbsp;
<span style="color: #000080;">if</span> f &lt; &gt; nil <span style="color: #000080;">then</span> // f different from nil
    t = f.CreateTextFile // create file <span style="color: #000080;">in</span> selected location
    s = ConvertEncoding(TextArea1.Text, Encodings.UTF8) // convert encoding <span style="color: #000080;">to</span> UTF8
    t.Write (s) // write <span style="color: #000080;">date</span> from <span style="color: #000080;">string</span> <span style="color: #000080;">to</span> file
    t.<span style="color: #000080;">Close</span> // <span style="color: #000080;">close</span> file
<span style="color: #000080;">else</span>
    // user cancelled
<span style="color: #000080;">end</span> <span style="color: #000080;">if</span></pre></td></tr></table></div>

<h2>BinaryStream Class</h2>
<p>BinaryStream objects are used to read and write data to and from a binary file. The benefit of using BinaryStreams rather than text streams is that you can read from and write to any position in the file. Text files must be read sequentially from the start to the end. On Windows and Macintosh only, BinaryStream objects can work with files larger than 2 gigabytes. This example reads each pair of bytes from a file and writes them in reverse order to a new file. The user chooses the source file using the Open-file dialog box and saves the new file using the Save as dialog box</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Dim</span> WriteToFile <span style="color: #000080;">as</span> BinaryStream
<span style="color: #000080;">Dim</span> ReadFromFile <span style="color: #000080;">as</span> BinaryStream
<span style="color: #000080;">Dim</span> f <span style="color: #000080;">as</span> FolderItem
&nbsp;
f = GetOpenFolderItem(<span style="color: #800000;">&quot;text&quot;</span>)
&nbsp;
<span style="color: #000080;">if</span> f &lt; &gt; nil <span style="color: #000080;">then</span> // <span style="color: #000080;">if</span> f different nil <span style="color: #000080;">then</span>
ReadFromFile = BinaryStream.<span style="color: #000080;">Open</span> (f,<span style="color: #000080;">False</span>)
ReadFromFile.littleEndian = <span style="color: #000080;">True</span>
f = GetSaveFolderItem (<span style="color: #800000;">&quot;&quot;</span>,<span style="color: #800000;">&quot;&quot;</span>)
&nbsp;
<span style="color: #000080;">if</span> f &lt; &gt; nil <span style="color: #000080;">then</span> // <span style="color: #000080;">if</span> f different nil <span style="color: #000080;">then</span>
WriteToFile = BinaryStream.Create (f,<span style="color: #000080;">False</span>)
<span style="color: #000080;">while</span> <span style="color: #000080;">not</span> ReadFromFile.EOF
WriteToFile.WriteShort ReadFromFile.ReadShort
wend
WriteToFile.<span style="color: #000080;">Close</span>
<span style="color: #000080;">end</span> <span style="color: #000080;">if</span>
ReadFromFile.<span style="color: #000080;">Close</span>
<span style="color: #000080;">end</span> <span style="color: #000080;">if</span></pre></td></tr></table></div>

</div>
]]></content:encoded>
			<wfw:commentRss>http://realbasic.tutspolis.com/tutorials/working-with-text-stream-in-realbasic/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Drag and drop images, text, controls in REALbasic</title>
		<link>http://realbasic.tutspolis.com/tutorials/drag-and-drop-images-text-controls-in-realbasic/</link>
		<comments>http://realbasic.tutspolis.com/tutorials/drag-and-drop-images-text-controls-in-realbasic/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 16:16:02 +0000</pubDate>
		<dc:creator>Jakub Pawlak</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[controls]]></category>
		<category><![CDATA[drag and drop]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[realbasic]]></category>
		<category><![CDATA[statictext]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[textarea]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://realbasic.tutspolis.com/?p=100</guid>
		<description><![CDATA[<!-- isPostPurchased ,postID 100, userID 0, combination 1 -->
			
				
			
		
In this tutorial we learn how to drag and drop images and text files from desktop to our application, and how to drag and drop controls inside Window in REALbasic. Watch it, learn it, enjoy it!


Creating the GUI
We will use today a StaticText, TextArea and Canvas control to create our GUI. Simply drag and drop [...]]]></description>
			<content:encoded><![CDATA[<!-- isPostPurchased ,postID 100, userID 0, combination 1 --><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Frealbasic.tutspolis.com%2Ftutorials%2Fdrag-and-drop-images-text-controls-in-realbasic%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Frealbasic.tutspolis.com%2Ftutorials%2Fdrag-and-drop-images-text-controls-in-realbasic%2F&amp;source=REALbasicCity&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In this tutorial we learn how to drag and drop images and text files from desktop to our application, and how to drag and drop controls inside Window in REALbasic. Watch it, learn it, enjoy it!</p>
<p><span id="more-100"></span></p>
<div style="margin-left:19px;float:left">
<h2>Creating the GUI</h2>
<p>We will use today a StaticText, TextArea and Canvas control to create our GUI. Simply drag and drop this controls to Window1 so they will be placed to something similar to the picture below.</p>
<p><img src="http://realbasic.tutspolis.com/files/tutorials/draganddrop/draganddrop.png" alt="Drag and drop in REALbasic" /></p>
<h2>Drag and drop controls</h2>
<p>The firs thing we will do in this tutorial is dragging a StaticText control to TextArea control and displaying in it StaticText1.Text. To do this go to StaticText1 Function MouseDown () and use this code.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Dim</span> d <span style="color: #000080;">As</span> DragItem
&nbsp;
d = NewDragItem(me.left,me.top,me.width,me.height)
d.text = me.text
d.drag</pre></td></tr></table></div>

<p>Now you can drag and drop StaticText to TextArea control. Isn&#8217;t this easy or what?</p>
<h2>Drag and drop text file from desktop into TextArea</h2>
<p>In this part of tutorial we will learn how can we drag and drop text file from desktop to our REALbasic application. In this case we will use TextArea control as a object into we will drag and drop text file and display all content in it available.  Firs go to Project tab and add new File type set and as Display Name type special/any.</p>
<p><img src="http://realbasic.tutspolis.com/files/tutorials/draganddrop/filetypeset.png" alt="File type set in REALbasic" /></p>
<p>Next go to code editor and in TextArea1 Sub Open () enter code&#8230; Of course you can be more detailed by allowing only a specify format for drag and drop in this control.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;">me.AcceptFileDrop(<span style="color: #800000;">&quot;special/any&quot;</span>)</pre></td></tr></table></div>

<p>We will create a Drag and drop event in TextArea1 Sub DropObject ()</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Dim</span> text <span style="color: #000080;">As</span> TextInputStream
<span style="color: #000080;">Dim</span> f <span style="color: #000080;">As</span> FolderItem
&nbsp;
<span style="color: #000080;">do</span>
   <span style="color: #000080;">if</span> obj.FolderItemAvailable <span style="color: #000080;">then</span>
&nbsp;
    f = obj.FolderItem
&nbsp;
      <span style="color: #000080;">if</span> f &lt; &gt;  Nil <span style="color: #000080;">then</span> // f various Nil
        text =  f.OpenAsTextFile
        TextArea1.Text = text.ReadAll
        text.<span style="color: #000080;">close</span>
    <span style="color: #000080;">else</span>
        //User Cancelled
    <span style="color: #000080;">end</span> <span style="color: #000080;">if</span>
&nbsp;
  <span style="color: #000080;">end</span> <span style="color: #000080;">if</span>
<span style="color: #000080;">loop</span> <span style="color: #000080;">until</span> <span style="color: #000080;">not</span> obj.NextItem</pre></td></tr></table></div>

<p>As you can imagine if you will now drag and drop a text file to this control it will read and display the text inside the text file.</p>
<h2>Drag and drop image file from desktop into Canvas</h2>
<p>Getting a picture or graphic from desktop (or should say from hard drive) into Canvas using drag and drop method is similar to previous paragraph. Go to code editor and in Canvas1 Sub Open () enter code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;">me.AcceptFileDrop(<span style="color: #800000;">&quot;special/any&quot;</span>)</pre></td></tr></table></div>

<p>Create a Drag and drop event in Canvas1 Sub DropObject ()</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Dim</span> f <span style="color: #000080;">As</span> FolderItem
<span style="color: #000080;">Dim</span> p <span style="color: #000080;">As</span> Picture
&nbsp;
<span style="color: #000080;">do</span>
  <span style="color: #000080;">if</span> obj.FolderItemAvailable <span style="color: #000080;">then</span>
    f = obj.FolderItem
&nbsp;
    <span style="color: #000080;">if</span> f &lt; &gt;  Nil <span style="color: #000080;">then</span> // f various Nil
        p = f.OpenAsPicture  // load picture <span style="color: #000080;">to</span> memory
        Canvas1.Backdrop = p // load image from memory <span style="color: #000080;">to</span> canvas
    <span style="color: #000080;">else</span>
        //User Cancelled
    <span style="color: #000080;">end</span> <span style="color: #000080;">if</span>
&nbsp;
  <span style="color: #000080;">end</span> <span style="color: #000080;">if</span>
<span style="color: #000080;">loop</span> <span style="color: #000080;">until</span> <span style="color: #000080;">not</span> obj.NextItem</pre></td></tr></table></div>

<p>If you like you can add to this project some image manipulation techniques like fit to canvas, crop etc. from tutorial <a href="http://realbasic.tutspolis.com/tutorials/creating-imageviewer-in-realbasic/">Creating ImageViewer in REALbasic</a>.  See you next time!</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://realbasic.tutspolis.com/tutorials/drag-and-drop-images-text-controls-in-realbasic/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>REALbasic – TextArea Control</title>
		<link>http://realbasic.tutspolis.com/classes/realbasic-textarea-control/</link>
		<comments>http://realbasic.tutspolis.com/classes/realbasic-textarea-control/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 08:51:14 +0000</pubDate>
		<dc:creator>Jakub Pawlak</dc:creator>
				<category><![CDATA[Classes & Controls]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[realbasic]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[textarea]]></category>

		<guid isPermaLink="false">http://realbasic.tutspolis.com/?p=68</guid>
		<description><![CDATA[<!-- isPostPurchased ,postID 68, userID 0, combination 1 -->
			
				
			
		
TextArea control is a editable text area that you are using in text editors (notepad, word, openoffice, pages etc.) or IM. It can contain multiple lines of text and can display mixed fonts, font styles and sizes. Learn how can you use it!


Adding text to a TextArea
Add to the Window PushButton Control and double click [...]]]></description>
			<content:encoded><![CDATA[<!-- isPostPurchased ,postID 68, userID 0, combination 1 --><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Frealbasic.tutspolis.com%2Fclasses%2Frealbasic-textarea-control%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Frealbasic.tutspolis.com%2Fclasses%2Frealbasic-textarea-control%2F&amp;source=REALbasicCity&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>TextArea control is a editable text area that you are using in text editors (notepad, word, openoffice, pages etc.) or IM. It can contain multiple lines of text and can display mixed fonts, font styles and sizes. Learn how can you use it!</p>
<p><span id="more-68"></span></p>
<div style="margin-left:19px;float:left">
<h2>Adding text to a TextArea</h2>
<p>Add to the Window PushButton Control and double click on it. Then enter there the code below. It&#8217;s simply like in TextField.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;">TextArea.Text = <span style="color: #800000;">&quot;REALbasic City sample text&quot;</span></pre></td></tr></table></div>

<h2>Reading text from a TextArea</h2>
<p>Reading the content from TextArea is extreme easy like this s = TextArea.Text. Here you got a example that shows Message Box:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Dim</span> s <span style="color: #000080;">As</span> <span style="color: #000080;">String</span>
<span style="color: #000080;">Dim</span> d <span style="color: #000080;">as</span> <span style="color: #000080;">New</span> MessageDialog //<span style="color: #000080;">declare</span> the MessageDialog <span style="color: #000080;">object</span>
<span style="color: #000080;">Dim</span> b <span style="color: #000080;">as</span> MessageDialogButton //handling the result
&nbsp;
s = TextArea.Text
d.Message = s
b = d.ShowModal</pre></td></tr></table></div>

<h3>Changing selected text in TextArea</h3>
<p>Every text editor has a option to change the style of the text. Here you can look how you can simple change the selected text in TextArea control to new color and new font with bold style. Add the code to PushButton Sub Action()</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Dim</span> Black <span style="color: #000080;">As</span> Color
&nbsp;
Black = RGB(0,0,0)
&nbsp;
TextArea.SelTextFont = <span style="color: #800000;">&quot;Arial&quot;</span>
TextArea.SelBold = <span style="color: #000080;">true</span>
TextArea.SelTextColor = Black</pre></td></tr></table></div>

<h2>Changing string with TextArea</h2>
<p>We can also change the text in string ex. by finding the word or by putting the cursor on indicated line. We will change the word &#8220;my&#8221; form text string by putting the cursor on 8 position and changing the next 2 letters to bold and red color.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Dim</span> text <span style="color: #000080;">As</span> <span style="color: #000080;">String</span>
&nbsp;
text = <span style="color: #800000;">&quot;This is my string&quot;</span>
&nbsp;
TextArea.StyledText.Text = text
&nbsp;
TextArea.StyledText.Bold( 8, 2 ) = <span style="color: #000080;">true</span>
TextArea.StyledText.TextColor( 8, 2 ) = &amp;amp;cFF0020</pre></td></tr></table></div>

<h2>Using Mask</h2>
<p>Simply select TextArea in GUI builder Tab and then in Property and Value find Behavior -&gt; Mask and place there ex. ###-##-####. You can also add a code in TextArea Sub Open(). Go to Window1 code editor Controls -&gt; TextArea -&gt; Open.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;">TextArea.Mask = <span style="color: #800000;">&quot;###-##-####&quot;</span> //US Social Security number
TextArea.Mask = <span style="color: #800000;">&quot;(###) ###-####&quot;</span> //US Phone number, <span style="color: #000080;">with</span> area code</pre></td></tr></table></div>

<h2>Mask Character in TextArea</h2>
<ul>
<b>#</b> &#8211; The single digit placeholder. Entry optional. If this position is left blank in the mask, it will be rendered as a space. Plus and minus signs are allowed. The user can type only a digit character in this position.<br />
<b>.</b> &#8211; Decimal placeholder. The decimal placeholder that is actually used is specified in the user&#8217;s International settings. The character is treated as a literal (formatting) character for masking purposes.<br />
<b>,</b> &#8211; Thousands separator. The thousands separator that is actually used is specified in the user&#8217;s International settings. The character is treated as a literal (formatting) character for masking purposes.<br />
<b>:</b> &#8211; Time separator. The time separator that is actually used is specified in the user&#8217;s International settings. The character is treated as a literal (formatting) character for masking purposes.<br />
<b>/</b> &#8211; Date separator. The date separator that is actually used is specified in the user&#8217;s International settings. The character is treated as a literal (formatting) character for masking purposes.<br />
<b>\</b> &#8211; Mask escape character. Treat the next character in the mask as a literal. The escape character enables you to use the &#8216;#&#8217;, &#8216;&amp;&#8217;, &#8216;A&#8217;, &#8216;?&#8217; (and so on) characters in the mask. The escapted character is treated as a literal (formatting) character.<br />
<b>&amp;</b> Character or space placeholder. Valid values are the ASCII characters 32-126 and the non-ASCII characters 128-255.<br />
<b>C</b> &#8211; Character or space placeholder, where entry is optional. It operates like the &#8216;&amp;&#8217; placeholder.<br />
<b>&gt;</b> &#8211; Convert all the characters that follow to uppercase. Uppercasing works beyond the ASCII range where appropriate, e.g., ü becomes Ü.<br />
<b>&lt;</b> &#8211; Convert all the characters that follow to lowercase. Lowercasing works beyond the ASCII range where appropriate, e.g., Ü becomes ü.<br />
<b>A</b> &#8211; Alphanumeric character placeholder, where entry is mandatory.<br />
For example, the spec &#8220;AAA&#8221; specifies three alphanumeric characters.<br />
<b>a</b> -Alphanumeric character placeholder, where entry is optional.<br />
<b>0</b> &#8211; Any single digit between 0 and 9. Entry is required.<br />
<b>9</b> &#8211; Digit or space where entry is optional.<br />
<b>?</b> &#8211; Alphabetic placeholder. Entry is optional.<br />
<b>L</b> &#8211; Alphabetic placeholder. Entry is required. Any literal. All other symbols are displayed as literals for formatting purposes.<br />
<b>~</b> &#8211; Reserved for future use. If you use &#8220;~&#8221; it will trigger an exception error. Use \~ instead.
</ul>
<h2>Using TextArea Property and Value</h2>
<p>When you select TextArea in GUI builder you can change some Property and Value for this control. We have got there position properties (width, height), appearance (text color, border), font (text size, text font), initial state (default text), behaviors (mask, read only) or database binding. Please play with them for a wile to understand what is happening when you change the values.
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://realbasic.tutspolis.com/classes/realbasic-textarea-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
