Bug 113727; improved UI for Page Setup dialog; r=sgehani, sr=blake, a=asa/drivers

This commit is contained in:
law%netscape.com 2002-03-01 00:51:47 +00:00
Родитель ae0aaa7f30
Коммит 76a54876d6
22 изменённых файлов: 1247 добавлений и 500 удалений

Двоичные данные
themes/classic/communicator/icons/pg-landscape-small.gif Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 151 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 151 B

После

Ширина:  |  Высота:  |  Размер: 311 B

Двоичные данные
themes/classic/communicator/icons/pg-portrait-small.gif Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 152 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 152 B

После

Ширина:  |  Высота:  |  Размер: 318 B

Просмотреть файл

@ -0,0 +1,87 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Print Preview Toolbar.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corp.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Samir Gehani <sgehani@netscape.com>
* Bill Law <law@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* ::::: print preview toolbar ::::: */
/* ..... page navigation ..... */
.home-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-lft-sharp-end.gif");
}
.end-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-rit-sharp-end.gif");
}
.last-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-lft-sharp.gif");
}
.next-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-rit-sharp.gif");
}
/* ...... scale in/decrement ..... */
.up-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-up-sharp.gif");
}
.down-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-dn-sharp.gif");
}
/* ..... orientation ..... */
.toolbar-portrait-page {
list-style-image: url("chrome://communicator/skin/icons/pg-portrait-small.gif");
}
.toolbar-landscape-page {
list-style-image: url("chrome://communicator/skin/icons/pg-landscape-small.gif");
}
/* ::::: page setup dialog ::::: */
.portrait-page {
list-style-image: url("chrome://communicator/skin/icons/pg-portrait.gif");
}
.landscape-page {
list-style-image: url("chrome://communicator/skin/icons/pg-landscape.gif");
}

Просмотреть файл

@ -0,0 +1,87 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Print Preview Toolbar.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corp.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Samir Gehani <sgehani@netscape.com>
* Bill Law <law@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* ::::: print preview toolbar ::::: */
/* ..... page navigation ..... */
.home-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-lft-sharp-end.gif");
}
.end-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-rit-sharp-end.gif");
}
.last-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-lft-sharp.gif");
}
.next-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-rit-sharp.gif");
}
/* ...... scale in/decrement ..... */
.up-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-up-sharp.gif");
}
.down-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-dn-sharp.gif");
}
/* ..... orientation ..... */
.toolbar-portrait-page {
list-style-image: url("chrome://communicator/skin/icons/pg-portrait-small.gif");
}
.toolbar-landscape-page {
list-style-image: url("chrome://communicator/skin/icons/pg-landscape-small.gif");
}
/* ::::: page setup dialog ::::: */
.portrait-page {
list-style-image: url("chrome://communicator/skin/icons/pg-portrait.gif");
}
.landscape-page {
list-style-image: url("chrome://communicator/skin/icons/pg-landscape.gif");
}

Просмотреть файл

@ -5,6 +5,7 @@ classic.jar:
skin/classic/communicator/brand.css (communicator/brand.css)
skin/classic/communicator/securityOverlay.css (communicator/securityOverlay.css)
skin/classic/communicator/dialogs.css (communicator/dialogs.css)
skin/classic/communicator/printing.css (communicator/printing.css)
skin/classic/communicator/communicator.css (communicator/communicator.css)
skin/classic/communicator/formatting.css (communicator/formatting.css)
skin/classic/communicator/prefpanels.css (communicator/prefpanels.css)
@ -58,7 +59,9 @@ classic.jar:
skin/classic/communicator/icons/offline.gif (communicator/icons/offline.gif)
skin/classic/communicator/icons/online.gif (communicator/icons/online.gif)
skin/classic/communicator/icons/pg-landscape.gif (communicator/icons/pg-landscape.gif)
skin/classic/communicator/icons/pg-landscape-small.gif (communicator/icons/pg-landscape-small.gif)
skin/classic/communicator/icons/pg-portrait.gif (communicator/icons/pg-portrait.gif)
skin/classic/communicator/icons/pg-portrait-small.gif (communicator/icons/pg-portrait-small.gif)
skin/classic/communicator/icons/content-large.gif (communicator/icons/content-large.gif)
skin/classic/communicator/icons/content-small.gif (communicator/icons/content-small.gif)
skin/classic/communicator/icons/search-act.gif (communicator/icons/search-act.gif)

Двоичные данные
themes/modern/communicator/icons/pg-landscape-small.gif Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 151 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 151 B

После

Ширина:  |  Высота:  |  Размер: 311 B

Двоичные данные
themes/modern/communicator/icons/pg-portrait-small.gif Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 152 B

Двоичные данные
themes/modern/communicator/icons/pg-portrait.gif

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 152 B

После

Ширина:  |  Высота:  |  Размер: 318 B

Просмотреть файл

@ -0,0 +1,87 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Print Preview Toolbar.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corp.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Samir Gehani <sgehani@netscape.com>
* Bill Law <law@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* ::::: print preview toolbar ::::: */
/* ..... page navigation ..... */
.home-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-lft-sharp-end.gif");
}
.end-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-rit-sharp-end.gif");
}
.last-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-lft-sharp.gif");
}
.next-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-rit-sharp.gif");
}
/* ...... scale in/decrement ..... */
.up-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-up-sharp.gif");
}
.down-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-dn-sharp.gif");
}
/* ..... orientation ..... */
.toolbar-portrait-page {
list-style-image: url("chrome://communicator/skin/icons/pg-portrait-small.gif");
}
.toolbar-landscape-page {
list-style-image: url("chrome://communicator/skin/icons/pg-landscape-small.gif");
}
/* ::::: page setup dialog ::::: */
.portrait-page {
list-style-image: url("chrome://communicator/skin/icons/pg-portrait.gif");
}
.landscape-page {
list-style-image: url("chrome://communicator/skin/icons/pg-landscape.gif");
}

Просмотреть файл

@ -0,0 +1,87 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Mozilla Print Preview Toolbar.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corp.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Samir Gehani <sgehani@netscape.com>
* Bill Law <law@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* ::::: print preview toolbar ::::: */
/* ..... page navigation ..... */
.home-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-lft-sharp-end.gif");
}
.end-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-rit-sharp-end.gif");
}
.last-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-lft-sharp.gif");
}
.next-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-rit-sharp.gif");
}
/* ...... scale in/decrement ..... */
.up-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-up-sharp.gif");
}
.down-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-dn-sharp.gif");
}
/* ..... orientation ..... */
.toolbar-portrait-page {
list-style-image: url("chrome://communicator/skin/icons/pg-portrait-small.gif");
}
.toolbar-landscape-page {
list-style-image: url("chrome://communicator/skin/icons/pg-landscape-small.gif");
}
/* ::::: page setup dialog ::::: */
.portrait-page {
list-style-image: url("chrome://communicator/skin/icons/pg-portrait.gif");
}
.landscape-page {
list-style-image: url("chrome://communicator/skin/icons/pg-landscape.gif");
}

Просмотреть файл

@ -8,6 +8,7 @@ modern.jar:
skin/modern/communicator/button.css (communicator/button.css)
skin/modern/communicator/toolbar.css (communicator/toolbar.css)
skin/modern/communicator/dialogs.css (communicator/dialogs.css)
skin/modern/communicator/printing.css (communicator/printing.css)
skin/modern/communicator/communicator.css (communicator/communicator.css)
skin/modern/communicator/bookmarks/bookmark-folder-closed.gif (communicator/bookmarks/bookmark-folder-closed.gif)
skin/modern/communicator/bookmarks/bookmark-folder-dis.gif (communicator/bookmarks/bookmark-folder-dis.gif)
@ -36,7 +37,9 @@ modern.jar:
skin/modern/communicator/icons/offline.gif (communicator/icons/offline.gif)
skin/modern/communicator/icons/online.gif (communicator/icons/online.gif)
skin/modern/communicator/icons/pg-landscape.gif (communicator/icons/pg-landscape.gif)
skin/modern/communicator/icons/pg-landscape-small.gif (communicator/icons/pg-landscape-small.gif)
skin/modern/communicator/icons/pg-portrait.gif (communicator/icons/pg-portrait.gif)
skin/modern/communicator/icons/pg-portrait-small.gif (communicator/icons/pg-portrait-small.gif)
skin/modern/communicator/icons/turbo-systray.gif (communicator/icons/turbo-systray.gif)
skin/modern/communicator/icons/btn1.gif (communicator/icons/btn1.gif)
skin/modern/communicator/icons/search.gif (communicator/icons/search.gif)

Просмотреть файл

@ -42,41 +42,3 @@
toolbar[printpreview="true"] {
-moz-binding: url("chrome://communicator/content/printPreviewBindings.xml#printpreviewtoolbar");
}
/* ..... page navigation ..... */
.home-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-lft-sharp-end.gif");
}
.end-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-rit-sharp-end.gif");
}
.last-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-lft-sharp.gif");
}
.next-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-rit-sharp.gif");
}
/* ...... scale in/decrement ..... */
.up-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-up-sharp.gif");
}
.down-arrow {
list-style-image: url("chrome://global/skin/arrow/arrow-dn-sharp.gif");
}
/* ..... orientation ..... */
.portrait-page {
list-style-image: url("chrome://communicator/skin/icons/pg-portrait.gif");
}
.landscape-page {
list-style-image: url("chrome://communicator/skin/icons/pg-landscape.gif");
}

Просмотреть файл

@ -51,28 +51,45 @@ function initDialog()
gDialog = new Object;
gDialog.orientation = document.getElementById("orientation");
gDialog.printBGColors = document.getElementById("printBGColors");
gDialog.printBGImages = document.getElementById("printBGImages");
gDialog.portrait = document.getElementById("portrait");
gDialog.landscape = document.getElementById("landscape");
gDialog.printBG = document.getElementById("printBG");
gDialog.shrinkToFit = document.getElementById("shrinkToFit");
gDialog.marginGroup = document.getElementById("marginGroup");
gDialog.marginPage = document.getElementById("marginPage");
gDialog.marginTop = document.getElementById("marginTop");
gDialog.marginBottom = document.getElementById("marginBottom");
gDialog.marginLeft = document.getElementById("marginLeft");
gDialog.marginRight = document.getElementById("marginRight");
gDialog.topInput = document.getElementById("topInput");
gDialog.bottomInput = document.getElementById("bottomInput");
gDialog.leftInput = document.getElementById("leftInput");
gDialog.rightInput = document.getElementById("rightInput");
gDialog.hLeftInput = document.getElementById("hLeftInput");
gDialog.hCenterInput = document.getElementById("hCenterInput");
gDialog.hRightInput = document.getElementById("hRightInput");
gDialog.hLeftOption = document.getElementById("hLeftOption");
gDialog.hCenterOption = document.getElementById("hCenterOption");
gDialog.hRightOption = document.getElementById("hRightOption");
gDialog.fLeftInput = document.getElementById("fLeftInput");
gDialog.fCenterInput = document.getElementById("fCenterInput");
gDialog.fRightInput = document.getElementById("fRightInput");
gDialog.fLeftOption = document.getElementById("fLeftOption");
gDialog.fCenterOption = document.getElementById("fCenterOption");
gDialog.fRightOption = document.getElementById("fRightOption");
gDialog.scalingLabel = document.getElementById("scalingInput");
gDialog.scalingInput = document.getElementById("scalingInput");
gDialog.enabled = false;
gDialog.strings = new Array;
gDialog.strings[ "marginUnits.inches" ] = document.getElementById("marginUnits.inches").childNodes[0].nodeValue;
gDialog.strings[ "marginUnits.metric" ] = document.getElementById("marginUnits.metric").childNodes[0].nodeValue;
gDialog.strings[ "customPrompt.title" ] = document.getElementById("customPrompt.title").childNodes[0].nodeValue;
gDialog.strings[ "customPrompt.prompt" ] = document.getElementById("customPrompt.prompt").childNodes[0].nodeValue;
}
//---------------------------------------------------
@ -86,6 +103,108 @@ function checkDouble(element)
}
}
// Theoretical paper width/height.
var gPageWidth = 8.5;
var gPageHeight = 11.0;
//---------------------------------------------------
function setOrientation()
{
var selection = gDialog.orientation.selectedItem;
var style = "background-color:white;";
if ((selection == gDialog.portrait && gPageWidth > gPageHeight) ||
(selection == gDialog.landscape && gPageWidth < gPageHeight)) {
// Swap width/height.
var temp = gPageHeight;
gPageHeight = gPageWidth;
gPageWidth = temp;
}
style += "width:" + gPageWidth/10 + unitString() + ";height:" + gPageHeight/10 + unitString() + ";";
gDialog.marginPage.setAttribute( "style", style );
}
//---------------------------------------------------
function unitString()
{
return (gPrintSettings.paperSizeUnit == gPrintSettingsInterface.kPaperSizeInches) ? "in" : "mm";
}
//---------------------------------------------------
function checkMargin( value, max, other )
{
// Don't draw this margin bigger than permitted.
return Math.min(value, max - other.value);
}
//---------------------------------------------------
function changeMargin( node )
{
// Correct invalid input.
checkDouble(node);
// Reset the margin height/width for this node.
var val = node.value;
var nodeToStyle;
var attr="width";
if ( node == gDialog.topInput ) {
nodeToStyle = gDialog.marginTop;
val = checkMargin( val, gPageHeight, gDialog.bottomInput );
attr = "height";
} else if ( node == gDialog.bottomInput ) {
nodeToStyle = gDialog.marginBottom;
val = checkMargin( val, gPageHeight, gDialog.topInput );
attr = "height";
} else if ( node == gDialog.leftInput ) {
nodeToStyle = gDialog.marginLeft;
val = checkMargin( val, gPageWidth, gDialog.rightInput );
} else {
nodeToStyle = gDialog.marginRight;
val = checkMargin( val, gPageWidth, gDialog.leftInput );
}
var style = attr + ":" + val/10 + unitString() + ";";
nodeToStyle.setAttribute( "style", style );
}
//---------------------------------------------------
function changeMargins()
{
changeMargin( gDialog.topInput );
changeMargin( gDialog.bottomInput );
changeMargin( gDialog.leftInput );
changeMargin( gDialog.rightInput );
}
//---------------------------------------------------
function customize( node )
{
// If selection is now "Custom..." then prompt user for custom setting.
if ( node.value == 6 ) {
var prompter = Components.classes[ "@mozilla.org/embedcomp/prompt-service;1" ]
.getService( Components.interfaces.nsIPromptService );
var title = gDialog.strings[ "customPrompt.title" ];
var promptText = gDialog.strings[ "customPrompt.prompt" ];
var result = { value: node.custom };
var ok = prompter.prompt(window, title, promptText, result, null, { value: false } );
if ( ok ) {
node.custom = result.value;
}
}
}
//---------------------------------------------------
function setHeaderFooter( node, value )
{
node.value= hfValueToId(value);
if (node.value == 6) {
// Remember current Custom... value.
node.custom = value;
} else {
// Start with empty Custom... value.
node.custom = "";
}
}
//---------------------------------------------------
function getDoubleStr(val, dec)
{
@ -94,16 +213,51 @@ function getDoubleStr(val, dec)
return str.substring(0, inx+dec+1);
}
//---------------------------------------------------
function doEnableScaling(value)
var gHFValues = new Array;
gHFValues[ "&T" ] = 1;
gHFValues[ "&U" ] = 2;
gHFValues[ "&D" ] = 3;
gHFValues[ "&P" ] = 4;
gHFValues[ "&PT" ] = 5;
function hfValueToId(val)
{
if (value) {
gDialog.scalingLabel.removeAttribute("disabled");
gDialog.scalingInput.removeAttribute("disabled");
} else {
gDialog.scalingLabel.setAttribute("disabled","true");
gDialog.scalingInput.setAttribute("disabled","true");
if ( val in gHFValues ) {
return gHFValues[val];
}
if ( val.length ) {
return 6; // Custom...
} else {
return 0; // --blank--
}
}
function hfIdToValue(node)
{
var result = "";
switch ( parseInt( node.value ) ) {
case 0:
break;
case 1:
result = "&T";
break;
case 2:
result = "&U";
break;
case 3:
result = "&D";
break;
case 4:
result = "&P";
break;
case 5:
result = "&PT";
break;
case 6:
result = node.custom;
break;
}
return result;
}
//---------------------------------------------------
@ -125,7 +279,7 @@ function loadDialog()
}
if (gDoDebug) {
dump("orientation "+print_orientation+"\n");
dump("print_orientation "+print_orientation+"\n");
dump("print_margin_top "+print_margin_top+"\n");
dump("print_margin_left "+print_margin_left+"\n");
@ -133,37 +287,55 @@ function loadDialog()
dump("print_margin_bottom "+print_margin_bottom+"\n");
}
gDialog.printBGColors.checked = gPrintSettings.printBGColors;
gDialog.printBGImages.checked = gPrintSettings.printBGImages;
gDialog.printBG.checked = gPrintSettings.printBGColors || gPrintSettings.printBGImages;
gDialog.shrinkToFit.checked = gPrintSettings.shrinkToFit;
doEnableScaling(!gDialog.shrinkToFit.checked);
gDialog.scalingLabel.disabled = gDialog.scalingInput.disabled = gDialog.shrinkToFit.checked;
if (print_orientation == gPrintSettingsInterface.kPortraitOrientation) {
gDialog.orientation.selectedIndex = 0;
gDialog.orientation.selectedItem = gDialog.portrait;
} else if (print_orientation == gPrintSettingsInterface.kLandscapeOrientation) {
gDialog.orientation.selectedIndex = 1;
gDialog.orientation.selectedItem = gDialog.landscape;
}
var marginGroupLabel = gDialog.marginGroup.label;
if (gPrintSettings.paperSizeUnit == gPrintSettingsInterface.kPaperSizeInches) {
marginGroupLabel = marginGroupLabel.replace(/#1/, gDialog.strings["marginUnits.inches"]);
} else {
marginGroupLabel = marginGroupLabel.replace(/#1/, gDialog.strings["marginUnits.metric"]);
// Also, set global page dimensions for A4 paper, in millimeters (assumes portrait at this point).
gPageWidth = 210;
gPageHeight = 297;
}
gDialog.marginGroup.label = marginGroupLabel;
// Set orientation the first time on a timeout so the dialog sizes to the
// maximum height specified in the .xul file. Otherwise, if the user switches
// from landscape to portrait, the content grows and the buttons are clipped.
setTimeout( setOrientation, 0 );
gDialog.topInput.value = getDoubleStr(print_margin_top, 1);
gDialog.bottomInput.value = getDoubleStr(print_margin_bottom, 1);
gDialog.leftInput.value = getDoubleStr(print_margin_left, 1);
gDialog.rightInput.value = getDoubleStr(print_margin_right, 1);
changeMargins();
gDialog.hLeftInput.value = gPrintSettings.headerStrLeft;
gDialog.hCenterInput.value = gPrintSettings.headerStrCenter;
gDialog.hRightInput.value = gPrintSettings.headerStrRight;
setHeaderFooter( gDialog.hLeftOption, gPrintSettings.headerStrLeft );
setHeaderFooter( gDialog.hCenterOption, gPrintSettings.headerStrCenter );
setHeaderFooter( gDialog.hRightOption, gPrintSettings.headerStrRight );
gDialog.fLeftInput.value = gPrintSettings.footerStrLeft;
gDialog.fCenterInput.value = gPrintSettings.footerStrCenter;
gDialog.fRightInput.value = gPrintSettings.footerStrRight;
setHeaderFooter( gDialog.fLeftOption, gPrintSettings.footerStrLeft );
setHeaderFooter( gDialog.fCenterOption, gPrintSettings.footerStrCenter );
setHeaderFooter( gDialog.fRightOption, gPrintSettings.footerStrRight );
gDialog.scalingInput.value = getDoubleStr(gPrintSettings.scaling * 100.0, 3);
// Give initial focus to the orientation radio group.
// Done on a timeout due to to bug 103197.
setTimeout( function() { gDialog.orientation.focus(); }, 0 );
}
var param;
//---------------------------------------------------
function onLoad()
{
@ -188,7 +360,11 @@ function onAccept()
{
if (gPrintSettings) {
gPrintSettings.orientation = gDialog.orientation.selectedIndex;
if ( gDialog.orientation.selectedItem == gDialog.portrait ) {
gPrintSettings.orientation = gPrintSettingsInterface.kPortraitOrientation;
} else {
gPrintSettings.orientation = gPrintSettingsInterface.kLandscapeOrientation;
}
// save these out so they can be picked up by the device spec
gPrintSettings.marginTop = gDialog.topInput.value;
@ -196,21 +372,24 @@ function onAccept()
gPrintSettings.marginBottom = gDialog.bottomInput.value;
gPrintSettings.marginRight = gDialog.rightInput.value;
gPrintSettings.headerStrLeft = hfIdToValue(gDialog.hLeftOption);
gPrintSettings.headerStrCenter = hfIdToValue(gDialog.hCenterOption);
gPrintSettings.headerStrRight = hfIdToValue(gDialog.hRightOption);
gPrintSettings.headerStrLeft = gDialog.hLeftInput.value;
gPrintSettings.headerStrCenter = gDialog.hCenterInput.value;
gPrintSettings.headerStrRight = gDialog.hRightInput.value;
gPrintSettings.footerStrLeft = hfIdToValue(gDialog.fLeftOption);
gPrintSettings.footerStrCenter = hfIdToValue(gDialog.fCenterOption);
gPrintSettings.footerStrRight = hfIdToValue(gDialog.fRightOption);
gPrintSettings.footerStrLeft = gDialog.fLeftInput.value;
gPrintSettings.footerStrCenter = gDialog.fCenterInput.value;
gPrintSettings.footerStrRight = gDialog.fRightInput.value;
gPrintSettings.printBGColors = gDialog.printBG.checked;
gPrintSettings.printBGImages = gDialog.printBG.checked;
gPrintSettings.printBGColors = gDialog.printBGColors.checked;
gPrintSettings.printBGImages = gDialog.printBGImages.checked;
gPrintSettings.shrinkToFit = gDialog.shrinkToFit.checked;
var scaling = document.getElementById("scalingInput").value;
if (scaling < 50.0 || scaling > 100.0) {
if (scaling < 50.0) {
scaling = 50.0;
}
if (scaling > 100.0) {
scaling = 100.0;
}
scaling /= 100.0;
@ -227,4 +406,3 @@ function onAccept()
return true;
}

Просмотреть файл

@ -25,10 +25,12 @@ Contributor(s):
Roland Mainz <roland.mainz@informatik.med.uni-giessen.de>
Asko Tontti <atontti@cc.hut.fi>
Rod Spears <rods@netscape.com>
Bill Law <law@netscape.com>
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/printing.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/printPageSetup.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
@ -41,175 +43,190 @@ Contributor(s):
<script type="application/x-javascript" src="chrome://communicator/content/printPageSetup.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<vbox>
<grid>
<columns>
<column/>
<column flex="1"/>
</columns>
<!-- 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>
<rows>
<row>
<hbox align="center" pack="end">
<label id="orientationLabel" value="&orientationGroup.label;"/>
</hbox>
<menulist id="orientation" flex ="1">
<menupopup>
<menuitem label="&portraitItem.label;" value="0"/>
<menuitem label="&landscapeItem.label;" value="1"/>
</menupopup>
</menulist>
</row>
</rows>
</grid>
<hbox>
<checkbox id="printBGColors" label="&printBGColorsInput.label;"/>
<checkbox id="printBGImages" label="&printBGImagesInput.label;"/>
</hbox>
<grid>
<columns>
<column/>
</columns>
<rows>
<row>
<groupbox flex="1">
<caption label="&marginInput.label;"/>
<hbox>
<hbox align="center">
<label id="topLabel" control="topInput" value="&topInput.label;"/>
<textbox id="topInput" style="width:5em;" onkeyup="checkDouble(this)"/>
</hbox>
<hbox align="center">
<label id="bottomLabel" control="bottomInput" value="&bottomInput.label;"/>
<textbox id="bottomInput" style="width:5em;" onkeyup="checkDouble(this)"/>
</hbox>
<hbox align="center">
<label id="leftLabel" control="leftInput" value="&leftInput.label;"/>
<textbox id="leftInput" style="width:5em;" onkeyup="checkDouble(this)"/>
</hbox>
<hbox align="center">
<label id="rightLabel" control="rightInput" value="&rightInput.label;"/>
<textbox id="rightInput" style="width:5em;" onkeyup="checkDouble(this)"/>
</hbox>
</hbox>
<tabbox>
<tabs>
<tab label="&basic.tab;"/>
<tab label="&advanced.tab;"/>
</tabs>
<tabpanels>
<tabpanel orient="vertical">
<groupbox>
<caption label="&formatGroup.label;"/>
<vbox>
<hbox align="center">
<label value="&orientation.label;"/>
<radiogroup id="orientation" oncommand="setOrientation()" tabindex="1">
<hbox align="center">
<radio id="portrait" class="portrait-page" label="&portrait;"/>
<radio id="landscape" class="landscape-page" label="&landscape;"/>
</hbox>
</radiogroup>
</hbox>
<separator/>
<hbox align="center">
<label value="&scale.label;"/>
<textbox id="scalingInput" size="4" onfocus="this.select()" oninput="checkDouble(this)" tabindex="1"/>
<label value="&scalePercent;"/>
<separator/>
<checkbox id="shrinkToFit" label="&shrinkToFit.label;" tabindex="1"
oncommand="gDialog.scalingInput.disabled=gDialog.scalingLabel.disabled=this.checked"/>
</hbox>
</vbox>
</groupbox>
</row>
</rows>
</grid>
<hbox flex="1">
<grid>
<columns>
<column/>
</columns>
<rows>
<row>
<groupbox flex="1">
<caption label="&headerInput.label;"/>
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<hbox align="center" pack="end">
<label id="hLeftLabel" control="hLeftInput" value="&leftInput.label;"/>
</hbox>
<textbox id="hLeftInput" style="width:10em;"/>
</row>
<row>
<hbox align="center" pack="end">
<label id="hCenterLabel" control="hCenterInput" value="&centerInput.label;"/>
</hbox>
<textbox id="hCenterInput" style="width:10em;"/>
</row>
<row>
<hbox align="center" pack="end">
<label id="hRightLabel" control="hRightInput" value="&rightInput.label;"/>
</hbox>
<textbox id="hRightInput" style="width:10em;"/>
</row>
</rows>
</grid>
</groupbox>
</row>
</rows>
</grid>
<grid>
<columns>
<column/>
</columns>
<rows>
<row>
<groupbox flex="1">
<caption label="&footerInput.label;"/>
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<hbox align="center" pack="end">
<label id="fLeftLabel" control="fLeftInput" value="&leftInput.label;"/>
</hbox>
<textbox id="fLeftInput" style="width:10em;"/>
</row>
<row>
<hbox align="center" pack="end">
<label id="fCenterLabel" control="fCenterInput" value="&centerInput.label;"/>
</hbox>
<textbox id="fCenterInput" style="width:10em;"/>
</row>
<row>
<hbox align="center" pack="end">
<label id="fRightLabel" control="fRightInput" value="&rightInput.label;"/>
</hbox>
<textbox id="fRightInput" style="width:10em;"/>
</row>
</rows>
</grid>
</groupbox>
</row>
</rows>
</grid>
</hbox>
<hbox>
<groupbox>
<caption label="&scalingGroup.label;" disabled="true"/>
<grid>
<columns>
<column/>
<column/>
<column/>
</columns>
<rows>
<row>
<groupbox>
<caption label="&optionsGroup.label;"/>
<checkbox id="printBG" label="&printBG.label;" tabindex="1"/>
</groupbox>
</tabpanel>
<tabpanel orient="vertical">
<groupbox>
<caption id="marginGroup" label="&marginGroup.label;"/>
<vbox>
<hbox align="center">
<label id="scalingLabel" control="scalingInput" value="&scalingInput.label;" />
<spacer flex="1"/>
<label value="&marginTop.label;"/>
<textbox id="topInput" size="5" oninput="changeMargin(this)" onfocus="this.select()" tabindex="1"/>
<!-- 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>
<spacer flex="1"/>
<vbox>
<spacer flex="1"/>
<label value="&marginLeft.label;"/>
<textbox id="leftInput" size="5" oninput="changeMargin(this)" onfocus="this.select()" tabindex="1"/>
<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">
<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 value="&marginRight.label;"/>
<textbox id="rightInput" size="5" oninput="changeMargin(this)" onfocus="this.select()" tabindex="1"/>
<label value="&marginRight.label;" style="visibility: hidden;"/>
<spacer flex="1"/>
</vbox>
<spacer flex="1"/>
</hbox>
<textbox id="scalingInput" style="width:4em;" onkeyup="checkDouble(this)" />
<hbox align="center">
<label id="scalingLabelPost" control="scalingInputPost" value="&scalingInputPost.label;" />
<spacer flex="1"/>
<label value="&marginBottom.label;"/>
<textbox id="bottomInput" size="5" oninput="changeMargin(this)" onfocus="this.select()" tabindex="1"/>
<label value="&marginBottom.label;" style="visibility: hidden;"/>
<spacer flex="1"/>
</hbox>
</row>
</rows>
</grid>
<hrow>
<checkbox id="shrinkToFit" label="&shrinkToFitInput.label;" oncommand="doEnableScaling(!this.checked);"/>
</hrow>
</groupbox>
</hbox>
</vbox>
</vbox>
</groupbox>
<groupbox>
<caption id="headersAndFooters" label="&headerFooter.label;"/>
<hbox>
<vbox>
<menulist id="hLeftOption" oncommand="customize(this)" tabindex="2">
<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>
<vbox align="center">
<label value="&hfLeft.label;"/>
</vbox>
<menulist id="fLeftOption" oncommand="customize(this)" tabindex="3">
<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>
</vbox>
<vbox>
<menulist id="hCenterOption" oncommand="customize(this)" tabindex="2">
<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>
<vbox align="center">
<label value="&hfCenter.label;"/>
</vbox>
<menulist id="fCenterOption" oncommand="customize(this)" tabindex="3">
<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>
</vbox>
<vbox>
<menulist id="hRightOption" oncommand="customize(this)" tabindex="2">
<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>
<vbox align="center">
<label value="&hfRight.label;"/>
</vbox>
<menulist id="fRightOption" oncommand="customize(this)" tabindex="3">
<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>
</vbox>
</hbox>
</groupbox>
</tabpanel>
</tabpanels>
</tabbox>
<separator/>
</dialog>

Просмотреть файл

@ -44,6 +44,9 @@
<binding id="printpreviewtoolbar"
extends="chrome://global/content/bindings/toolbar.xml#toolbar">
<resources>
<stylesheet src="chrome://communicator/skin/printing.css"/>
</resources>
<content>
<xul:button label="&print.label;" oncommand="BrowserPrint();"/>
@ -89,10 +92,10 @@
<xul:vbox align="center" pack="center">
<xul:hbox align="center" pack="center">
<xul:toolbarbutton label="&portrait.label;" checked="true"
type="radio" group="orient" class="portrait-page"
type="radio" group="orient" class="toolbar-portrait-page"
oncommand="parentNode.parentNode.parentNode.orient('portrait');"/>
<xul:toolbarbutton label="&landscape.label;"
type="radio" group="orient" class="landscape-page"
type="radio" group="orient" class="toolbar-landscape-page"
oncommand="parentNode.parentNode.parentNode.orient('landscape');"/>
</xul:hbox>
</xul:vbox>

Просмотреть файл

@ -1,33 +1,52 @@
<!-- extracted from printjoboptions.xul -->
<!ENTITY printSetup.title "Page Setup">
<!ENTITY printSetup.title "Page Setup">
<!ENTITY cmdInput.label "Print Command:">
<!ENTITY basic.tab "Format &amp; Options">
<!ENTITY colorGroup.label "Color:">
<!ENTITY grayRadio.label "GrayScale">
<!ENTITY colorRadio.label "Color">
<!ENTITY formatGroup.label "Format">
<!ENTITY orientationGroup.label "Orientation:">
<!ENTITY portraitItem.label "Portrait">
<!ENTITY landscapeItem.label "Landscape">
<!ENTITY orientation.label "Orientation:">
<!ENTITY portrait "Portrait">
<!ENTITY landscape "Landscape">
<!ENTITY marginInput.label "Margins(inches)">
<!ENTITY topInput.label "Top:">
<!ENTITY bottomInput.label "Bottom:">
<!ENTITY leftInput.label "Left:">
<!ENTITY rightInput.label "Right:">
<!ENTITY scale.label "Scale:">
<!ENTITY scalePercent "&#037;">
<!ENTITY headerInput.label "Header">
<!ENTITY footerInput.label "Footer">
<!ENTITY leftInput.label "Left:">
<!ENTITY centerInput.label "Center:">
<!ENTITY rightInput.label "Right:">
<!ENTITY shrinkToFit.label "Shrink To Fit Page Width">
<!ENTITY printBGColorsInput.label "Print Background Colors">
<!ENTITY printBGImagesInput.label "Print Background Images">
<!ENTITY optionsGroup.label "Options">
<!ENTITY scalingGroup.label "Page Scaling">
<!ENTITY scalingInput.label "Percent:">
<!ENTITY scalingInputPost.label "(Values in range 50-100)">
<!ENTITY shrinkToFitInput.label "Shrink To Fit Page Width">
<!ENTITY printBG.label "Print Background (colors &amp; images)">
<!ENTITY advanced.tab "Margins &amp; Header/Footer">
<!ENTITY marginGroup.label "Margins (#1)">
<!ENTITY marginUnits.inches "inches">
<!ENTITY marginUnits.metric "millimeters">
<!ENTITY marginTop.label "Top:">
<!ENTITY marginBottom.label "Bottom:">
<!ENTITY marginLeft.label "Left:">
<!ENTITY marginRight.label "Right:">
<!ENTITY headerFooter.label "Headers &amp; Footers">
<!ENTITY hfLeft.label "Left:">
<!ENTITY hfCenter.label "Center:">
<!ENTITY hfRight.label "Right:">
<!ENTITY hfTitle "Title">
<!ENTITY hfTitle.code "[&amp;T]">
<!ENTITY hfURL "URL">
<!ENTITY hfURL.code "[&amp;U]">
<!ENTITY hfDateAndTime "Date/Time">
<!ENTITY hfDateAndTime.code "&amp;D">
<!ENTITY hfPage "Page #">
<!ENTITY hfPage.code "[&amp;P]">
<!ENTITY hfPageAndTotal "Page # of #">
<!ENTITY hfPageAndTotal.code "[&amp;PT]">
<!ENTITY hfBlank "--blank--">
<!ENTITY hfCustom "Custom...">
<!ENTITY customPrompt.title "Custom...">
<!ENTITY customPrompt.prompt "Enter your custom header/footer text">

Просмотреть файл

@ -51,28 +51,45 @@ function initDialog()
gDialog = new Object;
gDialog.orientation = document.getElementById("orientation");
gDialog.printBGColors = document.getElementById("printBGColors");
gDialog.printBGImages = document.getElementById("printBGImages");
gDialog.portrait = document.getElementById("portrait");
gDialog.landscape = document.getElementById("landscape");
gDialog.printBG = document.getElementById("printBG");
gDialog.shrinkToFit = document.getElementById("shrinkToFit");
gDialog.marginGroup = document.getElementById("marginGroup");
gDialog.marginPage = document.getElementById("marginPage");
gDialog.marginTop = document.getElementById("marginTop");
gDialog.marginBottom = document.getElementById("marginBottom");
gDialog.marginLeft = document.getElementById("marginLeft");
gDialog.marginRight = document.getElementById("marginRight");
gDialog.topInput = document.getElementById("topInput");
gDialog.bottomInput = document.getElementById("bottomInput");
gDialog.leftInput = document.getElementById("leftInput");
gDialog.rightInput = document.getElementById("rightInput");
gDialog.hLeftInput = document.getElementById("hLeftInput");
gDialog.hCenterInput = document.getElementById("hCenterInput");
gDialog.hRightInput = document.getElementById("hRightInput");
gDialog.hLeftOption = document.getElementById("hLeftOption");
gDialog.hCenterOption = document.getElementById("hCenterOption");
gDialog.hRightOption = document.getElementById("hRightOption");
gDialog.fLeftInput = document.getElementById("fLeftInput");
gDialog.fCenterInput = document.getElementById("fCenterInput");
gDialog.fRightInput = document.getElementById("fRightInput");
gDialog.fLeftOption = document.getElementById("fLeftOption");
gDialog.fCenterOption = document.getElementById("fCenterOption");
gDialog.fRightOption = document.getElementById("fRightOption");
gDialog.scalingLabel = document.getElementById("scalingInput");
gDialog.scalingInput = document.getElementById("scalingInput");
gDialog.enabled = false;
gDialog.strings = new Array;
gDialog.strings[ "marginUnits.inches" ] = document.getElementById("marginUnits.inches").childNodes[0].nodeValue;
gDialog.strings[ "marginUnits.metric" ] = document.getElementById("marginUnits.metric").childNodes[0].nodeValue;
gDialog.strings[ "customPrompt.title" ] = document.getElementById("customPrompt.title").childNodes[0].nodeValue;
gDialog.strings[ "customPrompt.prompt" ] = document.getElementById("customPrompt.prompt").childNodes[0].nodeValue;
}
//---------------------------------------------------
@ -86,6 +103,108 @@ function checkDouble(element)
}
}
// Theoretical paper width/height.
var gPageWidth = 8.5;
var gPageHeight = 11.0;
//---------------------------------------------------
function setOrientation()
{
var selection = gDialog.orientation.selectedItem;
var style = "background-color:white;";
if ((selection == gDialog.portrait && gPageWidth > gPageHeight) ||
(selection == gDialog.landscape && gPageWidth < gPageHeight)) {
// Swap width/height.
var temp = gPageHeight;
gPageHeight = gPageWidth;
gPageWidth = temp;
}
style += "width:" + gPageWidth/10 + unitString() + ";height:" + gPageHeight/10 + unitString() + ";";
gDialog.marginPage.setAttribute( "style", style );
}
//---------------------------------------------------
function unitString()
{
return (gPrintSettings.paperSizeUnit == gPrintSettingsInterface.kPaperSizeInches) ? "in" : "mm";
}
//---------------------------------------------------
function checkMargin( value, max, other )
{
// Don't draw this margin bigger than permitted.
return Math.min(value, max - other.value);
}
//---------------------------------------------------
function changeMargin( node )
{
// Correct invalid input.
checkDouble(node);
// Reset the margin height/width for this node.
var val = node.value;
var nodeToStyle;
var attr="width";
if ( node == gDialog.topInput ) {
nodeToStyle = gDialog.marginTop;
val = checkMargin( val, gPageHeight, gDialog.bottomInput );
attr = "height";
} else if ( node == gDialog.bottomInput ) {
nodeToStyle = gDialog.marginBottom;
val = checkMargin( val, gPageHeight, gDialog.topInput );
attr = "height";
} else if ( node == gDialog.leftInput ) {
nodeToStyle = gDialog.marginLeft;
val = checkMargin( val, gPageWidth, gDialog.rightInput );
} else {
nodeToStyle = gDialog.marginRight;
val = checkMargin( val, gPageWidth, gDialog.leftInput );
}
var style = attr + ":" + val/10 + unitString() + ";";
nodeToStyle.setAttribute( "style", style );
}
//---------------------------------------------------
function changeMargins()
{
changeMargin( gDialog.topInput );
changeMargin( gDialog.bottomInput );
changeMargin( gDialog.leftInput );
changeMargin( gDialog.rightInput );
}
//---------------------------------------------------
function customize( node )
{
// If selection is now "Custom..." then prompt user for custom setting.
if ( node.value == 6 ) {
var prompter = Components.classes[ "@mozilla.org/embedcomp/prompt-service;1" ]
.getService( Components.interfaces.nsIPromptService );
var title = gDialog.strings[ "customPrompt.title" ];
var promptText = gDialog.strings[ "customPrompt.prompt" ];
var result = { value: node.custom };
var ok = prompter.prompt(window, title, promptText, result, null, { value: false } );
if ( ok ) {
node.custom = result.value;
}
}
}
//---------------------------------------------------
function setHeaderFooter( node, value )
{
node.value= hfValueToId(value);
if (node.value == 6) {
// Remember current Custom... value.
node.custom = value;
} else {
// Start with empty Custom... value.
node.custom = "";
}
}
//---------------------------------------------------
function getDoubleStr(val, dec)
{
@ -94,16 +213,51 @@ function getDoubleStr(val, dec)
return str.substring(0, inx+dec+1);
}
//---------------------------------------------------
function doEnableScaling(value)
var gHFValues = new Array;
gHFValues[ "&T" ] = 1;
gHFValues[ "&U" ] = 2;
gHFValues[ "&D" ] = 3;
gHFValues[ "&P" ] = 4;
gHFValues[ "&PT" ] = 5;
function hfValueToId(val)
{
if (value) {
gDialog.scalingLabel.removeAttribute("disabled");
gDialog.scalingInput.removeAttribute("disabled");
} else {
gDialog.scalingLabel.setAttribute("disabled","true");
gDialog.scalingInput.setAttribute("disabled","true");
if ( val in gHFValues ) {
return gHFValues[val];
}
if ( val.length ) {
return 6; // Custom...
} else {
return 0; // --blank--
}
}
function hfIdToValue(node)
{
var result = "";
switch ( parseInt( node.value ) ) {
case 0:
break;
case 1:
result = "&T";
break;
case 2:
result = "&U";
break;
case 3:
result = "&D";
break;
case 4:
result = "&P";
break;
case 5:
result = "&PT";
break;
case 6:
result = node.custom;
break;
}
return result;
}
//---------------------------------------------------
@ -125,7 +279,7 @@ function loadDialog()
}
if (gDoDebug) {
dump("orientation "+print_orientation+"\n");
dump("print_orientation "+print_orientation+"\n");
dump("print_margin_top "+print_margin_top+"\n");
dump("print_margin_left "+print_margin_left+"\n");
@ -133,37 +287,55 @@ function loadDialog()
dump("print_margin_bottom "+print_margin_bottom+"\n");
}
gDialog.printBGColors.checked = gPrintSettings.printBGColors;
gDialog.printBGImages.checked = gPrintSettings.printBGImages;
gDialog.printBG.checked = gPrintSettings.printBGColors || gPrintSettings.printBGImages;
gDialog.shrinkToFit.checked = gPrintSettings.shrinkToFit;
doEnableScaling(!gDialog.shrinkToFit.checked);
gDialog.scalingLabel.disabled = gDialog.scalingInput.disabled = gDialog.shrinkToFit.checked;
if (print_orientation == gPrintSettingsInterface.kPortraitOrientation) {
gDialog.orientation.selectedIndex = 0;
gDialog.orientation.selectedItem = gDialog.portrait;
} else if (print_orientation == gPrintSettingsInterface.kLandscapeOrientation) {
gDialog.orientation.selectedIndex = 1;
gDialog.orientation.selectedItem = gDialog.landscape;
}
var marginGroupLabel = gDialog.marginGroup.label;
if (gPrintSettings.paperSizeUnit == gPrintSettingsInterface.kPaperSizeInches) {
marginGroupLabel = marginGroupLabel.replace(/#1/, gDialog.strings["marginUnits.inches"]);
} else {
marginGroupLabel = marginGroupLabel.replace(/#1/, gDialog.strings["marginUnits.metric"]);
// Also, set global page dimensions for A4 paper, in millimeters (assumes portrait at this point).
gPageWidth = 210;
gPageHeight = 297;
}
gDialog.marginGroup.label = marginGroupLabel;
// Set orientation the first time on a timeout so the dialog sizes to the
// maximum height specified in the .xul file. Otherwise, if the user switches
// from landscape to portrait, the content grows and the buttons are clipped.
setTimeout( setOrientation, 0 );
gDialog.topInput.value = getDoubleStr(print_margin_top, 1);
gDialog.bottomInput.value = getDoubleStr(print_margin_bottom, 1);
gDialog.leftInput.value = getDoubleStr(print_margin_left, 1);
gDialog.rightInput.value = getDoubleStr(print_margin_right, 1);
changeMargins();
gDialog.hLeftInput.value = gPrintSettings.headerStrLeft;
gDialog.hCenterInput.value = gPrintSettings.headerStrCenter;
gDialog.hRightInput.value = gPrintSettings.headerStrRight;
setHeaderFooter( gDialog.hLeftOption, gPrintSettings.headerStrLeft );
setHeaderFooter( gDialog.hCenterOption, gPrintSettings.headerStrCenter );
setHeaderFooter( gDialog.hRightOption, gPrintSettings.headerStrRight );
gDialog.fLeftInput.value = gPrintSettings.footerStrLeft;
gDialog.fCenterInput.value = gPrintSettings.footerStrCenter;
gDialog.fRightInput.value = gPrintSettings.footerStrRight;
setHeaderFooter( gDialog.fLeftOption, gPrintSettings.footerStrLeft );
setHeaderFooter( gDialog.fCenterOption, gPrintSettings.footerStrCenter );
setHeaderFooter( gDialog.fRightOption, gPrintSettings.footerStrRight );
gDialog.scalingInput.value = getDoubleStr(gPrintSettings.scaling * 100.0, 3);
// Give initial focus to the orientation radio group.
// Done on a timeout due to to bug 103197.
setTimeout( function() { gDialog.orientation.focus(); }, 0 );
}
var param;
//---------------------------------------------------
function onLoad()
{
@ -188,7 +360,11 @@ function onAccept()
{
if (gPrintSettings) {
gPrintSettings.orientation = gDialog.orientation.selectedIndex;
if ( gDialog.orientation.selectedItem == gDialog.portrait ) {
gPrintSettings.orientation = gPrintSettingsInterface.kPortraitOrientation;
} else {
gPrintSettings.orientation = gPrintSettingsInterface.kLandscapeOrientation;
}
// save these out so they can be picked up by the device spec
gPrintSettings.marginTop = gDialog.topInput.value;
@ -196,21 +372,24 @@ function onAccept()
gPrintSettings.marginBottom = gDialog.bottomInput.value;
gPrintSettings.marginRight = gDialog.rightInput.value;
gPrintSettings.headerStrLeft = hfIdToValue(gDialog.hLeftOption);
gPrintSettings.headerStrCenter = hfIdToValue(gDialog.hCenterOption);
gPrintSettings.headerStrRight = hfIdToValue(gDialog.hRightOption);
gPrintSettings.headerStrLeft = gDialog.hLeftInput.value;
gPrintSettings.headerStrCenter = gDialog.hCenterInput.value;
gPrintSettings.headerStrRight = gDialog.hRightInput.value;
gPrintSettings.footerStrLeft = hfIdToValue(gDialog.fLeftOption);
gPrintSettings.footerStrCenter = hfIdToValue(gDialog.fCenterOption);
gPrintSettings.footerStrRight = hfIdToValue(gDialog.fRightOption);
gPrintSettings.footerStrLeft = gDialog.fLeftInput.value;
gPrintSettings.footerStrCenter = gDialog.fCenterInput.value;
gPrintSettings.footerStrRight = gDialog.fRightInput.value;
gPrintSettings.printBGColors = gDialog.printBG.checked;
gPrintSettings.printBGImages = gDialog.printBG.checked;
gPrintSettings.printBGColors = gDialog.printBGColors.checked;
gPrintSettings.printBGImages = gDialog.printBGImages.checked;
gPrintSettings.shrinkToFit = gDialog.shrinkToFit.checked;
var scaling = document.getElementById("scalingInput").value;
if (scaling < 50.0 || scaling > 100.0) {
if (scaling < 50.0) {
scaling = 50.0;
}
if (scaling > 100.0) {
scaling = 100.0;
}
scaling /= 100.0;
@ -227,4 +406,3 @@ function onAccept()
return true;
}

Просмотреть файл

@ -25,10 +25,12 @@ Contributor(s):
Roland Mainz <roland.mainz@informatik.med.uni-giessen.de>
Asko Tontti <atontti@cc.hut.fi>
Rod Spears <rods@netscape.com>
Bill Law <law@netscape.com>
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/printing.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/printPageSetup.dtd">
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
@ -41,175 +43,190 @@ Contributor(s):
<script type="application/x-javascript" src="chrome://communicator/content/printPageSetup.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<vbox>
<grid>
<columns>
<column/>
<column flex="1"/>
</columns>
<!-- 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>
<rows>
<row>
<hbox align="center" pack="end">
<label id="orientationLabel" value="&orientationGroup.label;"/>
</hbox>
<menulist id="orientation" flex ="1">
<menupopup>
<menuitem label="&portraitItem.label;" value="0"/>
<menuitem label="&landscapeItem.label;" value="1"/>
</menupopup>
</menulist>
</row>
</rows>
</grid>
<hbox>
<checkbox id="printBGColors" label="&printBGColorsInput.label;"/>
<checkbox id="printBGImages" label="&printBGImagesInput.label;"/>
</hbox>
<grid>
<columns>
<column/>
</columns>
<rows>
<row>
<groupbox flex="1">
<caption label="&marginInput.label;"/>
<hbox>
<hbox align="center">
<label id="topLabel" control="topInput" value="&topInput.label;"/>
<textbox id="topInput" style="width:5em;" onkeyup="checkDouble(this)"/>
</hbox>
<hbox align="center">
<label id="bottomLabel" control="bottomInput" value="&bottomInput.label;"/>
<textbox id="bottomInput" style="width:5em;" onkeyup="checkDouble(this)"/>
</hbox>
<hbox align="center">
<label id="leftLabel" control="leftInput" value="&leftInput.label;"/>
<textbox id="leftInput" style="width:5em;" onkeyup="checkDouble(this)"/>
</hbox>
<hbox align="center">
<label id="rightLabel" control="rightInput" value="&rightInput.label;"/>
<textbox id="rightInput" style="width:5em;" onkeyup="checkDouble(this)"/>
</hbox>
</hbox>
<tabbox>
<tabs>
<tab label="&basic.tab;"/>
<tab label="&advanced.tab;"/>
</tabs>
<tabpanels>
<tabpanel orient="vertical">
<groupbox>
<caption label="&formatGroup.label;"/>
<vbox>
<hbox align="center">
<label value="&orientation.label;"/>
<radiogroup id="orientation" oncommand="setOrientation()" tabindex="1">
<hbox align="center">
<radio id="portrait" class="portrait-page" label="&portrait;"/>
<radio id="landscape" class="landscape-page" label="&landscape;"/>
</hbox>
</radiogroup>
</hbox>
<separator/>
<hbox align="center">
<label value="&scale.label;"/>
<textbox id="scalingInput" size="4" onfocus="this.select()" oninput="checkDouble(this)" tabindex="1"/>
<label value="&scalePercent;"/>
<separator/>
<checkbox id="shrinkToFit" label="&shrinkToFit.label;" tabindex="1"
oncommand="gDialog.scalingInput.disabled=gDialog.scalingLabel.disabled=this.checked"/>
</hbox>
</vbox>
</groupbox>
</row>
</rows>
</grid>
<hbox flex="1">
<grid>
<columns>
<column/>
</columns>
<rows>
<row>
<groupbox flex="1">
<caption label="&headerInput.label;"/>
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<hbox align="center" pack="end">
<label id="hLeftLabel" control="hLeftInput" value="&leftInput.label;"/>
</hbox>
<textbox id="hLeftInput" style="width:10em;"/>
</row>
<row>
<hbox align="center" pack="end">
<label id="hCenterLabel" control="hCenterInput" value="&centerInput.label;"/>
</hbox>
<textbox id="hCenterInput" style="width:10em;"/>
</row>
<row>
<hbox align="center" pack="end">
<label id="hRightLabel" control="hRightInput" value="&rightInput.label;"/>
</hbox>
<textbox id="hRightInput" style="width:10em;"/>
</row>
</rows>
</grid>
</groupbox>
</row>
</rows>
</grid>
<grid>
<columns>
<column/>
</columns>
<rows>
<row>
<groupbox flex="1">
<caption label="&footerInput.label;"/>
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<hbox align="center" pack="end">
<label id="fLeftLabel" control="fLeftInput" value="&leftInput.label;"/>
</hbox>
<textbox id="fLeftInput" style="width:10em;"/>
</row>
<row>
<hbox align="center" pack="end">
<label id="fCenterLabel" control="fCenterInput" value="&centerInput.label;"/>
</hbox>
<textbox id="fCenterInput" style="width:10em;"/>
</row>
<row>
<hbox align="center" pack="end">
<label id="fRightLabel" control="fRightInput" value="&rightInput.label;"/>
</hbox>
<textbox id="fRightInput" style="width:10em;"/>
</row>
</rows>
</grid>
</groupbox>
</row>
</rows>
</grid>
</hbox>
<hbox>
<groupbox>
<caption label="&scalingGroup.label;" disabled="true"/>
<grid>
<columns>
<column/>
<column/>
<column/>
</columns>
<rows>
<row>
<groupbox>
<caption label="&optionsGroup.label;"/>
<checkbox id="printBG" label="&printBG.label;" tabindex="1"/>
</groupbox>
</tabpanel>
<tabpanel orient="vertical">
<groupbox>
<caption id="marginGroup" label="&marginGroup.label;"/>
<vbox>
<hbox align="center">
<label id="scalingLabel" control="scalingInput" value="&scalingInput.label;" />
<spacer flex="1"/>
<label value="&marginTop.label;"/>
<textbox id="topInput" size="5" oninput="changeMargin(this)" onfocus="this.select()" tabindex="1"/>
<!-- 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>
<spacer flex="1"/>
<vbox>
<spacer flex="1"/>
<label value="&marginLeft.label;"/>
<textbox id="leftInput" size="5" oninput="changeMargin(this)" onfocus="this.select()" tabindex="1"/>
<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">
<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 value="&marginRight.label;"/>
<textbox id="rightInput" size="5" oninput="changeMargin(this)" onfocus="this.select()" tabindex="1"/>
<label value="&marginRight.label;" style="visibility: hidden;"/>
<spacer flex="1"/>
</vbox>
<spacer flex="1"/>
</hbox>
<textbox id="scalingInput" style="width:4em;" onkeyup="checkDouble(this)" />
<hbox align="center">
<label id="scalingLabelPost" control="scalingInputPost" value="&scalingInputPost.label;" />
<spacer flex="1"/>
<label value="&marginBottom.label;"/>
<textbox id="bottomInput" size="5" oninput="changeMargin(this)" onfocus="this.select()" tabindex="1"/>
<label value="&marginBottom.label;" style="visibility: hidden;"/>
<spacer flex="1"/>
</hbox>
</row>
</rows>
</grid>
<hrow>
<checkbox id="shrinkToFit" label="&shrinkToFitInput.label;" oncommand="doEnableScaling(!this.checked);"/>
</hrow>
</groupbox>
</hbox>
</vbox>
</vbox>
</groupbox>
<groupbox>
<caption id="headersAndFooters" label="&headerFooter.label;"/>
<hbox>
<vbox>
<menulist id="hLeftOption" oncommand="customize(this)" tabindex="2">
<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>
<vbox align="center">
<label value="&hfLeft.label;"/>
</vbox>
<menulist id="fLeftOption" oncommand="customize(this)" tabindex="3">
<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>
</vbox>
<vbox>
<menulist id="hCenterOption" oncommand="customize(this)" tabindex="2">
<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>
<vbox align="center">
<label value="&hfCenter.label;"/>
</vbox>
<menulist id="fCenterOption" oncommand="customize(this)" tabindex="3">
<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>
</vbox>
<vbox>
<menulist id="hRightOption" oncommand="customize(this)" tabindex="2">
<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>
<vbox align="center">
<label value="&hfRight.label;"/>
</vbox>
<menulist id="fRightOption" oncommand="customize(this)" tabindex="3">
<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>
</vbox>
</hbox>
</groupbox>
</tabpanel>
</tabpanels>
</tabbox>
<separator/>
</dialog>

Просмотреть файл

@ -1,33 +1,52 @@
<!-- extracted from printjoboptions.xul -->
<!ENTITY printSetup.title "Page Setup">
<!ENTITY printSetup.title "Page Setup">
<!ENTITY cmdInput.label "Print Command:">
<!ENTITY basic.tab "Format &amp; Options">
<!ENTITY colorGroup.label "Color:">
<!ENTITY grayRadio.label "GrayScale">
<!ENTITY colorRadio.label "Color">
<!ENTITY formatGroup.label "Format">
<!ENTITY orientationGroup.label "Orientation:">
<!ENTITY portraitItem.label "Portrait">
<!ENTITY landscapeItem.label "Landscape">
<!ENTITY orientation.label "Orientation:">
<!ENTITY portrait "Portrait">
<!ENTITY landscape "Landscape">
<!ENTITY marginInput.label "Margins(inches)">
<!ENTITY topInput.label "Top:">
<!ENTITY bottomInput.label "Bottom:">
<!ENTITY leftInput.label "Left:">
<!ENTITY rightInput.label "Right:">
<!ENTITY scale.label "Scale:">
<!ENTITY scalePercent "&#037;">
<!ENTITY headerInput.label "Header">
<!ENTITY footerInput.label "Footer">
<!ENTITY leftInput.label "Left:">
<!ENTITY centerInput.label "Center:">
<!ENTITY rightInput.label "Right:">
<!ENTITY shrinkToFit.label "Shrink To Fit Page Width">
<!ENTITY printBGColorsInput.label "Print Background Colors">
<!ENTITY printBGImagesInput.label "Print Background Images">
<!ENTITY optionsGroup.label "Options">
<!ENTITY scalingGroup.label "Page Scaling">
<!ENTITY scalingInput.label "Percent:">
<!ENTITY scalingInputPost.label "(Values in range 50-100)">
<!ENTITY shrinkToFitInput.label "Shrink To Fit Page Width">
<!ENTITY printBG.label "Print Background (colors &amp; images)">
<!ENTITY advanced.tab "Margins &amp; Header/Footer">
<!ENTITY marginGroup.label "Margins (#1)">
<!ENTITY marginUnits.inches "inches">
<!ENTITY marginUnits.metric "millimeters">
<!ENTITY marginTop.label "Top:">
<!ENTITY marginBottom.label "Bottom:">
<!ENTITY marginLeft.label "Left:">
<!ENTITY marginRight.label "Right:">
<!ENTITY headerFooter.label "Headers &amp; Footers">
<!ENTITY hfLeft.label "Left:">
<!ENTITY hfCenter.label "Center:">
<!ENTITY hfRight.label "Right:">
<!ENTITY hfTitle "Title">
<!ENTITY hfTitle.code "[&amp;T]">
<!ENTITY hfURL "URL">
<!ENTITY hfURL.code "[&amp;U]">
<!ENTITY hfDateAndTime "Date/Time">
<!ENTITY hfDateAndTime.code "&amp;D">
<!ENTITY hfPage "Page #">
<!ENTITY hfPage.code "[&amp;P]">
<!ENTITY hfPageAndTotal "Page # of #">
<!ENTITY hfPageAndTotal.code "[&amp;PT]">
<!ENTITY hfBlank "--blank--">
<!ENTITY hfCustom "Custom...">
<!ENTITY customPrompt.title "Custom...">
<!ENTITY customPrompt.prompt "Enter your custom header/footer text">