IDE, Debugger: add "copy line" to callstack window. Issue #40392 Patch by Bruno K

This commit is contained in:
Martin 2023-07-20 19:21:34 +02:00
parent c74bd43729
commit ae1c9e4710
26 changed files with 154 additions and 23 deletions

View File

@ -8,7 +8,7 @@ object CallStackDlg: TCallStackDlg
ClientHeight = 246
ClientWidth = 562
OnCreate = FormCreate
LCLVersion = '1.9.0.0'
LCLVersion = '3.99.0.0'
Visible = True
object lvCallStack: TListView
Left = 0
@ -23,7 +23,7 @@ object CallStackDlg: TCallStackDlg
item
AutoSize = True
Caption = 'Index'
Width = 100
Width = 44
end
item
Caption = 'Source'
@ -57,34 +57,34 @@ object CallStackDlg: TCallStackDlg
ShowHint = True
TabOrder = 1
object ToolButtonShow: TToolButton
Left = 32
Left = 28
Top = 2
Action = actShow
ImageIndex = 0
ShowCaption = False
end
object ToolButtonCurrent: TToolButton
Left = 55
Left = 51
Top = 2
Action = actSetCurrent
ShowCaption = False
end
object ToolButton4: TToolButton
Left = 78
Left = 74
Height = 22
Top = 2
Caption = 'ToolButton4'
Style = tbsSeparator
end
object ToolButtonMore: TToolButton
Left = 121
Left = 113
Top = 2
Action = actViewMore
ImageIndex = 1
ShowCaption = False
end
object ToolButtonMax: TToolButton
Left = 86
Left = 78
Top = 2
Action = actViewLimit
AutoSize = True
@ -92,14 +92,14 @@ object CallStackDlg: TCallStackDlg
Style = tbsDropDown
end
object ToolButtonGoto: TToolButton
Left = 248
Left = 236
Top = 2
Action = actViewGoto
ImageIndex = 4
ShowCaption = False
end
object ToolButtonCopyAll: TToolButton
Left = 279
Left = 263
Top = 2
Action = actCopyAll
ImageIndex = 5
@ -113,28 +113,28 @@ object CallStackDlg: TCallStackDlg
Style = tbsSeparator
end
object ToolButton9: TToolButton
Left = 144
Left = 136
Height = 22
Top = 2
Caption = 'ToolButton9'
Style = tbsSeparator
end
object ToolButtonTop: TToolButton
Left = 152
Left = 140
Top = 2
Action = actViewTop
ImageIndex = 2
ShowCaption = False
end
object ToolButtonBottom: TToolButton
Left = 175
Left = 163
Top = 2
Action = actViewBottom
ImageIndex = 3
ShowCaption = False
end
object Panel1: TPanel
Left = 198
Left = 186
Height = 22
Top = 2
Width = 50
@ -164,7 +164,7 @@ object CallStackDlg: TCallStackDlg
Style = tbsCheck
end
object ToolButton2: TToolButton
Left = 271
Left = 259
Height = 22
Top = 2
Caption = 'ToolButton2'
@ -193,9 +193,15 @@ object CallStackDlg: TCallStackDlg
Action = actSetCurrent
OnClick = actSetAsCurrentClick
end
object Separator1: TMenuItem
Caption = '-'
end
object popCopyLine: TMenuItem
Action = actCopyLine
end
object popCopyAll: TMenuItem
Action = actCopyAll
OnClick = actCopyAllClick
OnClick = actCopyLineClick
end
end
object aclActions: TActionList
@ -209,14 +215,6 @@ object CallStackDlg: TCallStackDlg
)
ShortCut = 16470
end
object actSetCurrent: TAction
Caption = 'Current'
OnExecute = actSetAsCurrentClick
end
object actCopyAll: TAction
Caption = 'Copy All'
OnExecute = actCopyAllClick
end
object actViewMore: TAction
Category = 'View'
Caption = 'More'
@ -242,6 +240,19 @@ object CallStackDlg: TCallStackDlg
Caption = 'Bottom'
OnExecute = actViewBottomExecute
end
object actSetCurrent: TAction
Caption = 'Current'
OnExecute = actSetAsCurrentClick
end
object actCopyLine: TAction
Caption = 'Copy line'
OnExecute = actCopyLineClick
ShortCut = 16451
end
object actCopyAll: TAction
Caption = 'Copy All'
OnExecute = actCopyLineClick
end
object actToggleBreakPoint: TAction
Caption = 'Toggle Breakpoint'
OnExecute = actToggleBreakPointExecute

View File

@ -59,6 +59,7 @@ type
TCallStackDlg = class(TDebuggerDlg)
aclActions: TActionList;
actCopyAll: TAction;
actCopyLine: TAction;
actShowDisass: TAction;
actToggleBreakPoint: TAction;
actViewBottom: TAction;
@ -68,8 +69,10 @@ type
actViewMore: TAction;
actSetCurrent: TAction;
actShow: TAction;
popCopyLine: TMenuItem;
popShowDisass: TMenuItem;
popToggle: TMenuItem;
Separator1: TMenuItem;
ToolButtonPower: TToolButton;
ToolButton2: TToolButton;
ToolButtonTop: TToolButton;
@ -110,6 +113,7 @@ type
procedure txtGotoKeyPress(Sender: TObject; var Key: char);
procedure lvCallStackDBLCLICK(Sender: TObject);
procedure actCopyAllClick(Sender: TObject);
procedure actCopyLineClick(Sender: TObject);
procedure actSetAsCurrentClick(Sender : TObject);
procedure actShowClick(Sender: TObject);
private
@ -129,6 +133,7 @@ type
procedure UpdateView;
procedure JumpToSource;
procedure CopyToClipBoard;
procedure LineToClipBoard;
procedure ToggleBreakpoint(Item: TListItem);
protected
procedure DoBeginUpdate; override;
@ -582,6 +587,22 @@ begin
ClipBoard.AsText := S;
end;
procedure TCallStackDlg.LineToClipBoard;
var
n: integer;
Entry: TIdeCallStackEntry;
S: String;
begin
Entry := GetCurrentEntry;
if not Assigned(Entry) then
exit;
Clipboard.Clear;
ClipBoard.AsText := format('%s at %s:%d',
[GetFunction(Entry), Entry.Source, Entry.Line]);
end;
procedure TCallStackDlg.ToggleBreakpoint(Item: TListItem);
var
idx: Integer;
@ -668,6 +689,11 @@ begin
CopyToClipBoard;
end;
procedure TCallStackDlg.actCopyLineClick(Sender: TObject);
begin
LineToClipBoard;
end;
procedure TCallStackDlg.actSetAsCurrentClick(Sender : TObject);
var
Entry: TIdeCallStackEntry;
@ -798,6 +824,7 @@ begin
actShowDisass.Caption := lisViewSourceDisass;
actToggleBreakPoint.Caption := uemToggleBreakpoint;
actSetCurrent.Caption := lisCurrent;
actCopyLine.Caption := lisCopyLine;
actCopyAll.Caption := lisCopyAll;
actViewMore.Hint := lisMore;

View File

@ -168,6 +168,7 @@ resourcestring
lisViewSourceDisass = 'View Assembler';
lisMaxS = 'Max %d';
lisGotoSelected = 'Goto selected';
lisCopyLine = 'Copy Line';
lisCopyAll = 'Copy All';
lisIndex = 'Index';
lisFunction = 'Function';

View File

@ -514,6 +514,10 @@ msgstr ""
msgid "Copy all output to clipboard"
msgstr ""
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgid "Bottom"
msgstr ""

View File

@ -515,6 +515,10 @@ msgstr ""
msgid "Copy all output to clipboard"
msgstr ""
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgid "Bottom"
msgstr ""

View File

@ -521,6 +521,10 @@ msgstr ""
msgid "Copy all output to clipboard"
msgstr ""
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgid "Bottom"
msgstr ""

View File

@ -542,6 +542,10 @@ msgstr "Kopírovat vše"
msgid "Copy all output to clipboard"
msgstr "Zkopírovat celý výstup do schránky"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -540,6 +540,10 @@ msgstr "Alle &kopieren"
msgid "Copy all output to clipboard"
msgstr "Alle Ausgaben in die Zwischenablage kopieren"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -546,6 +546,10 @@ msgstr "Copiar Todo"
msgid "Copy all output to clipboard"
msgstr "Copiar toda la salida al portapapeles"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -538,6 +538,10 @@ msgstr "Kopioi kaikki"
msgid "Copy all output to clipboard"
msgstr "Kopioi kaikki tulostus leikepöydälle"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -543,6 +543,10 @@ msgstr "Tout copier"
msgid "Copy all output to clipboard"
msgstr "Copier toutes les sorties dans le presse-papiers"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -538,6 +538,10 @@ msgstr "העתק הכל"
msgid "Copy all output to clipboard"
msgstr "העתק את כל הפלט ללוח הזמני"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -542,6 +542,10 @@ msgstr "Minden másolása"
msgid "Copy all output to clipboard"
msgstr "Minden kimenet másolása a vágólapra"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -523,6 +523,10 @@ msgstr ""
msgid "Copy all output to clipboard"
msgstr ""
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgid "Bottom"
msgstr ""

View File

@ -546,6 +546,10 @@ msgstr "Copia tutto"
msgid "Copy all output to clipboard"
msgstr "Copia tutto l'output negli appunti"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -544,6 +544,10 @@ msgstr "すべてコピー"
msgid "Copy all output to clipboard"
msgstr "すべての出力をクリップボードにコピー"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -544,6 +544,10 @@ msgstr "Kopijuoti viską"
msgid "Copy all output to clipboard"
msgstr "Visą išvestį kopijuoti į išvestinę"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -523,6 +523,10 @@ msgstr ""
msgid "Copy all output to clipboard"
msgstr ""
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgid "Bottom"
msgstr ""

View File

@ -542,6 +542,10 @@ msgstr "Kopiuj wszystko"
msgid "Copy all output to clipboard"
msgstr "Kopiuj wszystko do schowka"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -522,6 +522,10 @@ msgstr ""
msgid "Copy all output to clipboard"
msgstr ""
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -544,6 +544,10 @@ msgstr "Copiar Tudo"
msgid "Copy all output to clipboard"
msgstr "Copiar toda saída para área transferência"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -534,6 +534,10 @@ msgstr "Копировать все"
msgid "Copy all output to clipboard"
msgstr "Копировать весь вывод в буфер обмена"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -539,6 +539,10 @@ msgstr "Kopírovať všetko"
msgid "Copy all output to clipboard"
msgstr ""
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -529,6 +529,10 @@ msgstr "Tümünü Kopyala"
msgid "Copy all output to clipboard"
msgstr "Tüm çıktıları panoya kopyala"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -530,6 +530,10 @@ msgstr "Копіювати все"
msgid "Copy all output to clipboard"
msgstr "Копіювати весь вивід у буфер"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"

View File

@ -543,6 +543,10 @@ msgstr "复制所有"
msgid "Copy all output to clipboard"
msgstr "复制所有输出到剪贴板"
#: idedebuggerstringconstants.liscopyline
msgid "Copy Line"
msgstr ""
#: idedebuggerstringconstants.liscsbottom
msgctxt "lazarusidestrconsts.liscsbottom"
msgid "Bottom"