added evaluate text at cursor during debugging from Darek

git-svn-id: trunk@9419 -
This commit is contained in:
mattias 2006-06-12 18:48:30 +00:00
parent a49b4716a8
commit 5d2766a239
3 changed files with 29 additions and 2 deletions

View File

@ -468,7 +468,7 @@ begin
exit; exit;
end; end;
ClearLastError; ClearLastError;
DebugLn('TPascalParserTool.BuildTree B OnlyIntf=',dbgs(OnlyInterfaceNeeded),' ',TCodeBuffer(Scanner.MainCode).Filename); // DebugLn('TPascalParserTool.BuildTree B OnlyIntf=',dbgs(OnlyInterfaceNeeded),' ',TCodeBuffer(Scanner.MainCode).Filename);
//CheckHeap('TBasicCodeTool.BuildTree B '+IntToStr(MemCheck_GetMem_Cnt)); //CheckHeap('TBasicCodeTool.BuildTree B '+IntToStr(MemCheck_GetMem_Cnt));
// scan code // scan code

View File

@ -63,8 +63,14 @@ type
Shift: TShiftState); Shift: TShiftState);
procedure tbEvaluateClick(Sender: TObject); procedure tbEvaluateClick(Sender: TObject);
procedure tbWatchClick(Sender: TObject); procedure tbWatchClick(Sender: TObject);
private private
function GetFindText: string;
procedure SetFindText(const NewFindText: string);
public public
property FindText: string read GetFindText write SetFindText;
end; end;
implementation implementation
@ -92,6 +98,22 @@ begin
end; end;
end; end;
procedure TEvaluateDlg.SetFindText(const NewFindText: string);
begin
if NewFindText<>'' then begin
cmbExpression.Text := NewFindText;
cmbExpression.SelectAll;
tbEvaluate.Click;
end;
ActiveControl := cmbExpression;
end;
function TEvaluateDlg.GetFindText: string;
begin
Result := cmbExpression.Text;
end;
procedure TEvaluateDlg.FormShow(Sender: TObject); procedure TEvaluateDlg.FormShow(Sender: TObject);
begin begin
cmbExpression.SetFocus; cmbExpression.SetFocus;

View File

@ -1114,7 +1114,7 @@ begin
then Include(FManagerStates,dmsInitializingDebuggerObjectFailed); then Include(FManagerStates,dmsInitializingDebuggerObjectFailed);
end; end;
DebugLn('[TDebugManager.OnDebuggerChangeState] state: ', STATENAME[FDebugger.State]); //DebugLn('[TDebugManager.OnDebuggerChangeState] state: ', STATENAME[FDebugger.State]);
// All conmmands // All conmmands
// ------------------- // -------------------
@ -1313,6 +1313,11 @@ begin
TBreakPointsDlg(CurDialog).BaseDirectory:=Project1.ProjectDirectory; TBreakPointsDlg(CurDialog).BaseDirectory:=Project1.ProjectDirectory;
end; end;
end; end;
if (CurDialog is tEvaluateDlg) and (sourceNotebook<>nil)
then begin
tEvaluateDlg(CurDialog).FindText:=
SourceNotebook.GetActiveSE.GetWordAtCurrentCaret;
end;
FDialogs[ADialogType].Show; FDialogs[ADialogType].Show;
FDialogs[ADialogType].BringToFront; FDialogs[ADialogType].BringToFront;
end; end;