You can dim or hide toolbar extension items if an extension item function is not available in certain cases.
The example below shows how to set the extension button unavailable. In the example, the boolean parameter aHide indicates if the button should be hidden or dimmed.
void CMyAppView::SetExtensionButtonUnavailableL( TBool aHide ) { CAknToolbar* toolbar = Toolbar(); if ( toolbar ) { CAknToolbarExtension* toolbarExtension = toolbar->ToolbarExtension(); if ( toolbarExtension ) { if ( aHide ) { // To show the item again: // toolbar->HideItem( KExtensionButtonId, EFalse ); toolbarExtension->HideItemL( KExtensionButtonId, ETrue ); } else { // To undim the item again: // toolbar->SetItemDimmed( KExtensionButtonId, EFalse ); toolbarExtension->SetItemDimmed( KExtensionButtonId, ETrue ); } } } }
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.