Console.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. #include <GUITools.h>
  22. //----------------------------------------------------------------------------
  23. class TConsoleDialog : public TForm
  24. {
  25. __published:
  26. TMemo *OutputMemo;
  27. TBevel *Bevel1;
  28. TLabel *Label1;
  29. TLabel *Label2;
  30. TLabel *Label4;
  31. TButton *CancelBtn;
  32. THistoryComboBox *CommandEdit;
  33. TButton *ExecuteButton;
  34. TPathLabel *DirectoryLabel;
  35. TButton *HelpButton;
  36. TPngImageList *Images;
  37. TPopupMenu *PopupMenu;
  38. TMenuItem *SelectAllItem;
  39. TMenuItem *CopyItem;
  40. TMenuItem *N1;
  41. TMenuItem *AdjustWindowItem;
  42. TActionList *ActionList;
  43. TEditCopy *EditCopy;
  44. TEditSelectAll *EditSelectAll;
  45. TAction *AdjustWindow;
  46. TImage *Image;
  47. TPngImageList *Images120;
  48. TPngImageList *Images144;
  49. TPngImageList *Images192;
  50. void __fastcall ExecuteButtonClick(TObject *Sender);
  51. void __fastcall CommandEditChange(TObject *Sender);
  52. void __fastcall HelpButtonClick(TObject *Sender);
  53. void __fastcall ActionListExecute(TBasicAction *Action, bool &Handled);
  54. void __fastcall ActionListUpdate(TBasicAction *Action, bool &Handled);
  55. void __fastcall FormShow(TObject *Sender);
  56. void __fastcall OutputMemoContextPopup(TObject *Sender, TPoint &MousePos,
  57. bool &Handled);
  58. void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
  59. private:
  60. TTerminal * FTerminal;
  61. TTerminal * FLastTerminal;
  62. TNotifyEvent FOldChangeDirectory;
  63. TNotifyEvent FPrevTerminalClose;
  64. TRect FAutoBounds;
  65. bool FClearExceptionOnFail;
  66. bool FDirectoryChanged;
  67. bool FExecuting;
  68. void __fastcall DoExecuteCommand();
  69. void __fastcall ExecuteCommand();
  70. void __fastcall SetTerminal(TTerminal * value);
  71. void __fastcall TerminalClose(TObject * Sender);
  72. void __fastcall AddLine(const UnicodeString & Line, TCaptureOutputType OutputType);
  73. protected:
  74. void __fastcall DoChangeDirectory(TObject * Sender);
  75. void __fastcall UpdateControls();
  76. virtual void __fastcall CreateParams(TCreateParams & Params);
  77. virtual void __fastcall Dispatch(void * Message);
  78. void __fastcall DoAdjustWindow();
  79. INTERFACE_HOOK;
  80. public:
  81. virtual __fastcall ~TConsoleDialog();
  82. virtual __fastcall TConsoleDialog(TComponent* AOwner);
  83. bool __fastcall Execute(const UnicodeString Command = L"",
  84. const TStrings * Log = NULL);
  85. __property TTerminal * Terminal = { read = FTerminal, write = SetTerminal };
  86. };
  87. //----------------------------------------------------------------------------
  88. #endif