Class zwt.event.ClickEvent
Extends
zwt.event.UIEvent.
A click event is emitted when a click event occurs on a widget.
Defined in: ClickEvent.js.
Constructor Attributes | Constructor Name and Description |
---|---|
zwt.event.ClickEvent(event, zwt_ui_Widget_widget, int_type)
Construct a click event.
|
Field Attributes | Field Name and Description |
---|---|
<static> |
zwt.event.ClickEvent.CLICK
Constant used to indicate a click event
|
<static> |
zwt.event.ClickEvent.DOUBLE_CLICK
Constant used to indicate a doubleClick event
|
<static> |
zwt.event.ClickEvent.LEFT_CLICK
Constant used to indicate the left mouse button
|
<static> |
zwt.event.ClickEvent.MIDDLE_CLICK
Constant used to indicate the middle mouse button
|
<static> |
zwt.event.ClickEvent.RIGHT_CLICK
Constant used to indicate the right mouse button
|
Method Attributes | Method Name and Description |
---|---|
Return the mouse button that was pressed.
|
|
getX()
Return the horizontal position of the cursor when the event occurs.
|
|
getY()
Return the vertical position of the cursor when the event occurs.
|
|
isAlt()
Return true if the Alt key was pressed when the event occurs.
|
|
isCtrl()
Return true if the Ctrl key was pressed when the event occurs.
|
|
isMeta()
Return true if the Meta key was pressed when the event occurs.
|
|
isShift()
Return true if the Shift key was pressed when the event occurs.
|
- Methods borrowed from class zwt.event.UIEvent:
- getBrowserEvent, getBrowserEventTarget, getReturn, getWidget, setReturn
- Methods borrowed from class zwt.event.Event:
- getType, isCancelBubble, setCancelBubble, touch
Class Detail
zwt.event.ClickEvent(event, zwt_ui_Widget_widget, int_type)
Construct a click event.
Author: Jeremy KUHN.
Author: Jeremy KUHN.
- Parameters:
- {Event} event
- The javaScript event object
- {zwt.ui.Widget} zwt_ui_Widget_widget
- The widget linked to the event
- {Integer} int_type
- The event type
Field Detail
<static>
{Integer}
zwt.event.ClickEvent.CLICK
Constant used to indicate a click event
<static>
{Integer}
zwt.event.ClickEvent.DOUBLE_CLICK
Constant used to indicate a doubleClick event
<static>
{Integer}
zwt.event.ClickEvent.LEFT_CLICK
Constant used to indicate the left mouse button
<static>
{Integer}
zwt.event.ClickEvent.MIDDLE_CLICK
Constant used to indicate the middle mouse button
<static>
{Integer}
zwt.event.ClickEvent.RIGHT_CLICK
Constant used to indicate the right mouse button
Method Detail
{Integer}
getButton()
Return the mouse button that was pressed.
- Returns:
- One of zwt.event.ClickEvent.LEFT_CLICK, zwt.event.ClickEvent.MIDDLE_CLICK or zwt.event.ClickEvent.RIGHT_CLICK
{Integer}
getX()
Return the horizontal position of the cursor when the event occurs.
- Returns:
- The X position
{Integer}
getY()
Return the vertical position of the cursor when the event occurs.
- Returns:
- The Y position
{Boolean}
isAlt()
Return true if the Alt key was pressed when the event occurs.
- Returns:
- true if Alt was pressed
{Boolean}
isCtrl()
Return true if the Ctrl key was pressed when the event occurs.
- Returns:
- true if Ctrl was pressed
{Boolean}
isMeta()
Return true if the Meta key was pressed when the event occurs.
- Returns:
- true if Meta was pressed
{Boolean}
isShift()
Return true if the Shift key was pressed when the event occurs.
- Returns:
- true if Shift was pressed