#ifndef UNREGISTER_H_
#define UNREGISTER_H_

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

class TUnRegister{
	public:
		TCtlPanel1 *aPanel;
	public:
		TStaticText Caption;
		TStaticText SText;
		u32 Color;
	
		int TabOrder;
	
		TPoint OwnerLeftTop; //ParrentLeftTop;
		TRect Bound;	
		TRect Content;
		TMyString Str;
		
		unsigned char CtlIndex;
		unsigned char ListIndex;
		unsigned char IsViewList;
		unsigned char EntryCount;
		unsigned char PageCount;
		unsigned char IsRemoveAll;
		unsigned char IsAskingRemoveWhat;
	
		unsigned char Data[8];
		unsigned char RecData[8];
	private:
		void SetListColWidth(int w0, int w1, int w2, int w3, int w4,int w5,int w6, int w7, int w8, int w9);
	public:
		TUnRegister(){};
		TUnRegister(int x1, int y1, int aW, int aH, int OwnerX, int OwnerY, u32 aColor){
			Init(x1, y1, aW, aH, OwnerX, OwnerY, aColor);
		}
		void Init(int x1, int y1, int aW, int aH, int OwnerX, int OwnerY, u32 aColor);
	
		void SetAndShowCaption(unsigned char aType);
		void RenderBackGround(void);
		void RenderBackGround(unsigned int aClr);
		void DrawSelf(void);
		void ShowList();
		void ShowType();
		void ClearClearAllText();
		void ShowClearAllText();
		void ClearOutText();
		void ShowInputErr();
		void ShowExResult(int What, int aRst);

		void Show(void);
		void ShowCaption();
		void ReDraw(void);
		void DrawCaption2(void);
		
		void TryIncValue();
		void TryDecValue();
		
		TGuiMsgReturn KeyIn(unsigned char aKey);
		
		void InitPanel(void);
		void InitPanel4All(void);
		void InitPanel4Part(void);
		void Check4Selected4Part(void);
		void LoadListStr();
		
		void SendCmdClearAll();
		
		void SendCmdClearOnePort(unsigned char aCc);
		void SendCmdClearMultAddr(unsigned char aCc, unsigned char sAddr, unsigned char eAddr, unsigned char aType);
		void SendCmdClearOneAddr(unsigned char aCc, unsigned char aAddr, unsigned char aType);
		void SendCmdClear();

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



#endif

