From Clomosy Docs

No edit summary
No edit summary
Line 1: Line 1:
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.
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.<br>


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.
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.<br>


<div class="alert alert-warning" role="alert" data-bs-theme="light">
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.
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.
</div>


<div class="table-responsive">
{| class="wikitable" style="border: 2px solid #c3d7e0"
{| class="wikitable" style="border: 2px solid #c3d7e0"
! style="background-color: #c3d7e0"| Feature !!style="background-color: #c3d7e0"| Use of !!style="background-color: #c3d7e0"|Definition  
! style="background-color: #c3d7e0"| Feature !!style="background-color: #c3d7e0"| Use of !!style="background-color: #c3d7e0"| 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).
| tbeOnGesture ||Form1.AddNewEvent(GestureImg, tbeOnGesture, 'BtnOnGesture'); //GestureImg:TclImage || 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.
| clSetTouchIG ||Form1.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.
| igLongTap || Form1.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.
| igZoom ||Form1.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.
| igRotate ||Form1.clSetTouchIG(igRotate,GestureImg); || It refers to the process of rotating the object.
|-
|-
| igPan ||MyForm.clSetTouchIG(igPan,GestureImg); ||  
| igPan ||Form1.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.
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.
| clFormGestureEvent_GestureID ||Form1.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.
|}
|}
</div>




'''Example:'''<br>


var
<b>Example</b><br>
myForm:TclForm;
<pre>
GestureLbl:TclLabel;
var
GestureImg:TClImage;
  myForm:TclForm;
  GestureLbl:TclLabel;
void BtnOnGesture;
  GestureImg:TClImage;
{
 
  GestureLbl.Text = 'Gesture Event : ' + IntToStr(MyForm.clFormGestureEvent_GestureID);
void BtnOnGesture;
}
{
  GestureLbl.Text = 'Gesture Event : ' + IntToStr(MyForm.clFormGestureEvent_GestureID);
{
}
myForm = TClForm.Create(Self);
 
GestureLbl = myForm.AddNewLabel(MyForm, 'GestureLbl','--');
{
GestureLbl.Align = alMostTop;
  myForm = TClForm.Create(Self);
GestureLbl.Height = 20;
  GestureLbl = myForm.AddNewLabel(MyForm, 'GestureLbl','--');
  GestureLbl.Align = alMostTop;
GestureImg = myForm.AddNewImage(MyForm, 'GestureImg');
  GestureLbl.Height = 20;
MyForm.setImage(GestureImg,'https://clomosy.com/demos/bg.png');
 
GestureImg.Align = alBottom;
  GestureImg = myForm.AddNewImage(MyForm, 'GestureImg');
GestureImg.Height = 300;
  MyForm.setImage(GestureImg,'https://clomosy.com/demos/bg.png');
GestureImg.Width = 300;
  GestureImg.Align = alBottom;
  GestureImg.Height = 300;
MyForm.clSetTouchIG(igLongTap,GestureImg);  
  GestureImg.Width = 300;
 
MyForm.AddNewEvent(GestureImg, tbeOnGesture, 'BtnOnGesture');
  MyForm.clSetTouchIG(igLongTap,GestureImg);  
 
myForm.Run;
  MyForm.AddNewEvent(GestureImg, tbeOnGesture, 'BtnOnGesture');
 
}
  myForm.Run;
}
</pre>
 
<h2> See Also </h2>
* [[Sensor Structures]]
* [[Components]]
* [[Object Properties]]

Revision as of 13:08, 19 November 2024

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.

Feature Use of Definition
tbeOnGesture Form1.AddNewEvent(GestureImg, tbeOnGesture, 'BtnOnGesture'); //GestureImg:TclImage It refers to the event triggered by a specific movement or action on a particular component (such as an image or a form).
clSetTouchIG Form1.clSetTouchIG(igPan,GestureImg); It is a function used to handle touch events on Android devices.
igLongTap Form1.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 Form1.clSetTouchIG(igZoom,GestureImg); It refers to a feature that allows users to zoom in or out on content, such as an image.
igRotate Form1.clSetTouchIG(igRotate,GestureImg); It refers to the process of rotating the object.
igPan Form1.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 Form1.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

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;
}

See Also