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

#ifndef MainCppH
#define MainCppH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <ExtCtrls.hpp>
#include <jpeg.hpp>
#include <Menus.hpp>
#include <ToolWin.hpp>
#include <Dialogs.hpp>
#include <ImgList.hpp>
#include <Printers.hpp>
#include <IniFiles.hpp>
#include <OleServer.hpp>
#include <utilcls.h>
#define PG OlePropertyGet 
#define PS OlePropertySet 
#define FN OleFunction 
#define PR OleProcedure 
//---------------------------------------------------------------------------
class TMainForm : public TForm
{
__published:	// IDE-managed Components
        TToolBar *ToolBar1;
        TStatusBar *StatusBar1;
        TScrollBox *ScrollBox1;
        TImage *Image1;
        TEdit *Edit1;
        TEdit *Edit2;
        TEdit *Edit3;
        TEdit *Edit4;
        TEdit *Edit5;
        TEdit *Edit6;
        TEdit *Edit7;
        TEdit *Edit8;
        TEdit *Edit9;
        TEdit *Edit10;
        TEdit *Edit11;
        TEdit *Edit12;
        TEdit *Edit13;
        TEdit *Edit14;
        TEdit *Edit15;
        TEdit *Edit16;
        TEdit *Edit17;
        TEdit *Edit18;
        TEdit *Edit19;
        TEdit *Edit20;
        TEdit *Edit21;
        TEdit *Edit22;
        TEdit *Edit23;
        TEdit *Edit24;
        TEdit *Edit25;
        TEdit *Edit26;
        TEdit *Edit27;
        TEdit *Edit28;
        TEdit *Edit29;
        TEdit *Edit30;
        TEdit *Edit31;
        TEdit *Edit32;
        TEdit *Edit33;
        TEdit *Edit34;
        TEdit *Edit35;
        TEdit *Edit36;
        TEdit *Edit37;
        TEdit *Edit38;
        TEdit *Edit39;
        TEdit *Edit40;
        TEdit *Edit41;
        TEdit *Edit42;
        TEdit *Edit43;
        TEdit *Edit44;
        TEdit *Edit45;
        TEdit *Edit46;
        TEdit *Edit47;
        TEdit *Edit48;
        TEdit *Edit49;
        TEdit *Edit50;
        TEdit *Edit51;
        TEdit *Edit52;
        TEdit *Edit53;
        TEdit *Edit54;
        TEdit *Edit55;
        TButton *Button1;
        TButton *Button2;
        TButton *Button3;
        TEdit *Edit56;
        TEdit *Edit57;
        TEdit *Edit58;
        void __fastcall Edit28Click(TObject *Sender);
        void __fastcall Edit23KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit24KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit25KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit26KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit27KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit29KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit30KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit31KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit32KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit20KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit22KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit18KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit19KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit9KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit4Click(TObject *Sender);
        void __fastcall Edit34Click(TObject *Sender);
        void __fastcall Button1Click(TObject *Sender);
        void __fastcall Button3Click(TObject *Sender);
        void __fastcall Button2Click(TObject *Sender);
        void __fastcall Edit56KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit57KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit58KeyPress(TObject *Sender, char &Key);
        void __fastcall Edit6Click(TObject *Sender);
private:	// User declarations
public:		// User declarations
        __fastcall TMainForm(TComponent* Owner);
        char CheckChar(char Key);
        int length,zheng,yu,sum,FontSize,nRow,nCol;
        int Edit[57][2];
        AnsiString Edits,Year,Month,Day;
        double xdpi,ydpi,xDouble,yDouble,ldpi,tdpi;
        char *ADevice, *ADriver, *APort;
        THandle DeviceMode;
        PDeviceMode DevMode;
        int Pagelength,Pagewidth;
        TPrinter *Prntr;


};
//---------------------------------------------------------------------------
extern PACKAGE TMainForm *MainForm;
//---------------------------------------------------------------------------
#endif
