Week 12 contribution of PDK documentation_content. See release notes for details. Fixes Bug 2054, Bug 1583, Bug 381, Bug 390, Bug 463, Bug 1897, Bug 344, Bug 1319, Bug 394, Bug 1520, Bug 1522, Bug 1892"
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License
"Eclipse Public License v1.0" which accompanies this distribution,
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
Nokia Corporation - initial contribution.
Contributors:
-->
<!DOCTYPE concept
PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-089FE9FA-44C8-48D5-A473-9486BF763283" xml:lang="en"><title>Setting
properties for button states</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>The state-specific properties and the methods used for setting them for
the generic button include the following: </p>
<table id="GUID-D566BDC2-4D12-4878-8970-2B8BC88550C9">
<tgroup cols="2"><colspec colname="col1" colwidth="0.37*"/><colspec colname="col2" colwidth="1.63*"/>
<thead>
<row>
<entry><p>Property</p></entry>
<entry><p>Method in <codeph>CAknButtonState</codeph></p></entry>
</row>
</thead>
<tbody>
<row>
<entry><p>Text</p></entry>
<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>
</row>
<row>
<entry><p>Icon</p></entry>
<entry><ul>
<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>
<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>
<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>
</ul></entry>
</row>
<row>
<entry><p>Flags</p></entry>
<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>
</row>
<row>
<entry><p>Help text</p></entry>
<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>
</row>
</tbody>
</tgroup>
</table>
<codeblock xml:space="preserve">// Set second state as having latched frame
button->State( 1 )->SetFlags( KAknButtonStateHasLatchedFrame );
// Set text and help text to second state
HBufC* buttonText = StringLoader::LoadLC( R_MYAPP_BUTTON_TEXT );
HBufC* buttonHelpText = StringLoader::LoadLC( R_MYAPP_BUTTON_HELP_TEXT );
button->State( 1 )->SetTextL( *buttonText );
button->State( 1 )->SetHelpTextL( *buttonHelpText );
CleanupStack::PopAndDestroy( 2 ); // buttonText, buttonHelpText </codeblock>
</conbody></concept>