Symbian3/PDK/Source/GUID-8F2D8656-B7F4-4BDA-81CB-8440A2FDDD82.dita
changeset 1 25a17d01db0c
child 3 46218c8b8afa
equal deleted inserted replaced
0:89d6a7a84779 1:25a17d01db0c
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept id="GUID-8F2D8656-B7F4-4BDA-81CB-8440A2FDDD82" xml:lang="en"><title>Dimming
       
    13 or hiding toolbar extension items</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>You can dim or hide toolbar extension items if an extension item function
       
    15 is not available in certain cases.</p>
       
    16 <p>The example below shows how to set the extension button unavailable. In
       
    17 the example, the boolean parameter <codeph>aHide</codeph> indicates if the
       
    18 button should be hidden or dimmed.</p>
       
    19 <codeblock xml:space="preserve">void CMyAppView::SetExtensionButtonUnavailableL( TBool aHide )
       
    20     {
       
    21     CAknToolbar* toolbar = Toolbar();
       
    22     if ( toolbar )
       
    23         {
       
    24         CAknToolbarExtension* toolbarExtension = toolbar-&gt;ToolbarExtension();
       
    25         if ( toolbarExtension )
       
    26             {
       
    27             if ( aHide )
       
    28                 {
       
    29                 // To show the item again: 
       
    30                 // toolbar-&gt;HideItem( KExtensionButtonId, EFalse );
       
    31                 toolbarExtension-&gt;HideItemL( KExtensionButtonId, ETrue );
       
    32                 }
       
    33             else
       
    34                 {
       
    35                 // To undim the item again:
       
    36                 // toolbar-&gt;SetItemDimmed( KExtensionButtonId, EFalse );
       
    37                 toolbarExtension-&gt;SetItemDimmed( KExtensionButtonId, ETrue );
       
    38                 }
       
    39             }
       
    40         }
       
    41     }
       
    42 </codeblock>
       
    43 </conbody></concept>