brew3.15中怎样加载菜单项

allen1986 2009-03-30 05:47:58
我按照BREW2.1中的方法加载菜单,结果程序运行后什么画面都没有,一片空白。我想可能是因为版本的原因。想请教各位,如何在3.15版本下添加菜单。有没有相关的技术文档啊。
...全文
1424 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
allen1986 2009-03-31
  • 打赏
  • 举报
回复
程序中用到的字符窜与位图资源在资源编辑器中编辑了的。
allen1986 2009-03-31
  • 打赏
  • 举报
回复
我在这里将数据定义,初始化函数,和菜单加载函数那出来,请大家帮忙分析,我是在_HandleEvent()里调用menu_Start()

typedef struct _CMenu
{
AEEApplet a;
AEEDeviceInfo DeviceInfo; // always have access to the hardware device information

IDisplay *pIDisplay; // give a standar way to access the display interface
IShell *pIShell; // give a standar way to access the shell interface

int m_nScrWidth;
int m_nScrHeight;
int m_nLineHeight;
int m_nLargeLineHeight;

AEERect m_nCIntAreaRect;
uint8 m_nState;
void* m_pObj;
}CMenu;
static boolean menu_Start(CMenu* pApp)
{
IMenuCtl* pMenuCtl=NULL;
CtlAddItem rMenuItem;
AEERect nRect;
AEEItemStyle nNormal;
AEEItemStyle nSel;
if(ISHELL_CreateInstance(pApp->a.m_pIShell, AEECLSID_MENUCTL,
(void**)(&pApp->m_pObj))!=SUCCESS)
return FALSE;


// Fill in the CtlAddItem structure values
pMenuCtl=(IMenuCtl*)pApp->m_pObj;
IMENUCTL_Reset(pMenuCtl);
IMENUCTL_SetActive(pMenuCtl,FALSE);
rMenuItem.pText=NULL;
rMenuItem.pImage=NULL;
rMenuItem.pszResImage=rMenuItem.pszResText=CMENU_RES_FILE;//resourc file name
rMenuItem.wFont=AEE_FONT_NORMAL;

rMenuItem.wText=IDS_STRING_START;
rMenuItem.wImage=IDI_IMAGE_STA;
rMenuItem.wItemID=IDS_STRING_START;
IMENUCTL_AddItemEx(pMenuCtl,&rMenuItem);

rMenuItem.wText=IDS_STRING_SEL;
rMenuItem.wImage=IDI_IMAGE_SEL;
rMenuItem.wItemID=IDS_STRING_SEL;
IMENUCTL_AddItemEx(pMenuCtl, &rMenuItem);

nNormal.ft=AEE_FT_NONE;
nNormal.xOffset=nNormal.yOffset=0;
nNormal.roImage=AEE_RO_COPY;

nSel.ft=AEE_FT_BOX;
nSel.xOffset=nSel.yOffset=0;
nSel.roImage=AEE_RO_NOT;

IMENUCTL_SetStyle(pMenuCtl, &nNormal, &nSel);

IMENUCTL_SetProperties(pMenuCtl, IMENUCTL_GetProperties(pMenuCtl) &
~(MP_ICON_TEXT_TOP));
SETAEERECT(&nRect, 0, 0, pApp->m_nScrWidth, pApp->m_nScrHeight);
IMENUCTL_SetRect(pMenuCtl, &nRect);
IMENUCTL_SetActive(pMenuCtl, TRUE);
IDISPLAY_Update(pApp->pIDisplay);
return TRUE;
}
boolean CMenu_InitAppData(CMenu* pMe)
{
// Get the device information for this handset.
// Reference all the data by looking at the pMe->DeviceInfo structure
// Check the API reference guide for all the handy device info you can get
pMe->DeviceInfo.wStructSize = sizeof(pMe->DeviceInfo);
ISHELL_GetDeviceInfo(pMe->a.m_pIShell,&pMe->DeviceInfo);

// Insert your code here for initializing or allocating resources...
pMe->pIShell=pMe->a.m_pIShell;
pMe->pIDisplay=pMe->a.m_pIDisplay;
// Insert your code here for initializing or allocating resources...
pMe->m_nLineHeight=IDISPLAY_GetFontMetrics(pMe->a.m_pIDisplay,
AEE_FONT_NORMAL,
NULL,
NULL);
pMe->m_nLargeLineHeight=IDISPLAY_GetFontMetrics(pMe->a.m_pIDisplay,
AEE_FONT_LARGE,
NULL,
NULL);
pMe->m_nScrHeight=pMe->DeviceInfo.cyScreen;
pMe->m_nScrWidth=pMe->DeviceInfo.cxScreen;
SETAEERECT(&pMe->m_nCIntAreaRect,
0,
0,
pMe->DeviceInfo.cxScreen,
pMe->DeviceInfo.cyScreen-pMe->m_nLargeLineHeight);
pMe->m_pObj=NULL;



// if there have been no failures up to this point then return success
return TRUE;
}
allen1986 2009-03-31
  • 打赏
  • 举报
回复
恩,我是按照BREW教程(海信).pdf文档上的DEMO做的。
sunyymq 2009-03-31
  • 打赏
  • 举报
回复
最好是程序拿出来给大家分析,可能是没有更新,或者是你写的不对。跟版本没有关系!
zsf81 2009-03-31
  • 打赏
  • 举报
回复
有没有UPDATE,加载程序扔出崃看看
  • 打赏
  • 举报
回复
与版本无关,用DBGPRINTF看看是哪出的问题,很有可能是MIF文件的ClassID有问题吧

4,661

社区成员

发帖
与我相关
我的任务
社区描述
本论坛以AI、WoS 、XR、IoT、Auto、生成式AI等核心板块组成,为开发者提供便捷及高效的学习和交流平台。 高通开发者专区主页:https://qualcomm.csdn.net/
人工智能物联网机器学习 技术论坛(原bbs) 北京·东城区
社区管理员
  • csdnsqst0050
  • chipseeker
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧