Cursor manipulation within a text item [message #167199] |
Tue, 11 April 2006 16:43  |
rcd70
Messages: 14 Registered: April 2006 Location: Auckland, New Zealand
|
Junior Member |
|
|
Hi
Is there any way of positioning the cursor in a text item or highlighting a part of the text.
I am working on an issue on a form which has a multiline text item. Its difficult for the user to search a string (like name) in the text item as they have to scroll through the entire text item, because at times it can be quite big.
So the solution I came up with is having a SEARCH text item and a checkbox, wherein the user enter the string to be searched in the SEARCH text box and checks the checkbox and the text gets highlighted or the cursor is placed at the beginning of the string in the text item.
Is there any way of highlighting or placing the cursor in the text item at a desired place in the text item.
Any help is very much appreciated.
Thanks
|
|
|
Re: Cursor manipulation within a text item [message #167218 is a reply to message #167199] |
Tue, 11 April 2006 21:45   |
 |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
You will have to use a Java thingy to position the cursor.
I will search for an example and update this post later.
David
Upd: Look at this on metalink which mentions win_api_shell.sendkeys. I searched this forum for 'WIN_API_SHELL' and found this which says to look in d2kwutil, whose documentation says "WIN_API_SHELL - SendKeys - Allows you to simulate User Keystrokes via a macro language". So you use PL/SQL to determine how many cahracters into the field you wish to go, then by using 'win_api_shell.sendkeys' you can 'right arrow' the cursor to the start of the wanted string, then press 'shift' and 'right arrow' to select the text.
[Updated on: Wed, 12 April 2006 00:53] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Cursor manipulation within a text item [message #169453 is a reply to message #169436] |
Wed, 26 April 2006 22:09   |
 |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
I meant a url to the meaning of the '+^%' commands. If '+' means 'shift', then I would expect that '+{Right 10}' would highlight 10 characters. Is this correct?
Instead of win_api_shell.sendkeys(win,'^{Home}+{Right 520}',FALSE);
win_api_shell.sendkeys(win,'+{Right 501}',FALSE);
please trywin_api_shell.sendkeys(win,'^{Home}{Right 520}',FALSE);
win_api_shell.sendkeys(win,'{Right 501}',FALSE);
win_api_shell.sendkeys(win,'+{Right 10}',FALSE);
does this set of commands cause the cursor to highlight 10 characters a 1000 or so characters into the item?
Do you really need to use Ctrl-Home or will Home get you to the beginning of the item?
David
|
|
|
|
|
|
|
|
|
|
|