From 49948f42f19e635ade7820ba269d863f59ddcf0a Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 18 Apr 2010 17:31:58 +0000 Subject: [PATCH] LCL: TCustomForm: autosize/updateshowing is now delayed till AfterConstruction, including DoCreate, bug #16290 git-svn-id: trunk@24700 - --- lcl/include/customform.inc | 39 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index 39f7462b9c..c9cdeb77ee 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -75,7 +75,9 @@ end; ------------------------------------------------------------------------------} procedure TCustomForm.AfterConstruction; begin + //DebugLn(['TCustomForm.AfterConstruction ']); DoCreate; + EndFormUpdate; // the BeginFormUpdate is in CreateNew inherited AfterConstruction; end; @@ -1794,28 +1796,23 @@ begin //DebugLn('[TCustomForm.Create] A Class=',Classname); GlobalNameSpace.BeginWrite; try - BeginFormUpdate; - try - CreateNew(AOwner, 1); - //DebugLn('[TCustomForm.Create] B Class=',Classname); - if (ClassType <> TForm) and not (csDesigning in ComponentState) then - begin - Include(FFormState, fsCreating); - try - //DebugLn('[TCustomForm.Create] C Class=',Classname); - if not InitResourceComponent(Self, TForm) then begin - //DebugLn('[TCustomForm.Create] Resource '''+ClassName+''' not found'); - //DebugLn('This is for information purposes only. This is not critical at this time.'); - // MG: Ignoring is best at the moment. (Delphi raises an exception.) - end; - //DebugLn('[TCustomForm.Create] D Class=',Classname); - //DebugLn('[TCustomForm.Create] E Class=',Classname); - finally - Exclude(FFormState, fsCreating); + CreateNew(AOwner, 1); // this calls BeginFormUpdate, which is ended in AfterConstruction + //DebugLn('[TCustomForm.Create] B Class=',Classname); + if (ClassType <> TForm) and not (csDesigning in ComponentState) then + begin + Include(FFormState, fsCreating); + try + //DebugLn('[TCustomForm.Create] C Class=',Classname); + if not InitResourceComponent(Self, TForm) then begin + //DebugLn('[TCustomForm.Create] Resource '''+ClassName+''' not found'); + //DebugLn('This is for information purposes only. This is not critical at this time.'); + // MG: Ignoring is best at the moment. (Delphi raises an exception.) end; + //DebugLn('[TCustomForm.Create] D Class=',Classname); + //DebugLn('[TCustomForm.Create] E Class=',Classname); + finally + Exclude(FFormState, fsCreating); end; - finally - EndFormUpdate; end; finally GlobalNameSpace.EndWrite; @@ -1862,8 +1859,8 @@ begin Color := clBtnFace; FloatingDockSiteClass := TWinControlClass(ClassType); Screen.AddForm(Self); - EndFormUpdate; FAllowDropFiles := False; + // the EndFormUpdate is done in AfterConstruction end; {------------------------------------------------------------------------------