mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 10:59:29 +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
|
||||
Watch := DebugBoss.Watches.CurrentWatches.Add(S);
|
||||
Watch.Enabled := True;
|
||||
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
|
||||
Watch := DebugBoss.Watches.CurrentWatches.Add(S);
|
||||
Watch.Enabled := True;
|
||||
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
|
||||
NewWatch := DebugBoss.Watches.CurrentWatches.Add(s);
|
||||
NewWatch.DisplayFormat := wdfDefault;
|
||||
NewWatch.EvaluateFlags := [defClassAutoCast];
|
||||
NewWatch.Enabled := True;
|
||||
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
|
||||
NewWatch := DebugBoss.Watches.CurrentWatches.Add(s);
|
||||
NewWatch.DisplayFormat := wdfDefault;
|
||||
NewWatch.EvaluateFlags := [defClassAutoCast];
|
||||
NewWatch.Enabled := True;
|
||||
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,25 +82,30 @@ const
|
||||
wdfStructure, wdfDefault, wdfMemDump, wdfBinary
|
||||
);
|
||||
begin
|
||||
if FWatch = nil
|
||||
then begin
|
||||
FWatch := DebugBoss.Watches.CurrentWatches.Add(txtExpression.Text);
|
||||
end
|
||||
else begin
|
||||
FWatch.Expression := txtExpression.Text;
|
||||
DebugBoss.Watches.CurrentWatches.BeginUpdate;
|
||||
try
|
||||
if FWatch = nil
|
||||
then begin
|
||||
FWatch := DebugBoss.Watches.CurrentWatches.Add(txtExpression.Text);
|
||||
end
|
||||
else begin
|
||||
FWatch.Expression := txtExpression.Text;
|
||||
end;
|
||||
|
||||
if (rgStyle.ItemIndex >= low(StyleToDispFormat))
|
||||
and (rgStyle.ItemIndex <= High(StyleToDispFormat))
|
||||
then FWatch.DisplayFormat := StyleToDispFormat[rgStyle.ItemIndex]
|
||||
else FWatch.DisplayFormat := wdfDefault;
|
||||
|
||||
if chkUseInstanceClass.Checked
|
||||
then FWatch.EvaluateFlags := [defClassAutoCast]
|
||||
else FWatch.EvaluateFlags := [];
|
||||
FWatch.RepeatCount := StrToIntDef(txtRepCount.Text, 0);
|
||||
|
||||
FWatch.Enabled := chkEnabled.Checked;
|
||||
finally
|
||||
DebugBoss.Watches.CurrentWatches.EndUpdate;
|
||||
end;
|
||||
|
||||
if (rgStyle.ItemIndex >= low(StyleToDispFormat))
|
||||
and (rgStyle.ItemIndex <= High(StyleToDispFormat))
|
||||
then FWatch.DisplayFormat := StyleToDispFormat[rgStyle.ItemIndex]
|
||||
else FWatch.DisplayFormat := wdfDefault;
|
||||
|
||||
if chkUseInstanceClass.Checked
|
||||
then FWatch.EvaluateFlags := [defClassAutoCast]
|
||||
else FWatch.EvaluateFlags := [];
|
||||
FWatch.RepeatCount := StrToIntDef(txtRepCount.Text, 0);
|
||||
|
||||
FWatch.Enabled := chkEnabled.Checked;
|
||||
end;
|
||||
|
||||
procedure TWatchPropertyDlg.btnHelpClick(Sender: TObject);
|
||||
|
@ -1137,14 +1137,19 @@ begin
|
||||
WatchVar := SE.GetOperandAtCurrentCaret;
|
||||
if (WatchVar <> '') and SE.EditorComponent.Focused then
|
||||
begin
|
||||
w := Watches.CurrentWatches.Find(WatchVar);
|
||||
if w = nil
|
||||
then w := Watches.CurrentWatches.Add(WatchVar);
|
||||
if (w <> nil)
|
||||
then begin
|
||||
w.Enabled := True;
|
||||
ViewDebugDialog(ddtWatches, False);
|
||||
Exit;
|
||||
Watches.CurrentWatches.BeginUpdate;
|
||||
try
|
||||
w := Watches.CurrentWatches.Find(WatchVar);
|
||||
if w = nil
|
||||
then w := Watches.CurrentWatches.Add(WatchVar);
|
||||
if (w <> nil)
|
||||
then begin
|
||||
w.Enabled := True;
|
||||
ViewDebugDialog(ddtWatches, False);
|
||||
Exit;
|
||||
end;
|
||||
finally
|
||||
Watches.CurrentWatches.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user