Page 1 of 1

select all text in the field

Posted: Sun Apr 08, 2012 12:00 am
by snm
Hi,

How to select all the text in the field on enter it by mouse click?
Attached below handler from Dictionary is working only when navigating by TAB. After clicking on the field it seems to select all the text, but immediately the text is unselected and in place of clicking is blinking cursor.

Code: Select all

on openField
   select text of the target
end openField
LC 5.5.1 on Mac
The field is not locked. Am I missing something, or it's LC bug?

Thanks for help in advance,
Marek

Re: select all text in the field

Posted: Sun Apr 08, 2012 12:31 pm
by Klaus
Hi Marek,

well, the text gets selected "on openfield", but then the mouseclick will also be executed,
-> set cursor in field and deselect previous selection, immediately after that!

If you add a little wait handler it will work out fine:

Code: Select all

on openfield
  wait 1 with messages
  select text of the target
end openfield
Tested and works :D


Best and happy easter

Klaus

Re: select all text in the field

Posted: Sun Apr 08, 2012 9:28 pm
by snm
Happy Easter Klaus, thanks a lot.

I was trying to wait before select, but not with message after it.

Happy Easter to all LC Coders,
Marek