mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-14 22:00:10 +02:00
LCL: Separate coolbar and other dockmanagers (another patch by Andrey Zubarev), Issue #32027
git-svn-id: trunk@55438 -
This commit is contained in:
parent
5305e255e4
commit
9139481f92
@ -379,6 +379,7 @@ type
|
||||
procedure RestoreSite(SplitterPos: integer);
|
||||
procedure StoreConstraints;
|
||||
function GetSitePreferredClientSize: TPoint;
|
||||
function IsEnabledControl(Control: TControl):Boolean; override;
|
||||
|
||||
property Site: TWinControl read FSite; // the associated TControl (a TAnchorDockHostSite or a custom dock site)
|
||||
property DockSite: TAnchorDockHostSite read FDockSite; // if Site is a TAnchorDockHostSite, this is it
|
||||
@ -6037,6 +6038,11 @@ begin
|
||||
Result:=(Left<>0) or (Top<>0) or (Right<>0) or (Bottom<>0);
|
||||
end;
|
||||
|
||||
function TAnchorDockManager.IsEnabledControl(Control: TControl):Boolean;
|
||||
begin
|
||||
Result := (DockMaster <> nil) and DockMaster.IsSite(Control);
|
||||
end;
|
||||
|
||||
{ TAnchorDockSplitter }
|
||||
|
||||
procedure TAnchorDockSplitter.SetResizeAnchor(const AValue: TAnchorKind);
|
||||
|
@ -578,6 +578,7 @@ type
|
||||
procedure SaveToStream(Stream: TStream); virtual; abstract;
|
||||
procedure SetReplacingControl(Control: TControl); virtual;
|
||||
function AutoFreeByControl: Boolean; virtual;
|
||||
function IsEnabledControl(Control: TControl):Boolean; virtual;
|
||||
end;
|
||||
|
||||
TDockManagerClass = class of TDockManager;
|
||||
@ -4506,6 +4507,15 @@ begin
|
||||
|
||||
end;
|
||||
|
||||
function TDockManager.IsEnabledControl(Control: TControl):Boolean;
|
||||
begin
|
||||
Result := true;
|
||||
if Control is TWinControl then
|
||||
if (Control as TWinControl).DockManager <> nil then
|
||||
Result := (Control as TWinControl).DockManager = self;
|
||||
end;
|
||||
|
||||
|
||||
initialization
|
||||
//DebugLn('controls.pp - initialization');
|
||||
RegisterPropertyToSkip(TControl, 'AlignWithMargins', 'VCL compatibility property', '');
|
||||
|
@ -5517,6 +5517,9 @@ begin
|
||||
InfluenceRect.Right := InfluenceRect.Right+ADockMargin;
|
||||
InfluenceRect.Bottom := InfluenceRect.Bottom+ADockMargin;
|
||||
|
||||
if UseDockManager then
|
||||
CanDock:=DockManager.IsEnabledControl(Client);
|
||||
|
||||
if Assigned(FOnGetSiteInfo) then
|
||||
FOnGetSiteInfo(Self, Client, InfluenceRect, MousePos, CanDock);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user