📄 gui_main.c
字号:
/******************
* mp3_main.c
*****************/
#include <string.h>
#include "api.h"
#include "lcd.h"
#include "common.h"
#include "ap_common.h"
#include "display.h"
#include "prefer.h"
#include "ui_main.h"
#include "res_show.h"
#include "res.h"
#include "global_user.h"
INT16U active=0;
INT16U code main_menu_fm[9] ={MUSIC1,MOVIE1,RECOR1,VOICE1,RADIO1, PIC1, EBOOK1,MGAME1,MSET1};
INT16U code main_menu_topfm1[9] ={ZEMUSI,ZEMOVI,ZERECO,ZEVOIC,ZERADI, ZEPIC, ZEBOOK,ZEGAME,ZESET}; //英文
INT16U code main_menu_topfm2[9] ={ZFMUSI,ZFMOVI,ZFRECO,ZFVOIC,ZFRADI, ZFPIC, ZFBOOK,ZFGAME,ZFSET}; //繁体中文
INT16U code main_menu_topfm3[9] ={ZCMUSI,ZCMOVI,ZCRECO,ZCVOIC,ZCRADI, ZCPIC, ZCBOOK,ZCGAME,ZCSET}; //简体中文
#define MAINMENU_SELECT_MAX 9 //with FM
void screen_mainmenu_init(void)
{
select = menu_id;
screen_level = SCREEN_LEVEL_MAINMENU;
bResShowPic(main_menu_fm[active],0,0);
if(tUserPreference.u8LanguageId==1)
bResShowPic(main_menu_topfm2[active],0,131);
else if(tUserPreference.u8LanguageId==2)
bResShowPic(main_menu_topfm3[active],0,131);
else
bResShowPic(main_menu_topfm1[active],0,131);
}
void enter_lowlevel()
{
#if 0
#ifdef dynamic_load
select+=0x91;
api_bLoad(active,1); //system setting
#else
Print("Load Function\n");
#endif
#endif
tUserPreference.u8MenuId = menu_id = active;
api_bSavePreferenceData(&tUserPreference,sizeof(USER_PREFERENCE_T));
switch(active)
{
case 0:
#ifdef dynamic_load
//select+=0x91;
api_vLoad(Code_USER2,0); //mp3 player
//api_vLOAD(Code_USER9);
#else
Print("Load Function\n");
#endif
break;
case 1:
#ifdef dynamic_load
//select+=0x91;
api_vLoad(Code_USER3,0); //movie player
#else
Print("Load Function\n");
#endif
break;
case 2:
#ifdef dynamic_load
//select+=0x91;
api_vLoad(Code_USER4,0); //record player
#else
Print("Load Function\n");
#endif
break;
case 3:
#ifdef dynamic_load
//select+=0x91;
api_vLoad(Code_USER5,0); //voice player
#else
Print("Load Function\n");
#endif
break;
case 4:
#ifdef dynamic_load
//select+=0x91;
api_vLoad(Code_USER6,1); //Fm player
#else
Print("Load Function\n");
#endif
break;
case 5:
#ifdef dynamic_load
//select+=0x91;
api_vLoad(Code_USER8,0); //picture player
#else
Print("Load Function\n");
#endif
break;
case 6:
#ifdef dynamic_load
//select+=0x91;
api_vLoad(Code_USER7,0); //e book
#else
Print("Load Function\n");
#endif
break;
case 7:
#ifdef dynamic_load
//select+=0x91;
api_vLoad(Code_USER9,0); //game setting
#else
Print("Load Function\n");
#endif
break;
case 8:
#ifdef dynamic_load
//select+=0x91;
api_vLoad(Code_USER10,0); //system setting
#else
Print("Load Function\n");
#endif
break;
}
//#endif
}
void screen_mainmenu(UINT8 key)
{
if(key_menu_long == 1)
{
key_menu_long = 0;
return;
}
switch(key)
{
case KEY_MENU:
menu_id = 100;
enter_lowlevel();
//return;
case KEY_NEXT:
if(++active >= MAINMENU_SELECT_MAX)
active = 0;
break;
case KEY_PREV:
if((INT8)--active < 0)
active = MAINMENU_SELECT_MAX - 1;
break;
default:
return;
}
bResShowPic(main_menu_fm[active],0,0);
if(tUserPreference.u8LanguageId==1)
bResShowPic(main_menu_topfm2[active],0,131);
else if(tUserPreference.u8LanguageId==2)
bResShowPic(main_menu_topfm3[active],0,131);
else
bResShowPic(main_menu_topfm1[active],0,131);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -