anchordocking: restoretest: load/restore Splitter

git-svn-id: trunk@39736 -
This commit is contained in:
mattias 2013-01-02 18:31:57 +00:00
parent 626930d7e3
commit 6082ecf68a

View File

@ -34,7 +34,7 @@ unit MainUnit;
interface interface
uses uses
Classes, SysUtils, FileUtil, LazFileUtils, LazLogger, SynEdit, Classes, SysUtils, math, FileUtil, LazFileUtils, LazLogger, SynEdit,
SynHighlighterXML, AnchorDocking, AnchorDockStorage, ADLayoutViewer, Forms, SynHighlighterXML, AnchorDocking, AnchorDockStorage, ADLayoutViewer, Forms,
Controls, Graphics, Dialogs, ComCtrls, ExtCtrls, Buttons, StdCtrls, Controls, Graphics, Dialogs, ComCtrls, ExtCtrls, Buttons, StdCtrls,
XMLPropStorage; XMLPropStorage;
@ -156,6 +156,9 @@ begin
if (NewBounds.Right>NewBounds.Left) if (NewBounds.Right>NewBounds.Left)
and (NewBounds.Bottom>NewBounds.Top) then and (NewBounds.Bottom>NewBounds.Top) then
BoundsRect:=NewBounds; BoundsRect:=NewBounds;
SplitterXMLLayout.Left:=Max(1,Cfg.GetValue('Splitter/BetweenXMLAndLayout/Left',SplitterXMLLayout.Left));
SplitterBetweenXML.Top:=Max(1,Cfg.GetValue('Splitter/BetweenXML/Top',SplitterBetweenXML.Top));
SplitterBetweenLayouts.Top:=Max(1,Cfg.GetValue('Splitter/BetweenLayout/Top',SplitterBetweenLayouts.Top));
finally finally
Cfg.Free; Cfg.Free;
end; end;
@ -177,6 +180,9 @@ begin
Cfg:=TXMLConfigStorage.Create(ConfigFilename,false); Cfg:=TXMLConfigStorage.Create(ConfigFilename,false);
try try
Cfg.SetDeleteValue('Bounds',BoundsRect,Rect(0,0,0,0)); Cfg.SetDeleteValue('Bounds',BoundsRect,Rect(0,0,0,0));
Cfg.SetDeleteValue('Splitter/BetweenXMLAndLayout/Left',SplitterXMLLayout.Left,-1);
Cfg.SetDeleteValue('Splitter/BetweenXML/Top',SplitterBetweenXML.Top,-1);
Cfg.SetDeleteValue('Splitter/BetweenLayout/Top',SplitterBetweenLayouts.Top,-1);
finally finally
Cfg.Free; Cfg.Free;
end; end;