views:

345

answers:

3

I see that Flex3 has a class called ApplicationControlBar dedicated to "holding components that provide global navigation and application commands." (quoted from the langref). The question is: is there an advantage of using this class instead of just adding a plain HBox with a greyish background, or is it just a matter of taste?

In my current code, I use the following box:

<mx:HBox verticalAlign="middle" horizontalGap="5" backgroundColor="0xCCCCCC"
         width="100%" paddingTop="5" paddingRight="5" paddingBottom="5"
         paddingLeft="5">

Granted, this requires explicitly specifying a few attributes, but other than that?

+1  A: 

ApplicationControlBar is essentially an HBox with both scroll policies set to false and a transparent background. The only other feature it offers is the ability to be docked. From the Livedocs:

Docked mode: The bar is always at the top of the application's drawing area and becomes part of the application chrome. Any application-level scroll bars don't apply to the component, so that it always remains at the top of the visible area, and the bar expands to fill the width of the application. To create a docked bar, set the value of the dock property to true.

If you look at the source for ApplicationControlBar and Application.dockControlBar you'll see that when docked=true the bar is added to rawChildren instead of children which is what allows it to "ignore" scollbars and such.

cliff.meyers
+1  A: 

In addition to the previous answer I can add, that it's possible to set the gradient background to the ApplicationControlBar, which is not allowed to the HBox, if you're not using the special border type, of course :)

aleksk
A: 

But even with HBox you can still draw your own gradient background without setting the border style.

radekg