unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Math, Menus;
type
TForm1 =
class(TForm)
Panel1: TPanel;
BeendenBtn: TButton;
Zahl1Edit: TEdit;
Zahl2Edit: TEdit;
Panel2: TPanel;
PlusBtn: TButton;
MinusBtn: TButton;
LabeledEdit1: TLabeledEdit;
MalBtn: TButton;
DiviBtn: TButton;
Label1: TLabel;
Label2: TLabel;
QuadratBtn: TButton;
Wurzel: TButton;
Button1: TButton;
ClearBtn: TButton;
Panel3: TPanel;
ListBox1: TListBox;
SpeicherBtn: TButton;
DelBtn: TButton;
Panel4: TPanel;
procedure PlusBtnClick(Sender: TObject);
procedure BeendenBtnClick(Sender: TObject);
procedure MinusBtnClick(Sender: TObject);
procedure MalBtnClick(Sender: TObject);
procedure DiviBtnClick(Sender: TObject);
procedure QuadratBtnClick(Sender: TObject);
procedure WurzelClick(Sender: TObject);
procedure ClearBtnClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure DelBtnClick(Sender: TObject);
procedure SpeicherBtnClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
a, b, c, d : real;
implementation
{$R *.dfm}
procedure TForm1.PlusBtnClick(Sender: TObject);
begin
a := StrToFloat(Zahl1Edit.Text);
b := StrToFloat(Zahl2Edit.Text);
c := a + b;
LabeledEdit1.Text := FloatToStr(c);
end;
procedure TForm1.BeendenBtnClick(Sender: TObject);
begin
close;
end;
procedure TForm1.MinusBtnClick(Sender: TObject);
begin
a := StrToFloat(Zahl1Edit.Text);
b := StrToFloat(Zahl2Edit.Text);
c := a - b;
LabeledEdit1.Text := FloatToStr(c);
end;
procedure TForm1.MalBtnClick(Sender: TObject);
begin
a := StrToFloat (Zahl1Edit.Text);
b := StrtoFloat (Zahl2Edit.Text);
c := a * b;
LabeledEdit1.Text := FloatToStr(c);
end;
procedure TForm1.DiviBtnClick(Sender: TObject);
begin
a := StrToFloat (Zahl1Edit.Text);
b := StrToFloat (Zahl2Edit.Text);
C := a / b;
LabeledEdit1.text := FloatToStr(c);
end;
procedure TForm1.QuadratBtnClick(Sender: TObject);
begin
a := StrToFloat (Zahl1Edit.Text);
c := sqr(a);
LabeledEdit1.Text := FloatToStr(c);
end;
procedure TForm1.WurzelClick(Sender: TObject);
begin
a := StrToFloat (Zahl1Edit.Text);
d := sqrt(a);
LabeledEdit1.Text := FloatToStr(d);
end;
procedure TForm1.ClearBtnClick(Sender: TObject);
begin
Zahl1Edit.Clear;
Zahl2Edit.Clear;
LabeledEdit1.Clear;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
s:
string;
begin
Listbox1.Items.Add(Zahl1Edit.Text);
s := Listbox1.Items[0];
s := s+'
+'+(Zahl2Edit.Text)+ '
=' + (LabeledEdit1.Text);
ListBox1.Items[0] := s;
end;
procedure TForm1.DelBtnClick(Sender: TObject);
begin
Listbox1.clear;
end;
procedure TForm1.SpeicherBtnClick(Sender: TObject);
begin
//Listbox1.Items.SaveToFile('Speicherort');
end;
end.