|
发表于 2011-8-28 09:03:07
|
显示全部楼层
TK手机平台添加资源和菜单的方式
一、 菜单的修改或增加:
以一个例子的方式介绍如何添加一个菜单,例子如下:
在主菜单的“设置”菜单下增加一个“我的设定”子菜单,“我的设定”下有两个子菜单:“我
的设定1”和“我的设定2”,打开这两个菜单,分别显示一幅动画。
步骤如下:
1.在..\plutommi\mmi\Setting\SettingInc目录下的SettingDefs.h文件中增加如下内容:
a. enum STR_SETTING_LIST的最后增加三个字符串ID的声明:
STR_MY_SETTING,
STR_MY_SETTING1,
STR_MY_SETTING2,
b. enum SCR_SETTING_LIST的最后增加三个Screen ID的声明:
SCR_MY_SETTING,
SCR_MY_SETTING1,
SCR_MY_SETTING2,
c. enum IMG_SETTING_LIST的最后增加一个Image ID的声明:
IMG_MY_SETTING,
d. 在..\plutommi\mmi\Inc目录下GlobalMenuItems.h文件中enum GLOBALMENUITEMSID
的最后增加三个菜单ID的声明:(有的是在本AP或模块的*Defs.h中声明)
MENU_MY_SETTING,
MENU_MY_SETTING1,
MENU_MY_SETTING2,
2.在..\plutommi\Customer\CustResource\PLUTO_MMI目录下的Ref_list.txt中添加三个字符串:
STR_MY_SETTING Undefined 10 My Setting My Setting 我的设定 我的设定
STR_MY_SETTING1 Undefined 10 My Setting1 My Setting1 我的设定1 我的设定1
STR_MY_SETTING2 Undefined 10 My Setting2 My Setting2 我的设定2 我的设定2
3. 在.. \plutommi\Customer\CustResource\PLUTO_MMI\Res_MMI目录下的Res_Setting.c增加如下
资源:
ADD_APPLICATION_MENUITEM((MENU_MY_SETTING,MAIN_MENU_SETTINGS_MENUID ,2,MENU_MY_SETTING1,MENU_MY_SETTING2,SHOW, MOVEABLEWITHINPARENT,
DISP_LIST,STR_MY_SETTING,0));
ADD_APPLICATION_MENUITEM((MENU_MY_SETTING1,MENU_MY_SETTING,0,SHOW,
MOVEABLEWITHINPARENT, DISP_LIST,STR_MY_SETTING1,0));
ADD_APPLICATION_MENUITEM((MENU_MY_SETTING2,MENU_MY_SETTING,0,SHOW,
MOVEABLEWITHINPARENT, DISP_LIST,STR_MY_SETTING2,0));
ADD_APPLICATION_IMAGE2(IMG_MY_SETTING,CUST_IMG_PATH"\\\\MainLCD\\\\SubMenu\\\Settings\\\\MY_SETTING.GIF","My Setting.");
ADD_APPLICATION_STRING2(STR_MY_SETTING,"My Setting","MySetting");
ADD_APPLICATION_STRING2(STR_MY_SETTING1,"My Setting1","My Setting1");
ADD_APPLICATION_STRING2(STR_MY_SETTING2,"My Setting2","My Setting2");
4. 在.. \plutommi\Customer\CustResource\PLUTO_MMI\Res_MMI目录下的Res_MainMenu.c中修改如下:
ADD_APPLICATION_MENUITEM((MAIN_MENU_SETTINGS_MENUID,IDLE_SCREEN_
MENU_ID, 5,
MENU9102_INITIAL_SETUP,
.
.
.
改为:
ADD_APPLICATION_MENUITEM((MAIN_MENU_SETTINGS_MENUID,IDLE_SCREEN_
MENU_ID,6,
MENU_MY_SETTING,
MENU9102_INITIAL_SETUP,
.
.
.
5.在..\plutommi\mmi\Setting\SettingInc\目录下的SettingProt.h中增加如下的函数声明:
void HighlightMySetting(void);
void HighlightMySetting1(void);
void HighlightMySetting2(void);
void EntryMySetting(void);
void EntryMySetting1(void);
void EntryMySetting2(void);
6.在..\plutommi\mmi\Setting\SettingSrc\目录下的SettingSrc.c中增加如下的函数定义:
void HighlightMySetting(void)
{
SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
SetRightSoftkeyFunction(GoBackHistory,KEY_EVENT_UP);
SetKeyHandler(EntryMySetting, KEY_RIGHT_ARROW,KEY_EVENT_DOWN);
SetLeftSoftkeyFunction(EntryMySetting,KEY_EVENT_UP);
}
void HighlightMySetting1(void)
{
SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
SetRightSoftkeyFunction(GoBackHistory,KEY_EVENT_UP);
SetKeyHandler(EntryMySetting1, KEY_RIGHT_ARROW,KEY_EVENT_DOWN);
SetLeftSoftkeyFunction(EntryMySetting1,KEY_EVENT_UP);
}
void HighlightMySetting2(void)
{
SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN); |
|