[Lazarus] Change default component name

Mattias Gaertner nc-gaertnma at netcologne.de
Wed Oct 12 09:26:41 CEST 2011


On Wed, 12 Oct 2011 06:59:00 +0200
Michalis Kamburelis <michalis.kambi at gmail.com> wrote:

> 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,

I added a check. Please test.

> 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.

Yes, that would be nicer for many users.

Mattias




More information about the Lazarus mailing list