To focus on field without have the text selected
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
To focus on field without have the text selected
Hi all!
I'm trying to use the focus on field command in a series of fields with lockText true, unfortunately when the field get the focus the entire text of the field is selected, is there a way to avoid the text selection when move from a field to another?
I'm trying to use the focus on field command in a series of fields with lockText true, unfortunately when the field get the focus the entire text of the field is selected, is there a way to avoid the text selection when move from a field to another?
Re: To focus on field without have the text selected
Hi.
Not sure how you are doing this, but if you focus on a field that contains text, the default behavior is to set the cursor at the end of that text, not to select all. Anyway, try this in a button somewhere:
Craig
EDIT: Hmmm, this seemed reasonable, but of course selecting empty defocuses the field. Try something else...
More Hmmm. Setting the cursor to none and locking does not work. And why should it? There are always two cursors when a blinking one is in the field and the "ordinary" one is hanging around the card.
Not sure how you are doing this, but if you focus on a field that contains text, the default behavior is to set the cursor at the end of that text, not to select all. Anyway, try this in a button somewhere:
Code: Select all
on mouseUp
focus on fld 1
select empty
end mouseUp
EDIT: Hmmm, this seemed reasonable, but of course selecting empty defocuses the field. Try something else...
More Hmmm. Setting the cursor to none and locking does not work. And why should it? There are always two cursors when a blinking one is in the field and the "ordinary" one is hanging around the card.
Re: To focus on field without have the text selected
Maybe select text something? But what? 

Re: To focus on field without have the text selected
OK.
This has to win the silver for ugliest kluge of the Olympics. It works, and if you never do anything to the text of that field it can stay. Otherwise, ugh.
In a button script, with a field with text in it:
Oh. Did I mention it was awful?
Craig
This has to win the silver for ugliest kluge of the Olympics. It works, and if you never do anything to the text of that field it can stay. Otherwise, ugh.
In a button script, with a field with text in it:
Code: Select all
on mouseUp
get the scroll of fld 1
focus on fld 1
repeat 100
put return after fld 1
end repeat
select after text of fld 1
set the scroll of fld 1 to it
end mouseUp
Craig
Re: To focus on field without have the text selected
Hi Mag,
Just tried this and it seems to work (Mac OSX)
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
-
Just tried this and it seems to work (Mac OSX)
Code: Select all
on mouseUp
focus on fld 1
select char 0 of fld 1
end mouseUp
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
-
Re: To focus on field without have the text selected
Neil.
Right. Thank heaven.
Craig
Right. Thank heaven.
Craig
Re: To focus on field without have the text selected
A bit of trivia: fields with autoTab set to true will auto-select the entire field content. Fields with autoTab set to false will set the insertion point at the end. Or at least it used to be that way, I haven't checked in a while.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: To focus on field without have the text selected
Jacque.
That is right. Forgot about autoTab
Mag, listen to Jacque.
Craig
That is right. Forgot about autoTab
Mag, listen to Jacque.
Craig
Re: To focus on field without have the text selected
runrevneil wrote:Hi Mag,
Just tried this and it seems to work (Mac OSX)
Kind Regards,Code: Select all
on mouseUp focus on fld 1 select char 0 of fld 1 end mouseUp
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
-
Thank you Neil works fine and it suits perfectly the needs of my current project.

So now I replaced
focus on field "abc"
with
select char 0 of fld "abc"
Thank you Jacque and Craig for your help!
Re: To focus on field without have the text selected
Mag,
So your instinct about "select something..." was spot on.
Craig
So your instinct about "select something..." was spot on.
Craig
Re: To focus on field without have the text selected
Hehehedunbarx wrote:Mag,
So your instinct about "select something..." was spot on.
Craig
