lcl: formatting

git-svn-id: trunk@20093 -
This commit is contained in:
paul 2009-05-21 08:09:32 +00:00
parent a8ae3b4f66
commit 071f4c60e7
2 changed files with 39 additions and 34 deletions

View File

@ -4890,21 +4890,22 @@ because then the docking manager (DragDockObject) would refer to an invalid (no
existing) target.
}
if not KeepDockSiteSize then begin
NewBounds:=BoundsRect;
if not KeepDockSiteSize then
begin
NewBounds := BoundsRect;
case Client.Align of
alLeft:
inc(NewBounds.Left,Client.Width);
alTop:
inc(NewBounds.Top,Client.Height);
alRight:
dec(NewBounds.Right,Client.Width);
alBottom:
dec(NewBounds.Bottom,Client.Height);
alLeft:
inc(NewBounds.Left, Client.Width);
alTop:
inc(NewBounds.Top, Client.Height);
alRight:
dec(NewBounds.Right, Client.Width);
alBottom:
dec(NewBounds.Bottom, Client.Height);
end;
SetBoundsKeepBase(NewBounds.Left,NewBounds.Top,
NewBounds.Right-NewBounds.Left,
NewBounds.Bottom-NewBounds.Top);
SetBoundsKeepBase(NewBounds.Left, NewBounds.Top,
NewBounds.Right - NewBounds.Left,
NewBounds.Bottom - NewBounds.Top);
end;
Result := Result and DoUndockClientMsg(NewTarget, Client);
@ -7102,7 +7103,7 @@ end;
function TWinControl.DoUnDockClientMsg(NewTarget, Client: TControl): boolean;
begin
Result := true;
Result := True;
DebugLn(['TWinControl.DoUnDockClientMsg ',DbgSName(Self),' ',DbgSName(Client),' ',DbgSName(Client.Parent)]);
if FUseDockManager and (DockManager <> nil) then
DockManager.RemoveControl(Client);

View File

@ -863,7 +863,7 @@ end;
constructor TLazDockPages.Create(TheOwner: TComponent);
begin
PageClass:=TLazDockPage;
PageClass := TLazDockPage;
inherited Create(TheOwner);
end;
@ -878,22 +878,26 @@ var
begin
DebugLn(['TLazDockTree.UndockControlForDocking AControl=',DbgSName(AControl),' AControl.Parent=',DbgSName(AControl.Parent)]);
// undock AControl
if AControl is TWinControl then begin
AWinControl:=TWinControl(AControl);
if (AWinControl.DockManager<>nil)
and (AWinControl.DockManager<>Self) then begin
if AControl is TWinControl then
begin
AWinControl := TWinControl(AControl);
if (AWinControl.DockManager<>nil) and (AWinControl.DockManager<>Self) then
begin
raise Exception.Create('TLazDockTree.UndockControlForDocking mixing docking managers is not supported');
end;
end;
if AControl.Parent<>nil then begin
AControl.Parent:=nil;
if AControl.Parent <> nil then
begin
AControl.Parent := nil;
end;
for i:=AControl.AnchoredControlCount-1 downto 0 do begin
Sibling:=AControl.AnchoredControls[i];
if (Sibling<>AControl.Parent) and (Sibling.Parent<>AControl) then begin
for a:=low(TAnchorKind) to high(TAnchorKind) do
if Sibling.AnchorSide[a].Control=AControl then
Sibling.AnchorSide[a].Control:=nil;
for i:=AControl.AnchoredControlCount - 1 downto 0 do
begin
Sibling := AControl.AnchoredControls[i];
if (Sibling <> AControl.Parent) and (Sibling.Parent <> AControl) then
begin
for a := Low(TAnchorKind) to High(TAnchorKind) do
if Sibling.AnchorSide[a].Control = AControl then
Sibling.AnchorSide[a].Control := nil;
end;
end;
end;
@ -905,14 +909,14 @@ end;
procedure TLazDockTree.BreakAnchors(Zone: TDockZone);
begin
if Zone=nil then exit;
if (Zone.ChildControl<>nil) and (Zone.ChildControl<>DockSite) then
if Zone = nil then Exit;
if (Zone.ChildControl <> nil) and (Zone.ChildControl <> DockSite) then
begin
Zone.ChildControl.AnchorSide[akLeft].Control:=nil;
Zone.ChildControl.AnchorSide[akTop].Control:=nil;
Zone.ChildControl.Anchors:=[akLeft,akTop];
Zone.ChildControl.BorderSpacing.Left:=0;
Zone.ChildControl.BorderSpacing.Top:=0;
Zone.ChildControl.AnchorSide[akLeft].Control := nil;
Zone.ChildControl.AnchorSide[akTop].Control := nil;
Zone.ChildControl.Anchors := [akLeft, akTop];
Zone.ChildControl.BorderSpacing.Left := 0;
Zone.ChildControl.BorderSpacing.Top := 0;
end;
BreakAnchors(Zone.FirstChild);
BreakAnchors(Zone.NextSibling);