Delphi-Quellcode:
constructor TPImage.create(aOwner: TComponent);
begin
inherited create(aOwner);
createPParams(nil);
end;
constructor TPImage.create(aOwner: TComponent ; xpixel, ypixel: Integer);
begin
// object Defaults
inherited create(aOwner);
Self.Height := ypixel;
Self.Width := xpixel;
// user code
createPParams(nil);
end;
Da du in deinem erweiterten constructor den originalen per inherited aufrufst, kannst Du dir in deinem erweiterten das
Delphi-Quellcode:
// user code
createPParams(nil);
sparen!
Also:
Delphi-Quellcode:
constructor TPImage.create(aOwner: TComponent);
begin
inherited create(aOwner);
createPParams(nil);
end;
constructor TPImage.create(aOwner: TComponent ; xpixel, ypixel: Integer);
begin
// object Defaults
inherited create(aOwner);
Self.Height := ypixel;
Self.Width := xpixel;
end;