unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, DBCtrls, StdCtrls, Mask,
DB, DBTables;
type
TForm3 =
class(TForm)
Button1: TButton;
Table1: TTable;
DataSource1: TDataSource;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Button6: TButton;
Image1: TImage;
Button7: TButton;
GroupBox1: TGroupBox;
DBEdit2: TDBEdit;
DBEdit3: TDBEdit;
DBEdit4: TDBEdit;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
GroupBox2: TGroupBox;
CheckBox1: TCheckBox;
DBEdit1: TDBEdit;
Label1: TLabel;
Label5: TLabel;
DBEdit5: TDBEdit;
procedure Button1Click(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure DBEdit1KeyPress(Sender: TObject;
var Key: Char);
procedure Button7Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure DBEdit5Change(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var arr:
array of Integer;
max, min: Integer;
av: Double;
Form3: TForm3;
implementation
uses Unit1, Unit2;
{$R *.dfm}
procedure TForm3.Button1Click(Sender: TObject);
begin
Form1.show ;
// zeige das hauptfenster
Form1.Table1.Refresh;
// aktuellesiere es
form1.DBgrid1.Enabled := true;
form1.button1.Enabled := true;
form1.button2.Enabled := true;
form1.button3.Enabled := true;
form1.button4.Enabled := true;
Form1.WindowState := wsnormal;
form1.Enabled := true;
Form3.Close ;
button6.Enabled := false;
end;
procedure TForm3.CheckBox1Click(Sender: TObject);
begin
if checkbox1.State = cbUnchecked
then
begin
DBEdit5.Text := '
Nein';
dbedit1.Enabled := false;
dbedit1.Color := clscrollbar;
DBedit1.Clear;
Button6.Enabled := true;
end;
if checkbox1.State = cbChecked
then
begin
DBedit1.Enabled := true;
DbEdit1.Color := clWindow;
DBEdit5.Text := '
Ja';
Button6.Enabled := false;
end;
end;
procedure TForm3.Button2Click(Sender: TObject);
begin
table1.First;
// zum ersten eintrag
button5.Enabled := true;
button4.Enabled := true;
button2.Enabled := false;
button3.Enabled := false;
table1.Refresh;
end;
procedure TForm3.Button3Click(Sender: TObject);
begin
table1.Prior ;
// zum vorherigen eintrag
Button4.Enabled := true;
button5.Enabled := true;
if table1.Bof
then
begin
button2.Enabled:= false ;
button3.Enabled:= false ;
end;
table1.Refresh;
end;
procedure TForm3.Button4Click(Sender: TObject);
begin
table1.Next;
// zum nexten eintrag
Button2.Enabled := true;
Button3.Enabled := true;
if table1.Eof
then
begin
button5.Enabled := false;
button4.Enabled := false;
end;
table1.Refresh;
end;
procedure TForm3.Button5Click(Sender: TObject);
begin
table1.Last;
// zum letzten eintrag
button2.Enabled := true;
button3.Enabled := true;
Button5.Enabled := false;
Button4.Enabled := false;
table1.Refresh;
end;
procedure TForm3.Button6Click(Sender: TObject);
begin
table1.Post;
// Speichern
form1.DBGrid1.Enabled := true;
Form1.Table1.Refresh;
table1.Refresh;
Form1.Enabled := false;
button6.Enabled := false;
end;
procedure TForm3.DBEdit1KeyPress(Sender: TObject;
var Key: Char);
begin
if key = #13
then
begin
if DBEdit1.Text = '
'
then
begin
DBedit5.Text := '
Nein' ;
Checkbox1.state := cbunchecked;
form1.DBGrid1.Enabled := true;
Form1.Table1.Refresh;
table1.Refresh;
Form1.Enabled := false;
button6.Enabled := false
end;
if DBEdit1.Text <> '
'
then
begin
table1.Post;
// Speichern
form1.DBGrid1.Enabled := true;
Form1.Table1.Refresh;
table1.Refresh;
Form1.Enabled := false;
button6.Enabled := false;
end;
end;
end;
procedure TForm3.Button7Click(Sender: TObject);
begin
Form1.WindowState := wsminimized;
Form3.WindowState := wsminimized
end;
procedure TForm3.FormCreate(Sender: TObject);
begin
Table1.Refresh;
end;
procedure TForm3.DBEdit5Change(Sender: TObject);
begin
if DBEdit5.Text = '
Nein'
then
Begin
if checkbox1.State = cbchecked
then
begin
checkbox1.State := cbunchecked;
end;
end;
if DBEdit5.Text = '
Ja'
then
Begin
if Checkbox1.state = cbunchecked
then
begin
checkbox1.State := cbchecked;
end;
end;
end;
end.