mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 13:19:21 +02:00
LCL: TWinControl.Destroy: undock all DockCLients
git-svn-id: trunk@23036 -
This commit is contained in:
parent
a0992b75f0
commit
957ae67d77
@ -3919,8 +3919,7 @@ begin
|
|||||||
// undock from old HostSite
|
// undock from old HostSite
|
||||||
// - this only undocks from the DockManager
|
// - this only undocks from the DockManager
|
||||||
// - this control still uses the DockSite as parent control
|
// - this control still uses the DockSite as parent control
|
||||||
{ TODO -cdocking : Combine with ManualFloat, for consistent handling
|
{ TODO -cdocking : Combine with ManualFloat, for consistent handling }
|
||||||
}
|
|
||||||
DebugLn('TControl.ManualDock UNDOCKING ',Name);
|
DebugLn('TControl.ManualDock UNDOCKING ',Name);
|
||||||
Result:=HostDockSite.DoUndock(NewDockSite,Self);
|
Result:=HostDockSite.DoUndock(NewDockSite,Self);
|
||||||
end;
|
end;
|
||||||
|
@ -4989,7 +4989,7 @@ var
|
|||||||
i: integer;
|
i: integer;
|
||||||
AWinControl: TWinControl;
|
AWinControl: TWinControl;
|
||||||
begin
|
begin
|
||||||
///DebugLn(['TWinControl.DestroyHandle START ',DbgSName(Self)]);
|
//DebugLn(['TWinControl.DestroyHandle START ',DbgSName(Self)]);
|
||||||
if not HandleAllocated then begin
|
if not HandleAllocated then begin
|
||||||
DebugLn('Warning: TWinControl.DestroyHandle ',Name,':',ClassName,' Handle not Allocated');
|
DebugLn('Warning: TWinControl.DestroyHandle ',Name,':',ClassName,' Handle not Allocated');
|
||||||
//RaiseGDBException('');
|
//RaiseGDBException('');
|
||||||
@ -6284,6 +6284,7 @@ begin
|
|||||||
Control := Controls[n - 1];
|
Control := Controls[n - 1];
|
||||||
//DebugLn('[TWinControl.Destroy] C ',Name,':',ClassName,' ',Control.Name,':',Control.ClassName);
|
//DebugLn('[TWinControl.Destroy] C ',Name,':',ClassName,' ',Control.Name,':',Control.ClassName);
|
||||||
Remove(Control);
|
Remove(Control);
|
||||||
|
//DebugLn(['TWinControl.Destroy ',DbgSName(Control.HostDockSite)]);
|
||||||
if Control.HostDockSite = Self then
|
if Control.HostDockSite = Self then
|
||||||
Control.HostDockSite := nil;
|
Control.HostDockSite := nil;
|
||||||
// don't free the control just set parent to nil
|
// don't free the control just set parent to nil
|
||||||
@ -6293,6 +6294,13 @@ begin
|
|||||||
n := ControlCount;
|
n := ControlCount;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// undock controls that use this as HostDockSite
|
||||||
|
while DockClientCount>0 do begin
|
||||||
|
Control:=DockClients[DockClientCount-1];
|
||||||
|
//DebugLn(['TWinControl.Destroy ',DbgSName(Self),' undocking ',DbgSName(Control)]);
|
||||||
|
Control.HostDockSite:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
FreeThenNil(FBrush);
|
FreeThenNil(FBrush);
|
||||||
FreeThenNil(FChildSizing);
|
FreeThenNil(FChildSizing);
|
||||||
if (FDockManager<>nil) then
|
if (FDockManager<>nil) then
|
||||||
|
Loading…
Reference in New Issue
Block a user