Componentes.Terceros.RemObj.../official/5.0.30.691/Data Abstract for Delphi/Samples/Dynamic Where/memoForm.pas

62 lines
1.2 KiB
ObjectPascal

unit memoForm;
interface
uses
Forms, StdCtrls, ComCtrls, Classes, Controls, ExtCtrls
;
type
TfrmMemo = class(TForm)
Panel1: TPanel;
edtMemo: TRichEdit;
btnOK: TButton;
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure btnOKClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
class procedure Execute(const ACaption: string; const Memos: string; WordWrap: Boolean);
end;
implementation
uses
Windows
;
{$R *.dfm}
class procedure TfrmMemo.Execute(const ACaption: string; const Memos: string;
WordWrap: Boolean);
var
Frm: TfrmMemo;
begin
Frm := TfrmMemo.Create(Application);
try
Frm.Caption := ACaption;
Frm.edtMemo.WordWrap := WordWrap;
Frm.edtMemo.Lines.Text := Memos;
Frm.ShowModal();
finally
Frm.Release();
end;
end;
procedure TfrmMemo.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (Shift = []) and (Key = VK_ESCAPE) then
Close();
end;
procedure TfrmMemo.btnOKClick(Sender: TObject);
begin
Close();
end;
end.