Form inheritance
Delphi is an object-oriented language and it is no wonder that objects and inheritance are used throughout the runtime libraries. That includes both user interface frameworks, VCL and FireMonkey, where every user interface element from a label to a form is represented as an object.
It is no big surprise that we can use the object-oriented approach to create new user interface elements by deriving from existing ones. As each form is represented with its own class (usually inheriting from TForm
), we can even use inheritance to create new forms. Even more, the IDE implements tooling support for creating inherited forms and maintaining the repository of base forms.
Note
Chapter 5, Adapter, Proxy, Decorator, and Facade, discusses how inheritance can be used to create a proxy object for a button in the Delphi idioms – replacing components in runtime section.
Form inheritance is useful in two common situations. First, it functions great when you need the same functionality in multiple...