A first try to dinamically build a Classes hierarchy tree from the used Classes in your app 
classtree.prg

classtree.prg
#include "FiveWin.ch"
static aClasses := {}
function Main()
local oWnd
DEFINE WINDOW oWnd TITLE "Classes hierarchy"
ACTIVATE WINDOW oWnd ;
ON INIT BuildClassesTree( oWnd )
return nil
function BuildClassesTree( oWnd )
local n := 1, oClass, oTree, oItem, oChild
while ! Empty( __ClassName( n ) )
AAdd( aClasses, TClass():New( __ClassName( n++ ) ) )
end
for each oClass in aClasses
oClass:GetSuper()
next
for each oClass in aClasses
oClass:GetChilds()
next
oTree = TTreeView():New( 1, 1, oWnd )
oTree:nWidth = 152
// oTree:SetImageList( oImageList )
// oTree:Add( "Files" )
for each oClass in aClasses
if Empty( oClass:cSuper )
oItem = oTree:Add( oClass:cName )
for each oChild in oClass:aChilds
oItem:Add( oChild:cName )
next
endif
next
oTree:Expand()
return nil
CLASS TClass
DATA cName
DATA cSuper
DATA aChilds INIT {}
METHOD New( cName )
METHOD GetSuper()
METHOD GetChilds()
ENDCLASS
METHOD New( cName ) CLASS TClass
::cName = cName
::cSuper = ""
return Self
METHOD GetSuper() CLASS TClass
local oClass, oInstance := &( ::cName + "()" )
for each oClass in aClasses
try
if oInstance:IsDerivedFrom( oClass:cName ) .and. ::cName != oClass:cName
::cSuper = oClass:cName
endif
end
next
return nil
METHOD GetChilds() CLASS TClass
local oClass
for each oClass in aClasses
if oClass:cSuper == ::cName
AAdd( ::aChilds, oClass )
endif
next
return nil
function Error()
return ErrorNew()



