mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 19:09:19 +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
|
DesignTop = 100
|
||||||
object ToolBar1: TToolBar
|
object ToolBar1: TToolBar
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 18
|
Height = 24
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 602
|
Width = 602
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
@ -25,8 +25,27 @@ object BreakpointGroupFrame: TBreakpointGroupFrame
|
|||||||
OnDragOver = FrameDragOver
|
OnDragOver = FrameDragOver
|
||||||
OnEndDrag = ToolBar1EndDrag
|
OnEndDrag = ToolBar1EndDrag
|
||||||
OnStartDrag = ToolBar1StartDrag
|
OnStartDrag = ToolBar1StartDrag
|
||||||
object StaticText1: TStaticText
|
object ToolButtonEnableAll: TToolButton
|
||||||
Left = 1
|
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
|
Height = 16
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 57
|
Width = 57
|
||||||
@ -40,7 +59,7 @@ object BreakpointGroupFrame: TBreakpointGroupFrame
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object StaticText2: TStaticText
|
object StaticText2: TStaticText
|
||||||
Left = 58
|
Left = 114
|
||||||
Height = 16
|
Height = 16
|
||||||
Top = 2
|
Top = 2
|
||||||
Width = 57
|
Width = 57
|
||||||
@ -61,14 +80,14 @@ object BreakpointGroupFrame: TBreakpointGroupFrame
|
|||||||
AnchorSideBottom.Control = ToolBar1
|
AnchorSideBottom.Control = ToolBar1
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 579
|
Left = 579
|
||||||
Height = 17
|
Height = 23
|
||||||
Top = 1
|
Top = 1
|
||||||
Width = 23
|
Width = 23
|
||||||
Anchors = [akTop, akRight, akBottom]
|
Anchors = [akTop, akRight, akBottom]
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderSpacing.Top = 1
|
BorderSpacing.Top = 1
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 17
|
ClientHeight = 23
|
||||||
ClientWidth = 23
|
ClientWidth = 23
|
||||||
ParentBackground = False
|
ParentBackground = False
|
||||||
ParentColor = False
|
ParentColor = False
|
||||||
@ -78,7 +97,7 @@ object BreakpointGroupFrame: TBreakpointGroupFrame
|
|||||||
AnchorSideBottom.Control = Panel1
|
AnchorSideBottom.Control = Panel1
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 17
|
Height = 23
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 23
|
Width = 23
|
||||||
Anchors = [akTop, akLeft, akBottom]
|
Anchors = [akTop, akLeft, akBottom]
|
||||||
|
@ -32,6 +32,9 @@ type
|
|||||||
StaticText1: TStaticText;
|
StaticText1: TStaticText;
|
||||||
StaticText2: TStaticText;
|
StaticText2: TStaticText;
|
||||||
ToolBar1: TToolBar;
|
ToolBar1: TToolBar;
|
||||||
|
ToolButtonEnableAll: TToolButton;
|
||||||
|
ToolButtonDisableAll: TToolButton;
|
||||||
|
ToolButtonDivider1: TToolButton;
|
||||||
procedure BtnDeleteClick(Sender: TObject);
|
procedure BtnDeleteClick(Sender: TObject);
|
||||||
procedure FrameDragDrop(Sender, Source: TObject; X, Y: Integer);
|
procedure FrameDragDrop(Sender, Source: TObject; X, Y: Integer);
|
||||||
procedure FrameDragOver(Sender, Source: TObject; X, Y: Integer;
|
procedure FrameDragOver(Sender, Source: TObject; X, Y: Integer;
|
||||||
@ -40,6 +43,8 @@ type
|
|||||||
Shift: TShiftState; X, Y: Integer);
|
Shift: TShiftState; X, Y: Integer);
|
||||||
procedure ToolBar1EndDrag(Sender, Target: TObject; X, Y: Integer);
|
procedure ToolBar1EndDrag(Sender, Target: TObject; X, Y: Integer);
|
||||||
procedure ToolBar1StartDrag(Sender: TObject; var DragObject: TDragObject);
|
procedure ToolBar1StartDrag(Sender: TObject; var DragObject: TDragObject);
|
||||||
|
procedure ToolButtonDisableAllClick(Sender: TObject);
|
||||||
|
procedure ToolButtonEnableAllClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
FGroupKind: TBreakpointGroupFrameKind;
|
FGroupKind: TBreakpointGroupFrameKind;
|
||||||
FOnDeleteGroup: TOnDeleteGroup;
|
FOnDeleteGroup: TOnDeleteGroup;
|
||||||
@ -60,6 +65,7 @@ type
|
|||||||
AGroupKind: TBreakpointGroupFrameKind = bgfGroup); reintroduce;
|
AGroupKind: TBreakpointGroupFrameKind = bgfGroup); reintroduce;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure UpdateDisplay;
|
procedure UpdateDisplay;
|
||||||
|
procedure UpdateButtons;
|
||||||
function Compare(AnOther: TBreakpointGroupFrame): integer;
|
function Compare(AnOther: TBreakpointGroupFrame): integer;
|
||||||
|
|
||||||
property Visible: boolean read GetVisible write SetVisible;
|
property Visible: boolean read GetVisible write SetVisible;
|
||||||
@ -97,6 +103,34 @@ begin
|
|||||||
FOwner.FDraggingGroupHeader := True;
|
FOwner.FDraggingGroupHeader := True;
|
||||||
end;
|
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);
|
procedure TBreakpointGroupFrame.BtnDeleteClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if assigned(FOnDeleteGroup) then
|
if assigned(FOnDeleteGroup) then
|
||||||
@ -211,6 +245,7 @@ begin
|
|||||||
FBrkGroup := nil;
|
FBrkGroup := nil;
|
||||||
FGroupKind := bgfAbandoned;
|
FGroupKind := bgfAbandoned;
|
||||||
Visible := False;
|
Visible := False;
|
||||||
|
UpdateButtons;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TBreakpointGroupFrame.GetName: String;
|
function TBreakpointGroupFrame.GetName: String;
|
||||||
@ -258,6 +293,16 @@ begin
|
|||||||
if AGroupKind = bgfGroup then
|
if AGroupKind = bgfGroup then
|
||||||
FGroupKind := bgfUngrouped;
|
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.Visible := FBrkGroup <> nil;
|
||||||
BtnDelete.Images := IDEImages.Images_16;
|
BtnDelete.Images := IDEImages.Images_16;
|
||||||
BtnDelete.ImageIndex := IDEImages.LoadImage('menu_close');
|
BtnDelete.ImageIndex := IDEImages.LoadImage('menu_close');
|
||||||
@ -274,6 +319,8 @@ end;
|
|||||||
|
|
||||||
procedure TBreakpointGroupFrame.UpdateDisplay;
|
procedure TBreakpointGroupFrame.UpdateDisplay;
|
||||||
begin
|
begin
|
||||||
|
UpdateButtons;
|
||||||
|
|
||||||
case FGroupKind of
|
case FGroupKind of
|
||||||
bgfUngrouped: begin
|
bgfUngrouped: begin
|
||||||
StaticText1.Caption := BreakViewHeaderNoGroup;
|
StaticText1.Caption := BreakViewHeaderNoGroup;
|
||||||
@ -299,6 +346,29 @@ begin
|
|||||||
|
|
||||||
end;
|
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;
|
function TBreakpointGroupFrame.Compare(AnOther: TBreakpointGroupFrame): integer;
|
||||||
begin
|
begin
|
||||||
Result := ord(FGroupKind) - ord(AnOther.FGroupKind);
|
Result := ord(FGroupKind) - ord(AnOther.FGroupKind);
|
||||||
|
@ -188,6 +188,7 @@ type
|
|||||||
procedure JumpToCurrentBreakPoint;
|
procedure JumpToCurrentBreakPoint;
|
||||||
procedure ShowProperties;
|
procedure ShowProperties;
|
||||||
protected
|
protected
|
||||||
|
procedure CreateWnd; override;
|
||||||
procedure AcceptGroupHeaderDrop(ADroppedGroupFrame: TBreakpointGroupFrame; ATargetNode: PVirtualNode); override;
|
procedure AcceptGroupHeaderDrop(ADroppedGroupFrame: TBreakpointGroupFrame; ATargetNode: PVirtualNode); override;
|
||||||
procedure DoBreakPointsChanged; override;
|
procedure DoBreakPointsChanged; override;
|
||||||
procedure DoBeginUpdate; override;
|
procedure DoBeginUpdate; override;
|
||||||
@ -954,6 +955,7 @@ var
|
|||||||
AllCanEnable, AllCanDisable: Boolean;
|
AllCanEnable, AllCanDisable: Boolean;
|
||||||
CurBreakPoint: TIDEBreakPoint;
|
CurBreakPoint: TIDEBreakPoint;
|
||||||
TotalCnt: Integer;
|
TotalCnt: Integer;
|
||||||
|
g: TBreakpointGroupFrame;
|
||||||
begin
|
begin
|
||||||
if UpdateCount > 0 then exit;
|
if UpdateCount > 0 then exit;
|
||||||
|
|
||||||
@ -1000,6 +1002,12 @@ begin
|
|||||||
actGroupSetNew.Enabled := ItemSelected;
|
actGroupSetNew.Enabled := ItemSelected;
|
||||||
actGroupSetNone.Enabled := ItemSelected;
|
actGroupSetNone.Enabled := ItemSelected;
|
||||||
|
|
||||||
|
for VNode in tvBreakPoints.ControlNodes do begin
|
||||||
|
g := GetGroupFrame(VNode);
|
||||||
|
if g <> nil then
|
||||||
|
g.UpdateDisplay;
|
||||||
|
end;
|
||||||
|
|
||||||
tvBreakPoints.Invalidate;
|
tvBreakPoints.Invalidate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1618,6 +1626,22 @@ begin
|
|||||||
end;
|
end;
|
||||||
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;
|
procedure TBreakPointsDlg.DoBreakPointsChanged;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user