custom imagery dialogue
[potlatch2.git] / net / systemeD / potlatch2 / BackgroundSelector.mxml
1 <?xml version="1.0" encoding="utf-8"?>
2 <mx:VBox
3         xmlns:mx="http://www.adobe.com/2006/mxml"
4         paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10"
5         horizontalAlign="left" backgroundColor="white" borderStyle="inset">
6         
7         <mx:List width="100%" height="100%" id="background" change="updateBackground();" verticalScrollPolicy="on" 
8                  dataProvider="{Application.application.theController.imagery}" />
9         <mx:CheckBox width="100%" label="Dim background" selected="true" id="dim"
10             change="Globals.vars.root.tileset.setDimming(dim.selected); Globals.vars.yahoo.alpha = dim.selected ? 0.5 : 1" />
11
12         <mx:HBox>
13         <mx:Button label="Edit..." click="new BackgroundDialog().init(background);" />
14         <mx:Button label="Vector file" click="new VectorSourceDialog().init();" />
15         </mx:HBox>
16
17         <mx:Script><![CDATA[
18                 import net.systemeD.halcyon.*;
19                 import net.systemeD.halcyon.connection.*;
20                 import net.systemeD.potlatch2.*;
21                 import mx.core.*;
22                 import mx.collections.ArrayCollection;
23                 import mx.managers.PopUpManager;
24                 import net.systemeD.halcyon.Globals;
25
26                 private function updateBackground():void {
27             var theMap:Map = Globals.vars.root;
28                         var bg:String=background.selectedItem.data;
29                         if (bg=='yahoo') {
30                                 theMap.tileset.init('',false);
31                                 Globals.vars.yahoo.show();
32                         } else {
33                                 theMap.tileset.init(background.selectedItem.data,true);
34                                 Globals.vars.yahoo.hide();
35                         }
36                 }
37
38     ]]></mx:Script>     
39 </mx:VBox>
40