how to move caret programmatically
by apu2 » Sat, 13 Dec 2008 14:32:23 GMT
I am creating a Bengali editor using a Bengali font. A key input or a sequence
of key inputs translates to a single Bengali character symbol or a basic
character symbol with a modifier symbol. I am using an event handler for the
change event in TextArea object. In the event handler, I check the key typed ,
map it to the unicode(s) corresponding to the key or sequence of keys typed and
put this unicode sequence back to TextArea.text .
The problem is that when , say the sequence "ko" is typed the two letters
translate to 3 Bengali symbols. When I replace the "ko" with the 3 symbols,
they show up alright but the caret or cursor shows up between symbol 2 and 3.
For all other symbols, it works properly i.e. that caret shows up after the
last symbol. So, in order to type, user has to manually press right arrow to
move the caret to the right of 3rd symbol. Can it be done programmatically?
What I want is I will map "ko" to 4 rather than 3 symbols, the last being a
non-printable unicode for right arrow. Is it possible? I could not find the
unicode for non-printable right arrow. I just want to move caret one position
to the right programmatically.
Re: how to move caret programmatically
by apu2 » Sat, 13 Dec 2008 21:34:32 GMT
I found the solution from another thread.
ta.setSelection(ta.text.length, ta.text.length);
This sets the focus at the end of text in the text area
Similar Threads:
1.How do I keep main form richedit caret flashing when pressing button in 2nd form
I'm writing an application with custom skinned controls.
I have a text editor form with a rich edit control. Because there's no
toolbuttons in the skinned control set, I have to use normal ones for
Bold/Italic/Underline etc. Because they're normal buttons, they grab focus
from the rich edit. So to prevent losing the caret Ive used the Validating
event to cancel focus loss. This works great.
The application can be run in either terminal or desktop mode.
In terminal mode ie no physical keyboard, I have had to write a small
keyboard window to allow the user to enter text/symbols.
When I switch to the 2nd form, the rich edit is still the ActiveControl on
the main form but the caret vanishes from view.
Am I able to do anything similar here? The keypad window needs to behave in
the same way they do in compact framework.
thanks
2.CARET (flashing text insertion) position: GetGUIThreadInfo problem
Hallo,
I need to track the Caret position (flashing text insertion point),
I go with GetGuiThreadInfo and it gives me the coordinates
of the caret and of the window that owns it,
then I convert them to screen coordinate,
so it's all OK.
But...
if the window has another little window inside it,
in example a meter on the top (like MS Works)
or a dropdown combobox on the top (like the VB6 code editor; it has two
dropdown combobox indeed),
the resulting coordinate of the window that owns the caret
(Y coordinate in those cases)
is wrong:
the height dimension of the little window is not considered.
How can I solve it?
With Notepad is all ok because it has no other window/object
inside it, but with more complex windows...?
3.Textfield caret missing in Mozilla and Mozilla Firefox browsers
4.Textfield caret missing in Mozilla and Mozilla Firefox browsers
Standard textfields don't have a caret on those browsers.
Anybody knows a quick solution for this?
5.Input text fields: problem with caret position
Hi,
I have two input text fields on the stage with embedded char sets. When I
switch fields with a right-click the caret does not blink at the correct
position. It blinks sometimes after the second, sometimes after the third
character.
When I do not embed the characters everything works fine. But I want to use
embedded char sets...
Has anyone a solution for me?
Thanks.
6. Customization of TextInput Caret
7. Textfield caret missing in Mozilla and Mozilla Firefox browsers
8. Caret is not visible in Flash-Object within Director Movie