Page 1 of 1

Assign OnTapHold programatically

PostPosted: 06 Jan 2019 12:21
by cyracks
Hello,

I would like to create TIWCGJQMLabel programatically and assign event OnTapHold.
Code: Select all
procedure TForm_mTravelOrderRoute.pListFiles;
var MLabelFile: TIWCGJQMLabel;
begin
    MLabelFile := TIWCGJQMLabel.Create(Self);
    MLabelFile.Events.OnTapHold := MLabelFileEventsTapHold; // ERROR HERE
end;

Code: Select all
procedure TForm_mTravelOrderRoute.MLabelFileEventsTapHold(Sender: TObject; AParams: TStringList);
begin
    WebApplication.ShowMessage(AParams.Values['ComponentName']);
end;


But when code is compiled error "E2035 Not enough actual parameters" is raised.

I know this is probably not just cgdevtools question but still I used similar code many times in VCL and it worked (as long as procedure had right parameters).

Best regards,
Tomaž

Re: Assign OnTapHold programatically

PostPosted: 09 Jan 2019 11:51
by Alexander Bulei
Hi cyracks,

MLabelFile.Events.OnTapHold := MLabelFileEventsTapHold; // ERROR HERE


Of course you will get the error there...just follow the tree structure of event:

Code: Select all
IWCGJQMLabel1.Events.OnTapHold.OnEvent


Best Regards.

Re: Assign OnTapHold programatically

PostPosted: 09 Jan 2019 11:52
by cyracks
:) of course, thank you.