unit form_uartterminalgui;

{$I _crw_sysdef.inc}

{$I _crw_sysmode.inc}

interface

uses
 //////////////////////////////////////////////////////
 {$I _crw_uses_first.inc} // NB: MUST BE FIRST USES !!!
 //////////////////////////////////////////////////////
 Classes, SysUtils, StrUtils, Math, Forms, Controls, Graphics, Dialogs,
 ExtCtrls, StdCtrls, ComCtrls, Buttons, lcltype,
 _crw_alloc, _crw_cmdargs, _crw_environ, _crw_eldraw, _crw_str,
 _crw_proc, _crw_appforms, _crw_apptools, Form_UartTerminal;

type

  { TFormUartTerminalGui }

  TFormUartTerminalGui = class(TMasterForm)
    procedure FormCreate(Sender: TObject);
  private
  public
   procedure OnIdle(Sender:TObject; var Done:Boolean);
  end;

var
  FormUartTerminalGui: TFormUartTerminalGui;

implementation

{$R *.lfm}

{ TFormUartTerminalGui }

procedure TFormUartTerminalGui.FormCreate(Sender: TObject);
begin
 SetStandardFont(Self);
 Application.OnIdle:=OnIdle;
 UartTerminalSysClose:=true;
 Language:=GetOptLanguage(GetDefLanguage);
end;

const
 UartDone:Boolean=false;

procedure TFormUartTerminalGui.OnIdle(Sender:TObject; var Done:Boolean);
begin
 Done:=true;
 if not UartDone then begin
  UartDone:=true;
  Visible:=False;
  ExecuteUartTerminal(poScreenCenter);
  Application.Terminate;
 end;
end;

initialization

 UseRunCommandEx(True);

end.

