|
发表于 2007-7-11 14:55:29
|
显示全部楼层
不太明白, 可能的另一种方法, 举个例子:
void EntryMusicLightMode(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 *guiBuffer;
U8 *inputBuffer;
U16 n_items = 0;
U16 i;
U8 *PopUpList[MAX_SUB_MENUS];
U16 nStrItemList[] = {
STR_ID_PHNSET_MUSIC_LIGHT_SETTING_INCOMING_CALL,
STR_ID_PHNSET_MUSIC_LIGHT_SETTING_MESSAGE,
STR_ID_PHNSET_MUSIC_LIGHT_SETTING_POWERON_TONE,
STR_ID_PHNSET_MUSIC_LIGHT_SETTING_POWEROFF_TONE,
STR_ID_PHNSET_MUSIC_LIGHT_SETTING_AUDIO_PLAY,
STR_ID_PHNSET_MUSIC_LIGHT_SETTING_ALARM
};
n_items = 6;
EntryNewScreen(SCR_SETTING_MUSIC_LIGHT_MODE, ExitMusicLightMode, EntryMusicLightMode, NULL);
RegisterHighlightHandler(HighlightMusicLightModeIndex);
/* Display Category1 Screen */
ShowCategory52Screen(
STR_ID_PHNSET_MUSIC_LIGHT_SETTING_MODE,
GetRootTitleIcon(MENU_ID_PHNSET_MUSIC_LIGHT_SETTING) ,
STR_GLOBAL_OK,
IMG_GLOBAL_OK,
STR_GLOBAL_BACK,
IMG_GLOBAL_BACK,
n_items,
nStrItemList,
(PU16) gIndexIconsImageList,
NULL,//PopUpList,
0,
0,
guiBuffer);
/* Register function with right softkey */
SetLeftSoftkeyFunction(EntryModeSelectScreen, KEY_EVENT_UP);
SetKeyHandler(EntryModeSelectScreen, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
}
HighlightMusicLightModeIndex用来确定你选择的是哪个index, 然后使用EntryModeSelectScreen来处理这个index, 这样可以不使用ADD_APPLICATION_MENUITEM |
|