From Clomosy Docs

No edit summary
No edit summary
Line 1: Line 1:
<div class="alert alert-ligth border border-3 border-primary-subtle rounded-5 p-4 shadow-sm" role="alert">
procedure clDoClick(AComponent:TComponent);
</div>
"clDoClick" is a part of the Clomosy library and allows you to programmatically perform a click operation on a component or object.
"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:
*<span style="color:blue">''AComponent''</span>: The component or object name to click on.
 
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 purposes. For example, it can be used to trigger a specific action by clicking on a button.<br>


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.
<b>Example</b><br>
In the example, the click feature is enabled when the project is opened.<br>
<b>TRObject Syntax</b><br>
<pre>
var
  MainForm : TclForm;
  iconImg : TCLProImage;


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


:'''TRObject Syntax'''
{
   var
   MainForm = TclForm.Create(self);
    MainForm : TclForm;
  MainForm.SetFormBGImage('https://clomosy.com/demos/bg.png');
    iconImg : TCLProImage;
    
    
   void iconBtnClick;
   iconImg  = MainForm.AddNewProImage(MainForm,'iconImg');
   {
   clComponent.SetupComponent(iconImg,'{"Align" : "Top","MarginTop":40,"MarginLeft":5,
    ShowMessage('Hello!');
  "Height":150,"ImgUrl":"https://clomosy.com/demos/moon.png", "ImgFit":"yes"}');
   }
  MainForm.AddNewEvent(iconImg,tbeOnClick,'iconBtnClick');
   clDoClick(iconImg);
    
    
   void StartForm;
   MainForm.Run;
  {
}
    '''clDoClick'''(iconImg);
</pre>
  }
<b>Base Syntax</b><br>
 
<pre>
   {
var
    MainForm =TclForm.Create(self);
   MainForm : TclForm;
    MainForm.SetFormBGImage('https://clomosy.com/demos/bg.png');
  iconImg : TCLProImage;
    MainForm.AddNewEvent(MainForm,tbeOnFormActivate,'StartForm');
 
   
procedure iconBtnClick;
    iconImg  = MainForm.AddNewProImage(MainForm,'iconImg');
begin
    clComponent.SetupComponent(iconImg,'{"Align" : "Top","MarginTop":40,"MarginLeft":5,
  ShowMessage('Hello!');
    "Height":150,"ImgUrl":"https://clomosy.com/demos/moon.png", "ImgFit":"yes"}');
end;
    MainForm.AddNewEvent(iconImg,tbeOnClick,'iconBtnClick');
   
    MainForm.Run;
  }


:'''Base Syntax'''
begin
   var
   MainForm :=TclForm.Create(self);
    MainForm : TclForm;
   MainForm.SetFormBGImage('https://clomosy.com/demos/bg.png');
    iconImg : TCLProImage;
    
  procedure iconBtnClick;
  begin
    ShowMessage('Hello!');
  end;
    
    
   procedure StartForm;
   iconImg  := MainForm.AddNewProImage(MainForm,'iconImg');
   begin
   clComponent.SetupComponent(iconImg,'{"Align" : "Top","MarginTop":40,"MarginLeft":5,
    '''clDoClick'''(iconImg);
  "Height":150,"ImgUrl":"https://clomosy.com/demos/moon.png", "ImgFit":"yes"}');
  end;
  MainForm.AddNewEvent(iconImg,tbeOnClick,'iconBtnClick');
  clDoClick(iconImg);
    
    
   begin
   MainForm.Run;
    MainForm :=TclForm.Create(self);
end;
    MainForm.SetFormBGImage('https://clomosy.com/demos/bg.png');
</pre>
    MainForm.AddNewEvent(MainForm,tbeOnFormActivate,'StartForm');
   
    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 =
<h2> See Also </h2>
* [[Controls| Controls]]
* [[System_Library#Cl_Utilities_Functions | Cl Utilities Functions]]

Revision as of 07:24, 10 October 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.
TRObject Syntax

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');
  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;
}

Base Syntax

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;

See Also