Skip to content

Commit

Permalink
add copy to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
cheat-engine committed Jul 6, 2016
1 parent 8d631db commit 3de5cb1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
17 changes: 11 additions & 6 deletions Cheat Engine/frmDisassemblyscanunit.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ object frmDisassemblyscan: TfrmDisassemblyscan
OnDestroy = FormDestroy
OnShow = FormShow
Position = poScreenCenter
LCLVersion = '1.0.8.0'
LCLVersion = '1.6.0.4'
object Label1: TLabel
Left = 0
Height = 14
Top = 156
Height = 13
Top = 157
Width = 447
Align = alBottom
Alignment = taCenter
Expand All @@ -25,23 +25,24 @@ object frmDisassemblyscan: TfrmDisassemblyscan
end
object ListBox1: TListBox
Left = 0
Height = 156
Height = 157
Top = 0
Width = 381
Align = alClient
ItemHeight = 0
MultiSelect = True
OnDblClick = ListBox1DblClick
OnKeyDown = ListBox1KeyDown
PopupMenu = PopupMenu1
TabOrder = 0
end
object Panel1: TPanel
Left = 381
Height = 156
Height = 157
Top = 0
Width = 66
Align = alRight
ClientHeight = 156
ClientHeight = 157
ClientWidth = 66
TabOrder = 1
OnClick = Panel1Click
Expand Down Expand Up @@ -70,5 +71,9 @@ object frmDisassemblyscan: TfrmDisassemblyscan
ShortCut = 32
OnClick = MenuItem1Click
end
object MenuItem2: TMenuItem
Caption = 'Copy selection to clipboard'
OnClick = MenuItem2Click
end
end
end
1 change: 1 addition & 0 deletions Cheat Engine/frmDisassemblyscanunit.lrt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ TFRMDISASSEMBLYSCAN.CAPTION=Assemblyscan
TFRMDISASSEMBLYSCAN.LABEL1.CAPTION=
TFRMDISASSEMBLYSCAN.BTNCANCEL.CAPTION=Cancel
TFRMDISASSEMBLYSCAN.MENUITEM1.CAPTION=Go to this address
TFRMDISASSEMBLYSCAN.MENUITEM2.CAPTION=Copy selection to clipboard
19 changes: 18 additions & 1 deletion Cheat Engine/frmDisassemblyscanunit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface
uses
windows, LCLIntf, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,disassembler,{$ifndef net}NewKernelHandler,{$endif}CEFuncProc, ExtCtrls, StdCtrls,
ComCtrls, LResources, LCLProc, Menus, strutils, OldRegExpr, RegExpr;
ComCtrls, LResources, LCLProc, Menus, strutils, OldRegExpr, RegExpr, Clipbrd;

type
TfrmDisassemblyscan = class;
Expand Down Expand Up @@ -36,13 +36,15 @@ TfrmDisassemblyscan = class(TForm)
ListBox1: TListBox;
Label1: TLabel;
MenuItem1: TMenuItem;
MenuItem2: TMenuItem;
Panel1: TPanel;
PopupMenu1: TPopupMenu;
Timer1: TTimer;
procedure ListBox1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState
);
procedure ListBox1KeyPress(Sender: TObject; var Key: char);
procedure MenuItem1Click(Sender: TObject);
procedure MenuItem2Click(Sender: TObject);
procedure Panel1Click(Sender: TObject);
procedure Panel1Resize(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
Expand Down Expand Up @@ -202,6 +204,21 @@ procedure TfrmDisassemblyscan.MenuItem1Click(Sender: TObject);
listbox1.OnDblClick(listbox1);
end;

procedure TfrmDisassemblyscan.MenuItem2Click(Sender: TObject);
var
i: integer;
sl: tstringlist;
begin
sl:=tstringlist.create;

for i:=0 to listbox1.Items.count-1 do
if listbox1.Selected[i] then
sl.add(listbox1.items[i]);

clipboard.AsText:=sl.text;
sl.free;
end;

procedure TfrmDisassemblyscan.ListBox1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
Expand Down

0 comments on commit 3de5cb1

Please sign in to comment.