Keeping a field to one line only?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Garrett
Posts: 386
Joined: Sat Apr 08, 2006 8:15 am
Contact:

Keeping a field to one line only?

Post by Garrett » Wed Apr 19, 2006 5:28 am

Rev 2.6.1

How on earth do I disable enter and return in a field, or keep it to a single
line field only?

the enterKey and returnKey messages are not working either.

Thanks,
-Garrett

marielle
Livecode Opensource Backer
Livecode Opensource Backer

Post by marielle » Wed Apr 19, 2006 9:50 am

In a textfield, it is possible to capture the enter event with

Code: Select all

on enterInField
   ...
end enterInField
to have code that works cross platform/cross keyboards it's always best to add

Code: Select all

on returnInField
   enterinfield
end returnInField
Garrett, you are actively coding it seems!? :wink:

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Wed Apr 19, 2006 2:38 pm

You can also set the "AutoTab" property (labeled "Tab on return" in the inspector).

Note that you still can paste returns into such a field.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Garrett
Posts: 386
Joined: Sat Apr 08, 2006 8:15 am
Contact:

Re: Keeping a field to one line only?

Post by Garrett » Wed Apr 19, 2006 6:21 pm

Garrett wrote:the enterKey and returnKey messages are not working either.
How I came up with the two message names above is beyond me, but
enterInField and returnInField do the job. :-)

I needed to catch the enter and return keys so I could active some code,
so the autoTab would not have worked. But thanks a bunch BvG :-)

And thank you also Marielle.

-Garrett

Post Reply