support GPX 1.1 too
[potlatch2.git] / net / systemeD / potlatch2 / StyleSelector.mxml
index 04566cdad0d7e98e1bf62308bfd3a894a64d573e..71bcfed0ff7a4ba97fb723e8c782ec4e230fd50a 100644 (file)
@@ -6,15 +6,17 @@
        
        <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}" />
+               change="Application.application.styleButton.close(); Stylesheets.instance().setStylesheet(mapStyle.selectedItem.name, mapStyle.selectedItem.url);"
+               dataProvider="{Stylesheets.instance().getCollection()}"
+               updateComplete="{mapStyle.width=mapStyle.measureWidthOfItems()+2;mapStyle.height=mapStyle.measureHeightOfItems()+2}" />
 
-       <mx:Button label="Edit..." click="new BackgroundDialog().init('Map style',mapStyle,Application.application.theController.stylesheets);" />
+       <mx:Button label="Edit..." click="new BackgroundDialog().init('Map style',mapStyle,Stylesheets.instance());" />
 
        <mx:Script><![CDATA[
                import net.systemeD.halcyon.*;
                import net.systemeD.halcyon.connection.*;
                import net.systemeD.potlatch2.*;
+               import net.systemeD.potlatch2.collections.Stylesheets;
                import mx.core.*;
     ]]></mx:Script>    
 </mx:VBox>