64 lines
1.5 KiB
C
64 lines
1.5 KiB
C
#ifndef MYWIN_PAGE_H__
|
||
#define MYWIN_PAGE_H__
|
||
|
||
// 页面,继承自MYWIN框架
|
||
|
||
// 条目属性结构体
|
||
typedef struct {
|
||
u8 *image;
|
||
char *str;
|
||
void (*fun)(void *);
|
||
} PAGE_ItemStruct;
|
||
|
||
typedef struct {
|
||
WIN_WindowStruct win;
|
||
int index;
|
||
int touchIn; // 点击事件
|
||
char *title;
|
||
int titleHeight;
|
||
PAGE_ItemStruct **item;
|
||
int itemHeight;
|
||
int itemIndent; // 条目缩进
|
||
int itemNum;
|
||
char *key;
|
||
WIN_PicStruct pic;
|
||
} WIN_PageStruct;
|
||
|
||
WIN_PageStruct *WIN_CreatPage(WIN_WindowStruct *base,
|
||
void (*msgLoop)(struct _WIN_WindowStruct *win,
|
||
WIN_MsgStruct *msg),
|
||
int x, int y, int x_size, int y_size);
|
||
|
||
// 销毁页面
|
||
void WIN_DeletePage(WIN_PageStruct *page);
|
||
|
||
// 设置页面的背景图片,参数为0,不使用背景图片
|
||
void PAGE_SetBackPic(WIN_PageStruct *page, WIN_PicStruct *pic);
|
||
|
||
// 设置列表框显示的条目
|
||
void PAGE_SetItem(WIN_PageStruct *page, const PAGE_ItemStruct *item,
|
||
int itemNum);
|
||
|
||
// 设置标题高度
|
||
void PAGE_SetTitleHeight(WIN_PageStruct *page, int height);
|
||
|
||
// 设置条目高度
|
||
void PAGE_SetItemHeight(WIN_PageStruct *page, int height);
|
||
|
||
// 设置条目缩进
|
||
void PAGE_SetItemIndent(WIN_PageStruct *page, int indent);
|
||
|
||
// 索引增加
|
||
void PAGE_IndexAdd(WIN_PageStruct *page);
|
||
|
||
// 索引减少
|
||
void PAGE_IndexSub(WIN_PageStruct *page);
|
||
|
||
// 默认绘制函数
|
||
void PAGE_DefaultPaint(WIN_PageStruct *page);
|
||
|
||
// 默认消息处理函数
|
||
void PAGE_DefaultMsgLoop(WIN_PageStruct *page, WIN_MsgStruct *msg);
|
||
|
||
#endif
|