#include <Pt/Forms/TouchEvent.h>

Touch press, move, or release. More...

Inherits BasicEvent< T >.

Public Member Functions

 TouchEvent ()
 Creates an event without a target.
 
 TouchEvent (Widget &widget)
 Creates an event targeted at widget.
 
void clear ()
 Resets the touch data while retaining the target.
 
void setId (Pt::uint64_t widgetId)
 Sets the target widget ID to widgetId.
 
Pt::uint64_t widgetId () const
 Returns the target widget ID.
 
Widgetwidget () const
 Returns the target widget, or 0 when no target is set.
 
void setWidget (Widget *widget)
 Sets the target widget and its ID.
 
const Gfx::PointFposition () const
 Returns the touch position in local coordinates.
 
void setPosition (const Gfx::PointF &pos)
 Sets the touch position to pos.
 
double x () const
 Returns the local horizontal touch position.
 
void setX (double x)
 Sets the local horizontal touch position to x.
 
double y () const
 Returns the local vertical touch position.
 
void setY (double y)
 Sets the local vertical touch position to y.
 
Pt::uint32_t trackingId () const
 Returns the identity of the tracked touch.
 
void setTrackingId (Pt::uint32_t tid)
 Sets the tracked touch identity to tid.
 
double pressure () const
 Returns the touch pressure.
 
void setPressure (double p)
 Sets the touch pressure to p.
 
bool isMove () const
 Returns true when the event reports touch movement.
 
void setMove ()
 Changes the event to touch movement.
 
bool isPressed () const
 Returns true if touch device is in pressed state.
 
bool isPress () const
 Returns true if touch device was just pressed.
 
void setPress ()
 Changes the event to a touch press.
 
bool isRelease () const
 Returns true if touch device was released.
 
void setRelease ()
 Changes the event to a touch release.
 
Eventclone (Allocator &allocator) const
 Clones this event using an allocator.
 
void destroy (Allocator &allocator)
 Destroys this event using an allocator.
 
const std::type_info & typeInfo () const
 Returns the type info for this class of events.
 

Static Public Member Functions

template<typename EventT >
static EventcopyConstruct (const EventT &ev, Allocator &allocator)
 Copies an event using an allocator.
 
template<typename EventT >
static void destruct (EventT &ev, Allocator &allocator)
 Destructs an event using an allocator.
 

Detailed Description

The event carries a local position and a touch identity. The widget pointer and widget ID identify the target.