From Clomosy Docs
No edit summary |
No edit summary |
||
| Line 3: | Line 3: | ||
Search bar does not appear automatically in ProListView. It is a component created for this. This component also has the ability to search by scanning the barcode. Now let's see how it goes either way. Let's start with the definition.<br> | Search bar does not appear automatically in ProListView. It is a component created for this. This component also has the ability to search by scanning the barcode. Now let's see how it goes either way. Let's start with the definition.<br> | ||
searchEdt1 : TClProSearchEdit; | |||
Let's add ProSearchEdit in form. | |||
Let's add ProSearchEdit in | <pre> | ||
< | searchEdt1 = Form1.AddNewProSearchEdit(Form1,'searchEdt1','Search Something ...'); | ||
searchEdt1.Align = alTop; | |||
searchEdt1.Margins.Top = 15; | |||
searchEdt1.Margins.Left = 15; | |||
searchEdt1.Margins.Right = 15; | |||
searchEdt1.Margins.Bottom = 10; | |||
searchEdt1.Height = 40; | |||
</pre> | |||
</ | |||
The following screenshot is displayed with the above code.<br> | The following screenshot is displayed with the above code.<br> | ||
| Line 21: | Line 20: | ||
[[File:ProSearchEdit.png|frameless|450px]]<br> | [[File:ProSearchEdit.png|frameless|450px]]<br> | ||
Now, if we want to search by scanning the barcode in the search bar, we must write the following code in our searchEdt variable, then the barcode scanning button will appear on the screen.<br> | Now, if we want to search by scanning the barcode in the search bar, we must write the following code in our searchEdt variable, then the barcode scanning button will appear on the screen.<br> | ||
searchEdt.''' | searchEdt1.'''clBarcodeReader''' = True; | ||
The TargetListView property determines which TclProListView component the search component will operate on. | |||
searchEdt.'''TargetListView''' = ListView1; | |||
'''Output:'''<br> | '''Output:'''<br> | ||
[[File:ProSearchEditBarcode.png|frameless|450px]]<br> | [[File:ProSearchEditBarcode.png|frameless|450px]]<br> | ||
''' | |||
'''Example:'''<br> | |||
:'''TRObject Syntax''' | |||
<pre> | |||
Var | |||
MyForm:TclForm; | |||
ListView1 : TClProListView; | |||
searchEdt : TClProSearchEdit; | |||
void SetSearchEdit; | |||
{ | |||
searchEdt = MyForm.AddNewProSearchEdit(MyForm,'searchEdt','Search Something ...'); | |||
searchEdt.Align = alTop; | |||
searchEdt.Margins.Top = 15; | |||
searchEdt.Margins.Left = 15; | |||
searchEdt.Margins.Right = 15; | |||
searchEdt.Margins.Bottom = 10; | |||
searchEdt.Height = 40; | |||
searchEdt.clBarcodeReader = True; | |||
} | |||
void CreateListView; | |||
{ | |||
ListView1 = MyForm.AddNewProListView(MyForm,'ListView1'); | |||
ListView1.Align = AlClient; | |||
ListView1.Margins.Bottom = 20; | |||
ListView1.Margins.Top = 20; | |||
ListView1.Margins.Right = 20; | |||
ListView1.Margins.Left = 20; | |||
ListView1.clProSettings.ViewType = lvIcon; //(lvList, lvIcon, lvWaterFall) | |||
ListView1.clProSettings.ColCount = 2; | |||
ListView1.clProSettings.ItemHeight = 150; | |||
ListView1.clProSettings.ItemWidth = 150; | |||
ListView1.clProSettings.ItemSpace = 10; | |||
ListView1.clProSettings.BorderColor = clAlphaColor.clHexToColor('#098614'); | |||
ListView1.clProSettings.BorderWidth = 2; | |||
ListView1.clProSettings.RoundHeight = 5; | |||
ListView1.clProSettings.RoundWidth = 5; | |||
ListView1.SetclProSettings(ListView1.clProSettings); | |||
ListView1.ListType = 'horizontal'; | |||
searchEdt.TargetListView = ListView1; | |||
} | |||
{ | |||
MyForm = TclForm.Create(Self); | |||
SetSearchEdit; | |||
CreateListView; | |||
MyForm.Run; | |||
} | |||
</pre> | |||
:'''Base Syntax''' | :'''Base Syntax''' | ||
<pre> | |||
Var | |||
MyForm:TclForm; | |||
ListView1 : TClProListView; | |||
searchEdt : TClProSearchEdit; | |||
procedure SetSearchEdit; | |||
begin | |||
searchEdt := MyForm.AddNewProSearchEdit(MyForm,'searchEdt','Search Something ...'); | |||
searchEdt.Align := alTop; | |||
searchEdt.Margins.Top := 15; | |||
searchEdt.Margins.Left := 15; | |||
searchEdt.Margins.Right := 15; | |||
searchEdt.Margins.Bottom := 10; | |||
searchEdt.Height := 40; | |||
searchEdt.clBarcodeReader := True; | |||
end; | |||
procedure CreateListView; | |||
begin | |||
ListView1 := MyForm.AddNewProListView(MyForm,'ListView1'); | |||
ListView1.Align := AlClient; | |||
ListView1.Margins.Bottom := 20; | |||
ListView1.Margins.Top := 20; | |||
ListView1.Margins.Right := 20; | |||
ListView1.Margins.Left := 20; | |||
ListView1.clProSettings.ViewType := lvIcon; //(lvList, lvIcon, lvWaterFall) | |||
ListView1.clProSettings.ColCount := 2; | |||
ListView1.clProSettings.ItemHeight := 150; | |||
ListView1.clProSettings.ItemWidth := 150; | |||
ListView1.clProSettings.ItemSpace := 10; | |||
ListView1.clProSettings.BorderColor := clAlphaColor.clHexToColor('#098614'); | |||
ListView1.clProSettings.BorderWidth := 2; | |||
ListView1.clProSettings.RoundHeight := 5; | |||
ListView1.clProSettings.RoundWidth := 5; | |||
ListView1.SetclProSettings(ListView1.clProSettings); | |||
ListView1.ListType := 'horizontal'; | |||
searchEdt.TargetListView := ListView1; | |||
end; | |||
begin | |||
MyForm := TclForm.Create(Self); | |||
SetSearchEdit; | |||
CreateListView; | |||
MyForm.Run; | |||
end; | |||
</pre> | |||
= See Also = | |||
* [[TClProListView]] | |||
* [[JSON_Design]] | |||
Revision as of 11:44, 22 August 2024
AddNewProSearchEdit(TComponent, xName, xCaption):TClProSearchEdit;
Search bar does not appear automatically in ProListView. It is a component created for this. This component also has the ability to search by scanning the barcode. Now let's see how it goes either way. Let's start with the definition.
searchEdt1 : TClProSearchEdit;
Let's add ProSearchEdit in form.
searchEdt1 = Form1.AddNewProSearchEdit(Form1,'searchEdt1','Search Something ...'); searchEdt1.Align = alTop; searchEdt1.Margins.Top = 15; searchEdt1.Margins.Left = 15; searchEdt1.Margins.Right = 15; searchEdt1.Margins.Bottom = 10; searchEdt1.Height = 40;
The following screenshot is displayed with the above code.
Output:
![]()
Now, if we want to search by scanning the barcode in the search bar, we must write the following code in our searchEdt variable, then the barcode scanning button will appear on the screen.
searchEdt1.clBarcodeReader = True;
The TargetListView property determines which TclProListView component the search component will operate on.
searchEdt.TargetListView = ListView1;
Example:
- TRObject Syntax
Var
MyForm:TclForm;
ListView1 : TClProListView;
searchEdt : TClProSearchEdit;
void SetSearchEdit;
{
searchEdt = MyForm.AddNewProSearchEdit(MyForm,'searchEdt','Search Something ...');
searchEdt.Align = alTop;
searchEdt.Margins.Top = 15;
searchEdt.Margins.Left = 15;
searchEdt.Margins.Right = 15;
searchEdt.Margins.Bottom = 10;
searchEdt.Height = 40;
searchEdt.clBarcodeReader = True;
}
void CreateListView;
{
ListView1 = MyForm.AddNewProListView(MyForm,'ListView1');
ListView1.Align = AlClient;
ListView1.Margins.Bottom = 20;
ListView1.Margins.Top = 20;
ListView1.Margins.Right = 20;
ListView1.Margins.Left = 20;
ListView1.clProSettings.ViewType = lvIcon; //(lvList, lvIcon, lvWaterFall)
ListView1.clProSettings.ColCount = 2;
ListView1.clProSettings.ItemHeight = 150;
ListView1.clProSettings.ItemWidth = 150;
ListView1.clProSettings.ItemSpace = 10;
ListView1.clProSettings.BorderColor = clAlphaColor.clHexToColor('#098614');
ListView1.clProSettings.BorderWidth = 2;
ListView1.clProSettings.RoundHeight = 5;
ListView1.clProSettings.RoundWidth = 5;
ListView1.SetclProSettings(ListView1.clProSettings);
ListView1.ListType = 'horizontal';
searchEdt.TargetListView = ListView1;
}
{
MyForm = TclForm.Create(Self);
SetSearchEdit;
CreateListView;
MyForm.Run;
}
- Base Syntax
Var
MyForm:TclForm;
ListView1 : TClProListView;
searchEdt : TClProSearchEdit;
procedure SetSearchEdit;
begin
searchEdt := MyForm.AddNewProSearchEdit(MyForm,'searchEdt','Search Something ...');
searchEdt.Align := alTop;
searchEdt.Margins.Top := 15;
searchEdt.Margins.Left := 15;
searchEdt.Margins.Right := 15;
searchEdt.Margins.Bottom := 10;
searchEdt.Height := 40;
searchEdt.clBarcodeReader := True;
end;
procedure CreateListView;
begin
ListView1 := MyForm.AddNewProListView(MyForm,'ListView1');
ListView1.Align := AlClient;
ListView1.Margins.Bottom := 20;
ListView1.Margins.Top := 20;
ListView1.Margins.Right := 20;
ListView1.Margins.Left := 20;
ListView1.clProSettings.ViewType := lvIcon; //(lvList, lvIcon, lvWaterFall)
ListView1.clProSettings.ColCount := 2;
ListView1.clProSettings.ItemHeight := 150;
ListView1.clProSettings.ItemWidth := 150;
ListView1.clProSettings.ItemSpace := 10;
ListView1.clProSettings.BorderColor := clAlphaColor.clHexToColor('#098614');
ListView1.clProSettings.BorderWidth := 2;
ListView1.clProSettings.RoundHeight := 5;
ListView1.clProSettings.RoundWidth := 5;
ListView1.SetclProSettings(ListView1.clProSettings);
ListView1.ListType := 'horizontal';
searchEdt.TargetListView := ListView1;
end;
begin
MyForm := TclForm.Create(Self);
SetSearchEdit;
CreateListView;
MyForm.Run;
end;