unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ExtCtrls, Menus, Mask;
type
Tll =
class(TForm)
edit_eingabe: TEdit;
lbl_wert: TLabel;
lbl_operation: TLabel;
lbl_speicherm: TLabel;
Label1: TLabel;
Label2: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
BitBtn4: TBitBtn;
BitBtn5: TBitBtn;
BitBtn6: TBitBtn;
BitBtn7: TBitBtn;
BitBtn8: TBitBtn;
BitBtn9: TBitBtn;
BitBtn10: TBitBtn;
BitBtn11: TBitBtn;
BitBtn12: TBitBtn;
BitBtn13: TBitBtn;
BitBtn14: TBitBtn;
BitBtn15: TBitBtn;
BitBtn16: TBitBtn;
BitBtn17: TBitBtn;
BitBtn18: TBitBtn;
BitBtn19: TBitBtn;
BitBtn20: TBitBtn;
BitBtn21: TBitBtn;
BitBtn22: TBitBtn;
BitBtn23: TBitBtn;
BitBtn24: TBitBtn;
BitBtn25: TBitBtn;
BitBtn26: TBitBtn;
BitBtn27: TBitBtn;
BitBtn28: TBitBtn;
BitBtn29: TBitBtn;
pnl_speicheranzeige: TPanel;
MainMenu1: TMainMenu;
Bearbeiten1: TMenuItem;
Ansicht1: TMenuItem;
N1: TMenuItem;
KopierenStrgC1: TMenuItem;
EinfgenStrgV1: TMenuItem;
Standart1: TMenuItem;
Wissenschaftlich1: TMenuItem;
Hilfethemen1: TMenuItem;
Info1: TMenuItem;
Zifferngruppierung1: TMenuItem;
procedure btm_1Click(Sender: TObject);
procedure btm_2Click(Sender: TObject);
procedure btm_plusClick(Sender: TObject);
procedure btm_gleichClick(Sender: TObject);
procedure btm_kerwertClick(Sender: TObject);
procedure btm_minusClick(Sender: TObject);
procedure btm_malClick(Sender: TObject);
procedure btm_geteiltClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure Button8Click(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure btm_loeschenClick(Sender: TObject);
procedure Button10Click(Sender: TObject);
procedure btm_prozentClick(Sender: TObject);
procedure btmk_wurzelClick(Sender: TObject);
procedure Button11Click(Sender: TObject);
procedure btm_ceClick(Sender: TObject);
procedure btm_backClick(Sender: TObject);
procedure btm_msClick(Sender: TObject);
procedure btm_mcClick(Sender: TObject);
procedure btm_mrClick(Sender: TObject);
procedure btm_mplusClick(Sender: TObject);
procedure btm_mminusClick(Sender: TObject);
procedure Info1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
ll: Tll;
implementation
{$R *.DFM}
procedure Tll.btm_1Click(Sender: TObject);
begin
if edit_eingabe.text= '
0'
then edit_eingabe.Text := '
';
edit_eingabe.text := edit_eingabe.text+'
1';
end;
procedure Tll.btm_2Click(Sender: TObject);
begin
if edit_eingabe.text= '
0'
then edit_eingabe.Text := '
';
edit_eingabe.text := edit_eingabe.text+'
2';
end;
procedure Tll.btm_plusClick(Sender: TObject);
begin
lbl_wert.Caption := edit_eingabe.text;
edit_eingabe.text := '
0' ;
lbl_operation.caption := '
+' ;
//edit_eingabe.SetFocus;
end;
procedure Tll.btm_gleichClick(Sender: TObject);
var
wert_aktuell, wert_gespeichert: double;
ergebnis:double;
begin
ergebnis:=0;
wert_aktuell := StrToFloat(edit_eingabe.text);
wert_gespeichert := StrToFloat(lbl_wert.caption);
if lbl_operation.caption= '
+'
then ergebnis := wert_aktuell + wert_gespeichert
else
If lbl_operation.caption = '
-'
then ergebnis := wert_gespeichert - wert_aktuell;
if lbl_operation.caption= '
*'
then ergebnis := wert_aktuell * wert_gespeichert
else
If lbl_operation.caption = '
/'
then ergebnis := wert_gespeichert / wert_aktuell;
edit_eingabe.text := FloatToStr(ergebnis);
lbl_operation.caption := '
' ;
lbl_wert.Caption := '
0' ;
end;
procedure Tll.btm_kerwertClick(Sender: TObject);
var
aktueller_wert, ergebnis: double;
begin
if ((edit_eingabe.text='
0')
or (edit_eingabe.text='
'))
then exit;
aktueller_wert := StrToFloat(edit_eingabe.text);
ergebnis := 1/aktueller_wert;
edit_eingabe.text := FloatToStr(ergebnis);
end;
procedure Tll.btm_minusClick(Sender: TObject);
begin
lbl_wert.Caption := edit_eingabe.text;
edit_eingabe.text := '
0' ;
lbl_operation.caption := '
-' ;
end;
procedure Tll.btm_malClick(Sender: TObject);
begin
lbl_wert.Caption := edit_eingabe.text;
edit_eingabe.text := '
0' ;
lbl_operation.caption := '
*' ;
end;
procedure Tll.btm_geteiltClick(Sender: TObject);
begin
lbl_wert.Caption := edit_eingabe.text;
edit_eingabe.text := '
0' ;
lbl_operation.caption := '
/' ;
end;
procedure Tll.Button1Click(Sender: TObject);
begin
if edit_eingabe.text= '
0'
then edit_eingabe.Text := '
';
edit_eingabe.text := edit_eingabe.text+'
3';
end;
procedure Tll.Button2Click(Sender: TObject);
begin
if edit_eingabe.text= '
0'
then edit_eingabe.Text := '
';
edit_eingabe.text := edit_eingabe.text+'
4';
end;
procedure Tll.Button3Click(Sender: TObject);
begin
if edit_eingabe.text= '
0'
then edit_eingabe.Text := '
';
edit_eingabe.text := edit_eingabe.text+'
5';
end;
procedure Tll.Button4Click(Sender: TObject);
begin
if edit_eingabe.text= '
0'
then edit_eingabe.Text := '
';
edit_eingabe.text := edit_eingabe.text+'
6';
end;
procedure Tll.Button5Click(Sender: TObject);
begin
if edit_eingabe.text= '
0'
then edit_eingabe.Text := '
';
edit_eingabe.text := edit_eingabe.text+'
7';
end;
procedure Tll.Button6Click(Sender: TObject);
begin
if edit_eingabe.text= '
0'
then edit_eingabe.Text := '
';
edit_eingabe.text := edit_eingabe.text+'
8';
end;
procedure Tll.Button7Click(Sender: TObject);
begin
if edit_eingabe.text= '
0'
then edit_eingabe.Text := '
';
edit_eingabe.text := edit_eingabe.text+'
9';
end;
procedure Tll.Button8Click(Sender: TObject);
begin
if edit_eingabe.text= '
0'
then edit_eingabe.Text := '
';
edit_eingabe.text := edit_eingabe.text+'
0';
end;
procedure Tll.Button9Click(Sender: TObject);
begin
//If Pos(':', '3278387:4582')
//then edit_eingabe.text := edit_eingabe.text+',';
if Pos('
,',edit_eingabe.text)=0
then
edit_eingabe.text := edit_eingabe.text+'
,';
end;
procedure Tll.btm_loeschenClick(Sender: TObject);
begin
edit_eingabe.Text := '
0' ;
lbl_operation.caption := '
' ;
lbl_wert.Caption := '
0' ;
end;
procedure Tll.Button10Click(Sender: TObject);
var Zahl:
string;
begin
Zahl:=edit_eingabe.Text;
if Pos('
-', Zahl) = 1
then
begin
Delete(Zahl, 1,1);
edit_eingabe.Text:=Zahl;
end
else
edit_eingabe.Text:='
-'+edit_eingabe.Text;
end;
procedure Tll.btm_prozentClick(Sender: TObject);
var
a, er: Extended;
begin
a := strtofloat (lbl_wert.caption);
er := strtofloat (edit_eingabe.text) * (a/100);
edit_eingabe.text := floattostr (er);
end;
procedure Tll.btmk_wurzelClick(Sender: TObject);
begin
edit_eingabe.text := floattostr(sqrt(strtofloat(edit_eingabe.text)));
end;
procedure Tll.Button11Click(Sender: TObject);
begin
edit_eingabe.text := floattostr(sqr(strtofloat(edit_eingabe.text)));
end;
procedure Tll.btm_ceClick(Sender: TObject);
begin
edit_eingabe.text := '
0';
end;
procedure Tll.btm_backClick(Sender: TObject);
begin
edit_eingabe.text := Copy(edit_eingabe.text,1, Length(edit_eingabe.text)-1);
if edit_eingabe.text= '
'
then edit_eingabe.Text := '
0';
//Edit1.Text := Copy(Edit1.Text,1,Length(Edit1.Text)-1)
end;
procedure Tll.btm_msClick(Sender: TObject);
begin
lbl_speicherm.Caption := edit_eingabe.text;
pnl_speicheranzeige.caption := '
M' ;
end;
procedure Tll.btm_mcClick(Sender: TObject);
begin
lbl_speicherm.caption := '
0';
pnl_Speicheranzeige.caption := '
';
end;
procedure Tll.btm_mrClick(Sender: TObject);
begin
edit_eingabe.text := lbl_speicherm.caption;
end;
procedure Tll.btm_mplusClick(Sender: TObject);
begin
lbl_speicherm.Caption := IntToStr(StrToInt(lbl_speicherm.Caption) + StrToInt(edit_eingabe.Text));
end;
procedure Tll.btm_mminusClick(Sender: TObject);
begin
lbl_speicherm.Caption := IntToStr(StrToInt(lbl_speicherm.Caption) - StrToInt(edit_eingabe.Text));
end;
procedure Tll.Info1Click(Sender: TObject);
var
lForm: THilfedatei;
begin
with lForm.Create(
Nil)
do
try
ShowModal;
finally
free;
end;
end;
end.