Handling of control inheritance

If several of your own controls require an identical part of the source code, it is advisable to put them on a common inheritance basis. In this way, common attributes could be implemented in a base class and then used in all derived controls.

Each custom control can be seen in the context of inheritance. All controls are at least derived from the base control TcHmiControl. From this, each control inherits the base functionality such as positioning (including Left, Top, Width, Height) and the handling of the life cycle.

Inheritance is defined in two places in a control. First in the attribute base in the metadata of description.json. This inheritance is also defined in the TypeScript/JavaScript source code in the Base framework of the control.

Methods and properties within the source code are marked in TypeScript either as public, protected or private. Public resources can be used/accessed from any location. These are therefore part of the public interface (API) of a control. Protected resources, on the other hand, are only intended for derived classes. In contrast, private resources are really only accessible to the class itself.