mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-22 07:41:02 +02:00
LCL: Implement TImage.OnPaintBackground. Issue #29581, patch from Alexey Torgashin.
git-svn-id: trunk@51507 -
This commit is contained in:
parent
7714ec4ab7
commit
bf09dadd9a
@ -37,6 +37,7 @@ type
|
|||||||
TPage = class;
|
TPage = class;
|
||||||
|
|
||||||
TBeforeShowPageEvent = procedure (ASender: TObject; ANewPage: TPage; ANewIndex: Integer) of object;
|
TBeforeShowPageEvent = procedure (ASender: TObject; ANewPage: TPage; ANewIndex: Integer) of object;
|
||||||
|
TImagePaintBackgroundEvent = procedure (ASender: TObject; ACanvas: TCanvas; ARect: TRect) of object;
|
||||||
|
|
||||||
TPage = class(TCustomControl)
|
TPage = class(TCustomControl)
|
||||||
private
|
private
|
||||||
@ -481,6 +482,7 @@ type
|
|||||||
private
|
private
|
||||||
FAntialiasingMode: TAntialiasingMode;
|
FAntialiasingMode: TAntialiasingMode;
|
||||||
FOnPictureChanged: TNotifyEvent;
|
FOnPictureChanged: TNotifyEvent;
|
||||||
|
FOnPaintBackground: TImagePaintBackgroundEvent;
|
||||||
FPicture: TPicture;
|
FPicture: TPicture;
|
||||||
FCenter: Boolean;
|
FCenter: Boolean;
|
||||||
FKeepOriginXWhenClipped: Boolean;
|
FKeepOriginXWhenClipped: Boolean;
|
||||||
@ -536,6 +538,7 @@ type
|
|||||||
property Transparent: Boolean read FTransparent write SetTransparent default False;
|
property Transparent: Boolean read FTransparent write SetTransparent default False;
|
||||||
property Proportional: Boolean read FProportional write SetProportional default False;
|
property Proportional: Boolean read FProportional write SetProportional default False;
|
||||||
property OnPictureChanged: TNotifyEvent read FOnPictureChanged write FOnPictureChanged;
|
property OnPictureChanged: TNotifyEvent read FOnPictureChanged write FOnPictureChanged;
|
||||||
|
property OnPaintBackground: TImagePaintBackgroundEvent read FOnPaintBackground write FOnPaintBackground;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -571,6 +574,7 @@ type
|
|||||||
property OnMouseWheelUp;
|
property OnMouseWheelUp;
|
||||||
property OnPaint;
|
property OnPaint;
|
||||||
property OnPictureChanged;
|
property OnPictureChanged;
|
||||||
|
property OnPaintBackground;
|
||||||
property OnResize;
|
property OnResize;
|
||||||
property OnStartDrag;
|
property OnStartDrag;
|
||||||
property ParentShowHint;
|
property ParentShowHint;
|
||||||
|
@ -239,6 +239,8 @@ begin
|
|||||||
C.AntialiasingMode := FAntialiasingMode;
|
C.AntialiasingMode := FAntialiasingMode;
|
||||||
FPainting:=true;
|
FPainting:=true;
|
||||||
try
|
try
|
||||||
|
if Assigned(FOnPaintBackground) then
|
||||||
|
FOnPaintBackground(Self, C, R);
|
||||||
C.StretchDraw(R, Picture.Graphic);
|
C.StretchDraw(R, Picture.Graphic);
|
||||||
finally
|
finally
|
||||||
FPainting:=false;
|
FPainting:=false;
|
||||||
|
Loading…
Reference in New Issue
Block a user