I have no idea what you're asking.
All I can do is to determine, that things were functioning in 2.0.8 - and they don't in 2.0.10.
Imagine there may be a million places, things can go wrong.
But I can give you some details.
Control ClipCont is derived from TPanel. Basically a userdrawn panel of a TStringList, with a scrollbar, determining which texts to draw.
Starting drag is done like this:
procedure TmyStripPlayForm.SetDragStart(aX,aY:integer); // called at mousedown
begin
mdX := aX;
mdY := aY;
end;
procedure TmyStripPlayForm.ClipContMouseMove(Sender:TObject;Shift:TShiftState;X,Y:Integer);
begin
if (ssLeft in Shift) and (mdX > -1) and (mdY > -1) then begin
if Abs(mdX - X) + Abs(mdY - Y) > 5 then begin
DragCtrl := ClipCont;
DragCtrl.BeginDrag(true);
end;
end;
end;
The use of DragCtrl is nescessary, as Source in DragOver is otherwise the form containing the panels - which is not usefull, and it wasn't like that in 2.0.8 - it was the actual control starting the drag.
DragCtrl is a public var in the Form class.
Following the start of the Drag operation, DragOver is called on the same control that starts the Drag.
procedure TmyStripPlayForm.ClipContDragOver(Sender,Source:TObject;X,Y:Integer;State:TDragState;var Accept:Boolean);
var
dtTyp : byte = dtNone;
crCur : TCursor;
begin // Drag over text-Listen af clips
{
if ((Source = ClipCont) and (ClipCont.SelectedIndex <> ClipCont.DropIndex)) or
((Source = ClipImgCont.HeaderLabel) and (ClipImgCont.Selected <> ClipCont.DropIndex)) then
dtTyp := dtMove or dtExch
else if (Source = AutoImgCont.HeaderLabel) or (Source = HistoryListCont.HeaderLabel) then
dtTyp := dtCopy;
}
if ((DragCtrl = ClipCont) and (ClipCont.SelectedIndex <> ClipCont.DropIndex)) or
((DragCtrl = ClipImgCont) and (ClipImgCont.Selected <> ClipCont.DropIndex)) then
dtTyp := dtMove or dtExch
else if (DragCtrl = AutoImgCont) or (DragCtrl = HistoryListCont) then
dtTyp := dtCopy;
crCur := GetDragCursor(dtTyp);
TDragControl(DragCtrl).DragCursor := crCur;
Accept := crCur <> crNoDrop;
end;
where
TDragControl = class(TControl)
published
property DragCursor;
end;
{commented out code is the code that functioned in 2.0.8.}
The line that causes the problem is here line 19:
DragCtrl is no longer set, for some reason. (and it was Source in the original 2.0.8, and it did not give any runtime errors).
I have debugged MouseMove, and DragCtrl IS set as it should be.
I have tried to debug DragOver - and at least the first time, DragOver is called, DragCtrl IS set, and pointing to the Control that initiate the dragging.
My programming do nothing to unset DragCtrl - except when ending the drag, when it is set to nil.
If the drag has been ended, DragOver should not be called. (Debugging, execution doesn't get to where it is set to nil.)
And besides - Once the drag is initiated, it is the drag Manager that controls what is happening, and no code of mine - except DragOver and DragDrop event handlers - should be called.