diff -r 4816d766a08a -r f345bda72bc4 Symbian3/PDK/Source/GUID-7AE34C8A-50C6-49BA-9E43-AE76873B5E12.dita --- a/Symbian3/PDK/Source/GUID-7AE34C8A-50C6-49BA-9E43-AE76873B5E12.dita Tue Mar 30 11:42:04 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-7AE34C8A-50C6-49BA-9E43-AE76873B5E12.dita Tue Mar 30 11:56:28 2010 +0100 @@ -1,43 +1,43 @@ - - - - - -Handling -toolbar item events -

To be able to receive toolbar item events in your application -or application view, you must implement the toolbar observer interface in -the view and register the view to the toolbar:

To receive toolbar item -events, use the observer class MAknToolbarObserver.

The example below shows how to set the toolbar observer.

- void CMyAppView::ConstructL( TInt aResId ) - { - BaseConstructL( aResId ); - CAknToolbar* toolbar = Toolbar(); - if ( toolbar ) - { - toolbar->SetToolbarObserver( this ); - } - } -
-

Handle toolbar item events in MAknToolbarObserver’s OfferToolbarEventL().

OfferToolbarEventL() is called when the toolbar -item state has changed, for example when a button is pressed. When handling -a toolbar event, the control in question can be identified from the commandid -that is sent as a parameter in the method. The ID belongs to that control -it was sent from (in case of a button, the ID of the button that was pressed).

-

The example below illustrates how to implement OfferToolBarEventL().

- void CMyAppView::OfferToolbarEventL( TInt aCommandId ) - { - if ( aCommandId == KButtonId ) - { - // do button function - … - } - } -
+ + + + + +Handling +toolbar item events +

To be able to receive toolbar item events in your application +or application view, you must implement the toolbar observer interface in +the view and register the view to the toolbar:

To receive toolbar item +events, use the observer class MAknToolbarObserver.

The example below shows how to set the toolbar observer.

+ void CMyAppView::ConstructL( TInt aResId ) + { + BaseConstructL( aResId ); + CAknToolbar* toolbar = Toolbar(); + if ( toolbar ) + { + toolbar->SetToolbarObserver( this ); + } + } +
+

Handle toolbar item events in MAknToolbarObserver’s OfferToolbarEventL().

OfferToolbarEventL() is called when the toolbar +item state has changed, for example when a button is pressed. When handling +a toolbar event, the control in question can be identified from the commandid +that is sent as a parameter in the method. The ID belongs to that control +it was sent from (in case of a button, the ID of the button that was pressed).

+

The example below illustrates how to implement OfferToolBarEventL().

+ void CMyAppView::OfferToolbarEventL( TInt aCommandId ) + { + if ( aCommandId == KButtonId ) + { + // do button function + … + } + } +
\ No newline at end of file