Symbian3/SDK/Source/GUID-4A66B46E-8A23-42E4-ADAD-B124A36B180A.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 12:39:03 +0100
changeset 8 ae94777fff8f
parent 0 89d6a7a84779
child 13 48780e181b38
permissions -rw-r--r--
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

<?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-4A66B46E-8A23-42E4-ADAD-B124A36B180A" xml:lang="en"><title>Showing
and hiding stylus pop-up menu</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>Use the method <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknStylusPopUpMenu.html#2aab09ce484efcf807cb1191dbd08062" format="application/java-archive"><codeph>ShowMenu()</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> to show the stylus pop-up menu.</p>
<p>Usually, the pop-up menu must not be directly displayed in the <codeph>HandlePointerEventL</codeph> of
a <codeph>CCoeControl</codeph>.  Use the <codeph>CAknLongTapDetector</codeph> 
to handle the Llong Tap event and show the pop-up on the <codeph>HandleLongTapEventL</codeph>,
which is the implementation to the interface <codeph>MAknLongTapDetectorCallBack</codeph>.</p>
<p>The following code snippets illustrates how to show pop-up menu:</p>
<codeblock xml:space="preserve">CAknLongTapDetector * iLongTapDetector;
// "this" implement the interface MAknLongTapDetectorCallBack
iLongTapDetector = CAknLongTapDetector::NewL( this );

// pass the process to the long tap detector
void XXXX::HandlePointerEventL(
		const TPointerEvent&amp; aPointerEvent)
	{
	iLongTapDetector-&gt;PointerEventL( aPointerEvent );
	// Call base class HandlePointerEventL()
	CCoeControl::HandlePointerEventL(aPointerEvent);
	}
// handle long tap detector event to show the stylus popup
void XXXX::HandleLongTapEventL( const TPoint&amp; aPenEventLocation, const TPoint&amp; aPenEventScreenLocation )
	{
      iPopupMenu-&gt;SetPosition( 
               aPenEventScreenLocation ,
               CAknStylusPopUpMenu::EPositionTypeRightBottom );
	iPopupMenu-&gt;ShowMenu();
	}
</codeblock>
</conbody></concept>