From 8a8a407366a5ccce45e11809b2fedbabb70ac58d Mon Sep 17 00:00:00 2001 From: Dave Nottage Date: Mon, 24 Jul 2023 19:29:19 +0930 Subject: [PATCH] Changed LoadFromResource to a function --- Core/DW.StyleHelpers.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/DW.StyleHelpers.pas b/Core/DW.StyleHelpers.pas index 8629badb..a09fedae 100644 --- a/Core/DW.StyleHelpers.pas +++ b/Core/DW.StyleHelpers.pas @@ -27,7 +27,7 @@ TStyleBookHelper = class helper for TStyleBook /// /// Loads a stylebook from a resource compiled (default name: StyleBook) into the application /// - procedure LoadFromResource(const AResourceName: string = ''); + function LoadFromResource(const AResourceName: string = ''): Boolean; end; TStyleResource = record @@ -60,11 +60,12 @@ implementation { TStyleBookHelper } -procedure TStyleBookHelper.LoadFromResource(const AResourceName: string = ''); +function TStyleBookHelper.LoadFromResource(const AResourceName: string = ''): Boolean; var LStream: TStream; LResourceName: string; begin + Result := False; if LResourceName.IsEmpty then LResourceName := cStyleBookResourceNameDefault else @@ -74,6 +75,7 @@ procedure TStyleBookHelper.LoadFromResource(const AResourceName: string = ''); LStream := TResourceStream.Create(HInstance, LResourceName, RT_RCDATA); try LoadFromStream(LStream); + Result := True; finally LStream.Free; end;