A Panel container consists of a title bar, a caption, a border, and a content area for its children. Typically, you use Panel containers to wrap top-level application modules. For example, you could include a shopping cart in a Panel container.
MXML Syntax
The <mx:Panel> container inherits all the properties of its parent classes, and the following properties:
<mx:Panel panelBorderStyle="default" cornerRadius="3" dropShadow="true" headerColors="[0xE1E5EB, 0xF4F5F7]" headerHeight"28" footerColors="[0xF4F5F7, 0xE1E5EB]" title="No default." titleStyleDeclaration="Default value is undefined, which causes the title bar to have white bold text." click="Event handler; no default." mouseDownOutside="Event handler; no default." ... child tags ... />
Delivered after the Resize effect finishes playing. The default value is "Dissolve". To disable the Dissolve effect so that the children are hidden instantaneously, you must explicitly set the value of the resizeEndEffect trigger to "none".
resizeStartEffect
Delivered before the Resize effect begins playing. The default value is "Dissolve". To disable the Dissolve effect so that the children are hidden instantaneously, you must explicitly set the value of the resizeStartEffect trigger to "none".
Broadcast when the user selects the close button. The event object's target property contains a reference to the component that triggered the event. The event object's type property contains the name of the event.
mouseDownOutside
Broadcast when the user clicks outside the panel. The event object's target property contains a reference to the component that triggered the event. The event object's type property contains the name of the event.
Type:
Number
CSS Inheritance:
no Radius of corners of the window frame. The default value is 8.
dropShadow
Type:
Boolean
CSS Inheritance:
no Boolean property that controls the visibility of the Panel's drop shadow. The default value is true to draw the drop shadow.
footerColors
Type:
Array
CSS Inheritance:
yes Array of two colors used to draw the footer (area for the ControlBar container) background. The first color is the top color. The second color is the bottom color. The default values are (0xF4F5F7, 0xE1E5EB).
headerColors
Type:
Array
CSS Inheritance:
yes Array of two colors used to draw the header. The first color is the top color. The second color is the bottom color. The default values are (0xE1E5EB, 0xF4F5F7).
headerHeight
Type:
Number
CSS Inheritance:
no Height of the header. The default value is 28.
panelBorderStyle
CSS Inheritance:
no Border style for the bottom two corners of the container. The top two corners are always round. Possible values are default, which configures the container to have square corners, and roundCorners, which defines rounded corners. To configure the top corners to be square, set cornerRadius to 0. The default value is default.
shadowDirection
CSS Inheritance:
no Direction of drop shadow. Possible values are "left", "center" and "right". The default value is "center".
shadowDistance
Type:
Number
CSS Inheritance:
no Distance of drop shadow. Negative values move shadow above the panel. The default value is 2.
Closes a pop-up Panel container. This method is added to the Panel container if it is opened using the Application.popup() or PopUpManager.createPopUp() methods.
getViewMetrics
getViewMetrics(
)
:
Object
Returns the thickness of the edges of the object, including the border, title bar and scroll bars, if visible.
Returns
Object with left, right, top, and bottom properties containing the edge thickness, in pixels.
measure
measure(
)
:
Void
Calculates the preferred, mininum and maximum sizes of the Panel container. See the UIObject.measure() method for more information about the measure() method.
The measure() method first calls VBox.measure() method, then makes sure the _measuredPreferredWidth and _measuredMinWidth are wide enough to display the title and the ControlBar.
Property Detail
className
className:
String
Name of this class.
status
status:
String
Text in the status area of the title bar. The default value is an empty string.
statusStyleDeclaration
statusStyleDeclaration:
String
Style declaration name for the status in the title bar. The default value is windowStatus, which causes the status area to have bold text.
title
title:
String
Title or caption displayed in the title bar. The default value is an empty string.
titleStyleDeclaration
titleStyleDeclaration:
String
Style declaration name for the text in the title bar. The default value is windowStyles, which causes the title to have bold text.
The footerColors and headerColors styles do not seem to support CSS: "CSS Value for header-colors not supported." (v1.5)
Also, the documentation should indicate the default color values either: a.) not using parenthesis (so that the user can properly deduce how to construct an array of these values.) or b.) use square-brackets (array syntax) to indicate the default value and/or indicate usage e.g. ex: headerColors="[0xE1E5EB, 0xF4F5F7]"
Dan
smgilson
said on
Jul 7, 2006
at
6:19 AM :
I tried this code and it does work to set footerColors and headerColors.
<?xml version="1.0" encoding="utf-8"?> <!-- Simple example to demonstrate Panel layout --> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" backgroundColor="#FFFFFF">
I see what you mean. The misleading part for me was Flex Builder's context-sensitive code hints. When inside an <mx:Style> block, pressing the open-curly-brace brings up the hint list. The entries "header-color", and "header-colors" are in the list, but not "headerColors". It's the former two values that do not properly compile.
Comments
mr_dan said on Jul 6, 2006 at 2:40 PM : smgilson said on Jul 7, 2006 at 6:19 AM : mr_dan said on Jul 10, 2006 at 11:34 AM :