diff -r 51a74ef9ed63 -r ae94777fff8f Symbian3/SDK/Source/GUID-405F7AB8-0F0E-4171-95E6-3524D76917DE.dita --- a/Symbian3/SDK/Source/GUID-405F7AB8-0F0E-4171-95E6-3524D76917DE.dita Wed Mar 31 11:11:55 2010 +0100 +++ b/Symbian3/SDK/Source/GUID-405F7AB8-0F0E-4171-95E6-3524D76917DE.dita Fri Jun 11 12:39:03 2010 +0100 @@ -1,27 +1,44 @@ - - - - - -Handling -stylus pop-up menu events and commands -

At the construction phase, CAknStylusPopUpMenu is given -a MEikMenuObserver object, which is usually a pointer to -the application’s UI (CAknAppUi) -or another class that implements the interface. The stylus pop up menu will -grab the stylus event when one of its items is tapped on and it will then -report the item’s command ID to the menu observer. It is then up to the application -to handle the command in the implementation of MEikMenuObserver::HandleCommandL().

-

When an item is tapped, the menu calls its observer's (iMenuObserver) -ProcessCommandL. Typically the observer is application's AppUi. It is then -the observer's responsibility to handle the command appropriately. The observer -is informed with KErrCancel if the menu is closed without making a selection.

-

Add sample code on event and command -handling here.

+ + + + + +Handling stylus pop-up menu events and commands +

At the construction phase, CAknStylusPopUpMenu is given a MEikMenuObserver object, which is usually +a pointer to the application’s UI (CAknAppUi) or +another class that implements the interface. The stylus pop up menu +will grab the stylus event when one of its items is tapped on and +it will then report the item’s command ID to the menu observer. It +is then up to the application to handle the command in the implementation +of MEikMenuObserver::HandleCommandL().

+

When an item is tapped, the menu calls its observer's (iMenuObserver) ProcessCommandL() using:void ProcessCommandL(TInt aCommandId); where, aCommandID parameter is the command number recorded in +the resource file. You can also add it using AddMenuItemL() function as shown in the following code snippet:void AddMenuItemL( const TDesC& aItem, const TInt aCommandId );

+

The following code snippet illustrates how to handle the command:switch( aCommandId ) + { + case StylusMenuCommand1: + break; + case StylusMenuCommand2: + break; + case StylusMenuCommand3: + break; + case StylusMenuCommand4: + break; + case KErrCancel: + break; + default: + break; + } +

+

Typically the observer is application's AppUi. It is then the observer's +responsibility to handle the command appropriately. The observer is +informed with KErrCancel if the menu is closed without +making a selection.

+

Use the CAknStylusPopUpMenu::HandleControlEventL() method to handle events that occur when user selects a menu item.

+
\ No newline at end of file