LCL: anchordocking: started using TCustomLazDockingManager as LCL docking manager

git-svn-id: trunk@14060 -
This commit is contained in:
mattias 2008-02-10 00:19:14 +00:00
parent 78a6878d99
commit a51b0eced1
2 changed files with 47 additions and 5 deletions

View File

@ -2123,17 +2123,33 @@ begin
end;
procedure TCustomLazControlDocker.SetControl(const AValue: TControl);
var
WinControl: TWinControl;
begin
if FControl=AValue then exit;
if FControl<>nil then begin
FControl.RemoveAllHandlersOfObject(Self);
FControl.RemoveFreeNotification(Self);
if (Manager<>nil) and (FControl is TWinControl) then
begin
WinControl:=TWinControl(FControl);
WinControl.UseDockManager:=false;
WinControl.DockManager:=nil;
end;
end;
FControl:=AValue;
if Control<>nil then begin
Control.AddHandlerOnVisibleChanging(@ControlVisibleChanging);
Control.AddHandlerOnVisibleChanged(@ControlVisibleChanged);
Control.FreeNotification(Self);
if (Manager<>nil) and (FControl is TWinControl) then
begin
{$IFDEF EnableAnchorDockManager}
WinControl:=TWinControl(FControl);
WinControl.DockManager:=Manager.Manager;
WinControl.UseDockManager:=true;
{$ENDIF}
end;
end;
if (DockerName='') and (FControl<>nil) then
DockerName:=FControl.Name;
@ -2167,14 +2183,34 @@ end;
{ TCustomLazDockingManager }
procedure TCustomLazDockingManager.Remove(Docker: TCustomLazControlDocker);
var
WinControl: TWinControl;
begin
if Docker.Control is TWinControl then
begin
WinControl:=TWinControl(Docker.Control);
WinControl.UseDockManager:=false;
WinControl.DockManager:=nil;
end;
FDockers.Remove(Docker);
end;
function TCustomLazDockingManager.Add(Docker: TCustomLazControlDocker): Integer;
{$IFDEF EnableAnchorDockManager}
var
WinControl: TWinControl;
{$ENDIF}
begin
Docker.DockerName:=CreateUniqueName(Docker.DockerName,nil);
Result:=FDockers.Add(Docker);
if Docker.Control is TWinControl then
begin
{$IFDEF EnableAnchorDockManager}
WinControl:=TWinControl(Docker.Control);
WinControl.DockManager:=Manager;
WinControl.UseDockManager:=true;
{$ENDIF}
end;
end;
function TCustomLazDockingManager.GetDockers(Index: Integer

View File

@ -229,14 +229,15 @@ type
property TitleHeight: integer read FTitleHeight write FTitleHeight default 20;
procedure UpdateTitlePosition(Control: TControl);
procedure LoadFromStream(Stream: TStream); override;// not implemented
procedure PaintSite(DC: HDC); override;// not implemented
procedure PaintSite(DC: HDC); override;
procedure MouseMessage(var Msg: TLMMouse); override;// not implemented
procedure PositionDockRect(Client, DropCtl: TControl; DropAlign: TAlign;
var DockRect: TRect); override;// not implemented
procedure ResetBounds(Force: Boolean); override;// not implemented
procedure SaveToStream(Stream: TStream); override;// not implemented
procedure SetReplacingControl(Control: TControl); override;// not implemented
procedure LoadFromStream(Stream: TStream); override;// not implemented
procedure SaveToStream(Stream: TStream); override;// not implemented
// ToDo: move this to protected, after dockig code from LDockCtrl was moved
// here.
function CreateForm: TLazDockForm;
@ -2487,7 +2488,7 @@ end;
procedure TCustomAnchoredDockManager.PaintSite(DC: HDC);
begin
RaiseGDBException('TCustomAnchoredDockManager.PaintSite TODO');
// drawing of titles is done by TLazDockForm
end;
procedure TCustomAnchoredDockManager.PositionDockRect(Client, DropCtl: TControl;
@ -2516,6 +2517,11 @@ begin
RaiseGDBException('TCustomAnchoredDockManager.SetReplacingControl TODO');
end;
procedure TCustomAnchoredDockManager.MouseMessage(var Msg: TLMMouse);
begin
end;
function TCustomAnchoredDockManager.CreateForm: TLazDockForm;
begin
Result:=TLazDockForm.Create(FOwnerComponent);