#ifndef LITELISTVIEWMASK_H_
#define LITELISTVIEWMASK_H_

#include "gType.h" 
#include "GraphBase.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "my_string.h"
#include "MainCtl.h"
#include "Device.h"
#include "EpDevice.h"

//For Device View or Edit
class TLiteListViewMask{
	public:
		struct{
			u32 Color;
			u32 RibbonColor;
		}VScrollBar;
		struct{
			int TopIndex;
			int SelectedCol;
			unsigned short RowCount;
			unsigned short ColTop[12];
			unsigned short ColBottom[12];
			unsigned short ColHeight;
			unsigned short ColWidth[12];
			unsigned short ColLeft[12];
			unsigned short ColRight[12];
			unsigned short FixColTop;
			unsigned short FixColBottom;
		}ListView;
	public:
		TStaticText Caption;
		int ActiveLineNum;
		int LineCount;
		int LineHeight;
		float ScrollVertical;
	
		u32 FixColColor;
		u32 FixColTextColor;
		u32 Color;
		u32 TextColor;
		u32 SelectedColor;
		u32 SelectedTextColor;
	
		int TabOrder;
	
		TPoint OwnerLeftTop; //ParrentLeftTop;
		TRect Bound;	
		TRect VScrollBarBox;
		TRect Content;
	
		int SelectedIndex;
		int EntryCount;
		
		struct{
			unsigned char Path0;
			unsigned char Path1;
			unsigned char iType0;
			unsigned char iType1;
			unsigned int Loaded;
		}Entry[10],EntryFound;
		
		TMyString Str;

	private:
		void SetListColWidth(int w0, int w1, int w2, int w3, int w4,int w5,int w6, int w7, int w8);
	
		TGuiMsgReturn QueryKeyIn(unsigned char aKey);
		TGuiMsgReturn EditKeyIn(unsigned char aKey);
		
	public:
		TLiteListViewMask(){};
		TLiteListViewMask(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);	
		unsigned int ItemGetIcon(unsigned int aIndex);
		
		void RenderBackGround(void);
		void RenderBackGround(unsigned int aClr);
		void DrawSelf(void);
		void DrawVertScrollBar(void);
		void DrawShortList(void);
		void DrawList(void);
		void Show(void);
		void ReDraw(void);
		void DrawCaption(void);
		void RenderContent(void);
		
		TGuiMsgReturn KeyIn(unsigned char aKey);
		
		void EntryClear();
		void EntryLoadForward(void);
		void EntryLoadBackward(void);
		void EntryTotalize(void);
		void EntryFindByIndex(unsigned int aIndex);
		void EntryLoad(void);
		
		void FullRePaint(void);
		void RePaint(void);
		void FullRedraw(int Prm);
		
		int ExtRequst(unsigned char Prm){return 0;}
};











#endif


