From Clomosy Docs
No edit summary |
No edit summary |
||
| Line 3: | Line 3: | ||
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.<br> | 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.<br> | ||
'''The available SetupComponent properties for TclProPanel are:'''<br> | |||
* Width | * Width | ||
* Height | * Height | ||
| Line 17: | Line 18: | ||
* BorderColor | * BorderColor | ||
* BorderWidth | * BorderWidth | ||
<blockquote style="background-color:#CBEDD5">To learn the purpose and usage of the '''SetupComponent''' and '''clProSettings''' properties, please refer to [[JSON Design| the page]]. </blockquote> | |||
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.<br> | |||
:''For clProSettings:'' | |||
<pre> | |||
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); | |||
</pre> | |||
:''For SetupComponent:'' | |||
<pre> | |||
ProPanel1 = Form1.AddNewProPanel(Form1,'ProPanel1'); | |||
clComponent.SetupComponent(ProPanel1,'{"Align" : "Center", "Width":200, "Height":280, "RoundHeight":10, "RoundWidth":10, "BorderColor":"#fabd2", "BorderWidth":2}'); | |||
</pre> | |||
'''Example:'''<br> | '''Example:'''<br> | ||
:'''TRObject Syntax''' | |||
<pre> | |||
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; | |||
} | |||
</pre> | |||
:'''Base Syntax''' | :'''Base Syntax''' | ||
<pre> | |||
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; | |||
</pre> | |||
Revision as of 13:21, 22 August 2024
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;