#ifndef DISPLAYPADCFG_H_
#define DISPLAYPADCFG_H_


#include "gType.h" 
#include "GraphBase.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "my_string.h"
#include "Device.h"
#include "EpDevice.h"
#include "StaticText.h"
#include "EditML.h"
#include "CtlPanel1.h"

class TDisplayPadCfg{
	public:
		TStaticText Caption;
	
		u32 Color;
	
		TRect Bound;	
		TRect Content;
		TRect RectPanel;
		class TCtlPanel1 *aPanel;
	
		unsigned char CtlIndex;
	
		struct{
			unsigned char CtlNum;
			unsigned char Path0;
			unsigned char BeginAddr;
			unsigned char EndAddr;
		}AddrAssign[3];
		struct{
			unsigned char P0;
			unsigned char P1;
			unsigned char P0Found;
			unsigned char P1Found;
			unsigned char Inx;
		}Loaded;
		
		union{
			unsigned char D8[256];
			unsigned int  D32[64];
		}ReadWriteData;
		
		int Sta;
	public:
		TDisplayPadCfg(){};
		void Init(int x1, int y1, int aW, int aH, int OwnerX, int OwnerY, u32 aColor);
		void RenderBackGround(void);

		void RenderBackGround(unsigned int aClr);
		void RenderContent(void);
		void DrawSelf(void);
		void DrawCaption(void);
		void Show();
		void FullRedraw(int Prm);
		void DelayMs(unsigned int aMs);
			
		void ShowSta();
		void ShowSta(int aSta);
			
		void DrawItem();
			
		void LoadData();
		void SaveData();
			
		void Check4Selected();

		void InitPanel();
		int FindNextPadViaCircuit();
		int FindPrvPadViaAddr();
		int FindNextPadViaAddr();
			
		TGuiMsgReturn KeyIn(unsigned char aKey);
		
		void Write2Flash();

		int ExtRequst(unsigned char Prm){return 0;}
};



































#endif
