Progress.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 *TimeLeftLabelLabel;
  53. TLabel *TimeLeftLabel;
  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. bool FReadOnly;
  73. void __fastcall SetDisconnectWhenComplete(bool value);
  74. bool __fastcall GetDisconnectWhenComplete();
  75. void __fastcall SetAllowMinimize(bool value);
  76. bool __fastcall GetAllowMinimize();
  77. void __fastcall SetReadOnly(bool value);
  78. protected:
  79. void __fastcall CancelOperation();
  80. void __fastcall MinimizeApp();
  81. void __fastcall UpdateControls();
  82. public:
  83. static AnsiString __fastcall OperationName(TFileOperation Operation);
  84. virtual __fastcall ~TProgressForm();
  85. void __fastcall SetProgressData(const TFileOperationProgressType & AData);
  86. virtual __fastcall TProgressForm(TComponent * AOwner);
  87. __property TCancelStatus Cancel = { read = FCancel };
  88. __property bool DisconnectWhenComplete = { read=GetDisconnectWhenComplete, write=SetDisconnectWhenComplete };
  89. __property bool AllowMinimize = { read=GetAllowMinimize, write=SetAllowMinimize };
  90. __property bool DeleteToRecycleBin = { read=FDeleteToRecycleBin, write=FDeleteToRecycleBin };
  91. __property bool ReadOnly = { read=FReadOnly, write=SetReadOnly };
  92. };
  93. //----------------------------------------------------------------------------
  94. #endif