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;
end;
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));
// scan code

View File

@ -63,8 +63,14 @@ type
Shift: TShiftState);
procedure tbEvaluateClick(Sender: TObject);
procedure tbWatchClick(Sender: TObject);
private
function GetFindText: string;
procedure SetFindText(const NewFindText: string);
public
property FindText: string read GetFindText write SetFindText;
end;
implementation
@ -92,6 +98,22 @@ begin
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);
begin
cmbExpression.SetFocus;

View File

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