unit Unit1;
{Name der Unit}
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, ExtCtrls;
type
TForm1 =
class(TForm)
Image0: TImage;
Image1: TImage;
Image2: TImage;
Image8: TImage;
Image5: TImage;
Image3: TImage;
Image7: TImage;
Image6: TImage;
Image4: TImage;
Image9: TImage;
Mal: TImage;
Back: TImage;
Geteilt: TImage;
Gleich: TImage;
Plus: TImage;
Punkt: TImage;
Rechts: TImage;
Links: TImage;
Minus: TImage;
Exp: TImage;
Edit1: TEdit;
{ Procedure Starts }
procedure Button1Click(Sender: TObject);
procedure Image0Click(Sender: TObject);
procedure Image1Click(Sender: TObject);
procedure Image2Click(Sender: TObject);
procedure Image3Click(Sender: TObject);
procedure Image4Click(Sender: TObject);
procedure Image5Click(Sender: TObject);
procedure Image6Click(Sender: TObject);
procedure Image7Click(Sender: TObject);
procedure Image8Click(Sender: TObject);
procedure Image9Click(Sender: TObject);
procedure btnLinksClick(Sender: TObject);
procedure btnRechtsClick(Sender: TObject);
procedure btnPlusClick(Sender: TObject);
procedure btnPunktClick(Sender: TObject);
procedure btnMalClick(Sender: TObject);
procedure btnGeteiltClick(Sender: TObject);
procedure btnExpClick(Sender: TObject);
procedure btnMinusClick(Sender: TObject);
procedure btnGleichClick(Sender: TObject);
procedure GleichClick(Sender: TObject);
{ Procedure Ends }
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
//Hier werden die Globalen Variablen definiert
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
//Unser OnClick-Ereignis
var
zahl1, zahl2, ergebnis: integer;
//Unsere Variablen
begin
Edit1.Text:=IntToStr(2*StrToInt(Edit1.Text))
end;
{ Zahlen Buttons }
procedure TForm1.Image0Click(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
0';
end;
procedure TForm1.Image1Click(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
1';
end;
procedure TForm1.Image2Click(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
2';
end;
procedure TForm1.Image3Click(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
3';
end;
procedure TForm1.Image4Click(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
4';
end;
procedure TForm1.Image5Click(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
5';
end;
procedure TForm1.Image6Click(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
6';
end;
procedure TForm1.Image7Click(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
7';
end;
procedure TForm1.Image8Click(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
8';
end;
procedure TForm1.Image9Click(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
9';
end;
{ Zahlen Buttons }
{ Symbole }
procedure TForm1.btnLinksClick(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
(';
end;
procedure TForm1.btnRechtsClick(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
)';
end;
procedure TForm1.btnPlusClick(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
+';
end;
procedure TForm1.btnMalClick(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
*';
end;
procedure TForm1.btnMinusClick(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
-';
end;
procedure TForm1.btnGeteiltClick(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
/';
end;
procedure TForm1.btnPunktClick(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
,';
end;
procedure TForm1.btnGleichClick(Sender: TObject);
begin
Edit1.Text := Edit1.Text + '
='
end;
procedure TForm1.btnExpClick(Sender: TObject);
begin
Edit1.Text := format('
%1.4f',[pi]);
end;
{ Symbole }
end.