Recent

Author Topic: TVirtualStringTree not loading on small demo project [SOLVED]  (Read 738 times)

carl_caulkett

  • Hero Member
  • *****
  • Posts: 654
TVirtualStringTree not loading on small demo project [SOLVED]
« on: September 27, 2024, 08:42:12 pm »
* Mac Mini M1
* macOS 14.6.1
* Lazarus 3.4
* FPC 3.2.2

I am trying to load the project in the zip file `vst.zip` mentioned in this post https://forum.lazarus.freepascal.org/index.php/topic,54369.msg404124.html#msg404124

Despite the fact I have TVirtualTreeView installed, the project will not load, giving a series of error messages (see attached)...

I tried changing the file in the `uMain.pas` file from `VirtualTrees` to `laz.virtualtrees` but that didn't work.

What am I missing?



« Last Edit: September 27, 2024, 10:43:41 pm by carl_caulkett »
"It builds... ship it!"

wp

  • Hero Member
  • *****
  • Posts: 13324
Re: TVirtualStringTree not loading on small demo project
« Reply #1 on: September 27, 2024, 10:08:22 pm »
Despite the fact I have TVirtualTreeView installed, the project will not load, giving a series of error messages (see attached)...
Which TVirtualTreeView? The one from OPM? Or the one from https://github.com/blikblum/VirtualTreeView-Lazarus? The project seems to be written for the latter one.

In order to get it working you must either install the github version or convert the sample project to the Lazarus OPM version.

These are the steps for the conversion:
  • Load the uMain.pas into an external editor, change unit VirtualTrees to laz.VirtualTrees, and the type of TfMain member VTV from TVirtualStringTree to TLazVirtualStringTree. The same with member FSortDir (must be type Laz.VirtualTrees.TSortDirection). In procedure TfMain.VSTHeaderClick replace VirtualTrees by Laz.VirtualTrees.
  • Next, load the lfm file into an external editor, find the line "VST: TVirtualStringTree" and replace the TVirtualStringTree  by TLazTVirtualStringTree.
  • Finally load the lpi file into the editor, find the line "<packageName Value="virtualtreeview_package"/>", and add the "laz." before the "virtualtreeview_package".
Now the project should work in Lazarus. See attachment.

The reason for this renaming action is that initially the Lazarus VTV had partially the original names which lead the issues for those users who wanted to work with the github version as well.

« Last Edit: September 27, 2024, 10:11:45 pm by wp »

carl_caulkett

  • Hero Member
  • *****
  • Posts: 654
Re: TVirtualStringTree not loading on small demo project
« Reply #2 on: September 27, 2024, 10:43:10 pm »
That's perfect! Thanks very much indeed 🙏🏽
"It builds... ship it!"

 

TinyPortal © 2005-2018