Hi All
How to hide/replace the default menu options (Add Field, Edit Label, Save, Delete Field) associated with a form. I want to define my own options instead of these default options.
here is how i implemented in rss and cpp file but its not working i m getting the these options in (Edit, Add Field, Edit Label, Save, Delete Field, however none of this is working) form menu and my options does not appear at all.
RESOURCE FORM r_form
{
flags=EEikFormEditModeOnly;
items=
{
DLG_LINE
{
type=EEikCtEdwin;
prompt="Email From:";
id = EFilter;
control= EDWIN
{
width = 15;
maxlength = 256;
};
},
DLG_LINE
{
type = EAknCtPopupFieldText;
prompt = "Attachment";
id = EAknPopUpListFieldAttach;
itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
control =POPUP_FIELD_TEXT
{
popupfield=POPUP_FIELD
{
width = 9;
//other ="Other..";
};
textarray = r_attach_list_array;
};
}
};
}
RESOURCE MENU_BAR r_menubar
{
titles =
{
MENU_TITLE
{
menu_pane = r_menu_pane;
}
};
}
RESOURCE MENU_PANE r_menu_pane
{
items =
{
MENU_ITEM
{
command = ESave;
txt = "Save";
},
MENU_ITEM
{
command = EExit;
txt = "Exit";
}
};
}
CAknPrefForm* CAknPrefForm::NewL()
{
CAknPrefForm* self =
new (ELeave) CAknPrefForm();
CleanupStack::PushL(self);
self->ConstructL(R_MENUBAR);
CleanupStack::Pop();
return self;
}
void CAknPrefForm::ConstructL(TInt aMenuResource)
{
CAknForm::ConstructL(aMenuResource);
}
void CAknPrefForm::ProcessCommandL(TInt aCommandId)
{
switch(aCommandId)
{
case EPrefSave:// saving some data
break;
case EPrefExit: User::Exit(1);
}
}
void CAknPrefForm:

ynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane)
{
if (aResourceId == R_MENUBAR)
{
aMenuPane->SetItemDimmed(EAknFormCmdAdd, ETrue);
aMenuPane->SetItemDimmed(EAknFormCmdEdit, ETrue);
aMenuPane->SetItemDimmed(EAknFormCmdSave, ETrue);
aMenuPane->SetItemDimmed(EAknFormCmdLabel, ETrue);
aMenuPane->SetItemDimmed(EAknFormCmdDelete, ETrue);
CAknForm:

ynInitMenuPaneL(aResourceId,aMenuPane);
}
}
On debugging i found that if clause of DynInitMenuPaneL() doesnt execute at all
if(aResourceId==R_MENUBAR)
{
....... //control doesnt reach here
}
I tried this also
if(aResourceId==R_MENU_PANE)
{
....... //control doesnt reach here
}
this too does nt work
why its so? what can be the reason?
whats missing here in my code?
can anyone plz tell me
waiting for a reply