//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop

#include "barmati.h"
#include "claves.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
TForm4 *Form4;
//---------------------------------------------------------------------------
__fastcall TForm4::TForm4(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Edit1KeyPress(TObject *Sender, char &Key)
{
 	if (Key=='\r' && Edit1->Text == clave)
    	{
        ShowMessage("Clave correcta");
        if (acceso==2)
        	{
            Label2->Visible=true;
            Edit2->Visible=true;
            Edit2->SetFocus();
            }
        else
        	Form4->Visible=false;
        }
    else if (Key=='\r')
    	ShowMessage("Clave incorrecta");
}
//---------------------------------------------------------------------------
void __fastcall TForm4::Edit2KeyPress(TObject *Sender, char &Key)
{
	if (Key=='\r')
    	{
        clave = Edit2->Text;
        Edit2->Clear();
        Label2->Visible=false;
        Edit2->Visible=false;
        Form4->Visible=false;
        }
}
//---------------------------------------------------------------------------