I added my handler, to allow filtering by N space-separated words in the filter field.
My handler:
function TfmMain.CodeTreeFilter_OnFilterNode(ItemNode: TTreeNode; out Done: Boolean): Boolean;
var
SNodeText: string;
SItem: string;
Sep: TATStringSeparator;
begin
SNodeText:= LowerCase(ItemNode.Text);
Sep.Init(CodeTreeFilter.FilterLowercase, ' ');
while Sep.GetItemStr(SItem) do
begin
if Pos(SItem, SNodeText)=0 then
begin
Done:= true;
exit(false);
end;
end;
Done:= true;
Result:= true;
end;
when at least one space-separated word don't match, I return False and set Done=true. If all words are present - i return True and set Done=true. Is this OK logic?
But result is bad!
Lazarus 2.3.0 (rev main-2_3-3327-g27bf5d2ba7) FPC 3.2.3 x86_64-linux-gtk2
Maybe TreeFilterEdit event is buggy?