summaryrefslogtreecommitdiffstats
path: root/toolkit/components/printing/content/printPageSetup.xul
blob: a0c3afe174fbbbb85f8b9d3334c7782300648865 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<?xml version="1.0"?> <!-- -*- Mode: HTML -*- -->

<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://global/skin/printPageSetup.css" type="text/css"?>
<!DOCTYPE dialog SYSTEM "chrome://global/locale/printPageSetup.dtd">

<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  id="printPageSetupDialog"
  onload="onLoad();"
  ondialogaccept="return onAccept();"
  oncancel="return onCancel();"
  title="&printSetup.title;"
  persist="screenX screenY"
  screenX="24" screenY="24">

  <script type="application/javascript" src="chrome://global/content/printPageSetup.js"/>

  <!-- Localizable strings manipulated at run-time. -->
  <data id="marginUnits.inches">&marginUnits.inches;</data>
  <data id="marginUnits.metric">&marginUnits.metric;</data>
  <data id="customPrompt.title">&customPrompt.title;</data>
  <data id="customPrompt.prompt">&customPrompt.prompt;</data>

  <tabbox flex="1">
    <tabs>
      <tab label="&basic.tab;"/>
      <tab label="&advanced.tab;"/>
    </tabs>
    <tabpanels flex="1">
      <vbox>
        <groupbox>
          <caption label="&formatGroup.label;"/>
          <vbox>
            <hbox align="center">
              <label control="orientation" value="&orientation.label;"/>
              <radiogroup id="orientation" oncommand="setOrientation()">
                <hbox align="center">
                  <radio id="portrait"
                         class="portrait-page"
                         label="&portrait.label;"
                         accesskey="&portrait.accesskey;"/>
                  <radio id="landscape"
                         class="landscape-page"
                         label="&landscape.label;"
                         accesskey="&landscape.accesskey;"/>
                </hbox>
              </radiogroup>
            </hbox>
            <separator/>
            <hbox align="center">
              <label control="scalingInput"
                     value="&scale.label;"
                     accesskey="&scale.accesskey;"/>
              <textbox id="scalingInput" size="4" oninput="checkDouble(this)"/>
              <label value="&scalePercent;"/>
              <separator/>
              <checkbox id="shrinkToFit"
                        label="&shrinkToFit.label;"
                        accesskey="&shrinkToFit.accesskey;"
                        oncommand="gDialog.scalingInput.disabled=gDialog.scalingLabel.disabled=this.checked"/>
            </hbox>
          </vbox>
        </groupbox>
        <groupbox>
          <caption label="&optionsGroup.label;"/>
          <checkbox id="printBG"
                    label="&printBG.label;"
                    accesskey="&printBG.accesskey;"/>
        </groupbox>
      </vbox>
      <vbox>
        <groupbox>
          <caption id="marginGroup" label="&marginGroup.label;"/>
          <vbox>
            <hbox align="center">
              <spacer flex="1"/>
              <label control="topInput"
                     value="&marginTop.label;"
                     accesskey="&marginTop.accesskey;"/>
              <textbox id="topInput" size="5" oninput="changeMargin(this)"/>
              <!-- This invisible label (with same content as the visible one!) is used
                   to ensure that the <textbox> is centered above the page.  The same
                   technique is deployed for the bottom/left/right input fields, below. -->
              <label value="&marginTop.label;" style="visibility: hidden;"/>
              <spacer flex="1"/>
            </hbox>
            <hbox dir="ltr">
              <spacer flex="1"/>
              <vbox>
                <spacer flex="1"/>
                <label control="leftInput"
                       value="&marginLeft.label;"
                       accesskey="&marginLeft.accesskey;"/>
                <textbox id="leftInput" size="5" oninput="changeMargin(this)"/>
                <label value="&marginLeft.label;" style="visibility: hidden;"/>
                <spacer flex="1"/>
              </vbox>
              <!-- The "margin page" draws a simulated printout page with dashed lines
                   for the margins.  The height/width style attributes of the marginTop,
                   marginBottom, marginLeft, and marginRight elements are set by
                   the JS code dynamically based on the user input. -->
              <vbox id="marginPage" style="height:29.7mm;">
                <box id="marginTop" style="height:0.05in;"/>
                <hbox flex="1" dir="ltr">
                  <box id="marginLeft" style="width:0.025in;"/>
                  <box style="border: 1px; border-style: dashed; border-color: gray;" flex="1"/>
                  <box id="marginRight" style="width:0.025in;"/>
                </hbox>
                <box id="marginBottom" style="height:0.05in;"/>
              </vbox>
              <vbox>
                <spacer flex="1"/>
                <label control="rightInput"
                       value="&marginRight.label;"
                       accesskey="&marginRight.accesskey;"/>
                <textbox id="rightInput" size="5" oninput="changeMargin(this)"/>
                <label value="&marginRight.label;" style="visibility: hidden;"/>
                <spacer flex="1"/>
              </vbox>
              <spacer flex="1"/>
            </hbox>
            <hbox align="center">
              <spacer flex="1"/>
              <label control="bottomInput"
                     value="&marginBottom.label;"
                     accesskey="&marginBottom.accesskey;"/>
              <textbox id="bottomInput" size="5" oninput="changeMargin(this)"/>
              <label value="&marginBottom.label;" style="visibility: hidden;"/>
              <spacer flex="1"/>
            </hbox>
          </vbox>
        </groupbox>
        <groupbox>
          <caption id="headersAndFooters" label="&headerFooter.label;"/>
          <grid>
            <columns>
              <column/>
              <column/>
              <column/>
            </columns>
            <rows>
              <row dir="ltr">
                <menulist id="hLeftOption" oncommand="customize(this)" tooltiptext="&headerLeft.tip;">
                  <menupopup>
                    <menuitem value="0" label="&hfBlank;"/>
                    <menuitem value="1" label="&hfTitle;"/>
                    <menuitem value="2" label="&hfURL;"/>
                    <menuitem value="3" label="&hfDateAndTime;"/>
                    <menuitem value="4" label="&hfPage;"/>
                    <menuitem value="5" label="&hfPageAndTotal;"/>
                    <menuitem value="6" label="&hfCustom;"/>
                  </menupopup>
                </menulist>
                <menulist id="hCenterOption" oncommand="customize(this)" tooltiptext="&headerCenter.tip;">
                  <menupopup>
                    <menuitem value="0" label="&hfBlank;"/>
                    <menuitem value="1" label="&hfTitle;"/>
                    <menuitem value="2" label="&hfURL;"/>
                    <menuitem value="3" label="&hfDateAndTime;"/>
                    <menuitem value="4" label="&hfPage;"/>
                    <menuitem value="5" label="&hfPageAndTotal;"/>
                    <menuitem value="6" label="&hfCustom;"/>
                  </menupopup>
                </menulist>
                <menulist id="hRightOption" oncommand="customize(this)" tooltiptext="&headerRight.tip;">
                  <menupopup>
                    <menuitem value="0" label="&hfBlank;"/>
                    <menuitem value="1" label="&hfTitle;"/>
                    <menuitem value="2" label="&hfURL;"/>
                    <menuitem value="3" label="&hfDateAndTime;"/>
                    <menuitem value="4" label="&hfPage;"/>
                    <menuitem value="5" label="&hfPageAndTotal;"/>
                    <menuitem value="6" label="&hfCustom;"/>
                  </menupopup>
                </menulist>
              </row>
              <row dir="ltr">
                <vbox align="center">
                  <label value="&hfLeft.label;"/>
                </vbox>
                <vbox align="center">
                  <label value="&hfCenter.label;"/>
                </vbox>
                <vbox align="center">
                  <label value="&hfRight.label;"/>
                </vbox>
              </row>
              <row dir="ltr">
                <menulist id="fLeftOption" oncommand="customize(this)" tooltiptext="&footerLeft.tip;">
                  <menupopup>
                    <menuitem value="0" label="&hfBlank;"/>
                    <menuitem value="1" label="&hfTitle;"/>
                    <menuitem value="2" label="&hfURL;"/>
                    <menuitem value="3" label="&hfDateAndTime;"/>
                    <menuitem value="4" label="&hfPage;"/>
                    <menuitem value="5" label="&hfPageAndTotal;"/>
                    <menuitem value="6" label="&hfCustom;"/>
                  </menupopup>
                </menulist>
                <menulist id="fCenterOption" oncommand="customize(this)" tooltiptext="&footerCenter.tip;">
                  <menupopup>
                    <menuitem value="0" label="&hfBlank;"/>
                    <menuitem value="1" label="&hfTitle;"/>
                    <menuitem value="2" label="&hfURL;"/>
                    <menuitem value="3" label="&hfDateAndTime;"/>
                    <menuitem value="4" label="&hfPage;"/>
                    <menuitem value="5" label="&hfPageAndTotal;"/>
                    <menuitem value="6" label="&hfCustom;"/>
                  </menupopup>
                </menulist>
                <menulist id="fRightOption" oncommand="customize(this)" tooltiptext="&footerRight.tip;">
                  <menupopup>
                    <menuitem value="0" label="&hfBlank;"/>
                    <menuitem value="1" label="&hfTitle;"/>
                    <menuitem value="2" label="&hfURL;"/>
                    <menuitem value="3" label="&hfDateAndTime;"/>
                    <menuitem value="4" label="&hfPage;"/>
                    <menuitem value="5" label="&hfPageAndTotal;"/>
                    <menuitem value="6" label="&hfCustom;"/>
                  </menupopup>
                </menulist>
              </row>  
            </rows>
          </grid>
        </groupbox>
      </vbox>
    </tabpanels>
  </tabbox>
</dialog>