Console.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. TButton *HelpButton;
  33. void __fastcall ExecuteButtonClick(TObject *Sender);
  34. void __fastcall CommandEditChange(TObject *Sender);
  35. void __fastcall HelpButtonClick(TObject *Sender);
  36. private:
  37. TTerminal * FTerminal;
  38. TTerminal * FLastTerminal;
  39. TNotifyEvent FOldChangeDirectory;
  40. TLogAddLineEvent FOldLogAddLine;
  41. bool FAddOutput;
  42. TNotifyEvent FPrevTerminalClose;
  43. void __fastcall DoExecuteCommand();
  44. void __fastcall ExecuteCommand();
  45. void __fastcall SetTerminal(TTerminal * value);
  46. void __fastcall TerminalClose(TObject * Sender);
  47. void __fastcall AddLine(TLogLineType Type, AnsiString Line);
  48. protected:
  49. void __fastcall DoChangeDirectory(TObject * Sender);
  50. void __fastcall DoLogAddLine(System::TObject* Sender, TLogLineType Type,
  51. const AnsiString AddedLine);
  52. void __fastcall UpdateControls();
  53. virtual void __fastcall CreateParams(TCreateParams & Params);
  54. public:
  55. virtual __fastcall ~TConsoleDialog();
  56. virtual __fastcall TConsoleDialog(TComponent* AOwner);
  57. bool __fastcall Execute(const AnsiString Command = "",
  58. const TStrings * Log = NULL);
  59. __property TTerminal * Terminal = { read = FTerminal, write = SetTerminal };
  60. };
  61. //----------------------------------------------------------------------------
  62. #endif