mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 03:35:58 +02:00
anchordocking: started save/load settings
git-svn-id: trunk@26348 -
This commit is contained in:
parent
73c490be56
commit
fa65c21adb
@ -485,6 +485,8 @@ type
|
||||
property RestoreLayouts: TAnchorDockRestoreLayouts read FRestoreLayouts;
|
||||
property Restoring: boolean read FRestoring write SetRestoring;
|
||||
property IdleConnected: Boolean read FIdleConnected write SetIdleConnected;
|
||||
procedure LoadSettingsFromConfig(Config: TConfigStorage);
|
||||
procedure SaveSettingsToConfig(Config: TConfigStorage);
|
||||
|
||||
// manual docking
|
||||
procedure ManualFloat(AControl: TControl);
|
||||
@ -2196,6 +2198,48 @@ begin
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
procedure TAnchorDockMaster.LoadSettingsFromConfig(Config: TConfigStorage);
|
||||
begin
|
||||
Config.AppendBasePath('Settings/');
|
||||
DragTreshold:=Config.GetValue('DragThreshold',4);
|
||||
DockOutsideMargin:=Config.GetValue('DockOutsideMargin',10);
|
||||
DockParentMargin:=Config.GetValue('DockOutsideMargin',10);
|
||||
PageAreaInPercent:=Config.GetValue('DockOutsideMargin',40);
|
||||
HeaderAlignTop:=Config.GetValue('DockOutsideMargin',80);
|
||||
HeaderAlignLeft:=Config.GetValue('DockOutsideMargin',120);
|
||||
SplitterWidth:=Config.GetValue('DockOutsideMargin',4);
|
||||
ScaleOnResize:=Config.GetValue('DockOutsideMargin',true);
|
||||
ShowHeaderCaption:=Config.GetValue('DockOutsideMargin',true);
|
||||
HideHeaderCaptionFloatingControl:=Config.GetValue('DockOutsideMargin',true);
|
||||
AllowDragging:=Config.GetValue('DockOutsideMargin',true);
|
||||
HeaderButtonSize:=Config.GetValue('DockOutsideMargin',10);
|
||||
|
||||
//property HeaderHint: string read FHeaderHint write FHeaderHint;
|
||||
|
||||
Config.UndoAppendBasePath;
|
||||
end;
|
||||
|
||||
procedure TAnchorDockMaster.SaveSettingsToConfig(Config: TConfigStorage);
|
||||
begin
|
||||
Config.AppendBasePath('Settings/');
|
||||
Config.SetDeleteValue('DragThreshold',DragTreshold,4);
|
||||
Config.SetDeleteValue('DockOutsideMargin',DockOutsideMargin,10);
|
||||
Config.SetDeleteValue('DockParentMargin',DockParentMargin,10);
|
||||
Config.SetDeleteValue('PageAreaInPercent',PageAreaInPercent,40);
|
||||
Config.SetDeleteValue('HeaderAlignTop',HeaderAlignTop,80);
|
||||
Config.SetDeleteValue('HeaderAlignLeft',HeaderAlignLeft,120);
|
||||
Config.SetDeleteValue('SplitterWidth',SplitterWidth,4);
|
||||
Config.SetDeleteValue('ScaleOnResize',ScaleOnResize,true);
|
||||
Config.SetDeleteValue('ShowHeaderCaption',ShowHeaderCaption,true);
|
||||
Config.SetDeleteValue('HideHeaderCaptionFloatingControl',HideHeaderCaptionFloatingControl,true);
|
||||
Config.SetDeleteValue('AllowDragging',AllowDragging,true);
|
||||
Config.SetDeleteValue('HeaderButtonSize',HeaderButtonSize,10);
|
||||
|
||||
//property HeaderHint: string read FHeaderHint write FHeaderHint;
|
||||
|
||||
Config.UndoAppendBasePath;
|
||||
end;
|
||||
|
||||
procedure TAnchorDockMaster.ManualFloat(AControl: TControl);
|
||||
var
|
||||
Site: TAnchorDockHostSite;
|
||||
|
@ -274,6 +274,7 @@ begin
|
||||
if not DockMaster.ConfigIsEmpty(Config) then begin
|
||||
// loading last layout
|
||||
debugln(['TIDEAnchorDockMaster.LoadUserLayout restoring ...']);
|
||||
DockMaster.LoadSettingsFromConfig(Config);
|
||||
DockMaster.LoadLayoutFromConfig(Config,true);
|
||||
UserLayoutLoaded:=true;
|
||||
end else begin
|
||||
@ -299,6 +300,7 @@ begin
|
||||
debugln(['TIDEAnchorDockMaster.SaveDefaultLayout ',Filename]);
|
||||
Config:=GetIDEConfigStorage(Filename,false);
|
||||
try
|
||||
DockMaster.SaveSettingsToConfig(Config);
|
||||
DockMaster.SaveLayoutToConfig(Config);
|
||||
finally
|
||||
Config.Free;
|
||||
@ -582,6 +584,7 @@ begin
|
||||
if not (AOptions is SupportedOptionsClass) then exit;
|
||||
IDEAnchorDockMaster.Enabled:=EnableCheckBox.Checked;
|
||||
OptionsFrame.SaveToMaster;
|
||||
|
||||
end;
|
||||
|
||||
class function TAnchorDockIDEFrame.
|
||||
|
Loading…
Reference in New Issue
Block a user