the texstyle of the clickline
Éric Chatonet
eric.chatonet at wanadoo.fr
Thu Sep 9 04:12:48 EDT 2004
Bonjour Leo,
In Revolution, objects inherit some of the properties of their owner.
That is especially true for text attributes, colors, patterns and so on.
When such a property is inherited, asking for it returns empty.
The docs says: Use the effective keyword to get the displayed property
of an object, regardless of whether the object itself has that property
set.
So in your handler:
on mouseUp
if the effective textstyle of the clickline is "plain" then
set the textstyle of the clickline to "bold"
else
set the textstyle of the clickline to "plain"
end if
end mouseup
Le 8 sept. 04, à 22:24, doupsy at wanadoo.fr a écrit :
> Message: 6
> Date: Wed, 8 Sep 2004 18:56:18 +0200
> From: doupsy at wanadoo.fr
> Subject: the texstyle of the clickline
> To: use-revolution at lists.runrev.com
> Message-ID: <00F855B1-01B8-11D9-8E2E-0003937E4820 at wanadoo.fr>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
>
> Hello,
>
> I have a card with a locked field and many lines of text inside.
> The script of this field is :
>
> on mouseup
> if the textstyle of the clickline is "plain" then set the
> textstyle
> of the clickline to "bold" else set the textstyle of the clickline to
> "plain"
> end mouseup
>
>
> I used this script under Hypertalk with no problem.
>
> Under Revolution, this script don't work correctly.
>
> When the textstyle is "plain", I saw than sometimes the textstyle of
> the clickline can be "plain" and sometimes can be empty.
> With others textstyles (bold, italic, underline, etc...) there is no
> problem.
>
> I rectified this script like this :
>
> on mouseup
> if (the textstyle of the clickline is "plain" or the textstyle of
> the
> clickline is empty) then ......
> end mouseup
>
> Is there a better solution ?
>
> Thanks
>
> Leo
Éric Chatonet
24, Boulevard de Port-Royal
75005 Paris
Fixe : 33 1 43 31 77 62
Mobile : 33 6 20 74 50 89
More information about the use-livecode
mailing list