|
发表于 2013-3-21 08:23:22
|
显示全部楼层
和我写的一个GUI有些像,给你参考一下- struct PAGE
- {
- const struct PAGE *pParent;
- void (*Function)(u8 key);
- const struct Item *pItem;
- const u8 ItemNum;
- };
- struct Item
- {
- const u8 TypeAndIndex;
- const u8 *pText;
- const struct PAGE *pChildrenPage;
- };
- /******************************************************************************************************/
- //主菜单
- //定义Item项 //显示方式&序号 项目的名字 项目指向的页(Page)
- const struct Item main_item[]={ 0x00, "信息", &SMS_Page,
- 0x01, "设置", &Setting_Page,
- 0x02, "版本", &Version_Page,
- 0x03, "时间", &Time_Page,
- 0x04, "状态", 0,
- 0x05, "报警", 0,
- 0x06, "飞信", 0,
- 0x07, "问答", 0
- };
- //定义一个Page 父页 该页的回调函数 该页的项 项的个数
- const struct PAGE mainPage={0,mainPageCallBack,main_item,sizeof(main_item)/sizeof(struct Item)};
- /*********************************************************************************************************/
- const struct PAGE Version_Page={&mainPage,Version_CallBack,0,0};
- /***************************************************************************************************************/
- //定义Item项 //显示方式&序号 项目的名字 项目指向的页(Page)
- const struct Item Setting_item[]={ 0x10, " 00.设0", 0,
- 0x11, " 01.设1", 0,
- 0x12, " 02.设2", 0,
- 0x13, " 03.设3", 0,
- 0x14, " 04.设4", 0,
- 0x15, " 05.设5", 0,
- 0x16, " 06.设6 你好", 0,
- 0x17, " 07.设7", 0,
- 0x18, " 08.设8", 0,
- 0x19, " 09.设9", 0,
- 0x1A, " 10.设10", 0
- };
- const struct PAGE Setting_Page={&mainPage,Setting_CallBack,Setting_item,sizeof(Setting_item)/sizeof(struct Item)};
- /***************************************************************************************************************/
- const struct PAGE Time_Page={&mainPage,Time_CallBack,0,0};
- /***************************************************************************************************************/
- //定义Item项 //显示方式&序号 项目的名字 项目指向的页(Page)
- const struct Item SMS_item[]={
- 0x10, " 00.", &SMS_Text_Page,
- 0x11, " 01.", &SMS_Text_Page,
- 0x12, " 02.", &SMS_Text_Page,
- 0x13, " 03.", &SMS_Text_Page,
- 0x14, " 04.", &SMS_Text_Page,
- 0x15, " 05.", &SMS_Text_Page,
- 0x16, " 06.", &SMS_Text_Page,
- 0x17, " 07.", &SMS_Text_Page,
- 0x18, " 08.", &SMS_Text_Page,
- 0x19, " 09.", &SMS_Text_Page,
- 0x1A, " 10.", &SMS_Text_Page
- };
- const struct PAGE SMS_Page={&mainPage,SMS_CallBack,SMS_item,sizeof(Setting_item)/sizeof(struct Item)};
复制代码 这是7Z格式的,把.zip去掉就可以正常解压了 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|