Browse Source

Show proper dialog title for Add Watch and Edit Watch

Margers 9 months ago
parent
commit
fd64cb8c5a
1 changed files with 7 additions and 3 deletions
  1. 7 3
      packages/ide/fpdebug.pas

+ 7 - 3
packages/ide/fpdebug.pas

@@ -3102,13 +3102,17 @@ end;
 procedure TWatchesListBox.EditCurrent;
 procedure TWatchesListBox.EditCurrent;
 var
 var
   P: PWatch;
   P: PWatch;
+  D: PWatchItemDialog;
 begin
 begin
   if Range=0 then Exit;
   if Range=0 then Exit;
   if Focused<WatchesCollection^.Count then
   if Focused<WatchesCollection^.Count then
     P:=WatchesCollection^.At(Focused)
     P:=WatchesCollection^.At(Focused)
   else
   else
-    P:=New(PWatch,Init(''));
-  Application^.ExecuteDialog(New(PWatchItemDialog,Init(P)),nil);
+    begin EditNew; exit; end;
+  D:=New(PWatchItemDialog,Init(P));
+  Dispose(D^.Title);
+  D^.Title:=NewStr('Edit Watch');
+  Application^.ExecuteDialog(D,nil);
   WatchesCollection^.Update;
   WatchesCollection^.Update;
 end;
 end;
 
 
@@ -3410,7 +3414,7 @@ constructor TWatchItemDialog.Init(AWatch: PWatch);
 var R,R2: TRect;
 var R,R2: TRect;
 begin
 begin
   R.Assign(0,0,50,10);
   R.Assign(0,0,50,10);
-  inherited Init(R,'Edit Watch');
+  inherited Init(R,'Add Watch');
   Watch:=AWatch;
   Watch:=AWatch;
 
 
   GetExtent(R); R.Grow(-3,-2);
   GetExtent(R); R.Grow(-3,-2);