mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 18:08:35 +02:00
Debugger: Inspect-Win, move array navigation to frame / add images
This commit is contained in:
parent
90453ce72b
commit
626207d7ff
@ -78,9 +78,6 @@ resourcestring
|
||||
drsLen = 'Len=%d: ';
|
||||
synfNewValueIsEmpty = '"New value" is empty.';
|
||||
synfTheDebuggerWasNotAbleToModifyTheValue = 'The debugger was not able to modify the value.';
|
||||
dlgInspectIndexOfFirstItemToShow = 'Index of first item to show';
|
||||
dlgInspectAmountOfItemsToShow = 'Amount of items to show';
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -193,114 +193,39 @@ object IDEInspectDlg: TIDEInspectDlg
|
||||
Caption = 'tbDiv5'
|
||||
Style = tbsDivider
|
||||
end
|
||||
object pnlArrayNav: TPanel
|
||||
inline ArrayNavigationBar1: TArrayNavigationBar
|
||||
Left = 285
|
||||
Height = 23
|
||||
Top = 2
|
||||
Width = 242
|
||||
AutoSize = True
|
||||
BevelOuter = bvNone
|
||||
ClientHeight = 23
|
||||
ClientWidth = 242
|
||||
TabOrder = 0
|
||||
Visible = False
|
||||
object btnArrayFastUp: TSpeedButton
|
||||
Left = 23
|
||||
inherited btnArrayFastUp: TSpeedButton
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 23
|
||||
Align = alLeft
|
||||
Caption = '<<'
|
||||
Flat = True
|
||||
OnClick = BtnArrayNavClicked
|
||||
end
|
||||
object btnArrayFastDown: TSpeedButton
|
||||
Left = 106
|
||||
inherited btnArrayFastDown: TSpeedButton
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 23
|
||||
Align = alLeft
|
||||
Caption = '>>'
|
||||
Flat = True
|
||||
OnClick = BtnArrayNavClicked
|
||||
end
|
||||
object edArrayStart: TSpinEditEx
|
||||
Left = 46
|
||||
inherited edArrayStart: TSpinEditEx
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 60
|
||||
Align = alLeft
|
||||
MaxLength = 0
|
||||
TabOrder = 0
|
||||
OnEditingDone = edArrayStartEditingDone
|
||||
Increment = 10
|
||||
NullValue = 0
|
||||
UpDownVisible = False
|
||||
Value = 0
|
||||
end
|
||||
object btnArrayStart: TSpeedButton
|
||||
Left = 0
|
||||
inherited btnArrayStart: TSpeedButton
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 23
|
||||
Align = alLeft
|
||||
Caption = '|<'
|
||||
Flat = True
|
||||
OnClick = BtnArrayNavClicked
|
||||
end
|
||||
object btnArrayEnd: TSpeedButton
|
||||
Left = 129
|
||||
inherited btnArrayEnd: TSpeedButton
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 23
|
||||
Align = alLeft
|
||||
Caption = '>|'
|
||||
Flat = True
|
||||
OnClick = BtnArrayNavClicked
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 152
|
||||
inherited Label1: TLabel
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 4
|
||||
Align = alLeft
|
||||
AutoSize = False
|
||||
end
|
||||
object btnArrayPageDec: TSpeedButton
|
||||
Left = 156
|
||||
inherited btnArrayPageDec: TSpeedButton
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 23
|
||||
Align = alLeft
|
||||
Caption = '-'
|
||||
Flat = True
|
||||
OnClick = BtnArrayPageClicked
|
||||
end
|
||||
object edArrayPageSize: TSpinEditEx
|
||||
Left = 179
|
||||
inherited edArrayPageSize: TSpinEditEx
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 40
|
||||
Align = alLeft
|
||||
MaxLength = 0
|
||||
TabOrder = 1
|
||||
OnEditingDone = edArrayPageSizeEditingDone
|
||||
Increment = 10
|
||||
MaxValue = 5000
|
||||
MinValue = 10
|
||||
NullValue = 0
|
||||
UpDownVisible = False
|
||||
Value = 200
|
||||
end
|
||||
object btnArrayPageInc: TSpeedButton
|
||||
Left = 219
|
||||
inherited btnArrayPageInc: TSpeedButton
|
||||
Height = 23
|
||||
Top = 0
|
||||
Width = 23
|
||||
Align = alLeft
|
||||
Caption = '+'
|
||||
Flat = True
|
||||
OnClick = BtnArrayPageClicked
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -40,7 +40,8 @@ uses
|
||||
// IDE
|
||||
LazarusIDEStrConsts, BaseDebugManager, InputHistory, IDEProcs, Debugger,
|
||||
IdeDebuggerWatchResPrinter, IdeDebuggerWatchResult, IdeDebuggerWatchResUtils,
|
||||
IdeDebuggerBase, DebuggerDlg, DebuggerStrConst, EnvironmentOpts;
|
||||
IdeDebuggerBase, ArrayNavigationFrame, DebuggerDlg, DebuggerStrConst,
|
||||
EnvironmentOpts;
|
||||
|
||||
type
|
||||
|
||||
@ -52,19 +53,10 @@ type
|
||||
{ TIDEInspectDlg }
|
||||
|
||||
TIDEInspectDlg = class(TDebuggerDlg)
|
||||
btnArrayPageInc: TSpeedButton;
|
||||
btnArrayEnd: TSpeedButton;
|
||||
btnArrayStart: TSpeedButton;
|
||||
btnArrayPageDec: TSpeedButton;
|
||||
edArrayPageSize: TSpinEditEx;
|
||||
ArrayNavigationBar1: TArrayNavigationBar;
|
||||
EdInspect: TComboBox;
|
||||
ErrorLabel: TLabel;
|
||||
Label1: TLabel;
|
||||
PageControl: TPageControl;
|
||||
pnlArrayNav: TPanel;
|
||||
btnArrayFastUp: TSpeedButton;
|
||||
btnArrayFastDown: TSpeedButton;
|
||||
edArrayStart: TSpinEditEx;
|
||||
StatusBar1: TStatusBar;
|
||||
DataPage: TTabSheet;
|
||||
PropertiesPage: TTabSheet;
|
||||
@ -86,15 +78,11 @@ type
|
||||
tbDiv4: TToolButton;
|
||||
tbDiv2: TToolButton;
|
||||
procedure BtnAddWatchClick(Sender: TObject);
|
||||
procedure BtnArrayNavClicked(Sender: TObject);
|
||||
procedure BtnArrayPageClicked(Sender: TObject);
|
||||
procedure btnBackwardClick(Sender: TObject);
|
||||
procedure btnColClassClick(Sender: TObject);
|
||||
procedure btnForwardClick(Sender: TObject);
|
||||
procedure btnPowerClick(Sender: TObject);
|
||||
procedure btnUseInstanceClick(Sender: TObject);
|
||||
procedure edArrayPageSizeEditingDone(Sender: TObject);
|
||||
procedure edArrayStartEditingDone(Sender: TObject);
|
||||
procedure EdInspectEditingDone(Sender: TObject);
|
||||
procedure EdInspectKeyDown(Sender: TObject; var Key: Word; {%H-}Shift: TShiftState);
|
||||
procedure FormActivate(Sender: TObject);
|
||||
@ -126,6 +114,7 @@ type
|
||||
FHistoryIndex: Integer;
|
||||
FPowerImgIdx, FPowerImgIdxGrey: Integer;
|
||||
|
||||
procedure ArrayNavChanged(Sender: TArrayNavigationBar; AValue: Int64);
|
||||
procedure DoDebuggerState(ADebugger: TDebuggerIntf; AnOldState: TDBGState);
|
||||
procedure DoWatchesInvalidated(Sender: TObject);
|
||||
procedure DoWatchUpdated(const ASender: TIdeWatches; const AWatch: TIdeWatch);
|
||||
@ -226,16 +215,6 @@ begin
|
||||
UpdateData;
|
||||
end;
|
||||
|
||||
procedure TIDEInspectDlg.edArrayPageSizeEditingDone(Sender: TObject);
|
||||
begin
|
||||
InspectResDataArray;
|
||||
end;
|
||||
|
||||
procedure TIDEInspectDlg.edArrayStartEditingDone(Sender: TObject);
|
||||
begin
|
||||
InspectResDataArray;
|
||||
end;
|
||||
|
||||
procedure TIDEInspectDlg.ContextChanged(Sender: TObject);
|
||||
begin
|
||||
FExpressionWasEvaluated := False;
|
||||
@ -368,12 +347,14 @@ begin
|
||||
|
||||
LowBnd := Res.LowBound;
|
||||
if FUpdatedData then begin
|
||||
edArrayStart.Value := LowBnd;
|
||||
ArrayNavigationBar1.LowBound := LowBnd;
|
||||
ArrayNavigationBar1.HighBound := LowBnd + Res.ArrayLength - 1;
|
||||
ArrayNavigationBar1.Index := LowBnd;
|
||||
FUpdatedData := False;
|
||||
end;
|
||||
|
||||
CurIndexOffs := edArrayStart.Value - LowBnd;
|
||||
CurPageCount := edArrayPageSize.Value;
|
||||
CurIndexOffs := ArrayNavigationBar1.Index - LowBnd;
|
||||
CurPageCount := ArrayNavigationBar1.PageSize;
|
||||
if (CurIndexOffs >= 0) and (CurIndexOffs < res.ArrayLength) then
|
||||
CurPageCount := Max(1, Min(CurPageCount, res.ArrayLength - CurIndexOffs));
|
||||
|
||||
@ -693,47 +674,6 @@ begin
|
||||
|
||||
end;
|
||||
|
||||
procedure TIDEInspectDlg.BtnArrayNavClicked(Sender: TObject);
|
||||
begin
|
||||
if (FCurrentWatchValue = nil) or (FCurrentWatchValue.ResultData=nil) then
|
||||
exit;
|
||||
if Sender = btnArrayStart then
|
||||
edArrayStart.Value := FCurrentWatchValue.ResultData.LowBound
|
||||
else
|
||||
if Sender = btnArrayFastUp then
|
||||
edArrayStart.Value := max(edArrayStart.Value - edArrayPageSize.Value,
|
||||
FCurrentWatchValue.ResultData.LowBound)
|
||||
else
|
||||
if Sender = btnArrayFastDown then
|
||||
edArrayStart.Value := min(edArrayStart.Value + edArrayPageSize.Value,
|
||||
Max(FCurrentWatchValue.ResultData.LowBound,
|
||||
FCurrentWatchValue.ResultData.LowBound
|
||||
+ FCurrentWatchValue.ResultData.ArrayLength
|
||||
- edArrayPageSize.Value)
|
||||
)
|
||||
else
|
||||
if Sender = btnArrayEnd then
|
||||
edArrayStart.Value := Max(FCurrentWatchValue.ResultData.LowBound,
|
||||
FCurrentWatchValue.ResultData.LowBound
|
||||
+ FCurrentWatchValue.ResultData.ArrayLength
|
||||
- edArrayPageSize.Value)
|
||||
;
|
||||
InspectResDataArray;
|
||||
end;
|
||||
|
||||
procedure TIDEInspectDlg.BtnArrayPageClicked(Sender: TObject);
|
||||
begin
|
||||
if (FCurrentWatchValue = nil) or (FCurrentWatchValue.ResultData=nil) then
|
||||
exit;
|
||||
if Sender = btnArrayPageDec then
|
||||
edArrayPageSize.Value := Max(10, edArrayPageSize.Value - 10)
|
||||
else
|
||||
if Sender = btnArrayPageInc then
|
||||
edArrayPageSize.Value := Min(5000, edArrayPageSize.Value + 10)
|
||||
;
|
||||
InspectResDataArray;
|
||||
end;
|
||||
|
||||
procedure TIDEInspectDlg.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
begin
|
||||
if (Key = VK_ESCAPE) and not Docked then
|
||||
@ -1226,6 +1166,10 @@ begin
|
||||
DebugBoss.RegisterStateChangeHandler(@DoDebuggerState);
|
||||
DebugBoss.RegisterWatchesInvalidatedHandler(@DoWatchesInvalidated);
|
||||
|
||||
ArrayNavigationBar1.OnIndexChanged := @ArrayNavChanged;
|
||||
ArrayNavigationBar1.OnPageSize := @ArrayNavChanged;
|
||||
ArrayNavigationBar1.Visible := False;
|
||||
|
||||
FHistory := TStringList.Create;
|
||||
|
||||
FGridData:=TStringGrid.Create(DataPage);
|
||||
@ -1264,9 +1208,6 @@ begin
|
||||
btnBackward.Enabled := FHistoryIndex > 0;
|
||||
btnForward.Enabled := FHistoryIndex < FHistory.Count - 1;
|
||||
|
||||
edArrayStart.Hint := dlgInspectIndexOfFirstItemToShow;
|
||||
edArrayPageSize.Hint := dlgInspectAmountOfItemsToShow;
|
||||
|
||||
Clear;
|
||||
end;
|
||||
|
||||
@ -1327,7 +1268,7 @@ begin
|
||||
exit;
|
||||
|
||||
FExpression:=FHistory[FHistoryIndex];
|
||||
edArrayStart.Value := 0;
|
||||
ArrayNavigationBar1.Index := 0;
|
||||
EdInspect.Text := FExpression;
|
||||
UpdateData;
|
||||
end;
|
||||
@ -1366,6 +1307,7 @@ begin
|
||||
FHumanReadable := FWatchPrinter.PrintWatchValue(FCurrentWatchValue.ResultData, wdfStructure);
|
||||
|
||||
if FCurrentWatchValue.Validity = ddsValid then begin
|
||||
ArrayNavigationBar1.Visible := False;
|
||||
if FCurrentWatchValue.TypeInfo <> nil then begin
|
||||
case FCurrentWatchValue.TypeInfo.Kind of
|
||||
skClass, skObject, skInterface: InspectClass();
|
||||
@ -1392,7 +1334,7 @@ begin
|
||||
end
|
||||
else begin
|
||||
// resultdata
|
||||
pnlArrayNav.Visible := FCurrentWatchValue.ResultData.ValueKind = rdkArray;
|
||||
ArrayNavigationBar1.Visible := FCurrentWatchValue.ResultData.ValueKind = rdkArray;
|
||||
case FCurrentWatchValue.ResultData.ValueKind of
|
||||
//rdkError: ;
|
||||
rdkPrePrinted,
|
||||
@ -1443,6 +1385,12 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TIDEInspectDlg.ArrayNavChanged(Sender: TArrayNavigationBar;
|
||||
AValue: Int64);
|
||||
begin
|
||||
InspectResDataArray;
|
||||
end;
|
||||
|
||||
procedure TIDEInspectDlg.DoWatchesInvalidated(Sender: TObject);
|
||||
begin
|
||||
if (not btnPower.Down) or (not Visible) then exit;
|
||||
@ -1509,11 +1457,11 @@ begin
|
||||
if AWatch = nil then begin
|
||||
FInspectWatches.Clear;
|
||||
AWatch := FInspectWatches.Add(expr);
|
||||
edArrayStart.Value := 0;
|
||||
ArrayNavigationBar1.Index := 0;
|
||||
end;
|
||||
AWatch.EvaluateFlags := Opts;
|
||||
AWatch.Enabled := True;
|
||||
AWatch.RepeatCount := edArrayPageSize.Value;
|
||||
AWatch.RepeatCount := ArrayNavigationBar1.PageSize;
|
||||
FInspectWatches.EndUpdate;
|
||||
FCurrentWatchValue := AWatch.Values[tid, idx];
|
||||
if FCurrentWatchValue <> nil then begin
|
||||
|
110
ide/packages/idedebugger/arraynavigationframe.lfm
Normal file
110
ide/packages/idedebugger/arraynavigationframe.lfm
Normal file
@ -0,0 +1,110 @@
|
||||
object ArrayNavigationBar: TArrayNavigationBar
|
||||
Left = 0
|
||||
Height = 26
|
||||
Top = 0
|
||||
Width = 320
|
||||
AutoSize = True
|
||||
ClientHeight = 26
|
||||
ClientWidth = 320
|
||||
TabOrder = 0
|
||||
DesignLeft = 518
|
||||
DesignTop = 777
|
||||
object btnArrayFastDown: TSpeedButton
|
||||
Left = 23
|
||||
Height = 26
|
||||
Top = 0
|
||||
Width = 23
|
||||
Align = alLeft
|
||||
Caption = '<<'
|
||||
Flat = True
|
||||
OnClick = BtnChangePageClicked
|
||||
end
|
||||
object btnArrayFastUp: TSpeedButton
|
||||
Left = 106
|
||||
Height = 26
|
||||
Top = 0
|
||||
Width = 23
|
||||
Align = alLeft
|
||||
Caption = '>>'
|
||||
Flat = True
|
||||
OnClick = BtnChangePageClicked
|
||||
end
|
||||
object edArrayStart: TSpinEditEx
|
||||
Left = 46
|
||||
Height = 26
|
||||
Top = 0
|
||||
Width = 60
|
||||
Align = alLeft
|
||||
MaxLength = 0
|
||||
TabOrder = 0
|
||||
OnEditingDone = edArrayStartEditingDone
|
||||
Increment = 10
|
||||
NullValue = 0
|
||||
UpDownVisible = False
|
||||
Value = 0
|
||||
end
|
||||
object btnArrayStart: TSpeedButton
|
||||
Left = 0
|
||||
Height = 26
|
||||
Top = 0
|
||||
Width = 23
|
||||
Align = alLeft
|
||||
Caption = '|<'
|
||||
Flat = True
|
||||
OnClick = BtnChangePageClicked
|
||||
end
|
||||
object btnArrayEnd: TSpeedButton
|
||||
Left = 129
|
||||
Height = 26
|
||||
Top = 0
|
||||
Width = 23
|
||||
Align = alLeft
|
||||
Caption = '>|'
|
||||
Flat = True
|
||||
OnClick = BtnChangePageClicked
|
||||
end
|
||||
object Label1: TLabel
|
||||
Left = 152
|
||||
Height = 26
|
||||
Top = 0
|
||||
Width = 4
|
||||
Align = alLeft
|
||||
AutoSize = False
|
||||
end
|
||||
object btnArrayPageDec: TSpeedButton
|
||||
Left = 156
|
||||
Height = 26
|
||||
Top = 0
|
||||
Width = 23
|
||||
Align = alLeft
|
||||
Caption = '-'
|
||||
Flat = True
|
||||
OnClick = BtnChangeSizeClicked
|
||||
end
|
||||
object edArrayPageSize: TSpinEditEx
|
||||
Left = 179
|
||||
Height = 26
|
||||
Top = 0
|
||||
Width = 40
|
||||
Align = alLeft
|
||||
MaxLength = 0
|
||||
TabOrder = 1
|
||||
OnEditingDone = edArrayPageSizeEditingDone
|
||||
Increment = 10
|
||||
MaxValue = 5000
|
||||
MinValue = 10
|
||||
NullValue = 0
|
||||
UpDownVisible = False
|
||||
Value = 200
|
||||
end
|
||||
object btnArrayPageInc: TSpeedButton
|
||||
Left = 219
|
||||
Height = 26
|
||||
Top = 0
|
||||
Width = 23
|
||||
Align = alLeft
|
||||
Caption = '+'
|
||||
Flat = True
|
||||
OnClick = BtnChangeSizeClicked
|
||||
end
|
||||
end
|
184
ide/packages/idedebugger/arraynavigationframe.pas
Normal file
184
ide/packages/idedebugger/arraynavigationframe.pas
Normal file
@ -0,0 +1,184 @@
|
||||
unit ArrayNavigationFrame;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Math, Forms, Controls, Buttons, StdCtrls, SpinEx,
|
||||
IDEImagesIntf, IdeDebuggerStringConstants;
|
||||
|
||||
type
|
||||
|
||||
TArrayNavigationBar = class;
|
||||
|
||||
TArrayNavChangeEvent = procedure(Sender: TArrayNavigationBar; AValue: Int64) of object;
|
||||
|
||||
{ TArrayNavigationBar }
|
||||
|
||||
TArrayNavigationBar = class(TFrame)
|
||||
btnArrayEnd: TSpeedButton;
|
||||
btnArrayFastUp: TSpeedButton;
|
||||
btnArrayFastDown: TSpeedButton;
|
||||
btnArrayPageDec: TSpeedButton;
|
||||
btnArrayPageInc: TSpeedButton;
|
||||
btnArrayStart: TSpeedButton;
|
||||
edArrayPageSize: TSpinEditEx;
|
||||
edArrayStart: TSpinEditEx;
|
||||
Label1: TLabel;
|
||||
procedure BtnChangePageClicked(Sender: TObject);
|
||||
procedure BtnChangeSizeClicked(Sender: TObject);
|
||||
procedure edArrayPageSizeEditingDone(Sender: TObject);
|
||||
procedure edArrayStartEditingDone(Sender: TObject);
|
||||
private
|
||||
FHighBound: int64;
|
||||
FLowBound: int64;
|
||||
FOnIndexChanged: TArrayNavChangeEvent;
|
||||
FOnPageSize: TArrayNavChangeEvent;
|
||||
function GetIndex: int64;
|
||||
function GetPageSize: int64;
|
||||
procedure SetHighBound(AValue: int64);
|
||||
procedure SetIndex(AValue: int64);
|
||||
procedure SetLowBound(AValue: int64);
|
||||
procedure SetPageSize(AValue: int64);
|
||||
public
|
||||
constructor Create(TheOwner: TComponent); override;
|
||||
property LowBound: int64 read FLowBound write SetLowBound;
|
||||
property HighBound: int64 read FHighBound write SetHighBound;
|
||||
|
||||
property Index: int64 read GetIndex write SetIndex;
|
||||
property PageSize: int64 read GetPageSize write SetPageSize;
|
||||
published
|
||||
property OnIndexChanged: TArrayNavChangeEvent read FOnIndexChanged write FOnIndexChanged;
|
||||
property OnPageSize: TArrayNavChangeEvent read FOnPageSize write FOnPageSize;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TArrayNavigationBar }
|
||||
|
||||
procedure TArrayNavigationBar.SetHighBound(AValue: int64);
|
||||
begin
|
||||
if FHighBound = AValue then Exit;
|
||||
FHighBound := AValue;
|
||||
end;
|
||||
|
||||
procedure TArrayNavigationBar.BtnChangePageClicked(Sender: TObject);
|
||||
var
|
||||
v: int64;
|
||||
begin
|
||||
v := edArrayStart.Value;
|
||||
if Sender = btnArrayStart then
|
||||
edArrayStart.Value := FLowBound
|
||||
else
|
||||
if Sender = btnArrayFastDown then
|
||||
edArrayStart.Value := max(edArrayStart.Value - edArrayPageSize.Value,
|
||||
FLowBound)
|
||||
else
|
||||
if Sender = btnArrayFastUp then
|
||||
edArrayStart.Value := min(edArrayStart.Value + edArrayPageSize.Value,
|
||||
Max(FLowBound,
|
||||
FHighBound + 1 - edArrayPageSize.Value)
|
||||
)
|
||||
else
|
||||
if Sender = btnArrayEnd then
|
||||
edArrayStart.Value := Max(FLowBound,
|
||||
FHighBound + 1 - edArrayPageSize.Value)
|
||||
;
|
||||
if (FOnIndexChanged <> nil) and (edArrayStart.Value <> v) then
|
||||
FOnIndexChanged(Self, edArrayStart.Value);
|
||||
end;
|
||||
|
||||
procedure TArrayNavigationBar.BtnChangeSizeClicked(Sender: TObject);
|
||||
var
|
||||
v: int64;
|
||||
begin
|
||||
v := edArrayPageSize.Value;
|
||||
if Sender = btnArrayPageDec then
|
||||
edArrayPageSize.Value := Max(10, edArrayPageSize.Value - 10)
|
||||
else
|
||||
if Sender = btnArrayPageInc then
|
||||
edArrayPageSize.Value := Min(5000, edArrayPageSize.Value + 10)
|
||||
;
|
||||
if (FOnPageSize <> nil) and (edArrayPageSize.Value <> v) then
|
||||
FOnPageSize(Self, edArrayStart.Value);
|
||||
end;
|
||||
|
||||
procedure TArrayNavigationBar.edArrayPageSizeEditingDone(Sender: TObject);
|
||||
begin
|
||||
if (FOnPageSize <> nil) then
|
||||
FOnPageSize(Self, edArrayStart.Value);
|
||||
end;
|
||||
|
||||
procedure TArrayNavigationBar.edArrayStartEditingDone(Sender: TObject);
|
||||
begin
|
||||
if (FOnIndexChanged <> nil) then
|
||||
FOnIndexChanged(Self, edArrayStart.Value);
|
||||
end;
|
||||
|
||||
function TArrayNavigationBar.GetIndex: int64;
|
||||
begin
|
||||
Result := edArrayStart.Value;
|
||||
end;
|
||||
|
||||
function TArrayNavigationBar.GetPageSize: int64;
|
||||
begin
|
||||
Result := edArrayPageSize.Value;
|
||||
end;
|
||||
|
||||
procedure TArrayNavigationBar.SetIndex(AValue: int64);
|
||||
begin
|
||||
edArrayStart.Value := AValue;
|
||||
end;
|
||||
|
||||
procedure TArrayNavigationBar.SetLowBound(AValue: int64);
|
||||
begin
|
||||
if FLowBound = AValue then Exit;
|
||||
FLowBound := AValue;
|
||||
end;
|
||||
|
||||
procedure TArrayNavigationBar.SetPageSize(AValue: int64);
|
||||
begin
|
||||
edArrayPageSize.Value := AValue;
|
||||
end;
|
||||
|
||||
constructor TArrayNavigationBar.Create(TheOwner: TComponent);
|
||||
begin
|
||||
inherited Create(TheOwner);
|
||||
|
||||
edArrayStart.Hint := dlgInspectIndexOfFirstItemToShow;
|
||||
edArrayPageSize.Hint := dlgInspectAmountOfItemsToShow;
|
||||
|
||||
btnArrayStart.Images := IDEImages.Images_16;
|
||||
btnArrayStart.ImageIndex := IDEImages.LoadImage('NavArrow_F');
|
||||
btnArrayStart.Caption := '';
|
||||
|
||||
btnArrayFastDown.Images := IDEImages.Images_16;
|
||||
btnArrayFastDown.ImageIndex := IDEImages.LoadImage('NavArrow_L');
|
||||
btnArrayFastDown.Caption := '';
|
||||
|
||||
btnArrayFastUp.Images := IDEImages.Images_16;
|
||||
btnArrayFastUp.ImageIndex := IDEImages.LoadImage('NavArrow_R');
|
||||
btnArrayFastUp.Caption := '';
|
||||
|
||||
btnArrayEnd.Images := IDEImages.Images_16;
|
||||
btnArrayEnd.ImageIndex := IDEImages.LoadImage('NavArrow_E');
|
||||
btnArrayEnd.Caption := '';
|
||||
|
||||
btnArrayPageDec.Images := IDEImages.Images_16;
|
||||
btnArrayPageDec.ImageIndex := IDEImages.LoadImage('NavMinus');
|
||||
btnArrayPageDec.Caption := '';
|
||||
|
||||
btnArrayPageInc.Images := IDEImages.Images_16;
|
||||
btnArrayPageInc.ImageIndex := IDEImages.LoadImage('NavPlus');
|
||||
btnArrayPageInc.Caption := '';
|
||||
|
||||
|
||||
btnArrayFastDown.Caption := '';
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -60,8 +60,20 @@
|
||||
<Filename Value="idedebuggerwatchresutils.pas"/>
|
||||
<UnitName Value="IdeDebuggerWatchResUtils"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<Filename Value="arraynavigationframe.pas"/>
|
||||
<UnitName Value="ArrayNavigationFrame"/>
|
||||
<ResourceBaseClass Value="Frame"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<Filename Value="idedebuggerstringconstants.pas"/>
|
||||
<UnitName Value="IdeDebuggerStringConstants"/>
|
||||
</Item>
|
||||
</Files>
|
||||
<RequiredPkgs>
|
||||
<Item>
|
||||
<PackageName Value="LazControlDsgn"/>
|
||||
</Item>
|
||||
<Item>
|
||||
<PackageName Value="laz.virtualtreeview_package"/>
|
||||
</Item>
|
||||
|
@ -10,7 +10,8 @@ interface
|
||||
uses
|
||||
IdeDebuggerBase, Debugger, ProcessDebugger, ProcessList, DebuggerTreeView,
|
||||
IdeDebuggerUtils, IdeDebuggerWatchResult, IdeDebuggerWatchResPrinter,
|
||||
IdeDebuggerWatchResUtils, LazarusPackageIntf;
|
||||
IdeDebuggerWatchResUtils, ArrayNavigationFrame, IdeDebuggerStringConstants,
|
||||
LazarusPackageIntf;
|
||||
|
||||
implementation
|
||||
|
||||
|
17
ide/packages/idedebugger/idedebuggerstringconstants.pas
Normal file
17
ide/packages/idedebugger/idedebuggerstringconstants.pas
Normal file
@ -0,0 +1,17 @@
|
||||
unit IdeDebuggerStringConstants;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
{//$R images.rc}
|
||||
{$R images.res}
|
||||
|
||||
resourcestring
|
||||
dlgInspectIndexOfFirstItemToShow = 'Index of first item to show';
|
||||
dlgInspectAmountOfItemsToShow = 'Amount of items to show';
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
||||
|
@ -305,7 +305,6 @@ var
|
||||
PointerValue: TWatchResultDataPointer absolute AResValue;
|
||||
ResTypeName: String;
|
||||
PtrDeref: TWatchResultData;
|
||||
i: Integer;
|
||||
begin
|
||||
inc(ANestLvl);
|
||||
if ANestLvl > MAX_ALLOWED_NEST_LVL then
|
||||
|
19
ide/packages/idedebugger/images.rc
Normal file
19
ide/packages/idedebugger/images.rc
Normal file
@ -0,0 +1,19 @@
|
||||
NavArrow_F RCDATA "../../../images/general_purpose/Arrow_26_16.png"
|
||||
NavArrow_F_150 RCDATA "../../../images/general_purpose/Arrow_26_24.png"
|
||||
NavArrow_F_200 RCDATA "../../../images/general_purpose/Arrow_26_32.png"
|
||||
NavArrow_L RCDATA "../../../images/general_purpose/Arrow_22_16.png"
|
||||
NavArrow_L_150 RCDATA "../../../images/general_purpose/Arrow_22_24.png"
|
||||
NavArrow_L_200 RCDATA "../../../images/general_purpose/Arrow_22_32.png"
|
||||
NavArrow_R RCDATA "../../../images/general_purpose/Arrow_21_16.png"
|
||||
NavArrow_R_150 RCDATA "../../../images/general_purpose/Arrow_21_24.png"
|
||||
NavArrow_R_200 RCDATA "../../../images/general_purpose/Arrow_21_32.png"
|
||||
NavArrow_E RCDATA "../../../images/general_purpose/Arrow_25_16.png"
|
||||
NavArrow_E_150 RCDATA "../../../images/general_purpose/Arrow_25_24.png"
|
||||
NavArrow_E_200 RCDATA "../../../images/general_purpose/Arrow_25_32.png"
|
||||
NavPlus RCDATA "../../../images/general_purpose/Add_07_16.png"
|
||||
NavPlus_150 RCDATA "../../../images/general_purpose/Add_07_24.png"
|
||||
NavPlus_200 RCDATA "../../../images/general_purpose/Add_07_32.png"
|
||||
NavMinus RCDATA "../../../images/general_purpose/Remove_07_16.png"
|
||||
NavMinus_150 RCDATA "../../../images/general_purpose/Remove_07_24.png"
|
||||
NavMinus_200 RCDATA "../../../images/general_purpose/Remove_07_32.png"
|
||||
|
BIN
ide/packages/idedebugger/images.res
Normal file
BIN
ide/packages/idedebugger/images.res
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user