Console.h 2.7 KB

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