From 4620b0c84b0afaee43971637962fc0bd196e4d52 Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 19 Dec 2008 10:08:07 +0000 Subject: [PATCH] lcl: fix DockOrientation of child control git-svn-id: trunk@17864 - --- lcl/ldocktree.pas | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lcl/ldocktree.pas b/lcl/ldocktree.pas index 05aa53f0fe..1fbd0cea76 100644 --- a/lcl/ldocktree.pas +++ b/lcl/ldocktree.pas @@ -1297,19 +1297,19 @@ begin if OldParentZone <> nil then OldParentZone.ReplaceChild(DropZone, NewParentZone); NewParentZone.AddAsFirstChild(DropZone); - - // child control already had orientation but now we moved it to another parent - // which can take another orientation => change child control orientation - NewParentZone.Orientation := NewOrientation; - if DropZone.ChildControl <> nil then - DropZone.ChildControl.DockOrientation := NewOrientation; end; if DropZone.Parent = nil then RaiseGDBException('TLazDockTree.InsertControl Inconsistency DropZone.Parent=nil'); // adjust Orientation in tree if DropZone.Parent.Orientation = doNoOrient then + begin + // child control already had orientation but now we moved it to parent + // which can take another orientation => change child control orientation DropZone.Parent.Orientation := NewOrientation; + if (DropZone.Parent.ChildCount = 1) and (DropZone.Parent.FirstChild.ChildControl <> nil) then + DropZone.Parent.FirstChild.ChildControl.DockOrientation := NewOrientation; + end; if DropZone.Parent.Orientation <> NewOrientation then RaiseGDBException('TLazDockTree.InsertControl Inconsistency DropZone.Orientation<>NewOrientation');