lazarus/examples/dockmanager/patches/dragstartstop.patch
dodi 3b09a8015c Dragging: fixes for trunk
git-svn-id: trunk@31814 -
2011-07-28 04:27:40 +00:00

33 lines
1.1 KiB
Diff

diff --git a/lcl/include/dragmanager.inc b/lcl/include/dragmanager.inc
index e94e580..0624547 100644
--- a/lcl/include/dragmanager.inc
+++ b/lcl/include/dragmanager.inc
@@ -644,6 +644,9 @@ begin
FWaitForTreshold := not AImmediate;
GetCursorPos(FStartPosition);
+ if (AControl.DragKind<>dkDock) and (AControl.HostDockSite <> nil) then
+ AControl.DragKind := dkDock; //make docked control dockable
+
case AControl.DragKind of
dkDrag: FPerformer := TDragPerformer.Create(Self, AControl);
dkDock: FPerformer := TDockPerformer.Create(Self, AControl);
@@ -780,6 +783,7 @@ var
AIsDragging,
AIsDocking: Boolean;
begin
+{$IFDEF old}
// if this is TWinControl, and it have controls (not TWinControls)
// then we should check Dragging in those controls
AIsDocking := False;
@@ -803,6 +807,9 @@ begin
// belongs to parent => we should allow parent to get capture
if not (AIsDocking and (CaptureControl = OldCaptureControl.Parent)) then
DragStop(AIsDragging);
+{$ELSE}
+//ignore changes, they prevent proper drag start and stop
+{$ENDIF}
end;