Reformat dates. Surprisingly limited options for parsing and displaying dates.
[potlatch2.git] / net / systemeD / potlatch2 / StyleSelector.mxml
index b2e5609d2d043f417cad6b41d50d908c0f6244ee..04566cdad0d7e98e1bf62308bfd3a894a64d573e 100644 (file)
@@ -4,25 +4,18 @@
        paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"
        horizontalAlign="left" backgroundColor="white" borderStyle="inset">
        
-       <mx:List width="100%" height="100%" id="mapStyle" change="updateMapStyle();"> 
-           <!-- This should be pulled in from an XML file rather than sitting in the source -->
-           <mx:dataProvider>
-               <mx:Object label="Potlatch" data="potlatch.css" />
-               <mx:Object label="Wireframe" data="wireframe.css" />
-           </mx:dataProvider>
-       </mx:List>
+       <mx:List width="100%" height="100%" id="mapStyle" 
+               labelField="name"
+               change="Application.application.styleButton.close(); Application.application.setStylesheet(mapStyle.selectedItem.name, mapStyle.selectedItem.url);"
+               dataProvider="{Application.application.theController.stylesheets}" />
+
+       <mx:Button label="Edit..." click="new BackgroundDialog().init('Map style',mapStyle,Application.application.theController.stylesheets);" />
 
        <mx:Script><![CDATA[
                import net.systemeD.halcyon.*;
                import net.systemeD.halcyon.connection.*;
                import net.systemeD.potlatch2.*;
-
-               private function updateMapStyle():void {
-            var theMap:Map = Globals.vars.root;
-                       var style:String=mapStyle.selectedItem.data;
-                       theMap.setStyle(style);
-               }
-
+               import mx.core.*;
     ]]></mx:Script>    
 </mx:VBox>