From Clomosy Docs

No edit summary
No edit summary
Line 1: Line 1:
  AddNewProListViewDesignerPanel(TComponent, xName):TClProListViewDesignerPanel;
  AddNewProListViewDesignerPanel(TComponent, xName):TClProListViewDesignerPanel;


It is a component that can be defined in Listview and that we can add elements to and design. We can add a certain amount of elements in the DesignerPanel. The binding parameters of these elements to be added are as follows:
It is a component that can be defined in Listview and that we can add elements to and design. We can add a certain amount of elements in the DesignerPanel.  
 
'''The binding parameters of these elements to be added are as follows:'''<br>
* clCaption
* clCaption
* clText
* clText
Line 15: Line 17:


How do we use these parameters?<br>
How do we use these parameters?<br>
For example, there is a label and it is text. We can use one of the clText ones for this. Let's take a look at the usage.<br>
When you want to add an object to the TclProListViewDesignerPanel component, the '''AddPanelObject''' property is used. The first parameter of this property is the name of the object to be added, and the second parameter specifies the field where the object will be added.<br>
<blockquote style="background-color:#F7F5EB">
For example, there is a TclEdit object. This object is a text component. One of the fields starting with clText mentioned above can be used for this. Below, an addition has been made to the clText field.<br>
testDesignerPanel.'''AddPanelObject'''(testLabel,'''clText''');
 
</blockquote>
DesignerPanel1.AddPanelObject(Label1,'''clText''');
 
Let's define it to use in our project.<br>
Let's define it to use in our project.<br>
<blockquote style="background-color:#F7F5EB">
testDesignerPanel : TClProListViewDesignerPanel;
</blockquote>


Let's add the DesignerPanel to the ProListView.
DesignerPanel1 : TClProListViewDesignerPanel;
<blockquote style="background-color:#F7F5EB">
 
    testDesignerPanel := MyForm.AddNewProListViewDesignerPanel(testListview,'testDesignerPanel'); <br>
<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>
    clComponent.SetupComponent(testDesignerPanel,'{"Height":100,"Width" : 150,"BackgroundColor":"#F6EDDB","BorderColor":"#F5BCC9","BorderWidth":2,"RoundHeight":20,"RoundWidth":20}');<br>
 
    testListview.'''SetDesignerPanel'''(testDesignerPanel);
Let's add the DesignerPanel to the ProListView. Then, we'll assign properties to our panel using both the SetupComponent structure and clProSettings.
</blockquote>
 
:''For clProSettings:''
<pre>
  DesignerPanel1 = Form1.AddNewProButton(ListView1,'DesignerPanel1');
  DesignerPanel1.Align = alMostTop;
  DesignerPanel1.Height = 100;
  DesignerPanel1.clProSettings.BorderColor = clAlphaColor.clHexToColor('#F5BCC9');
  DesignerPanel1.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#F6EDDB');
  DesignerPanel1.clProSettings.IsTransparent = False;
  DesignerPanel1.clProSettings.IsFill = True;
  DesignerPanel1.clProSettings.IsRound = True;
  DesignerPanel1.clProSettings.RoundHeight = 20;
  DesignerPanel1.clProSettings.RoundWidth = 20;
  DesignerPanel1.clProSettings.BorderWidth = 2;
  DesignerPanel1.SetclProSettings(DesignerPanel1.clProSettings);
</pre>
 
:''For SetupComponent:''
<pre>
DesignerPanel1 = MyForm.AddNewProListViewDesignerPanel(testListview,'DesignerPanel1');
clComponent.SetupComponent(DesignerPanel1,'{"Align":"MostTop","Height":100,"Width" : 150,"BackgroundColor":"#F6EDDB",
"BorderColor":"#F5BCC9","BorderWidth":2,"RoundHeight":20,"RoundWidth":20}');
testListview.SetDesignerPanel(DesignerPanel1);
</pre>
 
 
In this way, we have made our definitions. You can see the sample project in the [[TClProListView|AddNewProListView]] field.
In this way, we have made our definitions. You can see the sample project in the [[TClProListView|AddNewProListView]] field.

Revision as of 11:10, 22 August 2024

AddNewProListViewDesignerPanel(TComponent, xName):TClProListViewDesignerPanel;

It is a component that can be defined in Listview and that we can add elements to and design. We can add a certain amount of elements in the DesignerPanel.

The binding parameters of these elements to be added are as follows:

  • clCaption
  • clText
  • clText1
  • clText2
  • clText3
  • clText4
  • clText5
  • clText6
  • clImage1
  • clImage2
  • clRecord_GUID

How do we use these parameters?
When you want to add an object to the TclProListViewDesignerPanel component, the AddPanelObject property is used. The first parameter of this property is the name of the object to be added, and the second parameter specifies the field where the object will be added.
For example, there is a TclEdit object. This object is a text component. One of the fields starting with clText mentioned above can be used for this. Below, an addition has been made to the clText field.

DesignerPanel1.AddPanelObject(Label1,clText);

Let's define it to use in our project.

DesignerPanel1 : TClProListViewDesignerPanel;

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

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

For clProSettings:
   DesignerPanel1 = Form1.AddNewProButton(ListView1,'DesignerPanel1');
   DesignerPanel1.Align = alMostTop;
   DesignerPanel1.Height = 100;
   DesignerPanel1.clProSettings.BorderColor = clAlphaColor.clHexToColor('#F5BCC9');
   DesignerPanel1.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#F6EDDB');
   DesignerPanel1.clProSettings.IsTransparent = False;
   DesignerPanel1.clProSettings.IsFill = True; 
   DesignerPanel1.clProSettings.IsRound = True;
   DesignerPanel1.clProSettings.RoundHeight = 20;
   DesignerPanel1.clProSettings.RoundWidth = 20;
   DesignerPanel1.clProSettings.BorderWidth = 2;
   DesignerPanel1.SetclProSettings(DesignerPanel1.clProSettings);
For SetupComponent:
DesignerPanel1 = MyForm.AddNewProListViewDesignerPanel(testListview,'DesignerPanel1');
clComponent.SetupComponent(DesignerPanel1,'{"Align":"MostTop","Height":100,"Width" : 150,"BackgroundColor":"#F6EDDB",
"BorderColor":"#F5BCC9","BorderWidth":2,"RoundHeight":20,"RoundWidth":20}');
testListview.SetDesignerPanel(DesignerPanel1);


In this way, we have made our definitions. You can see the sample project in the AddNewProListView field.