[Lazarus] Change default component name

Michalis Kamburelis michalis.kambi at gmail.com
Wed Oct 12 06:59:00 CEST 2011


Michalis Kamburelis wrote:
> Browsing the Lazarus sources, I didn't see any such way (it seems that
> the logic to remove 'T' from ClassName is just hardcoded in some
> places), so I'm guessing it's 2., but wanted to make sure :)
> 

To answer my own question, the logic is inside
TCustomFormEditor.CreateUniqueComponentName, and there doesn't seem to
exist a reasonable way to change it. In theory, I could try assigning my
own Name in constructor looking at my Owner, but then I also need to
make sure myself that the name is unique (add unique number suffix),
opening a can of worms (since I would have to replicate part of
TCustomFormEditor.CreateUniqueComponentName implementation then, and
fear that it can change one day :).

I guess the class should just be renamed.

Michalis




More information about the Lazarus mailing list