unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, Grids, ExtCtrls;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    Label1: TLabel;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Button6: TButton;
    BitBtn1: TBitBtn;
    Button2: TButton;
    Button7: TButton;
    Button8: TButton;
    Label2: TLabel;
    Label3: TLabel;
    Bevel1: TBevel;
    Bevel2: TBevel;
    procedure Memo1KeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormCreate(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button8Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Memo1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  //Label1.Caption:= Inttostr(Memo1.CaretPos.x)+','+Inttostr(Memo1.CaretPos.Y);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Bitbtn1.Caption:='Wyświetl'+#13+'współrzędne'+#13+'kursora';
end;

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
  //wyswietlenie wspólrzednych kursora
  Label1.Caption:= Inttostr(Memo1.CaretPos.x)+','+Inttostr(Memo1.CaretPos.Y);
  Memo1.SetFocus;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
   //dodanie linii
  Memo1.Lines.Add( inttostr(Random(10)) );
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  Memo1.CutToClipboard;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
  Memo1.PasteFromClipboard;
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
  Memo1.CopyToClipboard;
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
  Memo1.ClearSelection;
end;


procedure TForm1.Button8Click(Sender: TObject);
begin
  Memo1.Lines.SaveToFile('Memo.txt');
end;

procedure TForm1.Button7Click(Sender: TObject);
begin
  Memo1.Lines.LoadFromFile('Memo.txt');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  Memo1.Clear;
end;

end.
