mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-01 00:52:34 +02:00
lcl: add another TImageList.Draw Delphi compatibility method (issue #0018921)
git-svn-id: trunk@29835 -
This commit is contained in:
parent
5bc0a7c8d3
commit
d257609a59
@ -172,7 +172,11 @@ type
|
||||
procedure Clear;
|
||||
procedure Delete(AIndex: Integer);
|
||||
procedure Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer; AEnabled: Boolean = True); overload;
|
||||
procedure Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer; ADrawEffect: TGraphicsDrawEffect); overload; virtual;
|
||||
procedure Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer; ADrawEffect: TGraphicsDrawEffect); overload;
|
||||
procedure Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer; ADrawingStyle: TDrawingStyle; AImageType: TImageType;
|
||||
AEnabled: Boolean = True); overload;
|
||||
procedure Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer; ADrawingStyle: TDrawingStyle; AImageType: TImageType;
|
||||
ADrawEffect: TGraphicsDrawEffect); overload; virtual;
|
||||
procedure FillDescription(out ADesc: TRawImageDescription);
|
||||
procedure GetBitmap(Index: Integer; Image: TCustomBitmap); overload;
|
||||
procedure GetBitmap(Index: Integer; Image: TCustomBitmap; AEffect: TGraphicsDrawEffect); overload;
|
||||
|
@ -28,6 +28,12 @@ const
|
||||
SIG_LAZ3 = 'Li';
|
||||
SIG_D3 = 'IL';
|
||||
|
||||
const
|
||||
EffectMap: array[Boolean] of TGraphicsDrawEffect = (
|
||||
gdeDisabled,
|
||||
gdeNormal
|
||||
);
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: CopyImage
|
||||
Params: Destination, Source: the destination/source canvas
|
||||
@ -485,24 +491,31 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
procedure TCustomImageList.Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer;
|
||||
AEnabled: Boolean);
|
||||
const
|
||||
EffectMap: array[Boolean] of TGraphicsDrawEffect =
|
||||
(
|
||||
gdeDisabled,
|
||||
gdeNormal
|
||||
);
|
||||
begin
|
||||
Draw(ACanvas, AX, AY, AIndex, EffectMap[AEnabled]);
|
||||
end;
|
||||
|
||||
procedure TCustomImageList.Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer;
|
||||
ADrawEffect: TGraphicsDrawEffect);
|
||||
begin
|
||||
Draw(ACanvas, AX, AY, AIndex, DrawingStyle, ImageType, ADrawEffect);
|
||||
end;
|
||||
|
||||
procedure TCustomImageList.Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer;
|
||||
ADrawingStyle: TDrawingStyle; AImageType: TImageType; AEnabled: Boolean);
|
||||
begin
|
||||
Draw(ACanvas, AX, AY, AIndex, ADrawingStyle, AImageType, EffectMap[AEnabled]);
|
||||
end;
|
||||
|
||||
procedure TCustomImageList.Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer;
|
||||
ADrawingStyle: TDrawingStyle; AImageType: TImageType;
|
||||
ADrawEffect: TGraphicsDrawEffect);
|
||||
begin
|
||||
if (AIndex < 0) or (AIndex >= FCount) then Exit;
|
||||
|
||||
ReferenceNeeded;
|
||||
TWSCustomImageListClass(WidgetSetClass).Draw(Self, AIndex, ACanvas, Rect(AX, AY, FWidth, FHeight),
|
||||
BkColor, BlendColor, ADrawEffect, DrawingStyle, ImageType);
|
||||
BkColor, BlendColor, ADrawEffect, ADrawingStyle, AImageType);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user