docking: before start auto docking check if DragMode = dmAutomatic

git-svn-id: trunk@14049 -
This commit is contained in:
paul 2008-02-09 14:51:51 +00:00
parent 6a8326732d
commit 6ecc6cd943
2 changed files with 12 additions and 8 deletions

View File

@ -2050,7 +2050,10 @@ var
APoint: TQtPoint;
begin
//Drag&Dock support TCustomForm => Start BeginDrag()
if (LCLObject is TCustomForm) and (QMouseEvent_button(QMouseEventH(Event)) = QtLeftButton) then
if (LCLObject is TCustomForm) and
(TWinControlAccess(LCLObject).DragKind = dkDock) and
(TWinControlAccess(LCLObject).DragMode = dmAutomatic) and
(QMouseEvent_button(QMouseEventH(Event)) = QtLeftButton) then
begin
APoint := QMouseEvent_globalPos(QMouseEventH(Event))^;
AHeader := getGeometry;
@ -2065,7 +2068,7 @@ begin
// we can skip translation of coords to global since we already working with window
// check for title
if PtInRect(AHeader, Point(APoint.x, APoint.y)) and (TWinControlAccess(LCLObject).DragKind = dkDock) then
if PtInRect(AHeader, Point(APoint.x, APoint.y)) then
LCLObject.BeginDrag(true);
end;
end;

View File

@ -1825,7 +1825,8 @@ begin
begin
if lWinControl is TCustomForm then
begin
if TWinControlAccess(lWinControl).DragKind = dkDock then
if (TWinControlAccess(lWinControl).DragKind = dkDock) and
(TWinControlAccess(lWinControl).DragMode = dmAutomatic) then
lWinControl.BeginDrag(true);
end;
end;