Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2026141
  • 博文数量: 413
  • 博客积分: 10926
  • 博客等级: 上将
  • 技术积分: 3862
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-09 18:14
文章分类

全部博文(413)

文章存档

2015年(5)

2014年(1)

2013年(5)

2012年(6)

2011年(138)

2010年(85)

2009年(42)

2008年(46)

2007年(26)

2006年(59)

分类:

2008-04-28 12:28:15

In the RSS file:

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"; }
    };
}


In the HRH file:

enum TYourAppCommandIds
{
    // ...
    id=EYourAppCmdOpenApp,
    id=EYourAppCmdStopApp,
    // ...
};


In your application's AppUi class:

void CYourAppUi::SetCommandSetL(TInt aResourceId)
{
    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
    cba->SetCommandSetL( aResourceId );
}


Now you can call:

SetCommandSetL( R_YOURAPP_SOFTKEYS_OPTIONS_OPEN );
OR
SetCommandSetL( R_YOURAPP_SOFTKEYS_OPTIONS_STOP );

where ever you want.



Change the cba of dialog, you can call SetCommandSetL with argument R_AVKON_SOFTKEYS_XXX directly.

阅读(2086) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~