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"; }
};
}
{
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,
// ...
};
{
// ...
id=EYourAppCmdOpenApp,
id=EYourAppCmdStopApp,
// ...
};
In your application's AppUi class:
void CYourAppUi::SetCommandSetL(TInt aResourceId)
{
CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
cba->SetCommandSetL( 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.
ZT:http://blog.chinaunix.net/u/9577/showart_613710.html