Hopefully something simple I'm missing
We have our own components that are inherited from existing compenents, with the properties changed to our internal standards.
Ideally the component names would be prefixed with our company standards for them (save a bit of typing), unfortunately this is not quite working.
Have tried:
private
FName: TComponentName;
protected
procedure SetName(const NewName: TComponentName);override;
public
published
property Name : TComponentName read FName write SetName;
then the SetName:
const
ucstd = 'abc';
procedure TheComponent.SetName(const NewName: TComponentName);
begin
inherited;
if copy(NewName,1,3) <> ucstd then
Name := ucstd + NewName;
end;
This sets the name in the code correctly, but the property in the object inspector is blank, if we set FName rather than name it works in reverse. If we do both it hangs or access violates.
Any ideas?
We have our own components that are inherited from existing compenents, with the properties changed to our internal standards.
Ideally the component names would be prefixed with our company standards for them (save a bit of typing), unfortunately this is not quite working.
Have tried:
private
FName: TComponentName;
protected
procedure SetName(const NewName: TComponentName);override;
public
published
property Name : TComponentName read FName write SetName;
then the SetName:
const
ucstd = 'abc';
procedure TheComponent.SetName(const NewName: TComponentName);
begin
inherited;
if copy(NewName,1,3) <> ucstd then
Name := ucstd + NewName;
end;
This sets the name in the code correctly, but the property in the object inspector is blank, if we set FName rather than name it works in reverse. If we do both it hangs or access violates.
Any ideas?