domapi.Window
See also:
Elm See also:
Component
This component mimics a browser window, with these important differences:
Exists within your main page -- not subject to popup blockers.
Can be fully skinned to match your application.
Can behave modally, even if the browser does not support modal dialogs.
Can function as an MDI group.
The 'visibleButtons' constructor attribute is an integer value made up of the summation of one of more button constants. The available button constants are:
wbMinimize
wbMaximize
wbHelp
wbClose
So for example if you wanted to show the minimize, maximize and close buttons, you'd pass
visibleButtons: wbMinimize + wbMaximize + wbClose
The windowType attribute defaults to "DIV", but can be any block HTMLElement type. When windowType is "IFRAME", you can use the Window.loadURL() method to set its url.
Window Example:
system ,
aqua
Window Constructor
var window1 = domapi.Window({
btnH : 14,
btnW : 16,
minH : 40,
minW : 120,
doModal : false,
resizeBdr : 20,
minimizedW : 150,
separatorW : 2,
windowType : "DIV",
doAllowMove : true,
captionAlign : "left",
titlePadding : 2,
controlsAlign : "right",
doAllowResize : true,
doManageFocus : true,
destroyOnClose : true,
doIframeShield : true,
doManageShield : true,
titleBarHeight : 20,
visibleButtons : 1+2+8,
doCreateButtons : true,
showContentsWhileDragging : false
});
Also inherits the construtor arguments of
Elm and
Component .
Constructor Details
Parameter
Type
Default
Description
btnH
integer
14
btnW
integer
16
minH
integer
40
minW
integer
120
doModal
boolean
false
resizeBdr
integer
20
minimizedW
integer
150
separatorW
integer
2
windowType
String
DIV
doAllowMove
boolean
true
captionAlign
String
left
titlePadding
integer
2
controlsAlign
String
right
doAllowResize
boolean
true
doManageFocus
boolean
true
destroyOnClose
boolean
true
doIframeShield
boolean
true
doManageShield
boolean
true
titleBarHeight
integer
20
visibleButtons
integer
1+2+8
doCreateButtons
boolean
true
showContentsWhileDragging
boolean
false
Events unique to domapi.Window
Methods unique to domapi.Window
Events
back to top
Return false to disallow the closing of the window.
back to top
back to top
back to top
back to top
back to top
Fires after the url for the window has changed (if type is IFRAME).
back to top
back to top
back to top
back to top
Fires when the window is resized.
back to top
back to top
Methods
Toggles the movability of the window. When this is false, the user cannot drag the window.
Parameters:
Parameter
Type
Required
Default
Description
allow
boolean
Y
back to top
Sets whether or not the user is allowed to resize the window.
Parameters:
Parameter
Type
Required
Default
Description
allow
boolean
Y
back to top
Removes the window from the page. If you set 'destroyOnClose' to true during construction, the window is freed from memory as well.
back to top
If the type of window is an IFRAME, then this method can load a page into it. The site need not come from the same server, but the developer is responsible for dealing with any XSS issues.
Parameters:
Parameter
Type
Required
Default
Description
url
String
Y
back to top
Maximizes the window. Maximized windows grow to the same proportions as their parent.
back to top
Minimizes the window. Minimixed windows are displayed in the lower left portion of their parent container.
back to top
If a window was previously closed (and destroyOnClose was false) then this method will restore the visibility of the window.
back to top
Returns a maximized or minimized window to its previous dimensions.
back to top
Makes this window the 'active' one. Effectively this focuses the window and brings it to the front of the z-index.
back to top
Changes the CSS alignment of the title text.
Parameters:
Parameter
Type
Required
Default
Description
align
String
Y
left, center, right
back to top
Turns the modal attribute of the window on or off. When a window is modal, the user cannot interact with any other portion of the screen.
Parameters:
Parameter
Type
Required
Default
Description
modal
boolean
Y
back to top
Changes the title of the window.
Parameters:
Parameter
Type
Required
Default
Description
text
String
Y
back to top
Hides or shows the titlebar.
Parameters:
Parameter
Type
Required
Default
Description
show
boolean
Y
back to top
Adds a given HTMLElement into the workspace of the window. Not applicable if the window is an IFRAME.
Parameters:
Parameter
Type
Required
Default
Description
element
HTMLElement
Y
back to top