Reference TCustomTerminal
Declared in Codebot.Terminal.Controls.pas on line 76
TCustomTerminal is a terminal emulator. The shell starts when the control is first shown. OnReady is invoked when the shell has written its prompt, and OnTerminate when the shell ends, such as when exit is typed. Restart clears the terminal and starts the shell again, and can be called from OnTerminate to keep the terminal going.
TCustomTerminal = class(TWinControl, ITerminalEvents)
protected
class procedure WSRegisterClass; override;
procedure InitializeWnd; override;
procedure DestroyWnd; override;
procedure FontChanged(Sender: TObject); override;
procedure PaintWindow(DC: HDC); override;
{ Paint the control when it has no terminal, using ControlCanvas }
procedure Paint; virtual;
{ ControlCanvas is used to paint the control when it has no terminal }
property ControlCanvas: TControlCanvas read FCanvas;
{ Invoke OnReady }
procedure DoReady; virtual;
{ Invoke OnTerminate }
procedure DoTerminate; virtual;
{ The colors of the terminal }
property Colors: TTerminalColors read FColors write SetColors;
{ When true a vertical scroll bar is shown beside the terminal to scroll
back through its output. When false the mouse wheel still scrolls. }
property ScrollBar: Boolean read FScrollBar write SetScrollBar default True;
{ OnReady is invoked when the shell has written its prompt }
property OnReady: TNotifyEvent read FOnReady write FOnReady;
{ OnTerminate is invoked when the shell ends }
property OnTerminate: TNotifyEvent read FOnTerminate write FOnTerminate;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
{ True if the control is showing a terminal, false if it paints a message }
function HasTerminal: Boolean;
{ Clear the terminal and start the shell again }
procedure Restart;
end;See also
ITerminalEvents in Codebot.Terminal.Types.pas