mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-21 04:48:23 +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 Clear;
|
||||||
procedure Delete(AIndex: Integer);
|
procedure Delete(AIndex: Integer);
|
||||||
procedure Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer; AEnabled: Boolean = True); overload;
|
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 FillDescription(out ADesc: TRawImageDescription);
|
||||||
procedure GetBitmap(Index: Integer; Image: TCustomBitmap); overload;
|
procedure GetBitmap(Index: Integer; Image: TCustomBitmap); overload;
|
||||||
procedure GetBitmap(Index: Integer; Image: TCustomBitmap; AEffect: TGraphicsDrawEffect); overload;
|
procedure GetBitmap(Index: Integer; Image: TCustomBitmap; AEffect: TGraphicsDrawEffect); overload;
|
||||||
|
@ -28,6 +28,12 @@ const
|
|||||||
SIG_LAZ3 = 'Li';
|
SIG_LAZ3 = 'Li';
|
||||||
SIG_D3 = 'IL';
|
SIG_D3 = 'IL';
|
||||||
|
|
||||||
|
const
|
||||||
|
EffectMap: array[Boolean] of TGraphicsDrawEffect = (
|
||||||
|
gdeDisabled,
|
||||||
|
gdeNormal
|
||||||
|
);
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: CopyImage
|
Method: CopyImage
|
||||||
Params: Destination, Source: the destination/source canvas
|
Params: Destination, Source: the destination/source canvas
|
||||||
@ -485,24 +491,31 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TCustomImageList.Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer;
|
procedure TCustomImageList.Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer;
|
||||||
AEnabled: Boolean);
|
AEnabled: Boolean);
|
||||||
const
|
|
||||||
EffectMap: array[Boolean] of TGraphicsDrawEffect =
|
|
||||||
(
|
|
||||||
gdeDisabled,
|
|
||||||
gdeNormal
|
|
||||||
);
|
|
||||||
begin
|
begin
|
||||||
Draw(ACanvas, AX, AY, AIndex, EffectMap[AEnabled]);
|
Draw(ACanvas, AX, AY, AIndex, EffectMap[AEnabled]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomImageList.Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer;
|
procedure TCustomImageList.Draw(ACanvas: TCanvas; AX, AY, AIndex: Integer;
|
||||||
ADrawEffect: TGraphicsDrawEffect);
|
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
|
begin
|
||||||
if (AIndex < 0) or (AIndex >= FCount) then Exit;
|
if (AIndex < 0) or (AIndex >= FCount) then Exit;
|
||||||
|
|
||||||
ReferenceNeeded;
|
ReferenceNeeded;
|
||||||
TWSCustomImageListClass(WidgetSetClass).Draw(Self, AIndex, ACanvas, Rect(AX, AY, FWidth, FHeight),
|
TWSCustomImageListClass(WidgetSetClass).Draw(Self, AIndex, ACanvas, Rect(AX, AY, FWidth, FHeight),
|
||||||
BkColor, BlendColor, ADrawEffect, DrawingStyle, ImageType);
|
BkColor, BlendColor, ADrawEffect, ADrawingStyle, AImageType);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user