we have an option!
authorRichard Fairhurst <richard@systemed.net>
Fri, 11 Jun 2010 17:11:52 +0000 (17:11 +0000)
committerRichard Fairhurst <richard@systemed.net>
Fri, 11 Jun 2010 17:11:52 +0000 (17:11 +0000)
TODO.txt
embedded/close_small.png [new file with mode: 0644]
net/systemeD/potlatch2/Toolbox.as
net/systemeD/potlatch2/help/HelpDialog.mxml
net/systemeD/potlatch2/options/OptionsDialog.mxml
potlatch2.mxml

index f9b27e6..ca549ab 100644 (file)
--- a/TODO.txt
+++ b/TODO.txt
@@ -44,7 +44,6 @@ Potlatch 2: main outstanding issues
 == UI ==
 
 ** Potlatch 1-style "floaty warnings"
-** Toolbox fixes (see comments in file)
 ** Should remember which background imagery layer you had previously selected
 ** Dialog for adding custom imagery url
 * B keypress for background source tag
diff --git a/embedded/close_small.png b/embedded/close_small.png
new file mode 100644 (file)
index 0000000..42c9c8f
Binary files /dev/null and b/embedded/close_small.png differ
index 3b0e3ce..51c1538 100644 (file)
@@ -9,11 +9,6 @@ package net.systemeD.potlatch2 {
 
        /*
                Floating toolbox palette
-
-               Still to do:
-               ** Should have close and minimise boxes, and be able to be activated from the top bar
-               ** Remove annoying Illustrator cruft from SVG icons!
-
        */
 
        public class Toolbox extends Panel {
@@ -49,6 +44,10 @@ package net.systemeD.potlatch2 {
                        this.stopDrag();
                }
                
+               public function toggle():void {
+                       this.visible=!this.visible;
+               }
+               
                // --------------------------------------------------------------------------------
                // Enable/disable toolbox buttons
                // (ideally we'd use CSS to set alpha in disabled state, but Flex's CSS
index 2958b3a..a9d590f 100644 (file)
@@ -30,7 +30,7 @@ For Potlatch 2 help, see the <u><a href="http://wiki.openstreetmap.org/wiki/Potl
   </mx:Text>
   <mx:ControlBar>
     <mx:Spacer width="100%"/>
-    <mx:Button label="Exit" click="PopUpManager.removePopUp(this);"/>
+    <mx:Button label="Ok" click="PopUpManager.removePopUp(this);"/>
   </mx:ControlBar>
 
 </mx:TitleWindow>
\ No newline at end of file
index b5b6149..1caba57 100644 (file)
@@ -2,7 +2,7 @@
 <mx:TitleWindow
         xmlns:mx="http://www.adobe.com/2006/mxml" 
         layout="vertical" showCloseButton="true"
-        horizontalAlign="center" title="Help"
+        horizontalAlign="center" title="Options"
         width="350" height="250" verticalGap="0">
   <mx:Script><![CDATA[
     import mx.managers.PopUpManager;
@@ -13,6 +13,7 @@
         PopUpManager.addPopUp(this, Application(Application.application), true);
         PopUpManager.centerPopUp(this);
         this.addEventListener(CloseEvent.CLOSE, optionsDialog_close);
+               tbcheck.selected=Application.application.toolbox.visible;
     }
     
     private function optionsDialog_close(evt:CloseEvent):void {
 
               ]]>
   </mx:Script>
-  <mx:Text>
-    <mx:text>
-      You can take the red pill, or the blue pill.
-    </mx:text>
-  </mx:Text>
+       <mx:CheckBox width="100%" label="Show toolbox" selected="true" id="tbcheck"
+           change="Application.application.toolbox.toggle()" />
+
   <mx:ControlBar>
     <mx:Spacer width="100%"/>
-    <mx:Button label="Red Pill" click="PopUpManager.removePopUp(this);"/>
-    <mx:Button label="Blue Pill" click="PopUpManager.removePopUp(this);"/>
+    <mx:Button label="Ok" click="PopUpManager.removePopUp(this);"/>
   </mx:ControlBar>
 
 </mx:TitleWindow>
\ No newline at end of file
index 03f06ec..79e0cee 100755 (executable)
@@ -34,6 +34,7 @@
             enabled="{MainUndoStack.getGlobalStack().canRedo()}"/>
         <mx:Spacer width="100%"/>
         <mx:Button label="Help" click="new HelpDialog().init();" />
+        <mx:Button label="Options" click="new OptionsDialog().init();" /> 
         <mx:Button label="Save" icon="@Embed('embedded/save.svg')" click="SaveManager.saveChanges();"/>
     </mx:ApplicationControlBar>
     
                        headerHeight="6" headerColors="[black, gray]" 
                        borderThicknessRight="0" borderThicknessLeft="0" borderThicknessBottom="0" 
                        paddingLeft="4" paddingTop="4" layout="horizontal"
-                       includeInLayout="false" >
+                       includeInLayout="false" 
+                       creationComplete="toolboxClose.y=-6; toolboxClose.x=239;">
+
+                       <mx:Image data="@Embed('embedded/close_small.png')"
+                           includeInLayout="false" id="toolboxClose" click="toolbox.toggle();" />
 
                <mx:Button icon="@Embed('embedded/delete.svg')"
                                click='toolbox.doDelete();'