Recent

Author Topic: Differences in ShellListView in Delphi and Lazarus  (Read 3859 times)

JanRoza

  • Hero Member
  • *****
  • Posts: 744
    • http://www.silentwings.nl
Differences in ShellListView in Delphi and Lazarus
« on: June 17, 2015, 12:22:55 am »
I used the following statement without errors in Delphi:

Code: [Select]
iFileSize := CountSize(ShellListView1.Folders[i].PathName);
But in Lazarus it seems ShellListView has no Folders member, anyone know how to get the same result as above in Lazarus?
OS: Windows 11 / Linux Mint 22.3
       Lazarus 4.6 RC FPC 3.2.2
       CodeTyphon 8.90 FPC 3.3.1

Bart

  • Hero Member
  • *****
  • Posts: 5713
    • Bart en Mariska's Webstek
Re: Differences in ShellListView in Delphi and Lazarus
« Reply #1 on: June 17, 2015, 12:02:00 pm »
What does CountSize do?
What are you rtying to achieve (I guess the total size a given folder takes on disk)?

In Delphi the shellcontrols are an interface to the OS, in Lazarus they are not (yet).

To get to Folders I guess you have to iterate through the Items property, and test wether it is a folder or a file.
You can use TFileSearcher to iterate over all files/folder and use the OnFileFound event to get the filesize of each found file.

Bart

JanRoza

  • Hero Member
  • *****
  • Posts: 744
    • http://www.silentwings.nl
Re: Differences in ShellListView in Delphi and Lazarus
« Reply #2 on: June 17, 2015, 04:47:34 pm »
Hi Bart,

Correct, I'm trying to count the total size of everything selected in the shelllistview window.
I made a backup/restore program in Delphi which uses Abbrevia for compressed backups and a shelltreeview and shelllistview for uncompressed backups. In the Delphi version everything works as designed but in Lazarus I have quite some glitches I have to overcome. One is the different way the shellcontrols work and another one is that Abbrevia misses some visual components items (unless you use the CodeTyphon version) and it does not show the folder and file icons correctly in the treeview and listview. A pity as I wanted to make my backup program a part of the Lazarus/FreePascal showcase. Well to get a complete and correct working Lazarus version of this backup program will keep me out of the bar for the foreseeable future.  :)
OS: Windows 11 / Linux Mint 22.3
       Lazarus 4.6 RC FPC 3.2.2
       CodeTyphon 8.90 FPC 3.3.1

Bart

  • Hero Member
  • *****
  • Posts: 5713
    • Bart en Mariska's Webstek
Re: Differences in ShellListView in Delphi and Lazarus
« Reply #3 on: June 17, 2015, 05:10:52 pm »
I recently saw a thread that implemented folder/file icons for Lazarus shellcontrols, I think it was in this forum...

We need shellcontrols to be an interface to the OS, and that then must be cross-platform, which is gonna be a hell of a job.

Bart

 

TinyPortal © 2005-2018