Recent

Author Topic: Why methods of TCustomShellListView are not virtual?  (Read 1918 times)

mm7

  • Full Member
  • ***
  • Posts: 231
  • PDP-11 RSX Pascal, Turbo Pascal, Delphi, Lazarus
Why methods of TCustomShellListView are not virtual?
« on: May 20, 2015, 03:55:28 am »
Why methods of TCustomShellListView are not virtual?

I would override procedure PopulateWithRoot(); but it is not virtual.
I need to fill ShellListView with all directories and only files that defined by Mask.
Currently Mask is applied to both, directories and files.

I know workarounds:
A. write TMyCustomShellListView;
B. Populate all, and then delete file items that are not comply to Mask;
C. Populate with Mask, and then additionally populate with directories;

But B and C require an event like "AfterPopulateWithRoot(); that also does not exist.

Q1: any other ideas?
Q2: Why methods of TCustomShellListView are not virtual?
« Last Edit: May 20, 2015, 04:29:02 am by mm7 »

Bart

  • Hero Member
  • *****
  • Posts: 5689
    • Bart en Mariska's Webstek
Re: Why methods of TCustomShellListView are not virtual?
« Reply #1 on: May 20, 2015, 12:04:45 pm »
Maybe you can use the OnFileAdded event?
Use '*' as mask, then uses functions like MatchesMaskList to check if the file/foldername matches your desired mask?

Bart

mm7

  • Full Member
  • ***
  • Posts: 231
  • PDP-11 RSX Pascal, Turbo Pascal, Delphi, Lazarus
Re: Why methods of TCustomShellListView are not virtual?
« Reply #2 on: May 20, 2015, 02:22:27 pm »
Thanks Bart.
It would be nice. But. Unfortunately there is no OnFileAdded event.
Lazarus 1.4RC2

Bart

  • Hero Member
  • *****
  • Posts: 5689
    • Bart en Mariska's Webstek
Re: Why methods of TCustomShellListView are not virtual?
« Reply #3 on: May 20, 2015, 02:53:21 pm »
There is in trunk.
Since introducing this event isn't a bug fix, chances are it will not be merged into the 1.4 branch.

If you need it, and don't want to use trunk, you can modify the shellctrls unit yourself.
(Find the revision it was introduced, get the diff file and use patch to update your local copy)

Bart

 

TinyPortal © 2005-2018