Fix layout issues. Waste afternoon. Kill Flex.
[potlatch2.git] / net / systemeD / potlatch2 / skins / CustomFormSkin.mxml
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3
4 ADOBE SYSTEMS INCORPORATED
5 Copyright 2010 Adobe Systems Incorporated
6 All Rights Reserved.
7
8 NOTICE: Adobe permits you to use, modify, and distribute this file
9 in accordance with the terms of the license agreement accompanying it.
10
11 -->
12
13 <!--- The default skin class for a Spark Form container.  
14
15 This skin defines a contentGroup for the Form container with a 
16 FormLayout as its layout object. The FormLayout is a VerticalLayout
17 that has additional logic to align the columns of FormItems.
18
19 @see spark.components.Form
20 @see spark.layouts.FormLayout
21
22 @langversion 3.0
23 @playerversion Flash 10
24 @playerversion AIR 1.5
25 @productversion Flex 4.5
26 -->
27 <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" 
28         xmlns:s="library://ns.adobe.com/flex/spark" 
29         xmlns:fb="http://ns.adobe.com/flashbuilder/2009" 
30         alpha.disabled="0.5">
31     
32     <fx:Metadata>
33         <![CDATA[ 
34         /** 
35         * @copy spark.skins.spark.ApplicationSkin#hostComponent
36         */
37         [HostComponent("spark.components.Form")]
38         ]]>
39     </fx:Metadata> 
40     
41     <fx:Script fb:purpose="styling">
42         <![CDATA[         
43             /**
44              *  @private
45              */
46             override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number) : void
47             {
48                 // Push backgroundColor and backgroundAlpha directly.
49                 // Handle undefined backgroundColor by hiding the background object.
50                 if (isNaN(getStyle("backgroundColor")))
51                 {
52                     background.visible = false;
53                 }
54                 else
55                 {
56                     background.visible = true;
57                     bgFill.color = getStyle("backgroundColor");
58                     bgFill.alpha = getStyle("backgroundAlpha");
59                 }
60                 
61                 super.updateDisplayList(unscaledWidth, unscaledHeight);
62             }
63         ]]>        
64     </fx:Script>
65     
66     <s:states>
67         <s:State name="normal" />
68         <s:State name="error" />
69         <s:State name="disabled" />
70     </s:states>
71     
72     <!--- Defines the appearance of the Form class's background. -->
73     <s:Rect id="background" left="0" right="0" top="0" bottom="0">
74         <s:fill>
75             <!--- @private -->
76             <s:SolidColor id="bgFill" color="#FFFFFF"/>
77         </s:fill>
78     </s:Rect>
79     <!--- @copy spark.components.SkinnableContainer#contentGroup -->
80     <!-- We set Form's showErrorTip and showErrorSkin to false, so we set them back 
81          to true for the Form's elements -->
82     <s:Group id="contentGroup" showErrorSkin="true" showErrorTip="true" 
83              left="0" right="0" top="0" bottom="0">
84         <s:layout>
85             <s:FormLayout gap="0"/>
86         </s:layout>
87     </s:Group>
88     
89     
90 </s:Skin>