likemike Posted April 12, 2022 Share Posted April 12, 2022 Hello! I'm searching for a way, that an UnimImage react on user gestures. Unfortunately the OnDblClick-event is already in use in my application. So I'm searching for something like OnClickHold for components like UnimImage, UnimPanel , UnimButton etc. Is it possible to do this with OnAjaxEvent? If yes - how? Best regards Mike Link to comment Share on other sites More sharing options...
Sherzod Posted April 12, 2022 Share Posted April 12, 2022 Hello, For example for UnimImage. 1. procedure TMainmForm.UnimFormCreate(Sender: TObject); begin with UnimImage1, UnimImage1.JSInterface do JSAddElListener('taphold', 'element', JSFunction('', 'ajaxRequest('+ JSName +', "_taphold", [])')); end; 2. procedure TMainmForm.UnimImage1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = '_taphold' then ShowMessage('TapHold') end; 2 Link to comment Share on other sites More sharing options...
likemike Posted April 12, 2022 Author Share Posted April 12, 2022 Perfect!! Thanks!! 1 Link to comment Share on other sites More sharing options...
Recommended Posts