Console.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //----------------------------------------------------------------------------
  2. #ifndef ConsoleH
  3. #define ConsoleH
  4. //----------------------------------------------------------------------------
  5. #include <vcl\System.hpp>
  6. #include <vcl\Windows.hpp>
  7. #include <vcl\SysUtils.hpp>
  8. #include <vcl\Classes.hpp>
  9. #include <vcl\Graphics.hpp>
  10. #include <vcl\StdCtrls.hpp>
  11. #include <vcl\Forms.hpp>
  12. #include <vcl\Controls.hpp>
  13. #include <vcl\Buttons.hpp>
  14. #include <vcl\ExtCtrls.hpp>
  15. #include <ComCtrls.hpp>
  16. #include <HistoryComboBox.hpp>
  17. #include <PathLabel.hpp>
  18. #include <Terminal.h>
  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. void __fastcall ExecuteButtonClick(TObject *Sender);
  33. void __fastcall CommandEditChange(TObject *Sender);
  34. private:
  35. TTerminal * FTerminal;
  36. TNotifyEvent FOldChangeDirectory;
  37. TLogAddLineEvent FOldLogAddLine;
  38. bool FAddOutput;
  39. TNotifyEvent FPrevTerminalClose;
  40. void __fastcall DoExecuteCommand();
  41. void __fastcall ExecuteCommand();
  42. void __fastcall SetTerminal(TTerminal * value);
  43. void __fastcall TerminalClose(TObject * Sender);
  44. protected:
  45. void __fastcall DoChangeDirectory(TObject * Sender);
  46. void __fastcall DoLogAddLine(System::TObject* Sender, const AnsiString AddedLine);
  47. void __fastcall UpdateControls();
  48. virtual void __fastcall CreateParams(TCreateParams & Params);
  49. public:
  50. virtual __fastcall ~TConsoleDialog();
  51. virtual __fastcall TConsoleDialog(TComponent* AOwner);
  52. bool __fastcall Execute(const AnsiString Command = "");
  53. __property TTerminal * Terminal = { read = FTerminal, write = SetTerminal };
  54. };
  55. //----------------------------------------------------------------------------
  56. #endif