Start user entry filed with a capital letter? - Solved
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Start user entry filed with a capital letter? - Solved
I have looked in the dictionary under text, Capital and keyboard, but
can't find how to Start user entry filed with a capital letter?
Could someone give me a clue?
Also, I would like to be able to have the cursor go to the last character of the text in a user entry field, when I click on it, how?
Thanks,
David
can't find how to Start user entry filed with a capital letter?
Could someone give me a clue?
Also, I would like to be able to have the cursor go to the last character of the text in a user entry field, when I click on it, how?
Thanks,
David
Last edited by DR White on Wed Feb 15, 2017 7:15 pm, edited 1 time in total.
Re: Start user entry filed with a capital letter?
Hi
How is the user interacting? Do they simply type into a field? If so, you might trap the keyDown message. Put this in the field script:
Now can you think of other ways to do the same thing?
Craig Newman
How is the user interacting? Do they simply type into a field? If so, you might trap the keyDown message. Put this in the field script:
Code: Select all
on keyDown tKey
if me is "" then
put toUpper(tKey) into me
select after text of me
else pass keyDown
end keyDown
Craig Newman
Re: Start user entry filed with a capital letter?
Craig,
Your code works great!
Thanks,
David
Your code works great!
Thanks,
David
Re: Start user entry filed with a capital letter? - Solved
I just reread the whole of your post.
Put this into the field script:
I originally thought that trapping the "openField" message would do the same thing. It does not. Sequence of LC internal workings, I guess...
Craig
Put this into the field script:
Code: Select all
on selectionChanged
select after text of me
end selectionChanged
Craig
Re: Start user entry filed with a capital letter? - Solved
Craig,
I really did not describe my objective very well, which was to automatically start the beginning of a user entry field with a capital letter, when the user starts to type in the field.
Your code was just what I needed to get me started.
I ended up with:
On TextChanged
if len(me) = 1 then
put toUpper(me) into me
select after text of me
end if
End TextChanged
Thanks so much,
David
I really did not describe my objective very well, which was to automatically start the beginning of a user entry field with a capital letter, when the user starts to type in the field.
Your code was just what I needed to get me started.
I ended up with:
On TextChanged
if len(me) = 1 then
put toUpper(me) into me
select after text of me
end if
End TextChanged
Thanks so much,
David
Re: Start user entry filed with a capital letter? - Solved
Well and good, and you found another message to exploit.
The second post was about sending the insertion point to the end of any existing text. You had mentioned that as well.
Craig
The second post was about sending the insertion point to the end of any existing text. You had mentioned that as well.
Craig
Re: Start user entry filed with a capital letter? - Solved
Craig,
On you first post, I wondered why you did not mention anything about cursor going to the last character of the text in a user entry field.
But, as I played with your solution to my first issue, I found that "select after text of me" worked well for placing the cursor at the end of text in a field.
Thanks again for all your help,
David
On you first post, I wondered why you did not mention anything about cursor going to the last character of the text in a user entry field.
But, as I played with your solution to my first issue, I found that "select after text of me" worked well for placing the cursor at the end of text in a field.
Thanks again for all your help,
David