lcl: newautosize: create parent handle before child handle

git-svn-id: trunk@23872 -
This commit is contained in:
mattias 2010-03-07 23:43:23 +00:00
parent 7c12e786fa
commit 4402426dd3
2 changed files with 7 additions and 5 deletions

View File

@ -1839,7 +1839,7 @@ type
procedure FinalizeWnd; virtual; // gets called before the Handle is destroyed.
procedure FixupTabList;
procedure FontChanged(Sender: TObject); override;
procedure InitializeWnd; virtual; // gets called after the Handle is created and before the child handles are created
procedure InitializeWnd; virtual; // gets called after the Handle is created and before the missing child handles are created
procedure Loaded; override;
procedure FormEndUpdated; override;
procedure MainWndProc(var Msg: TLMessage);

View File

@ -6994,12 +6994,14 @@ begin
DisableAutoSizing;
try
{$IFDEF NewAutoSize}
// create parent handle before child handles
if Parent<>nil then
if (Parent<>nil) and (not Parent.HandleAllocated) then
begin
// first create the parent handle
Parent.HandleNeeded;
if HandleAllocated then exit;
end;
{$ENDIF}
// Control is not visible at this moment. It will be showed in UpdateShowing
// Control is not visible at this moment. It will be shown in UpdateShowing
FShowing := False;
Exclude(FWinControlFlags, wcfHandleVisible);