Progress.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. #include "HistoryComboBox.hpp"
  19. //----------------------------------------------------------------------------
  20. class TProgressForm : public TForm
  21. {
  22. __published:
  23. TAnimate *Animate;
  24. TButton *CancelButton;
  25. TButton *MinimizeButton;
  26. TPanel *MainPanel;
  27. TLabel *Label1;
  28. TPathLabel *FileLabel;
  29. TLabel *TargetLabel;
  30. TPathLabel *TargetPathLabel;
  31. TProgressBar *OperationProgress;
  32. TPanel *TransferPanel;
  33. TLabel *Label3;
  34. TLabel *TimeElapsedLabel;
  35. TLabel *StartTimeLabelLabel;
  36. TLabel *StartTimeLabel;
  37. TLabel *Label4;
  38. TLabel *BytesTransferedLabel;
  39. TLabel *Label12;
  40. TLabel *CPSLabel;
  41. TProgressBar *FileProgress;
  42. TTimer *UpdateTimer;
  43. TPanel *SpeedPanel;
  44. TLabel *SpeedLabel2;
  45. TLabel *TimeLeftLabelLabel;
  46. TLabel *TimeLeftLabel;
  47. THistoryComboBox *SpeedCombo;
  48. TLabel *OnceDoneOperationLabel;
  49. TComboBox *OnceDoneOperationCombo;
  50. void __fastcall UpdateTimerTimer(TObject *Sender);
  51. void __fastcall FormShow(TObject *Sender);
  52. void __fastcall FormHide(TObject *Sender);
  53. void __fastcall CancelButtonClick(TObject *Sender);
  54. void __fastcall MinimizeButtonClick(TObject *Sender);
  55. void __fastcall SpeedComboExit(TObject *Sender);
  56. void __fastcall SpeedComboSelect(TObject *Sender);
  57. void __fastcall SpeedComboKeyPress(TObject *Sender, char &Key);
  58. void __fastcall OnceDoneOperationComboSelect(TObject *Sender);
  59. void __fastcall OnceDoneOperationComboCloseUp(TObject *Sender);
  60. private:
  61. TCancelStatus FCancel;
  62. TFileOperationProgressType FData;
  63. bool FDataReceived;
  64. TFileOperation FLastOperation;
  65. bool FLastTotalSizeSet;
  66. bool FMinimizedByMe;
  67. int FUpdateCounter;
  68. bool FAsciiTransferChanged;
  69. bool FResumeStatusChanged;
  70. void * FShowAsModalStorage;
  71. TDateTime FLastUpdate;
  72. bool FDeleteToRecycleBin;
  73. bool FReadOnly;
  74. unsigned long FCPSLimit;
  75. TOnceDoneOperation FOnceDoneOperation;
  76. void __fastcall SetOnceDoneOperation(TOnceDoneOperation value);
  77. void __fastcall SetAllowMinimize(bool value);
  78. bool __fastcall GetAllowMinimize();
  79. void __fastcall SetReadOnly(bool value);
  80. void __fastcall GlobalMinimize(TObject * Sender);
  81. protected:
  82. void __fastcall CancelOperation();
  83. void __fastcall MinimizeApp();
  84. void __fastcall UpdateControls();
  85. void __fastcall ApplyCPSLimit();
  86. void __fastcall ResetOnceDoneOperation();
  87. public:
  88. static AnsiString __fastcall OperationName(TFileOperation Operation);
  89. virtual __fastcall ~TProgressForm();
  90. void __fastcall SetProgressData(TFileOperationProgressType & AData);
  91. virtual __fastcall TProgressForm(TComponent * AOwner);
  92. __property TCancelStatus Cancel = { read = FCancel };
  93. __property TOnceDoneOperation OnceDoneOperation = { read=FOnceDoneOperation, write=SetOnceDoneOperation };
  94. __property bool AllowMinimize = { read=GetAllowMinimize, write=SetAllowMinimize };
  95. __property bool DeleteToRecycleBin = { read=FDeleteToRecycleBin, write=FDeleteToRecycleBin };
  96. __property bool ReadOnly = { read=FReadOnly, write=SetReadOnly };
  97. };
  98. //----------------------------------------------------------------------------
  99. #endif