Last Updated:

Visual and non-visual components

All components are divided into two groups: visual and non-visual components.

  • Visual components are visible UI elements: buttons, labels, list boxes, and so on, and they look the same during the design phase and while the app is running.
  • Non-visual components are, so to speak, fighters of the invisible front; they work, but are not visible on the screen themselves. Non-visual components include a timer, database access components, etc. During the design process, such components are represented on the form with a small icon. Their properties are set in the Properties window you already know. Some components, although non-visual, can display something on the screen. For example, the non-visual MainMenu component displays a main menu bar on the form, and the OpenDialog component displays a standard file selection dialog box.

 

Non-visual components may have signatures. Signatures are displayed by setting the Show component captions radio button in the Environment Options window on the Designer tab. The window is invoked by the Tools menu command | Environment Options...

7.5.3. "Window" and "Graphical" Components

Visual components are divided into components drawn by the Windows window system and components drawn by the VCL graphics library (Figure 7.39). In programmer's jargon, the former are called "window" components, and the latter are called "graphical" components.

  • Windowed controls are specialized windows within a form window. Their most important quality is the ability to receive input focus. Window components include, for example, components ButtonRadioButtonCheckBoxGroupBox, etc. Some window components (GroupBoxTabControlPageControl) are capable of containing other visual components and are called containers (container controls). The display of window components is provided by the Windows operating system. For professionals who have dealt with the Windows API, note that window components have a Handle property. It associates a component of the Delphi environment with the corresponding operating system object.
  • "Graphical" controls are not windows, so they cannot receive input focus or contain other visual components. The graphics components are not based on Windows operating system objects, and their display is fully performed by the VCL library. Graphics components include, for example, SpeedButtonImageBevel, etc.

The general classification of components has been compiled, so let's move on to the discussion of their properties and events. Obviously, each component has a specific set of properties and events and, it would seem, they should be studied in the context of studying the component. This is what we will do in the future when considering the distinctive properties of components. However, for now, it makes sense to consider properties and events that are common to most components.

Non-visual components have almost no common properties and events, the only common properties for them are Name (no comments are required) and Tag (an integer value that does not carry a semantic load - you can use it as you wish). But the visual components have many properties and events in common, which we will now consider.