|
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-089FE9FA-44C8-48D5-A473-9486BF763283" xml:lang="en"><title>Setting |
|
13 properties for button states</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <p>The state-specific properties and the methods used for setting them for |
|
15 the generic button include the following: </p> |
|
16 <table id="GUID-D566BDC2-4D12-4878-8970-2B8BC88550C9"> |
|
17 <tgroup cols="2"><colspec colname="col1" colwidth="0.37*"/><colspec colname="col2" colwidth="1.63*"/> |
|
18 <thead> |
|
19 <row> |
|
20 <entry><p>Property</p></entry> |
|
21 <entry><p>Method in <codeph>CAknButtonState</codeph></p></entry> |
|
22 </row> |
|
23 </thead> |
|
24 <tbody> |
|
25 <row> |
|
26 <entry><p>Text</p></entry> |
|
27 <entry><p><xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknButtonState.html#bcf1d51ebf4177465387f76584078f0c" format="application/java-archive"><codeph>SetTextL()</codeph></xref></p></entry> |
|
28 </row> |
|
29 <row> |
|
30 <entry><p>Icon</p></entry> |
|
31 <entry><ul> |
|
32 <li><p>Dimmed state: <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknButtonState.html#7c0f428eb5b32eea76bc0f103d73c82c" format="application/java-archive"><codeph>SetDimmedIcon()</codeph></xref></p></li> |
|
33 <li><p>Normal state: <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknButtonState.html#440bc20e739fbfe2cfe88ac05dd1935d" format="application/java-archive"><codeph>SetIcon()</codeph></xref></p></li> |
|
34 <li><p>Pressed-down state: <xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknButtonState.html#cfb323f7e74e5f0e2dc04d42a8d9b8a1" format="application/java-archive"><codeph>SetPressedIcon()</codeph></xref></p></li> |
|
35 </ul></entry> |
|
36 </row> |
|
37 <row> |
|
38 <entry><p>Flags</p></entry> |
|
39 <entry><p><xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknButtonState.html#0637dd54230fd8a733261f1803bfeade" format="application/java-archive"><codeph>SetFlags()</codeph></xref></p></entry> |
|
40 </row> |
|
41 <row> |
|
42 <entry><p>Help text</p></entry> |
|
43 <entry><p><xref href="jar:GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6.jar!/html/classCAknButtonState.html#3aa033c14f22fc44efd11e6177249b75" format="application/java-archive"><codeph>SetHelpTextL()</codeph></xref></p></entry> |
|
44 </row> |
|
45 </tbody> |
|
46 </tgroup> |
|
47 </table> |
|
48 <codeblock xml:space="preserve">// Set second state as having latched frame |
|
49 button->State( 1 )->SetFlags( KAknButtonStateHasLatchedFrame ); |
|
50 |
|
51 // Set text and help text to second state |
|
52 HBufC* buttonText = StringLoader::LoadLC( R_MYAPP_BUTTON_TEXT ); |
|
53 HBufC* buttonHelpText = StringLoader::LoadLC( R_MYAPP_BUTTON_HELP_TEXT ); |
|
54 button->State( 1 )->SetTextL( *buttonText ); |
|
55 button->State( 1 )->SetHelpTextL( *buttonHelpText ); |
|
56 CleanupStack::PopAndDestroy( 2 ); // buttonText, buttonHelpText </codeblock> |
|
57 </conbody></concept> |