Showing and hiding stylus pop-up menu

Use the method CAknStylusPopUpMenu::ShowMenu() 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();
	}