Wieso, die Klasse erfüllt genau das, was du gefordert hast, auch in dem von dir beschriebenen Kontext
Delphi-Quellcode:
type
TKlasseB = class
private
FBitmap: TLayerBitmap;
protected
function GetBitmap: TBitmap;
procedure SetBitmap( const Value : TBitmap );
function GetBitmapEnabled : Boolean;
procedure SetBitmapEnabled( const Value : Boolean );
public
constructor Create;
destructor Destroy; override;
property Bitmap: TBitmap read GetBitmap write SetBitmap;
property BitmapEnabled: Boolean read GetBitmapEnabled write SetBitmapEnabled;
end;
constructor TKlasseB.Create;
begin
inherited;
FBitmap := TLayerBitmap.Create;
end;
destructor TKlasseB.Destroy;
begin
FBitmap.Free;
inherited;
end;
function TKlasseB.GetBitmap: TBitmap;
begin
Result := FBitmap;
end;
procedure TKlasseB.SetBitmap( const Value : TBitmap );
begin
FBitmap.Assign( Value );
end;
function TKlasseB.GetBitmapEnabled : Boolean;
begin
Result := FBitmap.CanDraw;
end;
procedure TKlasseB.SetBitmapEnabled( const Value : Boolean );
begin
FBitmap.CanDraw := Value;
end;
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ea 0a 4c 14 0d b6 3a a4 c1 c5 b9
dc 90 9d f0 e9 de 13 da 60)