LCL: LCLGlyphs: load from lazarus resources as well

git-svn-id: trunk@57871 -
This commit is contained in:
ondrej 2018-05-09 11:45:58 +00:00
parent 64b220c68c
commit 80848f9dfb

View File

@ -44,11 +44,19 @@ end;
function GetDefaultGlyph(ResourceName: string; ScalePercent: Integer;
IgnoreMissingResource: Boolean): TCustomBitmap;
var
LRes: TLResource;
begin
if ScalePercent<>100 then
ResourceName := ResourceName+'_'+IntToStr(ScalePercent);
Result := CreateBitmapFromResourceName(HINSTANCE, ResourceName);
if Result=nil then
begin
LRes := LazarusResources.Find(ResourceName);
if LRes<>nil then
Result := CreateBitmapFromLazarusResource(LRes);
end;
if (Result=nil) and not IgnoreMissingResource then
raise EResNotFound.CreateFmt(SResNotFound,[ResourceName]);
end;