ide: add TSourceEditor.FillExecutionMarks, TSourceEditor.ClearExecutionMarks (debugger part is missing)

git-svn-id: trunk@18993 -
This commit is contained in:
paul 2009-03-14 19:19:13 +00:00
parent 25fc0e9b9c
commit fb124b7de5
2 changed files with 30 additions and 7 deletions

View File

@ -343,6 +343,10 @@ type
procedure Activate;
function PageIndex: integer;
function IsActiveOnNoteBook: boolean;
// debugging
procedure FillExecutionMarks;
procedure ClearExecutionMarks;
public
// properties
property CodeBuffer: TCodeBuffer read FCodeBuffer write SetCodeBuffer;
@ -3016,6 +3020,23 @@ begin
Result:=false;
end;
procedure TSourceEditor.FillExecutionMarks;
var
i: integer;
ASource: String;
Addr: TDBGPtr;
begin
ASource := FileName;
for i := 0 to EditorComponent.Lines.Count - 1 do
if DebugBoss.SourceAddress(ASource, i, 0, Addr) and (Addr <> 0) then
EditorComponent.SetDebugMarks(i, i);
end;
procedure TSourceEditor.ClearExecutionMarks;
begin
EditorComponent.ClearDebugMarks;
end;
Function TSourceEditor.GetWordAtCurrentCaret: String;
var
CaretPos: TPoint;
@ -4489,7 +4510,7 @@ Begin
End;
Function TSourceNotebook.NewSE(PageNum: Integer): TSourceEditor;
Begin
begin
{$IFDEF IDE_DEBUG}
writeln('TSourceNotebook.NewSE A ');
{$ENDIF}
@ -4507,23 +4528,21 @@ Begin
{$ENDIF}
Result := TSourceEditor.Create(Self,Notebook.Page[PageNum]);
Result.EditorComponent.BeginUpdate;
//debugln(['TSourceNotebook.NewSE PageNum=',PageNum,' Notebook.PageIndex=',Notebook.PageIndex,' FindPageWithEditor=',FindPageWithEditor(Result)]);
FSourceEditorList.Add(Result);
Result.CodeTemplates:=CodeTemplateModul;
Notebook.PageIndex := Pagenum;
//debugln(['TSourceNotebook.NewSE C GetActiveSE=Result=',GetActiveSE=Result]);
Result.FPageName:=NoteBook.Pages[Pagenum];
Result.EditorComponent.BookMarkOptions.BookmarkImages :=
SourceEditorMarks.ImgList;
Result.PopupMenu:=SrcPopupMenu;
Result.EditorComponent.BookMarkOptions.BookmarkImages := SourceEditorMarks.ImgList;
Result.EditorComponent.Gutter.MarksPart.DebugMarksImageIndex := SourceEditorMarks.SourceLineImg;
Result.PopupMenu := SrcPopupMenu;
Result.OnEditorChange := @EditorChanged;
Result.OnMouseMove := @EditorMouseMove;
Result.OnMouseDown := @EditorMouseDown;
Result.OnMouseWheel := @EditorMouseWheel;
Result.OnClickLink := @EditorClickLink;
Result.OnMouseLink := @EditorMouseLink;
Result.OnKeyDown :=@EditorKeyDown;
Result.OnKeyDown := @EditorKeyDown;
Result.EditorComponent.EndUpdate;
{$IFDEF IDE_DEBUG}

View File

@ -142,6 +142,7 @@ type
fActiveBreakPointImg: Integer;
FCurrentLineBreakPointImg: Integer;
FCurrentLineImg: Integer;
FSourceLineImg: Integer;
FImgList: TImageList;
fInactiveBreakPointImg: Integer;
fInvalidBreakPointImg: Integer;
@ -195,6 +196,7 @@ type
property UnknownBreakPointImg: Integer read fUnknownBreakPointImg;
property CurrentLineImg: Integer read FCurrentLineImg;
property CurrentLineBreakPointImg: Integer read FCurrentLineBreakPointImg;
property SourceLineImg: Integer read FSourceLineImg;
end;
var
@ -524,6 +526,8 @@ begin
FCurrentLineImg:=AddImage('debugger_current_line');
// load current line + breakpoint image
FCurrentLineBreakPointImg:=AddImage('debugger_current_line_breakpoint');
// load source line
FSourceLineImg:=AddImage('debugger_source_line');
end;
function TSourceMarks.FindFirstMarkNode(ASynEdit: TCustomSynEdit; ALine: integer