autoHilite and focus (following Jacque's solution)

Peter Brigham MD pmbrig at gmail.com
Wed Jul 6 17:48:48 EDT 2011


On Jul 6, 2011, at 12:52 PM, J. Landman Gay wrote:

> On 7/6/11 2:06 AM, Slava Paperno wrote:
>> But then I added other buttons to the same card, and found that if any of
>> them has AutoHilite set to true, my focus command is undone, and the focus
>> moves to the card itself as soon as the mouseUp handler is done in the Find
>> button. I do want the user to see the visual feedback from those buttons,
>> and I don't want their Focus with Keyboard property set to true.
> 
> I think what you're seeing is the engine's long-standing behavior that automatically focuses on the first object that has traversalOn set to true whenever the card changes. On Windows/Linux, it can be a button. On OS X, where buttons by default don't respond the same way, it's a field. This has been known to drive developers gibbering into the streets, and I wish there were a way to turn that off.

One way to "turn that off" is to group all the controls on the card, then set the traversalon of the *group* to false. You can still enter text in any individual field, but you don't get an unintended insertion point in the first (lowest layer) field when the card opens. I use this a lot, since I'm one of the people (can't really call myself a true developer) you might have seen gibbering in the street....

> But since we're stuck with it, one solution is to make your Find field the first one (the lowest layer) if possible. Or, see my suggestion in my other post. Or add an (ugly) command to an openCard handler that sends a message in 1 millisecond to another handler, which in turn focuses on nothing (or on your field if you prefer.)
> 
>> 
>> With the focus gone, my user will probably try to press Tab to return the
>> focus to the input field. But when the focus is on the card, none of my
>> buttons receives that Tab keypress.
> 
> Put the tabkey handler into the stack or card and check "the target" to see which object received the message.
> 
> -- 
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig






More information about the use-livecode mailing list