Thanks, Nigel!
I made it work using a TStringList of filenames and a checkbox to toggle filtering.
procedure TfrmAssetCurator.ckbFilterGridClick(Sender: TObject);
var imgGrid: TImageEnMView;
begin
if (not Self.Active) then
Exit;
if (iNavGrid = 0) then
imgGrid := imgMView
else
imgGrid := imgMViewTarget;
if (ckbFilterGrid.Checked) then
GetCheckedImages (imgGrid)
else
fExcludedFiles.Clear;
UpdateFilter(imgGrid);
end;
function TfrmAssetCurator.GetCheckedImages (imgGrid: TImageEnMView): Integer;
var i: Integer;
begin
fExcludedFiles.Clear;
for i := 0 to imgGrid.ImageCount-1 do
if (not imgGrid.Checked[i]) then
fExcludedFiles.Add(imgGrid.ImageFileName[i]);
Result := fExcludedFiles.Count;
end;
procedure TfrmAssetCurator.imgMViewFilter(Sender: TObject; Index: Integer;
const Filename: string; var ShowFrame: Boolean);
begin
if fExcludedFiles.IndexOf( Filename ) >= 0 then
ShowFrame := False;
end;
It's working well enough at the moment. I may reach out to you for source later, as well as some tips for speeding up the reloading the grid when clearing the filter.
Thanks again,
Skip