📄 menu_rc.c
字号:
// 菜单模板 (即菜单构造数据)
#include "config.h"
/* 菜单项功能函数声明 */
extern void FUN11_Find(void);
extern void FUN12_Edit(void);
extern void FUN21_Rcv(void);
extern void FUN22_Send(void);
extern void FUN23_Bad(void);
extern void FUN32_Disp(void);
extern void FUN41_Vk100(void);
extern void FUN311_Chgt(void);
extern void FUN312_T12(void);
extern void FUN313_T24(void);
/* 菜单显示坐标值(不管是哪一级的菜单,其显示位置是固定的) */
#define ICO1_X 170
#define ICO1_Y 10
#define ICO2_X 170
#define ICO2_Y 75
#define ICO3_X 170
#define ICO3_Y 140
#define ICO4_X 170
#define ICO4_Y 205
/* 第一级菜单定义 */
extern uint8 ico_telno[];
extern uint8 f_telno[];
const MENUICO mico1_1 =
{ ICO1_X, // x
ICO1_Y, // y
ico_telno, // icodat
f_telno, // title
0, // state
NULL // Function (有子菜单,设置为NULL)
};
extern uint8 ico_sx[];
extern uint8 f_sx[];
const MENUICO mico1_2 =
{ ICO2_X, // x
ICO2_Y, // y
ico_sx, // icodat
f_sx, // title
0, // state
NULL // Function
};
extern uint8 ico_set[];
extern uint8 f_set[];
const MENUICO mico1_3 =
{ ICO3_X, // x
ICO3_Y, // y
ico_set, // icodat
f_set, // title
0, // state
NULL // Function
};
extern uint8 ico_wjj[];
extern uint8 f_wjj[];
const MENUICO mico1_4 =
{ ICO4_X, // x
ICO4_Y, // y
ico_wjj, // icodat
f_wjj, // title
0, // state
NULL // Function
};
const MY_MENU TELNO_MENU[]; // 声明各子菜单
const MY_MENU SX_MENU[];
const MY_MENU SET_MENU[];
const MY_MENU WJJ_MENU[];
const MY_MENU MAIN_MENU[5] =
{ {(MENUICO *)&mico1_1, 0, (MY_MENU *)TELNO_MENU }, // "电话本"->TELNO_MENU
{(MENUICO *)&mico1_2, 1, (MY_MENU *)SX_MENU }, // "信息"->SX_MENU
{(MENUICO *)&mico1_3, 2, (MY_MENU *)SET_MENU }, // "设置"->SET_MENU
{(MENUICO *)&mico1_4, 3, (MY_MENU *)WJJ_MENU }, // "文件夹"->WJJ_MENU
{NULL, RET_UPMENU, NULL } // 结束标志
};
// 代码先判断MY_MENU.ret_no是否为RET_UPMENU或RET_MAINMENU,若是则直接返回上层或主菜单。
// 然后判断MY_MENU.next_menu是否为NULL,若不是则进入下一级目录;若是则判断MY_MENU.mdata->Function是否
// 为NULL,若不是则执行此函数(执行完后重绘菜单),否则不作任何反应。
/* 第二级菜单定义(TELNO_MENU) */
extern uint8 ico_find[];
extern uint8 f_find[];
const MENUICO mico2_11 =
{ ICO1_X, // x
ICO1_Y, // y
ico_find, // icodat
f_find, // title
0, // state
FUN11_Find // Function
};
extern uint8 ico_edit[];
extern uint8 f_edit[];
const MENUICO mico2_12 =
{ ICO2_X, // x
ICO2_Y, // y
ico_edit, // icodat
f_edit, // title
0, // state
FUN12_Edit // Function
};
extern uint8 ico_ret[];
extern uint8 f_ret[];
const MENUICO mico2_13 =
{ ICO3_X, // x
ICO3_Y, // y
ico_ret, // icodat
f_ret, // title
0, // state
NULL // Function
};
const MY_MENU TELNO_MENU[4] =
{ {(MENUICO *)&mico2_11, 0, NULL }, // "电话本"->"查找"
{(MENUICO *)&mico2_12, 1, NULL }, // "电话本"->"编辑"
{(MENUICO *)&mico2_13, RET_UPMENU, NULL }, // "电话本"->"返回"
{NULL, RET_UPMENU, NULL }
};
/* 第二级菜单定义(SX_MENU) */
extern uint8 ico_rcv[];
extern uint8 f_rcv[];
const MENUICO mico2_21 =
{ ICO1_X, // x
ICO1_Y, // y
ico_rcv, // icodat
f_rcv, // title
0, // state
FUN21_Rcv // Function
};
extern uint8 ico_send[];
extern uint8 f_send[];
const MENUICO mico2_22 =
{ ICO2_X, // x
ICO2_Y, // y
ico_send, // icodat
f_send, // title
0, // state
FUN22_Send // Function
};
extern uint8 ico_bad[];
extern uint8 f_bad[];
const MENUICO mico2_23 =
{ ICO3_X, // x
ICO3_Y, // y
ico_bad, // icodat
f_bad, // title
0, // state
FUN23_Bad // Function
};
const MENUICO mico2_24 =
{ ICO4_X, // x
ICO4_Y, // y
ico_ret, // icodat
f_ret, // title
0, // state
NULL // Function
};
const MY_MENU SX_MENU[5] =
{ {(MENUICO *)&mico2_21, 0, NULL }, // "信息"->"收件箱"
{(MENUICO *)&mico2_22, 1, NULL }, // "信息"->"发件箱"
{(MENUICO *)&mico2_23, 2, NULL }, // "信息"->"废件箱"
{(MENUICO *)&mico2_24, RET_UPMENU, NULL }, // "信息"->"返回"
{NULL, RET_UPMENU, NULL }
};
/* 第二级菜单定义(SET_MENU) */
extern uint8 ico_clk[];
extern uint8 f_clk[];
const MENUICO mico2_31 =
{ ICO1_X, // x
ICO1_Y, // y
ico_clk, // icodat
f_clk, // title
0, // state
NULL // Function
};
extern uint8 ico_disp[];
extern uint8 f_disp[];
const MENUICO mico2_32 =
{ ICO2_X, // x
ICO2_Y, // y
ico_disp, // icodat
f_disp, // title
0, // state
FUN32_Disp // Function
};
#define mico2_33 mico2_13
const MY_MENU SETCLK_MENU[];
const MY_MENU SET_MENU[4] =
{ {(MENUICO *)&mico2_31, 0, (MY_MENU *)SETCLK_MENU }, // "设置"->"时钟"->SETCLK_MENU
{(MENUICO *)&mico2_32, 1, NULL }, // "设置"->"显示"
{(MENUICO *)&mico2_33, RET_UPMENU, NULL }, // "设置"->"返回"
{NULL, RET_UPMENU, NULL }
};
/* 第二级菜单定义(WJJ_MENU) */
extern uint8 ico_vk100[];
extern uint8 f_vk100[];
const MENUICO mico2_41 =
{ ICO1_X, // x
ICO1_Y, // y
ico_vk100, // icodat
f_vk100, // title
0, // state
FUN41_Vk100 // Function
};
const MENUICO mico2_42 =
{ ICO2_X, // x
ICO2_Y, // y
ico_ret, // icodat
f_ret, // title
0, // state
NULL // Function
};
const MY_MENU WJJ_MENU[3] =
{ {(MENUICO *)&mico2_41, 0, NULL }, // "文件夹"->"VK100"
{(MENUICO *)&mico2_42, RET_UPMENU, NULL }, // "文件夹"->"返回"
{NULL, RET_UPMENU, NULL }
};
/* 第三级菜单定义(SETCLK_MENU) */
extern uint8 ico_chgt[];
extern uint8 f_chgt[];
const MENUICO mico3_311 =
{ ICO1_X, // x
ICO1_Y, // y
ico_chgt, // icodat
f_chgt, // title
0, // state
FUN311_Chgt // Function
};
extern uint8 ico_t12[];
extern uint8 f_t12[];
const MENUICO mico3_312 =
{ ICO2_X, // x
ICO2_Y, // y
ico_t12, // icodat
f_t12, // title
0, // state
FUN312_T12 // Function
};
extern uint8 ico_t24[];
extern uint8 f_t24[];
const MENUICO mico3_313 =
{ ICO3_X, // x
ICO3_Y, // y
ico_t24, // icodat
f_t24, // title
0, // state
FUN313_T24 // Function
};
#define mico3_314 mico2_24
const MY_MENU SETCLK_MENU[5] =
{ {(MENUICO *)&mico3_311, 0, NULL }, // "设置"->"时钟"->"校时"
{(MENUICO *)&mico3_312, 1, NULL }, // "设置"->"时钟"->"12时制"
{(MENUICO *)&mico3_313, 2, NULL }, // "设置"->"时钟"->"24时制"
{(MENUICO *)&mico3_314, RET_UPMENU, NULL }, // "设置"->"时钟"->"返回"
{NULL, RET_UPMENU, NULL }
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -