1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
unit alarm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DateUtils, StdCtrls, ExtCtrls; {pour les fonctions Tomorrow, Yesterday et IsToday}
type
TForm3 = class(TForm)
Label1: TLabel;
Timer1: TTimer;
dayCB: TComboBox;
hourCB: TComboBox;
minCB: TComboBox;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
procedure minCBChange(Sender: TObject);
procedure dayCBChange(Sender: TObject);
procedure hourCBChange(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Form3: TForm3;
Day : word;
Hour : word;
Minute : word;
DayC : string;
HourC : string;
MinuteC : string;
implementation
{$R *.dfm}
{$R WindowsXP.res}
procedure TForm3.minCBChange(Sender: TObject);
begin
MinuteC := minCB.Text;
Label1.Caption := MinuteC;
end;
procedure TForm3.dayCBChange(Sender: TObject);
begin
DayC := DayCB.Text;
end;
procedure TForm3.HourCBChange(Sender: TObject);
begin
HourC := HourCB.Text;
end;
procedure TForm3.Timer1Timer(Sender: TObject);
begin
Day := DayOfTheWeek(Now);
Hour := HourOf(Now);
Minute := MinuteOf(Now);
if ((Day = DayC) and (Hour = HourC) and (Minute = MinuteC)) then
begin
Windows.Beep(440, 500);
Windows.Beep(2000, 100);
Windows.Beep(440, 100);
Label1.Caption:='Il est l''heure de sortir les caliss de vidanges.!';
end;
end;
end. |
Partager