TControl branch in Delphi

The TControl branch consists of components that descend from TControl but not TWinControl (TWidgetControl in CLX applications). Classes in this branch are controls: visual objects that the user can see and manipulate at runtime.

All controls have properties, methods, and events in common that relate to how the control looks, such as its position, the cursor associated with the control’s window, methods to paint or move the control, and events to respond to mouse actions.

Controls in this branch, however, can never receive keyboard input. Whereas TComponent defines behavior for all components, TControl defines behavior for all visual controls. This includes drawing routines, standard events, and containership.

TControl introduces many visual properties that all controls inherit. These include the Caption, Color, Font, and HelpContext or HelpKeyword. While these properties inherited from TControl, they are only published—and hence appear in the Object Inspector— for controls to which they are applicable.

For example, TImage does not publish the Color property, since its color is determined by the graphic it displays. TControl also introduces the Parent property, which specifies another control that visually contains the control.

Classes in the TControl branch often called graphic controls, because they all descend from TGraphicControl, which is an immediate descendant of TControl. Although these controls appear to the user at runtime, graphic controls do not have their own underlying window or widget.

Instead, they use their parent’s window or widget. It is because of this limitation that graphic controls cant receive keyboard input or act as a parent to other controls. However, because they do not have their own window or widget, graphic controls use fewer system resources.

There are two versions of TControl, one for VCL (Windows-only) applications and one for CLX (cross-platform) applications. Most controls have two versions as well, a Windows-only version that descends from the Windows-only version of TControl, and a cross-platform version that descends from the cross-platform version of TControl.

The Windows-only controls use native Windows APIs in their implementations, while the cross-platform versions sit on top of the Qt crossplatform widget library.