From Clomosy Docs

No edit summary
No edit summary
Line 22: Line 22:
  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,
  testPanel.Align = AlCenter;
"Height":300,"RoundHeight":10,"RoundWidth":10,"BorderColor":"#3a32a8","BorderWidth":2}');
testPanel.Width = 200;
 
testPanel.Height = 300;
testPanel.clProSettings.IsRound = True;
testPanel.clProSettings.RoundHeight = 10;
testPanel.clProSettings.RoundWidth = 10;
testPanel.clProSettings.BorderColor = clAlphaColor.clHexToColor('#3a32a8');
testPanel.clProSettings.BorderWidth = 2;
testPanel.SetclProSettings(testPanel.clProSettings);
  for (i = 0 to 4)
  for (i = 0 to 4)
  {
  {
testBtn = MyForm.AddNewProButton(testPanel,'testBtn'+IntToStr(i+1),'');
  testBtn = MyForm.AddNewProButton(testPanel,'testBtn'+IntToStr(i+1),'');
clComponent.SetupComponent(testBtn,'{"caption":"testBtn'+IntToStr(i+1)+'","Align" : "Top","MarginTop":5,"MarginLeft":5,"MarginRight":5,
  testBtn.Align = AlTop;
"Height":50}');
  testBtn.caption = 'testBtn'+IntToStr(i+1);
MyForm.SetImage(testBtn,'https://clomosy.com/demos/foodInformationBox.png');  
  testBtn.Margins.Right = 5;
 
  testBtn.Margins.Left = 5;
testBtn.clTagInt = i+1;
  testBtn.Margins.Top = 5;
MyForm.AddNewEvent(testBtn,tbeOnClick,'BtnOnClick');
  testBtn.Height = 50;
  MyForm.SetImage(testBtn,'https://clomosy.com/demos/foodInformationBox.png');  
 
  testBtn.clTagInt = i+1;
  MyForm.AddNewEvent(testBtn,tbeOnClick,'BtnOnClick');
  }
  }



Revision as of 08:58, 20 November 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.

Example

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');
 testPanel.Align = AlCenter;
 testPanel.Width = 200;
 testPanel.Height = 300;
 testPanel.clProSettings.IsRound = True;
 testPanel.clProSettings.RoundHeight = 10;
 testPanel.clProSettings.RoundWidth = 10;
 testPanel.clProSettings.BorderColor = clAlphaColor.clHexToColor('#3a32a8');
 testPanel.clProSettings.BorderWidth = 2;
 testPanel.SetclProSettings(testPanel.clProSettings);
 
 for (i = 0 to 4)
 {
   testBtn = MyForm.AddNewProButton(testPanel,'testBtn'+IntToStr(i+1),'');
   testBtn.Align = AlTop;
   testBtn.caption = 'testBtn'+IntToStr(i+1);
   testBtn.Margins.Right = 5;
   testBtn.Margins.Left = 5;
   testBtn.Margins.Top = 5;
   testBtn.Height = 50;
   MyForm.SetImage(testBtn,'https://clomosy.com/demos/foodInformationBox.png'); 
  
   testBtn.clTagInt = i+1;
   MyForm.AddNewEvent(testBtn,tbeOnClick,'BtnOnClick');
 }

 MyForm.Run;
}

See Also