|
@@ -14,13 +14,23 @@
|
|
|
|
|
|
**********************************************************************}
|
|
**********************************************************************}
|
|
|
|
|
|
|
|
+procedure TIDEApp.Messages;
|
|
|
|
+begin
|
|
|
|
+ if MessagesWindow=nil then
|
|
|
|
+ Desktop^.Insert(New(PMessagesWindow, Init))
|
|
|
|
+ else
|
|
|
|
+ MessagesWindow^.Focus;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TIDEApp.DoAsciiTable;
|
|
procedure TIDEApp.DoAsciiTable;
|
|
-var
|
|
|
|
- P: PAsciiChart;
|
|
|
|
begin
|
|
begin
|
|
- P := New(PAsciiChart, Init);
|
|
|
|
- P^.HelpCtx := hcAsciiTable;
|
|
|
|
- InsertWindow(P);
|
|
|
|
|
|
+ if ASCIIChart=nil then
|
|
|
|
+ begin
|
|
|
|
+ New(ASCIIChart, Init);
|
|
|
|
+ Desktop^.Insert(ASCIIChart);
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ ASCIIChart^.Focus;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
@@ -35,23 +45,88 @@ end;
|
|
|
|
|
|
procedure TIDEApp.ExecuteTool(Idx: integer);
|
|
procedure TIDEApp.ExecuteTool(Idx: integer);
|
|
var Title,ProgramPath,Params: string;
|
|
var Title,ProgramPath,Params: string;
|
|
- W: word;
|
|
|
|
|
|
+ W: PSourceWindow;
|
|
|
|
+ Wo: word;
|
|
Err: integer;
|
|
Err: integer;
|
|
|
|
+ CaptureFile: string;
|
|
|
|
+ ExecMode: TExecType;
|
|
begin
|
|
begin
|
|
if (Idx<1) or (Idx>GetToolCount) then Exit;
|
|
if (Idx<1) or (Idx>GetToolCount) then Exit;
|
|
- GetToolParams(Idx-1,Title,ProgramPath,Params,W);
|
|
|
|
|
|
+ GetToolParams(Idx-1,Title,ProgramPath,Params,Wo);
|
|
Err:=ParseToolParams(Params,false);
|
|
Err:=ParseToolParams(Params,false);
|
|
if Err=-1 then Exit;
|
|
if Err=-1 then Exit;
|
|
if Err<>0 then
|
|
if Err<>0 then
|
|
begin ErrorBox(^C'Error parsing tool params.',nil); Exit; end;
|
|
begin ErrorBox(^C'Error parsing tool params.',nil); Exit; end;
|
|
- DoExecute(ProgramPath,Params,false);
|
|
|
|
|
|
+ if CaptureToolTo<>capNone then
|
|
|
|
+ begin
|
|
|
|
+ CaptureFile:=ToolCaptureName;
|
|
|
|
+ ExecMode:=exNoSwap;
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ begin
|
|
|
|
+ CaptureFile:='';
|
|
|
|
+ ExecMode:=exNormal;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ EraseFile(CaptureFile);
|
|
|
|
+ EraseFile(FilterCaptureName);
|
|
|
|
+
|
|
|
|
+ if CaptureToolTo=capMessageWindow then
|
|
|
|
+ AddToolCommand(ProgramPath+' '+Params);
|
|
|
|
+
|
|
|
|
+ if CaptureToolTo<>capNone then
|
|
|
|
+ ShowMessage('Executing tool '+KillTilde(Title)+'...');
|
|
|
|
+
|
|
|
|
+ DoExecute(ProgramPath,Params,'',CaptureFile,ExecMode);
|
|
|
|
+
|
|
|
|
+ if CaptureToolTo<>capNone then
|
|
|
|
+ HideMessage;
|
|
|
|
+
|
|
|
|
+ if (DosError=0) and (DosExitCode=0) then
|
|
|
|
+ begin
|
|
|
|
+ if CaptureToolTo=capEditWindow then
|
|
|
|
+ begin
|
|
|
|
+ W:=OpenEditorWindow(nil,'',0,0);
|
|
|
|
+ if W<>nil then
|
|
|
|
+ if StartEditor(W^.Editor,CaptureFile)=false then
|
|
|
|
+ ErrorBox('Error reading output.',nil);
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ if ToolFilter<>'' then
|
|
|
|
+ begin
|
|
|
|
+ ShowMessage('Executing filter for '+KillTilde(Title)+'...');
|
|
|
|
+ DoExecute(ToolFilter,'',CaptureFile,FilterCaptureName,exNoSwap);
|
|
|
|
+ HideMessage;
|
|
|
|
+ if (DosError=0) and (DosExitCode=0) then
|
|
|
|
+ begin
|
|
|
|
+ if ExistsFile(FilterCaptureName)=false then
|
|
|
|
+ ErrorBox('Can''t find filtered output.',nil)
|
|
|
|
+ else
|
|
|
|
+ if ProcessMessageFile(FilterCaptureName)=false then
|
|
|
|
+ ErrorBox('Error processing filtered output.',nil);
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ if (DosError<>0) then
|
|
|
|
+ ErrorBox('Error executing filter '+KillTilde(GetToolName(Idx-1)),nil) else
|
|
|
|
+ if DosExitCode<>0 then
|
|
|
|
+ ErrorBox('Filter execution successful. Exit code '+IntToStr(DosExitCode),nil);
|
|
|
|
+ UpdateToolMessages;
|
|
|
|
+ if DosError=0 then
|
|
|
|
+ Messages;
|
|
|
|
+ end;
|
|
|
|
+ end else
|
|
if (DosError<>0) then
|
|
if (DosError<>0) then
|
|
ErrorBox('Error executing tool '+KillTilde(GetToolName(Idx-1)),nil) else
|
|
ErrorBox('Error executing tool '+KillTilde(GetToolName(Idx-1)),nil) else
|
|
if DosExitCode<>0 then
|
|
if DosExitCode<>0 then
|
|
- ErrorBox('Execution successful. Exit code '+IntToStr(DosExitCode),nil);
|
|
|
|
|
|
+ ErrorBox('Tool execution successful. Exit code '+IntToStr(DosExitCode),nil);
|
|
|
|
+{$ifndef DEBUG}
|
|
|
|
+ EraseFile(CaptureFile);
|
|
|
|
+ EraseFile(FilterCaptureName);
|
|
|
|
+{$endif}
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure TIDEApp.Grep;
|
|
|
|
|
|
+
|
|
|
|
+procedure TIDEApp.DoGrep;
|
|
Const
|
|
Const
|
|
GrepOutName = 'grep$$.out';
|
|
GrepOutName = 'grep$$.out';
|
|
GrepErrName = 'grep$$.err';
|
|
GrepErrName = 'grep$$.err';
|
|
@@ -63,11 +138,13 @@ var
|
|
s : string;
|
|
s : string;
|
|
p,lineNb : longint;
|
|
p,lineNb : longint;
|
|
error : word;
|
|
error : word;
|
|
|
|
+ showmsg : boolean;
|
|
searchword,
|
|
searchword,
|
|
GrepExe,GrepArgs,Line,ModuleName : String;
|
|
GrepExe,GrepArgs,Line,ModuleName : String;
|
|
GrepOut : text;
|
|
GrepOut : text;
|
|
Params : Array[0..4] of longint;
|
|
Params : Array[0..4] of longint;
|
|
begin
|
|
begin
|
|
|
|
+ showmsg:=false;
|
|
{ Find grep.exe }
|
|
{ Find grep.exe }
|
|
GrepExe:=GrepExeName;
|
|
GrepExe:=GrepExeName;
|
|
If not LocateExeFile(GrepExe) then
|
|
If not LocateExeFile(GrepExe) then
|
|
@@ -122,7 +199,7 @@ begin
|
|
GrepArgs:=IL2^.Data^;
|
|
GrepArgs:=IL2^.Data^;
|
|
ReplaceStr(GrepArgs,'$TEXT',SearchWord);
|
|
ReplaceStr(GrepArgs,'$TEXT',SearchWord);
|
|
{ Linux ? }
|
|
{ Linux ? }
|
|
- if not ExecuteRedir(GrepExe,GrepArgs,GrepOutName,GrepErrName) then
|
|
|
|
|
|
+ if not ExecuteRedir(GrepExe,GrepArgs,'',GrepOutName,GrepErrName) then
|
|
Begin
|
|
Begin
|
|
{ 2 as exit code just means that
|
|
{ 2 as exit code just means that
|
|
some file vwere not found ! }
|
|
some file vwere not found ! }
|
|
@@ -134,6 +211,7 @@ begin
|
|
end;
|
|
end;
|
|
End;
|
|
End;
|
|
{$I-}
|
|
{$I-}
|
|
|
|
+ showmsg:=true;
|
|
Assign(GrepOut,GrepOutName);
|
|
Assign(GrepOut,GrepOutName);
|
|
Reset(GrepOut);
|
|
Reset(GrepOut);
|
|
While not eof(GrepOut) do
|
|
While not eof(GrepOut) do
|
|
@@ -147,11 +225,8 @@ begin
|
|
p:=pos(':',Line);
|
|
p:=pos(':',Line);
|
|
val(copy(Line,1,p-1),lineNb,error);
|
|
val(copy(Line,1,p-1),lineNb,error);
|
|
if error=0 then
|
|
if error=0 then
|
|
- ProgramInfoWindow^.AddMessage(V_Normal,Copy(Line,p+1,255),
|
|
|
|
- ModuleName,LineNb,1);
|
|
|
|
|
|
+ AddToolMessage(ModuleName,Copy(Line,p+1,255),LineNb,1);
|
|
end;
|
|
end;
|
|
- ProgramInfoWindow^.Show;
|
|
|
|
- ProgramInfoWindow^.MakeFirst;
|
|
|
|
end;
|
|
end;
|
|
Close(GrepOut);
|
|
Close(GrepOut);
|
|
Erase(GrepOut);
|
|
Erase(GrepOut);
|
|
@@ -163,10 +238,20 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
Dispose(PGrepDialog, Done);
|
|
Dispose(PGrepDialog, Done);
|
|
|
|
+ UpdateToolMessages;
|
|
|
|
+ if showmsg then
|
|
|
|
+ Messages;
|
|
end;
|
|
end;
|
|
|
|
+
|
|
|
|
+
|
|
{
|
|
{
|
|
$Log$
|
|
$Log$
|
|
- Revision 1.10 1999-02-22 12:46:57 peter
|
|
|
|
|
|
+ Revision 1.11 1999-03-02 13:48:30 peter
|
|
|
|
+ * fixed far problem is fpdebug
|
|
|
|
+ * tile/cascading with message window
|
|
|
|
+ * grep fixes
|
|
|
|
+
|
|
|
|
+ Revision 1.10 1999/02/22 12:46:57 peter
|
|
* small fixes for linux and grep
|
|
* small fixes for linux and grep
|
|
|
|
|
|
Revision 1.9 1999/02/22 11:29:37 pierre
|
|
Revision 1.9 1999/02/22 11:29:37 pierre
|