sending focus to next field

Richmond richmondmathewson at gmail.com
Mon Jun 18 14:09:43 EDT 2012


On 06/18/2012 08:38 PM, Bob Sneidar wrote:
> Works great so long as you only have fields, but sooner or later it is going to focus on your button. What I have done is on openCard I build a list of fields whose names match a criteria, such as starting with "fld" whose locktext is false. I save it in a property.

You are right there; that is why I posted an earlier message that went 
like this:

"However, I haven't had such a super weekend as something began to 
niggle at my mind last night:

What if the sequence of fields is interupted by a button or other control?

Tried this and had NO JOY:

on mouseUp
   put the id of the focusedObject into fOB
repeat until control id fOB is a field
   put (fOB + 1) into fOB
end repeat
   focus on fld id fOB
on mouseUp

the 'repeat' line "threw a bluey" (is: bad validation type)

replaced 'is' with '=' . . . same old sh*t.

What am I missing? "

and am still waiting for a reply that might allow me to lever my 
original solution.

>
> When I want to set the focus, I find my current field in the list, and then set the focus to the next object in the list. This has the added advantage of being able to run a "tab order" procedure to change the tab order of objects without changing their ID's. I also intercept the tab key in the card script and follow the above method instead of letting LC do it.
>
> Bob
>
>
> On Jun 16, 2012, at 1:02 PM, Richmond wrote:
>
>> On 06/16/2012 10:49 PM, Dr. Hawkins wrote:
>>> OK, today's kindergarten question, to which I think I knew the answer
>>> once upon a time (but then, i thought that I used to use "send some
>>> message to every field in this card" . . .).
>>>
>>> I want to be able to leave a field and focus to the next field, just
>>> as if tab were hit, from within a script.  I've tried sending tab as a
>>> message to the field, and sending it to the card with a tick delay.
>>>
>>> Surely this is easy . . .
>>>
>>>
>> I have just made a merry little stack with 3 fields all in a row.
>>
>> And a button containing this script:
>>
>> on mouseUp
>>   put the id of the focusedObject into fOB
>>   put (fOB + 1) into fOB
>>   focus on fld id fOB
>> on mouseUp
>>
>> and, oddly enough, it shifts the focus down the line of fields, one per click.
>>
>> Have a lovely weekend.  Richmond.
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the Use-livecode mailing list