1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
unit comterm;
{$mode objfpc}
interface
uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
StdCtrls, ExtCtrls
, LCLType
,header_utils;
type
{ TComTermForm }
TComTermForm = class(TForm)
ClearButton: TButton;
InputEdit: TEdit;
Label1: TLabel;
InputMemo: TMemo;
OutputMemo: TMemo;
procedure ClearButtonClick(Sender: TObject);
procedure InputEditKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ private declarations }
public
{ public declarations }
end;
var
ComTermForm: TComTermForm;
implementation
{ TComTermForm }
procedure TComTermForm.InputEditKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
If (Key=VK_RETURN) then begin //remember to add LCLType in uses
//writeln('Enter key');
InputMemo.Append(InputEdit.Text);
OutputMemo.Append(SendGet(InputEdit.Text));
Key:=0;
end;
end;
procedure TComTermForm.ClearButtonClick(Sender: TObject);
begin
OutputMemo.Clear;
InputMemo.Clear;
InputEdit.Clear;
InputEdit.SetFocus;
end;
initialization
{$I comterm.lrs}
end.
|