lcl: few docking changes by Hans-Peter Diettrich (part of issue #0013427)

git-svn-id: trunk@19436 -
This commit is contained in:
paul 2009-04-15 06:04:15 +00:00
parent a939a6214e
commit dea006ff6b
2 changed files with 12 additions and 14 deletions

View File

@ -202,8 +202,7 @@ begin
WinDragTarget := TWinControl(DragTarget);
GetWindowRect(WinDragTarget.Handle, FDockRect);
if (WinDragTarget.DockManager <> nil) then
WinDragTarget.DockManager.PositionDockRect(Control, DropOnControl,
DropAlign, FDockRect);
WinDragTarget.DockManager.PositionDockRect(DragDockObject);
end else
begin
with FDockRect do

View File

@ -421,7 +421,15 @@ begin
if FDockObject.DragTarget <> nil then
FDockObject.DragTargetPos := TControl(FDockObject.DragTarget).ScreenToClient(APosition);
with FDockObject do
begin //determine precise target now, before dmDragMove
DragTargetPos := DragTarget.ScreenToClient(APosition);
DropOnControl := GetDropControl;
if DropOnControl = nil then
DropAlign := FDockObject.DragTarget.GetDockEdge(DragTargetPos)
else
DropAlign := DropOnControl.GetDockEdge(DropOnControl.ScreenToClient(APosition));
end;
DragCursor := FDockObject.GetDragCursor(SendCmDragMsg(FDockObject, dmDragMove),APosition.X, APosition.Y);
if FDragImageList <> nil then
begin
@ -442,17 +450,8 @@ begin
//Draw borders for the docking section or the boundaries of the dragged form
with FDockObject do
begin
if DragTarget = nil then
FDockObject.Control.DockTrackNoTarget(TDragDockObject(FDockObject), APosition.X, APosition.Y)
else
begin
DropOnControl := GetDropControl;
if DropOnControl = nil then
with FDockObject do
DropAlign := DragTarget.GetDockEdge(DragTargetPos)
else
DropAlign := DropOnControl.GetDockEdge(DropOnControl.ScreenToClient(APosition));
end;
if DragTarget = nil then //show as floating
FDockObject.Control.DockTrackNoTarget(FDockObject, APosition.X, APosition.Y);
MoveDockImage;
end;