Symbian3/PDK/Source/GUID-7B863846-7666-4FBF-90B2-52F847710C45.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
parent 14 578be2adaf3e
permissions -rw-r--r--
Initial contribution of the Adaptation Documentation.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-7B863846-7666-4FBF-90B2-52F847710C45" xml:lang="en"><title>Adding
and removing menu items</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>Add items to the menu by either:</p>
<ul>
<li><p>Calling the method <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknStylusPopUpMenu.html#7199d833dc81124c5f84684b7981ad0d" format="application/java-archive"><codeph>AddMenuItemL()</codeph></xref> in the class <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknStylusPopUpMenu.html" format="application/java-archive"><codeph>CAknStylusPopUpMenu</codeph></xref> for each menu item to be added or</p></li>
<li><p>Creating the entire menu instance from a resource by calling <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknStylusPopUpMenu.html#75cd95c35a6ed4734b93713596bb51d5" format="application/java-archive"><codeph>CAknStylusPopUpMenu::ConstructFromResourceL()</codeph></xref>. This requires a <codeph>STYLUS_POPUP_MENU</codeph> resource structure
that contains the items in the structure <codeph>STYLUS_POPUP_MENU_ITEM</codeph>.</p></li>
</ul>
<note><p>If the menu already contains the maximum number of items, <codeph>CAknStylusPopUpMenu::AddMenuItemL()</codeph> will
do nothing. The same applies to <codeph>CAknStylusPopUpMenu::ConstructFromResourceL()</codeph>:
it will only add the maximum number of menu items even if there were more
items defined in the resource.</p><p><draft-comment time="2008-05-15T11:15" translate="no">What's
the maximum here: six according to UI Style Guide, no mention in <codeph>aknstyluspopupmenu.h</codeph> in
Kevlar. Or can this be set by app developer somehow?</draft-comment></p></note>
<p>To remove items, use the method <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknStylusPopUpMenu.html#3ae9fb001d266da3fff2e82692d45e27" format="application/java-archive"><codeph>CAknStylusPopUpMenu::RemoveItem()</codeph></xref>.</p>
<p><draft-comment time="2008-05-15T13:32" translate="no">Add sample code on adding and removing
menu items here</draft-comment></p>
</conbody></concept>