I have been guilty of this and have been using typeNames now. I've found
that I need to set typeNames before calling super() in the constructor. I
thought it was done afterwards, but if I set typeNames after calling
super(), the typeName I set does not show up in the HTML produced.
Also, suppose I have this: A Menu with a label inside of it. People will
want to change the background color of the menu and the color of the
label's text. If I were doing this in plain HTML/JS/CSS, I would set a
selector: .Menu .Label { color: blue; } but that's not supported in the
Flash Player. So when I set up the typeName for the label inside of the
Menu should I set it to: Menu_Label or MenuLabel or Menu-Label? And is
using "." in a selector name a good idea? I would think the CSS processor
in the browser would be confused between ".x.y" and ".x .y" which can also
be written as ".x.y". Basically, we should have a consist naming pattern
here.
‹peter
On 2/23/18, 4:09 AM, "Gabe Harbs" <[email protected]> wrote:
>There¹s some edge cases which seem problematic. One example:
>ComboBoxBiew has the following:
> input = new TextInput();
> input.className = "ComboBoxTextInput";
>
> button = new TextButton();
> button.className =
>"opt_org-apache.royale-html-ComboBox_Button";
>
>Input and button are both external to the view class, but are managed by
>the view class. On the other hand, there is a chance that the user might
>wan to style them. I¹m not sure whether className or typeNames is more
>appropriate hereŠ
>
>Harbs
>
>> On Feb 23, 2018, at 11:03 AM, Gabe Harbs <[email protected]> wrote:
>>
>> I¹ll help.
>>
>>> On Feb 23, 2018, at 10:50 AM, Alex Harui <[email protected]>
>>>wrote:
>>>
>>> Quick note before I shut down for the night.
>>>
>>> UIBase has both a typeNames and className property. TypeNames is used
>>>to
>>> emulate Flex-like type selectors in the CSS lookup. It should be set
>>>in
>>> the constructor and never set from outside the class. There are a few
>>> classes in Basic and lots of classes in MDL that should be upgraded to
>>>set
>>> typeNames in the constructor. Subclasses can append to the base
>>>class's
>>> typeNames
>>>
>>> className is the opposite. It should never be set inside the
>>>component's
>>> class. It is for users of that component to set styles on the
>>>component.
>>>
>>> Can we get a volunteer to clean this up?
>>>
>>> Thanks,
>>> -Alex
>>>
>>
>