CustomCommand.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //---------------------------------------------------------------------------
  2. #ifndef CustomCommandH
  3. #define CustomCommandH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <Controls.hpp>
  7. #include <StdCtrls.hpp>
  8. #include <Forms.hpp>
  9. #include "HistoryComboBox.hpp"
  10. //---------------------------------------------------------------------------
  11. class TCustomCommands;
  12. //---------------------------------------------------------------------------
  13. class TCustomCommandDialog : public TForm
  14. {
  15. __published:
  16. TGroupBox *Group;
  17. TButton *OkButton;
  18. TButton *CancelButton;
  19. TLabel *DescriptionLabel;
  20. TEdit *DescriptionEdit;
  21. TLabel *Label1;
  22. THistoryComboBox *CommandEdit;
  23. TCheckBox *ApplyToDirectoriesCheck;
  24. TCheckBox *RecursiveCheck;
  25. TRadioButton *LocalCommandButton;
  26. TRadioButton *RemoteCommandButton;
  27. TCheckBox *ShowResultsCheck;
  28. TButton *HelpButton;
  29. TCheckBox *CopyResultsCheck;
  30. TStaticText *HintText;
  31. void __fastcall ControlChange(TObject *Sender);
  32. void __fastcall FormShow(TObject *Sender);
  33. void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
  34. void __fastcall HelpButtonClick(TObject *Sender);
  35. void __fastcall CommandEditGetData(THistoryComboBox *Sender,
  36. Pointer &Data);
  37. void __fastcall CommandEditSetData(THistoryComboBox *Sender,
  38. Pointer Data);
  39. private:
  40. TCustomCommandsMode FMode;
  41. int FOptions;
  42. int FParams;
  43. AnsiString FOrigDescription;
  44. const TCustomCommands * FCustomCommands;
  45. TCustomCommandValidate FOnValidate;
  46. void __fastcall SetCommand(AnsiString value);
  47. AnsiString __fastcall GetCommand();
  48. void __fastcall SetDescription(AnsiString value);
  49. AnsiString __fastcall GetDescription();
  50. void __fastcall SetParams(int value);
  51. int __fastcall GetParams();
  52. protected:
  53. void __fastcall UpdateControls();
  54. public:
  55. __fastcall TCustomCommandDialog(TComponent* Owner, unsigned int Options);
  56. bool __fastcall Execute();
  57. __property AnsiString Command = { read = GetCommand, write = SetCommand };
  58. __property AnsiString Description = { read = GetDescription, write = SetDescription };
  59. __property int Params = { read = GetParams, write = SetParams };
  60. __property TCustomCommandsMode Mode = { read = FMode, write = FMode };
  61. __property const TCustomCommands * CustomCommands = { read = FCustomCommands, write = FCustomCommands };
  62. __property TCustomCommandValidate OnValidate = { read = FOnValidate, write = FOnValidate };
  63. };
  64. //---------------------------------------------------------------------------
  65. #endif