Symbian中动态改变 CBA 按钮
2010-06-03 23:03:00 来源:WEB开发网核心提示:Symbian中动态改变 CBA 按钮在Rss文件中添加以下代码:CODE:RESOURCE CBA r_yourapp_softkeys_options_open{buttons ={CBA_BUTTON { id=EAknSoftkeyOptions; txt = "Options"; },CB
Symbian中动态改变 CBA 按钮
在Rss文件中添加以下代码:
CODE:
RESOURCE CBA r_yourapp_softkeys_options_open
{
buttons =
{
CBA_BUTTON { id=EAknSoftkeyOptions; txt = "Options"; },
CBA_BUTTON { id=EYourAppCmdOpenApp; txt = "Open"; }
};
}
RESOURCE CBA r_yourapp_softkeys_options_stop
{
buttons =
{
CBA_BUTTON { id=EAknSoftkeyOptions; txt = "Options"; },
CBA_BUTTON { id=EYourAppCmdStopApp; txt = "Stop"; }
};
}
在hrh文件中添加:
CODE:
enum TYourAppCommandIds
{
// ...
id=EYourAppCmdOpenApp,
id=EYourAppCmdStopApp,
// ...
};
在应用程序的AppUi类中添加:
CODE:
void CYourAppUi::SetCommandSetL(TInt aResourceId)
{
CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
cba->SetCommandSetL( aResourceId );
}
更多精彩
赞助商链接