mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 09:59:20 +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 RestoreLayouts: TAnchorDockRestoreLayouts read FRestoreLayouts;
|
||||||
property Restoring: boolean read FRestoring write SetRestoring;
|
property Restoring: boolean read FRestoring write SetRestoring;
|
||||||
property IdleConnected: Boolean read FIdleConnected write SetIdleConnected;
|
property IdleConnected: Boolean read FIdleConnected write SetIdleConnected;
|
||||||
|
procedure LoadSettingsFromConfig(Config: TConfigStorage);
|
||||||
|
procedure SaveSettingsToConfig(Config: TConfigStorage);
|
||||||
|
|
||||||
// manual docking
|
// manual docking
|
||||||
procedure ManualFloat(AControl: TControl);
|
procedure ManualFloat(AControl: TControl);
|
||||||
@ -2196,6 +2198,48 @@ begin
|
|||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
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);
|
procedure TAnchorDockMaster.ManualFloat(AControl: TControl);
|
||||||
var
|
var
|
||||||
Site: TAnchorDockHostSite;
|
Site: TAnchorDockHostSite;
|
||||||
|
@ -274,6 +274,7 @@ begin
|
|||||||
if not DockMaster.ConfigIsEmpty(Config) then begin
|
if not DockMaster.ConfigIsEmpty(Config) then begin
|
||||||
// loading last layout
|
// loading last layout
|
||||||
debugln(['TIDEAnchorDockMaster.LoadUserLayout restoring ...']);
|
debugln(['TIDEAnchorDockMaster.LoadUserLayout restoring ...']);
|
||||||
|
DockMaster.LoadSettingsFromConfig(Config);
|
||||||
DockMaster.LoadLayoutFromConfig(Config,true);
|
DockMaster.LoadLayoutFromConfig(Config,true);
|
||||||
UserLayoutLoaded:=true;
|
UserLayoutLoaded:=true;
|
||||||
end else begin
|
end else begin
|
||||||
@ -299,6 +300,7 @@ begin
|
|||||||
debugln(['TIDEAnchorDockMaster.SaveDefaultLayout ',Filename]);
|
debugln(['TIDEAnchorDockMaster.SaveDefaultLayout ',Filename]);
|
||||||
Config:=GetIDEConfigStorage(Filename,false);
|
Config:=GetIDEConfigStorage(Filename,false);
|
||||||
try
|
try
|
||||||
|
DockMaster.SaveSettingsToConfig(Config);
|
||||||
DockMaster.SaveLayoutToConfig(Config);
|
DockMaster.SaveLayoutToConfig(Config);
|
||||||
finally
|
finally
|
||||||
Config.Free;
|
Config.Free;
|
||||||
@ -582,6 +584,7 @@ begin
|
|||||||
if not (AOptions is SupportedOptionsClass) then exit;
|
if not (AOptions is SupportedOptionsClass) then exit;
|
||||||
IDEAnchorDockMaster.Enabled:=EnableCheckBox.Checked;
|
IDEAnchorDockMaster.Enabled:=EnableCheckBox.Checked;
|
||||||
OptionsFrame.SaveToMaster;
|
OptionsFrame.SaveToMaster;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TAnchorDockIDEFrame.
|
class function TAnchorDockIDEFrame.
|
||||||
|
Loading…
Reference in New Issue
Block a user