10 <!DOCTYPE concept |
10 <!DOCTYPE concept |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
12 <concept id="GUID-4A66B46E-8A23-42E4-ADAD-B124A36B180A" xml:lang="en"><title>Showing |
12 <concept id="GUID-4A66B46E-8A23-42E4-ADAD-B124A36B180A" xml:lang="en"><title>Showing |
13 and hiding stylus pop-up menu</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
13 and hiding stylus pop-up menu</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
14 <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> |
14 <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> |
15 <p><draft-comment time="2008-05-19T11:33" translate="no">How is the menu dismissed/hidden? |
15 <p>Usually, the pop-up menu must not be directly displayed in the <codeph>HandlePointerEventL</codeph> of |
16 Automatically after a command has been selected or when the user taps outside |
16 a <codeph>CCoeControl</codeph>. Use the <codeph>CAknLongTapDetector</codeph> |
17 the menu?</draft-comment></p> |
17 to handle the Llong Tap event and show the pop-up on the <codeph>HandleLongTapEventL</codeph>, |
18 <p><draft-comment time="2008-05-19T11:35" translate="no">Add sample code on showing and hiding |
18 which is the implementation to the interface <codeph>MAknLongTapDetectorCallBack</codeph>.</p> |
19 the menu here.</draft-comment></p> |
19 <p>The following code snippets illustrates how to show pop-up menu:</p> |
|
20 <codeblock xml:space="preserve">CAknLongTapDetector * iLongTapDetector; |
|
21 // "this" implement the interface MAknLongTapDetectorCallBack |
|
22 iLongTapDetector = CAknLongTapDetector::NewL( this ); |
|
23 |
|
24 // pass the process to the long tap detector |
|
25 void XXXX::HandlePointerEventL( |
|
26 const TPointerEvent& aPointerEvent) |
|
27 { |
|
28 iLongTapDetector->PointerEventL( aPointerEvent ); |
|
29 // Call base class HandlePointerEventL() |
|
30 CCoeControl::HandlePointerEventL(aPointerEvent); |
|
31 } |
|
32 // handle long tap detector event to show the stylus popup |
|
33 void XXXX::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation ) |
|
34 { |
|
35 iPopupMenu->SetPosition( |
|
36 aPenEventScreenLocation , |
|
37 CAknStylusPopUpMenu::EPositionTypeRightBottom ); |
|
38 iPopupMenu->ShowMenu(); |
|
39 } |
|
40 </codeblock> |
20 </conbody></concept> |
41 </conbody></concept> |