DynInitMenuPaneL not getting called

Login to reply to this topic.
Tue, 2008-03-04 14:07
Joined: 2006-04-19
Forum posts: 155

Hi All ,

I am working on UIQ3.1 and OS 9.2 .I want to add dynamic menu item in my view.But DynInitMenuPaneL
is not getting called. My code is:

void CTestView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane *aMenuPane)
{
CEikonEnv::Static()->InfoMsg(_L("Test111"));

if(aResourceId == R_Test_View_MENU )
{
CEikonEnv::Static()->InfoMsg(_L("Test1"));
// aMenuPane -> SetItemDimmed(EEikBidYes,EFalse);
CEikMenuPaneItem::SData itemData;
// set the command for the item and any extra flags
itemData.iText=_L("check");
itemData.iCommandId=EEikCmdFileOpenAnother;
itemData.iFlags=0;
itemData.iCascadeId=0;
// add the item
aMenuPane->AddMenuItemL(itemData);
}

RESOURCE MENU_BAR r_test_view_menubar
{
titles=
{
MENU_TITLE { menu_pane=r_test_view_menu; txt="Actions"; }
};
}

RESOURCE MENU_PANE r_test_view_menu
{
items=
{
//MENU_ITEM { command=EEikBidYes; txt="Yes";}
};
}
}

I tried to debug the code also but control is not coming in this method.I am implementing this mehod in my view.

I trid in both way as creating the command in .rss itself and do dimmed in view and other way create command in view itself.

I have used the same thing in Series 60 successfully many times . Is there some different way in UIQ??

Please tell me where I am doing wrong??

Any comments would be a great help for me as it is very urgent.
Regards,
Isha


"To the question of your life , you are the only Answer. To the problems of your life,you are the only Solution".


Tue, 2008-03-04 14:37
Joined: 2005-11-20
Forum posts: 1241
Re: DynInitMenuPaneL not getting called

Uh, no, anything with CEikMenuPane in it (note the "Eik") is almost certainly wrong in the case of UIQ3. That's still there to support "legacy" code, but all new stuff should use CQikCommand.

I think the way to go is using CQikCommandManager. There is a sample from SE that shows how to add custom commands programmatically:
MyFontExplorer


René Brunner

Wed, 2008-03-05 05:19
Joined: 2006-04-19
Forum posts: 155
Re: DynInitMenuPaneL not getting called


Hi rbrunner,

Thanks a lot for your support. My problem got resolved.I used this method of CQikCommand SetInvisible(TBool aValue);

Thanks once again.

Regards,
Isha


"To the question of your life , you are the only Answer. To the problems of your life,you are the only Solution".

Tue, 2008-05-06 11:28
Joined: 2006-11-23
Forum posts: 15
Re: DynInitMenuPaneL not getting called

Hi Isha,

See the attached sample application, It is possible to add menu items dynamically in uiq3.1 and also we can handle the click event of those menu items....

Br
Pankaj

AttachmentSize
HelloWorld_DynMenu.zip73.41 KB

Pankaj Dubey

Tue, 2008-05-06 11:42
Joined: 2006-04-19
Forum posts: 155
Re: DynInitMenuPaneL not getting called

Hi dubepankaj1980

Thanks a lot for your concern. But I have already resolved my problem. Smiling

Thanks once again.

Regards,
Isha


"To the question of your life , you are the only Answer. To the problems of your life,you are the only Solution".

  • Login to reply to this topic.