mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 10:18:05 +02:00
lcl: distinct AutoCreated TDragObject and AutoFree TDragObject:
- first is created internally by LCL if in DragStart none DragObject is passed - second is a TDragObject which must be auto destructed on drag drop operation finish (more delphi compatible and fixes issue #0014476) git-svn-id: trunk@21544 -
This commit is contained in:
parent
ac2fa2549d
commit
be1d125c88
@ -343,6 +343,7 @@ type
|
||||
FControl: TControl;
|
||||
FDragTarget: TControl;
|
||||
FDragTargetPos: TPoint;
|
||||
FAutoFree: Boolean;
|
||||
FAutoCreated: Boolean;
|
||||
FDropped: Boolean;
|
||||
protected
|
||||
@ -358,6 +359,7 @@ type
|
||||
|
||||
property AlwaysShowDragImages: Boolean read FAlwaysShowDragImages write FAlwaysShowDragImages;
|
||||
property AutoCreated: Boolean read FAutoCreated;
|
||||
property AutoFree: Boolean read FAutoFree;
|
||||
property Control: TControl read FControl write FControl;
|
||||
property DragPos: TPoint read FDragPos write FDragPos;
|
||||
property DragTarget: TControl read FDragTarget write FDragTarget;
|
||||
|
@ -253,7 +253,7 @@ begin
|
||||
|
||||
finally
|
||||
//erase global variables (dragging stopped)
|
||||
if ADragObjectCopy.AutoCreated then
|
||||
if ADragObjectCopy.AutoFree then
|
||||
ADragObjectCopy.Free;
|
||||
end;
|
||||
end;
|
||||
@ -532,7 +532,7 @@ begin
|
||||
ADockObjectCopy.Control.DragCanceled;
|
||||
ADockObjectCopy.EndDrag(ADockObjectCopy.DragTarget,TargetPos.X,TargetPos.Y);
|
||||
finally
|
||||
if ADockObjectCopy.AutoCreated then
|
||||
if ADockObjectCopy.AutoFree then
|
||||
ADockObjectCopy.Free
|
||||
end;
|
||||
end;
|
||||
|
@ -29,6 +29,7 @@ constructor TDragObject.AutoCreate(AControl: TControl);
|
||||
begin
|
||||
Create(AControl);
|
||||
FAutoCreated := True;
|
||||
FAutoFree := True;
|
||||
end;
|
||||
|
||||
procedure TDragObject.EndDrag(Target: TObject; X, Y: Integer);
|
||||
@ -67,7 +68,7 @@ end;
|
||||
constructor TDragObjectEx.Create(AControl: TControl);
|
||||
begin
|
||||
inherited Create(AControl);
|
||||
FAutoCreated := True;
|
||||
FAutoFree := True;
|
||||
end;
|
||||
|
||||
{ TDragControlObject }
|
||||
@ -90,7 +91,7 @@ end;
|
||||
constructor TDragControlObjectEx.Create(AControl: TControl);
|
||||
begin
|
||||
inherited Create(AControl);
|
||||
FAutoCreated := True;
|
||||
FAutoFree := True;
|
||||
end;
|
||||
|
||||
{ TDragDockObject }
|
||||
@ -160,7 +161,7 @@ end;
|
||||
constructor TDragDockObjectEx.Create(AControl: TControl);
|
||||
begin
|
||||
inherited Create(AControl);
|
||||
FAutoCreated := True;
|
||||
FAutoFree := True;
|
||||
end;
|
||||
|
||||
// included by controls.pp
|
||||
|
Loading…
Reference in New Issue
Block a user