Merge branch 'master' into mapquest
[potlatch2.git] / net / systemeD / potlatch2 / Toolbox.mxml
index 7637c8f10b18682b5b433001f86ca5cc82c77fce..241d5f42adc75a754a3db32ee79ccdab9ac9de1a 100644 (file)
                        toolTip="{deleteToolTipText()}" 
                        width="24" height="24" />
 
-        <mx:HBox width="24" height="24" y="4" x="36" borderStyle="solid" cornerRadius="12" click="reverseClicked();" horizontalAlign="center" verticalAlign="middle">
-            <mx:ViewStack id="rotateButtonStack">
+        <mx:HBox id="reverseButton" width="24" height="24" y="4" x="36" borderStyle="solid" cornerRadius="12" 
+                         click="reverseClicked();" horizontalAlign="center" verticalAlign="middle" toolTip="Reverse direction (V)">
+            <mx:ViewStack id="rotateButtonStack" creationPolicy="all">
                 <mx:HBox id="arrowBoxWrapper"><!-- changing the viewstack back onto a rotated hbox causes positioning glitches, hence this wrapper -->
                     <!-- I can totally recommend adding borderStyle="solid" to arrowBox when debugging -->
                     <mx:HBox id="arrowBox" horizontalAlign="center" verticalAlign="middle" width="24" height="24">
                         <mx:Image id="arrow" source="@Embed('../../../embedded/arrow.svg')"
                             alpha="{getAlpha('reverseDirection')}"
-                            toolTip="Reverse direction (V)"
                             width="22" height="22"/>
                     </mx:HBox>
                 </mx:HBox>
                 <mx:HBox id="clockwiseBox" horizontalAlign="center" verticalAlign="middle">
                     <mx:Image id="clockwise" source="@Embed('../../../embedded/clockwise.svg')"
                         alpha="{getAlpha('reverseDirection')}"
-                        toolTip="Reverse direction (V)"
                         width="22" height="22" x="2" y="2"/>
                 </mx:HBox>
                 <mx:HBox id="antiClockwiseBox" horizontalAlign="center" verticalAlign="middle">
                         click='doReverseDirection();'
                         enabled="{canDo('reverseDirection')}"
                         alpha="{getAlpha('reverseDirection')}"
-                        toolTip="Reverse direction (V)"
                         width="22" height="22" x="2" y="2"/>
                 </mx:HBox>
             </mx:ViewStack>
         </mx:HBox>
                <mx:Button icon="@Embed('../../../embedded/cut.svg')" 
+                       id="splitButton"
                        click='doSplit();'
                        enabled="{canDo('split')}" 
                        alpha="{getAlpha('split')}" 
                        toolTip="Split way (X)" 
                        width="24" height="24" />
                <mx:Button icon="@Embed('../../../embedded/merge.svg')" 
+                       id="mergeButton"
                        click='doMerge();'
                        enabled="{canDo('merge')}" 
                        alpha="{getAlpha('merge')}" 
                <!-- Second row -->
 
                <mx:Button icon="@Embed('../../../embedded/straighten.svg')" 
+                       id="straightenButton"
                        click='doStraighten();' 
                        enabled="{canDo('straighten')}" 
                        alpha="{getAlpha('straighten')}" 
                        toolTip="Straighten way" 
                        width="24" height="24" />
                <mx:Button icon="@Embed('../../../embedded/circle.svg')" 
+                       id="circulariseButton"
                        click='doCircularise();' 
                        enabled="{canDo('circularise')}" 
                        alpha="{getAlpha('circularise')}" 
                        toolTip="Make circular" 
                        width="24" height="24" />
                <mx:Button icon="@Embed('../../../embedded/quadrilateralise.svg')" 
+                       id="quadrilateraliseButton"
                        click='doQuadrilateralise();' 
                        enabled="{canDo('quadrilateralise')}" 
                        alpha="{getAlpha('quadrilateralise')}" 
                        toolTip="Make right-angled (Q)" 
                        width="24" height="24" />
                <mx:Button icon="@Embed('../../../embedded/parallel.svg')" 
+                       id="parralleliseButton"
                        click='doParallelise();' 
                        enabled="{canDo('parallelise')}" 
                        alpha="{getAlpha('parallelise')}" 
         [Bindable]
         public var angle:int=0;
 
+        public var deleteNode:String = "Delete Node (Delete)";
+        public var deleteArea:String = "Delete Area (Shift+Delete)";
+        public var deleteWay:String = "Delete Way (Shift+Delete)";
+        public var deleteItem:String = "Delete Item"; // When nothing is selected
+
                public function init(controller:EditController):void {
                        this.controller=controller;
                        /* check if the toolbox was explictly turned off in a previous session */
                [Bindable(event="updateSkin")]
                private function deleteToolTipText():String {
                        var entity:Entity=controller.state.firstSelected;
-                       if (entity is Node) { return "Delete Node (Delete)"; }
-                       if (entity is Way && Way(entity).isArea()) { return "Delete Area (Shift+Delete)"; }
-                       if (entity is Way) { return "Delete Way (Shift+Delete)"; }
-                       return "Delete Item"; // When nothing is selected
+                       if (entity is Node) { return deleteNode; }
+                       if (entity is Way && Way(entity).isArea()) { return deleteArea; }
+                       if (entity is Way) { return deleteWay; }
+                       return deleteItem; // When nothing is selected
                }
 
         private function updateDirectionArrow():void {