diff --git a/lcl/forms.pp b/lcl/forms.pp index 6429f42dbd..bc12c667e1 100644 --- a/lcl/forms.pp +++ b/lcl/forms.pp @@ -558,6 +558,7 @@ type constructor Create(AOwner: TComponent); override; constructor CreateNew(AOwner: TComponent; Num: Integer = 0); virtual; destructor Destroy; override; + procedure AfterConstruction; override; procedure BeforeDestruction; override; class function GetControlClassDefaultSize: TPoint; override; diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index 9fa1903489..c98f216404 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -66,6 +66,19 @@ begin end; end; +{------------------------------------------------------------------------------ + Method: TCustomForm.AfterConstruction + Params: None + Returns: Nothing + + Gets called after the construction of the object + ------------------------------------------------------------------------------} +procedure TCustomForm.AfterConstruction; +begin + DoCreate; + inherited AfterConstruction; +end; + {------------------------------------------------------------------------------ Method: TCustomForm.BeforeDestruction Params: None @@ -1772,7 +1785,6 @@ begin // MG: Ignoring is best at the moment. (Delphi raises an exception.) end; //DebugLn('[TCustomForm.Create] D Class=',Classname); - DoCreate; //DebugLn('[TCustomForm.Create] E Class=',Classname); finally Exclude(FFormState, fsCreating);