unit Ledlp_6a;

interface

uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls, Ledlp;

type
  TForm1 = class(TForm)
    LEdit1: TLEdit;
    Button1: TButton;
    Edit1: TEdit;
    Label1: TLabel;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Button6: TButton;
    Button7: TButton;
    Button8: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button8Click(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
  { Append the text to the end of the text within LEdit }
  LEdit1.AddStr(Edit1.Text);
  { Set focus to LEdit }
  LEdit1.SetFocus;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  { Add a Carriage Return to the end of the text }
  LEdit1.AddStr(#13);
  LEdit1.SetFocus;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
  LEdit1.OpenFile;
  LEdit1.SetFocus;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  LEdit1.SaveFile;
  LEdit1.SetFocus;
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
  LEdit1.Clear;
  Edit1.Clear;
  LEdit1.SetFocus;
end;

procedure TForm1.Button7Click(Sender: TObject);
begin
  { Get the current line or selected text and put it into the Edit box }
  Edit1.Text := LEdit1.GetStr;
  { Set the focus to the Edit box }
  Edit1.SetFocus;
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
  { Insert the string from the Edit box into the current position in LEdit. If
    some text is selected in LEdit, then it will be replaced }
  LEdit1.InsertStr(Edit1.Text);
  { Set the focus to LEdit }
  LEdit1.SetFocus;
end;

procedure TForm1.Button8Click(Sender: TObject);
begin
  { Insert a Carriage Return to the end of the text }
  LEdit1.InsertStr(#13);
  LEdit1.SetFocus;
end;

end.
