SynchronizeProgress.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. //---------------------------------------------------------------------------
  2. #ifndef SynchronizeProgressH
  3. #define SynchronizeProgressH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Controls.hpp>
  7. #include <StdCtrls.hpp>
  8. #include <Forms.hpp>
  9. #include "PathLabel.hpp"
  10. #include <ExtCtrls.hpp>
  11. #include "PngImageList.hpp"
  12. #include "TB2Dock.hpp"
  13. #include "TB2Item.hpp"
  14. #include "TB2Toolbar.hpp"
  15. #include "TBX.hpp"
  16. #include <Vcl.ImgList.hpp>
  17. #include <GUITools.h>
  18. #include <Vcl.ComCtrls.hpp>
  19. //---------------------------------------------------------------------------
  20. class TSynchronizeProgressForm : public TForm
  21. {
  22. __published:
  23. TLabel *Label1;
  24. TLabel *Label2;
  25. TPathLabel *RemoteDirectoryLabel;
  26. TPathLabel *LocalDirectoryLabel;
  27. TLabel *StartTimeLabel;
  28. TLabel *StartTimeLabelLabel;
  29. TLabel *Label3;
  30. TLabel *TimeElapsedLabel;
  31. TTimer *UpdateTimer;
  32. TPngImageList *ImageList;
  33. TPanel *ToolbarPanel;
  34. TTBXDock *Dock;
  35. TTBXToolbar *Toolbar;
  36. TTBXItem *CancelItem;
  37. TTBXItem *MinimizeItem;
  38. TPaintBox *AnimationPaintBox;
  39. TPanel *ComponentsPanel;
  40. TPngImageList *ImageList120;
  41. TPngImageList *ImageList144;
  42. TPngImageList *ImageList192;
  43. TProgressBar *OperationProgress;
  44. TLabel *TimeLeftLabelLabel;
  45. TLabel *TimeLeftLabel;
  46. void __fastcall UpdateTimerTimer(TObject *Sender);
  47. void __fastcall MinimizeItemClick(TObject *Sender);
  48. void __fastcall CancelItemClick(TObject *Sender);
  49. public:
  50. __fastcall TSynchronizeProgressForm(TComponent * Owner, bool AllowMinimize, int Files);
  51. virtual __fastcall ~TSynchronizeProgressForm();
  52. void __fastcall Start();
  53. int __fastcall SetData(
  54. const UnicodeString & LocalDirectory, const UnicodeString & RemoteDirectory, int Progress, bool & Continue);
  55. __property bool Started = { read = FStarted };
  56. protected:
  57. virtual void __fastcall Dispatch(void * Message);
  58. int __fastcall CalculateProgress();
  59. private:
  60. TDateTime FStartTime;
  61. bool FStarted;
  62. bool FCanceled;
  63. void * FShowAsModalStorage;
  64. bool FMinimizedByMe;
  65. TFrameAnimation FFrameAnimation;
  66. void __fastcall UpdateControls();
  67. void __fastcall GlobalMinimize(TObject * Sender);
  68. void __fastcall CancelOperation();
  69. void __fastcall CMDialogKey(TCMDialogKey & Message);
  70. INTERFACE_HOOK;
  71. };
  72. //---------------------------------------------------------------------------
  73. #endif