Show proper dialog title for Add Watch and Edit Watch

This commit is contained in:
Margers 2024-11-11 07:31:36 +00:00 committed by Michael Van Canneyt
parent b73bf4a811
commit fd64cb8c5a

View File

@ -3102,13 +3102,17 @@ end;
procedure TWatchesListBox.EditCurrent;
var
P: PWatch;
D: PWatchItemDialog;
begin
if Range=0 then Exit;
if Focused<WatchesCollection^.Count then
P:=WatchesCollection^.At(Focused)
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;
end;
@ -3410,7 +3414,7 @@ constructor TWatchItemDialog.Init(AWatch: PWatch);
var R,R2: TRect;
begin
R.Assign(0,0,50,10);
inherited Init(R,'Edit Watch');
inherited Init(R,'Add Watch');
Watch:=AWatch;
GetExtent(R); R.Grow(-3,-2);