From Clomosy Docs

(Created page with ""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: *<span style="color:red">''AComponent''</span>: 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 purpose...")
 
No edit summary
Line 13: Line 13:
'''Example:'''
'''Example:'''


  clDoClick(Button1); //Performs a click action on Button1.
  '''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;'''

Revision as of 10:06, 18 September 2023

"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;