#ifndef FNETWORKREGMANUAL_H_
#define FNETWORKREGMANUAL_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 TfNetworkRegManual{
	public:
		TCtlPanel1 *aPanel;
	public:
		TStaticText Caption;
		TStaticText SText;
		u32 Color;
	
		int TabOrder;
	
		TPoint OwnerLeftTop; //ParrentLeftTop;
		TRect Bound;	
		TRect Content;
		TMyString Str;
		
		int IsShowing;
		unsigned char IsViewList;
		unsigned char CtlIndex;
	
		unsigned char Count;
		unsigned char PageIndex;
		unsigned char PageCount;
		unsigned char Done;
	
		char dText[64];
		unsigned char Data[12];
		unsigned char RecData[12];
		unsigned char pNumList[24];
		
		int Sta;
		
		unsigned char aMasterNum;
		unsigned char aSlaveCount;
		unsigned char aNumList[16];
		

	public:
		TfNetworkRegManual(){};
		TfNetworkRegManual(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 ClearOutText();
		void JustShowSlaveListNum();
		void ShowTip();
		void ShowActionResult();
		void ShowActionResult(int aSta);

		void Show(void);
		void ShowCaption();
		void ReDraw(void);
		void FullRedraw(int Prm);
		void DrawCaption2(void);
		void DrawList();
		void SetPanelCaptionColor();
		void ClearData();
		void LoadData();
		void TryAddRemoveSlave(int IsAdd);
		void TryAddRemoveMaster(int IsAdd);
		
		TGuiMsgReturn KeyIn(unsigned char aKey);
		
		void InitPanel4Master(void);
		void InitPanel4Slave(void);
		void InitPanel4None();
		void InitPanel(void);
		void Check4Selected(void);
		void Check4Selected4Slave();
		
		void Task1000Ms();
		
		void SendNwList();
		void SendfNetMsg(int Len);
		void PushfNetMsg(unsigned char aCubCmd, unsigned char *data, int Len);
		
		int ExtRequst(unsigned char Prm);

};



#endif

