Console.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. TNotifyEvent FPrevTerminalClose;
  41. void __fastcall DoExecuteCommand();
  42. void __fastcall ExecuteCommand();
  43. void __fastcall SetTerminal(TTerminal * value);
  44. void __fastcall TerminalClose(TObject * Sender);
  45. inline void __fastcall AddLine(TLogLineType Type, const AnsiString & Line);
  46. protected:
  47. void __fastcall DoChangeDirectory(TObject * Sender);
  48. void __fastcall DoLogAddLine(System::TObject* Sender, TLogLineType Type,
  49. const AnsiString AddedLine);
  50. void __fastcall UpdateControls();
  51. virtual void __fastcall CreateParams(TCreateParams & Params);
  52. public:
  53. virtual __fastcall ~TConsoleDialog();
  54. virtual __fastcall TConsoleDialog(TComponent* AOwner);
  55. bool __fastcall Execute(const AnsiString Command = "",
  56. const TStrings * Log = NULL);
  57. __property TTerminal * Terminal = { read = FTerminal, write = SetTerminal };
  58. };
  59. //----------------------------------------------------------------------------
  60. #endif