You are not logged in
click here to log in
Expand All
Collapse All

Right-to-Left (RTL) Text Field

In LiveCode 1 to 6.x, it was very complicated to create an application with text editing features for Arabic, Persian, Urdu, Hebrew and other RTL languages. To make this possible, Economy-x-Talk created a number of solutions. Some of these solution date back to more than 20 years, including an AppleScript-based solution for a university in Israel. More recently, we created solutions for a university in Great Britain and a company in the USA.

With the dawn of LiveCode 7 in 2014, we are now looking forward to built-in RTL text capabilities, which means that our custom solution is no longer needed by those using LiveCode 7 and later. This has led to the decision to make the custom field available to anyone who continues to use LiveCode 6 and earlier versions.

The following is a culmination of many RTL text fields together, which were created for customers in the past. (The text in the picture is meant to say "I love reading a lot").



The picture shows a stack with an RTL text control. When you choose an RTL input method, you can type your text in this control. Type space to start a new word --this seems obvious, but it is important to keep this in mind-- and type return to start a new line. The dontWrap of this control is set to true and can't be changed. Scrollbars allow you to read the entire text.

You can select and copy text with control-C or command-C and paste the text into any unicode-compliant text editor. Sometimes, text appears reversed in a text editor after pasting. In those cases, use shift-control-C or shift-command-C to copy the text.Pasting text into the text control is also possible. However, any additional text will appear at the end of the text if the text is pasted after a space. Text is inserted normally if pasted before a space. This quirky behaviour was necessary to make the text control work at all.

On Mac OS X, you can set the autoKeyboard property of the control to true, e.g. using the syntax
set the autoKeyboard of grp "Test Control" to the hilite of me
If this property is set to true, the input method is automatically set to the standard Arabic input method. For this to work, you must have the language input menu enabled and the extInputMethod command line utility installed in the CLIS folder next to the stack containing the text control. This property is not required to make the field work properly.

To use this field in your own stack, just copy and paste the control into your stack. (It is actually a group with its selectGroupedControls property set to false). In older versions of LiveCode, you may have to set the global selectGroupedControls property to false, or disable Select Grouped Controls in LiveCode's toolbar. Each copied control has its own scripts and propeties and works independently of the other controls.

This field is available for free to anyone who made a donation within the past year. If you made a donation, you can log in using the link in the top-right. After logging in, use the index in the left side to go back to this page (software for livecode developers -> Right to Left Text Field).

If you haven't donated yet, you can do so below (please, be patient: it may take several hours for your password to arrive). Once logged in, the download links will appear below.

Login

You need to log in to download free LiveCode and other programming-related goodies. If you don't have an account yet, please register.
E-mail
Password
Don't have an account yet? Register here.

Share on FaceBook! Digg! Delicious submit to reddit
click on an icon to share this web site with your friends

copyright © 2005-2012 by Economy-x-Talk, Nijmegen, the Netherlands - no rights can be derived from this website - economy-x-talk bears no responsibility for linking and linked websites - disclaimers apply at all times