Displaying Inheritance Hierarchy in the Graph Window

From RAD Studio
Jump to: navigation, search

Go Up to C++ Class Explorer Topics


You can select several types in the Type List and view a graphical representation of their inheritance. The Graph window in the C++ Class Explorer can display the inheritance hierarchy of types regardless of whether the types are in the managed unit (paired .cpp/.h files) of your application. For example, you can select types from the VCL, and the Graph window displays their inheritance hierarchy.

To display the inheritance hierarchy of types:

  1. In C++Builder, open a C++ project that you want to examine.
  2. Select View > C++ Class Explorer .
  3. In the Type List, select several types whose inheritance you want to view. To select multiple noncontiguous types, use Ctrl+Click.
  4. Click the Graph tab of the Source/References/Graph window.

The inheritance hierarchy in the Graph window uses shapes as follows:

  • Elliptical shapes (ovals) enclose the symbols.
  • Rectangular shapes enclose groups (that is, symbols defined in the same file, such as .h or .hpp).

Use the context menu commands on the Graph window to control the graphical representation as follows:

  • Arrows (controls direction of inheritance arrows: You can choose either Base to Derived or Derived to Base)
  • Group (controls whether source file groups are indicated: You can choose By File or None)
  • Orientation (You can choose from Top -> Bottom, Bottom -> Top, Left -> Right, or Right -> Left)
  • Ratio (controls the size of the graph in the window: You can choose either Window or Best Fit)
  • Zoom (enlarges or reduces the size of the graph: You can choose an increment between 25% and 400%)

Screenshot: See C++ Class Explorer Overview.

Tips

  • If you group the Type List by File (ClExplFile.png), Namespace (GroupTypesByNamespace.png) or Custom Group (ClExplCustomGroup.png), you can select the node of the file, namespace or custom group that you want in the Type List. Then the Graph view displays the hierarchical relationship of the classes declared in the corresponding file, namespace or custom group.
  • The Type List allows you to multi-select only nodes of the same level, except when you have selected Group Types by Inheritance Hierarchy (ClExplHierarchy.png) in the toolbar. In hierarchy mode, you can multi-select nodes at any level. This means that certain graphs are easier to generate in one grouping than another. For example, if you want to create a graph of just classes in your project, you would want to activate Custom grouping (ClExplCustomGroup.png). And if you want to create a graph of classes from two files or two namespaces, it is best to activate Group by Files (ClExplFile.png) and Group by Namespaces (GroupTypesByNamespace.png), respectively.

See Also