mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 20:19:24 +02:00
LCL: anchordocking: started using TCustomLazDockingManager as LCL docking manager
git-svn-id: trunk@14060 -
This commit is contained in:
parent
78a6878d99
commit
a51b0eced1
@ -2123,17 +2123,33 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomLazControlDocker.SetControl(const AValue: TControl);
|
procedure TCustomLazControlDocker.SetControl(const AValue: TControl);
|
||||||
|
var
|
||||||
|
WinControl: TWinControl;
|
||||||
begin
|
begin
|
||||||
if FControl=AValue then exit;
|
if FControl=AValue then exit;
|
||||||
if FControl<>nil then begin
|
if FControl<>nil then begin
|
||||||
FControl.RemoveAllHandlersOfObject(Self);
|
FControl.RemoveAllHandlersOfObject(Self);
|
||||||
FControl.RemoveFreeNotification(Self);
|
FControl.RemoveFreeNotification(Self);
|
||||||
|
if (Manager<>nil) and (FControl is TWinControl) then
|
||||||
|
begin
|
||||||
|
WinControl:=TWinControl(FControl);
|
||||||
|
WinControl.UseDockManager:=false;
|
||||||
|
WinControl.DockManager:=nil;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
FControl:=AValue;
|
FControl:=AValue;
|
||||||
if Control<>nil then begin
|
if Control<>nil then begin
|
||||||
Control.AddHandlerOnVisibleChanging(@ControlVisibleChanging);
|
Control.AddHandlerOnVisibleChanging(@ControlVisibleChanging);
|
||||||
Control.AddHandlerOnVisibleChanged(@ControlVisibleChanged);
|
Control.AddHandlerOnVisibleChanged(@ControlVisibleChanged);
|
||||||
Control.FreeNotification(Self);
|
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;
|
end;
|
||||||
if (DockerName='') and (FControl<>nil) then
|
if (DockerName='') and (FControl<>nil) then
|
||||||
DockerName:=FControl.Name;
|
DockerName:=FControl.Name;
|
||||||
@ -2167,14 +2183,34 @@ end;
|
|||||||
{ TCustomLazDockingManager }
|
{ TCustomLazDockingManager }
|
||||||
|
|
||||||
procedure TCustomLazDockingManager.Remove(Docker: TCustomLazControlDocker);
|
procedure TCustomLazDockingManager.Remove(Docker: TCustomLazControlDocker);
|
||||||
|
var
|
||||||
|
WinControl: TWinControl;
|
||||||
begin
|
begin
|
||||||
|
if Docker.Control is TWinControl then
|
||||||
|
begin
|
||||||
|
WinControl:=TWinControl(Docker.Control);
|
||||||
|
WinControl.UseDockManager:=false;
|
||||||
|
WinControl.DockManager:=nil;
|
||||||
|
end;
|
||||||
FDockers.Remove(Docker);
|
FDockers.Remove(Docker);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomLazDockingManager.Add(Docker: TCustomLazControlDocker): Integer;
|
function TCustomLazDockingManager.Add(Docker: TCustomLazControlDocker): Integer;
|
||||||
|
{$IFDEF EnableAnchorDockManager}
|
||||||
|
var
|
||||||
|
WinControl: TWinControl;
|
||||||
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
Docker.DockerName:=CreateUniqueName(Docker.DockerName,nil);
|
Docker.DockerName:=CreateUniqueName(Docker.DockerName,nil);
|
||||||
Result:=FDockers.Add(Docker);
|
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;
|
end;
|
||||||
|
|
||||||
function TCustomLazDockingManager.GetDockers(Index: Integer
|
function TCustomLazDockingManager.GetDockers(Index: Integer
|
||||||
|
@ -229,14 +229,15 @@ type
|
|||||||
property TitleHeight: integer read FTitleHeight write FTitleHeight default 20;
|
property TitleHeight: integer read FTitleHeight write FTitleHeight default 20;
|
||||||
procedure UpdateTitlePosition(Control: TControl);
|
procedure UpdateTitlePosition(Control: TControl);
|
||||||
|
|
||||||
procedure LoadFromStream(Stream: TStream); override;// not implemented
|
procedure PaintSite(DC: HDC); override;
|
||||||
procedure PaintSite(DC: HDC); override;// not implemented
|
procedure MouseMessage(var Msg: TLMMouse); override;// not implemented
|
||||||
procedure PositionDockRect(Client, DropCtl: TControl; DropAlign: TAlign;
|
procedure PositionDockRect(Client, DropCtl: TControl; DropAlign: TAlign;
|
||||||
var DockRect: TRect); override;// not implemented
|
var DockRect: TRect); override;// not implemented
|
||||||
procedure ResetBounds(Force: Boolean); 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 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
|
// ToDo: move this to protected, after dockig code from LDockCtrl was moved
|
||||||
// here.
|
// here.
|
||||||
function CreateForm: TLazDockForm;
|
function CreateForm: TLazDockForm;
|
||||||
@ -2487,7 +2488,7 @@ end;
|
|||||||
|
|
||||||
procedure TCustomAnchoredDockManager.PaintSite(DC: HDC);
|
procedure TCustomAnchoredDockManager.PaintSite(DC: HDC);
|
||||||
begin
|
begin
|
||||||
RaiseGDBException('TCustomAnchoredDockManager.PaintSite TODO');
|
// drawing of titles is done by TLazDockForm
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomAnchoredDockManager.PositionDockRect(Client, DropCtl: TControl;
|
procedure TCustomAnchoredDockManager.PositionDockRect(Client, DropCtl: TControl;
|
||||||
@ -2516,6 +2517,11 @@ begin
|
|||||||
RaiseGDBException('TCustomAnchoredDockManager.SetReplacingControl TODO');
|
RaiseGDBException('TCustomAnchoredDockManager.SetReplacingControl TODO');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomAnchoredDockManager.MouseMessage(var Msg: TLMMouse);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
function TCustomAnchoredDockManager.CreateForm: TLazDockForm;
|
function TCustomAnchoredDockManager.CreateForm: TLazDockForm;
|
||||||
begin
|
begin
|
||||||
Result:=TLazDockForm.Create(FOwnerComponent);
|
Result:=TLazDockForm.Create(FOwnerComponent);
|
||||||
|
Loading…
Reference in New Issue
Block a user