IDE, Debugger: prevent empty watches from being added.

git-svn-id: trunk@63650 -
This commit is contained in:
martin 2020-07-24 22:39:08 +00:00
parent b208794e24
commit 5e1702e798
4 changed files with 15 additions and 1 deletions

View File

@ -378,6 +378,8 @@ var
Watch: TCurrentWatch;
begin
S := cmbExpression.Text;
if s = '' then
exit;
if DebugBoss.Watches.CurrentWatches.Find(S) = nil
then begin
DebugBoss.Watches.CurrentWatches.BeginUpdate;

View File

@ -309,6 +309,8 @@ var
Watch: TCurrentWatch;
begin
S := lvLocals.Selected.Caption;
if s = '' then
exit;
if DebugBoss.Watches.CurrentWatches.Find(S) = nil then
begin
DebugBoss.Watches.CurrentWatches.BeginUpdate;

View File

@ -11,7 +11,7 @@ object WatchPropertyDlg: TWatchPropertyDlg
ClientWidth = 428
Constraints.MinWidth = 400
Position = poScreenCenter
LCLVersion = '1.9.0.0'
LCLVersion = '2.1.0.0'
object rgStyle: TRadioGroup
Left = 6
Height = 104
@ -105,6 +105,7 @@ object WatchPropertyDlg: TWatchPropertyDlg
BorderSpacing.Left = 6
BorderSpacing.Top = 6
BorderSpacing.Right = 6
OnChange = txtExpressionChange
TabOrder = 0
end
object lblRepCount: TLabel

View File

@ -61,6 +61,7 @@ type
txtRepCount: TEdit;
procedure btnHelpClick(Sender: TObject);
procedure btnOKClick(Sender: TObject);
procedure txtExpressionChange(Sender: TObject);
private
FWatch: TIdeWatch;
public
@ -82,6 +83,8 @@ const
wdfStructure, wdfDefault, wdfMemDump, wdfBinary
);
begin
if txtExpression.Text = '' then
exit;
DebugBoss.Watches.CurrentWatches.BeginUpdate;
try
if FWatch = nil
@ -108,6 +111,11 @@ begin
end;
end;
procedure TWatchPropertyDlg.txtExpressionChange(Sender: TObject);
begin
ButtonPanel.OKButton.Enabled := txtExpression.Text <> '';
end;
procedure TWatchPropertyDlg.btnHelpClick(Sender: TObject);
begin
LazarusHelp.ShowHelpForIDEControl(Self);
@ -142,6 +150,7 @@ begin
chkUseInstanceClass.Checked := defClassAutoCast in FWatch.EvaluateFlags;
txtRepCount.Text := IntToStr(FWatch.RepeatCount);
end;
txtExpressionChange(nil);
lblDigits.Enabled := False;
txtDigits.Enabled := False;