From Clomosy Docs

No edit summary
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
procedure clDoClick(AComponent:TComponent);
procedure clDoClick(AComponent:TCLComponent);
</div>
</div>


Line 11: Line 11:
<b>Example</b><br>
<b>Example</b><br>
In the example, the click feature is enabled when the project is opened.<br>
In the example, the click feature is enabled when the project is opened.<br>
<b>TRObject Syntax</b><br>
 
<pre>
<pre>
var
var
Line 27: Line 27:
    
    
   iconImg  = MainForm.AddNewProImage(MainForm,'iconImg');
   iconImg  = MainForm.AddNewProImage(MainForm,'iconImg');
   clComponent.SetupComponent(iconImg,'{"Align" : "Top","MarginTop":40,"MarginLeft":5,
   iconImg.Align = AlTop;
   "Height":150,"ImgUrl":"https://clomosy.com/demos/moon.png", "ImgFit":"yes"}');
  iconImg.Height = 150;
  iconImg.Margins.Top = 40;
  iconImg.Margins.Left = 5;
  iconImg.clProSettings.PictureAutoFit = True;
   iconImg.clProSettings.PictureSource = 'https://clomosy.com/demos/moon.png';
  iconImg.SetclProSettings(iconImg.clProSettings);
   MainForm.AddNewEvent(iconImg,tbeOnClick,'iconBtnClick');
   MainForm.AddNewEvent(iconImg,tbeOnClick,'iconBtnClick');
   clDoClick(iconImg);
   clDoClick(iconImg);
Line 34: Line 39:
   MainForm.Run;
   MainForm.Run;
}
}
</pre>
<b>Base Syntax</b><br>
<pre>
var
  MainForm : TclForm;
  iconImg : TCLProImage;
procedure iconBtnClick;
begin
  ShowMessage('Hello!');
end;
begin
  MainForm :=TclForm.Create(self);
  MainForm.SetFormBGImage('https://clomosy.com/demos/bg.png');
 
  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');
  clDoClick(iconImg);
 
  MainForm.Run;
end;
</pre>
</pre>


<h2> See Also </h2>
<h2> See Also </h2>
* [[System_Library#Cl_Utilities_Functions | Cl Utilities Functions]]
* [[System_Library#Cl_Utilities_Functions | Cl Utilities Functions]]
{{#seo:|title=ClDoClick Using - Clomosy Docs}}
{{#seo:|description=Clomosy’s ClDoClick function allows seamless simulation of click actions in mobile apps, improving user experience and functionality.}}

Latest revision as of 13:25, 24 December 2024

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

  • AComponent: The component or object name 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
In the example, the click feature is enabled when the project is opened.

var
  MainForm : TclForm;
  iconImg : TCLProImage;

void iconBtnClick;
{
  ShowMessage('Hello!');
}

{
  MainForm = TclForm.Create(self);
  MainForm.SetFormBGImage('https://clomosy.com/demos/bg.png');
  
  iconImg  = MainForm.AddNewProImage(MainForm,'iconImg');
  iconImg.Align = AlTop;
  iconImg.Height = 150;
  iconImg.Margins.Top = 40;
  iconImg.Margins.Left = 5;
  iconImg.clProSettings.PictureAutoFit = True;
  iconImg.clProSettings.PictureSource = 'https://clomosy.com/demos/moon.png';
  iconImg.SetclProSettings(iconImg.clProSettings);
  MainForm.AddNewEvent(iconImg,tbeOnClick,'iconBtnClick');
  clDoClick(iconImg);
  
  MainForm.Run;
}

See Also