Hi Judah,

We also use custom skins a lot along Flex 4 components, but when
particular style is marked on base class as "excluded" with meta-tag
[Exclude] there is no way to re-include this style back in base class
descendant.

Mxmlc compiler will continue to complain about style "being excluded"
for the component.

Luckily, in this case we can extend LinkButton from ButtonBase, and
voila, "textAlign" style is back for the Spark LinkButton.


--
Best regards,
Andriy Panas



On 18 May 2010 22:41, dorkie dork from dorktown
<dorkiedorkfromdorkt...@gmail.com> wrote:
>
>
>
> 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
>>>
>>
>
> 


------------------------------------

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location: 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    flexcoders-dig...@yahoogroups.com 
    flexcoders-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    flexcoders-unsubscr...@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to