finding & storing the field that *would* be next on closefield

Dr. Hawkins dochawk at gmail.com
Sun Oct 20 12:25:42 EDT 2013


On Sat, Oct 19, 2013 at 9:11 PM, <dunbarx at aol.com> wrote:

> But could you set a flag, maybe in a custom property, on closing the field
> in question, and then when any other field takes focus, check that
> property? If the newly focussed field is the one you are interested in,
> clear the flag, if not keep it.
>
>
I've got it storing where it came from, and go back there, but . . .

I guess what I really need is to be able, from within closeField, to be
able to tell *why* and *how* it got triggered?  Did a user tab out?  Did
the card get deleted (in which case, it should store it's insertion point
and it's successor get focus)?  Did the user click in another field?  Was
another navigation key used to go to the next row?

It is possible (likely) that the data in the field when closed causes a
change in page layout (say, changing from "Acme" to "Mom", causing it to
change from appearing on page 1 to page 4.  Or changing the number of lines
in the field, affecting placement of all later fields. Or this was the
entry row for new data, so now we need a new row for that.  Or . . .)

So when closefield happens, the data is saved, and a check is made to see
if any layout changes happened.  If so, a "send in" causes the existing
card to be wiped, and the page to be redrawn by placing & filling new
groups [or, a different page to be shown, if this caused the element to
jump pages]).

But I want the focus to land in the "natural" place--the next field if tab,
the field clicked if clicked, and so forth.  So I need to figure out from
this variety of possible events where that was.

And the tricky one seems to be a mouse click in another field; as near as I
can tell, the closest I can come is mouseControl(), but that doesn't seem
to tell me that that's actually what happened--if the user tabs out, the
mouse could still be over another field.

-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462



More information about the use-livecode mailing list