mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-15 06:09:30 +02:00
cleanup
git-svn-id: trunk@16503 -
This commit is contained in:
parent
b8949b9c21
commit
f67b637d75
@ -561,10 +561,10 @@ type
|
||||
FUseParentCanvas: boolean;
|
||||
function GetCanvas: TCanvas;
|
||||
procedure SetPicture(const AValue: TPicture);
|
||||
procedure SetCenter(Value : Boolean);
|
||||
procedure SetCenter(const AValue : Boolean);
|
||||
procedure SetProportional(const AValue: Boolean);
|
||||
procedure SetStretch(Value : Boolean);
|
||||
procedure SetTransparent(Value : Boolean);
|
||||
procedure SetStretch(const AValue : Boolean);
|
||||
procedure SetTransparent(const AValue : Boolean);
|
||||
protected
|
||||
procedure PictureChanged(Sender : TObject); virtual;
|
||||
function DestRect: TRect; virtual;
|
||||
@ -575,7 +575,7 @@ type
|
||||
procedure DoAutoSize; override;
|
||||
procedure Paint; override;
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
property Canvas: TCanvas read GetCanvas;
|
||||
public
|
||||
@ -589,9 +589,9 @@ type
|
||||
property OnMouseDown;
|
||||
property OnMouseMove;
|
||||
property OnMouseUp;
|
||||
property Stretch: Boolean read FStretch write SetStretch;
|
||||
property Transparent: Boolean read FTransparent write SetTransparent default false;
|
||||
property Proportional: Boolean read FProportional write SetProportional default false;
|
||||
property Stretch: Boolean read FStretch write SetStretch default False;
|
||||
property Transparent: Boolean read FTransparent write SetTransparent default False;
|
||||
property Proportional: Boolean read FProportional write SetProportional default False;
|
||||
end;
|
||||
|
||||
|
||||
|
@ -16,18 +16,19 @@
|
||||
*****************************************************************************
|
||||
}
|
||||
|
||||
constructor TCustomImage.Create(TheOwner: TComponent);
|
||||
constructor TCustomImage.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited Create(TheOwner);
|
||||
inherited Create(AOwner);
|
||||
ControlStyle:= [csCaptureMouse, csClickEvents, csDoubleClicks];
|
||||
AutoSize := False;
|
||||
FCenter := False;
|
||||
FProportional := False;
|
||||
FStretch := False;
|
||||
FTransparent := False;
|
||||
FPicture := TPicture.Create;
|
||||
FPicture.OnChange := @PictureChanged;
|
||||
FUseParentCanvas := false;
|
||||
SetInitialBounds(0,0,GetControlClassDefaultSize.X,GetControlClassDefaultSize.Y);
|
||||
FUseParentCanvas := False;
|
||||
SetInitialBounds(0, 0, GetControlClassDefaultSize.X, GetControlClassDefaultSize.Y);
|
||||
end;
|
||||
|
||||
destructor TCustomImage.Destroy;
|
||||
@ -112,33 +113,33 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCustomImage.SetStretch(Value : Boolean);
|
||||
procedure TCustomImage.SetStretch(const AValue : Boolean);
|
||||
begin
|
||||
if FStretch=Value then exit;
|
||||
FStretch := Value;
|
||||
if FStretch = AValue then exit;
|
||||
FStretch := AValue;
|
||||
PictureChanged(Self);
|
||||
end;
|
||||
|
||||
procedure TCustomImage.SetTransparent(Value : Boolean);
|
||||
procedure TCustomImage.SetTransparent(const AValue : Boolean);
|
||||
begin
|
||||
if FTransparent=Value then exit;
|
||||
FTransparent := Value;
|
||||
if FTransparent = AValue then exit;
|
||||
FTransparent := AValue;
|
||||
if (FPicture.Graphic <> nil) and (FPicture.Graphic.Transparent <> FTransparent)
|
||||
then FPicture.Graphic.Transparent := FTransparent
|
||||
else PictureChanged(Self);
|
||||
end;
|
||||
|
||||
procedure TCustomImage.SetCenter(Value : Boolean);
|
||||
procedure TCustomImage.SetCenter(const AValue : Boolean);
|
||||
begin
|
||||
if FCenter=Value then exit;
|
||||
FCenter := Value;
|
||||
if FCenter = AValue then exit;
|
||||
FCenter := AValue;
|
||||
PictureChanged(Self);
|
||||
end;
|
||||
|
||||
procedure TCustomImage.SetProportional(const AValue: Boolean);
|
||||
begin
|
||||
if FProportional=AValue then exit;
|
||||
FProportional:=AValue;
|
||||
if FProportional = AValue then exit;
|
||||
FProportional := AValue;
|
||||
PictureChanged(Self);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user