//---------------------------------------------------------------------------

#ifndef uMainH
#define uMainH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <Grids.hpp>
#include "PBEdit.hpp"
//---------------------------------------------------------------------------
struct KEYDEF
{
	char cNormal;
	char cShifted;
	int cWidth;
};
//---------------------------------------------------------------------------
class TfrmVKey : public TForm
{
__published:	// IDE-managed Components
   TPanel *pnlTop;
   TPBEdit *edtKeyVal;
   void __fastcall FormCreate(TObject *Sender);
   void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
   void __fastcall FormPaint(TObject *Sender);
   void __fastcall FormResize(TObject *Sender);
   void __fastcall FormMouseDown(TObject *Sender, TMouseButton Button,
          TShiftState Shift, int X, int Y);
   void __fastcall FormMouseMove(TObject *Sender, TShiftState Shift, int X,
          int Y);
private:	// User declarations
   HWND gFocus;
   int nCurKeyState;
   int pKeyWidth;
   int pKeyHeight;
   TList *kList;
   void __fastcall AddKey(char pNormal, char pShifted, int pWidth);
   void __fastcall CalcWidthHeight();
   void __fastcall DrawKey(TCanvas *dc, TRect &rc, KEYDEF *key, bool bHilight = false);
   void __fastcall DrawKeyboard();
   int  __fastcall DescribeKeyState();
   void __fastcall SendKey(KEYDEF *keydef);
   void __fastcall ReleaseFocus();
   void __fastcall DrawMouseOver(TCanvas *dc, TRect &rc, KEYDEF *key, bool bIsOver);

public:		// User declarations
   __fastcall TfrmVKey(TComponent* Owner);
   __fastcall TfrmVKey(HWND hWnd);
};
//---------------------------------------------------------------------------
extern PACKAGE TfrmVKey *frmVKey;
//---------------------------------------------------------------------------
#endif
