The DFrame class is a graphical object representing a squared surface.
new DFrame(position, title, DFrameStyle, parentDFrame)
position
Array. The position of the left top, right top, right top and right bottom corners.
See position of objects for more information.
title
String. The title of the DFrame, as it will be shown in the title bar and buttons for this DFrame in taskBars.
dFrameStyle
The style that will be used to build the DFrame. See DFrameStyle
parentDFrame
The DFrame on wich the DFrame will be created. If omitted the DFrame is created on the window object of the browser.
This parent DFrame will be important for the new DFrame:
§ positions are relatives to the parent DFrame (except when use a array as parameter for a position)
§ If the parent DFrame is not yet created it will be created before the new DFrame.
§ If the parent DFrame is closed (closeDFrame method) or hidden (show method) all DFrames this DFrame contains will be closed or hidden
Positions are always based on the free space of the parent DFrame. The free space is the space remaining free after additions of borders, title bars and other bars.
See also the setOverlayParentBars method of DFrameStyle and the setFreezeXXXXXSide methods of BarStyle classes.
Consider the code:
var dFrame1 = new DFrame(parameters)
var dFrame2 = new DFrame(position, title, dFrameStyle, dFrame1)
dFrame2.show()
dFrame1.addBar()
This code will launch an error message as
§ parent DFrame for dFrame2 is dFrame1. So dFrame1 will be automatically before the creation of dFrame2
§ It is not possible to add a bar on a created DFrame.
Same thing if a parameter of the dFrame2's position refers to dFrame1.
As the creation occurs with the show method the following code is correct:
var dFrame1 = new DFrame(parameters)
var dFrame2 = new DFrame(position, title, dFrameStyle, dFrame1)
dFrame1.addBar()
dFrame2.show()
Consider the code:
var dFrame1 = new DFrame(parameters)
dFrame1.setURL(url)
var dFrame2 = new DFrame([10, 10, 90, 90], title, dFrameStyle, dFrame1)
dFrame2.show()
dFrameAPI hide the content of a DFrame if it is recovered - even partially - by another DFrame.
The page of dFrame1 will so never be seen in Internet Explorer (and Netscape if dFrame1 contains a form) as it will be hidden by dFrame2.
A parameter allow to create hidden DFrame in the setURL method:
dFrame.setURL(url, false)
This is useful if the hidden dFrame contains a form used in conjunction with the formBuffer object.
However Netscape 6 does not allow access to forms contained in invisible IFrames.
DFrames containing forms and having to remain invisible will have to be created with positions set to 0:
var dFrame = new DFrame([0, 0, 0, 0], title, dFrameStyle)
Another problem, always for Netscape 6 only, is that Netscape 6 does not create valid IFrames having dimensions less than 16 px x 17px (!). All IFrames for NS6 will so have those minimal sizes, even if they are contained by DFrames having 0 as width and height dimensions. The content of the form has then to be hidden with a <br> tag at its beginning.