Symbian3/SDK/Source/GUID-8845AFD6-F238-43FF-BD7B-902CD8CD3973.dita
changeset 7 51a74ef9ed63
parent 0 89d6a7a84779
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     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-8845AFD6-F238-43FF-BD7B-902CD8CD3973" xml:lang="en"><title>Showing
       
    13 and hiding toolbar items</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>You can set toolbar items hidden or dimmed if a toolbar function is temporary
       
    15 unavailable. </p>
       
    16 <p>The example below shows how to set a button unavailable. In the example,
       
    17 the boolean parameter <codeph>aHide</codeph> tells if the button should be
       
    18 hidden or dimmed. </p>
       
    19 <codeblock xml:space="preserve">void CMyAppView::SetButtonUnavailable( TBool aHide )
       
    20     {
       
    21     CAknToolbar* toolbar = Toolbar();
       
    22     if ( toolbar )
       
    23         {
       
    24         if ( aHide )
       
    25             {
       
    26             // To show the item again: 
       
    27             // toolbar-&gt;HideItem( KButtonId, EFalse, ETrue );
       
    28             toolbar-&gt;HideItem( KButtonId, ETrue, ETrue );
       
    29             }
       
    30         else
       
    31             {
       
    32             // To undim the item again:
       
    33             // toolbar-&gt;SetItemDimmed( KButtonId, EFalse, ETrue );
       
    34             toolbar-&gt;SetItemDimmed( KButtonId, ETrue, ETrue );
       
    35             }
       
    36         }
       
    37     }
       
    38 </codeblock>
       
    39 </conbody></concept>