|
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->HideItem( KButtonId, EFalse, ETrue ); |
|
28 toolbar->HideItem( KButtonId, ETrue, ETrue ); |
|
29 } |
|
30 else |
|
31 { |
|
32 // To undim the item again: |
|
33 // toolbar->SetItemDimmed( KButtonId, EFalse, ETrue ); |
|
34 toolbar->SetItemDimmed( KButtonId, ETrue, ETrue ); |
|
35 } |
|
36 } |
|
37 } |
|
38 </codeblock> |
|
39 </conbody></concept> |