mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 13:27:43 +02:00
MG: added Run Parameter Options - not enabled yet
git-svn-id: trunk@390 -
This commit is contained in:
parent
4d2da430b7
commit
311b264796
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -123,6 +123,7 @@ ide/newprojectdlg.pp svneol=native#text/pascal
|
|||||||
ide/project.pp svneol=native#text/pascal
|
ide/project.pp svneol=native#text/pascal
|
||||||
ide/projectopts.lrs svneol=native#text/pascal
|
ide/projectopts.lrs svneol=native#text/pascal
|
||||||
ide/projectopts.pp svneol=native#text/pascal
|
ide/projectopts.pp svneol=native#text/pascal
|
||||||
|
ide/runparamsopts.pas svneol=native#text/pascal
|
||||||
ide/splash.pp svneol=native#text/pascal
|
ide/splash.pp svneol=native#text/pascal
|
||||||
ide/testform.pp svneol=native#text/pascal
|
ide/testform.pp svneol=native#text/pascal
|
||||||
ide/transfermacros.pp svneol=native#text/pascal
|
ide/transfermacros.pp svneol=native#text/pascal
|
||||||
|
38
ide/main.pp
38
ide/main.pp
@ -39,7 +39,7 @@ uses
|
|||||||
IDEComp, AbstractFormEditor, FormEditor, CustomFormEditor, ObjectInspector,
|
IDEComp, AbstractFormEditor, FormEditor, CustomFormEditor, ObjectInspector,
|
||||||
PropEdits, ControlSelection, UnitEditor, CompilerOptions, EditorOptions,
|
PropEdits, ControlSelection, UnitEditor, CompilerOptions, EditorOptions,
|
||||||
EnvironmentOpts, TransferMacros, KeyMapping, ProjectOpts, IDEProcs, Process,
|
EnvironmentOpts, TransferMacros, KeyMapping, ProjectOpts, IDEProcs, Process,
|
||||||
UnitInfoDlg, Debugger;
|
UnitInfoDlg, Debugger, RunParamsOpts;
|
||||||
|
|
||||||
const
|
const
|
||||||
Version_String = '0.8 alpha';
|
Version_String = '0.8 alpha';
|
||||||
@ -112,6 +112,7 @@ type
|
|||||||
itmProjectRunToCursor: TMenuItem;
|
itmProjectRunToCursor: TMenuItem;
|
||||||
itmProjectStop: TMenuItem;
|
itmProjectStop: TMenuItem;
|
||||||
itmProjectCompilerSettings: TMenuItem;
|
itmProjectCompilerSettings: TMenuItem;
|
||||||
|
itmProjectRunParameters: TMenuItem;
|
||||||
|
|
||||||
itmEditUndo: TMenuItem;
|
itmEditUndo: TMenuItem;
|
||||||
itmEditRedo: TMenuItem;
|
itmEditRedo: TMenuItem;
|
||||||
@ -164,6 +165,7 @@ type
|
|||||||
Procedure mnuViewFormsClicked(Sender : TObject);
|
Procedure mnuViewFormsClicked(Sender : TObject);
|
||||||
|
|
||||||
procedure mnuToggleFormUnitClicked(Sender : TObject);
|
procedure mnuToggleFormUnitClicked(Sender : TObject);
|
||||||
|
|
||||||
procedure mnuNewProjectClicked(Sender : TObject);
|
procedure mnuNewProjectClicked(Sender : TObject);
|
||||||
procedure mnuOpenProjectClicked(Sender : TObject);
|
procedure mnuOpenProjectClicked(Sender : TObject);
|
||||||
procedure mnuSaveProjectClicked(Sender : TObject);
|
procedure mnuSaveProjectClicked(Sender : TObject);
|
||||||
@ -171,6 +173,8 @@ type
|
|||||||
procedure mnuAddToProjectClicked(Sender : TObject);
|
procedure mnuAddToProjectClicked(Sender : TObject);
|
||||||
procedure mnuRemoveFromProjectClicked(Sender : TObject);
|
procedure mnuRemoveFromProjectClicked(Sender : TObject);
|
||||||
procedure mnuViewProjectSourceClicked(Sender : TObject);
|
procedure mnuViewProjectSourceClicked(Sender : TObject);
|
||||||
|
procedure mnuProjectOptionsClicked(Sender : TObject);
|
||||||
|
|
||||||
procedure mnuBuildProjectClicked(Sender : TObject);
|
procedure mnuBuildProjectClicked(Sender : TObject);
|
||||||
procedure mnuRunProjectClicked(Sender : TObject);
|
procedure mnuRunProjectClicked(Sender : TObject);
|
||||||
procedure mnuPauseProjectClicked(Sender : TObject);
|
procedure mnuPauseProjectClicked(Sender : TObject);
|
||||||
@ -178,8 +182,8 @@ type
|
|||||||
procedure mnuStepOverProjectClicked(Sender : TObject);
|
procedure mnuStepOverProjectClicked(Sender : TObject);
|
||||||
procedure mnuRunToCursorProjectClicked(Sender : TObject);
|
procedure mnuRunToCursorProjectClicked(Sender : TObject);
|
||||||
procedure mnuStopProjectClicked(Sender : TObject);
|
procedure mnuStopProjectClicked(Sender : TObject);
|
||||||
|
procedure mnuRunParametersClicked(Sender : TObject);
|
||||||
procedure mnuProjectCompilerSettingsClicked(Sender : TObject);
|
procedure mnuProjectCompilerSettingsClicked(Sender : TObject);
|
||||||
procedure mnuProjectOptionsClicked(Sender : TObject);
|
|
||||||
|
|
||||||
procedure mnuViewCodeExplorerClick(Sender : TObject);
|
procedure mnuViewCodeExplorerClick(Sender : TObject);
|
||||||
procedure mnuViewMessagesClick(Sender : TObject);
|
procedure mnuViewMessagesClick(Sender : TObject);
|
||||||
@ -1159,7 +1163,13 @@ begin
|
|||||||
itmProjectCompilerSettings.Caption := 'Compiler Options...';
|
itmProjectCompilerSettings.Caption := 'Compiler Options...';
|
||||||
itmProjectCompilerSettings.OnClick := @mnuProjectCompilerSettingsClicked;
|
itmProjectCompilerSettings.OnClick := @mnuProjectCompilerSettingsClicked;
|
||||||
mnuRun.Add(itmProjectCompilerSettings);
|
mnuRun.Add(itmProjectCompilerSettings);
|
||||||
|
|
||||||
|
itmProjectRunParameters := TMenuItem.Create(Self);
|
||||||
|
itmProjectRunParameters.Name:='itmProjectRunParameters';
|
||||||
|
itmProjectRunParameters.Caption := 'Run Parameters ...';
|
||||||
|
itmProjectRunParameters.OnClick := @mnuRunParametersClicked;
|
||||||
|
mnuRun.Add(itmProjectRunParameters);
|
||||||
|
|
||||||
//--------------
|
//--------------
|
||||||
// Environment
|
// Environment
|
||||||
//--------------
|
//--------------
|
||||||
@ -1726,6 +1736,13 @@ begin
|
|||||||
DoOpenMainUnit(false);
|
DoOpenMainUnit(false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainIDE.mnuProjectOptionsClicked(Sender : TObject);
|
||||||
|
begin
|
||||||
|
if ShowProjectOptionsDialog(Project)=mrOk then begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
Procedure TMainIDE.mnuBuildProjectClicked(Sender : TObject);
|
Procedure TMainIDE.mnuBuildProjectClicked(Sender : TObject);
|
||||||
Begin
|
Begin
|
||||||
DoBuildProject;
|
DoBuildProject;
|
||||||
@ -1776,13 +1793,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.mnuProjectOptionsClicked(Sender : TObject);
|
procedure TMainIDE.mnuRunParametersClicked(Sender : TObject);
|
||||||
begin
|
begin
|
||||||
if ShowProjectOptionsDialog(Project)=mrOk then begin
|
if ShowRunParamsOptsDlg(Project.RunParameterOptions)=mrOk then begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TMainIDE.SaveDesktopSettings(
|
procedure TMainIDE.SaveDesktopSettings(
|
||||||
@ -3337,7 +3356,8 @@ writeln('[TMainIDE.DoRunProject] A');
|
|||||||
TheProcess.Execute;
|
TheProcess.Execute;
|
||||||
except
|
except
|
||||||
on e: Exception do begin
|
on e: Exception do begin
|
||||||
AText:='Error running program "'+ProgramFilename+'": '+e.Message;
|
AText:='Error running program'#13'"'+ProgramFilename+'"'#13
|
||||||
|
+'Error: '+e.Message;
|
||||||
MessageDlg(AText,mterror,[mbok], 0);
|
MessageDlg(AText,mterror,[mbok], 0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -4409,6 +4429,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.136 2001/11/06 12:20:30 lazarus
|
||||||
|
MG: added Run Parameter Options - not enabled yet
|
||||||
|
|
||||||
Revision 1.135 2001/11/05 18:18:13 lazarus
|
Revision 1.135 2001/11/05 18:18:13 lazarus
|
||||||
added popupmenu+arrows to notebooks, added target filename
|
added popupmenu+arrows to notebooks, added target filename
|
||||||
|
|
||||||
@ -9042,6 +9065,9 @@ end.
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.136 2001/11/06 12:20:30 lazarus
|
||||||
|
MG: added Run Parameter Options - not enabled yet
|
||||||
|
|
||||||
Revision 1.135 2001/11/05 18:18:13 lazarus
|
Revision 1.135 2001/11/05 18:18:13 lazarus
|
||||||
added popupmenu+arrows to notebooks, added target filename
|
added popupmenu+arrows to notebooks, added target filename
|
||||||
|
|
||||||
|
100
ide/project.pp
100
ide/project.pp
@ -32,7 +32,8 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LCLLinux, XMLCfg, LazConf, CompilerOptions, FileCtrl,
|
Classes, SysUtils, LCLLinux, XMLCfg, LazConf, CompilerOptions, FileCtrl,
|
||||||
CodeToolManager, CodeCache, Forms, Controls, EditorOptions, Dialogs, IDEProcs;
|
CodeToolManager, CodeCache, Forms, Controls, EditorOptions, Dialogs, IDEProcs,
|
||||||
|
RunParamsOpts;
|
||||||
|
|
||||||
type
|
type
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@ -192,12 +193,12 @@ type
|
|||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
TProjectType = // for a description see ProjectTypeDescriptions
|
TProjectType = // for a description see ProjectTypeDescriptions below
|
||||||
(ptApplication, ptProgram, ptCustomProgram);
|
(ptApplication, ptProgram, ptCustomProgram);
|
||||||
|
|
||||||
TProject = class(TObject)
|
TProject = class(TObject)
|
||||||
private
|
private
|
||||||
xmlcfg: TXMLConfig;
|
xmlconfig: TXMLConfig;
|
||||||
|
|
||||||
{ Variables }
|
{ Variables }
|
||||||
fActiveEditorIndexAtStart: integer;
|
fActiveEditorIndexAtStart: integer;
|
||||||
@ -214,6 +215,7 @@ type
|
|||||||
fTitle: String;
|
fTitle: String;
|
||||||
fUnitList: TList; // list of TUnitInfo
|
fUnitList: TList; // list of TUnitInfo
|
||||||
fUnitOutputDirectory: String;
|
fUnitOutputDirectory: String;
|
||||||
|
fRunParameterOptions: TRunParamsOptions;
|
||||||
|
|
||||||
function GetProjectInfoFile: string;
|
function GetProjectInfoFile: string;
|
||||||
function GetTargetFilename: string;
|
function GetTargetFilename: string;
|
||||||
@ -275,6 +277,7 @@ type
|
|||||||
property ProjectInfoFile: string
|
property ProjectInfoFile: string
|
||||||
read GetProjectInfoFile write SetProjectInfoFile;
|
read GetProjectInfoFile write SetProjectInfoFile;
|
||||||
property ProjectType: TProjectType read fProjectType write fProjectType;
|
property ProjectType: TProjectType read fProjectType write fProjectType;
|
||||||
|
property RunParameterOptions: TRunParamsOptions read fRunParameterOptions;
|
||||||
property TargetFileExt: String read fTargetFileExt write fTargetFileExt;
|
property TargetFileExt: String read fTargetFileExt write fTargetFileExt;
|
||||||
property TargetFilename: string read GetTargetFilename write SetTargetFilename;
|
property TargetFilename: string read GetTargetFilename write SetTargetFilename;
|
||||||
property Title: String read fTitle write fTitle;
|
property Title: String read fTitle write fTitle;
|
||||||
@ -293,7 +296,10 @@ const
|
|||||||
// ptApplication
|
// ptApplication
|
||||||
'Application'#13
|
'Application'#13
|
||||||
+'A graphical lcl/freepascal program. The program file is '
|
+'A graphical lcl/freepascal program. The program file is '
|
||||||
+'automatically maintained by lazarus.'
|
+'automatically maintained by lazarus.'#13
|
||||||
|
+#13
|
||||||
|
+'WARNING:'#13
|
||||||
|
+'Form editing is under development and should not be used.'
|
||||||
|
|
||||||
// ptProgram
|
// ptProgram
|
||||||
,'Program:'#13
|
,'Program:'#13
|
||||||
@ -862,7 +868,7 @@ begin
|
|||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
Assert(False, 'Trace:Project Class Created');
|
Assert(False, 'Trace:Project Class Created');
|
||||||
XMLCfg := nil;
|
xmlconfig := nil;
|
||||||
|
|
||||||
fProjectType:=TheProjectType;
|
fProjectType:=TheProjectType;
|
||||||
|
|
||||||
@ -874,6 +880,7 @@ begin
|
|||||||
fModified := false;
|
fModified := false;
|
||||||
fOutputDirectory := '.';
|
fOutputDirectory := '.';
|
||||||
fProjectFile := '';
|
fProjectFile := '';
|
||||||
|
fRunParameterOptions:=TRunParamsOptions.Create;
|
||||||
fTargetFileExt := DefaultTargetFileExt;
|
fTargetFileExt := DefaultTargetFileExt;
|
||||||
fTitle := '';
|
fTitle := '';
|
||||||
fUnitList := TList.Create; // list of TUnitInfo
|
fUnitList := TList.Create; // list of TUnitInfo
|
||||||
@ -928,8 +935,9 @@ destructor TProject.Destroy;
|
|||||||
begin
|
begin
|
||||||
Clear;
|
Clear;
|
||||||
fBookmarks.Free;
|
fBookmarks.Free;
|
||||||
if (XMLCfg <> nil) then XMLCfg.Free;
|
if (xmlconfig <> nil) then xmlconfig.Free;
|
||||||
fUnitList.Free;
|
fUnitList.Free;
|
||||||
|
fRunParameterOptions.Free;
|
||||||
fCompilerOptions.Free;
|
fCompilerOptions.Free;
|
||||||
|
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
@ -951,39 +959,42 @@ begin
|
|||||||
Result:=fOnFileBackup(confPath,true);
|
Result:=fOnFileBackup(confPath,true);
|
||||||
if Result=mrAbort then exit;
|
if Result=mrAbort then exit;
|
||||||
end;
|
end;
|
||||||
xmlcfg := TXMLConfig.Create(SetDirSeparators(confPath));
|
xmlconfig := TXMLConfig.Create(SetDirSeparators(confPath));
|
||||||
|
|
||||||
try
|
try
|
||||||
repeat
|
repeat
|
||||||
try
|
try
|
||||||
xmlcfg.SetValue('ProjectOptions/General/ProjectType/Value',
|
xmlconfig.SetValue('ProjectOptions/General/ProjectType/Value',
|
||||||
ProjectTypeNames[ProjectType]);
|
ProjectTypeNames[ProjectType]);
|
||||||
xmlcfg.SetValue('ProjectOptions/General/MainUnit/Value', MainUnit);
|
xmlconfig.SetValue('ProjectOptions/General/MainUnit/Value', MainUnit);
|
||||||
xmlcfg.SetValue('ProjectOptions/General/ActiveEditorIndexAtStart/Value'
|
xmlconfig.SetValue('ProjectOptions/General/ActiveEditorIndexAtStart/Value'
|
||||||
,ActiveEditorIndexAtStart);
|
,ActiveEditorIndexAtStart);
|
||||||
xmlcfg.SetValue('ProjectOptions/General/IconPath/Value', IconPath);
|
xmlconfig.SetValue('ProjectOptions/General/IconPath/Value', IconPath);
|
||||||
xmlcfg.SetValue('ProjectOptions/General/TargetFileExt/Value'
|
xmlconfig.SetValue('ProjectOptions/General/TargetFileExt/Value'
|
||||||
,TargetFileExt);
|
,TargetFileExt);
|
||||||
xmlcfg.SetValue('ProjectOptions/General/Title/Value', Title);
|
xmlconfig.SetValue('ProjectOptions/General/Title/Value', Title);
|
||||||
xmlcfg.SetValue('ProjectOptions/General/OutputDirectory/Value'
|
xmlconfig.SetValue('ProjectOptions/General/OutputDirectory/Value'
|
||||||
,OutputDirectory);
|
,OutputDirectory);
|
||||||
xmlcfg.SetValue('ProjectOptions/General/UnitOutputDirectory/Value'
|
xmlconfig.SetValue('ProjectOptions/General/UnitOutputDirectory/Value'
|
||||||
,UnitOutputDirectory);
|
,UnitOutputDirectory);
|
||||||
fBookmarks.SaveToXMLConfig(xmlcfg,'ProjectOptions/');
|
fBookmarks.SaveToXMLConfig(xmlconfig,'ProjectOptions/');
|
||||||
|
|
||||||
// Set options for each Unit
|
// Set options for each Unit
|
||||||
xmlcfg.SetValue('ProjectOptions/Units/Count',UnitCount);
|
xmlconfig.SetValue('ProjectOptions/Units/Count',UnitCount);
|
||||||
for i := 0 to UnitCount - 1 do begin
|
for i := 0 to UnitCount - 1 do begin
|
||||||
Units[i].SaveToXMLConfig(
|
Units[i].SaveToXMLConfig(
|
||||||
xmlcfg,'ProjectOptions/Units/Unit'+IntToStr(i)+'/');
|
xmlconfig,'ProjectOptions/Units/Unit'+IntToStr(i)+'/');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Save the compiler options
|
// Save the compiler options
|
||||||
CompilerOptions.XMLConfigFile := xmlcfg;
|
CompilerOptions.XMLConfigFile := xmlconfig;
|
||||||
CompilerOptions.ProjectFile := confPath;
|
CompilerOptions.ProjectFile := confPath;
|
||||||
CompilerOptions.SaveCompilerOptions(true);
|
CompilerOptions.SaveCompilerOptions(true);
|
||||||
|
|
||||||
|
// save the Run Parameter Options
|
||||||
|
RunParameterOptions.Save(xmlconfig,'ProjectOptions/');
|
||||||
|
|
||||||
xmlcfg.Flush;
|
xmlconfig.Flush;
|
||||||
Modified:=false;
|
Modified:=false;
|
||||||
except
|
except
|
||||||
ACaption:='Write error';
|
ACaption:='Write error';
|
||||||
@ -994,8 +1005,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
until Result<>mrRetry;
|
until Result<>mrRetry;
|
||||||
finally
|
finally
|
||||||
xmlcfg.Free;
|
xmlconfig.Free;
|
||||||
xmlcfg:=nil;
|
xmlconfig:=nil;
|
||||||
end;
|
end;
|
||||||
Result := mrOk;
|
Result := mrOk;
|
||||||
end;
|
end;
|
||||||
@ -1013,46 +1024,49 @@ begin
|
|||||||
|
|
||||||
ProjectInfoFile:=LPIFilename;
|
ProjectInfoFile:=LPIFilename;
|
||||||
try
|
try
|
||||||
xmlcfg := TXMLConfig.Create(ProjectInfoFile);
|
xmlconfig := TXMLConfig.Create(ProjectInfoFile);
|
||||||
except
|
except
|
||||||
MessageDlg('Unable to read the project info file "'+ProjectInfoFile+'".'
|
MessageDlg('Unable to read the project info file'#13'"'+ProjectInfoFile+'".'
|
||||||
,mtError,[mbOk],0);
|
,mtError,[mbOk],0);
|
||||||
Result:=mrCancel;
|
Result:=mrCancel;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
try
|
try
|
||||||
ProjectType := ProjectTypeNameToType(xmlcfg.GetValue(
|
ProjectType := ProjectTypeNameToType(xmlconfig.GetValue(
|
||||||
'ProjectOptions/General/ProjectType/Value', ''));
|
'ProjectOptions/General/ProjectType/Value', ''));
|
||||||
MainUnit := xmlcfg.GetValue('ProjectOptions/General/MainUnit/Value', -1);
|
MainUnit := xmlconfig.GetValue('ProjectOptions/General/MainUnit/Value', -1);
|
||||||
ActiveEditorIndexAtStart := xmlcfg.GetValue(
|
ActiveEditorIndexAtStart := xmlconfig.GetValue(
|
||||||
'ProjectOptions/General/ActiveEditorIndexAtStart/Value', -1);
|
'ProjectOptions/General/ActiveEditorIndexAtStart/Value', -1);
|
||||||
IconPath := xmlcfg.GetValue('ProjectOptions/General/IconPath/Value', './');
|
IconPath := xmlconfig.GetValue('ProjectOptions/General/IconPath/Value', './');
|
||||||
TargetFileExt := xmlcfg.GetValue(
|
TargetFileExt := xmlconfig.GetValue(
|
||||||
'ProjectOptions/General/TargetFileExt/Value', DefaultTargetFileExt);
|
'ProjectOptions/General/TargetFileExt/Value', DefaultTargetFileExt);
|
||||||
Title := xmlcfg.GetValue('ProjectOptions/General/Title/Value', '');
|
Title := xmlconfig.GetValue('ProjectOptions/General/Title/Value', '');
|
||||||
OutputDirectory := xmlcfg.GetValue(
|
OutputDirectory := xmlconfig.GetValue(
|
||||||
'ProjectOptions/General/OutputDirectory/Value', '.');
|
'ProjectOptions/General/OutputDirectory/Value', '.');
|
||||||
UnitOutputDirectory := xmlcfg.GetValue(
|
UnitOutputDirectory := xmlconfig.GetValue(
|
||||||
'ProjectOptions/General/UnitOutputDirectory/Value', '.');
|
'ProjectOptions/General/UnitOutputDirectory/Value', '.');
|
||||||
fBookmarks.LoadFromXMLConfig(xmlcfg,'ProjectOptions/');
|
fBookmarks.LoadFromXMLConfig(xmlconfig,'ProjectOptions/');
|
||||||
|
|
||||||
NewUnitCount:=xmlcfg.GetValue('ProjectOptions/Units/Count',0);
|
NewUnitCount:=xmlconfig.GetValue('ProjectOptions/Units/Count',0);
|
||||||
for i := 0 to NewUnitCount - 1 do begin
|
for i := 0 to NewUnitCount - 1 do begin
|
||||||
NewUnitInfo:=TUnitInfo.Create(nil);
|
NewUnitInfo:=TUnitInfo.Create(nil);
|
||||||
AddUnit(NewUnitInfo,false);
|
AddUnit(NewUnitInfo,false);
|
||||||
NewUnitInfo.LoadFromXMLConfig(
|
NewUnitInfo.LoadFromXMLConfig(
|
||||||
xmlcfg,'ProjectOptions/Units/Unit'+IntToStr(i)+'/');
|
xmlconfig,'ProjectOptions/Units/Unit'+IntToStr(i)+'/');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Load the compiler options
|
// Load the compiler options
|
||||||
CompilerOptions.XMLConfigFile := xmlcfg;
|
CompilerOptions.XMLConfigFile := xmlconfig;
|
||||||
CompilerOptions.ProjectFile := ProjectFile;
|
CompilerOptions.ProjectFile := ProjectFile;
|
||||||
CompilerOptions.LoadCompilerOptions(true);
|
CompilerOptions.LoadCompilerOptions(true);
|
||||||
|
|
||||||
|
// load the Run Parameter Options
|
||||||
|
RunParameterOptions.Load(xmlconfig,'ProjectOptions/');
|
||||||
|
|
||||||
finally
|
finally
|
||||||
xmlcfg.Free;
|
xmlconfig.Free;
|
||||||
xmlcfg:=nil;
|
xmlconfig:=nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Result := mrOk;
|
Result := mrOk;
|
||||||
@ -1123,11 +1137,13 @@ end;
|
|||||||
procedure TProject.Clear;
|
procedure TProject.Clear;
|
||||||
var i:integer;
|
var i:integer;
|
||||||
begin
|
begin
|
||||||
if XMLCfg<>nil then XMLCfg.Free;
|
if xmlconfig<>nil then xmlconfig.Free;
|
||||||
XMLCfg:=nil;
|
xmlconfig:=nil;
|
||||||
|
|
||||||
for i:=0 to UnitCount-1 do Units[i].Free;
|
for i:=0 to UnitCount-1 do Units[i].Free;
|
||||||
fUnitList.Clear;
|
fUnitList.Clear;
|
||||||
|
|
||||||
|
fRunParameterOptions.Clear;
|
||||||
|
|
||||||
fActiveEditorIndexAtStart := -1;
|
fActiveEditorIndexAtStart := -1;
|
||||||
fBookmarks.Clear;
|
fBookmarks.Clear;
|
||||||
@ -1469,7 +1485,6 @@ begin
|
|||||||
if (OldUnitName<>'') and (ProjectType in [ptProgram, ptApplication]) then
|
if (OldUnitName<>'') and (ProjectType in [ptProgram, ptApplication]) then
|
||||||
begin
|
begin
|
||||||
// rename unit in program uses section
|
// rename unit in program uses section
|
||||||
writeln('TProject.OnUnitNameChange A');
|
|
||||||
CodeToolBoss.RenameUsedUnit(Units[MainUnit].Source
|
CodeToolBoss.RenameUsedUnit(Units[MainUnit].Source
|
||||||
,OldUnitName,NewUnitName,'');
|
,OldUnitName,NewUnitName,'');
|
||||||
end;
|
end;
|
||||||
@ -1489,6 +1504,9 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.35 2001/11/06 12:20:33 lazarus
|
||||||
|
MG: added Run Parameter Options - not enabled yet
|
||||||
|
|
||||||
Revision 1.34 2001/11/05 18:18:18 lazarus
|
Revision 1.34 2001/11/05 18:18:18 lazarus
|
||||||
added popupmenu+arrows to notebooks, added target filename
|
added popupmenu+arrows to notebooks, added target filename
|
||||||
|
|
||||||
|
@ -109,8 +109,6 @@ begin
|
|||||||
SetupFormsPage;
|
SetupFormsPage;
|
||||||
SetupApplicationPage;
|
SetupApplicationPage;
|
||||||
|
|
||||||
NoteBook.Show;
|
|
||||||
|
|
||||||
CancelButton:=TButton.Create(Self);
|
CancelButton:=TButton.Create(Self);
|
||||||
with CancelButton do begin
|
with CancelButton do begin
|
||||||
Name:='CancelButton';
|
Name:='CancelButton';
|
||||||
|
543
ide/runparamsopts.pas
Normal file
543
ide/runparamsopts.pas
Normal file
@ -0,0 +1,543 @@
|
|||||||
|
{
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
Author: Mattias Gaertner
|
||||||
|
|
||||||
|
Abstract:
|
||||||
|
Run Parameters Options (TRunParamsOptions)
|
||||||
|
and Dialog for them (TRunParamsOptsDlg)
|
||||||
|
|
||||||
|
Run Parameters are project specific options for the debugger like
|
||||||
|
command line parameters and working directory.
|
||||||
|
|
||||||
|
The options saved in a TRunParamsOptions are stored in the project info file
|
||||||
|
(.lpi) together with the rest of the project.
|
||||||
|
|
||||||
|
The dialog will be activated by main.pp with the function
|
||||||
|
ShowRunParamsOptsDlg (see below) when the user clicks on the
|
||||||
|
menu->Run->Run Parameters.
|
||||||
|
}
|
||||||
|
unit RunParamsOpts;
|
||||||
|
|
||||||
|
{$mode objfpc}
|
||||||
|
{$H+}
|
||||||
|
|
||||||
|
{$I ide.inc}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
{$IFDEF IDE_MEM_CHECK}
|
||||||
|
MemCheck,
|
||||||
|
{$ENDIF}
|
||||||
|
Classes, SysUtils, Controls, Forms, Buttons, StdCtrls, ComCtrls, Dialogs,
|
||||||
|
ExtCtrls, LResources, XMLCfg;
|
||||||
|
|
||||||
|
{ The xml format version:
|
||||||
|
When the format changes (new values, changed formats) we can distinguish old
|
||||||
|
files and are able to convert them.
|
||||||
|
}
|
||||||
|
const RunParamsOptionsVersion = '1.0';
|
||||||
|
|
||||||
|
type
|
||||||
|
{
|
||||||
|
the storage object for run parameters
|
||||||
|
}
|
||||||
|
TRunParamsOptions = class
|
||||||
|
private
|
||||||
|
// local options
|
||||||
|
fHostApplicationFilename: string;
|
||||||
|
fCmdLineParams: string;
|
||||||
|
fUseLaunchingApplication: boolean;
|
||||||
|
fLaunchingApplicationPathPlusParams: string;
|
||||||
|
fWorkingDirectory: string;
|
||||||
|
fDisplay: string;
|
||||||
|
|
||||||
|
// environment options
|
||||||
|
fUserOverrides: TStringList;
|
||||||
|
fIncludeSystemVariables: boolean;
|
||||||
|
public
|
||||||
|
constructor Create;
|
||||||
|
destructor Destroy; override;
|
||||||
|
procedure Clear;
|
||||||
|
function Load(XMLConfig: TXMLConfig; const Path: string): TModalResult;
|
||||||
|
function Save(XMLConfig: TXMLConfig; const Path: string): TModalResult;
|
||||||
|
|
||||||
|
// local options
|
||||||
|
property HostApplicationFilename: string
|
||||||
|
read fHostApplicationFilename write fHostApplicationFilename;
|
||||||
|
property CmdLineParams: string read fCmdLineParams write fCmdLineParams;
|
||||||
|
property UseLaunchingApplication: boolean
|
||||||
|
read fUseLaunchingApplication write fUseLaunchingApplication;
|
||||||
|
property LaunchingApplicationPathPlusParams: string
|
||||||
|
read fLaunchingApplicationPathPlusParams
|
||||||
|
write fLaunchingApplicationPathPlusParams;
|
||||||
|
property WorkingDirectory: string
|
||||||
|
read fWorkingDirectory write fWorkingDirectory;
|
||||||
|
property Display: string read fDisplay write fDisplay;
|
||||||
|
|
||||||
|
// environment options
|
||||||
|
property UserOverrides: TStringList read fUserOverrides;
|
||||||
|
property IncludeSystemVariables: boolean
|
||||||
|
read fIncludeSystemVariables write fIncludeSystemVariables;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{
|
||||||
|
TRunParamsOptsDlg is the form of the run parameters options dialog
|
||||||
|
}
|
||||||
|
TRunParamsOptsDlg = class(TForm)
|
||||||
|
Notebook: TNotebook;
|
||||||
|
HostApplicationGroupBox: TGroupBox;
|
||||||
|
HostApplicationEdit: TEdit;
|
||||||
|
HostApplicationBrowseBtn: TBitBtn;
|
||||||
|
CmdLineParametersGroupBox: TGroupBox;
|
||||||
|
CmdLineParametersEdit: TEdit;
|
||||||
|
UseLaunchingApplicationBevel: TBevel;
|
||||||
|
UseLaunchingApplicationCheckBox: TCheckBox;
|
||||||
|
UseLaunchingApplicationEdit: TEdit;
|
||||||
|
WorkingDirectoryGroupBox: TGroupBox;
|
||||||
|
WorkingDirectoryEdit: TEdit;
|
||||||
|
WorkingDirectoryBtn: TBitBtn;
|
||||||
|
DisplayGroupBox: TGroupBox;
|
||||||
|
DisplayEdit: TEdit;
|
||||||
|
SystemVariablesGroupBox: TGroupBox;
|
||||||
|
UserOverridesGroupBox: TGroupBox;
|
||||||
|
IncludeSystemVariablesCheckBox: TCheckBox;
|
||||||
|
OkButton: TButton;
|
||||||
|
CancelButton: TButton;
|
||||||
|
procedure OkButtonClick(Sender: TObject);
|
||||||
|
procedure CancelButtonClick(Sender: TObject);
|
||||||
|
private
|
||||||
|
fOptions: TRunParamsOptions;
|
||||||
|
procedure SetupNotebook;
|
||||||
|
procedure SetupLocalPage;
|
||||||
|
procedure SetupEnvironmentPage;
|
||||||
|
procedure SetOptions(NewOptions: TRunParamsOptions);
|
||||||
|
procedure SaveToOptions;
|
||||||
|
public
|
||||||
|
constructor Create(AnOwner: TComponent); override;
|
||||||
|
property Options: TRunParamsOptions read fOptions write SetOptions;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function ShowRunParamsOptsDlg(RunParamsOptions: TRunParamsOptions):TModalResult;
|
||||||
|
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
function ShowRunParamsOptsDlg(RunParamsOptions: TRunParamsOptions):TModalResult;
|
||||||
|
var
|
||||||
|
RunParamsOptsForm: TRunParamsOptsDlg;
|
||||||
|
begin
|
||||||
|
Result:=mrCancel;
|
||||||
|
RunParamsOptsForm:=TRunParamsOptsDlg.Create(Application);
|
||||||
|
try
|
||||||
|
RunParamsOptsForm.Options:=RunParamsOptions;
|
||||||
|
Result:=RunParamsOptsForm.ShowModal;
|
||||||
|
finally
|
||||||
|
RunParamsOptsForm.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{ TRunParamsOptions }
|
||||||
|
|
||||||
|
constructor TRunParamsOptions.Create;
|
||||||
|
begin
|
||||||
|
inherited Create;
|
||||||
|
fUserOverrides:=TStringList.Create;
|
||||||
|
Clear;
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TRunParamsOptions.Destroy;
|
||||||
|
begin
|
||||||
|
fUserOverrides.Free;
|
||||||
|
inherited Destroy;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TRunParamsOptions.Clear;
|
||||||
|
begin
|
||||||
|
// local options
|
||||||
|
fHostApplicationFilename:='';
|
||||||
|
fCmdLineParams:='';
|
||||||
|
fUseLaunchingApplication:=false;
|
||||||
|
fLaunchingApplicationPathPlusParams:='';
|
||||||
|
fWorkingDirectory:='';
|
||||||
|
fDisplay:=':0';
|
||||||
|
|
||||||
|
// environment options
|
||||||
|
fUserOverrides.Clear;
|
||||||
|
fIncludeSystemVariables:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TRunParamsOptions.Load(XMLConfig: TXMLConfig;
|
||||||
|
const Path: string): TModalResult;
|
||||||
|
|
||||||
|
procedure LoadUserOverrides(const APath: string);
|
||||||
|
var i, Cnt: integer;
|
||||||
|
begin
|
||||||
|
fUserOverrides.Clear;
|
||||||
|
Cnt:=XMLConfig.GetValue(APath+'/Count',0);
|
||||||
|
for i:=0 to Cnt-1 do begin
|
||||||
|
fUserOverrides.Values[XMLConfig.GetValue(
|
||||||
|
APath+'/Variable'+IntToStr(i)+'/Name','')]:=
|
||||||
|
XMLConfig.GetValue(APath+'/Variable'+IntToStr(i)+'/Value','');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
// local options
|
||||||
|
fHostApplicationFilename:=XMLConfig.GetValue(
|
||||||
|
Path+'RunParams/local/HostApplicationFilename/Value',
|
||||||
|
fHostApplicationFilename);
|
||||||
|
fCmdLineParams:=XMLConfig.GetValue(
|
||||||
|
Path+'RunParams/local/CommandLineParams/Value',
|
||||||
|
fCmdLineParams);
|
||||||
|
fUseLaunchingApplication:=XMLConfig.GetValue(
|
||||||
|
Path+'RunParams/local/LaunchingApplication/Use',
|
||||||
|
fUseLaunchingApplication);
|
||||||
|
fLaunchingApplicationPathPlusParams:=XMLConfig.GetValue(
|
||||||
|
Path+'RunParams/local/LaunchingApplication/PathPlusParams',
|
||||||
|
fLaunchingApplicationPathPlusParams);
|
||||||
|
fWorkingDirectory:=XMLConfig.GetValue(
|
||||||
|
Path+'RunParams/local/WorkingDirectory/Value',
|
||||||
|
fWorkingDirectory);
|
||||||
|
fDisplay:=XMLConfig.GetValue(
|
||||||
|
Path+'RunParams/local/Display/Value',
|
||||||
|
fDisplay);
|
||||||
|
|
||||||
|
// environment options
|
||||||
|
LoadUserOverrides(Path+'RunParams/environment/UserOverrides/');
|
||||||
|
fIncludeSystemVariables:=XMLConfig.GetValue(
|
||||||
|
Path+'RunParams/environment/IncludeSystemVariables/Value',
|
||||||
|
fIncludeSystemVariables);
|
||||||
|
|
||||||
|
Result:=mrOk;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TRunParamsOptions.Save(XMLConfig: TXMLConfig;
|
||||||
|
const Path: string): TModalResult;
|
||||||
|
|
||||||
|
procedure SaveUserOverrides(const APath: string);
|
||||||
|
var i: integer;
|
||||||
|
begin
|
||||||
|
XMLConfig.SetValue(APath+'/Count',fUserOverrides.Count);
|
||||||
|
for i:=0 to fUserOverrides.Count-1 do begin
|
||||||
|
XMLConfig.SetValue(APath+'/Variable'+IntToStr(i)+'/Name',
|
||||||
|
fUserOverrides.Names[i]);
|
||||||
|
XMLConfig.SetValue(APath+'/Variable'+IntToStr(i)+'/Value',
|
||||||
|
fUserOverrides.Values[fUserOverrides.Names[i]]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
// save a format version to distinguish old formats
|
||||||
|
XMLConfig.SetValue(Path+'RunParams/local/FormatVersion/Value',
|
||||||
|
RunParamsOptionsVersion);
|
||||||
|
|
||||||
|
// local options
|
||||||
|
XMLConfig.SetValue(Path+'RunParams/local/HostApplicationFilename/Value',
|
||||||
|
fHostApplicationFilename);
|
||||||
|
XMLConfig.SetValue(Path+'RunParams/local/CommandLineParams/Value',
|
||||||
|
fCmdLineParams);
|
||||||
|
XMLConfig.SetValue(Path+'RunParams/local/LaunchingApplication/Use',
|
||||||
|
fUseLaunchingApplication);
|
||||||
|
XMLConfig.SetValue(Path+'RunParams/local/LaunchingApplication/PathPlusParams',
|
||||||
|
fLaunchingApplicationPathPlusParams);
|
||||||
|
XMLConfig.SetValue(Path+'RunParams/local/WorkingDirectory/Value',
|
||||||
|
fWorkingDirectory);
|
||||||
|
XMLConfig.SetValue(Path+'RunParams/local/Display/Value',
|
||||||
|
fDisplay);
|
||||||
|
|
||||||
|
// environment options
|
||||||
|
SaveUserOverrides(Path+'RunParams/environment/UserOverrides/');
|
||||||
|
XMLConfig.SetValue(Path+'RunParams/environment/IncludeSystemVariables/Value',
|
||||||
|
fIncludeSystemVariables);
|
||||||
|
|
||||||
|
Result:=mrOk;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ TRunParamsOptsDlg }
|
||||||
|
|
||||||
|
constructor TRunParamsOptsDlg.Create(AnOwner: TComponent);
|
||||||
|
begin
|
||||||
|
inherited Create(AnOwner);
|
||||||
|
if LazarusResources.Find(ClassName)=nil then begin
|
||||||
|
|
||||||
|
Caption:='Run parameters';
|
||||||
|
SetBounds((Screen.Width-500) div 2,(Screen.Height-450) div 2,500,450);
|
||||||
|
|
||||||
|
SetupNotebook;
|
||||||
|
|
||||||
|
OkButton:=TButton.Create(Self);
|
||||||
|
with OkButton do begin
|
||||||
|
Name:='OkButton';
|
||||||
|
Parent:=Self;
|
||||||
|
SetBounds(270,Self.ClientHeight-40,100,25);
|
||||||
|
Caption:='Ok';
|
||||||
|
OnClick:=@OkButtonClick;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
CancelButton:=TButton.Create(Self);
|
||||||
|
with CancelButton do begin
|
||||||
|
Name:='CancelButton';
|
||||||
|
Parent:=Self;
|
||||||
|
SetBounds(390,OkButton.Top,100,25);
|
||||||
|
Caption:='Cancel';
|
||||||
|
OnClick:=@CancelButtonClick;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TRunParamsOptsDlg.SetupNotebook;
|
||||||
|
// create the notebook
|
||||||
|
begin
|
||||||
|
Notebook:=TNotebook.Create(Self);
|
||||||
|
with Notebook do begin
|
||||||
|
Name:='Notebook';
|
||||||
|
Parent:=Self;
|
||||||
|
SetBounds(0,0,Self.ClientWidth,Self.ClientHeight-50);
|
||||||
|
Pages[0]:='Local';
|
||||||
|
Pages.Add('Environment');
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
SetupLocalPage;
|
||||||
|
SetupEnvironmentPage;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TRunParamsOptsDlg.SetupLocalPage;
|
||||||
|
var w: integer;
|
||||||
|
begin
|
||||||
|
w:=Self.ClientWidth-15;
|
||||||
|
|
||||||
|
HostApplicationGroupBox:=TGroupBox.Create(Self);
|
||||||
|
with HostApplicationGroupBox do begin
|
||||||
|
Name:='HostApplicationGroupBox';
|
||||||
|
Parent:=NoteBook.Page[0];
|
||||||
|
SetBounds(5,5,w,60);
|
||||||
|
Caption:='Host application';
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
HostApplicationEdit:=TEdit.Create(Self);
|
||||||
|
with HostApplicationEdit do begin
|
||||||
|
Name:='HostApplicationEdit';
|
||||||
|
Parent:=HostApplicationGroupBox;
|
||||||
|
SetBounds(5,5,w-10-35,25);
|
||||||
|
Caption:='';
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
HostApplicationBrowseBtn:=TBitBtn.Create(Self);
|
||||||
|
with HostApplicationBrowseBtn do begin
|
||||||
|
Name:='HostApplicationBrowseBtn';
|
||||||
|
Parent:=HostApplicationGroupBox;
|
||||||
|
SetBounds(HostApplicationEdit.Left+HostApplicationEdit.Width+2,5,25,25);
|
||||||
|
Caption:='...';
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
CmdLineParametersGroupBox:=TGroupBox.Create(Self);
|
||||||
|
with CmdLineParametersGroupBox do begin
|
||||||
|
Name:='CmdLineParametersGroupBox';
|
||||||
|
Parent:=NoteBook.Page[0];
|
||||||
|
SetBounds(5,HostApplicationGroupBox.Top+HostApplicationGroupBox.Height+5,
|
||||||
|
w,60);
|
||||||
|
Caption:='Command line parameters (without application name)';
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
CmdLineParametersEdit:=TEdit.Create(Self);
|
||||||
|
with CmdLineParametersEdit do begin
|
||||||
|
Name:='CmdLineParametersEdit';
|
||||||
|
Parent:=CmdLineParametersGroupBox;
|
||||||
|
SetBounds(5,5,w-15,25);
|
||||||
|
Caption:='';
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
UseLaunchingApplicationBevel:=TBevel.Create(Self);
|
||||||
|
with UseLaunchingApplicationBevel do begin
|
||||||
|
Name:='UseLaunchingApplicationBevel';
|
||||||
|
Parent:=NoteBook.Page[0];
|
||||||
|
SetBounds(
|
||||||
|
5,CmdLineParametersGroupBox.Top+CmdLineParametersGroupBox.Height+10,w,60);
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
UseLaunchingApplicationCheckBox:=TCheckBox.Create(Self);
|
||||||
|
with UseLaunchingApplicationCheckBox do begin
|
||||||
|
Name:='UseLaunchingApplicationCheckBox';
|
||||||
|
Parent:=NoteBook.Page[0];
|
||||||
|
SetBounds(UseLaunchingApplicationBevel.Left+10,
|
||||||
|
UseLaunchingApplicationBevel.Top,100,25);
|
||||||
|
Caption:='Use launching application';
|
||||||
|
Checked:=false;
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
UseLaunchingApplicationEdit:=TEdit.Create(Self);
|
||||||
|
with UseLaunchingApplicationEdit do begin
|
||||||
|
Name:='UseLaunchingApplicationEdit';
|
||||||
|
Parent:=NoteBook.Page[0];
|
||||||
|
SetBounds(UseLaunchingApplicationBevel.Left+5,
|
||||||
|
UseLaunchingApplicationBevel.Top+25,w-15,25);
|
||||||
|
Caption:='';
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
WorkingDirectoryGroupBox:=TGroupBox.Create(Self);
|
||||||
|
with WorkingDirectoryGroupBox do begin
|
||||||
|
Name:='WorkingDirectoryGroupBox';
|
||||||
|
Parent:=NoteBook.Page[0];
|
||||||
|
SetBounds(5,UseLaunchingApplicationBevel.Top
|
||||||
|
+UseLaunchingApplicationBevel.Height+10,w,60);
|
||||||
|
Caption:='Working directory';
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
WorkingDirectoryEdit:=TEdit.Create(Self);
|
||||||
|
with WorkingDirectoryEdit do begin
|
||||||
|
Name:='WorkingDirectoryEdit';
|
||||||
|
Parent:=WorkingDirectoryGroupBox;
|
||||||
|
SetBounds(5,5,w-10-35,25);
|
||||||
|
Caption:='';
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
WorkingDirectoryBtn:=TBitBtn.Create(Self);
|
||||||
|
with WorkingDirectoryBtn do begin
|
||||||
|
Name:='WorkingDirectoryBtn';
|
||||||
|
Parent:=WorkingDirectoryGroupBox;
|
||||||
|
SetBounds(WorkingDirectoryEdit.Left+WorkingDirectoryEdit.Width+2,5,25,25);
|
||||||
|
Caption:='...';
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
DisplayGroupBox:=TGroupBox.Create(Self);
|
||||||
|
with DisplayGroupBox do begin
|
||||||
|
Name:='DisplayGroupBox';
|
||||||
|
Parent:=NoteBook.Page[0];
|
||||||
|
SetBounds(5,WorkingDirectoryGroupBox.Top+WorkingDirectoryGroupBox.Height+10,
|
||||||
|
w,60);
|
||||||
|
Caption:='Display (not for win32)';
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
DisplayEdit:=TEdit.Create(Self);
|
||||||
|
with DisplayEdit do begin
|
||||||
|
Name:='DisplayEdit';
|
||||||
|
Parent:=DisplayGroupBox;
|
||||||
|
SetBounds(5,5,w-15,25);
|
||||||
|
Caption:='';
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TRunParamsOptsDlg.SetupEnvironmentPage;
|
||||||
|
var w: integer;
|
||||||
|
begin
|
||||||
|
w:=Self.ClientWidth-15;
|
||||||
|
|
||||||
|
SystemVariablesGroupBox:=TGroupBox.Create(Self);
|
||||||
|
with SystemVariablesGroupBox do begin
|
||||||
|
Name:='SystemVariablesGroupBox';
|
||||||
|
Parent:=NoteBook.Page[1];
|
||||||
|
SetBounds(5,5,w,150);
|
||||||
|
Caption:='System variables';
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
UserOverridesGroupBox:=TGroupBox.Create(Self);
|
||||||
|
with UserOverridesGroupBox do begin
|
||||||
|
Name:='UserOverridesGroupBox';
|
||||||
|
Parent:=NoteBook.Page[1];
|
||||||
|
SetBounds(5,SystemVariablesGroupBox.Top+SystemVariablesGroupBox.Height+10,
|
||||||
|
w,150);
|
||||||
|
Caption:='User overrides';
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
IncludeSystemVariablesCheckBox:=TCheckBox.Create(Self);
|
||||||
|
with IncludeSystemVariablesCheckBox do begin
|
||||||
|
Name:='IncludeSystemVariablesCheckBox';
|
||||||
|
Parent:=NoteBook.Page[1];
|
||||||
|
SetBounds(5,UserOverridesGroupBox.Top+UserOverridesGroupBox.Height+10,w,25);
|
||||||
|
Caption:='Include system variables';
|
||||||
|
Checked:=false;
|
||||||
|
Enabled:=false;
|
||||||
|
Visible:=true;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TRunParamsOptsDlg.OkButtonClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
SaveToOptions;
|
||||||
|
ModalResult:=mrOk;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TRunParamsOptsDlg.CancelButtonClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
ModalResult:=mrCancel;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TRunParamsOptsDlg.SaveToOptions;
|
||||||
|
begin
|
||||||
|
// local
|
||||||
|
fOptions.HostApplicationFilename:=HostApplicationEdit.Text;
|
||||||
|
fOptions.CmdLineParams:=CmdLineParametersEdit.Text;
|
||||||
|
fOptions.UseLaunchingApplication:=UseLaunchingApplicationCheckBox.Checked;
|
||||||
|
fOptions.LaunchingApplicationPathPlusParams:=UseLaunchingApplicationEdit.Text;
|
||||||
|
fOptions.WorkingDirectory:=WorkingDirectoryEdit.Text;
|
||||||
|
fOptions.Display:=DisplayEdit.Text;
|
||||||
|
|
||||||
|
// environment
|
||||||
|
fOptions.IncludeSystemVariables:=IncludeSystemVariablesCheckBox.Checked;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TRunParamsOptsDlg.SetOptions(NewOptions: TRunParamsOptions);
|
||||||
|
begin
|
||||||
|
fOptions:=NewOptions;
|
||||||
|
|
||||||
|
// local
|
||||||
|
HostApplicationEdit.Text:=fOptions.HostApplicationFilename;
|
||||||
|
CmdLineParametersEdit.Text:=fOptions.CmdLineParams;
|
||||||
|
UseLaunchingApplicationCheckBox.Checked:=fOptions.UseLaunchingApplication;
|
||||||
|
UseLaunchingApplicationEdit.Text:=fOptions.LaunchingApplicationPathPlusParams;
|
||||||
|
WorkingDirectoryEdit.Text:=fOptions.WorkingDirectory;
|
||||||
|
DisplayEdit.Text:=fOptions.Display;
|
||||||
|
|
||||||
|
// environment
|
||||||
|
IncludeSystemVariablesCheckBox.Checked:=fOptions.IncludeSystemVariables;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user