


The design-only or run-only package option determines the package's type. Packages come in two flavors: design-time packages used by the Delphi IDE and run-time packages optionally used by applications. Each component package is basically a DLL (a dynamic link library) with a BPL extension (which stands for Borland Package Library). Component PackagesĬomponents are added to component packages. The VCL hierarchy includes many of these intermediate classes (often indicated with the TCustom prefix in their name) to let you choose a default behavior for your new component and change its properties. You can derive a new component from an existing component or from an abstract component class-one that does not correspond to a usable component. These new classes will be derived from one of the existing component-related classes or the generic TComponent class, adding new capabilities to those they inherit.

You extend the VCL by writing new component classes in a package and installing it in Delphi. You'll find more information about writing components in Chapter 17, "Writing Database Components," including how to build data-aware components.ĭelphi components are classes, and the Visual Components Library (VCL) is the collection of all the classes defining Delphi components. There is not enough space to present very complex components, but the ideas I've included cover all the basics and will get you started. This chapter gives you an overview of writing Delphi components and presents some examples. For this reason, even though this book is intended for Delphi application programmers and not Delphi tool writers, this chapter will discuss creating components and introduce Delphi add-ins, such as component and property editors. One of the most interesting aspects of Delphi is that creating components is not much more difficult than writing programs. Most Delphi programmers are probably familiar with using existing components, but at times it can also be useful to write your own components or to customize existing ones. Deriving from the TComponentEditor Class.Handling Internal Messages The Active Button.Referring to Components with Interfaces.
