the focusedObject

william humphrey shoreagent at gmail.com
Mon Jan 12 07:49:22 EST 2009


It's funny. I read all the emails in this list and must learn something but
when it is a problem I'm working on and then you guys answer I really do
learn something.
I like the idea of trapping the "close field" (you got the idea -- I'm
trying to run the next code call without the user having to reach for the
mouse) and it will probably be faster as I've noticed that trapping for the
"return" introduces a processing delay.

Thanks for the suggestion. I think it will work better and I just have to
make sure that a field is open first, as I was thinking a return could be
trapped even when a field wasn't open but you're idea is so much better for
the other reasons that you've pointed out.

Thanks

On Sun, Jan 11, 2009 at 11:07 PM, J. Landman Gay
<jacque at hyperactivesw.com>wrote:

> william humphrey wrote:
>
>  When I hit a return key in field id 1045 it sends "returnkey",  what I'm
>> trying to do is send "returnkey" no matter what field the cursor is in
>> except for field id 1045 which has more then one line and which needs to
>> allow returns.
>>
>
> It looks like you want to execute a handler when the field is closed, and
> you are trying to trap returnkey messages to figure that out. If that's the
> case, then I'd do this instead:
>
> 1. Set every relevant field to use the autotab property. This lets the
> engine figure out for you when the user has typed a return. The advantage
> here is that any number of returns in longer fields are allowed; only a
> return key that would cause the text to drop below the bottom of the field
> are disallowed.
>
> 2. Size each field to show exactly how many lines you'll allow.
>
> 3. Change your returnkey handler to a closefield handler. Every time the
> user types return (or tab) to leave the field, a closefield will trigger.
>
> If the longer field needs to be a scrolling field to allow more text, then
> you can put an empty closefield handler in that particular field's script to
> block the message so that the card (or stack) script closefield handler
> doesn't catch it.
>
> If I've misinterpreted what you need to do, then just ignore all this. :)
>
> http://www.bluewatermaritime.com



More information about the use-livecode mailing list