From 3cf422d2112c46b31c957664c7feaa35297f17d5 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 10 Jun 2010 15:34:04 +0000 Subject: [PATCH] anchordocking: resize after redock custom dock site git-svn-id: trunk@26025 - --- examples/anchordocking/anchordocking.pas | 30 ++++++++++++++++++------ 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/examples/anchordocking/anchordocking.pas b/examples/anchordocking/anchordocking.pas index ef39a55ce0..5ab413199a 100644 --- a/examples/anchordocking/anchordocking.pas +++ b/examples/anchordocking/anchordocking.pas @@ -1939,18 +1939,34 @@ procedure TAnchorDockHostSite.RemoveControlFromLayout(AControl: TControl); and (Parent.Parent=nil)) then begin // shrink this site and the parent (which is a custom dock site) + NewParentBounds:=Parent.BoundsRect; case Align of alTop: begin - NewParentBounds:=Parent.BoundsRect; - // ToDo Height:=OnlySiteLeft.Height; - - Parent.BoundsRect:=NewParentBounds; + inc(NewParentBounds.Top,Height-OnlySiteLeft.Height); + Width:=Parent.ClientWidth; + Height:=OnlySiteLeft.Height; + end; + alBottom: + begin + dec(NewParentBounds.Bottom,Height-OnlySiteLeft.Height); + Width:=Parent.ClientWidth; + Height:=OnlySiteLeft.Height; + end; + alLeft: + begin + inc(NewParentBounds.Left,Width-OnlySiteLeft.Width); + Width:=OnlySiteLeft.Width; + Height:=Parent.ClientHeight; + end; + alRight: + begin + dec(NewParentBounds.Right,Width-OnlySiteLeft.Width); + Width:=OnlySiteLeft.Width; + Height:=Parent.ClientHeight; end; - alBottom: ; - alLeft: ; - alRight: ; end; + Parent.BoundsRect:=NewParentBounds; end; // change type