From 9091957623e8064b538f29b545e91cba0f5e926d Mon Sep 17 00:00:00 2001 From: ondrej Date: Wed, 10 Jan 2018 13:13:15 +0000 Subject: [PATCH] LCL: High-DPI ImageList: add TCustomImageList.RegisterResolutions method. git-svn-id: branches/HiDPIImageList@57041 - --- lcl/imglist.pp | 6 ++++-- lcl/include/imglist.inc | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lcl/imglist.pp b/lcl/imglist.pp index 9cce9cd4df..318d8fa499 100644 --- a/lcl/imglist.pp +++ b/lcl/imglist.pp @@ -315,8 +315,8 @@ type procedure RegisterChanges(Value: TChangeLink); procedure StretchDraw(Canvas: TCanvas; Index: Integer; ARect: TRect; Enabled: Boolean = True); procedure UnRegisterChanges(Value: TChangeLink); - function Resolutions: TCustomImageListResolutionEnumerator; - function ResolutionsDesc: TCustomImageListResolutionEnumerator; + + procedure RegisterResolutions(const AResolutionWidths: array of Integer); public property AllocBy: Integer read FAllocBy write FAllocBy default 4; property BlendColor: TColor read FBlendColor write FBlendColor default clNone; @@ -334,6 +334,8 @@ type property ReferenceForImagePPI[AImageWidth, APPI: Integer]: TWSCustomImageListReference read GetReferenceForImagePPI; property Resolution[AImageWidth: Integer]: TCustomImageListResolution read GetResolution; property ResolutionForImagePPI[AImageWidth, APPI: Integer]: TCustomImageListResolution read GetResolutionForImagePPI; + function Resolutions: TCustomImageListResolutionEnumerator; + function ResolutionsDesc: TCustomImageListResolutionEnumerator; property ShareImages: Boolean read FShareImages write SetShareImages default False; property ImageType: TImageType read FImageType write FImageType default itImage; property OnGetWidthForImagePPI: TCustomImageListGetWidthForImagePPI read FOnGetWidthForImagePPI write FOnGetWidthForImagePPI; diff --git a/lcl/include/imglist.inc b/lcl/include/imglist.inc index 82087eb1ea..7b4f8a925e 100644 --- a/lcl/include/imglist.inc +++ b/lcl/include/imglist.inc @@ -2008,6 +2008,15 @@ begin end; end; +procedure TCustomImageList.RegisterResolutions( + const AResolutionWidths: array of Integer); +var + R: Integer; +begin + for R in AResolutionWidths do + GetResolution(R); +end; + {------------------------------------------------------------------------------ Method: TCustomImageList.Replace Params: Index: the index of the replaceded image