focusIn

Richmond richmondmathewson at gmail.com
Wed Mar 25 12:17:27 EDT 2015


I got things a bit wrong as I wanted the field backGroundColor to change 
when
end-users selected a field, so, after going for a walk I changed things 
to the far simpler:

on mouseEnter
   set the backGroundColor of me to green
end mouseEnter

on mouseLeave
   set the backGroundColor of me to red\
end mouseLeave

Richmond.

> LC 7.0.3
> New stack, two new fields with their lockText set to true.
> In both fields their scripts:
>
> on focusIn
>     set the backgroundColor of me to green
> end focusIn
>
> on focusOut
>     set the backgroundColor of me to red
> end focusOut
>
> Pressing the Tab key moves the focus from one to the other and the
> backgroundColor changes from green to red and vice versa.
> If I change the lockText to false in both fields, then change the script to:
>
> on openField
>     set the backgroundColor of me to green
> end openField
>
> on ExitField
>     set the backgroundColor of me to red
> end ExitField
>
> Again the backgroundColor changes from red to green and vice versa when I
> tab.
>
> So you are right. There is no difference.
>
> PS If you need the same to happen when data in the field is changed then
> you'd also have to include an CloseField handler.
>
> On Wed, Mar 25, 2015 at 3:17 PM, Richmond <richmondmathewson at gmail.com>
> wrote:
>
>> On 25/03/15 09:14, John Dixon wrote:
>>
>>> Richmond...
>>>
>>> from the dictionary... 'If the control is an unlocked field .....  the
>>> openField message is sent to it instead of the focusIn message.'
>>>
>>> Is your field unlocked ?...:-)
>>>
>> Cannot see any difference really.
>>
>>
>>
>>>   Date: Wed, 25 Mar 2015 08:57:47 +0200
>>>> From: richmondmathewson at gmail.com
>>>> To: use-livecode at lists.runrev.com
>>>> Subject: focusIn
>>>>
>>>> I tried this:
>>>>
>>>> on focusIn
>>>>       set the backGroundColor of fld "CHAMP" to green
>>>> end focusIn
>>>>
>>>> and it didn't work.
>>>>
>>>> I wanted to change a field's backGroundColor when someone selects that
>>>> field;
>>>> obviously THAT method doesn't work.
>>>>
>>>> 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
>>>
>>
>> _______________________________________________
>> 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