;
Image2: TImage;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
TabSheet3: TTabSheet;
Chart1: TChart;
TabSheet4: TTabSheet;
Chart2: TChart;
StringGrid1: TStringGrid;
MainMenu1: TMainMenu;
File1: TMenuItem;
Exit1: TMenuItem;
Help1: TMenuItem;
About1: TMenuItem;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
procedure Edit1KeyPress (Sender: TObject; var Key: Char);
procedure Edit2KeyPress (Sender: TObject; var Key: Char);
procedure Edit3KeyPress (Sender: TObject; var Key: Char);
procedure Edit4KeyPress (Sender: TObject; var Key: Char);
procedure Edit5KeyPress (Sender: TObject; var Key: Char);
procedure PageControl1Changing (Sender: TObject;
var AllowChange: Boolean);
procedure PageControl1Change (Sender: TObject);
procedure FormActivate (Sender: TObject);
procedure Exit1Click (Sender: TObject);
procedure About1Click (Sender: TObject);
В
private
{Private declarations}
public
i: boolean;
nn1, nn2, nn3, dd, wll: real;
{Public declarations}
end;
var
Form1: TForm1;
implementation
uses Unit4;
{$ R *. dfm}
procedure TForm1.Edit1KeyPress (Sender: TObject; var Key: Char);
begin
case key of
'0 '.. '9', chr (8):;
'-': if length (edit1.text) <> 0 then key: = chr (0) else key: = chr (45);
'.': if pos (',', edit1.text) <> 0 then key: = chr (0) else key: = chr (44);
',': if pos (',', edit1.text) <> 0 then key: = chr (0) else key: = chr (44);
else key: = chr (0);
end;
end;
procedure TForm1.Edit2KeyPress (Sender: TObject; var Key: Char);
begin
case key of
'0 '.. '9', chr (8):;
'-': if length (edit2.text) <> 0 then key: = chr (0) else key: = chr (45);
'.': if pos (',', edit2.text) <> 0 then key: = chr (0) else key: = chr (44);
',': if pos (',', edit2.text) <> 0 then key: = chr (0) else key: = chr (44);
else key: = chr (0);
end;
end;
procedure TForm1.Edit3KeyPress (Sender: TObject; var Key: Char);
begin
case key of
'0 '.. '9', chr (8):;
'-': if length (edit3.text) <> 0 then key: = chr (0) else key: = chr (45);
'.': if pos (',', edit3.text) <> 0 then key: = chr (0) else key: = chr (44);
',': if pos (',', edit3.text) <> 0 then key: = chr (0) else key: = chr (44);
else key: = chr (0);
end;
end;
procedure TForm1.Edit4KeyPress (Sender: TObject; var Key: Char);
begin
case key of
'0 '.. '9', chr (8):;
'-': if length (edit4.text) <> 0 then key: = chr (0) else key: = chr (45);
'.': if pos (',', edit4.text) <> 0 then key: = chr (0) else key: = chr (44);
',': if pos (',', edit4.text) <> 0 then key: = chr (0) else key: = chr (44);
else key: = chr (0);
end;
end;
procedure TForm1.Edit5KeyPress (Sender: TObject; var Key: Char);
begin
case key of
'0 '.. '9', chr (8):;
'-': if length (edit5.text) <> 0 then key: = chr (0) else key: = chr (45);
'.': if pos (',', edit5.text) <> 0 then key: = chr (0) else key: = chr (44);
',': if pos (',', edit5.text) <> 0 then key: = chr (0) else key: = chr (44);
else key: = chr (0);
end;
end;
procedure TForm1.PageControl1Changing (Sender: TObject;
var AllowChange: Boolean);
begin
allowchange: =
end;
procedure TForm1.PageControl1Change (Sender: TObject);
// основна процедура програми, прив'язана до зміни закладки
// по її ходу і здійснюються всі обчислення і побудова графіків
var
n: byte;
k: integer;
a, b, c, f: real;
begin
nn1: = strtofloat (edit1.text);
nn2: = strtofloat (edit2.text);
nn3: = strtofloat (edit3.text);
dd: = strtofloat (edit4.text)/1000000;
wll: = strtofloat (edit5.text)/1000000000;
if pagecontrol1.activepage = (tabsheet1) then
begin
i: = false;
chart1.RemoveAllSeries;
chart2.RemoveAllSeries;
<...