FileFind.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. //---------------------------------------------------------------------------
  16. class TFileFindDialog : public TForm
  17. {
  18. __published:
  19. TGroupBox *FilterGroup;
  20. TButton *CancelButton;
  21. TLabel *MaskLabel;
  22. TLabel *RemoteDirectoryLabel;
  23. THistoryComboBox *RemoteDirectoryEdit;
  24. THistoryComboBox *MaskEdit;
  25. TButton *StartStopButton;
  26. TButton *HelpButton;
  27. TIEListView *FileView;
  28. TStatusBar *StatusBar;
  29. TButton *FocusButton;
  30. TButton *MinimizeButton;
  31. TStaticText *MaskHintText;
  32. void __fastcall ControlChange(TObject *Sender);
  33. void __fastcall StartStopButtonClick(TObject *Sender);
  34. void __fastcall StopButtonClick(TObject *Sender);
  35. void __fastcall MinimizeButtonClick(TObject *Sender);
  36. void __fastcall FormShow(TObject *Sender);
  37. void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
  38. void __fastcall HelpButtonClick(TObject *Sender);
  39. void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
  40. TShiftState Shift);
  41. void __fastcall MaskEditExit(TObject *Sender);
  42. void __fastcall FileViewDblClick(TObject *Sender);
  43. void __fastcall FocusButtonClick(TObject *Sender);
  44. void __fastcall FileViewSelectItem(TObject *Sender, TListItem *Item,
  45. bool Selected);
  46. public:
  47. __fastcall TFileFindDialog(TComponent * Owner, TFindEvent OnFind);
  48. virtual __fastcall ~TFileFindDialog();
  49. bool __fastcall Execute(AnsiString Directory, AnsiString & Path);
  50. protected:
  51. void __fastcall Clear();
  52. void __fastcall Start();
  53. void __fastcall Stop();
  54. bool __fastcall StopIfFinding();
  55. void __fastcall GlobalMinimize(TObject * Sender);
  56. void __fastcall MinimizeApp();
  57. void __fastcall UpdateControls();
  58. bool __fastcall IsFinding();
  59. private:
  60. enum { ffInit, ffFinding, ffAborting, ffAborted, ffDone } FState;
  61. bool FMinimizedByMe;
  62. AnsiString FFindingInDirectory;
  63. AnsiString FDirectory;
  64. TFindEvent FOnFind;
  65. TImageList * FSystemImageList;
  66. void __fastcall FileFound(TTerminal * Terminal,
  67. const AnsiString FileName, const TRemoteFile * File, bool & Cancel);
  68. void __fastcall FindingFile(TTerminal * Terminal, const AnsiString Directory,
  69. bool & Cancel);
  70. };
  71. //---------------------------------------------------------------------------
  72. #endif