From Clomosy Docs

Revision as of 13:21, 22 August 2024 by ClomosyManager (talk | contribs)

AddNewProPanel(TComponent, xName): TclProPanel

The TclProPanel feature is a component that contains components that we use more than once in our application. You can define the component with the json structure. It has the features described below.

The available SetupComponent properties for TclProPanel are:

  • Width
  • Height
  • PositionX
  • PositionY
  • Align
  • BackgroundColor
  • MarginTop
  • MarginBottom
  • MarginRight
  • MarginLeft
  • RoundHeight
  • RoundWidth
  • BorderColor
  • BorderWidth

To learn the purpose and usage of the SetupComponent and clProSettings properties, please refer to the page.

Let's define the proPanel at the beginning.

Var
  ProPanel1 : TClProPanel;

Let's add the object to the form. Then, we'll assign properties to our panel using both the SetupComponent structure and clProSettings.

For clProSettings:
ProPanel1 = Form1.AddNewProPanel(Form1,'ProPanel1');
ProPanel1.Align = alCenter;
ProPanel1.Width = 200;
ProPanel1.Height = 280;
ProPanel1.clProSettings.BorderColor = clAlphaColor.clHexToColor('#fabd2');
ProPanel1.clProSettings.RoundHeight = 10;
ProPanel1.clProSettings.RoundWidth = 10;
ProPanel1.clProSettings.BorderWidth = 2;
ProPanel1.clProSettings.IsFill = True; 
ProPanel1.clProSettings.IsRound = True;
ProPanel1.SetclProSettings(ProPanel1.clProSettings);
For SetupComponent:
ProPanel1 = Form1.AddNewProPanel(Form1,'ProPanel1');
clComponent.SetupComponent(ProPanel1,'{"Align" : "Center", "Width":200, "Height":280, "RoundHeight":10, "RoundWidth":10, "BorderColor":"#fabd2", "BorderWidth":2}');


Example:

TRObject Syntax
Var  
  Form1:TclForm;
  ProPanel1 : TclProPanel;

{
  Form1=TclForm.Create(self);
  ProPanel1=Form1.AddNewProPanel(Form1,'ProPanel1');
  ProPanel1.Align = alCenter;
  ProPanel1.Width = 200;
  ProPanel1.Height = 280;
  ProPanel1.clProSettings.BorderColor = clAlphaColor.clHexToColor('#fabd2');
  ProPanel1.clProSettings.RoundHeight = 10;
  ProPanel1.clProSettings.RoundWidth = 10;
  ProPanel1.clProSettings.BorderWidth = 2;
  ProPanel1.clProSettings.IsFill = True; 
  ProPanel1.clProSettings.IsRound = True;
  ProPanel1.SetclProSettings(ProPanel1.clProSettings);
  
  Form1.Run;
}
Base Syntax
Var  
  Form1:TclForm;
  ProPanel1 : TclProPanel;

begin
  Form1:=TclForm.Create(self);
  ProPanel1:=Form1.AddNewProPanel(Form1,'ProPanel1');
  ProPanel1.Align := alCenter;
  ProPanel1.Width := 200;
  ProPanel1.Height := 280;
  ProPanel1.clProSettings.BorderColor := clAlphaColor.clHexToColor('#fabd2');
  ProPanel1.clProSettings.RoundHeight := 10;
  ProPanel1.clProSettings.RoundWidth := 10;
  ProPanel1.clProSettings.BorderWidth := 2;
  ProPanel1.clProSettings.IsFill := True; 
  ProPanel1.clProSettings.IsRound := True;
  ProPanel1.SetclProSettings(ProPanel1.clProSettings);
  
  Form1.Run;
end;