rudimentary help and options dialog boxes
authorAndy Allan <gravitystorm@gmail.com>
Thu, 3 Dec 2009 13:24:37 +0000 (13:24 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Thu, 3 Dec 2009 13:24:37 +0000 (13:24 +0000)
net/systemeD/potlatch2/help/HelpDialog.mxml [new file with mode: 0644]
net/systemeD/potlatch2/options/OptionsDialog.mxml [new file with mode: 0644]
potlatch2.mxml

diff --git a/net/systemeD/potlatch2/help/HelpDialog.mxml b/net/systemeD/potlatch2/help/HelpDialog.mxml
new file mode 100644 (file)
index 0000000..6e9f7d7
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:TitleWindow
+        xmlns:mx="http://www.adobe.com/2006/mxml" 
+        layout="vertical" showCloseButton="true"
+        horizontalAlign="center" title="Help"
+        width="350" height="250" verticalGap="0">
+  <mx:Script><![CDATA[
+    import mx.managers.PopUpManager;
+    import mx.events.CloseEvent;
+    import mx.core.Application;
+    
+    public function init():void {
+        PopUpManager.addPopUp(this, Application(Application.application), true);
+        PopUpManager.centerPopUp(this);
+        this.addEventListener(CloseEvent.CLOSE, helpDialog_close);
+    }
+    
+    private function helpDialog_close(evt:CloseEvent):void {
+        PopUpManager.removePopUp(this);
+    }
+
+              ]]>
+  </mx:Script>
+  <mx:Text>
+    <mx:text>
+      There is no spoon.
+    </mx:text>
+  </mx:Text>
+  <mx:ControlBar>
+    <mx:Spacer width="100%"/>
+    <mx:Button label="Exit" click="PopUpManager.removePopUp(this);"/>
+  </mx:ControlBar>
+
+</mx:TitleWindow>
\ No newline at end of file
diff --git a/net/systemeD/potlatch2/options/OptionsDialog.mxml b/net/systemeD/potlatch2/options/OptionsDialog.mxml
new file mode 100644 (file)
index 0000000..b5b6149
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:TitleWindow
+        xmlns:mx="http://www.adobe.com/2006/mxml" 
+        layout="vertical" showCloseButton="true"
+        horizontalAlign="center" title="Help"
+        width="350" height="250" verticalGap="0">
+  <mx:Script><![CDATA[
+    import mx.managers.PopUpManager;
+    import mx.events.CloseEvent;
+    import mx.core.Application;
+    
+    public function init():void {
+        PopUpManager.addPopUp(this, Application(Application.application), true);
+        PopUpManager.centerPopUp(this);
+        this.addEventListener(CloseEvent.CLOSE, optionsDialog_close);
+    }
+    
+    private function optionsDialog_close(evt:CloseEvent):void {
+        PopUpManager.removePopUp(this);
+    }
+
+              ]]>
+  </mx:Script>
+  <mx:Text>
+    <mx:text>
+      You can take the red pill, or the blue pill.
+    </mx:text>
+  </mx:Text>
+  <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:ControlBar>
+
+</mx:TitleWindow>
\ No newline at end of file
index d71d38b222c5bf223d373181d4469ca38d79da37..7218233254aa767d8938934244d2837b518c8c65 100755 (executable)
@@ -24,6 +24,8 @@
 
     <mx:ApplicationControlBar dock="true">
         <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>
     
@@ -51,6 +53,9 @@
                import net.systemeD.halcyon.connection.*;
                import net.systemeD.potlatch2.*;
                import net.systemeD.potlatch2.save.SaveManager;
+                import net.systemeD.potlatch2.help.*;
+                import net.systemeD.potlatch2.options.*;
+                import mx.managers.PopUpManager;
                import flash.system.Security;
                import flash.net.*;
                import flash.events.MouseEvent;