From Clomosy Docs

No edit summary
No edit summary
Line 43: Line 43:
   MainForm.Run;
   MainForm.Run;
  '''end;'''
  '''end;'''
= See Also =
* [[Controls| Controls]]

Revision as of 06:32, 24 January 2024

"clDoClick" is a part of the Clomosy library and allows you to programmatically perform a click operation on a component or object.

Its basic usage is as follows:

clDoClick(AComponent);

Parameter:

  • AComponent: The component or object to click on.

When this function is called, a click operation is performed on the specified component or object. This can be used to simulate the user interface of the program or for automation purposes. For example, it can be used to trigger a specific action by clicking on a button.

Example:

var
 MainForm : TclForm;
 iconImg : TCLProImage;
 GetTimer: TClTimer;

procedure iconBtnClick;
begin
 ShowMessage('Hello!');
end;

procedure Animation;
begin
   clDoClick(iconImg);
   GetTimer.Enabled := False;
end;

begin
  MainForm:=TclForm.Create(self);
  MainForm.SetFormBGImage('https://clomosy.com/demos/bg.png');
  GetTimer:= MainForm.AddNewTimer(MainForm,'GetTimer',1500);
  GetTimer.Enabled := True;
  MainForm.AddNewEvent(GetTimer,tbeOnTimer,'Animation');

  iconImg := MainForm.AddNewProImage(MainForm,'iconImg');
  clComponent.SetupComponent(iconImg,'{"Align" : "Top","MarginTop":40,"MarginLeft":5,
 "Height":150,"ImgUrl":"https://clomosy.com/demos/moon.png", "ImgFit":"yes"}');
  MainForm.AddNewEvent(iconImg,tbeOnClick,'iconBtnClick');

  MainForm.Run;
end;

See Also