home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
sibdemo3.zip
/
SAMPLES.DAT
/
SAMPLES
/
ADDONSMP
/
SWIUNIT.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1997-07-03
|
1KB
|
58 lines
Unit SwiUnit;
Interface
Uses
Classes, Forms, Graphics, GlyphBtn, ComCtrls;
Type
TOnOffSwitchForm = Class (TForm)
OnOffSwitch1: TOnOffSwitch;
OnOffSwitch2: TOnOffSwitch;
OnOffSwitch3: TOnOffSwitch;
OnOffSwitch4: TOnOffSwitch;
ProgressBar1: TProgressBar;
ProgressBar2: TProgressBar;
ProgressBar3: TProgressBar;
ProgressBar4: TProgressBar;
Timer1: TTimer;
Procedure OnOffSwitchFormOnCreate (Sender: TObject);
Procedure Timer1OnTimer (Sender: TObject);
Private
{Insert private declarations here}
Public
{Insert public declarations here}
End;
Var
OnOffSwitchForm: TOnOffSwitchForm;
Implementation
Procedure TOnOffSwitchForm.OnOffSwitchFormOnCreate (Sender: TObject);
Begin
Timer1.Start;
End;
Procedure TOnOffSwitchForm.Timer1OnTimer (Sender: TObject);
Procedure SetState(Switch:TOnOffSwitch;ProgressBar:TProgressBar);
Begin
If not Switch.Down Then
ProgressBar.Position:=Random(100);
End;
Begin
If Handle=0 Then exit;
Randomize;
SetState(OnOffSwitch1,ProgressBar1);
SetState(OnOffSwitch2,ProgressBar2);
SetState(OnOffSwitch3,ProgressBar3);
SetState(OnOffSwitch4,ProgressBar4);
End;
Initialization
RegisterClasses ([TOnOffSwitchForm, TOnOffSwitch, TProgressBar, TTimer]);
End.