Reference for the Mosaic class Core::DragEvent
The class Core::DragEvent provides a specialized event object able to deliver drag events. These events are sent when the user has touched the screen and then moved the finger. See the method DriveCursorMovement() of the class Core::Root.
The event contains information about the position where the user has tapped (HittingPos), the current position after the drag operation (CurrentPos), the displacement since the last drag event (Offset), etc.
The drag events are sent together with the cursor events Core::CursorEvent.
var point CurrentPos;
The variable 'CurrentPos' stores the current cursor position. This position is valid in the coordinate space of the owner of the target view. In this manner the position can be compared directly with the coordinates of the view.
var int32 Finger;
The variable 'Finger' identifies the finger as an event source within a multi-touch environment. The fingers are numbered with values lying in the range 0 .. 9.
var point GlobalCurrentPos;
The variable 'GlobalCurrentPos' stores the current cursor position expressed in the global (screen) coordinate space.
var point GlobalHittingPos;
The variable 'GlobalHittingPos' stores the position where the user has touched the screen. This is the origin position at the beginning of the grab cycle. This position is expressed in the global (screen) coordinate space.
var point HittingPos;
The variable 'HittingPos' stores the position where the user has touched the screen. This is the origin position at the beginning of the grab cycle. This position is valid in the coordinate space of the owner of the target view. In this manner the position can be compared directly with the coordinates of the view.
var int32 HoldPeriod;
The variable 'HoldPeriod' stores the time in milliseconds how long the user is pressing the finger on the screen. This variable is very useful if the view needs to perform an operation after some time is elapsed. At the begin of the grab cycle the HoldPeriod == 0.
method Core::DragEvent Initialize
arg int32 aFinger,
arg point aCurrentPos,
arg point aHittingPos,
arg point aOffset,
arg int32 aHoldPeriod,
arg int32 aSequelCount,
arg point aHitOffset,
arg point aGlobalCurrentPos,
arg point aGlobalHittingPos
The method Initialize() simplifies the initialization of this Core::DragEvent object. This method stores the given parameters in the variables of this event object and returns this event object to the caller.
var point Offset;
The variable 'Offset' stores the displacement since the last drag event.
var int32 StrikeCount;
The variable 'StrikeCount' stores how often the user has tapped the screen in succession. It is one, if the user has single tapped it. It is two if a double tap took place, and so far.
Such series of taps are recognized only when the taps are performed very quickly and the user doesn't move the finger very much. The appropriate time delay and the valid range for the movement are determined by the properties CursorDragLimit and CursorSequelDelay of the class Core::Root.