make it look purty
[potlatch2.git] / net / systemeD / potlatch2 / options / OptionsDialog.mxml
1 <?xml version="1.0" encoding="utf-8"?>
2 <mx:TitleWindow
3         xmlns:mx="http://www.adobe.com/2006/mxml" 
4         layout="vertical" showCloseButton="true"
5         horizontalAlign="center" title="Options"
6         width="350" height="250" verticalGap="0">
7   <mx:Script><![CDATA[
8     import mx.managers.PopUpManager;
9     import mx.events.CloseEvent;
10     import mx.core.Application;
11     import net.systemeD.halcyon.Globals;
12     
13     public function init():void {
14         PopUpManager.addPopUp(this, Application(Application.application), true);
15         PopUpManager.centerPopUp(this);
16         this.addEventListener(CloseEvent.CLOSE, optionsDialog_close);
17
18         var obj:SharedObject = SharedObject.getLocal("user_state");
19
20         tbcheck.selected = Application.application.toolbox.visible;
21         cursorcheck.selected = Application.application.theController.cursorsEnabled;
22         tigercheck.selected = obj.data['tiger_highlighted'];
23     }
24     
25     private function optionsDialog_close(evt:CloseEvent):void {
26         PopUpManager.removePopUp(this);
27     }
28
29     private function tigerToggle():void {
30         Globals.vars.highlightTiger = tigercheck.selected;
31         Application.application.theMap.redraw();
32
33         var obj:SharedObject = SharedObject.getLocal("user_state");
34         obj.setProperty("tiger_highlighted",tigercheck.selected);
35         obj.flush();
36     }
37
38               ]]>
39   </mx:Script>
40         <mx:CheckBox width="100%" label="Show toolbox" selected="true" id="tbcheck"
41             change="Application.application.toolbox.toggle()" />
42
43         <mx:CheckBox width="100%" label="Use custom cursors" selected="true" id="cursorcheck"
44             change="Application.application.theController.cursorsEnabled=cursorcheck.selected" />
45
46     <mx:CheckBox width="100%" label="Highlight unedited TIGER (US roads)" selected="false" id="tigercheck"
47         change="tigerToggle()" />
48
49   <mx:ControlBar>
50     <mx:Spacer width="100%"/>
51     <mx:Button label="Ok" click="PopUpManager.removePopUp(this);" styleName="titleWindowButton" />
52   </mx:ControlBar>
53
54 </mx:TitleWindow>