home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Di Gi Charat Mail
/
disc2.iso
/
disc1
/
ie5
/
IENT_S4.CAB
/
IENT_4.CAB
/
MSHTMLER.DLL
/
HTML
/
FORCHAR.DLG
< prev
next >
Wrap
Text File
|
1999-04-01
|
21KB
|
761 lines
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
<HTML id=dlgFont STYLE="font-family: MS UI Gothic; font-size: 9pt;
width: 35.4em; height: 26.9em">
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<TITLE id=dialogTitle>
âtâHâôâg
</TITLE>
</HEAD>
<SCRIPT defer>
function callHelp(elm)
{
if (null != elm.helpid)
{
window.showHelp(elm.helpfile, "" + parseInt(elm.helpid),
"popup");
}
else
{
if ("BODY" != elm.tagName)
{
callHelp(elm.parentElement);
}
}
}
function btnCancelClick()
{
window.close();
}
function getTextRange(elm)
{
var r = elm.parentTextEdit.createTextRange();
r.moveToElementText(elm);
return r;
}
function mouseClick()
{
if (window.event.srcElement.id.substring(0,3)
== "txt")
{
return;
}
if (window.event.button == 2)
{
callHelp(window.event.srcElement);
}
}
function txtDefaultESC()
{
if (event.keyCode == 27)
{
window.close();
return;
}
}
window.onerror = HandleError
var L_Dialog_ErrorMessage = "é▒é╠â_âCâAâìâOé┼âGâëü[é¬ö¡É╢é╡é▄é╡é╜üB";
var L_ErrorNumber_Text = "âGâëü[: ";
function HandleError(message, url, line)
{
var str = L_Dialog_ErrorMessage + "\n\n"
+ L_ErrorNumber_Text + line + "\n"
+ message;
alert (str);
window.close();
return true;
}
var g_bSearchList = false;
var g_nTimeoutID;
var g_szLastFound = "";
var g_nLastFoundIndex = 0;
var g_nMatchLength = 0;
function GetSampleString()
{
var strReturn = "AaBbYyZz";
if (txtFontName.value != "")
{
switch (dialogHelper.getCharset(txtFontName.value))
{
case 2:
{
strReturn = "Symbol";
break;
}
case 128:
{
strReturn = "Aa\u3042\u3041\u30a2\u30a1\u4e9c\u5b87";
break;
}
case 129:
case 130:
{
strReturn = "\uac00\ub098\ub2e4\u0041\u0061\u0042\u0062\u0059\u0079\u005a\u007a";
break;
}
case 136:
{
strReturn = "\u4e2d\u6587\u5b57\u578b\u7bc4\u4f8b";
break;
}
case 161:
{
strReturn = "AaBb\u0391\u03b1\u0392\u03b2";
break;
}
case 162:
{
strReturn = "AaBb\u011e\u011f\u015e\u015f";
break;
}
case 177:
{
strReturn = "AaBb\u05e0\u05e1\u05e9\u05ea";
break;
}
case 178:
case 179:
{
strReturn = "AaBb\u0639\u0645\u0646\u062e\u0631\u0648\u0643\u0645";
break;
}
case 204:
{
strReturn = "AaBb\u0411\u0431\u0424\u0444";
break;
}
case 238:
{
strReturn = "AaBb\u00c1\u00e1\u00d4\u00f4";
break;
}
case 255:
{
strReturn = "Aa\u00f8\u00f1\u00fd";
break;
}
}
}
return strReturn;
}
function getCheckStateCmd(checkbox, range)
{
checkbox.checked = (true == range.queryCommandState(checkbox.value));
}
function getSelectStateCmd(select, range)
{
var index;
if (null != range.queryCommandValue(select.id.substring(3)))
{
for (index = 0; index < select.options.length; index++)
{
if (select.options[index].value ==
range.queryCommandValue(select.id.substring(3)))
{
select.selectedIndex = index;
break;
}
}
}
else
{
select.selectedIndex = -1;
}
}
function setCheckStateCmd(checkbox, range)
{
if (checkbox.checked !=
(true == range.queryCommandState(checkbox.value)))
{
range.execCommand(checkbox.value, false);
}
}
function setSelectStateCmd(select, range)
{
if (-1 != select.selectedIndex)
{
range.execCommand(select.id.substring(3), false,
select.options[select.selectedIndex].value);
}
}
function NoCaseCompare(str1, str2)
{
var ideo1 = 1 != escape(str1.charAt(0)).length;
var ideo2 = 1 != escape(str2.charAt(0)).length;
if (ideo1 != ideo2)
return ideo1 ? -1 : 1;
if (str1.toLowerCase() < str2.toLowerCase())
return -1;
if (str1.toLowerCase() > str2.toLowerCase())
return 1;
return 0;
}
function fillFontSelect(select)
{
var index;
var fontList = new Array();
var optFontName;
var len = dialogHelper.fonts.length;
for (index = 0; index < len; index++)
{
fontList[index] =
dialogHelper.fonts.item(index);
}
fontList.sort(NoCaseCompare);
for (index = 0; index < fontList.length; index++)
{
optFontName = new Option();
optFontName.value = fontList[index];
optFontName.text = fontList[index];
select.options[index] = optFontName;
}
}
function setFont(range)
{
var FontNameCommand = "FontName";
if (window.event.srcElement == txtFontName ||
window.event.srcElement == cmdFontName)
{
range.text = GetSampleString();
range = getTextRange(elmSample);
}
if (-1 != cmdFontName.selectedIndex)
{
range.execCommand(FontNameCommand, false, txtFontName.value);
}
}
function getFontStyle()
{
var cmdBold = "Bold";
var cmdItalic = "Italic";
var globalDoc = window.dialogArguments;
var range = globalDoc;
with (range)
{
if (queryCommandState(cmdBold) && queryCommandState(cmdItalic))
{
selFontStyle.value = "Bold-Italic";
}
else if (queryCommandState(cmdBold))
{
selFontStyle.value = "Bold";
}
else if (queryCommandState(cmdItalic))
{
selFontStyle.value = "Italic";
}
else
{
selFontStyle.value = "Regular";
}
}
}
function setFontStyle(range)
{
var cmdBold = "Bold";
var cmdItalic = "Italic";
with (range)
{
if ("Bold-Italic" == selFontStyle.value)
{
if (true != queryCommandState(cmdBold))
{
execCommand(cmdBold, false);
}
if (true != queryCommandState(cmdItalic))
{
execCommand(cmdItalic, false);
}
}
else if ("Bold" == selFontStyle.value)
{
if (true != queryCommandState(cmdBold))
{
execCommand(cmdBold, false);
}
if (true == queryCommandState(cmdItalic))
{
execCommand(cmdItalic, false);
}
}
else if ("Italic" == selFontStyle.value)
{
if (true == queryCommandState(cmdBold))
{
execCommand(cmdBold, false);
}
if (true != queryCommandState(cmdItalic))
{
execCommand(cmdItalic, false);
}
}
else
{
if (true == queryCommandState(cmdBold))
{
execCommand(cmdBold, false);
}
if (true == queryCommandState(cmdItalic))
{
execCommand(cmdItalic, false);
}
}
}
}
function getFontColor()
{
var cmdForeColor = "ForeColor";
var globalDoc = window.dialogArguments;
var range = globalDoc;
var intColor = range.queryCommandValue(cmdForeColor);
if (null != intColor)
{
selColor.value = intColor;
if (parseInt(selColor.value) != parseInt(intColor))
{
selColor.customColor = intColor;
selColor.value = "custom";
}
}
else
{
selColor.selectedIndex = -1;
}
}
function setFontColor(range)
{
var cmdForeColor = "ForeColor";
var intDefaultColor = 0;
if (-1 != selColor.selectedIndex)
{
if ("custom" == selColor.value)
{
range.execCommand(cmdForeColor, false,
parseInt(selColor.customColor));
return;
}
else
{
range.execCommand(cmdForeColor, false,
parseInt(selColor.value));
}
}
}
function syncSelect(ctlSelect, ctlText)
{
if (-1 != ctlSelect.selectedIndex)
{
if (ctlText.value.toLowerCase()
== ctlSelect.options[ctlSelect.selectedIndex]
.text.toLowerCase())
{
ctlText.value = ctlSelect.options[ctlSelect.selectedIndex].text;
}
}
}
function syncSelect2(ctlSelect, ctlText)
{
if (-1 != ctlSelect.selectedIndex)
{
ctlText.value = ctlSelect.options[ctlSelect.selectedIndex].text;
}
}
function findMatch (strMatch, optionsList)
{
var index;
var index2;
var bestChar = 0;
var bestMatch = 0;
var strOptText;
for (index = 0; index < optionsList.length; index++)
{
strOptText = optionsList.options[index].text;
for (index2 = bestChar; index2 < strMatch.length; index2++)
{
if (strMatch.substring(0, index2 + 1).toLowerCase() ==
strOptText.substring(0, index2 + 1)
.toLowerCase())
{
bestChar = index2 + 1;
bestMatch = index;
}
else
{
break;
}
}
}
return bestMatch;
}
function updateSample()
{
var rngSample = getTextRange(elmSample);
setCheckStateCmd(chkUnderline, rngSample);
rngSample.text = GetSampleString();
rngSample = getTextRange(elmSample);
setFont(rngSample);
setSelectStateCmd(cmdFontSize, rngSample);
setFontStyle(rngSample);
setFontColor(rngSample);
}
function searchText()
{
var index;
var index2;
var bestChar = g_nMatchLength;
var bestMatch = g_nLastFo