Progress.h 3.5 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. TCheckBox *DisconnectWhenCompleteCheck;
  44. TLabel *Label10;
  45. TLabel *TransferModeLabel;
  46. TLabel *Label11;
  47. TLabel *ResumeLabel;
  48. TPanel *SpeedPanel;
  49. TLabel *SpeedLabel2;
  50. TLabel *TimeLeftLabelLabel;
  51. TLabel *TimeLeftLabel;
  52. THistoryComboBox *SpeedCombo;
  53. void __fastcall UpdateTimerTimer(TObject *Sender);
  54. void __fastcall FormShow(TObject *Sender);
  55. void __fastcall FormHide(TObject *Sender);
  56. void __fastcall CancelButtonClick(TObject *Sender);
  57. void __fastcall MinimizeButtonClick(TObject *Sender);
  58. void __fastcall SpeedComboExit(TObject *Sender);
  59. void __fastcall SpeedComboSelect(TObject *Sender);
  60. void __fastcall SpeedComboKeyPress(TObject *Sender, char &Key);
  61. private:
  62. TCancelStatus FCancel;
  63. TFileOperationProgressType FData;
  64. bool FDataReceived;
  65. TFileOperation FLastOperation;
  66. bool FLastTotalSizeSet;
  67. bool FMinimizedByMe;
  68. int FUpdateCounter;
  69. bool FAsciiTransferChanged;
  70. bool FResumeStatusChanged;
  71. void * FShowAsModalStorage;
  72. TDateTime FLastUpdate;
  73. bool FDeleteToRecycleBin;
  74. bool FReadOnly;
  75. unsigned long FCPSLimit;
  76. void __fastcall SetDisconnectWhenComplete(bool value);
  77. bool __fastcall GetDisconnectWhenComplete();
  78. void __fastcall SetAllowMinimize(bool value);
  79. bool __fastcall GetAllowMinimize();
  80. void __fastcall SetReadOnly(bool value);
  81. void __fastcall GlobalMinimize(TObject * Sender);
  82. protected:
  83. void __fastcall CancelOperation();
  84. void __fastcall MinimizeApp();
  85. void __fastcall UpdateControls();
  86. void __fastcall ApplyCPSLimit();
  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 bool DisconnectWhenComplete = { read=GetDisconnectWhenComplete, write=SetDisconnectWhenComplete };
  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