home *** CD-ROM | disk | FTP | other *** search
/ Chip: Shareware for Win 95 / Chip-Shareware-Win95.bin / ostatni / delphi / ruzne / rzcomps.exe / DEMO / PROGFRM.PA_ / PROGFRM.PA
Text File  |  1996-10-18  |  2KB  |  87 lines

  1. unit Progfrm;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, RzPrgres, RzTrkBar, StdCtrls, RzSpnEdt, RzLabel;
  8.  
  9. type
  10.   TFrmProgress = class(TForm)
  11.     Pbr1: TRzProgressBar;
  12.     Pbr2: TRzProgressBar;
  13.     Pbr3: TRzProgressBar;
  14.     Pbr4: TRzProgressBar;
  15.     TrkPercent: TRzTrackBar;
  16.     BtnOK: TButton;
  17.     Pbr5: TRzProgressBar;
  18.     SpnPartsComp: TRzSpinEdit;
  19.     SpnTotal: TRzSpinEdit;
  20.     Label1: TLabel;
  21.     Label2: TLabel;
  22.     Pbr6: TRzProgressBar;
  23.     RzLabel1: TRzLabel;
  24.     RzLabel2: TRzLabel;
  25.     RzLabel3: TRzLabel;
  26.     procedure TrkPercentChange(Sender: TObject);
  27.     procedure SpnPartsCompChange(Sender: TObject);
  28.     procedure SpnTotalChange(Sender: TObject);
  29.     procedure SpnPartsCompChanging(Sender: TObject;
  30.       var AllowChange: Boolean);
  31.   private
  32.     { Private declarations }
  33.   public
  34.     { Public declarations }
  35.   end;
  36.  
  37. var
  38.   FrmProgress: TFrmProgress;
  39.  
  40. implementation
  41.  
  42. {$R *.DFM}
  43.  
  44. procedure TFrmProgress.TrkPercentChange(Sender: TObject);
  45. begin
  46.   SpnPartsComp.Value := 0;
  47.   SpnTotal.Value := 0;
  48.   Pbr1.Percent := TrkPercent.Position;
  49.   Pbr2.Percent := TrkPercent.Position;
  50.   Pbr3.Percent := TrkPercent.Position;
  51.   Pbr4.Percent := TrkPercent.Position;
  52.   Pbr5.Percent := TrkPercent.Position;
  53.   Pbr6.Percent := TrkPercent.Position;
  54. end;
  55.  
  56. procedure TFrmProgress.SpnPartsCompChange(Sender: TObject);
  57. begin
  58.   Pbr1.PartsComplete := SpnPartsComp.IntValue;
  59.   Pbr2.PartsComplete := SpnPartsComp.IntValue;
  60.   Pbr3.PartsComplete := SpnPartsComp.IntValue;
  61.   Pbr4.PartsComplete := SpnPartsComp.IntValue;
  62.   Pbr5.PartsComplete := SpnPartsComp.IntValue;
  63.   Pbr6.PartsComplete := SpnPartsComp.IntValue;
  64. end;
  65.  
  66. procedure TFrmProgress.SpnTotalChange(Sender: TObject);
  67. begin
  68.   SpnPartsComp.Value := 0;
  69.   SpnPartsCompChange( Self );
  70.  
  71.   Pbr1.TotalParts := SpnTotal.IntValue;
  72.   Pbr2.TotalParts := SpnTotal.IntValue;
  73.   Pbr3.TotalParts := SpnTotal.IntValue;
  74.   Pbr4.TotalParts := SpnTotal.IntValue;
  75.   Pbr5.TotalParts := SpnTotal.IntValue;
  76.   Pbr6.TotalParts := SpnTotal.IntValue;
  77. end;
  78.  
  79. procedure TFrmProgress.SpnPartsCompChanging(Sender: TObject;
  80.   var AllowChange: Boolean);
  81. begin
  82.   if SpnTotal.IntValue = 0 then
  83.     AllowChange := False;
  84. end;
  85.  
  86. end.
  87.