unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, bsSkinData, BusinessSkinForm, Mask, bsSkinBoxCtrls, bscalc,
bsSkinCtrls;
type
TForm1 = class(TForm)
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Button9: TButton;
Button10: TButton;
Button11: TButton;
Button12: TButton;
Button13: TButton;
Button14: TButton;
Button15: TButton;
Button16: TButton;
Button17: TButton;
Button18: TButton;
Button19: TButton;
Button20: TButton;
Button21: TButton;
Button22: TButton;
bsBusinessSkinForm1: TbsBusinessSkinForm;
bsSkinData1: TbsSkinData;
Edit1: TbsSkinEdit;
bsCompressedStoredSkin1: TbsCompressedStoredSkin;
Edit2: TbsSkinEdit;
Edit3: TbsSkinEdit;
Edit4: TbsSkinEdit;
Label1: TLabel;
Button1: TButton;
Button23: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(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 Button10Click(Sender: TObject);
procedure Button11Click(Sender: TObject);
procedure Button12Click(Sender: TObject);
procedure Button13Click(Sender: TObject);
procedure Button14Click(Sender: TObject);
procedure Button15Click(Sender: TObject);
procedure Button16Click(Sender: TObject);
procedure Edit1Change(Sender: TObject);
procedure Edit3Change(Sender: TObject);
procedure Edit1Enter(Sender: TObject);
procedure Edit3Enter(Sender: TObject);
procedure Button17Click(Sender: TObject);
procedure Button18Click(Sender: TObject);
procedure Button19Click(Sender: TObject);
procedure Button20Click(Sender: TObject);
procedure Button21Click(Sender: TObject);
procedure Button22Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure Button23Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
str1:String;
str2:String;
int1:real;
int2:real;
bo:real;
result:real;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if bo= then
begin
str1:=str1+'';
Edit1.Text:=str1;
end
Else
begin
str2:=str2+'';
Edit3.Text:=str2;
end
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
int1:=;
int2:=;
bo:=;
SetWindowLong(Edit1.Handle,GWL_STYLE,GetWindowLong(Edit1.Handle,GWL_STYLE) or Es_right);
SetWindowLong(Edit2.Handle,GWL_STYLE,GetWindowLong(Edit2.Handle,GWL_STYLE) or Es_right);
SetWindowLong(Edit3.Handle,GWL_STYLE,GetWindowLong(Edit3.Handle,GWL_STYLE) or Es_right);
SetWindowLong(Edit4.Handle,GWL_STYLE,GetWindowLong(Edit4.Handle,GWL_STYLE) or Es_right);
end;
procedure TForm1.Button20Click(Sender: TObject);
begin
edit2.Text:='';
edit3.Text:='';
int2:=;
edit4.Text:= FormatFloat('0.00000',/int1) ;
end;
procedure TForm1.Button21Click(Sender: TObject);
begin
edit2.Text:='';
edit3.Text:='';
int2:=;
edit4.Text:= FormatFloat('0.00000',Sqrt(int1)) ;
end;
procedure TForm1.Button22Click(Sender: TObject);
begin
result:=int1*int2/;
Edit4.Text:=FormatFloat('0.00000',result);
end;
procedure TForm1.Button23Click(Sender: TObject);
begin
if bo= then
edit1.Text:=''
else
edit3.Text:='';
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if bo= then
begin
str1:=str1+'';
Edit1.Text:=str1;
end
Else
begin
str2:=str2+'';
Edit3.Text:=str2;
end
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
if bo= then
begin
str1:=str1+'';
Edit1.Text:=str1;
end
Else
begin
str2:=str2+'';
Edit3.Text:=str2;
end
end;
procedure TForm1.Button4Click(Sender: TObject);
begin
if bo= then
begin
str1:=str1+'';
Edit1.Text:=str1;
end
Else
begin
str2:=str2+'';
Edit3.Text:=str2;
end
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
if bo= then
begin
str1:=str1+'';
Edit1.Text:=str1;
end
Else
begin
str2:=str2+'';
Edit3.Text:=str2;
end
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
if bo= then
begin
str1:=str1+'';
Edit1.Text:=str1;
end
Else
begin
str2:=str2+'';
Edit3.Text:=str2;
end
end;
procedure TForm1.Button7Click(Sender: TObject);
begin
if bo= then
begin
str1:=str1+'';
Edit1.Text:=str1;
end
Else
begin
str2:=str2+'';
Edit3.Text:=str2;
end
end;
procedure TForm1.Button8Click(Sender: TObject);
begin
if bo= then
begin
str1:=str1+'';
Edit1.Text:=str1;
end
Else
begin
str2:=str2+'';
Edit3.Text:=str2;
end
end;
procedure TForm1.Button9Click(Sender: TObject);
begin
if bo= then
begin
str1:=str1+'';
Edit1.Text:=str1;
end
Else
begin
str2:=str2+'';
Edit3.Text:=str2;
end
end;
procedure TForm1.Edit1Change(Sender: TObject);
begin
str1:=edit1.Text;
if edit1.Text<>'' then
int1:=strtofloat(edit1.Text)
else
int1:=;
end;
procedure TForm1.Edit1Enter(Sender: TObject);
begin
bo:=;
end;
procedure TForm1.Edit3Change(Sender: TObject);
begin
str2:=edit3.Text;
if edit3.Text<>'' then
int2:=strtofloat(edit3.Text)
else
int2:=;
end;
procedure TForm1.Edit3Enter(Sender: TObject);
begin
bo:=;
end;
procedure TForm1.bsSkinButton1Click(Sender: TObject);
begin
if bo= then
begin
str1:=str1+'';
Edit1.Text:=str1;
end
Else
begin
str2:=str2+'';
Edit3.Text:=str2;
end
end;
procedure TForm1.Button10Click(Sender: TObject);
begin
if bo= then
begin
str1:=str1+'';
Edit1.Text:=str1;
end
Else
begin
str2:=str2+'';
Edit3.Text:=str2;
end
end;
procedure TForm1.Button11Click(Sender: TObject);
begin
bo:=;
Edit2.Text:='+';
end;
procedure TForm1.Button12Click(Sender: TObject);
begin
bo:=;
Edit2.Text:='-';
end;
procedure TForm1.Button13Click(Sender: TObject);
begin
bo:=;
Edit2.Text:='*';
end;
procedure TForm1.Button14Click(Sender: TObject);
begin
bo:=;
Edit2.Text:='/';
end;
procedure TForm1.Button15Click(Sender: TObject);
begin
if Edit2.Text='+' then
begin
result:=int1+int2;
Edit4.Text:=floattostr(result);
end ;
if Edit2.Text='-' then
begin
result:=int1-int2;
Edit4.Text:=floattostr(result);
end ;
if Edit2.Text='*' then
begin
result:=int1*int2;
Edit4.Text:=floattostr(result);
end ;
if ( Edit2.Text='/') and (int2<> ) then
begin
result:=int1/int2;
{保留5位小数}
Edit4.Text:=FormatFloat('0.00000',result);
end ;
if ( Edit2.Text='/') and (int2= ) then
begin
Application.MessageBox('除数不能为0!','错误提示',MB_OKCANCEL);
end ;
end;
procedure TForm1.Button16Click(Sender: TObject);
begin
bo:=;
Edit1.Text:='';
Edit2.Text:='';
Edit3.Text:='';
Edit4.Text:='';
int1:=;
int2:=;
result:=;
end;
procedure TForm1.Button17Click(Sender: TObject);
begin
if bo= then
edit1.Text:= Copy( edit1.Text, , length( Edit1.text )- ) {截取}
else
edit3.Text:= Copy( edit3.Text, , length( Edit3.text )- );
end;
procedure TForm1.Button18Click(Sender: TObject);
begin
if bo= then
begin
str1:=str1+'.';
Edit1.Text:=str1;
end
Else
begin
str2:=str2+'.';
Edit3.Text:=str2;
end
end;
procedure TForm1.Button19Click(Sender: TObject);
begin
if bo= then
begin
if int1> then
edit1.Text:='-'+edit1.Text
else
begin
int1:=-strtofloat(edit1.Text);
edit1.Text:=floattostr(int1) ;
end;
end
else
begin
if int2> then
edit3.Text:='-'+edit3.Text
else
begin
int2:=-strtofloat(edit3.Text);
edit3.Text:=floattostr(int2) ;
end;
end;
end;
end.