home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merlin VR High Speed Real Time 3D
/
mvr_1_0.iso
/
data1.cab
/
Program_DLLs
/
Mshtml.dll
/
HTML
/
FORCHAR.DLG
< prev
next >
Wrap
Text File
|
2000-09-15
|
21KB
|
753 lines
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
<HTML id=dlgFont STYLE="font-family: ms sans serif; font-size: 8pt;
width: 35.4em; height: 26.9em">
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE id=dialogTitle>
Font
</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
function HandleError(message, url, line)
{
var L_Dialog_ErrorMessage = "An error has occured in this dialog.";
var L_ErrorNumber_Text = "Error: ";
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 (window.dialogArguments.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)
{
if (str1.toLowerCase() < str2.toLowerCase())
return -1;
if (str1.toLowerCase() > str2.toLowerCase())
return 1;
return 0;
}
function fillFontSelect(select)
{
var index;
var globalDoc = window.dialogArguments.document;
var range = globalDoc.selection.createRange();
var fontList = new Array();
var optFontName;
for (index = 0; index < window.dialogArguments.fonts.length; index++)
{
fontList[index] =
window.dialogArguments.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.document;
var range = globalDoc.selection.createRange();
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.document;
var range = globalDoc.selection.createRange();
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 = 33554432;
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 customColor()
{
if ("custom" == selColor.value)
{
selColor.customColor
= window.dialogArguments.choosecolordlg(selColor.customColor);
}
}
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_nLastFoundIndex;
var strOptText;
var optionsList = cmdFontName.options;
var strMatch = txtFontName.value;
if (strMatch.length == 0)
{
cmdFontName.selectedIndex = -1;
g_nMatchLength = 0;
g_nLastFoundIndex = 0;
g_bSearchList = false;
g_szLastFound = "";
return;
}
if (strMatch.length >= g_szLastFound.length
&& (strMatch.substring(0, g_nMatchLength).toLowerCase()
== g_szLastFound.substring(0, g_nMatchLength).toLowerCase()))
{
index = g_nLastFoundIndex;
}
else
{
index = 0;
bestChar = 0;
}
for (; index < optionsList.length; index++)
{
strOptText = optionsList.options[index].text;
for (index2 = bestChar; index2 < strMatch.length; index2++)
{
if (strMatch.substring(index2, index2 + 1).toLowerCase() ==
strOptText.substring(index2, index2 + 1)
.toLowerCase())
{
bestChar = index2 + 1;
bestMatch = index;
g_nLastFoundIndex = bestMatch;
g_nMatchLegth = bestChar;
}
else
{
break;
}
}
if (bestChar > 0 && index < optionsList.options.length - 2 &&
optionsList.options[index + 1].text
.substring(bestChar - 1, bestChar).toLowerCase()
!= strMatch.substring(bestChar - 1, bestChar).toLowerCase())
{
break;
}
}
cmdFontName.selectedIndex = bestMatch;
g_bSearchList = false;
g_szLastFound = txtFontName.value;
}
function syncTextFont()
{
if (40 == window.event.keyCode &&
cmdFontName.selectedIndex < cmdFontName.options.length - 1)
{
cmdFontName.selectedIndex = cmdFontName.selectedIndex + 1;
txtFontName.value =
cmdFontName.options(cmdFontName.selectedIndex).text;
txtFontName.select();
return;
}
if (38 == window.event.keyCode && cmdFontName.selectedIndex)
{
cmdFontName.selectedIndex = cmdFontName.selectedIndex - 1;
txtFontName.value
= cmdFontName.options(cmdFontName.selectedIndex).text;
txtFontName.select();
return;
}
if (g_szLastFound.toLowerCase() == txtFontName.value.toLowerCase())
{
return;
}
if (g_bSearchList)
{
window.clearTimeout(g_nTimeoutID);
}
g_bSearchList = true;
g_nTimeoutID = window.setTimeout("searchText()", 200);
}
function loadBdy()
{
var doc = window.dialogArguments.document;
var L_InsideFrameset_ErrorMessage =
"This command is not available because the page contains frames.";
if (doc.parentWindow.frames.length > 0 &&
doc.all.tags("IFRAME").length == 0)
{
alert(L_InsideFrameset_ErrorMessage);
window.close();
}
var rngCurrent = doc.selection.createRange();
document.onhelp = new Function("callHelp(window.event.srcElement)");
document.onmouseup = new Function("mouseClick()");
txtFontName.onblur = new
Function("syncSelect(cmdFontName, txtFontName)");
txtFontName.onfocus = new Function("txtFontName.select()");
txtFontName.onchange = new
Function("setFont(getTextRange(elmSample))");
txtFontName.onkeyup = new Function("syncTextFont()");
txtFontName.onfocus = new Function("txtFontName.select()");
txtFontName.onkeypress = new Function("txtDefaultESC()");
txtFontStyle.onblur = new
Function("syncSelect(selFontStyle, txtFontStyle)");
txtFontStyle.onfocus = new Function("txtFontStyle.select()");
txtFontStyle.onchange = new Function("setFontStyle" +
"(getTextRange(elmSample))");
txtFontStyle.onkeyup = new Function("synchText()");
txtFontStyle.onfocus = new Function("txtFontStyle.select()");
txtFontStyle.onkeypress = new Function("txtDefaultESC()");
txtFontSize.onblur = new
Function("syncSelect(cmdFontSize, txtFontSize)");
txtFontSize.onfocus = new Function("txtFontSize.select()");
txtFontSize.onchange = new
Function("setSelectStateCmd(cmdFontSize, " +
"getTextRange(elmSample))");
txtFontSize.onkeyup = new Function("synchText()");
txtFontSize.onfocus = new Function("txtFontSize.select()");
txtFontSize.onkeypress = new Function("txtDefaultESC()");
cmdFontName.onchange = new Function("syncSelect2(cmdFontName, txtFontName);" +
"setFont(getTextRange(elmSample))");
selFontStyle.onchange = new Function("syncSelect2(selFontStyle," +
"txtFontStyle);" +
"setFontStyle(getTextRange(elmSample))");
cmdFontSize.onchange = new Function("syncSelect2(cmdFontSize, txtFontSize);" +
"setSelectStateCmd(cmdFontSize, getTextRange(elmSample))");
chkUnderline.onclick = new Function("setCheckStateCmd(chkUnderline," +
"getTextRange(elmSample))");
selColor.onchange = new Function("customColor();" +
"setFontColor(getTextRange(elmSample))");
btnOK.onclick = new Function("btnOKClick()");
btnCancel.onclick = new Function("btnCancelClick()");
fillFontSelect(cmdFontName);
getCheckStateCmd(chkUnderline, rngCurrent);
getSelectStateCmd(cmdFontName, rngCurrent);
getSelectStateCmd(cmdFontSize, rngCurrent);
getFontStyle();
selColor.customColor = 0;
getFontColor();
syncSelect2(cmdFontName, txtFontName);
syncSelect2(selFontStyle, txtFontStyle);
syncSelect2(cmdFontSize, txtFontSize);
txtFontName.select();
g_szLastFound = txtFontName.value;
updateSample();
txtFontName.focus();
}
function btnOKClick()
{
var globalDoc = window.dialogArguments.document;
var range = globalDoc.selection.createRange();
setCheckStateCmd(chkUnderline, range);
setSelectStateCmd(cmdFontSize, range);
setFont(range);
setFontColor(range);
setFontStyle(range);
range.select();
window.close();
}
function synchText()
{
var index;
var elmSource = window.event.srcElement;
var arrSelect = new Array();
var elmSelect;
var elmOptions;
arrSelect["txtFontName"] = cmdFontName;
arrSelect["txtFontStyle"] = selFontStyle;
arrSelect["txtFontSize"] = cmdFontSize;
elmSelect = arrSelect[elmSource.id];
elmOptions = elmSelect.options;
if (40 == window.event.keyCode &&
elmSelect.selectedIndex < elmOptions.length - 1)
{
elmSelect.selectedIndex = elmSelect.selectedIndex + 1;
elmSource.value = elmOptions(elmSelect.selectedIndex).text;
elmSource.select();
return;
}
if (38 == window.event.keyCode && elmSelect.selectedIndex)
{
elmSelect.selectedIndex = elmSelect.selectedIndex - 1;
elmSource.value = elmOptions(elmSelect.selectedIndex).text;
elmSource.select();
return;
}
if ("" != elmSource.value)
{
elmSelect.selectedIndex = findMatch(elmSource.value,
elmOptions);
}
}
</SCRIPT>
<BODY id=bdy onload="loadBdy()" style="font-family: 'ms sans serif'; font-size: 8pt;
background: threedface;">
<DIV id=divFontName style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 0.98em; top: 0.9126em; width: 2.38em; height: 1.2168em;">
<LABEL for=txtFontName tabIndex=-1 helpid="35420" helpfile="msimn.hlp">
<u>F</u>ont:</LABEL>
</DIV>
<DIV id=divFontStyle style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 13.86em; top: 0.9126em; width: 4.76em; height: 1.2168em;">
<LABEL for=txtFontStyle tabIndex=-1 helpid="35425" helpfile="msimn.hlp">
St<u>y</u>le:</LABEL>
</DIV>
<DIV id=divFontSize style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 20.58em; top: 0.9126em; width: 2.24em; height: 1.2168em;">
<LABEL for=txtFontSize tabIndex=-1 helpid="35430" helpfile="msimn.hlp">
<u>S</u>ize:</LABEL>
</DIV>
<INPUT type=text ID=txtFontName ACCESSKEY=f tabIndex=5
style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 0.98em; top: 2.3em; width: 12.04em; height: 1.9773em; "
helpid="35420" helpfile="msimn.hlp">
<INPUT type=text ID=txtFontStyle ACCESSKEY=y tabIndex=10
style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 13.86em; top: 2.3em; width: 5.8em; height: 1.9773em; "
helpid="35425" helpfile="msimn.hlp">
<INPUT type=text ID=txtFontSize ACCESSKEY=s tabIndex=15
style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 20.58em; top: 2.3em; width: 4.8em; height: 1.9773em; "
helpid="35430" helpfile="msimn.hlp">
<SELECT ID=cmdFontName style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 0.8em; top: 4.2588em; width: 12.2em; height: 9.9739em; "
name=setCmdID ACCESSKEY=f tabIndex=-1 size=7
helpid="35420" helpfile="msimn.hlp">
</SELECT>
<SELECT ID=selFontStyle ACCESSKEY=y size=7 tabIndex=-1
style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 13.7em; top: 4.2588em; width: 6em; height: 9.9739em; "
helpid="35425" helpfile="msimn.hlp">
<OPTION VALUE=Regular SELECTED> Regular </OPTION>
<OPTION VALUE=Italic> Italic </OPTION>
<OPTION VALUE=Bold> Bold </OPTION>
<OPTION VALUE=Bold-Italic> Bold Italic </OPTION>
</SELECT>
<SELECT ID=cmdFontSize ACCESSKEY=s size=7 tabIndex=-1 name=setCmdID
style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 20.4em; top: 4.2588em; width: 5em; height: 9.9739em; "
helpid="35430" helpfile="msimn.hlp">
<OPTION VALUE=1> 8 </OPTION>
<OPTION VALUE=2> 10 </OPTION>
<OPTION VALUE=3 SELECTED> 12 </OPTION>
<OPTION VALUE=4> 14 </OPTION>
<OPTION VALUE=5> 18 </OPTION>
<OPTION VALUE=6> 24 </OPTION>
<OPTION VALUE=7> 36 </OPTION>
</SELECT>
<FIELDSET id=fldEffects style="font-family: ms sans serif; font-size: 8pt;
position: absolute; left: 0.98em; top: 14.6em; width: 12.04em;
height: 8.8em;">
<LEGEND>
Effects
</LEGEND>
</FIELDSET>
<INPUT ID=chkUnderline ACCESSKEY=u type=checkbox tabIndex=35 value=Underline
name=setCmdID helpid="35445" helpfile="msimn.hlp"
style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 1.66em; top: 16.1789em; width: 1em; height: 1em; ">
<DIV id=divUnderline style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 3.6em; top: 16.5789em; width: 6.44em; height: 1.521em;">
<LABEL for=chkUnderline
tabIndex=-1><u>U</u>nderline
</LABEL>
</DIV>
<DIV id=divColor style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 1.96em; top: 18.8604em; width: 2.66em; height: 1.2168em;">
<LABEL helpid="35440" helpfile="msimn.hlp" for=selColor>
<u>C</u>olor:</LABEL>
</DIV>
<SELECT ID=selColor ACCESSKEY=c tabIndex=55
style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 1.96em; top: 20.3814em; width: 9.94em; height: 1.21em; "
helpid="35440" helpfile="msimn.hlp">
<OPTION value=33554432> Black </OPTION>
<OPTION value=50331647> White </OPTION>
<OPTION value=33587200> Green </OPTION>
<OPTION value=33554560> Maroon </OPTION>
<OPTION value=33587328> Olive </OPTION>
<OPTION value=41943040> Navy </OPTION>
<OPTION value=41943168> Purple </OPTION>
<OPTION value=41975936> Gray </OPTION>
<OPTION value=33619967> Yellow </OPTION>
<OPTION value=33619712> Lime </OPTION>
<OPTION value=50331392> Aqua </OPTION>
<OPTION value=50266367> Fuchsia </OPTION>
<OPTION value=46186688> Silver </OPTION>
<OPTION value=33554687> Red </OPTION>
<OPTION value=50266112> Blue </OPTION>
<OPTION value=41975808> Teal </OPTION>
<OPTION value=custom> Custom </OPTION>
</SELECT>
<FIELDSET id=fldSample style="font-family: ms sans serif; font-size: 8pt; position:
absolute; left: 13.86em; top: 14.6em; width: 11.4em; height: 8.8em;">
<LEGEND helpid="35435" helpfile="msimn.hlp">
Sample
</LEGEND>
</FIELDSET>
<table cellspacing borderColorDark=threedhighlight
borderColorLight=threedshadow noshade="yes" border=1 id=tblSample1
style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 14.98em; top: 16.5789em; width: 9.24em; height: 5.0277em;">
<tr>
<td id=tdSample1 style="font-family: ms sans serif; font-size: 8pt;
left: 14.98em; top: 16.5789em; width: 9.24em; height: 5.0277em;">
</td>
</tr>
</table>
<DIV id=divSample2 style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 14.98em; top: 16.5789em; width: 8.9em; height: 5.0277em;
overflow: hidden" helpid="35435" helpfile="msimn.hlp">
<TABLE id=tblSample2 style="font-family: ms sans serif; font-size: 8pt; width: 8.9em;
height: 5.0277em; " helpid="35435" helpfile="msimn.hlp">
<TR>
<TD id=tdSample2 style="font-family: ms sans serif; font-size: 8pt; width: 8.9em;
height: 5.0277em; "
helpid="35435" helpfile="msimn.hlp">
<CENTER>
<DIV id=elmSample>
<NOBR helpid="35435" helpfile="msimn.hlp">
AaBbYyZz</NOBR></DIV></CENTER>
</TD>
</TR>
</TABLE>
</DIV>
<BUTTON id=btnOK tabIndex=60
style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 26.6em; top: 2.2815em; width: 7em; height: 2.2em; "
helpid="28443" helpfile="windows.hlp" type=submit>
OK</BUTTON>
<BUTTON id=btnCancel tabIndex=70
style="font-family: ms sans serif; font-size: 8pt; position: absolute;
left: 26.6em; top: 4.7151em; width: 7em; height: 2.2em; "
helpid="28444" helpfile="windows.hlp" type=reset>
Cancel</BUTTON>
</BODY>
</HTML>