/*
  ICS HTTP authentication login form - C++Builder translation of the Delphi demo unit
  OverbyteIcsLogin.pas (demos-delphi-vcl), ICS V9.8. Shared by several demos.

  The caller fills ListMethods with the authentication methods the server offered,
  shows the form modally and reads AuthUsername, AuthPassword and ListMethods->ItemIndex.
*/

#include <vcl.h>
#pragma hdrstop

#include "OverbyteIcsLogin.h"

#pragma package(smart_init)
#pragma resource "*.dfm"

TFormLogin *FormLogin;

__fastcall TFormLogin::TFormLogin(TComponent *Owner)
    : TForm(Owner)
{
}

// OK only closes the form once both a user name and a password are entered.
void __fastcall TFormLogin::doOKClick(TObject *Sender)
{
    if (AuthUsername->Text.IsEmpty() || AuthPassword->Text.IsEmpty()) {
        System::Sysutils::Beep();
        return;
    }
    ModalResult = mrOk;
}
