summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/fpg_dialogs.pas18
-rw-r--r--src/gui/messagedialog.inc16
2 files changed, 25 insertions, 9 deletions
diff --git a/src/gui/fpg_dialogs.pas b/src/gui/fpg_dialogs.pas
index baa2bb92..8f3639e6 100644
--- a/src/gui/fpg_dialogs.pas
+++ b/src/gui/fpg_dialogs.pas
@@ -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,
@@ -450,10 +450,18 @@ end;
procedure TfpgMessageBox.FormKeyPressed(Sender: TObject; var KeyCode: word;
var ShiftState: TShiftState; var Consumed: boolean);
begin
- if KeyCode = keyEscape then
- begin
- Consumed := False;
- Close;
+ case CheckClipBoardKey(keycode, shiftstate) of
+ ckCopy:
+ begin
+ fpgClipboard.Text := FLines.Text;
+ Consumed := True;
+ end;
+ else
+ if KeyCode = keyEscape then
+ begin
+ Consumed := True;
+ Close;
+ end;
end;
end;
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;