Console.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //----------------------------------------------------------------------------
  2. #ifndef ConsoleH
  3. #define ConsoleH
  4. //----------------------------------------------------------------------------
  5. #include "HistoryComboBox.hpp"
  6. #include "PathLabel.hpp"
  7. #include <System.Classes.hpp>
  8. #include <Vcl.ActnList.hpp>
  9. #include <Vcl.Controls.hpp>
  10. #include <Vcl.ExtCtrls.hpp>
  11. #include <Vcl.ImgList.hpp>
  12. #include <Vcl.Menus.hpp>
  13. #include <Vcl.StdActns.hpp>
  14. #include <Vcl.StdCtrls.hpp>
  15. //----------------------------------------------------------------------------
  16. #include "WinInterface.h"
  17. #include <Terminal.h>
  18. #include "PngImageList.hpp"
  19. #include <Vcl.Imaging.pngimage.hpp>
  20. #include <System.Actions.hpp>
  21. //----------------------------------------------------------------------------
  22. class TConsoleDialog : public TForm
  23. {
  24. __published:
  25. TMemo *OutputMemo;
  26. TBevel *Bevel1;
  27. TLabel *Label1;
  28. TLabel *Label2;
  29. TLabel *Label4;
  30. TButton *CancelBtn;
  31. THistoryComboBox *CommandEdit;
  32. TButton *ExecuteButton;
  33. TPathLabel *DirectoryLabel;
  34. TButton *HelpButton;
  35. TPngImageList *Images;
  36. TPopupMenu *PopupMenu;
  37. TMenuItem *SelectAllItem;
  38. TMenuItem *CopyItem;
  39. TMenuItem *N1;
  40. TMenuItem *AdjustWindowItem;
  41. TActionList *ActionList;
  42. TEditCopy *EditCopy;
  43. TEditSelectAll *EditSelectAll;
  44. TAction *AdjustWindow;
  45. TImage *Image;
  46. TPngImageList *Images120;
  47. TPngImageList *Images144;
  48. TPngImageList *Images192;
  49. void __fastcall ExecuteButtonClick(TObject *Sender);
  50. void __fastcall CommandEditChange(TObject *Sender);
  51. void __fastcall HelpButtonClick(TObject *Sender);
  52. void __fastcall ActionListExecute(TBasicAction *Action, bool &Handled);
  53. void __fastcall ActionListUpdate(TBasicAction *Action, bool &Handled);
  54. void __fastcall FormShow(TObject *Sender);
  55. void __fastcall OutputMemoContextPopup(TObject *Sender, TPoint &MousePos,
  56. bool &Handled);
  57. void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
  58. private:
  59. TTerminal * FTerminal;
  60. TTerminal * FLastTerminal;
  61. TNotifyEvent FOldChangeDirectory;
  62. TNotifyEvent FPrevTerminalClose;
  63. TRect FAutoBounds;
  64. bool FClearExceptionOnFail;
  65. bool FDirectoryChanged;
  66. bool FExecuting;
  67. void __fastcall DoExecuteCommand();
  68. void __fastcall ExecuteCommand();
  69. void __fastcall SetTerminal(TTerminal * value);
  70. void __fastcall TerminalClose(TObject * Sender);
  71. void __fastcall AddLine(const UnicodeString & Line, TCaptureOutputType OutputType);
  72. protected:
  73. void __fastcall DoChangeDirectory(TObject * Sender);
  74. void __fastcall UpdateControls();
  75. virtual void __fastcall CreateParams(TCreateParams & Params);
  76. virtual void __fastcall Dispatch(void * Message);
  77. void __fastcall DoAdjustWindow();
  78. public:
  79. virtual __fastcall ~TConsoleDialog();
  80. virtual __fastcall TConsoleDialog(TComponent* AOwner);
  81. bool __fastcall Execute(const UnicodeString Command = L"",
  82. const TStrings * Log = NULL);
  83. __property TTerminal * Terminal = { read = FTerminal, write = SetTerminal };
  84. };
  85. //----------------------------------------------------------------------------
  86. #endif