80 lines
1.4 KiB
C
80 lines
1.4 KiB
C
#ifndef WIN_USER_CALENDAR_H__
|
|
#define WIN_USER_CALENDAR_H__
|
|
|
|
|
|
|
|
//定义最大字符长度
|
|
#define CALENDAR_TXT_MAXLEN 20
|
|
|
|
|
|
|
|
typedef struct
|
|
{
|
|
int x;
|
|
int y;
|
|
int x_size;
|
|
int y_size;
|
|
int select;
|
|
char txt[3];
|
|
}CALENDAR_BoxStruct;
|
|
|
|
|
|
|
|
typedef struct
|
|
{
|
|
WIN_TouchWinStruct win;
|
|
char title[CALENDAR_TXT_MAXLEN];
|
|
u8 *icon; //图标
|
|
int tip_y; //年月提示的纵向坐标
|
|
CALENDAR_BoxStruct box[7*7];
|
|
u32 txtColor;
|
|
u32 selectRectColor;
|
|
u32 backRectColor;
|
|
int margin; //边距
|
|
int year_const; //当前年
|
|
int month_const; //当前月
|
|
int year;
|
|
int month;
|
|
int day;
|
|
|
|
WIN_ButtonStruct *key_back;
|
|
WIN_ButtonStruct *key_sub;
|
|
WIN_ButtonStruct *key_add;
|
|
}WIN_CalendarStruct;
|
|
|
|
|
|
WIN_CalendarStruct *WIN_CreatCalendar (WIN_WindowStruct *base,
|
|
void (*msgLoop)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg),
|
|
int x,int y,int x_size,int y_size);
|
|
|
|
|
|
|
|
//设置标题
|
|
void CALENDAR_SetTitle (WIN_CalendarStruct *calendar,char *txt);
|
|
|
|
|
|
//索引增加
|
|
void CALENDAR_IndexAdd (WIN_CalendarStruct *calendar);
|
|
|
|
//索引减少
|
|
void CALENDAR_IndexSub (WIN_CalendarStruct *calendar);
|
|
|
|
//刷新
|
|
void CALENDAR_Refresh (WIN_CalendarStruct *calendar);
|
|
|
|
//默认绘制函数
|
|
void CALENDAR_DefaultPaint (WIN_CalendarStruct *calendar);
|
|
|
|
|
|
//默认消息处理函数
|
|
void CALENDAR_DefaultMsgLoop (WIN_CalendarStruct *calendar,WIN_MsgStruct *msg);
|
|
|
|
|
|
//查看日期
|
|
WIN_CalendarStruct *CALENDAR_SelectDate (WIN_WindowStruct *base);
|
|
|
|
|
|
#endif
|
|
|
|
|