Symbian C++ 标题面板
2010-05-31 19:40:00 来源:WEB开发网//在标题面板中显示图像
case ETitlePaneCmdTitleImage:
{
_LIT(KTitleBitMapFile, "\system\apps\titlepane\TitlePane.mbm");
TUid titlePaneUid;
titlePaneUid.iUid = EEikStatusPaneUidTitle;
CEikStatusPane* statusPane = this->StatusPane();
CEikStatusPane::TPaneCapabilities subPane =
statusPane->PaneCapabilities(titlePaneUid);
//如果可以访问标题面板
if(subPane.IsPresent() && subPane.IsAppOwned())
{
CAknTitlePane* titlePane =
(CAknTitlePane*)statusPane->ControlL(titlePaneUid);
CFbsBitmap* bitmap = iEikonEnv->CreateBitmapL(KTitleBitMapFile, EMbmTitlepaneTitle);
//设置标题面板的图像
titlePane->SetPicture(bitmap);
}
break;
}
default:
Panic(ETitlePaneUi);
break;
}
}
4. 在资源文件中更改标题面板的文本和图像
RESOURCE EIK_APP_INFO
{
status_pane = r_titlepane_status_pane;
menubar = r_titlepane_menubar;
cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
}
//定义包含文本的标题面板
RESOURCE TITLE_PANE r_titlepane_title_pane
{
//标题文本
txt = qtn_titlepane_title_text;
}
//定义包含图像的标题面板
RESOURCE TITLE_PANE r_titlepane_title_pane
{
//标题图像
bmpid = EMbmTitlepaneTitle;
// bmpmaskid = EMbmTitlepaneMaskTitle
bmpfile = "\system\apps\titlepane\TitlePane.mbm";
}
//定义状态面板
RESOURCE STATUS_PANE_APP_MODEL r_titlepane_status_pane
{
panes =
{
SPANE_PANE
{
id = EEikStatusPaneUidTitle; //avkon.hrh 810
type = EAknCtTitlePane; //avkon.hrh 415
resource = r_titlepane_title_pane;
}
};
}
更多精彩
赞助商链接