Avoiding openField on resumeStack

J. Landman Gay jacque at hyperactivesw.com
Sun Jan 13 12:10:52 CST 2008


David Epstein wrote:
> MC 2.2 on Mac OSX 10.4.
> 
> While observing the message watcher, I click on the titleBar of a (not
> frontmost) stack that contains an unlocked field.  The message watcher
> shows these two messages:
> 
> resumeStack
> openField
> 
> and the unlocked field gets a blinking insertion point.
> 
> How can I suppress this behavior?  I only want an insertion point if
> the user clicks on the unlocked field itself, not if he simply brings
> the stack to the front.

When  a card opens, the engine focuses on the first object on the card 
that has traversalOn set to true. On Windows machines, where buttons can 
have traversal, a button at a lower layer than the first unlocked field 
will receive the focus and the behavior you describe won't happen. On a 
Mac, buttons don't get traversal, so the first unlocked field gets the 
focus instead.

You can work around this a few different ways. One is put an unlocked 
field at layer 1 somewhere off screen. This isn't a very good solution 
for some stacks, but it does allow the engine to focus on that field 
without anything visible happening for the user to notice. It will mess 
up the tabbing order though, since the user will think nothing happened 
if they tab into that field, since they can't see it.

Another way is to script this:

on preOpenCard
  send "unsel" to me in 10
end preOpenCard

on unsel
  select empty
end unsel

This is a hack too, but I've used it for a long time. Another solution 
I've read is this:

on preOpenCard
  set the traversalOn of fld 1 to false
end preOpenCard

on openCard
  set the traversalOn of fld 1 to true
end openCard

The problem with this is that if you have another editable field, the 
focus can shift there instead. You would probably have to loop through 
all the fields, setting traversalOn to false on preOpenCard, and then 
loop again on openCard to set them all back.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com


More information about the metacard mailing list