LazControls: Use the new OnFilterItemEx also for TreeFilterEdit.

git-svn-id: trunk@51866 -
This commit is contained in:
juha 2016-03-08 21:05:58 +00:00
parent 919198e297
commit d658049401
2 changed files with 9 additions and 4 deletions

View File

@ -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;

View File

@ -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