From 546052732fbd8e9e13c31520973ebe68be4aad24 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Thu, 17 Sep 2015 18:16:58 +0200 Subject: [PATCH] allow more ctrl types to be assignedto --- src/ce_sharedres.pas | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ce_sharedres.pas b/src/ce_sharedres.pas index b522d490..fc1b6a35 100644 --- a/src/ce_sharedres.pas +++ b/src/ce_sharedres.pas @@ -3,23 +3,25 @@ unit ce_sharedres; interface uses - LResources, Controls, Buttons, Graphics; + LResources, Classes, Controls, Buttons, Graphics; -procedure AssignPng(ctrl: TControl; const resName: string); +procedure AssignPng(ctrl: TPersistent; const resName: string); implementation var png: TPortableNetworkGraphic; -procedure AssignPng(ctrl: TControl; const resName: string); +procedure AssignPng(ctrl: TPersistent; const resName: string); begin try png.LoadFromLazarusResource(resName); if ctrl is TCustomBitBtn then TCustomBitBtn(ctrl).Glyph.Assign(png) else if ctrl is TCustomSpeedButton then - TCustomSpeedButton(ctrl).Glyph.Assign(png); + TCustomSpeedButton(ctrl).Glyph.Assign(png) + else if ctrl is TBitmap then + TBitmap(ctrl).Assign(png); except end; end;