mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-15 06:09:30 +02:00
IdeDebugger: Breakpoint dialog, enable/disabl all breakpoint in each group
This commit is contained in:
parent
46731b05ee
commit
0643c39980
@ -12,7 +12,7 @@ object BreakpointGroupFrame: TBreakpointGroupFrame
|
||||
DesignTop = 100
|
||||
object ToolBar1: TToolBar
|
||||
Left = 0
|
||||
Height = 18
|
||||
Height = 24
|
||||
Top = 0
|
||||
Width = 602
|
||||
AutoSize = True
|
||||
@ -25,8 +25,27 @@ object BreakpointGroupFrame: TBreakpointGroupFrame
|
||||
OnDragOver = FrameDragOver
|
||||
OnEndDrag = ToolBar1EndDrag
|
||||
OnStartDrag = ToolBar1StartDrag
|
||||
object StaticText1: TStaticText
|
||||
object ToolButtonEnableAll: TToolButton
|
||||
Left = 1
|
||||
Top = 2
|
||||
Caption = 'ToolButtonEnableAll'
|
||||
OnClick = ToolButtonEnableAllClick
|
||||
end
|
||||
object ToolButtonDisableAll: TToolButton
|
||||
Left = 24
|
||||
Top = 2
|
||||
Caption = 'ToolButtonDisableAll'
|
||||
OnClick = ToolButtonDisableAllClick
|
||||
end
|
||||
object ToolButtonDivider1: TToolButton
|
||||
Left = 47
|
||||
Height = 22
|
||||
Top = 2
|
||||
Caption = 'ToolButtonDivider1'
|
||||
Style = tbsDivider
|
||||
end
|
||||
object StaticText1: TStaticText
|
||||
Left = 57
|
||||
Height = 16
|
||||
Top = 2
|
||||
Width = 57
|
||||
@ -40,7 +59,7 @@ object BreakpointGroupFrame: TBreakpointGroupFrame
|
||||
TabOrder = 0
|
||||
end
|
||||
object StaticText2: TStaticText
|
||||
Left = 58
|
||||
Left = 114
|
||||
Height = 16
|
||||
Top = 2
|
||||
Width = 57
|
||||
@ -61,14 +80,14 @@ object BreakpointGroupFrame: TBreakpointGroupFrame
|
||||
AnchorSideBottom.Control = ToolBar1
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 579
|
||||
Height = 17
|
||||
Height = 23
|
||||
Top = 1
|
||||
Width = 23
|
||||
Anchors = [akTop, akRight, akBottom]
|
||||
AutoSize = True
|
||||
BorderSpacing.Top = 1
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 17
|
||||
ClientHeight = 23
|
||||
ClientWidth = 23
|
||||
ParentBackground = False
|
||||
ParentColor = False
|
||||
@ -78,7 +97,7 @@ object BreakpointGroupFrame: TBreakpointGroupFrame
|
||||
AnchorSideBottom.Control = Panel1
|
||||
AnchorSideBottom.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 17
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 23
|
||||
Anchors = [akTop, akLeft, akBottom]
|
||||
|
@ -32,6 +32,9 @@ type
|
||||
StaticText1: TStaticText;
|
||||
StaticText2: TStaticText;
|
||||
ToolBar1: TToolBar;
|
||||
ToolButtonEnableAll: TToolButton;
|
||||
ToolButtonDisableAll: TToolButton;
|
||||
ToolButtonDivider1: TToolButton;
|
||||
procedure BtnDeleteClick(Sender: TObject);
|
||||
procedure FrameDragDrop(Sender, Source: TObject; X, Y: Integer);
|
||||
procedure FrameDragOver(Sender, Source: TObject; X, Y: Integer;
|
||||
@ -40,6 +43,8 @@ type
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
procedure ToolBar1EndDrag(Sender, Target: TObject; X, Y: Integer);
|
||||
procedure ToolBar1StartDrag(Sender: TObject; var DragObject: TDragObject);
|
||||
procedure ToolButtonDisableAllClick(Sender: TObject);
|
||||
procedure ToolButtonEnableAllClick(Sender: TObject);
|
||||
private
|
||||
FGroupKind: TBreakpointGroupFrameKind;
|
||||
FOnDeleteGroup: TOnDeleteGroup;
|
||||
@ -60,6 +65,7 @@ type
|
||||
AGroupKind: TBreakpointGroupFrameKind = bgfGroup); reintroduce;
|
||||
destructor Destroy; override;
|
||||
procedure UpdateDisplay;
|
||||
procedure UpdateButtons;
|
||||
function Compare(AnOther: TBreakpointGroupFrame): integer;
|
||||
|
||||
property Visible: boolean read GetVisible write SetVisible;
|
||||
@ -97,6 +103,34 @@ begin
|
||||
FOwner.FDraggingGroupHeader := True;
|
||||
end;
|
||||
|
||||
procedure TBreakpointGroupFrame.ToolButtonDisableAllClick(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
FOwner.BeginUpdate;
|
||||
try
|
||||
for i := 0 to DebugBoss.BreakPoints.Count - 1 do
|
||||
if DebugBoss.BreakPoints[i].Group = BrkGroup then
|
||||
DebugBoss.BreakPoints[i].Enabled := False;
|
||||
finally
|
||||
FOwner.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TBreakpointGroupFrame.ToolButtonEnableAllClick(Sender: TObject);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
FOwner.BeginUpdate;
|
||||
try
|
||||
for i := 0 to DebugBoss.BreakPoints.Count - 1 do
|
||||
if DebugBoss.BreakPoints[i].Group = BrkGroup then
|
||||
DebugBoss.BreakPoints[i].Enabled := True;
|
||||
finally
|
||||
FOwner.EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TBreakpointGroupFrame.BtnDeleteClick(Sender: TObject);
|
||||
begin
|
||||
if assigned(FOnDeleteGroup) then
|
||||
@ -211,6 +245,7 @@ begin
|
||||
FBrkGroup := nil;
|
||||
FGroupKind := bgfAbandoned;
|
||||
Visible := False;
|
||||
UpdateButtons;
|
||||
end;
|
||||
|
||||
function TBreakpointGroupFrame.GetName: String;
|
||||
@ -258,6 +293,16 @@ begin
|
||||
if AGroupKind = bgfGroup then
|
||||
FGroupKind := bgfUngrouped;
|
||||
|
||||
ToolBar1.Images := IDEImages.Images_16;
|
||||
|
||||
ToolButtonEnableAll.Caption := lisEnableAll;
|
||||
ToolButtonEnableAll.Hint := lisDbgAllItemEnableHint;
|
||||
ToolButtonEnableAll.ImageIndex := IDEImages.LoadImage('debugger_enable_all');
|
||||
|
||||
ToolButtonDisableAll.Caption := liswlDIsableAll;
|
||||
ToolButtonDisableAll.Hint := lisDbgAllItemDisableHint;
|
||||
ToolButtonDisableAll.ImageIndex := IDEImages.LoadImage('debugger_disable_all');
|
||||
|
||||
BtnDelete.Visible := FBrkGroup <> nil;
|
||||
BtnDelete.Images := IDEImages.Images_16;
|
||||
BtnDelete.ImageIndex := IDEImages.LoadImage('menu_close');
|
||||
@ -274,6 +319,8 @@ end;
|
||||
|
||||
procedure TBreakpointGroupFrame.UpdateDisplay;
|
||||
begin
|
||||
UpdateButtons;
|
||||
|
||||
case FGroupKind of
|
||||
bgfUngrouped: begin
|
||||
StaticText1.Caption := BreakViewHeaderNoGroup;
|
||||
@ -299,6 +346,29 @@ begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TBreakpointGroupFrame.UpdateButtons;
|
||||
var
|
||||
HasEnabled, HasDisabled: Boolean;
|
||||
v: PVirtualNode;
|
||||
b: TIDEBreakPoint;
|
||||
begin
|
||||
HasEnabled := False;
|
||||
HasDisabled := False;
|
||||
|
||||
for v in FTree.VisibleChildNoInitNodes(Node) do begin
|
||||
b := TIDEBreakPoint(FTree.NodeItem[v]);
|
||||
if b = nil then continue;
|
||||
HasEnabled := HasEnabled or b.Enabled;
|
||||
HasDisabled := HasDisabled or not b.Enabled;
|
||||
end;
|
||||
|
||||
ToolButtonEnableAll.Visible := GroupKind in [bgfUngrouped, bgfGroup];
|
||||
ToolButtonEnableAll.Enabled := (Count > 0) and HasDisabled;
|
||||
|
||||
ToolButtonDisableAll.Visible := GroupKind in [bgfUngrouped, bgfGroup];
|
||||
ToolButtonDisableAll.Enabled := (Count > 0) and HasEnabled;
|
||||
end;
|
||||
|
||||
function TBreakpointGroupFrame.Compare(AnOther: TBreakpointGroupFrame): integer;
|
||||
begin
|
||||
Result := ord(FGroupKind) - ord(AnOther.FGroupKind);
|
||||
|
@ -188,6 +188,7 @@ type
|
||||
procedure JumpToCurrentBreakPoint;
|
||||
procedure ShowProperties;
|
||||
protected
|
||||
procedure CreateWnd; override;
|
||||
procedure AcceptGroupHeaderDrop(ADroppedGroupFrame: TBreakpointGroupFrame; ATargetNode: PVirtualNode); override;
|
||||
procedure DoBreakPointsChanged; override;
|
||||
procedure DoBeginUpdate; override;
|
||||
@ -954,6 +955,7 @@ var
|
||||
AllCanEnable, AllCanDisable: Boolean;
|
||||
CurBreakPoint: TIDEBreakPoint;
|
||||
TotalCnt: Integer;
|
||||
g: TBreakpointGroupFrame;
|
||||
begin
|
||||
if UpdateCount > 0 then exit;
|
||||
|
||||
@ -1000,6 +1002,12 @@ begin
|
||||
actGroupSetNew.Enabled := ItemSelected;
|
||||
actGroupSetNone.Enabled := ItemSelected;
|
||||
|
||||
for VNode in tvBreakPoints.ControlNodes do begin
|
||||
g := GetGroupFrame(VNode);
|
||||
if g <> nil then
|
||||
g.UpdateDisplay;
|
||||
end;
|
||||
|
||||
tvBreakPoints.Invalidate;
|
||||
end;
|
||||
|
||||
@ -1618,6 +1626,22 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.CreateWnd;
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
inherited CreateWnd;
|
||||
BeginUpdate;
|
||||
try
|
||||
ClearTree;
|
||||
for i := 0 to DebugBoss.BreakPointGroups.Count - 1 do
|
||||
GetNodeForBrkGroup(DebugBoss.BreakPointGroups[i]);
|
||||
UpdateAll;
|
||||
finally
|
||||
EndUpdate;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TBreakPointsDlg.DoBreakPointsChanged;
|
||||
var
|
||||
i: Integer;
|
||||
|
Loading…
Reference in New Issue
Block a user