u3.pas
资源名称:辩论赛计时器.rar [点击查看]
上传用户:pegasus
上传日期:2013-04-14
资源大小:3825k
文件大小:3k
源码类别:
教育系统应用
开发平台:
Delphi
- {****************************************************************** }
- { 第三阶段-自由辩论阶段 }
- { }
- {****************************************************************** }
- unit u3;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ExtCtrls, Buttons, StdCtrls, jpeg;
- type
- TForm3 = class(TForm)
- Label3: TLabel;
- gbZh: TGroupBox;
- sbtnZhStart: TSpeedButton;
- ZhLeftTime: TLabel;
- gbF: TGroupBox;
- sbtnFStart: TSpeedButton;
- FLeftTime: TLabel;
- timerZh: TTimer;
- TimerF: TTimer;
- lb: TLabel;
- Image1: TImage;
- lbZh: TLabel;
- lbF: TLabel;
- procedure timerZhTimer(Sender: TObject);
- procedure TimerFTimer(Sender: TObject);
- procedure sbtnZhStartClick(Sender: TObject);
- procedure sbtnFStartClick(Sender: TObject);
- procedure FormKeyPress(Sender: TObject; var Key: Char);
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- tZh :integer; //正方时间
- tF :integer; //反方时间
- public
- { Public declarations }
- end;
- var
- Form3: TForm3;
- implementation
- uses
- uMain;
- {$R *.dfm}
- procedure TForm3.timerZhTimer(Sender: TObject);
- begin
- ZhleftTime.Caption:=IntToTime(tZh);
- if tZh=300 then
- begin
- beep1;
- end;
- if tZh=0 then
- begin
- uMain.beep2;
- timerZh.Enabled:=False;
- sbtnZhStart.Enabled:=False;
- // sbtnFStart.Enabled:=False; //考虑到主席要说:“正方时间到 ”
- // if tF>0 then timerF.Enabled:=True; //注释掉此两行
- end;
- tZh:=tZh-1;
- end;
- procedure TForm3.TimerFTimer(Sender: TObject);
- begin
- FleftTime.Caption:=IntToTime(tF);
- if tF=300 then
- begin
- beep1;
- end;
- if tF=0 then
- begin
- uMain.beep2;
- sbtnFStart.Enabled:=False;
- timerF.Enabled:=False;
- end;
- tF:=tF-1;
- end;
- procedure TForm3.sbtnZhStartClick(Sender: TObject);
- begin
- sbtnZhStart.Enabled:=False;
- sbtnFStart.Enabled:=True;
- timerZh.Enabled:=True;
- timerF.Enabled:=False;
- lb.Caption:='正 方 计 时 中';
- lb.Font:=sbtnZhStart.Font;
- lb.Font.Size:=28;
- if tF<1 then sbtnFStart.Enabled:=False;
- end;
- procedure TForm3.sbtnFStartClick(Sender: TObject);
- begin
- sbtnZhStart.Enabled:=True;
- sbtnFStart.Enabled:=False;
- timerZh.Enabled:=False;
- timerF.Enabled:=True;
- lb.Caption:='反 方 计 时 中';
- lb.Font:=sbtnFStart.Font;
- lb.Font.Size:=28;
- if tZh<1 then sbtnZhStart.Enabled:=False;
- end;
- procedure TForm3.FormKeyPress(Sender: TObject; var Key: Char);
- begin
- if (Key=#113) or (Key=#81) then
- Close;
- end;
- procedure TForm3.FormCreate(Sender: TObject);
- begin
- // tZh :=350; //正方时间
- // tF :=350; //反方时间
- tZh :=3000; //正方时间
- tF :=3000; //反方时间
- lbZh.Font.Color:=uMain.ZhFontColor;
- ZhLeftTime.Font.Color:= uMain.ZhFontColor;
- lbF.Font.Color:=uMain.FFontColor;
- FLeftTime.Font.Color:= uMain.FFontColor;
- gbZh.Color:=uMain.ZhBackgroundColor;
- gbF.Color:=uMain.FBackgroundColor;
- end;
- end.
English
