couple of todos, and fix the toolbox
authorRichard Fairhurst <richard@systemed.net>
Thu, 17 Jun 2010 12:34:16 +0000 (12:34 +0000)
committerRichard Fairhurst <richard@systemed.net>
Thu, 17 Jun 2010 12:34:16 +0000 (12:34 +0000)
TODO.txt
net/systemeD/potlatch2/Toolbox.mxml [moved from net/systemeD/potlatch2/Toolbox.as with 52% similarity]
net/systemeD/potlatch2/controller/DrawWay.as

index e79de7e..28a8441 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -4,7 +4,6 @@ Potlatch 2: main outstanding issues
 
 == Core geometry ==
 
-* Straighten way + undo + redo looks fine in the UI, but doesn't reinsert the nodes into the way properly when saving (maybe way isn't dirty?) - can't reproduce
 * Dragging multipolygons (or constituent nodes) doesn't force redraw of all ways - need to hook something up to WAY_NODE_MOVED
 * Make parallelise properly undoable
 * Make Quadralatalawhatsit properly undoable
@@ -28,6 +27,7 @@ Potlatch 2: main outstanding issues
 
 == Tag editing ==
 
+** Roundabouts are recognised as areas, so you don't get highway types etc.
 * Dynamic reloading of stylesheet/map_features, so that you don't need to reload the full page when editing them
 * 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
 * If you have both inputSets names and buildingAddress, and name= key is filled in then the basic tab will get both, surely only name should be shown and building name should be ignored e.g. cafes. [Actually this was an issue of addr: being missing from one of them, however this may still be a problem for other overlapping inputSets]
@@ -40,6 +40,8 @@ Potlatch 2: main outstanding issues
 
 == UI ==
 
+* Escape should rewind the entity to how it was before the current ControllerState. (Record a position in the undo stack when exiting a ControllerState, and escape would rewind to that)
+* Stylesheets should be pulled from an XML file in exactly the same way as background layers
 * Potlatch 1-style "floaty warnings"
 * Custom imagery dialog fixes
 * Ctrl-clicking two areas (one inside the other) should create a multipolygon
similarity index 52%
rename from net/systemeD/potlatch2/Toolbox.as
rename to net/systemeD/potlatch2/Toolbox.mxml
index 51c1538..c086e5b 100644 (file)
@@ -1,25 +1,70 @@
-package net.systemeD.potlatch2 {
+<?xml version="1.0" encoding="utf-8"?>
+<mx:Panel
+       xmlns:mx="http://www.adobe.com/2006/mxml"
+       xmlns:potlatch2="net.systemeD.potlatch2.*"
+       height="46" width="219" 
+       headerHeight="6" headerColors="[black, gray]" 
+       borderThicknessRight="0" borderThicknessLeft="0" borderThicknessBottom="0" 
+       paddingLeft="4" paddingTop="4" layout="absolute" >
+
+               <mx:Image data="@Embed('../../../embedded/close_small.png')"
+                   includeInLayout="false" id="toolboxClose" click="toggle();" 
+                   y="-6" x="205" />
+
+        <mx:Button icon="@Embed('../../../embedded/delete.svg')"
+                       click='doDelete();' 
+                       enabled="{canDo('delete')}" 
+                       alpha="{getAlpha('delete')}" 
+                       toolTip="Delete item" 
+                       width="28" height="28" textAlign="left" y="4" x="6" paddingLeft="6" paddingRight="0" />
+        <mx:Button icon="@Embed('../../../embedded/direction.svg')" 
+            click='doReverseDirection();'
+                       enabled="{canDo('reverseDirection')}" 
+                       alpha="{getAlpha('reverseDirection')}" 
+                       toolTip="Reverse direction" 
+                       width="28" height="28" textAlign="left" y="4" x="36" paddingLeft="8" paddingRight="0" />
+        <mx:Button icon="@Embed('../../../embedded/cut.svg')" 
+               click='doSplit();'
+                       enabled="{canDo('split')}" 
+                       alpha="{getAlpha('split')}" 
+                       toolTip="Split way" 
+                       width="28" height="28" textAlign="left" y="4" x="66" paddingLeft="8" paddingRight="0" />
+        <mx:Button icon="@Embed('../../../embedded/straighten.svg')" 
+                       click='doStraighten();' 
+                       enabled="{canDo('straighten')}" 
+                       alpha="{getAlpha('straighten')}" 
+                       toolTip="Straighten way" 
+                       width="28" height="28" textAlign="left" y="4" x="96" paddingLeft="5" paddingRight="0" />
+        <mx:Button icon="@Embed('../../../embedded/circle.svg')" 
+                       click='doCircularise();' 
+                       enabled="{canDo('circularise')}" 
+                       alpha="{getAlpha('circularise')}" 
+                       toolTip="Make circular" 
+                       width="28" height="28" textAlign="left" y="4" x="126" paddingLeft="4" paddingRight="0" />
+        <mx:Button icon="@Embed('../../../embedded/quadrilateralise.svg')" 
+                       click='doQuadrilateralise();' 
+                       enabled="{canDo('quadrilateralise')}" 
+                       alpha="{getAlpha('quadrilateralise')}" 
+                       toolTip="Make right-angled" 
+                       width="28" height="28" textAlign="left" y="4" x="156" paddingLeft="6" paddingRight="0" />
+        <mx:Button icon="@Embed('../../../embedded/parallel.svg')" 
+                       click='doParallelise();' 
+                       enabled="{canDo('parallelise')}" 
+                       alpha="{getAlpha('parallelise')}" 
+                       toolTip="Create parallel way" 
+                       width="28" height="28" textAlign="left" y="4" x="186" paddingLeft="8" paddingRight="0" />
+
+       <mx:Script><![CDATA[
+
+               import flash.events.Event;
+               import flash.events.MouseEvent;
+               import net.systemeD.halcyon.connection.*;
+           import net.systemeD.potlatch2.controller.*;
+           import net.systemeD.potlatch2.tools.*;
 
-       import flash.events.Event;
-       import flash.events.MouseEvent;
-       import mx.containers.Panel;
-       import net.systemeD.halcyon.connection.*;
-    import net.systemeD.potlatch2.controller.*;
-    import net.systemeD.potlatch2.tools.*;
-
-       /*
-               Floating toolbox palette
-       */
-
-       public class Toolbox extends Panel {
-               
                private var entity:Entity;
                private var controller:EditController;
 
-               public function Toolbox(){
-                       super();
-               }
-               
                public function init(controller:EditController):void {
                        this.controller=controller;
                }
@@ -124,5 +169,7 @@ package net.systemeD.potlatch2 {
                        }
                }
 
-       }
-}
+
+    ]]>
+</mx:Script>   
+</mx:Panel>
index bbcd7f6..0ff81f7 100644 (file)
@@ -119,6 +119,7 @@ package net.systemeD.potlatch2.controller {
                        switch (event.keyCode) {
                                case 13:                                        return stopDrawing();
                                case 27:                                        return stopDrawing();
+                               case Keyboard.DELETE:           return backspaceNode(MainUndoStack.getGlobalStack().addAction);
                                case Keyboard.BACKSPACE:        return backspaceNode(MainUndoStack.getGlobalStack().addAction);
                                case 82:                                        repeatTags(selectedWay); return this;
                        }