From Clomosy Docs

Revision as of 08:59, 5 December 2023 by ClomosyManager (talk | contribs)

The "Gesture" event refers to the event triggered by a specific movement or action on a component (such as an image or a form). These types of events allow users to interact with a specific component by moving, zooming, rotating, or performing other touch gestures using a touch screen or a mouse.

For example, in a mobile application, to zoom in on an image, the user can spread two fingers on the screen to perform a "pinch" gesture. When such a gesture is detected, the corresponding component's "Gesture" event is triggered.

These types of events are commonly used on touch screen devices and in mobile applications. The handling of these events may vary depending on the programming language or development platform used.

Feature Use of Definition
tbeOnGesture MyForm.AddNewEvent(GestureImg, tbeOnGesture, 'BtnOnGesture'); It refers to the event triggered by a specific movement or action on a particular component (such as an image or a form).
clSetTouchIG MyForm.clSetTouchIG(igPan,GestureImg); It is a function used to handle touch events on Android devices.
igLongTap MyForm.clSetTouchIG(igLongTap,GestureImg); It is an event triggered when a user presses and holds on a touch device for an extended period. This event is used to detect that a touch has been sustained on the screen for a specific duration.
igZoom MyForm.clSetTouchIG(igZoom,GestureImg); It refers to a feature that allows users to zoom in or out on content, such as an image.
igRotate MyForm.clSetTouchIG(igRotate,GestureImg); It refers to the process of rotating the object.
igPan MyForm.clSetTouchIG(igPan,GestureImg);

It typically means the action of scrolling content within a program or platform. This action enables the content to move in a specific direction, such as up, down, left, or right.

clFormGestureEvent_GestureID MyForm.clFormGestureEvent_GestureID It is a value that specifies the type of gesture (Gesture ID) that occurs on a form. This value contains the identifier of a specific gesture, such as zoom, rotate, etc.


Example:

Basic Syntax
var
 myForm:TclForm;
 GestureLbl:TclLabel;
 GestureImg:TClImage;

 Procedure BtnOnGesture;
 begin
   GestureLbl.Text := 'Gesture Event : ' + IntToStr(MyForm.clFormGestureEvent_GestureID);
 End;

begin
 myForm := TClForm.Create(Self);
 GestureLbl := myForm.AddNewLabel(MyForm, 'GestureLbl','--');
 GestureLbl.Align := alMostTop;
 GestureLbl.Height := 20;

 GestureImg := myForm.AddNewImage(MyForm, 'GestureImg');
 MyForm.setImage(GestureImg,'https://clomosy.com/demos/bg.png');
 GestureImg.Align := alBottom;
 GestureImg.Height := 300;
 GestureImg.Width := 300;

 MyForm.clSetTouchIG(igLongTap,GestureImg); 

 MyForm.AddNewEvent(GestureImg, tbeOnGesture, 'BtnOnGesture');

 myForm.Run;

End;
TRObject Syntax
var
myForm:TclForm;
GestureLbl:TclLabel;
GestureImg:TClImage;

void BtnOnGesture;
{
  GestureLbl.Text = 'Gesture Event : ' + IntToStr(MyForm.clFormGestureEvent_GestureID);
}

{
myForm = TClForm.Create(Self);
GestureLbl = myForm.AddNewLabel(MyForm, 'GestureLbl','--');
GestureLbl.Align = alMostTop;
GestureLbl.Height = 20;

GestureImg = myForm.AddNewImage(MyForm, 'GestureImg');
MyForm.setImage(GestureImg,'https://clomosy.com/demos/bg.png');
GestureImg.Align = alBottom;
GestureImg.Height = 300;
GestureImg.Width = 300;

MyForm.clSetTouchIG(igLongTap,GestureImg); 

MyForm.AddNewEvent(GestureImg, tbeOnGesture, 'BtnOnGesture');

myForm.Run;

}