Page 1 of 1
prevent field text "flicker" when using openfield
Posted: Mon Dec 01, 2008 2:23 am
by billworld
When tabbing into some fields, I need the text to be highlighted. The following code does this, however, there's an annoying flicker which occurs. It appears that the cursor first gets positioned at the end of the text then the text gets highlighted, thus the "flicker". Is there a way around this?
Thanks
Code: Select all
on openfield
select text of me
end openfield
Posted: Mon Dec 01, 2008 10:58 pm
by Mark
Hi Bill,
instead of using the openField message, use the tabkey message. Of course, you will have to write a different script for each field or apply some trick with cursom properties.
Code: Select all
on tabKey
select text of fld "Next Field"
end tabKey
Best,
Mark
Posted: Mon Dec 01, 2008 11:43 pm
by billworld
That approach is not practical. It also doesn't help with tabbing backward (shift-tab). Anyway, I'll just deal with the flicker and post a QCC report. Thanks anyway.
Mark wrote:Hi Bill,
instead of using the openField message, use the tabkey message. Of course, you will have to write a different script for each field or apply some trick with cursom properties.
Code: Select all
on tabKey
select text of fld "Next Field"
end tabKey
Best,
Mark
Posted: Mon Dec 01, 2008 11:59 pm
by Mark
Hi Bill,
Why is't it practical? You have to write a script to make it practical. You can expect that Rev does everything for you.
You didn't say you want it to go the reverse if the shiftkey is pressed. You can check whether the shiftkey is pressed in your script and select the text of a different field.
Best,
Mark
Posted: Tue Dec 02, 2008 12:17 am
by SparkOut
More importantly, what operating system/environment do you have? There's various quirks in the display (that for instance, lockscreen doesn't prevent, although I believe it should) on my runtimes in various ways, but I get no flicker at all in testing your original openField script.
Granted, it's only one card, but I made several very large fields and they all tabbed and selected with no quirk in the display.
I use Rev Studio 3 on Windows XP, mainly.
Posted: Tue Dec 02, 2008 12:50 am
by bn
bill,
this works if you put it into the script of a card (based on Marks suggestion)
Code: Select all
local tLastFieldNumber
on tabKey
put the number of fields into tFieldNumbers
if tLastFieldNumber is "" then put 0 into tLastFieldNumber -- first time
if the shiftkey is not down then
if tLastFieldNumber < tFieldNumbers then
add 1 to tLastFieldNumber
select text of field tLastFieldNumber
else
put 1 into tLastFieldNumber
select text of field tLastFieldNumber
end if
else -- shiftKey is down
if tLastFieldNumber > 1 then
subtract 1 from tLastFieldNumber
select text of field tLastFieldNumber
else
put tFieldNumbers into tLastFieldNumber
select text of field tLastFieldNumber
end if
end if
end tabKey
almost no flicker with this. Although the flicker is barely noticeable on my Mac 2.2 Mhz. Give your user a nickel if he notices the flicker (as an incentive)
bernd
Posted: Tue Dec 02, 2008 3:00 am
by susiRMIT
Hi bn,
I applied your code but I must press tab key two times then cursor moves to another field.
Plz help me. Thanks
Posted: Tue Dec 02, 2008 6:02 am
by Janschenkel
You can also let the engine do the hiliting whenever the user 'tabs' between fields. Select your field, open the Inspector and tick the checkbox 'Tab on return' in the 'Basic properties' panel - or if you'd rather do it by script
Code: Select all
set the autoTab of field "foobar" to true
HTH,
Jan Schenkel.
Posted: Tue Dec 02, 2008 10:14 am
by susiRMIT
It's OK now. Thanks

Posted: Tue Dec 02, 2008 1:23 pm
by bn
Jan Schenkel wrote:
You can also let the engine do the hiliting whenever the user 'tabs' between fields. Select your field, open the Inspector and tick the checkbox 'Tab on return' in the 'Basic properties' panel - or if you'd rather do it by script
that works perfectly, without the hassle of scripting the tab or openfield and Bill, no
FLICKER.
Bernd
Posted: Tue Dec 02, 2008 1:27 pm
by Mark
Hi,
That's a great solution, but note that the field layers have to be in a particular order for this to work.
Best,
Mark
Posted: Wed Dec 03, 2008 5:07 am
by billworld
Thanks Jan. Odd, but, that works! How do you know this stuff? I guess you stumbled on it one day?
While it shouldn't be an issue for most of my fields, losing the ability to use the Return key to generate a carriage return within a field may be a concern (for larger text fields). But, as that may be the exception rather than the norm, other techniques could be used for that.
But, regardless, your technique provides the highlight without flicker nice and easy.
Thanks!
Bill
Janschenkel wrote:You can also let the engine do the hiliting whenever the user 'tabs' between fields. Select your field, open the Inspector and tick the checkbox 'Tab on return' in the 'Basic properties' panel - or if you'd rather do it by script
Code: Select all
set the autoTab of field "foobar" to true
HTH,
Jan Schenkel.
Posted: Wed Dec 03, 2008 6:29 am
by Janschenkel
I'm not even sure where I got that information - it must have come up on the use-revolution list at one point and it stuck in my head (which is odd, as I usually have the memory of a goldfish)
It's a funky property, as it allows the user to only enter a return if it doesn't cause the field to 'scroll' - so if you have a field that is tall enough to hold 4 lines of text, then the user can enter up to 4 lines of text and the next time he hits the return key the focus will jump to the next field.
But the jump to the next field and the hiliting behaviour is great for data entry forms as you don't have to go about and script individual 'tabKey' and 'returnInField' handlers to move things on their merry way.
Jan Schenkel.
Posted: Wed Dec 03, 2008 6:37 am
by billworld
Excellent. Thanks for the clarification on the return key. Awesome tips here. They're now in my personal RR notes db.
Thanks
Bill
Janschenkel wrote:I'm not even sure where I got that information - it must have come up on the use-revolution list at one point and it stuck in my head (which is odd, as I usually have the memory of a goldfish)
It's a funky property, as it allows the user to only enter a return if it doesn't cause the field to 'scroll' - so if you have a field that is tall enough to hold 4 lines of text, then the user can enter up to 4 lines of text and the next time he hits the return key the focus will jump to the next field.
But the jump to the next field and the hiliting behaviour is great for data entry forms as you don't have to go about and script individual 'tabKey' and 'returnInField' handlers to move things on their merry way.
Jan Schenkel.