uint32 IMainUI_Show(IMainUI* pUI){ CtlAddItem ai; AEERect rRect; boolean ok; pUI->glbVar->appState = APP_STATE_MAINUI; IDisplay_ClearScreen(pUI->glbVar->pIDisplay); IRESOURCE_LoadResource(pUI->glbVar->pIResouce, IDS_MAINUI_TITLE); IMENUCTL_SetTitle(pUI->pMenu, NULL, 0, pUI->glbVar->pIResouce->idsResource); // Add Items in the Menu IRESOURCE_LoadResource(pUI->glbVar->pIResouce, IDS_MAINUI_LOCATE); // Add Items in the Menu //ai.pText = pUI->glbVar->pIResouce->idsResource; ai.pImage = NULL; ai.pszResImage = ai.pszResText = NULL; ai.wImage = NULL; ai.wText = NULL; ai.dwData = 0; // Add New ai.wFont = AEE_FONT_NORMAL; ai.wItemID = IDS_MAINUI_LOCATE; //位置上报 IRESOURCE_LoadResource(pUI->glbVar->pIResouce, IDS_MAINUI_LOCATE); ai.pText = pUI->glbVar->pIResouce->idsResource; ai.wItemID = IDS_MAINUI_LOCATE; ok = IMENUCTL_AddItemEx(pUI->pMenu, &ai); //拍照上传 IRESOURCE_LoadResource(pUI->glbVar->pIResouce, IDS_MAINUI_PHOTO); ai.pText = pUI->glbVar->pIResouce->idsResource; ai.wItemID = IDS_MAINUI_PHOTO; IMENUCTL_AddItemEx(pUI->pMenu, &ai); SETAEERECT(&rRect, 0, 5, pUI->glbVar->pDevice->cxScreen, pUI->glbVar->pDevice->cyScreen - IDISPLAY_GetFontMetrics( pUI->glbVar->pIDisplay, AEE_FONT_NORMAL, NULL, NULL ) - 10); IMENUCTL_SetRect(pUI->pMenu, &rRect); IMENUCTL_SetActive(pUI->pMenu, FALSE); IMENUCTL_Redraw(pUI->pMenu); IRESOURCE_LoadResource(pUI->glbVar->pIResouce, IDS_MAINUI_SETTINGS); IMENUCTL_AddItem(pUI->pSK, NULL, NULL, IDS_MAINUI_SETTINGS, pUI->glbVar->pIResouce->idsResource, 0); IMENUCTL_Redraw(pUI->pSK); pUI->focusCTL = MAINUI_INIT; return AEE_SUCCESS; }
/*=========================================================================== This function adds one item to the specified IMenuCtl. ===========================================================================*/ boolean TS_AddMenuItem(IMenuCtl * pMenu, uint16 wTextID, AECHAR * pText, uint16 wImageID, uint16 wItemID, uint32 dwData) { CtlAddItem ai; // Fill in the CtlAddItem structure values ai.pText = pText; ai.pImage = NULL; ai.pszResImage = NAVIGATE_RES_FILE; ai.pszResText = NAVIGATE_RES_FILE; ai.wText = wTextID; ai.wFont = AEE_FONT_LARGE; ai.wImage = wImageID; ai.wItemID = wItemID; ai.dwData = dwData; // Add the item to the menu control return IMENUCTL_AddItemEx( pMenu, &ai ); }