Event XbpWindow():gesture Foundation
A touch gesture was performed.
:gesture := {|nId, aInfo, self| ... }
:gesture( nId, aInfo ) --> self
xbeP_Gesture (1048672)
This method returns the object executing the method (self).
The operating system provides default behavior for touch gestures on computers featuring a touch digitizer. This allows the Xbase Parts to be operated with the finger in addition to the keyboard and mouse. In cases were the standard behavior provided by the system is insufficient or if a custom Xbase Part class is to be created which is to be made touch-aware, the xbeP_Gesture event can be used to implement custom behavior.
Support for gesture events must be explicitly enabled using the :inputMode member variable. Afterwards, an xbeP_Gesture event is generated by the system whenever a touch gesture is performed by the user.
The <nId> parameter specifies the kind of gesture which is executed. The system recognizes a number of predefined gestures which can be used to move, zoom or otherwise manipulate objects on the screen. The following table lists the touch gestures which are recognized by the system. The corresponding constants are defined in the xbp.ch include file.
Gesture Identifier | Description |
---|---|
XBP_GESTURE_ZOOM | Identifies a two-finger gesture where the distance between the fingers is varied to indicate the scaling or zoom level of an element. |
XBP_GESTURE_PAN | Identifies a swipe gesture executed with one or two fingers which is used to move an element or scroll a window. |
XBP_GESTURE_ROTATE | Identifies a two-finger gesture where the fingers are rotated around a center point to indicate the angle of rotation of an element. |
XBP_GESTURE_TWOFINGERTAP | Identifies a tap gesture executed with two fingers. |
XBP_GESTURE_PRESSANDTAP | Identifies a two-finger gesture in which the first finger is brought down to select an element, and a tap is executed with the second finger. This gesture is often used to trigger a certain standard action on an element, such as opening a context menu. |
The array in the <aInfo> parameter contains additional information about the touch gesture. The values contained in the elements of the array vary with each gesture.
aInfo Array Element | Description |
---|---|
XBP_GESTUREINFO_STARTPOS | Indicates the position the pan gesture was begun at. The element contains an array with the x and y coordinate, specified relative to the desktop object see the AppDesktop() function). |
XBP_GESTUREINFO_POS | Indicates the current position of the pan. |
XBP_GESTUREINFO_LASTPOS | Indicates the position specified in the last xbeP_Gesture event. |
XBP_GESTUREINFO_STARTARGS | Indicates the distance between the two fingers when the gesture was begun. This element is 0 for one-finger pans. |
XBP_GESTUREINFO_ARGS | Specifies the distance between the two fingers executing the gesture. This element is 0 for one-finger pans. |
XBP_GESTUREINFO_LASTARGS | Indicates the distance specified in the last xbeP_Gesture event. |
XBP_GESTUREINFO_STATE | Contains information about the current state of the gesture. See the table below for more information. |
aInfo Array Element | Description |
---|---|
XBP_GESTUREINFO_STARTPOS | Indicates the center point of the zoom. The element contains an array with the x and y coordinate, specified relative to the desktop object (see the AppDesktop() function). |
XBP_GESTUREINFO_POS | Contains the same information as the preview element and can be ignored. |
XBP_GESTUREINFO_LASTPOS | Contains the same information as the previous element and can be ignored. |
XBP_GESTUREINFO_STARTARGS | Indicates the distance between the two fingers when the gesture was begun. |
XBP_GESTUREINFO_ARGS | Indicates the distance between the two fingers executing the gesture. The ratio between the current and the start distance defines the current zoom level. |
XBP_GESTUREINFO_LASTARGS | Indicates the distance specified in the last xbeP_Gesture event. |
XBP_GESTUREINFO_STATE | Contains information about the current state of the gesture. See the table below for more information. |
aInfo Array Element | Description |
---|---|
XBP_GESTUREINFO_STARTPOS | Indicates the center point of the rotation. The element contains an array with the x and y coordinate, specified relative to the desktop object (see the AppDesktop() function). |
XBP_GESTUREINFO_POS | Contains the same information as the previous element and can be ignored. |
XBP_GESTUREINFO_LASTPOS | Contains the same information as the previous element and can be ignored. |
XBP_GESTUREINFO_STARTARGS | Indicates the start angle of the rotation. This element is always 0 for rotate gestures. |
XBP_GESTUREINFO_ARGS | Indicates the current angle of rotation. Positive values indicate a counter-clockwise direction. |
XBP_GESTUREINFO_LASTARGS | Indicates the rotation angle specified in the last xbeP_Gesture event. |
XBP_GESTUREINFO_STATE | Contains information about the current state of the gesture. See the table below for more information. |
aInfo Array Element | Description |
---|---|
XBP_GESTUREINFO_STARTPOS | Indicates the center point between the two fingers. The element contains an array with the x and y coordinate, specified relative to the desktop object (see the AppDesktop() function). |
XBP_GESTUREINFO_POS | Contains the same information as the previous element and can be ignored. |
XBP_GESTUREINFO_LASTPOS | Contains the same information as the previous element and can be ignored. |
XBP_GESTUREINFO_STARTARGS | Indicates the distance between the two fingers executing the gesture. |
XBP_GESTUREINFO_ARGS | Contains the same information as the previous element and be ignored. |
XBP_GESTUREINFO_LASTARGS | Contains the same information as the previous element and can be ignored. |
XBP_GESTUREINFO_STATE | Contains information about the current state of the gesture. See the table below for more information. |
aInfo Array Element | Description |
---|---|
XBP_GESTUREINFO_STARTPOS | Indicates the position the first finger comes down on. The element contains an array with the x and y coordinate, specified relative to the desktop object (see the AppDesktop() function). |
XBP_GESTUREINFO_POS | Contains the same information as the first element. The element can be ignored for the press and tap gesture. |
XBP_GESTUREINFO_LASTPOS | Contains the same information as the first element. The element can be ignored for the press and tap gesture. |
XBP_GESTUREINFO_STARTARGS | Indicates the distance between the first and the second finger. |
XBP_GESTUREINFO_ARGS | Contains the same information as the previous element. Can be ignored for the press and tap gesture. |
XBP_GESTUREINFO_LASTARGS | Contains the same information as the previous element. Can be ignored for the press and tap gesture. |
XBP_GESTUREINFO_STATE | Contains information about the current state of the gesture. See the table below for more information. |
The last array element (XBP_GESTUREINFO_STATE) contains information about the current state of the gesture. The element contains a combination of the constants listed in the following table.
Constant | Description |
---|---|
XBP_GESTURESTATE_BEGIN | The xbeP_Gesture event marks the beginning of the gesture. |
XBP_GESTURESTATE_END | The gesture is finished. The xbeP_Gesture event is the last for the current gesture. |
XBP_GESTURESTATE_HASINERTIA | The gesture has triggered inertia. In this case, the system continues to generate xbeP_Gesture events after the gesture is finished. Inertiagenerated events have this state flag set. |
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.