mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 02:39:51 +02:00
anchordocking: ManualFloat, manual enlarge
git-svn-id: trunk@26077 -
This commit is contained in:
parent
13d8b20deb
commit
c27563fcab
@ -401,6 +401,7 @@ type
|
||||
function FindControl(const aName: string): TControl;
|
||||
function IsSite(AControl: TControl): boolean;
|
||||
function IsCustomSite(AControl: TControl): boolean;
|
||||
function GetSite(AControl: TControl): TAnchorDockHostSite;
|
||||
function GetPopupMenu: TPopupMenu;
|
||||
function AddPopupMenuItem(AName, ACaption: string;
|
||||
const OnClickEvent: TNotifyEvent; AParent: TMenuItem = nil): TMenuItem; virtual;
|
||||
@ -425,6 +426,13 @@ type
|
||||
function ConfigIsEmpty(Config: TConfigStorage): boolean;
|
||||
function LoadLayoutFromConfig(Config: TConfigStorage): boolean;
|
||||
|
||||
// manual docking
|
||||
procedure ManualFloat(AControl: TControl);
|
||||
{procedure ManualDock(SrcSite, TargetSite: TAnchorDockHostSite;
|
||||
Align: TAlign; Inside: boolean);}
|
||||
function EnlargeSide(Site: TAnchorDockHostSite; Side: TAnchorKind;
|
||||
OnlyCheckIfPossible: boolean): boolean;
|
||||
|
||||
// simplification/garbage collection
|
||||
procedure BeginUpdate;
|
||||
procedure EndUpdate;
|
||||
@ -1515,6 +1523,16 @@ begin
|
||||
and (TCustomForm(AControl).DockManager is TAnchorDockManager);
|
||||
end;
|
||||
|
||||
function TAnchorDockMaster.GetSite(AControl: TControl): TAnchorDockHostSite;
|
||||
begin
|
||||
if AControl is TAnchorDockHostSite then
|
||||
Result:=TAnchorDockHostSite(AControl)
|
||||
else if (AControl.HostDockSite is TAnchorDockHostSite) then
|
||||
Result:=TAnchorDockHostSite(AControl.HostDockSite)
|
||||
else
|
||||
Result:=nil;
|
||||
end;
|
||||
|
||||
function TAnchorDockMaster.GetPopupMenu: TPopupMenu;
|
||||
begin
|
||||
if fPopupMenu=nil then begin
|
||||
@ -1812,6 +1830,21 @@ begin
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
procedure TAnchorDockMaster.ManualFloat(AControl: TControl);
|
||||
var
|
||||
Site: TAnchorDockHostSite;
|
||||
begin
|
||||
Site:=GetSite(AControl);
|
||||
if Site=nil then exit;
|
||||
Site.Undock;
|
||||
end;
|
||||
|
||||
function TAnchorDockMaster.EnlargeSide(Site: TAnchorDockHostSite;
|
||||
Side: TAnchorKind; OnlyCheckIfPossible: boolean): boolean;
|
||||
begin
|
||||
Result:=(Site<>nil) and Site.EnlargeSide(Side,OnlyCheckIfPossible);
|
||||
end;
|
||||
|
||||
procedure TAnchorDockMaster.BeginUpdate;
|
||||
begin
|
||||
inc(fUpdateCount);
|
||||
|
Loading…
Reference in New Issue
Block a user