LCL: Allow overriding resource loading in TCustomForm. Issue #20358, patch from Anton Kavalenka.

git-svn-id: trunk@50911 -
This commit is contained in:
juha 2015-12-18 19:06:14 +00:00
parent 894c125543
commit 08f907306b
2 changed files with 12 additions and 6 deletions

View File

@ -557,6 +557,7 @@ type
procedure SetAutoScroll(Value: Boolean); override;
procedure DoAddActionList(List: TCustomActionList);
procedure DoRemoveActionList(List: TCustomActionList);
procedure ProcessResource;virtual;
protected
// drag and dock
procedure BeginAutoDrag; override;

View File

@ -1966,12 +1966,7 @@ begin
begin
Include(FFormState, fsCreating);
try
if not InitResourceComponent(Self, TForm) then
if RequireDerivedFormResource then
raise EResNotFound.CreateFmt(
rsFormResourceSNotFoundForResourcelessFormsCreateNew, [ClassName])
else
DebugLn(Format(rsFormResourceSNotFoundForResourcelessFormsCreateNew, [ClassName]));
ProcessResource;
finally
Exclude(FFormState, fsCreating);
end;
@ -1981,6 +1976,16 @@ begin
end;
end;
procedure TCustomForm.ProcessResource;
begin
if not InitResourceComponent(Self, TForm) then
if RequireDerivedFormResource then
raise EResNotFound.CreateFmt(
rsFormResourceSNotFoundForResourcelessFormsCreateNew, [ClassName])
else
DebugLn(Format(rsFormResourceSNotFoundForResourcelessFormsCreateNew, [ClassName]));
end;
{------------------------------------------------------------------------------
constructor TCustomForm.CreateNew(AOwner: TComponent; Num : Integer);
------------------------------------------------------------------------------}