unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, Mask,math;
type
TForm1 =
class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
ListView1: TListView;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Label5: TLabel;
Edit5: TEdit;
Edit6: TEdit;
Button2: TButton;
Label6: TLabel;
Edit7: TEdit;
Edit8: TEdit;
Edit9: TEdit;
Edit10: TEdit;
Button3: TButton;
Label4: TLabel;
Edit4: TEdit;
Label7: TLabel;
Edit11: TEdit;
Label8: TLabel;
Button4: TButton;
Button5: TButton;
Edit12: TEdit;
Edit13: TEdit;
Button6: TButton;
procedure Button1Click(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject;
var Key: Char);
procedure Edit1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var item:TListItem;
var br,ti,ho,art,mm:
string;
var breite,tiefe,hoehe,qmz:double;
begin
br:=Edit1.Text;
ti:=Edit2.Text;
ho:=Edit3.Text;
breite:= StrToFloat(br);
tiefe:=StrToFloat(ti);
hoehe:=StrToFloat(ho);
qmz:=2*hoehe*(breite+tiefe);
mm:=FloatToStr(qmz);
item := ListView1.Items.Add;
item.Caption:=br;
item.SubItems.Add(ti);
item.SubItems.Add(ho);
item.SubItems.Add(mm);
item.SubItems.Add('
Raum');
end;
procedure TForm1.Button2Click(Sender: TObject);
var item:TListItem;
var br,ho,mm:
string;
var breite,hoehe,qmz:double;
begin
br:=Edit5.Text;
ho:=Edit6.Text;
breite:= StrToFloat(br);
hoehe:=StrToFloat(ho);
qmz:=-breite*hoehe;
mm:=FloatToStr(qmz);
item := ListView1.Items.Add;
item.Caption:=br;
item.SubItems.Add('
-');
item.SubItems.Add(ho);
item.SubItems.Add(mm);
item.SubItems.Add('
F/T');
end;
procedure TForm1.Button3Click(Sender: TObject);
var item:TListItem;
var sks,sls,sti,sho,qm:
string;
var ks,ls,ho,ti,qmz: double;
begin
sks:=Edit7.Text;
sls:=Edit7.Text;
sti:=Edit7.Text;
sho:=Edit7.Text;
ks:=StrToFloat(sks);
ls:=StrToFloat(sls);
ti:=StrToFloat(sti);
ho:=StrToFloat(sho);
qmz:=ti*((ks+ls)/2);
qm:=FloatToStr(qmz);
item:=ListView1.Items.Add;
item.Caption:=sks+'
/'+sls;
item.SubItems.Add(sti);
item.SubItems.Add(sho);
item.SubItems.Add(qm);
item.SubItems.Add('
Trapez');
end;
procedure TForm1.Button4Click(Sender: TObject);
var i:integer;
var qmgz,bbz,tolz,rolz,rolbz,roloptz:double;
var qmg,bb,tol,rol,rolopt:
string;
begin
for i := 0
to ListView1.Items.Count - 1
do
begin
qmgz := qmgz + StrToFloat(ListView1.Items[i].SubItems[2]);
end;
Edit12.Text:= '
Gesamt: ' + FloatToStr(qmgz) + '
qm';
rolbz:=StrToFloat(Edit4.Text);
tolz:=StrToFloat(Edit11.Text);
rolz := qmgz/(rolbz*(100-tolz)/100);
rol:= FloatToStr(rolz);
Delete(rol,5,length(rol)-5);
roloptz:=rolz+1;
rolopt:= FloatToStr(roloptz);
Delete(rolopt,2,length(rolopt)-2);
Edit13.Text:=rol + '
Rollen ' + '
('+rolopt+'
Stck)';
end;
procedure TForm1.Button6Click(Sender: TObject);
var item:TListItem;
var br,ho,mm:
string;
var breite,hoehe,qmz:double;
begin
br:=Edit5.Text;
ho:=Edit6.Text;
breite:= StrToFloat(br);
hoehe:=StrToFloat(ho);
qmz:=breite*hoehe;
mm:=FloatToStr(qmz);
item := ListView1.Items.Add;
item.Caption:=br;
item.SubItems.Add('
-');
item.SubItems.Add(ho);
item.SubItems.Add(mm);
item.SubItems.Add('
F/T');
end;
procedure TForm1.Edit1Click(Sender: TObject);
begin
(Sender
as TEdit).Clear;
end;
procedure TForm1.Edit1KeyPress(Sender: TObject;
var Key: Char);
begin
if not (key
in [#48..#57, #8, #44])
then key := #0
end;
end.