From Clomosy Docs

No edit summary
No edit summary
Line 5: Line 5:


'''Example:'''<br>
'''Example:'''<br>
:'''Base Syntax'''
 
:'''TRObject Syntax:'''
  Var   
  Var   
   MyForm:TclForm;
   MyForm:TclForm;
Line 12: Line 13:
   i : Integer;
   i : Integer;
   
   
  procedure BtnOnClick;  
  void BtnOnClick;  
  begin
  {
   ShowMessage(TClProButton(Myform.Clsender).clTagInt);  
   ShowMessage(TClProButton(Myform.Clsender).clTagInt);  
  end;
  }
 
  begin
  {
   MyForm:=TclForm.Create(self);
   MyForm=TclForm.Create(self);
   testPanel:=MyForm.AddNewProPanel(MyForm,'testPanel');
   testPanel=MyForm.AddNewProPanel(MyForm,'testPanel');
   clComponent.SetupComponent(testPanel,'{"Align" : "Center","Width" :200,  
   clComponent.SetupComponent(testPanel,'{"Align" : "Center","Width" :200,  
  "Height":300,"RoundHeight":10,"RoundWidth":10,"BorderColor":"#3a32a8","BorderWidth":2}');
  "Height":300,"RoundHeight":10,"RoundWidth":10,"BorderColor":"#3a32a8","BorderWidth":2}');
   
   
   for i := 0 to 4 do
   for (i = 0 to 4)
   begin
   {
   testBtn := MyForm.AddNewProButton(testPanel,'testBtn'+IntToStr(i+1),<nowiki>''</nowiki>);
   testBtn = MyForm.AddNewProButton(testPanel,'testBtn'+IntToStr(i+1),<nowiki>''</nowiki>);
  clComponent.SetupComponent(testBtn,'{"caption":"testBtn'+IntToStr(i+1)+'","Align" : "Top","MarginTop":5,"MarginLeft":5,"MarginRight":5,
  clComponent.SetupComponent(testBtn,'{"caption":"testBtn'+IntToStr(i+1)+'","Align" : "Top","MarginTop":5,"MarginLeft":5,"MarginRight":5,
   "Height":50}');
   "Height":50}');
  MyForm.SetImage(testBtn,'https://clomosy.com/demos/foodInformationBox.png');  
  MyForm.SetImage(testBtn,'https://clomosy.com/demos/foodInformationBox.png');  
   
   
   testBtn.clTagInt := i+1;
   testBtn.clTagInt = i+1;
   MyForm.AddNewEvent(testBtn,tbeOnClick,'BtnOnClick');
   MyForm.AddNewEvent(testBtn,tbeOnClick,'BtnOnClick');
   end;
   }
   
   
   MyForm.Run;
   MyForm.Run;
  end;
  }


:'''TRObject Syntax:'''
:'''Base Syntax'''
  Var   
  Var   
   MyForm:TclForm;
   MyForm:TclForm;
Line 44: Line 45:
   i : Integer;
   i : Integer;
   
   
  void BtnOnClick;  
  procedure BtnOnClick;  
  {
  begin
   ShowMessage(TClProButton(Myform.Clsender).clTagInt);  
   ShowMessage(TClProButton(Myform.Clsender).clTagInt);  
  }
  end;
 
  {
  begin
   MyForm=TclForm.Create(self);
   MyForm:=TclForm.Create(self);
   testPanel=MyForm.AddNewProPanel(MyForm,'testPanel');
   testPanel:=MyForm.AddNewProPanel(MyForm,'testPanel');
   clComponent.SetupComponent(testPanel,'{"Align" : "Center","Width" :200,  
   clComponent.SetupComponent(testPanel,'{"Align" : "Center","Width" :200,  
  "Height":300,"RoundHeight":10,"RoundWidth":10,"BorderColor":"#3a32a8","BorderWidth":2}');
  "Height":300,"RoundHeight":10,"RoundWidth":10,"BorderColor":"#3a32a8","BorderWidth":2}');
   
   
   for (i = 0 to 4)
   for i := 0 to 4 do
   {
   begin
   testBtn = MyForm.AddNewProButton(testPanel,'testBtn'+IntToStr(i+1),<nowiki>''</nowiki>);
   testBtn := MyForm.AddNewProButton(testPanel,'testBtn'+IntToStr(i+1),<nowiki>''</nowiki>);
  clComponent.SetupComponent(testBtn,'{"caption":"testBtn'+IntToStr(i+1)+'","Align" : "Top","MarginTop":5,"MarginLeft":5,"MarginRight":5,
  clComponent.SetupComponent(testBtn,'{"caption":"testBtn'+IntToStr(i+1)+'","Align" : "Top","MarginTop":5,"MarginLeft":5,"MarginRight":5,
   "Height":50}');
   "Height":50}');
  MyForm.SetImage(testBtn,'https://clomosy.com/demos/foodInformationBox.png');  
  MyForm.SetImage(testBtn,'https://clomosy.com/demos/foodInformationBox.png');  
   
   
   testBtn.clTagInt = i+1;
   testBtn.clTagInt := i+1;
   MyForm.AddNewEvent(testBtn,tbeOnClick,'BtnOnClick');
   MyForm.AddNewEvent(testBtn,tbeOnClick,'BtnOnClick');
   }
   end;
   
   
   MyForm.Run;
   MyForm.Run;
  }
  end;


= See Also=
= See Also=
* [[Controls| Controls]]
* [[Controls| Controls]]

Revision as of 11:10, 23 August 2024

The ClTagInt property is used to store an integer value for any object. It is typically used to carry additional information or identification details specific to the object.

textBtn.ClTagInt
TclProImage(Myform.Clsender).ClTagInt

Example:

TRObject Syntax:
Var  
 MyForm:TclForm;
 testPanel : TclProPanel;
 testBtn : TClProButton;
 i : Integer;

void BtnOnClick; 
{
 ShowMessage(TClProButton(Myform.Clsender).clTagInt); 
}

{
 MyForm=TclForm.Create(self);
 testPanel=MyForm.AddNewProPanel(MyForm,'testPanel');
 clComponent.SetupComponent(testPanel,'{"Align" : "Center","Width" :200, 
"Height":300,"RoundHeight":10,"RoundWidth":10,"BorderColor":"#3a32a8","BorderWidth":2}');

 for (i = 0 to 4)
 {
 testBtn = MyForm.AddNewProButton(testPanel,'testBtn'+IntToStr(i+1),'');
clComponent.SetupComponent(testBtn,'{"caption":"testBtn'+IntToStr(i+1)+'","Align" : "Top","MarginTop":5,"MarginLeft":5,"MarginRight":5,
 "Height":50}');
MyForm.SetImage(testBtn,'https://clomosy.com/demos/foodInformationBox.png'); 

 testBtn.clTagInt = i+1;
 MyForm.AddNewEvent(testBtn,tbeOnClick,'BtnOnClick');
 }

 MyForm.Run;
}
Base Syntax
Var  
 MyForm:TclForm;
 testPanel : TclProPanel;
 testBtn : TClProButton;
 i : Integer;

procedure BtnOnClick; 
begin
 ShowMessage(TClProButton(Myform.Clsender).clTagInt); 
end;
 
begin
 MyForm:=TclForm.Create(self);
 testPanel:=MyForm.AddNewProPanel(MyForm,'testPanel');
 clComponent.SetupComponent(testPanel,'{"Align" : "Center","Width" :200, 
"Height":300,"RoundHeight":10,"RoundWidth":10,"BorderColor":"#3a32a8","BorderWidth":2}');

 for i := 0 to 4 do
 begin
 testBtn := MyForm.AddNewProButton(testPanel,'testBtn'+IntToStr(i+1),'');
clComponent.SetupComponent(testBtn,'{"caption":"testBtn'+IntToStr(i+1)+'","Align" : "Top","MarginTop":5,"MarginLeft":5,"MarginRight":5,
 "Height":50}');
MyForm.SetImage(testBtn,'https://clomosy.com/demos/foodInformationBox.png'); 

 testBtn.clTagInt := i+1;
 MyForm.AddNewEvent(testBtn,tbeOnClick,'BtnOnClick');
 end;

 MyForm.Run;
end;

See Also