35 lines
853 B
C
35 lines
853 B
C
#ifndef MYWIN_USER_STAT_H__
|
||
#define MYWIN_USER_STAT_H__
|
||
|
||
#include "mywin_inc.h"
|
||
|
||
// 定义字符最大长度
|
||
#define STAT_TXT_MAXLEN 20
|
||
|
||
typedef struct {
|
||
WIN_WindowStruct win;
|
||
int timerId;
|
||
void (*TimerCallBack)(void *);
|
||
uint8_t *img;
|
||
char txt[STAT_TXT_MAXLEN];
|
||
} WIN_StatStruct;
|
||
|
||
WIN_StatStruct *WIN_CreatStat(WIN_WindowStruct *base,
|
||
void (*msgLoop)(struct _WIN_WindowStruct *win,
|
||
WIN_MsgStruct *msg),
|
||
int x, int y, int x_size, int y_size);
|
||
|
||
// 设置显示文字,成功返回1
|
||
int STAT_SetTxt(WIN_StatStruct *stat, char *txt);
|
||
|
||
// 设置图标
|
||
int STAT_SetImg(WIN_StatStruct *stat, uint8_t *img);
|
||
|
||
// 默认绘制函数
|
||
void STAT_DefaultPaint(WIN_StatStruct *stat);
|
||
|
||
// 默认消息处理函数
|
||
void STAT_DefaultMsgLoop(WIN_StatStruct *stat, WIN_MsgStruct *msg);
|
||
|
||
#endif
|