procedure TControl.DoDragMsg(var DragMsg: TCMDrag);
var
lForm: TCustomForm;
S: TObject;
Accepts, IsDockOp: Boolean;
begin
with DragMsg, DragRec^ do
begin
S := Source;
IsDockOp := S is TDragDockObject;
if DragInternalObject and not IsDockOp then
S := (S as TDragControlObject).Control;
with ScreenToClient(Pos) do
case DragMessage of
dmDragEnter, dmDragLeave, dmDragMove:
begin
Accepts := True;
if IsDockOp then
begin
TWinControl(Target).DockOver(TDragDockObject(S), X, Y,
TDragState(DragMessage), Accepts)
end
else
DragOver(S, X, Y, TDragState(DragMessage), Accepts);
Result := Ord(Accepts);
end;
dmDragDrop:
begin
if IsDockOp then
TWinControl(Target).DockDrop(TDragDockObject(S), X, Y)
else
DragDrop(S, X, Y);
// перенесено сюда из CMDockClient
lForm := GetParentForm(Self);
if (lForm <> nil) and lForm.Visible then lForm.BringToFront; {V}
end;
end;
end;
end;
Комментариев нет:
Отправить комментарий