From 584a1f6a3387d2e051418930bf89c40d1ce4542b Mon Sep 17 00:00:00 2001 From: marc Date: Tue, 10 Apr 2007 21:44:21 +0000 Subject: [PATCH] * fixes for newstyle imagelist git-svn-id: trunk@10932 - --- .../editortoolbar/editortoolbar_impl.pas | 2 +- packager/packageeditor.pas | 3 ++- packager/pkggraphexplorer.pas | 22 +++++-------------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/components/editortoolbar/editortoolbar_impl.pas b/components/editortoolbar/editortoolbar_impl.pas index 9ff41a3d1f..630a46bc95 100644 --- a/components/editortoolbar/editortoolbar_impl.pas +++ b/components/editortoolbar/editortoolbar_impl.pas @@ -146,7 +146,7 @@ begin // If we have a image, us it. Otherwise supply a default. if AMenuItem.HasBitmap then begin - i := BI.AddCopy(AMenuItem.Bitmap, AMenuItem.Bitmap); + i := BI.Add(AMenuItem.Bitmap, AMenuItem.Bitmap); B.ImageIndex := i; end else diff --git a/packager/packageeditor.pas b/packager/packageeditor.pas index 6b0d5d3f27..53fd5f0f1d 100644 --- a/packager/packageeditor.pas +++ b/packager/packageeditor.pas @@ -1289,7 +1289,8 @@ procedure TPackageEditorForm.SetupComponents; Pixmap:=TPixmap.Create; Pixmap.TransparentColor:=clWhite; Pixmap.LoadFromLazarusResource(ResName); - ImageList.AddDirect(Pixmap,nil) + ImageList.Add(Pixmap,nil); + Pixmap.Free; end; procedure LoadBitBtnGlyph(ABitBtn: TBitBtn; const ResName: string); diff --git a/packager/pkggraphexplorer.pas b/packager/pkggraphexplorer.pas index 57296fba25..edc21746ba 100644 --- a/packager/pkggraphexplorer.pas +++ b/packager/pkggraphexplorer.pas @@ -269,23 +269,13 @@ begin end; procedure TPkgGraphExplorerDlg.SetupComponents; - - function AddResImg(const ResName: string): integer; - var Pixmap: TPixmap; - begin - Pixmap:=TPixmap.Create; - Pixmap.TransparentColor:=clWhite; - Pixmap.LoadFromLazarusResource(ResName); - Result:=ImageList.AddDirect(Pixmap,nil) - end; - begin - ImgIndexPackage:=AddResImg('pkg_package'); - ImgIndexInstalledPackage:=AddResImg('pkg_package_install'); - ImgIndexInstallPackage:=AddResImg('pkg_package_autoinstall'); - ImgIndexUninstallPackage:=AddResImg('pkg_package_uninstall'); - ImgIndexCirclePackage:=AddResImg('pkg_package_circle'); - ImgIndexMissingPackage:=AddResImg('pkg_conflict'); + ImgIndexPackage := ImageList.AddLazarusResource('pkg_package'); + ImgIndexInstalledPackage := ImageList.AddLazarusResource('pkg_package_install'); + ImgIndexInstallPackage := ImageList.AddLazarusResource('pkg_package_autoinstall'); + ImgIndexUninstallPackage := ImageList.AddLazarusResource('pkg_package_uninstall'); + ImgIndexCirclePackage := ImageList.AddLazarusResource('pkg_package_circle'); + ImgIndexMissingPackage := ImageList.AddLazarusResource('pkg_conflict'); PkgTreeLabel.Caption:=lisPckExplLoadedPackages; PkgListLabel.Caption:=lisPckExplIsRequiredBy;