diff --git a/lcl/dialogs.pp b/lcl/dialogs.pp index 0f8714ad95..38a0a708bd 100644 --- a/lcl/dialogs.pp +++ b/lcl/dialogs.pp @@ -23,7 +23,7 @@ interface uses Types, typinfo, Classes, LResources, SysUtils, LCLIntf, InterfaceBase, FileUtil, LCLStrConsts, LCLType, LCLProc, Forms, Controls, Themes, GraphType, - Graphics, Buttons, ButtonPanel, StdCtrls, ExtCtrls, LCLClasses; + Graphics, Buttons, ButtonPanel, StdCtrls, ExtCtrls, LCLClasses, ClipBrd; type diff --git a/lcl/include/promptdialog.inc b/lcl/include/promptdialog.inc index 067ca6c7ad..37bd1f7745 100644 --- a/lcl/include/promptdialog.inc +++ b/lcl/include/promptdialog.inc @@ -17,6 +17,8 @@ type private FCancelKind: TBitBtnKind; function CreateButtons(AVerticalLayout: Boolean; ASpacing: Integer): Integer; + protected + procedure KeyDown(var Key: Word; Shift: TShiftState); override; public IsSmallDevice: Boolean; @@ -89,6 +91,16 @@ begin DefaultButton.Default := True; end; +procedure TPromptDialog.KeyDown(var Key: Word; Shift: TShiftState); +begin + inherited KeyDown(Key, Shift); + if (Shift = [ssModifier]) and (Key = VK_C) then + begin + Key := 0; + ClipBoard.AsText := MSG; + end; +end; + procedure TPromptDialog.Paint; var UseMaskHandle: HBitmap; @@ -111,13 +123,14 @@ begin end; constructor TPromptDialog.CreateMessageDialog(const ACaption, aMsg: string; - DialogType : longint; TheButtons: PLongint; ButtonCount, DefaultIndex : Longint); + DialogType: Longint; TheButtons: PLongint; ButtonCount, DefaultIndex: Longint + ); var curBtn: Integer; curKind: TBitBtnKind; begin inherited CreateNew(nil, 1); - + KeyPreview := True; //needed for capturing Ctrl+C in KeyDown IsSmallDevice := (Screen.Width <= 300); AutoScroll := False;