DELPHI FMX uses both Longtap and tap

Source: Internet
Author: User

When applied to the Manage icon, such as long press the show delete flag, click Cancel to remove the flag.
In the FMX gesture management, only long press LONGTAP, tap Tap is a separate event and cannot be managed in the same event.
After executing the LONGTAP, tap will also be triggered?, the solution, to determine whether long press and click the same position:
Add variable
Taploaction:tpointf??;

Procedure Tform1.form1gesture (Sender:tobject; Const Eventinfo:tgestureeventinfo; var handled:boolean);?
Begin
Case Eventinfo.gestureid of
Igilongtap:begin?
Taplocation:= eventinfo.location;?
{Execute Longtap}
End;?
End;?
End;???

Procedure Tform1.form1tap (sender:tobject; const point:tpointf);
Begin?
If Point<>taplocation then begin?
taplocation.x:=0;?
taplocation.y:=0;?
{Execute tap}
End;?
End;??

After testing, it was found that more desirable results,

Also need to add a timer to set the time interval,

In the Ontap event, whether or not the time interval is exceeded to respond,

Avoid long presses and respond when you let go.

DELPHI FMX uses both Longtap and tap

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.