unit frmLogin;

{$mode ObjFPC}{$H+}

interface

uses
  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, orca_scene2d;

type

  { TFormLogin }

  TFormLogin = class(TForm)
    btnOK: TD2CornerButton;
    btnCancel: TD2CornerButton;
    Label1: TD2Label;
    Label2: TD2Label;
    Layout1: TD2Layout;
    Layout2: TD2Layout;
    Layout4: TD2Layout;
    Root: TD2Background;
    Scene: TD2Scene;
    edtAccount: TD2TextBox;
    edtPassword: TD2TextBox;
    procedure btnOKClick(Sender: TObject);
    procedure edtAccountChange(Sender: TObject);
  private
    FUserAccount: string;
    FUserPassword: string;

  public
  published
    property UserAccount: string read FUserAccount write FUserAccount;
    property UserPassword: string read FUserPassword write FUserPassword;
  end;

var
  FormLogin: TFormLogin;

implementation

{$R *.lfm}

{ TFormLogin }

procedure TFormLogin.edtAccountChange(Sender: TObject);
var
  acc: string;
  pwd: string;
begin
  acc := edtAccount.Text;
  pwd := edtPassword.Text;
  btnOK.Enabled:= (acc <> '') and (pwd <> '');
end;

procedure TFormLogin.btnOKClick(Sender: TObject);
begin
  FUserAccount:= edtAccount.Text;
  FUserPassword:= edtPassword.Text;
end;

end.

