diff -r 48780e181b38 -r 578be2adaf3e Symbian3/PDK/Source/GUID-6113CC3B-F994-4AA8-81E9-50433A3266E2.dita --- a/Symbian3/PDK/Source/GUID-6113CC3B-F994-4AA8-81E9-50433A3266E2.dita Tue Jul 20 12:00:49 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-6113CC3B-F994-4AA8-81E9-50433A3266E2.dita Fri Aug 13 16:47:46 2010 +0100 @@ -1,57 +1,57 @@ - - - - - -Adding -and removing toolbar extension items -

The toolbar extension can basically hold the same items as the toolbar -itself. However, the floating toolbar extension can only have focusable buttons. -A fixed toolbar extension does not naturally have focus since its parent toolbar -is not focusing.

-

The toolbar extension can have a variable number of items. They are located -from the upper left (right in mirrored layout) corner. If all items cannot -fit into the extension, items from the end will be dropped.

-

You can add items to the toolbar extension in the similar way as to a toolbar, -either by defining TBAR_CTRL resource structures in the resource -file or adding the items dynamically by using toolbar extension functions.

-

You can also remove items from the extension.

-

The example below shows how to add an item to the toolbar extension as -the first item.

-void CMyAppView::AddItemAsFirstToToolbarExtensionL() - { - CAknToolbar* toolbar = Toolbar(); - if ( toolbar ) - { - CAknToolbarExtension* toolbarExtension = toolbar->ToolbarExtension(); - if ( toolbarExtension ) - { - CAknButton* newButton = CAknButton::NewL( R_MYAPP_EXTENSION_BUTTON ); - // Last parameter tells the index at where to add new item - toolbarExtension->AddItemL( - newButton, EAknCtButton, KExtensionButtonId, 0, 0 ); - } - } - } - -

The example below shows how to remove an item from the toolbar extension.

-void CMyAppView::RemoveItemFromToolbarExtensionL() - { - CAknToolbar* toolbar = Toolbar(); - if ( toolbar ) - { - CAknToolbarExtension* toolbarExtension = toolbar->ToolbarExtension(); - if ( toolbarExtension ) - { - toolbarExtension->RemoveItemL( KExtensionButtonId ); - } - } - } - + + + + + +Adding +and removing toolbar extension items +

The toolbar extension can basically hold the same items as the toolbar +itself. However, the floating toolbar extension can only have focusable buttons. +A fixed toolbar extension does not naturally have focus since its parent toolbar +is not focusing.

+

The toolbar extension can have a variable number of items. They are located +from the upper left (right in mirrored layout) corner. If all items cannot +fit into the extension, items from the end will be dropped.

+

You can add items to the toolbar extension in the similar way as to a toolbar, +either by defining TBAR_CTRL resource structures in the resource +file or adding the items dynamically by using toolbar extension functions.

+

You can also remove items from the extension.

+

The example below shows how to add an item to the toolbar extension as +the first item.

+void CMyAppView::AddItemAsFirstToToolbarExtensionL() + { + CAknToolbar* toolbar = Toolbar(); + if ( toolbar ) + { + CAknToolbarExtension* toolbarExtension = toolbar->ToolbarExtension(); + if ( toolbarExtension ) + { + CAknButton* newButton = CAknButton::NewL( R_MYAPP_EXTENSION_BUTTON ); + // Last parameter tells the index at where to add new item + toolbarExtension->AddItemL( + newButton, EAknCtButton, KExtensionButtonId, 0, 0 ); + } + } + } + +

The example below shows how to remove an item from the toolbar extension.

+void CMyAppView::RemoveItemFromToolbarExtensionL() + { + CAknToolbar* toolbar = Toolbar(); + if ( toolbar ) + { + CAknToolbarExtension* toolbarExtension = toolbar->ToolbarExtension(); + if ( toolbarExtension ) + { + toolbarExtension->RemoveItemL( KExtensionButtonId ); + } + } + } +
\ No newline at end of file