Streamline code for FilterEdits and their example project.

This commit is contained in:
Juha 2023-01-05 13:18:28 +02:00
parent 4c822bb36e
commit 5a269b8bc4
3 changed files with 4 additions and 7 deletions

View File

@ -85,6 +85,9 @@
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>

View File

@ -96,14 +96,11 @@ end;
procedure TListViewFilterForm.FormCreate(Sender: TObject);
begin
ListView1.BeginUpdate;
AddLVItem('String1', 'String2');
AddLVItem('String3', 'String4');
AddLVItem('A String', 'another String');
AddLVItem('x string', 'Extra String');
ListViewFilterEdit1.InvalidateFilter;
ListViewFilterEdit1.ResetFilter;
ListView1.EndUpdate;
end;
procedure TListViewFilterForm.ButtonProgramClick(Sender: TObject);

View File

@ -1187,10 +1187,7 @@ end;
procedure TCustomControlFilterEdit.SetFilter(const AValue: string);
begin
if Text=AValue then Exit;
Text:=AValue;
Button.Enabled:=AValue<>'';
fFilterLowercase:=UTF8LowerCase(AValue);
InvalidateFilter;
Text:=AValue; // ActivateFilter will be called by EditChange handler.
end;
procedure TCustomControlFilterEdit.SetFilterOptions(AValue: TFilterStringOptions);