calculate DockOffset in screen coordinates

git-svn-id: trunk@14374 -
This commit is contained in:
paul 2008-03-03 06:58:12 +00:00
parent 2b483d841f
commit e79628a20a

View File

@ -268,7 +268,7 @@ end;
constructor TDockPerformer.Create(AManager: TDragManagerDefault; AControl: TControl);
//Start a drag operation, if not already running
var
p: TPoint;
p, cp: TPoint;
begin
inherited Create(AManager, AControl);
AControl.DoStartDock(TDragObject(FDockObject));
@ -283,8 +283,11 @@ begin
GetCursorPos(p);
FDockObject.DragPos := p;
// mouse click offset from control TopLeft
FDockObject.DockOffset := Point(p.x - AControl.Left, p.y - AControl.Top);
// mouse click offset from control TopLeft in screen coordinates
cp := AControl.BoundsRect.TopLeft;
if AControl.Parent <> nil then
cp := AControl.Parent.ClientToScreen(cp);
FDockObject.DockOffset := Point(p.x - cp.x, p.y - cp.y);
AControl.CalculateDockSizes;
FDockObject.DockRect := Rect(p.x, p.y, p.x + AControl.Width, p.y + AControl.Height);
FDockObject.EraseDockRect := Rect(MaxInt, 0, MaxInt, 0);