#ifndef _PREFERENCES_H_
#define _PREFERENCES_H_

//extremely useful in debugging

#define printf_s(...) {															\
						char x[64];												\
						RectangleType rc,clean;									\
						RctSetRectangle(&rc,0,0,160,160);						\
						WinScrollRectangle(&rc,winUp,FntLineHeight(),&clean);	\
						WinEraseRectangle(&clean,0);							\
						StrPrintF(x,__VA_ARGS__);								\
						WinDrawChars(x,StrLen(x),0,160-FntLineHeight()); 		\
						SysTaskDelay(50);										\
					}


#define printf(...) {															\
						char x[64];												\
						StrPrintF(x,__VA_ARGS__);								\
						FrmCustomAlert(10024,x,NULL,NULL);						\
					}



#define WinSetForeColorRgb(rv,gv,bv) do{tmp.r=rv;tmp.g=gv;tmp.b=bv;WinSetForeColorRGB(&tmp,&ofc);}while(0)
#define WinSetBackColorRgb(rv,gv,bv) do{tmp.r=rv;tmp.g=gv;tmp.b=bv;WinSetBackColorRGB(&tmp,&obc);}while(0)
#define WinSetTextColorRgb(rv,gv,bv) do{tmp.r=rv;tmp.g=gv;tmp.b=bv;WinSetTextColorRGB(&tmp,&otc);}while(0)

#define LINE_HEIGHT					13
#define TOP_MARGIN					16
#define LEFT_MARGIN					1


#define CONST_NUM_ROWS				0
#define CONST_NUM_COLS				1
#define CONST_FORM_WIDTH			2
#define CONST_FORM_HEIGHT			3
#define CONST_COL_WIDTH				4

#define SCREEN_RESIZED_EVENT		0x7F00
#define SCREEN_AUTOSCROLLED_EVENT	0x7F01

typedef struct{
	
	UInt32 topRow;
	UInt32 curCat;
	UInt32 curItem;
	
}ViewState;




#endif //_PREFERENCES_H_