Convert background and stylesheet dialogs to spark, and ensure the correct background...
authorAndy Allan <andy@gravitystorm.co.uk>
Sat, 24 Mar 2012 15:36:49 +0000 (15:36 +0000)
committerAndy Allan <andy@gravitystorm.co.uk>
Sat, 24 Mar 2012 15:36:49 +0000 (15:36 +0000)
net/systemeD/potlatch2/BackgroundDialog.mxml
net/systemeD/potlatch2/BackgroundSelector.mxml
net/systemeD/potlatch2/StyleSelector.mxml

index 4c21149..cf8e64d 100644 (file)
@@ -44,7 +44,7 @@
     import mx.core.Application;
     import mx.core.FlexGlobals;
        import mx.collections.ArrayCollection;
-       import mx.controls.List;
+       import spark.components.List;
        import net.systemeD.potlatch2.FunctionKeyManager;
 
        public var dataCollection:ArrayCollection;
@@ -64,7 +64,6 @@
     
     private function backgroundDialog_close(evt:CloseEvent):void {
         PopUpManager.removePopUp(this);
-               if (menu) { menu.invalidateList(); }
     }
 
        private function addNewSource():void {
index 4b339d0..45e8393 100644 (file)
@@ -1,26 +1,35 @@
 <?xml version="1.0" encoding="utf-8"?>
-<mx:VBox
-       xmlns:fx="http://ns.adobe.com/mxml/2009"
-       xmlns:mx="library://ns.adobe.com/flex/mx"
-       paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"
-       horizontalAlign="left" backgroundColor="white" borderStyle="inset">
-       
-       <mx:List width="100%" height="100%" id="background"
-                       labelField="name"
-                       change="FlexGlobals.topLevelApplication.bgButton.close(); Imagery.instance().setBackground(background.selectedItem);"
-               dataProvider="{Imagery.instance().getAvailableImagery()}"
-               rowCount="{Imagery.instance().getAvailableImagery().length}"/>
-       <mx:HBox>
-       <mx:CheckBox width="100%" label="Dim" selected="{application.theMap.getDimming()}" id="dim"
-           change="setDimming(dim.selected)" />
-       <mx:CheckBox width="100%" label="Sharpen" selected="{application.theMap.getSharpen()}" id="sharpen"
-           change="setSharpen(sharpen.selected)" />
-       </mx:HBox>
-
-       <mx:HBox>
-       <mx:Button id="editLabel" label="Edit..." click="FlexGlobals.topLevelApplication.bgButton.close(); new BackgroundDialog().init('Background imagery',background,Imagery.instance());" />
-       <mx:Button label="Vector file..." click="FlexGlobals.topLevelApplication.bgButton.close(); new VectorSourceDialog().init();" />
-       </mx:HBox>
+<s:BorderContainer
+    xmlns:fx="http://ns.adobe.com/mxml/2009"
+    xmlns:s="library://ns.adobe.com/flex/spark">
+
+    <s:layout>
+      <s:VerticalLayout
+          paddingLeft="5" paddingRight="5"
+          paddingTop="5" paddingBottom="5"/>
+    </s:layout>
+
+    <s:List width="100%" height="100%" id="background"
+            labelField="name"
+            change="FlexGlobals.topLevelApplication.bgButton.close(); Imagery.instance().setBackground(background.selectedItem);"
+            dataProvider="{Imagery.instance().getAvailableImagery()}"
+            selectedItem="{Imagery.instance().selected}">
+      <s:layout>
+        <s:VerticalLayout requestedRowCount="{Imagery.instance().getAvailableImagery().length}" gap="0" horizontalAlign="contentJustify"/>
+      </s:layout>
+    </s:List>
+
+    <s:HGroup>
+      <s:CheckBox width="100%" label="Dim" selected="{application.theMap.getDimming()}" id="dim"
+          change="setDimming(dim.selected)" />
+      <s:CheckBox width="100%" label="Sharpen" selected="{application.theMap.getSharpen()}" id="sharpen"
+          change="setSharpen(sharpen.selected)" />
+    </s:HGroup>
+
+    <s:HGroup>
+      <s:Button id="editLabel" label="Edit..." click="FlexGlobals.topLevelApplication.bgButton.close(); new BackgroundDialog().init('Background imagery',background,Imagery.instance());" />
+      <s:Button label="Vector file..." click="FlexGlobals.topLevelApplication.bgButton.close(); new VectorSourceDialog().init();" />
+    </s:HGroup>
 
        <fx:Script><![CDATA[
 
@@ -48,5 +57,4 @@
                        obj.flush();
                }
     ]]></fx:Script>
-</mx:VBox>
-
+</s:BorderContainer>
index 057e6f8..5714f99 100644 (file)
@@ -1,17 +1,25 @@
 <?xml version="1.0" encoding="utf-8"?>
-<mx:VBox
+<s:BorderContainer
        xmlns:fx="http://ns.adobe.com/mxml/2009"
-       xmlns:mx="library://ns.adobe.com/flex/mx"
-       paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"
-       horizontalAlign="left" backgroundColor="white" borderStyle="inset">
-       
-       <mx:List width="100%" height="100%" id="mapStyle" 
+    xmlns:s="library://ns.adobe.com/flex/spark" >
+
+    <s:layout>
+      <s:VerticalLayout
+          paddingLeft="5" paddingRight="5"
+          paddingTop="5" paddingBottom="5"/>
+    </s:layout>
+
+       <s:List width="100%" height="100%" id="mapStyle"
                labelField="name"
                change="FlexGlobals.topLevelApplication.styleButton.close(); Stylesheets.instance().setStylesheet(mapStyle.selectedItem.name, mapStyle.selectedItem.url);"
-               dataProvider="{Stylesheets.instance().getCollection()}"
-               rowCount="{Stylesheets.instance().getCollection().length}" />
+            dataProvider="{Stylesheets.instance().getCollection()}"
+            selectedItem="{Stylesheets.instance().selected}">
+      <s:layout>
+        <s:VerticalLayout requestedRowCount="{Stylesheets.instance().getCollection().length}" gap="0" horizontalAlign="contentJustify"/>
+      </s:layout>
+    </s:List>
 
-       <mx:Button id="editButton" label="Edit..." click="FlexGlobals.topLevelApplication.styleButton.close(); new BackgroundDialog().init('Map style',mapStyle,Stylesheets.instance());" />
+       <s:Button id="editButton" label="Edit..." click="FlexGlobals.topLevelApplication.styleButton.close(); new BackgroundDialog().init('Map style',mapStyle,Stylesheets.instance());" />
 
        <fx:Script><![CDATA[
                import net.systemeD.halcyon.*;
@@ -20,5 +28,5 @@
                import net.systemeD.potlatch2.collections.Stylesheets;
                import mx.core.*;
     ]]></fx:Script>
-</mx:VBox>
+</s:BorderContainer>