Recent

Author Topic: About the Class View  (Read 360 times)

yinhuajian

  • New Member
  • *
  • Posts: 14
About the Class View
« on: December 16, 2025, 03:03:33 am »
If I have many classes in my project, and there are multiple levels of inheritance relationships between the classes, is there a view in the Lazarus IDE that allows me to easily examine the class inheritance hierarchy?

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4660
  • I like bugs.
Re: About the Class View
« Reply #1 on: December 16, 2025, 11:59:18 am »
No, but you could try an external reverse engineering UML app LazModel which is a port of ESS-Model.
It uses fcl-passrc from FPC libs. Now I use FPC trunk and get errors about "resource not supported" when opening a project's .lpr file. I don't know why.

AFAIK the best version is in https://github.com/iLya2IK/Laz-Model.
It has not been updated for almost 3 years. Somebody should improve and develop it further.

Such UML tool should be integrated in Lazarus IDE as a plugin package. ESS-Model license is GPL and it could be used.
A hint for somebody who is searching for a nice challenge.
IMO reverse engineering a class diagram is more useful than drawing it. Even if a UML tool supports generating code from a drawn diagram, the code must be changed in editor and finally it will not match with the diagram.
Better use the editor with all its Codetools helper features and then reverse engineer a class diagram.
Other kinds of UML diagrams still require a standalone UML tool. The reverse engineering is only for class diagrams.
« Last Edit: December 16, 2025, 01:07:34 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

wp

  • Hero Member
  • *****
  • Posts: 13334
Re: About the Class View
« Reply #2 on: December 16, 2025, 01:58:25 pm »
In my github you can find a small project which displays the hierarchy of TAChart classes by means of the TLvlGraphControl coming with Lazarus. Add a class to the tree by calling the AddClassNode method of the form, all the ancestors of this class will be added as well up to an optional "RootClass" in the inheritance tree.

 

TinyPortal © 2005-2018