lcl: allow form dragging by client area only if it is docked into docksite without dock manager

git-svn-id: trunk@20070 -
This commit is contained in:
paul 2009-05-20 07:30:39 +00:00
parent 6306629a9e
commit e30c0905a2
3 changed files with 8 additions and 5 deletions

View File

@ -507,6 +507,7 @@ type
procedure SetAutoSize(Value: Boolean); override;
protected
// drag and dock
procedure BeginAutoDrag; override;
procedure DoDock(NewDockSite: TWinControl; var ARect: TRect); override;
function GetFloating: Boolean; override;
function GetDefaultDockCaption: String; override;

View File

@ -71,11 +71,6 @@ end;
------------------------------------------------------------------------------}
procedure TControl.BeginAutoDrag;
begin
{ TODO -cdocking : Automatic drag-dock never should start immediately.
A docked control should not try to undock itself, at least not immediately.
A docked control also should stay docked until it is really dropped into a different location,
so that a docking mangager can detect and handle (abort) an drop into the old place.
}
BeginDrag(DragManager.DragImmediate, DragManager.DragThreshold);
end;

View File

@ -1073,6 +1073,13 @@ begin
inherited SetAutoSize(Value);
end;
procedure TCustomForm.BeginAutoDrag;
begin
// allow form dragging only if it is docked into a site without DockManager
if (HostDockSite <> nil) and not HostDockSite.UseDockManager then
BeginDrag(False);
end;
class function TCustomForm.GetControlClassDefaultSize: TPoint;
begin
Result.X:=320;