IDE: project options: compiler path: combobox with history

git-svn-id: trunk@44137 -
This commit is contained in:
mattias 2014-02-18 16:47:43 +00:00
parent b85d70831d
commit 37556f70b9
2 changed files with 21 additions and 11 deletions

View File

@ -198,10 +198,11 @@ object CompilerCompilationOptionsFrame: TCompilerCompilationOptionsFrame
end end
object lblCompiler: TLabel object lblCompiler: TLabel
AnchorSideLeft.Control = grpCompiler AnchorSideLeft.Control = grpCompiler
AnchorSideTop.Control = cobCompiler
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
Left = 6 Left = 6
Height = 15 Height = 15
Top = 38 Top = 42
Width = 62 Width = 62
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'lblCompiler' Caption = 'lblCompiler'
@ -246,7 +247,7 @@ object CompilerCompilationOptionsFrame: TCompilerCompilationOptionsFrame
Caption = 'chkCompilerRun' Caption = 'chkCompilerRun'
TabOrder = 2 TabOrder = 2
end end
object edtCompiler: TComboBox object cobCompiler: TComboBox
AnchorSideLeft.Control = lblCompiler AnchorSideLeft.Control = lblCompiler
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = chkCompilerCompile AnchorSideTop.Control = chkCompilerCompile
@ -262,7 +263,7 @@ object CompilerCompilationOptionsFrame: TCompilerCompilationOptionsFrame
BorderSpacing.Around = 6 BorderSpacing.Around = 6
ItemHeight = 0 ItemHeight = 0
TabOrder = 3 TabOrder = 3
Text = 'edtCompiler' Text = 'cobCompiler'
end end
end end
object ExecuteBeforeGroupBox: TGroupBox object ExecuteBeforeGroupBox: TGroupBox

View File

@ -6,7 +6,7 @@ interface
uses uses
Controls, StdCtrls, IDEOptionsIntf, Project, CompilerOptions, CompOptsIntf, Controls, StdCtrls, IDEOptionsIntf, Project, CompilerOptions, CompOptsIntf,
PackageDefs, LazarusIDEStrConsts; PackageDefs, LazarusIDEStrConsts, EnvironmentOpts, LazConf, IDEProcs;
type type
@ -23,7 +23,7 @@ type
chkExecBeforeBuild: TCheckBox; chkExecBeforeBuild: TCheckBox;
chkExecBeforeCompile: TCheckBox; chkExecBeforeCompile: TCheckBox;
chkExecBeforeRun: TCheckBox; chkExecBeforeRun: TCheckBox;
edtCompiler: TComboBox; cobCompiler: TComboBox;
ExecuteAfterCommandEdit: TEdit; ExecuteAfterCommandEdit: TEdit;
ExecuteAfterCommandLabel: TLabel; ExecuteAfterCommandLabel: TLabel;
ExecuteAfterGroupBox: TGroupBox; ExecuteAfterGroupBox: TGroupBox;
@ -86,7 +86,7 @@ begin
chkCompilerCompile.Checked := True; chkCompilerCompile.Checked := True;
chkCompilerRun.Caption := lisRunStage; chkCompilerRun.Caption := lisRunStage;
chkCompilerRun.Checked := True; chkCompilerRun.Checked := True;
edtCompiler.Text := ''; cobCompiler.Text := '';
lblCompiler.Caption := lisCOCommand; lblCompiler.Caption := lisCOCommand;
lblRunIfCompiler.Caption := lisCOCallOn; lblRunIfCompiler.Caption := lisCOCallOn;
@ -133,7 +133,14 @@ begin
chkExecBeforeRun.Visible := False; chkExecBeforeRun.Visible := False;
end; end;
edtCompiler.Text := Options.CompilerPath; with cobCompiler do begin
Items.BeginUpdate;
Items.Assign(EnvironmentOptions.CompilerFileHistory);
AddFilenameToList(Items,'$(CompPath)');
SetComboBoxText(cobCompiler,Options.CompilerPath,cstFilename);
Items.EndUpdate;
end;
if Options is TProjectCompilerOptions then if Options is TProjectCompilerOptions then
with TProjectCompilerOptions(Options) do with TProjectCompilerOptions(Options) do
begin begin
@ -147,7 +154,7 @@ begin
chkCompilerCompile.Visible := True; chkCompilerCompile.Visible := True;
chkCompilerBuild.Visible := True; chkCompilerBuild.Visible := True;
chkCompilerRun.Visible := True; chkCompilerRun.Visible := True;
edtCompiler.AnchorToNeighbour(akTop, 0, chkCompilerCompile); cobCompiler.AnchorToNeighbour(akTop, 0, chkCompilerCompile);
end end
else if Options is TPkgCompilerOptions then else if Options is TPkgCompilerOptions then
begin begin
@ -160,7 +167,7 @@ begin
chkCompilerCompile.Checked := TPkgCompilerOptions(Options).SkipCompiler; chkCompilerCompile.Checked := TPkgCompilerOptions(Options).SkipCompiler;
chkCompilerBuild.Visible := False; chkCompilerBuild.Visible := False;
chkCompilerRun.Visible := False; chkCompilerRun.Visible := False;
edtCompiler.AnchorToNeighbour(akTop, 0, chkCompilerCompile); cobCompiler.AnchorToNeighbour(akTop, 0, chkCompilerCompile);
end end
else else
begin begin
@ -168,7 +175,7 @@ begin
chkCompilerCompile.Visible := False; chkCompilerCompile.Visible := False;
chkCompilerBuild.Visible := False; chkCompilerBuild.Visible := False;
chkCompilerRun.Visible := False; chkCompilerRun.Visible := False;
edtCompiler.AnchorParallel(akTop, 0, lblCompiler.Parent); cobCompiler.AnchorParallel(akTop, 0, lblCompiler.Parent);
end; end;
ExecuteAfterCommandEdit.Text := Options.ExecuteAfter.Command; ExecuteAfterCommandEdit.Text := Options.ExecuteAfter.Command;
@ -220,7 +227,9 @@ begin
MakeCompileReasons(chkExecBeforeCompile, chkExecBeforeBuild, chkExecBeforeRun); MakeCompileReasons(chkExecBeforeCompile, chkExecBeforeBuild, chkExecBeforeRun);
end; end;
Options.CompilerPath := edtCompiler.Text; Options.CompilerPath := cobCompiler.Text;
EnvironmentOptions.CompilerFileHistory.Assign(cobCompiler.Items);
if Options is TProjectCompilerOptions then if Options is TProjectCompilerOptions then
begin begin
TProjectCompilerOptions(Options).CompileReasons := TProjectCompilerOptions(Options).CompileReasons :=