mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 09:16:13 +02:00
TPromptDialog: handle Ctrl+C (copy MSG to clipboard).
Issue #0016295. git-svn-id: trunk@42005 -
This commit is contained in:
parent
d79ef4641e
commit
2b0d38d8b6
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user