CodePudding user response:
Struct MenuItem{
Short MenuCount;//the current total number of menu items
DisplayString u8 *;//the current project to display characters
Void * Subs () ();//select a menu functions performed after
Struct MenuItem * ChildrenMenus;//the current project sub-menu
Struct MenuItem * ParentMenus;//the father of the current project menu
}
Void the display (struct MenuItem * MenuPoint, short selectItem)//display function
{
int i;
int j;
Under-16 x=30;
Under-16 y=30;
For (I=0; I & lt; (selectItem - 1); I++)
{
LCD_ShowString (x, y, 200,16,16 MenuPoint [I] DisplayString);
Y +=30;
}
My own definition menu structure variables:
Struct MenuItem the MainMenu [3]={
{3, "characters", NULL, NULL, NULL},
{3, "set2", NULL, NULL, NULL},
{3, "set3", NULL, NULL, NULL}
};
Struct MenuItem Setmenu1 [2]={
{2, "timeset1", NULL, NULL, the MainMenu},
{2, "Voiceset1", NULL, NULL, the MainMenu}};
Struct MenuItem Setmenu2 [2]={
{2, "timeset2", NULL, NULL, the MainMenu},
{2, "Voiceset2", NULL, NULL, the MainMenu}};
Struct MenuItem Setmenu11 [2]={
{2, "timeset1.1", NULL, NULL, Setmenu1},
{2, "Voiceset1.1", NULL, NULL, Setmenu1}};
Struct MenuItem * MenuPoint=the MainMenu
Short selectItem;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Copyright statement: this article to CSDN blogger (XHY__handsome) of the original articles, follow by CC 4.0 - sa the copyright agreement, reproduced and this statement, please attach the original source link
The original link: https://blog.csdn.net/XHY__handsome/article/details/88563814