finish things up for 4.0b3
[mandelbrot.git] / content / mandelbrot.xul
1 <?xml version="1.0"?>
2
3 <!-- ***** BEGIN LICENSE BLOCK *****
4    - Version: MPL 1.1/GPL 2.0/LGPL 2.1
5    -
6    - The contents of this file are subject to the Mozilla Public License Version
7    - 1.1 (the "License"); you may not use this file except in compliance with
8    - the License. You may obtain a copy of the License at
9    - http://www.mozilla.org/MPL/
10    -
11    - Software distributed under the License is distributed on an "AS IS" basis,
12    - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13    - for the specific language governing rights and limitations under the
14    - License.
15    -
16    - The Original Code is KaiRo.at Mandelbrot, XULRunner version.
17    -
18    - The Initial Developer of the Original Code is
19    - Robert Kaiser <kairo@kairo.at>.
20    - Portions created by the Initial Developer are Copyright (C) 2008-2011
21    - the Initial Developer. All Rights Reserved.
22    -
23    - Contributor(s):
24    -   Robert Kaiser <kairo@kairo.at>
25    -
26    - Alternatively, the contents of this file may be used under the terms of
27    - either the GNU General Public License Version 2 or later (the "GPL"), or
28    - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29    - in which case the provisions of the GPL or the LGPL are applicable instead
30    - of those above. If you wish to allow use of your version of this file only
31    - under the terms of either the GPL or the LGPL, and not to allow others to
32    - use your version of this file under the terms of the MPL, indicate your
33    - decision by deleting the provisions above and replace them with the notice
34    - and other provisions required by the LGPL or the GPL. If you do not delete
35    - the provisions above, a recipient may use your version of this file under
36    - the terms of any one of the MPL, the GPL or the LGPL.
37    -
38    - ***** END LICENSE BLOCK ***** -->
39
40 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
41 <?xml-stylesheet href="chrome://mandelbrot/skin/" type="text/css"?>
42
43 <!DOCTYPE page [
44   <!ENTITY % mandelbrotDTD SYSTEM "chrome://mandelbrot/locale/mandelbrot.dtd">
45   %mandelbrotDTD;
46 ]>
47
48 <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
49       xmlns:html="http://www.w3.org/1999/xhtml"
50       id="mandelbrot-page" title="&windowTitle;"
51       disablefastfind="true"
52       onload="Startup();">
53
54   <html:link rel="shortcut icon"
55               href="chrome://mandelbrot/skin/mandelbrotIcon16.png"/>
56
57   <script type="application/x-javascript"
58           src="chrome://mandelbrot/content/mandelbrot.js"/>
59
60   <stringbundleset id="stringbundleset">
61     <stringbundle id="mbrotBundle" src="chrome://mandelbrot/locale/mandelbrot.properties"/>
62   </stringbundleset>
63
64   <commandset id="mainCommands">
65   </commandset>
66
67   <toolbox>
68     <toolbar class="chromeclass-toolbar"
69              id="mandelbrotToolbar"
70              align="center">
71       <toolbarbutton id="fileDraw" label="&toolbarDraw.label;" oncommand="drawImage();"/>
72       <toolbarbutton id="fileSave" label="&toolbarSave.label;" oncommand="saveImage();"/>
73       <toolbarbutton id="bookmarkMenu"
74                      type="menu"
75                      class="tabbable"
76                      label="&bookmarkMenu.label;">
77         <menupopup id="menu_bookmarkPopup"
78                    onpopupshowing="updateBookmarkMenu(event.target);"
79                    oncommand="callBookmark(event.target);">
80           <menuitem id="bookmarkOverview" label="&bookmarkOverview.label;"/>
81           <menuitem id="bookmarkSave" label="&bookmarkSave.label;" oncommand="saveBookmark();"/>
82           <menuseparator id="bookmarkSeparator"/>
83         </menupopup>
84       </toolbarbutton>
85       <toolbarbutton id="imgSettings" label="&imgSettings.label;" oncommand="imgSettings();"/>
86     </toolbar>
87   </toolbox>
88   <panel id="imgSettingsPanel"
89          onpopupshowing="initImgSettings();"
90          onpopuphiding="saveImgSettings();">
91     <!-- |titlebar="normal" noautohide="true" close="true" label="&imageSettings.title;"|
92          doesn't seem to work on the panel, so work around with a <titlebar> instead -->
93     <titlebar><label value="&imageSettings.title;"/></titlebar>
94     <groupbox>
95       <caption label="&coord.title;"/>
96       <description value="&coord.real.label;" class="coord-caption"/>
97       <hbox align="center">
98         <label value="&coord.min.label;" control="is_Cr_min"/>
99         <textbox id="is_Cr_min" size="10"
100                  onchange="checkISValue(this, 'coord'); recalcCoord('Cr', 'scale');"/>
101         <label value="&coord.max.label;" control="is_Cr_max"/>
102         <textbox id="is_Cr_max" size="10"
103                  onchange="checkISValue(this, 'coord'); recalcCoord('Cr', 'scale');"/>
104         <label value="&coord.scale.label;" control="is_Cr_scale"/>
105         <textbox id="is_Cr_scale" size="10"
106                  onchange="checkISValue(this, 'coord'); recalcCoord('Cr', 'max');"/>
107       </hbox>
108       <separator class="thin"/>
109       <description value="&coord.imag.label;" class="coord-caption"/>
110       <hbox align="center">
111         <label value="&coord.min.label;" control="is_Ci_min"/>
112         <textbox id="is_Ci_min" size="10"
113                  onchange="checkISValue(this, 'coord'); recalcCoord('Ci', 'scale');"/>
114         <label value="&coord.max.label;" control="is_Ci_max"/>
115         <textbox id="is_Ci_max" size="10"
116                  onchange="checkISValue(this, 'coord'); recalcCoord('Ci', 'scale');"/>
117         <label value="&coord.scale.label;" control="is_Ci_scale"/>
118         <textbox id="is_Ci_scale" size="10"
119                  onchange="checkISValue(this, 'coord'); recalcCoord('Ci', 'max');"/>
120       </hbox>
121     </groupbox>
122
123     <hbox flex="1">
124       <groupbox>
125         <caption label="&img.size.title;"/>
126         <hbox align="center">
127           <label value="&img.width.label;" control="is_img_width"/>
128           <textbox id="is_img_width" size="4"
129                    onchange="checkISValue(this, 'dim'); recalcCoord('Ci', 'scale');"/>
130         </hbox>
131         <hbox align="center">
132           <label value="&img.height.label;" control="is_img_height"/>
133           <textbox id="is_img_height" size="4"
134                    onchange="checkISValue(this, 'dim'); recalcCoord('Cr', 'scale');"/>
135         </hbox>
136       </groupbox>
137
138       <groupbox>
139         <caption label="&preview.title;"/>
140         <hbox flex="1" pack="center" align="center">
141           <html:canvas id="is_mbrotPreview" width="50" height="50"></html:canvas>
142         </hbox>
143         <button id="is_previewButton" label="&previewDraw.label;" oncommand="drawPreview();"/>
144       </groupbox>
145
146       <groupbox>
147         <caption label="&options.title;"/>
148         <hbox>
149           <vbox>
150             <label value="&colorList.label;" control="colorList"/>
151             <menulist id="colorList">
152               <menupopup oncommand="setPalette(event.target.value);">
153                 <menuitem value="bw" label="&colorBW.label;"/>
154                 <menuitem value="kairo" label="&colorKairo.label;"/>
155                 <menuitem value="rainbow-linear1" label="&colorRBLin1.label;"/>
156                 <menuitem value="rainbow-squared1" label="&colorRBSq1.label;"/>
157                 <menuitem value="rainbow-linear2" label="&colorRBLin2.label;"/>
158                 <menuitem value="rainbow-squared2" label="&colorRBSq2.label;"/>
159               </menupopup>
160             </menulist>
161             <label value="&algoList.label;" control="algoList"/>
162             <menulist id="algoList">
163               <menupopup oncommand="setAlgorithm(event.target.value);">
164                 <menuitem value="numeric" label="&algoNumeric.label;"/>
165                 <menuitem value="oo" label="&algoOO.label;"/>
166               </menupopup>
167             </menulist>
168           </vbox>
169           <vbox>
170             <label value="&iterList.label;" control="iterList"/>
171             <menulist id="iterList">
172               <menupopup oncommand="setIter(event.target.value);">
173                 <menuitem value="50" label="&iter50.label;"/>
174                 <menuitem value="100" label="&iter100.label;"/>
175                 <menuitem value="500" label="&iter500.label;"/>
176                 <menuitem value="1000" label="&iter1000.label;"/>
177               </menupopup>
178             </menulist>
179             <hbox align="center">
180               <checkbox id="is_syncProp"
181                         label="&syncProp.label;"
182                         onclick="checkProportions();"/>
183             </hbox>
184           </vbox>
185         </hbox>
186       </groupbox>
187     </hbox>
188     <hbox>
189       <button id="is_closeButton" label="&closeSettings.label;" oncommand="closeImgSettings();"/>
190       <spacer flex="1"/>
191       <button id="is_drawButton" label="&drawImageButton.label;" oncommand="closeImgSettings(); drawImage();"/>
192     </hbox>
193   </panel>
194   <hbox flex="1" pack="center" align="center">
195     <stack>
196       <html:canvas id="mbrotImage" width="300" height="300">
197       </html:canvas>
198       <button id="drawButton" label="&buttonDraw.label;" oncommand="drawImage();"/>
199     </stack>
200   </hbox>
201   <hbox pack="end" align="end">
202     <description id="statusLabel"/>
203   </hbox>
204 </page>