IdeDebugger: Breakpoint properties, check for valid group name

This commit is contained in:
Martin 2023-07-26 13:24:42 +02:00
parent 05db0c6c76
commit 02f62a1b49
2 changed files with 43 additions and 4 deletions

View File

@ -173,19 +173,22 @@ object BreakPropertyDlg: TBreakPropertyDlg
BorderSpacing.Left = 24
BorderSpacing.Around = 6
ItemHeight = 15
OnChange = cmbGroupEditingDone
OnEditingDone = cmbGroupEditingDone
OnExit = cmbGroupEditingDone
OnKeyPress = cmbGroupKeyPress
TabOrder = 7
Text = 'cmbGroup'
end
object gbActions: TGroupBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = cmbGroup
AnchorSideTop.Control = lblBadGroupName
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 6
Height = 215
Top = 255
Top = 276
Width = 438
Anchors = [akTop, akLeft, akRight]
AutoSize = True
@ -407,8 +410,8 @@ object BreakPropertyDlg: TBreakPropertyDlg
AnchorSideTop.Control = gbActions
AnchorSideTop.Side = asrBottom
Left = 6
Height = 95
Top = 476
Height = 74
Top = 497
Width = 438
Anchors = [akTop, akLeft, akRight, akBottom]
OKButton.Name = 'OKButton'
@ -609,4 +612,24 @@ object BreakPropertyDlg: TBreakPropertyDlg
Caption = 'chkEnabled'
TabOrder = 10
end
object lblBadGroupName: TLabel
AnchorSideLeft.Control = cmbGroup
AnchorSideTop.Control = cmbGroup
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 139
Height = 15
Top = 255
Width = 305
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
BorderSpacing.Right = 6
BorderSpacing.Bottom = 6
Caption = 'lblBadGroupName'
Font.Color = clRed
ParentFont = False
Visible = False
WordWrap = True
end
end

View File

@ -46,6 +46,7 @@ type
edtFilename: TEdit;
gbActions: TGroupBox;
Label1: TLabel;
lblBadGroupName: TLabel;
lblWatchKind: TLabel;
lblWatchScope: TLabel;
lblLogCallStackLimit: TLabel;
@ -75,6 +76,7 @@ type
procedure chkEvalExpressionChange(Sender: TObject);
procedure chkLogCallStackChange(Sender: TObject);
procedure chkLogMessageChange(Sender: TObject);
procedure cmbGroupEditingDone(Sender: TObject);
procedure cmbGroupKeyPress(Sender: TObject; var Key: char);
procedure edtDisableGroupsButtonClick(Sender: TObject);
procedure edtEnableGroupsButtonClick(Sender: TObject);
@ -128,6 +130,12 @@ begin
edtLogMessage.Enabled := chkLogMessage.Checked;
end;
procedure TBreakPropertyDlg.cmbGroupEditingDone(Sender: TObject);
begin
lblBadGroupName.Visible := (cmbGroup.Text <> '') and (not TIDEBreakPointGroup.CheckName(cmbGroup.Text));
ButtonPanel.OKButton.Enabled := (cmbGroup.Text = '') or (TIDEBreakPointGroup.CheckName(cmbGroup.Text));
end;
procedure TBreakPropertyDlg.cmbGroupKeyPress(Sender: TObject; var Key: char);
begin
if Key = ';' then Key := #0;
@ -212,6 +220,11 @@ var
begin
if FBreakpoint = nil then Exit;
if (cmbGroup.Text <> '') and (not TIDEBreakPointGroup.CheckName(cmbGroup.Text)) then begin
MessageDlg(Caption, lisGroupNameInvalid, mtError, [mbOk], 0);
exit;
end;
EnableGroupList := TStringListUTF8Fast.Create;
DisableGroupList := TStringListUTF8Fast.Create;
@ -389,6 +402,8 @@ begin
chkLogCallStack.Checked := bpaLogCallStack in Actions;
edtLogCallStack.Value := FBreakpoint.LogCallStackLimit;
chkTakeSnap.Checked := bpaTakeSnapshot in Actions;
cmbGroupEditingDone(nil);
FUpdatingInfo := False;
end;
@ -437,6 +452,7 @@ begin
lblAutoContinue.Caption := lisAutoContinueAfter;
lblMS.Caption := lisMS;
lblGroup.Caption := lisGroup + ':';
lblBadGroupName.Caption := lisGroupNameInvalid;
gbActions.Caption := lisActions;
chkActionBreak.Caption := lisBreak;
chkEnableGroups.Caption := lisEnableGroups;