summaryrefslogtreecommitdiff
path: root/src/gui/messagedialog.inc
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2012-09-26 22:22:37 +0100
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2012-09-26 22:22:37 +0100
commita37b44fabbfe9db5e10bad4c1a3e67c3d55ccae8 (patch)
treeefa371b4a572b8ccfe73baadc7e7a4f8f16cca7e /src/gui/messagedialog.inc
parent345e2c2047c2b2e388ff6ade61aea4b5e505c151 (diff)
downloadfpGUI-a37b44fabbfe9db5e10bad4c1a3e67c3d55ccae8.tar.xz
You can now copy to clipboard the content of message dialogs.
The TfpgMessageDialog and TfpgMessageBox dialogs now support the "copy to clipboard" keyboard shortcuts. This is nice and handy for pasting an error message into an email or something.
Diffstat (limited to 'src/gui/messagedialog.inc')
-rw-r--r--src/gui/messagedialog.inc16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gui/messagedialog.inc b/src/gui/messagedialog.inc
index f5651c7a..0c5c1f24 100644
--- a/src/gui/messagedialog.inc
+++ b/src/gui/messagedialog.inc
@@ -1,7 +1,7 @@
{
fpGUI - Free Pascal GUI Toolkit
- Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this
+ Copyright (C) 2006 - 2012 See the file AUTHORS.txt, included in this
distribution, for details of the copyright.
See the file COPYING.modifiedLGPL, included in this distribution,
@@ -330,10 +330,18 @@ end;
procedure TfpgMessageDialog.HandleKeyPress(var keycode: word;
var shiftstate: TShiftState; var consumed: boolean);
begin
- if keycode = keyEscape then // Esc cancels the dialog
- ModalResult := mrCancel
+ case CheckClipBoardKey(keycode, shiftstate) of
+ ckCopy:
+ begin
+ fpgClipboard.Text := Text + LineEnding + LineEnding + InformativeText;
+ Consumed := True;
+ end;
else
- inherited HandleKeyPress(keycode, shiftstate, consumed);
+ if keycode = keyEscape then // Esc cancels the dialog
+ ModalResult := mrCancel
+ else
+ inherited HandleKeyPress(keycode, shiftstate, consumed);
+ end;
end;
procedure TfpgMessageDialog.PrepareLayout;