FileFind.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //---------------------------------------------------------------------------
  2. #ifndef FileFindH
  3. #define FileFindH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Controls.hpp>
  7. #include <StdCtrls.hpp>
  8. #include <Forms.hpp>
  9. #include <HistoryComboBox.hpp>
  10. #include <WinInterface.h>
  11. #include <ComCtrls.hpp>
  12. #include <ExtCtrls.hpp>
  13. #include "IEListView.hpp"
  14. #include "NortonLikeListView.hpp"
  15. #include <Vcl.Imaging.pngimage.hpp>
  16. //---------------------------------------------------------------------------
  17. class TFileFindDialog : public TForm
  18. {
  19. __published:
  20. TGroupBox *FilterGroup;
  21. TButton *CancelButton;
  22. TLabel *MaskLabel;
  23. TLabel *RemoteDirectoryLabel;
  24. THistoryComboBox *RemoteDirectoryEdit;
  25. THistoryComboBox *MaskEdit;
  26. TButton *StartStopButton;
  27. TButton *HelpButton;
  28. TIEListView *FileView;
  29. TStatusBar *StatusBar;
  30. TButton *FocusButton;
  31. TButton *MinimizeButton;
  32. TStaticText *MaskHintText;
  33. TButton *MaskButton;
  34. TImage *Image;
  35. void __fastcall ControlChange(TObject *Sender);
  36. void __fastcall StartStopButtonClick(TObject *Sender);
  37. void __fastcall StopButtonClick(TObject *Sender);
  38. void __fastcall MinimizeButtonClick(TObject *Sender);
  39. void __fastcall FormShow(TObject *Sender);
  40. void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
  41. void __fastcall HelpButtonClick(TObject *Sender);
  42. void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
  43. TShiftState Shift);
  44. void __fastcall MaskEditExit(TObject *Sender);
  45. void __fastcall FileViewDblClick(TObject *Sender);
  46. void __fastcall FocusButtonClick(TObject *Sender);
  47. void __fastcall FileViewSelectItem(TObject *Sender, TListItem *Item,
  48. bool Selected);
  49. void __fastcall MaskButtonClick(TObject *Sender);
  50. public:
  51. __fastcall TFileFindDialog(TComponent * Owner, TFindEvent OnFind);
  52. virtual __fastcall ~TFileFindDialog();
  53. bool __fastcall Execute(UnicodeString Directory, UnicodeString & Path);
  54. protected:
  55. void __fastcall Clear();
  56. void __fastcall Start();
  57. void __fastcall Stop();
  58. bool __fastcall StopIfFinding();
  59. void __fastcall GlobalMinimize(TObject * Sender);
  60. void __fastcall UpdateControls();
  61. bool __fastcall IsFinding();
  62. private:
  63. enum { ffInit, ffFinding, ffAborting, ffAborted, ffDone } FState;
  64. bool FMinimizedByMe;
  65. UnicodeString FFindingInDirectory;
  66. UnicodeString FDirectory;
  67. TFindEvent FOnFind;
  68. TImageList * FSystemImageList;
  69. void __fastcall FileFound(TTerminal * Terminal,
  70. const UnicodeString FileName, const TRemoteFile * File, bool & Cancel);
  71. void __fastcall FindingFile(TTerminal * Terminal, const UnicodeString Directory,
  72. bool & Cancel);
  73. };
  74. //---------------------------------------------------------------------------
  75. #endif