diff -r 51a74ef9ed63 -r ae94777fff8f Symbian3/SDK/Source/GUID-4A66B46E-8A23-42E4-ADAD-B124A36B180A.dita --- 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 @@ - - - - - -Showing -and hiding stylus pop-up menu -

Use the method ShowMenu() in the class CAknStylusPopUpMenu to show the stylus pop-up menu.

-

How is the menu dismissed/hidden? -Automatically after a command has been selected or when the user taps outside -the menu?

-

Add sample code on showing and hiding -the menu here.

+ + + + + +Showing +and hiding stylus pop-up menu +

Use the method ShowMenu() in the class CAknStylusPopUpMenu to show the stylus pop-up menu.

+

Usually, the pop-up menu must not be directly displayed in the HandlePointerEventL of +a CCoeControl. Use the CAknLongTapDetector +to handle the Llong Tap event and show the pop-up on the HandleLongTapEventL, +which is the implementation to the interface MAknLongTapDetectorCallBack.

+

The following code snippets illustrates how to show pop-up menu:

+CAknLongTapDetector * iLongTapDetector; +// "this" implement the interface MAknLongTapDetectorCallBack +iLongTapDetector = CAknLongTapDetector::NewL( this ); + +// pass the process to the long tap detector +void XXXX::HandlePointerEventL( + const TPointerEvent& aPointerEvent) + { + iLongTapDetector->PointerEventL( aPointerEvent ); + // Call base class HandlePointerEventL() + CCoeControl::HandlePointerEventL(aPointerEvent); + } +// handle long tap detector event to show the stylus popup +void XXXX::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation ) + { + iPopupMenu->SetPosition( + aPenEventScreenLocation , + CAknStylusPopUpMenu::EPositionTypeRightBottom ); + iPopupMenu->ShowMenu(); + } +
\ No newline at end of file