When I find it too messy to override button class or whatever class to
change the label (for multiline or more advance stuff) I just put a label on
top of the button and turn includeInLayout=false and mouseChildren=false
It does need more coding if you want to respect the style textRollOver etc..

On Thu, Sep 11, 2008 at 2:16 PM, wnoone01 <[EMAIL PROTECTED]> wrote:

>   Hey all,
> I've got a theoretical question about subclassing a component. Here is
> the use case:
>
> A programmer requires buttons that support multiline labels. This is a
> requiement for Button, RadioButton, and CheckBox. Now to start, the
> programmer can subclass mx.controls.Button to implement the
> functionality. But now he needs to implement the functionality in
> RadioButton and CheckBox.
>
> One way is to subclass RadioButton and CheckBox and then duplicate the
> functionality there. However, not only will he be duplicating
> functionality, he is headed down a slippery slope. Let's say that for
> his next project, he suddenly requires a button label that supports
> HTML formatting. Now he must subclass again. So now the classes grow
> from:
>
> MultilineButton
> MultilineRadioButton
> MultilineCheckBox
>
> To
>
> MultilineButton
> HTMLButton
> MultilineRadioButton
> HTMLRadioButton
> MultilineCheckBox
> HTMLCheckBox
>
> The next project requires a multiline html button. So now its:
>
> MultilineButton
> HTMLButton
> MultilineHTMLButton
> MultilineRadioButton
> HTMLRadioButton
> MultilineHTMLRadioButton
> MultilineCheckBox
> HTMLCheckBox
> MultilineHTMLCheckBox
>
> And now its officially out of hand and the programmer is mired in a
> subclassing nightmare.
>
> ---
>
> So basically my question is what is the best way to handle this
> problem in Flex. Is subclassing the only way or is there a more
> efficient solution (decorators, item renderers, etc.)?
>
> Thanks in advance for any guidance
> Bill
>
>  
>



-- 
Merci,
Guillaume

Guillaume Malartre
Programmeur-Analyste, Scolab
514-528-8066, 1-888-528-8066

Besoin d'aide en maths?
www.NetMaths.net

Reply via email to