Skip to main content
Version: 4.16

DragEvent

A drag event. The only drag event currently supported is DRAGGED, which will be issued every time the input system detects a drag.

See: Event

Inherits from: Event

Public Types#

enumDragEventType { DRAGGED }
Values that represent drag event types.

Public Functions#

DragEvent(DragEventType type, int16_t fromX, int16_t fromY, int16_t toX, int16_t toY)
Initializes a new instance of the DragEvent class.
int16_tgetDeltaX() const
Gets the distance in x coordinates (how long was the drag).
int16_tgetDeltaY() const
Gets the distance in y coordinates (how long was the drag).
virtual Event::EventTypegetEventType()
Gets event type.
int16_tgetNewX() const
Gets the new x coordinate (dragged to).
int16_tgetNewY() const
Gets the new x coordinate (dragged to).
int16_tgetOldX() const
Gets the x coordinate where the drag operation was started (dragged from).
int16_tgetOldY() const
Gets the y coordinate where the drag operation was started (dragged from).
DragEventTypegetType() const
Gets the type of this drag event.

Additional inherited members#

Public Types inherited from Event#

enumEventType { EVENT_CLICK, EVENT_DRAG, EVENT_GESTURE }
The event types.

Public Functions inherited from Event#

virtual ~Event()
Finalizes an instance of the Event class.

Public Types Documentation#

DragEventType#

Values that represent drag event types.

DRAGGEDAn enum constant representing the dragged option.

Public Functions Documentation#

DragEvent#

DragEvent(DragEventTypetype ,
int16_tfromX ,
int16_tfromY ,
int16_ttoX ,
int16_ttoY
)

Initializes a new instance of the DragEvent class.

Parameters:
typeThe type of the drag event.
fromXThe x coordinate of the drag start position (dragged from)
fromYThe y coordinate of the drag start position (dragged from)
toXThe x coordinate of the new position (dragged to)
toYThe y coordinate of the new position (dragged to)

getDeltaX#

int16_t getDeltaX()const

Gets the distance in x coordinates (how long was the drag).

Returns:

The distance of this drag event.

getDeltaY#

int16_t getDeltaY()const

Gets the distance in y coordinates (how long was the drag).

Returns:

The distance of this drag event.

getEventType#

virtual Event::EventType getEventType()

Gets event type.

Returns:

The type of this event.

Reimplements: touchgfx::Event::getEventType

getNewX#

int16_t getNewX()const

Gets the new x coordinate (dragged to).

Returns:

The new x coordinate (dragged to).

getNewY#

int16_t getNewY()const

Gets the new x coordinate (dragged to).

Returns:

The new y coordinate (dragged to).

getOldX#

int16_t getOldX()const

Gets the x coordinate where the drag operation was started (dragged from).

Returns:

The x coordinate where the drag operation was started (dragged from).

getOldY#

int16_t getOldY()const

Gets the y coordinate where the drag operation was started (dragged from).

Returns:

The y coordinate where the drag operation was started (dragged from).

getType#

DragEventType getType()const

Gets the type of this drag event.

Returns:

The type of this drag event.