(delphi) how to add a property to child controls?

In the Delphi IDE, some components in Delphi have the ability to "add" properties to child controls that are contained in the property editor.

How can I achieve the same with my own descendant TCustomPanel?

Additional Information:

I want to achieve the following: I have a very complicated configuration dialog for an application with a lot of visual components.

I want to add to each of these components a “complexity index” (an integer) that will be used to show or hide the component based on the choices made by the user (a drop-down list with “simple”, “advanced”, and “expert” options).

I understand that this property will belong to the parent panel, but I need a way to display it in the IDE, as if it were bound to the control to which it belongs.

Ideal examples are the various "organizational" panels provided by Delphi: TGridPaneland TRelativePanel. Each of them has properties ControlCollection(published) that are used to store the actual states of additional properties, but I have not been able to determine how the property editor knows that it should attach properties to child controls.

Here is a screenshot TLabelplaced inside TRelativePanelwith the relevant properties highlighted: Screenshot of Property Editor with

+4
source share

Source: https://habr.com/ru/post/1691391/


All Articles