AlanScottAgain 1 Posted April 17, 2023 Hi, I couldn't find any information this. When I capture a long tap - I get the tap event fired as well. Is this right? I want to set a value on tap and clear it on long tap. Its messy at the moment with the events being called in sequence. Thanks Alan Share this post Link to post
programmerdelphi2k 237 Posted April 17, 2023 see in your disk by Embarcadero samples: c:\users\Public\...\Samples\Object Pascal\Mobile Snippets\InteractiveGestures\TapAndHold Share this post Link to post
AlanScottAgain 1 Posted April 18, 2023 Many thanks I was aware of the demos 😉 And am doing similar. It seems that if I use ShowMessage to display the event action, something must happen with the message queue as I get multiple showmesage popups. if I just update a label - all works fine. this simple code generates multiple popups for me? procedure TForm1.FormGesture(Sender: TObject; const EventInfo: TGestureEventInfo; var Handled: Boolean); begin if EventInfo.GestureID = igiLongTap then begin Label1.Text:= 'Long Tap'; TDialogService.MessageDialog('Did you mean to long press',TMsgDlgType.mtInformation, [TMsgDlgBtn.mbYes, TMsgDlgBtn.mbNo], TMsgDlgBtn.mbYes,0, procedure(const AResult: TModalResult) begin if AResult = mrYes then ShowMessage('YES') else ShowMessage('you have cancel the operation'); end ); end; end; procedure TForm1.FormTap(Sender: TObject; const Point: TPointF); begin Label1.Text:= 'Tap'; end; Share this post Link to post
programmerdelphi2k 237 Posted April 18, 2023 (edited) @AlanScottAgain you can test "how many time a "event" is called, then, you can know why this behaviour... Quote var MyCounter:integer; ... now just increment it while showing your label with new value in "MyCounter", and see how many time this event is called! Edited April 18, 2023 by programmerdelphi2k Share this post Link to post
AlanScottAgain 1 Posted April 19, 2023 Thanks, I tried the counter but it says its only being called once. However the dialogs still pop up more than once. There is no other code in the Test project, Just the onTap and onGesture. If I had hair I'd be pulling it out 😞 I have attached a small video. Xrecorder 18042023 154853.mp4 Share this post Link to post