Recent

Author Topic: Lazarus Release Candidate 3 for 2.0  (Read 103968 times)

hubblec4

  • New Member
  • *
  • Posts: 25
Re: Lazarus Release Candidate 3 for 2.0
« Reply #45 on: December 30, 2018, 01:59:37 pm »
Or should OPM contain only VTV4 with all critical identifiers renamed to give users of the old version a chance to install it in addition to the one used by OPM?

This should be a MUST. I need this "old" VTV4 otherwise a have to rewrite a 100.000 line code project(again).

hubblec4

  • New Member
  • *
  • Posts: 25
Re: Lazarus Release Candidate 3 for 2.0
« Reply #46 on: December 30, 2018, 02:16:24 pm »
And here another issue with VTV5.

I changed VTV4 to VTV5 in the project inspector and compile my project.

It crashes before the the program window is visible on screen.
After a while I found the reason.
I have a unit with an initialization part.
With VTV4 is this unit loaded and the initialization part will be engaged. (a class is created and a var is set to true which is needed to block something later in my code).
With VTV5 is this unit not loaded (or is loaded later maybe)...no var is set to true and it crashes for a setting on a component.

It seams to me there are changes in order to load units or so....sorry I'm not an expert at this. But with VTV4 works like expected.
« Last Edit: December 30, 2018, 02:39:13 pm by hubblec4 »

balazsszekely

  • Guest
Re: Lazarus Release Candidate 3 for 2.0
« Reply #47 on: December 30, 2018, 02:48:20 pm »
@hubblec4
You can always download vtv4 from here: https://github.com/blikblum/VirtualTreeView-Lazarus/releases/tag/lazarus-4.8.7-R4
Unfortunately OPM will not work with that version. So you must uninstall VTV5 and OPM first. As I said in one of my previous posts, initially OPM had a "build in" VTV, which in fact it was VTV4.8.7, but then the core developers started to complain about code duplication, code bloat, etc...and they were right. So unfortunately there is no perfect solution.
« Last Edit: December 30, 2018, 03:02:44 pm by GetMem »

hubblec4

  • New Member
  • *
  • Posts: 25
Re: Lazarus Release Candidate 3 for 2.0
« Reply #48 on: December 30, 2018, 03:12:35 pm »
I can understand why it is necessary to have VTV5, but it is not the right way to get working an older VTV when I have to uninstall good new features(OPM).

The best will be to fix VTV5 immediately before rev2.0 is finished.
Any one which will use the VTV5 will have all the issues.

balazsszekely

  • Guest
Re: Lazarus Release Candidate 3 for 2.0
« Reply #49 on: December 30, 2018, 03:31:05 pm »
Quote
The best will be to fix VTV5 immediately before rev2.0 is finished.
Any one which will use the VTV5 will have all the issues.
The official repository for VTV is on github. You should file a bug report there: https://github.com/blikblum/VirtualTreeView-Lazarus/issues. The one in the lazarus component folder is just a copy, only needed for OPM. After it's fixed on github, the changes can be merged back to the component folder.

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: Lazarus Release Candidate 3 for 2.0
« Reply #50 on: December 30, 2018, 04:10:41 pm »
You should file a bug report there: https://github.com/blikblum/VirtualTreeView-Lazarus/issues.
I absolutely agree with GetMem. It is no use complaining here about the bugs in VTV5, there is almost zero chance that Luiz, the maintainer of the Lazarus port VTV, will read a thread titled "Lazarus Release Candidate 3 for 2.0" and expect a VTV bug report buried among 50 posts.

hubblec4

  • New Member
  • *
  • Posts: 25
Re: Lazarus Release Candidate 3 for 2.0
« Reply #51 on: December 30, 2018, 04:54:47 pm »
You both are right this is not the right place for VTV bug report.
I know this project on GitHub, I had open a feature request there for a long time... no answer, and I guess it needs a looong time for VTV fixes.

Quote
Why should everybody (including you) test the release candidate?
Every one should test the new RC's because "you can be the one of millions where the projects are broken".

Lazarus works with VTV4 and now we have VTV5 with more features but it is unstable and buggy and breaks my and maybe other projects. I don't understand the logic to replace a working component with a buggy version.


balazsszekely

  • Guest
Re: Lazarus Release Candidate 3 for 2.0
« Reply #52 on: December 30, 2018, 05:17:06 pm »
@hubblec4
Quote
Why should everybody (including you) test the release candidate?
Quote
Every one should test the new RC's because "you can be the one of millions where the projects are broken".

Lazarus works with VTV4 and now we have VTV5 with more features but it is unstable and buggy and breaks my and maybe other projects. I don't understand the logic to replace a working component with a buggy version.
I understand your frustration, sometimes I feel the same about Lazarus development, but:
1. We did not replace anything. Until now(Lazarus 2.0), VTV wasn't part of the Lazarus project. Just a third party package, a very useful one by the way
2. We added VTV5 because it was recommended by the package maintainer(@luiz)
3. VTV5 is only needed for OPM, Lazarus itself does not depend on the package. You can uninstall both VTV5/OPM and use VTV4 if you like. So no showstopper here
4. Until now I did not notice any major bug in VTV5. Please note I'm not saying your findings are not true, but I don't have time to look after VTV bugs for now, maybe next year
« Last Edit: December 30, 2018, 05:22:02 pm by GetMem »

hubblec4

  • New Member
  • *
  • Posts: 25
Re: Lazarus Release Candidate 3 for 2.0
« Reply #53 on: December 30, 2018, 07:14:20 pm »
I'm not really frustrated and for me it is OK how it is, and my project works also with Lazarus rev2.0 and installed OPM. I don't want waste my energy for things that I can't change. So I think best way is to fix VTV5.

Is there anyone active develop VTV5?

VTV is the best component for me and I don't want miss them anymore.
« Last Edit: December 30, 2018, 07:16:10 pm by hubblec4 »

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: Lazarus Release Candidate 3 for 2.0
« Reply #54 on: December 31, 2018, 02:06:27 am »
Now I took the time to rename the essential classes of VTV4 (i.e. i added a "4") and packed everything into a zip. Unfortunately, the file is too large for the forum, so I uploaded it to my dropbox: https://www.dropbox.com/s/d5hmtmurcdx5eeo/VirtualTreeView4.zip?dl=0.

I adapted to demos coming with VTV to the new naming scheme within 1 hour (for more than 20 forms); I did everything manually because I fear that Search & replace can damage the text.

These are the steps to adapt an existing VTV4 project:
  • Make a backup copy of the entire project. You will have to do some operations which usually are not recommended.
  • Open an external editor such as NotePad++ and drag in the .lpi file. Find the package section and make sure that the VTV package has the name "virtualtreeview_package4". Add the "4" if the name is that of the VTV5 package, "virtualtreeview_package" 
  • Drag in the .lpr file, and make sure that, if the package name is used, it contains the "4" at the end.
  • Drag each .lfm file into the editor. Find out whether there are any lines with the types "TVirtualStringTree", "TVirtualDrawTree", or "TVHTeaderPopup". Add a "4" to the type names, leave the instance name intact, i.e. a line "object VirtualStringGrid1: TVirtualStringTree" must become "object "VirtualstringGrid1: TVirtualStringTree4". This is an essential step because Lazarus will not load the "non-4" classes with the VTV4-package, and this will cause a lot of trouble
  • Drag each .pas file into the editor:
    • In the uses clause replace the unit name "VirtualStringTrees" by "VirtualStringTrees4". If other VTV units are used they need the "4" at the end, too.
    • Scroll down, find the VirtualstringTree or VirtualDrawTree or TVTHeaderPopup in the type declaration of the form and add a "4" to the type, i.e. replace
      "TVirtualStringTree" by "TVirtualStringTree4".
    • Load the unit into Lazarus and try to compile. The compiler will complain each time it finds an identifier of VTV5 - add the "4" to the type, i.e. do the following replacements
      • "TBaseVirtualTree" --> "TBaseVirtualTree4"
      • "TVirtualStringTree" --> "TVirtualStringTree4"
      • "TVirtualDrawTree" --> "TVirtualDrawTree4"
      • "TVTHeader" --> "TVTHeader4"
      • "TVirtualTreeColumn" by "TVirtualTreeColumn4" (the same for the plural.).
      Probably there are some more which I forgot
    • After a few iterations, the project will compile and use the VirtualTreeView v4.
    This list may look scary, but when you practice with a dummy project you'll see that it's easy.

    [EDIT]
    Looks like the IDE is much more tolerant against duplicate class names than I assumed. In fact it is sufficient to rename only the registered components, i.e. TVirtualStringTree to TVirtualStringTree4, TVirtualDrawTree to TVirtualDrawTree4, and TVTHeaderPopup to TVTHeaderPopup4 (plus the unit names and package names, of course). This makes adaption of a project to coexistent VTV4 much easier. The new version in my dropbox link takes care of this.

    The attached screenshot demonstrates that VTV5 and VTV4 components (the latter ones with overlay "4") co-exist in the same IDE. It is possible to compile the "Advanced" demo of the VTV5 distribution (in Luiz's github) and the adapted one of the VTV4 package without any further changes.
« Last Edit: December 31, 2018, 09:17:14 am by wp »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus Release Candidate 3 for 2.0
« Reply #55 on: December 31, 2018, 02:21:08 am »
Not tested, but...

Has anyone checked if OPM would compile against vtv4?

I am not suggesting to change the distribution. But if it compiles, and someone needs vtv4, they can
- download vtv4
- open opm package, drop vtv5 dependency, replace by vtv4, and compile.

And then they should have vtv4 in their Ide.

hubblec4

  • New Member
  • *
  • Posts: 25
Re: Lazarus Release Candidate 3 for 2.0
« Reply #56 on: December 31, 2018, 03:12:52 am »
Not tested, but...

Has anyone checked if OPM would compile against vtv4?

I am not suggesting to change the distribution. But if it compiles, and someone needs vtv4, they can
- download vtv4
- open opm package, drop vtv5 dependency, replace by vtv4, and compile.

And then they should have vtv4 in their Ide.

Sounds interesting, I will test it.

@wp

Looks like a lot of work. Thanks for try to find a solution.

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: Lazarus Release Candidate 3 for 2.0
« Reply #57 on: December 31, 2018, 07:13:21 am »
@wp

Looks like a lot of work.
No. It is a snap. Please see the [EDIT] of my previous post: You only must rename the unit name and the names of the registered components, for a form with a single VTV this is one change in the lfm and two changes in the pas file.

balazsszekely

  • Guest
Re: Lazarus Release Candidate 3 for 2.0
« Reply #58 on: December 31, 2018, 09:21:03 am »
@wp
Quote
Now I took the time to rename the essential classes of VTV4 (i.e. i added a "4") and packed everything into a zip. Unfortunately, the file is too large for the forum, so I uploaded it to my dropbox: https://www.dropbox.com/s/d5hmtmurcdx5eeo/VirtualTreeView4.zip?dl=0.
Thanks. I assume that the modified VTV4 can co-exists with VTV5, so you can install both of them at the same time. If yes, then I will add it back to the main repository.


@martin_fr
Quote
Has anyone checked if OPM would compile against vtv4?
Yes. Unfortunately you cannot build OPM with VTV4, at least not without small modification. However it shouldn't take too long to make the necessary adjustments. Some of the procedures parameter has changed, like:
VTV4
Code: Pascal  [Select][+][-]
  1. procedure OnHeaderClick(Sender: TVTHeader; Column: TColumnIndex; Button: TMouseButton; Shift: TShiftState;  X,  Y: Integer)
vs VTV5
Code: Pascal  [Select][+][-]
  1. procedure OnHeaderClick(Sender: TVTHeader; HitInfo: TVTHeaderHitInfo);
However the drawback is that with each new version of OPM, the adjustments must be redone. In my opinion the best solution is to fix the bugs(if any) in VTV5.
« Last Edit: December 31, 2018, 09:22:39 am by GetMem »

wp

  • Hero Member
  • *****
  • Posts: 11858
Re: Lazarus Release Candidate 3 for 2.0
« Reply #59 on: December 31, 2018, 10:48:12 am »
I assume that the modified VTV4 can co-exists with VTV5, so you can install both of them at the same time.
Yes. Installation of both VTV versions on the same system is no problem (well... I only checked Windows, Linux gtk2 and qt).

However, with the current version, VTV4 and VTV5 cannot be mixed within the same project. This is some kind of disadvantage because otherwise a large project could be converted form by form. To avoid this more auxiliary types should be differentiated, e.g. by introducing a TBaseVirtualTree4 like I had in my first version. But this would make it more difficult to convert an existing VTV4 project to the modified VTV4.

If yes, then I will add it back to the main repository.
Maybe we should wait for some feedback first. I think I'll add it to ccr in order to have some workplace if changes are required in the future. It should be clarified here, however, that this VTV4 fork will not be developed any further, I will only fix compilation issues which can creep in sometimes.
« Last Edit: December 31, 2018, 11:12:40 am by wp »

 

TinyPortal © 2005-2018