mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 10:59:29 +02:00
LazControls: Use the new OnFilterItemEx also for TreeFilterEdit.
git-svn-id: trunk@51866 -
This commit is contained in:
parent
919198e297
commit
d658049401
@ -154,6 +154,7 @@ begin
|
||||
else
|
||||
EndInd := 0;
|
||||
for i := 0 to EndInd do begin
|
||||
// ToDo: Use OnFilterItemEx event.
|
||||
Result := Pos(FilterLC,UTF8LowerCase(aData[i]))>0;
|
||||
if Result then
|
||||
Exit;
|
||||
|
@ -475,12 +475,16 @@ begin
|
||||
FilterLC:=UTF8LowerCase(Filter);
|
||||
while Node<>nil do
|
||||
begin
|
||||
// Call OnFilterItem handler.
|
||||
if Assigned(OnFilterItem) then
|
||||
Pass:=OnFilterItem(TObject(Node.Data), Done)
|
||||
// Filter with event handler if there is one.
|
||||
if Assigned(fOnFilterItemEx) then
|
||||
Pass:=fOnFilterItemEx(Node.Text, TObject(Node.Data), Done)
|
||||
else
|
||||
Pass:=False;
|
||||
// Filter by item's title text if needed.
|
||||
// Support also the old filter event without a caption.
|
||||
if (not (Pass and Done)) and Assigned(fOnFilterItem) then
|
||||
Pass:=fOnFilterItem(TObject(Node.Data), Done);
|
||||
|
||||
// Filter by item's caption text if needed.
|
||||
if not (Pass or Done) then
|
||||
Pass:=(FilterLC='') or (Pos(FilterLC,UTF8LowerCase(Node.Text))>0);
|
||||
if Pass and (fFirstPassedNode=Nil) then
|
||||
|
Loading…
Reference in New Issue
Block a user