* fixed far problem is fpdebug

* tile/cascading with message window
  * grep fixes
This commit is contained in:
peter 1999-03-02 13:48:28 +00:00
parent c5e45b576b
commit 2f31c21e63
3 changed files with 134 additions and 27 deletions

View File

@ -532,7 +532,7 @@ end;
function TBreakpointCollection.GetGDB(index : longint) : PBreakpoint; function TBreakpointCollection.GetGDB(index : longint) : PBreakpoint;
function IsNum(P : PBreakpoint) : boolean; function IsNum(P : PBreakpoint) : boolean;{$ifndef FPC}far;{$endif}
begin begin
IsNum:=P^.GDBIndex=index; IsNum:=P^.GDBIndex=index;
end; end;
@ -546,7 +546,7 @@ end;
procedure TBreakpointCollection.ShowBreakpoints(W : PSourceWindow); procedure TBreakpointCollection.ShowBreakpoints(W : PSourceWindow);
procedure SetInSource(P : PBreakpoint); procedure SetInSource(P : PBreakpoint);{$ifndef FPC}far;{$endif}
begin begin
If assigned(P^.FileName) and (P^.FileName^=W^.Editor^.FileName) then If assigned(P^.FileName) and (P^.FileName^=W^.Editor^.FileName) then
W^.Editor^.SetLineBreakState(P^.Line,P^.state=bs_enabled); W^.Editor^.SetLineBreakState(P^.Line,P^.state=bs_enabled);
@ -558,7 +558,7 @@ end;
function TBreakpointCollection.GetType(typ : BreakpointType;Const s : String) : PBreakpoint; function TBreakpointCollection.GetType(typ : BreakpointType;Const s : String) : PBreakpoint;
function IsThis(P : PBreakpoint) : boolean; function IsThis(P : PBreakpoint) : boolean;{$ifndef FPC}far;{$endif}
begin begin
IsThis:=(P^.typ=typ) and (P^.Name^=S); IsThis:=(P^.typ=typ) and (P^.Name^=S);
end; end;
@ -571,7 +571,7 @@ function TBreakpointCollection.ToggleFileLine(Const FileName: String;LineNr : Lo
var PB : PBreakpoint; var PB : PBreakpoint;
function IsThere(P : PBreakpoint) : boolean; function IsThere(P : PBreakpoint) : boolean;{$ifndef FPC}far;{$endif}
begin begin
IsThere:=(P^.typ=bt_file_line) and (P^.FileName^=FileName) and (P^.Line=LineNr); IsThere:=(P^.typ=bt_file_line) and (P^.FileName^=FileName) and (P^.Line=LineNr);
end; end;
@ -678,11 +678,17 @@ end.
{ {
$Log$ $Log$
Revision 1.16 1999-03-01 15:41:52 peter Revision 1.17 1999-03-02 13:48:28 peter
* fixed far problem is fpdebug
* tile/cascading with message window
* grep fixes
Revision 1.16 1999/03/01 15:41:52 peter
+ Added dummy entries for functions not yet implemented + Added dummy entries for functions not yet implemented
* MenuBar didn't update itself automatically on command-set changes * MenuBar didn't update itself automatically on command-set changes
* Fixed Debugging/Profiling options dialog * Fixed Debugging/Profiling options dialog
* TCodeEditor converts spaces to tabs at save only if efUseTabChars is set * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
set
* efBackSpaceUnindents works correctly * efBackSpaceUnindents works correctly
+ 'Messages' window implemented + 'Messages' window implemented
+ Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros

View File

@ -17,7 +17,7 @@ unit fpide;
interface interface
uses uses
Drivers,Views,App,Gadgets,MsgBox, Objects,Drivers,Views,App,Gadgets,MsgBox,
{$ifdef EDITORS}Editors,{$else}WEditor,{$endif} {$ifdef EDITORS}Editors,{$else}WEditor,{$endif}
Comphook, Comphook,
FPViews,FPSymbol; FPViews,FPSymbol;
@ -33,6 +33,7 @@ type
function OpenSearch(FileName: string) : boolean; function OpenSearch(FileName: string) : boolean;
procedure Idle; virtual; procedure Idle; virtual;
procedure HandleEvent(var Event: TEvent); virtual; procedure HandleEvent(var Event: TEvent); virtual;
procedure GetTileRect(var R: TRect); virtual;
function GetPalette: PPalette; virtual; function GetPalette: PPalette; virtual;
procedure DosShell; virtual; procedure DosShell; virtual;
destructor Done; virtual; destructor Done; virtual;
@ -121,7 +122,7 @@ uses
linux, linux,
{$endif} {$endif}
Video,Mouse,Keyboard, Video,Mouse,Keyboard,
Dos,Objects,Memory,Menus,Dialogs,StdDlg,ColorSel,Commands,HelpCtx, Dos,Memory,Menus,Dialogs,StdDlg,ColorSel,Commands,HelpCtx,
AsciiTab, AsciiTab,
Systems,BrowCol, Systems,BrowCol,
WUtils,WHelp,WHlpView,WINI,WViews, WUtils,WHelp,WHlpView,WINI,WViews,
@ -458,6 +459,15 @@ begin
end; end;
procedure TIDEApp.GetTileRect(var R: TRect);
begin
Desktop^.GetExtent(R);
{ Leave the messages window in the bottom }
if assigned(MessagesWindow) then
R.B.Y:=MessagesWindow^.Origin.Y;
end;
{**************************************************************************** {****************************************************************************
Switch Screens Switch Screens
****************************************************************************} ****************************************************************************}
@ -706,11 +716,17 @@ end;
END. END.
{ {
$Log$ $Log$
Revision 1.20 1999-03-01 15:41:54 peter Revision 1.21 1999-03-02 13:48:29 peter
* fixed far problem is fpdebug
* tile/cascading with message window
* grep fixes
Revision 1.20 1999/03/01 15:41:54 peter
+ Added dummy entries for functions not yet implemented + Added dummy entries for functions not yet implemented
* MenuBar didn't update itself automatically on command-set changes * MenuBar didn't update itself automatically on command-set changes
* Fixed Debugging/Profiling options dialog * Fixed Debugging/Profiling options dialog
* TCodeEditor converts spaces to tabs at save only if efUseTabChars is set * TCodeEditor converts spaces to tabs at save only if efUseTabChars is
set
* efBackSpaceUnindents works correctly * efBackSpaceUnindents works correctly
+ 'Messages' window implemented + 'Messages' window implemented
+ Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros + Added '$CAP MSG()' and '$CAP EDIT' to available tool-macros

View File

@ -14,13 +14,23 @@
**********************************************************************} **********************************************************************}
procedure TIDEApp.DoAsciiTable; procedure TIDEApp.Messages;
var
P: PAsciiChart;
begin begin
P := New(PAsciiChart, Init); if MessagesWindow=nil then
P^.HelpCtx := hcAsciiTable; Desktop^.Insert(New(PMessagesWindow, Init))
InsertWindow(P); else
MessagesWindow^.Focus;
end;
procedure TIDEApp.DoAsciiTable;
begin
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), AddToolMessage(ModuleName,Copy(Line,p+1,255),LineNb,1);
ModuleName,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