The component library is extensive, containing both components that you can work with in the IDE and classes that you create and use in runtime code. Some of the classes can be used in any application, while others can only appear in certain types of applications.
The component library is made up of objects separated into several sublibraries, each of which serves a different purpose. These sublibraries are listed below:
- BaseCLX - Low-level classes and routines available for all CLX applications. BaseCLX includes the runtime library (RTL) up to and including the Classes unit.
- DataCLX - Client data-access components. The components in DataCLX are a subset of the total available set of components for working with databases. These components are used in cross-platform applications that access databases. They can access data from a file on disk or from a database server using dbExpress.
- NetCLX - Components for building Web Server applications. These include support for applications that use Apache or CGI Web Servers.
- VisualCLX - Cross-platform GUI components and graphics classes. VisualCLX classes make use of an underlying cross-platform widget library (Qt).
- WinCLX - Classes that are available only on the Windows platform. These include controls that are wrappers for native Windows controls, database access components that use mechanisms (such as the Borland Database Engine or ADO) that are not available on Linux, and components that support Windows-only technologies (such as COM, NT Services, or control panel applets).
The VCL and CLX contain many of the same sublibraries. They both include BaseCLX, DataCLX, NetCLX. The VCL also includes WinCLX while CLX includes VisualCLX instead.
Use the VCL when you want to use native Windows controls, Windows-specific features, or extend an existing VCL application. Use CLX when you want to write a cross-platform application or use controls that are available in CLX applications, such as TLCDNumber.
All classes 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 Component 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 and CLX objects is accessible through online Help 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” and those in CLX are marked “CLX Reference.”