RAD Studio |  |

Understanding the Component Library
See Also
Collapse All

The component library is made up of objects that you can use in your projects. The VCL/RTL contains low-level classes and routines available for all VCL applications. VCL/RTL includes the runtime library (RTL) up to and including the Classes unit.

Use the VCL when you want to use native Windows controls, Windows-specific features, or extend an existing VCL application.

All classes in the VCL descend from TObject. TObject introduces methods that implement fundamental behavior like construction, destruction, and message handling.

Components are a subset of the component library that descend from the class TComponent. You can place components on a form or data module and manipulate them at design time. Using the Object Inspector, you can assign property values without writing code. Most components are either visual or nonvisual, depending on whether they are visible at runtime. Some components appear on the Tool palette.

Visual components, such as TForm and TSpeedButton, are called controls and descend from TControl. Controls are used in GUI applications, and appear to the user at runtime. TControl provides properties that specify the visual attributes of controls, such as their height and width.

Nonvisual components are used for a variety of tasks. For example, if you are writing an application that connects to a database, you can place a TDataSource component on a form to connect a control and a dataset used by the control. This connection is not visible to the user, so TDataSource is nonvisual. At design time, nonvisual components are represented by an icon. This allows you to manipulate their properties and events just as you would a visual control.

Classes that are not components (that is, classes that descend from TObject but not TComponent) are also used for a variety of tasks. Typically, these classes are used for accessing system objects (such as a file or the clipboard) or for transient tasks (such as storing data in a list). You can't create instances of these classes at design time, although they are sometimes created by the components that you add in the Form Designer.

Detailed reference material on all VCL objects is accessible while you are programming. In the Code editor, place the cursor anywhere on the object and press F1 to display the Help topic. Objects, properties, methods, and events that are in the VCL are marked "VCL Reference."

See Also

Properties

Objects

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