unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Button6: TButton;
    Button7: TButton;
    Button8: TButton;
    Button9: TButton;
    procedure Button1KeyPress(Sender: TObject; var Key: Char);
    procedure Button3KeyPress(Sender: TObject; var Key: Char);
    procedure Button4KeyPress(Sender: TObject; var Key: Char);
    procedure Button5KeyPress(Sender: TObject; var Key: Char);
    procedure Button1Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
    procedure Button8Click(Sender: TObject);



  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  stisk:word;
implementation

{$R *.dfm}

procedure TForm1.Button1KeyPress(Sender: TObject; var Key: Char);
begin
if ord(key) = 8 then button1.Caption:=''
                else button1.Caption:=button1.Caption+key;
end;




procedure TForm1.Button3KeyPress(Sender: TObject; var Key: Char);
begin
if ord(key) = 8 then button3.Caption:=''
                else button3.Caption:=button3.Caption+key;
end;

procedure TForm1.Button4KeyPress(Sender: TObject; var Key: Char);
begin
if ord(key) = 8 then button4.Caption:=''
                else button4.Caption:=button4.Caption+key;
end;

procedure TForm1.Button5KeyPress(Sender: TObject; var Key: Char);
begin
if ord(key) = 8 then button5.Caption:=''
                else button5.Caption:=button5.Caption+key;
end;



procedure TForm1.Button1Click(Sender: TObject);
begin
stisk := 1;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
stisk := 2;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
stisk := 3;
end;

procedure TForm1.Button5Click(Sender: TObject);
begin
stisk := 4;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
if stisk=1 then label1.caption:=inttostr(strtoint(label1.caption)+1);
if stisk=2 then label2.caption:=inttostr(strtoint(label2.caption)+1);
if stisk=3 then label3.caption:=inttostr(strtoint(label3.caption)+1);
if stisk=4 then label4.caption:=inttostr(strtoint(label4.caption)+1);
end;


procedure TForm1.Button6Click(Sender: TObject);
begin
if stisk=1 then label1.caption:=inttostr(strtoint(label1.caption)+2);
if stisk=2 then label2.caption:=inttostr(strtoint(label2.caption)+2);
if stisk=3 then label3.caption:=inttostr(strtoint(label3.caption)+2);
if stisk=4 then label4.caption:=inttostr(strtoint(label4.caption)+2);

end;


procedure TForm1.Button7Click(Sender: TObject);
begin
if stisk=1 then label1.caption:=inttostr(strtoint(label1.caption)+10);
if stisk=2 then label2.caption:=inttostr(strtoint(label2.caption)+10);
if stisk=3 then label3.caption:=inttostr(strtoint(label3.caption)+10);
if stisk=4 then label4.caption:=inttostr(strtoint(label4.caption)+10);
end;


procedure TForm1.Button8Click(Sender: TObject);
begin
if stisk=1 then label1.caption:=inttostr(strtoint(label1.caption)+20);
if stisk=2 then label2.caption:=inttostr(strtoint(label2.caption)+20);
if stisk=3 then label3.caption:=inttostr(strtoint(label3.caption)+20);
if stisk=4 then label4.caption:=inttostr(strtoint(label4.caption)+20);
end;
begin
end.
