PXEvent Class Reference
| Inherits from | NSObject |
| Conforms to | NSCopying PXPooledObject |
| Declared in | PXEvent.h PXEvent.m |
Overview
The base class for all events dispatched through the PXEventDispatcher class.
A PXEvent holds all of the information related to the given event, and is always passed in as the first argument of every event listener invocation by an event listener.
While the PXEvent class is the base for all other event classes, it’s not abstract, meaning that it can be used on its own for several common events.
Tasks
-
bubblesDescribes whether the event participates in the bubbling phase of the event flow.
property -
cancelableDescribes whether the behavior represented by the event may be canceled. If
propertyYES, preventDefault may be used. -
currentTargetThe node in the event flow currently processing the event.
property -
targetThe node representing the ultimate target of the event.
property -
typeA string representing the type of the event
property -
eventPhaseThe event in which the event is currently participating
property -
– initWithType:Makes a new event with the given properties. These properties may not change after the event object is created.
-
– initWithType:bubbles:cancelable:Makes a new event with the given properties. These properties may not change after the event object is created.
-
– preventDefaultCauses the behavior represented by this event to be canceled. Not all events may be canceled. Use the cancelable property to check if this event’s behavior can be canceled.
-
– stopPropagationPrevents the event from being dispatched any further in the event flow.
-
– stopImmediatePropagationStops the event from being dispatched any further, and cancels event dispatching for all remaining event listeners registered to listen for this event.
-
– isDefaultPreventedWhether the preventDefault method has been called on this event.
-
– eventWithType:Makes a event with the given properties. These properties may not change after the event object is created.
-
– eventWithType:bubbles:cancelable:Makes a event with the given properties. These properties may not change after the event object is created.
Properties
bubbles
Describes whether the event participates in the bubbling phase of the event flow.
@property (nonatomic, readonly) BOOL bubblesDeclared In
PXEvent.hcancelable
Describes whether the behavior represented by the event may be canceled. If
YES, preventDefault may be used.
@property (nonatomic, readonly) BOOL cancelableSee Also
Declared In
PXEvent.hcurrentTarget
The node in the event flow currently processing the event.
@property (nonatomic, readonly) id currentTargetDeclared In
PXEvent.heventPhase
The event in which the event is currently participating
@property (nonatomic, readonly) PXEventPhase eventPhaseDeclared In
PXEvent.hInstance Methods
eventWithType:
Makes a event with the given properties. These properties may not change after the event object is created.
- (PXEvent *)eventWithType:(NSString *)typeParameters
- type
A string representing the type of the event
Discussion
Uses default values bubbling = NO and
cancelable = NO.
Declared In
PXEvent.meventWithType:bubbles:cancelable:
Makes a event with the given properties. These properties may not change after the event object is created.
- (PXEvent *)eventWithType:(NSString *)type bubbles:(BOOL)bubbles cancelable:(BOOL)cancelableParameters
- type
A string representing the type of the event
- bubbles
Whether the event should participate in the bubbling phase of the event flow.
- cancelable
Whether the behavior described by the event can be canceled by the user.
Declared In
PXEvent.minitWithType:
Makes a new event with the given properties. These properties may not change after the event object is created.
- (id)initWithType:(NSString *)typeParameters
- type
A string representing the type of the event
Discussion
Uses default values bubbling = NO and
cancelable = NO.
Declared In
PXEvent.minitWithType:bubbles:cancelable:
Makes a new event with the given properties. These properties may not change after the event object is created.
- (id)initWithType:(NSString *)type bubbles:(BOOL)bubbles cancelable:(BOOL)cancelableParameters
- type
A string representing the type of the event
- bubbles
Whether the event should participate in the bubbling phase of the event flow.
- cancelable
Whether the behavior described by the event can be canceled by the user.
Declared In
PXEvent.misDefaultPrevented
Whether the preventDefault method has been called on this event.
- (BOOL)isDefaultPreventedDeclared In
PXEvent.mpreventDefault
Causes the behavior represented by this event to be canceled. Not all events may be canceled. Use the cancelable property to check if this event’s behavior can be canceled.
- (void)preventDefaultDeclared In
PXEvent.m