bug 111396, tabbing in dialogs give incorrect results, r=jag, sr=hewitt

This commit is contained in:
morse%netscape.com 2001-11-29 09:27:19 +00:00
Родитель 0139fb7d57
Коммит eb790816f5
2 изменённых файлов: 41 добавлений и 23 удалений

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

@ -42,7 +42,6 @@ var gCommonDialogParam;
function commonDialogOnLoad()
{
doSetOKCancel(commonDialogOnOK, commonDialogOnCancel, commonDialogOnButton2, commonDialogOnButton3);
gCommonDialogParam = window.arguments[0].QueryInterface(Components.interfaces.nsIDialogParamBlock);
// display the main text
@ -73,28 +72,44 @@ function commonDialogOnLoad()
// set the number of command buttons
var nButtons = gCommonDialogParam.GetInt(2);
if (nButtons == 1) hideElementById("cancel");
var string;
switch (nButtons) {
case 4:
unHideElementByID("Button3");
document.getElementById("Button3").label = gCommonDialogParam.GetString(11);
string = gCommonDialogParam.GetString(11);
if (string)
document.getElementById("Button3").label = string;
// fall through
case 3:
unHideElementByID("Button2");
document.getElementById("Button2").label = gCommonDialogParam.GetString(10);
string = gCommonDialogParam.GetString(10);
if (string)
document.getElementById("Button2").label = string;
// fall through
default:
case 2:
var string = gCommonDialogParam.GetString(8);
if (string)
document.getElementById("ok").label = string;
// fall through
case 1:
string = gCommonDialogParam.GetString(9);
if (string)
document.getElementById("cancel").label = string;
// fall through
case 1:
string = gCommonDialogParam.GetString(8);
if (string)
document.getElementById("ok").label = string;
break;
}
switch (nButtons) {
case 1:
hideElementById("cancel");
// fall through
default:
case 2:
hideElementById("Button2");
// fall through
case 3:
hideElementById("Button3");
// fall through
case 4:
break;
}
// initialize the checkbox
setCheckbox(gCommonDialogParam.GetString(1), gCommonDialogParam.GetInt(1));

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

@ -1,15 +1,13 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://global/locale/commonDialog.dtd">
<window id="commonDialog"
<dialog id="commonDialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="commonDialogOnLoad();"
style="min-width: 29em; min-height: 8.5em; -moz-user-focus: ignore;"
class="dialog">
ondialogaccept="return commonDialogOnOK();"
ondialogcancel="return commonDialogOnCancel();"
style="min-width: 29em; min-height: 8.5em; -moz-user-focus: ignore;">
<script type="application/x-javascript" src="chrome://global/content/commonDialog.js"/>
<keyset id="dialogKeys"/>
@ -26,17 +24,17 @@
<!-- edit fields -->
<vbox id="loginEditField" collapsed="true">
<label id="login.text" value="&editfield0.label;" control="dialog.loginname"/>
<label id="login.text" control="dialog.loginname"/>
<textbox tabindex="0" id="dialog.loginname" flex="1"/>
<separator class="thin"/>
</vbox>
<vbox id ="password1EditField" collapsed="true">
<label id="password1.text" value="&editfield1.label;" control="dialog.password1"/>
<label id="password1.text" control="dialog.password1"/>
<textbox tabindex="1" type="password" id="dialog.password1" flex="1"/>
<separator class="thin"/>
</vbox>
<vbox id="password2EditField" collapsed="true">
<label id="password2.text" value="&editfield2.label;" control="dialog.password2"/>
<label id="password2.text" control="dialog.password2"/>
<textbox tabindex="1" type="password" id="dialog.password2" flex="1"/>
<separator class="thin"/>
</vbox>
@ -51,6 +49,11 @@
</hbox>
<separator class="thin"/>
<hbox id="okCancelButtons"/>
</window>
<hbox align="right">
<button id="ok" dlgtype="accept"/>
<button id="Button2" oncommand="commonDialogOnButton2();"/>
<button id="Button3" oncommand="commonDialogOnButton3();"/>
<button id="cancel" dlgtype="cancel"/>
</hbox>
</dialog>