From Clomosy Docs
TclLoyout is a container for other graphic object. Use TclLayout to edit multiple chart controls under the same parent. For example, you wanted to put 2 components (label, button) in a single line on the page you want to design. In such cases, you can position these 2 components in a single Layout.
AddNewLayout(xOwner:TComponent; xName:String): TclLayout
TComponent : The variable name of the defined component is written. Here you should write the component variable name of whatever your component will be in.
xName : The name of the defined layout should be written.
| Feature | Use of | Definition |
|---|---|---|
| TclLayout | Layout1 : TclLayout; | A variable belonging to the TclLayout class is created. |
| AddNewLayout | Layout1 = MyForm.AddNewLayout(MyForm,'Layout1'); | A new TclLayout is added to the form. |
| Width | Layout1.Width = 150; | Allows adjusting the width of the layout. |
| Height | Layout1.Height = 50; | Allows adjusting the height of the layout. |
| Align | Layout1.Align = alTop; | With the Align parameter, you can specify where you want our component to be aligned in the form. This parameter has multiple positioning properties. See the page to learn about these features. |
| Margins | Layout1.Margins.Left = 50; // Right, Top, Bottom | With the Margins parameter, you can give margins at any scale from the right, left, bottom, top. |
Example:
- TRObject Syntax
Var
MyForm:TclForm;
Panel1 : TclPanel;
Layout1 : TclLayout;
Edit1 : TclEdit;
{
MyForm=TclForm.Create(self);
Panel1=MyForm.AddNewPanel(MyForm,'Panel1');
Panel1.Align=ALTop;
Panel1.Height=100;
Layout1 = MyForm.AddNewLayout(Panel1,'Layout1');
Layout1.Align=ALCenter;
Layout1.Height = 50;
Edit1 = MyForm.AddNewEdit(Layout1,'Edit1','Write something...');
Edit1.Align=aLLeft;
Edit1.Width = 150;
MyForm.Run;
}
- Base Syntax
Var
MyForm:TclForm;
Panel1 : TclPanel;
Layout1 : TclLayout;
Edit1 : TclEdit;
begin
MyForm:=TclForm.Create(self);
Panel1:=MyForm.AddNewPanel(MyForm,'Panel1');
Panel1.Align:=ALTop;
Panel1.Height:=100;
Layout1 := MyForm.AddNewLayout(Panel1,'Layout1');
Layout1.Align:=ALCenter;
Layout1.Height := 50;
Edit1 := MyForm.AddNewEdit(Layout1,'Edit1','Write something...');
Edit1.Align:=aLLeft;
Edit1.Width := 150;
MyForm.Run;
end;