home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 2001 May
/
VPR0105A.BIN
/
MSIE_55
/
IENT_S4.CAB
/
IENT_4.CAB
/
MSHTMLER.DLL
/
HTML
/
INSIMAGE.DLG
< prev
next >
Wrap
Text File
|
2000-06-19
|
12KB
|
377 lines
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
<HTML id=dlgImage STYLE="font-family: MS UI Gothic; font-size: 9pt;
width: 40.1em; height: 18em">
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<TITLE>
画像
</TITLE>
<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 = "このダイアログでエラーが発生しました。";
var L_ErrorNumber_Text = "エラー : ";
function HandleError(message, url, line)
{
var str = L_Dialog_ErrorMessage + "\n\n"
+ L_ErrorNumber_Text + line + "\n"
+ message;
alert (str);
window.close();
return true;
}
function setOKState(fEvent) { if (fEvent && (event.propertyName != "value")) { return; } if (("" == txtFileName.value) == g_fOKEnabled) { btnOK.disabled = g_fOKEnabled; g_fOKEnabled = !g_fOKEnabled; } } var g_fOKEnabled = false;
function btnBrowseClick()
{
var L_Picture_DIALOG_Title_DialogTitle = "画像";
var L_Picture_DIALOG_FileTypes_Text = "GIF および JPEG (*.gif, *.jpg)|*.gif;*.jpg|ビットマップ (*.bmp)|*.bmp|Windows メタファイル (*.wmf)|*.wmf|XBM (*.xbm)|*.xbm|ART (*.art)|*.art|すべてのファイル (*.*)|*.*|";
var strFileName;
strFileName = dialogHelper.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;
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.onpropertychange = 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;
if (elmSelectedImage.src)
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);
txtFileName.focus();
}
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
= "横の間隔には 0 から 999 の数字を入力してください。";
var L_VerticalNotNumber_ErrorMessage
= "縦の間隔には 0 から 999 の数字を入力してください。";
var L_BoderNotNumber_ErrorMessage
= "外枠の太さには 0 から 999 の数字を入力してください。";
var cmdInsertImage = "InsertImage";
var cmdDelete = "Delete";
var htmlSelectionControl = "Control";
var globalDoc = window.dialogArguments;
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();
}
idstr = "\" id=\"c2eec6217e1a474eb649bfedd577334a";
if (!txtFileName.fImageLoaded)
{
grngMaster.execCommand(cmdInsertImage, false, idstr);
elmImage = globalDoc.all.c2eec6217e1a474eb649bfedd577334a;
elmImage.removeAttribute("id");
elmImage.removeAttribute("src");
grngMaster.moveStart("character", -1);
}
else
{
elmImage = grngMaster.item(0);
if (elmImage.src != txtFileName.value)
{
grngMaster.execCommand(cmdDelete);
grngMaster = globalDoc.selection.createRange();
grngMaster.execCommand(cmdInsertImage, false, idstr);
elmImage = globalDoc.all.c2eec6217e1a474eb649bfedd577334a;
elmImage.removeAttribute("id");
elmImage.removeAttribute("src");
grngMaster.moveStart("character", -1);
txtFileName.fImageLoaded = false;
}
grngMaster = getTextRange(elmImage);
}
if (txtFileName.fImageLoaded)
{
elmImage.style.width = txtFileName.intImageWidth;
elmImage.style.height = txtFileName.intImageHeight;
}
if (txtFileName.value.length > 2040)
txtFileName.value = txtFileName.value.substring(0,2040);
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;
}
elmImage.align = selAlignment.value;
grngMaster.collapse(false);
grngMaster.select();
window.close();
}
</SCRIPT>
</HEAD>
<BODY id=bdy onload="bdyLoad()" style="font-family: MS UI Gothic;
font-size: 9pt; background: threedface; color: windowtext;" scroll=no>
<OBJECT ID="dialogHelper" CLASSID="CLSID:3050f4e1-98b5-11cf-bb82-00aa00bdce0b"
HEIGHT=0 WIDTH=0 tabindex=-1>
</OBJECT>
<DIV id=divFileName style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
left: 0.98em; top: 1.2168em; width: 7em; height: 1.2168em; ">
<LABEL id=lblFileName FOR=txtFileName tabIndex=-1
helpid="35450" helpfile=msoe.hlp>
ファイル名(<U>P</U>):
</LABEL>
</DIV>
<INPUT ID=txtFileName type=text style="font-family: MS UI Gothic; font-size: 9pt;
position: absolute; left: 8.54em; top: 1.0647em; width: 13.58em;
height: 1.7em; " tabIndex=10 ACCESSKEY=p
helpid="35450" helpfile=msoe.hlp>
<DIV id=divAltText style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
left: 0.98em; top: 4.1067em; width: 7.5em; height: 1.2168em; ">
<LABEL id=lblAltText FOR=txtAltText tabIndex=-1
helpid="35455" helpfile=msoe.hlp>
代替テキスト(<U>T</U>):
</LABEL>
</DIV>
<INPUT type=text ID=txtAltText tabIndex=15 ACCESSKEY=t
style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
left: 8.54em; top: 3.8025em; width: 21.5em; height: 1.7em; "
helpid="35455" helpfile=msoe.hlp>
<BUTTON ID=btnBrowse style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
left: 22.96em; top: 1.0647em; width: 7em; height: 1.8em; "
ACCESSKEY=r tabIndex=12 helpid="35462" helpfile=msoe.hlp>
参照(<U>R</U>)...
</BUTTON>
<FIELDSET id=fldLayout style="font-family: MS UI Gothic; font-size: 9pt;
position: absolute; left: .9em; top: 7.1em; width: 17.08em;
height: 7.6em;">
<LEGEND id=lgdLayout>
レイアウト
</LEGEND>
</FIELDSET>
<FIELDSET id=fldSpacing style="font-family: MS UI Gothic; font-size: 9pt;
position: absolute; left: 18.9em; top: 7.1em; width: 11em;
height: 7.6em;">
<LEGEND id=lgdSpacing>
間隔
</LEGEND>
</FIELDSET>
<DIV id=divAlign style="font-family: MS UI Gothic; font-size: 9pt;
position: absolute; left: 1.82em; top: 9.126em; width: 4.76em;
height: 1.2168em; ">
<LABEL id=lblAlignment FOR=selAlignment tabIndex=-1 helpid="35465"
helpfile=msoe.hlp>
配置(<U>A</U>):
</LABEL>
</DIV>
<SELECT size=1 ID=selAlignment tabIndex=20 ACCESSKEY=a
style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
left: 9.36em; top: 8.8218em; width: 7.5em; height: 1.2168em; "
helpid="35465" helpfile=msoe.hlp>
<OPTION id=optNotSet value=""> 設定なし </OPTION>
<OPTION id=optLeft value=left> 左 </OPTION>
<OPTION id=optRight value=right> 右 </OPTION>
<OPTION id=optTexttop value=textTop> 上 (テキスト) </OPTION>
<OPTION id=optAbsMiddle value=absMiddle> 全体の中央 </OPTION>
<OPTION id=optBaseline value=baseline SELECTED> ベースライン </OPTION>
<OPTION id=optAbsBottom value=absBottom> 全体の下 </OPTION>
<OPTION id=optBottom value=bottom> 下 </OPTION>
<OPTION id=optMiddle value=middle> 中央 </OPTION>
<OPTION id=optTop value=top> 上 </OPTION>
</SELECT>
<DIV id=divHoriz style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
left: 19.88em; top: 9.126em; width: 4.76em; height: 1.2168em; ">
<LABEL id=lblHorizontal FOR=txtHorizontal tabIndex=-1 helpid="35475"
helpfile=msoe.hlp>
横(<U>H</U>):
</LABEL>
</DIV>
<INPUT ID=txtHorizontal style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
left: 24.92em; top: 8.8218em; width: 4.2em; height: 1.7em; ime-mode: disabled;"
type=text size=3 value="" tabIndex=25 ACCESSKEY=h
helpid="35475" helpfile=msoe.hlp>
<DIV id=divBorder style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
left: 1.82em; top: 12.0159em; width: 8.12em; height: 1.2168em; ">
<LABEL id=lblBorder tabIndex=-1 FOR=txtBorder helpid="35470"
helpfile=msoe.hlp>
外枠の太さ(<U>B</U>):
</LABEL>
</DIV>
<INPUT ID=txtBorder style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
left: 9.36em; top: 11.5596em; width: 7.5em; height: 1.7em; ime-mode: disabled;"
type=text size=3 value="" tabIndex=21 ACCESSKEY=b
helpid="35470" helpfile=msoe.hlp>
<DIV id=divVert style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
left: 19.88em; top: 12.0159em; width: 3.64em; height: 1.2168em; ">
<LABEL id=lblVertical FOR=txtVertical tabIndex=-1 helpid="35480"
helpfile=msoe.hlp>
縦(<U>V</U>):
</LABEL>
</DIV>
<INPUT ID=txtVertical style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
left: 24.92em; top: 11.5596em; width: 4.2em; height: 1.7em; ime-mode: disabled;"
type=text size=3 value="" tabIndex=30 ACCESSKEY=v
helpid="35480" helpfile=msoe.hlp>
<BUTTON ID=btnOK style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
left: 31.36em; top: 1.0647em; width: 7em; height: 1.8em; " type=submit
tabIndex=40 DISABLED=1 helpid="28443" helpfile="windows.hlp">
OK
</BUTTON>
<BUTTON ID=btnCancel style="font-family: MS UI Gothic; font-size: 9pt; position: absolute;
left: 31.36em; top: 3.6504em; width: 7em; height: 1.8em; " type=reset
tabIndex=45 helpid="28444" helpfile="windows.hlp">
キャンセル
</BUTTON>
</BODY>
</HTML>