drag/drop:

- restore CancelDrag
- restore DragManager.EndDrag

git-svn-id: trunk@13952 -
This commit is contained in:
paul 2008-02-02 09:45:19 +00:00
parent 11b2e6f04c
commit 6826699163
3 changed files with 15 additions and 1 deletions

View File

@ -339,6 +339,7 @@ type
FDragTarget: TControl;
FDragTargetPos: TPoint;
protected
procedure EndDrag(Target: TObject; X, Y: Integer); virtual;
function GetDragImages: TDragImageList; virtual;
function GetDragCursor(Accepted: Boolean; X, Y: Integer): TCursor; virtual;
public
@ -2163,6 +2164,7 @@ procedure RecreateWnd(const AWinControl:TWinControl);
var
DefaultDockTreeClass: TDockTreeClass;
procedure CancelDrag;
procedure SetCaptureControl(AWinControl: TWinControl; const Position: TPoint);
procedure SetCaptureControl(Control: TControl);
function GetCaptureControl: TControl;
@ -2506,6 +2508,12 @@ begin
then Result := CaptureControl;
end;
procedure CancelDrag;
begin
if (DragManager <> nil) and DragManager.IsDragging then
DragManager.DragStop(False);
end;
procedure SetCaptureControl(AWinControl: TWinControl; const Position: TPoint);
var
Control: TControl;

View File

@ -253,7 +253,7 @@ begin
if not Accepted then
ADragObjectCopy.Control.DragCanceled;
ADragObjectCopy.Control.DoEndDrag(ADragObjectCopy.DragTarget, TargetPos.X, TargetPos.Y);
ADragObjectCopy.EndDrag(ADragObjectCopy.DragTarget, TargetPos.X, TargetPos.Y);
finally
//erase global variables (dragging stopped)

View File

@ -25,6 +25,12 @@ begin
FControl := AControl;
end;
procedure TDragObject.EndDrag(Target: TObject; X, Y: Integer);
begin
if FControl <> nil then
FControl.DoEndDrag(Target, X, Y);
end;
function TDragObject.GetDragImages: TDragImageList;
begin
Result := nil;