Recent

Author Topic: Class explorer  (Read 2068 times)

bpranoto

  • Full Member
  • ***
  • Posts: 183
Class explorer
« on: May 22, 2023, 03:27:06 pm »
Is there a feature in the Lazarus IDE to display Class inheritance?

If I have TParentClass, can I get information all descendant classes like below?

Code: Pascal  [Select][+][-]
  1. TParentClass=class;
  2.    TChild1Class=class(TParentClass);
  3.        TGrandChild1Class1=class(TChild1Class)
  4.        TGrandChild2Class1=class(TChild1Class)
  5.    TChild2Class=class(TParentClass);
  6.        TGrandChild1Class2=class(TChild2Class)
  7.        TGrandChild2Class2=class(TChild2Class)
  8.  

Blaazen

  • Hero Member
  • *****
  • Posts: 3241
  • POKE 54296,15
    • Eye-Candy Controls
Re: Class explorer
« Reply #1 on: May 22, 2023, 05:17:13 pm »
There's only class hierarchy for Components (View -> Components). I don't know any for project itself.
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

cdbc

  • Hero Member
  • *****
  • Posts: 1499
    • http://www.cdbc.dk
Re: Class explorer
« Reply #2 on: May 22, 2023, 05:41:21 pm »
Hi
Dunno about IDE, but you can traverse the class hierarchy backwards from e.g.: TGrandChild2Class2 via the ClassParent function of TObject, yourself.
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

Handoko

  • Hero Member
  • *****
  • Posts: 5290
  • My goal: build my own game engine using Lazarus
Re: Class explorer
« Reply #3 on: May 22, 2023, 06:11:21 pm »
I use Code Explorer. Not very good, hope it will be improved in the future.

See the attached screenshot below. There we can see TgiButton is a child class of TgiLabel. And Both TgiRectangle and TgiLabel are child classes of TgiItem.

bpranoto

  • Full Member
  • ***
  • Posts: 183
Re: Class explorer
« Reply #4 on: May 23, 2023, 03:22:27 am »
Hi
Dunno about IDE, but you can traverse the class hierarchy backwards from e.g.: TGrandChild2Class2 via the ClassParent function of TObject, yourself.
Regards Benny

Traverse backward is easy, we can see the parent class in the class declaration.

wp

  • Hero Member
  • *****
  • Posts: 12304
Re: Class explorer
« Reply #5 on: May 23, 2023, 11:32:55 am »
For documentation purposes I wrote myself the attached ClassHierarchy application which contains an LvlGraphControl to list the hierarchical relation between classes added. Specify the classes in the AddControls method, but don't forget to add the units of the classes to the uses clause. Note that the application assumes that the component icons are found in the images/components folder of the Lazarus installation (for more general locations this part of the application must be extended).

zen010101

  • Newbie
  • Posts: 4
Re: Class explorer
« Reply #6 on: July 25, 2024, 05:08:41 pm »
I know only ModelMaker Code Explorer (MMX) for delphi can do this . So, view the code in delphi.

see the picture: https://i.imgur.com/jF9s7Xz.png

source of the class hierarchy: https://imgur.com/ECYwo1P

 

TinyPortal © 2005-2018