
CHAPTER 4: User-Interface Tools Window object 119
addEventListener()
windowObj.addEventListener (eventName, handler[, capturePhase]);
eventName
The event name string. Predefined event names include:
change changing
move moving
resize resizing
show enterKey
focus blur
mousedown mouseup
mousemove mouseover
mouseout
click
(detail = 1 for single, 2 for double)
handler
The function to register for the specified event in this target. This can be the
name of a function defined in the extension, or a locally defined handler
function to be executed when the event occurs. A handler function takes one
argument, the UIEvent base class
. See “Registering event listeners for windows
or controls” on page 82.
capturePhase
Optional. When true, the handler is called only in the capturing phase of the
event propagation. Default is false, meaning that the handler is called in the
bubbling phase if this object is an ancestor of the target, or in the at-target
phase if this object is itself the target.
Registers an event handler for a particular type of event occurring in this window.
Returns
undefined.
center()
windowObj.center ([window])
window
Optional. A Window object.
Centers this window on the screen, or with respect to another specified window.
Returns
undefined.
close()
windowObj.close ([result])
result
Optional. A number to be returned from the show method that invoked this
window as a modal dialog.
Closes this window. If an onClose
callback is defined for the window, calls that function before
closing the window.
Returns
undefined.
dispatchEvent()
windowObj.dispatchEvent (eventObj)
eventObj
A UIEvent base class.
Simulates the occurrence of an event in this target. A script can create a UIEvent base class
for a
specific event and pass it to this method to start the event propagation for the event.
Returns false if any of the registered listeners that handled the event called the event object’s
preventDefault()
method, true otherwise.
Comentários a estes Manuais