RAD Studio |  |

Objects, Components, and Controls
See Also
Collapse All

The following diagram is a greatly simplified view of the inheritance hierarchy that illustrates the relationship between objects, components, and controls.

Every object (class) inherits from TObject. Objects that can appear in the Form Designer inherit from TPersistent or TComponent. Controls, which appear to the user at runtime, inherit from TControl. There are two types of controls, graphic controls, which inherit from TGraphicControl, and windowed controls, which inherit from TWinControl or TWidgetControl. A control like TCheckBox inherits all the functionality of TObject, TPersistent, TComponent, TControl, and TWinControl or TWidgetControl, and adds specialized capabilities of its own.

The figure shows several important base classes, which are described in the following table:

Class | Description
TObject | Signifies the base class and ultimate ancestor of everything in the VCL TObject encapsulates the fundamental behavior common to all VCLobjects by introducing methods that perform basic functions such as creating, maintaining, and destroying an instance of an object.
Exception | Specifies the base class of all classes that relate to VCL exceptions. Exception provides a consistent interface for error conditions, and enables applications to handle error conditions gracefully.
TPersistent | Specifies the base class for all objects that implement publishable properties. Classes under TPersistent deal with sending data to streams and allow for the assignment of classes.
TComponent | Specifies the base class for all components. Components can be added to the Tool palette and manipulated at design time. Components can own other components.
TControl | Represents the base class for all controls that are visible at runtime. TControl is the common ancestor of all visual components and provides standard visual controls like position and cursor. This class also provides events that respond to mouse actions.
TWinControl or TWidgetControl | Specifies the base class of all controls that can have keyboard focus. Controls under TWinControl are called windowed controls while those under TWidgetControl are called widgets.

See Also

Object Pascal and the Class Libraries

TPersistent Branch

TComponent Branch

TControl Branch

TObject Branch

TWinControl/TWidgetControl Branch

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!