mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-14 13:32:56 +02:00
LCL: newautosize: create parent handle before child handles
git-svn-id: trunk@23854 -
This commit is contained in:
parent
b4b050bffb
commit
3d1b378679
@ -1942,7 +1942,7 @@ type
|
||||
procedure DefaultHandler(var AMessage); override;
|
||||
function GetTextLen: Integer; override;
|
||||
procedure Invalidate; override;
|
||||
procedure AddControl; virtual;
|
||||
procedure AddControl; virtual; // tell widgetset
|
||||
procedure InsertControl(AControl: TControl);
|
||||
procedure InsertControl(AControl: TControl; Index: integer); virtual;
|
||||
procedure RemoveControl(AControl: TControl);
|
||||
|
@ -5749,11 +5749,7 @@ begin
|
||||
FillChar(Params, SizeOf(Params),0);
|
||||
Params.Caption := PChar(FCaption);
|
||||
Params.Style := WS_CHILD or WS_CLIPSIBLINGS;
|
||||
if (Parent <> nil)
|
||||
{$IFDEF NewAutoSize}
|
||||
and Parent.HandleAllocated
|
||||
{$ENDIF}
|
||||
then
|
||||
if (Parent <> nil) then
|
||||
Params.WndParent := Parent.Handle
|
||||
else
|
||||
Params.WndParent := ParentWindow;
|
||||
@ -6997,6 +6993,12 @@ begin
|
||||
{$ENDIF}
|
||||
DisableAutoSizing;
|
||||
try
|
||||
{$IFDEF NewAutoSize}
|
||||
// create parent handle before child handles
|
||||
if Parent<>nil then
|
||||
Parent.HandleNeeded;
|
||||
{$ENDIF}
|
||||
|
||||
// Control is not visible at this moment. It will be showed in UpdateShowing
|
||||
FShowing := False;
|
||||
Exclude(FWinControlFlags, wcfHandleVisible);
|
||||
@ -7006,7 +7008,10 @@ begin
|
||||
CreateParams(Params);
|
||||
with Params do begin
|
||||
if (WndParent = 0) and (Style and WS_CHILD <> 0) then
|
||||
begin
|
||||
DebugLn(['TWinControl.CreateWnd ',DbgSName(Self),' Parent=',DbgSName(Parent),' ERROR WndParent=0']);
|
||||
raise EInvalidOperation.CreateFmt('Control ''%s'' has no parent window', [Name]);
|
||||
end;
|
||||
end;
|
||||
|
||||
//DebugLn(['TWinControl.CreateWnd ',DbgSName(WidgetSetClass),' ',DbgSName(Self)]);
|
||||
|
Loading…
Reference in New Issue
Block a user