Symbian3/SDK/Source/GUID-089FE9FA-44C8-48D5-A473-9486BF763283.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?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-&gt;State( 1 )-&gt;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-&gt;State( 1 )-&gt;SetTextL( *buttonText ); 
button-&gt;State( 1 )-&gt;SetHelpTextL( *buttonHelpText ); 
CleanupStack::PopAndDestroy( 2 ); // buttonText, buttonHelpText </codeblock>
</conbody></concept>