how do I hate thee, Flex? let me count the ways
authorRichard Fairhurst <richard@systemed.net>
Wed, 7 Jul 2010 17:10:52 +0000 (17:10 +0000)
committerRichard Fairhurst <richard@systemed.net>
Wed, 7 Jul 2010 17:10:52 +0000 (17:10 +0000)
TODO.txt
net/systemeD/potlatch2/mapfeatures/editors/TurnRestrictionIcon.mxml
net/systemeD/potlatch2/mapfeatures/editors/TurnRestrictionRenderer.mxml

index d82ba0f..433c5c6 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -22,7 +22,7 @@ Potlatch 2: main outstanding issues
 
 == Tag editing ==
 
-** Finish turn restriction editor
+** Turn restriction editor needs to lose the scrollbars
 * initialiseEditors is quite slow (typically 150ms)
 * If a select name is too long then, the select menu seems to give a horizontal scrollbar instead of the name of the item e.g. cuisine#Coffee Shop
 * Bug where the wrong feature is used, when an item that is dragged from the list when an POI has no icon.
index 27a2c18..9603601 100755 (executable)
     import mx.collections.ArrayCollection;
        import mx.utils.ObjectProxy;
 
-       /* ** FIXME as of Wed:
-                 - 'from' and 'to' don't get populated with original values
-                 - scrollbar ugh
-                 - "warning: unable to bind to property 'data' on class 'Object' (class is not an IEventDispatcher)"
-                 - (plus general node redraw bug when you change something)
-       */
-
     private var _turn:Object;
+       [Bindable(event="turn_inited")] private var connectingWays:ArrayCollection;
     
     public function setTurnRestriction(restriction:Object):void {   
         _turn = restriction;
+
+               var ways:Array=[];
+               for each (var way:Way in Entity(_turn.entity).parentWays) {
+                       ways.push( { label:way.getDescription(), data:way } );
+               }
+               connectingWays=new ArrayCollection(ways);
+
+               dispatchEvent(new Event("turn_inited"));
     }
-    
+
        private function findSelected(role:String):Object {
                trace("calling findSelected for "+role);
                var rel:Relation=Relation(_turn.relation);
                }
                return null;
        }
-
-       private function get connectingWays():ArrayCollection {
-               trace("calling connectingWays");
-               var ways:Array=[];
-               for each (var way:Way in Entity(_turn.entity).parentWays) {
-                       ways.push( { label:way.getDescription(), data:way } );
-               }
-               return new ArrayCollection(ways);
-       }
     
        private function setMember(entity:Entity,role:String):void {
                trace("setMember "+role+" to "+entity);
index dcb07d0..50bf477 100644 (file)
@@ -3,10 +3,19 @@
        xmlns:mx="http://www.adobe.com/2006/mxml" 
        xmlns:edit="net.systemeD.potlatch2.mapfeatures.editors.*"
        width="40" height="40" maxWidth="40" maxHeight="40" minWidth="40" minHeight="40"
-       toolTip="{data.label}"
        mouseEnabled="false" mouseChildren="false">
 
-    <mx:Image x="0" y="0" source="{'features/restriction__'+data.data+'.png'}"  left="4" top="4" />
-  
+       <mx:Image x="0" y="0" id="sign" left="4" top="4" source="{dataProxied.data ? 'features/restriction__'+dataProxied.data+'.png' : ''}" toolTip="{dataProxied.label}" />
+
+  <mx:Script><![CDATA[
+
+       import mx.utils.ObjectProxy;
+
+       [Bindable(event="dataChange")] public function get dataProxied():ObjectProxy {
+               return new ObjectProxy(data);
+       }
+
+  ]]></mx:Script>
+       
 </mx:Canvas>