CustomCommand.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. TLabel *ShortCutLabel;
  32. TComboBox *ShortCutCombo;
  33. void __fastcall ControlChange(TObject *Sender);
  34. void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
  35. void __fastcall HelpButtonClick(TObject *Sender);
  36. void __fastcall CommandEditGetData(THistoryComboBox *Sender,
  37. Pointer & Data);
  38. void __fastcall CommandEditSetData(THistoryComboBox *Sender,
  39. Pointer Data);
  40. private:
  41. TCustomCommandsMode FMode;
  42. int FParams;
  43. UnicodeString FOrigDescription;
  44. const TCustomCommandList * FCustomCommandList;
  45. TCustomCommandValidate FOnValidate;
  46. void __fastcall SetParams(int value);
  47. int __fastcall GetParams();
  48. void __fastcall GetCommand(TCustomCommandType & Command);
  49. protected:
  50. void __fastcall UpdateControls();
  51. public:
  52. __fastcall TCustomCommandDialog(TComponent* Owner,
  53. const TCustomCommandList * CustomCommandList, TCustomCommandsMode Mode,
  54. int Options, TCustomCommandValidate OnValidate, const TShortCuts * ShortCuts);
  55. bool __fastcall Execute(TCustomCommandType & Command);
  56. };
  57. //---------------------------------------------------------------------------
  58. #endif