Fix compiler warnings
authorRichard Fairhurst <richard@systemeD.net>
Fri, 26 Aug 2011 16:44:10 +0000 (17:44 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Fri, 26 Aug 2011 16:44:10 +0000 (17:44 +0100)
net/systemeD/potlatch2/BackgroundSelector.mxml
net/systemeD/potlatch2/RelationSelectPanel.mxml
net/systemeD/potlatch2/help/HelpDialog.mxml
net/systemeD/potlatch2/save/SaveDialog.mxml
potlatch2.mxml
styles/Application.css

index cb65eb6..78d4b91 100644 (file)
@@ -11,9 +11,9 @@
                dataProvider="{Imagery.instance().getAvailableImagery()}"
                rowCount="{Imagery.instance().getAvailableImagery().length}"/>
        <mx:HBox>
-       <mx:CheckBox width="100%" label="Dim" selected="{FlexGlobals.topLevelApplication.theMap.getDimming()}" id="dim"
+       <mx:CheckBox width="100%" label="Dim" selected="{application.theMap.getDimming()}" id="dim"
            change="setDimming(dim.selected)" />
-       <mx:CheckBox width="100%" label="Sharpen" selected="{FlexGlobals.topLevelApplication.theMap.getSharpen()}" id="sharpen"
+       <mx:CheckBox width="100%" label="Sharpen" selected="{application.theMap.getSharpen()}" id="sharpen"
            change="setSharpen(sharpen.selected)" />
        </mx:HBox>
 
@@ -32,6 +32,8 @@
                import mx.collections.ArrayCollection;
                import mx.managers.PopUpManager;
 
+               [Bindable] private var application:Object = FlexGlobals.topLevelApplication;
+
                public function setDimming(v:Boolean):void {
                        FlexGlobals.topLevelApplication.theMap.setDimming(dim.selected);
                        FlexGlobals.topLevelApplication.yahoo.alpha = dim.selected ? 0.5 : 1;
index e626f4f..00b0bd1 100644 (file)
                        panel.setEntity(entity);
                        PopUpManager.centerPopUp(panel);
                }
+               
+               public function updateSelectButton():void {
+                       selectButton.enabled=relationSelector.selectedItems.length>0;
+               }
         
     ]]></fx:Script>
     <mx:Text id="warning" text="" />
-    <mx:List width="100%" height="100%" id="relationSelector" verticalScrollPolicy="on" allowMultipleSelection="true" > 
+    <mx:List width="100%" height="100%" id="relationSelector" change="updateSelectButton();" verticalScrollPolicy="on" allowMultipleSelection="true" > 
     </mx:List>
     <mx:ControlBar>
       <mx:Button label="New Relation..." click="closeAndNewRelation();" styleName="titleWindowButton" />
       <mx:Button label="Load Relation..." click="closeAndLoadRelation();" styleName="titleWindowButton" />
       <mx:Spacer width="100%"/>
-      <mx:Button label="Select" click="updateEntityAndClose();" enabled="{relationSelector.selectedItems.length>0}" styleName="titleWindowButton" />
+      <mx:Button label="Select" id="selectButton" click="updateEntityAndClose();" enabled="false" styleName="titleWindowButton" />
     </mx:ControlBar>
 </mx:TitleWindow>
index 91437be..f9abf0f 100644 (file)
     import mx.core.Application;
     import mx.core.FlexGlobals;
 
+       [Bindable] private var application:Object = FlexGlobals.topLevelApplication;
+
     /** Pops up a multi-tabbed help window in the middle of the screen, then remembers that the user has seen it. */
     public function init():void {
-        PopUpManager.addPopUp(this, Application(FlexGlobals.topLevelApplication), true);
+        PopUpManager.addPopUp(this, Application(application), true);
         PopUpManager.centerPopUp(this);
         this.addEventListener(CloseEvent.CLOSE, helpDialog_close);
 
   </mx:TabNavigator>
 
   <mx:ControlBar>
-    <mx:Label text="Version: {FlexGlobals.topLevelApplication.version} Build: {FlexGlobals.topLevelApplication.build_number}" />
+    <mx:Label text="Version: {application.version} Build: {application.build_number}" />
     <mx:Spacer width="100%"/>
     <mx:Button label="Ok" click="PopUpManager.removePopUp(this);" styleName="titleWindowButton" />
   </mx:ControlBar>
index c0849a5..510d01f 100644 (file)
@@ -9,8 +9,8 @@
   <fx:Declarations>
   <mx:ArrayCollection id="changesetTags">
     <fx:Object k="created_by" v="Potlatch 2"/>
-    <fx:Object k="version" v="{FlexGlobals.topLevelApplication.version}"/>
-    <fx:Object k="build" v="{FlexGlobals.topLevelApplication.build_number}"/>
+    <fx:Object k="version" v="{application.version}"/>
+    <fx:Object k="build" v="{application.build_number}"/>
   </mx:ArrayCollection>
   </fx:Declarations>
   
@@ -95,8 +95,8 @@
     private var _connection:Connection;
        private var doSkip:Boolean = false;
     
-    [Bindable]
-    private var failureText:String = "";
+    [Bindable] private var failureText:String = "";
+       [Bindable] private var application:Object = FlexGlobals.topLevelApplication;
 
        public function setConnection(connection:Connection):void {
                _connection=connection;
index 09c9861..fbf7aee 100644 (file)
@@ -32,7 +32,7 @@
         <mx:WipeRight id="wipeIn" duration="250"/>
     </fx:Declarations>
 
-    <mx:ApplicationControlBar dock="true">
+    <mx:ApplicationControlBar id="controlbar" dock="true">
         <mx:PopUpButton id="bgButton" label="Background" openAlways="true" styleName="appBarButton"
             creationComplete="bgButton.popUp = new BackgroundSelector();"/>
         <mx:PopUpButton id="styleButton" label="Map Style" openAlways="true" styleName="appBarButton"
                }
                
                private function continueInit(r:Event):void {
+                       controlbar.setStyle('dropShadowEnabled',"false");       // Flex 4 doesn't permit this in Application.css
+
                        // Set font
                        var FontLibrary:Class = r.target.applicationDomain.getDefinition("FontLibrary") as Class;
                        Font.registerFont(FontLibrary.DejaVu);
index b61730b..097833f 100644 (file)
@@ -90,8 +90,8 @@ mx|ApplicationControlBar {
        fillAlphas: 1,1;
        fillColors: haloBlue, #6495ED;
        /*fillColors: #ffffcc, #ffff99;*/
-       backgroundColor: #ffffcc;
-       dropShadowEnabled: false;
+       /*backgroundColor: #ffffcc;*/
+       /*dropShadowEnabled: false;*/
        /*borderSkin: ClassReference("mx.skins.halo.ApplicationBackground");*/
 }