From d257609a597f0954db24bbe1bd77d73d9b3ef5af Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 14 Mar 2011 07:25:08 +0000 Subject: [PATCH] lcl: add another TImageList.Draw Delphi compatibility method (issue #0018921) git-svn-id: trunk@29835 - --- lcl/imglist.pp | 6 +++++- lcl/include/imglist.inc | 27 ++++++++++++++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/lcl/imglist.pp b/lcl/imglist.pp index d891eb5790..839438fcfc 100644 --- a/lcl/imglist.pp +++ b/lcl/imglist.pp @@ -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; diff --git a/lcl/include/imglist.inc b/lcl/include/imglist.inc index 54f0f99187..5b1cfc2d36 100644 --- a/lcl/include/imglist.inc +++ b/lcl/include/imglist.inc @@ -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; {------------------------------------------------------------------------------