Console.h 3.1 KB

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