Progress.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //----------------------------------------------------------------------------
  2. #ifndef ProgressH
  3. #define ProgressH
  4. //----------------------------------------------------------------------------
  5. #include <vcl\System.hpp>
  6. #include <vcl\Windows.hpp>
  7. #include <vcl\SysUtils.hpp>
  8. #include <vcl\Classes.hpp>
  9. #include <vcl\Graphics.hpp>
  10. #include <vcl\StdCtrls.hpp>
  11. #include <vcl\Forms.hpp>
  12. #include <vcl\Controls.hpp>
  13. #include <vcl\Buttons.hpp>
  14. #include <vcl\ExtCtrls.hpp>
  15. #include <ComCtrls.hpp>
  16. #include <PathLabel.hpp>
  17. #include <FileOperationProgress.h>
  18. //----------------------------------------------------------------------------
  19. class TProgressForm : public TForm
  20. {
  21. __published:
  22. TAnimate *Animate;
  23. TButton *CancelButton;
  24. TButton *MinimizeButton;
  25. TPanel *MainPanel;
  26. TLabel *Label1;
  27. TPathLabel *FileLabel;
  28. TLabel *TargetLabel;
  29. TPathLabel *TargetPathLabel;
  30. TProgressBar *OperationProgress;
  31. TPanel *TransferPanel;
  32. TLabel *Label3;
  33. TLabel *TimeElapsedLabel;
  34. TLabel *StartTimeLabelLabel;
  35. TLabel *StartTimeLabel;
  36. TLabel *Label4;
  37. TLabel *BytesTransferedLabel;
  38. TLabel *Label7;
  39. TLabel *CPSLabel;
  40. TProgressBar *FileProgress;
  41. TTimer *UpdateTimer;
  42. TCheckBox *DisconnectWhenCompleteCheck;
  43. TLabel *Label10;
  44. TLabel *TransferModeLabel;
  45. TLabel *Label11;
  46. TLabel *ResumeLabel;
  47. TPanel *SpeedPanel;
  48. TLabel *SpeedLabel;
  49. TTrackBar *SpeedBar;
  50. TLabel *SpeedLowLabel;
  51. TLabel *SpeedHighLabel;
  52. TLabel *TimeEstimatedLabelLabel;
  53. TLabel *TimeEstimatedLabel;
  54. void __fastcall UpdateTimerTimer(TObject *Sender);
  55. void __fastcall FormShow(TObject *Sender);
  56. void __fastcall FormHide(TObject *Sender);
  57. void __fastcall CancelButtonClick(TObject *Sender);
  58. void __fastcall MinimizeButtonClick(TObject *Sender);
  59. private:
  60. TCancelStatus FCancel;
  61. TFileOperationProgressType FData;
  62. bool FDataReceived;
  63. TFileOperation FLastOperation;
  64. bool FLastTotalSizeSet;
  65. bool FMinimizedByMe;
  66. int FUpdateCounter;
  67. bool FAsciiTransferChanged;
  68. bool FResumeStatusChanged;
  69. void * FShowAsModalStorage;
  70. TDateTime FLastUpdate;
  71. bool FDeleteToRecycleBin;
  72. void __fastcall SetDisconnectWhenComplete(bool value);
  73. bool __fastcall GetDisconnectWhenComplete();
  74. void __fastcall SetAllowMinimize(bool value);
  75. bool __fastcall GetAllowMinimize();
  76. protected:
  77. void __fastcall CancelOperation();
  78. void __fastcall MinimizeApp();
  79. void __fastcall UpdateControls();
  80. public:
  81. static AnsiString __fastcall OperationName(TFileOperation Operation);
  82. virtual __fastcall ~TProgressForm();
  83. void __fastcall SetProgressData(const TFileOperationProgressType & AData);
  84. virtual __fastcall TProgressForm(TComponent * AOwner);
  85. __property TCancelStatus Cancel = { read = FCancel };
  86. __property bool DisconnectWhenComplete = { read=GetDisconnectWhenComplete, write=SetDisconnectWhenComplete };
  87. __property bool AllowMinimize = { read=GetAllowMinimize, write=SetAllowMinimize };
  88. __property bool DeleteToRecycleBin = { read=FDeleteToRecycleBin, write=FDeleteToRecycleBin };
  89. };
  90. //----------------------------------------------------------------------------
  91. #endif