Symbian3/SDK/Source/GUID-4A66B46E-8A23-42E4-ADAD-B124A36B180A.dita
changeset 8 ae94777fff8f
parent 0 89d6a7a84779
child 13 48780e181b38
--- a/Symbian3/SDK/Source/GUID-4A66B46E-8A23-42E4-ADAD-B124A36B180A.dita	Wed Mar 31 11:11:55 2010 +0100
+++ b/Symbian3/SDK/Source/GUID-4A66B46E-8A23-42E4-ADAD-B124A36B180A.dita	Fri Jun 11 12:39:03 2010 +0100
@@ -1,20 +1,41 @@
-<?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><draft-comment time="2008-05-19T11:33" translate="no">How is the menu dismissed/hidden?
-Automatically after a command has been selected or when the user taps outside
-the menu?</draft-comment></p>
-<p><draft-comment time="2008-05-19T11:35" translate="no">Add sample code on showing and hiding
-the menu here.</draft-comment></p>
+<?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>
\ No newline at end of file