Kto to rozwią?że jest mistrzem!

0

Mam utworzone 4 klasy. Klasa 1(TChronometry jest klasą generyczną- nie posiada swoich egzemplarzy), metody 3 klas pokrywają metody klasy pierwszej której to metody są wirualne. Problem tkwi w tym że metody klasy 2 działają a metody innych klas nie(chodz w zasadzie się niczym nie różnią). Pomórzcie mi!!!!!!!!!!!!!!!!!!!

{glowa} :[[ ;(
Delphi5

unit1-deklaracja klas, konstruktory
unit2- wywołanie metod wirtualnych dla klasy TMechaniczne- działa
unit3- wyświetlenie- działa dla wszystkich
unit4- wywołanie metod wirtualnych dla klasy TAtomowe- nie działają metody????
//unit4- wywołanie metod wirtualnych dla klasy TElektroniczne- nie działają metody???

hmm... hmm...


unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,ExtCtrls,MMSystem;

type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
Button2: TButton;
Exit: TButton;
Button3: TButton;
Button4: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure ExitClick(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }

end;

TDodatkowe_funkcje=class
Budzik,Timer,Stoper,
Kalkulator,Data: string;
constructor Create(b,ti,s,k,d:string);overload;
end;

TChronometry=class
Nazwa,Firma,Typ,
Zasilanie,
Co_do_1h,
Co_do_1sec,
Co_do_1dsec,
Co_do_1ssec : string ;
Dodatkowe_funkcje: TDodatkowe_funkcje;
function PokazNazwe :string;
procedure Ustaw(t: TTimer;b:TButton);
procedure Czas(l1,l2,l3:TLabel);virtual;
procedure Data(c:TComboBox;l:TLabel;Date:TDateTime);virtual;
procedure Timer(c:TComboBox;b:TButton;l1,l2,l3:TLabel);
procedure Budzik(e1,e2,e3:TEdit;c:TComboBox;l1,l2,l3:TLabel);virtual;
end;

TWskazowki=class
Ilosc_wsk: integer;
Rodzaj_wsk: string;
constructor Create(il:integer;r:string);overload;
end;

TMechaniczne=class(TChronometry)
Ilosc_tarcz: integer;
Wskazowki: TWskazowki;
constructor Create(i,il:integer;n,f,t,z,c1,c2,c3,c4,b,ti,s,k,d,r:string);overload;
procedure Czas(l1,l2,l3:TLabel);override;
procedure Data(c:TComboBox;l:TLabel;Date:TDateTime);override;
procedure Budzik(e1,e2,e3:TEdit;c:TComboBox;l1,l2,l3:TLabel);override;
end;

TWyswietlacz=class
Rodzaj_wysw,
Typ_wysw: string;
constructor Create(rw,tw:string);overload;
end;

TAtomowe=class(TChronometry)
Wskazowki:TWskazowki;
Wyswietlacz:TWyswietlacz;
constructor Create(il:integer;n,f,t,z,c1,c2,c3,c4,b,ti,s,k,d,r,rw,tw:string);overload;
procedure Czas(l1,l2,l3:TLabel);override;
procedure Data(c:TComboBox;l:TLabel;Date:TDateTime);override;
procedure Budzik(e1,e2,e3:TEdit;c:TComboBox;l1,l2,l3:TLabel);override;
end;

TElektroniczne=class(TChronometry)
Ilosc_wys:integer;
Wyswietlacz:TWyswietlacz;
constructor Create(n,f,t,z,c1,c2,c3,c4,b,ti,s,k,d,rw,tw:string);overload;
procedure Czas(l1,l2,l3:TLabel);override;
procedure Data(c:TComboBox;l:TLabel;Date:TDateTime);override;
procedure Budzik(e1,e2,e3:TEdit;c:TComboBox;l1,l2,l3:TLabel);override;
end;

var
Form1: TForm1;
Lista:TList;
Index:integer;
nowy: TChronometry;

implementation

uses Unit2, Unit3, Unit4, Unit5;

{$R *.DFM}

constructor TDodatkowe_funkcje.Create(b,ti,s,k,d:string);
begin
Budzik:=b;
Timer:=ti;
Stoper:=s;
Kalkulator:=k;
Data:=d;
end;

procedure TChronometry.Budzik(e1,e2,e3:TEdit;c:TComboBox;l1,l2,l3:TLabel);
var
A,B,D:string;
begin
A := FormatDateTime('hh', Time);
l1.Caption := A;
B := FormatDateTime('nn', Time);
l2.Caption := B;
D := FormatDateTime('ss', Time);
l3.Caption := D;
if c.Text='tak' then
if e3.Textthen if e2.Text then
if e1.Text` then
if e3.Text = D then begin
if e2.Text = B then begin
if e1.Text = A then begin
ShowMessage('Dzyn-Dzyn');
end;
end;
end;
end;

procedure TMechaniczne.Budzik(e1,e2,e3:TEdit;c:TComboBox;l1,l2,l3:TLabel);
var
A,B,D:string;
begin
A := FormatDateTime('hh', Time);
l1.Caption := A;
B := FormatDateTime('nn', Time);
l2.Caption := B;
D := FormatDateTime('ss', Time);
l3.Caption := D;
if c.Text='tak' then
if e3.Textthen if e2.Text then
if e1.Text` then
if e3.Text = D then begin
if e2.Text = B then begin
if e1.Text = A then begin
PlaySound('Alarm1.wav',0,snd_Async);
end;
end;
end;
end;

procedure TAtomowe.Budzik(e1,e2,e3:TEdit;c:TComboBox;l1,l2,l3:TLabel);
var
A,B,D:string;
begin
A := FormatDateTime('hh', Time);
l1.Caption := A;
B := FormatDateTime('nn', Time);
l2.Caption := B;
D := FormatDateTime('ss', Time);
l3.Caption := D;
if c.Text='tak' then
if e3.Textthen if e2.Text then
if e1.Text` then
if e3.Text = D then begin
if e2.Text = B then begin
if e1.Text = A then begin
PlaySound('Alarm2.wav',0,snd_Async);
end;
end;
end;
end;

procedure TElektroniczne.Budzik(e1,e2,e3:TEdit;c:TComboBox;l1,l2,l3:TLabel);
var
A,B,D:string;
begin
A := FormatDateTime('hh', Time);
l1.Caption := A;
B := FormatDateTime('nn', Time);
l2.Caption := B;
D := FormatDateTime('ss', Time);
l3.Caption := D;
if c.Text='tak' then
if e3.Textthen if e2.Text then
if e1.Text` then
if e3.Text = D then begin
if e2.Text = B then begin
if e1.Text = A then begin
PlaySound('Alarm3.wav',0,snd_Async);
end;
end;
end;
end;

procedure TElektroniczne.Czas(l1,l2,l3:TLabel);
begin
l1.Caption := FormatDateTime('h', Time);
l2.Caption := FormatDateTime('m', Time);
l3.Caption := FormatDateTime('s', Time);
end;

procedure TChronometry.Czas(l1,l2,l3:TLabel);
begin
l1.Caption := FormatDateTime('h', Time);
l2.Caption := FormatDateTime('m', Time);
l3.Caption := FormatDateTime('s', Time);
end;

procedure TMechaniczne.Czas(l1,l2,l3:TLabel);
begin
l1.Caption := FormatDateTime('h', Time);
l2.Caption := FormatDateTime('m', Time);
l3.Caption := FormatDateTime('s', Time);
end;

procedure TAtomowe.Czas(l1,l2,l3:TLabel);
begin
l1.Caption :=FormatDateTime('h', Time);
l2.Caption :=FormatDateTime('m', Time);
l3.Caption :=FormatDateTime('s', Time);
end;

procedure TChronometry.Data(c:TComboBox;l:TLabel;Date:TDateTime);
begin
if c.Text='tak' then
l.Caption:=DateToStr(Date)
else
l.Caption:=`;
end;

procedure TMechaniczne.Data(c:TComboBox;l:TLabel;Date:TDateTime);
begin
if c.Text='tak' then
l.Caption:=DateToStr(Date)
else
l.Caption:=`;
end;

procedure TChronometry.Timer(c:TComboBox;b:TButton;l1,l2,l3:TLabel);
begin
if (c.Text='tak') and (b.Caption='Start Timer') then begin
X := StrToInt(l3.Caption) + 1;
if StrToInt(l3.Caption) = 59 then Begin
X := 0;
Y := Y + 1;
l2.Caption := IntToStr(Y);
end;
if StrToInt(l3.Caption) = 59 then Begin
if StrToInt(l2.Caption) = 59 then Begin
Y := 0;
l2.Caption := IntToStr(Y);
Z := Z + 1;
l1.Caption := IntToStr(Z);
end;
end;
l3.Caption := IntToStr(X);
end
end;

procedure TChronometry.Ustaw(t: TTimer;b:TButton);
begin
if t.Enabled = true then begin
t.Enabled := false;
b.Caption := 'Stop Timer';
end else begin
t.Enabled := true;
b.Caption := 'Start Timer';
end;
end;

procedure TAtomowe.Data(c:TComboBox;l:TLabel;Date:TDateTime);
begin
if c.Text='nie' then
l.Caption:=DateToStr(Date)
else
l.Caption:=`;
end;

function TChronometry.PokazNazwe :string;
begin
PokazNazwe:=Nazwa;
end;

constructor TWskazowki.Create(il:integer;r:string);
begin
Ilosc_wsk:=il;
Rodzaj_wsk:=r;
end;

constructor TMechaniczne.Create(i,il:integer;n,f,t,z,c1,c2,c3,c4,b,ti,s,k,d,r:string);
begin
Ilosc_tarcz:=i;
Nazwa:=n;
Firma:=f;
Typ:=t;
Zasilanie:=z;
Co_do_1h:=c1;
Co_do_1sec:=c2;
Co_do_1dsec:=c3;
Co_do_1ssec:=c4;
Dodatkowe_funkcje:=TDodatkowe_funkcje.Create(b,ti,s,k,d);
Wskazowki:=TWskazowki.Create(il,r);
end;

constructor TWyswietlacz.Create(rw,tw:string);
begin
Rodzaj_wysw:=rw;
Typ_wysw:=tw;
end;

constructor TAtomowe.Create(il:integer;n,f,t,z,c1,c2,c3,c4,b,ti,s,k,d,r,rw,tw:string);
begin
Nazwa:=n;
Firma:=f;
Typ:=t;
Zasilanie:=z;
Co_do_1h:=c1;
Co_do_1sec:=c2;
Co_do_1dsec:=c3;
Co_do_1ssec:=c4;
Dodatkowe_funkcje:=TDodatkowe_funkcje.Create(b,ti,s,k,d);
Wskazowki:=TWskazowki.Create(il,r);
Wyswietlacz:=TWyswietlacz.Create(rw,tw);
end;

constructor TElektroniczne.Create(n,f,t,z,c1,c2,c3,c4,b,ti,s,k,d,rw,tw:string);
 begin
  Nazwa:=n;
  Firma:=f;
  Typ:=t;
  Zasilanie:=z;
  Co_do_1h:=c1;
  Co_do_1sec:=c2;
  Co_do_1dsec:=c3;
  Co_do_1ssec:=c4;
  Dodatkowe_funkcje:=TDodatkowe_funkcje.Create(b,ti,s,k,d);
  Wyswietlacz:=TWyswietlacz.Create(rw,tw);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.Show;
Form2.Edit1.Text:='Andromeda'; Form2.Edit2.Text:='Casio'; Form2.Edit3.Text:='1';Form2.ComboBox2.Text:='Na rękę';
Form2.ComboBox3.Text:='tak'; Form2.ComboBox4.Text:='tak'; Form2.ComboBox1.Text:='Mechaniczne';
Form2.ComboBox5.Text:='tak'; Form2.ComboBox6.Text:='tak'; Form2.ComboBox7.Text:='tak';
Form2.ComboBox8.Text:='tak';Form2.ComboBox9.Text:='tak';Form2.ComboBox10.Text:='tak';
Form2.ComboBox11.Text:='tak';Form2.Edit14.Text:='3'; Form2.ComboBox12.Text:='Tytanowe';
Form2.Edit4.Text:=;Form2.Edit5.Text:=;Form2.Edit6.Text:=`;
Form2.ComboBox1.Items.LoadFromFile('lista1.txt');
Form2.ComboBox2.Items.LoadFromFile('lista2.txt');
Form2.ComboBox3.Items.LoadFromFile('lista3.txt');
Form2.ComboBox4.Items.LoadFromFile('lista3.txt');
Form2.ComboBox5.Items.LoadFromFile('lista3.txt');
Form2.ComboBox6.Items.LoadFromFile('lista3.txt');
Form2.ComboBox7
.Items.LoadFromFile('lista3.txt');
Form2.ComboBox8.Items.LoadFromFile('lista3.txt');
Form2.ComboBox9.Items.LoadFromFile('lista3.txt');
Form2.ComboBox10.Items.LoadFromFile('lista3.txt');
Form2.ComboBox11.Items.LoadFromFile('lista3.txt');
Form2.ComboBox12.Items.LoadFromFile('lista4.txt');
end;

procedure TForm1.Button2Click(Sender: TObject);
var
i:integer;
begin
if Lista nil then
begin
Form3.Show;
Form3.ListBox1.Clear;
for i:=0 to Lista.Count-1 do Form3.ListBox1.Items.Add((TObject(Lista[i]) as TChronometry).PokazNazwe);
end
else
ShowMessage('Lista jest pusta');
end;

procedure TForm1.ExitClick(Sender: TObject);
begin
Close;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
Form4.Show;
Form4.Edit1.Text:='Orion';Form4.Edit2.Text:='Quartz';Form4.Edit3.Text:='0';Form4.ComboBox2.Text:='Atomowe';
Form4.ComboBox3.Text:='tak'; Form4.ComboBox4.Text:='tak'; Form4.ComboBox1.Text:='Stacjonarny';
Form4.ComboBox5.Text:='tak'; Form4.ComboBox6.Text:='tak'; Form4.ComboBox7.Text:='tak';
Form4.ComboBox8.Text:='tak';Form4.ComboBox9.Text:='tak';Form4.ComboBox10.Text:='tak';
Form4.ComboBox11.Text:='tak';Form4.Edit4.Text:=;Form4.Edit5.Text:=;Form4.Edit6.Text:=`;
Form4.ComboBox13.Text:='Brak';Form4.ComboBox14.Text:='Cieklokrystaliczny';Form4.ComboBox15.Text:='Okrągly';
Form4.ComboBox1.Items.LoadFromFile('lista2.txt');
Form4.ComboBox2.Items.LoadFromFile('lista1.txt');
Form4.ComboBox3.Items.LoadFromFile('lista3.txt');
Form4.ComboBox4.Items.LoadFromFile('lista3.txt');
Form4.ComboBox5.Items.LoadFromFile('lista3.txt');
Form4.ComboBox6.Items.LoadFromFile('lista3.txt');
Form4.ComboBox7.Items.LoadFromFile('lista3.txt');
Form4.ComboBox8.Items.LoadFromFile('lista3.txt');
Form4.ComboBox9.Items.LoadFromFile('lista3.txt');
Form4.ComboBox10.Items.LoadFromFile('lista3.txt');
Form4.ComboBox11.Items.LoadFromFile('lista3.txt');
Form4.ComboBox13.Items.LoadFromFile('lista4.txt');
Form4.ComboBox14.Items.LoadFromFile('lista5.txt');
Form4.ComboBox15.Items.LoadFromFile('lista6.txt');

end;

procedure TForm1.Button4Click(Sender: TObject);
begin
Form5.Show;
Form5.ComboBox2.Text:='Bateryjne';
Form5.ComboBox3.Text:='tak'; Form5.ComboBox4.Text:='tak'; Form5.ComboBox1.Text:='Ścienny';
Form5.ComboBox5.Text:='tak'; Form5.ComboBox6.Text:='tak'; Form5.ComboBox7.Text:='tak';
Form5.ComboBox8.Text:='tak'; Form5.ComboBox9.Text:='tak'; Form5.ComboBox10.Text:='tak';
Form5.ComboBox11.Text:='tak';Form5.ComboBox12.Text:='Kwarcowy';Form5.ComboBox13.Text:='Kwadratowy';
Form5.Edit1.Text:='Casiope';Form5.Edit2.Text:='Sportex';Form5.Edit3.Text:=;Form5.Edit4.Text:=;
Form5.Edit5.Text:=`;
Form5.ComboBox1.Items.LoadFromFile('lista2.txt');
Form5.ComboBox2.Items.LoadFromFile('lista1.txt');
Form5.ComboBox3.Items.LoadFromFile('lista3.txt');
Form5.ComboBox4.Items.LoadFromFile('lista3.txt');
Form5.ComboBox5.Items.LoadFromFile('lista3.txt');
Form5.ComboBox6.Items.LoadFromFile('lista3.txt');
Form5.ComboBox7.Items.LoadFromFile('lista3.txt');
Form5.ComboBox8.Items.LoadFromFile('lista3.txt');
Form5.ComboBox9.Items.LoadFromFile('lista3.txt');
Form5.ComboBox10.Items.LoadFromFile('lista3.txt');
Form5.ComboBox11.Items.LoadFromFile('lista3.txt');
Form5.ComboBox12.Items.LoadFromFile('lista5.txt');
Form5.ComboBox13.Items.LoadFromFile('lista6.txt');
end;

procedure TElektroniczne.Data(c: TComboBox; l: TLabel; Date: TDateTime);
begin
if c.Text='tak' then
l.Caption:=DateToStr(Date)
else
l.Caption:=`;
end;

end.


unit Unit2;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls,StdCtrls,Unit1,MMSystem;

type
TForm2 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Edit14: TEdit;
Label15: TLabel;
ComboBox1: TComboBox;
ComboBox2: TComboBox;
ComboBox3: TComboBox;
ComboBox4: TComboBox;
ComboBox5: TComboBox;
ComboBox6: TComboBox;
ComboBox7: TComboBox;
ComboBox8: TComboBox;
ComboBox9: TComboBox;
ComboBox10: TComboBox;
ComboBox11: TComboBox;
Button1: TButton;
Button2: TButton;
Edit3: TEdit;
Label16: TLabel;
ComboBox12: TComboBox;
Timer1: TTimer;
Button3: TButton;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label21: TLabel;
Timer3: TTimer;
Label22: TLabel;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Timer4: TTimer;
Label23: TLabel;
Label24: TLabel;
Label25: TLabel;
Label26: TLabel;
Label20: TLabel;
Timer2: TTimer;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure Timer3Timer(Sender: TObject);
procedure Timer4Timer(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form2: TForm2;
X,Y,Z: integer;

implementation

{$R *.DFM}

procedure TForm2.Button2Click(Sender: TObject);
begin
Form2.Close;
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
If (Edit1.Text)and(Edit2.Text)and(ComboBox1.Text)and(ComboBox2.Text)and
(ComboBox3.Text)and(ComboBox4.Text)and(ComboBox5.Text)and(ComboBox6.Text)and
(ComboBox7.Text)and(ComboBox8.Text)and(ComboBox9.Text)and(ComboBox10.Text)and
(ComboBox11.Text) and (Edit3.Text) and
(Edit14.Text`)and(ComboBox12.Text'') then
begin
if Lista=nil then
begin
Lista:=TList.Create;
Index:=0;
Index:=Lista.Add(TMechaniczne.Create(StrToInt(Edit3.Text), StrToInt(Edit14.Text), Edit1.Text,Edit2.Text, ComboBox2.Text, ComboBox1.Text,ComboBox8.Text, ComboBox9.Text, ComboBox10.Text, ComboBox11.Text, ComboBox3.Text, ComboBox4.Text, ComboBox5.Text, ComboBox6.Text, ComboBox7.Text, ComboBox12.Text));
ShowMessage('Chronometr Mechaniczny zostal utworzony');
Form2.Close;
end
else
begin
Index:=Lista.Add(TMechaniczne.Create(StrToInt(Edit3.Text),StrToInt(Edit14.Text), Edit1.Text,Edit2.Text, ComboBox2.Text, ComboBox1.Text, ComboBox8.Text, ComboBox9.Text, ComboBox10.Text, ComboBox11.Text, ComboBox3.Text, ComboBox4.Text, ComboBox5.Text,
ComboBox6.Text, ComboBox7.Text, ComboBox12.Text));
ShowMessage('Chronometr Mechaniczny zostal utworzony');
Form2.Close
end
end
else
ShowMessage('Blad w wprowadzaniu danych');
end;

procedure TForm2.FormActivate(Sender: TObject);
begin
nowy:=TMechaniczne.Create;
nowy.Czas(Label23,Label24,Label25);
end;

procedure TForm2.Timer3Timer(Sender: TObject);
var
t:TDateTime;
begin
Date;
t:=Date;
nowy:=TMechaniczne.Create;
nowy.Data(ComboBox7,Label22,t);
end;

procedure TForm2.Timer1Timer(Sender: TObject);
begin
nowy.Timer(ComboBox4,Button3,Label17,Label18,Label19);
end;

procedure TForm2.Button3Click(Sender: TObject);
begin
nowy.Ustaw(Timer1,Button3);
end;

procedure TForm2.Timer4Timer(Sender: TObject);
begin
nowy:=TMechaniczne.Create;
nowy.Budzik(Edit4,Edit5,Edit6,ComboBox3,Label23,Label24,Label25);
end;

end.


unit Unit3;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,Unit1;

type
TForm3 = class(TForm)
ListBox1: TListBox;
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form3: TForm3;

implementation

{$R *.DFM}

procedure TForm3.Button1Click(Sender: TObject);
begin
Close;
end;

procedure TForm3.Button2Click(Sender: TObject);
begin
index:=ListBox1.ItemIndex;
ListBox1.Items.Delete(index);

end;

procedure TForm3.Button3Click(Sender: TObject);
begin
ListBox1.Sorted:=True;
end;

end.


unit Unit4;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,Unit1,ExtCtrls;

type
TForm4 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
Label3: TLabel;
ComboBox1: TComboBox;
Label4: TLabel;
ComboBox2: TComboBox;
Label5: TLabel;
ComboBox3: TComboBox;
Label6: TLabel;
ComboBox4: TComboBox;
Label7: TLabel;
ComboBox5: TComboBox;
Label8: TLabel;
ComboBox6: TComboBox;
Label9: TLabel;
ComboBox7: TComboBox;
Label10: TLabel;
ComboBox8: TComboBox;
Label11: TLabel;
ComboBox9: TComboBox;
Label12: TLabel;
ComboBox10: TComboBox;
Label13: TLabel;
ComboBox11: TComboBox;
Label14: TLabel;
Label15: TLabel;
ComboBox13: TComboBox;
Label16: TLabel;
ComboBox14: TComboBox;
Label17: TLabel;
ComboBox15: TComboBox;
Button1: TButton;
Button2: TButton;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Edit3: TEdit;
Timer1: TTimer;
Label23: TLabel;
Timer2: TTimer;
Label24: TLabel;
Label25: TLabel;
Label26: TLabel;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Label27: TLabel;
Button3: TButton;
Timer3: TTimer;
Timer4: TTimer;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Timer3Timer(Sender: TObject);
procedure Timer4Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form4: TForm4;

implementation

{$R *.DFM}

procedure TForm4.Button2Click(Sender: TObject);
begin
Close;
end;

procedure TForm4.Button1Click(Sender: TObject);
begin
If (Edit1.Text)and(Edit2.Text)and(ComboBox1.Text)and(ComboBox2.Text)and
(ComboBox3.Text)and(ComboBox4.Text)and(ComboBox5.Text)and(ComboBox6.Text)and
(ComboBox7.Text)and(ComboBox8.Text)and(ComboBox9.Text)and(ComboBox10.Text)and
(ComboBox11.Text) and (ComboBox14.Text)and(ComboBox15.Text)and (Edit3.Text)and
(ComboBox13.Text'') then
begin
if Lista=nil then
begin
Lista:=TList.Create;
Index:=0;
Index:=Lista.Add(TAtomowe.Create(StrToInt(Edit3.Text), Edit1.Text, Edit2.Text, ComboBox2.Text, ComboBox1.Text, ComboBox8.Text, ComboBox9.Text, ComboBox10.Text, ComboBox11.Text, ComboBox3.Text, ComboBox4.Text, ComboBox5.Text, ComboBox6.Text, ComboBox7.Text, ComboBox13.Text, ComboBox14.Text, ComboBox15.Text));
ShowMessage('Chronometr Atomowy zostal utworzony');
Form4.Close;
end
else
begin
Index:=Lista.Add(TAtomowe.Create(StrToInt(Edit3.Text), Edit1.Text,Edit2.Text, ComboBox2.Text, ComboBox1.Text, ComboBox8.Text, ComboBox9.Text, ComboBox10.Text, ComboBox11.Text, ComboBox3.Text, ComboBox4.Text, ComboBox5.Text, ComboBox6.Text, ComboBox7.Text, ComboBox13.Text, ComboBox14.Text, ComboBox15.Text));
ShowMessage('Chronometr Atomowy zostal utworzony');
Form4.Close
end
end
else
ShowMessage('Blad w wprowadzaniu danych');
end;

procedure TForm4.FormActivate(Sender: TObject);
begin
nowy:=TAtomowe.Create;
nowy.Czas(Label19,Label24,Label25);
end;

procedure TForm4.Timer2Timer(Sender: TObject);
var
t:TDateTime;
begin
Date;
t:=Date;
nowy:=TAtomowe.Create;
nowy.Data(ComboBox7,Label23,t);
end;

procedure TForm4.Timer3Timer(Sender: TObject);
begin
nowy:=TAtomowe.Create;
nowy.Timer(ComboBox4,Button3,Label20,Label21,Label22);
end;

procedure TForm4.Button3Click(Sender: TObject);
begin
nowy:=TAtomowe.Create;
nowy.Ustaw(Timer3,Button3);
end;

procedure TForm4.Timer4Timer(Sender: TObject);
begin
nowy:=TAtomowe.Create;
nowy.Budzik(Edit4,Edit5,Edit6,ComboBox3,Label19,Label24,Label25);
end;

end.


unit Unit5;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,ExtCtrls,Unit1, Unit4;

type
TForm5 = class(TForm)
Label1: TLabel;
Edit1: TEdit;
Label2: TLabel;
Edit2: TEdit;
Label3: TLabel;
ComboBox1: TComboBox;
Label4: TLabel;
ComboBox2: TComboBox;
Label5: TLabel;
ComboBox3: TComboBox;
Label6: TLabel;
ComboBox4: TComboBox;
Label7: TLabel;
ComboBox5: TComboBox;
Label8: TLabel;
ComboBox6: TComboBox;
Label9: TLabel;
ComboBox7: TComboBox;
Label10: TLabel;
ComboBox8: TComboBox;
Label11: TLabel;
ComboBox9: TComboBox;
Label12: TLabel;
ComboBox10: TComboBox;
Label13: TLabel;
ComboBox11: TComboBox;
Label14: TLabel;
ComboBo
x12: TComboBox;
Label15: TLabel;
ComboBox13: TComboBox;
Button1: TButton;
Button2: TButton;
Label16: TLabel;
Timer1: TTimer;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
Label24: TLabel;
Label25: TLabel;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Button3: TButton;
Timer2: TTimer;
Timer3: TTimer;
Timer4: TTimer;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
procedure Timer3Timer(Sender: TObject);
procedure Timer4Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form5: TForm5;

implementation

{$R *.DFM}

procedure TForm5.Button2Click(Sender: TObject);
begin
Close;
end;

procedure TForm5.Button1Click(Sender: TObject);
begin
If (Edit1.Text)and(Edit2.Text)and(ComboBox1.Text)and(ComboBox2.Text)and
(ComboBox3.Text)and(ComboBox4.Text)and(ComboBox5.Text)and(ComboBox6.Text)and
(ComboBox7.Text)and(ComboBox8.Text)and(ComboBox9.Text)and(ComboBox10.Text)and
(ComboBox11.Text) and(ComboBox12.Text)and (ComboBox13.Text'') then
begin
if Lista=nil then
begin
Lista:=TList.Create;
Index:=0;
Index:=Lista.Add(TElektroniczne.Create(Edit1.Text, Edit2.Text, ComboBox2.Text, ComboBox1.Text, ComboBox8.Text, ComboBox9.Text, ComboBox10.Text, ComboBox11.Text, ComboBox3.Text, ComboBox4.Text, ComboBox5.Text, ComboBox6.Text, ComboBox7.Text, ComboBox13.Text, ComboBox12.Text));
ShowMessage('Chronometr Elektroniczny zostal utworzony');
Form5.Close;
end
else
begin
Index:=Lista.Add(TElektroniczne.Create(Edit1.Text, Edit2.Text, ComboBox2.Text, ComboBox1.Text, ComboBox8.Text, ComboBox9.Text, ComboBox10.Text, ComboBox11.Text, ComboBox3.Text, ComboBox4.Text, ComboBox5.Text, ComboBox6.Text, ComboBox7.Text, ComboBox13.Text, ComboBox12.Text));
ShowMessage('Chronometr Elektroniczny zostal utworzony');
Form5.Close
end
end
else
ShowMessage('Blad w wprowadzaniu danych');
end;

procedure TForm5.FormActivate(Sender: TObject);
begin
nowy:=TElektroniczne.Create;
nowy.Czas(Label16,Label17,Label18);
end;

procedure TForm5.Timer2Timer(Sender: TObject);
var
t:TDateTime;
begin
Date;
t:=Date;
nowy:=TElektroniczne.Create;
nowy.Data(ComboBox7,Label19,t);
end;

procedure TForm5.Timer3Timer(Sender: TObject);
begin
nowy:=TElektroniczne.Create;
nowy.Timer(ComboBox4,Button3,Label23,Label24,Label25);
end;

procedure TForm5.Button3Click(Sender: TObject);
begin
nowy:=TElektroniczne.Create;
nowy.Ustaw(Timer3,Button3);
end;

procedure TForm5.Timer4Timer(Sender: TObject);
begin
nowy:=TElektroniczne.Create;
nowy.Budzik(Edit3,Edit4,Edit5,ComboBox3,Label16,Label17,Label18);
end;

end.

0

Lepiej jak bys dał kod zródłofy

0

Kiedyś dostałem podobny mail - z takim czyms - i niechcący go usunąłem :] i gosciu nie dostanie kodu :(

ale wracając co tam masz: lepiej udostępnij kod źródłowy i go spakuj nikomu się nie chce czytać tylu linijek i robić tego - bo najlepiej jest np. włączyć debuggera

ale mysle ze kołopot to:

//unit1-deklaracja klas, konstruktory
unit2- wywołanie metod wirtualnych dla klasy TMechaniczne- działa
unit4- wywołanie metod wirtualnych dla klasy TAtomowe- nie działają metody????
unit4- wywołanie metod wirtualnych dla klasy TElektroniczne- nie działają metody???
unit3- wyświetlenie- działa dla wszystkich

A wiesz co ci powiem to ty do mnie wysłałęś maila !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! wysliej jeszcze raz ale z kodem tzn. wszystkie pasy dcr dcu itp. ale bez exe !!!!!!!!!!!--

1 użytkowników online, w tym zalogowanych: 0, gości: 1, botów: 0