home *** CD-ROM | disk | FTP | other *** search
- <!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));
- }
- 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;
- }
- }
- var g_bSearchList = false;
- var g_nTimeoutID;
- var g_szLastFound = "";
- var g_nLastFoundIndex = 0;
- var g_nMatchLength = 0;
- 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 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();
- 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 (-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);
- 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 && 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 (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();
- }
- 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;
- if ("" != elmSource.value)
- {
- arrSelect["txtFontName"] = cmdFontName;
- arrSelect["txtFontStyle"] = selFontStyle;
- arrSelect["txtFontSize"] = cmdFontSize;
- elmSelect = arrSelect[elmSource.id];
- elmOptions = elmSelect.options;
- elmSelect.selectedIndex = findMatch(elmSource.value,
- elmOptions);
- }
- }
- </SCRIPT>
- <BODY onload="loadBdy()" style="font-family: 'ms sans serif'; font-size: '8pt';
- background: threedface;" id=bdy>
- <DIV style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 0.98em; top: 0.9126em; width: 2.38em; height: 1.2168em; "
- id=divFontName>
- <LABEL for=txtFontName tabIndex=-1 helpid="35420" helpfile="msimn.hlp">
- <u>F</u>ont:</LABEL>
- </DIV>
- <DIV style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 13.86em; top: 0.9126em; width: 4.76em; height: 1.2168em; "
- id=divFontStyle>
- <LABEL for=txtFontStyle tabIndex=-1 helpid="35425" helpfile="msimn.hlp">
- St<u>y</u>le:</LABEL>
- </DIV>
- <DIV style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 20.58em; top: 0.9126em; width: 2.24em; height: 1.2168em; "
- id=divFontSize>
- <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 style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 0.8em; top: 4.2588em; width: 12.2em; height: 9.9739em; "
- ID=cmdFontName name=setCmdID ACCESSKEY=f tabIndex=17 size=7
- helpid="35420" helpfile="msimn.hlp">
- </SELECT>
- <SELECT ID=selFontStyle ACCESSKEY=y size=7 tabIndex=20
- 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=30 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> Smallest </OPTION>
- <OPTION VALUE=2> Smaller </OPTION>
- <OPTION VALUE=3 SELECTED> Normal </OPTION>
- <OPTION VALUE=4> Large </OPTION>
- <OPTION VALUE=5> Larger </OPTION>
- <OPTION VALUE=6> Largest </OPTION>
- <OPTION VALUE=7> Huge </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 style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 3.6em; top: 16.5789em; width: 6.44em; height: 1.521em; "
- id=divUnderline>
- <LABEL for=chkUnderline
- tabIndex=-1><u>U</u>nderline
- </LABEL>
- </DIV>
- <DIV style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 1.96em; top: 18.8604em; width: 2.66em; height: 1.2168em; "
- id=divColo>
- <LABEL helpid="35440" helpfile="msimn.hlp">
- <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
- style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 14.98em; top: 16.5789em; width: 9.24em; height: 5.0277em; "
- id=tblSample1>
- <tr>
- <td style="font-family: ms sans serif; font-size: 8pt;
- left: 14.98em; top: 16.5789em; width: 9.24em; height: 5.0277em; "
- id=tdSample1>
- </td>
- </tr>
- </table>
- <DIV 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" id=divSample2 helpid="35435" helpfile="msimn.hlp">
- <TABLE style="font-family: ms sans serif; font-size: 8pt; width: 8.9em;
- height: 5.0277em; "
- id=tblSample2 helpid="35435" helpfile="msimn.hlp">
- <TR>
- <TD style="font-family: ms sans serif; font-size: 8pt; width: 8.9em;
- height: 5.0277em; " id=tdSample2
- helpid="35435" helpfile="msimn.hlp">
- <CENTER id=elmSample helpid="35435" helpfile="msimn.hlp">
- <NOBR helpid="35435" helpfile="msimn.hlp">
- AaBbYyZz</NOBR></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.1294em; "
- 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.1294em; "
- helpid="28444" helpfile="windows.hlp" type=reset>
- Cancel</BUTTON>
- </BODY>
- </HTML>
-