全部博文(413)
分类:
2008-04-17 18:03:11
RESOURCE DIALOG test_dialog
{
……
buttons = R_AVKON_SOFTKEYS_OPTIONS_BACK;
……..
}
然后需要实现一个从CaknDialog派生的对话框类,并重写OkToExitL()和ProcessCommandL()函数用于显示菜单和命令响应.
TBool CTestDialog::OkToExitL(TInt aButtonId)
{
if ( aButtonId == EAknSoftkeyOptions ) // press options button
{
CAknDialog:isplayMenuL(); // display the menu
}
else if ( aButtonId == EAknSoftkeyBack )
{
return ETrue;
}
return EFalse;
}
void CTestDialog::ProcessCommandL( TInt aCommandId )
{
switch ( aCommandId )
{
case EcmdMenuTest:
{
CAknInformationNote *note = new (ELeave) CAknInformationNote;
note->ExecuteLD( _L( "Test" ) );
}
break;
}
CAknDialog::HideMenu(); // hide the menu after commands finished
}