IDE: using only one copy of editoropts

git-svn-id: trunk@22174 -
This commit is contained in:
mattias 2009-10-14 14:40:20 +00:00
parent d1d342eb3c
commit b336463cc3
4 changed files with 19 additions and 27 deletions

View File

@ -100,15 +100,18 @@ uses SysUtils;
constructor TXMLConfig.Create(const AFilename: String); constructor TXMLConfig.Create(const AFilename: String);
begin begin
//DebugLn(['TXMLConfig.Create ',AFilename]);
inherited Create(nil); inherited Create(nil);
SetFilename(AFilename); SetFilename(AFilename);
end; end;
constructor TXMLConfig.CreateClean(const AFilename: String); constructor TXMLConfig.CreateClean(const AFilename: String);
begin begin
//DebugLn(['TXMLConfig.CreateClean ',AFilename]);
inherited Create(nil); inherited Create(nil);
fDoNotLoad:=true; fDoNotLoad:=true;
SetFilename(AFilename); SetFilename(AFilename);
FModified:=FileExistsCached(AFilename);
end; end;
destructor TXMLConfig.Destroy; destructor TXMLConfig.Destroy;

View File

@ -93,14 +93,11 @@ end;
procedure TEduEnvFrame.ReadSettings(AOptions: TAbstractIDEOptions); procedure TEduEnvFrame.ReadSettings(AOptions: TAbstractIDEOptions);
begin begin
debugln(['TEduEnvFrame.ReadSettings ',EduGeneralOptions.Enabled]);
EnableCheckBox.Checked:=EduGeneralOptions.Enabled; EnableCheckBox.Checked:=EduGeneralOptions.Enabled;
DebugLn(['TEduEnvFrame.ReadSettings ',EnableCheckBox.Checked,' ',EduGeneralOptions.Enabled]);
end; end;
procedure TEduEnvFrame.WriteSettings(AOptions: TAbstractIDEOptions); procedure TEduEnvFrame.WriteSettings(AOptions: TAbstractIDEOptions);
begin begin
debugln(['TEduEnvFrame.WriteSettings ',EnableCheckBox.Checked]);
EduGeneralOptions.Enabled:=EnableCheckBox.Checked; EduGeneralOptions.Enabled:=EnableCheckBox.Checked;
if EducationOptions.Save<>mrOk then if EducationOptions.Save<>mrOk then
DebugLn(['TEduEnvFrame.WriteSettings Failed']); DebugLn(['TEduEnvFrame.WriteSettings Failed']);

View File

@ -89,18 +89,14 @@ procedure TCodetoolsLineSplittingOptionsFrame.UpdatePreviewSettings;
var var
Options: TEditorOptions; Options: TEditorOptions;
begin begin
Options := TEditorOptions.Create; Options := EditorOpts;
try if Assigned(OnSaveIDEOptions) then
if Assigned(OnSaveIDEOptions) then OnSaveIDEOptions(Self, Options);
OnSaveIDEOptions(Self, Options); SplitPreviewSynEdit.Highlighter := GetHighlighter(Options);
SplitPreviewSynEdit.Highlighter := GetHighlighter(Options); Options.GetSynEditPreviewSettings(SplitPreviewSynEdit);
Options.GetSynEditPreviewSettings(SplitPreviewSynEdit); SplitPreviewSynEdit.Gutter.Visible := False;
SplitPreviewSynEdit.Gutter.Visible := False; SplitPreviewSynEdit.Options := SplitPreviewSynEdit.Options + [eoNoCaret, eoNoSelection];
SplitPreviewSynEdit.Options := SplitPreviewSynEdit.Options + [eoNoCaret, eoNoSelection]; SplitPreviewSynEdit.ReadOnly := True;
SplitPreviewSynEdit.ReadOnly := True;
finally
Options.Free;
end;
end; end;
procedure TCodetoolsLineSplittingOptionsFrame.WriteBeautifyCodeOptions(Options: TBeautifyCodeOptions); procedure TCodetoolsLineSplittingOptionsFrame.WriteBeautifyCodeOptions(Options: TBeautifyCodeOptions);

View File

@ -93,18 +93,14 @@ procedure TCodetoolsSpaceOptionsFrame.UpdatePreviewSettings;
var var
Options: TEditorOptions; Options: TEditorOptions;
begin begin
Options := TEditorOptions.Create; Options := EditorOpts;
try if Assigned(OnSaveIDEOptions) then
if Assigned(OnSaveIDEOptions) then OnSaveIDEOptions(Self, Options);
OnSaveIDEOptions(Self, Options); SpacePreviewSynEdit.Highlighter := GetHighlighter(Options);
SpacePreviewSynEdit.Highlighter := GetHighlighter(Options); Options.GetSynEditPreviewSettings(SpacePreviewSynEdit);
Options.GetSynEditPreviewSettings(SpacePreviewSynEdit); SpacePreviewSynEdit.Gutter.Visible := False;
SpacePreviewSynEdit.Gutter.Visible := False; SpacePreviewSynEdit.Options := SpacePreviewSynEdit.Options + [eoNoCaret, eoNoSelection];
SpacePreviewSynEdit.Options := SpacePreviewSynEdit.Options + [eoNoCaret, eoNoSelection]; SpacePreviewSynEdit.ReadOnly := True;
SpacePreviewSynEdit.ReadOnly := True;
finally
Options.Free;
end;
end; end;
procedure TCodetoolsSpaceOptionsFrame.WriteBeautifyCodeOptions( procedure TCodetoolsSpaceOptionsFrame.WriteBeautifyCodeOptions(