diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2013-03-15 12:22:12 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2013-03-15 15:08:37 +0000 |
commit | 350e85c64e3ea2cb56e0a2a2454bb13d36a3e39a (patch) | |
tree | df4d6c83d8284842252ad4ffeb290aa8a44a1be1 /examples | |
parent | bf949cb2ef2ef24339ea4ba5c5928b15b8afe310 (diff) | |
download | fpGUI-350e85c64e3ea2cb56e0a2a2454bb13d36a3e39a.tar.xz |
ide: Adds the ability to copy the Messages output to the clipboard
Diffstat (limited to 'examples')
-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); |