mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 05:59:19 +02:00
anchordocking: IsFloating
git-svn-id: trunk@26175 -
This commit is contained in:
parent
c047ffb4a5
commit
2b4356ce41
@ -437,6 +437,7 @@ type
|
|||||||
function IsCustomSite(AControl: TControl): boolean;
|
function IsCustomSite(AControl: TControl): boolean;
|
||||||
function GetSite(AControl: TControl): TAnchorDockHostSite;
|
function GetSite(AControl: TControl): TAnchorDockHostSite;
|
||||||
function GetControl(Site: TControl): TControl;
|
function GetControl(Site: TControl): TControl;
|
||||||
|
function IsFloating(AControl: TControl): Boolean;
|
||||||
function GetPopupMenu: TPopupMenu;
|
function GetPopupMenu: TPopupMenu;
|
||||||
function AddPopupMenuItem(AName, ACaption: string;
|
function AddPopupMenuItem(AName, ACaption: string;
|
||||||
const OnClickEvent: TNotifyEvent; AParent: TMenuItem = nil): TMenuItem; virtual;
|
const OnClickEvent: TNotifyEvent; AParent: TMenuItem = nil): TMenuItem; virtual;
|
||||||
@ -1655,7 +1656,19 @@ begin
|
|||||||
AnchorSite:=TAnchorDockHostSite(Site);
|
AnchorSite:=TAnchorDockHostSite(Site);
|
||||||
if AnchorSite.SiteType=adhstOneControl then
|
if AnchorSite.SiteType=adhstOneControl then
|
||||||
Result:=AnchorSite.GetOneControl;
|
Result:=AnchorSite.GetOneControl;
|
||||||
end;
|
end else if (Site<>nil) and (Site.HostDockSite is TAnchorDockHostSite)
|
||||||
|
and (TAnchorDockHostSite(Site.HostDockSite).SiteType=adhstOneControl) then
|
||||||
|
Result:=Site;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TAnchorDockMaster.IsFloating(AControl: TControl): Boolean;
|
||||||
|
begin
|
||||||
|
if AControl is TAnchorDockHostSite then
|
||||||
|
Result:=TAnchorDockHostSite(AControl).SiteType=adhstOneControl
|
||||||
|
else if (AControl.HostDockSite is TAnchorDockHostSite) then
|
||||||
|
Result:=TAnchorDockHostSite(AControl.HostDockSite).SiteType=adhstOneControl
|
||||||
|
else
|
||||||
|
Result:=AControl.Parent=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TAnchorDockMaster.GetPopupMenu: TPopupMenu;
|
function TAnchorDockMaster.GetPopupMenu: TPopupMenu;
|
||||||
|
@ -214,19 +214,23 @@ var
|
|||||||
NewDockSite: TAnchorDockHostSite;
|
NewDockSite: TAnchorDockHostSite;
|
||||||
Site: TAnchorDockHostSite;
|
Site: TAnchorDockHostSite;
|
||||||
AControl: TControl;
|
AControl: TControl;
|
||||||
|
NeedPlacing: Boolean;
|
||||||
begin
|
begin
|
||||||
debugln(['TIDEAnchorDockMaster.ShowForm ',DbgSName(AForm),' BringToFront=',BringToFront,' IsSite=',DockMaster.IsSite(AForm),' IsCustomSite=',DockMaster.IsCustomSite(AForm)]);
|
debugln(['TIDEAnchorDockMaster.ShowForm START ',DbgSName(AForm),' BringToFront=',BringToFront,' IsSite=',DockMaster.IsSite(AForm),' IsCustomSite=',DockMaster.IsCustomSite(AForm)]);
|
||||||
try
|
try
|
||||||
AForm.DisableAlign;
|
AForm.DisableAlign;
|
||||||
|
|
||||||
|
NeedPlacing:=not AForm.IsVisible;
|
||||||
if not DockMaster.IsSite(AForm) then begin
|
if not DockMaster.IsSite(AForm) then begin
|
||||||
// this form was not yet docked
|
// this form was not yet docked
|
||||||
// => make it dockable
|
// => make it dockable
|
||||||
DockMaster.MakeDockable(AForm,false);
|
DockMaster.MakeDockable(AForm,false);
|
||||||
|
NeedPlacing:=true;
|
||||||
end;
|
end;
|
||||||
AControl:=DockMaster.GetControl(AForm);
|
AControl:=DockMaster.GetControl(AForm);
|
||||||
|
|
||||||
if (AControl<>nil) and (not AForm.IsVisible) and (AForm.Parent=nil) then begin
|
debugln(['TIDEAnchorDockMaster.ShowForm AControl=',DbgSName(AControl),' NeedPlacing=',NeedPlacing,' Floating=',DockMaster.IsFloating(AForm)]);
|
||||||
|
if (AControl<>nil) and NeedPlacing and DockMaster.IsFloating(AForm) then begin
|
||||||
// this form is not yet on the screen and is not yet docked
|
// this form is not yet on the screen and is not yet docked
|
||||||
debugln(['TIDEAnchorDockMaster.ShowForm placing ',DbgSName(AControl),' ...']);
|
debugln(['TIDEAnchorDockMaster.ShowForm placing ',DbgSName(AControl),' ...']);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user