Show the description of the feature when hovering over the feature in the CategorySel...
authorAndy Allan <gravitystorm@gmail.com>
Tue, 15 Feb 2011 12:25:15 +0000 (12:25 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Tue, 15 Feb 2011 12:25:15 +0000 (12:25 +0000)
net/systemeD/potlatch2/CategorySelector.mxml
net/systemeD/potlatch2/mapfeatures/Feature.as

index 7e802ff..fbee981 100644 (file)
@@ -18,7 +18,7 @@
                   <mx:Component>
                       <mx:VBox width="100" height="75"
                           horizontalScrollPolicy="off" verticalScrollPolicy="off"
-                          horizontalAlign="center" verticalGap="0">
+                          horizontalAlign="center" verticalGap="0" toolTip="{data.description}">
                           <mx:Image source="{data.image}" height="100%" verticalAlign="middle"/>
                           <mx:Text text="{data.name}"/>
                       </mx:VBox>
index e47ba40..007c87e 100644 (file)
@@ -107,6 +107,14 @@ package net.systemeD.potlatch2.mapfeatures {
                        return null;
         }
 
+        [Bindable(event="descriptionChanged")]
+        /** The human-readable description of the feature, or null if none. */
+        public function get description():String {
+            var desc:XMLList = _xml.description
+            if (desc.length()>0) { return desc[0]; }
+            return null;
+        }
+
         /** Returns the icon defined for the feature.
         * This uses the "image" property of the feature's icon element. If no image property is defined, returns a default "missing icon".
         */