mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-01 12:27:41 +01:00
anchordocking: restore custom dock site child
git-svn-id: trunk@26035 -
This commit is contained in:
parent
f987a5217d
commit
7a85daf14a
@ -338,6 +338,7 @@ type
|
|||||||
function RestoreLayout(Tree: TAnchorDockLayoutTree;
|
function RestoreLayout(Tree: TAnchorDockLayoutTree;
|
||||||
TreeNameToDocker: TADNameToControl): boolean;
|
TreeNameToDocker: TADNameToControl): boolean;
|
||||||
function DoCreateControl(aName: string; DisableAutoSizing: boolean): TControl;
|
function DoCreateControl(aName: string; DisableAutoSizing: boolean): TControl;
|
||||||
|
procedure DisableControlAutoSizing(AControl: TControl);
|
||||||
procedure EnableAllAutoSizing;
|
procedure EnableAllAutoSizing;
|
||||||
procedure ClearLayoutProperties(AControl: TControl);
|
procedure ClearLayoutProperties(AControl: TControl);
|
||||||
protected
|
protected
|
||||||
@ -529,19 +530,14 @@ function TAnchorDockMaster.CreateNeededControls(Tree: TAnchorDockLayoutTree;
|
|||||||
AControl:=FindControl(Node.Name);
|
AControl:=FindControl(Node.Name);
|
||||||
if AControl<>nil then begin
|
if AControl<>nil then begin
|
||||||
debugln(['CreateControlsForNode ',Node.Name,' already exists']);
|
debugln(['CreateControlsForNode ',Node.Name,' already exists']);
|
||||||
if DisableAutoSizing and (fDisabledAutosizing.IndexOf(AControl)<0) then
|
DisableControlAutoSizing(AControl);
|
||||||
begin
|
|
||||||
AControl.DisableAutoSizing;
|
|
||||||
fDisabledAutosizing.Add(AControl);
|
|
||||||
end;
|
|
||||||
end else begin
|
end else begin
|
||||||
debugln(['CreateControlsForNode ',Node.Name,' needs creation']);
|
debugln(['CreateControlsForNode ',Node.Name,' needs creation']);
|
||||||
AControl:=DoCreateControl(Node.Name,DisableAutoSizing);
|
AControl:=DoCreateControl(Node.Name,DisableAutoSizing);
|
||||||
if AControl<>nil then begin
|
if AControl<>nil then begin
|
||||||
debugln(['CreateControlsForNode ',AControl.Name,' created']);
|
debugln(['CreateControlsForNode ',AControl.Name,' created']);
|
||||||
if fDisabledAutosizing.IndexOf(AControl)>=0 then
|
if fDisabledAutosizing.IndexOf(AControl)<0 then
|
||||||
RaiseGDBException(''); // should never happen
|
fDisabledAutosizing.Add(AControl);
|
||||||
fDisabledAutosizing.Add(AControl);
|
|
||||||
MakeDockable(AControl,false);
|
MakeDockable(AControl,false);
|
||||||
end else begin
|
end else begin
|
||||||
debugln(['CreateControlsForNode ',Node.Name,' failed to create']);
|
debugln(['CreateControlsForNode ',Node.Name,' failed to create']);
|
||||||
@ -721,6 +717,8 @@ function TAnchorDockMaster.RestoreLayout(Tree: TAnchorDockLayoutTree;
|
|||||||
Site.BoundsRect:=Node.BoundsRect;
|
Site.BoundsRect:=Node.BoundsRect;
|
||||||
Site.Visible:=true;
|
Site.Visible:=true;
|
||||||
Site.Parent:=Parent;
|
Site.Parent:=Parent;
|
||||||
|
if IsCustomSite(Parent) then
|
||||||
|
Site.Align:=Node.Align;
|
||||||
if Site is TAnchorDockHostSite then
|
if Site is TAnchorDockHostSite then
|
||||||
TAnchorDockHostSite(Site).Header.HeaderPosition:=Node.HeaderPosition;
|
TAnchorDockHostSite(Site).Header.HeaderPosition:=Node.HeaderPosition;
|
||||||
if Parent=nil then begin
|
if Parent=nil then begin
|
||||||
@ -753,6 +751,7 @@ function TAnchorDockMaster.RestoreLayout(Tree: TAnchorDockLayoutTree;
|
|||||||
debugln(['TAnchorDockMaster.RestoreLayout.Restore can not find control ',Node.Name]);
|
debugln(['TAnchorDockMaster.RestoreLayout.Restore can not find control ',Node.Name]);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
DisableControlAutoSizing(AControl);
|
||||||
if AControl.HostDockSite=nil then
|
if AControl.HostDockSite=nil then
|
||||||
MakeDockable(AControl,false)
|
MakeDockable(AControl,false)
|
||||||
else
|
else
|
||||||
@ -775,8 +774,13 @@ function TAnchorDockMaster.RestoreLayout(Tree: TAnchorDockLayoutTree;
|
|||||||
debugln(['TAnchorDockMaster.RestoreLayout.Restore WARNING: ',Node.Name,' is not a custom dock site ',DbgSName(AControl)]);
|
debugln(['TAnchorDockMaster.RestoreLayout.Restore WARNING: ',Node.Name,' is not a custom dock site ',DbgSName(AControl)]);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
DisableControlAutoSizing(AControl);
|
||||||
SetupSite(TCustomForm(AControl),Node,nil);
|
SetupSite(TCustomForm(AControl),Node,nil);
|
||||||
Result:=AControl;
|
Result:=AControl;
|
||||||
|
// restore docked site
|
||||||
|
if Node.Count>0 then begin
|
||||||
|
Restore(Node[0],TCustomForm(AControl));
|
||||||
|
end;
|
||||||
end else if Node.IsSplitter then begin
|
end else if Node.IsSplitter then begin
|
||||||
// restore splitter
|
// restore splitter
|
||||||
Splitter:=TAnchorDockSplitter(TreeNameToDocker[Node.Name]);
|
Splitter:=TAnchorDockSplitter(TreeNameToDocker[Node.Name]);
|
||||||
@ -877,11 +881,22 @@ function TAnchorDockMaster.DoCreateControl(aName: string;
|
|||||||
begin
|
begin
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
OnCreateControl(Self,aName,Result,DisableAutoSizing);
|
OnCreateControl(Self,aName,Result,DisableAutoSizing);
|
||||||
|
if Result=nil then
|
||||||
|
debugln(['TAnchorDockMaster.DoCreateControl WARNING: control not found: "',aName,'"']);
|
||||||
if (Result<>nil) and (Result.Name<>aName) then
|
if (Result<>nil) and (Result.Name<>aName) then
|
||||||
raise Exception.Create('TAnchorDockMaster.DoCreateControl'+Format(
|
raise Exception.Create('TAnchorDockMaster.DoCreateControl'+Format(
|
||||||
adrsRequestedButCreated, [aName, Result.Name]));
|
adrsRequestedButCreated, [aName, Result.Name]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TAnchorDockMaster.DisableControlAutoSizing(AControl: TControl);
|
||||||
|
begin
|
||||||
|
if fDisabledAutosizing.IndexOf(AControl)>=0 then exit;
|
||||||
|
debugln(['TAnchorDockMaster.DisableControlAutoSizing ',DbgSName(AControl)]);
|
||||||
|
fDisabledAutosizing.Add(AControl);
|
||||||
|
AControl.FreeNotification(Self);
|
||||||
|
AControl.DisableAutoSizing;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TAnchorDockMaster.EnableAllAutoSizing;
|
procedure TAnchorDockMaster.EnableAllAutoSizing;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -1145,7 +1160,7 @@ begin
|
|||||||
if SavedSites.IndexOf(AForm)>=0 then continue;
|
if SavedSites.IndexOf(AForm)>=0 then continue;
|
||||||
SavedSites.Add(AForm);
|
SavedSites.Add(AForm);
|
||||||
debugln(['TAnchorDockMaster.SaveMainLayoutToTree AForm=',DbgSName(AForm)]);
|
debugln(['TAnchorDockMaster.SaveMainLayoutToTree AForm=',DbgSName(AForm)]);
|
||||||
DebugWriteChildAnchors(AForm);
|
DebugWriteChildAnchors(AForm,true,true);
|
||||||
if (AForm is TAnchorDockHostSite) then begin
|
if (AForm is TAnchorDockHostSite) then begin
|
||||||
Site:=TAnchorDockHostSite(AForm);
|
Site:=TAnchorDockHostSite(AForm);
|
||||||
LayoutNode:=LayoutTree.NewNode(LayoutTree.Root);
|
LayoutNode:=LayoutTree.NewNode(LayoutTree.Root);
|
||||||
@ -1693,7 +1708,7 @@ begin
|
|||||||
BoundsIncreased:=true;
|
BoundsIncreased:=true;
|
||||||
end;
|
end;
|
||||||
debugln(['TAnchorDockHostSite.DockAnotherControl AFTER ENLARGE ',Caption]);
|
debugln(['TAnchorDockHostSite.DockAnotherControl AFTER ENLARGE ',Caption]);
|
||||||
DebugWriteChildAnchors(Self);
|
DebugWriteChildAnchors(Self,true,true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// anchors
|
// anchors
|
||||||
@ -1850,7 +1865,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
DebugWriteChildAnchors(Self);
|
DebugWriteChildAnchors(Self,true,true);
|
||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1962,7 +1977,7 @@ procedure TAnchorDockHostSite.RemoveControlFromLayout(AControl: TControl);
|
|||||||
debugln(['RemoveControlBoundSplitter ',DbgSName(Splitter)]);
|
debugln(['RemoveControlBoundSplitter ',DbgSName(Splitter)]);
|
||||||
Splitter.Free;
|
Splitter.Free;
|
||||||
|
|
||||||
DebugWriteChildAnchors(GetParentForm(Self));
|
DebugWriteChildAnchors(GetParentForm(Self),true,true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure ConvertToOneControlType(OnlySiteLeft: TAnchorDockHostSite);
|
procedure ConvertToOneControlType(OnlySiteLeft: TAnchorDockHostSite);
|
||||||
@ -2031,7 +2046,7 @@ procedure TAnchorDockHostSite.RemoveControlFromLayout(AControl: TControl);
|
|||||||
UpdateHeaderAlign;
|
UpdateHeaderAlign;
|
||||||
|
|
||||||
debugln(['TAnchorDockHostSite.RemoveControlFromLayout.ConvertToOneControlType AFTER CONVERT "',Caption,'" to onecontrol OnlySiteLeft="',OnlySiteLeft.Caption,'"']);
|
debugln(['TAnchorDockHostSite.RemoveControlFromLayout.ConvertToOneControlType AFTER CONVERT "',Caption,'" to onecontrol OnlySiteLeft="',OnlySiteLeft.Caption,'"']);
|
||||||
DebugWriteChildAnchors(GetParentForm(Self));
|
DebugWriteChildAnchors(GetParentForm(Self),true,true);
|
||||||
|
|
||||||
DockMaster.NeedSimplify(Self);
|
DockMaster.NeedSimplify(Self);
|
||||||
finally
|
finally
|
||||||
@ -2192,7 +2207,7 @@ begin
|
|||||||
EnableAutoSizing;
|
EnableAutoSizing;
|
||||||
end;
|
end;
|
||||||
debugln(['TAnchorDockHostSite.SimplifyPages END Self="',Caption,'"']);
|
debugln(['TAnchorDockHostSite.SimplifyPages END Self="',Caption,'"']);
|
||||||
DebugWriteChildAnchors(GetParentForm(Self));
|
DebugWriteChildAnchors(GetParentForm(Self),true,true);
|
||||||
end else if Pages.PageCount=0 then begin
|
end else if Pages.PageCount=0 then begin
|
||||||
debugln(['TAnchorDockHostSite.SimplifyPages "',Caption,'" PageCount=0 Self=',dbgs(Pointer(Self))]);
|
debugln(['TAnchorDockHostSite.SimplifyPages "',Caption,'" PageCount=0 Self=',dbgs(Pointer(Self))]);
|
||||||
FSiteType:=adhstNone;
|
FSiteType:=adhstNone;
|
||||||
@ -2257,7 +2272,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
debugln(['TAnchorDockHostSite.SimplifyOneControl END Self="',Caption,'"']);
|
debugln(['TAnchorDockHostSite.SimplifyOneControl END Self="',Caption,'"']);
|
||||||
DebugWriteChildAnchors(GetParentForm(Self));
|
DebugWriteChildAnchors(GetParentForm(Self),true,true);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TAnchorDockHostSite.GetOneControl: TControl;
|
function TAnchorDockHostSite.GetOneControl: TControl;
|
||||||
|
|||||||
@ -67,6 +67,7 @@ type
|
|||||||
|
|
||||||
TAnchorDockLayoutTreeNode = class
|
TAnchorDockLayoutTreeNode = class
|
||||||
private
|
private
|
||||||
|
FAlign: TAlign;
|
||||||
fAnchors: array[TAnchorKind] of string;
|
fAnchors: array[TAnchorKind] of string;
|
||||||
FBoundsRect: TRect;
|
FBoundsRect: TRect;
|
||||||
FHeaderPosition: TADLHeaderPosition;
|
FHeaderPosition: TADLHeaderPosition;
|
||||||
@ -84,6 +85,7 @@ type
|
|||||||
function GetRight: integer;
|
function GetRight: integer;
|
||||||
function GetTop: integer;
|
function GetTop: integer;
|
||||||
function GetWidth: integer;
|
function GetWidth: integer;
|
||||||
|
procedure SetAlign(const AValue: TAlign);
|
||||||
procedure SetAnchors(Site: TAnchorKind; const AValue: string);
|
procedure SetAnchors(Site: TAnchorKind; const AValue: string);
|
||||||
procedure SetBottom(const AValue: integer);
|
procedure SetBottom(const AValue: integer);
|
||||||
procedure SetBoundsRect(const AValue: TRect);
|
procedure SetBoundsRect(const AValue: TRect);
|
||||||
@ -134,6 +136,7 @@ type
|
|||||||
property Bottom: integer read GetBottom write SetBottom;
|
property Bottom: integer read GetBottom write SetBottom;
|
||||||
property BoundsRect: TRect read FBoundsRect write SetBoundsRect;
|
property BoundsRect: TRect read FBoundsRect write SetBoundsRect;
|
||||||
property Anchors[Site: TAnchorKind]: string read GetAnchors write SetAnchors; // empty means default (parent)
|
property Anchors[Site: TAnchorKind]: string read GetAnchors write SetAnchors; // empty means default (parent)
|
||||||
|
property Align: TAlign read FAlign write SetAlign;
|
||||||
property WindowState: TWindowState read FWindowState write SetWindowState;
|
property WindowState: TWindowState read FWindowState write SetWindowState;
|
||||||
property Monitor: integer read FMonitor write SetMonitor;
|
property Monitor: integer read FMonitor write SetMonitor;
|
||||||
property HeaderPosition: TADLHeaderPosition read FHeaderPosition write SetHeaderPosition;
|
property HeaderPosition: TADLHeaderPosition read FHeaderPosition write SetHeaderPosition;
|
||||||
@ -215,16 +218,27 @@ const
|
|||||||
'right',
|
'right',
|
||||||
'bottom'
|
'bottom'
|
||||||
);
|
);
|
||||||
|
ADLAlignNames: array[TAlign] of string = (
|
||||||
|
'None',
|
||||||
|
'Top',
|
||||||
|
'Bottom',
|
||||||
|
'Left',
|
||||||
|
'Right',
|
||||||
|
'Client',
|
||||||
|
'Custom'
|
||||||
|
);
|
||||||
|
|
||||||
function NameToADLTreeNodeType(s: string): TADLTreeNodeType;
|
function NameToADLTreeNodeType(s: string): TADLTreeNodeType;
|
||||||
function NameToADLWindowState(s: string): TWindowState;
|
function NameToADLWindowState(s: string): TWindowState;
|
||||||
function NameToADLHeaderPosition(s: string): TADLHeaderPosition;
|
function NameToADLHeaderPosition(s: string): TADLHeaderPosition;
|
||||||
|
function NameToADLAlign(s: string): TAlign;
|
||||||
function dbgs(const NodeType: TADLTreeNodeType): string; overload;
|
function dbgs(const NodeType: TADLTreeNodeType): string; overload;
|
||||||
|
|
||||||
procedure WriteDebugLayout(Title: string; RootNode: TObject);
|
procedure WriteDebugLayout(Title: string; RootNode: TObject);
|
||||||
function DebugLayoutAsString(RootNode: TObject): string;
|
function DebugLayoutAsString(RootNode: TObject): string;
|
||||||
procedure DebugWriteChildAnchors(RootNode: TAnchorDockLayoutTreeNode); overload;
|
procedure DebugWriteChildAnchors(RootNode: TAnchorDockLayoutTreeNode); overload;
|
||||||
procedure DebugWriteChildAnchors(RootControl: TWinControl); overload;
|
procedure DebugWriteChildAnchors(RootControl: TWinControl;
|
||||||
|
OnlyWinControls, OnlyForms: boolean); overload;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -249,6 +263,13 @@ begin
|
|||||||
Result:=adlhpAuto;
|
Result:=adlhpAuto;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function NameToADLAlign(s: string): TAlign;
|
||||||
|
begin
|
||||||
|
for Result:=low(TAlign) to high(TAlign) do
|
||||||
|
if s=ADLAlignNames[Result] then exit;
|
||||||
|
Result:=alNone;
|
||||||
|
end;
|
||||||
|
|
||||||
function dbgs(const NodeType: TADLTreeNodeType): string; overload;
|
function dbgs(const NodeType: TADLTreeNodeType): string; overload;
|
||||||
begin
|
begin
|
||||||
Result:=ADLTreeNodeTypeNames[NodeType];
|
Result:=ADLTreeNodeTypeNames[NodeType];
|
||||||
@ -498,7 +519,7 @@ var
|
|||||||
if MinPosCalculating then begin
|
if MinPosCalculating then begin
|
||||||
DebugLn(['DebugLayoutAsString.GetMinPos.Compute WARNING: anchor circle detected RootNode=',DbgSName(RootNode)]);
|
DebugLn(['DebugLayoutAsString.GetMinPos.Compute WARNING: anchor circle detected RootNode=',DbgSName(RootNode)]);
|
||||||
if RootNode is TWinControl then
|
if RootNode is TWinControl then
|
||||||
DebugWriteChildAnchors(TWinControl(RootNode))
|
DebugWriteChildAnchors(TWinControl(RootNode),true,true)
|
||||||
else if RootNode is TAnchorDockLayoutTreeNode then
|
else if RootNode is TAnchorDockLayoutTreeNode then
|
||||||
DebugWriteChildAnchors(TAnchorDockLayoutTreeNode(RootNode));
|
DebugWriteChildAnchors(TAnchorDockLayoutTreeNode(RootNode));
|
||||||
RaiseGDBException('circle detected');
|
RaiseGDBException('circle detected');
|
||||||
@ -700,7 +721,8 @@ begin
|
|||||||
WriteControl(RootNode[i],' ');
|
WriteControl(RootNode[i],' ');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure DebugWriteChildAnchors(RootControl: TWinControl); overload;
|
procedure DebugWriteChildAnchors(RootControl: TWinControl;
|
||||||
|
OnlyWinControls, OnlyForms: boolean); overload;
|
||||||
|
|
||||||
procedure WriteControl(AControl: TControl; Prefix: string);
|
procedure WriteControl(AControl: TControl; Prefix: string);
|
||||||
var
|
var
|
||||||
@ -709,6 +731,9 @@ procedure DebugWriteChildAnchors(RootControl: TWinControl); overload;
|
|||||||
AnchorControl: TControl;
|
AnchorControl: TControl;
|
||||||
AnchorName: String;
|
AnchorName: String;
|
||||||
begin
|
begin
|
||||||
|
if OnlyWinControls and (not (AControl is TWinControl)) then exit;
|
||||||
|
if OnlyForms and (not (AControl is TCustomForm)) then exit;
|
||||||
|
|
||||||
debugln([Prefix,DbgSName(AControl),' Caption="',dbgstr(AControl.Caption),'" Align=',dbgs(AControl.Align),' Bounds=',dbgs(AControl.BoundsRect)]);
|
debugln([Prefix,DbgSName(AControl),' Caption="',dbgstr(AControl.Caption),'" Align=',dbgs(AControl.Align),' Bounds=',dbgs(AControl.BoundsRect)]);
|
||||||
for a:=low(TAnchorKind) to high(TAnchorKind) do begin
|
for a:=low(TAnchorKind) to high(TAnchorKind) do begin
|
||||||
AnchorControl:=AControl.AnchorSide[a].Control;
|
AnchorControl:=AControl.AnchorSide[a].Control;
|
||||||
@ -777,6 +802,13 @@ begin
|
|||||||
Result:=FBoundsRect.Right-FBoundsRect.Left;
|
Result:=FBoundsRect.Right-FBoundsRect.Left;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TAnchorDockLayoutTreeNode.SetAlign(const AValue: TAlign);
|
||||||
|
begin
|
||||||
|
if FAlign=AValue then exit;
|
||||||
|
FAlign:=AValue;
|
||||||
|
IncreaseChangeStamp;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TAnchorDockLayoutTreeNode.SetAnchors(Site: TAnchorKind;
|
procedure TAnchorDockLayoutTreeNode.SetAnchors(Site: TAnchorKind;
|
||||||
const AValue: string);
|
const AValue: string);
|
||||||
begin
|
begin
|
||||||
@ -923,6 +955,7 @@ begin
|
|||||||
or (Count<>Node.Count)
|
or (Count<>Node.Count)
|
||||||
or (NodeType<>Node.NodeType)
|
or (NodeType<>Node.NodeType)
|
||||||
or (Name<>Node.Name)
|
or (Name<>Node.Name)
|
||||||
|
or (Align<>Node.Align)
|
||||||
or (WindowState<>Node.WindowState)
|
or (WindowState<>Node.WindowState)
|
||||||
or (HeaderPosition<>Node.HeaderPosition)
|
or (HeaderPosition<>Node.HeaderPosition)
|
||||||
then
|
then
|
||||||
@ -943,6 +976,7 @@ begin
|
|||||||
Name:=Node.Name;
|
Name:=Node.Name;
|
||||||
NodeType:=Node.NodeType;
|
NodeType:=Node.NodeType;
|
||||||
BoundsRect:=Node.BoundsRect;
|
BoundsRect:=Node.BoundsRect;
|
||||||
|
Align:=Node.Align;
|
||||||
WindowState:=Node.WindowState;
|
WindowState:=Node.WindowState;
|
||||||
HeaderPosition:=Node.HeaderPosition;
|
HeaderPosition:=Node.HeaderPosition;
|
||||||
for a:=low(TAnchorKind) to high(TAnchorKind) do
|
for a:=low(TAnchorKind) to high(TAnchorKind) do
|
||||||
@ -966,6 +1000,7 @@ var
|
|||||||
begin
|
begin
|
||||||
Name:=AControl.Name;
|
Name:=AControl.Name;
|
||||||
BoundsRect:=AControl.BoundsRect;
|
BoundsRect:=AControl.BoundsRect;
|
||||||
|
Align:=AControl.Align;
|
||||||
if (AControl.Parent=nil) and (AControl is TCustomForm) then begin
|
if (AControl.Parent=nil) and (AControl is TCustomForm) then begin
|
||||||
WindowState:=TCustomForm(AControl).WindowState;
|
WindowState:=TCustomForm(AControl).WindowState;
|
||||||
Monitor:=TCustomForm(AControl).Monitor.MonitorNum;
|
Monitor:=TCustomForm(AControl).Monitor.MonitorNum;
|
||||||
@ -997,6 +1032,7 @@ begin
|
|||||||
Anchors[akTop]:=Config.GetValue('Anchors/Top','');
|
Anchors[akTop]:=Config.GetValue('Anchors/Top','');
|
||||||
Anchors[akRight]:=Config.GetValue('Anchors/Right','');
|
Anchors[akRight]:=Config.GetValue('Anchors/Right','');
|
||||||
Anchors[akBottom]:=Config.GetValue('Anchors/Bottom','');
|
Anchors[akBottom]:=Config.GetValue('Anchors/Bottom','');
|
||||||
|
Align:=NameToADLAlign(Config.GetValue('Anchors/Align',AlignNames[alNone]));
|
||||||
WindowState:=NameToADLWindowState(Config.GetValue('WindowState',ADLWindowStateNames[wsNormal]));
|
WindowState:=NameToADLWindowState(Config.GetValue('WindowState',ADLWindowStateNames[wsNormal]));
|
||||||
HeaderPosition:=NameToADLHeaderPosition(Config.GetValue('Header/Position',ADLHeaderPositionNames[adlhpAuto]));
|
HeaderPosition:=NameToADLHeaderPosition(Config.GetValue('Header/Position',ADLHeaderPositionNames[adlhpAuto]));
|
||||||
Monitor:=Config.GetValue('Monitor',0);
|
Monitor:=Config.GetValue('Monitor',0);
|
||||||
@ -1025,6 +1061,7 @@ begin
|
|||||||
Config.SetDeleteValue('Anchors/Top',Anchors[akTop],'');
|
Config.SetDeleteValue('Anchors/Top',Anchors[akTop],'');
|
||||||
Config.SetDeleteValue('Anchors/Right',Anchors[akRight],'');
|
Config.SetDeleteValue('Anchors/Right',Anchors[akRight],'');
|
||||||
Config.SetDeleteValue('Anchors/Bottom',Anchors[akBottom],'');
|
Config.SetDeleteValue('Anchors/Bottom',Anchors[akBottom],'');
|
||||||
|
Config.SetDeleteValue('Anchors/Align',ADLAlignNames[Align],ADLAlignNames[alNone]);
|
||||||
Config.SetDeleteValue('WindowState',ADLWindowStateNames[WindowState],
|
Config.SetDeleteValue('WindowState',ADLWindowStateNames[WindowState],
|
||||||
ADLWindowStateNames[wsNormal]);
|
ADLWindowStateNames[wsNormal]);
|
||||||
Config.SetDeleteValue('Header/Position',ADLHeaderPositionNames[HeaderPosition],
|
Config.SetDeleteValue('Header/Position',ADLHeaderPositionNames[HeaderPosition],
|
||||||
|
|||||||
@ -81,6 +81,12 @@ procedure TMainIDE.DockMasterCreateControl(Sender: TObject; aName: string; var
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
AControl:=Screen.FindForm(aName);
|
||||||
|
if AControl<>nil then begin
|
||||||
|
if DoDisableAutoSizing then
|
||||||
|
AControl.DisableAutoSizing;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
if aName='CodeExplorer' then
|
if aName='CodeExplorer' then
|
||||||
CreateForm('Code Explorer',Bounds(700,230,100,250))
|
CreateForm('Code Explorer',Bounds(700,230,100,250))
|
||||||
else if aName='FPDocEditor' then
|
else if aName='FPDocEditor' then
|
||||||
@ -117,8 +123,8 @@ begin
|
|||||||
|
|
||||||
SetBounds(100,50,600,80);
|
SetBounds(100,50,600,80);
|
||||||
ViewSrcEditor1ToolButtonClick(Self);
|
ViewSrcEditor1ToolButtonClick(Self);
|
||||||
ViewMessagesToolButtonClick(Self);
|
//ViewMessagesToolButtonClick(Self);
|
||||||
ViewOIToolButtonClick(Self);
|
//ViewOIToolButtonClick(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.LoadLayoutToolButtonClick(Sender: TObject);
|
procedure TMainIDE.LoadLayoutToolButtonClick(Sender: TObject);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user