File: comterm.pas

package info (click to toggle)
udm 1.0.0.352-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,076 kB
  • sloc: pascal: 72,496; ansic: 6,892; awk: 880; makefile: 768; sh: 493; perl: 34; python: 22; tcl: 18
file content (61 lines) | stat: -rw-r--r-- 1,125 bytes parent folder | download | duplicates (3)
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.