mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-13 10:09:25 +02:00
MG: fixed compiler warnings and asking to create non existing files
git-svn-id: trunk@667 -
This commit is contained in:
parent
5e00188a21
commit
90cf59a11f
@ -52,7 +52,7 @@ type
|
||||
property DebugProcess: TProcess read FDbgProcess;
|
||||
property OutputLines: TStringList read FOutputLines;
|
||||
public
|
||||
constructor Create; override;
|
||||
constructor Create; {override; }
|
||||
destructor Destroy; override;
|
||||
procedure TestCmd(const ACommand: String); virtual;// For internal debugging purposes
|
||||
end;
|
||||
@ -387,6 +387,9 @@ end;
|
||||
end.
|
||||
{ =============================================================================
|
||||
$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
|
||||
MWE: * Updated tebugger
|
||||
+ Added debugger to IDE
|
||||
|
@ -35,7 +35,7 @@ type
|
||||
FDebugger: TObject; // reference to our debugger
|
||||
FEnabled: Boolean;
|
||||
FExpression: String;
|
||||
FValue: String;
|
||||
//FValue: String;
|
||||
FOnChange: TNotifyEvent;
|
||||
procedure SetEnabled(const AValue: Boolean);
|
||||
protected
|
||||
@ -147,6 +147,9 @@ end;
|
||||
end.
|
||||
{ =============================================================================
|
||||
$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
|
||||
MWE: * Updated tebugger
|
||||
+ Added debugger to IDE
|
||||
|
@ -102,7 +102,7 @@ type
|
||||
procedure SetFileName(const AValue: String); virtual;
|
||||
procedure SetState(const AValue: TDBGState);
|
||||
public
|
||||
constructor Create; virtual;
|
||||
constructor Create; {virtual; Virtual constructor makes no sense}
|
||||
destructor Destroy; override;
|
||||
|
||||
procedure Init; virtual; // Initializes the debugger
|
||||
@ -299,6 +299,9 @@ end;
|
||||
end.
|
||||
{ =============================================================================
|
||||
$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
|
||||
MWE: * Updated tebugger
|
||||
+ Added debugger to IDE
|
||||
|
@ -54,7 +54,7 @@ type
|
||||
procedure SetFileName(const AValue: String); override;
|
||||
function RequestCommand(const ACommand: TDBGCommand; const AParams: array of const): Boolean; override;
|
||||
public
|
||||
constructor Create; override;
|
||||
constructor Create; {override;}
|
||||
destructor Destroy; override;
|
||||
|
||||
procedure Init; override; // Initializes external debugger
|
||||
@ -168,7 +168,7 @@ var
|
||||
loc: TDBGLocationRec;
|
||||
dState: TDBGState;
|
||||
StopAdress: Integer;
|
||||
idx: Integer;
|
||||
//idx: Integer;
|
||||
S: String;
|
||||
begin
|
||||
if State in [dsIdle, dsStop]
|
||||
@ -466,6 +466,7 @@ end;
|
||||
|
||||
function TGDBWatch.GetValid: Boolean;
|
||||
begin
|
||||
Result:=false;
|
||||
end;
|
||||
|
||||
procedure TGDBWatch.SetExpression(const AValue: String);
|
||||
@ -484,6 +485,9 @@ end;
|
||||
end.
|
||||
{ =============================================================================
|
||||
$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
|
||||
MWE: * Updated tebugger
|
||||
+ Added debugger to IDE
|
||||
|
42
ide/main.pp
42
ide/main.pp
@ -342,7 +342,7 @@ type
|
||||
function DoCloseEditorUnit(PageIndex:integer;
|
||||
SaveFirst: boolean):TModalResult;
|
||||
function DoOpenEditorFile(const AFileName:string;
|
||||
ProjectLoading:boolean):TModalResult;
|
||||
ProjectLoading, OnlyIfExists:boolean):TModalResult;
|
||||
function DoOpenFileAtCursor(Sender: TObject):TModalResult;
|
||||
function DoSaveAll: TModalResult;
|
||||
function DoOpenMainUnit(ProjectLoading: boolean): TModalResult;
|
||||
@ -1677,7 +1677,7 @@ begin
|
||||
AFilename:=ExpandFilename(OpenDialog.Files.Strings[i]);
|
||||
if i=0 then
|
||||
EnvironmentOptions.LastOpenDialogDir:=ExtractFilePath(AFilename);
|
||||
if DoOpenEditorFile(AFilename,false)=mrOk then begin
|
||||
if DoOpenEditorFile(AFilename,false,false)=mrOk then begin
|
||||
EnvironmentOptions.AddToRecentOpenFiles(AFilename);
|
||||
end;
|
||||
end;
|
||||
@ -1688,7 +1688,7 @@ begin
|
||||
end;
|
||||
end else if Sender is TMenuItem then begin
|
||||
AFileName:=ExpandFilename(TMenuItem(Sender).Caption);
|
||||
if DoOpenEditorFile(AFilename,false)=mrOk then begin
|
||||
if DoOpenEditorFile(AFilename,false,false)=mrOk then begin
|
||||
EnvironmentOptions.AddToRecentOpenFiles(AFilename);
|
||||
SaveEnvironment;
|
||||
end;
|
||||
@ -2819,7 +2819,7 @@ writeln('TMainIDE.DoCloseEditorUnit end');
|
||||
end;
|
||||
|
||||
function TMainIDE.DoOpenEditorFile(const AFileName:string;
|
||||
ProjectLoading:boolean):TModalResult;
|
||||
ProjectLoading, OnlyIfExists:boolean):TModalResult;
|
||||
var Ext,ACaption,AText:string;
|
||||
i,BookmarkID:integer;
|
||||
ReOpen:boolean;
|
||||
@ -2867,10 +2867,11 @@ CheckHeap(IntToStr(GetMem_Cnt));
|
||||
mtError, [mbIgnore, mbAbort], 0);
|
||||
exit;
|
||||
end;
|
||||
if MessageDlg('File not found',
|
||||
if (not OnlyIfExists)
|
||||
and (MessageDlg('File not found',
|
||||
'File "'+AFilename+'" not found.'#13
|
||||
+'Do you want to create it?'#13
|
||||
,mtInformation,[mbYes,mbNo],0)=mrYes then
|
||||
,mtInformation,[mbYes,mbNo],0)=mrYes) then
|
||||
begin
|
||||
// create new file
|
||||
Ext:=lowercase(ExtractFileExt(AFilename));
|
||||
@ -2879,6 +2880,11 @@ CheckHeap(IntToStr(GetMem_Cnt));
|
||||
else
|
||||
Result:=DoNewEditorUnit(nuEmpty,AFilename);
|
||||
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
|
||||
// cancel loading file
|
||||
exit;
|
||||
@ -3185,7 +3191,7 @@ Begin
|
||||
if MainUnitIndex=i then
|
||||
Result:=DoOpenMainUnit(false)
|
||||
else
|
||||
Result:=DoOpenEditorFile(AnUnitInfo.Filename,false);
|
||||
Result:=DoOpenEditorFile(AnUnitInfo.Filename,false,true);
|
||||
if Result=mrAbort then exit;
|
||||
end;
|
||||
end;
|
||||
@ -3291,7 +3297,7 @@ begin
|
||||
if FindPasFile(FName,SPath) then begin
|
||||
result:=mrOk;
|
||||
EnvironmentOptions.LastOpenDialogDir:=ExtractFilePath(FName);
|
||||
if DoOpenEditorFile(FName,false)=mrOk then begin
|
||||
if DoOpenEditorFile(FName,false,false)=mrOk then begin
|
||||
EnvironmentOptions.AddToRecentOpenFiles(FName);
|
||||
SaveEnvironment;
|
||||
end;
|
||||
@ -3623,7 +3629,7 @@ CheckHeap(IntToStr(GetMem_Cnt));
|
||||
Ext:='.lpi';
|
||||
end;
|
||||
if Ext<>'.lpi' then begin
|
||||
Result:=DoOpenEditorFile(AFilename,false);
|
||||
Result:=DoOpenEditorFile(AFilename,false,false);
|
||||
exit;
|
||||
end;
|
||||
if FileExists(AFilename) and (not FileIsText(AFilename)) then begin
|
||||
@ -3694,7 +3700,8 @@ CheckHeap(IntToStr(GetMem_Cnt));
|
||||
if LowestEditorIndex>=0 then begin
|
||||
// reopen file
|
||||
//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);
|
||||
if Result=mrAbort then begin
|
||||
// mark all files, that are left to load as unloaded:
|
||||
@ -4267,7 +4274,7 @@ begin
|
||||
if (Sender<>FDebugger) or (Sender=nil) then exit;
|
||||
//TODO: Show assembler window if no source can be found.
|
||||
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;
|
||||
if ActiveSrcEdit=nil then exit;
|
||||
with ActiveSrcEdit.EditorComponent do begin
|
||||
@ -4793,7 +4800,7 @@ begin
|
||||
// open the file in the source editor
|
||||
Ext:=lowercase(ExtractFileExt(SearchedFilename));
|
||||
if (Ext<>'.lfm') and (Ext<>'.lpi') then begin
|
||||
Result:=(DoOpenEditorFile(SearchedFilename,false)=mrOk);
|
||||
Result:=(DoOpenEditorFile(SearchedFilename,false,true)=mrOk);
|
||||
if Result then begin
|
||||
// set caret position
|
||||
SourceNotebook.AddJumpPointClicked(Self);
|
||||
@ -5129,7 +5136,7 @@ begin
|
||||
// open all sources in editor
|
||||
for i:=0 to Manager.SourceChangeCache.BuffersToModifyCount-1 do begin
|
||||
if DoOpenEditorFile(Manager.SourceChangeCache.BuffersToModify[i].Filename,
|
||||
false)<>mrOk then
|
||||
false,true)<>mrOk then
|
||||
begin
|
||||
Abort:=true;
|
||||
exit;
|
||||
@ -5193,7 +5200,7 @@ begin
|
||||
end;
|
||||
if NewSource<>ActiveUnitInfo.Source then begin
|
||||
// jump to other file -> open it
|
||||
Result:=DoOpenEditorFile(NewSource.Filename,false);
|
||||
Result:=DoOpenEditorFile(NewSource.Filename,false,true);
|
||||
if Result<>mrOk then exit;
|
||||
GetUnitWithPageIndex(SourceNoteBook.NoteBook.PageIndex,NewSrcEdit,
|
||||
NewUnitInfo);
|
||||
@ -5260,7 +5267,8 @@ begin
|
||||
// jump to error in source editor
|
||||
if CodeToolBoss.ErrorCode<>nil then begin
|
||||
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;
|
||||
SourceNotebook.BringToFront;
|
||||
with ActiveSrcEdit.EditorComponent do begin
|
||||
@ -5755,6 +5763,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$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
|
||||
MWE: * Updated tebugger
|
||||
+ Added debugger to IDE
|
||||
@ -6263,3 +6274,4 @@ end.
|
||||
+ Initial import
|
||||
|
||||
}
|
||||
|
||||
|
@ -237,6 +237,9 @@ end.
|
||||
{ =============================================================================
|
||||
|
||||
$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
|
||||
TPanel implemented.
|
||||
Basic graphic primitives split into GraphType package, so that we can
|
||||
|
Loading…
Reference in New Issue
Block a user