leledumbo wroteMaybe for the programmer of the unit, but for the users, it's almost always a
disadvantage. They will get unexpected behavior instead (especially if you
put it along with other things in the unit where one might need some of
them).
This "hack" is used in a company when I worked before. So, all programmer did know about it. Nobody got unexpected behavior.
Open LCL sources and see how its components are named.
There are no pattern in LCL sources. Some components have a prefix, some not...
Show quoted text 14 lines
For your "advantage" case, I would give something like TColorEdit. Your proposal has
an advantage of changing a component behavior just by changing the uses
clause, that's also possible with the current situation. Example:
uses
?StdCtrls,ColorEdit;
type
?TEditCtrl = TEdit;
... // use TEditCtrl everywhere
when you want to change to TColorEdit, just change TEditCtrl definition to
TColorEdit. Same type-savings as your proposal.
You din't TEdit class is already used in all sources. This hack provides a big change with a few lines code. This hack is used in programs that already exists. To new programs we use a new widget, of course (or not =).
Marcos Douglas