Console.h 2.7 KB

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