mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-11 09:28:07 +02:00
LCL: Allow overriding resource loading in TCustomForm. Issue #20358, patch from Anton Kavalenka.
git-svn-id: trunk@50911 -
This commit is contained in:
parent
894c125543
commit
08f907306b
@ -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;
|
||||
|
@ -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);
|
||||
------------------------------------------------------------------------------}
|
||||
|
Loading…
Reference in New Issue
Block a user