Displays a custom, modal HTML dialog page. A modal dialog box retains the input focus while open. The user cannot switch windows until the dialog box is closed.
Rhino.HtmlBox (strFileName [, arrArguments [, strOptions]])
|
strFileName |
Required. String. The filename the HTML dialog page to display. | ||||||||||||||||||||||||
|
arrArguments |
Optional. Variant. An argument or a zero-based, one-dimensional array of arguments to pass to the HTML-dialog page. | ||||||||||||||||||||||||
|
strOptions |
Optional. String. The window ornaments for the dialog box, using one or more of the following semicolon-delimited values:
|
|
Variant |
If successful, the return value of the method will be dependant on the developer's implemention of the custom HTML dialog page. |
|
Null |
If not successful, or on error. |
You can also eliminate scroll bars on dialog boxes by setting the SCROLL attribute to false in the body element for the dialog window, or call the modal dialog box from a trusted application.
You can set the default font settings the same way you set Cascading Style Sheets (CSS) attributes (for example, "font:3;font-size:4"). To define multiple font values, use multiple font attributes.
The default unit of measure for dialogHeight and dialogWidth in Internet Explorer 4.0 is the pixel; in Internet Explorer 5 it is the em. The value can be an integer or floating-point number, followed by an absolute units designator (cm, mm, in, pt, or pc) or a relative units designator (em, ex, or px). For consistent results, specify the dialogHeight and dialogWidth in pixels when designing modal dialog boxes.
Although a user can manually adjust the height of a dialog box to a smaller value —provided the dialog box is resizable —the minimum dialogHeight you can specify is 100 pixels.
To override center, even though the default for center is yes, you can specify either dialogLeft and/or dialogTop.
Dim strLayer, strName
strLayer = Rhino.CurrentLayer
strName = Rhino.HtmlBox("RenameCurrentLayer.htm", strLayer, "dialogLeft:0;dialogTop:0")
If Not IsNull(strName) Then
Rhino.RenameLayer strLayer, strName
End If

<HTML id=RenameLayerDialog style="width: 22em; height: 12em">
<HEAD>
<TITLE>Rename Layer</TITLE>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub OnInitDialog()
Dim sArgs
sArgs = window.dialogArguments
If Not IsNull(sArgs) Then
txtOldName.value = CStr(sArgs)
End If
End Sub
Sub OnOk()
Dim sResult
sResult = txtNewName.value
window.returnValue = sResult
window.close
End Sub
Sub OnCancel()
window.returnValue = ""
window.close
End Sub
-->
</SCRIPT>
</HEAD>
<BODY ONLOAD="OnInitDialog()" STYLE="font-family: Arial, sans-serif">
<H3>
<FONT FACE="Verdana,Arial,Times New I2">Enter new layer name</FONT></H3>
<P>
<TABLE CELLPADDING="1" CELLSPACING="2" BORDER="0">
<TR>
<TD VALIGN=CENTER>
<P>
<FONT FACE="Verdana,Arial,Times New I2">Old layer name:</FONT></TD>
<TD VALIGN=CENTER>
<P>
<INPUT TYPE=TEXT NAME="txtOldName" SIZE="25" MAXLENGTH="256"></TD>
</TR>
<TR>
<TD VALIGN=CENTER>
<P>
<FONT FACE="Verdana,Arial,Times New I2">New layer name:</FONT></TD>
<TD VALIGN=CENTER>
<P>
<INPUT TYPE=TEXT NAME="txtNewName" SIZE="25" MAXLENGTH="256"></TD>
</TR>
<TR>
<TD VALIGN=CENTER><DIV ALIGN=RIGHT>
<P ALIGN=RIGHT>
<INPUT TYPE=SUBMIT VALUE="OK" ID="cmdOK" ONCLICK="OnOk()" STYLE="width: 5em; left; border: thin solid THREEDSHADOW"></TD>
<TD VALIGN=CENTER><CENTER>
<P ALIGN=CENTER>
<INPUT TYPE=SUBMIT VALUE="Cancel" ID="cmdCancel" CLASS="button" ONCLICK="OnCancel()" STYLE="width: 5em; left; border: thin solid THREEDSHADOW"></TD>
</TR>
</TABLE>
</P>
</BODY>
</HTML>