Thanks Andriys, I see what you mean. I didn't look at the actual button
skin. I assumed the textAlign and top left right bottom constraints were
hardcoded in the default button skin's label.

My example was mainly for illustrative purposes on how to pull in and set a
style in your skin from CSS. In my experience so far I've had to extend
almost all the controls to get the look and feel we want. This would have
been a lot of work in Flex 3 but with skinning in FDK 4 (yeah i said it -
coined!) and FC it's turning out to be a lot less work and lot more fun (is
it ok to say work is fun?). ;)

JP

On Tue, May 18, 2010 at 8:04 AM, Andriy Panas <a.pa...@gmail.com> wrote:

>
>
> Hi Judah,
>
> I really do not get the Adobe folks reasoning why "textAlign" style was
> excluded from Spark Buttton.
>
> BTW, the binding of "textAlign" style property in your custom skin via
> {getStyle('textAlign')} is redundant.
>
> The <s:Label> inside Button's skin would inherit the value set
> from "textAlign" style from <s:Button>, because  <s:Label> will have no
> explicit value set to "textAlign" in our custom skin
>
> e.g
>
>
> <s:SparkSkin>
> ...
> <s:Label id="labelDisplay"
>              verticalAlign="middle"
>              maxDisplayedLines="1"
>              horizontalCenter="0" verticalCenter="1"
>              left="10" right="10" top="2" bottom="2">
>     </s:Label>
> </s:SparkSkin>
>
> --
> Best regards,
> Andriy Panas
>
>
>
>
> On 18 May 2010 07:53, dorkie dork from dorktown <
> dorkiedorkfromdorkt...@gmail.com> wrote:
>
>>
>>
>> Hi Andriy,
>>
>> Yes. You will need to create a custom skin. You can base it on the Button
>> skin. In the skin you can use the following code:
>>
>> <s:Label
>> id="labelDisplay"
>> textAlign="getStyle('textAlign')"
>>
>> left="2" right="2" top="2" bottom="2"/>
>> </s:Skin>
>>
>> And you must set the style in CSS. The other way to set it is to extend
>> Button and add a property for text alignment. Then you can set it in MXML.
>>
>> JP
>>
>>
>> On Mon, May 17, 2010 at 3:25 AM, Andriy Panas <a.pa...@gmail.com> wrote:
>>
>>>
>>>
>>> Hi all,
>>>
>>> "textAlign" style is excluded for Spark Button, and probably for a good
>>> reason.
>>>
>>> [Exclude(name="textAlign", kind="style")]
>>>
>>> If I want to align Spark Button text label to the left, should I
>>> create custom skin to accomplish that?
>>>
>>> Something e.g:
>>>
>>> <?xml version="1.0" encoding="utf-8"?>
>>> <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009";
>>> xmlns:s="library://ns.adobe.com/flex/spark"
>>> xmlns:mx="library://ns.adobe.com/flex/mx"
>>> minWidth="21" minHeight="21"
>>> alpha.disabled="0.5">
>>> .......
>>>
>>> <s:Label
>>> id="labelDisplay"
>>> textAlign="left"
>>> left="2" right="2" top="2" bottom="2"/>
>>> </s:Skin>
>>>
>>> --
>>> Best regards,
>>> Andriy Panas
>>>
>>
>>
>  
>

Reply via email to