home *** CD-ROM | disk | FTP | other *** search
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
- <HTML id=dlgImage STYLE="font-family: ms sans serif; font-size: 8pt;
- width: 40.1em; height: 18em">
- <HEAD>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <TITLE>
- Picture
- </TITLE>
- <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;
- }
- }
- function setOKState(fKeyPress) { var htmlKeyAlt = 18; if (!fKeyPress || htmlKeyAlt != event.keyCode) { if (("" == txtFileName.value) == g_fOKEnabled) { btnOK.disabled = g_fOKEnabled; g_fOKEnabled = !g_fOKEnabled; } } else { window.setTimeout("set" + "OK" + "State(false)", 50); } }
- var g_fOKEnabled = false;
- function btnBrowseClick()
- {
- var L_Picture_DIALOG_Title_DialogTitle = "Picture";
- var L_Picture_DIALOG_FileTypes_Text = "GIF and JPEG (*.gif, *.jpg)|*.gif;*.jpg|Bitmap (*.bmp)|*.bmp|Windows Metafile (*.wmf)|*.wmf|XBM (*.xbm)|*.xbm|ART (*.art)|*.art|All files (*.*)|*.*|";
- var strFileName;
- strFileName = window.dialogArguments.openfiledlg("","",
- L_Picture_DIALOG_FileTypes_Text,L_Picture_DIALOG_Title_DialogTitle);
- if ("" != strFileName)
- {
- txtFileName.value = strFileName;
- }
- setOKState(false);
- }
- function getProtocolFromURL(strURL)
- {
- var index;
- return strURL.substring(0, strURL.indexOf(":") + 1);
- }
- function bdyLoad()
- {
- var elmSelectedImage;
- var htmlSelectionControl = "Control";
- var globalDoc = window.dialogArguments.document;
- var grngMaster = globalDoc.selection.createRange();
- txtFileName.onfocus = new Function("txtFileName.select()");
- txtFileName.onkeypress = new Function("txtDefaultESC()");
- txtAltText.onfocus = new Function("txtAltText.select()");
- txtAltText.onkeypress = new Function("txtDefaultESC()");
- txtHorizontal.onfocus = new Function("txtHorizontal.select()");
- txtHorizontal.onkeypress = new Function("txtDefaultESC()");
- txtBorder.onfocus = new Function("txtBorder.select()");
- txtBorder.onkeypress = new Function("txtDefaultESC()");
- txtVertical.onfocus = new Function("txtVertical.select()");
- txtVertical.onkeypress = new Function("txtDefaultESC()");
- btnBrowse.onclick = new Function("btnBrowseClick()");
- btnOK.onclick = new Function("btnOKClick()");
- btnCancel.onclick = new Function("btnCancelClick()");
- document.onhelp = new Function("callHelp(window.event.srcElement)");
- document.onmouseup = new Function("mouseClick()");
- txtFileName.onkeyup = new Function("setOKState(true)");
- txtFileName.fImageLoaded = false;
- txtFileName.intImageWidth = 0;
- txtFileName.intImageHeight = 0;
- if (globalDoc.selection.type == htmlSelectionControl)
- {
- if (grngMaster.length == 1)
- {
- elmSelectedImage = grngMaster.item(0);
- if (elmSelectedImage.tagName == "IMG")
- {
- txtFileName.fImageLoaded = true;
- txtFileName.value = elmSelectedImage.src;
- txtFileName.intImageHeight = elmSelectedImage.height;
- txtFileName.intImageWidth = elmSelectedImage.width;
- txtVertical.value = elmSelectedImage.vspace;
- txtHorizontal.value = elmSelectedImage.hspace;
- txtBorder.value = elmSelectedImage.border;
- txtAltText.value = elmSelectedImage.alt;
- selAlignment.value = elmSelectedImage.align;
- }
- }
- }
- setOKState(false);
- }
- function testTextValue(txtBox)
- {
- var val = parseInt(txtBox.value);
- if (isNaN(val) || val < 0 || val > 999)
- {
- return false;
- }
- return true;
- }
- function btnOKClick()
- {
- var elmImage;
- var intAlignment;
- var L_HorizontalNotNumber_ErrorMessage
- = "Horizontal spacing must be a number between 0 and 999.";
- var L_VerticalNotNumber_ErrorMessage
- = "Vertical spacing must be a number between 0 and 999.";
- var L_BoderNotNumber_ErrorMessage
- = "Border thickness must be a number between 0 and 999.";
- var cmdInsertImage = "InsertImage";
- var cmdDelete = "Cut";
- var htmlSelectionControl = "Control";
- var globalDoc = window.dialogArguments.document;
- var grngMaster = globalDoc.selection.createRange();
- if ("" != txtHorizontal.value)
- {
- if (!testTextValue(txtHorizontal))
- {
- alert(L_HorizontalNotNumber_ErrorMessage);
- txtHorizontal.focus();
- return;
- }
- }
- if ("" != txtBorder.value)
- {
- if (!testTextValue(txtBorder))
- {
- alert(L_BoderNotNumber_ErrorMessage);
- txtBorder.focus();
- return;
- }
- }
- if ("" != txtVertical.value)
- {
- if (!testTextValue(txtVertical))
- {
- alert(L_VerticalNotNumber_ErrorMessage);
- txtVertical.focus();
- return;
- }
- }
- if (globalDoc.selection.type == htmlSelectionControl
- && !txtFileName.fImageLoaded)
- {
- grngMaster.execCommand(cmdDelete);
- grngMaster = globalDoc.selection.createRange();
- }
- if (!txtFileName.fImageLoaded)
- {
- grngMaster.execCommand(cmdInsertImage);
- grngMaster.moveStart("character", -1);
- elmImage = grngMaster.parentElement();
- }
- else
- {
- elmImage = grngMaster.item(0);
- grngMaster = getTextRange(elmImage);
- }
- if ("" == getProtocolFromURL(txtFileName.value))
- {
- elmImage.src = "file://" + txtFileName.value;
- }
- else
- {
- elmImage.src = txtFileName.value;
- }
- if (txtHorizontal.value != "")
- {
- elmImage.hspace = parseInt(txtHorizontal.value);
- }
- else
- {
- elmImage.hspace = 0;
- }
- if (txtVertical.value != "")
- {
- elmImage.vspace = parseInt(txtVertical.value);
- }
- else
- {
- elmImage.vspace = 0;
- }
- elmImage.alt = txtAltText.value;
- if (txtBorder.value != "")
- {
- elmImage.border = parseInt(txtBorder.value);
- }
- else
- {
- elmImage.border = 0;
- }
- if (txtFileName.fImageLoaded)
- {
- elmImage.style.width = txtFileName.intImageWidth;
- elmImage.style.height = txtFileName.intImageHeight;
- }
- elmImage.align = selAlignment.value;
- grngMaster.collapse(false);
- grngMaster.select();
- window.close();
- }
- </SCRIPT>
- </HEAD>
- <BODY onload="bdyLoad()" style="font-family: ms sans serif; font-size: 8pt;
- background: threedface;">
- <DIV style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 0.98em; top: 1.2168em; width: 7em; height: 1.2168em; "
- id=divFileName>
- <LABEL FOR=txtFileName tabIndex=-1
- helpid="35450" helpfile="msimn.hlp">
- <U>P</U>icture Source:
- </LABEL>
- </DIV>
- <INPUT type=text style="font-family: ms sans serif; font-size: 8pt;
- position: absolute; left: 8.54em; top: 1.0647em; width: 13.58em;
- height: 2.1294em; " helpid="35450" helpfile="msimn.hlp"
- ID=txtFileName tabIndex=10 ACCESSKEY=p>
- <DIV style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 0.98em; top: 4.1067em; width: 6.58em; height: 1.2168em; "\
- id=divAltText>
- <LABEL FOR=txtAltText tabIndex=-1
- helpid="35455" helpfile="msimn.hlp">
- Alternate <u>T</u>ext:
- </LABEL>
- </DIV>
- <INPUT type=text ID=txtAltText tabIndex=15 ACCESSKEY=t
- style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 8.54em; top: 3.8025em; width: 21.5em; height: 2.1294em; "
- helpid="35455" helpfile="msimn.hlp">
- <BUTTON style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 22.96em; top: 1.0647em; width: 7em; height: 2.1294em; "
- ID=btnBrowse ACCESSKEY=r tabIndex=12 helpid="35462" helpfile="msimn.hlp">
- B<U>r</U>owse...
- </BUTTON>
- <FIELDSET id=fldLayout style="font-family: ms sans serif; font-size: 8pt;
- position: absolute; left: .9em; top: 7.1em; width: 17.08em;
- height: 7.6em;">
- <LEGEND>
- Layout
- </LEGEND>
- </FIELDSET>
- <FIELDSET style="font-family: ms sans serif; font-size: 8pt;
- position: absolute; left: 18.9em; top: 7.1em; width: 11em;
- height: 7.6em;" id=fldSpacing>
- <LEGEND>
- Spacing
- </LEGEND>
- </FIELDSET>
- <DIV style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 1.82em; top: 9.126em; width: 4.76em; height: 1.2168em; " id=divAlign>
- <LABEL FOR=selAlignment tabIndex=-1 helpid="35465" helpfile="msimn.hlp">
- <U>A</U>lignment:
- </LABEL>
- </DIV>
- <SELECT size=1 ID=selAlignment tabIndex=20 ACCESSKEY=a
- style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 10.36em; top: 8.8218em; width: 6.72em; height: 1.2168em; "
- helpid="35465" helpfile="msimn.hlp">
- <OPTION value=""> Not set </OPTION>
- <OPTION value=left> Left </OPTION>
- <OPTION value=right> Right </OPTION>
- <OPTION value=textTop> Texttop </OPTION>
- <OPTION value=absMiddle> Absmiddle </OPTION>
- <OPTION value=baseline SELECTED> Baseline </OPTION>
- <OPTION value=absBottom> Absbottom </OPTION>
- <OPTION value=bottom> Bottom </OPTION>
- <OPTION value=middle> Middle </OPTION>
- <OPTION value=top> Top </OPTION>
- </SELECT>
- <DIV style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 19.88em; top: 9.126em; width: 4.76em; height: 1.2168em; " id=divHoriz>
- <LABEL FOR=txtHorizontal tabIndex=-1 helpid="35475" helpfile="msimn.hlp">
- <U>H</U>orizontal:
- </LABEL>
- </DIV>
- <INPUT style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 24.92em; top: 8.8218em; width: 4.2em; height: 2.1294em; "
- type=text size=3 value="" ID=txtHorizontal tabIndex=25 ACCESSKEY=h
- helpid="35475" helpfile="msimn.hlp">
- <DIV style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 1.82em; top: 12.0159em; width: 8.12em; height: 1.2168em; " id=divBorder>
- <LABEL tabIndex=-1 FOR=txtBorder helpid="35470" helpfile="msimn.hlp">
- <u>B</u>order Thickness:
- </LABEL>
- </DIV>
- <INPUT style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 10.36em; top: 11.5596em; width: 6.72em; height: 2.1294em; "
- type=text size=3 value="" ID=txtBorder tabIndex=21 ACCESSKEY=b
- helpid="35470" helpfile="msimn.hlp">
- <DIV style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 19.88em; top: 12.0159em; width: 3.64em; height: 1.2168em; " id=divVert>
- <LABEL FOR=txtVertical tabIndex=-1 helpid="35480" helpfile="msimn.hlp">
- <U>V</U>ertical:
- </LABEL>
- </DIV>
- <INPUT style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 24.92em; top: 11.5596em; width: 4.2em; height: 2.1294em; "
- type=text size=3 value="" ID=txtVertical tabIndex=30 ACCESSKEY=v
- helpid="35480" helpfile="msimn.hlp">
- <BUTTON style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 31.36em; top: 1.0647em; width: 7em; height: 2.1294em; " type=submit
- ID=btnOK tabIndex=40 DISABLED=1 helpid="28443" helpfile="windows.hlp">
- OK
- </BUTTON>
- <BUTTON style="font-family: ms sans serif; font-size: 8pt; position: absolute;
- left: 31.36em; top: 3.6504em; width: 7em; height: 2.1294em; " type=reset
- ID=btnCancel tabIndex=45 helpid="28444" helpfile="windows.hlp">
- Cancel
- </BUTTON>
- </BODY>
- </HTML>
-