Adobe InDesign CS4 (6.0) Object Model JS: UIEvent

InDesign CS4

Class

UIEvent

 

Encapsulates input event information for an event that propagates through a container and control hierarchy.

Implements W3C standard event handling. This object is passed to a function that you register to respond to events of a certain type that occur in a window or control. Use windowObj.addEventListener() or controlObj.addEventListener() to register a handler function.

QuickLinks

UIEvent, initEvent, initUIEvent, preventDefault, stopPropagation

Properties

PropertyTypeAccessDescription
bubblesbool readonlyTrue if the event is of a type that bubbles.
cancelablebool readonly True if the default action associated with the event can be canceled with preventDefault().
capturesbool readonlyTrue if this event can be captured.
currentTargetbool readonlyThe event target object which is currently handling the event. During capturing and bubbling, this is different from the property target.
detailAny readonlyPassed in to initEvent(); it can e.g. be a mouse click count.
eventPhaseString readonly The current phase of event propagation; one of none, target, capture, bubble.
targetObject readonly The event target object for this event.
timeStampDate readonly The date and time at which the event occurred.
typeString readonly The name of the event that this Event object represents.
viewAny readonly

Methods

Constructor

UIEvent UIEvent (type: String[, captures: bool=false][, bubbles: bool=false][, view: Object][, detail: Number])
Creates an event.
The UIEvent object is normally created by ScriptUI and passed to your event handler. However, you can simulate a user action by constructing an event object and sending it to a target object’s dispatchEvent() function.

ParameterTypeDescription
typeStringThe event type. See UIEvent.type property.
capturesboolSet to true if this event can be captured. (default: false)
bubblesboolSet to true if the event bubbles. (default: false)
viewObjectThe ScriptUI element that this event relates to. (Optional)
detailNumberThis value sets the detail property; it can e.g. be a mouse click count. (Optional)

Instances

void initEvent (type: String[, captures: bool=false][, bubbles: bool=false][, cancelable: bool=false])
Initializes an UI event as a core W3C event.

ParameterTypeDescription
typeStringThe event type.
capturesboolSet to true if this event can be captured. (default: false)
bubblesboolSet to true if the event bubbles. (default: false)
cancelableboolSet to true if the default action is cancelable. (default: false)

void initUIEvent (type: String[, captures: bool=false][, bubbles: bool=false][, view: Object][, detail: Number])
Initializes an event.

ParameterTypeDescription
typeStringThe event type.
capturesboolSet to true if this event can be captured. (default: false)
bubblesboolSet to true if the event bubbles. (default: false)
viewObjectThe ScriptUI element that this event relates to. (Optional)
detailNumberThis value sets the detail property; it can e.g. be a mouse click count. (Optional)

void preventDefault ()
Calling this function causes the default action associated with this event not to be called.

void stopPropagation ()
Stops the propagation of this event.

Return

UIEvent UIEvent.UIEvent (type: String[, captures: bool=false][, bubbles: bool=false][, view: Object][, detail: Number])

UIEvent Window (SUI).dispatchEvent ()

Jongware, 20-Jun-2010 v3.0.3dContents :: Index