fun with tooltips
authorRichard Fairhurst <richard@systemed.net>
Fri, 11 Jun 2010 15:51:16 +0000 (15:51 +0000)
committerRichard Fairhurst <richard@systemed.net>
Fri, 11 Jun 2010 15:51:16 +0000 (15:51 +0000)
net/systemeD/potlatch2/TagViewer.mxml
net/systemeD/potlatch2/Toolbox.as
net/systemeD/potlatch2/mapfeatures/Feature.as
potlatch2.mxml

index f0b8b8d..99c78ef 100644 (file)
@@ -32,7 +32,7 @@
                   DragManager.doDrag(dragInitiator, dragSource, event, dragProxy);
               }
             ]]></mx:Script>
-            <mx:Image id="foo" source="{data.image}" height="25" width="25" mouseMove="dragPOI(event, data.tags)"/>
+            <mx:Image id="foo" source="{data.image}" height="25" width="25" mouseMove="dragPOI(event, data.tags)" toolTip="{data.name}" />
           </mx:VBox>
         </mx:Component>
       </mx:itemRenderer>
index d3c7e37..3b0e3ce 100644 (file)
@@ -12,9 +12,7 @@ package net.systemeD.potlatch2 {
 
                Still to do:
                ** Should have close and minimise boxes, and be able to be activated from the top bar
-               ** Should be automatically positioned at bottom-right of canvas on init
                ** Remove annoying Illustrator cruft from SVG icons!
-               ** Tooltips
 
        */
 
index 77fa3bb..f4dce50 100644 (file)
@@ -121,8 +121,8 @@ package net.systemeD.potlatch2.mapfeatures {
             var newStr:String = str.replace(/&/g, "&amp;");
             newStr = newStr.replace(/</g, "&lt;");
             newStr = newStr.replace(/>/g, "&gt;");
-            newStr = newStr.replace(/"/g, "&quot;");
-            newStr = newStr.replace(/'/g, "&apos;");
+            newStr = newStr.replace(/"/g, "&quot;");   // "
+            newStr = newStr.replace(/'/g, "&apos;");   // '
             return newStr;
         }
       
index 8395adb..dbba055 100755 (executable)
             enabled="false" borderThickness="0"
             showEffect="{wipeIn}" hideEffect="{wipeOut}"/>
 
+    </mx:Canvas>
+
                <potlatch2:Toolbox id="toolbox" 
                        height="46" width="253" 
                        headerHeight="6" headerColors="[black, gray]" 
                        borderThicknessRight="0" borderThicknessLeft="0" borderThicknessBottom="0" 
                        paddingLeft="4" paddingTop="4" layout="horizontal"
-                       includeInLayout="false" 
-                       x="10" y="300">
+                       includeInLayout="false" >
 
                <mx:Button icon="@Embed('embedded/delete.svg')"
                                click='toolbox.doDelete();' 
                                enabled="{toolbox.canDo('delete')}" 
                                alpha="{toolbox.getAlpha('delete')}" 
+                               toolTip="Delete item" 
                                width="28" height="28" textAlign="left" paddingLeft="6" paddingRight="0" />
                <mx:Button icon="@Embed('embedded/direction.svg')" 
                 click='toolbox.doReverseDirection();'
                                enabled="{toolbox.canDo('reverseDirection')}" 
                                alpha="{toolbox.getAlpha('reverseDirection')}" 
+                               toolTip="Reverse direction" 
                                width="28" height="28" textAlign="left" paddingLeft="8" paddingRight="0" />
                <mx:Button icon="@Embed('embedded/cut.svg')" 
                 click='toolbox.doSplit();'
                                enabled="{toolbox.canDo('split')}" 
                                alpha="{toolbox.getAlpha('split')}" 
+                               toolTip="Split way" 
                                width="28" height="28" textAlign="left" paddingLeft="8" paddingRight="0" />
                <mx:Button icon="@Embed('embedded/straighten.svg')" 
                                click='toolbox.doStraighten();' 
                                enabled="{toolbox.canDo('straighten')}" 
                                alpha="{toolbox.getAlpha('straighten')}" 
+                               toolTip="Straighten way" 
                                width="28" height="28" textAlign="left" paddingLeft="5" paddingRight="0" />
                <mx:Button icon="@Embed('embedded/circle.svg')" 
                                click='toolbox.doCircularise();' 
                                enabled="{toolbox.canDo('circularise')}" 
                                alpha="{toolbox.getAlpha('circularise')}" 
+                               toolTip="Make circular" 
                                width="28" height="28" textAlign="left" paddingLeft="4" paddingRight="0" />
                <mx:Button icon="@Embed('embedded/quadrilateralise.svg')" 
                                click='toolbox.doQuadrilateralise();' 
                                enabled="{toolbox.canDo('quadrilateralise')}" 
                                alpha="{toolbox.getAlpha('quadrilateralise')}" 
+                               toolTip="Make right-angled" 
                                width="28" height="28" textAlign="left" paddingLeft="6" paddingRight="0" />
                <mx:Button icon="@Embed('embedded/parallel.svg')" 
                                click='toolbox.doParallelise();' 
                                enabled="{toolbox.canDo('parallelise')}" 
                                alpha="{toolbox.getAlpha('parallelise')}" 
+                               toolTip="Create parallel way" 
                                width="28" height="28" textAlign="left" paddingLeft="8" paddingRight="0" />
 
                </potlatch2:Toolbox>
 
-    </mx:Canvas>
-
     </mx:HDividedBox>
 
        <mx:Script><![CDATA[
                loader.addEventListener(Event.COMPLETE, onImageryLoad);
                loader.load(request);
 
+                       // position toolbox
+                       toolbox.x=stage.stageWidth-275;
+                       toolbox.y=stage.stageHeight-100;
+
                        // add debug field
                        var t:TextField=new TextField();
                        t.width=500; t.height=150; t.border=true;
             conn.addEventListener(Connection.SAVE_STARTED, onDataStart);
             conn.addEventListener(Connection.SAVE_COMPLETED, onDataComplete);
                }
-
+               
         public function onResizeMap():void {
             if ( theMap != null )
                 theMap.updateSize(map_area.width, map_area.height);