|
添加资源的代码如下:
ADD_APPLICATION_MENUITEM2((MENU_ID_NFC_FUNCTION, MENU_SIM_OPTION_ID,
MENU_ID_NFC_TRANSPORT_CARD_APPLICATION,
MENU_ID_NFC_INTERG,
MENU_ID_NFC_WALLET,
MENU_ID_NFC_SETTING,
MENU_ITEM_END,
SHOW,
MOVEABLEWITHINPARENT |INSERTABLE,
DISP_LIST,
STR_NFC_FUNCTION, NULL));
ADD_APPLICATION_MENUITEM2((MENU_ID_NFC_TRANSPORT_CARD_APPLICATION, MENU_ID_NFC_FUNCTION,
MENU_ID_NFC_QUERY_BALANCE,
MENU_ID_NFC_QUERY_TRANSPORT_CARD_TRANSACTION_RECORD,
MENU_ID_NFC_RECHARGE_TRANSPORT_CARD,
MENU_ID_NFC_PROCESS_TRANSPORT_CARD_EXCEPTION,
MENU_ITEM_END,
SHOW,
MOVEABLEWITHINPARENT | INSERTABLE,
DISP_LIST,
STR_NFC_PUBLIC_TRANSPORT_CARD_APPLICATION, NULL));
ADD_APPLICATION_MENUITEM2((MENU_ID_NFC_INTERG, MENU_ID_NFC_FUNCTION,
MENU_ID_NFC_QUERY_INTERG,
MENU_ID_NFC_TRANSACTION_RECORD,
MENU_ID_NFC_INTERG_RECHARGE,
MENU_ITEM_END,
SHOW,
MOVEABLEWITHINPARENT | INSERTABLE,
DISP_LIST,
STR_NFC_INTERG, NULL));
ADD_APPLICATION_MENUITEM2((MENU_ID_NFC_WALLET, MENU_ID_NFC_FUNCTION,
MENU_ID_NFC_WALLET_QUERY_BALANCE,
MENU_ID_NFC_WALLET_TRANSACTION_RECORD,
MENU_ID_NFC_WALLET_RECHARGE,
MENU_ID_NFC_WALLET_PROCESS_RECHARGE_EXCEPTION,
MENU_ITEM_END,
SHOW,
MOVEABLEWITHINPARENT | INSERTABLE,
DISP_LIST,
STR_NFC_WALLET, NULL));
ADD_APPLICATION_MENUITEM2((MENU_ID_NFC_SETTING, MENU_ID_NFC_FUNCTION,
MENU_ID_NFC_APPLICATION_PRARMETER,
MENU_ID_NFC_START_APPLICATION,
MENU_ID_NFC_UPDATE_MENU,
MENU_ID_NFC_UPATE_PROGRAM,
MENU_ITEM_END,
SHOW,
MOVEABLEWITHINPARENT | INSERTABLE,
DISP_LIST,
STR_NFC_SETTING, NULL));
第一个是父菜单,已在模拟器上看到;后面四个是子菜单,未正常显示。
和父菜单相关的入口函数如下:
void mmi_nfc_entry_main_menu(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
U16 nNumofItem; /* Stores no of children in the submenu */
U16 nDispAttribute; /* Stores display attribue */
U8 *guiBuffer; /* Buffer holding history data */
U8 *ItemType[MAX_SUB_MENUS];
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
/* U32 maskingByte=-1;
U32 menuItemId=-1; */
/* 1 Call Exit Handler */
EntryNewScreen(SCR_NFC_MAIN_MENU, NULL, mmi_nfc_entry_main_menu, NULL);
/* 2 Get current screen to gui buffer for history purposes */
guiBuffer = GetCurrGuiBuffer(SCR_NFC_MAIN_MENU);
/* 3. Retrieve no of child of menu item to be displayed */
/* diamond, 2005/07/01 add _Ext to menu item functions */
nNumofItem = GetNumOfChild_Ext(SCR_NFC_MAIN_MENU);
/* 4. Get attribute of menu to be displayed */
nDispAttribute = GetDispAttributeOfItem(MENU_ID_NFC_FUNCTION);
/* 5. Retrieve string ids in sequence of given menu item to be displayed */
/* diamond, 2005/07/01 add _Ext to menu item functions */
GetSequenceStringIds_Ext(MENU_ID_NFC_FUNCTION, nStrItemList);
/* 6 Set current parent id */
SetParentHandler(MENU_ID_NFC_FUNCTION);
/* 7 Register highlight handler to be called in menu screen */
RegisterHighlightHandler(ExecuteCurrHiliteHandler);
/* 8 Construct the Hints List */
ConstructHintsList(MENU_ID_NFC_FUNCTION, ItemType);
ShowCategory52Screen(
STR_NFC_FUNCTION,
GetRootTitleIcon(MENU_ID_NFC_FUNCTION),
STR_GLOBAL_OK,
IMG_GLOBAL_OK,
STR_GLOBAL_BACK,
IMG_GLOBAL_BACK,
nNumofItem,
nStrItemList,
(PU16) gIndexIconsImageList,
ItemType,
0,
0,
guiBuffer);
/* 9.Register function with right softkey */
SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
}
void highlight_nfc_app(void)
{
ChangeLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
/* 2 Change right soft key icon and label */
ChangeRightSoftkey(STR_GLOBAL_BACK, IMG_GLOBAL_BACK);
SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
/* 3 Register function for left soft key */
SetLeftSoftkeyFunction(mmi_nfc_entry_main_menu, KEY_EVENT_UP);
SetKeyHandler(mmi_nfc_entry_main_menu, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
/* 4 Register function for right soft key */
SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
}
void mmi_nfc_init(void)
{
SetHiliteHandler(MENU_ID_NFC_FUNCTION, highlight_nfc_app);
}
基本是抄自源代码的,父菜单的右键能正常工作,可知highlight_nfc_app已被调用,但子菜单仍然无法显示,百思不得其解,望大虾指点,谢谢! |
|