unit LIAcc;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, StdCtrls, Menus, jpeg, ExtCtrls;
type
TForm13 =
class(TForm)
Button1: TButton;
Image1: TImage;
MainMenu1: TMainMenu;
Menu1: TMenuItem;
Exit1: TMenuItem;
Help1: TMenuItem;
Edit1: TEdit;
Label1: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Image2: TImage;
StringGrid1: TStringGrid;
Button2: TButton;
Button3: TButton;
StringGrid2: TStringGrid;
procedure Exit1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject;
var Key: Char);
procedure Edit1Exit(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form13: TForm13;
uc, u60, u200, u500, u1000 : extended;
implementation
{$R *.dfm}
procedure TForm13.Exit1Click(Sender: TObject);
begin
close();
end;
procedure TForm13.Button1Click(Sender: TObject);
begin
close();
end;
procedure TForm13.Edit1KeyPress(Sender: TObject;
var Key: Char);
begin
stringgrid1.cells[0,0]:='
Time';
stringgrid1.cells[0,1]:='
60';
stringgrid1.cells[0,2]:='
200';
stringgrid1.cells[0,3]:='
500';
stringgrid1.cells[0,4]:='
1000';
stringgrid1.cells[1,0]:='
Lirc Value';
stringgrid2.cells[0,0]:='
Repeat.';
stringgrid2.cells[1,0]:='
Error';
if (Key=#13)
then
Button2.SetFocus;
end;
procedure TForm13.Edit1Exit(Sender: TObject);
begin
try
uc:=StrToFloat(Edit1.Text);
except
ShowMessage('
Please enter only numbers for Uc!');
Edit1.Clear;
Edit1.SetFocus;
end;
end;
procedure TForm13.Button2Click(Sender: TObject);
begin
u60:=uc*60/1000;
u200:=uc*200/1000;
u500:=uc*500/1000;
u1000:=uc*1000/1000;
stringgrid1.cells[1,1]:=FloatToStrF(u60, ffNumber, 8, 2);
stringgrid1.cells[1,2]:=FloatToStrF(u200, ffNumber, 8, 2);
stringgrid1.cells[1,3]:=FloatToStrF(u500, ffNumber, 8, 2);
stringgrid1.cells[1,4]:=FloatToStrF(u1000, ffNumber, 8, 2);
end;
end.