Hi, while working on FLEX-33806 (changing the message top padding of 
experimental Alert),
I realized the implementation of this class was unnecessarily complex:

-           it derives from Panel (ok) and adds 3 skinParts (messageDisplay , 
iconDisplay, and buttonGroup)

-          Defines its own skin class that monkey-patches PanelSkin, disables 
contentGroup,  and adds the three skinParts laid out in two groups VGroup and 
HGroup.

-          Uses UIComponent to wrap the iconClass, and RichText to display the 
message.

I found it could be simplified that way:

-          Don't need a new skin,  default panel skin is fine.

-          Sets the icon and message directly in the class (not in the skin), 
so that they go in the contentGroup, and set the layout accordingly 
(HorizontalLayout with padding)

o   Use BitmapImage for the icon, instead of the "UIComponent" wrapper.

o   Use s:Label for the message instead of RichText

-          Use controlBarContent to hold the Alert buttons

-          And finally, since there is no skinParts for messageDisplay and 
iconDisplay, push the message text and icon class to the controls using the old 
fashioned invalidateProperties() / commitProperties() way.

What do you think?

Maurice Amsellem
SYSTAR R&D - BusinessBridgeFX

Reply via email to