MG: fixed compiler warnings and asking to create non existing files

git-svn-id: trunk@667 -
This commit is contained in:
lazarus 2002-02-06 08:58:29 +00:00
parent 5e00188a21
commit 90cf59a11f
6 changed files with 48 additions and 20 deletions

View File

@ -52,7 +52,7 @@ type
property DebugProcess: TProcess read FDbgProcess; property DebugProcess: TProcess read FDbgProcess;
property OutputLines: TStringList read FOutputLines; property OutputLines: TStringList read FOutputLines;
public public
constructor Create; override; constructor Create; {override; }
destructor Destroy; override; destructor Destroy; override;
procedure TestCmd(const ACommand: String); virtual;// For internal debugging purposes procedure TestCmd(const ACommand: String); virtual;// For internal debugging purposes
end; end;
@ -387,6 +387,9 @@ end;
end. end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.5 2002/02/06 08:58:29 lazarus
MG: fixed compiler warnings and asking to create non existing files
Revision 1.4 2002/02/05 23:16:48 lazarus Revision 1.4 2002/02/05 23:16:48 lazarus
MWE: * Updated tebugger MWE: * Updated tebugger
+ Added debugger to IDE + Added debugger to IDE

View File

@ -35,7 +35,7 @@ type
FDebugger: TObject; // reference to our debugger FDebugger: TObject; // reference to our debugger
FEnabled: Boolean; FEnabled: Boolean;
FExpression: String; FExpression: String;
FValue: String; //FValue: String;
FOnChange: TNotifyEvent; FOnChange: TNotifyEvent;
procedure SetEnabled(const AValue: Boolean); procedure SetEnabled(const AValue: Boolean);
protected protected
@ -147,6 +147,9 @@ end;
end. end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.7 2002/02/06 08:58:29 lazarus
MG: fixed compiler warnings and asking to create non existing files
Revision 1.6 2002/02/05 23:16:48 lazarus Revision 1.6 2002/02/05 23:16:48 lazarus
MWE: * Updated tebugger MWE: * Updated tebugger
+ Added debugger to IDE + Added debugger to IDE

View File

@ -102,7 +102,7 @@ type
procedure SetFileName(const AValue: String); virtual; procedure SetFileName(const AValue: String); virtual;
procedure SetState(const AValue: TDBGState); procedure SetState(const AValue: TDBGState);
public public
constructor Create; virtual; constructor Create; {virtual; Virtual constructor makes no sense}
destructor Destroy; override; destructor Destroy; override;
procedure Init; virtual; // Initializes the debugger procedure Init; virtual; // Initializes the debugger
@ -299,6 +299,9 @@ end;
end. end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.7 2002/02/06 08:58:29 lazarus
MG: fixed compiler warnings and asking to create non existing files
Revision 1.6 2002/02/05 23:16:48 lazarus Revision 1.6 2002/02/05 23:16:48 lazarus
MWE: * Updated tebugger MWE: * Updated tebugger
+ Added debugger to IDE + Added debugger to IDE

View File

@ -54,7 +54,7 @@ type
procedure SetFileName(const AValue: String); override; procedure SetFileName(const AValue: String); override;
function RequestCommand(const ACommand: TDBGCommand; const AParams: array of const): Boolean; override; function RequestCommand(const ACommand: TDBGCommand; const AParams: array of const): Boolean; override;
public public
constructor Create; override; constructor Create; {override;}
destructor Destroy; override; destructor Destroy; override;
procedure Init; override; // Initializes external debugger procedure Init; override; // Initializes external debugger
@ -168,7 +168,7 @@ var
loc: TDBGLocationRec; loc: TDBGLocationRec;
dState: TDBGState; dState: TDBGState;
StopAdress: Integer; StopAdress: Integer;
idx: Integer; //idx: Integer;
S: String; S: String;
begin begin
if State in [dsIdle, dsStop] if State in [dsIdle, dsStop]
@ -466,6 +466,7 @@ end;
function TGDBWatch.GetValid: Boolean; function TGDBWatch.GetValid: Boolean;
begin begin
Result:=false;
end; end;
procedure TGDBWatch.SetExpression(const AValue: String); procedure TGDBWatch.SetExpression(const AValue: String);
@ -484,6 +485,9 @@ end;
end. end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.5 2002/02/06 08:58:29 lazarus
MG: fixed compiler warnings and asking to create non existing files
Revision 1.4 2002/02/05 23:16:48 lazarus Revision 1.4 2002/02/05 23:16:48 lazarus
MWE: * Updated tebugger MWE: * Updated tebugger
+ Added debugger to IDE + Added debugger to IDE

View File

@ -342,7 +342,7 @@ type
function DoCloseEditorUnit(PageIndex:integer; function DoCloseEditorUnit(PageIndex:integer;
SaveFirst: boolean):TModalResult; SaveFirst: boolean):TModalResult;
function DoOpenEditorFile(const AFileName:string; function DoOpenEditorFile(const AFileName:string;
ProjectLoading:boolean):TModalResult; ProjectLoading, OnlyIfExists:boolean):TModalResult;
function DoOpenFileAtCursor(Sender: TObject):TModalResult; function DoOpenFileAtCursor(Sender: TObject):TModalResult;
function DoSaveAll: TModalResult; function DoSaveAll: TModalResult;
function DoOpenMainUnit(ProjectLoading: boolean): TModalResult; function DoOpenMainUnit(ProjectLoading: boolean): TModalResult;
@ -1677,7 +1677,7 @@ begin
AFilename:=ExpandFilename(OpenDialog.Files.Strings[i]); AFilename:=ExpandFilename(OpenDialog.Files.Strings[i]);
if i=0 then if i=0 then
EnvironmentOptions.LastOpenDialogDir:=ExtractFilePath(AFilename); EnvironmentOptions.LastOpenDialogDir:=ExtractFilePath(AFilename);
if DoOpenEditorFile(AFilename,false)=mrOk then begin if DoOpenEditorFile(AFilename,false,false)=mrOk then begin
EnvironmentOptions.AddToRecentOpenFiles(AFilename); EnvironmentOptions.AddToRecentOpenFiles(AFilename);
end; end;
end; end;
@ -1688,7 +1688,7 @@ begin
end; end;
end else if Sender is TMenuItem then begin end else if Sender is TMenuItem then begin
AFileName:=ExpandFilename(TMenuItem(Sender).Caption); AFileName:=ExpandFilename(TMenuItem(Sender).Caption);
if DoOpenEditorFile(AFilename,false)=mrOk then begin if DoOpenEditorFile(AFilename,false,false)=mrOk then begin
EnvironmentOptions.AddToRecentOpenFiles(AFilename); EnvironmentOptions.AddToRecentOpenFiles(AFilename);
SaveEnvironment; SaveEnvironment;
end; end;
@ -2819,7 +2819,7 @@ writeln('TMainIDE.DoCloseEditorUnit end');
end; end;
function TMainIDE.DoOpenEditorFile(const AFileName:string; function TMainIDE.DoOpenEditorFile(const AFileName:string;
ProjectLoading:boolean):TModalResult; ProjectLoading, OnlyIfExists:boolean):TModalResult;
var Ext,ACaption,AText:string; var Ext,ACaption,AText:string;
i,BookmarkID:integer; i,BookmarkID:integer;
ReOpen:boolean; ReOpen:boolean;
@ -2867,10 +2867,11 @@ CheckHeap(IntToStr(GetMem_Cnt));
mtError, [mbIgnore, mbAbort], 0); mtError, [mbIgnore, mbAbort], 0);
exit; exit;
end; end;
if MessageDlg('File not found', if (not OnlyIfExists)
and (MessageDlg('File not found',
'File "'+AFilename+'" not found.'#13 'File "'+AFilename+'" not found.'#13
+'Do you want to create it?'#13 +'Do you want to create it?'#13
,mtInformation,[mbYes,mbNo],0)=mrYes then ,mtInformation,[mbYes,mbNo],0)=mrYes) then
begin begin
// create new file // create new file
Ext:=lowercase(ExtractFileExt(AFilename)); Ext:=lowercase(ExtractFileExt(AFilename));
@ -2879,6 +2880,11 @@ CheckHeap(IntToStr(GetMem_Cnt));
else else
Result:=DoNewEditorUnit(nuEmpty,AFilename); Result:=DoNewEditorUnit(nuEmpty,AFilename);
exit; exit;
end else if OnlyIfExists then begin
MessageDlg('File not found','File "'+AFilename+'" not found.'#13,
mtInformation,[mbYes,mbNo],0);
// cancel loading file
exit;
end else begin end else begin
// cancel loading file // cancel loading file
exit; exit;
@ -3185,7 +3191,7 @@ Begin
if MainUnitIndex=i then if MainUnitIndex=i then
Result:=DoOpenMainUnit(false) Result:=DoOpenMainUnit(false)
else else
Result:=DoOpenEditorFile(AnUnitInfo.Filename,false); Result:=DoOpenEditorFile(AnUnitInfo.Filename,false,true);
if Result=mrAbort then exit; if Result=mrAbort then exit;
end; end;
end; end;
@ -3291,7 +3297,7 @@ begin
if FindPasFile(FName,SPath) then begin if FindPasFile(FName,SPath) then begin
result:=mrOk; result:=mrOk;
EnvironmentOptions.LastOpenDialogDir:=ExtractFilePath(FName); EnvironmentOptions.LastOpenDialogDir:=ExtractFilePath(FName);
if DoOpenEditorFile(FName,false)=mrOk then begin if DoOpenEditorFile(FName,false,false)=mrOk then begin
EnvironmentOptions.AddToRecentOpenFiles(FName); EnvironmentOptions.AddToRecentOpenFiles(FName);
SaveEnvironment; SaveEnvironment;
end; end;
@ -3623,7 +3629,7 @@ CheckHeap(IntToStr(GetMem_Cnt));
Ext:='.lpi'; Ext:='.lpi';
end; end;
if Ext<>'.lpi' then begin if Ext<>'.lpi' then begin
Result:=DoOpenEditorFile(AFilename,false); Result:=DoOpenEditorFile(AFilename,false,false);
exit; exit;
end; end;
if FileExists(AFilename) and (not FileIsText(AFilename)) then begin if FileExists(AFilename) and (not FileIsText(AFilename)) then begin
@ -3694,7 +3700,8 @@ CheckHeap(IntToStr(GetMem_Cnt));
if LowestEditorIndex>=0 then begin if LowestEditorIndex>=0 then begin
// reopen file // reopen file
//writeln('TMainIDE.DoOpenProjectFile C2 ',Project.Units[LowestUnitIndex].Filename); //writeln('TMainIDE.DoOpenProjectFile C2 ',Project.Units[LowestUnitIndex].Filename);
Result:=DoOpenEditorFile(Project.Units[LowestUnitIndex].Filename,true); Result:=DoOpenEditorFile(Project.Units[LowestUnitIndex].Filename,true,
true);
//writeln('TMainIDE.DoOpenProjectFile C3 ',Result=mrOk); //writeln('TMainIDE.DoOpenProjectFile C3 ',Result=mrOk);
if Result=mrAbort then begin if Result=mrAbort then begin
// mark all files, that are left to load as unloaded: // mark all files, that are left to load as unloaded:
@ -4267,7 +4274,7 @@ begin
if (Sender<>FDebugger) or (Sender=nil) then exit; if (Sender<>FDebugger) or (Sender=nil) then exit;
//TODO: Show assembler window if no source can be found. //TODO: Show assembler window if no source can be found.
if ALocation.SrcLine = -1 then Exit; if ALocation.SrcLine = -1 then Exit;
if DoOpenEditorFile(ALocation.SrcFile, false) <> mrOk then exit; if DoOpenEditorFile(ALocation.SrcFile,false,true) <> mrOk then exit;
ActiveSrcEdit:=SourceNoteBook.GetActiveSE; ActiveSrcEdit:=SourceNoteBook.GetActiveSE;
if ActiveSrcEdit=nil then exit; if ActiveSrcEdit=nil then exit;
with ActiveSrcEdit.EditorComponent do begin with ActiveSrcEdit.EditorComponent do begin
@ -4793,7 +4800,7 @@ begin
// open the file in the source editor // open the file in the source editor
Ext:=lowercase(ExtractFileExt(SearchedFilename)); Ext:=lowercase(ExtractFileExt(SearchedFilename));
if (Ext<>'.lfm') and (Ext<>'.lpi') then begin if (Ext<>'.lfm') and (Ext<>'.lpi') then begin
Result:=(DoOpenEditorFile(SearchedFilename,false)=mrOk); Result:=(DoOpenEditorFile(SearchedFilename,false,true)=mrOk);
if Result then begin if Result then begin
// set caret position // set caret position
SourceNotebook.AddJumpPointClicked(Self); SourceNotebook.AddJumpPointClicked(Self);
@ -5129,7 +5136,7 @@ begin
// open all sources in editor // open all sources in editor
for i:=0 to Manager.SourceChangeCache.BuffersToModifyCount-1 do begin for i:=0 to Manager.SourceChangeCache.BuffersToModifyCount-1 do begin
if DoOpenEditorFile(Manager.SourceChangeCache.BuffersToModify[i].Filename, if DoOpenEditorFile(Manager.SourceChangeCache.BuffersToModify[i].Filename,
false)<>mrOk then false,true)<>mrOk then
begin begin
Abort:=true; Abort:=true;
exit; exit;
@ -5193,7 +5200,7 @@ begin
end; end;
if NewSource<>ActiveUnitInfo.Source then begin if NewSource<>ActiveUnitInfo.Source then begin
// jump to other file -> open it // jump to other file -> open it
Result:=DoOpenEditorFile(NewSource.Filename,false); Result:=DoOpenEditorFile(NewSource.Filename,false,true);
if Result<>mrOk then exit; if Result<>mrOk then exit;
GetUnitWithPageIndex(SourceNoteBook.NoteBook.PageIndex,NewSrcEdit, GetUnitWithPageIndex(SourceNoteBook.NoteBook.PageIndex,NewSrcEdit,
NewUnitInfo); NewUnitInfo);
@ -5260,7 +5267,8 @@ begin
// jump to error in source editor // jump to error in source editor
if CodeToolBoss.ErrorCode<>nil then begin if CodeToolBoss.ErrorCode<>nil then begin
SourceNotebook.AddJumpPointClicked(Self); SourceNotebook.AddJumpPointClicked(Self);
if DoOpenEditorFile(CodeToolBoss.ErrorCode.Filename,false)=mrOk then begin if DoOpenEditorFile(CodeToolBoss.ErrorCode.Filename,false,true)=mrOk then
begin
ActiveSrcEdit:=SourceNoteBook.GetActiveSE; ActiveSrcEdit:=SourceNoteBook.GetActiveSE;
SourceNotebook.BringToFront; SourceNotebook.BringToFront;
with ActiveSrcEdit.EditorComponent do begin with ActiveSrcEdit.EditorComponent do begin
@ -5755,6 +5763,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.210 2002/02/06 08:58:27 lazarus
MG: fixed compiler warnings and asking to create non existing files
Revision 1.209 2002/02/05 23:16:47 lazarus Revision 1.209 2002/02/05 23:16:47 lazarus
MWE: * Updated tebugger MWE: * Updated tebugger
+ Added debugger to IDE + Added debugger to IDE
@ -6263,3 +6274,4 @@ end.
+ Initial import + Initial import
} }

View File

@ -237,6 +237,9 @@ end.
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.12 2002/02/06 08:58:29 lazarus
MG: fixed compiler warnings and asking to create non existing files
Revision 1.11 2002/02/03 00:24:00 lazarus Revision 1.11 2002/02/03 00:24:00 lazarus
TPanel implemented. TPanel implemented.
Basic graphic primitives split into GraphType package, so that we can Basic graphic primitives split into GraphType package, so that we can