mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 15:39:18 +02:00
IDE, Debugger: reduce calls to Update when adding a watch.
git-svn-id: trunk@63649 -
This commit is contained in:
parent
16b3c7f07b
commit
b208794e24
@ -380,8 +380,13 @@ begin
|
||||
S := cmbExpression.Text;
|
||||
if DebugBoss.Watches.CurrentWatches.Find(S) = nil
|
||||
then begin
|
||||
DebugBoss.Watches.CurrentWatches.BeginUpdate;
|
||||
try
|
||||
Watch := DebugBoss.Watches.CurrentWatches.Add(S);
|
||||
Watch.Enabled := True;
|
||||
finally
|
||||
DebugBoss.Watches.CurrentWatches.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
DebugBoss.ViewDebugDialog(ddtWatches);
|
||||
end;
|
||||
|
@ -311,8 +311,13 @@ begin
|
||||
S := lvLocals.Selected.Caption;
|
||||
if DebugBoss.Watches.CurrentWatches.Find(S) = nil then
|
||||
begin
|
||||
DebugBoss.Watches.CurrentWatches.BeginUpdate;
|
||||
try
|
||||
Watch := DebugBoss.Watches.CurrentWatches.Add(S);
|
||||
Watch.Enabled := True;
|
||||
finally
|
||||
DebugBoss.Watches.CurrentWatches.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
DebugBoss.ViewDebugDialog(ddtWatches);
|
||||
end;
|
||||
|
@ -427,10 +427,15 @@ begin
|
||||
if (Source is TCustomEdit) then s := TCustomEdit(Source).SelText;
|
||||
|
||||
if s <> '' then begin
|
||||
DebugBoss.Watches.CurrentWatches.BeginUpdate;
|
||||
try
|
||||
NewWatch := DebugBoss.Watches.CurrentWatches.Add(s);
|
||||
NewWatch.DisplayFormat := wdfDefault;
|
||||
NewWatch.EvaluateFlags := [defClassAutoCast];
|
||||
NewWatch.Enabled := True;
|
||||
finally
|
||||
DebugBoss.Watches.CurrentWatches.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -456,10 +461,15 @@ begin
|
||||
Key := 0;
|
||||
s := Clipboard.AsText;
|
||||
if s <> '' then begin
|
||||
DebugBoss.Watches.CurrentWatches.BeginUpdate;
|
||||
try
|
||||
NewWatch := DebugBoss.Watches.CurrentWatches.Add(s);
|
||||
NewWatch.DisplayFormat := wdfDefault;
|
||||
NewWatch.EvaluateFlags := [defClassAutoCast];
|
||||
NewWatch.Enabled := True;
|
||||
finally
|
||||
DebugBoss.Watches.CurrentWatches.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
exit;
|
||||
|
@ -82,6 +82,8 @@ const
|
||||
wdfStructure, wdfDefault, wdfMemDump, wdfBinary
|
||||
);
|
||||
begin
|
||||
DebugBoss.Watches.CurrentWatches.BeginUpdate;
|
||||
try
|
||||
if FWatch = nil
|
||||
then begin
|
||||
FWatch := DebugBoss.Watches.CurrentWatches.Add(txtExpression.Text);
|
||||
@ -101,6 +103,9 @@ begin
|
||||
FWatch.RepeatCount := StrToIntDef(txtRepCount.Text, 0);
|
||||
|
||||
FWatch.Enabled := chkEnabled.Checked;
|
||||
finally
|
||||
DebugBoss.Watches.CurrentWatches.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TWatchPropertyDlg.btnHelpClick(Sender: TObject);
|
||||
|
@ -1137,6 +1137,8 @@ begin
|
||||
WatchVar := SE.GetOperandAtCurrentCaret;
|
||||
if (WatchVar <> '') and SE.EditorComponent.Focused then
|
||||
begin
|
||||
Watches.CurrentWatches.BeginUpdate;
|
||||
try
|
||||
w := Watches.CurrentWatches.Find(WatchVar);
|
||||
if w = nil
|
||||
then w := Watches.CurrentWatches.Add(WatchVar);
|
||||
@ -1146,6 +1148,9 @@ begin
|
||||
ViewDebugDialog(ddtWatches, False);
|
||||
Exit;
|
||||
end;
|
||||
finally
|
||||
Watches.CurrentWatches.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user