home *** CD-ROM | disk | FTP | other *** search
- unit Unit1;
-
- interface
-
- uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, TileBack,
- StdCtrls, ExtCtrls, ProgBar, GrphFunc, Buttonex;
-
- type
- TForm1 = class(TForm)
- ProgBar1: TProgBar;
- ProgBar2: TProgBar;
- ProgBar4: TProgBar;
- ProgBar5: TProgBar;
- ProgBar3: TProgBar;
- ProgBar6: TProgBar;
- ProgBar8: TProgBar;
- ProgBar9: TProgBar;
- ProgBar10: TProgBar;
- ProgBar7: TProgBar;
- Panel1: TPanel;
- Button1: TButton;
- Button2: TButton;
- Button4: TButton;
- Button5: TButton;
- Button3: TButton;
- Button6: TButton;
- Button7: TButton;
- RadioButton1: TRadioButton;
- RadioButton2: TRadioButton;
- RadioButton4: TRadioButton;
- RadioButton3: TRadioButton;
- Panel2: TPanel;
- RadioButton5: TRadioButton;
- RadioButton6: TRadioButton;
- Panel3: TPanel;
- RadioButton7: TRadioButton;
- RadioButton8: TRadioButton;
- Panel4: TPanel;
- RadioButton9: TRadioButton;
- RadioButton10: TRadioButton;
- RadioButton11: TRadioButton;
- ButtonExt1: TButtonExt;
- Panel5: TPanel;
- RadioButton12: TRadioButton;
- RadioButton13: TRadioButton;
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure Button2Click(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure Button3Click(Sender: TObject);
- procedure Button4Click(Sender: TObject);
- procedure Button5Click(Sender: TObject);
- procedure Button6Click(Sender: TObject);
- procedure Button7Click(Sender: TObject);
- procedure RadioButton1Click(Sender: TObject);
- procedure RadioButton2Click(Sender: TObject);
- procedure RadioButton3Click(Sender: TObject);
- procedure RadioButton4Click(Sender: TObject);
- procedure RadioButton5Click(Sender: TObject);
- procedure RadioButton6Click(Sender: TObject);
- procedure RadioButton7Click(Sender: TObject);
- procedure RadioButton8Click(Sender: TObject);
- procedure RadioButton9Click(Sender: TObject);
- procedure RadioButton10Click(Sender: TObject);
- procedure RadioButton11Click(Sender: TObject);
- procedure RadioButton12Click(Sender: TObject);
- procedure RadioButton13Click(Sender: TObject);
- private
- procedure Go( ProgBar: TProgBar; var state: integer );
- public
- constructor Create( AOwner: TComponent ); override;
- destructor Destroy; override;
- end;
-
- var
- State1 : integer;
- State2 : integer;
- State3 : integer;
- State4 : integer;
- State5 : integer;
- State6 : integer;
- State7 : integer;
-
- bitmap : TBitmap;
-
- Form1 : TForm1;
-
- implementation
-
- {$R *.DFM}
-
- constructor TForm1.Create( AOwner: TComponent );
- begin
- inherited Create( AOwner );
- bitmap := ButtonExt1.Bitmaps.Up;
- end;
-
- destructor TForm1.Destroy;
- begin
-
- inherited Destroy;
- end;
-
-
- procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- Action := caFree;
- end;
-
- procedure TForm1.Go( ProgBar : TProgBar; var state : integer );
- var
- i: integer;
- begin
-
- case state of
- 0:
- begin
- for i:=0 to 100 do
- Progbar.Value := i;
- state := 1;
- end;
- 1:
- begin
- for i:=0 to 50 do
- Progbar.Value := i;
- for i:=50 downto 33 do
- Progbar.Value := i;
- for i:=33 to 75 do
- Progbar.Value := i;
- for i:=75 downto 0 do
- Progbar.Value := i;
- for i:=0 to 100 do
- Progbar.Value := i;
-
- state := 2;
- end;
- 2:
- begin
- state := 0;
- Progbar.Value := 0;
- end;
- end;
-
- end;
-
-
- procedure TForm1.Button1Click(Sender: TObject);
- var
- i: integer;
- begin
-
-
- case State1 of
- 0:
- begin
- ProgBar1.BarType := Normal;
- ProgBar1.ForeColor:=clBlue;
- end;
- 1:
- begin
- ProgBar1.BarType := Bar3D;
- ProgBar1.ForeColor:=clBtnFace;
- end;
- end;
-
- Go( ProgBar1, State1 );
-
- end;
-
- procedure TForm1.Button2Click(Sender: TObject);
- var
- i: integer;
- begin
-
- case State2 of
- 0:
- begin
- ProgBar2.BarType := Normal;
- ProgBar2.ForeColor:=clBlue;
- end;
- 1:
- begin
- ProgBar2.BarType := Bar3D;
- ProgBar2.ForeColor:=clBtnFace;
- end;
- end;
-
- Go( ProgBar2, State2 );
- end;
-
- procedure TForm1.Button3Click(Sender: TObject);
- begin
- Go( ProgBar3, State3 );
- end;
-
- procedure TForm1.Button4Click(Sender: TObject);
- begin
- Go( ProgBar4, State4 );
- end;
-
- procedure TForm1.Button5Click(Sender: TObject);
- begin
- Go( ProgBar5, State5 );
- end;
-
- procedure TForm1.Button6Click(Sender: TObject);
- begin
- Go( ProgBar6, State6 );
- end;
-
- procedure TForm1.Button7Click(Sender: TObject);
- var
- i: integer;
- begin
-
- case State7 of
- 0:
- begin
- for i:=0 to 50 do
- begin
- Progbar7.Value := i*2 ;
- Progbar8.Value := i*2 ;
- Progbar9.Value := i*2 ;
- Progbar10.Value := i*2 ;
- end;
- state7 := 1;
- end;
- 1:
- begin
-
- for i:=0 to 25 do
- begin
- Progbar7.Value := i*2 ;
- Progbar8.Value := i*2 ;
- Progbar9.Value := i*2 ;
- Progbar10.Value := i*2 ;
- end;
- for i:=25 downto 22 do
- begin
- Progbar7.Value := i*2 ;
- Progbar8.Value := i*2 ;
- Progbar9.Value := i*2 ;
- Progbar10.Value := i*2 ;
- end;
- for i:=22 to 38 do
- begin
- Progbar7.Value := i*2 ;
- Progbar8.Value := i*2 ;
- Progbar9.Value := i*2 ;
- Progbar10.Value := i*2 ;
- end;
- for i:=38 downto 0 do
- begin
- Progbar7.Value := i*2 ;
- Progbar8.Value := i*2 ;
- Progbar9.Value := i*2 ;
- Progbar10.Value := i*2 ;
- end;
- for i:=0 to 50 do
- begin
- Progbar7.Value := i*2 ;
- Progbar8.Value := i*2 ;
- Progbar9.Value := i*2 ;
- Progbar10.Value := i*2 ;
- end;
-
- State7 := 2;
- end;
- 2:
- begin
- State7 := 0;
- Progbar7.Value := 0 ;
- Progbar8.Value := 0 ;
- Progbar9.Value := 0 ;
- Progbar10.Value := 0 ;
- end;
- end;
-
- end;
-
- procedure TForm1.RadioButton1Click(Sender: TObject);
- begin
- Progbar7.bitmap := nil;
- Progbar8.bitmap := nil;
- Progbar9.bitmap := nil;
- Progbar10.bitmap := nil;
-
- Progbar7.BarType := Normal;
- Progbar8.BarType := Normal;
- Progbar9.BarType := Normal;
- Progbar10.BarType := Normal;
-
- ProgBar7.ForeColor := clBlue;
- ProgBar8.ForeColor := clBlue;
- ProgBar9.ForeColor := clBlue;
- ProgBar10.ForeColor := clBlue;
-
- ProgBar7.BackColor := clBtnFace;
- ProgBar8.BackColor := clBtnFace;
- ProgBar9.BackColor := clBtnFace;
- ProgBar10.BackColor := clBtnFace;
-
- end;
-
- procedure TForm1.RadioButton2Click(Sender: TObject);
- begin
- Progbar7.bitmap := nil;
- Progbar8.bitmap := nil;
- Progbar9.bitmap := nil;
- Progbar10.bitmap := nil;
-
- Progbar7.BarType := Bar3D;
- Progbar8.BarType := Bar3D;
- Progbar9.BarType := Bar3D;
- Progbar10.BarType := Bar3D;
-
- ProgBar7.ForeColor := clBtnFace;
- ProgBar8.ForeColor := clBtnFace;
- ProgBar9.ForeColor := clBtnFace;
- ProgBar10.ForeColor := clBtnFace;
-
- ProgBar7.BackColor := clBtnFace;
- ProgBar8.BackColor := clBtnFace;
- ProgBar9.BackColor := clBtnFace;
- ProgBar10.BackColor := clBtnFace;
-
- end;
-
- procedure TForm1.RadioButton3Click(Sender: TObject);
- begin
- Progbar7.bitmap := bitmap;
- Progbar8.bitmap := bitmap;
- Progbar9.bitmap := bitmap;
- Progbar10.bitmap := bitmap;
-
- Progbar7.BarType := Bar3D;
- Progbar8.BarType := Bar3D;
- Progbar9.BarType := Bar3D;
- Progbar10.BarType := Bar3D;
-
- ProgBar7.ForeColor := clBtnFace;
- ProgBar8.ForeColor := clBtnFace;
- ProgBar9.ForeColor := clBtnFace;
- ProgBar10.ForeColor := clBtnFace;
-
- ProgBar7.BackColor := clBtnFace;
- ProgBar8.BackColor := clBtnFace;
- ProgBar9.BackColor := clBtnFace;
- ProgBar10.BackColor := clBtnFace;
-
-
- end;
-
- procedure TForm1.RadioButton4Click(Sender: TObject);
- begin
- Progbar7.bitmap := nil;
- Progbar8.bitmap := nil;
- Progbar9.bitmap := nil;
- Progbar10.bitmap := nil;
-
- Progbar7.BarType := LED;
- Progbar8.BarType := LED;
- Progbar9.BarType := LED;
- Progbar10.BarType := LED;
-
- ProgBar7.BackColor := clBlack;
- ProgBar8.BackColor := clBlack;
- ProgBar9.BackColor := clBlack;
- ProgBar10.BackColor := clBlack;
-
-
- end;
-
- procedure TForm1.RadioButton5Click(Sender: TObject);
- begin
- ProgBar7.BarShape := Rectangular;
- ProgBar8.BarShape := Rectangular;
- ProgBar9.BarShape := Rectangular;
- ProgBar10.BarShape := Rectangular;
-
-
- end;
-
- procedure TForm1.RadioButton6Click(Sender: TObject);
- begin
- ProgBar7.BarShape := Trapezoidal;
- ProgBar8.BarShape := Trapezoidal;
- ProgBar9.BarShape := Trapezoidal;
- ProgBar10.BarShape := Trapezoidal;
-
- end;
-
- procedure TForm1.RadioButton7Click(Sender: TObject);
- begin
- ProgBar7.TrapezoidDir := LargeToSmall;
- ProgBar8.TrapezoidDir := LargeToSmall;
- ProgBar9.TrapezoidDir := LargeToSmall;
- ProgBar10.TrapezoidDir := LargeToSmall;
-
- end;
-
- procedure TForm1.RadioButton8Click(Sender: TObject);
- begin
- ProgBar7.TrapezoidDir := SmallToLarge;
- ProgBar8.TrapezoidDir := SmallToLarge;
- ProgBar9.TrapezoidDir := SmallToLarge;
- ProgBar10.TrapezoidDir := SmallToLarge;
-
- end;
-
- procedure TForm1.RadioButton9Click(Sender: TObject);
- begin
- ProgBar7.TrapezoidShape := TSLeft;
- ProgBar8.TrapezoidShape := TSLeft;
- ProgBar9.TrapezoidShape := TSLeft;
- ProgBar10.TrapezoidShape := TSLeft;
-
- end;
-
- procedure TForm1.RadioButton10Click(Sender: TObject);
- begin
- ProgBar7.TrapezoidShape := TSCenter;
- ProgBar8.TrapezoidShape := TSCenter;
- ProgBar9.TrapezoidShape := TSCenter;
- ProgBar10.TrapezoidShape := TSCenter;
-
- end;
-
- procedure TForm1.RadioButton11Click(Sender: TObject);
- begin
- ProgBar7.TrapezoidShape := TSRight;
- ProgBar8.TrapezoidShape := TSRight;
- ProgBar9.TrapezoidShape := TSRight;
- ProgBar10.TrapezoidShape := TSRight;
-
- end;
-
- procedure TForm1.RadioButton12Click(Sender: TObject);
- var
- i : integer;
- begin
-
- for i:=0 to componentCount -1 do
- begin
- if (Components[ i ] is TProgbar) then
- TProgbar( Components[ i ]).ShowText := True;
- end;
- end;
-
- procedure TForm1.RadioButton13Click(Sender: TObject);
- var
- i : integer;
- begin
-
- for i:=0 to componentCount -1 do
- begin
- if (Components[ i ] is TProgbar) then
- TProgbar( Components[ i ]).ShowText := False;
- end;
- end;
-
- end.
-