mirror of
http://gitlab.expertsoft.com.ua/git/expertcad
synced 2026-01-11 17:25:39 +02:00
60 lines
1.1 KiB
ObjectPascal
60 lines
1.1 KiB
ObjectPascal
unit MemoForm;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, StdCtrls;
|
|
|
|
type
|
|
TfrmMemo = class(TForm)
|
|
lbPrompt: TLabel;
|
|
Memo1: TMemo;
|
|
Button1: TButton;
|
|
Button2: TButton;
|
|
procedure Button1Click(Sender: TObject);
|
|
procedure Button2Click(Sender: TObject);
|
|
private
|
|
{ Private declarations }
|
|
public
|
|
{ Public declarations }
|
|
Function InputMemo(ACaption,APrompt:String; var Value:String):Boolean;
|
|
end;
|
|
|
|
var
|
|
frmMemo: TfrmMemo;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
{ TfrmMemo }
|
|
|
|
function TfrmMemo.InputMemo(ACaption, APrompt: String;
|
|
var Value: String): Boolean;
|
|
begin
|
|
Result := False;
|
|
Caption := aCaption;
|
|
lbPrompt.Caption := aPrompt;
|
|
Memo1.Text := Value;
|
|
ShowModal;
|
|
if ModalResult = mrOk then begin
|
|
Result := True;
|
|
Value := Memo1.Lines.Text;
|
|
end;
|
|
end;
|
|
|
|
procedure TfrmMemo.Button1Click(Sender: TObject);
|
|
begin
|
|
ModalResult := mrOk;
|
|
Hide;
|
|
end;
|
|
|
|
procedure TfrmMemo.Button2Click(Sender: TObject);
|
|
begin
|
|
ModalResult := mrCancel;
|
|
Hide;
|
|
end;
|
|
|
|
end.
|