Rule-based property management

Looking at the hierarchical structure of html and dfm, it can find similarities (nested structure, properties (attributes), etc.). The next step is to ask if there is something like css (Cascade style sheets) in the Delphi world. So, for example, a rule like this

TPanel TPanel BorderWidth=2

      

can specify that for any TPanel placed in another panel, the BorderWidth property should always be 2.

or

TPanel.MyPanel TLabel Font.Style=[fsBold] 

      

for TPanel named MyPanel, any label inside must be bold (similar to css. The specific name (MyPanel) can be equivalent to the id html attribute)

So, is there a library / unit that was designed for something like this?

I suppose there must be some problems

  • implementing this at design time may present compatibility issues with Delphi's internal form builder (perhaps this library could be more time oriented)

  • In the html world, this is mainly related to the visual, so the error can only lead to visual peculiarities, but in the properties of Delphi, which sometimes must be set explicitly by the programmer's team and make it an object of mass control, can present security and stability threats.

However, I thought we were too tied to property changes. Even if it is copy-paste, the root of any property change is the highlighted click.

+3


source to share





All Articles