diff -r 43e37759235e -r 51a74ef9ed63 Symbian3/SDK/Source/GUID-BC3207BF-9E9F-4BA0-8F01-B72228110A61.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-BC3207BF-9E9F-4BA0-8F01-B72228110A61.dita Wed Mar 31 11:11:55 2010 +0100 @@ -0,0 +1,50 @@ + + + + + +Accessing +the toolbar from applications or application views +

To access +the current toolbar (CAknToolbar, +defined in akntoolbar.h) in applications, use +the methods CAknAppUi::CurrentPopupToolbar() or CEikAppUiFactory::CurrentPopupToolbar() in the case of a floating toolbar. For a fixed toolbar, use CAknAppUi::CurrentFixedToolbar() or CEikAppUiFactory::CurrentFixedToolbar(). The methods return a pointer to either the application toolbar or +a view-specific toolbar (if defined).

To access the application toolbar +directly from applications, you can also call CAknAppUi::PopupToolbar() and CEikAppUiFactory::PopupToolbar(). To access the view-specific +toolbar as a client, call CAknView::Toolbar(). These calls do not transfer the ownership +of the toolbar, so the framework takes care of the toolbar destruction.

+

The example below +shows how to access the toolbar in the application AppUi class. (You can also +use CEikAppUiFactory methods.)

void CMyAppUi::DoSomethingToToolbar() + { + + // Current fixed toolbar (if view has no fixed toolbar, returns application toolbar) + CAknToolbar* fixedToolbar = CurrentFixedToolbar(); + + // Current popup toolbar (if view has no popup toolbar, returns application toolbar) + CAknToolbar* popupToolbar = CurrentPopupToolbar(); + + // Application toolbar + CAknToolbar* appToolbar = PopupToolbar(); + + … + + }

The example below shows how to access a view specific +toolbar in the application view class.

+void CMyView::DoSomethingToToolbar() + { + + // View toolbar + CAknToolbar* toolbar = Toolbar(); + + … + + } +
+
\ No newline at end of file