diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2013-03-15 12:22:12 +0000 |
---|---|---|
committer | David Laurence Emerson <dle3ab@angelbase.com> | 2013-05-28 00:42:47 -0700 |
commit | 6c32c2b218a95197db24d1a99d0775aa4cc21cea (patch) | |
tree | 3b4b866ddb8fbd09ae4369aefdb84f899f21d415 /examples/apps | |
parent | ceefc61fa412dca7aa797532862fe4911327b7ad (diff) | |
download | fpGUI-6c32c2b218a95197db24d1a99d0775aa4cc21cea.tar.xz |
ide: Adds the ability to copy the Messages output to the clipboard
Diffstat (limited to 'examples/apps')
-rw-r--r-- | examples/apps/ide/src/frm_main.pas | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/apps/ide/src/frm_main.pas b/examples/apps/ide/src/frm_main.pas index e13f102b..f5adaec6 100644 --- a/examples/apps/ide/src/frm_main.pas +++ b/examples/apps/ide/src/frm_main.pas @@ -97,6 +97,7 @@ type procedure miProjectSaveAs(Sender: TObject); procedure miProjectAddUnitToProject(Sender: TObject); procedure tvProjectDoubleClick(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); + procedure grdMessageKeyPressed(Sender: TObject; var KeyCode: Word; var ShiftState: TShiftState; var Consumed: Boolean); procedure TabSheetClosing(Sender: TObject; ATabSheet: TfpgTabSheet); procedure BuildTerminated(Sender: TObject); procedure BuildOutput(Sender: TObject; const ALine: string); @@ -529,6 +530,22 @@ begin end; end; +procedure TMainForm.grdMessageKeyPressed(Sender: TObject; var KeyCode: Word; var ShiftState: TShiftState; var Consumed: Boolean); +var + cr: TClipboardKeyType; + i: integer; + s: TfpgString; +begin + cr := CheckClipboardKey(KeyCode, ShiftState); + if cr = ckCopy then + begin + s := ''; + for i := 0 to grdMessages.RowCount-1 do + s := s + grdMessages.Cells[0, i] + LineEnding; + fpgClipboard.Text := s; + end; +end; + procedure TMainForm.TabSheetClosing(Sender: TObject; ATabSheet: TfpgTabSheet); var u: TUnit; @@ -1326,6 +1343,7 @@ begin RowSelect := True; ShowHeader := False; TabOrder := 13; + OnKeyPress := @grdMessageKeyPressed; end; tsScribble := TfpgTabSheet.Create(pnlWindow); |